Skip to content

Commit 5e59450

Browse files
committed
Merge branch 'release-5.4.0'
2 parents 856432e + 0170eab commit 5e59450

File tree

298 files changed

+36538
-27619
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

298 files changed

+36538
-27619
lines changed

CHANGELOG.md

Lines changed: 287 additions & 278 deletions
Large diffs are not rendered by default.

NOTICE.txt

Lines changed: 7369 additions & 2041 deletions
Large diffs are not rendered by default.

build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ subprojects {
2525
}
2626

2727
dependencies {
28-
testCompile group: 'junit', name: 'junit', version:'4.13'
29-
testCompile group: 'xmlunit', name: 'xmlunit', version:'1.6'
28+
testImplementation group: 'junit', name: 'junit', version:'4.13'
29+
testImplementation group: 'xmlunit', name: 'xmlunit', version:'1.6'
3030
compileOnly group: 'org.apache.commons', name: 'commons-lang3', version:'3.10'
3131
compileOnly group: 'org.apache.httpcomponents', name: 'httpclient', version:'4.5.12'
3232
}
@@ -37,6 +37,6 @@ subprojects {
3737
}
3838
}
3939

40-
task wrapper(type: Wrapper) {
41-
gradleVersion = '4.10.2'
40+
task gradleWrapper(type: Wrapper) {
41+
gradleVersion = '6.7'
4242
}

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
group=com.marklogic
2-
version=5.3.2
3-
releaseVersion=5.3.2
2+
version=5.4.0
3+
releaseVersion=5.4.0
44
describedName=MarkLogic Java Client API
55
publishUrl=file:../marklogic-java/releases

gradle/wrapper/gradle-wrapper.jar

-556 Bytes
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

gradlew

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
#!/usr/bin/env sh
22

3+
#
4+
# Copyright 2015 the original author or authors.
5+
#
6+
# Licensed under the Apache License, Version 2.0 (the "License");
7+
# you may not use this file except in compliance with the License.
8+
# You may obtain a copy of the License at
9+
#
10+
# https://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
#
18+
319
##############################################################################
420
##
521
## Gradle start up script for UN*X
@@ -28,7 +44,7 @@ APP_NAME="Gradle"
2844
APP_BASE_NAME=`basename "$0"`
2945

3046
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31-
DEFAULT_JVM_OPTS=""
47+
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
3248

3349
# Use the maximum available, or set MAX_FD != -1 to use that value.
3450
MAX_FD="maximum"
@@ -109,8 +125,8 @@ if $darwin; then
109125
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
110126
fi
111127

112-
# For Cygwin, switch paths to Windows format before running java
113-
if $cygwin ; then
128+
# For Cygwin or MSYS, switch paths to Windows format before running java
129+
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
114130
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
115131
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
116132
JAVACMD=`cygpath --unix "$JAVACMD"`

gradlew.bat

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
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+
117
@if "%DEBUG%" == "" @echo off
218
@rem ##########################################################################
319
@rem
@@ -14,7 +30,7 @@ set APP_BASE_NAME=%~n0
1430
set APP_HOME=%DIRNAME%
1531

1632
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17-
set DEFAULT_JVM_OPTS=
33+
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
1834

1935
@rem Find java.exe
2036
if defined JAVA_HOME goto findJavaFromJavaHome
Lines changed: 41 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,41 @@
1-
test {
2-
testLogging{
3-
events 'started','passed', 'skipped'
4-
}
5-
/* For use in testing TestDatabaseClientKerberosFromFile */
6-
systemProperty "keytabFile", System.getProperty("keytabFile")
7-
systemProperty "principal", System.getProperty("principal")
8-
9-
exclude 'com/marklogic/client/functionaltest/TestSSLConnection.class'
10-
exclude 'com/marklogic/client/functionaltest/TestBug18993.class'
11-
exclude 'com/marklogic/client/functionaltest/TestDatabaseClientWithKerberos.class'
12-
exclude 'com/marklogic/client/functionaltest/TestDatabaseClientKerberosFromFile.class'
13-
exclude 'com/marklogic/client/functionaltest/TestDatabaseClientWithCertBasedAuth.class'
14-
exclude 'com/marklogic/client/functionaltest/TestSandBox.class'
15-
}
16-
17-
/* The minimal number of tests that run in a sandbox environment */
18-
19-
task testSandbox(type:Test) {
20-
include 'com/marklogic/client/functionaltest/TestSandBox.class'
21-
}
22-
23-
/* The code repositories to consult for dependencies */
24-
25-
repositories {
26-
maven {url "http://distro.marklogic.com/nexus/repository/maven-snapshots" }
27-
maven { url "http://developer.marklogic.com/maven2" }
28-
}
29-
30-
dependencies {
31-
compile project (':marklogic-client-api')
32-
compile group: 'org.skyscreamer', name: 'jsonassert', version: '1.5.0'
33-
compile group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.11.0'
34-
compile group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.11.0'
35-
compile group: 'org.slf4j', name: 'slf4j-api', version:'1.7.25'
36-
testCompile group: 'ch.qos.logback', name: 'logback-classic', version:'1.2.3'
37-
compile group: 'commons-io', name: 'commons-io', version: '2.6'
38-
}
1+
test {
2+
testLogging{
3+
events 'started','passed', 'skipped'
4+
}
5+
/* For use in testing TestDatabaseClientKerberosFromFile */
6+
systemProperty "keytabFile", System.getProperty("keytabFile")
7+
systemProperty "principal", System.getProperty("principal")
8+
9+
exclude 'com/marklogic/client/functionaltest/TestSSLConnection.class'
10+
exclude 'com/marklogic/client/functionaltest/TestBug18993.class'
11+
exclude 'com/marklogic/client/functionaltest/TestDatabaseClientWithKerberos.class'
12+
exclude 'com/marklogic/client/functionaltest/TestDatabaseClientKerberosFromFile.class'
13+
exclude 'com/marklogic/client/functionaltest/TestDatabaseClientWithCertBasedAuth.class'
14+
exclude 'com/marklogic/client/functionaltest/TestSandBox.class'
15+
}
16+
17+
/* The minimal number of tests that run in a sandbox environment */
18+
19+
task testSandbox(type:Test) {
20+
include 'com/marklogic/client/functionaltest/TestSandBox.class'
21+
}
22+
23+
/* The code repositories to consult for dependencies */
24+
25+
repositories {
26+
maven {url "http://distro.marklogic.com/nexus/repository/maven-snapshots" }
27+
maven { url "http://developer.marklogic.com/maven2" }
28+
}
29+
30+
dependencies {
31+
implementation project (':marklogic-client-api')
32+
implementation group: 'org.skyscreamer', name: 'jsonassert', version: '1.5.0'
33+
implementation group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.11.0'
34+
implementation group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.11.0'
35+
implementation group: 'org.slf4j', name: 'slf4j-api', version:'1.7.25'
36+
testImplementation group: 'ch.qos.logback', name: 'logback-classic', version:'1.2.3'
37+
implementation group: 'commons-io', name: 'commons-io', version: '2.6'
38+
implementation group: 'com.squareup.okhttp3', name: 'okhttp', version:'4.7.2'
39+
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-core', version:'2.11.1'
40+
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version:'2.11.1'
41+
}

marklogic-client-api-functionaltests/src/test/java/com/marklogic/client/datamovement/functionaltests/DeleteListenerTest.java

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -183,18 +183,17 @@ public void tearDown() throws Exception {
183183

184184
@Test
185185
public void massDeleteSingleThread() throws Exception {
186-
Set<String> uriSet = new HashSet<>();
186+
HashSet<String> urisList = new HashSet<>();
187187

188-
Assert.assertTrue(uriSet.isEmpty());
188+
Assert.assertTrue(urisList.isEmpty());
189189
Assert.assertTrue(dbClient.newServerEval().xquery(query1).eval().next().getNumber().intValue() == 2000);
190190

191191
QueryBatcher queryBatcher = dmManager.newQueryBatcher(new StructuredQueryBuilder().collection("DeleteListener"))
192-
.withBatchSize(11)
193-
.withThreadCount(1)
192+
.withBatchSize(11, 1)
193+
//.withThreadCount(1)
194194
.onUrisReady(batch -> {
195-
for (String s : batch.getItems()) {
196-
uriSet.add(s);
197-
195+
synchronized (this) {
196+
urisList.addAll(Arrays.asList(batch.getItems()));
198197
}
199198
})
200199
.onQueryFailure(throwable -> {
@@ -208,13 +207,13 @@ public void massDeleteSingleThread() throws Exception {
208207
dmManager.stopJob(ticket);
209208

210209
Thread.currentThread().sleep(2000L);
211-
Assert.assertTrue(uriSet.size() == 2000);
210+
Assert.assertTrue(urisList.size() == 2000);
212211

213212
AtomicInteger successDocs = new AtomicInteger();
214213
HashSet<String> uris2 = new HashSet<>();
215214
StringBuffer failures2 = new StringBuffer();
216215

217-
QueryBatcher deleteBatcher = dmManager.newQueryBatcher(uriSet.iterator())
216+
QueryBatcher deleteBatcher = dmManager.newQueryBatcher(urisList.iterator())
218217
.withBatchSize(23)
219218
.withThreadCount(1)
220219
.onUrisReady(new DeleteListener())
@@ -365,7 +364,7 @@ public void run() {
365364
Thread t1;
366365
t1 = new Thread(new MyRunnable());
367366

368-
HashSet<String> urisList = new HashSet<>();
367+
Set<String> urisList = Collections.synchronizedSet(new HashSet<>());
369368

370369
QueryBatcher queryBatcher = dmManager.newQueryBatcher(
371370
new StructuredQueryBuilder().collection("DeleteListener"))
@@ -392,7 +391,7 @@ public void run() {
392391

393392
System.out.println("URI's size " + urisList.size());
394393
AtomicInteger successDocs = new AtomicInteger();
395-
HashSet<String> uris2 = new HashSet<>();
394+
Set<String> uris2 = Collections.synchronizedSet(new HashSet<>());
396395
StringBuffer failures2 = new StringBuffer();
397396

398397
QueryBatcher deleteBatcher = dmManager.newQueryBatcher(urisList.iterator())
@@ -645,7 +644,7 @@ public void deleteOnDiskUris() throws Exception {
645644

646645
public ArrayList<String> getUris() {
647646

648-
Set<String> uris = new HashSet<>();
647+
Set<String> uris = Collections.synchronizedSet(new HashSet<>());
649648

650649
QueryBatcher getUris = dmManager.newQueryBatcher(new StructuredQueryBuilder().collection("DeleteListener"))
651650
.withBatchSize(5000)
@@ -658,7 +657,7 @@ public ArrayList<String> getUris() {
658657
}
659658

660659
public ArrayList<String> writeUrisToDisk() throws IOException {
661-
Set<String> uris = new HashSet<>();
660+
Set<String> uris = Collections.synchronizedSet(new HashSet<>());
662661

663662
FileWriter writer = new FileWriter("uriCache.txt");
664663
QueryBatcher getUris = dmManager.newQueryBatcher(new StructuredQueryBuilder().collection("DeleteListener"))

0 commit comments

Comments
 (0)