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

public class JsonFileFormat<T> extends Object implements FileFormat<T>
FileFormat for the JSON Lines files. See FileFormat.json() for more details.
Since:
Jet 4.4
See Also:
  • Field Details

  • Method Details

    • withClass

      @Nonnull public JsonFileFormat<T> withClass(@Nullable Class<T> clazz)
      Specifies class that data will be deserialized into. If parameter is null data is deserialized into Map<String, Object>.
      Parameters:
      clazz - type of the object to deserialize JSON into
    • multiline

      @Nonnull public JsonFileFormat<T> multiline(boolean 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

      @Nullable public Class<T> 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

      @Nonnull public String 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 interface FileFormat<T>
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object