|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectvoldemort.store.AbstractStore<K,V,T>
voldemort.store.AbstractStorageEngine<ByteArray,byte[],byte[]>
voldemort.store.metadata.MetadataStore
public class MetadataStore
MetadataStore maintains metadata for Voldemort Server.
Metadata is persisted as strings in inner store for ease of readability.
Metadata Store keeps an in memory write-through-cache for performance.
Nested Class Summary | |
---|---|
static class |
MetadataStore.VoldemortState
|
Field Summary | |
---|---|
static java.lang.String |
CLUSTER_KEY
|
static java.util.Set<java.lang.String> |
GOSSIP_KEYS
|
static java.util.Set<java.lang.Object> |
METADATA_KEYS
|
static java.lang.String |
METADATA_STORE_NAME
|
static java.lang.String |
NODE_ID_KEY
|
static java.util.Set<java.lang.String> |
OPTIONAL_KEYS
|
java.util.concurrent.locks.Lock |
readLock
|
static java.lang.String |
REBALANCING_SOURCE_CLUSTER_XML
|
static java.lang.String |
REBALANCING_SOURCE_STORES_XML
|
static java.lang.String |
REBALANCING_STEAL_INFO
|
static java.util.Set<java.lang.String> |
REQUIRED_KEYS
|
static java.lang.String |
SERVER_STATE_KEY
|
static java.lang.String |
STORE_DEFINITIONS_STORE_NAME
|
static java.lang.String |
STORES_KEY
|
static java.lang.String |
SYSTEM_STORES_KEY
|
java.util.concurrent.locks.Lock |
writeLock
|
Constructor Summary | |
---|---|
MetadataStore(Store<java.lang.String,java.lang.String,java.lang.String> innerStore,
int nodeId)
|
|
MetadataStore(Store<java.lang.String,java.lang.String,java.lang.String> innerStore,
StorageEngine<java.lang.String,java.lang.String,java.lang.String> storeDefinitionsStorageEngine,
int nodeId)
|
Method Summary | |
---|---|
void |
addMetadataStoreListener(java.lang.String storeName,
MetadataStoreListener listener)
|
void |
addRebalancingState(RebalanceTaskInfo stealInfo)
Add the steal information to the rebalancer state |
void |
addStoreDefinition(StoreDefinition storeDef)
Function to add a new Store to the Metadata store. |
void |
cleanAllRebalancingState()
|
void |
close()
Close the store. |
boolean |
delete(ByteArray key,
Version version)
Delete all entries prior to the given version |
void |
deleteRebalancingState(RebalanceTaskInfo stealInfo)
Delete the partition steal information from the rebalancer state |
void |
deleteStoreDefinition(java.lang.String storeName)
Function to delete the specified store from Metadata store. |
ClosableIterator<Pair<ByteArray,Versioned<byte[]>>> |
entries()
Get an iterator over pairs of entries in the store. |
ClosableIterator<Pair<ByteArray,Versioned<byte[]>>> |
entries(int partition)
Get an iterator over pairs of entries in a store's partition. |
java.util.List<Versioned<byte[]>> |
get(ByteArray keyBytes,
byte[] transforms)
Get the value associated with the given key |
java.util.List<Versioned<byte[]>> |
get(java.lang.String key,
java.lang.String transforms)
|
java.util.Map<ByteArray,java.util.List<Versioned<byte[]>>> |
getAll(java.lang.Iterable<ByteArray> keys,
java.util.Map<ByteArray,byte[]> transforms)
Get the values associated with the given keys and returns them in a Map of keys to a list of versioned values. |
java.lang.Object |
getCapability(StoreCapabilityType capability)
Get some capability of the store. |
Cluster |
getCluster()
|
java.lang.String |
getName()
|
int |
getNodeId()
|
RebalancerState |
getRebalancerState()
|
Cluster |
getRebalancingSourceCluster()
|
java.util.List<StoreDefinition> |
getRebalancingSourceStores()
|
RoutingStrategy |
getRoutingStrategy(java.lang.String storeName)
|
MetadataStore.VoldemortState |
getServerStateLocked()
|
MetadataStore.VoldemortState |
getServerStateUnlocked()
|
StoreDefinition |
getStoreDef(java.lang.String storeName)
|
java.util.List<StoreDefinition> |
getStoreDefList()
|
java.util.List<StoreDefinition> |
getSystemStoreDefList()
|
java.util.List<Version> |
getVersions(ByteArray key)
Get the versions associated with the given key. |
boolean |
isValidStore(java.lang.String name)
Utility function to validate if the given store name exists in the store name list managed by MetadataStore. |
ClosableIterator<ByteArray> |
keys()
Get an iterator over keys in the store. |
ClosableIterator<ByteArray> |
keys(int partition)
Get an iterator over keys in the store's partition Note that the iterator need not be threadsafe, and that it must be manually closed after use. |
void |
put(ByteArray keyBytes,
Versioned<byte[]> valueBytes,
byte[] transforms)
A write through put to inner-store. |
void |
put(java.lang.String key,
java.lang.Object value)
helper function to read current version and put() after incrementing it for local node. |
void |
put(java.lang.String key,
Versioned<java.lang.Object> value)
helper function to convert strings to bytes as needed. |
static MetadataStore |
readFromDirectory(java.io.File dir,
int nodeId)
|
void |
removeMetadataStoreListener(java.lang.String storeName)
|
void |
truncate()
Truncate all entries in the store |
void |
updateStoreDefinitions(Versioned<byte[]> valueBytes)
Function to update store definitions. |
Methods inherited from class voldemort.store.AbstractStorageEngine |
---|
beginBatchModifications, endBatchModifications, getAndLock, isPartitionAware, isPartitionScanSupported, multiVersionPut, putAndUnlock, releaseLock, resolveAndConstructVersionsToPersist |
Methods inherited from class voldemort.store.AbstractStore |
---|
delete, get, getAll, put |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface voldemort.store.Store |
---|
delete, get, getAll, put |
Field Detail |
---|
public static final java.lang.String METADATA_STORE_NAME
public static final java.lang.String STORE_DEFINITIONS_STORE_NAME
public static final java.lang.String CLUSTER_KEY
public static final java.lang.String STORES_KEY
public static final java.lang.String SYSTEM_STORES_KEY
public static final java.lang.String SERVER_STATE_KEY
public static final java.lang.String NODE_ID_KEY
public static final java.lang.String REBALANCING_STEAL_INFO
public static final java.lang.String REBALANCING_SOURCE_CLUSTER_XML
public static final java.lang.String REBALANCING_SOURCE_STORES_XML
public static final java.util.Set<java.lang.String> GOSSIP_KEYS
public static final java.util.Set<java.lang.String> REQUIRED_KEYS
public static final java.util.Set<java.lang.String> OPTIONAL_KEYS
public static final java.util.Set<java.lang.Object> METADATA_KEYS
public final java.util.concurrent.locks.Lock readLock
public final java.util.concurrent.locks.Lock writeLock
Constructor Detail |
---|
public MetadataStore(Store<java.lang.String,java.lang.String,java.lang.String> innerStore, StorageEngine<java.lang.String,java.lang.String,java.lang.String> storeDefinitionsStorageEngine, int nodeId)
public MetadataStore(Store<java.lang.String,java.lang.String,java.lang.String> innerStore, int nodeId)
Method Detail |
---|
public void addMetadataStoreListener(java.lang.String storeName, MetadataStoreListener listener)
public void removeMetadataStoreListener(java.lang.String storeName)
public static MetadataStore readFromDirectory(java.io.File dir, int nodeId)
public java.lang.String getName()
getName
in interface Store<ByteArray,byte[],byte[]>
getName
in class AbstractStore<ByteArray,byte[],byte[]>
public void put(java.lang.String key, Versioned<java.lang.Object> value)
key
- value
- public void updateStoreDefinitions(Versioned<byte[]> valueBytes)
valueBytes
- specifies the bytes of the stores.xml containing
updates for the specified storespublic void put(java.lang.String key, java.lang.Object value)
key
- value
- public void put(ByteArray keyBytes, Versioned<byte[]> valueBytes, byte[] transforms) throws VoldemortException
put
in interface Store<ByteArray,byte[],byte[]>
put
in class AbstractStore<ByteArray,byte[],byte[]>
keyBytes
- : keyName strings serialized as bytes eg. 'cluster.xml'valueBytes
- : versioned byte[] eg. UTF bytes for cluster xml
definitions
VoldemortException
public void close() throws VoldemortException
Store
close
in interface Store<ByteArray,byte[],byte[]>
close
in class AbstractStore<ByteArray,byte[],byte[]>
VoldemortException
- If closing fails.public java.lang.Object getCapability(StoreCapabilityType capability)
Store
getCapability
in interface Store<ByteArray,byte[],byte[]>
getCapability
in class AbstractStore<ByteArray,byte[],byte[]>
capability
- The capability type to retrieve
public java.util.List<Versioned<byte[]>> get(ByteArray keyBytes, byte[] transforms) throws VoldemortException
Store
get
in interface Store<ByteArray,byte[],byte[]>
get
in class AbstractStore<ByteArray,byte[],byte[]>
keyBytes
- : keyName strings serialized as bytes eg. 'cluster.xml'
VoldemortException
public java.util.List<Versioned<byte[]>> get(java.lang.String key, java.lang.String transforms) throws VoldemortException
VoldemortException
public void cleanAllRebalancingState()
public java.util.List<Version> getVersions(ByteArray key)
Store
getVersions
in interface Store<ByteArray,byte[],byte[]>
getVersions
in class AbstractStore<ByteArray,byte[],byte[]>
key
- The key to retrieve the versions for
public Cluster getCluster()
public java.util.List<StoreDefinition> getStoreDefList()
public java.util.List<StoreDefinition> getSystemStoreDefList()
public int getNodeId()
public StoreDefinition getStoreDef(java.lang.String storeName)
public MetadataStore.VoldemortState getServerStateLocked()
public MetadataStore.VoldemortState getServerStateUnlocked()
public RebalancerState getRebalancerState()
public Cluster getRebalancingSourceCluster()
public java.util.List<StoreDefinition> getRebalancingSourceStores()
public RoutingStrategy getRoutingStrategy(java.lang.String storeName)
public void addRebalancingState(RebalanceTaskInfo stealInfo)
stealInfo
- The steal information to addpublic void deleteRebalancingState(RebalanceTaskInfo stealInfo)
stealInfo
- The steal information to deletepublic void addStoreDefinition(StoreDefinition storeDef)
storeDef
- defines the new store to be createdpublic void deleteStoreDefinition(java.lang.String storeName)
storeName
- specifies name of the store to be deleted.public ClosableIterator<Pair<ByteArray,Versioned<byte[]>>> entries()
StorageEngine
entries
in interface StorageEngine<ByteArray,byte[],byte[]>
entries
in class AbstractStorageEngine<ByteArray,byte[],byte[]>
public ClosableIterator<ByteArray> keys()
StorageEngine
keys
in interface StorageEngine<ByteArray,byte[],byte[]>
keys
in class AbstractStorageEngine<ByteArray,byte[],byte[]>
public ClosableIterator<Pair<ByteArray,Versioned<byte[]>>> entries(int partition)
StorageEngine
entries
in interface StorageEngine<ByteArray,byte[],byte[]>
entries
in class AbstractStorageEngine<ByteArray,byte[],byte[]>
partition
- partition whose entries are to be fetched
public ClosableIterator<ByteArray> keys(int partition)
StorageEngine
keys
in interface StorageEngine<ByteArray,byte[],byte[]>
keys
in class AbstractStorageEngine<ByteArray,byte[],byte[]>
partition
- partition whose keys are to be fetched
public void truncate()
StorageEngine
truncate
in interface StorageEngine<ByteArray,byte[],byte[]>
truncate
in class AbstractStorageEngine<ByteArray,byte[],byte[]>
public boolean delete(ByteArray key, Version version) throws VoldemortException
Store
delete
in interface Store<ByteArray,byte[],byte[]>
delete
in class AbstractStore<ByteArray,byte[],byte[]>
key
- The key to deleteversion
- The current value of the key
VoldemortException
public java.util.Map<ByteArray,java.util.List<Versioned<byte[]>>> getAll(java.lang.Iterable<ByteArray> keys, java.util.Map<ByteArray,byte[]> transforms) throws VoldemortException
Store
getAll
in interface Store<ByteArray,byte[],byte[]>
getAll
in class AbstractStore<ByteArray,byte[],byte[]>
keys
- The keys to check for.
VoldemortException
public boolean isValidStore(java.lang.String name)
name
- Name of the store to validate
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |