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, fs, hoodieTable, instantTime| 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(Option<FileSlice> fileSlice,
String baseCommitTime) |
protected HoodieLogFormat.Writer |
createLogWriter(Option<FileSlice> fileSlice,
String baseCommitTime,
String suffix) |
protected HoodieLogFormat.Writer |
createLogWriter(String baseCommitTime,
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() |
org.apache.hadoop.fs.FileSystem |
getFileSystem() |
HoodieTableMetaClient |
getHoodieTableMetaClient() |
abstract IOType |
getIOType() |
protected int |
getPartitionId() |
String |
getPartitionPath() |
protected int |
getStageId() |
org.apache.avro.Schema |
getWriterSchema() |
org.apache.avro.Schema |
getWriterSchemaWithMetaFields() |
protected boolean |
isClosed() |
protected org.apache.hadoop.fs.Path |
makeNewFilePath(String partitionPath,
String fileName)
Make new file path with given file name.
|
org.apache.hadoop.fs.Path |
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.
|
List<WriteStatus> |
writeStatuses() |
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 org.apache.hadoop.fs.Path makeNewPath(String partitionPath)
protected org.apache.hadoop.fs.Path 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> writeStatuses()
public String getPartitionPath()
public abstract IOType getIOType()
public org.apache.hadoop.fs.FileSystem getFileSystem()
getFileSystem 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(Option<FileSlice> fileSlice, String baseCommitTime) throws IOException
IOExceptionprotected HoodieLogFormat.Writer createLogWriter(Option<FileSlice> fileSlice, String baseCommitTime, String suffix) throws IOException
IOExceptionprotected HoodieLogFormat.Writer createLogWriter(String baseCommitTime, String fileSuffix)
protected static Option<org.apache.avro.generic.IndexedRecord> toAvroRecord(HoodieRecord record, org.apache.avro.Schema writerSchema, TypedProperties props)
Copyright © 2023 The Apache Software Foundation. All rights reserved.