name stringlengths 12 178 | code_snippet stringlengths 8 36.5k | score float64 3.26 3.68 |
|---|---|---|
hbase_RegionStateStore_getMergeRegions_rdh | /**
* Returns Return all regioninfos listed in the 'info:merge*' columns of the given {@code region}.
*/
public List<RegionInfo> getMergeRegions(RegionInfo region) throws IOException {
return CatalogFamilyFormat.getMergeRegions(getRegionCatalogResult(region).rawCells());
} | 3.26 |
hbase_RegionStateStore_deleteRegions_rdh | /**
* Deletes the specified regions.
*/
public void deleteRegions(final List<RegionInfo> regions)
throws IOException {
deleteRegions(regions, EnvironmentEdgeManager.currentTime());
} | 3.26 |
hbase_RegionStateStore_m0_rdh | /**
* Performs an atomic multi-mutate operation against the given table. Used by the likes of merge
* and split as these want to make atomic mutations across multiple rows.
*/
private void m0(RegionInfo ri, List<Mutation> mutations) throws IOException {
debugLogMutations(mutations);
byte[] row = Bytes.toByte... | 3.26 |
hbase_RegionStateStore_splitRegion_rdh | // ============================================================================================
// Update Region Splitting State helpers
// ============================================================================================
/**
* Splits the region into two in an atomic operation. Offlines the parent region wi... | 3.26 |
hbase_RegionStateStore_deleteMergeQualifiers_rdh | /**
* Deletes merge qualifiers for the specified merge region.
*
* @param connection
* connection we're using
* @param mergeRegion
* the merged region
*/
public void deleteMergeQualifiers(RegionInfo mergeRegion) throws IOException {
// NOTE: We are doing a new hbase:meta read here.
Cell[] cells = getRegionC... | 3.26 |
hbase_RegionStateStore_visitMetaForRegion_rdh | /**
* Queries META table for the passed region encoded name, delegating action upon results to the
* {@code RegionStateVisitor} passed as second parameter.
*
* @param regionEncodedName
* encoded name for the Region we want to query META for.
* @param visitor
* The {@code RegionStateVisitor} instance to react... | 3.26 |
hbase_RegionStateStore_overwriteRegions_rdh | /**
* Overwrites the specified regions from hbase:meta. Deletes old rows for the given regions and
* adds new ones. Regions added back have state CLOSED.
*
* @param connection
* connection we're using
* @param regionInfos
* list of regions to be added to META
*/
public void overwriteRegions(List<RegionInfo>... | 3.26 |
hbase_RegionStateStore_getRegionState_rdh | // ==========================================================================
// Region State
// ==========================================================================
/**
* Pull the region state from a catalog table {@link Result}.
*
* @return the region state, or null if unknown.
*/
public static State getReg... | 3.26 |
hbase_MasterRegionFlusherAndCompactor_setupConf_rdh | // inject our flush related configurations
static void setupConf(Configuration conf,
long flushSize, long flushPerChanges, long flushIntervalMs) {
conf.setLong(HConstants.HREGION_MEMSTORE_FLUSH_SIZE, flushSize);
conf.setLong(HRegion.MEMSTORE_FLUSH_PER_CHANGES, flushPerChanges);
conf.setLong(HRegion.MEMSTORE... | 3.26 |
hbase_AdaptiveLifoCoDelCallQueue_updateTunables_rdh | /**
* Update tunables.
*
* @param newCodelTargetDelay
* new CoDel target delay
* @param newCodelInterval
* new CoDel interval
* @param newLifoThreshold
* new Adaptive Lifo threshold
*/
public void updateTunables(int newCodelTargetDelay, int newCodelInterval, double newLifoThreshold) {
this.codelTar... | 3.26 |
hbase_AdaptiveLifoCoDelCallQueue_offer_rdh | // Generic BlockingQueue methods we support
@Override
public boolean offer(CallRunner callRunner) {
return queue.offer(callRunner);
} | 3.26 |
hbase_AdaptiveLifoCoDelCallQueue_poll_rdh | // This class does NOT provide generic purpose BlockingQueue implementation,
// so to prevent misuse all other methods throw UnsupportedOperationException.
@Override
public CallRunner poll(long timeout, TimeUnit unit) throws InterruptedException {
throw new UnsupportedOperationException("This class doesn't support... | 3.26 |
hbase_AdaptiveLifoCoDelCallQueue_m0_rdh | /**
* Behaves as {@link LinkedBlockingQueue#take()}, except it will silently skip all calls which it
* thinks should be dropped.
*
* @return the head of this queue
* @throws InterruptedException
* if interrupted while waiting
*/
@Override
public CallRunner m0() throws I... | 3.26 |
hbase_RegionReplicaGroupingCostFunction_costPerGroup_rdh | /**
* For each primary region, it computes the total number of replicas in the array (numReplicas)
* and returns a sum of numReplicas-1 squared. For example, if the server hosts regions a, b, c,
* d, e, f where a and b are same replicas, and c,d,e are same replicas, it returns (2-1) * (2-1)
* + ... | 3.26 |
hbase_HBaseCommonTestingUtility_deleteOnExit_rdh | /**
* Returns True if we should delete testing dirs on exit.
*/
boolean deleteOnExit() {
String v = System.getProperty("hbase.testing.preserve.testdir");// Let default be true, to delete on exit.
return v == null ? true : !Boolean.parseBoolean(v);
} | 3.26 |
hbase_HBaseCommonTestingUtility_waitFor_rdh | /**
* Wrapper method for {@link Waiter#waitFor(Configuration, long, long, boolean, Predicate)}.
*/
public <E extends Exception> long waitFor(long timeout, long interval, boolean failIfTimeout, Predicate<E> predicate) throws E {
return Waiter.waitFor(this.conf, timeout, interval, failIfTimeout, predicate);
} | 3.26 |
hbase_HBaseCommonTestingUtility_randomFreePort_rdh | /**
* Returns a random free port and marks that port as taken. Not thread-safe. Expected to be
* called from single-threaded test setup code/
*/
public int randomFreePort() {int port = 0;
do {
port = randomPort(); if (takenRandomPorts.contains(port)) {
port = 0;
continue;
... | 3.26 |
hbase_HBaseCommonTestingUtility_getConfiguration_rdh | /**
* Returns this classes's instance of {@link Configuration}.
*
* @return Instance of Configuration.
*/
public Configuration getConfiguration() {
return this.conf;
} | 3.26 |
hbase_HBaseCommonTestingUtility_deleteDir_rdh | /**
*
* @param dir
* Directory to delete
* @return True if we deleted it.
*/
boolean deleteDir(final File dir) {
if ((dir == null) || (!dir.exists())) {
return true;
}
int ntries = 0;
do {
ntries += 1;
try {
if (deleteOnExit()) {
FileUtils... | 3.26 |
hbase_HBaseCommonTestingUtility_cleanupTestDir_rdh | /**
*
* @param subdir
* Test subdir name.
* @return True if we removed the test dir
*/
public boolean cleanupTestDir(final String subdir) {
if (this.dataTestDir == null) {
return false;
}
return deleteDir(new File(this.dataTestDir, subdir));
}
/**
*
* @return Where to write test data on loc... | 3.26 |
hbase_HBaseCommonTestingUtility_randomPort_rdh | /**
* Returns a random port. These ports cannot be registered with IANA and are intended for
* dynamic allocation (see http://bit.ly/dynports).
*/
private int randomPort() {
return MIN_RANDOM_PORT + ThreadLocalRandom.current().nextInt(MAX_RANDOM_PORT - MIN_RANDOM_PORT);
} | 3.26 |
hbase_HBaseCommonTestingUtility_getRandomDir_rdh | /**
*
* @return A dir with a random (uuid) name under the test dir
* @see #getBaseTestDir()
*/
public Path getRandomDir() {
return new Path(getBaseTestDir(), getRandomUUID().toString());
} | 3.26 |
hbase_HBaseCommonTestingUtility_setupDataTestDir_rdh | /**
* Sets up a directory for a test to use.
*
* @return New directory path, if created.
*/
protected Path setupDataTestDir() {
if (this.dataTestDir != null) {
LOG.warn("Data test dir already setup in " + dataTestDir.getAbsolutePath());
return null;
}
Path testPath = getRandomDir();
... | 3.26 |
hbase_EntryBuffers_appendEntry_rdh | /**
* Append a log entry into the corresponding region buffer. Blocks if the total heap usage has
* crossed the specified threshold.
*/
void appendEntry(WAL.Entry entry) throws InterruptedException, IOException {
WALKey key = entry.getKey();
RegionEntryBuffer buffer;
lon... | 3.26 |
hbase_EntryBuffers_getChunkToWrite_rdh | /**
* Returns RegionEntryBuffer a buffer of edits to be written.
*/
synchronized RegionEntryBuffer getChunkToWrite() {
long biggestSize = 0;
byte[] v4 = null;
for (Map.Entry<byte[], RegionEntryBuffer> entry : buffers.entrySet()) {
long v6 = entry.getValue().heapSize();
if ((v6 > biggestSi... | 3.26 |
hbase_MetricsRegionAggregateSourceImpl_getMetrics_rdh | /**
* Yes this is a get function that doesn't return anything. Thanks Hadoop for breaking all
* expectations of java programmers. Instead of returning anything Hadoop metrics expects
* getMetrics to push the metrics into the collector.
*
* @param collector
* the collector
* @param all
* get all the metrics ... | 3.26 |
hbase_ByteBufferInputStream_skip_rdh | /**
* Skips <code>n</code> bytes of input from this input stream. Fewer bytes might be skipped if the
* end of the input stream is reached. The actual number <code>k</code> of bytes to be skipped is
* equal to the smaller of <code>n</code> and remaining bytes in the stream.
*
* @param n
... | 3.26 |
hbase_ByteBufferInputStream_read_rdh | /**
* Reads the next byte of data from this input stream. The value byte is returned as an
* <code>int</code> in the range <code>0</code> to <code>255</code>. If no byte is available
* because the end of the stream has been reached, the value <code>-1</code> is returned.
*
* @return the next byte of data, or <code... | 3.26 |
hbase_SnapshotReferenceUtil_m0_rdh | /**
* Iterate over the snapshot store files, restored.edits and logs
*
* @param conf
* The current {@link Configuration} instance.
* @param fs
* {@link FileSystem}
* @param snapshotDir
* {@link Path} to the Snapshot directory
* @param desc
* the {@link SnapshotDescription} of the snapshot to verify
*... | 3.26 |
hbase_SnapshotReferenceUtil_getHFileNames_rdh | /**
* Returns the store file names in the snapshot.
*
* @param conf
* The current {@link Configuration} instance.
* @param fs
* {@link FileSystem}
* @param snapshotDir
* {@link Path} to the Snapshot directory
* @param snapshotDesc
* the {@link SnapshotDescription} of the snapshot to inspect
* @throws... | 3.26 |
hbase_SnapshotReferenceUtil_verifyStoreFile_rdh | /**
* Verify the validity of the snapshot store file
*
* @param conf
* The current {@link Configuration} instance.
* @param fs
* {@link FileSystem}
* @param snapshotDir
* {@link Path} to the Snapshot directory of the snapshot to verify
* @param snapshot
* the {@link SnapshotDescription} of the snapsho... | 3.26 |
hbase_SnapshotReferenceUtil_m1_rdh | /**
* Returns the store file names in the snapshot.
*
* @param conf
* The current {@link Configuration} instance.
* @param fs
* {@link FileSystem}
* @param snapshotDir
* {@link Path} to the Snapshot directory
* @throws IOException
* if an error occurred while scanning the directory
* @return the name... | 3.26 |
hbase_SnapshotReferenceUtil_visitTableStoreFiles_rdh | /**
* © Iterate over the snapshot store files
*
* @param conf
* The current {@link Configuration} instance.
* @param fs
* {@link FileSystem}
* @param snapshotDir
* {@link Path} to the Snapshot directory
* @param desc
* the {@link SnapshotDescription} of the snapshot to verify
* @param visitor
* ca... | 3.26 |
hbase_SnapshotReferenceUtil_verifySnapshot_rdh | /**
* Verify the validity of the snapshot
*
* @param conf
* The current {@link Configuration} instance.
* @param fs
* {@link FileSystem}
* @param manifest
* snapshot manifest to inspect
* @throws CorruptedSnapshotException
* if the snapshot is corrupted
* @throws IOException
* if an error occurred... | 3.26 |
hbase_SnapshotReferenceUtil_visitRegionStoreFiles_rdh | /**
* Iterate over the snapshot store files in the specified region
*
* @param manifest
* snapshot manifest to inspect
* @param visitor
* callback object to get the store files
* @throws IOException
* if an error occurred while scanning the directory
*/
public static void visitRegionStoreFiles(final Snap... | 3.26 |
hbase_SnapshotReferenceUtil_visitReferencedFiles_rdh | /**
* Iterate over the snapshot store files
*
* @param conf
* The current {@link Configuration} instance.
* @param fs
* {@link FileSystem}
* @param snapshotDir
* {@link Path} to the Snapshot directory
* @param visitor
* callback object to get the referenced files
* @throws IOException
* if an erro... | 3.26 |
hbase_HBaseSaslRpcServer_unwrap_rdh | /**
* Unwrap InvalidToken exception, otherwise return the one passed in.
*/
public static Throwable unwrap(Throwable e) {
Throwable cause
= e;
while (cause != null) {
if (cause instanceof InvalidToken) {
return cause;
}
cause = cause.getCause();
}
return e;
} | 3.26 |
hbase_HFileArchiveTableMonitor_shouldArchiveTable_rdh | /**
* Determine if the given table should or should not allow its hfiles to be deleted in the archive
*
* @param tableName
* name of the table to check
* @return <tt>true</tt> if its store files should be retained, <tt>false</tt> otherwise
*/
public synchronized boolean shouldArchiveTable(String tableName) {
... | 3.26 |
hbase_HFileArchiveTableMonitor_addTable_rdh | /**
* Add the named table to be those being archived. Attempts to register the table
*
* @param table
* name of the table to be registered
*/
public synchronized void addTable(String table) {
if (this.shouldArchiveTable(table)) {
LOG.debug(("Already archiving table:... | 3.26 |
hbase_HFileArchiveTableMonitor_setArchiveTables_rdh | /**
* Set the tables to be archived. Internally adds each table and attempts to register it.
* <p>
* <b>Note: All previous tables will be removed in favor of these tables.</b>
*
* @param tables
* add each of the tables to be archived.
*/
public synchronized void setArchiveTables(List<String> tables) {
arc... | 3.26 |
hbase_NettyAsyncFSWALConfigHelper_m0_rdh | /**
* Set the EventLoopGroup and channel class for {@code AsyncFSWALProvider}.
*/
public static void m0(Configuration conf, EventLoopGroup group, Class<? extends Channel> channelClass) {
Preconditions.checkNotNull(group, "group is null");
Preconditions.checkNotNull(channelClass,
"channel class is null");
... | 3.26 |
hbase_ExportUtils_usage_rdh | /**
* Common usage for other export tools.
*
* @param errorMsg
* Error message. Can be null.
*/
public static void usage(final String errorMsg) {
if ((errorMsg != null) && (errorMsg.length() > 0)) {
System.err.println("ERROR: " + errorMsg);
}
System.err.println("Usage: Export [-D <property=... | 3.26 |
hbase_TextSortReducer_doSetup_rdh | /**
* Handles common parameter initialization that a subclass might want to leverage.
*/
protected void doSetup(Context context, Configuration conf) {
// If a custom separator has been used,
// decode it back from Base64 encoding.
separator = conf.get(ImportTsv.SEPARATOR_CONF_KEY);
if (separator == nu... | 3.26 |
hbase_TextSortReducer_setup_rdh | /**
* Handles initializing this class with objects specific to it (i.e., the parser). Common
* initialization that might be leveraged by a subsclass is done in <code>doSetup</code>. Hence a
* subclass may choose to override this method and call <code>doSetup</code> as well before
* handling it's own custom params.
... | 3.26 |
hbase_BalancerClusterState_registerRegion_rdh | /**
* Helper for Cluster constructor to handle a region
*/
private void registerRegion(RegionInfo region, int regionIndex, int serverIndex, Map<String, Deque<BalancerRegionLoad>> loads, RegionHDFSBlockLocationFinder regionFinder) {
String tableName = region.getTable().getNameAsString();
if (!tablesToIndex.co... | 3.26 |
hbase_BalancerClusterState_getOrComputeLocality_rdh | /**
* Looks up locality from cache of localities. Will create cache if it does not already exist.
*/
public float getOrComputeLocality(int region, int entity, BalancerClusterState.LocalityType type) {
switch (type) {case SERVER :
return getLocalityOfRegion(region, entity);
case RACK :
... | 3.26 |
hbase_BalancerClusterState_getOrComputeRackLocalities_rdh | /**
* Retrieves and lazily initializes a field storing the locality of every region/server
* combination
*/
public float[][] getOrComputeRackLocalities() {
if ((rackLocalities == null) || (regionsToMostLocalEntities == null)) {
computeCachedLocalities();
}
return rackLocalities;
} | 3.26 |
hbase_BalancerClusterState_getOrComputeWeightedRegionCacheRatio_rdh | /**
* Returns the weighted cache ratio of a region on the given region server
*/
public float getOrComputeWeightedRegionCacheRatio(int region, int server) {
return getTotalRegionHFileSizeMB(region) * getOrComputeRegionCacheRatio(region, server);
} | 3.26 |
hbase_BalancerClusterState_getOrComputeWeightedLocality_rdh | /**
* Returns locality weighted by region size in MB. Will create locality cache if it does not
* already exist.
*/
public double getOrComputeWeightedLocality(int region, int server, BalancerClusterState.LocalityType type) {
return getRegionSizeMB(region) * getOrComputeLocality(region, server, type);
} | 3.26 |
hbase_BalancerClusterState_computeRegionServerRegionCacheRatio_rdh | /**
* Populate the maps containing information about how much a region is cached on a region server.
*/
private void computeRegionServerRegionCacheRatio() {
regionIndexServerIndexRegionCachedRatio = new HashMap<>();
f1 = new int[numRegions];
for (int region = 0; region < numRegions; region++) {
float bestRegionCacheR... | 3.26 |
hbase_BalancerClusterState_wouldLowerAvailability_rdh | /**
* Return true if the placement of region on server would lower the availability of the region in
* question
*
* @return true or false
*/
boolean wouldLowerAvailability(RegionInfo regionInfo, ServerName serverName) {
if (!serversToIndex.containsKey(serverName.getAddress())) {
return false;// safeguard against r... | 3.26 |
hbase_BalancerClusterState_computeCachedLocalities_rdh | /**
* Computes and caches the locality for each region/rack combinations, as well as storing a
* mapping of region -> server and region -> rack such that server and rack have the highest
* locality for region
*/
private void computeCachedLocalities() {
rackLocalities = new float[numRegions][numRacks];
reg... | 3.26 |
hbase_BalancerClusterState_getRegionCacheRatioOnRegionServer_rdh | /**
* Returns the amount by which a region is cached on a given region server. If the region is not
* currently hosted on the given region server, then find out if it was previously hosted there
* and return the old cache ratio.
*/
protected float getRegionCacheRatioOnRegionServer(int region, int regionServerIndex)... | 3.26 |
hbase_BalancerClusterState_getRegionSizeMB_rdh | /**
* Returns the size in MB from the most recent RegionLoad for region
*/
public int getRegionSizeMB(int region) {
Deque<BalancerRegionLoad> load = regionLoads[region];
// This means regions have no actual data on disk
if (load == null) {
return 0;
}
return regionLoads[region].getLast(... | 3.26 |
hbase_BalancerClusterState_getRackForRegion_rdh | /**
* Maps region index to rack index
*/
public int getRackForRegion(int region) {
return serverIndexToRackIndex[regionIndexToServerIndex[region]];
} | 3.26 |
hbase_BalancerClusterState_getOrComputeRegionsToMostLocalEntities_rdh | /**
* Lazily initializes and retrieves a mapping of region -> server for which region has the highest
* the locality
*/
public int[] getOrComputeRegionsToMostLocalEntities(BalancerClusterState.LocalityType type) {
if ((rackLocalities == null) || (regionsToMostLocalEntities
== null)) {
computeCache... | 3.26 |
hbase_BalancerClusterState_updateForLocation_rdh | /**
* Common method for per host and per Location region index updates when a region is moved.
*
* @param serverIndexToLocation
* serverIndexToHostIndex or serverIndexToLocationIndex
* @param regionsPerLocation
* regionsPerHost or regionsPerLocation
* @param colocatedReplicaCountsPerLocation
* colocatedRe... | 3.26 |
hbase_BalancerClusterState_checkLocationForPrimary_rdh | /**
* Common method for better solution check.
*
* @param colocatedReplicaCountsPerLocation
* colocatedReplicaCountsPerHost or
* colocatedReplicaCountsPerRack
* @return 1 for better, -1 for no better, 0 for unknown
*/
private int checkLocationForPrimary(int location, Int2IntCounterMap[] colocatedReplicaCount... | 3.26 |
hbase_BalancerClusterState_serverHasTooFewRegions_rdh | /**
* Returns true iff a given server has less regions than the balanced amount
*/
public boolean serverHasTooFewRegions(int server) {
int
minLoad = this.numRegions / numServers;
int numRegions = getNumRegions(server);
return numRegions < minLoad;
} | 3.26 |
hbase_BalancerClusterState_getTotalRegionHFileSizeMB_rdh | /**
* Returns the size of hFiles from the most recent RegionLoad for region
*/
public int getTotalRegionHFileSizeMB(int region) {
Deque<BalancerRegionLoad> load = regionLoads[region];
if (load == null) {
// This means, that the region has no actual data on disk
return 0;
}
return regionLoads[region].getLas... | 3.26 |
hbase_ServerMetrics_getVersion_rdh | /**
* Returns the string type version of a regionserver.
*/
default String
getVersion() {
return "0.0.0";
} | 3.26 |
hbase_ServerMetrics_getVersionNumber_rdh | /**
* Returns the version number of a regionserver.
*/
default int getVersionNumber() {
return 0;
} | 3.26 |
hbase_ReplicationPeer_isPeerEnabled_rdh | /**
* Test whether the peer is enabled.
*
* @return {@code true} if enabled, otherwise {@code false}.
*/
default boolean isPeerEnabled() {
return getPeerState() == PeerState.ENABLED;
} | 3.26 |
hbase_HBackupFileSystem_getBackupTmpDirPath_rdh | /**
* Get backup temporary directory
*
* @param backupRootDir
* backup root
* @return backup tmp directory path
*/
public static Path getBackupTmpDirPath(String backupRootDir) {
return new Path(backupRootDir, ".tmp");
} | 3.26 |
hbase_HBackupFileSystem_checkImageManifestExist_rdh | /**
* Check whether the backup image path and there is manifest file in the path.
*
* @param backupManifestMap
* If all the manifests are found, then they are put into this map
* @param tableArray
* the tables involved
* @throws IOException
* exception
*/
public static void checkImageManifestExist(HashMa... | 3.26 |
hbase_HBackupFileSystem_getManifestPath_rdh | // TODO we do not keep WAL files anymore
// Move manifest file to other place
private static Path getManifestPath(Configuration conf, Path backupRootPath, String backupId) throws IOException {
FileSystem v0 = backupRootPath.getFileSystem(conf);
Path manifestPath = new Path((getBackupPath(backupRootPath.toStrin... | 3.26 |
hbase_HBackupFileSystem_getTableBackupDir_rdh | /**
* Given the backup root dir, backup id and the table name, return the backup image location,
* which is also where the backup manifest file is. return value look like:
* "hdfs://backup.hbase.org:9000/user/biadmin/backup/backup_1396650096738/default/t1_dn/", where
* "hdfs://backup.hbase.org:9000/user/biadmin/bac... | 3.26 |
hbase_HBackupFileSystem_getTableBackupPath_rdh | /**
* Given the backup root dir, backup id and the table name, return the backup image location,
* which is also where the backup manifest file is. return value look like:
* "hdfs://backup.hbase.org:9000/user/biadmin/backup/backup_1396650096738/default/t1_dn/", where
* "hdfs://backup.hbase.org:9000/user/biadmin/bac... | 3.26 |
hbase_HBackupFileSystem_getBackupTmpDirPathForBackupId_rdh | /**
* Get backup tmp directory for backupId
*
* @param backupRoot
* backup root
* @param backupId
* backup id
* @return backup tmp directory path
*/
public static Path getBackupTmpDirPathForBackupId(String backupRoot, String backupId) {
return new Path(getBackupTmpDirPath(backupRoot), backupId);
} | 3.26 |
hbase_FlushNonSloppyStoresFirstPolicy_selectStoresToFlush_rdh | /**
* Returns the stores need to be flushed.
*/
@Override
public Collection<HStore> selectStoresToFlush() {
Collection<HStore> specificStoresToFlush = new HashSet<>();
for (HStore store : regularStores) {
if (shouldFlush(store) || region.shouldFlushStore(store)) {
specificStoresToFlush.add... | 3.26 |
hbase_ExponentialClientBackoffPolicy_scale_rdh | /**
* Scale valueIn in the range [baseMin,baseMax] to the range [limitMin,limitMax]
*/
private static double scale(double valueIn, double baseMin, double baseMax, double limitMin, double limitMax) {
Preconditions.checkArgument(baseMin <= baseMax, "Illegal source range [%s,%s]", baseMin, baseMax);
Preconditions.chec... | 3.26 |
hbase_AsyncTableRegionLocator_getEndKeys_rdh | /**
* Gets the ending row key for every region in the currently open table.
* <p>
* This is mainly useful for the MapReduce integration.
*
* @return Array of region ending row keys
*/default CompletableFuture<List<byte[]>> getEndKeys() {
return getStartEndKeys().thenApply(startEndKeys -> startEndKeys.stream(... | 3.26 |
hbase_AsyncTableRegionLocator_getStartKeys_rdh | /**
* Gets the starting row key for every region in the currently open table.
* <p>
* This is mainly useful for the MapReduce integration.
*
* @return Array of region starting row keys
*/
default CompletableFuture<List<byte[]>> getStartKeys() {
return getStartEndKeys().thenApply(startEndKeys -> startEndKeys.s... | 3.26 |
hbase_AsyncTableRegionLocator_getStartEndKeys_rdh | /**
* Gets the starting and ending row keys for every region in the currently open table.
* <p>
* This is mainly useful for the MapReduce integration.
*
* @return Pair of arrays of region starting and ending row keys
*/
default CompletableFuture<List<Pair<byte[], byte[]>>> getStartEndKeys() {
return getAllReg... | 3.26 |
hbase_AsyncTableRegionLocator_getRegionLocations_rdh | /**
* Find all the replicas for the region on which the given row is being served.
*
* @param row
* Row to find.
* @return Locations for all the replicas of the row.
*/default CompletableFuture<List<HRegionLocation>> getRegionLocations(byte[] row) {
return getRegionLocations(row, false);
} | 3.26 |
hbase_AsyncTableRegionLocator_getRegionLocation_rdh | /**
* Finds the region with the given <code>replicaId</code> on which the given row is being served.
* <p/>
* Returns the location of the region with the given <code>replicaId</code> to which the row
* belongs.
*
* @param row
* Row to find.
* @param replicaId
* the replica id of the region
*/
default Comp... | 3.26 |
hbase_ServerManager_getOnlineServersList_rdh | /**
* Returns A copy of the internal list of online servers.
*/
public List<ServerName> getOnlineServersList() {
// TODO: optimize the load balancer call so we don't need to make a new list
// TODO: FIX. THIS IS POPULAR CALL.
return new ArrayList<>(this.onlineServers.keySet());
} | 3.26 |
hbase_ServerManager_checkAndRecordNewServer_rdh | /**
* Check is a server of same host and port already exists, if not, or the existed one got a
* smaller start code, record it.
*
* @param serverName
* the server to check and record
* @param sl
* the server load on the server
* @return true if the server is recorded, otherwise, false
*/
boolean checkAndRe... | 3.26 |
hbase_ServerManager_clearDeadServersWithSameHostNameAndPortOfOnlineServer_rdh | /**
* To clear any dead server with same host name and port of any online server
*/
void clearDeadServersWithSameHostNameAndPortOfOnlineServer() {
for (ServerName serverName : getOnlineServersList()) {
f1.cleanAllPreviousInstances(serverName);
}
} | 3.26 |
hbase_ServerManager_regionServerStartup_rdh | /**
* Let the server manager know a new regionserver has come online
*
* @param request
* the startup request
* @param versionNumber
* the version number of the new regionserver
* @param version
* the version of the new regionserver, could contain strings like "SNAPSHOT"
* @param ia
* the InetAddress ... | 3.26 |
hbase_ServerManager_removeDeletedRegionFromLoadedFlushedSequenceIds_rdh | /**
* Regions may have been removed between latest persist of FlushedSequenceIds and master abort. So
* after loading FlushedSequenceIds from file, and after meta loaded, we need to remove the
* deleted region according to RegionStates.
*/
public void removeDeletedRegionFromLoadedFlushedSequenceIds() {
RegionStates... | 3.26 |
hbase_ServerManager_closeRegionSilentlyAndWait_rdh | /**
* Contacts a region server and waits up to timeout ms to close the region. This bypasses the
* active hmaster. Pass -1 as timeout if you do not want to wait on result.
*/
public static void closeRegionSilentlyAndWait(AsyncClusterConnection connection, ServerName server, RegionInfo
region, long timeout) throws I... | 3.26 |
hbase_ServerManager_isServerKnownAndOnline_rdh | /**
* Returns whether the server is online, dead, or unknown.
*/
public synchronized ServerLiveState isServerKnownAndOnline(ServerName serverName) {
return onlineServers.containsKey(serverName) ? ServerLiveState.LIVE : f1.isDeadServer(serverName) ? ServerLiveState.DEAD : ServerLiveState.f3;
} | 3.26 |
hbase_ServerManager_stop_rdh | /**
* Stop the ServerManager.
*/
public void stop() {
if (flushedSeqIdFlusher != null) {
flushedSeqIdFlusher.shutdown();
}
if
(persistFlushedSequenceId) {
try {
m3();} catch (IOException e) {
LOG.warn("Failed to persist last flushed sequence id of regions" + " to file system", e);
... | 3.26 |
hbase_ServerManager_findServerWithSameHostnamePortWithLock_rdh | /**
* Assumes onlineServers is locked.
*
* @return ServerName with matching hostname and port.
*/
public ServerName findServerWithSameHostnamePortWithLock(final ServerName serverName) {
ServerName end = ServerName.valueOf(serverName.getHostname(), serverName.getPort(), Long.MAX_VALUE);
ServerName r = onli... | 3.26 |
hbase_ServerManager_createDestinationServersList_rdh | /**
* Calls {@link #createDestinationServersList} without server to exclude.
*/
public List<ServerName> createDestinationServersList() {
return
createDestinationServersList(null);
} | 3.26 |
hbase_ServerManager_startChore_rdh | /**
* start chore in ServerManager
*/
public void startChore() {
Configuration c = master.getConfiguration();
if (persistFlushedSequenceId) {
new Thread(() -> {
// after AM#loadMeta, RegionStates should be loaded, and some regions are
// deleted by drop/split/merge during removeDeletedRegionFromLo... | 3.26 |
hbase_ServerManager_updateLastFlushedSequenceIds_rdh | /**
* Updates last flushed sequence Ids for the regions on server sn
*/
private void updateLastFlushedSequenceIds(ServerName sn, ServerMetrics hsl) {for (Entry<byte[], RegionMetrics> entry : hsl.getRegionMetrics().entrySet()) {
byte[] encodedRegionName = Bytes.toBytes... | 3.26 |
hbase_ServerManager_checkIsDead_rdh | /**
* Called when RegionServer first reports in for duty and thereafter each time it heartbeats to
* make sure it is has not been figured for dead. If this server is on the dead list, reject it
* with a YouAreDeadException. If it was dead but came back with a new start code, remove the old
* entry from the dead lis... | 3.26 |
hbase_ServerManager_getOnlineServersListWithPredicator_rdh | /**
*
* @param keys
* The target server name
* @param idleServerPredicator
* Evaluates the server on the given load
* @return A copy of the internal list of online servers matched by the predicator
*/
public List<ServerName> getOnlineServersListWithPredicator(List<ServerName> keys, Predicate<ServerMetrics>... | 3.26 |
hbase_ServerManager_m0_rdh | /**
* Adds the onlineServers list. onlineServers should be locked.
*
* @param serverName
* The remote servers name.
*/
void m0(final ServerName serverName, final ServerMetrics sl) {
LOG.info("Registering regionserver=" + serverName);
this.onlineServers.put(serverName,
sl);
} | 3.26 |
hbase_ServerManager_getMinToStart_rdh | /**
* Calculate min necessary to start. This is not an absolute. It is just a friction that will
* cause us hang around a bit longer waiting on RegionServers to check-in.
*/
private int getMinToStart() {
if (master.isInMaintenanceMode()) {
// If in maintenance mode, then in process region server hosting meta will b... | 3.26 |
hbase_ServerManager_getDrainingServersList_rdh | /**
* Returns A copy of the internal list of draining servers.
*/
public List<ServerName> getDrainingServersList() {
return new ArrayList<>(this.drainingServers);
} | 3.26 |
hbase_ServerManager_countOfRegionServers_rdh | /**
* Returns the count of active regionservers
*/
public int countOfRegionServers() {
// Presumes onlineServers is a concurrent map
return this.onlineServers.size();
} | 3.26 |
hbase_ServerManager_registerListener_rdh | /**
* Add the listener to the notification list.
*
* @param listener
* The ServerListener to register
*/
public void registerListener(final
ServerListener listener) {
this.f2.add(listener);
} | 3.26 |
hbase_ServerManager_getVersionNumber_rdh | /**
* May return 0 when server is not online.
*/
public int getVersionNumber(ServerName serverName) {ServerMetrics serverMetrics = onlineServers.get(serverName);
return serverMetrics != null ? serverMetrics.getVersionNumber() : 0;
} | 3.26 |
hbase_ServerManager_areDeadServersInProgress_rdh | /**
* Checks if any dead servers are currently in progress.
*
* @return true if any RS are being processed as dead, false if not
*/
public boolean areDeadServersInProgress() throws IOException {
return master.getProcedures().stream().anyMatch(p -> (!p.isFinished()) && (p instanceof ServerCrashProcedure));
} | 3.26 |
hbase_ServerManager_checkClockSkew_rdh | /**
* Checks if the clock skew between the server and the master. If the clock skew exceeds the
* configured max, it will throw an exception; if it exceeds the configured warning threshold, it
* will log a warning but start normally.
*
* @param serverName
* Incoming servers's name
* @throws ClockOutOfSyncExcep... | 3.26 |
hbase_ServerManager_loadLastFlushedSequenceIds_rdh | /**
* Load last flushed sequence id of each region from HDFS, if persisted
*/
public void loadLastFlushedSequenceIds() throws IOException {
if (!persistFlushedSequenceId) {
return;
}
Configuration conf = master.getConfiguration();
Path rootDir = CommonFSUtils.getRootDir(conf);
Path lastFlushedSeqIdPath = new P... | 3.26 |
hbase_ServerManager_m2_rdh | /**
* Called by delete table and similar to notify the ServerManager that a region was removed.
*/
public void m2(final RegionInfo regionInfo) {
final byte[] encodedName = regionInfo.getEncodedNameAsBytes();
storeFlushedSequenceIdsByRegion.remove(encodedName);
flushedSequenceIdByRegion.remove(encodedName)... | 3.26 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.