Package com.mapr.fs

Class MapRHTable

  • All Implemented Interfaces:
    com.mapr.fs.jni.MapRConstants, java.io.Closeable, java.lang.AutoCloseable

    public class MapRHTable
    extends java.lang.Object
    implements java.io.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, 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, UserBit, UTF8_ENCODING, WireSecureBit
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addScanner​(MapRResultScanner scanner)  
      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 asyncFlush()  
      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​(java.nio.ByteBuffer key, java.nio.ByteBuffer[] serRecordMutations, int[] mutationsFamilyIds, byte[] serReadConstraint, java.nio.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​(java.nio.ByteBuffer key, java.nio.ByteBuffer[] serRecords, int[] recordFamilyIds, byte[] serReadConstraint, java.nio.ByteBuffer condition, boolean shouldFlush, boolean isDelete, com.mapr.fs.jni.MapRUpdateAndGet muag)  
      boolean checkUseUpdateAndGet()  
      void close()  
      void closeNoFlush()  
      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 flushCommits()  
      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 getAverageRowSize()  
      long getBulkLoader​(byte[] tableUuid)  
      org.apache.hadoop.conf.Configuration getConf()  
      int getFamilyId​(java.lang.String name)  
      java.lang.String getFamilyName​(int id)  
      Inode getInode()  
      void getJson​(com.mapr.fs.jni.MapRGet mget)  
      void getJson​(com.mapr.fs.jni.MapRGet[] mgets)  
      MapRFileSystem getMapRFS()  
      void getMultiTabletJson​(com.mapr.fs.jni.MapRGet[] mgets)  
      byte[] getName()  
      long getScanner​(com.mapr.fs.jni.MapRScan scan)  
      com.mapr.fs.proto.Dbserver.TableBasicStats getScanRangeStats​(byte[] stKey, byte[] endKey)  
      java.lang.Integer getSecurityPolicyID​(java.lang.String policyName)
      This method fetches the security policy ID for the given security policy name from the locally-cached securityPolicyNameToIdMap_.
      java.lang.String getSecurityPolicyName​(java.lang.Integer policyID)
      This method fetches the security policy name for the given security policy ID from the locally-cached securityPolicyIdToNameMap_.
      java.lang.String getServerForCid​(int cid)  
      org.apache.hadoop.fs.Path getTablePath()  
      MapRTabletScanner getTabletScanner()  
      MapRTabletScanner getTabletScanner​(boolean needSpaceUsage, boolean prefetchTabletMap)  
      MapRTabletScanner getTabletScanner​(byte[] row)  
      MapRTabletScanner 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, java.lang.String indexName, java.lang.String indexFid)  
      boolean isJson()  
      long lastUpdateTime()  
      void put​(com.mapr.fs.jni.MapRPut mput)  
      void put​(com.mapr.fs.jni.MapRPut[] mputs)  
      void removeScanner​(MapRResultScanner scanner)  
      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​(java.nio.ByteBuffer key, java.nio.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 Detail

      • MapRHTable

        public MapRHTable()
    • Method Detail

      • 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 java.io.IOException
        Throws:
        java.io.IOException
      • init

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

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

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

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

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

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

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

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

        public long getBulkLoader​(byte[] tableUuid)
                           throws java.io.IOException
        Throws:
        java.io.IOException
      • bulkLoaderClose

        public void bulkLoaderClose​(long bulkLoaderId)
                             throws java.io.IOException
        Throws:
        java.io.IOException
      • bulkLoaderAppend

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

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

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

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

        public byte[] getName()
      • getTablePath

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

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

        public void closeNoFlush()
                          throws java.io.IOException
        Throws:
        java.io.IOException
      • tryClose

        public void tryClose​(boolean doFlush)
                      throws java.io.IOException
        Throws:
        java.io.IOException
      • tryClose

        public void tryClose​(boolean doFlush,
                             boolean closeMFS)
                      throws java.io.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:
        java.io.IOException
      • lastUpdateTime

        public long lastUpdateTime()
      • flushCommits

        public void flushCommits()
                          throws java.io.IOException
        Throws:
        java.io.IOException
      • getJson

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

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

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

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

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

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

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

        public void freeArena​(long arenaAddr)
      • increment

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

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

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

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

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

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

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

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

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

        public boolean checkAndDelete​(byte[] row,
                                      boolean useCf,
                                      int familyId,
                                      byte[] qualifier,
                                      byte[] value,
                                      com.mapr.fs.jni.MapRPut mput,
                                      boolean shouldFlush)
                               throws java.io.IOException
        Throws:
        java.io.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 java.io.IOException
        Throws:
        java.io.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 java.io.IOException
        Throws:
        java.io.IOException
      • asyncToCheckAndMutate

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

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

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

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

        public java.lang.String getFamilyName​(int id)
                                       throws java.io.IOException
        Throws:
        java.io.IOException
      • getFamilyId

        public int getFamilyId​(java.lang.String name)
                        throws java.io.IOException
        Throws:
        java.io.IOException
      • getAverageRowSize

        public long getAverageRowSize()
                               throws java.io.IOException
        Throws:
        java.io.IOException
      • getScanRangeStats

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

        public MapRTabletScanner getTabletScanner​(byte[] row)
                                           throws java.io.IOException
        Throws:
        java.io.IOException
      • getTabletScanner

        public MapRTabletScanner getTabletScanner()
                                           throws java.io.IOException
        Throws:
        java.io.IOException
      • getTabletScanner

        public MapRTabletScanner getTabletScanner​(boolean needSpaceUsage,
                                                  boolean prefetchTabletMap)
                                           throws java.io.IOException
        Throws:
        java.io.IOException
      • getTabletScanner

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

        public java.lang.String getServerForCid​(int cid)
                                         throws java.io.IOException
        Throws:
        java.io.IOException
      • asyncFlush

        public void asyncFlush()
                        throws java.io.IOException
        Throws:
        java.io.IOException
      • getScanner

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

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

        public void closeScanner​(long scannerId)
                          throws java.io.IOException
        Throws:
        java.io.IOException
      • getInode

        public Inode getInode()
      • getConf

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

        public boolean isJson()
                       throws java.io.IOException
        Throws:
        java.io.IOException
      • checkAndReplaceOrDelete

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

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

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

        public java.lang.Integer getSecurityPolicyID​(java.lang.String policyName)
                                              throws java.io.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:
        java.io.IOException
      • getSecurityPolicyName

        public java.lang.String getSecurityPolicyName​(java.lang.Integer policyID)
                                               throws java.io.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:
        java.io.IOException