Skip to content

QueryBatcher hangs if batchSize is not specified #1293

@srinathgit

Description

@srinathgit

So we can address your issue, please include the following:

Version of MarkLogic Java Client API

See Readme.txt
5.4.0

Version of MarkLogic Server

9.0-12
See admin gui on port 8001 or run xdmp:version() in Query Console - port 8000)

Java version

8
Run java -version

OS and version

For MAC, run sw_vers.
For Windows, run systeminfo | findstr /B /C:"OS Name" /C:"OS Version"
For Linux, run cat /etc/os-release and uname -r

Input: Some code to illustrate the problem, preferably in a state that can be independently reproduced on our end

            DataMovementManager dmm = client.newDataMovementManager();
            QueryBatcher queryBatcher = dmm.newQueryBatcher(new StructuredQueryBuilder().collection("collA"))
                //.withBatchSize(100)
                .withThreadCount(1);
            dmm.startJob(queryBatcher);
            queryBatcher.awaitCompletion();
            dmm.stopJob(queryBatcher);

Actual output: What did you observe? What errors did you see? Can you attach the logs? (Java logs, MarkLogic logs)

When we run the above snippet, the following exception is thrown and QB hangs.

Exception in thread "pool-1-thread-1" java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
	at java.util.ArrayList.rangeCheck(ArrayList.java:657)
	at java.util.ArrayList.get(ArrayList.java:433)
	at com.marklogic.client.datamovement.impl.QueryBatcherImpl$QueryTask.run(QueryBatcherImpl.java:775)

Expected output: What specifically did you expect to happen?

Expect QB to return the uris and not hang.

Alternatives: What else have you tried, actual/expected?

Once the batch size is set (uncomment withBatchSize(100) from the snippet), it runs fine. Looks like 'docToUriBatchRatio' becomes zero if batch size is not set.

Metadata

Metadata

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions