Comments (8)
Another example for shell usage:
ml.corb().deleteCollection("collection-name")
That would construct a uris query for the given collection, and then a simple process module of "xdmp:document-delete($URI)". That would be very handy for deleting collections that are too large to delete in qconsole, but it's annoying to have to create two modules just to get this done.
from corb2.
Hi Rob,
I am little unclear about URIS-QUERY option. Since we can do URIS-MODULE=my-module.xqy|ADHOC where my-module.xqy stays in local file system (wherever corb is running from, not modules db), I am wondering if this would suffice instead of URIS-QUERY input param.
from corb2.
URIS-MODULE requires that the module exist on the filesystem. URIS-QUERY would allow for the module to be created programmatically and passed in as a string without ever being written to the filesystem. This is useful in allowing corb to be invoked from another program vs having to be invoked from the command line. Ideally, that program could eventually do something like this:
Manager m = new Manager()
m.setConnectionString(...)
m.setUrisQuery("cts:uris(...)")
m.setProcessTask("some.class.name")
m.setThreadCount(4)
m.run()
corb has always been a command-line driven tool, and I think it would increase its usability by developing the above sort of API underneath the command-line interface.
from corb2.
I started adding a new option URIS-QUERY, which is fairly easy. But I couldn't figure out an intuitive way to specify the language i.e., javascript or xquery. If none specified, xcc defaults to xquery. We can come up with two options URIS-QUERY and URIS-QUERY-JAVASCIPT, but I prefer a single option and optionally pass in language as part of the query string definition. Any ideas?
from corb2.
Rob, in case you aren’t familiar with it.. the ModuleExecutor class can be used for single stage transforms like deleting docs within a collection. It was written to replace an old app called runXQuery. It can handle queries written in either XQuery or JavaScript. It’s discussed at the bottom of the readMe.md file.
From: rjrudin [mailto:[email protected]]
Sent: Tuesday, December 22, 2015 11:08 PM
To: marklogic/corb2
Subject: Re: [corb2] Set URIs via an input parameter that is a query (#10)
Another example for shell usage:
ml.corb().deleteCollection("collection-name")
That would construct a uris query for the given collection, and then a simple process module of "xdmp:document-delete($URI)". That would be very handy for deleting collections that are too large to delete in qconsole, but it's annoying to have to create two modules just to get this done.
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/10#issuecomment-166798909.
from corb2.
I don't think ModuleExecutor will address my use case, because it too requires a module either in the database or on the filesystem.
What I'm after is a way to run corb without having to reference a module on the filesystem or in the modules database. That means the uris and transform queries need to be able to be passed in as strings.
from corb2.
Agreed, ModuleExecutor will not solve that issue. My suggestion was to address another issue you mentioned which was having to set up a two stage job when you only needed one.
From: rjrudin [mailto:[email protected]]
Sent: Tuesday, December 29, 2015 4:47 PM
To: marklogic/corb2
Cc: Matt Heckel
Subject: Re: [corb2] Set URIs via an input parameter that is a query (#10)
I don't think ModuleExecutor will address my use case, because it too requires a module either in the database or on the filesystem.
What I'm after is a way to run corb without having to reference a module on the filesystem or in the modules database. That means the uris and transform queries need to be able to be passed in as strings.
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/10#issuecomment-167884706.
from corb2.
I think, we can overload the existing URIS-MODULE, PROCESS-MODULE etc. If the value starts with a specific string such as "INLINE-XQUERY|" or "INLINE-JAVASCRIPT|", then what ever follows after can be read in as an adhoc query. This way, we can keep the code generic to all of the modules.
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.