Skip to content

Commit d61fe21

Browse files
committed
COH-31884 VectorDB features usage example
(merge ce/main -> ce/25.03 115096) [git-p4: depot-paths = "//dev/coherence-ce/release/coherence-ce-v25.03/": change = 115097]
1 parent f87334b commit d61fe21

File tree

16 files changed

+1604
-6
lines changed

16 files changed

+1604
-6
lines changed

prj/examples/guides/128-entry-processors/pom.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
3-
~ Copyright (c) 2022, 2024, Oracle and/or its affiliates.
4-
~
5-
~ Licensed under the Universal Permissive License v 1.0 as shown at
6-
~ https://oss.oracle.com/licenses/upl.
3+
Copyright (c) 2000, 2025, Oracle and/or its affiliates.
4+
5+
Licensed under the Universal Permissive License v 1.0 as shown at
6+
https://oss.oracle.com/licenses/upl.
77
-->
88

99
<project xmlns="http://maven.apache.org/POM/4.0.0"
@@ -14,7 +14,7 @@
1414
<groupId>com.oracle.coherence.guides</groupId>
1515
<artifactId>entry-processors</artifactId>
1616
<version>${revision}</version>
17-
<name>Coherence Guides - Views</name>
17+
<name>Coherence Guides - Entry Processors</name>
1818

1919
<properties>
2020
<revision>25.03-SNAPSHOT</revision>

prj/examples/guides/300-vector-store/README.adoc

