Class JacksonAvroParserImpl
java.lang.Object
tools.jackson.core.JsonParser
tools.jackson.core.base.ParserMinimalBase
tools.jackson.core.base.ParserBase
tools.jackson.dataformat.avro.AvroParser
tools.jackson.dataformat.avro.deser.AvroParserImpl
tools.jackson.dataformat.avro.deser.JacksonAvroParserImpl
- All Implemented Interfaces:
Closeable,AutoCloseable,tools.jackson.core.Versioned
Parser implementation that uses native Jackson avro decoder.
-
Nested Class Summary
Nested classes/interfaces inherited from class tools.jackson.core.JsonParser
tools.jackson.core.JsonParser.NumberType, tools.jackson.core.JsonParser.NumberTypeFP -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanFlag that indicates whether the input buffer is recycable (and needs to be returned to recycler once we are done) or not.protected byte[]Current buffer from which data is read; generally data is read into buffer from input source, but in some cases pre-loaded buffer is handed to the parser.protected InputStreamstatic final int[]Additionally we can combine UTF-8 decoding info into similar data table.Fields inherited from class tools.jackson.dataformat.avro.deser.AvroParserImpl
_branchIndex, _enumIndexFields inherited from class tools.jackson.dataformat.avro.AvroParser
_avroContext, _formatFeatures, _rootSchema, _streamReadContext, AVRO_READ_CAPABILITIESFields inherited from class tools.jackson.core.base.ParserBase
_binaryValue, _byteArrayBuilder, _currInputProcessed, _currInputRow, _currInputRowStart, _expLength, _fractLength, _inputEnd, _inputPtr, _intLength, _numberBigDecimal, _numberBigInt, _numberDouble, _numberFloat, _numberInt, _numberIsNaN, _numberLong, _numberNegative, _numberString, _numTypesValid, _textBuffer, _tokenInputCol, _tokenInputRow, _tokenInputTotalFields inherited from class tools.jackson.core.base.ParserMinimalBase
_closed, _currToken, _ioContext, _lastClearedToken, _objectReadContext, _streamReadConstraints, _streamReadFeatures, _tokenCount, _trackMaxTokenCount, BD_MAX_INT, BD_MAX_LONG, BD_MIN_INT, BD_MIN_LONG, BI_MAX_INT, BI_MAX_LONG, BI_MIN_INT, BI_MIN_LONG, CHAR_NULL, INT_0, INT_9, INT_APOS, INT_ASTERISK, INT_BACKSLASH, INT_COLON, INT_COMMA, INT_CR, INT_e, INT_E, INT_HASH, INT_LBRACKET, INT_LCURLY, INT_LF, INT_MINUS, INT_PERIOD, INT_PLUS, INT_QUOTE, INT_RBRACKET, INT_RCURLY, INT_RS, INT_SLASH, INT_SPACE, INT_TAB, MAX_BYTE_I, MAX_INT_D, MAX_INT_L, MAX_LONG_D, MAX_SHORT_I, MIN_BYTE_I, MIN_INT_D, MIN_INT_L, MIN_LONG_D, MIN_SHORT_I, NO_BYTES, NO_INTS, NR_BIGDECIMAL, NR_BIGINT, NR_DOUBLE, NR_FLOAT, NR_INT, NR_LONG, NR_UNKNOWN, STREAM_READ_FEATURE_DEFAULTSFields inherited from class tools.jackson.core.JsonParser
DEFAULT_READ_CAPABILITIES -
Constructor Summary
ConstructorsConstructorDescriptionJacksonAvroParserImpl(tools.jackson.core.ObjectReadContext readCtxt, tools.jackson.core.io.IOContext ioCtxt, int parserFeatures, int avroFeatures, AvroSchema schema, byte[] data, int offset, int len) JacksonAvroParserImpl(tools.jackson.core.ObjectReadContext readCtxt, tools.jackson.core.io.IOContext ioCtxt, int parserFeatures, int avroFeatures, AvroSchema schema, InputStream in) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidintlongprotected final booleanprotected final voidprotected final void_loadToHaveAtLeast(int minAvailable) Helper method that will try to load at least specified number bytes in input buffer, possible moving existing data around if necessaryprotected voidvoidvoidbooleanlonglongtools.jackson.core.JsonTokentools.jackson.core.JsonTokentools.jackson.core.JsonTokeninttools.jackson.core.JsonTokendecodeFixed(int size) tools.jackson.core.JsonTokenintfinal inttools.jackson.core.JsonTokenlongtools.jackson.core.JsonTokenlonglongvoidtools.jackson.core.JsonTokenintbooleanintprotected tools.jackson.core.JsonTokenlongvoidvoidvoidvoidskipFixed(int size) voidvoidskipInt()voidskipLong()longskipMap()voidMethods inherited from class tools.jackson.dataformat.avro.deser.AvroParserImpl
_checkNumericValue, _initSchema, branchIndex, close, convertNumberToBigDecimal, convertNumberToBigInteger, convertNumberToDouble, convertNumberToFloat, convertNumberToInt, convertNumberToLong, decodeBytesDecimal, decodeFixedDecimal, enumIndex, getFloatValue, getNumberType, getNumberTypeFP, getNumberValue, getNumberValueExact, getRemainingElements, isNaN, isRecord, nextName, nextName, nextNameMatch, nextToken, setAvroContext, setBytes, setNumber, setNumber, setNumber, setNumber, skipBytesDecimal, skipFixedDecimal, skipValueMethods inherited from class tools.jackson.dataformat.avro.AvroParser
_parseIntValue, _parseNumericValue, assignCurrentValue, canReadTypeId, configure, currentLocation, currentName, currentTokenLocation, currentValue, disable, enable, getBinaryValue, getEmbeddedObject, getSchema, getStringCharacters, getStringLength, getStringOffset, getTypeId, isEnabled, setSchema, streamReadCapabilities, streamReadContext, versionMethods inherited from class tools.jackson.core.base.ParserBase
_contentReference, _contentReferenceRedacted, _convertBigDecimalToBigInteger, _decodeBase64Escape, _decodeBase64Escape, _decodeEscaped, _eofAsNextChar, _getBigDecimal, _getBigInteger, _getByteArrayBuilder, _getNumberDouble, _getNumberFloat, _growNameDecodeBuffer, _handleBase64MissingPadding, _handleEOF, _reportInvalidBase64Char, _reportInvalidBase64Char, getBigIntegerValue, getDecimalValue, getDoubleValue, getIntValue, getLongValue, getNumberValueDeferred, getTokenCharacterOffset, getTokenColumnNr, getTokenLineNr, growArrayBy, reset, resetAsNaN, resetFloat, resetIntMethods inherited from class tools.jackson.core.base.ParserMinimalBase
_constructInputCoercion, _constructNotNumericType, _currentLocationMinusOne, _decodeBase64, _getCharDesc, _hasTextualNull, _longIntegerDesc, _longNumberDesc, _nullSafeUpdateToken, _reportBadInputStream, _reportBadReader, _reportError, _reportError, _reportError, _reportError, _reportInvalidEOF, _reportInvalidEOF, _reportInvalidEOFInValue, _reportInvalidNumber, _reportInvalidSpace, _reportInvalidUTF8Surrogate, _reportMissingRootWS, _reportOverflowByte, _reportOverflowInt, _reportOverflowInt, _reportOverflowInt, _reportOverflowLong, _reportOverflowLong, _reportOverflowLong, _reportOverflowShort, _reportUnexpectedChar, _reportUnexpectedNumberChar, _throwInternal, _updateToken, _updateTokenToNA, _updateTokenToNull, _wrapIOFailure, clearCurrentToken, currentNameMatch, currentToken, currentTokenCount, currentTokenId, finishToken, getBooleanValue, getByteValue, getLastClearedToken, getShortValue, getValueAsBoolean, getValueAsDouble, getValueAsInt, getValueAsInt, getValueAsLong, getValueAsLong, getValueAsString, getValueAsString, hasCurrentToken, hasToken, hasTokenId, isClosed, isEnabled, isExpectedNumberIntToken, isExpectedStartArrayToken, isExpectedStartObjectToken, nextValue, objectReadContext, readValueAs, readValueAs, readValueAs, readValueAsTree, skipChildren, streamReadConstraints, streamReadFeaturesMethods inherited from class tools.jackson.core.JsonParser
_constructReadException, _constructReadException, _constructReadException, _constructReadException, _constructReadException, _constructReadException, _reportUnsupportedOperation, canParseAsync, canReadObjectId, getBinaryValue, getObjectId, getText, getTextCharacters, getTextLength, getTextOffset, getValueAsBoolean, getValueAsDouble, nextBooleanValue, nextIntValue, nextLongValue, nonBlockingInputFeeder, readBinaryValue, readBinaryValue, readString, releaseBuffered
-
Field Details
-
sUtf8UnitLengths
public static final int[] sUtf8UnitLengthsAdditionally we can combine UTF-8 decoding info into similar data table. Values indicate "byte length - 1"; meaning -1 is used for invalid bytes, 0 for single-byte codes, 1 for 2-byte codes and 2 for 3-byte codes. -
_inputStream
-
_inputBuffer
protected byte[] _inputBufferCurrent buffer from which data is read; generally data is read into buffer from input source, but in some cases pre-loaded buffer is handed to the parser. -
_bufferRecyclable
protected boolean _bufferRecyclableFlag that indicates whether the input buffer is recycable (and needs to be returned to recycler once we are done) or not.If it is not, it also means that parser can NOT modify underlying buffer.
-
-
Constructor Details
-
JacksonAvroParserImpl
public JacksonAvroParserImpl(tools.jackson.core.ObjectReadContext readCtxt, tools.jackson.core.io.IOContext ioCtxt, int parserFeatures, int avroFeatures, AvroSchema schema, InputStream in) -
JacksonAvroParserImpl
public JacksonAvroParserImpl(tools.jackson.core.ObjectReadContext readCtxt, tools.jackson.core.io.IOContext ioCtxt, int parserFeatures, int avroFeatures, AvroSchema schema, byte[] data, int offset, int len)
-
-
Method Details
-
_releaseBuffers
protected void _releaseBuffers()- Overrides:
_releaseBuffersin classtools.jackson.core.base.ParserBase
-
streamReadInputSource
- Specified by:
streamReadInputSourcein classAvroParser
-
_closeInput
- Specified by:
_closeInputin classAvroParser- Throws:
IOException
-
releaseBuffered
- Overrides:
releaseBufferedin classtools.jackson.core.JsonParser
-
nextStringValue
- Specified by:
nextStringValuein classAvroParserImpl- Throws:
tools.jackson.core.JacksonException
-
hasStringCharacters
public boolean hasStringCharacters()- Specified by:
hasStringCharactersin classAvroParser
-
getString
- Specified by:
getStringin classAvroParser- Throws:
tools.jackson.core.JacksonException
-
getString
- Specified by:
getStringin classAvroParser- Throws:
tools.jackson.core.JacksonException
-
decodeIntToken
- Specified by:
decodeIntTokenin classAvroParserImpl- Throws:
IOException
-
decodeInt
- Specified by:
decodeIntin classAvroParserImpl- Throws:
IOException
-
_decodeIntSlow
- Throws:
IOException
-
skipInt
- Specified by:
skipIntin classAvroParserImpl- Throws:
IOException
-
_skipIntSlow
- Throws:
IOException
-
decodeLongToken
- Specified by:
decodeLongTokenin classAvroParserImpl- Throws:
IOException
-
decodeLong
- Specified by:
decodeLongin classAvroParserImpl- Throws:
IOException
-
_decodeLongSlow
- Throws:
IOException
-
skipLong
- Specified by:
skipLongin classAvroParserImpl- Throws:
IOException
-
_skipLongSlow
- Throws:
IOException
-
decodeFloat
- Specified by:
decodeFloatin classAvroParserImpl- Throws:
IOException
-
skipFloat
- Specified by:
skipFloatin classAvroParserImpl- Throws:
IOException
-
decodeDouble
- Specified by:
decodeDoublein classAvroParserImpl- Throws:
IOException
-
skipDouble
- Specified by:
skipDoublein classAvroParserImpl- Throws:
IOException
-
decodeStringToken
- Specified by:
decodeStringTokenin classAvroParserImpl- Throws:
IOException
-
decodeString
- Specified by:
decodeStringin classAvroParserImpl- Throws:
IOException
-
skipString
- Specified by:
skipStringin classAvroParserImpl- Throws:
IOException
-
decodeBytes
- Specified by:
decodeBytesin classAvroParserImpl- Throws:
IOException
-
skipBytes
- Specified by:
skipBytesin classAvroParserImpl- Throws:
IOException
-
decodeFixed
- Specified by:
decodeFixedin classAvroParserImpl- Throws:
IOException
-
skipFixed
- Specified by:
skipFixedin classAvroParserImpl- Throws:
IOException
-
decodeArrayStart
- Specified by:
decodeArrayStartin classAvroParserImpl- Throws:
IOException
-
decodeArrayNext
- Specified by:
decodeArrayNextin classAvroParserImpl- Throws:
IOException
-
skipArray
- Specified by:
skipArrayin classAvroParserImpl- Returns:
- Either 0, in which case all entries have been successfully skipped; or positive non-zero number to indicate elements that caller has to skip
- Throws:
IOException
-
decodeMapKey
- Specified by:
decodeMapKeyin classAvroParserImpl- Throws:
IOException
-
decodeMapStart
- Specified by:
decodeMapStartin classAvroParserImpl- Throws:
IOException
-
decodeMapNext
- Specified by:
decodeMapNextin classAvroParserImpl- Throws:
IOException
-
skipMap
- Specified by:
skipMapin classAvroParserImpl- Returns:
- Either 0, in which case all entries have been successfully skipped; or positive non-zero number to indicate map entries that caller has to skip
- Throws:
IOException
-
decodeBoolean
- Specified by:
decodeBooleanin classAvroParserImpl- Throws:
IOException
-
skipBoolean
- Specified by:
skipBooleanin classAvroParserImpl- Throws:
IOException
-
decodeIndex
- Specified by:
decodeIndexin classAvroParserImpl- Throws:
IOException
-
decodeEnum
- Specified by:
decodeEnumin classAvroParserImpl- Throws:
IOException
-
checkInputEnd
- Specified by:
checkInputEndin classAvroParserImpl- Throws:
IOException
-
setString
- Specified by:
setStringin classAvroParserImpl- Throws:
IOException
-
_loadMoreGuaranteed
- Throws:
IOException
-
_loadMore
- Throws:
IOException
-
_loadToHaveAtLeast
Helper method that will try to load at least specified number bytes in input buffer, possible moving existing data around if necessary- Throws:
IOException
-