public abstract class ParserProvider
extends java.lang.Object
Constructor and Description |
---|
ParserProvider() |
Modifier and Type | Method and Description |
---|---|
abstract Parser |
createParser(ParseSetup setup,
Key<Job> jobKey)
Create a new parser
|
abstract ParseSetup |
createParserSetup(Key[] inputs,
ParseSetup requiredSetup)
Create a parser specific setup.
|
ParseSetup |
guessFinalSetup(ByteVec v,
byte[] bits,
ParseSetup ps)
Finalizes ParseSetup created by
guessInitSetup using data read from a given ByteVec/bits. |
ParseSetup |
guessInitSetup(ByteVec v,
byte[] bits,
ParseSetup userSetup)
Constructs initial ParseSetup from a given user setup
Any exception thrown by this method will signal that this ParserProvider doesn't support
the input data.
|
protected ParseSetup |
guessSetup_impl(ByteVec v,
byte[] bits,
ParseSetup userSetup)
Actual implementation of the guessSetup method.
|
ParseSetup |
guessSetup(ByteVec v,
byte[] bits,
byte sep,
int ncols,
boolean singleQuotes,
int checkHeader,
java.lang.String[] columnNames,
byte[] columnTypes,
java.lang.String[][] domains,
java.lang.String[][] naStrings)
Returns parser setup of throws exception if input is not recognized
|
ParseSetup |
guessSetup(ByteVec v,
byte[] bits,
ParseSetup userSetup) |
abstract ParserInfo |
info()
Technical information for this parser
|
ParseSetup |
setupLocal(Vec v,
ParseSetup setup)
Executed exactly once per-file-per-node during parse.
|
public abstract ParserInfo info()
public abstract Parser createParser(ParseSetup setup, Key<Job> jobKey)
public final ParseSetup guessSetup(ByteVec v, byte[] bits, ParseSetup userSetup)
v
- optional ByteVec (can be null if extracting eg. from a compressed file)bits
- first bytes of the fileuserSetup
- user specified setupprotected ParseSetup guessSetup_impl(ByteVec v, byte[] bits, ParseSetup userSetup)
v
- bits
- userSetup
- public ParseSetup guessInitSetup(ByteVec v, byte[] bits, ParseSetup userSetup)
v
- optional ByteVecbits
- first bytes of the fileuserSetup
- user specified setuppublic ParseSetup guessFinalSetup(ByteVec v, byte[] bits, ParseSetup ps)
guessInitSetup
using data read from a given ByteVec/bits.v
- optional ByteVecbits
- first bytes of the fileps
- parse setup as created by guessInitSetup
public ParseSetup guessSetup(ByteVec v, byte[] bits, byte sep, int ncols, boolean singleQuotes, int checkHeader, java.lang.String[] columnNames, byte[] columnTypes, java.lang.String[][] domains, java.lang.String[][] naStrings)
public abstract ParseSetup createParserSetup(Key[] inputs, ParseSetup requiredSetup)
inputs
- input keysrequiredSetup
- user given parser setuppublic ParseSetup setupLocal(Vec v, ParseSetup setup)
v
- setup
-