|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectvoldemort.store.StoreUtils
public class StoreUtils
Group of store utilities
Constructor Summary | |
---|---|
StoreUtils()
|
Method Summary | ||
---|---|---|
static
|
assertValidKey(K key)
|
|
static void |
assertValidKeys(java.lang.Iterable<?> keys)
|
|
static void |
assertValidMetadata(ByteArray key,
RoutingStrategy routingStrategy,
Node currentNode)
Check if the current node is part of routing request based on cluster.xml or throw an exception. |
|
static void |
assertValidNode(MetadataStore metadataStore,
java.lang.Integer nodeId)
Check if the the nodeId is present in the cluster managed by the metadata store or throw an exception. |
|
static void |
close(java.io.Closeable c)
Closes a Closeable and logs a potential error instead of re-throwing the exception. |
|
static
|
get(Store<K,V,T> storageEngine,
K key,
T transform)
Implements get by delegating to getAll. |
|
static
|
getAll(Store<K,V,T> storageEngine,
java.lang.Iterable<K> keys,
java.util.Map<K,T> transforms)
Implements getAll by delegating to get. |
|
static StoreDefinition |
getStoreDef(java.util.List<StoreDefinition> list,
java.lang.String name)
Get a store definition from the given list of store definitions |
|
static java.util.HashMap<java.lang.String,StoreDefinition> |
getStoreDefsAsMap(java.util.List<StoreDefinition> storeDefs)
|
|
static java.util.List<java.lang.String> |
getStoreNames(java.util.List<StoreDefinition> list,
boolean ignoreViews)
Get the list of store names from a list of store definitions |
|
static
|
getVersions(java.util.List<Versioned<V>> versioneds)
|
|
static
|
keys(ClosableIterator<Pair<K,V>> values)
|
|
static
|
newEmptyHashMap(java.lang.Iterable<?> iterable)
Returns an empty map with expected size matching the iterable size if it's of type Collection. |
|
static
|
unsafeGetSerializer(SerializerFactory serializerFactory,
SerializerDefinition serializerDefinition)
This is a temporary measure until we have a type-safe solution for retrieving serializers from a SerializerFactory. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StoreUtils()
Method Detail |
---|
public static void assertValidKeys(java.lang.Iterable<?> keys)
public static <K> void assertValidKey(K key)
public static <K,V,T> java.util.List<Versioned<V>> get(Store<K,V,T> storageEngine, K key, T transform)
public static <K,V,T> java.util.Map<K,java.util.List<Versioned<V>>> getAll(Store<K,V,T> storageEngine, java.lang.Iterable<K> keys, java.util.Map<K,T> transforms)
public static <K,V> java.util.HashMap<K,V> newEmptyHashMap(java.lang.Iterable<?> iterable)
public static void close(java.io.Closeable c)
null
is passed, this method is a no-op.
This is typically used in finally blocks to prevent an exception thrown
during close from hiding an exception thrown inside the try.
c
- The Closeable to close, may be null.public static void assertValidMetadata(ByteArray key, RoutingStrategy routingStrategy, Node currentNode)
key
- The key we are checkingroutingStrategy
- The routing strategycurrentNode
- Current nodepublic static void assertValidNode(MetadataStore metadataStore, java.lang.Integer nodeId)
nodeId
- The nodeId to check existence ofpublic static <V> java.util.List<Version> getVersions(java.util.List<Versioned<V>> versioneds)
public static <K,V> ClosableIterator<K> keys(ClosableIterator<Pair<K,V>> values)
public static <T> Serializer<T> unsafeGetSerializer(SerializerFactory serializerFactory, SerializerDefinition serializerDefinition)
public static StoreDefinition getStoreDef(java.util.List<StoreDefinition> list, java.lang.String name)
list
- A list of store definitionsname
- The name of the store
public static java.util.List<java.lang.String> getStoreNames(java.util.List<StoreDefinition> list, boolean ignoreViews)
list
- ignoreViews
-
public static java.util.HashMap<java.lang.String,StoreDefinition> getStoreDefsAsMap(java.util.List<StoreDefinition> storeDefs)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |