|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectvoldemort.utils.ConsistencyCheck
public class ConsistencyCheck
Nested Class Summary | |
---|---|
protected static class |
ConsistencyCheck.ClusterNode
Used to track nodes that may share the same nodeId in different clusters |
static class |
ConsistencyCheck.ComparisonType
|
protected static class |
ConsistencyCheck.ConsistencyLevel
|
static class |
ConsistencyCheck.HashedValue
A class to save version and value hash It is used to compare versions by the value hash |
protected static class |
ConsistencyCheck.KeyFetchTracker
A class to track what keys have been fetched and what keys will not appear any more. |
protected static class |
ConsistencyCheck.Reporter
Used to report bad keys, progress, and statistics |
protected static class |
ConsistencyCheck.RetentionChecker
A checker to determine if a key is to be cleaned according to retention policy |
static class |
ConsistencyCheck.Value
|
class |
ConsistencyCheck.ValueFactory
|
static class |
ConsistencyCheck.VersionValue
|
Constructor Summary | |
---|---|
ConsistencyCheck(java.util.List<java.lang.String> urls,
java.lang.String storeName,
int partitionId,
java.io.Writer badKeyWriter,
ConsistencyCheck.ComparisonType comparisonType)
|
Method Summary | |
---|---|
static void |
cleanIneligibleKeys(java.util.Map<ByteArray,java.util.Map<ConsistencyCheck.Value,java.util.Set<ConsistencyCheck.ClusterNode>>> keyVersionNodeSetMap,
int requiredWrite)
Determine if a key version is invalid by comparing the version's existance and required writes configuration |
void |
connect()
Connect to the clusters using given urls and start fetching process on correct nodes |
static ConsistencyCheck.ConsistencyLevel |
determineConsistency(java.util.Map<ConsistencyCheck.Value,java.util.Set<ConsistencyCheck.ClusterNode>> versionNodeSetMap,
int replicationFactor)
Determine the consistency level of a key |
ConsistencyCheck.Reporter |
execute()
Run consistency check on connected key-value iterators |
static java.lang.String |
keyVersionToString(ByteArray key,
java.util.Map<ConsistencyCheck.Value,java.util.Set<ConsistencyCheck.ClusterNode>> versionMap,
java.lang.String storeName,
java.lang.Integer partitionId)
Convert a key-version-nodeSet information to string |
static void |
main(java.lang.String[] args)
|
void |
recordFetch(ConsistencyCheck.ClusterNode clusterNode,
ByteArray key,
Versioned<byte[]> versioned)
|
void |
trySweepAll()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ConsistencyCheck(java.util.List<java.lang.String> urls, java.lang.String storeName, int partitionId, java.io.Writer badKeyWriter, ConsistencyCheck.ComparisonType comparisonType)
Method Detail |
---|
public void connect() throws java.lang.Exception
java.lang.Exception
- When no such store is foundpublic ConsistencyCheck.Reporter execute() throws java.io.IOException
java.io.IOException
public void trySweepAll()
public void recordFetch(ConsistencyCheck.ClusterNode clusterNode, ByteArray key, Versioned<byte[]> versioned)
public static ConsistencyCheck.ConsistencyLevel determineConsistency(java.util.Map<ConsistencyCheck.Value,java.util.Set<ConsistencyCheck.ClusterNode>> versionNodeSetMap, int replicationFactor)
versionNodeSetMap
- A map that maps version to set of PrefixNodesreplicationFactor
- Total replication factor for the set of clusters
public static void cleanIneligibleKeys(java.util.Map<ByteArray,java.util.Map<ConsistencyCheck.Value,java.util.Set<ConsistencyCheck.ClusterNode>>> keyVersionNodeSetMap, int requiredWrite)
keyVersionNodeSetMap
- A map that contains keys mapping to a map
that maps versions to set of PrefixNodesrequiredWrite
- Required Write configurationpublic static void main(java.lang.String[] args) throws java.lang.Exception
java.lang.Exception
public static java.lang.String keyVersionToString(ByteArray key, java.util.Map<ConsistencyCheck.Value,java.util.Set<ConsistencyCheck.ClusterNode>> versionMap, java.lang.String storeName, java.lang.Integer partitionId)
key
- The keyversionMap
- mapping versions to set of PrefixNodesstoreName
- store's namepartitionId
- partition scanned
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |