public abstract class HoodieRecord<T> extends Object implements HoodieRecordCompatibilityInterface, com.esotericsoftware.kryo.KryoSerializable, Serializable
| Modifier and Type | Class and Description |
|---|---|
static class |
HoodieRecord.HoodieMetadataField |
static class |
HoodieRecord.HoodieRecordType |
| Constructor and Description |
|---|
HoodieRecord() |
HoodieRecord(HoodieKey key,
T data) |
HoodieRecord(HoodieKey key,
T data,
HoodieOperation operation,
HoodieRecordLocation currentLocation,
HoodieRecordLocation newLocation) |
HoodieRecord(HoodieKey key,
T data,
HoodieOperation operation,
Option<Map<String,String>> metaData) |
HoodieRecord(HoodieRecord<T> record) |
| Modifier and Type | Method and Description |
|---|---|
void |
checkState() |
void |
clearNewLocation()
Clears the new currentLocation of the record.
|
abstract HoodieRecord<T> |
copy()
This is used to copy data.
|
void |
deflate()
Release the actual payload, to ease memory pressure.
|
boolean |
equals(Object o) |
static String |
generateSequenceId(String instantTime,
int partitionId,
long recordIndex) |
abstract Object[] |
getColumnValues(org.apache.avro.Schema recordSchema,
String[] columns,
boolean consistentLogicalTimestampEnabled)
Get column in record to support RDDCustomColumnsSortPartitioner
|
HoodieRecordLocation |
getCurrentLocation() |
T |
getData() |
boolean |
getIgnoreIndexUpdate() |
HoodieKey |
getKey() |
abstract Option<Map<String,String>> |
getMetadata() |
HoodieRecordLocation |
getNewLocation() |
HoodieOperation |
getOperation() |
abstract Comparable<?> |
getOrderingValue(org.apache.avro.Schema recordSchema,
Properties props) |
String |
getPartitionPath() |
String |
getRecordKey() |
abstract String |
getRecordKey(org.apache.avro.Schema recordSchema,
Option<BaseKeyGenerator> keyGeneratorOpt) |
abstract String |
getRecordKey(org.apache.avro.Schema recordSchema,
String keyFieldName) |
abstract HoodieRecord.HoodieRecordType |
getRecordType() |
int |
hashCode() |
protected static boolean |
hasMetaFields(org.apache.avro.Schema schema) |
boolean |
isCurrentLocationKnown() |
abstract boolean |
isDelete(org.apache.avro.Schema recordSchema,
Properties props) |
abstract HoodieRecord |
joinWith(HoodieRecord other,
org.apache.avro.Schema targetSchema)
Support bootstrap.
|
abstract HoodieRecord<T> |
newInstance() |
abstract HoodieRecord<T> |
newInstance(HoodieKey key) |
abstract HoodieRecord<T> |
newInstance(HoodieKey key,
HoodieOperation op) |
abstract HoodieRecord |
prependMetaFields(org.apache.avro.Schema recordSchema,
org.apache.avro.Schema targetSchema,
MetadataValues metadataValues,
Properties props)
Rewrites record into new target schema containing Hudi-specific meta-fields
NOTE: This operation is idempotent
|
void |
read(com.esotericsoftware.kryo.Kryo kryo,
com.esotericsoftware.kryo.io.Input input)
NOTE: This method is declared final to make sure there's no polymorphism and therefore
JIT compiler could perform more aggressive optimizations
|
protected abstract T |
readRecordPayload(com.esotericsoftware.kryo.Kryo kryo,
com.esotericsoftware.kryo.io.Input input) |
HoodieRecord |
rewriteRecordWithNewSchema(org.apache.avro.Schema recordSchema,
Properties props,
org.apache.avro.Schema newSchema) |
abstract HoodieRecord |
rewriteRecordWithNewSchema(org.apache.avro.Schema recordSchema,
Properties props,
org.apache.avro.Schema newSchema,
Map<String,String> renameCols)
Support schema evolution.
|
void |
seal() |
HoodieRecord |
setCurrentLocation(HoodieRecordLocation location)
Sets the current currentLocation of the record.
|
void |
setIgnoreIndexUpdate(boolean ignoreFlag)
Sets the ignore flag.
|
void |
setNewLocation(HoodieRecordLocation location)
Sets the new currentLocation of the record, after being written.
|
abstract boolean |
shouldIgnore(org.apache.avro.Schema recordSchema,
Properties props)
Is EmptyRecord.
|
String |
toString() |
void |
unseal() |
void |
write(com.esotericsoftware.kryo.Kryo kryo,
com.esotericsoftware.kryo.io.Output output)
NOTE: This method is declared final to make sure there's no polymorphism and therefore
JIT compiler could perform more aggressive optimizations
|
protected abstract void |
writeRecordPayload(T payload,
com.esotericsoftware.kryo.Kryo kryo,
com.esotericsoftware.kryo.io.Output output) |
clone, finalize, getClass, notify, notifyAll, wait, wait, waittoIndexedRecord, truncateRecordKey, wrapIntoHoodieRecordPayloadWithKeyGen, wrapIntoHoodieRecordPayloadWithParamspublic static final String COMMIT_TIME_METADATA_FIELD
public static final String COMMIT_SEQNO_METADATA_FIELD
public static final String RECORD_KEY_METADATA_FIELD
public static final String PARTITION_PATH_METADATA_FIELD
public static final String FILENAME_METADATA_FIELD
public static final String OPERATION_METADATA_FIELD
public static final String HOODIE_IS_DELETED_FIELD
public static final org.apache.hudi.common.model.HoodieRecord.EmptyRecord SENTINEL
HoodieRecordPayload, which means we should just skip this record.
This record is only used for HoodieRecordPayload currently, so it should not
shuffle though network, we can compare the record locally by the equal method.
The HoodieRecordPayload#combineAndGetUpdateValue and HoodieRecordPayload#getInsertValue
have 3 kind of return:
1、Option.empty
This means we should delete this record.
2、IGNORE_RECORD
This means we should not process this record,just skip.
3、Other non-empty record
This means we should process this record.
We can see the usage of IGNORE_RECORD in
org.apache.spark.sql.hudi.command.payload.ExpressionPayloadpublic static final Set<String> HOODIE_META_COLUMNS_WITH_OPERATION
public static final Map<String,Integer> HOODIE_META_COLUMNS_NAME_TO_POS
public static int RECORD_KEY_META_FIELD_ORD
public static int PARTITION_PATH_META_FIELD_ORD
public static int FILENAME_META_FIELD_ORD
public static int COMMIT_TIME_METADATA_FIELD_ORD
public static int COMMIT_SEQNO_METADATA_FIELD_ORD
protected HoodieKey key
protected T data
protected HoodieRecordLocation currentLocation
protected HoodieRecordLocation newLocation
protected boolean ignoreIndexUpdate
protected HoodieOperation operation
public HoodieRecord(HoodieKey key, T data, HoodieOperation operation, Option<Map<String,String>> metaData)
public HoodieRecord(HoodieKey key, T data, HoodieOperation operation, HoodieRecordLocation currentLocation, HoodieRecordLocation newLocation)
public HoodieRecord(HoodieRecord<T> record)
public HoodieRecord()
public abstract HoodieRecord<T> newInstance()
public abstract HoodieRecord<T> newInstance(HoodieKey key, HoodieOperation op)
public abstract HoodieRecord<T> newInstance(HoodieKey key)
public HoodieKey getKey()
public HoodieOperation getOperation()
public abstract Comparable<?> getOrderingValue(org.apache.avro.Schema recordSchema, Properties props)
public T getData()
public void deflate()
public HoodieRecord setCurrentLocation(HoodieRecordLocation location)
@Nullable public HoodieRecordLocation getCurrentLocation()
public void setNewLocation(HoodieRecordLocation location)
@Nullable public HoodieRecordLocation getNewLocation()
public boolean isCurrentLocationKnown()
public void setIgnoreIndexUpdate(boolean ignoreFlag)
public boolean getIgnoreIndexUpdate()
public String getPartitionPath()
public String getRecordKey()
public abstract HoodieRecord.HoodieRecordType getRecordType()
public abstract String getRecordKey(org.apache.avro.Schema recordSchema, Option<BaseKeyGenerator> keyGeneratorOpt)
public abstract String getRecordKey(org.apache.avro.Schema recordSchema, String keyFieldName)
public void seal()
public void unseal()
public void checkState()
protected abstract void writeRecordPayload(T payload, com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Output output)
protected abstract T readRecordPayload(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Input input)
public void clearNewLocation()
public final void write(com.esotericsoftware.kryo.Kryo kryo,
com.esotericsoftware.kryo.io.Output output)
write in interface com.esotericsoftware.kryo.KryoSerializablepublic final void read(com.esotericsoftware.kryo.Kryo kryo,
com.esotericsoftware.kryo.io.Input input)
read in interface com.esotericsoftware.kryo.KryoSerializablepublic abstract Object[] getColumnValues(org.apache.avro.Schema recordSchema, String[] columns, boolean consistentLogicalTimestampEnabled)
public abstract HoodieRecord joinWith(HoodieRecord other, org.apache.avro.Schema targetSchema)
public abstract HoodieRecord prependMetaFields(org.apache.avro.Schema recordSchema, org.apache.avro.Schema targetSchema, MetadataValues metadataValues, Properties props)
public abstract HoodieRecord rewriteRecordWithNewSchema(org.apache.avro.Schema recordSchema, Properties props, org.apache.avro.Schema newSchema, Map<String,String> renameCols)
public HoodieRecord rewriteRecordWithNewSchema(org.apache.avro.Schema recordSchema, Properties props, org.apache.avro.Schema newSchema)
public abstract boolean isDelete(org.apache.avro.Schema recordSchema,
Properties props)
throws IOException
IOExceptionpublic abstract boolean shouldIgnore(org.apache.avro.Schema recordSchema,
Properties props)
throws IOException
IOExceptionpublic abstract HoodieRecord<T> copy()
public static String generateSequenceId(String instantTime, int partitionId, long recordIndex)
protected static boolean hasMetaFields(org.apache.avro.Schema schema)
Copyright © 2024 The Apache Software Foundation. All rights reserved.