简体   繁体   中英

MarkLogic Content Pump Java

I am trying to use the MarkLogic content pump from the maven dependency.

I'm struggling to find any documentation on the code. Does anyone have a tutorial they could point me to?

The Using MarkLogic Content Pump chapter of the Loading Content into MarkLogic Guide documents how to work with MLCP. If that doesn't cover what you're looking for, please add more detail to your question.

Found it eventually. What I was looking for was a way to use the mlcp maven dependency. The documentation I did find was mostly on how to use the content pump from command line and I need to use a java process instead.

The following link gave me the examples I needed on how to connect etc http://docs.marklogic.com/guide/java/intro

There is rudimentary maven information available here:

https://developer.marklogic.com/products/mlcp

If you are willing to use gradle, then you could use this in you build.gradle file:

repositories {
  mavenCentral()
  maven {url "http://developer.marklogic.com/maven2/"}
  maven {url "http://repository.cloudera.com/artifactory/cloudera-repos/" }
}

configurations {
  mlcp
}

dependencies {
  mlcp "com.marklogic:mlcp-Hadoop2:1.3-2"
}

task importDocuments(type: JavaExec) {
  main = "com.marklogic.contentpump.ContentPump"
  classpath = configurations.mlcp
  args = ["import",
    "-host", "myhost",
    "-port", "9000",
    "-username", "usn",
    "-password", "pwd",
    "-input_file_type", "documents",
    "-input_file_path", "mypath"]
}

HTH!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM