Splitter<JacksonHandle>
public class JacksonCSVSplitter extends java.lang.Object implements Splitter<JacksonHandle>
Modifier and Type | Class | Description |
---|---|---|
static interface |
JacksonCSVSplitter.UriMaker |
UriMaker which generates URI for each split
file
|
Constructor | Description |
---|---|
JacksonCSVSplitter() |
Modifier and Type | Method | Description |
---|---|---|
long |
getCount() |
The number of JsonNodes found so far.
|
com.fasterxml.jackson.dataformat.csv.CsvMapper |
getCsvMapper() |
The CsvMapper configured for the current
instance.
|
com.fasterxml.jackson.dataformat.csv.CsvSchema |
getCsvSchema() |
The CsvSchema configured for the current
instance.
|
com.fasterxml.jackson.databind.node.ArrayNode |
getHeaders() |
The headers of the csv file.
|
JacksonCSVSplitter.UriMaker |
getUriMaker() |
Get the UriMaker of the splitter
|
void |
setUriMaker(JacksonCSVSplitter.UriMaker uriMaker) |
Set the UriMaker to the splitter
|
java.util.stream.Stream<JacksonHandle> |
split(java.io.InputStream input) |
Takes the input stream and converts it into a
stream of JacksonHandle by setting the schema and wrapping the
JsonNode into JacksonHandle.
|
java.util.stream.Stream<JacksonHandle> |
split(java.io.Reader input) |
Takes the input stream and converts it into a
stream of JacksonHandle by setting the schema and wrapping the
JsonNode into JacksonHandle.
|
java.util.stream.Stream<DocumentWriteOperation> |
splitWriteOperations(java.io.InputStream input) |
Takes the input stream and converts it into a
stream of DocumentWriteOperation by setting the schema and wrapping
the JsonNode into DocumentWriteOperation.
|
java.util.stream.Stream<DocumentWriteOperation> |
splitWriteOperations(java.io.InputStream input,
java.lang.String splitFilename) |
Takes the input stream and the input name, then
converts the input into a stream of DocumentWriteOperation by
setting the schema and wrapping the JsonNode into
DocumentWriteOperation.
|
java.util.stream.Stream<DocumentWriteOperation> |
splitWriteOperations(java.io.Reader input) |
Takes the input Reader and converts it into a
stream of DocumentWriteOperation by setting the schema and wrapping
the JsonNode into DocumentWriteOperation.
|
java.util.stream.Stream<DocumentWriteOperation> |
splitWriteOperations(java.io.Reader input,
java.lang.String splitFilename) |
Takes the input Reader and the input name, then
converts the input Reader into a stream of DocumentWriteOperation
by setting the schema and wrapping the JsonNode into
DocumentWriteOperation.
|
JacksonCSVSplitter |
withCsvMapper(com.fasterxml.jackson.dataformat.csv.CsvMapper mapper) |
Used to set the CsvMapper for the current
instance.
|
JacksonCSVSplitter |
withCsvSchema(com.fasterxml.jackson.dataformat.csv.CsvSchema schema) |
Used to set the CsvSchema for the current
instance.
|
public com.fasterxml.jackson.dataformat.csv.CsvMapper getCsvMapper()
public JacksonCSVSplitter withCsvSchema(com.fasterxml.jackson.dataformat.csv.CsvSchema schema)
schema
- is the CsvSchema passed in.public JacksonCSVSplitter withCsvMapper(com.fasterxml.jackson.dataformat.csv.CsvMapper mapper)
mapper
- is the CsvMapper passed in.public com.fasterxml.jackson.dataformat.csv.CsvSchema getCsvSchema()
public java.util.stream.Stream<JacksonHandle> split(java.io.InputStream input) throws java.io.IOException
split
in interface Splitter<JacksonHandle>
input
- the input stream passed in.java.io.IOException
- if the input cannot be
splitpublic java.util.stream.Stream<JacksonHandle> split(java.io.Reader input) throws java.io.IOException
input
- the Reader stream passed in.java.io.IOException
- if the input cannot be
splitpublic java.util.stream.Stream<DocumentWriteOperation> splitWriteOperations(java.io.InputStream input) throws java.lang.Exception
splitWriteOperations
in
interface Splitter<JacksonHandle>
input
- is the incoming input stream.java.lang.Exception
- if the input cannot be
splitpublic java.util.stream.Stream<DocumentWriteOperation> splitWriteOperations(java.io.InputStream input, java.lang.String splitFilename) throws java.lang.Exception
splitWriteOperations
in
interface Splitter<JacksonHandle>
input
- is the incoming input stream.splitFilename
- the name of the input stream,
including name and extension. It is used to generate URLs for split
files.The splitFilename could either be provided here or in
user-defined UriMaker.java.lang.Exception
- if the input cannot be
splitpublic java.util.stream.Stream<DocumentWriteOperation> splitWriteOperations(java.io.Reader input) throws java.lang.Exception
input
- is the incoming input Reader.java.lang.Exception
- if the input cannot be
splitpublic java.util.stream.Stream<DocumentWriteOperation> splitWriteOperations(java.io.Reader input, java.lang.String splitFilename) throws java.lang.Exception
input
- is the incoming input Reader.splitFilename
- the name of the input Reader,
including name and extension. It is used to generate URLs for split
files.The splitFilename could either be provided here or in
user-defined UriMaker.java.lang.Exception
- if the input cannot be
splitpublic long getCount()
getCount
in interface Splitter<JacksonHandle>
public com.fasterxml.jackson.databind.node.ArrayNode getHeaders()
public JacksonCSVSplitter.UriMaker getUriMaker()
public void setUriMaker(JacksonCSVSplitter.UriMaker uriMaker)
uriMaker
- the uriMaker to generate URI of each
split file.Copyright © 2022 MarkLogic Corporation