Package com.mapr.fs
Class MapRHTable
- java.lang.Object
-
- com.mapr.fs.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
-
-
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
-
-
Constructor Summary
Constructors Constructor Description MapRHTable()MapRHTable(MapRFileSystem injectedMfs)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddScanner(MapRResultScanner scanner)voidappend(com.mapr.fs.jni.MapRPut mput)voidappend(com.mapr.fs.jni.MapRPut mput, boolean needResult)voidappend(com.mapr.fs.jni.MapRPut mput, boolean needResult, boolean shouldFlush)voidasyncDelete(com.mapr.fs.jni.MapRPut mput)voidasyncDelete(com.mapr.fs.jni.MapRPut[] mputs)voidasyncFlush()booleanasyncToCheckAndMutate(byte[] row, boolean useCf, int familyId, byte[] qualifier, byte[] value, com.mapr.fs.jni.MapRPut mput, boolean shouldFlush)voidbulkLoaderAppend(long bulkLoaderId, com.mapr.fs.jni.MapRPut mput)voidbulkLoaderAppend(long bulkLoaderId, com.mapr.fs.jni.MapRPut[] mput)voidbulkLoaderAppendEncoded(long bulkLoaderId, com.mapr.fs.jni.MapRJSONPut mput)voidbulkLoaderAppendEncoded(long bulkLoaderId, com.mapr.fs.jni.MapRJSONPut[] mput)voidbulkLoaderClose(long bulkLoaderId)booleancheckAndDelete(byte[] row, boolean useCf, int familyId, byte[] qualifier, byte[] value, com.mapr.fs.jni.MapRPut mput)booleancheckAndDelete(byte[] row, boolean useCf, int familyId, byte[] qualifier, byte[] value, com.mapr.fs.jni.MapRPut mput, boolean shouldFlush)booleancheckAndMutate(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)voidcheckAndMutate(java.nio.ByteBuffer key, java.nio.ByteBuffer[] serRecordMutations, int[] mutationsFamilyIds, byte[] serReadConstraint, java.nio.ByteBuffer serCondition, boolean shouldFlush, com.mapr.fs.jni.MapRUpdateAndGet muag)booleancheckAndMutateToCheckAndPut(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)booleancheckAndPut(byte[] row, boolean useCf, int familyId, byte[] qualifier, byte[] value, com.mapr.fs.jni.MapRPut mput)booleancheckAndPut(byte[] row, boolean useCf, int familyId, byte[] qualifier, byte[] value, com.mapr.fs.jni.MapRPut mput, boolean shouldFlush)voidcheckAndReplaceOrDelete(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)booleancheckUseUpdateAndGet()voidclose()voidcloseNoFlush()voidcloseScanner(long scannerId)voiddelete(com.mapr.fs.jni.MapRPut mput)voiddelete(com.mapr.fs.jni.MapRPut[] mputs)static longflip(long a)voidflushCommits()voidfreeArena(long arenaAddr)com.mapr.fs.jni.MapRResultget(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.MapRResultget(com.mapr.fs.jni.MapRGet mget, boolean shouldFlush)longgetAverageRowSize()longgetBulkLoader(byte[] tableUuid)org.apache.hadoop.conf.ConfigurationgetConf()intgetFamilyId(java.lang.String name)java.lang.StringgetFamilyName(int id)InodegetInode()voidgetJson(com.mapr.fs.jni.MapRGet mget)voidgetJson(com.mapr.fs.jni.MapRGet[] mgets)MapRFileSystemgetMapRFS()voidgetMultiTabletJson(com.mapr.fs.jni.MapRGet[] mgets)byte[]getName()longgetScanner(com.mapr.fs.jni.MapRScan scan)com.mapr.fs.proto.Dbserver.TableBasicStatsgetScanRangeStats(byte[] stKey, byte[] endKey)java.lang.IntegergetSecurityPolicyID(java.lang.String policyName)This method fetches the security policy ID for the given security policy name from the locally-cached securityPolicyNameToIdMap_.java.lang.StringgetSecurityPolicyName(java.lang.Integer policyID)This method fetches the security policy name for the given security policy ID from the locally-cached securityPolicyIdToNameMap_.java.lang.StringgetServerForCid(int cid)org.apache.hadoop.fs.PathgetTablePath()MapRTabletScannergetTabletScanner()MapRTabletScannergetTabletScanner(boolean needSpaceUsage, boolean prefetchTabletMap)MapRTabletScannergetTabletScanner(byte[] row)MapRTabletScannergetTabletScanner(byte[] startKey, byte[] endKey, boolean spaceUsage, boolean prefetchTabletMap)voidincrement(com.mapr.fs.jni.MapRIncrement incr)voidincrement(com.mapr.fs.jni.MapRIncrement incr, boolean shouldFlush)voidinit(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.Path tablePath)voidinit(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.Path priTablePath, java.lang.String indexName, java.lang.String indexFid)booleanisJson()longlastUpdateTime()voidput(com.mapr.fs.jni.MapRPut mput)voidput(com.mapr.fs.jni.MapRPut[] mputs)voidremoveScanner(MapRResultScanner scanner)voidscanNext(long scannerId, int nbRows, com.mapr.fs.jni.MapRResult[] res)voidsyncPut(com.mapr.fs.jni.MapRPut mput)voidsyncPut(com.mapr.fs.jni.MapRPut[] mputs)voidsyncPut(com.mapr.fs.jni.MapRPut[] mputs, boolean shouldBlock)voidsyncPut(com.mapr.fs.jni.MapRPut[] mputs, boolean shouldBlock, boolean rowMut)voidsyncPut(com.mapr.fs.jni.MapRPut mput, boolean shouldBlock)voidtryClose(boolean doFlush)voidtryClose(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 booleanunsignedLessThan(long a, long b)voidupdateRecord(java.nio.ByteBuffer key, java.nio.ByteBuffer[] serRecordMutations, int[] mutationsFamilyIds, byte[] serReadConstraint, boolean shouldFlush, com.mapr.fs.jni.MapRUpdateAndGet muag)
-
-
-
Constructor Detail
-
MapRHTable
public MapRHTable()
-
MapRHTable
public MapRHTable(MapRFileSystem injectedMfs)
-
-
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:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.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.IOExceptionThe 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)
-
addScanner
public void addScanner(MapRResultScanner scanner)
-
removeScanner
public void removeScanner(MapRResultScanner scanner)
-
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
-
getMapRFS
public MapRFileSystem getMapRFS()
-
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.IOExceptionThis 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.IOExceptionThis 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
-
-