@PublicAPIClass(maturity=STABLE) public interface HoodieRecordPayload<T extends HoodieRecordPayload> extends Serializable
HoodieRecordPayload This abstracts out callbacks which depend on record specific logic.| Modifier and Type | Method and Description |
|---|---|
Option<org.apache.avro.generic.IndexedRecord> |
combineAndGetUpdateValue(org.apache.avro.generic.IndexedRecord currentValue,
org.apache.avro.Schema schema)
Deprecated.
|
default Option<org.apache.avro.generic.IndexedRecord> |
combineAndGetUpdateValue(org.apache.avro.generic.IndexedRecord currentValue,
org.apache.avro.Schema schema,
Properties properties)
This methods lets you write custom merging/combining logic to produce new values as a function of current value on storage and whats contained
in this object.
|
Option<org.apache.avro.generic.IndexedRecord> |
getInsertValue(org.apache.avro.Schema schema)
Deprecated.
|
default Option<org.apache.avro.generic.IndexedRecord> |
getInsertValue(org.apache.avro.Schema schema,
Properties properties)
Generates an avro record out of the given HoodieRecordPayload, to be written out to storage.
|
default Option<Map<String,String>> |
getMetadata()
This method can be used to extract some metadata from HoodieRecordPayload.
|
default Comparable<?> |
getOrderingValue()
This method can be used to extract the ordering value of the payload for combining/merging,
or 0 if no value is specified which means natural order(arrival time is used).
|
T |
preCombine(T oldValue)
Deprecated.
|
default T |
preCombine(T oldValue,
Properties properties)
When more than one HoodieRecord have the same HoodieKey in the incoming batch, this function combines them before attempting to insert/upsert by taking in a property map.
|
default T |
preCombine(T oldValue,
org.apache.avro.Schema schema,
Properties properties)
When more than one HoodieRecord have the same HoodieKey in the incoming batch, this function combines them before attempting to insert/upsert by taking in a schema.
|
@Deprecated @PublicAPIMethod(maturity=DEPRECATED) T preCombine(T oldValue)
preCombine(HoodieRecordPayload, Properties) method.@PublicAPIMethod(maturity=STABLE) default T preCombine(T oldValue, Properties properties)
oldValue - instance of the old HoodieRecordPayload to be combined with.properties - Payload related properties. For example pass the ordering field(s) name to extract from value in storage.@PublicAPIMethod(maturity=EVOLVING) default T preCombine(T oldValue, org.apache.avro.Schema schema, Properties properties)
oldValue - instance of the old HoodieRecordPayload to be combined with.schema - Payload related schema. For example use schema to overwrite old instance for specified fields that doesn't equal to default value.properties - Payload related properties. For example pass the ordering field(s) name to extract from value in storage.@Deprecated @PublicAPIMethod(maturity=DEPRECATED) Option<org.apache.avro.generic.IndexedRecord> combineAndGetUpdateValue(org.apache.avro.generic.IndexedRecord currentValue, org.apache.avro.Schema schema) throws IOException
combineAndGetUpdateValue(IndexedRecord, Schema, Properties) for java docs.IOExceptiondefault Option<org.apache.avro.generic.IndexedRecord> combineAndGetUpdateValue(org.apache.avro.generic.IndexedRecord currentValue, org.apache.avro.Schema schema, Properties properties) throws IOException
eg: 1) You are updating counters, you may want to add counts to currentValue and write back updated counts 2) You may be reading DB redo logs, and merge them with current image for a database row on storage
currentValue - Current value in storage, to merge/combine this payload withschema - Schema used for recordproperties - Payload related properties. For example pass the ordering field(s) name to extract from value in storage.IOException@Deprecated @PublicAPIMethod(maturity=DEPRECATED) Option<org.apache.avro.generic.IndexedRecord> getInsertValue(org.apache.avro.Schema schema) throws IOException
getInsertValue(Schema, Properties) for java docs.schema - Schema used for recordIndexedRecord to be inserted.IOException@PublicAPIMethod(maturity=STABLE) default Option<org.apache.avro.generic.IndexedRecord> getInsertValue(org.apache.avro.Schema schema, Properties properties) throws IOException
schema - Schema used for recordproperties - Payload related properties. For example pass the ordering field(s) name to extract from value in storage.IndexedRecord to be inserted.IOException@PublicAPIMethod(maturity=STABLE) default Option<Map<String,String>> getMetadata()
WriteStatus.markSuccess() and
WriteStatus.markFailure() in order to compute some aggregate metrics using the metadata in the context of a write success or failure.@PublicAPIMethod(maturity=STABLE) default Comparable<?> getOrderingValue()
Copyright © 2024 The Apache Software Foundation. All rights reserved.