Class CommitActionsImpl
- All Implemented Interfaces:
CommitActions,AutoCloseable
CommitActions.
This implementation owns the commit file and supports multiple calls to getActions().
The first call reuses initially-read data to avoid double I/O, while subsequent calls re-read the
commit file for memory efficiency.
Resource Management:
- Calling
getActions()transfers resource ownership to the returned iterator. - Callers MUST close the returned iterator (preferably using try-with-resources) to release file handles and other resources.
- If
getActions()is never called, callers should explicitly callclose()to release internal resources. Otherwise, resources will be released when the object is garbage collected.
-
Constructor Summary
ConstructorsConstructorDescriptionCommitActionsImpl(Engine engine, FileStatus commitFile, String tablePath, Set<DeltaLogActionUtils.DeltaAction> actionSet) Creates a CommitActions from a commit file. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes this CommitActionsImpl and releases any underlying resources.Returns an iterator over the action batches for this commit.longReturns the commit timestamp in milliseconds since Unix epoch.longReturns the commit version number.
-
Constructor Details
-
CommitActionsImpl
public CommitActionsImpl(Engine engine, FileStatus commitFile, String tablePath, Set<DeltaLogActionUtils.DeltaAction> actionSet) Creates a CommitActions from a commit file.- Parameters:
engine- the engine for file I/OcommitFile- the commit file to readtablePath- the table path for error messagesactionSet- the set of actions to read from the commit file
-
-
Method Details
-
getVersion
public long getVersion()Description copied from interface:CommitActionsReturns the commit version number.- Specified by:
getVersionin interfaceCommitActions- Returns:
- the version number of this commit
-
getTimestamp
public long getTimestamp()Description copied from interface:CommitActionsReturns the commit timestamp in milliseconds since Unix epoch.- Specified by:
getTimestampin interfaceCommitActions- Returns:
- the timestamp of this commit
-
getActions
Description copied from interface:CommitActionsReturns an iterator over the action batches for this commit.Each
ColumnarBatchcontains actions from this commit only.Note: All rows within all batches have the same version (returned by
CommitActions.getVersion()).This method can be called multiple times, and each call returns a new iterator over the same set of batches. This supports use cases like two-pass processing (e.g., validation pass followed by processing pass).
Callers are responsible for closing each iterator returned by this method. Each iterator must be closed after use to release underlying resources.
- Specified by:
getActionsin interfaceCommitActions- Returns:
- a
CloseableIteratorover columnar batches containing this commit's actions
-
close
Closes this CommitActionsImpl and releases any underlying resources.- Specified by:
closein interfaceAutoCloseable- Throws:
IOException- if an I/O error occurs while closing resources
-