Class HashedStringKvStore

  • All Implemented Interfaces:
    KvTable<java.lang.String>

    public class HashedStringKvStore
    extends java.lang.Object
    implements KvTable<java.lang.String>
    MapR Filesystem based implementation of Key-Value table interface. Which uses Key as Hash(String)
    See Also:
    KvTable
    • Constructor Detail

      • HashedStringKvStore

        public HashedStringKvStore​(KvTable<com.google.protobuf.ByteString> kvTable)
    • Method Detail

      • open

        public int open​(java.lang.String name)
        Description copied from interface: KvTable
        Initializes in-memory state of the table, such as setting key type (where necessary).
        Specified by:
        open in interface KvTable<java.lang.String>
        Parameters:
        name - name of the key-value table to be initialized
        Returns:
      • getTableName

        public java.lang.String getTableName()
        Specified by:
        getTableName in interface KvTable<java.lang.String>
      • close

        public void close()
        Specified by:
        close in interface KvTable<java.lang.String>
      • getKvVersion

        public long getKvVersion()
        Specified by:
        getKvVersion in interface KvTable<java.lang.String>
      • setVarKeyType

        public void setVarKeyType​(java.lang.String type)
        Specified by:
        setVarKeyType in interface KvTable<java.lang.String>
      • lookup

        public byte[] lookup​(java.lang.String keyValue)
        Specified by:
        lookup in interface KvTable<java.lang.String>
      • lookup

        public byte[] lookup​(java.lang.String keyValue,
                             boolean allowStaleRead)
        Specified by:
        lookup in interface KvTable<java.lang.String>
      • getLeftNearValue

        public com.mapr.fs.proto.Fileserver.KvMsg getLeftNearValue​(java.lang.String key)
        Specified by:
        getLeftNearValue in interface KvTable<java.lang.String>
      • getRightNearValue

        public com.mapr.fs.proto.Fileserver.KvMsg getRightNearValue​(java.lang.String key)
        Specified by:
        getRightNearValue in interface KvTable<java.lang.String>
      • getMinKey

        public com.mapr.fs.proto.Fileserver.KvStoreKey getMinKey()
        Specified by:
        getMinKey in interface KvTable<java.lang.String>
      • getMaxKey

        public com.mapr.fs.proto.Fileserver.KvStoreKey getMaxKey()
        Specified by:
        getMaxKey in interface KvTable<java.lang.String>
      • getKeyCnt

        public int getKeyCnt()
        Specified by:
        getKeyCnt in interface KvTable<java.lang.String>
      • exists

        public boolean exists​(java.lang.String keyValue)
        Description copied from interface: KvTable
        Cognate of KvTable.lookup(Object, boolean), this function checks for the presence of an entry with a specific key.
        Specified by:
        exists in interface KvTable<java.lang.String>
        Returns:
      • getKeyFromKvStoreKey

        public java.lang.String getKeyFromKvStoreKey​(com.mapr.fs.proto.Fileserver.KvStoreKey key)
        Specified by:
        getKeyFromKvStoreKey in interface KvTable<java.lang.String>
      • getScanner

        public Scanner getScanner​(java.lang.String startKey,
                                  java.lang.String endKey,
                                  boolean keysOnly)
        Specified by:
        getScanner in interface KvTable<java.lang.String>
      • getScanner

        public Scanner getScanner​(java.lang.String startKey,
                                  boolean keysOnly)
        Specified by:
        getScanner in interface KvTable<java.lang.String>
      • getScanner

        public Scanner getScanner​(boolean keysOnly)
        Specified by:
        getScanner in interface KvTable<java.lang.String>
      • setType

        public void setType​(int type)
        Specified by:
        setType in interface KvTable<java.lang.String>
      • lookupCollisionNr

        public long lookupCollisionNr()
        Specified by:
        lookupCollisionNr in interface KvTable<java.lang.String>
      • isExistCollisionKey

        public boolean isExistCollisionKey()
        Specified by:
        isExistCollisionKey in interface KvTable<java.lang.String>
      • addInsertOp

        public int addInsertOp​(KvDatabaseOp op,
                               java.lang.String key,
                               int val,
                               boolean skipCollisionCountUpdate,
                               boolean verifyKey,
                               java.util.HashSet<HashedStringKvStore> pendingUnlockTables)
      • releaseUpdateLock

        public void releaseUpdateLock()