Skip to content

Commit 265ddc2

Browse files
authored
Merge pull request #1668 from marklogic/release/6.6.1
Merge release/6.6.1 into master
2 parents 917ae8c + 2b6c54f commit 265ddc2

File tree

19 files changed

+393
-162
lines changed

19 files changed

+393
-162
lines changed

Diff for: Jenkinsfile

+16-15
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ def getJava(){
55
return "/home/builder/java/jdk-17.0.2"
66
}else if(env.JAVA_VERSION=="JAVA11"){
77
return "/home/builder/java/jdk-11.0.2"
8-
}else{
8+
}else if(env.JAVA_VERSION=="JAVA21"){
9+
return "/home/builder/java/jdk-21.0.1"
10+
}else{
911
return "/home/builder/java/openjdk-1.8.0-262"
1012
}
1113
}
@@ -195,19 +197,18 @@ pipeline{
195197
}
196198
}
197199

198-
// Can't run these as all the Optic Update tests fail now (as expected) on 11.1.0.
199-
// stage('regressions-11.1.0') {
200-
// when {
201-
// allOf {
202-
// branch 'develop'
203-
// expression {return params.regressions}
204-
// }
205-
// }
206-
// steps {
207-
// runAllTests('Release', '11.1.0', false)
208-
// junit '**/build/**/TEST*.xml'
209-
// }
210-
// }
200+
stage('regressions-11.2.0') {
201+
when {
202+
allOf {
203+
branch 'develop'
204+
expression {return params.regressions}
205+
}
206+
}
207+
steps {
208+
runAllTests('Release', '11.2.0', false)
209+
junit '**/build/**/TEST*.xml'
210+
}
211+
}
211212

212213
stage('regressions-11') {
213214
when {
@@ -247,7 +248,7 @@ pipeline{
247248
junit '**/build/**/TEST*.xml'
248249
}
249250
}
250-
251+
251252
stage('regressions-10.0') {
252253
when {
253254
allOf {

Diff for: gradle.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
group=com.marklogic
2-
version=6.6.0
2+
version=6.6.1
33
describedName=MarkLogic Java Client API
44
publishUrl=file:../marklogic-java/releases
55

Diff for: gradle/wrapper/gradle-wrapper.properties

+1-1
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-7.6.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

Diff for: marklogic-client-api-functionaltests/build.gradle

+6
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ dependencies {
2929
implementation "org.jdom:jdom2:2.0.6.1"
3030
implementation "com.marklogic:ml-app-deployer:4.6.1"
3131

32+
if (JavaVersion.current().isJava9Compatible()) {
33+
implementation 'javax.xml.bind:jaxb-api:2.3.1'
34+
implementation 'org.glassfish.jaxb:jaxb-runtime:2.3.8'
35+
implementation 'org.glassfish.jaxb:jaxb-core:2.3.0.1'
36+
}
37+
3238
testImplementation 'ch.qos.logback:logback-classic:1.3.14'
3339
testImplementation 'org.junit.jupiter:junit-jupiter:5.10.1'
3440
testImplementation 'org.xmlunit:xmlunit-legacy:2.9.0'

Diff for: marklogic-client-api-functionaltests/src/test/java/com/marklogic/client/fastfunctest/TestAppServerConstraints.java

+5-20
Original file line numberDiff line numberDiff line change
@@ -445,10 +445,7 @@ public void testNegativePointInvalidValue() throws Exception {
445445
result = e.getMessage();
446446
}
447447

448-
String expectedResult = markLogicVersion.getMajor() <= 11 ?
449-
"<search:warning id=\"SEARCH-IGNOREDQTEXT\">[Invalid text, cannot parse geospatial point from '12,A'.]</search:warning>" :
450-
"arg2 is not of type xs:double";
451-
448+
String expectedResult = "<search:warning id=\"SEARCH-IGNOREDQTEXT\">[Invalid text, cannot parse geospatial point from '12,A'.]</search:warning>";
452449
assertTrue(result.contains(expectedResult), "Unexpected result: " + result);
453450
}
454451

@@ -626,14 +623,8 @@ public void testNegativePointInvalidValue_ChildConstraint() throws Exception {
626623
result = ex.getMessage();
627624
}
628625

629-
String expectedResult = markLogicVersion.getMajor() <= 11 ?
630-
"<search:warning id=\"SEARCH-IGNOREDQTEXT\">[Invalid text, cannot parse geospatial point from '12,A'.]</search:warning>" :
631-
"arg2 is not of type xs:double";
632-
633-
assertTrue(
634-
result.contains(expectedResult),
635-
"Unexpected result: " + result
636-
);
626+
String expectedResult = "<search:warning id=\"SEARCH-IGNOREDQTEXT\">[Invalid text, cannot parse geospatial point from '12,A'.]</search:warning>";
627+
assertTrue(result.contains(expectedResult), "Unexpected result: " + result);
637628
}
638629

639630
@Test
@@ -820,10 +811,7 @@ public void testNegativePointInvalidValue_GeoElementConstraint() throws Exceptio
820811
result = e.getMessage();
821812
}
822813

823-
String expectedResult = markLogicVersion.getMajor() <= 11 ?
824-
"<search:warning id=\"SEARCH-IGNOREDQTEXT\">[Invalid text, cannot parse geospatial point from '12,A'.]</search:warning>" :
825-
"arg2 is not of type xs:double";
826-
814+
String expectedResult = "<search:warning id=\"SEARCH-IGNOREDQTEXT\">[Invalid text, cannot parse geospatial point from '12,A'.]</search:warning>";
827815
assertTrue(result.contains(expectedResult), "Unexpected result: " + result);
828816
}
829817

@@ -1012,10 +1000,7 @@ public void testNegativePointInvalidValue_GeoElemPairConstraint() throws Excepti
10121000
result = e.getMessage();
10131001
}
10141002

