-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #120 from marklogic/feature/file-partitions-count
MLE-14304 Can now specify partitions for reading some files
- Loading branch information
Showing
15 changed files
with
154 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
...c/test/java/com/marklogic/newtool/impl/importdata/ImportAggregateXmlFilesOptionsTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.marklogic.newtool.impl.importdata; | ||
|
||
import com.marklogic.newtool.impl.AbstractOptionsTest; | ||
import com.marklogic.spark.Options; | ||
import org.junit.jupiter.api.Test; | ||
|
||
class ImportAggregateXmlFilesOptionsTest extends AbstractOptionsTest { | ||
|
||
@Test | ||
void numPartitions() { | ||
ImportAggregateXmlCommand command = (ImportAggregateXmlCommand) getCommand( | ||
"import_aggregate_xml_files", | ||
"--path", "src/test/resources/xml-file", | ||
"--preview", "10", | ||
"--element", "anything", | ||
"--partitions", "3" | ||
); | ||
|
||
assertOptions(command.getReadParams().makeOptions(), | ||
Options.READ_AGGREGATES_XML_ELEMENT, "anything", | ||
Options.READ_NUM_PARTITIONS, "3" | ||
); | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
...li/src/test/java/com/marklogic/newtool/impl/importdata/ImportArchiveFilesOptionsTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.marklogic.newtool.impl.importdata; | ||
|
||
import com.marklogic.newtool.impl.AbstractOptionsTest; | ||
import com.marklogic.spark.Options; | ||
import org.junit.jupiter.api.Test; | ||
|
||
class ImportArchiveFilesOptionsTest extends AbstractOptionsTest { | ||
|
||
@Test | ||
void numPartitions() { | ||
ImportArchiveFilesCommand command = (ImportArchiveFilesCommand) getCommand( | ||
"import_archive_files", | ||
"--path", "src/test/resources/archive-files", | ||
"--preview", "10", | ||
"--partitions", "18" | ||
); | ||
|
||
assertOptions(command.getReadParams().makeOptions(), | ||
Options.READ_NUM_PARTITIONS, "18" | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
...rc/test/java/com/marklogic/newtool/impl/importdata/ImportMlcpArchiveFilesOptionsTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.marklogic.newtool.impl.importdata; | ||
|
||
import com.marklogic.newtool.impl.AbstractOptionsTest; | ||
import com.marklogic.spark.Options; | ||
import org.junit.jupiter.api.Test; | ||
|
||
class ImportMlcpArchiveFilesOptionsTest extends AbstractOptionsTest { | ||
|
||
@Test | ||
void numPartitions() { | ||
ImportMlcpArchiveFilesCommand command = (ImportMlcpArchiveFilesCommand) getCommand( | ||
"import_mlcp_archive_files", | ||
"--path", "src/test/resources/archive-files", | ||
"--preview", "10", | ||
"--partitions", "7" | ||
); | ||
|
||
assertOptions(command.getReadParams().makeOptions(), | ||
Options.READ_NUM_PARTITIONS, "7" | ||
); | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
...ol-cli/src/test/java/com/marklogic/newtool/impl/importdata/ImportRdfFilesOptionsTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.marklogic.newtool.impl.importdata; | ||
|
||
import com.marklogic.newtool.impl.AbstractOptionsTest; | ||
import com.marklogic.spark.Options; | ||
import org.junit.jupiter.api.Test; | ||
|
||
class ImportRdfFilesOptionsTest extends AbstractOptionsTest { | ||
|
||
@Test | ||
void numPartitions() { | ||
ImportRdfFilesCommand command = (ImportRdfFilesCommand) getCommand( | ||
"import_rdf_files", | ||
"--path", "src/test/resources/rdf", | ||
"--preview", "10", | ||
"--partitions", "4" | ||
); | ||
|
||
assertOptions(command.getReadParams().makeOptions(), | ||
Options.READ_NUM_PARTITIONS, "4" | ||
); | ||
} | ||
} |