Class PaxosUncommittedTracker
- java.lang.Object
-
- org.apache.cassandra.service.paxos.uncommitted.PaxosUncommittedTracker
-
public class PaxosUncommittedTracker extends java.lang.Object
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 Modifier and Type Class Description static interface
PaxosUncommittedTracker.UpdateSupplier
-
Constructor Summary
Constructors Constructor Description PaxosUncommittedTracker(File dataDirectory)
PaxosUncommittedTracker(File dataDirectory, com.google.common.collect.ImmutableMap<TableId,UncommittedTableData> tableStates)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description File
getDirectory()
boolean
hasInflightAutoRepairs()
boolean
isAutoRepairsEnabled()
boolean
isStateFlushEnabled()
static PaxosUncommittedTracker
load(File dataDirectory)
void
rebuild(java.util.Iterator<PaxosKeyState> iterator)
void
setAutoRepairsEnabled(boolean autoRepairsEnabled)
void
setStateFlushEnabled(boolean enabled)
void
start()
void
startAutoRepairs()
java.util.Set<TableId>
tableIds()
static void
truncate(File dataDirectory)
CloseableIterator<UncommittedPaxosKey>
uncommittedKeyIterator(TableId tableId, java.util.Collection<Range<Token>> ranges)
static PaxosUncommittedTracker.UpdateSupplier
unsafGetUpdateSupplier()
static void
unsafSetUpdateSupplier(PaxosUncommittedTracker.UpdateSupplier updateSupplier)
-
-
-
Constructor Detail
-
PaxosUncommittedTracker
public PaxosUncommittedTracker(File dataDirectory, com.google.common.collect.ImmutableMap<TableId,UncommittedTableData> tableStates)
-
PaxosUncommittedTracker
public PaxosUncommittedTracker(File dataDirectory)
-
-
Method Detail
-
getDirectory
public File getDirectory()
-
truncate
public static void truncate(File dataDirectory)
-
load
public static PaxosUncommittedTracker load(File dataDirectory)
-
uncommittedKeyIterator
public CloseableIterator<UncommittedPaxosKey> uncommittedKeyIterator(TableId tableId, java.util.Collection<Range<Token>> ranges)
-
start
public void start()
-
rebuild
public void rebuild(java.util.Iterator<PaxosKeyState> iterator) throws java.io.IOException
- Throws:
java.io.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
public java.util.Set<TableId> tableIds()
-
unsafGetUpdateSupplier
public static PaxosUncommittedTracker.UpdateSupplier unsafGetUpdateSupplier()
-
unsafSetUpdateSupplier
public static void unsafSetUpdateSupplier(PaxosUncommittedTracker.UpdateSupplier updateSupplier)
-
-