name stringlengths 12 178 | code_snippet stringlengths 8 36.5k | score float64 3.26 3.68 |
|---|---|---|
hbase_AccessController_preCreateTable_rdh | /**
* ********************************* Observer implementations **********************************
*/
@Override
public void preCreateTable(ObserverContext<MasterCoprocessorEnvironment> c, TableDescriptor desc, RegionInfo[] regions)
throws IOException {
Set<byte[]> families = desc.getColumnFamilyNames();
Map<byte[], ... | 3.26 |
hbase_AccessController_permissionGranted_rdh | /**
* Check the current user for authorization to perform a specific action against the given set of
* row data.
*
* @param opType
* the operation type
* @param user
* the user
* @param e
* the coprocessor environment
* @param families
* the map of column families to qualifiers present in the request... | 3.26 |
hbase_AccessController_getActiveUser_rdh | /**
* Returns the active user to which authorization checks should be applied. If we are in the
* context of an RPC call, the remote user is used, otherwise the currently logged in user is
* used.
*/
private User getActiveUser(ObserverContext<?> ctx) throws IOException {
// for non-rpc handling, fallback to system ... | 3.26 |
hbase_AccessController_createACLTable_rdh | /**
* Create the ACL table
*/
private static void createACLTable(Admin admin) throws IOException {
/**
* Table descriptor for ACL table
*/
ColumnFamilyDescriptor v86 = ColumnFamilyDescriptorBuilder.newBuilder(PermissionStorage.ACL_LIST_FAMILY).setMaxVersions(1).setInMemory(true).setBlockCacheEnabl... | 3.26 |
hbase_AccessController_preCleanupBulkLoad_rdh | /**
* Authorization security check for SecureBulkLoadProtocol.cleanupBulkLoad()
*
* @param ctx
* the context
*/
@Override
public void preCleanupBulkLoad(ObserverContext<RegionCoprocessorEnvironment> ctx) throws IOException
{
requireAccess(ctx, "preCleanupBulkLoad", ctx.getEnvironment().getRegion().getTableDescri... | 3.26 |
hbase_AccessController_preBulkLoadHFile_rdh | /**
* Verifies user has CREATE or ADMIN privileges on the Column Families involved in the
* bulkLoadHFile request. Specific Column Write privileges are presently ignored.
*/
@Override
public void preBulkLoadHFile(ObserverContext<RegionCoprocessorEnvironment> ctx, List<Pair<byte[], String>> familyPaths) throws IOExc... | 3.26 |
hbase_AccessController_getRegionObserver_rdh | /**
* ********************************* Observer/Service Getters **********************************
*/
@Override
public Optional<RegionObserver> getRegionObserver() {
return Optional.of(this);
} | 3.26 |
hbase_AccessController_prePrepareBulkLoad_rdh | /**
* Authorization check for SecureBulkLoadProtocol.prepareBulkLoad()
*
* @param ctx
* the context
*/
@Override
public void prePrepareBulkLoad(ObserverContext<RegionCoprocessorEnvironment> ctx) throws IOException {
requireAccess(ctx, "prePrepareBulkLoad", ctx.getEnvironment().getRegion().getTableDescriptor().... | 3.26 |
hbase_AccessController_preEndpointInvocation_rdh | /* ---- EndpointObserver implementation ---- */
@Override
public Message preEndpointInvocation(ObserverContext<RegionCoprocessorEnvironment> ctx, Service service, String methodName, Message request) throws IOException {
// Don't intercept calls to our own AccessControlService, we check for
// appropriate permissions in... | 3.26 |
hbase_AccessController_updateACL_rdh | /**
* Writes all table ACLs for the tables in the given Map up into ZooKeeper znodes. This is called
* to synchronize ACL changes following {@code _acl_} table updates.
*/
private void updateACL(RegionCoprocessorEnvironment e, final Map<byte[], List<Cell>> familyMap) {
Set<byte[]> entries... | 3.26 |
hbase_AccessController_preOpen_rdh | /* ---- RegionObserver implementation ---- */
@Override
public void preOpen(ObserverContext<RegionCoprocessorEnvironment> c) throws
IOException
{
RegionCoprocessorEnvironment env = c.getEnvironment();final Region region = ... | 3.26 |
hbase_AuthMethod_m1_rdh | /**
* Return the SASL mechanism name
*/
public String m1() {
return mechanismName;
} | 3.26 |
hbase_AuthMethod_read_rdh | /**
* Read from in
*/
public static AuthMethod read(DataInput in) throws IOException {
return m0(in.readByte());
} | 3.26 |
hbase_AuthMethod_write_rdh | /**
* Write to out
*/
public void write(DataOutput
out) throws IOException {
out.write(code);
} | 3.26 |
hbase_AuthMethod_m0_rdh | /**
* Return the object represented by the code.
*/
public static AuthMethod m0(byte code) {
final int i = (code & 0xff) - FIRST_CODE;
return (i < 0) || (i
>= values().length) ? null : values()[i];
} | 3.26 |
hbase_BloomFilterMetrics_getNegativeResultsCount_rdh | /**
* Returns Current value for bloom negative results count
*/
public long getNegativeResultsCount() {return negativeResults.sum();
} | 3.26 |
hbase_BloomFilterMetrics_incrementRequests_rdh | /**
* Increment bloom request count, and negative result count if !passed
*/
public void incrementRequests(boolean passed) {
requests.increment();
if (!passed) {
negativeResults.increment();
}
} | 3.26 |
hbase_BloomFilterMetrics_getRequestsCount_rdh | /**
* Returns Current value for bloom requests count
*/
public long getRequestsCount() {
return requests.sum();
} | 3.26 |
hbase_BloomFilterMetrics_m0_rdh | /**
* Returns Current value for requests which could have used bloom filters but wasn't defined or
* loaded.
*/
public long m0() {
return eligibleRequests.sum();} | 3.26 |
hbase_BloomFilterMetrics_incrementEligible_rdh | /**
* Increment for cases where bloom filter could have been used but wasn't defined or loaded.
*/
public void incrementEligible() {
eligibleRequests.increment();
} | 3.26 |
hbase_Filter_parseFrom_rdh | /**
* Concrete implementers can signal a failure condition in their code by throwing an
* {@link IOException}.
*
* @param pbBytes
* A pb serialized {@link Filter} instance
* @return An instance of {@link Filter} made from <code>bytes</code>
* @throws DeserializationException
* if an error occurred
* @see #... | 3.26 |
hbase_Filter_setReversed_rdh | /**
* alter the reversed scan flag
*
* @param reversed
* flag
*/ public void setReversed(boolean reversed) {
this.reversed = reversed;
} | 3.26 |
hbase_Filter_filterCell_rdh | /**
* A way to filter based on the column family, column qualifier and/or the column value. Return
* code is described below. This allows filters to filter only certain number of columns, then
* terminate without matching ever column. If filterRowKey returns true, filterCell needs to be
* consistent with it. filter... | 3.26 |
hbase_MetricsStochasticBalancer_initSource_rdh | /**
* This function overrides the initSource in the MetricsBalancer, use
* MetricsStochasticBalancerSource instead of the MetricsBalancerSource.
*/
@Override
protected void initSource() {
stochasticSource = CompatibilitySingletonFactory.getInstance(MetricsStochasticBalancerSource.class);
} | 3.26 |
hbase_MetricsStochasticBalancer_updateMetricsSize_rdh | /**
* Updates the number of metrics reported to JMX
*/
public void updateMetricsSize(int size) {
stochasticSource.updateMetricsSize(size);
} | 3.26 |
hbase_MetricsStochasticBalancer_balancerStatus_rdh | /**
* Updates the balancer status tag reported to JMX
*/
@Override
public void balancerStatus(boolean status) {
stochasticSource.updateBalancerStatus(status);
} | 3.26 |
hbase_MetricsStochasticBalancer_updateStochasticCost_rdh | /**
* Reports stochastic load balancer costs to JMX
*/
public void updateStochasticCost(String tableName, String costFunctionName, String costFunctionDesc, Double value) {
stochasticSource.updateStochasticCost(tableName, costFunctionName, costFunctionDesc, value);
} | 3.26 |
hbase_JarFinder_getJar_rdh | /**
* Returns the full path to the Jar containing the class. It always return a JAR.
*
* @param klass
* class.
* @return path to the Jar containing the class.
*/
public static String getJar(Class klass) {
Preconditions.checkNotNull(klass, "klass");
ClassLoader loader = klass.getClassLoader();
if (lo... | 3.26 |
hbase_LongComparator_toByteArray_rdh | /**
* Returns The comparator serialized using pb
*/
@Override
public byte[] toByteArray() {
ComparatorProtos.LongComparator.Builder builder = ComparatorProtos.LongComparator.newBuilder();
builder.setComparable(ProtobufUtil.toByteArrayComparable(this.value));
return builder.build().toByteArray();} | 3.26 |
hbase_LongComparator_areSerializedFieldsEqual_rdh | /**
* Returns true if and only if the fields of the comparator that are serialized are equal to the
* corresponding fields in other. Used for testing.
*/
boolean areSerializedFieldsEqual(LongComparator other) {
if (other == this) {
return true;
}if (other == null) {
return false;
}
... | 3.26 |
hbase_LongComparator_parseFrom_rdh | /**
* Parses a serialized representation of {@link LongComparator}
*
* @param pbBytes
* A pb serialized {@link LongComparator} instance
* @return An instance of {@link LongComparator} made from <code>bytes</code>
* @throws DeserializationException
* if an error occurred
* @see #toByteArray
*/
public static... | 3.26 |
hbase_QuotaObserverChore_setTableQuotaSnapshot_rdh | /**
* Stores the quota state for the given table.
*/
void setTableQuotaSnapshot(TableName
table, SpaceQuotaSnapshot snapshot) {
this.tableQuotaSnapshots.put(table, snapshot);
} | 3.26 |
hbase_QuotaObserverChore_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 in the given timeunit.
* @see #getTimeUnit(Configuration)
*/
static long getInitialDelay(Configuration conf) {
return conf.getLong... | 3.26 |
hbase_QuotaObserverChore_getTableQuotaSnapshots_rdh | /**
* Returns an unmodifiable view over the current {@link SpaceQuotaSnapshot} objects for each HBase
* table with a quota defined.
*/
public Map<TableName, SpaceQuotaSnapshot> getTableQuotaSnapshots() {
return readOnlyTableQuotaSnapshots;
} | 3.26 |
hbase_QuotaObserverChore_processNamespacesWithQuotas_rdh | /**
* Processes each namespace which has a quota defined and moves all of the tables contained in
* that namespace into or out of violation of the quota. Tables which are already in violation of
* a quota at the table level which <em>also</em> have a reside in a namespace with a violated
* quota will not have the n... | 3.26 |
hbase_QuotaObserverChore_fetchAllTablesWithQuotasDefined_rdh | /**
* Computes the set of all tables that have quotas defined. This includes tables with quotas
* explicitly set on them, in addition to tables that exist namespaces which have a quota defined.
*/
TablesWithQuotas fetchAllTablesWithQuotasDefined() throws IOException {
final Scan scan = QuotaTableUtil.makeScan(nul... | 3.26 |
hbase_QuotaObserverChore_updateTableQuota_rdh | /**
* Updates the hbase:quota table with the new quota policy for this <code>table</code> if
* necessary.
*
* @param table
* The table being checked
* @param currentSnapshot
* The state of the quota on this table from the previous invocation.
* @param targetSnapshot
* The state the quota should be in for... | 3.26 |
hbase_QuotaObserverChore_updateNamespaceQuota_rdh | /**
* Updates the hbase:quota table with the target quota policy for this <code>namespace</code> if
* necessary.
*
* @param namespace
* The namespace being checked
* @param currentSnapshot
* The state of the quota on this namespace from the previous invocation
* @param targetSnapshot
* The state the quot... | 3.26 |
hbase_QuotaObserverChore_getTablesByNamespace_rdh | /**
* Returns a view of all tables that reside in a namespace with a namespace quota, grouped by
* the namespace itself.
*/
public Multimap<String, TableName> getTablesByNamespace() {
Multimap<String, TableName> tablesByNS = HashMultimap.create();
for (TableName tn : tablesWithNamespaceQuotas) {
tablesByNS.put(tn.... | 3.26 |
hbase_QuotaObserverChore_filterInsufficientlyReportedTables_rdh | /**
* Filters out all tables for which the Master currently doesn't have enough region space
* reports received from RegionServers yet.
*/
public Set<TableName> filterInsufficientlyReportedTables(QuotaSnapshotStore<TableName> tableStore) throws IOException {
final double percentRegionsReportedThreshold = m1(getCon... | 3.26 |
hbase_QuotaObserverChore_addTableQuotaTable_rdh | /**
* Adds a table with a table quota.
*/
public void
addTableQuotaTable(TableName tn) {
tablesWithTableQuotas.add(tn);
} | 3.26 |
hbase_QuotaObserverChore_pruneOldRegionReports_rdh | /**
* Removes region reports over a certain age.
*/
void pruneOldRegionReports() {
final long now = EnvironmentEdgeManager.currentTime();
final long pruneTime = now - regionReportLifetimeMillis;
final int numRemoved = quotaManager.pruneEntriesOlderThan(pruneTime, this);
if (LOG.isTraceEnabled()) {
LOG.trace(((("Remo... | 3.26 |
hbase_QuotaObserverChore_getNumRegions_rdh | /**
* Computes the total number of regions in a table.
*/
int getNumRegions(TableName table) throws IOException {
List<RegionInfo> regions = this.conn.getAdmin().getRegions(table);
if (regions == null) {
return 0;
}
// Filter the region replicas if any and return the original number of regions for a table.
RegionRepl... | 3.26 |
hbase_QuotaObserverChore_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 in the given timeunit.
* @see #getTimeUnit(Configuration)
*/
static int getPeriod(Configuration conf) {
return conf.getInt(QUOTA_OBSERVER_CHOR... | 3.26 |
hbase_QuotaObserverChore_getNumReportedRegions_rdh | /**
* Computes the number of regions reported for a table.
*/
int getNumReportedRegions(TableName table, QuotaSnapshotStore<TableName> tableStore) throws IOException {
return Iterables.size(tableStore.filterBySubject(table));
} | 3.26 |
hbase_QuotaObserverChore_getNamespaceQuotaTables_rdh | /**
* Returns an unmodifiable view of all tables in namespaces that have namespace quotas.
*/
public Set<TableName> getNamespaceQuotaTables() {
return Collections.unmodifiableSet(tablesWithNamespaceQuotas);
} | 3.26 |
hbase_QuotaObserverChore_setNamespaceQuotaSnapshot_rdh | /**
* Stores the given {@code snapshot} for the given {@code namespace} in this chore.
*/
void setNamespaceQuotaSnapshot(String namespace, SpaceQuotaSnapshot snapshot) {
this.f2.put(namespace, snapshot);
} | 3.26 |
hbase_QuotaObserverChore_isDisableSpaceViolationPolicy_rdh | /**
* Method to check whether we are dealing with DISABLE {@link SpaceViolationPolicy}. In such a
* case, currPolicy or/and targetPolicy will be having DISABLE policy.
*
* @param currPolicy
* currently set space violation policy
* @param targetPolicy
* new space violation policy
* @return true if is DISABLE... | 3.26 |
hbase_QuotaObserverChore_m0_rdh | /**
* Extracts the time unit for the chore period and initial delay from the configuration. The
* configuration value for {@link #QUOTA_OBSERVER_CHORE_TIMEUNIT_KEY} must correspond to a
* {@link TimeUnit} value.
*
* @param conf
* The configuration object.
* @return The configured time unit for the chore period... | 3.26 |
hbase_QuotaObserverChore_getNamespaceQuotaSnapshot_rdh | /**
* Fetches the {@link SpaceQuotaSnapshot} for the given namespace from this chore.
*/
SpaceQuotaSnapshot getNamespaceQuotaSnapshot(String namespace) {
SpaceQuotaSnapshot state = this.f2.get(namespace);
if (state == null) {
// No tracked state implies observance.
return QuotaSnapshotStore.NO_QUOTA;
}
return state;... | 3.26 |
hbase_QuotaObserverChore_m1_rdh | /**
* Extracts the percent of Regions for a table to have been reported to enable quota violation
* state change.
*
* @param conf
* The configuration object.
* @return The percent of regions reported to use.
*/
static Double m1(Configuration conf) {
return conf.getDouble(f1, QUOTA_OBSERVER_CHORE_REPORT_PERCENT... | 3.26 |
hbase_QuotaObserverChore_hasNamespaceQuota_rdh | /**
* Returns true if the table exists in a namespace with a namespace quota.
*/
public boolean hasNamespaceQuota(TableName tn) {
return tablesWithNamespaceQuotas.contains(tn);} | 3.26 |
hbase_QuotaObserverChore_getNamespaceQuotaSnapshots_rdh | /**
* Returns an unmodifiable view over the current {@link SpaceQuotaSnapshot} objects for each HBase
* namespace with a quota defined.
*/
public Map<String, SpaceQuotaSnapshot> getNamespaceQuotaSnapshots() {return readOnlyNamespaceSnapshots;
} | 3.26 |
hbase_QuotaObserverChore_processTablesWithQuotas_rdh | /**
* Processes each {@code TableName} which has a quota defined and moves it in or out of violation
* based on the space use.
*
* @param tablesWithTableQuotas
* The HBase tables which have quotas defined
*/
void processTablesWithQuotas(final Set<TableName> tablesWithTableQuotas) throws IOException {
long num... | 3.26 |
hbase_QuotaObserverChore_hasTableQuota_rdh | /**
* Returns true if the given table has a table quota.
*/
public boolean hasTableQuota(TableName tn) {
return tablesWithTableQuotas.contains(tn);
} | 3.26 |
hbase_QuotaObserverChore_addNamespaceQuotaTable_rdh | /**
* Adds a table with a namespace quota.
*/
public void addNamespaceQuotaTable(TableName tn) {
tablesWithNamespaceQuotas.add(tn);
} | 3.26 |
hbase_QuotaObserverChore_getTableQuotaTables_rdh | /**
* Returns an unmodifiable view of all tables with table quotas.
*/
public Set<TableName> getTableQuotaTables() {
return Collections.unmodifiableSet(tablesWithTableQuotas);
} | 3.26 |
hbase_QuotaObserverChore_getTableQuotaSnapshot_rdh | /**
* Fetches the {@link SpaceQuotaSnapshot} for the given table.
*/
SpaceQuotaSnapshot getTableQuotaSnapshot(TableName table) {
SpaceQuotaSnapshot state = this.tableQuotaSnapshots.get(table);
if (state == null) {
// No tracked state implies observance.
return QuotaSnapshotStore.NO_QUOTA;
}
return state;
} | 3.26 |
hbase_ClaimReplicationQueueRemoteProcedure_shouldSkip_rdh | // check whether ReplicationSyncUp has already done the work for us, if so, we should skip
// claiming the replication queues and deleting them instead.
private boolean shouldSkip(MasterProcedureEnv env) throws IOException {
MasterFileSystem mfs = env.getMasterFileSystem();
Path syncUpDir = new Path(mfs.getRoo... | 3.26 |
hbase_ReplicationPeerConfig_isSyncReplication_rdh | /**
* Use remote wal dir to decide whether a peer is sync replication peer
*/
public boolean isSyncReplication() {
return !StringUtils.isBlank(this.remoteWALDir);
} | 3.26 |
hbase_ReplicationPeerConfig_needToReplicate_rdh | /**
* Decide whether the table need replicate to the peer cluster
*
* @param table
* name of the table
* @return true if the table need replicate to the peer cluster
*/
public boolean needToReplicate(TableName
table) {return needToReplicate(table, null);
} | 3.26 |
hbase_CreateStoreFileWriterParams_includeMVCCReadpoint_rdh | /**
* Whether to include MVCC or not
*/
public CreateStoreFileWriterParams includeMVCCReadpoint(boolean includeMVCCReadpoint) {
this.includeMVCCReadpoint = includeMVCCReadpoint;
return this;
} | 3.26 |
hbase_CreateStoreFileWriterParams_isCompaction_rdh | /**
* Whether we are creating a new file in a compaction
*/
public CreateStoreFileWriterParams isCompaction(boolean isCompaction) {
this.isCompaction = isCompaction;
return this;
} | 3.26 |
hbase_CreateStoreFileWriterParams_compression_rdh | /**
* Set the compression algorithm to use
*/
public CreateStoreFileWriterParams compression(Compression.Algorithm compression) {
this.compression = compression;
return this;} | 3.26 |
hbase_CreateStoreFileWriterParams_includesTag_rdh | /**
* Whether to includesTag or not
*/
public CreateStoreFileWriterParams includesTag(boolean
includesTag) {
this.includesTag = includesTag;
return this;
} | 3.26 |
hbase_CompactionLifeCycleTracker_afterExecution_rdh | /**
* Called after compaction is executed by CompactSplitThread.
* <p>
* Requesting compaction on a region can lead to multiple compactions on different stores, so we
* will pass the {@link Store} in to tell you the store we operate on.
*/default void afterExecution(Store store) {
} | 3.26 |
hbase_CompactionLifeCycleTracker_notExecuted_rdh | /**
* Called if the compaction request is failed for some reason.
*/
default void notExecuted(Store store, String reason) {
} | 3.26 |
hbase_TerminatedWrapper_encode_rdh | /**
* Write instance {@code val} into buffer {@code dst}.
*
* @throws IllegalArgumentException
* when the encoded representation of {@code val} contains the
* {@code term} sequence.
*/
@Override
public int encode(PositionedByteRange dst, T val) {
final int start = dst.getPosition();
int written = wra... | 3.26 |
hbase_TerminatedWrapper_terminatorPosition_rdh | /**
* Return the position at which {@code term} begins within {@code src}, or {@code -1} if
* {@code term} is not found.
*/
protected int terminatorPosition(PositionedByteRange src) {byte[] a = src.getBytes();
final int offset = src.getOffset();
int v2;
SKIP : for (v2 = src.getPosition(); v2 < src.getLen... | 3.26 |
hbase_ModifyRegionUtils_createRegions_rdh | /**
* Create new set of regions on the specified file-system. NOTE: that you should add the regions
* to hbase:meta after this operation.
*
* @param exec
* Thread Pool Executor
* @param conf
* {@link Configuration}
* @param rootDir
* Root directory for HBase instance
* @param tableDescriptor
* descri... | 3.26 |
hbase_ModifyRegionUtils_editRegions_rdh | /**
* Execute the task on the specified set of regions.
*
* @param exec
* Thread Pool Executor
* @param regions
* {@link RegionInfo} that describes the regions to edit
* @param task
* {@link RegionFillTask} custom code to edit the region
*/
public static void editRegions(final ThreadPoolExecutor exec, fi... | 3.26 |
hbase_ClientTokenUtil_m0_rdh | /**
* Obtain and return an authentication token for the current user.
*
* @param conn
* The HBase cluster connection
* @throws IOException
* if a remote error or serialization problem occurs.
* @return the authentication token instance
*/
@InterfaceAudience.Private
static Token<AuthenticationTokenIdentifier... | 3.26 |
hbase_ClientTokenUtil_obtainToken_rdh | /**
* Obtain and return an authentication token for the given user.
*
* @param conn
* The HBase cluster connection
* @param user
* The user to obtain a token for
* @return the authentication token instance
*/
@InterfaceAudience.Private
static Token<AuthenticationTokenIdentifier> obtainToken(final Connection... | 3.26 |
hbase_ClientTokenUtil_obtainAndCacheToken_rdh | /**
* Obtain an authentication token for the given user and add it to the user's credentials.
*
* @param conn
* The HBase cluster connection
* @param user
* The user for whom to obtain the token
* @throws IOException
* If making a remote call to the authentication service fails
* @throws InterruptedExcep... | 3.26 |
hbase_ClientTokenUtil_toToken_rdh | /**
* Converts a protobuf Token message back into a Token instance.
*
* @param proto
* the protobuf Token message
* @return the Token instance
*/
@InterfaceAudience.Private
static Token<AuthenticationTokenIdentifier> toToken(AuthenticationProtos.Token proto) {
return new Token<>(proto.hasIdentifier() ? proto.ge... | 3.26 |
hbase_ProcedureEvent_suspendIfNotReady_rdh | /**
* Returns true if event is not ready and adds procedure to suspended queue, else returns false.
*/
public synchronized boolean suspendIfNotReady(Procedure proc) {
if (!ready) {
suspendedProcedures.addLast(proc);
}
return !ready;
} | 3.26 |
hbase_ProcedureEvent_wakeInternal_rdh | /**
* Only to be used by ProcedureScheduler implementations. Reason: To wake up multiple events,
* locking sequence is schedLock --> synchronized (event) To wake up an event, both schedLock()
* and synchronized(event) are required. The order is schedLock() --> synchronized(event) because
* when waking up multiple e... | 3.26 |
hbase_ProcedureEvent_wakeIfSuspended_rdh | /**
* Wakes up the suspended procedures only if the given {@code proc} is waiting on this event.
* <p/>
* Mainly used by region assignment to reject stale OpenRegionProcedure/CloseRegionProcedure. Use
* with caution as it will cause performance issue if there are lots of procedures waiting on the
* event.
*/
publ... | 3.26 |
hbase_ProcedureEvent_getSuspendedProcedures_rdh | /**
* Access to suspendedProcedures is 'synchronized' on this object, but it's fine to return it here
* for tests.
*/
public ProcedureDeque getSuspendedProcedures() {
return suspendedProcedures;
} | 3.26 |
hbase_ProcedureEvent_wakeEvents_rdh | /**
* Wakes up all the given events and puts the procedures waiting on them back into
* ProcedureScheduler queues.
*/
public static void wakeEvents(AbstractProcedureScheduler scheduler, ProcedureEvent... events) {
scheduler.wakeEvents(events);
} | 3.26 |
hbase_ProcedureEvent_wake_rdh | /**
* Wakes up the suspended procedures by pushing them back into scheduler queues and sets the event
* as ready. See {@link #wakeInternal(AbstractProcedureScheduler)} for why this is not
* synchronized.
*/
public void wake(AbstractProcedureScheduler procedureScheduler) {
procedureScheduler.wakeEvents(new Pro... | 3.26 |
hbase_RawLong_decodeLong_rdh | /**
* Read a {@code long} value from the buffer {@code buff}.
*/
public long decodeLong(byte[] buff, int offset) {
return Bytes.toLong(buff, offset);
} | 3.26 |
hbase_RawLong_encodeLong_rdh | /**
* Write instance {@code val} into buffer {@code buff}.
*/
public int encodeLong(byte[] buff, int offset, long val) {
return Bytes.putLong(buff, offset, val);
} | 3.26 |
hbase_FuzzyRowFilter_trimTrailingZeroes_rdh | /**
* For forward scanner, next cell hint should not contain any trailing zeroes unless they are part
* of fuzzyKeyMeta hint = '\x01\x01\x01\x00\x00' will skip valid row '\x01\x01\x01'
*
* @param toInc
* - position of incremented byte
* @return trimmed ver... | 3.26 |
hbase_FuzzyRowFilter_m0_rdh | /**
* Parse a serialized representation of {@link FuzzyRowFilter}
*
* @param pbBytes
* A pb serialized {@link FuzzyRowFilter} instance
* @return An instance of {@link FuzzyRowFilter} made from <code>bytes</code>
* @throws DeserializationException
* if an error occurred
* @see #toByteArray
*/
public static ... | 3.26 |
hbase_FuzzyRowFilter_areSerializedFieldsEqual_rdh | /**
* Returns true if and only if the fields of the filter that are serialized are equal to the
* corresponding fields in other. Used for testing.
*/
@Override
boolean areSerializedFieldsEqual(Filter o) {
if (o == this) {
return true;
}if (!(o instanceof FuzzyRowFilter)) {
return false;
}... | 3.26 |
hbase_FuzzyRowFilter_toByteArray_rdh | /**
* Returns The filter serialized using pb
*/
@Override
public byte[] toByteArray() {
FilterProtos.FuzzyRowFilter.Builder builder = FilterProtos.FuzzyRowFilter.newBuilder();
for (Pair<byte[], byte[]> v24 : fuzzyKeysData) {
BytesBytesPair.Builder bbpBuilder = BytesBy... | 3.26 |
hbase_FuzzyRowFilter_preprocessMask_rdh | /**
* We need to preprocess mask array, as since we treat 2's as unfixed positions and -1 (0xff) as
* fixed positions
*
* @return mask array
*/private byte[] preprocessMask(byte[]
mask) {
if (!UNSAFE_UNALIGNED) {
// do nothing
return mask;
}
if (isPreprocessedMask(mask))
return mask;
for (... | 3.26 |
hbase_HFileInfo_isReservedFileInfoKey_rdh | /**
* Return true if the given file info key is reserved for internal use.
*/
public static boolean isReservedFileInfoKey(byte[] key) {
return Bytes.startsWith(key, HFileInfo.f0);
} | 3.26 |
hbase_HFileInfo_write_rdh | /**
* Write out this instance on the passed in <code>out</code> stream. We write it as a protobuf.
*
* @see #read(DataInputStream)
*/
void write(final DataOutputStream out) throws IOException {
HFileProtos.FileInfoProto.Builder builder = HFileProtos.FileInfoProto.newBuilder();
for (Map.Entry<byte[], byte[... | 3.26 |
hbase_HFileInfo_read_rdh | /**
* Populate this instance with what we find on the passed in <code>in</code> stream. Can
* deserialize protobuf of old Writables format.
*
* @see #write(DataOutputStream)
*/
void read(final DataInputStream in) throws IOException {
// This code is tested over in TestHFileReaderV1 where we read an old hfile w... | 3.26 |
hbase_HFileInfo_append_rdh | /**
* Append the given key/value pair to the file info, optionally checking the key prefix.
*
* @param k
* key to add
* @param v
* value to add
* @param checkPrefix
* whether to check that the provided key does not start with the reserved
* prefix
* @return this file info object
* @throws IOException... | 3.26 |
hbase_HFileInfo_parseWritable_rdh | /**
* Now parse the old Writable format. It was a list of Map entries. Each map entry was a key and a
* value of a byte []. The old map format had a byte before each entry that held a code which was
* short for the key or value type. We know it was a byte [] so in below we just read and dump it.
*/
void parseWritab... | 3.26 |
hbase_HFileInfo_initMetaAndIndex_rdh | /**
* should be called after initTrailerAndContext
*/
public void initMetaAndIndex(HFile.Reader reader) throws IOException {
ReaderContext context = reader.getContext();
try {
HFileBlock.FSReader blockReader = reader.getUncachedBlockReader();
// Initialize an block iterator, and parse load-on-open blocks i... | 3.26 |
hbase_HFileInfo_m0_rdh | /**
* Fill our map with content of the pb we read off disk
*
* @param fip
* protobuf message to read
*/
void m0(final HFileProtos.FileInfoProto fip) {
this.map.clear();
for (BytesBytesPair pair : fip.getMapEntryList()) {
this.map.put(pair.getFirst().toByteArray(), pair.getSecond().toByteArray());}
} | 3.26 |
hbase_HFileInfo_checkFileVersion_rdh | /**
* File version check is a little sloppy. We read v3 files but can also read v2 files if their
* content has been pb'd; files written with 0.98.
*/
private void checkFileVersion(Path path) {
int majorVersion = trailer.getMajorVersion();
if (majorVersion == getMajorVersion()) {
return;
}
int minorVersion = tra... | 3.26 |
hbase_ByteArrayComparable_parseFrom_rdh | /**
* Parse a serialized representation of {@link ByteArrayComparable}
*
* @param pbBytes
* A pb serialized {@link ByteArrayComparable} instance
* @return An instance of {@link ByteArrayComparable} made from <code>bytes</code>
* @see #toByteArray
*/
@SuppressWarnings("DoNotCallSuggester")public static
ByteArra... | 3.26 |
hbase_ByteArrayComparable_m0_rdh | /**
* Return true if and only if the fields of the comparator that are serialized are equal to the
* corresponding fields in other.
*/
boolean m0(ByteArrayComparable other) {
if (other == this) {
return true;
}
return Bytes.equals(this.getValue(), other.getValue());
} | 3.26 |
hbase_ServerCommandLine_logProcessInfo_rdh | /**
* Logs information about the currently running JVM process including the environment variables.
* Logging of env vars can be disabled by setting {@code "hbase.envvars.logging.disabled"} to
* {@code "true"}.
* <p>
* If enabled, you can also exclude environment variables containing certai... | 3.26 |
hbase_ServerCommandLine_usage_rdh | /**
* Print usage information for this command line.
*
* @param message
* if not null, print this message before the usage info.
*/protected void usage(String message) {
if (message != null) {
System.err.println(message);
System.err.println("");
}
System.err.println(getUsage());
} | 3.26 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.