public class ValidReaderWriteIdList extends Object implements ValidWriteIdList
ValidWriteIdList for use by readers.
This class will view a write id as valid only if it maps to committed transaction.
Write ids of both open and aborted transactions will be seen as invalid.ValidWriteIdList.RangeResponse| Modifier and Type | Field and Description |
|---|---|
protected BitSet |
abortedBits |
protected long[] |
exceptions |
protected long |
highWatermark |
VALID_WRITEIDS_KEY| Constructor and Description |
|---|
ValidReaderWriteIdList()
This seems like a bad c'tor.
|
ValidReaderWriteIdList(String value) |
ValidReaderWriteIdList(String tableName,
long[] exceptions,
BitSet abortedBits,
long highWatermark)
Used if there are no open write ids in the snapshot.
|
ValidReaderWriteIdList(String tableName,
long[] exceptions,
BitSet abortedBits,
long highWatermark,
long minOpenWriteId) |
| Modifier and Type | Method and Description |
|---|---|
long |
getHighWatermark()
Get the largest write id used.
|
long[] |
getInvalidWriteIds()
Get the list of write ids under the high water mark that are not valid.
|
Long |
getMinOpenWriteId()
The smallest open write id.
|
String |
getTableName()
Get the table for which the ValidWriteIdList is formed
|
boolean |
isValidBase(long writeId)
We cannot use a base file if its range contains an open write id.
|
boolean |
isWriteIdAborted(long writeId)
Indicates whether a given write maps to aborted transaction.
|
ValidWriteIdList.RangeResponse |
isWriteIdRangeAborted(long minWriteId,
long maxWriteId)
Find out if a range of write ids are aborted.
|
ValidWriteIdList.RangeResponse |
isWriteIdRangeValid(long minWriteId,
long maxWriteId)
Find out if a range of write ids are valid.
|
boolean |
isWriteIdValid(long writeId)
Indicates whether a given write ID is valid.
|
void |
readFromString(String src)
Populate this ValidWriteIdList from the string.
|
String |
toString() |
ValidReaderWriteIdList |
updateHighWatermark(long value) |
String |
writeToString()
Write this ValidWriteIdList into a string.
|
protected long[] exceptions
protected BitSet abortedBits
protected long highWatermark
public ValidReaderWriteIdList()
public ValidReaderWriteIdList(String tableName, long[] exceptions, BitSet abortedBits, long highWatermark)
public ValidReaderWriteIdList(String tableName, long[] exceptions, BitSet abortedBits, long highWatermark, long minOpenWriteId)
public ValidReaderWriteIdList(String value)
public boolean isWriteIdValid(long writeId)
ValidWriteIdListisWriteIdValid in interface ValidWriteIdListwriteId - write ID of the tablepublic boolean isValidBase(long writeId)
isValidBase in interface ValidWriteIdListwriteId - from base_xxxxpublic ValidWriteIdList.RangeResponse isWriteIdRangeValid(long minWriteId, long maxWriteId)
ValidWriteIdListisWriteIdRangeValid in interface ValidWriteIdListminWriteId - minimum write ID to look for, inclusivemaxWriteId - maximum write ID to look for, inclusivepublic String writeToString()
ValidWriteIdListValidWriteIdList.readFromString(String) to populate a ValidWriteIdList.writeToString in interface ValidWriteIdListpublic void readFromString(String src)
ValidWriteIdListValidWriteIdList.writeToString() and the exceptions list is sorted.readFromString in interface ValidWriteIdListsrc - source string.public String getTableName()
ValidWriteIdListgetTableName in interface ValidWriteIdListpublic long getHighWatermark()
ValidWriteIdListgetHighWatermark in interface ValidWriteIdListpublic long[] getInvalidWriteIds()
ValidWriteIdListgetInvalidWriteIds in interface ValidWriteIdListpublic Long getMinOpenWriteId()
ValidWriteIdListgetMinOpenWriteId in interface ValidWriteIdListnull if there is none.public boolean isWriteIdAborted(long writeId)
ValidWriteIdListisWriteIdAborted in interface ValidWriteIdListwriteId - write id to be validatedpublic ValidWriteIdList.RangeResponse isWriteIdRangeAborted(long minWriteId, long maxWriteId)
ValidWriteIdListisWriteIdRangeAborted in interface ValidWriteIdListminWriteId - minimum write Id to look for, inclusivemaxWriteId - maximum write Id to look for, inclusivepublic ValidReaderWriteIdList updateHighWatermark(long value)
Copyright © 2021 The Apache Software Foundation. All rights reserved.