@Evolving public interface CommitCoordinatorClientHandler
Modifier and Type | Method and Description |
---|---|
void |
backfillToVersion(String logPath,
java.util.Map<String,String> tableConf,
long version,
Long lastKnownBackfilledVersion)
Requests the commit coordinator client to backfill commits up to a specified version.
|
CommitResponse |
commit(String logPath,
java.util.Map<String,String> tableConf,
long commitVersion,
CloseableIterator<Row> actions,
UpdatedActions updatedActions)
Commits a set of actions to a specified table at a given version.
|
GetCommitsResponse |
getCommits(String logPath,
java.util.Map<String,String> tableConf,
Long startVersion,
Long endVersion)
Retrieves unbackfilled commits for a specified table within a given version range.
|
java.util.Map<String,String> |
registerTable(String logPath,
long currentVersion,
AbstractMetadata currentMetadata,
AbstractProtocol currentProtocol)
API to register the table represented by the given `logPath` at the provided
currentTableVersion with the commit coordinator this commit coordinator client represents.
|
boolean |
semanticEquals(CommitCoordinatorClientHandler other)
Compares this
CommitCoordinatorClientHandler for semantic equality with another
instance. |
java.util.Map<String,String> registerTable(String logPath, long currentVersion, AbstractMetadata currentMetadata, AbstractProtocol currentProtocol)
This API is called when the table is being converted from a file system table to a coordinated-commit table.
When a new coordinated-commit table is being created, the currentTableVersion will be -1 and the upgrade commit needs to be a file system commit which will write the backfilled file directly.
logPath
- The path to the delta log of the table that should be convertedcurrentVersion
- The currentTableVersion is the version of the table just before
conversion. currentTableVersion + 1 represents the commit that will do the conversion. This
must be backfilled atomically. currentTableVersion + 2 represents the first commit after
conversion. This will go through the CommitCoordinatorClient and the client is free to
choose when it wants to backfill this commit.currentMetadata
- The metadata of the table at currentTableVersioncurrentProtocol
- The protocol of the table at currentTableVersioncommit(java.lang.String, java.util.Map<java.lang.String, java.lang.String>, long, io.delta.kernel.utils.CloseableIterator<io.delta.kernel.data.Row>, io.delta.kernel.engine.coordinatedcommits.UpdatedActions)
, getCommits(java.lang.String, java.util.Map<java.lang.String, java.lang.String>, java.lang.Long, java.lang.Long)
, and backfillToVersion(java.lang.String, java.util.Map<java.lang.String, java.lang.String>, long, java.lang.Long)
APIs to
identify the table.CommitResponse commit(String logPath, java.util.Map<String,String> tableConf, long commitVersion, CloseableIterator<Row> actions, UpdatedActions updatedActions) throws CommitFailedException
This method applies the provided actions to the table identified by logPath
as given
table version commitVersion
.
logPath
- The path to the delta log of the target tabletableConf
- Configuration details returned by the commit coordinator client during table
registrationcommitVersion
- The version of the commit that is being committed.actions
- The set of actions to be committedupdatedActions
- Additional information for the commit, including:
CommitFailedException
- if the commit operation failsGetCommitsResponse getCommits(String logPath, java.util.Map<String,String> tableConf, Long startVersion, Long endVersion)
This method fetches commits that have not yet been backfilled for the table identified by
logPath
. It returns commits between startVersion
and endVersion
(inclusive), ignoring commits outside this range. The returned commits are guaranteed to be
contiguous and in ascending version order.
Note: The first returned version may not equal startVersion
if some
versions have already been backfilled and are no longer tracked by the commit coordinator.
The latestTableVersion
in the response represents the highest commit version
ratified by the commit coordinator. A value of -1 is only valid if the commit coordinator has
never ratified any version (i.e., never accepted any unbackfilled commit).
logPath
- The path to the delta log of the target tabletableConf
- The table configuration returned by the commit coordinator during registrationstartVersion
- The minimum commit version to retrieve (inclusive, can be null)endVersion
- The maximum commit version to retrieve (inclusive, can be null)Commit
objects
latestTableVersion
tracked by CommitCoordinatorClientHandler
void backfillToVersion(String logPath, java.util.Map<String,String> tableConf, long version, Long lastKnownBackfilledVersion) throws java.io.IOException
This method instructs the commit coordinator client to backfill all commits up to the given
version
and notify the commit coordinator of the completion. A successful return from
this method guarantees that the backfill has been completed, even if the commit coordinator
hasn't been notified yet.
logPath
- The path to the delta log of the table to be backfilledtableConf
- The table configuration returned by the commit coordinator during registrationversion
- The target version up to which commits should be backfilledlastKnownBackfilledVersion
- The most recent version known to be backfilled before this
call. If null or invalid, the client will backfill from the table's beginning. Can be null.java.io.IOException
- if the backfill operation fails
Note: A successful return indicates backfill completion, but the commit coordinator may not be immediately aware of this update.
boolean semanticEquals(CommitCoordinatorClientHandler other)
CommitCoordinatorClientHandler
for semantic equality with another
instance.
Semantic equality is defined by the specific implementation of CommitCoordinatorClientHandler
. Two instances are considered semantically equal if they can be
used interchangeably for any CommitCoordinatorClientHandler
API, including but not
limited to:
commit(java.lang.String, java.util.Map<java.lang.String, java.lang.String>, long, io.delta.kernel.utils.CloseableIterator<io.delta.kernel.data.Row>, io.delta.kernel.engine.coordinatedcommits.UpdatedActions)
getCommits(java.lang.String, java.util.Map<java.lang.String, java.lang.String>, java.lang.Long, java.lang.Long)
For example, semantic equality might be based on both instances pointing to the same underlying endpoint.
other
- The CommitCoordinatorClientHandler
to compare with this instance