name
stringlengths
12
178
code_snippet
stringlengths
8
36.5k
score
float64
3.26
3.68
hbase_PrettyPrinter_valueOf_rdh
/** * Convert a human readable string to its value. * * @see org.apache.hadoop.hbase.util.PrettyPrinter#format(String, Unit) * @return the value corresponding to the human readable string */ public static String valueOf(final String pretty, final Unit unit) throws HBaseException { StringBuilder value = new S...
3.26
hbase_PrettyPrinter_toString_rdh
/** * Pretty prints a collection of any type to a string. Relies on toString() implementation of the * object type. * * @param collection * collection to pretty print. * @return Pretty printed string for the collection. */ public static String toString(Collection<?> collection) { List<String> stringList ...
3.26
hbase_PrettyPrinter_humanReadableIntervalToSec_rdh
/** * Convert a human readable time interval to seconds. Examples of the human readable time * intervals are: 50 DAYS 1 HOUR 30 MINUTES , 25000 SECONDS etc. The units of time specified can * be in uppercase as well as lowercase. Also, if a single number is specified without any time * unit, it is assumed to be in s...
3.26
hbase_RestoreSnapshotHelper_hasRegionsToRestore_rdh
/** * Returns true if there're regions to restore */ public boolean hasRegionsToRestore() { return (this.regionsToRestore != null) && (this.regionsToRestore.size() > 0); }
3.26
hbase_RestoreSnapshotHelper_hasRegionsToRemove_rdh
/** * Returns true if there're regions to remove */ public boolean hasRegionsToRemove() { return (this.regionsToRemove != null) && (this.regionsToRemove.size() > 0); }
3.26
hbase_RestoreSnapshotHelper_getRegionsToRestore_rdh
/** * Returns the list of 'restored regions' during the on-disk restore. The caller is responsible * to add the regions to hbase:meta if not present. * * @return the list of regions restored */ public List<RegionInfo> getRegionsToRestore() { return this.regionsToRestore; }
3.26
hbase_RestoreSnapshotHelper_getRegionsToRemove_rdh
/** * Returns the list of regions removed during the on-disk restore. The caller is responsible to * remove the regions from META. e.g. MetaTableAccessor.deleteRegions(...) * * @return the list of regions to remove from META */ public List<RegionInfo> getRegionsToRemove() { return this.regionsToRemove; }
3.26
hbase_RestoreSnapshotHelper_removeHdfsRegions_rdh
/** * Remove specified regions from the file-system, using the archiver. */ private void removeHdfsRegions(final ThreadPoolExecutor exec, final List<RegionInfo> regions) throws IOException { if ((regions == null) || regions.isEmpty()) return; ModifyRegionUtils.editRegions(exec, regions, new ModifyRegionUtils.RegionE...
3.26
hbase_RestoreSnapshotHelper_restoreStoreFile_rdh
/** * Create a new {@link HFileLink} to reference the store file. * <p> * The store file in the snapshot can be a simple hfile, an HFileLink or a reference. * <ul> * <li>hfile: abc -> table=region-abc * <li>reference: abc.1234 -> table=region-abc.1234 * <li>hfilelink: table=region-hfile -> table=region-hfile * ...
3.26
hbase_RestoreSnapshotHelper_cloneRegion_rdh
/** * Clone region directory content from the snapshot info. Each region is encoded with the table * name, so the cloned region will have a different region name. Instead of copying the hfiles a * HFileLink is created. * * @param region * {@link HRegion} cloned */ private void cloneRegion(final HRegion region...
3.26
hbase_RestoreSnapshotHelper_copySnapshotForScanner_rdh
/** * Copy the snapshot files for a snapshot scanner, discards meta changes. */ public static RestoreMetaChanges copySnapshotForScanner(Configuration conf, FileSystem fs, Path rootDir, Path restoreDir, String snapshotName) throws IOException { // ensure that restore dir is not under root dir if (!restoreDir.getFileSy...
3.26
hbase_RestoreSnapshotHelper_restoreRegion_rdh
/** * Restore region by removing files not in the snapshot and adding the missing ones from the * snapshot. */ private void restoreRegion(final RegionInfo regionInfo, final SnapshotRegionManifest regionManifest, Path regionDir) throws IOException { Map<String, List<SnapshotRegionManifest.StoreFile>> snapshotFiles =...
3.26
hbase_RestoreSnapshotHelper_getRegionsToAdd_rdh
/** * Returns the list of new regions added during the on-disk restore. The caller is responsible * to add the regions to META. e.g MetaTableAccessor.addRegionsToMeta(...) * * @return the list of regions to add to META */ public List<RegionInfo> getRegionsToAdd() { return this.regionsToAdd; }
3.26
hbase_RestoreSnapshotHelper_getTableRegionFamilyFiles_rdh
/** * Returns The set of files in the specified family directory. */ private Set<String> getTableRegionFamilyFiles(final Path familyDir) throws IOException { FileStatus[] hfiles = CommonFSUtils.listStatus(f0, familyDir); if (hfiles == null) { return Collections.emptySet(); } Set<String> familyFiles = new HashSet<>(hf...
3.26
hbase_RestoreSnapshotHelper_restoreMobRegion_rdh
/** * Restore mob region by removing files not in the snapshot and adding the missing ones from the * snapshot. */ private void restoreMobRegion(final RegionInfo regionInfo, final SnapshotRegionManifest regionManifest) throws IOException { if (regionManifest == null) { return; } restoreRegion(regionInfo, regionMani...
3.26
hbase_RestoreSnapshotHelper_restoreReferenceFile_rdh
/** * Create a new {@link Reference} as copy of the source one. * <p> * <blockquote> * * <pre> * The source table looks like: * 1234/abc (original file) * 5678/abc.1234 (reference file) * * After the clone operation looks like: * wxyz/table=1234-abc * stuv/table=1234-abc.wxyz * * NOTE that ...
3.26
hbase_RestoreSnapshotHelper_getTableRegions_rdh
/** * Returns the set of the regions contained in the table */ private List<RegionInfo> getTableRegions() throws IOException { LOG.debug("get table regions: " + tableDir); FileStatus[] regionDirs = CommonFSUtils.listStatus(f0, tableDir, new FSUtils.RegionDirFilter(f0)); if (regionDirs == null) { return null; } List<R...
3.26
hbase_RestoreSnapshotHelper_restoreHdfsMobRegions_rdh
/** * Restore specified mob regions by restoring content to the snapshot state. */ private void restoreHdfsMobRegions(final ThreadPoolExecutor exec, final Map<String, SnapshotRegionManifest> regionManifests, final List<RegionInfo> regions) throws IOException { if ((regions == null) || regions.isEmpty()) return; Modi...
3.26
hbase_RestoreSnapshotHelper_getParentToChildrenPairMap_rdh
/** * Returns the map of parent-children_pair. * * @return the map */ public Map<String, Pair<String, String>> getParentToChildrenPairMap() { return this.parentsMap; }
3.26
hbase_RestoreSnapshotHelper_m0_rdh
/** * Create a new {@link RegionInfo} from the snapshot region info. Keep the same startKey, endKey, * regionId and split information but change the table name. * * @param snapshotRegionInfo * Info for region to clone. * @return the new HRegion instance */ public RegionInfo m0(final RegionInfo snapshotRegionIn...
3.26
hbase_RestoreSnapshotHelper_cloneHdfsMobRegion_rdh
/** * Clone the mob region. For the region create a new region and create a HFileLink for each hfile. */ private void cloneHdfsMobRegion(final Map<String, SnapshotRegionManifest> regionManifests, final RegionInfo region) throws IOException { // clone region info (change embedded tableName with the new one) Path clone...
3.26
hbase_RestoreSnapshotHelper_cloneHdfsRegions_rdh
/** * Clone specified regions. For each region create a new region and create a HFileLink for each * hfile. */ private RegionInfo[] cloneHdfsRegions(final ThreadPoolExecutor exec, final Map<String, SnapshotRegionManifest> regionManifests, final List<RegionInfo> regions) throws IOException { if ((regions == null) ||...
3.26
hbase_RestoreSnapshotHelper_restoreHdfsRegions_rdh
/** * Restore specified regions by restoring content to the snapshot state. */ private void restoreHdfsRegions(final ThreadPoolExecutor exec, final Map<String, SnapshotRegionManifest> regionManifests, final List<RegionInfo> regions) throws IOException { if ((regions == null) || regions.isEmpty()) return; ModifyRegio...
3.26
hbase_RestoreSnapshotHelper_hasRegionsToAdd_rdh
/** * Returns true if there're new regions */ public boolean hasRegionsToAdd() { return (this.regionsToAdd != null) && (this.regionsToAdd.size() > 0); }
3.26
hbase_IndexBlockEncoding_getId_rdh
/** * Returns The id of a data block encoder. */ public short getId() { return f0; }
3.26
hbase_IndexBlockEncoding_getNameInBytes_rdh
/** * Returns name converted to bytes. */ public byte[] getNameInBytes() { return Bytes.toBytes(toString()); }
3.26
hbase_IndexBlockEncoding_getNameFromId_rdh
/** * Find and return the name of data block encoder for the given id. * * @param encoderId * id of data block encoder * @return name, same as used in options in column family */ public static String getNameFromId(short encoderId) { return getEncodingById(encoderId).toString(); }
3.26
hbase_IndexBlockEncoding_writeIdInBytes_rdh
/** * Writes id bytes to the given array starting from offset. * * @param dest * output array * @param offset * starting offset of the output array */ public void writeIdInBytes(byte[] dest, int offset) throws IOException { System.arraycopy(idInBytes, 0, dest, offset, ID_SIZE); }
3.26
hbase_FanOutOneBlockAsyncDFSOutputHelper_createOutput_rdh
/** * Create a {@link FanOutOneBlockAsyncDFSOutput}. The method maybe blocked so do not call it * inside an {@link EventLoop}. */ public static FanOutOneBlockAsyncDFSOutput createOutput(DistributedFileSystem dfs, Path f, boolean overwrite, boolean createParent, short replication, long blockSize, EventLoopGroup eve...
3.26
hbase_WALProcedureStore_getMaxLogId_rdh
/** * Make sure that the file set are gotten by calling {@link #getLogFiles()}, where we will sort * the file set by log id. * * @return Max-LogID of the specified log file set */ private static long getMaxLogId(FileStatus[] logFiles) { if ((logFiles == null) || (logFiles.length == 0)) { return 0L; } return getLog...
3.26
hbase_WALProcedureStore_removeInactiveLogs_rdh
// ========================================================================== // Log Files cleaner helpers // ========================================================================== private void removeInactiveLogs() throws IOException { // We keep track of which procedures are holding the oldest WAL in 'holdingClean...
3.26
hbase_WALProcedureStore_initTrackerFromOldLogs_rdh
/** * If last log's tracker is not null, use it as {@link #storeTracker}. Otherwise, set storeTracker * as partial, and let {@link ProcedureWALFormatReader} rebuild it using entries in the log. */ private void initTrackerFromOldLogs() { if (logs.isEmpty() || (!isRunning())) { return; } ProcedureWALFile log = logs.g...
3.26
hbase_WALProcedureStore_removeAllLogs_rdh
/** * Remove all logs with logId <= {@code lastLogId}. */ private void removeAllLogs(long lastLogId, String why) { if (logs.size() <= 1) { return; } LOG.info("Remove all state logs with ID less than {}, since {}", lastLogId, why); boolean removed = false; while (logs.size() > 1) { ProcedureWALFile log = logs.getFirs...
3.26
hbase_WALProcedureStore_initOldLog_rdh
/** * Loads given log file and it's tracker. */ private ProcedureWALFile initOldLog(final FileStatus logFile, final Path walArchiveDir) throws IOException { final ProcedureWALFile log = new ProcedureWALFile(fs, logFile); if (logFile.getLen() == 0) { LOG.warn("Remove uninitialized log: {}", logFile); log.removeFile(wa...
3.26
hbase_WALProcedureStore_main_rdh
/** * Parses a directory of WALs building up ProcedureState. For testing parse and profiling. * * @param args * Include pointer to directory of WAL files for a store instance to parse & load. */ public static void main(String[] args) throws IOException {Configuration conf = HBaseConfiguration.create(); if ((arg...
3.26
hbase_WALProcedureStore_initOldLogs_rdh
/** * Make sure that the file set are gotten by calling {@link #getLogFiles()}, where we will sort * the file set by log id. * * @return Max-LogID of the specified log file set */ private long initOldLogs(FileStatus[] logFiles) throws IOException { if ((logFiles == null) || (logFiles.length == 0)) { return 0L; }...
3.26
hbase_TableMapReduceUtil_getJar_rdh
/** * Invoke 'getJar' on a custom JarFinder implementation. Useful for some job configuration * contexts (HBASE-8140) and also for testing on MRv2. check if we have HADOOP-9426. * * @param my_class * the class to find. * @return a jar file that contains the class, or null. */private static String getJar(Class<...
3.26
hbase_TableMapReduceUtil_findContainingJar_rdh
/** * Find a jar that contains a class of the same name, if any. It will return a jar file, even if * that is not the first thing on the class path that has a class with the same name. Looks first * on the classpath and then in the <code>packagedClasses</code> map. * * @param my_class * the class to find. * @r...
3.26
hbase_TableMapReduceUtil_addHBaseDependencyJars_rdh
/** * Add HBase and its dependencies (only) to the job configuration. * <p> * This is intended as a low-level API, facilitating code reuse between this class and its mapred * counterpart. It also of use to external tools that need to build a MapReduce job that interacts * with HBase but want fine-grained control o...
3.26
hbase_TableMapReduceUtil_updateMap_rdh
/** * Add entries to <code>packagedClasses</code> corresponding to class files contained in * <code>jar</code>. * * @param jar * The jar who's content to list. * @param packagedClasses * map[class -> jar] */ private static void updateMap(String jar, Map<String, String> packagedClasses) throws IOException { ...
3.26
hbase_TableMapReduceUtil_setNumReduceTasks_rdh
/** * Sets the number of reduce tasks for the given job configuration to the number of regions the * given table has. * * @param table * The table to get the region count for. * @param job * The current job to adjust. * @throws IOException * When retrieving the table details fails. */ public static void...
3.26
hbase_TableMapReduceUtil_buildDependencyClasspath_rdh
/** * Returns a classpath string built from the content of the "tmpjars" value in {@code conf}. Also * exposed to shell scripts via `bin/hbase mapredcp`. */ public static String buildDependencyClasspath(Configuration conf) { if (conf == null) { throw new IllegalArgumentException("Must provide a configur...
3.26
hbase_TableMapReduceUtil_initMultiTableSnapshotMapperJob_rdh
/** * Sets up the job for reading from one or more table snapshots, with one or more scans per * snapshot. It bypasses hbase servers and read directly from snapshot files. * * @param snapshotScans * map of snapshot name to scans on that snapshot. * @param mapper * The mapper class to use. * @param outputKey...
3.26
hbase_TableMapReduceUtil_resetCacheConfig_rdh
/** * Enable a basic on-heap cache for these jobs. Any BlockCache implementation based on direct * memory will likely cause the map tasks to OOM when opening the region. This is done here * instead of in TableSnapshotRegionRecordReader in case an advanced user wants to override this * behavior in their job. */ pub...
3.26
hbase_TableMapReduceUtil_convertStringToScan_rdh
/** * Converts the given Base64 string back into a Scan instance. * * @param base64 * The scan details. * @return The newly created Scan instance. * @throws IOException * When reading the scan instance fails. */ public static Scan convertStringToScan(String base64) throws IOException { byte[] decoded = ...
3.26
hbase_TableMapReduceUtil_limitNumReduceTasks_rdh
/** * Ensures that the given number of reduce tasks for the given job configuration does not exceed * the number of regions for the given table. * * @param table * The table to get the region count for. * @param job * The current job to adjust. * @throws IOException * When retrieving the table details fa...
3.26
hbase_TableMapReduceUtil_initCredentialsForCluster_rdh
/** * Obtain an authentication token, for the specified cluster, on behalf of the current user and * add it to the credentials for the given map reduce job. * * @param job * The job that requires the permission. * @param conf * The configuration to use in connecting to the peer cluster * @throws IOException...
3.26
hbase_TableMapReduceUtil_addDependencyJarsForClasses_rdh
/** * Add the jars containing the given classes to the job's configuration such that JobClient will * ship them to the cluster and add them to the DistributedCache. N.B. that this method at most * adds one jar per class given. If there is more than one jar available containing a class with * the same name as a give...
3.26
hbase_TableMapReduceUtil_initTableReducerJob_rdh
/** * Use this before submitting a TableReduce job. It will appropriately set up the JobConf. * * @param table * The output table. * @param reducer * The reducer class to use. * @param job * The current job to adjust. Make sure the passed job is carrying all * necessary HBase configuration. * @param p...
3.26
hbase_TableMapReduceUtil_findOrCreateJar_rdh
/** * Finds the Jar for a class or creates it if it doesn't exist. If the class is in a directory in * the classpath, it creates a Jar on the fly with the contents of the directory and returns the * path to that Jar. If a Jar is created, it is created in the system temporary directory. * Otherwise, returns an exist...
3.26
hbase_TableMapReduceUtil_initTableSnapshotMapperJob_rdh
/** * Sets up the job for reading from a table snapshot. It bypasses hbase servers and read directly * from snapshot files. * * @param snapshotName * The name of the snapshot (of a table) to read from. * @param scan * The scan instance with the columns, time range etc. * @param mapper * The mapper class ...
3.26
hbase_TableMapReduceUtil_addDependencyJars_rdh
/** * Add the HBase dependency jars as well as jars for any of the configured job classes to the job * configuration, so that JobClient will ship them to the cluster and add them to the * DistributedCache. */ public sta...
3.26
hbase_TableMapReduceUtil_convertScanToString_rdh
/** * Writes the given scan into a Base64 encoded string. * * @param scan * The scan to write out. * @return The scan saved in a Base64 encoded string. * @throws IOException * When writing the scan fails. */ public static String convertScanToString(Scan scan) throws IOException { ClientProtos.Scan proto...
3.26
hbase_TableMapReduceUtil_setScannerCaching_rdh
/** * Sets the number of rows to return and cache with each scanner iteration. Higher caching values * will enable faster mapreduce jobs at the expense of requiring more heap to contain the cached * rows. * * @param job * The current job to adjust. * @param batchSize * The number of rows to return in batch ...
3.26
hbase_TableMapReduceUtil_initTableMapperJob_rdh
/** * Use this before submitting a Multi TableMap job. It will appropriately set up the job. * * @param scans * The list of {@link Scan} objects to read from. * @param mapper * The mapper class to use. * @param outputKeyClass * The class of the output key. * @param outputValueClass * The class of the ...
3.26
hbase_TaskGroup_addTask_rdh
/** * Add a new task to the group, and before that might complete the last task in the group * * @param description * the description of the new task * @param withCompleteLast * whether to complete the last task in the group * @return the added new task */ public synchronized MonitoredTask addTask(String d...
3.26
hbase_ProcedureMember_close_rdh
/** * Best effort attempt to close the threadpool via Thread.interrupt. */ @Override public void close() throws IOException { // have to use shutdown now to break any latch waiting f0.shutdownNow(); }
3.26
hbase_ProcedureMember_receivedReachedGlobalBarrier_rdh
/** * Notification that procedure coordinator has reached the global barrier * * @param procName * name of the subprocedure that should start running the in-barrier phase */ public void receivedReachedGlobalBarrier(String procName) { Subprocedure subproc = subprocs.get(procName); if (subproc == null) { ...
3.26
hbase_ProcedureMember_defaultPool_rdh
/** * Default thread pool for the procedure * * @param procThreads * the maximum number of threads to allow in the pool * @param keepAliveMillis * the maximum time (ms) that excess idle threads will wait for new tasks */ public static ThreadPoolExecutor defaultPool(String memberName, int procThreads, long ke...
3.26
hbase_ProcedureMember_controllerConnectionFailure_rdh
/** * The connection to the rest of the procedure group (member and coordinator) has been * broken/lost/failed. This should fail any interested subprocedure, but not attempt to notify * other members since we cannot reach them anymore. * * @param message * description of the error * @param cause * the actua...
3.26
hbase_ProcedureMember_createSubprocedure_rdh
/** * This is separated from execution so that we can detect and handle the case where the * subprocedure is invalid and inactionable due to bad info (like DISABLED snapshot type being * sent here) */ public Subprocedure createSubprocedure(String opName, byte[] data) { return builder.buildSubprocedure(opName, d...
3.26
hbase_ProcedureMember_getRpcs_rdh
/** * Package exposed. Not for public use. * * @return reference to the Procedure member's rpcs object */ ProcedureMemberRpcs getRpcs() { return rpcs; }
3.26
hbase_ProcedureMember_receiveAbortProcedure_rdh
/** * Send abort to the specified procedure * * @param procName * name of the procedure to about * @param ee * exception information about the abort */ public void receiveAbortProcedure(String procName, ForeignException ee) { LOG.debug("Request received to abort procedure " + procName, ee); // if we...
3.26
hbase_ProcedureMember_closeAndWait_rdh
/** * Shutdown the threadpool, and wait for upto timeoutMs millis before bailing * * @param timeoutMs * timeout limit in millis * @return true if successfully, false if bailed due to timeout. */ boolean closeAndWait(long timeoutMs) throws InterruptedException { f0.shutdown(); return f0.awaitTermination...
3.26
hbase_SecurityUtil_getPrincipalWithoutRealm_rdh
/** * Get the user name from a principal */ public static String getPrincipalWithoutRealm(final String principal) { int i = principal.indexOf("@"); return i > (-1) ? principal.substring(0, i) : principal; }
3.26
hbase_Mutation_getCellBuilder_rdh
/** * get a CellBuilder instance that already has relevant Type and Row set. * * @param cellBuilderType * e.g CellBuilderType.SHALLOW_COPY * @param cellType * e.g Cell.Type.Put * @return CellBuilder which already has relevant Type and Row set. */ protected CellBuilder getCellBuilder(CellBuilderType cellBuil...
3.26
hbase_Mutation_setClusterIds_rdh
/** * Marks that the clusters with the given clusterIds have consumed the mutation * * @param clusterIds * of the clusters that have consumed the mutation */ public Mutation setClusterIds(List<UUID> clusterIds) { ByteArrayDataOutput out = ByteStreams.newDataOutput();out.writeInt(clusterIds.size()); for...
3.26
hbase_Mutation_getACL_rdh
/** * Returns The serialized ACL for this operation, or null if none */ public byte[] getACL() { return getAttribute(AccessControlConstants.OP_ATTRIBUTE_ACL); }
3.26
hbase_Mutation_getFingerprint_rdh
/** * Compile the column family (i.e. schema) information into a Map. Useful for parsing and * aggregation by debugging, logging, and administration tools. */ @Override public Map<String, Object> getFingerprint() { Map<String, Object> map = new HashMap<>(); List<String> families = new ArrayList<>(getFamilyCe...
3.26
hbase_Mutation_size_rdh
/** * Number of KeyValues carried by this Mutation. * * @return the total number of KeyValues */ public int size() { int size = 0; for (List<Cell> cells : getFamilyCellMap().values()) { size += cells.size(); } return size; }
3.26
hbase_Mutation_getCellVisibility_rdh
/** * Returns CellVisibility associated with cells in this Mutation. n */ public CellVisibility getCellVisibility() throws DeserializationException { byte[] cellVisibilityBytes = this.getAttribute(VisibilityConstants.VISIBILITY_LABELS_ATTR_KEY); if (cellVisibilityBytes == null) return null; ...
3.26
hbase_Mutation_getFamilyCellMap_rdh
/** * Method for retrieving the put's familyMap */ public NavigableMap<byte[], List<Cell>> getFamilyCellMap() { return this.familyMap; }
3.26
hbase_Mutation_checkRow_rdh
/** * * @param row * Row to check * @throws IllegalArgumentException * Thrown if <code>row</code> is empty or null or &gt; * {@link HConstants#MAX_ROW_LENGTH} * @return <code>row</code> */ static byte[] checkRow(final byte[] row, final int offset, final int length) { if (row == null) { throw new I...
3.26
hbase_Mutation_getDurability_rdh
/** * Get the current durability */ public Durability getDurability() { return this.durability; }
3.26
hbase_Mutation_toMap_rdh
/** * Compile the details beyond the scope of getFingerprint (row, columns, timestamps, etc.) into a * Map along with the fingerprinted information. Useful for debugging, logging, and administration * tools. * * @param maxCols * ...
3.26
hbase_Mutation_m2_rdh
/** * Private method to determine if this object's familyMap contains the given value assigned to the * given family, qualifier and timestamp, respecting the 2 boolean arguments. */ protected boolean m2(byte[] family, byte[] qualifier, long ts, byte[] value, boolean ignoreTS, boolean ignoreValue) { List<Cell> list =...
3.26
hbase_Mutation_isEmpty_rdh
/** * Method to check if the familyMap is empty * * @return true if empty, false otherwise */ public boolean isEmpty() { return getFamilyCellMap().isEmpty(); }
3.26
hbase_Mutation_getClusterIds_rdh
/** * Returns the set of clusterIds that have consumed the mutation */ public List<UUID> getClusterIds() { List<UUID> clusterIds = new ArrayList<>(); byte[] bytes = getAttribute(CONSUMED_CLUSTER_IDS); if (bytes != null) { ByteArrayDataInput in = ByteStreams.newDataInput(bytes); int numClu...
3.26
hbase_Mutation_setACL_rdh
/** * Set the ACL for this operation. * * @param perms * A map of permissions for a user or users */ public Mutation setACL(Map<String, Permission> perms) { ListMultimap<String, Permission> permMap = ArrayListMultimap.create(); for (Map.Entry<String, Permission> entry : perms.entrySet()) { permM...
3.26
hbase_Mutation_numFamilies_rdh
/** * Returns the number of different families */ public int numFamilies() { return getFamilyCellMap().size(); }
3.26
hbase_Mutation_toCellVisibility_rdh
/** * Convert a protocol buffer CellVisibility bytes to a client CellVisibility * * @return the converted client CellVisibility */ private static CellVisibility toCellVisibility(byte[] protoBytes) throws DeserializationException { if (protoBytes == null) return null; ClientProtos.CellVisibility.Buil...
3.26
hbase_Mutation_m0_rdh
/** * Method for retrieving the timestamp. */ public long m0() { return this.ts; }
3.26
hbase_Mutation_getRow_rdh
/** * Method for retrieving the delete's row */@Overridepublic byte[] getRow() { return this.row; }
3.26
hbase_Mutation_setReturnResults_rdh
// Used by Increment and Append only. @InterfaceAudience.Private protected Mutation setReturnResults(boolean returnResults) { setAttribute(RETURN_RESULTS, Bytes.toBytes(returnResults)); return this; }
3.26
hbase_Mutation_createPutKeyValue_rdh
/** * Create a KeyValue with this objects row key and the Put identifier. * * @return a KeyValue with this objects row key and the Put identifier. */ KeyValue createPutKeyValue(byte[] family, ByteBuffer qualifier, long ts, ByteBuffer value, Tag[] tags) { return new KeyValue(this.row, 0, this.row == null ? 0 :...
3.26
hbase_Mutation_m1_rdh
/** * Subclasses should override this method to add the heap size of their own fields. * * @return the heap size to add (will be aligned). */ protected long m1() { return 0L; }
3.26
hbase_Mutation_getCellList_rdh
/** * Creates an empty list if one doesn't exist for the given column family or else it returns the * associated list of Cell objects. * * @param family * column family * @return a list of Cell objects, returns an empty list if one doesn't exist. */ List<Cell> getCellList(byte[] family) {List<Cell> v0 = getFam...
3.26
hbase_Mutation_setTimestamp_rdh
/** * Set the timestamp of the delete. */ public Mutation setTimestamp(long timestamp) { if (timestamp < 0) { throw new IllegalArgumentException("Timestamp cannot be negative. ts=" + timestamp); } this.ts = timestamp; return this;}
3.26
hbase_Mutation_setCellVisibility_rdh
/** * Sets the visibility expression associated with cells in this Mutation. */ public Mutation setCellVisibility(CellVisibility expression) {this.setAttribute(VisibilityConstants.VISIBILITY_LABELS_ATTR_KEY, toCellVisibility(expression).toByteArray()); return this; }
3.26
hbase_Mutation_setTTL_rdh
/** * Set the TTL desired for the result of the mutation, in milliseconds. * * @param ttl * the TTL desired for the result of the mutation, in milliseconds */public Mutation setTTL(long ttl) { setAttribute(OP_ATTRIBUTE_TTL, Bytes.toBytes(ttl)); return this; }
3.26
hbase_Mutation_heapSize_rdh
/** * Returns Calculate what Mutation adds to class heap size. */ @Override public long heapSize() { long heapsize = MUTATION_OVERHEAD; // Adding row heapsize += ClassSize.align(ClassSize.ARRAY + this.row.length); // Adding map overhead heapsize += ClassSize.align(getFamilyCellMap().size() * Cla...
3.26
hbase_Mutation_setDurability_rdh
/** * Set the durability for this mutation */ public Mutation setDurability(Durability d) { this.durability = d; return this; }
3.26
hbase_LocalHBaseCluster_m0_rdh
/** * * @param c * Configuration to check. * @return True if a 'local' address in hbase.master value. */ public static boolean m0(final Configuration c) { boolean mode = c.getBoolean(HConstants.CLUSTER_DISTRIBUTED, HConstants.DEFAULT_CLUSTER_DISTRIBUTED); return mode == HConstants.CLUSTER_IS_LOCAL; }
3.26
hbase_LocalHBaseCluster_getRegionServer_rdh
/** * Returns region server */ public HRegionServer getRegionServer(int serverNumber) { return regionThreads.get(serverNumber).getRegionServer(); }
3.26
hbase_LocalHBaseCluster_getActiveMaster_rdh
/** * Gets the current active master, if available. If no active master, returns null. * * @return the HMaster for the active master */ public HMaster getActiveMaster() { for (JVMClusterUtil.MasterThread mt : masterThreads) { // Ensure that the current active master is not stopped. // We don't w...
3.26
hbase_LocalHBaseCluster_getMasters_rdh
/** * Returns Read-only list of master threads. */ public List<JVMClusterUtil.MasterThread> getMasters() { return Collections.unmodifiableList(this.masterThreads); }
3.26
hbase_LocalHBaseCluster_getMaster_rdh
/** * Returns the HMaster thread */ public HMaster getMaster(int serverNumber) { return masterThreads.get(serverNumber).getMaster(); }
3.26
hbase_LocalHBaseCluster_join_rdh
/** * Wait for Mini HBase Cluster to shut down. Presumes you've already called {@link #shutdown()}. */ public void join() { if (this.regionThreads != null) { for (Thread t : this.regionThreads) { ...
3.26
hbase_LocalHBaseCluster_startup_rdh
/** * Start the cluster. */ public void startup() throws IOException { JVMClusterUtil.startup(this.masterThreads, this.regionThreads); }
3.26
hbase_LocalHBaseCluster_getRegionServers_rdh
/** * Returns Read-only list of region server threads. */ public List<JVMClusterUtil.RegionServerThread> getRegionServers() { return Collections.unmodifiableList(this.regionThreads);}
3.26