|
||||||||||
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.readonly.ReadOnlyStorageEngine
public class ReadOnlyStorageEngine
A read-only store that fronts a big file
Constructor Summary | |
---|---|
ReadOnlyStorageEngine(java.lang.String name,
SearchStrategy searchStrategy,
RoutingStrategy routingStrategy,
int nodeId,
java.io.File storeDir,
int numBackups)
Create an instance of the store |
|
ReadOnlyStorageEngine(java.lang.String name,
SearchStrategy searchStrategy,
RoutingStrategy routingStrategy,
int nodeId,
java.io.File storeDir,
int numBackups,
int deleteBackupMs)
Create an instance of the store |
|
ReadOnlyStorageEngine(java.lang.String name,
SearchStrategy searchStrategy,
RoutingStrategy routingStrategy,
int nodeId,
java.io.File storeDir,
int numBackups,
int deleteBackupMs,
boolean enforceMlock)
|
Method Summary | |
---|---|
void |
close()
Close the store. |
boolean |
delete(ByteArray key,
Version version)
Not supported, throws UnsupportedOperationException if called |
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 key,
byte[] transforms)
Get the value associated with the given key |
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. |
ChunkedFileSet |
getChunkedFileSet()
Returns the internal chunked file set |
java.lang.String |
getChunkIdToNumChunks()
Returns a string representation of map of chunk id to number of chunks |
java.lang.String |
getCurrentDirPath()
Retrieve the absolute path of the current version |
long |
getCurrentVersionId()
Retrieve the version id of the current directory |
long |
getLastSwapped()
Time since last time the store was swapped |
java.lang.String |
getName()
|
ReadOnlyStorageFormat |
getReadOnlyStorageFormat()
Retrieve the storage format of RO |
java.lang.String |
getStoreDirPath()
Retrieves the path of the store |
java.util.List<Version> |
getVersions(ByteArray key)
Get the versions associated with the given key. |
boolean |
isPartitionAware()
Are partitions persisted in distinct files? In other words is the data stored on disk on a per-partition basis? This is really for the read-only use case in which each partition is stored in a distinct file. |
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 |
open(java.io.File versionDir)
Open the store with the version directory specified. |
void |
put(ByteArray key,
Versioned<byte[]> value,
byte[] transforms)
Not supported, throws UnsupportedOperationException if called |
void |
rollback(java.io.File rollbackToDir)
Rollback to the specified push version |
void |
rollback(java.lang.String rollbackToDir)
Rollback to the specified push version |
void |
setRoutingStrategy(RoutingStrategy routingStrategy)
Set the routing strategy required to find which partition the key belongs to |
void |
swapFiles(java.lang.String newStoreDirectory)
Swap the current version folder for a new one |
void |
truncate()
Truncate all entries in the store |
Methods inherited from class voldemort.store.AbstractStorageEngine |
---|
beginBatchModifications, endBatchModifications, getAndLock, isPartitionScanSupported, multiVersionPut, putAndUnlock, releaseLock, resolveAndConstructVersionsToPersist |
Methods inherited from class voldemort.store.AbstractStore |
---|
delete, get, getAll, getCapability, 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, getCapability, put |
Constructor Detail |
---|
public ReadOnlyStorageEngine(java.lang.String name, SearchStrategy searchStrategy, RoutingStrategy routingStrategy, int nodeId, java.io.File storeDir, int numBackups, int deleteBackupMs)
name
- The name of the storesearchStrategy
- The algorithm to use for searching for keysroutingStrategy
- The routing strategy used to route keysnodeId
- Node idstoreDir
- The directory in which the .data and .index files residenumBackups
- The number of backups of these files to retaindeleteBackupMs
- The time in ms for which we'll wait before we
delete a backuppublic ReadOnlyStorageEngine(java.lang.String name, SearchStrategy searchStrategy, RoutingStrategy routingStrategy, int nodeId, java.io.File storeDir, int numBackups)
name
- The name of the storesearchStrategy
- The algorithm to use for searching for keysroutingStrategy
- The routing strategy used to route keysnodeId
- Node idstoreDir
- The directory in which the .data and .index files residenumBackups
- The number of backups of these files to retainpublic ReadOnlyStorageEngine(java.lang.String name, SearchStrategy searchStrategy, RoutingStrategy routingStrategy, int nodeId, java.io.File storeDir, int numBackups, int deleteBackupMs, boolean enforceMlock)
Method Detail |
---|
public ChunkedFileSet getChunkedFileSet()
public java.lang.String getChunkIdToNumChunks()
public void open(java.io.File versionDir)
versionDir
- Version Directory to open. If null, we open the max
versioned / latest directorypublic void setRoutingStrategy(RoutingStrategy routingStrategy)
public java.lang.String getCurrentDirPath()
public long getCurrentVersionId()
public java.lang.String getStoreDirPath()
public ReadOnlyStorageFormat getReadOnlyStorageFormat()
public long getLastSwapped()
public void close() throws VoldemortException
close
in interface Store<ByteArray,byte[],byte[]>
close
in class AbstractStore<ByteArray,byte[],byte[]>
VoldemortException
- If closing fails.public void swapFiles(java.lang.String newStoreDirectory)
newStoreDirectory
- The path to the new version directorypublic void rollback(java.lang.String rollbackToDir)
rollbackToDir
- The full path of the version directory to rollback
topublic void rollback(java.io.File rollbackToDir)
rollbackToDir
- The version directory to rollback topublic 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()
StorageEngine
entries
in interface StorageEngine<ByteArray,byte[],byte[]>
entries
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 java.util.List<Versioned<byte[]>> get(ByteArray key, byte[] transforms) throws VoldemortException
Store
get
in interface Store<ByteArray,byte[],byte[]>
get
in class AbstractStore<ByteArray,byte[],byte[]>
key
- The key to check for
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 delete(ByteArray key, Version version) throws VoldemortException
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 void put(ByteArray key, Versioned<byte[]> value, byte[] transforms) throws VoldemortException
put
in interface Store<ByteArray,byte[],byte[]>
put
in class AbstractStore<ByteArray,byte[],byte[]>
key
- The key to usevalue
- The value to store and its version.
VoldemortException
public java.lang.String getName()
getName
in interface Store<ByteArray,byte[],byte[]>
getName
in class AbstractStore<ByteArray,byte[],byte[]>
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 boolean isPartitionAware()
StorageEngine
isPartitionAware
in interface StorageEngine<ByteArray,byte[],byte[]>
isPartitionAware
in class AbstractStorageEngine<ByteArray,byte[],byte[]>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |