Class PaxosUncommittedTracker
java.lang.Object
org.apache.cassandra.service.paxos.uncommitted.PaxosUncommittedTracker
Tracks uncommitted paxos operations to enable operation completion as part of repair by returning an iterator of
partition keys with uncommitted paxos operations (and their consistency levels) for a given table and token range(s)
There are 2 parts to the uncommitted states it tracks: operations flushed to disk, and updates still in memory. This
class handles merging these two sources for queries and for merging states as part of flush. In practice, in memory
updates are the contents of the system.paxos memtables, although this has been generalized into an "UpdateSupplier"
interface to accomodate testing.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionPaxosUncommittedTracker(File dataDirectory) PaxosUncommittedTracker(File dataDirectory, com.google.common.collect.ImmutableMap<TableId, UncommittedTableData> tableStates) -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanbooleanstatic PaxosUncommittedTrackervoidrebuild(Iterator<PaxosKeyState> iterator) voidsetAutoRepairsEnabled(boolean autoRepairsEnabled) voidsetStateFlushEnabled(boolean enabled) voidstart()voidtableIds()static voiduncommittedKeyIterator(TableId tableId, Collection<Range<Token>> ranges) static voidunsafSetUpdateSupplier(PaxosUncommittedTracker.UpdateSupplier updateSupplier)
-
Constructor Details
-
PaxosUncommittedTracker
public PaxosUncommittedTracker(File dataDirectory, com.google.common.collect.ImmutableMap<TableId, UncommittedTableData> tableStates) -
PaxosUncommittedTracker
-
-
Method Details
-
getDirectory
-
truncate
-
load
-
uncommittedKeyIterator
public CloseableIterator<UncommittedPaxosKey> uncommittedKeyIterator(TableId tableId, Collection<Range<Token>> ranges) -
start
public void start() -
rebuild
- Throws:
IOException
-
startAutoRepairs
public void startAutoRepairs() -
hasInflightAutoRepairs
public boolean hasInflightAutoRepairs() -
isAutoRepairsEnabled
public boolean isAutoRepairsEnabled() -
setAutoRepairsEnabled
public void setAutoRepairsEnabled(boolean autoRepairsEnabled) -
isStateFlushEnabled
public boolean isStateFlushEnabled() -
setStateFlushEnabled
public void setStateFlushEnabled(boolean enabled) -
tableIds
-
unsafGetUpdateSupplier
-
unsafSetUpdateSupplier
-