name stringlengths 12 178 | code_snippet stringlengths 8 36.5k | score float64 3.26 3.68 |
|---|---|---|
hbase_MetaTableLocator_getMetaRegionLocation_rdh | /**
* Gets the meta region location, if available. Does not block.
*
* @param zkw
* reference to the {@link ZKWatcher} which also contains configuration and
* operation
* @param replicaId
* the ID of the replica
* @return server name
*/
@RestrictedApi(explanation = "Should only be called in self or ZKUti... | 3.26 |
hbase_MetaTableLocator_getMetaRegionState_rdh | /**
* Load the meta region state from the meta region server ZNode.
*
* @param zkw
* reference to the {@link ZKWatcher} which also contains configuration and
* operation
* @param replicaId
* the ID of the replica
* @throws KeeperException
* if a ZooKeeper operation fails
*/
public static RegionState ... | 3.26 |
hbase_MetaTableLocator_deleteMetaLocation_rdh | /**
* Deletes the location of <code>hbase:meta</code> in ZooKeeper.
*
* @param zookeeper
* zookeeper reference
* @throws KeeperException
* unexpected zookeeper exception
*/
@RestrictedApi(explanation = "Should only be called in tests", link = "", allowedOnPath = ".*/src/test/.*")
public static void deleteMet... | 3.26 |
hbase_CompactionProgress_getTotalCompactingKVs_rdh | /**
* Returns the total compacting key values in currently running compaction
*/
public long getTotalCompactingKVs() {
if (totalCompactingKVs < currentCompactedKVs) {
LOG.debug("totalCompactingKVs={} less than currentCompactedKVs={}", totalCompactingKVs, currentCompactedKVs);
return currentCompact... | 3.26 |
hbase_CompactionProgress_getTotalCompactedSize_rdh | /**
* Returns the total data size processed by the currently running compaction, in bytes
*/
public long getTotalCompactedSize() {
return totalCompactedSize;
} | 3.26 |
hbase_CompactionProgress_getCurrentCompactedKvs_rdh | /**
* Returns the completed count of key values in currently running compaction
*/
public long getCurrentCompactedKvs() {
return currentCompactedKVs;} | 3.26 |
hbase_CompactionProgress_complete_rdh | /**
* Marks the compaction as complete by setting total to current KV count; Total KV count is an
* estimate, so there might be a discrepancy otherwise.
*/
public void complete() {
this.totalCompactingKVs = this.currentCompactedKVs;
} | 3.26 |
hbase_CompactionProgress_cancel_rdh | /**
* Cancels the compaction progress, setting things to 0.
*/
public void cancel() {
this.currentCompactedKVs = this.totalCompactingKVs = 0;
} | 3.26 |
hbase_CompactionProgress_getProgressPct_rdh | /**
* getter for calculated percent complete
*/
public float getProgressPct() {
return ((float) (currentCompactedKVs)) / getTotalCompactingKVs();
} | 3.26 |
hbase_AbstractStateMachineTableProcedure_checkTableModifiable_rdh | /**
* Check whether a table is modifiable - exists and either offline or online with config set
*
* @param env
* MasterProcedureEnv
*/
protected void checkTableModifiable(final MasterProcedureEnv env) throws IOException {
// Checks whether the table exists
if (!env.getMasterServices().getTableDescriptors... | 3.26 |
hbase_AbstractStateMachineTableProcedure_checkOnline_rdh | /**
* Check region is online.
*/
protected static void checkOnline(MasterProcedureEnv env, RegionInfo ri)
throws DoNotRetryRegionException {
RegionStateNode regionNode = env.getAssignmentManager().getRegionStates().getRegionStateNode(ri);
if (regionNode == null) {
throw new UnknownRegionException("N... | 3.26 |
hbase_MetricsUserAggregateImpl_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 String getActiveUser()
{
Optional<User> user = RpcServer.getRequestUser();
if (!user.isPresent()) {
... | 3.26 |
hbase_BusyRegionSplitPolicy_updateRate_rdh | /**
* Update the blocked request rate based on number of blocked and total write requests in the last
* aggregation window, or since last call to this method, whichever is farthest in time. Uses
* weighted rate calculation based on the previous rate and new data.
*
* @return Updated blocked request rate.
*/
priva... | 3.26 |
hbase_CoprocessorBlockingRpcCallback_run_rdh | /**
* Called on completion of the RPC call with the response object, or {@code null} in the case of
* an error.
*
* @param parameter
* the response object or {@code null} if an error occurred
*/
@Override
public void run(R parameter) {
synchronized(this) {
result = parameter;
resultSet = t... | 3.26 |
hbase_CoprocessorBlockingRpcCallback_get_rdh | /**
* Returns the parameter passed to {@link #run(Object)} or {@code null} if a null value was
* passed. When used asynchronously, this method will block until the {@link #run(Object)} method
* has been called.
*
* @return the response object or {@code null} if no response was passed
*... | 3.26 |
hbase_AsyncMetaRegionLocator_getRegionLocationInCache_rdh | // only used for testing whether we have cached the location for a region.
RegionLocations getRegionLocationInCache() {
return f0.get();
} | 3.26 |
hbase_AsyncMetaRegionLocator_m0_rdh | // only used for testing whether we have cached the location for a table.
int m0() {
RegionLocations locs = f0.get();
return locs != null ? locs.numNonNullElements()
: 0;} | 3.26 |
hbase_AsyncMetaRegionLocator_getRegionLocations_rdh | /**
* Get the region locations for meta region. If the location for the given replica is not
* available in the cached locations, then fetch from the HBase cluster.
* <p/>
* The <code>replicaId</code> parameter is important. If the region replication config for meta
* region is changed, then the cached region loca... | 3.26 |
hbase_FavoredNodesPlan_removeFavoredNodes_rdh | /**
* Remove a favored node assignment
*
* @return the list of favored region server for this region based on the plan
*/
List<ServerName> removeFavoredNodes(RegionInfo region) {
return favoredNodesMap.remove(region.getRegionNameAsString());
} | 3.26 |
hbase_FavoredNodesPlan_getFavoredServerPosition_rdh | /**
* Return the position of the server in the favoredNodes list. Assumes the favoredNodes list is of
* size 3.
*/
public static Position getFavoredServerPosition(List<ServerName> favoredNodes, ServerName server) {
if (((favoredNodes == null) || (server == null)) || (favoredNodes.size() != FavoredNodeAssignment... | 3.26 |
hbase_FavoredNodesPlan_updateFavoredNodesMap_rdh | /**
* Update an assignment to the plan
*/
public void updateFavoredNodesMap(RegionInfo region, List<ServerName> servers) {
if (((region == null) || (servers == null)) || servers.isEmpty()) {
return;
}
this.favoredNodesMap.put(region.getRegionNameAsString(), servers);
} | 3.26 |
hbase_FavoredNodesPlan_getAssignmentMap_rdh | /**
* Return the mapping between each region to its favored region server list.
*/
public Map<String, List<ServerName>> getAssignmentMap() {
// Make a deep copy so changes don't harm our copy of favoredNodesMap.
return this.favoredNodesMap.entrySet().stream().collect(Collectors.toMap(k -> k.getKey(), v -> new... | 3.26 |
hbase_FavoredNodesPlan_getFavoredNodes_rdh | /**
* Returns the list of favored region server for this region based on the plan
*/
public List<ServerName> getFavoredNodes(RegionInfo region) {
return favoredNodesMap.get(region.getRegionNameAsString());
} | 3.26 |
hbase_RegionNormalizerFactory_getRegionNormalizer_rdh | /**
* Create a region normalizer from the given conf.
*
* @param conf
* configuration
* @return {@link RegionNormalizer} implementation
*/
private static RegionNormalizer getRegionNormalizer(Configuration conf) {
// Create instance of Region Normalizer
Class<? extends RegionNormalizer> balancerKlass = conf.getC... | 3.26 |
hbase_RegionNormalizerFactory_createNormalizerManager_rdh | // TODO: consolidate this down to MasterServices
public static RegionNormalizerManager createNormalizerManager(final Configuration conf, final MasterRegion masterRegion, final ZKWatcher zkWatcher, final HMaster master) throws DeserializationException, IOException, KeeperException {
final RegionNormalizer regionN... | 3.26 |
hbase_RegionServerSpaceQuotaManager_getRegionSizeStore_rdh | /**
* Returns the {@link RegionSizeStore} tracking filesystem utilization by each region.
*
* @return A {@link RegionSizeStore} implementation.
*/
public RegionSizeStore getRegionSizeStore() {
return regionSizeStore;
} | 3.26 |
hbase_RegionServerSpaceQuotaManager_copyActiveEnforcements_rdh | /**
* Returns the collection of tables which have quota violation policies enforced on this
* RegionServer.
*/
Map<TableName, SpaceViolationPolicyEnforcement> copyActiveEnforcements() {
// Allows reads to happen concurrently (or while the map is being updated)
return new HashMap<>(this.enforcedPolicies);
} | 3.26 |
hbase_RegionServerSpaceQuotaManager_updateQuotaSnapshot_rdh | /**
* Updates the current {@link SpaceQuotaSnapshot}s for the RegionServer.
*
* @param newSnapshots
* The space quota snapshots.
*/
public void updateQuotaSnapshot(Map<TableName, SpaceQuotaSnapshot> newSnapshots) {
currentQuotaSnapshots.set(Objects.requireNonNull(newSnapshots));
} | 3.26 |
hbase_RegionServerSpaceQuotaManager_enforceViolationPolicy_rdh | /**
* Enforces the given violationPolicy on the given table in this RegionServer.
*/
public void enforceViolationPolicy(TableName tableName, SpaceQuotaSnapshot snapshot) {
SpaceQuotaStatus status = snapshot.getQuotaStatus();
if (!status.isInViolation()) {
throw new IllegalStateException(tableName + "... | 3.26 |
hbase_RegionServerSpaceQuotaManager_buildFileArchiveRequest_rdh | /**
* Builds the protobuf message to inform the Master of files being archived.
*
* @param tn
* The table the files previously belonged to.
* @param archivedFiles
* The files and their size in bytes that were archived.
* @return The protobuf representation
*/
public FileArchiveNotificationRequest buildFileA... | 3.26 |
hbase_RegionServerSpaceQuotaManager_areCompactionsDisabled_rdh | /**
* Returns whether or not compactions should be disabled for the given <code>tableName</code> per
* a space quota violation policy. A convenience method.
*
* @param tableName
* The table to check
* @return True if compactions should be disabled for the table, false otherwise.
*/
public boolean areCompaction... | 3.26 |
hbase_RegionServerSpaceQuotaManager_disableViolationPolicyEnforcement_rdh | /**
* Disables enforcement on any violation policy on the given <code>tableName</code>.
*/
public void disableViolationPolicyEnforcement(TableName tableName) {if (LOG.isTraceEnabled()) {
LOG.trace("Disabling violation policy enforcement on "
+ tableName);
}
// "Disables" the policy
synchro... | 3.26 |
hbase_RegionServerSpaceQuotaManager_isStarted_rdh | /**
* Returns if the {@code Chore} has been started.
*/
public boolean isStarted() {
return started;
} | 3.26 |
hbase_RegionServerSpaceQuotaManager_copyQuotaSnapshots_rdh | /**
* Copies the last {@link SpaceQuotaSnapshot}s that were recorded. The current view of what the
* RegionServer thinks the table's utilization is.
*/
public Map<TableName, SpaceQuotaSnapshot> copyQuotaSnapshots() {
return new HashMap<>(currentQuotaSnapshots.get());
} | 3.26 |
hbase_RegionServerSpaceQuotaManager_getActiveEnforcements_rdh | /**
* Creates an object well-suited for the RegionServer to use in verifying active policies.
*/
public ActivePolicyEnforcement getActiveEnforcements() {
return new ActivePolicyEnforcement(copyActiveEnforcements(), copyQuotaSnapshots(), rsServices);
}
/**
* Converts a map of table to {@link SpaceViolationPolicy... | 3.26 |
hbase_ReplicationPeerConfigBuilder_putAllPeerData_rdh | /**
* Sets all of the provided serialized peer configuration data.
*
* @return {@code this}
*/
@InterfaceAudience.Private
default ReplicationPeerConfigBuilder putAllPeerData(Map<byte[], byte[]> peerData) {
peerData.forEach(this::putPeerData);
return this;
} | 3.26 |
hbase_ReplicationPeerConfigBuilder_putAllConfiguration_rdh | /**
* Adds all of the provided "raw" configuration entries to {@code this}.
*
* @param configuration
* A collection of raw configuration entries
* @return {@code this}
*/
@InterfaceAudience.Private
default ReplicationPeerConfigBuilder putAllConfiguration(Map<String, String> configuration) {
configuration.... | 3.26 |
hbase_TableQuotaSnapshotStore_getSnapshotSizesForTable_rdh | /**
* Fetches any serialized snapshot sizes from the quota table for the {@code tn} provided. Any
* malformed records are skipped with a warning printed out.
*/
long getSnapshotSizesForTable(TableName tn) throws IOException {
try (Table quotaTable = conn.getTable(Q... | 3.26 |
hbase_TableQuotaSnapshotStore_getQuotaForTable_rdh | /**
* Fetches the table quota. Visible for mocking/testing.
*/ Quotas getQuotaForTable(TableName table) throws IOException {
return QuotaTableUtil.getTableQuota(conn, table);
} | 3.26 |
hbase_DataBlockEncodingValidator_validateDBE_rdh | /**
* Check DataBlockEncodings of column families are compatible.
*
* @return number of column families with incompatible DataBlockEncoding
* @throws IOException
* if a remote or network exception occurs
*/
private int validateDBE() throws IOException {
int incompatibilities = 0;
LOG.info("Validating Da... | 3.26 |
hbase_FanOutOneBlockAsyncDFSOutputSaslHelper_wrapAndSetPayload_rdh | /**
* Create a ByteString from byte array without copying (wrap), and then set it as the payload
* for the builder.
*
* @param builder
* builder for HDFS DataTransferEncryptorMessage.
* @param payload
* byte array of payload.
*/
static void wrapAndSetPayload(DataTransferEncryptorMessageProto.Builder builder... | 3.26 |
hbase_SplitLogTask_parseFrom_rdh | /**
*
* @param data
* Serialized date to parse.
* @return An SplitLogTaskState instance made of the passed <code>data</code>
* @see #toByteArray()
*/
public static SplitLogTask parseFrom(final byte[] data) throws DeserializationException {
ProtobufUtil.expectPBMagicPrefix(data);try {
int prefixLen =... | 3.26 |
hbase_SplitLogTask_toByteArray_rdh | /**
*
* @return This instance serialized into a byte array
* @see #parseFrom(byte[])
*/
public byte[] toByteArray() {
// First create a pb ServerName. Then create a ByteString w/ the TaskState
// bytes in it. Finally create a SplitLogTaskState passing in the two
// pbs just created.
HBaseProtos.Serv... | 3.26 |
hbase_AbstractRecoveredEditsOutputSink_deleteOneWithFewerEntries_rdh | // delete the one with fewer wal entries
private void deleteOneWithFewerEntries(RecoveredEditsWriter editsWriter, Path dst) throws IOException {
long dstMinLogSeqNum = -1L;
try (WALStreamReader reader = walSplitter.getWalFactory().createStreamReader(walSplitter.walFS, dst)) {
WAL.Entry entry = reader.ne... | 3.26 |
hbase_AbstractRecoveredEditsOutputSink_updateRegionMaximumEditLogSeqNum_rdh | /**
* Update region's maximum edit log SeqNum.
*/
void updateRegionMaximumEditLogSeqNum(WAL.Entry entry) {
synchronized(regionMaximumEditLogSeqNum) {
String regionName = Bytes.toString(entry.getKey().getEncodedRegionName());
Long currentMaxSeqNum = regionMaximumEditLogSeqNum.get(regionName);
... | 3.26 |
hbase_AbstractRecoveredEditsOutputSink_createRecoveredEditsWriter_rdh | /**
* Returns a writer that wraps a {@link WALProvider.Writer} and its Path. Caller should close.
*/
protected RecoveredEditsWriter createRecoveredEditsWriter(TableName tableName, byte[] region, long seqId) throws
IOException {
Path regionEditsPath = getRegionSplitEditsPath(tableName, region, seqId, walSplitter... | 3.26 |
hbase_QuotaFilter_setUserFilter_rdh | /**
* Set the user filter regex
*
* @param regex
* the user filter
* @return the quota filter object
*/
public QuotaFilter setUserFilter(final String regex) { this.userRegex = regex;
hasFilters |= StringUtils.isNotEmpty(regex);
return this;
} | 3.26 |
hbase_QuotaFilter_getTypeFilters_rdh | /**
* Returns the QuotaType types that we want to filter one
*/
public Set<QuotaType> getTypeFilters() {
return types;
} | 3.26 |
hbase_QuotaFilter_setTableFilter_rdh | /**
* Set the table filter regex
*
* @param regex
* the table filter
* @return the quota filter object
*/
public QuotaFilter setTableFilter(final String regex) {
this.tableRegex = regex;
hasFilters |= StringUtils.isNotEmpty(regex);
return this;
} | 3.26 |
hbase_QuotaFilter_getRegionServerFilter_rdh | /**
* Returns the RegionServer filter regex
*/
public String getRegionServerFilter() {
return regionServerRegex;
} | 3.26 |
hbase_QuotaFilter_getUserFilter_rdh | /**
* Returns the User filter regex
*/
public String getUserFilter() {
return userRegex;
} | 3.26 |
hbase_QuotaFilter_setRegionServerFilter_rdh | /**
* Set the region server filter regex
*
* @param regex
* the region server filter
* @return the quota filter object
*/
public QuotaFilter setRegionServerFilter(final String regex) {
this.regionServerRegex = regex;
hasFilters |= StringUtils.isNotEmpty(regex);
return this;
} | 3.26 |
hbase_QuotaFilter_setNamespaceFilter_rdh | /**
* Set the namespace filter regex
*
* @param regex
* the namespace filter
* @return the quota filter object
*/
public QuotaFilter setNamespaceFilter(final String regex) {
this.namespaceRegex = regex;
hasFilters |= StringUtils.isNotEmpty(regex);
return this;
} | 3.26 |
hbase_QuotaFilter_isNull_rdh | /**
* Returns true if the filter is empty
*/
public boolean isNull() {
return !hasFilters;
} | 3.26 |
hbase_QuotaFilter_getTableFilter_rdh | /**
* Returns the Table filter regex
*/
public String getTableFilter() {
return tableRegex;
} | 3.26 |
hbase_QuotaFilter_getNamespaceFilter_rdh | /**
* Returns the Namespace filter regex
*/
public String getNamespaceFilter() {
return namespaceRegex;
} | 3.26 |
hbase_QuotaFilter_addTypeFilter_rdh | /**
* Add a type to the filter list
*
* @param type
* the type to filter on
* @return the quota filter object
*/
public QuotaFilter addTypeFilter(final QuotaType type) {
this.types.add(type);
... | 3.26 |
hbase_AbstractWALProvider_getRemoteWALPrefix_rdh | // Use a timestamp to make it identical. That means, after we transit the peer to DA/S and then
// back to A, the log prefix will be changed. This is used to simplify the implementation for
// replication source, where we do not need to consider that a terminated shipper could be added
// back.
private String getRemote... | 3.26 |
hbase_LzmaCompressor_checkSizeAndGrow_rdh | // ByteBufferOutputStream will reallocate the output buffer if it is too small. We
// do not want that behavior here.
@Override
protected void checkSizeAndGrow(int extra) {
long capacityNeeded = curBuf.position() + ((long) (extra));
if (capacityNeeded > curBuf.limit())
{
throw new BufferOverflow... | 3.26 |
hbase_LzmaCompressor_maxCompressedLength_rdh | // Package private
int maxCompressedLength(int len) {
return len + CompressionUtil.compressionOverhead(len);
} | 3.26 |
hbase_NamespaceAuditor_getRegionCountOfTable_rdh | /**
* Get region count for table
*
* @param tName
* - table name
* @return cached region count, or -1 if table status not found
* @throws IOException
* Signals that the namespace auditor has not been initialized
*/
public int
getRegionCountOfTable(TableName tName) throws IOException {
if (stateManager.i... | 3.26 |
hbase_NamespaceAuditor_isInitialized_rdh | /**
* Checks if namespace auditor is initialized. Used only for testing.
*
* @return true, if is initialized
*/
public boolean isInitialized() {
return stateManager.isInitialized();
} | 3.26 |
hbase_NamespaceAuditor_getState_rdh | /**
*
* @param namespace
* The name of the namespace
* @return An instance of NamespaceTableAndRegionInfo
*/public NamespaceTableAndRegionInfo
getState(String namespace) {
if (stateManager.isInitialized()) {
return stateManager.getState(namespace);
}
return null;
} | 3.26 |
hbase_NamespaceAuditor_checkQuotaToCreateTable_rdh | /**
* Check quota to create table. We add the table information to namespace state cache, assuming
* the operation will pass. If the operation fails, then the next time namespace state chore runs
* namespace state cache will be corrected.
*
* @param tName
* - The table name to check quota.
* @param regions
* ... | 3.26 |
hbase_NamespaceAuditor_checkQuotaToUpdateRegion_rdh | /**
* Check and update region count quota for an existing table.
*
* @param tName
* - table name for which region count to be updated.
* @param regions
* - Number of regions that will be added.
* @throws IOException
* Signals that an I/O exception has occurred.
*/
public void checkQuotaToUpdateRegion(Tab... | 3.26 |
hbase_BitComparator_getOperator_rdh | /**
* Returns the bitwise operator
*/
public BitwiseOp getOperator() {
return bitOperator;
} | 3.26 |
hbase_BitComparator_parseFrom_rdh | /**
* Parse a serialized representation of {@link BitComparator}
*
* @param pbBytes
* A pb serialized {@link BitComparator} instance
* @return An instance of {@link BitComparator} made from <code>bytes</code>
* @throws DeserializationException
* if an error occurred
* @see #toByteArray
*/
public static Bit... | 3.26 |
hbase_BitComparator_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.
*/
@Override
boolean areSerializedFieldsEqual(ByteArrayComparable other) {
if (other == this) {
return true;
}
if (!(other instanceof BitComparato... | 3.26 |
hbase_BitComparator_toByteArray_rdh | /**
* Returns The comparator serialized using pb
*/@Override
public byte[] toByteArray() {ComparatorProtos.BitComparator.Builder builder = ComparatorProtos.BitComparator.newBuilder();
builder.setComparable(ProtobufUtil.toByteArrayComparable(this.value));
ComparatorProtos.BitComparator.BitwiseOp bitwiseOpPb =... | 3.26 |
hbase_ClusterStatusPublisher_generateDeadServersListToSend_rdh | /**
* Create the dead server to send. A dead server is sent NB_SEND times. We send at max
* MAX_SERVER_PER_MESSAGE at a time. if there are too many dead servers, we send the newly dead
* first.
*/protected List<ServerName>
generateDeadServersListToSend() {// We're getting the message sent since last time, and add t... | 3.26 |
hbase_ClusterStatusPublisher_getDeadServers_rdh | /**
* Get the servers which died since a given timestamp. protected because it can be subclassed by
* the tests.
*/
protected List<Pair<ServerName, Long>> getDeadServers(long since) {
if
(master.getServerManager() == null) {
return Collections.emptyList();
}
... | 3.26 |
hbase_MultiRowRangeFilter_resetExclusive_rdh | /**
* Resets the exclusive flag.
*/
public void resetExclusive() {
exclusive = false;
} | 3.26 |
hbase_MultiRowRangeFilter_isStartRowInclusive_rdh | /**
* Returns if start row is inclusive.
*/
public boolean isStartRowInclusive() {
return startRowInclusive;
} | 3.26 |
hbase_MultiRowRangeFilter_get_rdh | /**
* Gets the RowRange at the given offset.
*/
@SuppressWarnings({ "unchecked", "TypeParameterUnusedInFormals" })
public <T extends BasicRowRange> T get(int i) {
return ((T) (ranges.get(i)));
} | 3.26 |
hbase_MultiRowRangeFilter_hasFoundFirstRange_rdh | /**
* Returns true if the first matching row range was found.
*/
public boolean
hasFoundFirstRange() {
return foundFirstRange;
} | 3.26 |
hbase_MultiRowRangeFilter_getNextRangeIndex_rdh | /**
* Calculates the position where the given rowkey fits in the ranges list.
*
* @param rowKey
* the row key to calculate
* @return index the position of the row key
*/
public int getNextRangeIndex(byte[] rowKey)
{
BasicRowRange temp;
if (reversed) {
temp = new ReversedRowRange(null, true, row... | 3.26 |
hbase_MultiRowRangeFilter_parseFrom_rdh | /**
* Parse a serialized representation of {@link MultiRowRangeFilter}
*
* @param pbBytes
* A pb serialized instance
* @return An instance of {@link MultiRowRangeFilter}
* @throws DeserializationException
* if an error occurred
* @see #toByteArray
*/
public static MultiRowRangeFilter parseFrom(final byte[]... | 3.26 |
hbase_MultiRowRangeFilter_isInitialized_rdh | /**
* Returns true if this class has been initialized by calling {@link #initialize(boolean)}.
*/
public boolean isInitialized() {return initialized;
} | 3.26 |
hbase_MultiRowRangeFilter_flipAndReverseRanges_rdh | /**
* Rebuilds the sorted ranges (by startKey) into an equivalent sorted list of ranges, only by
* stopKey instead. Descending order and the ReversedRowRange compareTo implementation make sure
* that we can use Collections.binarySearch().
*/
static List<ReversedRowRange> flipAndReverseRanges(List<RowRange> ranges) ... | 3.26 |
hbase_MultiRowRangeFilter_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 MultiRowRangeFilter)) {
return fa... | 3.26 |
hbase_MultiRowRangeFilter_setFoundFirstRange_rdh | /**
* Sets {@link #foundFirstRange} to {@code true}, indicating that we found a matching row range.
*/
public void setFoundFirstRange() {
this.foundFirstRange = true;
} | 3.26 |
hbase_MultiRowRangeFilter_toByteArray_rdh | /**
* Returns The filter serialized using pb
*/
@Override
public byte[] toByteArray() {
FilterProtos.MultiRowRangeFilter.Builder builder = FilterProtos.MultiRowRangeFilter.newBuilder();
for (RowRange range : rangeList) {
if (range != null) {
FilterProtos.RowRange.Builder rangebuilder = F... | 3.26 |
hbase_MultiRowRangeFilter_isExclusive_rdh | /**
* Returns true if the current range's key is exclusive
*/
public boolean isExclusive() {return exclusive;
} | 3.26 |
hbase_MultiRowRangeFilter_isIterationComplete_rdh | /**
* Returns true if we exhausted searching all row ranges.
*/
public boolean isIterationComplete(int index) {
return index >= ranges.size();
} | 3.26 |
hbase_MultiRowRangeFilter_isStopRowInclusive_rdh | /**
* Returns if stop row is inclusive.
*/
public boolean isStopRowInclusive() {
return stopRowInclusive;
} | 3.26 |
hbase_RegionState_matches_rdh | // the region is CLOSED because of a RS crashes. Usually it is the same
// with CLOSED, but for some operations such as merge/split, we can not
// apply it to a region in this state, as it may lead to data loss as we
// may have some data in recovered edits.
public boolean matche... | 3.26 |
hbase_RegionState_equals_rdh | /**
* Check if two states are the same, except timestamp
*/
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj
instanceof RegionState)) {
return false;
}
RegionState tmp = ((RegionState) (obj));
return ((RegionInfo.COMPARATOR.compare... | 3.26 |
hbase_RegionState_isReadyToOffline_rdh | /**
* Check if a region state can transition to offline
*/
public boolean isReadyToOffline() {
return (((isMerged() || isSplit()) || isOffline()) || isSplittingNew()) || isMergingNew();
... | 3.26 |
hbase_RegionState_convert_rdh | /**
* Convert a protobuf HBaseProtos.RegionState to a RegionState
*
* @return the RegionState
*/
public static RegionState convert(ClusterStatusProtos.RegionState proto) {
return new RegionState(ProtobufUtil.toRegionInfo(proto.getRegionInfo()), State.convert(proto.getState()), proto.getStamp(), null);
} | 3.26 |
hbase_RegionState_hashCode_rdh | /**
* Don't count timestamp in hash code calculation
*/
@Override
public int hashCode() {
return ((serverName != null ? serverName.hashCode() * 11 :
0) + hri.hashCode()) + (5 * state.ordinal());
} | 3.26 |
hbase_RegionState_updateRitDuration_rdh | /**
* Update the duration of region in transition
*
* @param previousStamp
* previous RegionState's timestamp
*/
@InterfaceAudience.Private
void updateRitDuration(long
previousStamp) {
this.ritDuration += this.stamp - previousStamp;
} | 3.26 |
hbase_RegionState_isReadyToOnline_rdh | /**
* Check if a region state can transition to online
*/
public boolean isReadyToOnline() {
return (isOpened() || isSplittingNew()) || isMergingNew();
} | 3.26 |
hbase_RegionState_isUnassignable_rdh | /**
* Check if a region state is one of offline states that can't transition to pending_close/closing
* (unassign/offline)
*/
public static boolean isUnassignable(State state) {
return ((((state == State.MERGED) || (state == State.SPLIT)) || (state == State.OFFLINE)) || (state == State.SPLITTING_NEW)) || (state ... | 3.26 |
hbase_RegionState_toDescriptiveString_rdh | /**
* A slower (but more easy-to-read) stringification
*/
public String toDescriptiveString() {
long relTime = EnvironmentEdgeManager.currentTime() - stamp;
return ((((((((hri.getRegionNameAsString() + " state=") + state) + ", ts=") + new Date(stamp)) + " (") + (relTime / 1000)) + "s ago)") + ", server=") +... | 3.26 |
hbase_RegionState_m0_rdh | /**
* Convert to protobuf ClusterStatusProtos.RegionState.State
*/
public State m0() {
ClusterStatusProtos.RegionState.State v1;
switch (this) {
case OFFLINE :
v1 = State.OFFLINE;
break;
case OPENING :
v1 = State.OPENING;
bre... | 3.26 |
hbase_ZKLeaderManager_waitToBecomeLeader_rdh | /**
* Blocks until this instance has claimed the leader ZNode in ZooKeeper
*/
public void waitToBecomeLeader() {
while (!candidate.isStopped()) {
try {
if (ZKUtil.createEphemeralNodeAndWatch(watcher, leaderZNode, nodeId)) {
// claimed the leader znode
leaderExists.set(true);
if (LOG.isDe... | 3.26 |
hbase_ZKLeaderManager_stepDownAsLeader_rdh | /**
* Removes the leader znode, if it is currently claimed by this instance.
*/
public void stepDownAsLeader() {
try {
synchronized(f0) {
if (!leaderExists.get()) {
return;
}
byte[] leaderId = ZKUtil.getData(watcher, leaderZNode);
if ((leaderId != null) && Bytes.equals(nodeId, leaderId)) {
LOG.info("Stepping... | 3.26 |
hbase_TableModel_setName_rdh | /**
*
* @param name
* the name to set
*/
public void setName(String name) {
this.name = name;
} | 3.26 |
hbase_TableModel_toString_rdh | /* (non-Javadoc)
@see java.lang.Object#toString()
*/
@Override
public String
toString() {
return this.name;
} | 3.26 |
hbase_TableModel_getName_rdh | /**
* Returns the name
*/
@XmlAttribute
public String getName() {
return name;
} | 3.26 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.