public abstract class HoodieWriteHandle<T,I,K,O> extends HoodieIOHandle<T,I,K,O>
| Modifier and Type | Field and Description |
|---|---|
protected String |
fileId |
protected HoodieRecordLocation |
newRecordLocation |
protected String |
partitionPath |
protected HoodieRecordMerger |
recordMerger |
protected boolean |
schemaOnReadEnabled |
protected TaskContextSupplier |
taskContextSupplier |
protected HoodieTimer |
timer |
protected org.apache.avro.Schema |
writeSchema
Schema used to write records into data files
|
protected org.apache.avro.Schema |
writeSchemaWithMetaFields |
protected WriteStatus |
writeStatus |
protected String |
writeToken |
config, hoodieTable, instantTime, storage| Modifier | Constructor and Description |
|---|---|
protected |
HoodieWriteHandle(HoodieWriteConfig config,
String instantTime,
String partitionPath,
String fileId,
HoodieTable<T,I,K,O> hoodieTable,
Option<org.apache.avro.Schema> overriddenSchema,
TaskContextSupplier taskContextSupplier) |
|
HoodieWriteHandle(HoodieWriteConfig config,
String instantTime,
String partitionPath,
String fileId,
HoodieTable<T,I,K,O> hoodieTable,
TaskContextSupplier taskContextSupplier) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canWrite(HoodieRecord record)
Determines whether we can accept the incoming records, into the current file.
|
abstract List<WriteStatus> |
close() |
protected HoodieLogFormat.Writer |
createLogWriter(String instantTime) |
protected HoodieLogFormat.Writer |
createLogWriter(String instantTime,
String fileSuffix) |
protected void |
createMarkerFile(String partitionPath,
String dataFileName)
Creates an empty marker file corresponding to storage writer path.
|
protected void |
doWrite(HoodieRecord record,
org.apache.avro.Schema schema,
TypedProperties props)
Perform the actual writing of the given record into the backing file.
|
protected long |
getAttemptId() |
HoodieWriteConfig |
getConfig() |
String |
getFileId() |
HoodieTableMetaClient |
getHoodieTableMetaClient() |
abstract IOType |
getIOType() |
protected LogFileCreationCallback |
getLogCreationCallback()
Returns a log creation hook impl.
|
protected int |
getPartitionId() |
String |
getPartitionPath() |
protected int |
getStageId() |
HoodieStorage |
getStorage() |
org.apache.avro.Schema |
getWriterSchema() |
org.apache.avro.Schema |
getWriterSchemaWithMetaFields() |
List<WriteStatus> |
getWriteStatuses() |
protected boolean |
isClosed() |
protected StoragePath |
makeNewFilePath(String partitionPath,
String fileName)
Make new file path with given file name.
|
StoragePath |
makeNewPath(String partitionPath) |
protected void |
markClosed() |
protected static Option<org.apache.avro.generic.IndexedRecord> |
toAvroRecord(HoodieRecord record,
org.apache.avro.Schema writerSchema,
TypedProperties props) |
void |
write(HoodieRecord record,
org.apache.avro.Schema schema,
TypedProperties props)
Perform the actual writing of the given record into the backing file.
|
protected final org.apache.avro.Schema writeSchema
protected final org.apache.avro.Schema writeSchemaWithMetaFields
protected final HoodieRecordMerger recordMerger
protected HoodieTimer timer
protected WriteStatus writeStatus
protected HoodieRecordLocation newRecordLocation
protected final String partitionPath
protected final String fileId
protected final String writeToken
protected final TaskContextSupplier taskContextSupplier
protected final boolean schemaOnReadEnabled
public HoodieWriteHandle(HoodieWriteConfig config, String instantTime, String partitionPath, String fileId, HoodieTable<T,I,K,O> hoodieTable, TaskContextSupplier taskContextSupplier)
protected HoodieWriteHandle(HoodieWriteConfig config, String instantTime, String partitionPath, String fileId, HoodieTable<T,I,K,O> hoodieTable, Option<org.apache.avro.Schema> overriddenSchema, TaskContextSupplier taskContextSupplier)
public StoragePath makeNewPath(String partitionPath)
protected StoragePath makeNewFilePath(String partitionPath, String fileName)
protected void createMarkerFile(String partitionPath, String dataFileName)
partitionPath - Partition pathpublic org.apache.avro.Schema getWriterSchemaWithMetaFields()
public org.apache.avro.Schema getWriterSchema()
public boolean canWrite(HoodieRecord record)
- Whether it belongs to the same partitionPath as existing records - Whether the current file written bytes lt max file size
protected void doWrite(HoodieRecord record, org.apache.avro.Schema schema, TypedProperties props)
public void write(HoodieRecord record, org.apache.avro.Schema schema, TypedProperties props)
protected boolean isClosed()
protected void markClosed()
public abstract List<WriteStatus> close()
public List<WriteStatus> getWriteStatuses()
public String getPartitionPath()
public abstract IOType getIOType()
public HoodieStorage getStorage()
getStorage in class HoodieIOHandle<T,I,K,O>public HoodieWriteConfig getConfig()
public HoodieTableMetaClient getHoodieTableMetaClient()
public String getFileId()
protected int getPartitionId()
protected int getStageId()
protected long getAttemptId()
protected HoodieLogFormat.Writer createLogWriter(String instantTime)
protected HoodieLogFormat.Writer createLogWriter(String instantTime, String fileSuffix)
protected LogFileCreationCallback getLogCreationCallback()
protected static Option<org.apache.avro.generic.IndexedRecord> toAvroRecord(HoodieRecord record, org.apache.avro.Schema writerSchema, TypedProperties props)
Copyright © 2024 The Apache Software Foundation. All rights reserved.