name
stringlengths
12
178
code_snippet
stringlengths
8
36.5k
score
float64
3.26
3.68
hbase_KeyValue_getFamilyLength_rdh
/** * Returns Family length */ @Override public byte getFamilyLength() { return m2(getFamilyLengthPosition(getRowLength())); }
3.26
hbase_KeyValue_matchingRows_rdh
/** * Compare rows. Just calls Bytes.equals, but it's good to have this encapsulated. * * @param left * Left row array. * @param loffset * Left row offset. * @param llength * Left row length. * @param right * Right row array. * @param roffset * Right row offset. * @param rlength * Right row le...
3.26
hbase_KeyValue_compareRowKey_rdh
/** * Compares the only the user specified portion of a Key. This is overridden by MetaComparator. * * @param left * left cell to compare row key * @param right * right cell to compare row key * @return 0 if equal, <0 if left smaller, >0 if right smaller */ protected int compareRowKey(final Cell left...
3.26
hbase_KeyValue_getKey_rdh
// --------------------------------------------------------------------------- // // Methods that return copies of fields // // --------------------------------------------------------------------------- /** * Do not use unless you have to. Used internally for compacting and testing. Use * {@link #getRowArray()}, {...
3.26
hbase_KeyValue_getTagsLength_rdh
/** * Return the total length of the tag bytes */ @Override public int getTagsLength() { int tagsLen = this.f2 - ((getKeyLength() + getValueLength()) + KEYVALUE_INFRASTRUCTURE_SIZE); if (tagsLen > 0) { // There are some Tag bytes in the byte[]. So reduce 2 bytes which is added to denote the tags // length tagsLen -= ...
3.26
hbase_KeyValue_getFamilyOffset_rdh
/** * Returns Family offset */ int getFamilyOffset(int familyLenPosition) { return familyLenPosition + Bytes.SIZEOF_BYTE; }
3.26
hbase_KeyValue_heapSize_rdh
/** * HeapSize implementation * <p/> * We do not count the bytes in the rowCache because it should be empty for a KeyValue in the * MemStore. */ @Override public long heapSize() { // Deep object overhead for this KV consists of two parts. The first part is the KV object // itself, while the second part is the back...
3.26
hbase_KeyValue_getShortMidpointKey_rdh
/** * This is a HFile block index key optimization. * * @param leftKey * byte array for left Key * @param rightKey * byte array for right Key * @return 0 if equal, &lt;0 if left smaller, &gt;0 if right smaller * @deprecated Since 0.99.2; */ @Deprecated public byte[] getShortMidpointKey(final byte[] leftKey...
3.26
hbase_KeyValue_getTagsArray_rdh
/** * Returns the backing array of the entire KeyValue (all KeyValue fields are in a single array) */ @Override public byte[] getTagsArray() { return bytes;}
3.26
hbase_KeyValue_keyToString_rdh
/** * Use for logging. * * @param b * Key portion of a KeyValue. * @param o * Offset to start of key * @param l * Length of key. * @return Key as a String. */ public static String keyToString(final byte[] b, final int o, final int l) { if (b == null) { return ""; } int rowlength = ...
3.26
hbase_KeyValue_createKeyOnly_rdh
/** * Creates a new KeyValue that only contains the key portion (the value is set to be null). TODO * only used by KeyOnlyFilter -- move there. * * @param lenAsVal * replace value with the actual value length (false=empty) */ public KeyValue createKeyOnly(boolean lenAsVal) { // KV format: <keylen:4><valuelen:...
3.26
hbase_KeyValue_getValueLength_rdh
/** * Returns Value length */ @Override public int getValueLength() { int vlength = Bytes.toInt(this.bytes, this.offset + Bytes.SIZEOF_INT);return vlength; }
3.26
hbase_KeyValue_getOffset_rdh
/** * Returns Offset into {@link #getBuffer()} at which this KeyValue starts. */ public int getOffset() { return this.offset; }
3.26
hbase_KeyValue_getFamilyArray_rdh
/** * Returns the backing array of the entire KeyValue (all KeyValue fields are in a single array) */ @Override public byte[] getFamilyArray() { return bytes; }
3.26
hbase_KeyValue_getRowLength_rdh
/** * Returns Row length */ @Override public short getRowLength() { return Bytes.toShort(this.bytes, getKeyOffset()); }
3.26
hbase_KeyValue_m3_rdh
/** * Returns the backing array of the entire KeyValue (all KeyValue fields are in a single array) */ @Override public byte[] m3() { return bytes; }
3.26
hbase_KeyValue_checkParameters_rdh
/** * Checks the parameters passed to a constructor. * * @param row * row key * @param rlength * row length * @param family * family name * @param flength * family length * @param qlength * qual...
3.26
hbase_KeyValue_getTagsOffset_rdh
/** * Return the offset where the tag data starts. */ @Override public int getTagsOffset() { int tagsLen = getTagsLength(); if (tagsLen == 0) { return this.offset + this.f2; } return (this.offset + this.f2) - tagsLen; }
3.26
hbase_KeyValue_getKeyValueDataStructureSize_rdh
/** * Computes the number of bytes that a <code>KeyValue</code> instance with the provided * characteristics would take up for its underlying data structure. * * @param klength * key length * @param vlength * value length * @param tagsLength * total length of the tags * @return the <code>KeyValue</code>...
3.26
hbase_KeyValue_createEmptyByteArray_rdh
/** * Create an empty byte[] representing a KeyValue All lengths are preset and can be filled in * later. * * @param rlength * row length * @param flength * family length * @param qlength * qualifier length * @param timestamp * version timestamp * @param type * key type * @param vlength * val...
3.26
hbase_KeyValue_getKeyDataStructureSize_rdh
/** * Computes the number of bytes that a <code>KeyValue</code> instance with the provided * characteristics would take up in its underlying data structure for the key. * * @param rlength * row length * @param flength * family length * @param qlength * qualifier length * @return the key data structure l...
3.26
hbase_KeyValue_equals_rdh
/** * Needed doing 'contains' on List. Only compares the key portion, not the value. */ @Override public boolean equals(Object other) { if (!(other instanceof Cell)) { return false; } return CellUtil.equals(this, ((Cell) (other))); }
3.26
hbase_KeyValue_getBuffer_rdh
// --------------------------------------------------------------------------- // // Public Member Accessors // // --------------------------------------------------------------------------- /** * To be used only in tests where the Cells are clearly assumed to be of type KeyValue and that we * need access to the ba...
3.26
hbase_KeyValue_shallowCopy_rdh
/** * Creates a shallow copy of this KeyValue, reusing the data byte buffer. * http://en.wikipedia.org/wiki/Object_copy * * @return Shallow copy of this KeyValue */ public KeyValue shallowCopy() { KeyValue v29 = new KeyValue(this.bytes, this.offset, this.f2); v29.m0(this.seqId); return v29; }
3.26
hbase_KeyValue_toStringMap_rdh
/** * Produces a string map for this key/value pair. Useful for programmatic use and manipulation of * the data stored in an WALKey, for example, printing as JSON. Values are left out due to their * tendency to be large. If needed, they can be added manually. * * @return the Map&lt;String,?&gt; containing data fro...
3.26
hbase_KeyValue_getQualifierOffset_rdh
/** * Returns Qualifier offset */ int getQualifierOffset(int foffset, int flength) { return foffset + flength; }
3.26
hbase_KeyValue_setKey_rdh
/** * A setter that helps to avoid object creation every time and whenever there is a need to * create new KeyOnlyKeyValue. * * @param key * Key to set * @param offset * Offset of the Key * @param length * length of the Key */ public void setKey(byte[] key, int offset, int length) { this.bytes = key...
3.26
hbase_KeyValue_getKeyLength_rdh
/** * Returns Length of key portion. */ public int getKeyLength() { return Bytes.toInt(this.bytes, this.offset); }
3.26
hbase_KeyValue_compare_rdh
// RawComparator @Override public int compare(byte[] l, int loff, int llen, byte[] r, int roff, int rlen) { return compareFlatKey(l, loff, llen, r, roff, rlen); }
3.26
hbase_KeyValue_write_rdh
/** * Write out a KeyValue in the manner in which we used to when KeyValue was a Writable. * * @param kv * the KeyValue on which write is being requested * @param out * OutputStream to write keyValue to * @return Length written on stream * @throws IOException * if any IO error happen * @see #create(Data...
3.26
hbase_KeyValue_writeByteArray_rdh
/** * Write KeyValue format into the provided byte array. * * @param buffer * the bytes buffer to use * @param boffset * buffer offset * @param row * row key * @param roffset * row offset * @param rlength * row length * @param family * family name * @param foffset * family offset * @param...
3.26
hbase_KeyValue_codeToType_rdh
/** * Cannot rely on enum ordinals . They change if item is removed or moved. Do our own codes. * * @param b * the kv serialized byte[] to process * @return Type associated with passed code. */ public static Type codeToType(final byte b) { Type t = codeArray[b & 0xff]; if (t != null) {return t; }th...
3.26
hbase_KeyValue_compareWithoutRow_rdh
/** * Compare columnFamily, qualifier, timestamp, and key type (everything except the row). This * method is used both in the normal comparator and the "same-prefix" comparator. Note that we * are assuming that row portions of both KVs have already been parsed and found identical, and * we don't validate that assum...
3.26
hbase_KeyValue_getLegacyKeyComparatorName_rdh
/** * Compare KeyValues. When we compare KeyValues, we only compare the Key portion. This means two * KeyValues with same Key but different Values are considered the same as far as this Comparator * is concerned. * * @deprecated : Use {@link CellComparatorImpl}. Deprecated for hbase 2.0, remove for hbase 3.0. */ ...
3.26
hbase_KeyValue_getTimestamp_rdh
/** * Return the timestamp. */ long getTimestamp(final int keylength) { int tsOffset = getTimestampOffset(keylength); return Bytes.toLong(this.bytes, tsOffset); }
3.26
hbase_KeyValue_m2_rdh
/** * Returns Family length */ public byte m2(int famLenPos) { return this.bytes[famLenPos]; }
3.26
hbase_CatalogReplicaLoadBalanceSimpleSelector_stop_rdh
// This class implements the Stoppable interface as chores needs a Stopable object, there is // no-op on this Stoppable object currently. @Override public void stop(String why) { isStopped = true; }
3.26
hbase_CatalogReplicaLoadBalanceSimpleSelector_onError_rdh
/** * When a client runs into RegionNotServingException, it will call this method to update * Selector's internal state. * * @param loc * the location which causes exception. */ @Override public void onError(HRegionLocation loc) { ConcurrentNavigableMap<byte[], StaleLocationCacheEntry> tableCache = comput...
3.26
hbase_CatalogReplicaLoadBalanceSimpleSelector_getRandomReplicaId_rdh
/** * Select an random replica id (including the primary replica id). In case there is no replica * region configured, return the primary replica id. * * @return Replica id */ private int getRandomReplicaId() { int cachedNumOfReplicas = this.numOfReplicas; if (cachedNumOfReplicas == CatalogReplicaLoadBalan...
3.26
hbase_CatalogReplicaLoadBalanceSimpleSelector_select_rdh
/** * When it looks up a location, it will call this method to find a replica region to go. For a * normal case, > 99% of region locations from catalog/meta replica will be up to date. In extreme * cases such as region server crashes, it will depends on how fast replication catches up. * * @param tableName * ta...
3.26
hbase_ReversedKeyValueHeap_compareRows_rdh
/** * Compares rows of two KeyValue * * @return less than 0 if left is smaller, 0 if equal etc.. */ public int compareRows(Cell left, Cell right) { return super.kvComparator.compareRows(left, right); }
3.26
hbase_AbstractStateMachineRegionProcedure_getRegion_rdh
/** * Returns The RegionInfo of the region we are operating on. */ public RegionInfo getRegion() { return this.hri; }
3.26
hbase_AbstractStateMachineRegionProcedure_setRegion_rdh
/** * Used when deserializing. Otherwise, DON'T TOUCH IT! */ protected void setRegion(final RegionInfo hri) { this.hri = hri; }
3.26
hbase_HQuorumPeer_main_rdh
/** * Parse ZooKeeper configuration from HBase XML config and run a QuorumPeer. * * @param args * String[] of command line arguments. Not used. */ public static void main(String[] args) { Configuration conf = HBaseConfiguration.create(); try { Properties zkProperties = ZKConfig.makeZKProps(conf)...
3.26
hbase_VisibilityController_postOpen_rdh
/** * **************************** Region related hooks ***************************** */ @Override public void postOpen(ObserverContext<RegionCoprocessorEnvironment> e) { // Read the entire labels table and populate the zk if (e.getEnvironment().getRegion().getRegionInfo().getTable().equals(LABELS_TABLE_NAME)) { ...
3.26
hbase_VisibilityController_getRegionObserver_rdh
/** * ************************** Observer/Service Getters *********************************** */ @Override public Optional<RegionObserver> getRegionObserver() { return Optional.of(this); }
3.26
hbase_VisibilityController_postStartMaster_rdh
/** * ******************************* Master related hooks ********************************* */ @Override public void postStartMaster(ObserverContext<MasterCoprocessorEnvironment> ctx) throws IOException { // Need to create the new system table for labels here try (Admin v0 = ctx.getEnvironment().getConnection().getA...
3.26
hbase_VisibilityController_addLabels_rdh
/** * **************************** * VisibilityEndpoint service related methods * **************************** */ @Override public synchronized void addLabels(RpcController controller, VisibilityLabelsRequest request, RpcCallback<VisibilityLabelsResponse> done) { VisibilityLabelsResponse.Builder response = Visi...
3.26
hbase_CellCreator_m0_rdh
/** * Returns Visibility expression resolver */ public VisibilityExpressionResolver m0() { return this.visExpResolver; }
3.26
hbase_CellCreator_create_rdh
/** * * @param row * row key * @param roffset * row offset * @param rlength * row length * @param family * family name * @param foffset * family offset * @param flength * family length * @param qualifier * column qualifier * @param qoffset * qualifier offset * @param qlength * quali...
3.26
hbase_CompatibilitySingletonFactory_getInstance_rdh
/** * Get the singleton instance of Any classes defined by compatibiliy jar's * * @return the singleton */ @SuppressWarnings("unchecked") public static <T> T getInstance(Class<T> klass) { synchronized(SingletonStorage.INSTANCE.lock) { T instance = ((T) (SingletonStorage.INSTANCE.instances.get(...
3.26
hbase_CompactedHFilesDischarger_setUseExecutor_rdh
/** * CompactedHFilesDischarger runs asynchronously by default using the hosting RegionServer's * Executor. In tests it can be useful to force a synchronous cleanup. Use this method to set * no-executor before you call run. * * @return The old setting for <code>useExecutor</code> */ boolean setUseExecutor(final ...
3.26
hbase_FastPathRpcHandler_loadCallRunner_rdh
/** * * @param cr * Task gotten via fastpath. * @return True if we successfully loaded our task */ boolean loadCallRunner(final CallRunner cr) { this.loadedCallRunner = cr; this.semaphore.release(); return true; }
3.26
hbase_RequestControllerFactory_create_rdh
/** * Constructs a {@link org.apache.hadoop.hbase.client.RequestController}. * * @param conf * The {@link Configuration} to use. * @return A RequestController which is built according to the configuration. */ public static RequestController create(Configuration conf) { Class<? extends RequestController> cla...
3.26
hbase_StoreFileTrackerValidationUtils_checkForNewFamily_rdh
// should not use MigrationStoreFileTracker for new family private static void checkForNewFamily(Configuration conf, TableDescriptor table, ColumnFamilyDescriptor family) throws IOException { Configuration mergedConf = StoreUtils.createStoreConfiguration(conf, table, family); Class<? extends StoreFileTracker> ...
3.26
hbase_StoreFileTrackerValidationUtils_validatePreRestoreSnapshot_rdh
/** * Makes sure restoring a snapshot does not break the current SFT setup follows * StoreUtils.createStoreConfiguration * * @param currentTableDesc * Existing Table's TableDescriptor * @param snapshotTableDesc * Snapshot's TableDescriptor * @param baseConf * Current global configuration * @throws Resto...
3.26
hbase_StoreFileTrackerValidationUtils_checkForCreateTable_rdh
/** * Pre check when creating a new table. * <p/> * For now, only make sure that we do not use {@link Trackers#MIGRATION} for newly created tables. * * @throws IOException * when there are check errors, the upper layer should fail the * {@code CreateTableProcedure}. */ public static void checkForCreateTable...
3.26
hbase_ChaosAgent_createIfZNodeNotExists_rdh
/** * Checks if given ZNode exists, if not creates a PERSISTENT ZNODE for same. * * @param path * Path to check for ZNode */ private void createIfZNodeNotExists(String path) { try { if (zk.exists(path, false) == null) { createZNode(path, new byte[0]); } } catch (KeeperExcepti...
3.26
hbase_ChaosAgent_setStatusOfTaskZNode_rdh
/** * sets given Status for Task Znode * * @param taskZNode * ZNode to set status * @param status * Status value */ public void setStatusOfTaskZNode(String taskZNode, String status) { LOG.info((("Setting status of Task ZNode: " + taskZNode) + " status : ") + status); zk.setData(taskZNode, status.getBytes...
3.26
hbase_ChaosAgent_register_rdh
/** * registration of ChaosAgent by checking and creating necessary ZNodes. */ private void register() { createIfZNodeNotExists(ChaosConstants.CHAOS_TEST_ROOT_ZNODE); createIfZNodeNotExists(ChaosConstants.CHAOS_AGENT_REGISTRATION_EPIMERAL_ZNODE); createIfZNodeNotExists(ChaosConstants.CHAOS_AGENT_STATUS_PE...
3.26
hbase_ChaosAgent_createEphemeralZNode_rdh
/** * * * Function to create EPHEMERAL ZNODE with given path and data as params. * * @param path * Path at which Ephemeral ZNode to create * @param data * Data to put under ZNode */ public void createEphemeralZNode(String path, byte[] data) { zk.create(path, data, Ids.OPEN_ACL_UNSAFE, CreateMode.EPHEMERAL, ...
3.26
hbase_ChaosAgent_createZKConnection_rdh
/** * * * Creates Connection with ZooKeeper. * * @throws IOException * if something goes wrong */ private void createZKConnection(Watcher watcher) throws IOException { if (watcher == null) { zk = new ZooKeeper(quorum, ChaosConstants.SESSION_TIMEOUT_ZK, this); } else { zk = ne...
3.26
hbase_ChaosAgent_execWithRetries_rdh
/** * Below function executes command with retries with given user. Uses LocalShell to execute a * command. * * @param user * user name, default none * @param cmd * Command to execute * @return A pair of Exit Code and Shell output * @throws IOException * Excep...
3.26
hbase_ChaosAgent_createZNode_rdh
/** * * * Function to create PERSISTENT ZNODE with given path and data given as params * * @param path * Path at which ZNode to create * @param data * Data to put under ZNode */ public void createZNode(String path, byte[] data) { zk.create(path, data, Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT, createZNodeC...
3.26
hbase_ChaosAgent_initChaosAgent_rdh
/** * * * sets global params and initiates connection with ZooKeeper then does registration. * * @param conf * initial configuration to use * @param quorum * ZK Quorum * @param agentName * AgentName to use */ private void initChaosAgent(Configuration conf, String quorum, String agentName) { this.c...
3.26
hbase_ChaosAgent_getTasks_rdh
/** * * * Gets tasks for execution, basically sets Watch on it's respective host's Znode and waits for * tasks to be assigned, also has a getTasksForAgentCallback which handles execution of task. */ private void getTasks() { LOG.info(("Getting Tasks for Agent: " + f0) + "and setting watch for new Tasks"); z...
3.26
hbase_ZKPermissionWatcher_deleteNamespaceACLNode_rdh
/** * * * Delete the acl notify node of namespace */ public void deleteNamespaceACLNode(final String namespace) { String v15 = ZNodePaths.joinZNode(watcher.getZNodePaths().baseZNode, ACL_NODE); v15 = ZNodePaths.joinZNode(v15, PermissionStorage.NAMESPACE_PREFIX + namespace); try { ZKUtil.del...
3.26
hbase_ZKPermissionWatcher_deleteTableACLNode_rdh
/** * * * Delete the acl notify node of table */ public void deleteTableACLNode(final TableName tableName) { String zkNode = ZNodePaths.joinZNode(watcher.getZNodePaths().baseZNode, ACL_NODE); zkNode = ZNodePaths.joinZNode(zkNode, tableName.getNameAsString()); try { ZKUtil.deleteNode(watcher, zkN...
3.26
hbase_HRegionServer_getFavoredNodesForRegion_rdh
/** * Return the favored nodes for a region given its encoded name. Look at the comment around * {@link #regionFavoredNodesMap} on why we convert to InetSocketAddress[] here. * * @param encodedRegionName * the encoded region name. * @return array of favored locations */ @Override public InetSocketAddress[] get...
3.26
hbase_HRegionServer_dumpRowLocks_rdh
/** * Used by {@link RSDumpServlet} to generate debugging information. */ public void dumpRowLocks(final PrintWriter out) { StringBuilder v5 = new StringBuilder(); for (HRegion region : getRegions()) { if (region.getLockedRows().size() > 0) { for (HRegion.RowLockContext rowLockContext...
3.26
hbase_HRegionServer_getOnlineRegionsLocalContext_rdh
/** * For tests, web ui and metrics. This method will only work if HRegionServer is in the same JVM * as client; HRegion cannot be serialized to cross an rpc. */ public Collection<HRegion> getOnlineRegionsLocalContext() { Collection<HRegion> regions = this.onlineRegions.values(); return Collections.unmodifia...
3.26
hbase_HRegionServer_closeUserRegions_rdh
/** * Schedule closes on all user regions. Should be safe calling multiple times because it wont' * close regions that are already closed or that are closing. * * @param abort * Whether we're running an abort. */ private void closeUserRegions(final boolean abort) { this.onlineRegionsLock.writeLock().lock();...
3.26
hbase_HRegionServer_handleReportForDutyResponse_rdh
/** * Run init. Sets up wal and starts up all server threads. * * @param c * Extra configuration. */ protected void handleReportForDutyResponse(final RegionServerStartupResponse c) throws IOException { try { boolean v77 = false; for (NameStringPair e : c.getMapEntriesList()) { String key = e.getName(); // The h...
3.26
hbase_HRegionServer_cleanup_rdh
/** * Cleanup after Throwable caught invoking method. Converts <code>t</code> to IOE if it isn't * already. * * @param t * Throwable * @param msg * Message to log in error. Can be null. * @return Throwable converted to an IOE; methods can only let out IOEs. */ private Throwable cleanup(final Throwable t, f...
3.26
hbase_HRegionServer_stopServiceThreads_rdh
/** * Wait on all threads to finish. Presumption is that all closes and stops have already been * called. */ protected void stopServiceThreads() { // clean up the scheduled chores stopChoreService(); if (bootstrapNodeManager != null) {bootstrapNodeManager.stop(); } if (this.cacheFlusher != null) { this.cacheFlusher...
3.26
hbase_HRegionServer_getReplicationSinkService_rdh
/** * Returns Return the object that implements the replication sink executorService. */ public ReplicationSinkService getReplicationSinkService() { return replicationSinkHandler;}
3.26
hbase_HRegionServer_triggerFlushInPrimaryRegion_rdh
/** * Trigger a flush in the primary region replica if this region is a secondary replica. Does not * block this thread. See RegionReplicaFlushHandler for details. */ private void triggerFlushInPrimaryRegion(final HRegion region) { if (ServerRegionReplicaUtil.isDefaultReplica(region.getRegionInfo())) { return;} T...
3.26
hbase_HRegionServer_getRetryPauseTime_rdh
/** * Return pause time configured in {@link HConstants#HBASE_RPC_SHORTOPERATION_RETRY_PAUSE_TIME}} * * @return pause time */ @InterfaceAudience.Private public long getRetryPauseTime() { return this.retryPauseTime; }
3.26
hbase_HRegionServer_checkCodecs_rdh
/** * Run test on configured codecs to make sure supporting libs are in place. */ private static void checkCodecs(final Configuration c) throws IOException { // check to see if the codec list is available: String[] codecs = c.getStrings(REGIONSERVER_CODEC, ((String[]) (null))); if (codecs == null) { return; } fo...
3.26
hbase_HRegionServer_setupWALAndReplication_rdh
/** * Setup WAL log and replication if enabled. Replication setup is done in here because it wants to * be hooked up to WAL. */ private void setupWALAndReplication() throws IOException { WALFactory factory = new WALFactory(conf, serverName, this); // TODO Replication make assumptions here based on the default filesy...
3.26
hbase_HRegionServer_getRegions_rdh
/** * Gets the online regions of the specified table. This method looks at the in-memory * onlineRegions. It does not go to <code>hbase:meta</code>. Only returns <em>online</em> regions. * If a region on this table has been closed during a disable, etc., it will not be included in * the returned list. So, the retur...
3.26
hbase_HRegionServer_reportRegionSizesForQuotas_rdh
/** * Reports the given map of Regions and their size on the filesystem to the active Master. * * @param regionSizeStore * The store containing region sizes * @return false if FileSystemUtilizationChore should pause reporting to master. true otherwise */ public boolean reportRegionSizesForQuotas(RegionSizeStore...
3.26
hbase_HRegionServer_getUseThisHostnameInstead_rdh
// HMaster should override this method to load the specific config for master @Override protected String getUseThisHostnameInstead(Configuration conf) throws IOException { String hostname = conf.get(UNSAFE_RS_HOSTNAME_KEY); if (conf.getBoolean(UNSAFE_RS_HOSTNAME_DISABLE_MASTER_REVERSEDNS_KEY...
3.26
hbase_HRegionServer_main_rdh
/** * * @see org.apache.hadoop.hbase.regionserver.HRegionServerCommandLine */ public static void main(String[] args) { LOG.info("STARTING executorService " + HRegionServer.class.getSimpleName()); VersionInfo.logVersion(); Configuration conf = HBaseConfiguration.create(); @SuppressWarnings("unchecked") Class<? extend...
3.26
hbase_HRegionServer_buildReportAndSend_rdh
/** * Builds the region size report and sends it to the master. Upon successful sending of the * report, the region sizes that were sent are marked as sent. * * @param rss * The stub to send to the Master * @param regionSizeStore * The store containing region sizes */ private void buildReportAndSend(RegionS...
3.26
hbase_HRegionServer_walRollRequestFinished_rdh
/** * For testing * * @return whether all wal roll request finished for this regionserver */ @InterfaceAudience.Private public boolean walRollRequestFinished() { return this.walRoller.walRollFinished(); }
3.26
hbase_HRegionServer_getFlushRequester_rdh
/** * Returns reference to FlushRequester */ @Overridepublic FlushRequester getFlushRequester() { return this.cacheFlusher; }
3.26
hbase_HRegionServer_submitRegionProcedure_rdh
/** * Will ignore the open/close region procedures which already submitted or executed. When master * had unfinished open/close region procedure and restarted, new active master may send duplicate * open/close region request to regionserver. The open/close request is submitted to a thread pool * and execute. So fir...
3.26
hbase_HRegionServer_getReplicationSourceService_rdh
/** * Returns Return the object that implements the replication source executorService. */ @Override public ReplicationSourceService getReplicationSourceService() { return replicationSourceHandler; }
3.26
hbase_HRegionServer_createRegionLoad_rdh
/** * * @param r * Region to get RegionLoad for. * @param regionLoadBldr * the RegionLoad.Builder, can be null * @param regionSpecifier * the RegionSpecifier.Builder, can be null * @return RegionLoad instance. */ RegionLoad createRegionLoad(final HRegion r, RegionLoad.Builder regionLoadBldr, RegionSpecif...
3.26
hbase_HRegionServer_closeRegion_rdh
/** * Close asynchronously a region, can be called from the master or internally by the regionserver * when stopping. If called from the master, the region will update the status. * <p> * If an opening was in progress, this method will cancel it, but will not start a new close. The * coprocessors are not called in...
3.26
hbase_HRegionServer_getBlockCache_rdh
/** * May be null if this is a master which not carry table. * * @return The block cache instance used by the regionserver. */ @Override public Optional<BlockCache> getBlockCache() { return Optional.ofNullable(this.blockCache); }
3.26
hbase_HRegionServer_roundSize_rdh
// Round the size with KB or MB. // A trick here is that if the sizeInBytes is less than sizeUnit, we will round the size to 1 // instead of 0 if it is not 0, to avoid some schedulers think the region has no data. See // HBASE-26340 for more details on why this is important. private static int roundSize(long sizeInByte...
3.26
hbase_HRegionServer_convertThrowableToIOE_rdh
/** * * @param msg * Message to put in new IOE if passed <code>t</code> is not an IOE * @return Make <code>t</code> an IOE if it isn't already. */ private IOException convertThrowableToIOE(final Throwable t, final String msg) { return t instanceof IOException ? ((IOException) (t)) : (msg == null) || (msg.length(...
3.26
hbase_HRegionServer_run_rdh
/** * The HRegionServer sticks in this loop until closed. */ @Override public void run() { if (isStopped()) { LOG.info("Skipping run; stopped"); return; } try { // Do pre-registration initializations; zookeeper, lease threads, etc. preRegistrationInitialization(); } catch (Throwable e) { abort("Fatal exception during...
3.26
hbase_HRegionServer_getOnlineTables_rdh
/** * Gets the online tables in this RS. This method looks at the in-memory onlineRegions. * * @return all the online tables in this RS */ public Set<TableName> getOnlineTables() { Set<TableName> tables = new HashSet<>(); synchronized(this.onlineRegions) { for (Region region : this.onlineRegions.values()) { table...
3.26
hbase_HRegionServer_createRegionServerStatusStub_rdh
/** * Get the current master from ZooKeeper and open the RPC connection to it. To get a fresh * connection, the current rssStub must be null. Method will block until a master is available. * You can break from this block by requesting the server stop. * * @param refresh * If true then master address will be rea...
3.26
hbase_HRegionServer_closeMetaTableRegions_rdh
/** * Close meta region if we carry it * * @param abort * Whether we're running an abort. */ private void closeMetaTableRegions(final boolean abort) { HRegion meta = null; this.onlineRegionsLock.writeLock().lock(); try { for (Map.Entry<String, HRegion> e : onlineRegions.entrySet()) {R...
3.26
hbase_HRegionServer_m0_rdh
/** * Bring up connection to zk ensemble and then wait until a master for this cluster and then after * that, wait until cluster 'up' flag has been set. This is the order in which master does things. * <p> * Finally open long-living server short-circuit connection. */ @SuppressWarnings(value = "RV_RETURN_VALUE_IGN...
3.26
hbase_HRegionServer_constructRegionServer_rdh
/** * Utility for constructing an instance of the passed HRegionServer class. */ static HRegionServer constructRegionServer(final Class<? extends HRegionServer> regionServerClass, final Configuration conf) { try { Constructor<? extends HRegionServer> c = regionServerClass.getConstructor(Configuration.class); ...
3.26