Package com.hazelcast.jet.pipeline.file
Class JsonFileFormat<T>
java.lang.Object
com.hazelcast.jet.pipeline.file.JsonFileFormat<T>
- Type Parameters:
T
- type of items a source using this file format will emit
- All Implemented Interfaces:
FileFormat<T>
,Serializable
FileFormat
for the JSON Lines files. See FileFormat.json()
for more details.- Since:
- Jet 4.4
- See Also:
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionclazz()
Returns the class Jet will deserialize data into.boolean
format()
Returns the name of the file format.int
hashCode()
boolean
Specifies if the Json parser should accept json records spanning multiple lines.multiline
(boolean multiline) Specifies if the Json parser should accept json records spanning multiple lines.Specifies class that data will be deserialized into.
-
Field Details
-
FORMAT_JSON
Format ID for JSON.- See Also:
-
-
Method Details
-
withClass
Specifies class that data will be deserialized into. If parameter isnull
data is deserialized intoMap<String, Object>
.- Parameters:
clazz
- type of the object to deserialize JSON into
-
multiline
Specifies if the Json parser should accept json records spanning multiple lines.The parser handles JSON records spanning multiple lines by default, but it prevents reading the file in parallel when using the Hadoop based connector, because the file is split at arbitrary positions.
Set this to false when reading large JSON files using Hadoop connector. Each line in the file must contain exactly one JSON record.
This setting has no effect when Hadoop is not used.
- Parameters:
multiline
- true, if the JSON parser should accept records spanning multiple lines, defaults to true
-
clazz
Returns the class Jet will deserialize data into. Null if not set. -
isMultiline
public boolean isMultiline()Specifies if the Json parser should accept json records spanning multiple lines. -
format
Description copied from interface:FileFormat
Returns the name of the file format. The convention is to use the well-known filename suffix or, if there is none, a short-form name of the format.- Specified by:
format
in interfaceFileFormat<T>
-
equals
-
hashCode
public int hashCode()
-