name stringlengths 12 178 | code_snippet stringlengths 8 36.5k | score float64 3.26 3.68 |
|---|---|---|
hbase_ServerManager_removeRegions_rdh | /**
* Called by delete table and similar to notify the ServerManager that a region was removed.
*/
public void removeRegions(final List<RegionInfo> regions) {
for (RegionInfo hri : regions) {
m2(hri);
}
} | 3.26 |
hbase_ServerManager_getLoad_rdh | /**
* Returns ServerMetrics if serverName is known else null
*/
public ServerMetrics getLoad(final ServerName serverName) {
return this.onlineServers.get(serverName);
} | 3.26 |
hbase_ServerManager_waitForRegionServers_rdh | /**
* Wait for the region servers to report in. We will wait until one of this condition is met: -
* the master is stopped - the 'hbase.master.wait.on.regionservers.maxtostart' number of region
* servers is reached - the 'hbase.master.wait.on.regionservers.mintostart' is reached AND there
* have been no new region ... | 3.26 |
hbase_ServerManager_addServerToDrainList_rdh | /**
* Add the server to the drain list.
*
* @return True if the server is added or the server is already on the drain list.
*/
public synchronized boolean addServerToDrainList(final ServerName sn) {
// Warn if the server (sn) is not online. ServerName is of the form:
// <hostname> , <port> , <startcode>
if (!this.i... | 3.26 |
hbase_ServerManager_findDeadServersAndProcess_rdh | /**
* Find out the region servers crashed between the crash of the previous master instance and the
* current master instance and schedule SCP for them.
* <p/>
* Since the {@code RegionServerTracker} has already helped us to construct the online servers set
* by scanning zookeeper, now we can compare the online se... | 3.26 |
hbase_ServerManager_getAverageLoad_rdh | /**
* Compute the average load across all region servers. Currently, this uses a very naive
* computation - just uses the number of regions being served, ignoring stats about number of
* requests.
*
* @return the average load
*/
public double getAverageLoad()
{
int totalLoad = 0;
int numServers = 0;
f... | 3.26 |
hbase_ServerManager_m3_rdh | /**
* Persist last flushed sequence id of each region to HDFS
*
* @throws IOException
* if persit to HDFS fails
*/
private void m3() throws IOException {
if (isFlushSeqIdPersistInProgress) {
return;
}
isFlushSeqIdPersistInProgress = true;
try {
Configuration conf = master.getConfiguration();
Path roo... | 3.26 |
hbase_ServerManager_isServerDead_rdh | /**
* Check if a server is known to be dead. A server can be online, or known to be dead, or unknown
* to this manager (i.e, not online, not known to be dead either; it is simply not tracked by the
* master any more, for example, a very old previous instance).
*/
public synchronized boolean isServerDead(ServerName ... | 3.26 |
hbase_ServerManager_unregisterListener_rdh | /**
* Remove the listener from the notification list.
*
* @param listener
* The ServerListener to unregister
*/
public boolean unregisterListener(final ServerListener listener) {
return this.f2.remove(listener);
} | 3.26 |
hbase_ServerManager_getOnlineServers_rdh | /**
* Returns Read-only map of servers to serverinfo
*/
public Map<ServerName, ServerMetrics> getOnlineServers() {
// Presumption is that iterating the returned Map is OK.
synchronized(this.onlineServers) {
return Collections.unmodifiableMap(this.onlineServers);
}
} | 3.26 |
hbase_ServerManager_moveFromOnlineToDeadServers_rdh | /**
* Called when server has expired.
*/
// Locking in this class needs cleanup.
public synchronized void moveFromOnlineToDeadServers(final ServerName sn) {
synchronized(this.onlineServers) {
boolean v37 = this.onlineServers.containsKey(sn);
if (v37) {
// Remove the server from the known servers lis... | 3.26 |
hbase_ServerManager_getVersion_rdh | /**
* May return "0.0.0" when server is not online
*/
public String getVersion(ServerName serverName) {
ServerMetrics serverMetrics = onlineServers.get(serverName);
return serverMetrics != null ? serverMetrics.getVersion() : "0.0.0";
} | 3.26 |
hbase_ProcedureStoreTracker_setDeletedIfDeletedByThem_rdh | /**
* For the global tracker, we will use this method to build the holdingCleanupTracker, as the
* modified flags will be cleared after rolling so we only need to test the deleted flags.
*
* @see #setDeletedIfModifiedInBoth(ProcedureStoreTracker)
*/
public void setDeletedIfDeletedByThem(ProcedureStoreTracker track... | 3.26 |
hbase_ProcedureStoreTracker_resetModified_rdh | /**
* Clears the list of updated procedure ids. This doesn't affect global list of active procedure
* ids.
*/
public void resetModified() {
for (Map.Entry<Long, BitSetNode> v27 :
map.entrySet()) {
v27.getValue().resetModified();
}
minModifiedProcId = Long.MAX_VALUE;
maxModifiedProcId = ... | 3.26 |
hbase_ProcedureStoreTracker_setDeletedIfModifiedInBoth_rdh | /**
* Similar with {@link #setDeletedIfModified(long...)}, but here the {@code procId} are given by
* the {@code tracker}. If a procedure is modified by us, and also by the given {@code tracker},
* then we mark it as deleted.
*
* @see #setDeletedIfModified(long...)
*/public void setDeletedIfModifiedInBoth(Procedu... | 3.26 |
hbase_ProcedureStoreTracker_growNode_rdh | /**
* Grows {@code node} to contain {@code procId} and updates the map.
*
* @return {@link BitSetNode} instance which contains {@code procId}.
*/
private BitSetNode growNode(BitSetNode node, long procId) {map.remove(node.getStart());
node.grow(procId);
map.put(node.getStart(), node);
return node;
} | 3.26 |
hbase_ProcedureStoreTracker_resetTo_rdh | /**
* Resets internal state to same as given {@code tracker}, and change the deleted flag according
* to the modified flag if {@code resetDelete} is true. Does deep copy of the bitmap.
* <p/>
* The {@code resetDelete} will be set to true when building cleanup tracker, please see the
* comments in {@link BitSetNode... | 3.26 |
hbase_ProcedureStoreTracker_toProto_rdh | // ========================================================================
// Convert to/from Protocol Buffer.
// ========================================================================
/**
* Builds org.apache.hadoop.hbase.protobuf.generated.ProcedureProtos.ProcedureStoreTracker
* protocol buffer from current state... | 3.26 |
hbase_ProcedureStoreTracker_mergeNodes_rdh | /**
* Merges {@code leftNode} & {@code rightNode} and updates the map.
*/
private BitSetNode mergeNodes(BitSetNode leftNode, BitSetNode
rightNode) {
assert leftNode.getStart() < rightNode.getStart();
leftNode.merge(rightNode);
map.remove(rightNode.getStart());
return leftNode;
} | 3.26 |
hbase_ProcedureStoreTracker_setDeleted_rdh | /**
* This method is used when restarting where we need to rebuild the ProcedureStoreTracker. The
* {@link #delete(long)} method above assume that the {@link BitSetNode} exists, but when restart
* this is not true, as we will read the wal files in reverse order so a delete may come first.
*/
public void setDeleted... | 3.26 |
hbase_ProcedureStoreTracker_setMinMaxModifiedProcIds_rdh | /**
* Will be called when restarting where we need to rebuild the ProcedureStoreTracker.
*/
public void setMinMaxModifiedProcIds(long min, long max) {
this.minModifiedProcId = min;
this.maxModifiedProcId = max;
} | 3.26 |
hbase_ProcedureStoreTracker_isEmpty_rdh | /**
* Returns true, if no procedure is active, else false.
*/
public boolean isEmpty() {
for (Map.Entry<Long, BitSetNode> entry : map.entrySet()) {
if (!entry.getValue().isEmpty()) {
return false;
}
}
return true;
}
/**
*
* @return true if all procedure was modified or del... | 3.26 |
hbase_ProcedureStoreTracker_isDeleted_rdh | /**
* If {@link #partial} is false, returns state from the bitmap. If no state is found for
* {@code procId}, returns YES. If partial is true, tracker doesn't have complete view of system
* state, so it returns MAYBE if there is no update for the procedure or if it doesn't have a
* state in bitmap. Otherwise, retur... | 3.26 |
hbase_ProcedureStoreTracker_getAllActiveProcIds_rdh | /**
* Will be used when there are too many proc wal files. We will rewrite the states of the active
* procedures in the oldest proc wal file so that we can delete it.
*
* @return all the active procedure ids in this tracker.
*/
public long[] getAllActiveProcIds()
{
return map.values().stream().map(BitSetNo... | 3.26 |
hbase_ProcedureStoreTracker_lookupClosestNode_rdh | /**
* lookup the node containing the specified procId.
*
* @param node
* cached node to check before doing a lookup
* @param procId
* the procId to lookup
* @return the node that may contains the procId or null
*/
private BitSetNode lookupClosestNode(final BitSetNode
node, final long procId) {
if ((node... | 3.26 |
hbase_ProcedureStoreTracker_setDeletedIfModified_rdh | /**
* Set the given bit for the procId to delete if it was modified before.
* <p/>
* This method is used to test whether a procedure wal file can be safely deleted, as if all the
* procedures in the given procedure wal file has been modified in the new procedure wal files,
* then we can delete it.
*/
public void ... | 3.26 |
hbase_RegionLocator_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
* @throws IOException
* if a remote or network exception occur... | 3.26 |
hbase_RegionLocator_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
* @throws IOException
* if a remote or network exception occurs
*/
default byte[][] getEndKeys() throws IOException {
return
... | 3.26 |
hbase_RegionLocator_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
* @throws IOException
* if a remote or network exception occurs
*/
default byte[][] getStartKeys() throws IOException {
r... | 3.26 |
hbase_RegionLocator_getRegionLocation_rdh | /**
* Finds the region with the given replica id on which the given row is being served.
*
* @param row
* Row to find.
* @param replicaId
* the replica id
* @return Location of the row.
* @throws IOException
* if a remote or network exception occurs
*/
default HRegionLocation getRegionLocation(byte[] ro... | 3.26 |
hbase_RegionLocator_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.
* @throws IOException
* if a remote or network exception occurs
*/
default List<HRegionLocation> getRegionLocations(byte[] row) throws IOExcep... | 3.26 |
hbase_DefaultHeapMemoryTuner_addToRollingStats_rdh | /**
* Add the given context to the rolling tuner stats.
*
* @param context
* The tuner context.
*/
private void addToRollingStats(TunerContext context) {
f0.insertDataValue(context.getCacheMissCount());
rollingStatsForFlushes.insertDataValue(context.getBlockedFlushCount() + context.getUnblockedFlushCount... | 3.26 |
hbase_DefaultHeapMemoryTuner_getTuneDirection_rdh | /**
* Determine best direction of tuning base on given context.
*
* @param context
* The tuner context.
* @return tuning direction.
*/
private StepDirection getTuneDirection(TunerContext context) {
StepDirection newTuneDirection = StepDirection.NEUTRAL;
long v11 = context.getBlockedFlushCount();
... | 3.26 |
hbase_ReplicationGroupOffset_getOffset_rdh | /**
* A negative value means this file has already been fully replicated out
*/
public long getOffset()
{
return offset;
} | 3.26 |
hbase_HBaseRpcControllerImpl_cellScanner_rdh | /**
* Returns One-shot cell scanner (you cannot back it up and restart)
*/
@Override
public CellScanner cellScanner() {
return cellScanner;
} | 3.26 |
hbase_CompressionState_readKey_rdh | /**
* Analyze the key and fill the state assuming we know previous state. Uses mark() and reset() in
* ByteBuffer to avoid moving the position.
* <p>
* This method overrides all the fields of this instance, except {@link #prevOffset}, which is
* usually manipulated directly by encoders and decoders.
*
* @param i... | 3.26 |
hbase_AsyncRegionLocatorHelper_removeRegionLocation_rdh | /**
* Create a new {@link RegionLocations} based on the given {@code oldLocs}, and remove the
* location for the given {@code replicaId}.
* <p/>
* All the {@link RegionLocations} in async locator related class are immutable because we want to
* access them concurrently, so here we need to create a new one, instead... | 3.26 |
hbase_AsyncRegionLocatorHelper_replaceRegionLocation_rdh | /**
* Create a new {@link RegionLocations} based on the given {@code oldLocs}, and replace the
* location for the given {@code replicaId} with the given {@code loc}.
* <p/>
* All the {@link RegionLocations} in async locator related class are immutable because we want to
* access them concurrently, so here we need ... | 3.26 |
hbase_SplitWALManager_releaseSplitWALWorker_rdh | /**
* After the worker finished the split WAL task, it will release the worker, and wake up all the
* suspend procedures in the ProcedureEvent
*
* @param worker
* worker which is about to release
* @param scheduler
* scheduler which is to wake up the procedure event
*/
public void releaseSplitWALWorker(Serv... | 3.26 |
hbase_SplitWALManager_addUsedSplitWALWorker_rdh | /**
* When master restart, there will be a new splitWorkerAssigner. But if there are splitting WAL
* tasks running on the region server side, they will not be count by the new splitWorkerAssigner.
* Thus we should add the workers of running tasks to the assigner when we load the procedures
* from MasterProcWALs.
*... | 3.26 |
hbase_SplitWALManager_archive_rdh | /**
* Archive processed WAL
*/
public void archive(String wal) throws IOException {
WALSplitUtil.moveWAL(this.fs, new Path(wal), this.walArchiveDir);} | 3.26 |
hbase_SplitWALManager_acquireSplitWALWorker_rdh | /**
* Acquire a split WAL worker
*
* @param procedure
* split WAL task
* @return an available region server which could execute this task
* @throws ProcedureSuspendedException
* if there is no available worker, it will throw this
* exception to WAIT the procedure.
*/
public ServerName acquireSplitWALWork... | 3.26 |
hbase_SyncTable_nextRow_rdh | /**
* Advance to the next row and return its row key. Returns null iff there are no more rows.
*/
public byte[] nextRow() {
if (f4 == null) {
// no cached row - check scanner for more
while (results.hasNext()) {
f4 = results.next();
Cell v27 = f4.rawCells()[0];
... | 3.26 |
hbase_SyncTable_compareRowKeys_rdh | /**
* Compare row keys of the given Result objects. Nulls are after non-nulls
*/
private static int compareRowKeys(byte[] r1, byte[] r2)
{
if (r1 == null) {
return 1;// source missing row
} else if (r2 == null) {
return -1;// target missing row
} else {
// Sync on no META tables only. We can directly do... | 3.26 |
hbase_SyncTable_compareCellKeysWithinRow_rdh | /**
* Compare families, qualifiers, and timestamps of the given Cells. They are assumed to be of
* the same row. Nulls are after non-nulls.
*/
private int compareCellKeysWithinRow(Cell c1, Cell
c2) {
if (c1 == null) {
return 1;// source missing cell
}
if (c2 == null) {
return -1;// target missing cell
}
... | 3.26 |
hbase_SyncTable_finishBatchAndCompareHashes_rdh | /**
* Finish the currently open hash batch. Compare the target hash to the given source hash. If
* they do not match, then sync the covered key range.
*/
private void finishBatchAndCompareHashes(Context context) throws IOException, InterruptedException {
targetHasher.finishBatch();
context.getCounter(Counter... | 3.26 |
hbase_SyncTable_syncRange_rdh | /**
* Rescan the given range directly from the source and target tables. Count and log differences,
* and if this is not a dry run, output Puts and Deletes to make the target table match the
* source table for this range
*/
private void syncRange(Context context, Immu... | 3.26 |
hbase_SyncTable_nextCellInRow_rdh | /**
* Returns the next Cell in the current row or null iff none remain.
*/
public Cell nextCellInRow() {
if (f3 == null) {
// nothing left in current row
return null;}
Cell nextCell = f3.rawCells()[nextCellInRow];
nextCellInRow++;
if (nextCellInRow == f3.size()) {
if (results... | 3.26 |
hbase_SyncTable_main_rdh | /**
* Main entry point.
*/
public static void main(String[] args) throws Exception {
int ret = ToolRunner.run(new SyncTable(HBaseConfiguration.create()), args);
System.exit(ret);
} | 3.26 |
hbase_SyncTable_syncRowCells_rdh | /**
* Compare the cells for the given row from the source and target tables. Count and log any
* differences. If not a dry run, output a Put and/or Delete needed to sync the target table to
* match the source table.
*/
private boolean syncRowCells(Context context, byte[]
rowKey, CellScanner sourceCells, CellScanne... | 3.26 |
hbase_SyncTable_findNextKeyHashPair_rdh | /**
* Attempt to read the next source key/hash pair. If there are no more, set nextSourceKey to
* null
*/
private void findNextKeyHashPair() throws IOException {
boolean hasNext = sourceHashReader.next();
if (hasNext) {
nextSourceKey
= sourceHashReader.getCurrentKey();
} else {
//... | 3.26 |
hbase_SyncTable_moveToNextBatch_rdh | /**
* If there is an open hash batch, complete it and sync if there are diffs. Start a new batch,
* and seek to read the
*/
private void moveToNextBatch(Context context) throws IOException, InterruptedException {
if (targetHasher.isBatchStarted()) {
finishBatchAndCompareHashes(context);
}
targetH... | 3.26 |
hbase_TagCompressionContext_uncompressTags_rdh | /**
* Uncompress tags from the InputStream and writes to the destination buffer.
*
* @param src
* Stream where the compressed tags are available
* @param dest
* Destination buffer where to write the uncompressed tags
* @param length
* Length of all tag bytes
* @throws IOException
* when the dictionary... | 3.26 |
hbase_TagCompressionContext_compressTags_rdh | /**
* Compress tags one by one and writes to the OutputStream.
*
* @param out
* Stream to which the compressed tags to be written
* @param in
* Source buffer where tags are available
* @param offset
* Offset for the tags byte buffer
* @param length
* Length of all tag bytes
*/
public void compressTag... | 3.26 |
hbase_HBaseServerBase_isClusterUp_rdh | /**
* Returns True if the cluster is up.
*/
public boolean isClusterUp() {return (!clusterMode()) || this.clusterStatusTracker.isClusterUp();
} | 3.26 |
hbase_HBaseServerBase_getTableDescriptors_rdh | /**
* Returns Return table descriptors implementation.
*/
public TableDescriptors getTableDescriptors() {
return this.tableDescriptors;
} | 3.26 |
hbase_HBaseServerBase_getNamedQueueRecorder_rdh | /**
* get NamedQueue Provider to add different logs to ringbuffer
*/
public NamedQueueRecorder getNamedQueueRecorder() {
return this.namedQueueRecorder;
} | 3.26 |
hbase_HBaseServerBase_getWALFileSystem_rdh | /**
* Returns Return the walFs.
*/
public FileSystem getWALFileSystem() {return walFs;
} | 3.26 |
hbase_HBaseServerBase_installShutdownHook_rdh | /**
* In order to register ShutdownHook, this method is called when HMaster and HRegionServer are
* started. For details, please refer to HBASE-26951
*/
protected final void installShutdownHook() {
ShutdownHook.install(conf, dataFs, this, Thread.currentThread());
isShutdownHookInstalled = true;
} | 3.26 |
hbase_HBaseServerBase_getDataRootDir_rdh | /**
* Returns Return the rootDir.
*/
public Path getDataRootDir() {
return dataRootDir;
} | 3.26 |
hbase_HBaseServerBase_setupWindows_rdh | /**
* If running on Windows, do windows-specific setup.
*/
private static void setupWindows(final Configuration conf, ConfigurationManager cm) {
if (!SystemUtils.IS_OS_WINDOWS) {
HBasePlatformDependent.handle("HUP", (number, name) -> {conf.reloadConfiguration();
cm.notifyAllObservers(conf);
... | 3.26 |
hbase_HBaseServerBase_getStartcode_rdh | /**
* Returns time stamp in millis of when this server was started
*/
public long getStartcode() {
return this.startcode;
} | 3.26 |
hbase_HBaseServerBase_setupClusterConnection_rdh | /**
* Setup our cluster connection if not already initialized.
*/
protected synchronized final void setupClusterConnection() throws IOException
{
if (asyncClusterConnection == null) {
InetSocketAddress localAddress = new InetSocketAddress(rpcServices.getSocketAddress().getAddress(), 0);
User use... | 3.26 |
hbase_WALStreamReader_next_rdh | /**
* Read the next entry in WAL.
* <p/>
* In most cases you should just use this method, especially when reading a closed wal file for
* splitting or printing.
*/
default Entry next() throws IOException {
return next(null);
} | 3.26 |
hbase_LossyCounting_sweep_rdh | /**
* sweep low frequency data
*/
public void sweep() {
for (Map.Entry<T, Integer> entry : data.entrySet()) {
if (entry.getValue() < currentTerm) {
T metric = entry.getKey();
data.remove(metric);
if (listener != null) {
listener.sweep(metric);
}
}
}
} | 3.26 |
hbase_LossyCounting_calculateCurrentTerm_rdh | /**
* Calculate and set current term
*/
private void calculateCurrentTerm() {
this.currentTerm = ((int) (Math.ceil((1.0 * totalDataCount) / ((double) (bucketSize)))));
} | 3.26 |
hbase_RowModel_getCells_rdh | /**
* Returns the cells
*/
public List<CellModel> getCells() {
return f1;
} | 3.26 |
hbase_RowModel_setKey_rdh | /**
*
* @param key
* the row key
*/
public void setKey(byte[] key) {
this.f0 = key;
} | 3.26 |
hbase_RowModel_getKey_rdh | /**
* Returns the row key
*/
public byte[] getKey() {
return f0;
} | 3.26 |
hbase_SimpleRpcServer_stop_rdh | /**
* Stops the service. No new calls will be handled after this is called.
*/
@Override
public synchronized void stop() {
LOG.info("Stopping server on " + port);
running = false;
if (authTokenSecretMgr != null) {
authTokenSecretMgr.stop();
authTokenSecretMgr = null;
}
listener.interrupt();
listener.doStop();
respo... | 3.26 |
hbase_SimpleRpcServer_closeIdle_rdh | // synch'ed to avoid explicit invocation upon OOM from colliding with
// timer task firing
synchronized void closeIdle(boolean scanAll) {
long minLastContact = EnvironmentEdgeManager.currentTime() - f0;
// concurrent iterator might miss new connections added
// during the iteration, but that's ok because they won't
// ... | 3.26 |
hbase_SimpleRpcServer_getNumOpenConnections_rdh | /**
* The number of open RPC conections
*
* @return the number of open rpc connections
*/
@Override
public int getNumOpenConnections() {
return connectionManager.size();
} | 3.26 |
hbase_SimpleRpcServer_addConnection_rdh | /**
* Updating the readSelector while it's being used is not thread-safe, so the connection must
* be queued. The reader will drain the queue and update its readSelector before performing
* the next select
*/
public void addConnection(SimpleServerRpcConnection conn) throws IOException {
pendingConnections.add(... | 3.26 |
hbase_SimpleRpcServer_getConnection_rdh | /**
* Subclasses of HBaseServer can override this to provide their own Connection implementations.
*/
protected SimpleServerRpcConnection getConnection(SocketChannel channel, long time) {
return new SimpleServerRpcConnection(this, channel, time);
} | 3.26 |
hbase_SimpleRpcServer_join_rdh | /**
* Wait for the server to be stopped. Does not wait for all subthreads to finish.
*
* @see #stop()
*/
@Override
public synchronized void join() throws InterruptedException {
while (running) {
wait();
}
} | 3.26 |
hbase_SimpleRpcServer_start_rdh | /**
* Starts the service. Must be called before any calls will be handled.
*/
@Override
public synchronized void start() {
if (started) {
return;
}
authTokenSecretMgr = createSecretManager();
if (authTokenSecretMgr != null) {
// Start AuthenticationTokenSecretManager in synchronized way to avoid race conditions in
//... | 3.26 |
hbase_SimpleRpcServer_setSocketSendBufSize_rdh | /**
* Sets the socket buffer size used for responding to RPCs.
*
* @param size
* send size
*/
@Override
public void setSocketSendBufSize(int size) {
this.socketSendBufferSize = size;
} | 3.26 |
hbase_Cipher_getProvider_rdh | /**
* Return the provider for this Cipher
*/public CipherProvider getProvider() {
return provider;
} | 3.26 |
hbase_HFileContext_isCompressedOrEncrypted_rdh | /**
* Returns true when on-disk blocks are compressed, and/or encrypted; false otherwise.
*/
public boolean isCompressedOrEncrypted() {
Compression.Algorithm v0 = m0();
boolean compressed = (v0 != null) && (v0 != Algorithm.NONE);
Encryption.Context cryptoContext = getEncryptionContext();
... | 3.26 |
hbase_BufferedMutatorOverAsyncBufferedMutator_getHostnameAndPort_rdh | // not always work, so may return an empty string
private String getHostnameAndPort(Throwable error) {
Matcher matcher = ADDR_MSG_MATCHER.matcher(error.getMessage());
if (matcher.matches()) {
return matcher.group(1);
} else {
return "";
}
} | 3.26 |
hbase_RatioBasedCompactionPolicy_m1_rdh | /**
* A heuristic method to decide whether to schedule a compaction request
*
* @param storeFiles
* files in the store.
* @param filesCompacting
* files being scheduled to compact.
* @return true to schedule a request.
*/
@Override
public boolean m1(Collection<HStoreFile> storeFiles, List<HStoreFile> filesC... | 3.26 |
hbase_RatioBasedCompactionPolicy_shouldPerformMajorCompaction_rdh | /* @param filesToCompact Files to compact. Can be null.
@return True if we should run a major compaction.
*/
@Override
public boolean shouldPerformMajorCompaction(Collection<HStoreFile> filesToCompact) throws IOException {
boolean result = false;
long mcTime = getNextMajorCompactTime(filesToCompact);
if ((... | 3.26 |
hbase_RatioBasedCompactionPolicy_applyCompactionPolicy_rdh | /**
* -- Default minor compaction selection algorithm: choose CompactSelection from candidates --
* First exclude bulk-load files if indicated in configuration. Start at the oldest file and stop
* when you find the first file that meets compaction criteria: (1) a recently-flushed, small file
* (i.e. <= minCompactSi... | 3.26 |
hbase_RatioBasedCompactionPolicy_setMinThreshold_rdh | /**
* Overwrite min threshold for compaction
*/
public void setMinThreshold(int minThreshold) {
comConf.setMinFilesToCompact(minThreshold);
} | 3.26 |
hbase_FilterListBase_filterRowCells_rdh | /**
* Filters that never filter by modifying the returned List of Cells can inherit this
* implementation that does nothing. {@inheritDoc }
*/@Override
public void filterRowCells(List<Cell> cells) throws IOException {
for (int i = 0, n = filters.size(); i < n; i++) {
filters.get(i).filterRowCells(cells)... | 3.26 |
hbase_FilterListBase_transformCell_rdh | /**
* For FilterList, we can consider a filter list as a node in a tree. sub-filters of the filter
* list are children of the relative node. The logic of transforming cell of a filter list, well,
* we can consider it as the process of post-order tree traverse. For a node , before we traverse
* the current child, we... | 3.26 |
hbase_FutureUtils_get_rdh | /**
* A helper class for getting the result of a Future with timeout, and convert the error to an
* {@link IOException}.
*/
public static <T> T get(Future<T> future, long timeout, TimeUnit unit) throws IOException {
try {
return future.get(timeout, unit);
} catch (InterruptedException e) {throw ((IO... | 3.26 |
hbase_FutureUtils_allOf_rdh | /**
* Returns a new CompletableFuture that is completed when all of the given CompletableFutures
* complete. If any of the given CompletableFutures complete exceptionally, then the returned
* CompletableFuture also does so, with a CompletionException holding this exception as its cause.
* Otherwise, the results of ... | 3.26 |
hbase_FutureUtils_consume_rdh | /**
* Log the error if the future indicates any failure.
*/
public static void consume(CompletableFuture<?> future) {
addListener(future, (r, e) -> {
if (e != null) {
LOG.warn("Async operation fails", e);
}
});
} | 3.26 |
hbase_FutureUtils_wrapFuture_rdh | /**
* Return a {@link CompletableFuture} which is same with the given {@code future}, but execute all
* the callbacks in the given {@code executor}.
*/
public static <T> CompletableFuture<T> wrapFuture(CompletableFuture<T> future, Executor executor) {
CompletableFuture<T> wrappedFuture = new CompletableFuture<>... | 3.26 |
hbase_FutureUtils_failedFuture_rdh | /**
* Returns a CompletableFuture that is already completed exceptionally with the given exception.
*/
public static <T> CompletableFuture<T> failedFuture(Throwable e) {
CompletableFuture<T> future =
new CompletableFuture<>();
future.completeExceptionally(e);
return future;
} | 3.26 |
hbase_FutureUtils_addListener_rdh | /**
* Almost the same with {@link #addListener(CompletableFuture, BiConsumer)} method above, the only
* exception is that we will call
* {@link CompletableFuture#whenCompleteAsync(BiConsumer, Executor)}.
*
* @see #addListener(CompletableFuture, BiConsumer)
*/
@SuppressWarnings("FutureReturnValueIgnored")
public s... | 3.26 |
hbase_FutureUtils_setStackTrace_rdh | // the CompletableFuture will have a stack trace starting from the root of the retry timer. If we
// just throw this exception out when calling future.get(by unwrapping the ExecutionException),
// the upper layer even can not know where is the exception thrown...
// See HBASE-22316.
private static void setStackTrace(Th... | 3.26 |
hbase_FutureUtils_unwrapCompletionException_rdh | /**
* Get the cause of the {@link Throwable} if it is a {@link CompletionException}.
*/
public static Throwable unwrapCompletionException(Throwable error) {
if (error instanceof CompletionException) {
Throwable v1 = error.getCause();
if (v1 != null) {
return v1;
}
... | 3.26 |
hbase_WALPlayer_main_rdh | /**
* Main entry point.
*
* @param args
* The command line parameters.
* @throws Exception
* When running the job fails.
*/
public static void main(String[] args) throws Exception {
int ret = ToolRunner.run(new WALPlayer(HBaseConfiguration.create()), args);
System.exit(ret);
} | 3.26 |
hbase_WALPlayer_createSubmittableJob_rdh | /**
* Sets up the actual job.
*
* @param args
* The command line parameters.
* @return The newly created job.
* @throws IOException
* When setting up the job fails.
*/
public Job createSubmittableJob(String[] args) throws IOException { Configuration conf = getConf();
setupTime(conf, WALInputFormat.START... | 3.26 |
hbase_WALPlayer_usage_rdh | /**
* Print usage
*
* @param errorMsg
* Error message. Can be null.
*/
private void usage(final String errorMsg) {
if ((errorMsg != null) && (errorMsg.length() > 0)) {
System.err.println("ERROR: " + errorMsg);
}
System.err.println(("Usage: " + NAME) + " [options] <WAL inputdir> [<tables> <tableMappings>]");
Sy... | 3.26 |
hbase_ScanWildcardColumnTracker_done_rdh | /**
* We can never know a-priori if we are done, so always return false.
*/
@Override
public boolean done() {
return false;
} | 3.26 |
hbase_ScanWildcardColumnTracker_checkColumn_rdh | /**
* {@inheritDoc } This receives puts *and* deletes.
*/
@Override
public MatchCode checkColumn(Cell cell, byte type) throws IOException {
return MatchCode.INCLUDE;
} | 3.26 |
hbase_ScanWildcardColumnTracker_checkVersion_rdh | /**
* Check whether this version should be retained. There are 4 variables considered: If this
* version is past max versions -> skip it If this kv has expired or was deleted, check min
* versions to decide whther to skip it or not. Increase the version counter unless this is a
... | 3.26 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.