Package com.mapr.fs

Class MapRHTable

java.lang.Object
com.mapr.fs.MapRHTable
All Implemented Interfaces:
com.mapr.fs.jni.MapRConstants, Closeable, AutoCloseable

public class MapRHTable extends Object implements Closeable, com.mapr.fs.jni.MapRConstants
  • Nested Class Summary

    Nested classes/interfaces inherited from interface com.mapr.fs.jni.MapRConstants

    com.mapr.fs.jni.MapRConstants.ErrorValue, com.mapr.fs.jni.MapRConstants.JniUsername, com.mapr.fs.jni.MapRConstants.PutConstants, com.mapr.fs.jni.MapRConstants.RowConstants
  • Field Summary

    Fields inherited from interface com.mapr.fs.jni.MapRConstants

    AtimeBit, AuditBit, ChunkSizeBit, ClusterConfDefault, CompressBit, CompressorTypeBit, DEFAULT_USER_IDENTIFIER, DEFAULT_USER_IDENTIFIER_ESCAPED, DefaultChunkSize, DefaultCLDBIp, DefaultCLDBPort, DiskFlushBit, EMPTY_BYTE_ARRAY, EMPTY_END_ROW, EMPTY_START_ROW, FidNameBit, GlobalClusterConfDefault, GroupBit, HADOOP_MAX_BLOCKSIZE, HADOOP_SECURITY_SPOOFED_GID, HADOOP_SECURITY_SPOOFED_GROUP, HADOOP_SECURITY_SPOOFED_UID, HADOOP_SECURITY_SPOOFED_USER, HOSTNAME_IP_SEPARATOR, IP_PORT_SEPARATOR, IPV6_ADDR_ENDER, IPV6_ADDR_STARTER, IPv6DefaultCLDBIp, LAST_ROW, LATEST_TIMESTAMP, MAPR_ENV_VAR, MAPR_PROPERTY_HOME, MapRClusterDir, MapRClusterDirPattern, MapRClusterDirSlash, MAPRFS_PREFIX, MAPRFS_SCHEME, MapRHomeDefault, MAX_CLUSTERS_CROSSED, MAX_PATH_LENGTH, MAX_PORT_NUMBER, MAX_RA_THREADS, MIN_RA_THREADS, MinChunkSize, ModeBit, MtimeBit, MULTI_ADDR_SEPARATOR, NUM_CONTAINERS_PER_RPC, OLDEST_TIMESTAMP, RA_THREADS_PER_STREAM, ReplBit, SSL_TRUSTSTORE, UserBit, UTF8_ENCODING, WireSecureBit
  • Constructor Summary

    Constructors
    Constructor
    Description
     
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    void
    append(com.mapr.fs.jni.MapRPut mput)
     
    void
    append(com.mapr.fs.jni.MapRPut mput, boolean needResult)
     
    void
    append(com.mapr.fs.jni.MapRPut mput, boolean needResult, boolean shouldFlush)
     
    void
    asyncDelete(com.mapr.fs.jni.MapRPut mput)
     
    void
    asyncDelete(com.mapr.fs.jni.MapRPut[] mputs)
     
    void
     
    boolean
    asyncToCheckAndMutate(byte[] row, boolean useCf, int familyId, byte[] qualifier, byte[] value, com.mapr.fs.jni.MapRPut mput, boolean shouldFlush)
     
    void
    bulkLoaderAppend(long bulkLoaderId, com.mapr.fs.jni.MapRPut mput)
     
    void
    bulkLoaderAppend(long bulkLoaderId, com.mapr.fs.jni.MapRPut[] mput)
     
    void
    bulkLoaderAppendEncoded(long bulkLoaderId, com.mapr.fs.jni.MapRJSONPut mput)
     
    void
    bulkLoaderAppendEncoded(long bulkLoaderId, com.mapr.fs.jni.MapRJSONPut[] mput)
     
    void
    bulkLoaderClose(long bulkLoaderId)
     
    boolean
    checkAndDelete(byte[] row, boolean useCf, int familyId, byte[] qualifier, byte[] value, com.mapr.fs.jni.MapRPut mput)
     
    boolean
    checkAndDelete(byte[] row, boolean useCf, int familyId, byte[] qualifier, byte[] value, com.mapr.fs.jni.MapRPut mput, boolean shouldFlush)
     
    boolean
    checkAndMutate(byte[] row, boolean useCf, boolean checkForNonExist, com.mapr.fs.jni.MapRRowConstraint checkConstraint, com.mapr.fs.proto.Dbfilters.FilterMsg filterMsg, com.mapr.fs.jni.MapRPut[] mputs, boolean shouldFlush)
     
    void
    checkAndMutate(ByteBuffer key, ByteBuffer[] serRecordMutations, int[] mutationsFamilyIds, byte[] serReadConstraint, ByteBuffer serCondition, boolean shouldFlush, com.mapr.fs.jni.MapRUpdateAndGet muag)
     
    boolean
    checkAndMutateToCheckAndPut(byte[] row, boolean useCf, boolean checkForNonExist, com.mapr.fs.jni.MapRRowConstraint checkConstraint, com.mapr.fs.proto.Dbfilters.FilterMsg filterMsg, com.mapr.fs.jni.MapRPut[] mputs, boolean shouldFlush)
     
    boolean
    checkAndPut(byte[] row, boolean useCf, int familyId, byte[] qualifier, byte[] value, com.mapr.fs.jni.MapRPut mput)
     
    boolean
    checkAndPut(byte[] row, boolean useCf, int familyId, byte[] qualifier, byte[] value, com.mapr.fs.jni.MapRPut mput, boolean shouldFlush)
     
    void
    checkAndReplaceOrDelete(ByteBuffer key, ByteBuffer[] serRecords, int[] recordFamilyIds, byte[] serReadConstraint, ByteBuffer condition, boolean shouldFlush, boolean isDelete, com.mapr.fs.jni.MapRUpdateAndGet muag)
     
    boolean
     
    void
     
    void
     
    void
    closeScanner(long scannerId)
     
    void
    delete(com.mapr.fs.jni.MapRPut mput)
     
    void
    delete(com.mapr.fs.jni.MapRPut[] mputs)
     
    static long
    flip(long a)
     
    void
     
    void
    freeArena(long arenaAddr)
     
    com.mapr.fs.jni.MapRResult
    get(com.mapr.fs.jni.MapRGet mget)
     
    com.mapr.fs.jni.MapRResult[]
    get(com.mapr.fs.jni.MapRGet[] mgets)
     
    com.mapr.fs.jni.MapRResult[]
    get(com.mapr.fs.jni.MapRGet[] mgets, boolean shouldFlush)
     
    com.mapr.fs.jni.MapRResult
    get(com.mapr.fs.jni.MapRGet mget, boolean shouldFlush)
     
    long
     
    long
    getBulkLoader(byte[] tableUuid)
     
    org.apache.hadoop.conf.Configuration
     
    int
     
    getFamilyName(int id)
     
     
    void
    getJson(com.mapr.fs.jni.MapRGet mget)
     
    void
    getJson(com.mapr.fs.jni.MapRGet[] mgets)
     
     
    void
    getMultiTabletJson(com.mapr.fs.jni.MapRGet[] mgets)
     
    byte[]
     
    long
    getScanner(com.mapr.fs.jni.MapRScan scan)
     
    com.mapr.fs.proto.Dbserver.TableBasicStats
    getScanRangeStats(byte[] stKey, byte[] endKey)
     
    This method fetches the security policy ID for the given security policy name from the locally-cached securityPolicyNameToIdMap_.
    This method fetches the security policy name for the given security policy ID from the locally-cached securityPolicyIdToNameMap_.
    getServerForCid(int cid)
     
    org.apache.hadoop.fs.Path
     
     
    getTabletScanner(boolean needSpaceUsage, boolean prefetchTabletMap)
     
    getTabletScanner(byte[] row)
     
    getTabletScanner(byte[] startKey, byte[] endKey, boolean spaceUsage, boolean prefetchTabletMap)
     
    void
    increment(com.mapr.fs.jni.MapRIncrement incr)
     
    void
    increment(com.mapr.fs.jni.MapRIncrement incr, boolean shouldFlush)
     
    void
    init(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.Path tablePath)
     
    void
    init(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.Path priTablePath, String indexName, String indexFid)
     
    boolean
     
    long
     
    void
    put(com.mapr.fs.jni.MapRPut mput)
     
    void
    put(com.mapr.fs.jni.MapRPut[] mputs)
     
    void
     
    void
    scanNext(long scannerId, int nbRows, com.mapr.fs.jni.MapRResult[] res)
     
    void
    syncPut(com.mapr.fs.jni.MapRPut mput)
     
    void
    syncPut(com.mapr.fs.jni.MapRPut[] mputs)
     
    void
    syncPut(com.mapr.fs.jni.MapRPut[] mputs, boolean shouldBlock)
     
    void
    syncPut(com.mapr.fs.jni.MapRPut[] mputs, boolean shouldBlock, boolean rowMut)
     
    void
    syncPut(com.mapr.fs.jni.MapRPut mput, boolean shouldBlock)
     
    void
    tryClose(boolean doFlush)
     
    void
    tryClose(boolean doFlush, boolean closeMFS)
    The closeMFS parameter has been passed in to this method so that we don't try to call close() method in the synchronized block.
    static boolean
    unsignedLessThan(long a, long b)
     
    void
    updateRecord(ByteBuffer key, ByteBuffer[] serRecordMutations, int[] mutationsFamilyIds, byte[] serReadConstraint, boolean shouldFlush, com.mapr.fs.jni.MapRUpdateAndGet muag)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • MapRHTable

      public MapRHTable()
    • MapRHTable

      public MapRHTable(MapRFileSystem injectedMfs)
  • Method Details

    • unsignedLessThan

      public static boolean unsignedLessThan(long a, long b)
    • flip

      public static long flip(long a)
    • init

      public void init(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.Path tablePath) throws IOException
      Throws:
      IOException
    • init

      public void init(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.Path priTablePath, String indexName, String indexFid) throws IOException
      Throws:
      IOException
    • put

      public void put(com.mapr.fs.jni.MapRPut mput) throws IOException
      Throws:
      IOException
    • put

      public void put(com.mapr.fs.jni.MapRPut[] mputs) throws IOException
      Throws:
      IOException
    • syncPut

      public void syncPut(com.mapr.fs.jni.MapRPut mput) throws IOException
      Throws:
      IOException
    • syncPut

      public void syncPut(com.mapr.fs.jni.MapRPut[] mputs) throws IOException
      Throws:
      IOException
    • syncPut

      public void syncPut(com.mapr.fs.jni.MapRPut mput, boolean shouldBlock) throws IOException
      Throws:
      IOException
    • syncPut

      public void syncPut(com.mapr.fs.jni.MapRPut[] mputs, boolean shouldBlock) throws IOException
      Throws:
      IOException
    • syncPut

      public void syncPut(com.mapr.fs.jni.MapRPut[] mputs, boolean shouldBlock, boolean rowMut) throws IOException
      Throws:
      IOException
    • getBulkLoader

      public long getBulkLoader(byte[] tableUuid) throws IOException
      Throws:
      IOException
    • bulkLoaderClose

      public void bulkLoaderClose(long bulkLoaderId) throws IOException
      Throws:
      IOException
    • bulkLoaderAppend

      public void bulkLoaderAppend(long bulkLoaderId, com.mapr.fs.jni.MapRPut mput) throws IOException
      Throws:
      IOException
    • bulkLoaderAppend

      public void bulkLoaderAppend(long bulkLoaderId, com.mapr.fs.jni.MapRPut[] mput) throws IOException
      Throws:
      IOException
    • bulkLoaderAppendEncoded

      public void bulkLoaderAppendEncoded(long bulkLoaderId, com.mapr.fs.jni.MapRJSONPut mput) throws IOException
      Throws:
      IOException
    • bulkLoaderAppendEncoded

      public void bulkLoaderAppendEncoded(long bulkLoaderId, com.mapr.fs.jni.MapRJSONPut[] mput) throws IOException
      Throws:
      IOException
    • getName

      public byte[] getName()
    • getTablePath

      public org.apache.hadoop.fs.Path getTablePath()
    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException
    • closeNoFlush

      public void closeNoFlush() throws IOException
      Throws:
      IOException
    • tryClose

      public void tryClose(boolean doFlush) throws IOException
      Throws:
      IOException
    • tryClose

      public void tryClose(boolean doFlush, boolean closeMFS) throws IOException
      The closeMFS parameter has been passed in to this method so that we don't try to call close() method in the synchronized block. The tryClose() method is also called from close(), and closeNoFlush() methods within the synchronized block, and we want to avoid close()ing MFS to avoid a deadlock.
      Throws:
      IOException
    • lastUpdateTime

      public long lastUpdateTime()
    • flushCommits

      public void flushCommits() throws IOException
      Throws:
      IOException
    • getJson

      public void getJson(com.mapr.fs.jni.MapRGet mget) throws IOException
      Throws:
      IOException
    • getJson

      public void getJson(com.mapr.fs.jni.MapRGet[] mgets) throws IOException
      Throws:
      IOException
    • getMultiTabletJson

      public void getMultiTabletJson(com.mapr.fs.jni.MapRGet[] mgets) throws IOException
      Throws:
      IOException
    • get

      public com.mapr.fs.jni.MapRResult get(com.mapr.fs.jni.MapRGet mget) throws IOException
      Throws:
      IOException
    • get

      public com.mapr.fs.jni.MapRResult[] get(com.mapr.fs.jni.MapRGet[] mgets) throws IOException
      Throws:
      IOException
    • get

      public com.mapr.fs.jni.MapRResult get(com.mapr.fs.jni.MapRGet mget, boolean shouldFlush) throws IOException
      Throws:
      IOException
    • get

      public com.mapr.fs.jni.MapRResult[] get(com.mapr.fs.jni.MapRGet[] mgets, boolean shouldFlush) throws IOException
      Throws:
      IOException
    • freeArena

      public void freeArena(long arenaAddr)
    • addScanner

      public void addScanner(MapRResultScanner scanner)
    • removeScanner

      public void removeScanner(MapRResultScanner scanner)
    • increment

      public void increment(com.mapr.fs.jni.MapRIncrement incr) throws IOException
      Throws:
      IOException
    • increment

      public void increment(com.mapr.fs.jni.MapRIncrement incr, boolean shouldFlush) throws IOException
      Throws:
      IOException
    • checkAndPut

      public boolean checkAndPut(byte[] row, boolean useCf, int familyId, byte[] qualifier, byte[] value, com.mapr.fs.jni.MapRPut mput) throws IOException
      Throws:
      IOException
    • checkAndPut

      public boolean checkAndPut(byte[] row, boolean useCf, int familyId, byte[] qualifier, byte[] value, com.mapr.fs.jni.MapRPut mput, boolean shouldFlush) throws IOException
      Throws:
      IOException
    • delete

      public void delete(com.mapr.fs.jni.MapRPut mput) throws IOException
      Throws:
      IOException
    • delete

      public void delete(com.mapr.fs.jni.MapRPut[] mputs) throws IOException
      Throws:
      IOException
    • asyncDelete

      public void asyncDelete(com.mapr.fs.jni.MapRPut mput) throws IOException
      Throws:
      IOException
    • asyncDelete

      public void asyncDelete(com.mapr.fs.jni.MapRPut[] mputs) throws IOException
      Throws:
      IOException
    • checkAndDelete

      public boolean checkAndDelete(byte[] row, boolean useCf, int familyId, byte[] qualifier, byte[] value, com.mapr.fs.jni.MapRPut mput) throws IOException
      Throws:
      IOException
    • checkAndDelete

      public boolean checkAndDelete(byte[] row, boolean useCf, int familyId, byte[] qualifier, byte[] value, com.mapr.fs.jni.MapRPut mput, boolean shouldFlush) throws IOException
      Throws:
      IOException
    • checkUseUpdateAndGet

      public boolean checkUseUpdateAndGet()
    • checkAndMutate

      public boolean checkAndMutate(byte[] row, boolean useCf, boolean checkForNonExist, com.mapr.fs.jni.MapRRowConstraint checkConstraint, com.mapr.fs.proto.Dbfilters.FilterMsg filterMsg, com.mapr.fs.jni.MapRPut[] mputs, boolean shouldFlush) throws IOException
      Throws:
      IOException
    • checkAndMutateToCheckAndPut

      public boolean checkAndMutateToCheckAndPut(byte[] row, boolean useCf, boolean checkForNonExist, com.mapr.fs.jni.MapRRowConstraint checkConstraint, com.mapr.fs.proto.Dbfilters.FilterMsg filterMsg, com.mapr.fs.jni.MapRPut[] mputs, boolean shouldFlush) throws IOException
      Throws:
      IOException
    • asyncToCheckAndMutate

      public boolean asyncToCheckAndMutate(byte[] row, boolean useCf, int familyId, byte[] qualifier, byte[] value, com.mapr.fs.jni.MapRPut mput, boolean shouldFlush) throws IOException
      Throws:
      IOException
    • append

      public void append(com.mapr.fs.jni.MapRPut mput, boolean needResult) throws IOException
      Throws:
      IOException
    • append

      public void append(com.mapr.fs.jni.MapRPut mput) throws IOException
      Throws:
      IOException
    • append

      public void append(com.mapr.fs.jni.MapRPut mput, boolean needResult, boolean shouldFlush) throws IOException
      Throws:
      IOException
    • getFamilyName

      public String getFamilyName(int id) throws IOException
      Throws:
      IOException
    • getFamilyId

      public int getFamilyId(String name) throws IOException
      Throws:
      IOException
    • getAverageRowSize

      public long getAverageRowSize() throws IOException
      Throws:
      IOException
    • getScanRangeStats

      public com.mapr.fs.proto.Dbserver.TableBasicStats getScanRangeStats(byte[] stKey, byte[] endKey) throws IOException
      Throws:
      IOException
    • getTabletScanner

      public MapRTabletScanner getTabletScanner(byte[] row) throws IOException
      Throws:
      IOException
    • getTabletScanner

      public MapRTabletScanner getTabletScanner() throws IOException
      Throws:
      IOException
    • getTabletScanner

      public MapRTabletScanner getTabletScanner(boolean needSpaceUsage, boolean prefetchTabletMap) throws IOException
      Throws:
      IOException
    • getTabletScanner

      public MapRTabletScanner getTabletScanner(byte[] startKey, byte[] endKey, boolean spaceUsage, boolean prefetchTabletMap) throws IOException
      Throws:
      IOException
    • getServerForCid

      public String getServerForCid(int cid) throws IOException
      Throws:
      IOException
    • asyncFlush

      public void asyncFlush() throws IOException
      Throws:
      IOException
    • getScanner

      public long getScanner(com.mapr.fs.jni.MapRScan scan) throws IOException
      Throws:
      IOException
    • scanNext

      public void scanNext(long scannerId, int nbRows, com.mapr.fs.jni.MapRResult[] res) throws IOException
      Throws:
      IOException
    • closeScanner

      public void closeScanner(long scannerId) throws IOException
      Throws:
      IOException
    • getMapRFS

      public MapRFileSystem getMapRFS()
    • getInode

      public Inode getInode()
    • getConf

      public org.apache.hadoop.conf.Configuration getConf()
    • isJson

      public boolean isJson() throws IOException
      Throws:
      IOException
    • checkAndReplaceOrDelete

      public void checkAndReplaceOrDelete(ByteBuffer key, ByteBuffer[] serRecords, int[] recordFamilyIds, byte[] serReadConstraint, ByteBuffer condition, boolean shouldFlush, boolean isDelete, com.mapr.fs.jni.MapRUpdateAndGet muag) throws IOException
      Throws:
      IOException
    • checkAndMutate

      public void checkAndMutate(ByteBuffer key, ByteBuffer[] serRecordMutations, int[] mutationsFamilyIds, byte[] serReadConstraint, ByteBuffer serCondition, boolean shouldFlush, com.mapr.fs.jni.MapRUpdateAndGet muag) throws IOException
      Throws:
      IOException
    • updateRecord

      public void updateRecord(ByteBuffer key, ByteBuffer[] serRecordMutations, int[] mutationsFamilyIds, byte[] serReadConstraint, boolean shouldFlush, com.mapr.fs.jni.MapRUpdateAndGet muag) throws IOException
      Throws:
      IOException
    • getSecurityPolicyID

      public Integer getSecurityPolicyID(String policyName) throws IOException
      This method fetches the security policy ID for the given security policy name from the locally-cached securityPolicyNameToIdMap_. If not found in the map, it fetchees it from the JNI MapClient cache. If no valid policy ID is returned by this method, it is safe to assume that the policy has not been created in the policy domain.
      Parameters:
      policyName - Security Policy name tag for which ID is required
      Returns:
      Security Policy ID
      Throws:
      IOException
    • getSecurityPolicyName

      public String getSecurityPolicyName(Integer policyID) throws IOException
      This method fetches the security policy name for the given security policy ID from the locally-cached securityPolicyIdToNameMap_. If not found in the map, it fetchees it from the JNI MapClient cache. If no valid policy name is returned by this method, it is safe to assume that the policy has not been created in the policy domain.
      Parameters:
      policyID - Security Policy ID tag for which nmae is required
      Returns:
      Security Policy Name
      Throws:
      IOException