name stringlengths 12 178 | code_snippet stringlengths 8 36.5k | score float64 3.26 3.68 |
|---|---|---|
hbase_ZKWatcher_keeperException_rdh | /**
* Handles KeeperExceptions in client calls.
* <p>
* This may be temporary but for now this gives one place to deal with these.
* <p>
* TODO: Currently this method rethrows the exception to let the caller handle
* <p>
*
* @param ke
* the exception to rethrow
* @throws KeeperException
* if a ZooKeeper ... | 3.26 |
hbase_ZKWatcher_connectionEvent_rdh | // Connection management
/**
* Called when there is a connection-related event via the Watcher callback.
* <p>
* If Disconnected or Expired, this should shutdown the cluster. But, since we send a
* KeeperException.SessionExpiredException along with the abort call, it's possible for the
* Abortable to catch it and ... | 3.26 |
hbase_ZKWatcher_getMetaReplicaNodes_rdh | /**
* Get the znodes corresponding to the meta replicas from ZK
*
* @return list of znodes
* @throws KeeperException
* if a ZooKeeper operation fails
*/
public List<String> getMetaReplicaNodes() throws KeeperException {
List<String> childrenOfBaseNode = ZKUtil.listChildrenNoWatch(this, znodePaths.baseZNode)... | 3.26 |
hbase_ZKWatcher_checkAndSetZNodeAcls_rdh | /**
* On master start, we check the znode ACLs under the root directory and set the ACLs properly if
* needed. If the cluster goes from an unsecure setup to a secure setup, this step is needed so
* that the existing znodes created with open permissions are now changed with restrictive perms.
*/
public void checkAnd... | 3.26 |
hbase_ZKWatcher_isSuperUserId_rdh | /* Validate whether ACL ID is superuser. */
public static boolean isSuperUserId(String[] superUsers, Id id) {
for (String v22 : superUsers) {
// TODO: Validate super group members also when ZK supports setting node ACL for groups.
if ((!AuthUtil.isGroupPrincipal(v22)) && new Id("sasl", v22).equals... | 3.26 |
hbase_ZKWatcher_checkACLForSuperUsers_rdh | /* Validate whether ACL set for all superusers. */
private boolean checkACLForSuperUsers(String[] superUsers, List<ACL> acls)
{
for (String user : superUsers) {
boolean hasAccess = false;
// TODO: Validate super group members also when ZK supports setting node ACL for groups.
if (!AuthUti... | 3.26 |
hbase_ZKWatcher_isBaseZnodeAclSetup_rdh | /**
* Checks whether the ACLs returned from the base znode (/hbase) is set for secure setup.
*
* @param acls
* acls from zookeeper
* @return whether ACLs are set for the base znode
* @throws IOException
* if getting the current user fails
*/
private boolean isBaseZnodeAclSetup(List<ACL> acls) throws IOExcep... | 3.26 |
hbase_ZKWatcher_getRecoverableZooKeeper_rdh | /**
* Get the connection to ZooKeeper.
*
* @return connection reference to zookeeper
*/
public RecoverableZooKeeper getRecoverableZooKeeper() {
return recoverableZooKeeper;} | 3.26 |
hbase_ZKWatcher_syncOrTimeout_rdh | /**
* Forces a synchronization of this ZooKeeper client connection within a timeout. Enforcing a
* timeout lets the callers fail-fast rather than wait forever for the sync to finish.
* <p>
* Executing this method before running other methods will ensure that the subsequent op... | 3.26 |
hbase_ZKWatcher_getQuorum_rdh | /**
* Get the quorum address of this instance.
*
* @return quorum string of this zookeeper connection instance
*/
public String getQuorum() {
return quorum;
} | 3.26 |
hbase_ZKWatcher_interruptedException_rdh | /**
* Handles InterruptedExceptions in client calls.
*
* @param ie
* the InterruptedException instance thrown
* @throws KeeperException
* the exception to throw, transformed from the InterruptedException
*/
public void interruptedException(InterruptedException ie) throws KeeperException {
interruptedExce... | 3.26 |
hbase_ZKWatcher_m3_rdh | /**
* Method called from ZooKeeper for events and connection status.
* <p>
* Valid events are passed along to listeners. Connection status changes are dealt with locally.
*/
@Override
public void m3(WatchedEvent event) {
LOG.debug(prefix(((((((("Received ZooKeeper Event, " + "type=") + event.getType()) + ", ") ... | 3.26 |
hbase_ZKWatcher_m2_rdh | /**
* Returns The number of currently registered listeners
*/
public int m2() {
return listeners.size();
} | 3.26 |
hbase_ZKWatcher_unregisterAllListeners_rdh | /**
* Clean all existing listeners
*/
public void unregisterAllListeners() {
listeners.clear();
} | 3.26 |
hbase_ZKWatcher_getZNodePaths_rdh | /**
* Get the znodePaths.
* <p>
* Mainly used for mocking as mockito can not mock a field access.
*/
public ZNodePaths getZNodePaths() {
return znodePaths;
} | 3.26 |
hbase_ZKWatcher_filterMetaReplicaNodes_rdh | /**
*
* @param nodes
* Input list of znodes
* @return Filtered list of znodes from nodes that belong to meta replica(s).
*/
private List<String> filterMetaReplicaNodes(List<String> nodes) {
if ((nodes == null) || nodes.isEmpty())
{
return new ArrayList<>();
}
List<String> metaReplicaNodes... | 3.26 |
hbase_ZKWatcher_registerListenerFirst_rdh | /**
* Register the specified listener to receive ZooKeeper events and add it as the first in the list
* of current listeners.
*
* @param listener
* the listener to register
*/
public void registerListenerFirst(ZKListener listener) { listeners.add(0, listener);} | 3.26 |
hbase_RpcThrottlingException_stringFromMillis_rdh | // Visible for TestRpcThrottlingException
protected static String stringFromMillis(long millis) {
StringBuilder buf = new StringBuilder();
long hours
= millis / ((60 * 60) * 1000);
long rem = millis % ((60 * 60) * 1000);
long minutes = rem / (60 * 1000);
rem = rem % (60 * 1000);
long second... | 3.26 |
hbase_UserQuotaState_setQuotas_rdh | /**
* Add the quota information of the specified namespace. (This operation is part of the QuotaState
* setup)
*/
public void setQuotas(final String namespace, Quotas quotas) {
namespaceLimiters = setLimiter(namespaceLimiters, namespace, quotas);} | 3.26 |
hbase_UserQuotaState_getTableLimiter_rdh | /**
* Return the limiter for the specified table associated with this quota. If the table does not
* have its own quota limiter the global one will be returned. In case there is no quota limiter
* associated with this object a noop limiter will be returned.
*
* @return the quota limiter for the specified table
*/... | 3.26 |
hbase_UserQuotaState_update_rdh | /**
* Perform an update of the quota state based on the other quota state object. (This operation is
* executed by the QuotaCache)
*/
@Override
public synchronized void update(final QuotaState other) {super.update(other);
if (other instanceof UserQuotaState) {
UserQuotaState uOther = ((UserQuotaState) (... | 3.26 |
hbase_UserQuotaState_isBypass_rdh | /**
* Returns true if there is no quota information associated to this object
*/
@Override
public synchronized boolean isBypass() {
return (((!bypassGlobals) && (getGlobalLimiterWithoutUpdatingLastQuery() == NoopQuotaLimiter.get())) && ((tableLimiters == null) || tableLimiters.isEmpty())) &... | 3.26 |
hbase_CostFunction_updateWeight_rdh | /**
* Add the cost of this cost function to the weight of the candidate generator that is optimized
* for this cost function. By default it is the RandomCandiateGenerator for a cost function.
* Called once per init or after postAction.
*
* @param weights
* the weights for every generator.
*/
public void update... | 3.26 |
hbase_CostFunction_scale_rdh | /**
* Scale the value between 0 and 1.
*
* @param min
* Min value
* @param max
* The Max value
* @param value
* The value to be scaled.
* @return The scaled value.
*/
protected static double scale(double min, double max, double value) {
if ((((max <= min) || (value <= min)) || (Math.abs(max - min) <... | 3.26 |
hbase_CostFunction_prepare_rdh | /**
* Called once per LB invocation to give the cost function to initialize it's state, and perform
* any costly calculation.
*/
void prepare(BalancerClusterState cluster) {
this.cluster = cluster;
} | 3.26 |
hbase_CostFunction_postAction_rdh | /**
* Called once per cluster Action to give the cost function an opportunity to update it's state.
* postAction() is always called at least once before cost() is called with the cluster that this
* action is performed on.
*/
void postAction(BalanceAction action) {
switch (action.get... | 3.26 |
hbase_TableInputFormatBase_setTableRecordReader_rdh | /**
* Allows subclasses to set the {@link TableRecordReader}. to provide other
* {@link TableRecordReader} implementations.
*/
protected void setTableRecordReader(TableRecordReader tableRecordReader) {
this.tableRecordReader = tableRecordReader;
} | 3.26 |
hbase_TableInputFormatBase_getRecordReader_rdh | /**
* Builds a TableRecordReader. If no TableRecordReader was provided, uses the default.
*
* @see InputFormat#getRecordReader(InputSplit, JobConf, Reporter)
*/
public RecordReader<ImmutableBytesWritable, Result> getRecordReader(InputSplit split, JobConf job, Reporter reporter) throws IOException {
// In case a... | 3.26 |
hbase_TableInputFormatBase_getSplits_rdh | /**
* Calculates the splits that will serve as input for the map tasks.
* <p/>
* Splits are created in number equal to the smallest between numSplits and the number of
* {@link org.apache.hadoop.hbase.regionserver.HRegion}s in the table. If the number of splits is
* smaller than the number of {@link org.apache.had... | 3.26 |
hbase_TableInputFormatBase_closeTable_rdh | /**
* Close the Table and related objects that were initialized via
* {@link #initializeTable(Connection, TableName)}.
*/protected void closeTable() throws IOException {
close(table, connection);
table = null;
connection = null;
} | 3.26 |
hbase_TableInputFormatBase_setRowFilter_rdh | /**
* Allows subclasses to set the {@link Filter} to be used.
*/
protected void
setRowFilter(Filter rowFilter) {this.rowFilter = rowFilter;
} | 3.26 |
hbase_TableInputFormatBase_setInputColumns_rdh | /**
*
* @param inputColumns
* to be passed in {@link Result} to the map task.
*/
protected void setInputColumns(byte[][] inputColumns) {
this.inputColumns = inputColumns;
} | 3.26 |
hbase_TableInputFormatBase_m0_rdh | /**
* Allows subclasses to get the {@link Table}.
*/
protected Table m0() {
if (table == null) {
throw new IllegalStateException(f0);
}
return this.table;
} | 3.26 |
hbase_TableInputFormatBase_initializeTable_rdh | /**
* Allows subclasses to initialize the table information.
*
* @param connection
* The Connection to the HBase cluster. MUST be unmanaged. We will close.
* @param tableName
* The {@link TableName} of the table to process.
*/
protected void
initializeTable(Connection connection, TableName tableName) throws ... | 3.26 |
hbase_FanOutOneBlockAsyncDFSOutput_recoverAndClose_rdh | /**
* The close method when error occurred. Now we just call recoverFileLease.
*/
@Override
public void recoverAndClose(CancelableProgressable reporter) throws IOException {
if (buf != null) {
buf.release();
buf = null;
}
closeDataNodeChannelsAndAwait();
endFileLease(client, fileId);
... | 3.26 |
hbase_FanOutOneBlockAsyncDFSOutput_close_rdh | /**
* End the current block and complete file at namenode. You should call
* {@link #recoverAndClose(CancelableProgressable)} if this method throws an exception.
*/
@Override
public void close() throws IOException {
endBlock();
state = State.CLOSED;
closeDataNodeChannelsAndAwait();
block.setNumByte... | 3.26 |
hbase_FanOutOneBlockAsyncDFSOutput_completed_rdh | // all lock-free to make it run faster
private void completed(Channel channel) {
for (Iterator<Callback> iter = waitingAckQueue.iterator(); iter.hasNext();) { Callback c = iter.next();
// if the current unfinished replicas does not contain us then it means that we have already
// acked this one, le... | 3.26 |
hbase_FanOutOneBlockAsyncDFSOutput_failed_rdh | // this usually does not happen which means it is not on the critical path so make it synchronized
// so that the implementation will not burn up our brain as there are multiple state changes and
// checks.
private synchronized void failed(Channel channel, Supplier<Throwable> errorSupplier) {
if (state == State.CLO... | 3.26 |
hbase_FanOutOneBlockAsyncDFSOutput_flush_rdh | /**
* Flush the buffer out to datanodes.
*
* @param syncBlock
* will call hsync if true, otherwise hflush.
* @return A CompletableFuture that hold the acked length after flushing.
*/
@Override
public CompletableFuture<Long> flush(boolean syncBlock) {
CompletableFuture<Long> future = new CompletableFuture<>(... | 3.26 |
hbase_ThrottleSettings_getProto_rdh | /**
* Returns a copy of the internal state of <code>this</code>
*/
ThrottleRequest getProto() {
return proto.toBuilder().build();
} | 3.26 |
hbase_FileMmapIOEngine_isPersistent_rdh | /**
* File IO engine is always able to support persistent storage for the cache
*/
@Override
public boolean isPersistent() {
// TODO : HBASE-21981 needed for persistence to really work
return true;
} | 3.26 |
hbase_FileMmapIOEngine_m1_rdh | /**
* Sync the data to file after writing
*/
@Override
public void m1() throws IOException {
if (f0 != null) {
f0.force(true);
}
} | 3.26 |
hbase_FileMmapIOEngine_shutdown_rdh | /**
* Close the file
*/
@Override public void shutdown() {
try {
f0.close();
} catch (IOException ex) {LOG.error("Can't shutdown cleanly", ex);
}
try {
raf.close();
} catch (IOException ex) {
LOG.error("Can't shutdown clean... | 3.26 |
hbase_FileMmapIOEngine_write_rdh | /**
* Transfers data from the given byte buffer to file
*
* @param srcBuffer
* the given byte buffer from which bytes are to be read
* @param offset
* The offset in the file where the first byte to be written
*/
@Override
public ... | 3.26 |
hbase_ArrayBackedTag_hasArray_rdh | /**
* Returns Offset of actual tag bytes within the backed buffer
*/
@Overridepublic int getValueOffset() {return this.offset + INFRASTRUCTURE_SIZE;}
@Override
public boolean hasArray() {
return true;
} | 3.26 |
hbase_ArrayBackedTag_getValueOffset_rdh | /**
* Returns Offset of actual tag bytes within the backed buffer
*/
| 3.26 |
hbase_ArrayBackedTag_getValueArray_rdh | /**
* Returns The byte array backing this Tag.
*/
@Override
public byte[] getValueArray() {
return this.bytes;
} | 3.26 |
hbase_ArrayBackedTag_getType_rdh | /**
* Returns the tag type
*/@Override
public byte getType() {
return this.type;
} | 3.26 |
hbase_ArrayBackedTag_getValueLength_rdh | /**
* Returns Length of actual tag bytes within the backed buffer
*/
@Override
public int getValueLength() {
return this.length - INFRASTRUCTURE_SIZE;
} | 3.26 |
hbase_MobUtils_parseDate_rdh | /**
* Parses the string to a date.
*
* @param dateString
* The string format of a date, it's yyyymmdd.
* @return A date.
*/
public static Date parseDate(String dateString) throws ParseException {
return LOCAL_FORMAT.get().parse(dateString);
} | 3.26 |
hbase_MobUtils_isReadEmptyValueOnMobCellMiss_rdh | /**
* Indicates whether return null value when the mob file is missing or corrupt. The information is
* set in the attribute "empty.value.on.mobcell.miss" of scan.
*
* @param scan
* The current scan.
* @return True if the readEmptyValueOnMobCellMiss is enabled.
*/
public static boolean isReadEmptyValueOnMobCel... | 3.26 |
hbase_MobUtils_removeMobFiles_rdh | /**
* Archives the mob files.
*
* @param conf
* The current configuration.
* @param fs
* The current file system.
* @param tableName
* The table name.
* @param tableDir
* The table directory.
* @param family
* The name of the column family.
* @param storeFiles
* The files to be deleted.
*/
pu... | 3.26 |
hbase_MobUtils_isMobRegionInfo_rdh | /**
* Gets whether the current RegionInfo is a mob one.
*
* @param regionInfo
* The current RegionInfo.
* @return If true, the current RegionInfo is a mob one.
*/
public static boolean isMobRegionInfo(RegionInfo regionInfo) {
return regionInfo == null ? false : getMobRegionInfo(regionInfo.getTable()).getE... | 3.26 |
hbase_MobUtils_createMobRefCell_rdh | /**
* Creates a mob reference KeyValue. The value of the mob reference KeyValue is mobCellValueSize +
* mobFileName.
*
* @param cell
* The original Cell.
* @param fileName
* The mob file name where the mob reference KeyValue is written.
* @param tableNameTag
* The tag of the current table name. It's very... | 3.26 |
hbase_MobUtils_hasValidMobRefCellValue_rdh | /**
* Indicates whether the current mob ref cell has a valid value. A mob ref cell has a mob
* reference tag. The value of a mob ref cell consists of two parts, real mob value length and mob
* file name. The real mob value length takes 4 bytes. The remaining part is the mob file name.
*
* @param cell
* The mob ... | 3.26 |
hbase_MobUtils_hasMobColumns_rdh | /**
* Checks whether this table has mob-enabled columns.
*
* @param htd
* The current table descriptor.
* @return Whether this table has mob-enabled columns.
*/
public static boolean hasMobColumns(TableDescriptor htd) {
ColumnFamilyDescriptor[] hcds = htd.getColumnFamilies();
for (ColumnFamilyDescriptor... | 3.26 |
hbase_MobUtils_isMobFileExpired_rdh | /**
* Checks if the mob file is expired.
*
* @param column
* The descriptor of the current column family.
* @param current
* The current time.
* @param fileDate
* The date string parsed from the mob file name.
* @return True if the mob file is expired.
*/
public static boolean
isMobFileExpired(ColumnFam... | 3.26 |
hbase_MobUtils_getTableName_rdh | /**
* Get the table name from when this cell was written into a mob hfile as a TableName.
*
* @param cell
* to extract tag from
* @return name of table as a TableName. empty if the tag is not found.
*/
public static Optional<TableName> getTableName(Cell cell) {
Optional<Tag>
maybe = getTableNameTag(ce... | 3.26 |
hbase_MobUtils_getMobFileName_rdh | /**
* Gets the mob file name from the mob ref cell. A mob ref cell has a mob reference tag. The value
* of a mob ref cell consists of two parts, real mob value length and mob file name. The real mob
* value length takes 4 bytes. The remaining part is the mob file name.
*
* @param cell
* The mob ref cell.
* @re... | 3.26 |
hbase_MobUtils_getMobFamilyPath_rdh | /**
* Gets the family dir of the mob files. It's
* {HBASE_DIR}/mobdir/{namespace}/{tableName}/{regionEncodedName}/{columnFamilyName}.
*
* @param regionPath
* The path of mob region which is a dummy one.
* @param familyName
* The current family name.
* @return The family dir of the mob files.
*/
public stat... | 3.26 |
hbase_MobUtils_getTableNameTag_rdh | /**
* Gets the table name tag.
*
* @param cell
* The current cell.
* @return The table name tag.
*/
private static Optional<Tag> getTableNameTag(Cell cell) {
Optional<Tag> tag = Optional.empty();
if (cell.getTagsLength() > 0) {
tag = PrivateCellUtil.getTag(cell, TagType.MOB_TABLE_NAME_TAG_TYPE)... | 3.26 |
hbase_MobUtils_isRefOnlyScan_rdh | /**
* Indicates whether it's a reference only scan. The information is set in the attribute
* "hbase.mob.scan.ref.only" of scan. If it's a ref only scan, only the cells with ref tag are
* returned.
*
* @param scan
* The current scan.
* @return True if it's a ref only scan.
*/
public static boolean isRefOnlySc... | 3.26 |
hbase_MobUtils_getMobHome_rdh | /**
* Gets the root dir of the mob files under the qualified HBase root dir. It's {rootDir}/mobdir.
*
* @param rootDir
* The qualified path of HBase root directory.
* @return The root dir of the mob file.
*/
public static Path getMobHome(Path rootDir) {
return
new Path(rootDir, MobConstants.MOB_DIR_NAME... | 3.26 |
hbase_MobUtils_getMobTableDir_rdh | /**
* Gets the table dir of the mob files under the qualified HBase root dir. It's
* {rootDir}/mobdir/data/${namespace}/${tableName}
*
* @param rootDir
* The qualified path of HBase root directory.
* @param tableName
* The name of table.
* @return The table dir of the mob file.
*/
public static Path getMob... | 3.26 |
hbase_MobUtils_isCacheMobBlocks_rdh | /**
* Indicates whether the scan contains the information of caching blocks. The information is set
* in the attribute "hbase.mob.cache.blocks" of scan.
*
* @param scan
* The current scan.
* @return True when the Scan attribute specifies to cache the MOB blocks.
*/
public static boolean isCacheMobBlocks(Scan s... | 3.26 |
hbase_MobUtils_deserializeMobFileRefs_rdh | /**
* Deserialize the set of referenced mob hfiles from store file metadata.
*
* @param bytes
* compatibly serialized data. can not be null
* @return a setmultimap of original table to list of hfile names. will be empty if no values.
* @throws IllegalStateException
* if there are values but no table name
*/... | 3.26 |
hbase_MobUtils_m0_rdh | /**
* Sets the attribute of caching blocks in the scan.
*
* @param scan
* The current scan.
* @param cacheBlocks
* True, set the attribute of caching blocks into the scan, the scanner with
* this scan caches blocks. False, the scanner doesn't cache blocks for this
* scan.
*/
public static void m0(Scan ... | 3.26 |
hbase_MobUtils_hasMobReferenceTag_rdh | /**
* Whether the tag list has a mob reference tag.
*
* @param tags
* The tag list.
* @return True if the list has a mob reference tag, false if it doesn't.
*/
public static boolean
hasMobReferenceTag(List<Tag> tags) {if (!tags.isEmpty()) {
for (Tag tag : tags) {
if (tag.getType() == TagType.MOB_RE... | 3.26 |
hbase_MobUtils_isMobRegionName_rdh | /**
* Gets whether the current region name follows the pattern of a mob region name.
*
* @param tableName
* The current table name.
* @param regionName
* The current region name.
* @return True if the current region name follows the pattern of a mob region name.
*/
public static boolean isMobRegionName(Tabl... | 3.26 |
hbase_MobUtils_isRawMobScan_rdh | /**
* Indicates whether it's a raw scan. The information is set in the attribute "hbase.mob.scan.raw"
* of scan. For a mob cell, in a normal scan the scanners retrieves the mob cell from the mob
* file. In a raw scan, the scanner directly returns cell in HBase without retrieve the one in the
* mob file.
*
* @para... | 3.26 |
hbase_MobUtils_formatDate_rdh | /**
* Formats a date to a string.
*
* @param date
* The date.
* @return The string format of the date, it's yyyymmdd.
*/
public static String formatDate(Date date) {
return LOCAL_FORMAT.get().format(date);
} | 3.26 |
hbase_MobUtils_cleanExpiredMobFiles_rdh | /**
* Cleans the expired mob files. Cleans the files whose creation date is older than (current -
* columnFamily.ttl), and the minVersions of that column family is 0.
*
* @param fs
* The current file system.
* @param conf
* The current configuration.
* @param tableName
* The current table name.
* @param... | 3.26 |
hbase_MobUtils_m1_rdh | /**
* Gets the root dir of the mob files. It's {HBASE_DIR}/mobdir.
*
* @param conf
* The current configuration.
* @return the root dir of the mob file.
*/
public static Path m1(Configuration conf) {
Path hbaseDir = new Path(conf.get(HConstants.HBASE_DIR));
return m1(hbaseDir);
} | 3.26 |
hbase_MobUtils_createWriter_rdh | /**
* Creates a writer for the mob file in temp directory.
*
* @param conf
* The current configuration.
* @param fs
* The current file system.
* @param family
* The descriptor of the current column family.
* @param path
* The path for a temp directory.
* @param maxKeyCount
* The key count.
* @par... | 3.26 |
hbase_MobUtils_isMobReferenceCell_rdh | /**
* Whether the current cell is a mob reference cell.
*
* @param cell
* The current cell.
* @return True if the cell has a mob reference tag, false if it doesn't.
*/
public static boolean isMobReferenceCell(Cell cell) {
if (cell.getTagsLength() > 0) {
Optional<Tag> tag = PrivateCellUtil.getTag(c... | 3.26 |
hbase_MobUtils_getMobValueLength_rdh | /**
* Gets the mob value length from the mob ref cell. A mob ref cell has a mob reference tag. The
* value of a mob ref cell consists of two parts, real mob value length and mob file name. The
* real mob value length takes 4 bytes. The remaining part is the mob file name.
*
* @param cell
* The mob ref cell.
* ... | 3.26 |
hbase_MobUtils_getMobRegionPath_rdh | /**
* Gets the region dir of the mob files under the specified root dir. It's
* {rootDir}/mobdir/data/{namespace}/{tableName}/{regionEncodedName}.
*
* @param rootDir
* The qualified path of HBase root directory.
* @param tableName
* The current table name.
* @return The region dir of the mob files.
*/
publ... | 3.26 |
hbase_MobUtils_serializeMobFileRefs_rdh | /**
* Serialize a set of referenced mob hfiles
*
* @param mobRefSet
* to serialize, may be null
* @return byte array to i.e. put into store file metadata. will not be null
*/
public static byte[] serializeMobFileRefs... | 3.26 |
hbase_MobUtils_getQualifiedMobRootDir_rdh | /**
* Gets the qualified root dir of the mob files.
*
* @param conf
* The current configuration.
* @return The qualified root dir.
*/
public static Path getQualifiedMobRootDir(Configuration conf) throws IOException {
Path hbaseDir = new Path(conf.get(HConstants.HBASE_DIR));
Path mobRootDir = new Path(hb... | 3.26 |
hbase_MobUtils_getMobColumnFamilies_rdh | /**
* Get list of Mob column families (if any exists)
*
* @param htd
* table descriptor
* @return list of Mob column families
*/
public static List<ColumnFamilyDescriptor> getMobColumnFamilies(TableDescriptor htd) {
List<ColumnFamilyDescriptor> fams = new ArrayList<ColumnFamilyDescriptor>();
ColumnFamil... | 3.26 |
hbase_MobUtils_getMobRegionInfo_rdh | /**
* Gets the RegionInfo of the mob files. This is a dummy region. The mob files are not saved in a
* region in HBase. It's internally used only.
*
* @return A dummy mob region info.
*/
public static RegionInfo getMobRegionInfo(TableName tableName) {
return RegionInfoBuilder.newBuilder(tableName).setStartKey(... | 3.26 |
hbase_WALEventTrackerTableAccessor_getRowKey_rdh | /**
* Create rowKey: 1. We want RS name to be the leading part of rowkey so that we can query by RS
* name filter. WAL name contains rs name as a leading part. 2. Timestamp when the event was
* generated. 3. Add state of the wal. Combination of 1 + 2 + 3 is definitely going to create a
* unique rowkey.
*
* @param... | 3.26 |
hbase_WALEventTrackerTableAccessor_addWalEventTrackerRows_rdh | /**
* Add wal event tracker rows to hbase:waleventtracker table
*
* @param walEventPayloads
* List of walevents to process
* @param connection
* Connection to use.
*/
public static void addWalEventTrackerRows(Queue<WALEventTrackerPayload> walEventPayloads, final Connection connection) throws Exception {
... | 3.26 |
hbase_HFileWriterImpl_checkKey_rdh | /**
* Checks that the given Cell's key does not violate the key order.
*
* @param cell
* Cell whose key to check.
* @return true if the key is duplicate
* @throws IOException
* if the key or the key order is wrong
*/
protected boolean checkKey(final Cell cell) throws IOException {
boolean isDuplicateKey... | 3.26 |
hbase_HFileWriterImpl_writeInlineBlocks_rdh | /**
* Gives inline block writers an opportunity to contribute blocks.
*/
private void writeInlineBlocks(boolean closing) throws IOException {
for (InlineBlockWriter ibw : inlineBlockWriters) {
while (ibw.shouldWriteBlock(closing)) {
long offset = outputStream.getPos();
boolean cach... | 3.26 |
hbase_HFileWriterImpl_checkValue_rdh | /**
* Checks the given value for validity.
*/
protected void checkValue(final byte[] value, final int offset, final int length) throws
IOException {
if (value == null) {
throw new IOException("Value cannot be null");
}
} | 3.26 |
hbase_HFileWriterImpl_appendFileInfo_rdh | /**
* Add to the file info. All added key/value pairs can be obtained using
* {@link HFile.Reader#getHFileInfo()}.
*
* @param k
* Key
* @param v
* Value
* @throws IOException
* in case the key or the value are invalid
*/
@Override
public void appendFileInfo(final byte[] k, final byte[] v) throws IOExce... | 3.26 |
hbase_HFileWriterImpl_m0_rdh | /**
* Sets the file info offset in the trailer, finishes up populating fields in the file info, and
* writes the file info into the given data output. The reason the data output is not always
* {@link #outputStream} is that we store file info as a block in version 2.
*
* @param trailer
* fixed file trailer
* @... | 3.26 |
hbase_HFileWriterImpl_finishBlock_rdh | /**
* Clean up the data block that is currently being written.
*/
private void finishBlock() throws IOException {
if ((!blockWriter.isWriting()) || (blockWriter.blockSizeWritten() == 0)) {
return;
}
// Update the first data block offset if UNSET; used scanning.
if (firstDataBlockOffset == UNSET) {
firstDataBl... | 3.26 |
hbase_HFileWriterImpl_finishInit_rdh | /**
* Additional initialization steps
*/
protected void finishInit(final Configuration conf) {
if (blockWriter != null) {
throw new IllegalStateException("finishInit called twice");
}
blockWriter = new HFileBlock.Writer(conf, blockEncoder, hFileContext, cacheConf.getByteBuffAllocator(), conf.getInt(MAX_BLOCK_SI... | 3.26 |
hbase_HFileWriterImpl_doCacheOnWrite_rdh | /**
* Caches the last written HFile block.
*
* @param offset
* the offset of the block we want to cache. Used to determine the cache key.
*/
private void doCacheOnWrite(long offset) {
cacheConf.getBlockCache().ifPresent(cache -> {
HFileBlock cacheFormatBlock = blockWriter.getBlockForCaching(cacheC... | 3.26 |
hbase_HFileWriterImpl_checkBlockBoundary_rdh | /**
* At a block boundary, write all the inline blocks and opens new block.
*/
protected void checkBlockBoundary() throws IOException {
boolean shouldFinishBlock = false;
// This means hbase.writer.unified.encoded.blocksize.ratio was set to something different from 0
// and we should use the encoding ratio
if (en... | 3.26 |
hbase_HFileWriterImpl_append_rdh | /**
* Add key/value to file. Keys must be added in an order that agrees with the Comparator passed on
* construction. Cell to add. Cannot be empty nor null.
*/
@Override
public void append(final Cell cell) throws IOException {
// checkKey uses comparator to check we are writing in order.
boolean dupKey = che... | 3.26 |
hbase_HFileWriterImpl_getMidpoint_rdh | /**
* Try to return a Cell that falls between <code>left</code> and <code>right</code> but that is
* shorter; i.e. takes up less space. This trick is used building HFile block index. Its an
* optimization. It does not always work. In this case we'll just return the <code>right</code>
* cell.
*
* @return A cell th... | 3.26 |
hbase_HFileWriterImpl_newBlock_rdh | /**
* Ready a new block for writing.
*/
protected void newBlock() throws IOException {
// This is where the next block begins.
blockWriter.startWriting(BlockType.DATA);
firstCellInBlock = null;
if (lastCell != null) {
f0 = lastCell;
}
} | 3.26 |
hbase_HFileWriterImpl_appendMetaBlock_rdh | /**
* Add a meta block to the end of the file. Call before close(). Metadata blocks are expensive.
* Fill one with a bunch of serialized data rather than do a metadata block per metadata instance.
* If metadata is small, consider adding to file info using
* {@link #appendFileInfo(byte[], byte[])} name of the block ... | 3.26 |
hbase_OrderedInt16_encodeShort_rdh | /**
* Write instance {@code val} into buffer {@code dst}.
*
* @param dst
* the {@link PositionedByteRange} to write to
* @param val
* the value to write to {@code dst}
* @return the number of bytes written
*/
public int encodeShort(PositionedByteRange dst, short val) {
return OrderedBytes.encodeInt16(ds... | 3.26 |
hbase_OrderedInt16_decodeShort_rdh | /**
* Read a {@code short} value from the buffer {@code src}.
*
* @param src
* the {@link PositionedByteRange} to read the {@code float} from
* @return the {@code short} read from buffer
*/
public short decodeShort(PositionedByteRange
src) {
return OrderedBytes.decodeInt16(src);
} | 3.26 |
hbase_IndexBuilder_configureJob_rdh | /**
* Job configuration.
*/
public static Job configureJob(Configuration conf,
String[] args) throws IOException {String tableName = args[0];
String columnFamily = args[1];
System.out.println("****" + tableName);
conf.set(TableInputFormat.SCAN, TableMapReduceUtil.convertScanToString(new Scan()));
... | 3.26 |
hbase_ParseFilter_registerFilter_rdh | /**
* Register a new filter with the parser. If the filter is already registered, an
* IllegalArgumentException will be thrown.
*
* @param name
* a name for the filter
* @param filterClass
* fully qualified class name
*/
public static void registerFilter(String name, String filterClass) {
if (LOG.isInfoEnab... | 3.26 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.