1015-
String expectedResult = markLogicVersion.getMajor() <= 11 ?
1016-
"<search:warning id=\"SEARCH-IGNOREDQTEXT\">[Invalid text, cannot parse geospatial point from '-12,A'.]</search:warning>" :
1017-
"arg2 is not of type xs:double";
1018-
1003+
String expectedResult = "<search:warning id=\"SEARCH-IGNOREDQTEXT\">[Invalid text, cannot parse geospatial point from '-12,A'.]</search:warning>";
10191004
assertTrue(result.contains(expectedResult), "Unexpected result: " + result);
10201005
}
10211006

Diff for: marklogic-client-api-functionaltests/src/test/java/com/marklogic/client/fastfunctest/TestOpticOnViews.java

+3-6
Original file line numberDiff line numberDiff line change
@@ -2213,10 +2213,7 @@ public void testFromSqlUnionSelectOrderbyLimitOffset() {
22132213
.orderBy(op.desc("id"))
22142214
.limit(3)
22152215
.offset(1)
2216-
// This is no longer working on MarkLogic 12 nightly. Neither op.col("name") works now op.schemaCol("opticFunctionalTest.detail.name").
2217-
// We get an error of "Invalid arguments: expression column myName with undefined expression".
2218-
//.select(p.as("myName", p.col("name")))
2219-
;
2216+
.select(op.as("myName", op.col("name")));
22202217

22212218
JacksonHandle jacksonHandle = new JacksonHandle();
22222219
jacksonHandle.setMimetype("application/json");
@@ -2225,8 +2222,8 @@ public void testFromSqlUnionSelectOrderbyLimitOffset() {
22252222
JsonNode rows = result.path("rows");
22262223

22272224
assertEquals(2, rows.size());
2228-
assertEquals("Detail 5", rows.path(0).path("opticFunctionalTest.detail.name").path("value").asText());
2229-
assertEquals("Detail 4", rows.path(1).path("opticFunctionalTest.detail.name").path("value").asText());
2225+
assertEquals("Detail 5", rows.path(0).path("myName").path("value").asText());
2226+
assertEquals("Detail 4", rows.path(1).path("myName").path("value").asText());
22302227
}
22312228

22322229

Diff for: marklogic-client-api-functionaltests/src/test/java/com/marklogic/client/fastfunctest/datamovement/QueryBatcherJobReportTest.java

+2-16
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
import org.slf4j.LoggerFactory;
3838

3939
import java.io.File;
40-
import java.io.IOException;
4140
import java.util.*;
4241
import java.util.concurrent.TimeUnit;
4342
import java.util.concurrent.atomic.AtomicBoolean;
@@ -189,10 +188,9 @@ public void jobReport() throws Exception {
189188
}
190189

191190
@Test
192-
public void testNullQdef() throws IOException, InterruptedException {
191+
public void testNullQdef() {
193192
System.out.println("In testNullQdef method");
194193
JsonNode node = null;
195-
JacksonHandle jacksonHandle = null;
196194

197195
WriteBatcher wbatcher = dmManager.newWriteBatcher().withBatchSize(32).withThreadCount(20);
198196
try {
@@ -203,19 +201,7 @@ public void testNullQdef() throws IOException, InterruptedException {
203201
}
204202

205203
try {
206-
wbatcher.add("/nulldoc", jacksonHandle);
207-
fail("Exception was not thrown, when it should have been");
208-
} catch (IllegalArgumentException e) {
209-
assertTrue(e.getMessage().equals("contentHandle must not be null"));
210-
}
211-
212-
QueryManager queryMgr = dbClient.newQueryManager();
213-
StringQueryDefinition querydef = queryMgr.newStringDefinition();
214-
215-
querydef = null;
216-
217-
try {
218-
QueryBatcher batcher = dmManager.newQueryBatcher(querydef).withBatchSize(32).withThreadCount(20);
204+
dmManager.newQueryBatcher((StringQueryDefinition) null).withBatchSize(32).withThreadCount(20);
219205
fail("Exception was not thrown, when it should have been");
220206
} catch (IllegalArgumentException e) {
221207
assertTrue(e.getMessage().equals("query must not be null"));

Diff for: marklogic-client-api/build.gradle

+4-46
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
plugins {
44
id 'maven-publish'
5-
id 'distribution'
65
}
76

87
group = 'com.marklogic'
@@ -81,7 +80,7 @@ jar {
8180
)
8281
}
8382
task sourcesJar(type: Jar) {
84-
classifier = 'sources'
83+
archiveClassifier = 'sources'
8584
exclude ('property', '*.xsd', '*.xjb')
8685
from sourceSets.main.allSource
8786
}
@@ -109,9 +108,9 @@ javadoc {
109108
}
110109
}
111110

112-
task javadocJar (type: Jar, dependsOn: javadoc) {
113-
classifier = 'javadoc'
114-
from javadoc.destinationDir
111+
task javadocJar(type: Jar, dependsOn: javadoc) {
112+
archiveClassifier = 'javadoc'
113+
from javadoc.destinationDir
115114
}
116115

117116
Node pomCustomizations = new NodeBuilder(). project {
@@ -180,47 +179,6 @@ publishing {
180179
}
181180
}
182181

183-
distZip {
184-
archiveFileName = "$project.name-$rootProject.version-with-dependencies.zip"
185-
dependsOn javadoc
186-
}
187-
188-
distributions {
189-
main {
190-
contents {
191-
from("..") {
192-
include("NOTICE.TXT")
193-
}
194-
from("src/main/resources") {
195-
include ("Readme.txt")
196-
include ("LICENSE.txt")
197-
}
198-
into ("example") {
199-
from ("../examples/src/main/resources") {
200-
include ("data/**")
201-
include ("scripts/**")
202-
include ("Example.properties")
203-
}
204-
from ("../examples/src/main/resources/example") {
205-
include ("README.txt")
206-
}
207-
from ("../examples/src/main/java/") {
208-
include ("com/marklogic/client/example/cookbook/*.java")
209-
include ("com/marklogic/client/example/handle/*.java")
210-
include ("com/marklogic/client/example/extension/*.java")
211-
}
212-
}
213-
into ("doc/api") {
214-
from ("build/docs/javadoc")
215-
}
216-
into("lib") {
217-
from jar
218-
from(project.configurations.runtimeClasspath)
219-
}
220-
}
221-
}
222-
}
223-
224182
task printClassPath() {
225183
doLast {
226184
println sourceSets.main.runtimeClasspath.asPath+':'+sourceSets.test.runtimeClasspath.asPath

Diff for: marklogic-client-api/src/main/java/com/marklogic/client/datamovement/impl/BatcherImpl.java

+24-5
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,16 @@
1717

1818
import com.marklogic.client.DatabaseClient;
1919
import com.marklogic.client.datamovement.*;
20+
import org.slf4j.Logger;
21+
import org.slf4j.LoggerFactory;
2022

2123
import java.util.*;
2224
import java.util.concurrent.atomic.AtomicBoolean;
2325

2426
public abstract class BatcherImpl implements Batcher {
27+
28+
private final Logger logger = LoggerFactory.getLogger(getClass());
29+
2530
private String jobName = "unnamed";
2631
private String jobId = null;
2732
private int batchSize = 100;
@@ -31,6 +36,7 @@ public abstract class BatcherImpl implements Batcher {
3136
private JobTicket jobTicket;
3237
private Calendar jobStartTime;
3338
private Calendar jobEndTime;
39+
3440
private final AtomicBoolean stopped = new AtomicBoolean(false);
3541
private final AtomicBoolean started = new AtomicBoolean(false);
3642

@@ -136,19 +142,32 @@ void setJobEndTime() {
136142
this.jobEndTime = Calendar.getInstance();
137143
}
138144

139-
AtomicBoolean getStarted() {
140-
return this.started;
141-
}
142145
@Override
143146
public boolean isStarted() {
144147
return started.get();
145148
}
149+
146150
@Override
147151
public boolean isStopped() {
148152
return stopped.get();
149153
}
150-
AtomicBoolean getStopped() {
151-
return this.stopped;
154+
155+
final void setStartedToTrue() {
156+
logger.info("Setting 'started' to true.");
157+
this.started.set(true);
158+
}
159+
160+
final void setStoppedToTrue() {
161+
logger.info("Setting 'stopped' to true.");
162+
this.stopped.set(true);
163+
}
164+
165+
final boolean isStoppedTrue() {
166+
// This method is necessary as calling "isStopped()" results in different behavior in QueryBatcherImpl, where
167+
// that method has been overridden to inspect the thread pool status instead. It's not clear why that was done,
168+
// so this preserves the existing behavior where the value of `stopped` is check in multiple places (it would seem
169+
// that in all of those places, calling "isStopped()" would be preferable).
170+
return this.stopped.get() == true;
152171
}
153172

154173
protected DataMovementManagerImpl getMoveMgr() {

Diff for: marklogic-client-api/src/main/java/com/marklogic/client/datamovement/impl/DataMovementManagerImpl.java

+2
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,14 @@ public JobReport getJobReport(JobTicket ticket) {
7878
@Override
7979
public void stopJob(JobTicket ticket) {
8080
if ( ticket == null ) throw new IllegalArgumentException("ticket must not be null");
81+
logger.info("Stopping {} job with ID: {}", ticket.getJobType(), ticket.getJobId());
8182
service.stopJob(ticket, activeJobs);
8283
}
8384

8485
@Override
8586
public void stopJob(Batcher batcher) {
8687
if ( batcher == null ) throw new IllegalArgumentException("batcher must not be null");
88+
logger.info("Stopping batcher; job name: {}; job ID: {}", batcher.getJobName(), batcher.getJobId());
8789
service.stopJob(batcher, activeJobs);
8890
}
8991

0 commit comments

Comments
 (0)