-
Notifications
You must be signed in to change notification settings - Fork 74
Closed
Description
So we can address your issue, please include the following:
Version of MarkLogic Java Client API
develop
Version of MarkLogic Server
10.0-5 / nightly builds
Java version
Java 8 or 9
OS and version
Windows
Input: Some code to illustrate the problem, preferably in a state that can be independently reproduced on our end
In the snippet we calls to awaitCompletion sequentially, to illustrate the issue.
OutputCaller<InputStream> unloadEndpt = OutputCaller.on(dbclient, new FileHandle(new File(ApiConfigDirPath + JsonEgressConfigName + ".api")), new InputStreamHandle());
IOEndpoint.CallContext callContextArray = unloadEndpt.newCallContext()
.withEndpointStateAs(returnIndex)
.withEndpointConstantsAs(workParams);
OutputCaller.BulkOutputCaller<InputStream> outputBulkCaller = unloadEndpt.bulkCaller(callContextArray);
OutputCaller.BulkOutputCaller.ErrorListener errorListener =
(retryCount, throwable, callContext)
-> IOEndpoint.BulkIOEndpointCaller.ErrorDisposition.SKIP_CALL;
outputBulkCaller.setOutputListener(record -> {
try {
ObjectMapper mapper = new ObjectMapper();
String s = mapper.readValue(record, ObjectNode.class).toString();
batchResults.append(s);
} catch (IOException e) {
err.append(e.getMessage());
e.printStackTrace();
}
}
);
outputBulkCaller.setErrorListener(errorListener);
outputBulkCaller.awaitCompletion();
outputBulkCaller.awaitCompletion();
Actual output: What did you observe? What errors did you see? Can you attach the logs? (Java logs, MarkLogic logs)
java.lang.IllegalStateException: Cannot process output since current phase is COMPLETED
at com.marklogic.client.dataservices.impl.OutputEndpointImpl$BulkOutputCallerImpl.awaitCompletion(OutputEndpointImpl.java:156)
at com.marklogic.client.functionaltest.BulkIOCallersFnTest.TestIngestEgressOnJsonDocs(BulkIOCallersFnTest.java:362)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
Expected output: What specifically did you expect to happen?
java.lang.IllegalStateException: Cannot process output since current phase is COMPLETED message needs to be rephrased to convey what error is.
Alternatives: What else have you tried, actual/expected?
n/a