public class TransactionEdit extends Object implements org.apache.hadoop.io.Writable
TransactionLog
.Modifier and Type | Class and Description |
---|---|
static class |
TransactionEdit.State
The possible state changes for a transaction.
|
Constructor and Description |
---|
TransactionEdit() |
Modifier and Type | Method and Description |
---|---|
static TransactionEdit |
convertCaskTxEdit(TransactionEdit txEdit)
Deprecated.
|
static TransactionEdit |
createAborted(long writePointer,
TransactionType type,
long[] checkpointPointers)
Creates a new instance in the
TransactionEdit.State.ABORTED state. |
static TransactionEdit |
createCheckpoint(long writePointer,
long parentWritePointer)
Creates a new instance in the
TransactionEdit.State.CHECKPOINT state. |
static TransactionEdit |
createCommitted(long writePointer,
Set<ChangeId> changes,
long nextWritePointer,
boolean canCommit)
Creates a new instance in the
TransactionEdit.State.COMMITTED state. |
static TransactionEdit |
createCommitting(long writePointer,
Set<ChangeId> changes)
Creates a new instance in the
TransactionEdit.State.COMMITTING state. |
static TransactionEdit |
createInvalid(long writePointer)
Creates a new instance in the
TransactionEdit.State.INVALID state. |
static TransactionEdit |
createMoveWatermark(long writePointer)
Creates a new instance in the
TransactionEdit.State.MOVE_WATERMARK state. |
static TransactionEdit |
createStarted(long writePointer,
long visibilityUpperBound,
long expirationDate,
TransactionType type)
Creates a new instance in the
TransactionEdit.State.INPROGRESS state. |
static TransactionEdit |
createTruncateInvalidTx(Set<Long> truncateInvalidTx)
Creates a new instance in the
TransactionEdit.State.TRUNCATE_INVALID_TX state. |
static TransactionEdit |
createTruncateInvalidTxBefore(long truncateInvalidTxTime)
Creates a new instance in the
TransactionEdit.State.TRUNCATE_INVALID_TX state. |
boolean |
equals(Object o) |
boolean |
getCanCommit()
Returns whether or not the transaction should be moved to the committed set.
|
Set<ChangeId> |
getChanges() |
long[] |
getCheckpointPointers()
Returns the checkpoint write pointers for the edit.
|
long |
getCommitPointer()
Returns the write pointer used to commit the row key change set.
|
long |
getExpiration()
Returns any expiration timestamp (in milliseconds) associated with the state change.
|
long |
getParentWritePointer()
Returns the parent write pointer for a checkpoint operation.
|
TransactionEdit.State |
getState()
Returns the type of state change represented.
|
Set<Long> |
getTruncateInvalidTx()
Returns the transaction ids to be removed from invalid transaction list.
|
long |
getTruncateInvalidTxTime()
Returns the time until which the invalid transactions need to be truncated from invalid transaction list.
|
TransactionType |
getType()
Returns the transaction type.
|
long |
getVisibilityUpperBound() |
long |
getWritePointer()
Returns the transaction write pointer assigned for the state change.
|
int |
hashCode() |
void |
readFields(DataInput in) |
String |
toString() |
void |
write(DataOutput out) |
public long getWritePointer()
public long getVisibilityUpperBound()
public TransactionEdit.State getState()
public long getExpiration()
TransactionEdit.State.INPROGRESS
.public Set<ChangeId> getChanges()
TransactionEdit.State.COMMITTING
or TransactionEdit.State.COMMITTED
.public long getCommitPointer()
TransactionEdit.State.COMMITTED
.public boolean getCanCommit()
TransactionEdit.State.COMMITTED
.public TransactionType getType()
TransactionEdit.State.INPROGRESS
or
TransactionEdit.State.ABORTED
.public Set<Long> getTruncateInvalidTx()
TransactionEdit.State.TRUNCATE_INVALID_TX
public long getTruncateInvalidTxTime()
TransactionEdit.State.TRUNCATE_INVALID_TX
public long getParentWritePointer()
TransactionEdit.State.CHECKPOINT
public long[] getCheckpointPointers()
TransactionEdit.State.ABORTED
.public static TransactionEdit createStarted(long writePointer, long visibilityUpperBound, long expirationDate, TransactionType type)
TransactionEdit.State.INPROGRESS
state.public static TransactionEdit createCommitting(long writePointer, Set<ChangeId> changes)
TransactionEdit.State.COMMITTING
state.public static TransactionEdit createCommitted(long writePointer, Set<ChangeId> changes, long nextWritePointer, boolean canCommit)
TransactionEdit.State.COMMITTED
state.public static TransactionEdit createAborted(long writePointer, TransactionType type, long[] checkpointPointers)
TransactionEdit.State.ABORTED
state.public static TransactionEdit createInvalid(long writePointer)
TransactionEdit.State.INVALID
state.public static TransactionEdit createMoveWatermark(long writePointer)
TransactionEdit.State.MOVE_WATERMARK
state.public static TransactionEdit createTruncateInvalidTx(Set<Long> truncateInvalidTx)
TransactionEdit.State.TRUNCATE_INVALID_TX
state.public static TransactionEdit createTruncateInvalidTxBefore(long truncateInvalidTxTime)
TransactionEdit.State.TRUNCATE_INVALID_TX
state.public static TransactionEdit createCheckpoint(long writePointer, long parentWritePointer)
TransactionEdit.State.CHECKPOINT
state.@Deprecated public static TransactionEdit convertCaskTxEdit(TransactionEdit txEdit)
TransactionEdit
.public void write(DataOutput out) throws IOException
write
in interface org.apache.hadoop.io.Writable
IOException
public void readFields(DataInput in) throws IOException
readFields
in interface org.apache.hadoop.io.Writable
IOException
Copyright © 2016 The Apache Software Foundation. All rights reserved.