T
- type of items a source using this file format will emitpublic class JsonFileFormat<T> extends Object implements FileFormat<T>
FileFormat
for the JSON Lines files. See FileFormat.json()
for more details.Modifier and Type | Field and Description |
---|---|
static String |
FORMAT_JSON
Format ID for JSON.
|
Modifier and Type | Method and Description |
---|---|
Class<T> |
clazz()
Returns the class Jet will deserialize data into.
|
boolean |
equals(Object o) |
String |
format()
Returns the name of the file format.
|
int |
hashCode() |
boolean |
isMultiline()
Specifies if the Json parser should accept json records spanning
multiple lines.
|
JsonFileFormat<T> |
multiline(boolean multiline)
Specifies if the Json parser should accept json records spanning
multiple lines.
|
JsonFileFormat<T> |
withClass(Class<T> clazz)
Specifies class that data will be deserialized into.
|
public static final String FORMAT_JSON
@Nonnull public JsonFileFormat<T> withClass(@Nullable Class<T> clazz)
null
data is deserialized into
Map<String, Object>
.clazz
- type of the object to deserialize JSON into@Nonnull public JsonFileFormat<T> multiline(boolean multiline)
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.
multiline
- true, if the JSON parser should accept records
spanning multiple lines, defaults to true@Nullable public Class<T> clazz()
public boolean isMultiline()
@Nonnull public String format()
FileFormat
format
in interface FileFormat<T>
Copyright © 2023 Hazelcast, Inc.. All rights reserved.