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"))

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

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,7 @@
1919
import static org.junit.Assert.assertEquals;
2020
import static org.junit.Assert.assertTrue;
2121

22-
import java.util.ArrayList;
23-
import java.util.HashMap;
24-
import java.util.List;
25-
import java.util.Map;
22+
import java.util.*;
2623

2724
import org.junit.After;
2825
import org.junit.AfterClass;
@@ -139,8 +136,8 @@ public void testPointInTimeQueryDeterministicSet() throws Exception {
139136
changeProperty(props, "/manage/v2/databases/" + dbName + "/properties");
140137
Thread.currentThread().sleep(10000L);
141138

142-
List<String> docExporterList = new ArrayList<String>();
143-
List<String> batcherList2 = new ArrayList<String>();
139+
List<String> docExporterList = Collections.synchronizedList(new ArrayList<String>());
140+
List<String> batcherList2 = Collections.synchronizedList(new ArrayList<String>());
144141

145142
QueryManager queryMgr = dbClient.newQueryManager();
146143
StringQueryDefinition querydef = queryMgr.newStringDefinition();
@@ -225,8 +222,8 @@ public void testWithSnapshots() throws Exception {
225222
changeProperty(props, "/manage/v2/databases/" + dbName + "/properties");
226223
Thread.currentThread().sleep(5000L);
227224

228-
List<String> docExporterList = new ArrayList<String>();
229-
List<String> batcherList = new ArrayList<String>();
225+
List<String> docExporterList = Collections.synchronizedList(new ArrayList<String>());
226+
List<String> batcherList = Collections.synchronizedList(new ArrayList<String>());
230227

231228
QueryManager queryMgr = dbClient.newQueryManager();
232229
StringQueryDefinition querydef = queryMgr.newStringDefinition();
@@ -332,7 +329,7 @@ public void testServerTimestampNoSnapshots() throws Exception {
332329
changeProperty(props, "/manage/v2/databases/" + dbName + "/properties");
333330
Thread.currentThread().sleep(5000L);
334331

335-
List<String> docExporterList = new ArrayList<String>();
332+
List<String> docExporterList = Collections.synchronizedList(new ArrayList<String>());
336333

337334
QueryManager queryMgr = dbClient.newQueryManager();
338335
StringQueryDefinition querydef = queryMgr.newStringDefinition();
@@ -406,7 +403,7 @@ public void testNoSnapshotOnListener() throws Exception {
406403

407404
QueryBatcher exportBatcher = dmManager.newQueryBatcher(querydef)
408405
.withConsistentSnapshot()
409-
.withBatchSize(10)
406+
.withBatchSize(10, 1)
410407
.onUrisReady(exportListener)
411408
.onUrisReady(batch -> {
412409
for (String u : batch.getItems()) {
@@ -441,7 +438,7 @@ public void testNoSnapshotOnListener() throws Exception {
441438

442439
QueryBatcher deleteBatcher = dmManager.newQueryBatcher(querydef)
443440
.withConsistentSnapshot()
444-
.withBatchSize(100)
441+
.withBatchSize(100, 1)
445442
.onUrisReady(new DeleteListener());
446443

447444
dmManager.startJob(deleteBatcher);
@@ -501,7 +498,7 @@ public void testPointInTimeQueryNonDeterministicSet() throws Exception {
501498
);
502499

503500
QueryBatcher exportBatcher = dmManager.newQueryBatcher(querydef)
504-
.withBatchSize(10)
501+
.withBatchSize(10, 1)
505502
.onUrisReady(exportListener)
506503
.onUrisReady(batch -> {
507504
for (String u : batch.getItems()) {
@@ -525,7 +522,7 @@ public void testPointInTimeQueryNonDeterministicSet() throws Exception {
525522

526523
QueryBatcher deleteBatcher = dmManager.newQueryBatcher(querydef)
527524
.withConsistentSnapshot()
528-
.withBatchSize(100)
525+
.withBatchSize(100, 1)
529526
.onUrisReady(new DeleteListener());
530527

531528
dmManager.startJob(deleteBatcher);
@@ -582,7 +579,7 @@ public void testOnBatchFailure() throws Exception {
582579
}
583580
wbatcher.flushAndWait();
584581

585-
List<String> docExporterList = new ArrayList<String>();
582+
List<String> docExporterList = Collections.synchronizedList(new ArrayList<String>());
586583

587584
QueryManager queryMgr = dbClient.newQueryManager();
588585
StringQueryDefinition querydef = queryMgr.newStringDefinition();

0 commit comments

Comments
 (0)