public class JsonRecordReader extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
JsonRecordReader.Handler
Implement this interface to stream records as and when one is found.
|
Modifier and Type | Method and Description |
---|---|
static void |
consumeTillMatchingEnd(org.noggit.JSONParser parser,
int obj,
int arr) |
List<Map<String,Object>> |
getAllRecords(Reader r)
Uses
streamRecords to getInst the JSON source but with
a handler that collects all the emitted records into a single List which
is returned upon completion. |
static JsonRecordReader |
getInst(String split,
List<String> fieldMappings) |
static List<Object> |
parseArrayFieldValue(int ev,
org.noggit.JSONParser parser,
org.apache.solr.common.util.JsonRecordReader.MethodFrameWrapper runnable) |
static Object |
parseSingleFieldValue(int ev,
org.noggit.JSONParser parser,
org.apache.solr.common.util.JsonRecordReader.MethodFrameWrapper runnable) |
void |
streamRecords(org.noggit.JSONParser parser,
JsonRecordReader.Handler handler) |
void |
streamRecords(Reader r,
JsonRecordReader.Handler handler)
Creates an JSONParser on top of whatever reader has been
configured.
|
public static final String DELIM
public static JsonRecordReader getInst(String split, List<String> fieldMappings)
public List<Map<String,Object>> getAllRecords(Reader r) throws IOException
streamRecords
to getInst the JSON source but with
a handler that collects all the emitted records into a single List which
is returned upon completion.r
- the stream readerIOException
public void streamRecords(Reader r, JsonRecordReader.Handler handler) throws IOException
r
- the stream readerhandler
- The callback instanceIOException
public void streamRecords(org.noggit.JSONParser parser, JsonRecordReader.Handler handler) throws IOException
IOException
public static Object parseSingleFieldValue(int ev, org.noggit.JSONParser parser, org.apache.solr.common.util.JsonRecordReader.MethodFrameWrapper runnable) throws IOException
IOException
public static List<Object> parseArrayFieldValue(int ev, org.noggit.JSONParser parser, org.apache.solr.common.util.JsonRecordReader.MethodFrameWrapper runnable) throws IOException
IOException
public static void consumeTillMatchingEnd(org.noggit.JSONParser parser, int obj, int arr) throws IOException
IOException
Copyright © 2000-2017 Apache Software Foundation. All Rights Reserved.