name stringlengths 12 178 | code_snippet stringlengths 8 36.5k | score float64 3.26 3.68 |
|---|---|---|
hbase_MasterCoprocessorHost_postTruncateRegionAction_rdh | /**
* Invoked after calling the truncate region procedure
*
* @param region
* Region which was truncated
* @param user
* The user
*/
public void postTruncateRegionAction(final RegionInfo region, User user)
throws IOException {
execOperation(coprocEnvironments.isEmpty() ? null : new MasterObserverOperation(... | 3.26 |
hbase_MasterCoprocessorHost_postRollBackMergeRegionsAction_rdh | /**
* Invoked after rollback merge regions operation
*
* @param regionsToMerge
* the regions to merge
* @param user
* the user
*/
public void postRollBackMergeRegionsAction(final RegionInfo[] regionsToMerge, final User user) throws IOException {
execOperation(coprocEnvironments.isEmpty() ? null : new MasterO... | 3.26 |
hbase_QuotaSettingsFactory_throttleTable_rdh | /**
* Throttle the specified table.
*
* @param tableName
* the table to throttle
* @param type
* the type of throttling
* @param limit
* the allowed number of request/data per timeUnit
* @param timeUnit
* the limit time unit
* @param scope
* the scope of throttling
* @return the quota settings
*... | 3.26 |
hbase_QuotaSettingsFactory_m1_rdh | /**
* Throttle the specified user on the specified table.
*
* @param userName
* the user to throttle
* @param tableName
* the table to throttle
* @param type
* the type of throttling
* @param limit
* the allowed number of request/data per timeUnit
* @param timeUnit
* the limit time unit
* @param ... | 3.26 |
hbase_QuotaSettingsFactory_bypassGlobals_rdh | /* ========================================================================== Global Settings */
/**
* Set the "bypass global settings" for the specified user
*
* @param userName
* the user to throttle
* @param bypassGlobals
* true if the global settings should be bypassed
* @return the quota settings
*/pub... | 3.26 |
hbase_QuotaSettingsFactory_unthrottleTableByThrottleType_rdh | /**
* Remove the throttling for the specified table.
*
* @param tableName
* the table
* @param type
* the type of throttling
* @return the quota settings
*/
public static QuotaSettings unthrottleTableByThrottleType(final TableName tableName, final ThrottleType type) {
return throttle(null, tableName, null... | 3.26 |
hbase_QuotaSettingsFactory_removeTableSpaceLimit_rdh | /**
* Creates a {@link QuotaSettings} object to remove the FileSystem space quota for the given
* table.
*
* @param tableName
* The name of the table to remove the quota for.
* @return A {@link QuotaSettings} object.
*/
public static QuotaSettings removeTableSpaceLimit(TableName tableName) {
return new SpaceL... | 3.26 |
hbase_QuotaSettingsFactory_unthrottleRegionServerByThrottleType_rdh | /**
* Remove the throttling for the specified region server by throttle type.
*
* @param regionServer
* the region Server
* @param type
* the type of throttling
* @return the quota settings
*/
public static QuotaSettings unthrottleRegionServerByThrottleType(final String regionServer, final ThrottleType type... | 3.26 |
hbase_QuotaSettingsFactory_throttle_rdh | /* Throttle helper */
private static QuotaSettings throttle(final String userName, final TableName tableName, final String namespace, final String regionServer,
final ThrottleType type, final long limit, final TimeUnit timeUnit, QuotaScope scope) {
QuotaProtos.ThrottleRequest.Builder builder = QuotaProtos.ThrottleR... | 3.26 |
hbase_QuotaSettingsFactory_throttleNamespace_rdh | /**
* Throttle the specified namespace.
*
* @param namespace
* the namespace to throttle
* @param type
* the type of throttling
* @param limit
* the allowed number of request/data per timeUnit
* @param timeUnit
* the limit time unit
* @param scope
* the scope of throttling
* @return the quota set... | 3.26 |
hbase_QuotaSettingsFactory_unthrottleTable_rdh | /**
* Remove the throttling for the specified table.
*
* @param tableName
* the table
* @return the quota settings
*/
public static QuotaSettings unthrottleTable(final TableName tableName) {
return throttle(null, tableName, null, null, null, 0, null, QuotaScope.MACHINE);
} | 3.26 |
hbase_QuotaSettingsFactory_unthrottleNamespace_rdh | /**
* Remove the throttling for the specified namespace.
*
* @param namespace
* the namespace
* @return the quota settings
*/
public static QuotaSettings unthrottleNamespace(final String namespace) {
return throttle(null, null, namespace, null, null, 0, null, QuotaScope.MACHINE);
} | 3.26 |
hbase_QuotaSettingsFactory_limitNamespaceSpace_rdh | /**
* Creates a {@link QuotaSettings} object to limit the FileSystem space usage for the given
* namespace to the given size in bytes. When the space usage is exceeded by all tables in the
* namespace, the provided {@link SpaceViolationPolicy} is enacted on all tables in the namespace.
*
* @param namespace
* Th... | 3.26 |
hbase_QuotaSettingsFactory_unthrottleUser_rdh | /**
* Remove the throttling for the specified user on the specified namespace.
*
* @param userName
* the user
* @param namespace
* the namespace
* @return the quota settings
*/
public static QuotaSettings unthrottleUser(final String userName, final String namespace) {
return throttle(userName, null, namespa... | 3.26 |
hbase_QuotaSettingsFactory_unthrottleRegionServer_rdh | /**
* Remove the throttling for the specified region server.
*
* @param regionServer
* the region Server
* @return the quota settings
*/
public static QuotaSettings unthrottleRegionServer(final String regionServer) {
return throttle(null, null, null, regionServer, null, 0, null, QuotaScope.MACHINE);
} | 3.26 |
hbase_QuotaSettingsFactory_throttleRegionServer_rdh | /**
* Throttle the specified region server.
*
* @param regionServer
* the region server to throttle
* @param type
* the type of throttling
* @param limit
* the allowed number of request/data per timeUnit
* @param timeUnit
* the limit time unit
* @return the quota settings
*/
public static QuotaSetti... | 3.26 |
hbase_QuotaSettingsFactory_unthrottleNamespaceByThrottleType_rdh | /**
* Remove the throttling for the specified namespace by throttle type.
*
* @param namespace
* the namespace
* @param type
* the type of throttling
* @return the quota settings
*/
public static QuotaSettings unthrottleNamespaceByThrottleType(final String namespace, final ThrottleType type) {
return thro... | 3.26 |
hbase_QuotaSettingsFactory_m2_rdh | /**
* Remove the throttling for the specified user on the specified table.
*
* @param userName
* the user
* @param tableName
* the table
* @param type
* the type of throttling
* @return the quota settings
*/
public static QuotaSettings m2(final String userName, final TableName tableName, final Throttle... | 3.26 |
hbase_QuotaSettingsFactory_throttleUser_rdh | /**
* Throttle the specified user on the specified namespace.
*
* @param userName
* the user to throttle
* @param namespace
* the namespace to throttle
* @param type
* the type of throttling
* @param limit
* the allowed number of request/data per timeUnit
* @param timeUnit
* the limit time unit
*... | 3.26 |
hbase_QuotaSettingsFactory_unthrottleUserByThrottleType_rdh | /**
* Remove the throttling for the specified user on the specified namespace.
*
* @param userName
* the user
* @param namespace
* the namespace
* @param type
* the type of throttling
* @return the quota settings
*/
public static QuotaSettings
unthrottleUserByThrottleType(final String userName, final St... | 3.26 |
hbase_ReusableStreamGzipCodec_writeTrailer_rdh | /**
* re-implement because the relative method in jdk is invisible
*/
private void writeTrailer(byte[] paramArrayOfByte, int paramInt) throws IOException {
writeInt(((int) (this.crc.getValue())), paramArrayOfByte, paramInt);
writeInt(this.def.getTotalIn(), paramArrayOfByte, paramInt + 4);
} | 3.26 |
hbase_ReusableStreamGzipCodec_writeShort_rdh | /**
* re-implement because the relative method in jdk is invisible
*/
private void writeShort(int paramInt1, byte[] paramArrayOfByte, int paramInt2) throws IOException {
paramArrayOfByte[paramInt2] = ((byte) (paramInt1 & 0xff));
paramArrayOfByte[paramInt2 +
1] = ((byte) ((paramInt1 >> 8) & 0xff));} | 3.26 |
hbase_ReusableStreamGzipCodec_writeInt_rdh | /**
* re-implement because the relative method in jdk is invisible
*/
private void writeInt(int paramInt1, byte[] paramArrayOfByte, int paramInt2) throws IOException {
writeShort(paramInt1 & 0xffff, paramArrayOfByte, paramInt2);
writeShort((paramInt1 >> 16) & 0xffff, paramArrayOfByte, paramInt2
+ 2);} | 3.26 |
hbase_ReusableStreamGzipCodec_finish_rdh | /**
* Override because certain implementation calls def.end() which causes problem when resetting
* the stream for reuse.
*/
@Override
public void finish() throws IOException { if (HAS_BROKEN_FINISH) {
if (!def.finished()) {
... | 3.26 |
hbase_VisibilityUtils_extractVisibilityTags_rdh | /**
* Extract the visibility tags of the given Cell into the given List
*
* @param cell
* - the cell
* @param tags
* - the array that will be populated if visibility tags are present
* @return The visibility tags serialization format
*/
public static Byte extractVisibilityTags(Cell cell, List<Tag> tags) {
B... | 3.26 |
hbase_VisibilityUtils_getActiveUser_rdh | /**
*
* @return User who called RPC method. For non-RPC handling, falls back to system user
* @throws IOException
* When there is IOE in getting the system user (During non-RPC handling).
*/
public static User getActiveUser() throws IOException {
Optional<User> optionalUser = RpcServer.getRequestUser();
User use... | 3.26 |
hbase_VisibilityUtils_readUserAuthsFromZKData_rdh | /**
* Reads back User auth data written to zookeeper.
*
* @return User auth details
*/
public static MultiUserAuthorizations readUserAuthsFromZKData(byte[] data) throws DeserializationException {
if (ProtobufUtil.isPBMagicPrefix(data)) {
int pblen = ProtobufUtil.lengthOfPBMagic();
try {
... | 3.26 |
hbase_VisibilityUtils_readLabelsFromZKData_rdh | /**
* Reads back from the zookeeper. The data read here is of the form written by
* writeToZooKeeper(Map<byte[], Integer> entries).
*
* @return Labels and their ordinal details
*/
public static List<VisibilityLabel> readLabelsFromZKData(byte[] data) throws DeserializationException {
if (ProtobufUtil.isPB... | 3.26 |
hbase_VisibilityUtils_getDataToWriteToZooKeeper_rdh | /**
* Creates the labels data to be written to zookeeper.
*
* @return Bytes form of labels and their ordinal details to be written to zookeeper.
*/
public static byte[] getDataToWriteToZooKeeper(Map<String, Integer> existingLabels) {
VisibilityLabelsRequest.Builder visReqBuilder = VisibilityLabelsRequest.newBu... | 3.26 |
hbase_VisibilityUtils_writeLabelOrdinalsToStream_rdh | /**
* This will sort the passed labels in ascending oder and then will write one after the other to
* the passed stream. Unsorted label ordinals Stream where to write the labels. When IOE during
* writes to Stream.
*/
private static void writeLabelOrdinalsToStream(List<Integer> labelOrdinals, DataOutputStream dos... | 3.26 |
hbase_ResultScanner_next_rdh | // get the pending next item and advance the iterator. returns null if
// there is no next item.
@Override
public Result next() {
// since hasNext() does the real advancing, we call this to determine
// if there is a next before proceeding.
if (!hasNext()) {
return null;
}
// if we get to he... | 3.26 |
hbase_ResultScanner_hasNext_rdh | // return true if there is another item pending, false if there isn't.
// this method is where the actual advancing takes place, but you need
// to call next() to consume it. hasNext() will only advance if there
// isn't a pending next().
@Override
public boolean hasNext() {
if (next != null) {
return true;... | 3.26 |
hbase_MasterProcedureScheduler_wakePeerExclusiveLock_rdh | /**
* Wake the procedures waiting for the specified peer
*
* @see #waitPeerExclusiveLock(Procedure, String)
* @param procedure
* the procedure releasing the lock
* @param peerId
* the peer that has the exclusive lock
*/
public void wakePeerExclusiveLock(Procedure<?> procedure, String peerId) {
schedLock();
... | 3.26 |
hbase_MasterProcedureScheduler_wakeGlobalExclusiveLock_rdh | /**
* Wake the procedures waiting for global.
*
* @see #waitGlobalExclusiveLock(Procedure, String)
* @param procedure
* the procedure releasing the lock
*/
public void wakeGlobalExclusiveLock(Procedure<?> procedure, String globalId)
{
schedLock();
try {final LockAndQueue lock = locking.getGlobalLock(globalId);... | 3.26 |
hbase_MasterProcedureScheduler_waitTableSharedLock_rdh | /**
* Suspend the procedure if the specified table is already locked. other "read" operations in the
* table-queue may be executed concurrently,
*
* @param procedure
* the procedure trying to acquire the lock
* @param table
* Table to lock
* @return true if the procedure has to wait for the table to be avai... | 3.26 |
hbase_MasterProcedureScheduler_dumpLocks_rdh | /**
* For debugging. Expensive.
*/
public String dumpLocks() throws IOException {
schedLock();
try {
// TODO: Refactor so we stream out locks for case when millions; i.e. take a PrintWriter
return this.locking.toString();
} finally {
schedUnlock();
}
} | 3.26 |
hbase_MasterProcedureScheduler_getMetaQueue_rdh | // ============================================================================
// Meta Queue Lookup Helpers
// ============================================================================
private MetaQueue getMetaQueue() {
MetaQueue node = AvlTree.get(metaMap, TableName.META_TABLE_NAME, META_QUEUE_KEY_COMPARATOR);
if ... | 3.26 |
hbase_MasterProcedureScheduler_wakeServerExclusiveLock_rdh | /**
* Wake the procedures waiting for the specified server
*
* @see #waitServerExclusiveLock(Procedure,ServerName)
* @param procedure
* the procedure releasing the lock
* @param serverName
* the server that has the exclusive lock
*/
public void wakeServerExclusiveLock(final Procedure<?> procedure, final Ser... | 3.26 |
hbase_MasterProcedureScheduler_getPeerQueue_rdh | // ============================================================================
// Peer Queue Lookup Helpers
// ============================================================================
private PeerQueue getPeerQueue(String peerId)
{
PeerQueue node = AvlTree.get(peerMap, peerId, PEER_QUEUE_KEY_COMPARATOR);
if (nod... | 3.26 |
hbase_MasterProcedureScheduler_waitRegions_rdh | /**
* Suspend the procedure if the specified set of regions are already locked.
*
* @param procedure
* the procedure trying to acquire the lock on the regions
* @param table
* the table name of the regions we are trying to lock
* @param regionInfos
* the list of regions we are trying to lock
* @return tr... | 3.26 |
hbase_MasterProcedureScheduler_wakeRegions_rdh | /**
* Wake the procedures waiting for the specified regions
*
* @param procedure
* the procedure that was holding the regions
* @param regionInfos
* the list of regions the procedure was holding
*/
public void wakeRegions(final Procedure<?> procedure, final TableName table, final RegionInfo... regionInfos) {... | 3.26 |
hbase_MasterProcedureScheduler_wakeTableExclusiveLock_rdh | /**
* Wake the procedures waiting for the specified table
*
* @param procedure
* the procedure releasing the lock
* @param table
* the name of the table that has the exclusive lock
*/
public void wakeTableExclusiveLock(final Procedure<?> procedure, final TableName table) {
schedLock();
try {
final LockAndQue... | 3.26 |
hbase_MasterProcedureScheduler_waitPeerExclusiveLock_rdh | // Peer Locking Helpers
// ============================================================================
/**
* Try to acquire the exclusive lock on the specified peer.
*
* @see #wakePeerExclusiveLock(Procedure, String)
* @param procedure
* the procedure trying to acquire the lock
* @param peerId
* peer to loc... | 3.26 |
hbase_MasterProcedureScheduler_getServerQueue_rdh | // ============================================================================
// Server Queue Lookup Helpers
// ============================================================================
private ServerQueue getServerQueue(ServerName serverName, ServerProcedureInterface proc) {
final int index = getBucketIndex(serve... | 3.26 |
hbase_MasterProcedureScheduler_m3_rdh | // ============================================================================
// Table Queue Lookup Helpers
// ============================================================================
private TableQueue m3(TableName tableName) {
TableQueue node = AvlTree.get(f1, tableName, TABLE_QUEUE_KEY_COMPARATOR);
if (node !=... | 3.26 |
hbase_MasterProcedureScheduler_logLockedResource_rdh | // ============================================================================
// Table Locking Helpers
// ============================================================================
/**
* Get lock info for a resource of specified type and name and log details
*/
private void logLockedResource(LockedResourceType re... | 3.26 |
hbase_MasterProcedureScheduler_wakeNamespaceExclusiveLock_rdh | /**
* Wake the procedures waiting for the specified namespace
*
* @see #waitNamespaceExclusiveLock(Procedure,String)
* @param procedure
* the procedure releasing the lock
* @param namespace
* the namespace that has the exclusive lock
*/
public void wakeNamespaceExclusiveLock(final Procedure<?> procedure, fi... | 3.26 |
hbase_MasterProcedureScheduler_wakeRegion_rdh | /**
* Wake the procedures waiting for the specified region
*
* @param procedure
* the procedure that was holding the region
* @param regionInfo
* the region the procedure was holding
*/
public void wakeRegion(final Procedure<?> procedure, final RegionInfo regionInfo) {
wakeRegions(procedure, regionInfo.get... | 3.26 |
hbase_MasterProcedureScheduler_wakeTableSharedLock_rdh | /**
* Wake the procedures waiting for the specified table
*
* @param procedure
* the procedure releasing the lock
* @param table
* the name of the table that has the shared lock
*/
public void wakeTableSharedLock(final Procedure<?> procedure, final TableName table) {
schedLock();
try {
final LockAndQueue na... | 3.26 |
hbase_MasterProcedureScheduler_waitNamespaceExclusiveLock_rdh | // ============================================================================
// Namespace Locking Helpers
// ============================================================================
/**
* Suspend the procedure if the specified namespace is already locked.
*
* @see #wakeNamespaceExclusiveLock(Procedure,String)... | 3.26 |
hbase_MasterProcedureScheduler_waitRegion_rdh | // ============================================================================
// Region Locking Helpers
// ============================================================================
/**
* Suspend the procedure if the specified region is already locked.
*
* @param procedure
* the procedure trying to acquire th... | 3.26 |
hbase_MasterProcedureScheduler_getGlobalQueue_rdh | // ============================================================================
// Global Queue Lookup Helpers
// ============================================================================
private GlobalQueue getGlobalQueue(String globalId) {
GlobalQueue node = AvlTree.get(f2, globalId, GLOBAL_QUEUE_KEY_COMPARATOR);
... | 3.26 |
hbase_MasterProcedureScheduler_waitGlobalExclusiveLock_rdh | // ============================================================================
// Global Locking Helpers
// ============================================================================
/**
* Try to acquire the share lock on global.
*
* @see #wakeGlobalExclusiveLock(Procedure, String)
* @param procedure
* the pr... | 3.26 |
hbase_MasterProcedureScheduler_waitTableExclusiveLock_rdh | /**
* Suspend the procedure if the specified table is already locked. Other operations in the
* table-queue will be executed after the lock is released.
*
* @param procedure
* the procedure trying to acquire the lock
* @param table
* Table to lock
* @return true if the procedure has to wait for the table to... | 3.26 |
hbase_Struct_decode_rdh | /**
* Read the field at {@code index}. {@code src}'s position is not affected.
*/
public Object
decode(PositionedByteRange src, int index) {assert index >= 0;
StructIterator it = iterator(src.shallowCopy());
for (; index > 0; index--) {
it.skip();
}
return it.next();
} | 3.26 |
hbase_Struct_iterator_rdh | /**
* Retrieve an {@link Iterator} over the values encoded in {@code src}. {@code src}'s position is
* consumed by consuming this iterator.
*/
public StructIterator iterator(PositionedByteRange src) {
return new StructIterator(src, fields);
} | 3.26 |
hbase_FsDelegationToken_releaseDelegationToken_rdh | /**
* Releases a previously acquired delegation token.
*/
public void releaseDelegationToken() {
if (userProvider.isHadoopSecurityEnabled()) {
if ((userToken != null) && (!hasForwardedToken))
{
try {
userToken.cancel(this.fs.getConf());
... | 3.26 |
hbase_FsDelegationToken_getRenewer_rdh | /**
* Returns the account name that is allowed to renew the token.
*/
public String getRenewer() {
return renewer;
} | 3.26 |
hbase_FsDelegationToken_getUserToken_rdh | /**
* Returns the delegation token acquired, or null in case it was not acquired
*/
public Token<?> getUserToken() {
return userToken;
} | 3.26 |
hbase_FsDelegationToken_acquireDelegationToken_rdh | /**
* Acquire the delegation token for the specified filesystem and token kind. Before requesting a
* new delegation token, tries to find one already available.
*
* @param tokenKind
* non-null token kind to get delegation token from the {@link UserProvider}
* @param fs
* the filesystem that requires the dele... | 3.26 |
hbase_BulkLoadHFilesTool_tryAtomicRegionLoad_rdh | /**
* Attempts to do an atomic load of many hfiles into a region. If it fails, it returns a list of
* hfiles that need to be retried. If it is successful it will return an empty list. NOTE: To
* maintain row atomicity guarantees, region server side should succeed atomically and fails
* atomically.
*
* @param conn... | 3.26 |
hbase_BulkLoadHFilesTool_loadHFileQueue_rdh | /**
* Used by the replication sink to load the hfiles from the source cluster. It does the following,
* <ol>
* <li>{@link #groupOrSplitPhase(AsyncClusterConnection, TableName, ExecutorService, Deque, List)}
* </li>
* <li>{@link #bulkLoadPhase(AsyncClusterConnection, TableName, Deque, Multimap, boolean, Map)}
* </... | 3.26 |
hbase_BulkLoadHFilesTool_getUniqueName_rdh | // unique file name for the table
private String getUniqueName() {
return UUID.randomUUID().toString().replaceAll("-", "");
} | 3.26 |
hbase_BulkLoadHFilesTool_getRegionIndex_rdh | /**
*
* @param startEndKeys
* the start/end keys of regions belong to this table, the list in ascending
* order by start key
* @param key
* the key need to find which region belong to
* @return region index
*/
private int getRegionIndex(List<Pair<byte[], byte[]>> startEndKeys, byte[] key) {
int idx = ... | 3.26 |
hbase_BulkLoadHFilesTool_validateFamiliesInHFiles_rdh | /**
* Checks whether there is any invalid family name in HFiles to be bulk loaded.
*/
private static void validateFamiliesInHFiles(TableDescriptor tableDesc, Deque<LoadQueueItem> queue, boolean silence) throws IOException {
Set<String> v2 =
Arrays.stream(tableDesc.getColumnFamilies()).map(ColumnFamilyDescri... | 3.26 |
hbase_BulkLoadHFilesTool_copyHFileHalf_rdh | /**
* Copy half of an HFile into a new HFile with favored nodes.
*/
private static void copyHFileHalf(Configuration conf, Path inFile, Path outFile, Reference reference, ColumnFamilyDescriptor familyDescriptor, AsyncTableRegionLocator loc) throws IOException {
FileSystem fs = inFile.getFileSystem(conf);
CacheConfig ... | 3.26 |
hbase_BulkLoadHFilesTool_visitBulkHFiles_rdh | /**
* Iterate over the bulkDir hfiles. Skip reference, HFileLink, files starting with "_". Check and
* skip non-valid hfiles by default, or skip this validation by setting {@link #VALIDATE_HFILES}
* to false.
*/
private static <TFamily> void visitBulkHFiles(FileSystem fs, Path bulkDir, BulkHFileVisitor<TFamily> vi... | 3.26 |
hbase_BulkLoadHFilesTool_m1_rdh | /**
* Split a storefile into a top and bottom half with favored nodes, maintaining the metadata,
* recreating bloom filters, etc.
*/
@InterfaceAudience.Private
static void m1(AsyncTableRegionLocator loc, Configuration conf, Path inFile, ColumnFamilyDescriptor familyDesc, byte[] splitKey, Path bottomOut, Path topOut)... | 3.26 |
hbase_BulkLoadHFilesTool_groupOrSplit_rdh | /**
* Attempt to assign the given load queue item into its target region group. If the hfile boundary
* no longer fits into a region, physically splits the hfile such that the new bottom half will
* fit and returns the list of LQI's corresponding to the resultant hfiles.
* <p/>
* protected for testing
*
* @throw... | 3.26 |
hbase_BulkLoadHFilesTool_doBulkLoad_rdh | /**
* Perform a bulk load of the given directory into the given pre-existing table. This method is
* not threadsafe.
*
* @param tableName
* table to load the hfiles
* @param hfofDir
* the directory that was provided as the output path of a job using
* HFileOutputFormat
* @param silence
* true to ignor... | 3.26 |
hbase_BulkLoadHFilesTool_createExecutorService_rdh | // Initialize a thread pool
private ExecutorService createExecutorService() {
ThreadPoolExecutor pool = new ThreadPoolExecutor(nrThreads, nrThreads, 60, TimeUnit.SECONDS, new LinkedBlockingQueue<>(), new ThreadFactoryBuilder().setNameFormat("BulkLoadHFilesTool-%1$d").setDaemon(true).build());
pool.allowCoreTh... | 3.26 |
hbase_BulkLoadHFilesTool_tableExists_rdh | /**
*
* @throws TableNotFoundException
* if table does not exist.
*/
private void tableExists(AsyncClusterConnection conn, TableName tableName) throws IOException
{
if (!FutureUtils.get(conn.getAdmin().tableExists(tableName))) {
throwAndLogTableNotFoundException(tableName);
}
} | 3.26 |
hbase_BulkLoadHFilesTool_inferBoundaries_rdh | /**
* Infers region boundaries for a new table.
* <p/>
* Parameter: <br/>
* bdryMap is a map between keys to an integer belonging to {+1, -1}
* <ul>
* <li>If a key is a start key of a file, then it maps to +1</li>
* <li>If a key is an end key of a file, then it maps to -1</li>
* </ul>
* <p>
* Algo:<br/>
* <o... | 3.26 |
hbase_BulkLoadHFilesTool_prepareHFileQueue_rdh | /**
* Prepare a collection of {@code LoadQueueItem} from list of source hfiles contained in the
* passed directory and validates whether the prepared queue has all the valid table column
* families in it.
*
* @param hfilesDir
* directory containing list of hfiles to be loaded into the table
* @param queue
* ... | 3.26 |
hbase_BulkLoadHFilesTool_checkRegionIndexValid_rdh | /**
* we can consider there is a region hole or overlap in following conditions. 1) if idx < 0,then
* first region info is lost. 2) if the endkey of a region is not equal to the startkey of the
* next region. 3) if the endkey of the last region is not empty.
*/
private void checkRegionIndexV... | 3.26 |
hbase_BulkLoadHFilesTool_createTable_rdh | /**
* If the table is created for the first time, then "completebulkload" reads the files twice. More
* modifications necessary if we want to avoid doing it.
*/
private void createTable(TableName tableName, Path hfofDir, AsyncAdmin admin) throws IOException {
final FileSystem fs = hfofDir.getFileSystem(getConf());
... | 3.26 |
hbase_BulkLoadHFilesTool_groupOrSplitPhase_rdh | /**
*
* @param conn
* the HBase cluster connection
* @param tableName
* the table name of the table to load into
* @param pool
* the ExecutorService
* @param queue
* the queue for LoadQueueItem
* @param startEndKeys
* start and end keys
* @return A map that groups LQI by likely bulk load region ta... | 3.26 |
hbase_BulkLoadHFilesTool_m0_rdh | /**
* Walk the given directory for all HFiles, and return a Queue containing all such files.
*/
private static void m0(Configuration conf, Deque<LoadQueueItem> ret, Path hfofDir, boolean validateHFile) throws IOException {
visitBulkHFiles(hfofDir.getFileSystem(conf), hfofD... | 3.26 |
hbase_RegionSplitCalculator_calcCoverage_rdh | /**
* Generates a coverage multimap from split key to Regions that start with the split key.
*
* @return coverage multimap
*/
public Multimap<byte[], R> calcCoverage() {
// This needs to be sorted to force the use of the comparator on the values,
// otherwise byte array comparison isn't used
Multimap<byte[], R> reg... | 3.26 |
hbase_RegionSplitCalculator_specialEndKey_rdh | /**
* SPECIAL CASE wrapper for empty end key
*
* @return ENDKEY if end key is empty, else normal endkey.
*/
private static <R extends KeyRange> byte[] specialEndKey(R range) {
byte[] end = range.getEndKey();
if (end.length == 0) {
return f1;
}
return end;
} | 3.26 |
hbase_RegionSplitCalculator_findBigRanges_rdh | /**
* Find specified number of top ranges in a big overlap group. It could return less if there are
* not that many top ranges. Once these top ranges are excluded, the big overlap group will be
* broken into ranges with no overlapping, or smaller overlapped groups, and most likely some
* holes.
*
* @param bigOver... | 3.26 |
hbase_RegionSplitCalculator_add_rdh | /**
* Adds an edge to the split calculator
*
* @return true if is included, false if backwards/invalid
*/
public boolean add(R range) {
byte[] start = range.getStartKey();
byte[] end = specialEndKey(range);
// No need to use Arrays.equals because ENDKEY is null
if ((end != f1) && (Bytes.compareTo(start, end) ... | 3.26 |
hbase_DeletionListener_hasException_rdh | /**
* Check if an exception has occurred when re-setting the watch.
*
* @return True if we were unable to re-set a watch on a ZNode due to an exception.
*/
public boolean hasException() {
return exception != null;
} | 3.26 |
hbase_DeletionListener_getException_rdh | /**
* Get the last exception which has occurred when re-setting the watch. Use hasException() to
* check whether or not an exception has occurred.
*
* @return The last exception observed when re-setting the watch.
*/
public Throwable getException() {
return exception;
} | 3.26 |
hbase_ForeignExceptionUtil_toProtoStackTraceElement_rdh | /**
* Convert a stack trace to list of {@link StackTraceElement}.
*
* @param trace
* the stack trace to convert to protobuf message
* @return <tt>null</tt> if the passed stack is <tt>null</tt>.
*/
public static List<StackTraceElementMessage> toProtoStackTraceElement(StackTraceElement[] trace) {
// if there... | 3.26 |
hbase_BoundedRecoveredHFilesOutputSink_writeRemainingEntryBuffers_rdh | /**
* Write out the remaining RegionEntryBuffers and close the writers.
*
* @return true when there is no error.
*/
private boolean writeRemainingEntryBuffers() throws IOException {
for (EntryBuffers.RegionEntryBuffer buffer : entryBuffers.buffers.values()) {
closeComplet... | 3.26 |
hbase_ProcedureExecutor_getProcedure_rdh | // ==========================================================================
// Executor query helpers
// ==========================================================================
public Procedure<TEnvironment> getProcedure(final long procId) {
return procedures.get(procId);
} | 3.26 |
hbase_ProcedureExecutor_isFinished_rdh | /**
* Return true if the procedure is finished. The state may be "completed successfully" or "failed
* and rolledback". Use getResult() to check the state or get the result data.
*
* @param procId
* the ID of the procedure to check
* @return true if the procedure execution is finished, otherwise false.
*/
publ... | 3.26 |
hbase_ProcedureExecutor_createNonceKey_rdh | // ==========================================================================
// Nonce Procedure helpers
// ==========================================================================
/**
* Create a NonceKey from the specified nonceGroup and nonce.
*
* @param nonceGroup
* the group to use for the {@link NonceKey}
... | 3.26 |
hbase_ProcedureExecutor_submitProcedure_rdh | /**
* Add a new root-procedure to the executor.
*
* @param proc
* the new procedure to execute.
* @param nonceKey
* the registered unique identifier for this operation from the client or process.
* @return the procedure id, that can be used to monitor the operation
*/
@SuppressWarnings(value
= "NP_NULL_ON_S... | 3.26 |
hbase_ProcedureExecutor_init_rdh | /**
* Initialize the procedure executor, but do not start workers. We will start them later.
* <p/>
* It calls ProcedureStore.recoverLease() and ProcedureStore.load() to recover the lease, and
* ensure a single executor, and start the procedure replay to resume and recover the previous
* pending and in-progress pr... | 3.26 |
hbase_ProcedureExecutor_registerNonce_rdh | /**
* Register a nonce for a procedure that is going to be submitted. A procId will be reserved and
* on submitProcedure(), the procedure with the specified nonce will take the reserved ProcId. If
* someone already reserved the nonce, this method will return the procId reserved, otherwise an
* invalid procId will b... | 3.26 |
hbase_ProcedureExecutor_setFailureResultForNonce_rdh | /**
* If the failure failed before submitting it, we may want to give back the same error to the
* requests with the same nonceKey.
*
* @param nonceKey
* A unique identifier for this operation from the client or process
* @param procName
* name of the procedure, used to inform the user
* @param procOwner
*... | 3.26 |
hbase_ProcedureExecutor_submitProcedures_rdh | /**
* Add a set of new root-procedure to the executor.
*
* @param procs
* the new procedures to execute.
*/
// TODO: Do we need to take nonces here?
public void submitProcedures(Procedure<TEnvironment>[] procs) {
Preconditions.checkArgument(lastProcId.get() >= 0);
if ((procs == null) || (procs.length <= 0)) {
... | 3.26 |
hbase_ProcedureExecutor_runProcedure_rdh | /**
* Encapsulates execution of the current {@link #activeProcedure} for easy tracing.
*/
private long runProcedure()
throws IOException {
final Procedure<TEnvironment> proc = this.activeProcedure;
int activeCount = activeExecutorCount.incrementAndGet();
int runningCount = store.setRunningProcedureCount(activeCount);... | 3.26 |
hbase_ProcedureExecutor_getCurrentRunTime_rdh | /**
* Returns the time since the current procedure is running
*/
public long getCurrentRunTime() {
return EnvironmentEdgeManager.currentTime() - executionStartTime.get();
} | 3.26 |
hbase_ProcedureExecutor_restoreLocks_rdh | // Restore the locks for all the procedures.
// Notice that we need to restore the locks starting from the root proc, otherwise there will be
// problem that a sub procedure may hold the exclusive lock first and then we are stuck when
// calling the acquireLock method for the parent procedure.
// The algorithm is strai... | 3.26 |
hbase_ProcedureExecutor_startWorkers_rdh | /**
* Start the workers.
*/public void startWorkers() throws IOException {
if (!running.compareAndSet(false, true)) {
LOG.warn("Already running");
return;
}
// Start the executors. Here we must have the lastPro... | 3.26 |
hbase_ProcedureExecutor_execProcedure_rdh | /**
* Executes <code>procedure</code>
* <ul>
* <li>Calls the doExecute() of the procedure
* <li>If the procedure execution didn't fail (i.e. valid user input)
* <ul>
* <li>...and returned subprocedures
* <ul>
* <li>The subprocedures are initialized.
* <li>The subprocedures are added to the store
* <li>The sub... | 3.26 |
hbase_ProcedureExecutor_keepAlive_rdh | // core worker never timeout
protected boolean keepAlive(long lastUpdate) {
return true;
} | 3.26 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.