name stringlengths 12 178 | code_snippet stringlengths 8 36.5k | score float64 3.26 3.68 |
|---|---|---|
hbase_ReplicationBarrierCleaner_chore_rdh | // Public so can be run out of MasterRpcServices. Synchronized so only one
// running instance at a time.
@Override
public synchronized void chore() {
long totalRows = 0;
long cleanedRows = 0;
long deletedRows = 0;
long deletedBarriers = 0;
long deletedLastPushed... | 3.26 |
hbase_CatalogJanitor_getLastReport_rdh | /**
* Returns Returns last published Report that comes of last successful scan of hbase:meta.
*/
public CatalogJanitorReport getLastReport() {
return this.lastReport;
} | 3.26 |
hbase_CatalogJanitor_hasNoReferences_rdh | /**
*
* @param p
* A pair where the first boolean says whether or not the daughter region directory
* exists in the filesystem and then the second boolean says whether the daughter has
* references to the parent.
* @return True the passed <code>p</code> signifies no references.
*/
private static boolean ha... | 3.26 |
hbase_CatalogJanitor_cleanParent_rdh | /**
* If daughters no longer hold reference to the parents, delete the parent.
*
* @param parent
* RegionInfo of split offlined parent
* @param rowContent
* Content of <code>parent</code> row in <code>metaRegionName</code>
* @return True if we removed <code>parent</code> from meta table and from the filesyst... | 3.26 |
hbase_CatalogJanitor_scanForReport_rdh | /**
* Scan hbase:meta.
*
* @return Return generated {@link CatalogJanitorReport}
*/
// will be override in tests.
protected CatalogJanitorReport scanForReport() throws IOException {
ReportMakingVisitor visitor = new ReportMakingVisitor(this.services);
// Null tablename means scan all of meta.
MetaTableA... | 3.26 |
hbase_CatalogJanitor_main_rdh | /**
* For testing against a cluster. Doesn't have a MasterServices context so does not report on good
* vs bad servers.
*/
public static void main(String[] args) throws IOException {
checkLog4jProperties();
ReportMakingVisitor visitor = new ReportMakingVisitor(null);
Configuration configuration = HBaseCo... | 3.26 |
hbase_ServerRegionReplicaUtil_isRegionReplicaWaitForPrimaryFlushEnabled_rdh | /**
* Returns True if wait for primary to flush is enabled for user-space tables.
*/
public static boolean isRegionReplicaWaitForPrimaryFlushEnabled(Configuration conf) {
return conf.getBoolean(REGION_REPLICA_WAIT_FOR_PRIMARY_FLUSH_CONF_KEY, DEFAULT_REGION_REPLICA_WAIT_FOR_PRIMARY_FLUSH);
} | 3.26 |
hbase_ServerRegionReplicaUtil_shouldReplayRecoveredEdits_rdh | /**
* Returns whether to replay the recovered edits to flush the results. Currently secondary region
* replicas do not replay the edits, since it would cause flushes which might affect the primary
* region. Primary regions even opened in read only mode should replay the edits.
*
* @param region
* the HRegion ob... | 3.26 |
hbase_ServerRegionReplicaUtil_getRegionInfoForFs_rdh | /**
* Returns the regionInfo object to use for interacting with the file system.
*
* @return An RegionInfo object to interact with the filesystem
*/
public static RegionInfo getRegionInfoForFs(RegionInfo regionInfo) {
if (regionInfo == null) {
return null;
}
return RegionReplicaUtil.getRegionIn... | 3.26 |
hbase_ServerRegionReplicaUtil_isMetaRegionReplicaReplicationEnabled_rdh | /**
* Returns True if hbase:meta Region Read Replica is enabled.
*/
public static boolean isMetaRegionReplicaReplicationEnabled(Configuration conf, TableName tn) {
return TableName.isMetaTableName(tn) &&
conf.getBoolean(REGION_REPLICA_REPLICATION_CATALOG_CONF_KEY, DEFAULT_REGION_REPLICA_REPLICATION_CATALOG);
... | 3.26 |
hbase_ServerRegionReplicaUtil_getStoreFileInfo_rdh | /**
* Returns a StoreFileInfo from the given FileStatus. Secondary replicas refer to the files of the
* primary region, so an HFileLink is used to construct the StoreFileInfo. This way ensures that
* the secondary will be able to continue reading the store files even if they are moved to
* archive after compaction
... | 3.26 |
hbase_ServerRegionReplicaUtil_isRegionReplicaStoreFileRefreshEnabled_rdh | /**
* Returns True if we are to refresh user-space hfiles in Region Read Replicas.
*/
public static boolean isRegionReplicaStoreFileRefreshEnabled(Configuration conf) {
return conf.getBoolean(REGION_REPLICA_STORE_FILE_REFRESH, DEFAULT_REGION_REPLICA_STORE_FILE_REFRESH);
} | 3.26 |
hbase_ServerRegionReplicaUtil_isReadOnly_rdh | /**
* Returns whether this region replica can accept writes.
*
* @param region
* the HRegion object
* @return whether the replica is read only
*/
public static boolean isReadOnly(HRegion region) {
return region.getTableDescriptor().isReadOnly() || (!isDefaultReplica(region.getRegionInfo()));
} | 3.26 |
hbase_ServerRegionReplicaUtil_isRegionReplicaReplicationEnabled_rdh | /**
* Returns True if Region Read Replica is enabled for user-space tables.
*/
private static boolean isRegionReplicaReplicationEnabled(Configuration conf) {
return conf.getBoolean(REGION_REPLICA_REPLICATION_CONF_KEY, DEFAULT_REGION_REPLICA_REPLICATION);
} | 3.26 |
hbase_ExportSnapshot_getSnapshotFiles_rdh | // ==========================================================================
// Input Format
// ==========================================================================
/**
* Extract the list of files (HFiles/WALs) to copy using Map-Reduce.
*
* @return list of files referenced by the snapshot (pair of path and si... | 3.26 |
hbase_ExportSnapshot_doWork_rdh | /**
* Execute the export snapshot by copying the snapshot metadata, hfiles and wals.
*
* @return 0 on success, and != 0 upon failure.
*/
@Override
public int doWork()
throws IOException {
Configuration conf = getConf();
// Check user options
if (snapshotName == null) {
System.err.println("Snapshot name not provid... | 3.26 |
hbase_ExportSnapshot_createOutputPath_rdh | /**
* Create the output folder and optionally set ownership.
*/
private void
createOutputPath(final Path path) throws IOException {
if
((filesUser == null) && (filesGroup == null)) {
outputFs.mkdirs(path);
} else {
Path parent
... | 3.26 |
hbase_ExportSnapshot_runCopyJob_rdh | // ==========================================================================
// Tool
// ==========================================================================
/**
* Run Map-Reduce Job to perform the files copy.
*/
private void runCopyJob(final Path inputRoot, final Path outputRoot, final String snapshotName, fin... | 3.26 |
hbase_ExportSnapshot_getBalancedSplits_rdh | /**
* Given a list of file paths and sizes, create around ngroups in as balanced a way as possible.
* The groups created will have similar amounts of bytes.
* <p>
* The algorithm used is pretty straightforward; the file list is sorted by size, and then each
* group fetch the bigger file available, iterating throug... | 3.26 |
hbase_ExportSnapshot_sameFile_rdh | /**
* Check if the two files are equal by looking at the file length, and at the checksum (if user
* has specified the verifyChecksum flag).
*/
private boolean sameFile(final FileStatus inputStat, final FileStatus outputStat)
{
// Not matching length
if (inputStat.getLen() != outputStat.getLen())
r... | 3.26 |
hbase_ExportSnapshot_getOutputPath_rdh | /**
* Returns the location where the inputPath will be copied.
*/
private Path getOutputPath(final SnapshotFileInfo inputInfo) throws IOException {
Path path =
null;
switch (inputInfo.getType()) {
case HFILE :
Path inputPath = new Path(inputInfo.getHfile());
String family... | 3.26 |
hbase_ExportSnapshot_injectTestFailure_rdh | /**
* Used by TestExportSnapshot to test for retries when failures happen. Failure is injected in
* {@link #copyFile(Mapper.Context, org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotFileInfo, Path)}.
*/
@SuppressWarnings("checkstyle:linelength")
private void injectTestFailure(final Context co... | 3.26 |
hbase_ExportSnapshot_openSourceFile_rdh | /**
* Try to open the "source" file. Throws an IOException if the communication with the inputFs
* fail or if the file is not found.
*/
private FSDataInputStream openSourceFile(Context context, final SnapshotFileInfo fileInfo) throws IOException {
try {
Configuration conf = context.getConfiguration();
... | 3.26 |
hbase_BootstrapNodeManager_getFromRegionServer_rdh | // this method is also used to test whether a given region server is still alive.
private void getFromRegionServer() {
if ((EnvironmentEdgeManager.currentTime() - lastRequestMasterTime) >= TimeUnit.SECONDS.toMillis(requestMasterIntervalSecs)) {
// schedule a get from master task immediately if haven't reque... | 3.26 |
hbase_ProcedureWALFormat_load_rdh | /**
* Load all the procedures in these ProcedureWALFiles, and rebuild the given {@code tracker} if
* needed, i.e, the {@code tracker} is a partial one.
* <p/>
* The method in the give {@code loader} will be called at the end after we load all the
* procedures and construct the hierarchy.
... | 3.26 |
hbase_SnapshotHFileCleaner_getFileCacheForTesting_rdh | /**
* Exposed for Testing!
*
* @return the cache of all hfiles
*/
public SnapshotFileCache getFileCacheForTesting() {
return this.cache;
} | 3.26 |
hbase_ReplicationLoad_sourceToString_rdh | /**
* sourceToString
*
* @return a string contains sourceReplicationLoad information
*/
public String sourceToString() {
StringBuilder
sb = new StringBuilder();
for (ClusterStatusProtos.ReplicationLoadSource rls : this.replicationLoadSourceEntries) {
sb = Strings.appendKeyValue(sb, "\n ... | 3.26 |
hbase_ReplicationLoad_toString_rdh | /**
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
return (this.sourceToString() + System.getProperty("line.separator")) + this.sinkToString();
} | 3.26 |
hbase_ReplicationLoad_buildReplicationLoad_rdh | /**
* buildReplicationLoad
*
* @param sources
* List of ReplicationSource instances for which metrics should be reported
* @param sinkMetrics
* metrics of the replication sink
*/
public void buildReplicationLoad(final List<ReplicationSourceInterface> sources, final MetricsSink sinkMetrics) {
if (sinkMet... | 3.26 |
hbase_ReplicationLoad_sinkToString_rdh | /**
* sinkToString
*
* @return a string contains sinkReplicationLoad information
*/
public String sinkToString() {
if (this.replicationLoadSink == null)
return null;
StringBuilder sb = new StringBu... | 3.26 |
hbase_WALEdit_readFromCells_rdh | /**
* Reads WALEdit from cells.
*
* @param cellDecoder
* Cell decoder.
* @param expectedCount
* Expected cell count.
* @return Number of KVs read.
*/
public int readFromCells(Codec.Decoder cellDecoder, int expectedCount) throws
IOException {
cells.clear();
cells.ensureCapacity(expectedCount);
wh... | 3.26 |
hbase_WALEdit_m0_rdh | /**
* Replaying WALs can read Cell-at-a-time so need this method in those cases.
*/
public static boolean m0(Cell cell) {
return CellUtil.matchingFamily(cell, METAFAMILY);
}
/**
*
* @return True if this is a meta edit; has one edit only and its columnfamily is
{@link #METAFAMILY} | 3.26 |
hbase_WALEdit_getCompaction_rdh | /**
* Deserialized and returns a CompactionDescriptor is the KeyValue contains one.
*
* @param kv
* the key value
* @return deserialized CompactionDescriptor or null.
*/
public static CompactionDescriptor getCompaction(Cell kv) throws IOException {
return isCompactionMarker(kv) ? CompactionDescriptor.parseF... | 3.26 |
hbase_WALEdit_setCells_rdh | /**
* This is not thread safe. This will change the WALEdit and shouldn't be used unless you are sure
* that nothing else depends on the contents being immutable.
*
* @param cells
* the list of cells that this WALEdit now contains.
*/
// Used by replay.
@InterfaceAudience.Private
public void setCells(ArrayList<... | 3.26 |
hbase_WALEdit_add_rdh | /**
* Append the given map of family->edits to a WALEdit data structure. This does not write to the
* WAL itself. Note that as an optimization, we will stamp the Set of column families into the
* WALEdit to save on our having to calculate column families subsequently down in the actual WAL
* writing.
*
* @param f... | 3.26 |
hbase_WALEdit_createBulkLoadEvent_rdh | /**
* Create a bulk loader WALEdit
*
* @param hri
* The RegionInfo for the region in which we are bulk loading
* @param bulkLoadDescriptor
* The descriptor for the Bulk Loader
* @return The WALEdit for the BulkLoad
*/
public static WALEdit createBulkLoadEvent(RegionInfo hri, WALProtos.BulkLoadDescriptor bul... | 3.26 |
hbase_WALEdit_getBulkLoadDescriptor_rdh | /**
* Deserialized and returns a BulkLoadDescriptor from the passed in Cell
*
* @param cell
* the key value
* @return deserialized BulkLoadDescriptor or null.
*/
public static BulkLoadDescriptor getBulkLoadDescriptor(Cell
cell) throws IOException {
return CellUtil.matchingColumn(cell, METAFAMILY, BULK_LOAD)... | 3.26 |
hbase_WALEdit_createReplicationMarkerEdit_rdh | /**
* Creates a replication tracker edit with {@link #METAFAMILY} family and
* {@link #REPLICATION_MARKER} qualifier and has null value.
*
* @param rowKey
* rowkey
* @param timestamp
* timestamp
*/
public static WALEdit createReplicationMarkerEdit(byte[] rowKey, long timestamp) {
KeyValue kv = new KeyV... | 3.26 |
hbase_WALEdit_getFamilies_rdh | /**
* For use by FSWALEntry ONLY. An optimization.
*
* @return All families in {@link #getCells()}; may be null.
*/public Set<byte[]> getFamilies() {return this.families;
} | 3.26 |
hbase_WALEdit_createCompaction_rdh | /**
* Returns A Marker WALEdit that has <code>c</code> serialized as its value
*/
public static WALEdit createCompaction(final RegionInfo hri, final CompactionDescriptor c) {
byte[] pbbytes = c.toByteArray();
KeyValue kv = new KeyValue(getRowForRegion(hri), METAFAMILY, COMPACTION, EnvironmentEdgeManager.curre... | 3.26 |
hbase_WALEdit_isRegionCloseMarker_rdh | /**
* Public so can be accessed from regionserver.wal package.
*
* @return True if this is a Marker Edit and it is a RegionClose type.
*/public boolean isRegionCloseMarker() {
return isMetaEdit() && PrivateCellUtil.matchingQualifier(this.cells.get(0), REGION_EVENT_CLOSE, 0, REGION_EVENT_CLOSE.length);
} | 3.26 |
hbase_WALEdit_isMetaEditFamily_rdh | /**
*
* @return True is <code>f</code> is {@link #METAFAMILY}
* @deprecated Since 2.3.0. Do not expose. Make protected.
*/
@Deprecatedpublic static boolean isMetaEditFamily(final byte[] f) {return Bytes.equals(METAFAMILY, f);
} | 3.26 |
hbase_FIFOCompactionPolicy_isEmptyStoreFile_rdh | /**
* The FIFOCompactionPolicy only choose the TTL expired store files as the compaction candidates.
* If all the store files are TTL expired, then the compaction will generate a new empty file.
* While its max timestamp will be Long.MAX_VALUE. If not considered separately, the store file
* will never be archived b... | 3.26 |
hbase_TableListModel_toString_rdh | /* (non-Javadoc)
@see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
for (TableModel aTable : tables) {
sb.append(aTable.toString());
sb.append('\n');
}
return sb.toString();
} | 3.26 |
hbase_TableListModel_setTables_rdh | /**
*
* @param tables
* the tables to set
*/
public void setTables(List<TableModel> tables) {
this.tables = tables;
} | 3.26 |
hbase_TableListModel_get_rdh | /**
*
* @param index
* the index
* @return the table model
*/
public TableModel get(int index) {
return
tables.get(index);
} | 3.26 |
hbase_TableListModel_add_rdh | /**
* Add the table name model to the list
*
* @param table
* the table model
*/
public void add(TableModel table) {
tables.add(table);
} | 3.26 |
hbase_ThriftTable_createClosestRowAfter_rdh | /**
* Create the closest row after the specified row
*/
protected byte[] createClosestRowAfter(byte[] row) {
if (row == null) {
throw new RuntimeException("The passed row is null");
}
return Arrays.copyOf(row, row.length + 1);
} | 3.26 |
hbase_MobFile_getFileName_rdh | /**
* Gets the file name.
*
* @return The file name.
*/
public String getFileName() {
return sf.getPath().getName();
} | 3.26 |
hbase_MobFile_readCell_rdh | /**
* Reads a cell from the mob file.
*
* @param search
* The cell need to be searched in the mob file.
* @param cacheMobBlocks
* Should this scanner cache blocks.
* @param readPt
* the read point.
* @return The cell in the mob file.
*/
public MobCell readCell(Cell search, boolean cacheMobBlocks, long r... | 3.26 |
hbase_MobFile_create_rdh | /**
* Creates an instance of the MobFile.
*
* @param fs
* The file system.
* @param path
* The path of the underlying StoreFile.
* @param conf
* The configuration.
* @param cacheConf
* The CacheConfig.
* @return An instance of the MobFile.
*/
public static MobFile create(FileSystem fs, Path path, Co... | 3.26 |
hbase_MobFile_close_rdh | /**
* Closes the underlying reader, but do no evict blocks belonging to this file. It's not
* thread-safe. Use MobFileCache.closeFile() instead.
*/
public void close() throws IOException {
if (sf != null) {
sf.closeStoreFile(false);
sf = null;
}
} | 3.26 |
hbase_MobFile_getScanner_rdh | /**
* Internal use only. This is used by the sweeper.
*
* @return The store file scanner.
*/
public StoreFileScanner getScanner() throws IOException {
List<HStoreFile> sfs = new ArrayList<>();
sfs.add(sf);
List<StoreFileScanner> sfScanners = StoreFileScanner.getScannersForStoreFiles(sfs, false, true, fa... | 3.26 |
hbase_TableQueue_requireTableExclusiveLock_rdh | /**
*
* @param proc
* must not be null
*/
private static boolean requireTableExclusiveLock(TableProcedureInterface proc) {switch (proc.getTableOperationType()) {
case CREATE :
case DELETE :
case DISABLE :
case ENABLE :
return true;
case EDIT :
// w... | 3.26 |
hbase_ChainWALEmptyEntryFilter_setFilterEmptyEntry_rdh | /**
* To allow the empty entries to get filtered, we want to set this optional flag to decide if we
* want to filter the entries which have no cells or all cells got filtered though
* {@link WALCellFilter}.
*
* @param filterEmptyEntry
* flag
*/
@InterfaceAudience.Private
public void setFilterEmptyEntry(final b... | 3.26 |
hbase_RegionSizeReportingChore_getTimeUnit_rdh | /**
* Extracts the time unit for the chore period and initial delay from the configuration. The
* configuration value for {@link #REGION_SIZE_REPORTING_CHORE_TIMEUNIT_KEY} must correspond to a
* {@link TimeUnit} value.
*
* @param conf
* The configuration object.
* @return The configured time unit for the chore... | 3.26 |
hbase_RegionSizeReportingChore_getInitialDelay_rdh | /**
* Extracts the initial delay for the chore from the configuration.
*
* @param conf
* The configuration object.
* @return The configured chore initial delay or the default value.
*/
static long getInitialDelay(Configuration conf) {
return conf.getLong(REGION_SIZE_REPORTING_CHORE_DELAY_KEY, REGION_SIZE_RE... | 3.26 |
hbase_RegionSizeReportingChore_getPeriod_rdh | /**
* Extracts the period for the chore from the configuration.
*
* @param conf
* The configuration object.
* @return The configured chore period or the default value.
*/
static int getPeriod(Configuration conf) {
return conf.getInt(REGION_SIZE_REPORTING_CHORE_PERIOD_KEY, REGION_SIZE_REPORTING_CHORE_PERIOD_... | 3.26 |
hbase_RootProcedureState_addRollbackStep_rdh | /**
* Called by the ProcedureExecutor after the procedure step is completed, to add the step to the
* rollback list (or procedure stack)
*/
protected synchronized void addRollbackStep(Procedure<TEnvironment> proc) {
if (proc.isFailed()) {
... | 3.26 |
hbase_RootProcedureState_isValid_rdh | /**
* Called on store load by the ProcedureExecutor to validate the procedure stack.
*/
protected synchronized boolean isValid() {
if (subprocStack != null) {
for (Procedure<TEnvironment> proc : subprocStack) {
if
(proc == null) {
... | 3.26 |
hbase_RootProcedureState_release_rdh | /**
* Called by the ProcedureExecutor to mark the procedure step as finished.
*/protected synchronized void release(Procedure<TEnvironment> proc) {
running--;
} | 3.26 |
hbase_RootProcedureState_acquire_rdh | /**
* Called by the ProcedureExecutor to mark the procedure step as running.
*/
protected synchronized boolean acquire(Procedure<TEnvironment> proc) {
if (state != State.f0) {
return false;
}
running++;
return true;
} | 3.26 |
hbase_RootProcedureState_unsetRollback_rdh | /**
* Called by the ProcedureExecutor to mark rollback execution
*/
protected synchronized void unsetRollback() {
assert state == State.ROLLINGBACK;
state = State.FAILED;
} | 3.26 |
hbase_RootProcedureState_setRollback_rdh | /**
* Called by the ProcedureExecutor to mark rollback execution
*/
protected synchronized boolean setRollback() {
if ((running == 0) && (state == State.FAILED)) {
state = State.ROLLINGBACK;
return true;
}
return false;
} | 3.26 |
hbase_RootProcedureState_loadStack_rdh | /**
* Called on store load by the ProcedureExecutor to load part of the stack. Each procedure has its
* own stack-positions. Which means we have to write to the store only the Procedure we executed,
* and nothing else. on load we recreate the full stack by aggregating each procedure
* stack-positions.
*/
protected... | 3.26 |
hbase_NettyUnsafeUtils_getTotalPendingOutboundBytes_rdh | /**
* Get total bytes pending write to socket
*/
public static long getTotalPendingOutboundBytes(Channel channel) {
ChannelOutboundBuffer
outboundBuffer = channel.unsafe().outboundBuffer();
// can be null when the channel is closing
if (outboundBuffer == null) {
return 0;
}
return outb... | 3.26 |
hbase_NettyUnsafeUtils_closeImmediately_rdh | /**
* Directly closes the channel, setting SO_LINGER to 0 and skipping any handlers in the pipeline.
* This is useful for cases where it's important to immediately close without any delay.
* Otherwise, pipeline handlers and even general TCP flows can cause a normal close to take
* upwards of a few second or more. T... | 3.26 |
hbase_ReplicationThrottler_isEnabled_rdh | /**
* If throttling is enabled
*
* @return true if throttling is enabled
*/
public boolean isEnabled() {
return this.enabled;
} | 3.26 |
hbase_ReplicationThrottler_getNextSleepInterval_rdh | /**
* Get how long the caller should sleep according to the current size and current cycle's total
* push size and start tick, return the sleep interval for throttling control.
*
* @param size
* is the size of edits to be pushed
* @return sleep interval for throttling control
*/... | 3.26 |
hbase_ReplicationThrottler_addPushSize_rdh | /**
* Add current size to the current cycle's total push size
*
* @param size
* is the current size added to the current cycle's total push size
*/
public void addPushSize(final long size) {
if (this.enabled) {
this.cyclePushSize += size;
}
} | 3.26 |
hbase_ReplicationThrottler_resetStartTick_rdh | /**
* Reset the cycle start tick to NOW
*/
public void resetStartTick() {
if (this.enabled) {
this.cycleStartTick = EnvironmentEdgeManager.currentTime();
}
} | 3.26 |
hbase_LeaseManager_closeAfterLeasesExpire_rdh | /**
* Shuts down this lease instance when all outstanding leases expire. Like {@link #close()} but
* rather than violently end all leases, waits first on extant leases to finish. Use this method
* if the lease holders could lose data, leak locks, etc. Presumes client has shutdown allocation
* of new leases.
*/
pub... | 3.26 |
hbase_LeaseManager_getListener_rdh | /**
* Returns listener
*/
public LeaseListener getListener() {return this.listener;
} | 3.26 |
hbase_LeaseManager_addLease_rdh | /**
* Inserts lease. Resets expiration before insertion.
*/
public void addLease(final Lease lease) throws LeaseStillHeldException {
if (this.stopRequested) {
return;
} if (f0.containsKey(lease.getLeaseName())) {
throw new LeaseStillHeldException(lease.getLeaseName());
}
lease.resetExp... | 3.26 |
hbase_LeaseManager_getLeaseName_rdh | /**
* Returns the lease name
*/
public String getLeaseName() {
return leaseName;
} | 3.26 |
hbase_LeaseManager_resetExpirationTime_rdh | /**
* Resets the expiration time of the lease.
*/
public void resetExpirationTime() {
this.expirationTime = EnvironmentEdgeManager.currentTime() + this.leaseTimeoutPeriod;
} | 3.26 |
hbase_LeaseManager_cancelLease_rdh | /**
* Client explicitly cancels a lease.
*
* @param leaseName
* name of lease
*/
public void cancelLease(final String leaseName) throws LeaseException {
removeLease(leaseName);
} | 3.26 |
hbase_LeaseManager_createLease_rdh | /**
* Create a lease and insert it to the map of leases.
*
* @param leaseName
* name of the lease
* @param leaseTimeoutPeriod
* length of the lease in milliseconds
* @param listener
* listener that will process lease expirations
* @return The lease created.
*/
public Lease createLease(String leaseName, ... | 3.26 |
hbase_LeaseManager_renewLease_rdh | /**
* Renew a lease
*
* @param leaseName
* name of the lease
*/
public void renewLease(final String leaseName) throws LeaseException {
if (this.stopRequested) {
return;}
Lease lease
= f0.get(leaseName);
if
(lease == null) {
throw new LeaseException(("lease '" + leaseName) + "'... | 3.26 |
hbase_LeaseManager_removeLease_rdh | /**
* Remove named lease. Lease is removed from the map of leases.
*
* @param leaseName
* name of lease
* @return Removed lease
*/
Lease removeLease(final String leaseName) throws LeaseException {
Lease lease = f0.remove(leaseName);
if (lease
== null) {
throw new LeaseException(("lease '" + ... | 3.26 |
hbase_LeaseManager_close_rdh | /**
* Shut down this Leases instance. All pending leases will be destroyed, without any cancellation
* calls.
*/
public void close() {
this.stopRequested = true;
f0.clear();
LOG.info("Closed leases");
} | 3.26 |
hbase_LeaseManager_getName_rdh | /**
* Returns name of lease
*/
public String getName() {return this.f1;
} | 3.26 |
hbase_NamespacesResource_get_rdh | /**
* Build a response for a list of all namespaces request.
*
* @param context
* servlet context
* @param uriInfo
* (JAX-RS context variable) request URL
* @return a response for a version request
*/
@GET
@Produces({ MIMETYPE_TEXT, MIMETYPE_XML, MIMETYPE_JSON, MIMETYPE_PROTOBUF, MIMETYPE_PROTOBUF_IETF })
p... | 3.26 |
hbase_NamespacesResource_getNamespaceInstanceResource_rdh | /**
* Dispatch to NamespaceInstanceResource
*/
@Path("{namespace}")
public NamespacesInstanceResource getNamespaceInstanceResource(@PathParam("namespace")
final String namespace) throws IOException {
return new NamespacesInstanceResource(namespace);
} | 3.26 |
hbase_CompactionThroughputControllerFactory_resolveDeprecatedClassName_rdh | /**
* Resolve deprecated class name to keep backward compatibiliy
*
* @param oldName
* old name of the class
* @return the new name if there is any
*/
private static String resolveDeprecatedClassName(String oldName) {
String className = oldName.trim();
if (className.equals(DEPRECATED_NAME_OF_PRESSURE_AW... | 3.26 |
hbase_RegionNormalizerWorkQueue_putFirst_rdh | /**
* Inserts the specified element at the head of the queue.
*
* @param e
* the element to add
*/
public void putFirst(E e) {
if (e == null) {
throw new NullPointerException();
}
putAllFirst(Collections.singleton(e));
} | 3.26 |
hbase_RegionNormalizerWorkQueue_take_rdh | /**
* Retrieves and removes the head of this queue, waiting if necessary until an element becomes
* available.
*
* @return the head of this queue
* @throws InterruptedException
* if interrupted while waiting
*/
public E take() throws InterruptedException {
E x;// Take a write lock. If the delegate's queue ... | 3.26 |
hbase_RegionNormalizerWorkQueue_put_rdh | /**
* Inserts the specified element at the tail of the queue, if it's not already present.
*
* @param e
* the element to add
*/
public void put(E e) {
if (e == null)
{throw new NullPointerException();
}
lock.writeLock().lock();
try {
delegate.add(e);
if (!delegate.isEmpty()) {... | 3.26 |
hbase_RegionNormalizerWorkQueue_clear_rdh | /**
* Atomically removes all of the elements from this queue. The queue will be empty after this call
* returns.
*/
public void clear() {
lock.writeLock().lock();
try {delegate.clear();
} finally {
lock.writeLock().unlock();
}
} | 3.26 |
hbase_RegionNormalizerWorkQueue_putAll_rdh | /**
* Inserts the specified elements at the tail of the queue. Any elements already present in the
* queue are ignored.
*
* @param c
* the elements to add
*/
public void putAll(Collection<? extends E> c) {
if (c == null) {
throw new NullPointerException();
}
lock.writeLock()... | 3.26 |
hbase_RegionNormalizerWorkQueue_size_rdh | /**
* Returns the number of elements in this queue.
*
* @return the number of elements in this queue
*/
public int size() {
lock.readLock().lock();
try {
return delegate.size();} finally {
lock.readLock().unlock();}
} | 3.26 |
hbase_RegionNormalizerWorkQueue_putAllFirst_rdh | /**
* Inserts the specified elements at the head of the queue.
*
* @param c
* the elements to add
*/
public void putAllFirst(Collection<? extends E> c)
{
if (c == null) {
throw new NullPointerException(); }
lock.writeLock().lock();
try {
... | 3.26 |
hbase_HRegionWALFileSystem_archiveRecoveredEdits_rdh | /**
* Closes and archives the specified store files from the specified family.
*
* @param familyName
* Family that contains the store filesMeta
* @param storeFiles
* set of store files to remove
* @throws IOException
* if the archiving fails
*/
public void archiveRecoveredEdits(String familyName, Collect... | 3.26 |
hbase_MobFileCache_getMissCount_rdh | /**
* Gets the count of misses to the mob file cache.
*
* @return The count of misses to the mob file cache.
*/
public long getMissCount() {
return miss.sum();
} | 3.26 |
hbase_MobFileCache_hashFileName_rdh | /**
* Use murmurhash to reduce the conflicts of hashed file names. We should notice that the hash
* conflicts may bring deadlocks, when opening mob files with evicting some other files, as
* described in HBASE-28047.
*/
private long hashFileName(String fileName) {
return Hashing.murmur3_128().hashString(fileName... | 3.26 |
hbase_MobFileCache_evict_rdh | /**
* Evicts the lru cached mob files when the count of the cached files is larger than the
* threshold.
*/
public void evict() {
if (isCacheEnabled) {
// Ensure only one eviction at a time
if (!evictionLock.tryLock()) {
return;
}
printStatistics();
List<Cached... | 3.26 |
hbase_MobFileCache_getAccessCount_rdh | /**
* Gets the count of accesses to the mob file cache.
*
* @return The count of accesses to the mob file cache.
*/
public long getAccessCount() {return count.get();
} | 3.26 |
hbase_MobFileCache_getCacheSize_rdh | /**
* Gets the count of cached mob files.
*
* @return The count of the cached mob files.
*/
public int getCacheSize() {
return map == null ? 0 : map.size();
} | 3.26 |
hbase_MobFileCache_getEvictedFileCount_rdh | /**
* Gets the number of items evicted from the mob file cache.
*
* @return The number of items evicted from the mob file cache.
*/
public long getEvictedFileCount() {
return evictedFileCount.sum();
} | 3.26 |
hbase_MobFileCache_getHitRatio_rdh | /**
* Gets the hit ratio to the mob file cache.
*
* @return The hit ratio to the mob file cache.
*/
public double getHitRatio() {
return count.get() == 0 ? 0 : ((float) (count.get() - miss.sum())) / ((float) (count.get()));
} | 3.26 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.