I am running a gradle task
gradlew -b import.gradle copy_taskName -PinputHost="Host1" -PoutputHost="Host2" -Pduration=1 --stacktrace
In import.gradle , there is a mlcp task, where we are passing a taskName.json(where all the query are written in json format to fetch the data from input host) in query_filter
field.
While running the task, I am getting:
Caused by: java.io.IOException: Cannot run program "C:\Program Files\Java\jdk1.8.0_211\bin\java.exe" (in directory "D:\Data1"): CreateProcess error=206, The filename or extension is too long at net.rubygrapefruit.platform.internal.DefaultProcessLauncher.start(DefaultProcessLauncher.java:25) ... 5 more Caused by: java.io.IOException: CreateProcess error=206, The filename or extension is too long ... 6 more
When I removed some query from taskName.json, I am not getting any issue.
I want to know, are there any constraints over size or number of queries written in taskName.json that we should have to pass in query_filter
parameter to run the mlcp task?
total no of line of query content in taskName.json is 398
taskName.json file content sample
{
"andQuery": {
"queries": [{
"collectionQuery": {
"uris": ["collection1"]
}
},
{
"orQuery": {
"queries": [
{
"elementValueQuery": {
"element": ["{http://namespace.com/a/b}id"],
"text": ["text1"],
"options": ["lang=en"]
}
},
{
"elementValueQuery": {
"element": ["{http://namespace.com/a/b}id"],
"text": ["text2"],
"options": ["lang=en"]
}
}]
}
},
{
"notQuery": {
"query": {
"elementRangeQuery": {
"element": ["{http://namespace.com/a/b}date"],
"operator": ">",
"value": [{
"type": "dateTime",
"val": "%%now%%"
}]
}
}
}
}]
}
}
import.gradle
def importDirs = new File("./teams").listFiles()
importDirs.each { importDir ->
def queries = importDir.listFiles()
queries.each { file ->
def taskname = importDir.name + "_" +file.name.replace('.json', '')
task "copy_$taskname" (
type: com.marklogic.gradle.task.MlcpTask,
group: 'abc',
dependsOn: []) {
classpath = configurations.mlcp
command = 'COPY'
input_database = mlAppConfig.contentDatabaseName
input_host = inputHost
input_port = port
input_username = inputUsername
input_password = inputPassword
output_database = mlAppConfig.contentDatabaseName
output_host = outputHost
output_port = port
output_username = outputUsername
output_password = outputPassword
query_filter = file.text.replaceAll('"','\\\\"').replaceAll('%%now%%', now).replaceAll('%%targetDate%%', targetDate)
max_split_size = 500
}
}
}