name stringlengths 12 178 | code_snippet stringlengths 8 36.5k | score float64 3.26 3.68 |
|---|---|---|
hbase_Procedure_updateTimestamp_rdh | /**
* Called by ProcedureExecutor after each time a procedure step is executed.
*/protected void updateTimestamp() {
this.lastUpdate = EnvironmentEdgeManager.currentTime();
} | 3.26 |
hbase_Procedure_setChildrenLatch_rdh | /**
* Called by the ProcedureExecutor on procedure-load to restore the latch state
*/
protected synchronized void setChildrenLatch(int numChildren) {
this.childrenLatch = numChildren;if (LOG.isTraceEnabled()) { LOG.trace("CHILD LATCH INCREMENT SET " + this.childrenLatch, new Throwable(this.toString()));
}
... | 3.26 |
hbase_Procedure_setNonceKey_rdh | /**
* Called by the ProcedureExecutor to set the value to the newly created procedure.
*/
protected void setNonceKey(NonceKey nonceKey) {
this.nonceKey = nonceKey;
} | 3.26 |
hbase_Procedure_getTimeoutTimestamp_rdh | /**
* Timeout of the next timeout. Called by the ProcedureExecutor if the procedure has timeout set
* and the procedure is in the waiting queue.
*
* @return the timestamp of the next timeout.
*/
protected long getTimeoutTimestamp() {
return getLastUpdate() + getTimeout();} | 3.26 |
hbase_Procedure_afterReplay_rdh | /**
* Called when the procedure is ready to be added to the queue after the loading/replay operation.
*/
protected void afterReplay(TEnvironment env) {
// no-op
} | 3.26 |
hbase_Procedure_isFailed_rdh | /**
* Returns true if the procedure has failed. It may or may not have rolled back.
*/
public synchronized boolean isFailed() {
return (state == ProcedureState.FAILED) || (state == ProcedureState.ROLLEDBACK);
} | 3.26 |
hbase_Procedure_getProcIdHashCode_rdh | // ==========================================================================
// misc utils
// ==========================================================================
/**
* Get an hashcode for the specified Procedure ID
*
* @return the hashcode for the specified procId
*/
public static long getProcIdHashCode(lon... | 3.26 |
hbase_Procedure_childrenCountDown_rdh | /**
* Called by the ProcedureExecutor to notify that one of the sub-procedures has completed.
*/
private synchronized boolean childrenCountDown() {
assert childrenLatch > 0 : this;
boolean b = (--childrenLatch) == 0;
if (LOG.isTraceEnabled()) {
LOG.trace("CHILD LATCH DECREMENT " + childrenLatch, n... | 3.26 |
hbase_Procedure_waitInitialized_rdh | /**
* The {@link #doAcquireLock(Object, ProcedureStore)} will be split into two steps, first, it will
* call us to determine whether we need to wait for initialization, second, it will call
* {@link #acquireLock(Object)} to actually handle the lock for this procedure.
* <p/>
* This is because that when master rest... | 3.26 |
hbase_Procedure_haveSameParent_rdh | /**
*
* @param a
* the first procedure to be compared.
* @param b
* the second procedure to be compared.
* @return true if the two procedures have the same parent
*/
public static boolean haveSamePar... | 3.26 |
hbase_Procedure_toStringClassDetails_rdh | /**
* Extend the toString() information with the procedure details e.g. className and parameters
*
* @param builder
* the string builder to use to append the proc specific information
*/
protected void toStringClassDetails(StringBuilder builder) {
builder.append(getClass().getName());} | 3.26 |
hbase_Procedure_updateMetricsOnFinish_rdh | /**
* This function will be called just after procedure execution is finished. Override this method
* to update metrics at the end of the procedure. If {@link #getProcedureMetrics(Object)} returns
* non-null {@link ProcedureMetrics}, the default implementation adds runtime of a procedure to a
* time histogram for s... | 3.26 |
hbase_Procedure_setLastUpdate_rdh | /**
* Called on store load to initialize the Procedure internals after the creation/deserialization.
*/
protected void setLastUpdate(long lastUpdate) {
this.lastUpdate = lastUpdate;
} | 3.26 |
hbase_Procedure_isSuccess_rdh | /**
* Returns true if the procedure is finished successfully.
*/
public synchronized boolean isSuccess() {return (state == ProcedureState.SUCCESS) && (!hasException());
} | 3.26 |
hbase_Procedure_completionCleanup_rdh | /**
* Called when the procedure is marked as completed (success or rollback). The procedure
* implementor may use this method to cleanup in-memory states. This operation will not be retried
* on failure. If a procedure took a lock, it will have been released when this method runs.
*/
protected void completionCleanu... | 3.26 |
hbase_Procedure_getRootProcedureId_rdh | /**
* Helper to lookup the root Procedure ID given a specified procedure.
*/
protected static <T> Long getRootProcedureId(Map<Long, Procedure<T>> procedures, Procedure<T> proc) {
while (proc.hasParent()) {
proc = procedures.get(proc.getParentProcId());
if (proc == null) {
return null... | 3.26 |
hbase_Procedure_lockedWhenLoading_rdh | /**
* Will only be called when loading procedures from procedure store, where we need to record
* whether the procedure has already held a lock. Later we will call {@link #restoreLock(Object)}
* to actually acquire the lock.
*/
final void lockedWhenLoading() {
this.lockedWhenLoading = true;
} | 3.26 |
hbase_Procedure_doRollback_rdh | /**
* Internal method called by the ProcedureExecutor that starts the user-level code rollback().
*/
protected void doRollback(TEnvironment env) throws IOException, InterruptedException {
try {
updateTimestamp();
if (bypass) {
LOG.info("{} bypassed, skipping rollback", this);
... | 3.26 |
hbase_Procedure_isLockedWhenLoading_rdh | /**
* Can only be called when restarting, before the procedure actually being executed, as after we
* actually call the {@link #doAcquireLock(Object, ProcedureStore)} method, we will reset
* {@link #lockedWhenLoading} to false.
* <p/>
* Now it is only used in the ProcedureScheduler to determine whether we should p... | 3.26 |
hbase_Procedure_incChildrenLatch_rdh | /**
* Called by the ProcedureExecutor on procedure-load to restore the latch state
*/
protected synchronized void incChildrenLatch() {
// TODO: can this be inferred from the stack? I think so...
this.childrenLatch++;
if (LOG.isTraceEnabled()) {
LOG.trace("CHILD LATCH INCREMENT " + this.childrenLat... | 3.26 |
hbase_Procedure_isWaiting_rdh | /**
* Returns true if the procedure is waiting for a child to finish or for an external event.
*/
public synchronized boolean isWaiting() {
switch (state) {
case WAITING :
case WAITING_TIMEOUT :
return true;
default :
break;
}
return ... | 3.26 |
hbase_Procedure_acquireLock_rdh | /**
* The user should override this method if they need a lock on an Entity. A lock can be anything,
* and it is up to the implementor. The Procedure Framework will call this method just before it
* invokes {@link #execute(Object)}. It calls {@link #releaseLock(Object)} after the call to
* execute.
* <p/>
* If yo... | 3.26 |
hbase_Procedure_getProcedureMetrics_rdh | /**
* Override this method to provide procedure specific counters for submitted count, failed count
* and time histogram.
*
* @param env
* The environment passed to the procedure executor
* @return Container object for procedure related metric
*/
protected ProcedureMetrics getProcedureMetrics(TEnvironment env)... | 3.26 |
hbase_Procedure_beforeReplay_rdh | /**
* Called when the procedure is loaded for replay. The procedure implementor may use this method
* to perform some quick operation before replay. e.g. failing the procedure if the state on
* replay may be unknown.
*/
protected void beforeReplay(TEnvironment env) {
// no-op
} | 3.26 |
hbase_Procedure_doAcquireLock_rdh | /**
* Internal method called by the ProcedureExecutor that starts the user-level code acquireLock().
*/
final LockState doAcquireLock(TEnvironment env, ProcedureStore store) {
if (waitInitialized(env)) {
return LockState.LOCK_EVENT_WAIT;
}
if (lockedWhenLoading) {
// reset it so we wil... | 3.26 |
hbase_Procedure_holdLock_rdh | /**
* Used to keep the procedure lock even when the procedure is yielding or suspended.
*
* @return true if the procedure should hold on the lock until completionCleanup()
*/
protected boolean holdLock(TEnvironment env) {
return false;
} | 3.26 |
hbase_Procedure_getProcId_rdh | // ==========================================================================
// Those fields are unchanged after initialization.
//
// Each procedure will get created from the user or during
// ProcedureExecutor.start() during the load() phase and then submitted
// to t... | 3.26 |
hbase_Procedure_toStringState_rdh | /**
* Called from {@link #toString()} when interpolating {@link Procedure} State. Allows decorating
* generic Procedure State with Procedure particulars.
*
* @param builder
* Append current {@link ProcedureState}
*/
protected void toStringState(StringBuilder builder)
{
builder.append(getState());
} | 3.26 |
hbase_Procedure_setParentProcId_rdh | /**
* Called by the ProcedureExecutor to assign the parent to the newly created procedure.
*/
protected void setParentProcId(long parentProcId) {
this.parentProcId = parentProcId;
} | 3.26 |
hbase_Procedure_setResult_rdh | /**
* The procedure may leave a "result" on completion.
*
* @param result
* the serialized result that will be passed to the client
*/
protected void setResult(byte[] result) {
this.result = result;
} | 3.26 |
hbase_Procedure_updateMetricsOnSubmit_rdh | /**
* This function will be called just when procedure is submitted for execution. Override this
* method to update the metrics at the beginning of the procedure. The default implementation
* updates submitted counter if {@link #getProcedureMetrics(Object)} returns non-null
* {@link ProcedureMetrics}.
*/
protected... | 3.26 |
hbase_SnappyCodec_isLoaded_rdh | /**
* Return true if the native shared libraries were loaded; false otherwise.
*/
public static boolean isLoaded() {
return loaded;
} | 3.26 |
hbase_SnappyCodec_getBufferSize_rdh | // Package private
static int getBufferSize(Configuration conf) {
return conf.getInt(SNAPPY_BUFFER_SIZE_KEY, conf.getInt(CommonConfigurationKeys.IO_COMPRESSION_CODEC_SNAPPY_BUFFERSIZE_KEY, CommonConfigurationKeys.IO_COMPRESSION_CODEC_SNAPPY_BUFFERSIZE_DEFAULT));
} | 3.26 |
hbase_DisableTableProcedure_holdLock_rdh | // For disabling a table, we does not care whether a region can be online so hold the table xlock
// for ever. This will simplify the logic as we will not be conflict with procedures other than
// SCP.
@Overrideprotected boolean holdLock(MasterProcedureEnv env) {
return true;
} | 3.26 |
hbase_DisableTableProcedure_prepareDisable_rdh | /**
* Action before any real action of disabling table. Set the exception in the procedure instead of
* throwing it. This approach is to deal with backward compatible with 1.0.
*
* @param env
* MasterProcedureEnv
*/
private boolean prepareDisable(final MasterProcedureEnv env) throws IOException {
boolean canTab... | 3.26 |
hbase_DisableTableProcedure_postDisable_rdh | /**
* Action after disabling table.
*
* @param env
* MasterProcedureEnv
* @param state
* the procedure state
*/
protected void postDisable(final MasterProcedureEnv env, final DisableTableState state) throws IOException, InterruptedException {
runCoprocessorAction(env, state);
} | 3.26 |
hbase_DisableTableProcedure_runCoprocessorAction_rdh | /**
* Coprocessor Action.
*
* @param env
* MasterProcedureEnv
* @param state
* the procedure state
*/
private void runCoprocessorAction(final MasterProcedureEnv env, final DisableTableState state) throws IOException, InterruptedException {
final MasterCoprocessorHost cpHost = env.getMasterCoprocessorHost();... | 3.26 |
hbase_DisableTableProcedure_preDisable_rdh | /**
* Action before disabling table.
*
* @param env
* MasterProcedureEnv
* @param state
* the procedure state
*/
protected void preDisable(final MasterProcedureEnv env, final DisableTableState state) throws IOException, InterruptedException {
runCoprocessorAction(env, state);
} | 3.26 |
hbase_DisableTableProcedure_setTableStateToDisabled_rdh | /**
* Mark table state to Disabled
*
* @param env
* MasterProcedureEnv
*/
protected static void setTableStateToDisabled(final MasterProcedureEnv env, final TableName tableName) throws IOException {
// Flip the table to disabled
env.getMasterServices().getTableStateManager().setTableState(tableName, State.DISABL... | 3.26 |
hbase_DisableTableProcedure_setTableStateToDisabling_rdh | /**
* Mark table state to Disabling
*
* @param env
* MasterProcedureEnv
*/
private static void setTableStateToDisabling(final
MasterProcedureEnv env, final TableName tableName) throws IOException {
// Set table disabling flag up in zk.
env.getMasterServices().getTableStateManager().setTableState(tableName, Stat... | 3.26 |
hbase_ChoreService_printChoreDetails_rdh | /**
* Prints a summary of important details about the chore. Used for debugging purposes
*/
private void printChoreDetails(final String header, ScheduledChore chore) {
if (!LOG.isTraceEnabled()) {
return;
}
LinkedHashMap<String, String> output = new LinkedHashMap<>();
output.put(header, "");
... | 3.26 |
hbase_ChoreService_requestCorePoolIncrease_rdh | /**
* Represents a request to increase the number of core pool threads. Typically a request
* originates from the fact that the current core pool size is not sufficient to service all of
* the currently running Chores
*
* @return true when the request to increase the core pool size succeeds
*/
private synchronize... | 3.26 |
hbase_ChoreService_cancelChore_rdh | /**
* Cancel any ongoing schedules that this chore has with the implementer of this interface.
* <p/>
* Call {@link ScheduledChore#cancel(boolean)} to cancel a {@link ScheduledChore}, in
* {@link ScheduledChore#cancel(boolean)} method we will call this method to remove the
* {@link ScheduledChore} from this {@link... | 3.26 |
hbase_ChoreService_printChoreServiceDetails_rdh | /**
* Prints a summary of important details about the service. Used for debugging purposes
*/
private void printChoreServiceDetails(final String header) {
if (!LOG.isTraceEnabled()) {
return;
}
LinkedHashMap<String, String> output = new
LinkedHashMap<>();
output.put(header, "");
outp... | 3.26 |
hbase_ChoreService_requestCorePoolDecrease_rdh | /**
* Represents a request to decrease the number of core pool threads. Typically a request
* originates from the fact that the current core pool size is more than sufficient to service the
* running Chores.
*/
private synchronized void requestCorePoolDecrease() {
... | 3.26 |
hbase_ChoreService_getNumberOfScheduledChores_rdh | /**
* Returns number of chores that this service currently has scheduled
*/
int getNumberOfScheduledChores() {
return scheduledChores.size();
} | 3.26 |
hbase_ChoreService_isChoreScheduled_rdh | /**
* Returns true when the chore is scheduled with the implementer of this interface
*/
@InterfaceAudience.Private
public synchronized boolean isChoreScheduled(ScheduledChore chore) {
return ((chore != null) &&
scheduledChores.containsKey(chore)) && (!scheduledChores.get(chore).isDone());
} | 3.26 |
hbase_ChoreService_onChoreMissedStartTime_rdh | /**
* A callback that tells the implementer of this interface that one of the scheduled chores is
* missing its start time. The implication of a chore missing its start time is that the service's
* current means of scheduling may not be sufficient to handle the number of ongoing chores (the
* other explanation is t... | 3.26 |
hbase_ChoreService_isTerminated_rdh | /**
* Returns true when the service is shutdown and all threads have terminated
*/
public boolean isTerminated() {return scheduler.isTerminated();
} | 3.26 |
hbase_ChoreService_getNumberOfChoresMissingStartTime_rdh | /**
* Return number of chores that this service currently has scheduled that are missing their
* scheduled start time
*/
int getNumberOfChoresMissingStartTime() {
return
choresMissingStartTime.size();
} | 3.26 |
hbase_ChoreService_shutdown_rdh | /**
* Shut down the service. Any chores that are scheduled for execution will be cancelled. Any
* chores in the middle of execution will be interrupted and shutdown. This service will be
* unusable after this method has been called (i.e. future scheduling attempts will fail).
* <p/>
* Notice that, this will only c... | 3.26 |
hbase_ChoreService_getCorePoolSize_rdh | /**
* Returns number of threads in the core pool of the underlying ScheduledThreadPoolExecutor
*/
int getCorePoolSize() { return scheduler.getCorePoolSize();
} | 3.26 |
hbase_ChoreService_isShutdown_rdh | /**
* Returns true when the service is shutdown and thus cannot be used anymore
*/
public boolean isShutdown() {
return scheduler.isShutdown();
} | 3.26 |
hbase_ChoreService_rescheduleChore_rdh | /**
*
* @param chore
* The Chore to be rescheduled. If the chore is not scheduled with this ChoreService
* yet then this call is equivalent to a call to scheduleChore.
*/
private void rescheduleChore(ScheduledChore chore, boolean immediately) {
... | 3.26 |
hbase_FastPathBalancedQueueRpcExecutor_popReadyHandler_rdh | /**
* Returns Pop a Handler instance if one available ready-to-go or else return null.
*/
private FastPathRpcHandler popReadyHandler() {
return this.fastPathHandlerStack.poll();
} | 3.26 |
hbase_BackupManager_close_rdh | /**
* Stop all the work of backup.
*/
@Override
public void close() {
if (systemTable != null) { try {
systemTable.close();
} catch (Exception e) {
LOG.error(e.toString(), e);
}
}
} | 3.26 |
hbase_BackupManager_getBackupHistory_rdh | /**
* Get all completed backup information (in desc order by time)
*
* @return history info of BackupCompleteData
* @throws IOException
* exception
*/
public List<BackupInfo> getBackupHistory() throws IOException {
return systemTable.getBackupHistory();} | 3.26 |
hbase_BackupManager_readBackupStartCode_rdh | /**
* Read the last backup start code (timestamp) of last successful backup. Will return null if
* there is no startcode stored in backup system table or the value is of length 0. These two
* cases indicate there is no successful backup completed so far.
*
* @return the timestamp of a last successful backup
* @th... | 3.26 |
hbase_BackupManager_readRegionServerLastLogRollResult_rdh | /**
* Get the RS log information after the last log roll from backup system table.
*
* @return RS log info
* @throws IOException
* exception
*/
public HashMap<String, Long> readRegionServerLastLogRollResult() throws IOException {
return systemTable.readRegionServerLastLogRollResult(backupInfo.getBackupRootD... | 3.26 |
hbase_BackupManager_writeBackupStartCode_rdh | /**
* Write the start code (timestamp) to backup system table. If passed in null, then write 0 byte.
*
* @param startCode
* start code
* @throws IOException
* exception
*/
public void writeBackupStartCode(Long startCode) throws IOException {
systemTable.writeBackupStartCode(startCode, backupInfo.getBacku... | 3.26 |
hbase_BackupManager_initialize_rdh | /**
* Start the backup manager service.
*
* @throws IOException
* exception
*/
public void initialize() throws IOException {
String ongoingBackupId = this.getOngoingBackupId();
if (ongoingBackupId != null) {
LOG.info("There is a ongoing backup {}" + ". Can not launch new backup until no ongoing b... | 3.26 |
hbase_BackupManager_getBackupInfo_rdh | /**
* Returns backup info
*/
protected BackupInfo getBackupInfo() {
return backupInfo;
} | 3.26 |
hbase_BackupManager_m2_rdh | /**
* Adds set of tables to overall incremental backup table set
*
* @param tables
* tables
* @throws IOException
* exception
*/
public void m2(Set<TableName> tables) throws IOException {
systemTable.addIncrementalBackupTableSet(tables, backupInfo.getBackupRootDir());
} | 3.26 |
hbase_BackupManager_finishBackupSession_rdh | /**
* Finishes active backup session
*
* @throws IOException
* if no active session
*/
public void finishBackupSession() throws IOException {
systemTable.finishBackupExclusiveOperation();} | 3.26 |
hbase_BackupManager_m0_rdh | /**
* Get the direct ancestors of this backup for one table involved.
*
* @param backupInfo
* backup info
* @param table
* table
* @return backupImages on the dependency list
* @throws IOException
* exception
*/
public ArrayList<BackupImage> m0(BackupInfo backupInfo, TableName table) throws IOException ... | 3.26 |
hbase_BackupManager_updateBackupInfo_rdh | /* backup system table operations */
/**
* Updates status (state) of a backup session in a persistent store
*
* @param context
* context
* @throws IOException
* exception
*/
public void updateBackupInfo(BackupInfo context) throws IOException {
systemTable.updateBackupInfo(context);
} | 3.26 |
hbase_BackupManager_getConf_rdh | /**
* Get configuration
*/
Configuration getConf() {
return conf;
} | 3.26 |
hbase_BackupManager_startBackupSession_rdh | /**
* Starts new backup session
*
* @throws IOException
* if active session already exists
*/
public void startBackupSession() throws IOException {
long startTime = EnvironmentEdgeManager.currentTime();
long timeout = conf.getInt(BACKUP_EXCLUSIVE_OPERATION_TIMEOUT_SECONDS_KEY, DEFAULT_BACKUP_EXCLUSIVE_O... | 3.26 |
hbase_BackupManager_createBackupInfo_rdh | /**
* Creates a backup info based on input backup request.
*
* @param backupId
* backup id
* @param type
* type
* @param tableList
* table list
* @param targetRootDir
* root dir
* @param workers
* number of parallel workers
* @param bandwidth
* bandwidth per worker in MB per sec
* @throws Bac... | 3.26 |
hbase_BackupManager_getAncestors_rdh | /**
* Get direct ancestors of the current backup.
*
* @param backupInfo
* The backup info for the current backup
* @return The ancestors for the current backup
* @throws IOException
* exception
*/
public ArrayList<BackupImage> getAncestors(BackupInfo backupInfo) throws IOException {
LOG.debug("Getting t... | 3.26 |
hbase_BackupManager_writeRegionServerLogTimestamp_rdh | /**
* Write the current timestamps for each regionserver to backup system table after a successful
* full or incremental backup. Each table may have a different set of log timestamps. The saved
* timestamp is of the last log file that was backed up already.
*
* @param tables
* tables
* @throws IOException
* ... | 3.26 |
hbase_BackupManager_decorateMasterConfiguration_rdh | /**
* This method modifies the master's configuration in order to inject backup-related features
* (TESTs only)
*
* @param conf
* configuration
*/
public static void decorateMasterConfiguration(Configuration conf) {
if (!isBackupEnabled(conf)) {
return;
}
// Add WAL archive cleaner plug-in
... | 3.26 |
hbase_BackupManager_decorateRegionServerConfiguration_rdh | /**
* This method modifies the Region Server configuration in order to inject backup-related features
* TESTs only.
*
* @param conf
* configuration
*/
public static void decorateRegionServerConfiguration(Configuration conf) {
if (!isBackupEnabled(conf)) {
return;
}
String classes... | 3.26 |
hbase_BackupManager_getOngoingBackupId_rdh | /**
* Check if any ongoing backup. Currently, we only reply on checking status in backup system
* table. We need to consider to handle the case of orphan records in the future. Otherwise, all
* the coming request will fail.
*
* @return the ongoing backup id if on going backup exists, otherwise null
* @throws IOEx... | 3.26 |
hbase_RegionMetrics_getNameAsString_rdh | /**
* Returns the region name as a string
*/
default String getNameAsString() {
return Bytes.toStringBinary(getRegionName());
} | 3.26 |
hbase_RegionMetrics_getRequestCount_rdh | /**
* Returns the number of write requests and read requests and coprocessor service requests made to
* region
*/
default long getRequestCount() {
return (getReadRequestCount() + getWriteRequestCount()) + getCpRequestCount();
} | 3.26 |
hbase_MetricsHBaseServerSourceFactory_createContextName_rdh | /**
* From the name of the class that's starting up create the context that an IPC source should
* register itself.
*
* @param serverName
* The name of the class that's starting up.
* @return The Camel Cased context name.
*/protected static String createContextName(String serverName) {
if (serverName.start... | 3.26 |
hbase_SnapshotVerifyProcedure_m1_rdh | // we will wrap remote exception into a RemoteProcedureException,
// here we try to unwrap it
private Throwable m1(RemoteProcedureException e) {
return e.getCause();
} | 3.26 |
hbase_BulkLoadCellFilter_filterCell_rdh | /**
* Filters the bulk load cell using the supplied predicate.
*
* @param cell
* The WAL cell to filter.
* @param famPredicate
* Returns true of given family should be removed.
* @return The filtered cell.
*/
public Cell filterCell(Cell cell, Predicate<byte[]> famPredicate) {
byte[] fam;
BulkLoadD... | 3.26 |
hbase_MetricSampleQuantiles_clear_rdh | /**
* Resets the estimator, clearing out all previously inserted items
*/
public synchronized void clear() {
count = 0;
bufferCount = 0;
samples.clear();
} | 3.26 |
hbase_MetricSampleQuantiles_allowableError_rdh | /**
* Specifies the allowable error for this rank, depending on which quantiles are being targeted.
* This is the f(r_i, n) function from the CKMS paper. It's basically how wide the range of this
* rank can be. the index in the list of samples
*/
private double allowableError(int rank) {
int size = samples.size... | 3.26 |
hbase_MetricSampleQuantiles_getCount_rdh | /**
* Returns the number of items that the estimator has processed
*
* @return count total number of items processed
*/
public synchronized long getCount() {
return count;
} | 3.26 |
hbase_MetricSampleQuantiles_getSampleCount_rdh | /**
* Returns the number of samples kept by the estimator
*
* @return count current number of samples
*/
public synchronized int getSampleCount() {
return samples.size();
} | 3.26 |
hbase_MetricSampleQuantiles_query_rdh | /**
* Get the estimated value at the specified quantile.
*
* @param quantile
* Queried quantile, e.g. 0.50 or 0.99.
* @return Estimated value at that quantile.
*/
private long query(double quantile) throws IOException
{
if (samples.isEmpty()) {
throw new IOException("No samples present");
}
... | 3.26 |
hbase_MetricSampleQuantiles_compress_rdh | /**
* Try to remove extraneous items from the set of sampled items. This checks if an item is
* unnecessary based on the desired error bounds, and merges it with the adjacent item if it is.
*/
private void compress() {
if (samples.size() < 2) {
return;
}
ListIterator<SampleItem> it = samples.list... | 3.26 |
hbase_MetricSampleQuantiles_insert_rdh | /**
* Add a new value from the stream.
*
* @param v
* the value to insert
*/
public synchronized void insert(long v) {
buffer[bufferCount] = v;
bufferCount++;
count++;
if (bufferCount == buffer.length) {
insertBatch();
compress();
}
} | 3.26 |
hbase_MetricSampleQuantiles_snapshot_rdh | /**
* Get a snapshot of the current values of all the tracked quantiles.
*
* @return snapshot of the tracked quantiles if no items have been added to the estimator
*/
public synchronized Map<MetricQuantile, Long> snapshot() throws IOException {
// flush the buffer first for best results
insertBatch();
M... | 3.26 |
hbase_CellFlatMap_navigableKeySet_rdh | // -------------------------------- Sub-Sets --------------------------------
@Override
public NavigableSet<Cell> navigableKeySet() {
throw new UnsupportedOperationException();
} | 3.26 |
hbase_CellFlatMap_put_rdh | // -------------------------------- Updates --------------------------------
// All updating methods below are unsupported.
// Assuming an array of Cells will be allocated externally,
// fill up with Cells and provided in construction time.
// Later the structure is immutable.
@Override
public Cell put(Cell k, Cell
v) ... | 3.26 |
hbase_CellFlatMap_firstKey_rdh | // -------------------------------- Key's getters --------------------------------
@Override
public Cell firstKey() {
if (isEmpty()) {
return null;
}
return descending ? getCell(maxCellIdx - 1) : getCell(minCellIdx);
} | 3.26 |
hbase_CellFlatMap_pollFirstEntry_rdh | // The following 2 methods (pollFirstEntry, pollLastEntry) are unsupported because these are
// updating methods.
@Override
public Entry<Cell, Cell> pollFirstEntry() {
throw new UnsupportedOperationException();
} | 3.26 |
hbase_CellFlatMap_find_rdh | /**
* Binary search for a given key in between given boundaries of the array. Positive returned
* numbers mean the index. Negative returned numbers means the key not found. The absolute value
* of the output is the possible insert index for the searched key In twos-complement, (-1 *
* insertion ... | 3.26 |
hbase_CellFlatMap_subMap_rdh | // ---------------- Sub-Maps ----------------
@Override
public NavigableMap<Cell, Cell> subMap(Cell fromKey, boolean fromInclusive, Cell toKey, boolean toInclusive) {
final int lessCellIndex = getValidIndex(fromKey, fromInclusive, true);
final int greaterCellIndex = getValidIndex(toKey, toInclusive, false);
... | 3.26 |
hbase_CellFlatMap_getValidIndex_rdh | /**
* Get the index of the given anchor key for creating subsequent set. It doesn't matter whether
* the given key exists in the set or not. taking into consideration whether the key should be
* inclusive or exclusive.
*/
private int getValidIndex(Cell key, boolean inclusive, boolean tail) {
final int index = find(... | 3.26 |
hbase_BaseReplicationEndpoint_getScopeWALEntryFilter_rdh | /**
* Returns a WALEntryFilter for checking the scope. Subclasses can return null if they don't want
* this filter
*/protected WALEntryFilter getScopeWALEntryFilter() {
return new ScopeWALEntryFilter();
} | 3.26 |
hbase_BaseReplicationEndpoint_getNamespaceTableCfWALEntryFilter_rdh | /**
* Returns a WALEntryFilter for checking replication per table and CF. Subclasses can return null
* if they don't want this filter
*/
protected WALEntryFilter getNamespaceTableCfWALEntryFilter() {
return new NamespaceTableCfWALEntryFilter(f0.getReplicationPeer());
} | 3.26 |
hbase_BaseReplicationEndpoint_getWALEntryfilter_rdh | /**
* Returns a default set of filters
*/
@Override
public WALEntryFilter getWALEntryfilter() {
ArrayList<WALEntryFilter> filters = Lists.newArrayList();
WALEntryFilter scopeFilter = getScopeWALEntryFilter();
if (scopeFilter != null) {
filters.add(scopeFilter);
}
WALEntryFilter tableCfFilter ... | 3.26 |
hbase_BaseReplicationEndpoint_peerConfigUpdated_rdh | /**
* No-op implementation for subclasses to override if they wish to execute logic if their config
* changes
*/
@Override
public void peerConfigUpdated(ReplicationPeerConfig rpc) {
} | 3.26 |
hbase_RegionServerObserver_postClearCompactionQueues_rdh | /**
* This will be called after clearing compaction queues
*
* @param ctx
* the environment to interact with the framework and region server.
*/
default void postClearCompactionQueues(final ObserverContext<RegionServerCoprocessorEnvironment> ctx) throws IOException {
} | 3.26 |
hbase_RegionServerObserver_preRollWALWriterRequest_rdh | /**
* This will be called before executing user request to roll a region server WAL.
*
* @param ctx
* the environment to interact with the framework and region server.
*/
default void preRollWALWriterRequest(final ObserverContext<RegionServerCoprocessorEnvironment> ctx) throws IOException {
} | 3.26 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.