name stringlengths 12 178 | code_snippet stringlengths 8 36.5k | score float64 3.26 3.68 |
|---|---|---|
hbase_CompactionPipeline_swap_rdh | /**
* Swaps the versioned list at the tail of the pipeline with a new segment. Swapping only if there
* were no changes to the suffix of the list since the version list was created.
*
* @param versionedList
* suffix of the pipeline to be replaced can be tail or all the pipeline
* @param segment
* new segment... | 3.26 |
hbase_RESTServlet_isReadOnly_rdh | /**
* Helper method to determine if server should only respond to GET HTTP method requests.
*
* @return boolean for server read-only state
*/
boolean isReadOnly() {
return getConfiguration().getBoolean("hbase.rest.readonly", false);
} | 3.26 |
hbase_RESTServlet_shutdown_rdh | /**
* Shutdown any services that need to stop
*/
void shutdown() {
if (pauseMonitor != null)
pauseMonitor.stop();
if (connectionCache != null)
connectionCache.shutdown();
} | 3.26 |
hbase_RESTServlet_getInstance_rdh | /**
* Returns the RESTServlet singleton instance
*/
@SuppressWarnings(value = "MS_EXPOSE_REP", justification = "singleton pattern")
public static synchronized RESTServlet getInstance() {
assert INSTANCE != null;
return INSTANCE;
} | 3.26 |
hbase_RESTServlet_getTable_rdh | /**
* Caller closes the table afterwards.
*/
Table getTable(String tableName) throws IOException {
return connectionCache.getTable(tableName);
} | 3.26 |
hbase_RESTServlet_getConnectionCache_rdh | /**
* Returns the ConnectionCache instance
*/
public ConnectionCache getConnectionCache() {
return connectionCache;
} | 3.26 |
hbase_StoreFileScanner_getSeekCount_rdh | // Test methods
static final long getSeekCount() {
return seekCount.sum();
} | 3.26 |
hbase_StoreFileScanner_seekToPreviousRowWithoutHint_rdh | /**
* This variant of the {@link StoreFileScanner#seekToPreviousRow(Cell)} method requires two seeks
* and one reseek. The extra expense/seek is with the intent of speeding up subsequent calls by
* using the {@link StoreFileScanner#seekToPreviousRowWithHint} which this method seeds the state
* for by setting {@link... | 3.26 |
hbase_StoreFileScanner_seekToPreviousRowWithHint_rdh | /**
* This variant of the {@link StoreFileScanner#seekToPreviousRow(Cell)} method requires one seek
* and one reseek. This method maintains state in {@link StoreFileScanner#previousRow} which only
* makes sense in the context of a sequential row-by-row reverse scan.
* {@link StoreFileScanner#previousRow} should be ... | 3.26 |
hbase_StoreFileScanner_requestSeek_rdh | /**
* Pretend we have done a seek but don't do it yet, if possible. The hope is that we find
* requested columns in more recent files and won't have to seek in older files. Creates a fake
* key/value with the given row/column and the highest (most recent) possible timestamp we might
* get from this file. When users... | 3.26 |
hbase_StoreFileScanner_getScannerOrder_rdh | /**
*
* @see KeyValueScanner#getScannerOrder()
*/@Override
public long getScannerOrder() {
return
scannerOrder;
} | 3.26 |
hbase_StoreFileScanner_getScannersForStoreFiles_rdh | /**
* Return an array of scanners corresponding to the given set of store files, And set the
* ScanQueryMatcher for each store file scanner for further optimization
*/
public static List<StoreFileScanner> getScannersForStoreFiles(Collection<HStoreFile> files, boolean cacheBlocks, boolean usePrea... | 3.26 |
hbase_StoreFileScanner_seekBeforeAndSaveKeyToPreviousRow_rdh | /**
* Seeks before the seek target cell and saves the location to {@link #previousRow}. If there
* doesn't exist a KV in this file before the seek target cell, reposition the scanner at the
* beginning of the storefile (in preparation to a reseek at or after the seek key) and set the
* {@link #previousRow} to null.... | 3.26 |
hbase_StoreFileScanner_seekToPreviousRowStateless_rdh | /**
* This variant of the {@link StoreFileScanner#seekToPreviousRow(Cell)} method requires two seeks.
* It should be used if the cost for seeking is lower i.e. when using a fast seeking data block
* encoding like RIV1.
*/
private boolean seekToPreviousRowStateless(Cell originalKey) throws IOException {
Cell key = o... | 3.26 |
hbase_StoreFileScanner_seekAtOrAfter_rdh | /**
* Returns false if not found or if k is after the end.
*/
public static boolean seekAtOrAfter(HFileScanner s, Cell k) throws IOException {
int result = s.seekTo(k);
if (result < 0) {
if (result == HConstants.INDEX_KEY_MAGIC) {
// using faked key
return true;
}
// Passed KV is smaller than first KV in ... | 3.26 |
hbase_MetaTableAccessor_makePutFromRegionInfo_rdh | /**
* Generates and returns a {@link Put} containing the {@link RegionInfo} for the catalog table.
*
* @throws IllegalArgumentException
* when the provided RegionInfo is not the default replica.
*/
public static Put makePutFromRegionInfo(RegionInfo regionInfo, long ts) throws IOException {
return addRegionInfo(n... | 3.26 |
hbase_MetaTableAccessor_scanMeta_rdh | /**
* Performs a scan of META table.
*
* @param connection
* connection we're using
* @param startRow
* Where to start the scan. Pass null if want to begin scan at first row.
* @param stopRow
* Where to stop the scan. Pass null if want to scan all rows from the start one
* @param type
* scanned part o... | 3.26 |
hbase_MetaTableAccessor_updateTableState_rdh | /**
* Update state of the table in meta.
*
* @param connection
* what we use for update
* @param state
* new state
*/
private static void updateTableState(Connection connection, TableState state) throws IOException {
Put put
= makePutFromTableState(state, EnvironmentEdgeManager.currentTime());
putToMetaTab... | 3.26 |
hbase_MetaTableAccessor_fullScanRegions_rdh | // //////////////////////
// Reading operations //
// //////////////////////
/**
* Performs a full scan of <code>hbase:meta</code> for regions.
*
* @param connection
* connection we're using
* @param visitor
* Visitor invoked against each row in regions family.
*/
public static void fullScanRegions(Connectio... | 3.26 |
hbase_MetaTableAccessor_scanByRegionEncodedName_rdh | /**
* Scans META table for a row whose key contains the specified <B>regionEncodedName</B>, returning
* a single related <code>Result</code> instance if any row is found, null otherwise.
*
* @param connection
* the connection to query META table.
* @param regionEncodedName
* the region encoded name to look f... | 3.26 |
hbase_MetaTableAccessor_getMetaHTable_rdh | /**
* Callers should call close on the returned {@link Table} instance.
*
* @param connection
* connection we're using to access Meta
* @return An {@link Table} for <code>hbase:meta</code>
* @throws NullPointerException
* if {@code connection} is {@code null}
*/
publi... | 3.26 |
hbase_MetaTableAccessor_getTableStates_rdh | /**
* Fetch table states from META table
*
* @param conn
* connection to use
* @return map {tableName -> state}
*/
public static Map<TableName, TableState> getTableStates(Connection conn) throws IOException {
final Map<TableName, TableState> states = new LinkedHashMap<>();
ClientMetaTableAccessor.Visitor col... | 3.26 |
hbase_MetaTableAccessor_updateRegionState_rdh | /**
* Update state column in hbase:meta.
*/
public static void updateRegionState(Connection connection, RegionInfo
ri, RegionState.State state) throws IOException {
final Put put = makePutFromRegionInfo(ri);
addRegionStateToPut(put, ri.getReplicaId(), state);
m3(connection, Collections.singletonList(put));
} | 3.26 |
hbase_MetaTableAccessor_getTableRegions_rdh | /**
* Gets all of the regions of the specified table. Do not use this method to get meta table
* regions, use methods in MetaTableLocator instead.
*
* @param connection
* connection we're using
* @param tableName
* table we're looking for
* @param excludeOfflinedSplitParents
* If true, do not include off... | 3.26 |
hbase_MetaTableAccessor_getTableState_rdh | /**
* Fetch table state for given table from META table
*
* @param conn
* connection to use
* @param tableName
* table to fetch state for
*/
@Nullable
public static TableState getTableState(Connection conn, TableName tableName) throws IOException {
if (tableName.equals(TableName.META_TABLE_NAME)) {
return ne... | 3.26 |
hbase_MetaTableAccessor_deleteTableState_rdh | /**
* Remove state for table from meta
*
* @param connection
* to use for deletion
* @param table
* to delete state for
*/
public static void deleteTableState(Connection connection, TableName table) throws IOException {
long time = EnvironmentEdgeManager.currentTime();
Delete delete = new Delete(table.getNam... | 3.26 |
hbase_MetaTableAccessor_makePutFromTableState_rdh | /**
* Construct PUT for given state
*
* @param state
* new state
*/
public static Put makePutFromTableState(TableState state, long ts) {
Put v69 = new Put(state.getTableName().getName(), ts);
v69.addColumn(HConstants.TABLE_FAMILY, HConstants.TABLE_STATE_QUALIFIER, state.convert().toByteArray());
return v69;
} | 3.26 |
hbase_MetaTableAccessor_m2_rdh | /**
*
* @param t
* Table to use
* @param p
* put to make
*/
private static void m2(Table t, Put p) throws IOException
{
debugLogMutation(p);
t.put(p);
} | 3.26 |
hbase_MetaTableAccessor_putToMetaTable_rdh | /**
* Put the passed <code>p</code> to the <code>hbase:meta</code> table.
*
* @param connection
* connection we're using
* @param p
* Put to add to hbase:meta
*/
private static void putToMetaTable(Connection connection, Put p) throws IOException {
try (Table table = getMetaHTable(connection)) {
m2(table, p);... | 3.26 |
hbase_MetaTableAccessor_makeDeleteFromRegionInfo_rdh | /**
* Generates and returns a Delete containing the region info for the catalog table
*/public static Delete makeDeleteFromRegionInfo(RegionInfo regionInfo, long ts) {
if (regionInfo == null) {
throw new IllegalArgumentException("Can't make a delete for null region");
}
if (regionInfo.getReplicaId() != RegionInfo.DEF... | 3.26 |
hbase_MetaTableAccessor_m3_rdh | /**
* Put the passed <code>ps</code> to the <code>hbase:meta</code> table.
*
* @param connection
* connection we're using
* @param ps
* Put to add to hbase:meta
*/
public static void m3(final Connection connection, final List<Put> ps) throws IOException {
if (ps.isEmpty()) {
return;
}
try
(Table t = getMetaH... | 3.26 |
hbase_MetaTableAccessor_deleteFromMetaTable_rdh | /**
* Delete the passed <code>deletes</code> from the <code>hbase:meta</code> table.
*
* @param connection
* connection we're using
* @param deletes
* Deletes to add to hbase:meta This list should support #remove.
*/
private static void deleteFromMetaTable(final Connection connection, final List<Delete> del... | 3.26 |
hbase_MetaTableAccessor_getClosestRegionInfo_rdh | /**
* Returns Get closest metatable region row to passed <code>row</code>
*/
@NonNull
private static RegionInfo getClosestRegionInfo(Connection connection, @NonNull
final TableName tableName, @NonNull
final byte[] row) throws IOException {
byte[] searchRow = RegionInfo.createRegionName(tableName, row, HConstants.NIN... | 3.26 |
hbase_MetaTableAccessor_addRegionsToMeta_rdh | /**
* Adds a hbase:meta row for each of the specified new regions. Initial state for new regions is
* CLOSED.
*
* @param connection
* connection we're using
* @param regionInfos
* region information list
* @param ts
* desired timestamp
* @throws IOException
* if problem connecting or updating meta
*... | 3.26 |
hbase_MetaTableAccessor_updateRegionLocation_rdh | /**
* Updates the location of the specified region in hbase:meta to be the specified server hostname
* and startcode.
* <p>
* Uses passed catalog tracker to get a connection to the server hosting hbase:meta and makes
* edits to that region.
*
* @param connection
* connection we're using
* @param regionInfo
... | 3.26 |
hbase_MetaTableAccessor_getDaughterRegions_rdh | /**
* Returns the daughter regions by reading the corresponding columns of the catalog table Result.
*
* @param data
* a Result object from the catalog table scan
* @return pair of RegionInfo or PairOfSameType(null, null) if region is not a split parent
*/
public static PairOfSameType<RegionInfo> getDaughterR... | 3.26 |
hbase_MetaTableAccessor_m1_rdh | /**
* Performs a scan of META table for given table starting from given row.
*
* @param connection
* connection we're using
* @param visitor
* visitor to call
* @param tableName
* table withing we scan
* @param row
* start scan from this row
* @param rowLimit
* max number of rows to return
*/
pub... | 3.26 |
hbase_MetaTableAccessor_getRegionLocation_rdh | /**
* Returns the HRegionLocation from meta for the given region
*
* @param connection
* connection we're using
* @param regionInfo
* region information
* @return HRegionLocation for the given region
*/
public static HRegionLocation getRegionLocation(Connection connection, RegionInfo regionInfo) throws IOEx... | 3.26 |
hbase_MetaTableAccessor_fullScan_rdh | /**
* Performs a full scan of <code>hbase:meta</code>.
*
* @param connection
* connection we're using
* @param type
* scanned part of meta
* @return List of {@link Result}
*/
private static List<Result> fullScan(Connection connection, QueryType type) throws IOException {
ClientMetaTableAccessor.Collec... | 3.26 |
hbase_MetaTableAccessor_getRegion_rdh | /**
* Gets the region info and assignment for the specified region.
*
* @param connection
* connection we're using
* @param regionName
* Region to lookup.
* @return Location and RegionInfo for <code>regionName</code>
* @deprecated use {@link #getRegionLocation(Connection, byte[])} instead
*/
@Deprecated
pu... | 3.26 |
hbase_MetaTableAccessor_getAllRegions_rdh | /**
* Lists all of the regions currently in META.
*
* @param connection
* to connect with
* @param excludeOfflinedSplitParents
* False if we are to include offlined/splitparents regions,
* true and we'll leave out offlined regions from returned list
* @return List of all user-space regions.
*/
public sta... | 3.26 |
hbase_MetaTableAccessor_addRegionStateToPut_rdh | /**
* Set the column value corresponding to this {@code replicaId}'s {@link RegionState} to the
* provided {@code state}. Mutates the provided {@link Put}.
*/
public static Put addRegionStateToPut(Put put, int replicaId, RegionState.State state) throws IOException {
put.add(CellBuilderFactory.create(CellBuilderTyp... | 3.26 |
hbase_MetaTableAccessor_fullScanTables_rdh | /**
* Performs a full scan of <code>hbase:meta</code> for tables.
*
* @param connection
* connection we're using
* @param visitor
* Visitor invoked against each row in tables family.
*/
public static void fullScanTables(Connection connection, final ClientMetaTableAccessor.Visitor visitor) throws IOException ... | 3.26 |
hbase_MetaTableAccessor_addSplitsToParent_rdh | /**
* Adds daughter region infos to hbase:meta row for the specified region.
* <p/>
* Note that this does not add its daughter's as different rows, but adds information about the
* daughters in the same row as the parent. Now only used in snapshot. Use
* {@link org.apache.hadoop.hbase.master.assignment.RegionState... | 3.26 |
hbase_MetaTableAccessor_addDaughtersToPut_rdh | /**
* Adds split daughters to the Put
*/
public static Put addDaughtersToPut(Put put, RegionInfo splitA, RegionInfo splitB) throws IOException {
if (splitA != null) {
put.add(CellBuilderFactory.create(CellBuilderType.SHALLOW_COPY).setRow(put.getRow()).setFamily(HConstants.CATALOG_FAMILY).setQualifier(HConstants.SPLIT... | 3.26 |
hbase_MetaTableAccessor_getRegionResult_rdh | /**
* Gets the result in hbase:meta for the specified region.
*
* @param connection
* connection we're using
* @param regionInfo
* region we're looking for
* @return result of the specified region
*/
public static Result getRegionResult(Connection connection, RegionInfo regionInfo) throws IOException {
... | 3.26 |
hbase_MetaTableAccessor_updateLocation_rdh | /**
* Updates the location of the specified region to be the specified server.
* <p>
* Connects to the specified server which should be hosting the specified catalog region name to
* perform the edit.
*
* @param connection
* connection we're using
* @param regionInfo
* region to update location of
* @para... | 3.26 |
hbase_MetaTableAccessor_getScanForTableName_rdh | /**
* This method creates a Scan object that will only scan catalog rows that belong to the specified
* table. It doesn't specify any columns. This is a better alternative to just using a start row
* and scan until it hits a new table since that requires parsing the HRI to get the table name.
*
* @param tableName
... | 3.26 |
hbase_MetaTableAccessor_getTableRegionsAndLocations_rdh | /**
* Do not use this method to get meta table regions, use methods in MetaTableLocator instead.
*
* @param connection
* connection we're using
* @param tableName
* table to work with, can be null for getting all regions
* @param excludeOfflinedSplitParents
* don't return split parents
* @return Return l... | 3.26 |
hbase_MetaTableAccessor_m0_rdh | /**
* Performs a full scan of <code>hbase:meta</code> for regions.
*
* @param connection
* connection we're using
*/
public static List<Result> m0(Connection connection) throws IOException {
return fullScan(connection, QueryType.REGION);
} | 3.26 |
hbase_ZKServerTool_main_rdh | /**
* Run the tool.
*
* @param args
* Command line arguments.
*/
public static void main(String[] args) {
for (ServerName server : readZKNodes(HBaseConfiguration.create())) {
// bin/zookeeper.sh relies on the "ZK host" string for grepping which is case sensitive.
System.out.println("ZK host:... | 3.26 |
hbase_GetUserPermissionsRequest_newBuilder_rdh | /**
* Build a get table permission request
*
* @param tableName
* the specific table name
* @return a get table permission request builder
*/
public static Builder newBuilder(TableName tableName) {
return new Builder(tableName);
} | 3.26 |
hbase_GetUserPermissionsRequest_withUserName_rdh | /**
* user name could be null if need all global/namespace/table permissions
*/
public Builder withUserName(String userName) {
this.userName = userName;
return this;} | 3.26 |
hbase_BufferedMutatorExample_onException_rdh | /**
* a callback invoked when an asynchronous write fails.
*/final BufferedMutator.ExceptionListener listener = new BufferedMutator.ExceptionListener() {
@Override
public void onException(RetriesExhaustedWithDetailsException e, BufferedMutator mutator) {
for (int i = 0; i < e.getNumExceptions(); i++) ... | 3.26 |
hbase_NamedQueueRecorder_addRecord_rdh | /**
* Add various NamedQueue records to ringbuffer. Based on the type of the event (e.g slowLog),
* consumer of disruptor ringbuffer will have specific logic. This method is producer of disruptor
* ringbuffer which is initialized in NamedQueueRecorder constructor.
*
* @param namedQueuePayload
* namedQueue paylo... | 3.26 |
hbase_NamedQueueRecorder_getEventCount_rdh | // must be power of 2 for disruptor ringbuffer
private int getEventCount(int eventCount) {
Preconditions.checkArgument(eventCount >= 0, "hbase.namedqueue.ringbuffer.size must be > 0");
int floor = Integer.highestOneBit(eventCount);
if
(floor == eventCount) {
return floor... | 3.26 |
hbase_NamedQueueRecorder_persistAll_rdh | /**
* Add all in memory queue records to system table. The implementors can use system table or
* direct HDFS file or ZK as persistence system.
*/
public void persistAll(NamedQueuePayload.NamedQueueEvent namedQueueEvent, Connection connection) {
if (this.logEventHandler
!= null) {
this.logEventHandler.persistAll(nam... | 3.26 |
hbase_NamedQueueRecorder_getNamedQueueRecords_rdh | /**
* Retrieve in memory queue records from ringbuffer
*
* @param request
* namedQueue request with event type
* @return queue records from ringbuffer after filter (if applied)
*/
public NamedQueueGetResponse getNamedQueueRecords(NamedQueueGetRequest request) {
return this.logEventHandler.getNamedQueueRecords(r... | 3.26 |
hbase_VersionInfoUtil_getVersionNumber_rdh | /**
* Pack the full number version in a int. by shifting each component by 8bit, except the dot
* release which has 12bit. Examples: (1.3.4 is 0x0103004, 2.1.0 is 0x0201000)
*
* @param versionInfo
* the VersionInfo object to pack
* @return the version number as int. (e.g. 0x0103004 is 1.3.4)
*/
public static i... | 3.26 |
hbase_VersionInfoUtil_getVersionComponents_rdh | /**
* Returns the version components Examples: "1.4.3" returns [1, 4, 3], "4.5.6-SNAPSHOT" returns
* [4, 5, 6, "SNAPSHOT"]
*
* @return the components of the version string
*/
private static String[] getVersionComponents(final HBaseProtos.VersionInfo versionInfo) {
return versionInfo.getVersion().split("[\\.-]"... | 3.26 |
hbase_VersionInfoUtil_getCurrentClientVersionInfo_rdh | /**
* Returns the versionInfo extracted from the current RpcCallContext
*/
public static VersionInfo getCurrentClientVersionInfo() {
return RpcServer.getCurrentCall().map(RpcCallContext::getClientVersionInfo).orElse(NonCallVersion.get());
} | 3.26 |
hbase_VersionInfoUtil_buildVersionNumber_rdh | /**
* Pack the full number version in a int. by shifting each component by 8bit, except the dot
* release which has 12bit. Examples: (1.3.4 is 0x0103004, 2.1.0 is 0x0201000)
*
* @param major
* version major number
* @param minor
* version minor number
* @param patch
* version patch number
* @return the ... | 3.26 |
hbase_VersionInfoUtil_versionNumberToString_rdh | /**
* Returns the passed-in <code>version</code> int as a version String (e.g. 0x0103004 is 1.3.4)
*/
public static String versionNumberToString(final int version) {
return String.format("%d.%d.%d", (version >> 20) & 0xff, (version >> 12) & 0xff, version & 0xfff);
} | 3.26 |
hbase_Size_getLongValue_rdh | /**
* get the value
*/
public long getLongValue() {
return ((long) (value));
} | 3.26 |
hbase_Size_get_rdh | /**
* get the value which is converted to specified unit.
*
* @param unit
* size unit
* @return the converted value
*/
public double get(Unit unit) {
if (value == 0) {
return value;
}
int diff = this.unit.getOrderOfSize() - unit.getOrderOfSize();
if (diff == 0) {
return value;
... | 3.26 |
hbase_Size_getUnit_rdh | /**
* Returns size unit
*/
public Unit getUnit() {
return unit;
} | 3.26 |
hbase_MasterAddressTracker_deleteIfEquals_rdh | /**
* delete the master znode if its content is same as the parameter
*
* @param zkw
* must not be null
* @param content
* must not be null
*/
public static boolean deleteIfEquals(ZKWatcher zkw, final String content) {
if (content == null) {
throw new IllegalArgumentException("Content must not be... | 3.26 |
hbase_MasterAddressTracker_toByteArray_rdh | /**
*
* @param sn
* must not be null
* @return Content of the master znode as a serialized pb with the pb magic as prefix.
*/ static byte[] toByteArray(final ServerName sn, int infoPort) {
ZooKeeperProtos.Master.Builder mbuilder = ZooKeeperProtos.Master.newBuilder();HBaseProtos.ServerName.Builder snbuilder =... | 3.26 |
hbase_MasterAddressTracker_setMasterAddress_rdh | /**
* Set master address into the <code>master</code> znode or into the backup subdirectory of backup
* masters; switch off the passed in <code>znode</code> path.
*
* @param zkw
* The ZKWatcher to use.
* @param znode
* Where to create the znode; could be at the top level or it could be under backup
* mast... | 3.26 |
hbase_MasterAddressTracker_getBackupMasterInfoPort_rdh | /**
* Get backup master info port. Use this instead of {@link #getBackupMasterInfoPort(ServerName)}
* if you do not have an instance of this tracker in your context.
*
* @param zkw
* ZKWatcher to use
* @param sn
* ServerName of the backup master
* @return backup master info port in the the master address zn... | 3.26 |
hbase_MasterAddressTracker_getMasterInfoPort_rdh | /**
* Get the info port of the current master of one is available. Return 0 if no current master or
* zookeeper is unavailable
*
* @return info port or 0 if timed out
*/
public int getMasterInfoPort() {
try {final ZooKeeperProtos.Master master = parse(this.getData(false));
if (master == null) {
... | 3.26 |
hbase_MasterAddressTracker_hasMaster_rdh | /**
* Check if there is a master available.
*
* @return true if there is a master set, false if not.
*/
public boolean hasMaster() {
return super.getData(false) != null;
} | 3.26 |
hbase_MasterAddressTracker_parse_rdh | /**
*
* @param data
* zookeeper data. may be null
* @return pb object of master, null if no active master
* @throws DeserializationException
* if the parsing fails
*/
public static Master parse(byte[] data) throws DeserializationException {
if (data == null) {
return null;
}
int prefixL... | 3.26 |
hbase_MasterAddressTracker_getMasterAddress_rdh | /**
* Get master address. Use this instead of {@link #getMasterAddress()} if you do not have an
* instance of this tracker in your context.
*
* @param zkw
* ZKWatcher to use
* @return ServerName stored in the the master address znode or null if no znode present.
* @throws KeeperException
* if a ZooKeeper op... | 3.26 |
hbase_MasterAddressTracker_getBackupMastersAndRenewWatch_rdh | /**
* Retrieves the list of registered backup masters and renews a watch on the znode for children
* updates.
*
* @param zkw
* Zookeeper watcher to use
* @return List of backup masters.
* @throws InterruptedIOExcept... | 3.26 |
hbase_TimeRangeTracker_includeTimestamp_rdh | /**
* Update the current TimestampRange to include the timestamp from <code>cell</code>. If the Key
* is of type DeleteColumn or DeleteFamily, it includes the entire time range from 0 to timestamp
* of the key.
*
* @param cell
* the Cell to include
*/
public void includeTimestamp(final Cell cell) {
include... | 3.26 |
hbase_TimeRangeTracker_toByteArray_rdh | /**
* This method used to serialize TimeRangeTracker (TRT) by protobuf while this breaks the forward
* compatibility on HFile.(See HBASE-21008) In previous hbase version ( < 2.0.0 ) we use
* DataOutput to serialize TRT, these old versions don't have capability to deserialize TRT which
* is serialized by protobuf. S... | 3.26 |
hbase_TimeRangeTracker_includesTimeRange_rdh | /**
* Check if the range has ANY overlap with TimeRange
*
* @param tr
* TimeRange, it expects [minStamp, maxStamp)
* @return True if there is overlap, false otherwise
*/
public boolean includesTimeRange(final TimeRange tr) {
return (getMin() < tr.getMax()) && (getMax() >= tr.getMin());
} | 3.26 |
hbase_TimeRangeTracker_toTimeRange_rdh | /**
* Returns Make a TimeRange from current state of <code>this</code>.
*/
TimeRange toTimeRange() {
long min = getMin();
long max = getMax();
// Initial TimeRangeTracker timestamps are the opposite of what you want for a TimeRange. Fix!
if (min == INITIAL_MIN_TIMESTAMP) {
min = TimeRange.INIT... | 3.26 |
hbase_LockServiceClient_tableLock_rdh | /**
* Create a new EntityLock object to acquire an exclusive or shared lock on a table. Internally,
* the table namespace will also be locked in shared mode.
*/
public EntityLock tableLock(final TableName tableName, final boolean exclusive, final String description, final Abortable abort) {
LockRequest lockReque... | 3.26 |
hbase_LockServiceClient_namespaceLock_rdh | /**
* LocCreate a new EntityLock object to acquire exclusive lock on a namespace. Clients can not
* acquire shared locks on namespace.
*/
public EntityLock namespaceLock(String namespace, String description, Abortable abort) {
LockRequest lockRequest = buildLockRequest(LockType.EXCLUSIVE, namespace, null, nu... | 3.26 |
hbase_LockServiceClient_regionLock_rdh | /**
* Create a new EntityLock object to acquire exclusive lock on multiple regions of same tables.
* Internally, the table and its namespace will also be locked in shared mode.
*/
public EntityLock regionLock(List<RegionInfo> regionInfos, String description, Abortable abort) {
LockRequest lockRequest = buildLock... | 3.26 |
hbase_VersionedSegmentsList_getEstimatedUniquesFrac_rdh | // Estimates fraction of unique keys
double getEstimatedUniquesFrac() {
int segmentCells = 0;
int maxCells = 0;
double est = 0;for (ImmutableSegment s :
storeSegments) {
double segmentUniques = s.getNumUniqueKeys();
if (segmentUniques != CellSet.UNKNOWN_N... | 3.26 |
hbase_RegionStates_getRegionsOfTableForEnabling_rdh | /**
* Get the regions for enabling a table.
* <p/>
* Here we want the EnableTableProcedure to be more robust and can be used to fix some nasty
* states, so the checks in this method will be a bit strange. In general, a region can only be
* offline when it is split, for merging we will just delete the parent region... | 3.26 |
hbase_RegionStates_getRegionsOfTableForReopen_rdh | /**
* Get the regions to be reopened when modifying a table.
* <p/>
* Notice that the {@code openSeqNum} in the returned HRegionLocation is also used to indicate the
* state of this region, positive means the region is in {@link State#OPEN}, -1 means
* {@link State#OPENING}. And for regions in other states we do n... | 3.26 |
hbase_RegionStates_hasTableRegionStates_rdh | // ============================================================================================
// TODO: helpers
// ============================================================================================
public boolean hasTableRegionStates(final TableName tableName) {
// TODO
return !getTableRegionStates(tableNam... | 3.26 |
hbase_RegionStates_logSplitting_rdh | /**
* Call this when we start log splitting for a crashed Server.
*
* @see #logSplit(ServerName)
*/
public void logSplitting(final ServerName serverName) {
setServerState(serverName, ServerState.SPLITTING);
} | 3.26 |
hbase_RegionStates_getAssignmentsForBalancer_rdh | /**
* This is an EXPENSIVE clone. Cloning though is the safest thing to do. Can't let out original
* since it can change and at least the load balancer wants to iterate this exported list. We need
* to synchronize on regions since all access to this.servers is under a lock on this.regions.
*
* @return A clone of c... | 3.26 |
hbase_RegionStates_setServerState_rdh | // ============================================================================================
// Split helpers
// These methods will only be called in ServerCrashProcedure, and at the end of SCP we will remove
// the ServerStateNode by calling removeServer.
// =========================================================... | 3.26 |
hbase_RegionStates_getServerNode_rdh | /**
* Returns Pertinent ServerStateNode or NULL if none found (Do not make modifications).
*/public ServerStateNode getServerNode(final ServerName serverName) {
return serverMap.get(serverName);
} | 3.26 |
hbase_RegionStates_getRegionsInTransitionCount_rdh | /**
* Get the number of regions in transition.
*/
public int getRegionsInTransitionCount()
{
return regionInTransition.size();
} | 3.26 |
hbase_RegionStates_clear_rdh | /**
* Called on stop of AssignmentManager.
*/
public void clear() {
regionsMap.clear();
encodedRegionsMap.clear();
regionInTransition.clear();
regionOffline.clear();
serverMap.clear();
} | 3.26 |
hbase_RegionStates_getAssignedRegions_rdh | // ============================================================================================
// TODO:
// ============================================================================================
public List<RegionInfo> getAssignedRegions() {
final List<RegionInfo> result = new ArrayList<RegionInfo>();
for (Region... | 3.26 |
hbase_RegionStates_metaLogSplitting_rdh | /**
* Call this when we start meta log splitting a crashed Server.
*
* @see #metaLogSplit(ServerName)
*/
public void metaLogSplitting(ServerName serverName) {
setServerState(serverName, ServerState.SPLITTING_META);
} | 3.26 |
hbase_RegionStates_isRegionOffline_rdh | /**
* Returns True if region is offline (In OFFLINE or CLOSED state).
*/
public boolean isRegionOffline(final RegionInfo regionInfo) {
return m2(regionInfo, State.OFFLINE, State.CLOSED);
} | 3.26 |
hbase_RegionStates_getRegionState_rdh | // ==========================================================================
// RegionState helpers
// ==========================================================================
public RegionState getRegionState(final RegionInfo regionInfo) {
RegionStateNode regionStateNode =
getRegionStateNode(regionInfo);
return re... | 3.26 |
hbase_RegionStates_addToOfflineRegions_rdh | // ==========================================================================
// Region offline helpers
// ==========================================================================
// TODO: Populated when we read meta but regions never make it out of here.
public void addToOfflineRegions(final RegionStateNode regionNo... | 3.26 |
hbase_RegionStates_removeServer_rdh | /**
* Called by SCP at end of successful processing.
*/
public void removeServer(final
ServerName serverName)
{
serverMap.remove(serverName);
} | 3.26 |
hbase_RegionStates_m1_rdh | /**
* Get the regions for deleting a table.
* <p/>
* Here we need to return all the regions irrespective of the states in order to archive them all.
* This is because if we don't archive OFFLINE/SPLIT regions and if a snapshot or a cloned table
* references to the regions, we will lose the data of the regions.
*/... | 3.26 |
hbase_RegionStates_metaLogSplit_rdh | /**
* Called after we've split the meta logs on a crashed Server.
*
* @see #metaLogSplitting(ServerName)
*/
public void metaLogSplit(ServerName serverName) {
setServerState(serverName, ServerState.SPLITTING_META_DONE);
} | 3.26 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.