Comments (3)
We used to throw an exception if the number of URIs exceeded the URIs count, but rather than IllegalStateException
it was an ArrayIndexOutOfBounds
:
if (count >= urisArray.length) {
throw new ArrayIndexOutOfBoundsException("received more than " + total + " results: " + uri);
}
We could override the ArrayQueue.add()
and change the behavior. If the capacity is exceeded, should we catch the IllegalStateException and then:
- log a WARNING or ERROR
- keep processing (without throwing) ignore that URI and subsequent URIs? Only processing up to the count that was specified?
Or, log the warning and instantiate a new larger Array? That could get expensive/slow depending on whether we grow incrementally, or by some percentage, and if we were to go down that route, we should consider just using an ArrayList instead of Array, or maybe create an ArrayListQueue?
from corb2.
Actually, it looks as if we expected to be able to catch when the number of URIs exceeded the count in the QueryUrisLoader, but are using queue.add()
https://github.com/marklogic/corb2/blob/master/src/main/java/com/marklogic/developer/corb/QueryUrisLoader.java#L169
and should instead be using queue.offer()
I'll take a look and do some testing.
from corb2.
Thanks Mads! Regarding your first question, I am a little unsure about whether to increase (expensive) the array size with a warning or fail with a proper error (and a non-zero exit code). Though it offers flexibility, we may not want to cover up the mistake from the developers. However, if we do allow it, should we opt for having little bit of internal buffer (few extra spaces for few additional elements) rather than unlimited array size adjustments?
We still want to adjust to lesser value as we can get less number of uris when there are empty strings in between.
from corb2.
Related Issues (20)
- Automatically use ExportBatchToFileTask when setting EXPORT-FILE-NAME
- Update SSL config to use TLSv1.2 HOT 3
- Issues running Corb via AppServicesPort HOT 5
- SchemaValidateBatchToFileTask not appending content, overwriting with last item
- Better diagnostics for easily detectable developer errors in QueryUrisLoader
- Corb runs selector even when the job is started with COMMAND=STOP
- Option UseConcMarkSweepGC deprecated
- QueryUrisLoader uses Integer.parseInt to obtain total count
- mangled output when default character encoding is not UTF-8
- Job server web page should update after the job completes HOT 2
- CORB running mjs modules issue HOT 1
- Adjustments for Java 11+ and deprecated JAXB javax.xml.bind package HOT 1
- Require PROCESS-MODULE to be set when using Export*ToFileTask
- TLS certificate failing to connect (but the same cert works fine with MLCP) HOT 4
- Suggestion: add deprecated bind libraries to build.gradle HOT 1
- Support external header (and footer) for Module Executor
- expose Manager execError with hasExecError() method
- improve usage messages
- Illegal base64 character encountered in PrivateKeyDecrypter.doDecrypt for unencrypted values that contain - HOT 1
- OPTIONS_FILE assumes ISO 8859-1 encoding HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from corb2.