name
stringlengths
12
178
code_snippet
stringlengths
8
36.5k
score
float64
3.26
3.68
hbase_ZKProcedureCoordinator_m0_rdh
/** * Start monitoring znodes in ZK - subclass hook to start monitoring znodes they are about. * * @return true if succeed, false if encountered initialization errors. */ @Override public final boolean m0(final ProcedureCoordinator coordinator) { if (this.coordinator != null) { throw new IllegalStateExc...
3.26
hbase_SequenceIdAccounting_onRegionClose_rdh
/** * Clear all the records of the given region as it is going to be closed. * <p/> * We will call this once we get the region close marker. We need this because that, if we use * Durability.ASYNC_WAL, after calling startCacheFlush, we may still get some ongoing wal entries * that has not been processed yet, this ...
3.26
hbase_SequenceIdAccounting_findLower_rdh
/** * Iterates over the given Map and compares sequence ids with corresponding entries in * {@link #lowestUnflushedSequenceIds}. If a region in {@link #lowestUnflushedSequenceIds} has a * sequence id less than that passed in <code>sequenceids</code> then return it. * * @param sequenceids * Sequenceids keyed by ...
3.26
hbase_SequenceIdAccounting_areAllLower_rdh
/** * See if passed <code>sequenceids</code> are lower -- i.e. earlier -- than any outstanding * sequenceids, sequenceids we are holding on to in this accounting instance. * * @param sequenceids * Keyed by encoded region name. Cannot be null (doesn't make sense for it to * be null). * @param keysBlocking * ...
3.26
hbase_SequenceIdAccounting_updateStore_rdh
/** * Update the store sequence id, e.g., upon executing in-memory compaction */ void updateStore(byte[] encodedRegionName, byte[] familyName, Long sequenceId, boolean onlyIfGreater) { if (sequenceId == null) { return; } Long highest = this.highestSequenceIds.get(...
3.26
hbase_SequenceIdAccounting_getLowestSequenceId_rdh
/** * * @param sequenceids * Map to search for lowest value. * @return Lowest value found in <code>sequenceids</code>. */ private static long getLowestSequenceId(Map<?, Long> sequenceids) { long lowest = HConstants.NO_SEQNUM; for (Map.Entry<?, Long> entry : sequenceids.entrySet()) { if (entry.g...
3.26
hbase_SequenceIdAccounting_update_rdh
/** * We've been passed a new sequenceid for the region. Set it as highest seen for this region and * if we are to record oldest, or lowest sequenceids, save it as oldest seen if nothing currently * older. * * @param lowest * Whether to keep running account of oldest sequence id. */ void update(byte[] encodedR...
3.26
hbase_RegionReplicaCandidateGenerator_selectCoHostedRegionPerGroup_rdh
/** * Randomly select one regionIndex out of all region replicas co-hosted in the same group (a group * is a server, host or rack) * * @param colocatedReplicaCountsPerGroup * either Cluster.colocatedReplicaCountsPerServer, * colocatedReplicaCountsPerHost or * colocatedReplic...
3.26
hbase_ClientExceptionsUtil_findException_rdh
/** * Look for an exception we know in the remote exception: - hadoop.ipc wrapped exceptions - nested * exceptions Looks for: RegionMovedException / RegionOpeningException / RegionTooBusyException / * RpcThrottlingException * * @return null if we didn't find the exception, the exception otherwise. */ public stati...
3.26
hbase_ClientExceptionsUtil_translatePFFE_rdh
/** * Translates exception for preemptive fast fail checks. * * @param t * exception to check * @return translated exception */ public static Throwable translatePFFE(Throwable t) throws IOException { if (t instanceof NoSuchMethodError) { // We probably can't recover from this exception by retrying. ...
3.26
hbase_ClientExceptionsUtil_isConnectionException_rdh
/** * Check if the exception is something that indicates that we cannot contact/communicate with the * server. * * @param e * exception to check * @return true when exception indicates that the client wasn't able to make contact with server */ public static boolean isConnectionException(Throwable e) { if ...
3.26
hbase_ServerListener_m0_rdh
/** * The server was removed from the cluster. * * @param serverName * The remote servers name. */ default void m0(final ServerName serverName) { }
3.26
hbase_ServerListener_serverAdded_rdh
/** * The server has joined the cluster. * * @param serverName * The remote servers name. */ default void serverAdded(final ServerName serverName) { }
3.26
hbase_ServerListener_waiting_rdh
/** * Started waiting on RegionServers to check-in. */ default void waiting() { }
3.26
hbase_ByteBufferIOEngine_write_rdh
/** * Transfers data from the given {@link ByteBuff} to the buffer array. Position of source will be * advanced by the {@link ByteBuffer#remaining()}. * * @param src * the given byte buffer from which bytes are to be read. * @param offset * The offset in the ByteBufferArray of the first byte to be written *...
3.26
hbase_ByteBufferIOEngine_shutdown_rdh
/** * No operation for the shutdown in the memory IO engine */ @Override public void shutdown() { // Nothing to do. }
3.26
hbase_ByteBufferIOEngine_isPersistent_rdh
/** * Memory IO engine is always unable to support persistent storage for the cache */ @Overridepublic boolean isPersistent() { return false; }
3.26
hbase_ByteBufferIOEngine_sync_rdh
/** * No operation for the sync in the memory IO engine */ @Override public void sync() { // Nothing to do. }
3.26
hbase_AccessChecker_requireTablePermission_rdh
/** * Authorizes that the current user has any of the given permissions for the given table, column * family and column qualifier. * * @param user * Active user to which authorization checks should be applied * @param request * Request type * @param tableName * Table requested * @param family * Colum...
3.26
hbase_AccessChecker_getUserGroups_rdh
/** * Retrieve the groups of the given user. * * @param user * User name */ public static List<String> getUserGroups(String user) { try { return groupService.getGroups(user); } catch (IOException e) { LOG.error("Error occurred while retrieving group for " + user, e);return new ArrayList<>(); }}
3.26
hbase_AccessChecker_hasUserPermission_rdh
/** * Authorizes that if the current user has the given permissions. * * @param user * Active user to which authorization checks should be applied * @param request * Request type * @param permission * Actions being requested * @return True if the user has the specific permission */ public boolean hasUse...
3.26
hbase_AccessChecker_initGroupService_rdh
/* Initialize the group service. */ private void initGroupService(Configuration conf) { if (groupService == null) { if (conf.getBoolean(TestingGroups.TEST_CONF, false)) { UserProvider.setGroups(new User.TestingGroups(UserProvider.getGroups())); groupService = UserProvider.getGroups(); } else { groupService = Groups.g...
3.26
hbase_AccessChecker_requireGlobalPermission_rdh
/** * Checks that the user has the given global permission. The generated audit log message will * contain context information for the operation being authorized, based on the given parameters. * * @param user * Active user to which authorization checks should be applied * @param req...
3.26
hbase_AccessChecker_requireNamespacePermission_rdh
/** * Checks that the user has the given global or namespace permission. * * @param user * Active user to which authorization checks should be applied * @param request * Request type * @param namespace * The given namespace * @param tableName * Table requested * @param familyMap * Column family ma...
3.26
hbase_AccessChecker_requirePermission_rdh
/** * Authorizes that the current user has any of the given permissions for the given table, column * family and column qualifier. * * @param user * Active user to which authorization checks should be applied * @param request * Request type * @param tableName * Tab...
3.26
hbase_AccessChecker_performOnSuperuser_rdh
/** * Check if caller is granting or revoking superusers's or supergroups's permissions. * * @param request * request name * @param caller * caller * @param userToBeChecked * target user or group * @throws IOException * AccessDeniedException if target user is superuser */ public void performOnSuperus...
3.26
hbase_AccessChecker_requireAccess_rdh
/** * Authorizes that the current user has any of the given permissions to access the table. * * @param user * Active user to which authorization checks should be applied * @param request * Request type. * @param tableName * Table requested * @param permissions * Actions being requested * @throws IOE...
3.26
hbase_HealthChecker_init_rdh
/** * Initialize. * * @param location * the location of the health script * @param timeout * the timeout to be used for the health script */ public void init(String location, long timeout) { this.healthCheckScript = location; this.scriptTimeout = timeout; ArrayList<String> execScript = new Arra...
3.26
hbase_ZKTableArchiveClient_getArchivingEnabled_rdh
/** * Determine if archiving is enabled (but not necessarily fully propagated) for a table * * @param table * name of the table to check * @return <tt>true</tt> if it is, <tt>false</tt> otherwise * @throws IOException * if an unexpected network issue occurs * @throws KeeperException * if zookeeper can't ...
3.26
hbase_ZKTableArchiveClient_enableHFileBackupAsync_rdh
/** * Turn on backups for all HFiles for the given table. * <p> * All deleted hfiles are moved to the archive directory under the table directory, rather than * being deleted. * <p> * If backups are already enabled for this table, does nothing. * <p> * If the table does not exist, the archiving the table's hfil...
3.26
hbase_ZKTableArchiveClient_disableHFileBackup_rdh
/** * Disable hfile backups for all tables. * <p> * Previously backed up files are still retained (if present). * <p> * Asynchronous operation - some extra HFiles may be retained, in the archive directory after * disable is called, dependent on the latency in zookeeper to the servers. * * @throws IOException *...
3.26
hbase_ZKTableArchiveClient_getArchiveZNode_rdh
/** * * @param conf * conf to read for the base archive node * @param zooKeeper * zookeeper to used for building the full path * @return get the znode for long-term archival of a table for */ public static String getArchiveZNode(Configuration conf, ZKWatcher zooKeeper) {return ZNodePaths.joinZNode(zooKeeper....
3.26
hbase_EnabledTableSnapshotHandler_snapshotRegions_rdh
// TODO consider switching over to using regionnames, rather than server names. This would allow // regions to migrate during a snapshot, and then be involved when they are ready. Still want to // enforce a snapshot time constraints, but lets us be potentially a bit more robust. /** * This method kicks off a snapshot ...
3.26
hbase_EnabledTableSnapshotHandler_m0_rdh
/** * Takes a snapshot of the mob region */private void m0(final RegionInfo regionInfo) throws IOException { snapshotManifest.addMobRegion(regionInfo); monitor.rethrowException(); status.setStatus("Completed referencing HFiles for the mob region of table: " + snapshotTable); }
3.26
hbase_BlockCache_notifyFileBlockEvicted_rdh
/** * Notifies the cache implementation that the given file had a block evicted * * @param fileName * the file had a block evicted. */ default void notifyFileBlockEvicted(String fileName) { // noop }
3.26
hbase_BlockCache_cacheBlock_rdh
/** * Add block to cache. * * @param cacheKey * The block's cache key. * @param buf * The block contents wrapped in a ByteBuffer. * @param inMemory * Whether block should be treated as in-memory * @param waitWhenCache * Whether to wait for the cache to be f...
3.26
hbase_BlockCache_isMetaBlock_rdh
/** * Check if block type is meta or index block * * @param blockType * block type of a given HFile block * @return true if block type is non-data block */ default boolean isMetaBlock(BlockType blockType) { return (blockType != null) && (blockType.getCategory() != BlockCategory.DATA); }
3.26
hbase_BlockCache_getBlock_rdh
/** * Fetch block from cache. * * @param cacheKey * Block to fetch. * @param caching * Whether this request has caching enabled (used for stats) * @param repeat * Whether this is a repeat lookup for the same block (used to avoid * double counting cache misses when doing double-check locking) * @param ...
3.26
hbase_BlockCache_notifyFileCachingCompleted_rdh
/** * Notifies the cache implementation that the given file has been fully cached (all its blocks * made into the cache). * * @param fileName * the file that has been completely cached. */ default void notifyFileCachingCompleted(Path fileName, int totalBlockCount, int dataBlockCount, long size) { // noop }
3.26
hbase_EnableTableProcedure_runCoprocessorAction_rdh
/** * Coprocessor Action. * * @param env * MasterProcedureEnv * @param state * the procedure state */ private void runCoprocessorAction(final MasterProcedureEnv env, final EnableTableState state) throws IOException, InterruptedException { final MasterCoprocessorHost cpHost = env.getMasterCoprocessorHost(...
3.26
hbase_EnableTableProcedure_setTableStateToEnabled_rdh
/** * Mark table state to Enabled * * @param env * MasterProcedureEnv */ protected static void setTableStateToEnabled(final MasterProcedureEnv env, final TableName tableName) throws IOException { // Flip the table to Enabled env.getMasterServices().getTableStateManager().setTableState(tableName, State.EN...
3.26
hbase_EnableTableProcedure_prepareEnable_rdh
/** * Action before any real action of enabling table. Set the exception in the procedure instead of * throwing it. This approach is to deal with backward compatible with 1.0. * * @param env * MasterProcedureEnv * @return whether the table passes the necessary checks */ private boolean prepareEnable(final Mast...
3.26
hbase_EnableTableProcedure_postEnable_rdh
/** * Action after enabling table. * * @param env * MasterProcedureEnv * @param state * the procedure state */private void postEnable(final MasterProcedureEnv env, final EnableTableState state) throws IOException, InterruptedException { runCoprocessorAction(env, state); }
3.26
hbase_EnableTableProcedure_preEnable_rdh
/** * Action before enabling table. * * @param env * MasterProcedureEnv * @param state * the procedure state */ private void preEnable(final MasterProcedureEnv env, final EnableTableState state) throws IOException, InterruptedException { runCoprocessorAction(env, state); }
3.26
hbase_EnableTableProcedure_getMaxReplicaId_rdh
/** * Returns Maximum region replica id found in passed list of regions. */ private static int getMaxReplicaId(List<RegionInfo> regions) { int max = 0; for (RegionInfo regionInfo : regions) { if (regionInfo.getReplicaId() > max) { // Iterating through all the list to identify the highest r...
3.26
hbase_ZKListener_getWatcher_rdh
/** * Returns The watcher associated with this listener */ public ZKWatcher getWatcher() { return this.watcher; }
3.26
hbase_ZKListener_nodeCreated_rdh
/** * Called when a new node has been created. * * @param path * full path of the new node */public void nodeCreated(String path) { // no-op }
3.26
hbase_ZKListener_nodeDeleted_rdh
/** * Called when a node has been deleted * * @param path * full path of the deleted node */ public void nodeDeleted(String path) { // no-op }
3.26
hbase_ZKListener_nodeChildrenChanged_rdh
/** * Called when an existing node has a child node added or removed. * * @param path * full path of the node whose children have changed */ public void nodeChildrenChanged(String path) { // no-op }
3.26
hbase_ZKListener_nodeDataChanged_rdh
/** * Called when an existing node has changed data. * * @param path * full path of the updated node */ public void nodeDataChanged(String path) { // no-op }
3.26
hbase_RefCnt_create_rdh
/** * Create an {@link RefCnt} with an initial reference count = 1. If the reference count become * zero, the recycler will do nothing. Usually, an Heap {@link ByteBuff} will use this kind of * refCnt to track its life cycle, it help to abstract the code path although it's not really * needed to track on heap ByteB...
3.26
hbase_RefCnt_hasRecycler_rdh
/** * Returns true if this refCnt has a recycler. */ public boolean hasRecycler() { return recycler != ByteBuffAllocator.NONE; }
3.26
hbase_ClientSnapshotDescriptionUtils_toString_rdh
/** * Returns a single line (no \n) representation of snapshot metadata. Use this instead of the * {@code toString} method of * {@link org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotDescription}. * We don't replace * {@link org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos....
3.26
hbase_HeapMemoryManager_getHeapOccupancyPercent_rdh
/** * Returns heap occupancy percentage, 0 &lt;= n &lt;= 1. or -0.0 for error asking JVM */ public float getHeapOccupancyPercent() { return this.heapOccupancyPercent == Float.MAX_VALUE ? HEAP_OCCUPANCY_ERROR_VALUE : this.heapOccupancyPercent; }
3.26
hbase_HeapMemoryManager_isTunerOn_rdh
// Used by the test cases. boolean isTunerOn() { return this.tunerOn; }
3.26
hbase_ClientIdGenerator_generateClientId_rdh
/** * Returns a unique ID incorporating IP address, PID, TID and timer. Might be an overkill... Note * though that new UUID in java by default is just a random number. */ public static byte[] generateClientId() {byte[] selfBytes = getIpAddressBytes(); Long pid = getPid(); long tid = Thread.currentThread().ge...
3.26
hbase_ClientIdGenerator_getPid_rdh
/** * Returns PID of the current process, if it can be extracted from JVM name, or null. */public static Long getPid() { String name = ManagementFactory.getRuntimeMXBean().getName(); List<String> nameParts = Splitter.on('@').splitToList(name);if (nameParts.size() == 2) { // 12345@somewhere try...
3.26
hbase_ClientIdGenerator_getIpAddressBytes_rdh
/** * Returns Some IPv4/IPv6 address available on the current machine that is up, not virtual and not * a loopback address. Empty array if none can be found or error occurred. */ public static byte[] getIpAddressBytes() { try { return Addressing.getIpAddress().getAddress(); ...
3.26
hbase_StealJobQueue_getStealFromQueue_rdh
/** * Get a queue whose job might be stolen by the consumer of this original queue * * @return the queue whose job could be stolen */ public BlockingQueue<T> getStealFromQueue() { return f0; }
3.26
hbase_RSProcedureDispatcher_splitAndResolveOperation_rdh
/** * Fetches {@link org.apache.hadoop.hbase.procedure2.RemoteProcedureDispatcher.RemoteOperation}s * from the given {@code remoteProcedures} and groups them by class of the returned operation. * Then {@code resolver} is used to dispatch {@link RegionOpenOperation}s and * {@l...
3.26
hbase_RSProcedureDispatcher_sendRequest_rdh
// will be overridden in test. protected ExecuteProceduresResponse sendRequest(final ServerName serverName, final ExecuteProceduresRequest request) throws IOException { return FutureUtils.get(getRsAdmin().executeProcedures(request)); }
3.26
hbase_KeyOnlyFilter_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 KeyOnlyFilter)) { return false; ...
3.26
hbase_KeyOnlyFilter_toByteArray_rdh
/** * Returns The filter serialized using pb */ @Override public byte[] toByteArray() { FilterProtos.KeyOnlyFilter.Builder builder = FilterProtos.KeyOnlyFilter.newBuilder(); builder.setLenAsVal(this.lenAsVal); return builder.build().toByteArray(); }
3.26
hbase_KeyOnlyFilter_m1_rdh
/** * Parse a serialized representation of {@link KeyOnlyFilter} * * @param pbBytes * A pb serialized {@link KeyOnlyFilter} instance * @return An instance of {@link KeyOnlyFilter} made from <code>bytes</code> * @throws DeserializationException * if an error occurred * @see #toByteArray */ public static Key...
3.26
hbase_MonitoredTaskImpl_expireNow_rdh
/** * Force the completion timestamp backwards so that it expires now. */ @Override public void expireNow() { stateTime -= 180 * 1000; }
3.26
hbase_MonitoredTaskImpl_getStatusJournal_rdh
/** * Returns the status journal. This implementation of status journal is not thread-safe. Currently * we use this to track various stages of flushes and compactions where we can use this/pretty * print for post task analysis, by which time we are already done changing states (writing to * journal) */ @Override p...
3.26
hbase_SlowLogQueueService_consumeEventFromDisruptor_rdh
/** * This implementation is specific to slowLog event. This consumes slowLog event from disruptor * and inserts records to EvictingQueue. * * @param namedQueuePayload * namedQueue payload from disruptor ring buffer */ @Override public void consumeEventFromDisruptor(NamedQueuePayload namedQueuePayload) { if...
3.26
hbase_MultiRowMutationEndpoint_start_rdh
/** * Stores a reference to the coprocessor environment provided by the * {@link org.apache.hadoop.hbase.regionserver.RegionCoprocessorHost} from the region where this * coprocessor is loaded. Since this is a coprocessor endpoint, it always expects to be loaded on * a table region, so always expects this to be an i...
3.26
hbase_QuotaCache_getTableLimiter_rdh
/** * Returns the limiter associated to the specified table. * * @param table * the table to limit * @return the limiter associated to the specified table */ public QuotaLimiter getTableLimiter(final TableName table) { return getQuotaState(this.tableQuotaCache, table).getGlobalLimiter(); }
3.26
hbase_QuotaCache_getNamespaceLimiter_rdh
/** * Returns the limiter associated to the specified namespace. * * @param namespace * the namespace to limit * @return the limiter associated to the specified namespace */ public QuotaLimiter getNamespaceLimiter(final String namespace) { return getQuotaState(this.namespaceQuotaCache, namespace).getGlobal...
3.26
hbase_QuotaCache_getQuotaUserName_rdh
/** * Applies a request attribute user override if available, otherwise returns the UGI's short * username * * @param ugi * The request's UserGroupInformation */ private String getQuotaUserName(final UserGroupInformation ugi) {if (userOverrideRequestAttributeKey == null) { return ugi.getShortUserName();...
3.26
hbase_QuotaCache_getQuotaState_rdh
/** * Returns the QuotaState requested. If the quota info is not in cache an empty one will be * returned and the quota request will be enqueued for the next cache refresh. */private <K> QuotaState getQuotaState(final ConcurrentMap<K, QuotaState> quotasMap, final K key) { return computeIfAbsent(quotasMap, key, ...
3.26
hbase_QuotaCache_m0_rdh
/** * Returns the QuotaState associated to the specified user. * * @param ugi * the user * @return the quota info associated to specified user */ public UserQuotaState m0(final UserGroupInformation ugi) { return computeIfAbsent(userQuotaCache, getQuotaUserName(ugi), UserQuotaState::new, this::triggerCache...
3.26
hbase_QuotaCache_updateQuotaFactors_rdh
/** * Update quota factors which is used to divide cluster scope quota into machine scope quota For * user/namespace/user over namespace quota, use [1 / RSNum] as machine factor. For table/user * over table quota, use [1 / TotalTableRegionNum * MachineTableRegionNum] as machine factor. */ private void updateQuotaFa...
3.26
hbase_QuotaCache_getUserLimiter_rdh
/** * Returns the limiter associated to the specified user/table. * * @param ugi * the user to limit * @param table * the table to limit * @return the limiter associated to the specified user/table */ public QuotaLimiter getUserLimiter(final UserGroupInformation ugi, final TableName table) { if (table....
3.26
hbase_LazyInitializedWALProvider_getProviderNoCreate_rdh
/** * Get the provider if it already initialized, otherwise just return {@code null} instead of * creating it. */ WALProvider getProviderNoCreate() { return holder.get(); }
3.26
hbase_MBeanSourceImpl_register_rdh
/** * Register an mbean with the underlying metrics system * * @param serviceName * Metrics service/system name * @param metricsName * name of the metrics obejct to expose * @param theMbean * the actual MBean * @return ObjectName from jmx */ @Override public ObjectName register(String serviceName, Strin...
3.26
hbase_ByteBuffInputStream_read_rdh
/** * Reads the next byte of data from this input stream. The value byte is returned as an * <code>int</code> in the range <code>0</code> to <code>255</code>. If no byte is available * because the end of the stream has been reached, the value <code>-1</code> is returned. * * @return the next byte of data, or <code...
3.26
hbase_ByteBuffInputStream_skip_rdh
/** * Skips <code>n</code> bytes of input from this input stream. Fewer bytes might be skipped if the * end of the input stream is reached. The actual number <code>k</code> of bytes to be skipped is * equal to the smaller of <code>n</code> and remaining bytes in the stream. * * @param n * the number of bytes to...
3.26
hbase_HBaseRpcController_getTableName_rdh
/** * Returns Region's table name or null if not available or pertinent. */ default TableName getTableName() { return null; }
3.26
hbase_HBaseRpcController_hasRegionInfo_rdh
/** * Returns True if this Controller is carrying the RPC target Region's RegionInfo. */ default boolean hasRegionInfo() { return false; }
3.26
hbase_HBaseRpcController_setTableName_rdh
/** * Sets Region's table name. */ default void setTableName(TableName tableName) { }
3.26
hbase_HBaseRpcController_getRegionInfo_rdh
/** * Returns Target Region's RegionInfo or null if not available or pertinent. */ default RegionInfo getRegionInfo() { return null; }
3.26
hbase_SkipFilter_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 SkipFilter)) { return false; ...
3.26
hbase_SkipFilter_parseFrom_rdh
/** * Parse a serialized representation of {@link SkipFilter} * * @param pbBytes * A pb serialized {@link SkipFilter} instance * @return An instance of {@link SkipFilter} made from <code>bytes</code> * @throws DeserializationException * if an error occurred * @see #toByteArray */ public static SkipFilter p...
3.26
hbase_SkipFilter_toByteArray_rdh
/** * Returns The filter serialized using pb */ @Override public byte[] toByteArray() throws IOException { FilterProtos.SkipFilter.Builder builder = FilterProtos.SkipFilter.newBuilder(); builder.setFilter(ProtobufUtil.toFilter(this.filter)); return builder.build().toByteArray(); }
3.26
hbase_MiniZooKeeperCluster_hasValidClientPortInList_rdh
/** * Check whether the client port in a specific position of the client port list is valid. * * @param index * the specified position */ private boolean hasValidClientPortInList(int index) { return (clientPortList.size() > index) && (clientPortList.get(index) > 0); }
3.26
hbase_MiniZooKeeperCluster_selectClientPort_rdh
/** * Selects a ZK client port. * * @param seedPort * the seed port to start with; -1 means first time. * @return a valid and unused client port */ private int selectClientPort(int seedPort) { int i...
3.26
hbase_MiniZooKeeperCluster_setupTestEnv_rdh
// / XXX: From o.a.zk.t.ClientBase private static void setupTestEnv() { // during the tests we run with 100K prealloc in the logs. // on windows systems prealloc of 64M was seen to take ~15seconds // resulting in test failure (client timeout on first session). // set env and directly in order to handle...
3.26
hbase_MiniZooKeeperCluster_addClientPort_rdh
/** * Add a client port to the list. * * @param clientPort * the specified port */ public void addClientPort(int clientPort) { clientPortList.add(clientPort); }
3.26
hbase_MiniZooKeeperCluster_waitForServerUp_rdh
// XXX: From o.a.zk.t.ClientBase. Its in the test jar but we don't depend on zk test jar. // We remove the SSL/secure bit. Not used in here. private static boolean waitForServerUp(int port, long timeout) throws IOException { long start = EnvironmentEdgeManager.currentTime(); while (true) { try { ...
3.26
hbase_MiniZooKeeperCluster_getAddress_rdh
/** * Returns Address for this cluster instance. */ public Address getAddress() { return Address.fromParts(HOST, getClientPort()); }
3.26
hbase_MiniZooKeeperCluster_waitForServerDown_rdh
// XXX: From o.a.zk.t.ClientBase. We just dropped the check for ssl/secure. private static boolean waitForServerDown(int port, long timeout) throws IOException { long start = EnvironmentEdgeManager.currentTime(); while (true) { try { send4LetterWord(HOST, port, "stat", false, ((int) (tim...
3.26
hbase_MiniZooKeeperCluster_killOneBackupZooKeeperServer_rdh
/** * Kill one back up ZK servers. * * @throws IOException * if waiting for the shutdown of a server fails */ public void killOneBackupZooKeeperServer() throws IOException, InterruptedException { if (((!started) || (activeZKServerIndex < 0)) || (standaloneServerFactoryList.size() <= 1)) { return; ...
3.26
hbase_MiniZooKeeperCluster_shutdown_rdh
/** * * @throws IOException * if waiting for the shutdown of a server fails */ public void shutdown() throws IOException { // shut down all the zk servers for (int i = 0; i < standaloneServerFactoryList.size(); i++) { NIOServerCnxnFactory standaloneServerFactory = standaloneServerFactoryList.get...
3.26
hbase_MiniZooKeeperCluster_getClientPortList_rdh
/** * Get the list of client ports. * * @return clientPortList the client port list */ @InterfaceAudience.Private public List<Integer> getClientPortList() { return clientPortList; }
3.26
hbase_RegionSplitRestriction_create_rdh
/** * Create the RegionSplitRestriction configured for the given table. * * @param tableDescriptor * the table descriptor * @param conf * the configuration * @return a RegionSplitRestriction instance * @throws IOException * if an error occurs */ public static RegionSplitRestriction create(TableDescri...
3.26
hbase_HDFSBlocksDistribution_addHostAndBlockWeight_rdh
/** * add some weight to a specific host * * @param host * the host name * @param weight * the weight * @param weightForSsd * the weight for ssd */ private void addHostAndBlockWeight(String host, long weight, long ...
3.26
hbase_HDFSBlocksDistribution_getBlockLocalityIndex_rdh
/** * Get the block locality index for a given host * * @param host * the host name * @return the locality index of the given host */ public float getBlockLocalityIndex(String host) { if (uniqueBlocksTotalWeight == 0) { return 0.0F; } else { return ((float) (getBlocksLocalityWeightInternal(h...
3.26
hbase_HDFSBlocksDistribution_getHost_rdh
/** * Returns the host name */ public String getHost() { return host; }
3.26