@API.Public @API.NotThreadSafe public interface ChangeDataReader extends Iterator<ChangeEvent>
ChangeDataRecord
.
It provides a cursor-like semantics which can be moved, one node at a time by invoking
next()
.
The properties of individual change node. For example, data type, field name,
field value, etc. can be retrieved using various methods of this interface.Modifier and Type | Method and Description |
---|---|
int |
getArrayIndex() |
ByteBuffer |
getBinary() |
boolean |
getBoolean() |
byte |
getByte() |
ODate |
getDate() |
int |
getDateInt() |
BigDecimal |
getDecimal() |
int |
getDecimalPrecision()
Returns the precision of the current
DECIMAL node. |
int |
getDecimalScale()
Returns the scale of the current
DECIMAL node. |
ByteBuffer |
getDecimalValueAsBytes()
Returns a
ByteBuffer containing the two's complement representation
of the current DECIMAL node. |
int |
getDecimalValueAsInt()
Returns an
int whose value is the unscaled value of this
DECIMAL . |
long |
getDecimalValueAsLong()
Returns a
long whose value is the unscaled value of this
DECIMAL . |
double |
getDouble() |
String |
getFieldName() |
ByteBuffer |
getFieldNameBytes() |
float |
getFloat() |
int |
getInt() |
OInterval |
getInterval() |
long |
getIntervalMillis()
Returns the value of this interval duration in milliseconds computed from
individual fields.
|
long |
getLong() |
ChangeOp |
getOp()
Returns the
ChangeOp of the current change node. |
long |
getOpTimestamp()
Returns the logical time of the data.
|
long |
getServerTimestamp() |
short |
getShort() |
String |
getString() |
OTime |
getTime() |
int |
getTimeInt() |
OTimestamp |
getTimestamp() |
long |
getTimestampLong() |
Value.Type |
getType() |
boolean |
inArray()
If it returns true, the current field is in an array;
otherwise, the current field is not in an array.
|
boolean |
inMap()
If it returns true, the current field is in a map;
otherwise, the current field is not in a map.
|
ChangeEvent |
next()
Moves the cursor to the next change node and returns the
ChangeEvent
associated with the node. |
forEachRemaining, hasNext, remove
ChangeEvent next()
ChangeEvent
associated with the node.next
in interface Iterator<ChangeEvent>
String getFieldName()
ByteBuffer getFieldNameBytes()
int getArrayIndex()
boolean inMap()
`true`
for all top level fieldsboolean inArray()
Value.Type getType()
long getOpTimestamp()
long getServerTimestamp()
byte getByte()
byte
value of the current nodeTypeException
- if the current EventType
is not
BYTE
short getShort()
byte
value of the current nodeTypeException
- if the current EventType
is not
SHORT
int getInt()
int
value of the current nodeTypeException
- if the current EventType
is not
INT
long getLong()
long
value of the current nodeTypeException
- if the current EventType
is not
LONG
float getFloat()
float
value of the current nodeTypeException
- if the current EventType
is not
FLOAT
double getDouble()
double
value of the current nodeTypeException
- if the current EventType
is not
DOUBLE
BigDecimal getDecimal()
BigDecimal
value of the current nodeTypeException
- if the current EventType
is not
DECIMAL
int getDecimalPrecision()
DECIMAL
node.
(The precision is the number of digits in the unscaled value.)
The precision of a zero value is 1.
DECIMAL
nodeTypeException
- if the current EventType
is not
DECIMAL
int getDecimalScale()
DECIMAL
node. If the returned
value is zero or positive, the scale is the number of digits to the right
of the decimal point. If negative, the unscaled value of the number is
multiplied by ten to the power of the negation of the scale. For example,
a scale of -3
means the unscaled value is multiplied by 1000.DECIMAL
nodeTypeException
- if the current EventType
is not
DECIMAL
int getDecimalValueAsInt()
int
whose value is the unscaled value of this
DECIMAL
.DECIMAL
nodeTypeException
- if the current EventType
is not
DECIMAL
org.w3c.dom.ranges.RangeException
- if the precision of the decimal number is greater
than 9long getDecimalValueAsLong()
long
whose value is the unscaled value of this
DECIMAL
.DECIMAL
nodeTypeException
- if the current EventType
is not
DECIMAL
org.w3c.dom.ranges.RangeException
- if the precision of the decimal number is greater
than 18ByteBuffer getDecimalValueAsBytes()
ByteBuffer
containing the two's complement representation
of the current DECIMAL
node. The byte array will be in big-endian
byte order: the most significant byte is in the zeroth element. The
array will contain the minimum number of bytes required to represent this
DECIMAL
, including one sign bit.DECIMAL
nodeboolean getBoolean()
boolean
value of the current nodeTypeException
- if the current EventType
is not
BOOLEAN
String getString()
String
value of the current nodeTypeException
- if the current EventType
is not
STRING
long getTimestampLong()
Timestamp
value of the current node as a long
representing the number of milliseconds since epochTypeException
- if the current EventType
is not
TIMESTAMP
OTimestamp getTimestamp()
Timestamp
value of the current nodeTypeException
- if the current EventType
is not
TIMESTAMP
int getDateInt()
Date
value of the current node as an int
representing the number of DAYS since epochTypeException
- if the current EventType
is not
DATE
ODate getDate()
Date
value of the current nodeTypeException
- if the current EventType
is not
DATE
int getTimeInt()
Time
value of the current node as an int
representing the number of milliseconds since midnightTypeException
- if the current EventType
is not
TIME
OTime getTime()
Time
value of the current nodeTypeException
- if the current EventType
is not
TIME
OInterval getInterval()
Interval
value of the current nodeTypeException
- if the current EventType
is not
INTERVAL
long getIntervalMillis()
TypeException
- if the current EventType
is not
INTERVAL
ByteBuffer getBinary()
ByteBuffer
value of the current nodeTypeException
- if the current EventType
is not
BINARY
Copyright © 2015–2018 MapR Technologies, Inc.. All rights reserved.