Lines changed: 367 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*
2+
* Copyright (c) 2000, 2025, Oracle and/or its affiliates.
3+
*
4+
* Licensed under the Universal Permissive License v 1.0 as shown at
5+
* https://oss.oracle.com/licenses/upl.
6+
*/
7+
8+
plugins {
9+
id 'java'
10+
}
11+
12+
group = 'com.oracle.coherence.guides'
13+
version = '${coherenceVersion}'
14+
sourceCompatibility = '17'
15+
16+
repositories {
17+
mavenCentral()
18+
mavenLocal()
19+
}
20+
21+
dependencies {
22+
implementation platform("${coherenceGroupId}:coherence-bom:${coherenceVersion}")
23+
implementation platform("dev.langchain4j:langchain4j-bom:${langChainVersion}")
24+
25+
implementation "${coherenceGroupId}:coherence"
26+
implementation "${coherenceGroupId}:coherence-hnsw"
27+
implementation "${coherenceGroupId}:coherence-json"
28+
implementation "dev.langchain4j:langchain4j"
29+
implementation "dev.langchain4j:langchain4j-document-parser-apache-tika"
30+
implementation "dev.langchain4j:langchain4j-embeddings-all-minilm-l6-v2"
31+
32+
testImplementation "${coherenceGroupId}:coherence-bedrock-testing-support"
33+
testImplementation "org.junit.jupiter:junit-jupiter-api:${junitVersion}"
34+
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:${junitVersion}")
35+
}
36+
37+
test {
38+
useJUnitPlatform()
39+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#
2+
# Copyright (c) 2000, 2025, Oracle and/or its affiliates.
3+
#
4+
# Licensed under the Universal Permissive License v 1.0 as shown at
5+
# https://oss.oracle.com/licenses/upl.
6+
#
7+
8+
# Change this property to the Coherence version you want to use
9+
coherenceVersion=25.03-SNAPSHOT
10+
# The Coherence groupId is com.oracle.coherence.ce for the Community Edition
11+
# or com.oracle.coherence for the Commercial Edition
12+
coherenceGroupId=com.oracle.coherence.ce
13+
14+
langChainVersion=1.0.0-beta1
15+
16+
junitVersion=5.8.2
Binary file not shown.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#
2+
# Copyright (c) 2000, 2025, Oracle and/or its affiliates.
3+
#
4+
# Licensed under the Universal Permissive License v 1.0 as shown at
5+
# https://oss.oracle.com/licenses/upl.
6+
#
7+
8+
distributionBase=GRADLE_USER_HOME
9+
distributionPath=wrapper/dists
10+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
11+
zipStoreBase=GRADLE_USER_HOME
12+
zipStorePath=wrapper/dists
Lines changed: 176 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,176 @@
1+
#!/usr/bin/env sh
2+
3+
#
4+
# Copyright (c) 2000, 2025, Oracle and/or its affiliates.
5+
#
6+
# Licensed under the Universal Permissive License v 1.0 as shown at
7+
# https://oss.oracle.com/licenses/upl.
8+
#
9+
10+
##############################################################################
11+
##
12+
## Gradle start up script for UN*X
13+
##
14+
##############################################################################
15+
16+
# Attempt to set APP_HOME
17+
# Resolve links: $0 may be a link
18+
PRG="$0"
19+
# Need this for relative symlinks.
20+
while [ -h "$PRG" ] ; do
21+
ls=`ls -ld "$PRG"`
22+
link=`expr "$ls" : '.*-> \(.*\)$'`
23+
if expr "$link" : '/.*' > /dev/null; then
24+
PRG="$link"
25+
else
26+
PRG=`dirname "$PRG"`"/$link"
27+
fi
28+
done
29+
SAVED="`pwd`"
30+
cd "`dirname \"$PRG\"`/" >/dev/null
31+
APP_HOME="`pwd -P`"
32+
cd "$SAVED" >/dev/null
33+
34+
APP_NAME="Gradle"
35+
APP_BASE_NAME=`basename "$0"`
36+
37+
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
38+
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
39+
40+
# Use the maximum available, or set MAX_FD != -1 to use that value.
41+
MAX_FD="maximum"
42+
43+
warn () {
44+
echo "$*"
45+
}
46+
47+
die () {
48+
echo
49+
echo "$*"
50+
echo
51+
exit 1
52+
}
53+
54+
# OS specific support (must be 'true' or 'false').
55+
cygwin=false
56+
msys=false
57+
darwin=false
58+
nonstop=false
59+
case "`uname`" in
60+
CYGWIN* )
61+
cygwin=true
62+
;;
63+
Darwin* )
64+
darwin=true
65+
;;
66+
MINGW* )
67+
msys=true
68+
;;
69+
NONSTOP* )
70+
nonstop=true
71+
;;
72+
esac
73+
74+
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
75+
76+
77+
# Determine the Java command to use to start the JVM.
78+
if [ -n "$JAVA_HOME" ] ; then
79+
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
80+
# IBM's JDK on AIX uses strange locations for the executables
81+
JAVACMD="$JAVA_HOME/jre/sh/java"
82+
else
83+
JAVACMD="$JAVA_HOME/bin/java"
84+
fi
85+
if [ ! -x "$JAVACMD" ] ; then
86+
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
87+
88+
Please set the JAVA_HOME variable in your environment to match the
89+
location of your Java installation."
90+
fi
91+
else
92+
JAVACMD="java"
93+
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
94+
95+
Please set the JAVA_HOME variable in your environment to match the
96+
location of your Java installation."
97+
fi
98+
99+
# Increase the maximum file descriptors if we can.
100+
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
101+
MAX_FD_LIMIT=`ulimit -H -n`
102+
if [ $? -eq 0 ] ; then
103+
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
104+
MAX_FD="$MAX_FD_LIMIT"
105+
fi
106+
ulimit -n $MAX_FD
107+
if [ $? -ne 0 ] ; then
108+
warn "Could not set maximum file descriptor limit: $MAX_FD"
109+
fi
110+
else
111+
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
112+
fi
113+
fi
114+
115+
# For Darwin, add options to specify how the application appears in the dock
116+
if $darwin; then
117+
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
118+
fi
119+
120+
# For Cygwin or MSYS, switch paths to Windows format before running java
121+
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
122+
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
123+
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
124+
125+
JAVACMD=`cygpath --unix "$JAVACMD"`
126+
127+
# We build the pattern for arguments to be converted via cygpath
128+
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
129+
SEP=""
130+
for dir in $ROOTDIRSRAW ; do
131+
ROOTDIRS="$ROOTDIRS$SEP$dir"
132+
SEP="|"
133+
done
134+
OURCYGPATTERN="(^($ROOTDIRS))"
135+
# Add a user-defined pattern to the cygpath arguments
136+
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
137+
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
138+
fi
139+
# Now convert the arguments - kludge to limit ourselves to /bin/sh
140+
i=0
141+
for arg in "$@" ; do
142+
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
143+
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
144+
145+
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
146+
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
147+
else
148+
eval `echo args$i`="\"$arg\""
149+
fi
150+
i=`expr $i + 1`
151+
done
152+
case $i in
153+
0) set -- ;;
154+
1) set -- "$args0" ;;
155+
2) set -- "$args0" "$args1" ;;
156+
3) set -- "$args0" "$args1" "$args2" ;;
157+
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
158+
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
159+
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
160+
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
161+
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
162+
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
163+
esac
164+
fi
165+
166+
# Escape application args
167+
save () {
168+
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
169+
echo " "
170+
}
171+
APP_ARGS=`save "$@"`
172+
173+
# Collect all arguments for the java command, following the shell quoting and substitution rules
174+
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
175+
176+
exec "$JAVACMD" "$@"
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
@rem
2+
@rem Copyright 2015 the original author or authors.
3+
@rem
4+
@rem Licensed under the Apache License, Version 2.0 (the "License");
5+
@rem you may not use this file except in compliance with the License.
6+
@rem You may obtain a copy of the License at
7+
@rem
8+
@rem https://www.apache.org/licenses/LICENSE-2.0
9+
@rem
10+
@rem Unless required by applicable law or agreed to in writing, software
11+
@rem distributed under the License is distributed on an "AS IS" BASIS,
12+
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
@rem See the License for the specific language governing permissions and
14+
@rem limitations under the License.
15+
@rem
16+
17+
@if "%DEBUG%" == "" @echo off
18+
@rem ##########################################################################
19+
@rem
20+
@rem Gradle startup script for Windows
21+
@rem
22+
@rem ##########################################################################
23+
24+
@rem Set local scope for the variables with windows NT shell
25+
if "%OS%"=="Windows_NT" setlocal
26+
27+
set DIRNAME=%~dp0
28+
if "%DIRNAME%" == "" set DIRNAME=.
29+
set APP_BASE_NAME=%~n0
30+
set APP_HOME=%DIRNAME%
31+
32+
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
33+
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
34+
35+
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
36+
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
37+
38+
@rem Find java.exe
39+
if defined JAVA_HOME goto findJavaFromJavaHome
40+
41+
set JAVA_EXE=java.exe
42+
%JAVA_EXE% -version >NUL 2>&1
43+
if "%ERRORLEVEL%" == "0" goto execute
44+
45+
echo.
46+
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
47+
echo.
48+
echo Please set the JAVA_HOME variable in your environment to match the
49+
echo location of your Java installation.
50+
51+
goto fail
52+
53+
:findJavaFromJavaHome
54+
set JAVA_HOME=%JAVA_HOME:"=%
55+
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
56+
57+
if exist "%JAVA_EXE%" goto execute
58+
59+
echo.
60+
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
61+
echo.
62+
echo Please set the JAVA_HOME variable in your environment to match the
63+
echo location of your Java installation.
64+
65+
goto fail
66+
67+
:execute
68+
@rem Setup the command line
69+
70+
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
71+
72+
73+
@rem Execute Gradle
74+
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
75+
76+
:end
77+
@rem End local scope for the variables with windows NT shell
78+
if "%ERRORLEVEL%"=="0" goto mainEnd
79+
80+
:fail
81+
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
82+
rem the _cmd.exe /c_ return code!
83+
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
84+
exit /b 1
85+
86+
:mainEnd
87+
if "%OS%"=="Windows_NT" endlocal
88+
89+
:omega

0 commit comments

Comments
 (0)