public interface TransactionStateStorage
extends com.google.common.util.concurrent.Service
| Modifier and Type | Method and Description |
|---|---|
TransactionLog |
createLog(long timestamp)
Creates a new
TransactionLog. |
void |
deleteLogsOlderThan(long timestamp)
Removes any transaction logs with a timestamp older than the given value.
|
long |
deleteOldSnapshots(int numberToKeep)
Removes any snapshots prior to the
numberToKeep most recent. |
TransactionSnapshot |
getLatestSnapshot()
Returns the most recent snapshot that has been successfully written.
|
TransactionVisibilityState |
getLatestTransactionVisibilityState()
Returns the most recent transaction visibility state that has been successfully written.
|
String |
getLocation()
Returns a string representation of the location used for persistence.
|
List<TransactionLog> |
getLogsSince(long timestamp)
Returns all
TransactionLogs with a timestamp greater than or equal to the given timestamp. |
List<String> |
listLogs()
Returns the (non-qualified) names of available logs.
|
List<String> |
listSnapshots()
Returns the (non-qualified) names of available snapshots.
|
void |
setupStorage()
Create the directories required for the transaction state stage.
|
void |
writeSnapshot(OutputStream out,
TransactionSnapshot snapshot)
Persists a snapshot of transaction state to an output stream.
|
void |
writeSnapshot(TransactionSnapshot snapshot)
Persists a snapshot of transaction state.
|
void writeSnapshot(OutputStream out, TransactionSnapshot snapshot) throws IOException
IOExceptionvoid writeSnapshot(TransactionSnapshot snapshot) throws IOException
IOExceptionTransactionSnapshot getLatestSnapshot() throws IOException
null
if no completed snapshot files are found.IOExceptionTransactionVisibilityState getLatestTransactionVisibilityState() throws IOException
null if no completed snapshot files are found.TransactionVisibilityStateIOExceptionlong deleteOldSnapshots(int numberToKeep)
throws IOException
numberToKeep most recent.numberToKeep - The number of most recent snapshots to keep.IOException - If an error occurs while deleting old snapshots.List<String> listSnapshots() throws IOException
IOExceptionList<TransactionLog> getLogsSince(long timestamp) throws IOException
TransactionLogs with a timestamp greater than or equal to the given timestamp. Note that
the returned list is guaranteed to be sorted in ascending timestamp order.IOExceptionTransactionLog createLog(long timestamp) throws IOException
TransactionLog.IOExceptionList<String> listLogs() throws IOException
IOExceptionvoid deleteLogsOlderThan(long timestamp)
throws IOException
timestamp - The timestamp to delete up to. Logs with a timestamp less than this value will be removed.IOException - If an error occurs while removing logs.void setupStorage()
throws IOException
IOException - If an error occurred during the creation of required directories for transaction state storage.String getLocation()
Copyright © 2018 The Apache Software Foundation. All rights reserved.