Class RecordReaderJsonArray

  • All Implemented Interfaces:
    Closeable, AutoCloseable

    public class RecordReaderJsonArray
    extends RecordReaderGenericBase<com.google.gson.JsonElement,​com.google.gson.JsonElement,​com.google.gson.JsonElement,​com.google.gson.JsonElement>
    • Constructor Detail

      • RecordReaderJsonArray

        public RecordReaderJsonArray()
      • RecordReaderJsonArray

        public RecordReaderJsonArray​(com.google.gson.Gson gson)
      • RecordReaderJsonArray

        public RecordReaderJsonArray​(String minRecordLengthKey,
                                     String maxRecordLengthKey,
                                     String probeRecordCountKey,
                                     Pattern recordSearchPattern,
                                     com.google.gson.Gson gson)
    • Method Detail

      • initialize

        public void initialize​(org.apache.hadoop.mapreduce.InputSplit inputSplit,
                               org.apache.hadoop.mapreduce.TaskAttemptContext context)
                        throws IOException
        Description copied from class: RecordReaderGenericBase
        Read out config paramaters (prefixes, length thresholds, ...) and examine the codec in order to set an internal flag whether the stream will be encoded or not.
        Overrides:
        initialize in class RecordReaderGenericBase<com.google.gson.JsonElement,​com.google.gson.JsonElement,​com.google.gson.JsonElement,​com.google.gson.JsonElement>
        Throws:
        IOException
      • effectiveInputStream

        protected InputStream effectiveInputStream​(InputStream base)
        Always replace the first character (which is either a comma or open bracket) with an open bracket in order to mimick a JSON array start.
        Overrides:
        effectiveInputStream in class RecordReaderGenericBase<com.google.gson.JsonElement,​com.google.gson.JsonElement,​com.google.gson.JsonElement,​com.google.gson.JsonElement>
        Parameters:
        base - The base input stream
        Returns:
      • parse

        protected io.reactivex.rxjava3.core.Flowable<com.google.gson.JsonElement> parse​(Callable<InputStream> inputStreamSupplier)
        Description copied from class: RecordReaderGenericBase
        Create a flowable from the input stream. The input stream may be incorrectly positioned in which case the Flowable is expected to indicate this by raising an error event.
        Specified by:
        parse in class RecordReaderGenericBase<com.google.gson.JsonElement,​com.google.gson.JsonElement,​com.google.gson.JsonElement,​com.google.gson.JsonElement>
        Parameters:
        inputStreamSupplier - A supplier of input streams. May supply the same underlying stream on each call hence only at most a single stream should be taken from the supplier. Supplied streams are safe to use in try-with-resources blocks (possibly using CloseShieldInputStream). Taken streams should be closed by the client code.
        Returns: