Package com.mapr.kvstore
Class KvStore<T>
- java.lang.Object
-
- com.mapr.kvstore.KvStore<T>
-
-
Constructor Summary
Constructors Constructor Description KvStore(KvStoreClient clnt)Deprecated.KvStore(KvStoreClient clnt, com.mapr.fs.proto.Security.CredentialsMsg creds)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()booleanexists(T keyValue)Cognate ofKvTable.lookup(Object, boolean), this function checks for the presence of an entry with a specific key.com.mapr.fs.proto.Common.FidMsggetFid()intgetKeyCnt()TgetKeyFromKvStoreKey(com.mapr.fs.proto.Fileserver.KvStoreKey key)longgetKvVersion()com.mapr.fs.proto.Fileserver.KvMsggetLeftNearValue(T key)Get the value corresponding to the key that is either less or equal to the key specified as the argument.com.mapr.fs.proto.Fileserver.KvStoreKeygetMaxKey()com.mapr.fs.proto.Fileserver.KvStoreKeygetMinKey()longgetNBlocks()com.mapr.fs.proto.Fileserver.KvMsggetRightNearValue(T key)Get the value corresponding to the key that is greater than the key specified as the argument.ScannergetScanner(boolean keysOnly)ScannergetScanner(com.mapr.fs.proto.Fileserver.KvStoreKey startKey, com.mapr.fs.proto.Fileserver.KvStoreKey endKey, boolean keysOnly)ScannergetScanner(T startKey, boolean keysOnly)ScannergetScanner(T startKey, T endKey, boolean keysOnly)java.lang.StringgetTableName()static com.mapr.fs.proto.Common.FSKeyTypegettype(KvStoreClient clnt, java.lang.String name)byte[]lookup(T keyValue)byte[]lookup(T keyValue, boolean allowStaleRead)com.mapr.fs.proto.Fileserver.KvstoreLookupNearResponselookupNear(T key)Fetch values of keys that are adjacent to a specific key.intopen(java.lang.String name)Initializes in-memory state of the table, such as setting key type (where necessary).com.mapr.fs.proto.Fileserver.KvStoreKeyparseKvStoreKey(java.lang.String keyString)voidprintKey(com.mapr.fs.proto.Fileserver.KvStoreKey key)static java.lang.StringsetThreadName(com.mapr.fs.proto.Fileserver.FSProg prog, com.mapr.fs.proto.Common.FidMsg fid)voidsetType(int type)voidsetVarKeyType(java.lang.String type)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.mapr.kvstore.KvTable
getHashedStringScanner, isExistCollisionKey, lookupCollisionNr
-
-
-
-
Constructor Detail
-
KvStore
@Deprecated public KvStore(KvStoreClient clnt)
Deprecated.
-
KvStore
public KvStore(KvStoreClient clnt, com.mapr.fs.proto.Security.CredentialsMsg creds)
-
-
Method Detail
-
getFid
public com.mapr.fs.proto.Common.FidMsg getFid()
-
open
public int open(java.lang.String name)
Description copied from interface:KvTableInitializes in-memory state of the table, such as setting key type (where necessary).
-
setVarKeyType
public void setVarKeyType(java.lang.String type)
- Specified by:
setVarKeyTypein interfaceKvTable<T>
-
getTableName
public java.lang.String getTableName()
- Specified by:
getTableNamein interfaceKvTable<T>
-
lookup
public byte[] lookup(T keyValue, boolean allowStaleRead)
-
setThreadName
public static java.lang.String setThreadName(com.mapr.fs.proto.Fileserver.FSProg prog, com.mapr.fs.proto.Common.FidMsg fid)
-
getLeftNearValue
public com.mapr.fs.proto.Fileserver.KvMsg getLeftNearValue(T key)
Get the value corresponding to the key that is either less or equal to the key specified as the argument.- Specified by:
getLeftNearValuein interfaceKvTable<T>- Parameters:
key- value of the key being looked up.- Returns:
- the left near value, if present null, if there are no keys that are equal to or lower than the first argument
-
getRightNearValue
public com.mapr.fs.proto.Fileserver.KvMsg getRightNearValue(T key)
Get the value corresponding to the key that is greater than the key specified as the argument.- Specified by:
getRightNearValuein interfaceKvTable<T>- Parameters:
key- value of the key being looked up.- Returns:
- the right near value, if present null, if there are no keys that are greater than the argument
-
lookupNear
public com.mapr.fs.proto.Fileserver.KvstoreLookupNearResponse lookupNear(T key) throws KvStoreException
Fetch values of keys that are adjacent to a specific key.- Specified by:
lookupNearin interfaceKvTable<T>- Parameters:
key-- Returns:
- Throws:
KvStoreException
-
getMinKey
public com.mapr.fs.proto.Fileserver.KvStoreKey getMinKey()
-
getMaxKey
public com.mapr.fs.proto.Fileserver.KvStoreKey getMaxKey()
-
getNBlocks
public long getNBlocks()
-
getKvVersion
public long getKvVersion()
- Specified by:
getKvVersionin interfaceKvTable<T>
-
exists
public boolean exists(T keyValue)
Description copied from interface:KvTableCognate ofKvTable.lookup(Object, boolean), this function checks for the presence of an entry with a specific key.
-
getKeyFromKvStoreKey
public T getKeyFromKvStoreKey(com.mapr.fs.proto.Fileserver.KvStoreKey key)
- Specified by:
getKeyFromKvStoreKeyin interfaceKvTable<T>
-
parseKvStoreKey
public com.mapr.fs.proto.Fileserver.KvStoreKey parseKvStoreKey(java.lang.String keyString)
-
getScanner
public Scanner getScanner(com.mapr.fs.proto.Fileserver.KvStoreKey startKey, com.mapr.fs.proto.Fileserver.KvStoreKey endKey, boolean keysOnly)
-
getScanner
public Scanner getScanner(T startKey, T endKey, boolean keysOnly)
- Specified by:
getScannerin interfaceKvTable<T>
-
getScanner
public Scanner getScanner(T startKey, boolean keysOnly)
- Specified by:
getScannerin interfaceKvTable<T>
-
getScanner
public Scanner getScanner(boolean keysOnly)
- Specified by:
getScannerin interfaceKvTable<T>
-
printKey
public void printKey(com.mapr.fs.proto.Fileserver.KvStoreKey key)
-
gettype
public static com.mapr.fs.proto.Common.FSKeyType gettype(KvStoreClient clnt, java.lang.String name)
-
-