Class LogMinerDmlEntryImplAdapter
java.lang.Object
io.debezium.connector.oracle.logminer.processor.infinispan.marshalling.LogMinerDmlEntryImplAdapter
An Infinispan ProtoStream adapter to marshall
LogMinerDmlEntryImpl instances.
This class defines a factory for creating LogMinerDmlEntryImpl instances for when
hydrating records from the persisted datastore as well as field handlers to extract instance values
to be marshalled to the protocol buffer stream.
The underlying protocol buffer record consists of the following structure:
message LogMinerDmlEntryImpl {
required int32 operation = 1;
string newValues = 2;
string oldValues = 3;
required string name = 4;
required string owner = 5;
}
- Author:
- Chris Cranford
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final StringArrays cannot be serialized with null values and so we use a sentinel value to mark a null element in an array.private static final StringThe supplied value arrays can now be populated withOracleValueConverters.UNAVAILABLE_VALUEwhich is simple java object. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionA ProtoStream factory that creates aLogMinerDmlEntryImplinstance from field values.getName(LogMinerDmlEntryImpl entry) A ProtoStream handler to extract theobjectNamefrom theLogMinerDmlEntryImpl.String[]getNewValues(LogMinerDmlEntryImpl entry) A ProtoStream handler to extract thenewValuesobject-array from theLogMinerDmlEntryImpl.String[]getOldValues(LogMinerDmlEntryImpl entry) A ProtoStream handler to extract teholdValuesobject-array from theLogMinerDmlEntryImpl.intgetOperation(LogMinerDmlEntryImpl entry) A ProtoStream handler to extract theentryfield from theLogMinerDmlEntryImpl.getOwner(LogMinerDmlEntryImpl entry) A ProtoStream handler to extract theobjectOwnerfrom theLogMinerDmlEntryImpl.private String[]objectArrayToStringArray(Object[] values) Converts the provided object-array to a string-array.private Object[]stringArrayToObjectArray(String[] values) Converters the provided string-array to an object-array.
-
Field Details
-
NULL_VALUE_SENTINEL
Arrays cannot be serialized with null values and so we use a sentinel value to mark a null element in an array.- See Also:
-
UNAVAILABLE_VALUE_SENTINEL
The supplied value arrays can now be populated withOracleValueConverters.UNAVAILABLE_VALUEwhich is simple java object. This cannot be represented as a string in the cached Infinispan record and so this sentinel is used to translate the runtime object representation to a serializable form and back during cache to object conversion.- See Also:
-
-
Constructor Details
-
LogMinerDmlEntryImplAdapter
public LogMinerDmlEntryImplAdapter()
-
-
Method Details
-
factory
@ProtoFactory public LogMinerDmlEntryImpl factory(int operation, String[] newValues, String[] oldValues, String name, String owner) A ProtoStream factory that creates aLogMinerDmlEntryImplinstance from field values.- Parameters:
operation- the operationnewValues- string-array of the after state valuesoldValues- string-array of the before state valuesname- name of the tableowner- tablespace or schema that owns the table- Returns:
- the constructed LogMinerDmlEntryImpl instance
-
getOperation
A ProtoStream handler to extract theentryfield from theLogMinerDmlEntryImpl.- Parameters:
entry- the entry instance, must not benull- Returns:
- the operation code, never
null
-
getNewValues
A ProtoStream handler to extract thenewValuesobject-array from theLogMinerDmlEntryImpl.- Parameters:
entry- the entry instance, must not benull- Returns:
- a string-array of all the after state
-
getOldValues
A ProtoStream handler to extract teholdValuesobject-array from theLogMinerDmlEntryImpl.- Parameters:
entry- the entry instance, must not benull- Returns:
- a string-array of all the before state
-
getName
A ProtoStream handler to extract theobjectNamefrom theLogMinerDmlEntryImpl.- Parameters:
entry- the entry instance, must not benull- Returns:
- the table name
-
getOwner
A ProtoStream handler to extract theobjectOwnerfrom theLogMinerDmlEntryImpl.- Parameters:
entry- the entry instance, must not benull- Returns:
- the tablespace name
-
objectArrayToStringArray
Converts the provided object-array to a string-array. Internally this method examines the supplied object array and handles conversion for null andOracleValueConverters.UNAVAILABLE_VALUEvalues so that they can be serialized.- Parameters:
values- the values array to be converted, should never benull- Returns:
- the values array converted to a string-array
-
stringArrayToObjectArray
Converters the provided string-array to an object-array. Internally this method examines the supplied string array and handles the conversion of specific sentinel values back to their runtime equivalents. For example,NULL_VALUE_SENTINELwill be interpreted as null andUNAVAILABLE_VALUE_SENTINELwill be converted back toOracleValueConverters.UNAVAILABLE_VALUE.- Parameters:
values- the values array to eb converted, should never benull- Returns:
- the values array converted to an object-array
-