name stringlengths 12 178 | code_snippet stringlengths 8 36.5k | score float64 3.26 3.68 |
|---|---|---|
hbase_HRegionServer_closeRegionIgnoreErrors_rdh | /**
* Try to close the region, logs a warning on failure but continues.
*
* @param region
* Region to close
*/
private void closeRegionIgnoreErrors(RegionInfo region, final boolean abort) {
try {
if (!closeRegion(region.getEncodedName(), abort, null)) {LOG.warn(("Failed to close " + region.getRegionNameAsString(... | 3.26 |
hbase_HRegionServer_buildRegionSpaceUseReportRequest_rdh | /**
* Builds a {@link RegionSpaceUseReportRequest} protobuf message from the region size map.
*
* @param regionSizes
* The size in bytes of regions
* @return The corresponding protocol buffer message.
*/
RegionSpaceUseReportRequest buildRegionSpaceUseReportRequest(RegionSizeStore regionSizes) {
RegionSpaceUseRe... | 3.26 |
hbase_HRegionServer_getRegion_rdh | /**
* Protected Utility method for safely obtaining an HRegion handle.
*
* @param regionName
* Name of online {@link HRegion} to return
* @return {@link HRegion} for <code>regionName</code>
*/
protected HRegion getRegion(final byte[] regionName) throws NotServingRegionException {
String encodedRegionName = R... | 3.26 |
hbase_HRegionServer_getCompactSplitThread_rdh | /**
* Returns the underlying {@link CompactSplit} for the servers
*/
public CompactSplit getCompactSplitThread() {
return this.compactSplitThread;
} | 3.26 |
hbase_HRegionServer_preRegistrationInitialization_rdh | /**
* All initialization needed before we go register with Master.<br>
* Do bare minimum. Do bulk of initializations AFTER we've connected to the Master.<br>
* In here we just put up the RpcServer, setup Connection, and ZooKeeper.
*/
private void preRegistrationInitialization() {
final Span span = TraceUtil.createS... | 3.26 |
hbase_HRegionServer_abort_rdh | /**
* Cause the server to exit without closing the regions it is serving, the log it is using and
* without notifying the master. Used unit testing and on catastrophic events such as HDFS is
* yanked out from under hbase or we OOME. the reason we are aborting the exception that caused
* the abort, or null
*/
@Over... | 3.26 |
hbase_HRegionServer_createNewReplicationInstance_rdh | //
// Main program and support routines
//
/**
* Load the replication executorService objects, if any
*/
private static void createNewReplicationInstance(Configuration conf, HRegionServer server, FileSystem walFs, Path walDir, Path oldWALDir, WALFactory walFactory) throws IOException {
// read in the name of the s... | 3.26 |
hbase_HRegionServer_getWriteRequestCount_rdh | /**
* Returns Current write count for all online regions.
*/
private long
getWriteRequestCount() {
long writeCount = 0;
for (Map.Entry<String, HRegion> e : this.onlineRegions.entrySet()) {
writeCount += e.getValue().getWriteRequestsCount();}
return writeCount;
} | 3.26 |
hbase_HRegionServer_getMobFileCache_rdh | /**
* May be null if this is a master which not carry table.
*
* @return The cache for mob files used by the regionserver.
*/
@Override
public Optional<MobFileCache> getMobFileCache() {
return Optional.ofNullable(this.mobFileCache);
} | 3.26 |
hbase_HRegionServer_checkFileSystem_rdh | /**
* Checks to see if the file system is still accessible. If not, sets abortRequested and
* stopRequested
*
* @return false if file system is not available
*/
boolean checkFileSystem() {
if (this.dataFsOk && (this.dataFs
!= null)) {
try {
FSUtils.checkFileSystemAvailable(this.dataFs);
} catch (IOException e) {... | 3.26 |
hbase_HRegionServer_startReplicationService_rdh | /**
* Start up replication source and sink handlers.
*/
private void startReplicationService() throws IOException {
if (sameReplicationSourceAndSink && (this.replicationSourceHandler != null)) {
this.replicationSourceHandler.startReplicationService();
} else {
if (this.replicationSourceHandler != null) {this.replic... | 3.26 |
hbase_HRegionServer_scheduleAbortTimer_rdh | // Limits the time spent in the shutdown process.
private void scheduleAbortTimer() {
if (this.abortMonitor == null) {
this.abortMonitor = new Timer("Abort regionserver monitor", true);
TimerTask abortTimeoutTask = null;
try {
Constructor<? extends TimerTask> timerTaskCtor =
Class.forName(conf.get(ABORT_TIMEOUT_TASK, ... | 3.26 |
hbase_HRegionServer_stop_rdh | /**
* Stops the regionserver.
*
* @param msg
* Status message
* @param force
* True if this is a regionserver abort
* @param user
* The user executing the stop request, or null if no user is associated
*/public void stop(final String msg, final boolean force, final User user) {
if (!this.stopped) {
LOG... | 3.26 |
hbase_HRegionServer_isDataFileSystemOk_rdh | /**
* Returns {@code true} when the data file system is available, {@code false} otherwise.
*/
boolean isDataFileSystemOk() {
return this.dataFsOk;
} | 3.26 |
hbase_HRegionServer_convertRegionSize_rdh | /**
* Converts a pair of {@link RegionInfo} and {@code long} into a {@link RegionSpaceUse} protobuf
* message.
*
* @param regionInfo
* The RegionInfo
* @param sizeInBytes
* The size in bytes of the Region
* @return The protocol buffer
*/
RegionSpaceUse convertRegionSize(RegionInfo regionInfo, Long sizeInBy... | 3.26 |
hbase_HRegionServer_startServices_rdh | /**
* Start maintenance Threads, Server, Worker and lease checker threads. Start all threads we need
* to run. This is called after we've successfully registered with the Master. Install an
* UncaughtExceptionHandler that calls abort of RegionServer if we get an unhandled exception. We
* cannot set the handler on a... | 3.26 |
hbase_HRegionServer_isOnline_rdh | /**
* Report the status of the server. A server is online once all the startup is completed (setting
* up filesystem, starting executorService threads, etc.). This method is designed mostly to be
* useful in tests.
*
* @return true if online, false if not.
*/
public boolean isOnline() {
return online.get();
} | 3.26 |
hbase_HRegionServer_getMasterAddressTracker_rdh | /**
* Returns Master address tracker instance.
*/
public MasterAddressTracker
getMasterAddressTracker() {
return this.masterAddressTracker;
} | 3.26 |
hbase_HRegionServer_isHealthy_rdh | /* Verify that server is healthy */private boolean isHealthy() {
if (!dataFsOk) {
// File system problem
return false;
}
// Verify that all threads are alive
boolean healthy = (((((this.leaseManager == null)
|| this.leaseManager.isAlive()) && ((this.cacheFlusher == null) || this.cacheFlusher.isAlive())) && ((this.walR... | 3.26 |
hbase_HRegionServer_isClusterUp_rdh | /**
* Returns True if the cluster is up.
*/
@Override
public boolean isClusterUp() {
return this.masterless || ((this.clusterStatusTracker != null) && this.clusterStatusTracker.isClusterUp());
} | 3.26 |
hbase_HRegionServer_finishRegionProcedure_rdh | /**
* See {@link #submitRegionProcedure(long)}.
*
* @param procId
* the id of the open/close region procedure
*/
public void finishRegionProcedure(long procId) {
executedRegionProcedures.put(procId, procId);
submittedRegionProcedures.remove(procId);
} | 3.26 |
hbase_HRegionServer_skipReportingTransition_rdh | /**
* Helper method for use in tests. Skip the region transition report when there's no master around
* to receive it.
*/
private boolean skipReportingTransition(final RegionStateTransitionContext context) {
final TransitionCode code = context.getCode();
final long openSeqNum = context.getOpenSeqNum();
long masterSy... | 3.26 |
hbase_JMXJsonServlet_init_rdh | /**
* Initialize this servlet.
*/
@Override
public void init() throws ServletException {
// Retrieve the MBean server
mBeanServer = ManagementFactory.getPlatformMBeanServer();
this.jsonBeanWriter = new JSONBean();
} | 3.26 |
hbase_JMXJsonServlet_doGet_rdh | /**
* Process a GET request for the specified resource. The servlet request we are processing The
* servlet response we are creating
*/
@Override
public void
doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
try {
if (!HttpServer.isInstrumentationAccessAllowed(getServl... | 3.26 |
hbase_JMXJsonServlet_checkCallbackName_rdh | /**
* Verifies that the callback property, if provided, is purely alphanumeric. This prevents a
* malicious callback name (that is javascript code) from being returned by the UI to an
* unsuspecting user.
*
* @param callbackName
* The callback name, can be null.
* @return The callback name
* @throws IOExcepti... | 3.26 |
hbase_FirstKeyOnlyFilter_hasFoundKV_rdh | /**
* Returns true if first KV has been found.
*/
protected boolean hasFoundKV() {
return this.foundKV;
} | 3.26 |
hbase_FirstKeyOnlyFilter_parseFrom_rdh | /**
* Parse a serialized representation of {@link FirstKeyOnlyFilter}
*
* @param pbBytes
* A pb serialized {@link FirstKeyOnlyFilter} instance
* @return An instance of {@link FirstKeyOnlyFilter} made from <code>bytes</code>
* @throws DeserializationException
* if an error occurred
* @see #toByteArray
*/
pu... | 3.26 |
hbase_FirstKeyOnlyFilter_toByteArray_rdh | /**
* Returns The filter serialized using pb
*/
@Override
public byte[] toByteArray() {
FilterProtos.FirstKeyOnlyFilter.Builder builder = FilterProtos.FirstKeyOnlyFilter.newBuilder();
return builder.build().toByteArray();
} | 3.26 |
hbase_FirstKeyOnlyFilter_m0_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 m0(Filter o) {if (o == this) {
return true;
}
if (!(o instanceof FirstKeyOnlyFilter)) {
return false;
}
return true;... | 3.26 |
hbase_FirstKeyOnlyFilter_setFoundKV_rdh | /**
* Set or clear the indication if the first KV has been found.
*
* @param value
* update {@link #foundKV} flag with value.
*/
protected void setFoundKV(boolean value) {
this.foundKV = value;
} | 3.26 |
hbase_WALCellCodec_create_rdh | /**
* Create and setup a {@link WALCellCodec} from the CompressionContext. Cell Codec classname is
* read from {@link Configuration}. Fully prepares the codec for use.
*
* @param conf
* {@link Configuration} to read for the user-specified codec. If none is
* specified, uses a {@link WALCellCodec}.
* @param c... | 3.26 |
hbase_RpcExecutor_m0_rdh | /**
* Start up our handlers.
*/
protected void m0(final
String nameSuffix, final int numHandlers, final List<BlockingQueue<CallRunner>> callQueues, final int qindex, final int qsize, final int port, final AtomicInteger activeHandlerCount)
{final String threadPrefix = name + Strings.nullToEmpty(nameSuffix);
double... | 3.26 |
hbase_RpcExecutor_getRpcCallSize_rdh | /**
* Return the {@link RpcCall#getSize()} from {@code callRunner} or 0L.
*/private static long getRpcCallSize(final CallRunner callRunner) {
return Optional.ofNullable(callRunner).map(CallRunner::getRpcCall).map(RpcCall::getSize).orElse(0L);
} | 3.26 |
hbase_RpcExecutor_getHandler_rdh | /**
* Override if providing alternate Handler implementation.
*/
protected RpcHandler getHandler(final String name, final double handlerFailureThreshhold, final int handlerCount,
final
BlockingQueue<CallRunner> q, final AtomicInteger activeHandlerCount, final AtomicInteger failedHandlerCount, final Abortable aborta... | 3.26 |
hbase_RpcExecutor_getMethodName_rdh | /**
* Return the {@link Descriptors.MethodDescriptor#getName()} from {@code callRunner} or "Unknown".
*/
private static String getMethodName(final CallRunner callRunner) {
return Optional.ofNullable(callRunner).map(CallRunner::getRpcCall).map(RpcCall::getMethod).map(Descriptors.MethodDescriptor::getName).orElse("... | 3.26 |
hbase_RpcExecutor_getQueues_rdh | /**
* Returns the list of request queues
*/
protected List<BlockingQueue<CallRunner>> getQueues() {
return f0;
} | 3.26 |
hbase_RpcExecutor_resizeQueues_rdh | /**
* Update current soft limit for executor's call queues
*
* @param conf
* updated configuration
*/
public void resizeQueues(Configuration conf) {
String configKey = RpcScheduler.IPC_SERVER_MAX_CALLQUEUE_LENGTH;
if (name != null) {
if (name.toLowerCase(Locale.ROOT).contains("priority")) {
configKey = ... | 3.26 |
hbase_RpcExecutor_getQueueLength_rdh | /**
* Returns the length of the pending queue
*/
public int getQueueLength() {
int length = 0;
for (final BlockingQueue<CallRunner> queue : f0) {
length += queue.size();
}
return length;
} | 3.26 |
hbase_RpcCallContext_getRequestUserName_rdh | /**
* Returns Current request's user name or not present if none ongoing.
*/
default Optional<String> getRequestUserName() {
return getRequestUser().map(User::getShortName);
} | 3.26 |
hbase_RpcServer_getService_rdh | /**
*
* @param serviceName
* Some arbitrary string that represents a 'service'.
* @param services
* Available services and their service interfaces.
* @return BlockingService that goes with the passed <code>serviceName</code>
*/
protected static BlockingService getService(final List<BlockingServiceAndInterfa... | 3.26 |
hbase_RpcServer_getMetrics_rdh | /**
* Returns the metrics instance for reporting RPC call statistics
*/
@Overridepublic MetricsHBaseServer getMetrics() {
return metrics;
} | 3.26 |
hbase_RpcServer_getCurrentServerCallWithCellScanner_rdh | /**
* Just return the current rpc call if it is a {@link ServerCall} and also has {@link CellScanner}
* attached.
* <p/>
* Mainly used for reference counting as {@link CellScanner} may reference non heap memory.
*/
public static Optional<ServerCall<?>> getCurrentServerCallWithCellScanner() {
return getCurrentCall(... | 3.26 |
hbase_RpcServer_setErrorHandler_rdh | /**
* Set the handler for calling out of RPC for error conditions.
*
* @param handler
* the handler implementation
*/
@Override
public void setErrorHandler(HBaseRPCErrorHandler handler) {
this.errorHandler = handler;
} | 3.26 |
hbase_RpcServer_setCurrentCall_rdh | /**
* Used by {@link org.apache.hadoop.hbase.procedure2.store.region.RegionProcedureStore}. Set the
* rpc call back after mutate region.
*/
public static void setCurrentCall(RpcCall rpcCall) {CurCall.set(rpcCall);
} | 3.26 |
hbase_RpcServer_truncateTraceLog_rdh | /**
* Truncate to number of chars decided by conf hbase.ipc.trace.log.max.length if TRACE is on else
* to 150 chars Refer to Jira HBASE-20826 and HBASE-20942
*
* @param strParam
* stringifiedParam to be truncated
* @return truncated trace log string
*/
String truncateTraceLog(String strParam) {
if (f0.isTr... | 3.26 |
hbase_RpcServer_call_rdh | /**
* This is a server side method, which is invoked over RPC. On success the return response has
* protobuf response payload. On failure, the exception name and the stack trace are returned in
* the protobuf response.
*/
@Override
public Pair<Message, CellScanner> call(RpcCall call, MonitoredRPCHandler status) thr... | 3.26 |
hbase_RpcServer_getRequestUserName_rdh | /**
* Returns the username for any user associated with the current RPC request or not present if no
* user is set.
*/
public static Optional<String> getRequestUserName() {
return getRequestUser().map(User::getShortName);
} | 3.26 |
hbase_RpcServer_logResponse_rdh | /**
* Logs an RPC response to the LOG file, producing valid JSON objects for client Operations.
*
* @param param
* The parameters received in the call.
* @param methodName
* The name of the method invoked
* @param call
* The string representation of the call
* @param tooLarge
* To indicate if the even... | 3.26 |
hbase_RpcServer_channelIO_rdh | /**
* Helper for {@link #channelRead(java.nio.channels.ReadableByteChannel, java.nio.ByteBuffer)}.
* Only one of readCh or writeCh should be non-null.
*
* @param readCh
* read channel
* @param writeCh
* write channel
* @param buf
* buffer to read or write into/out of
* @return bytes written
* @throws j... | 3.26 |
hbase_RpcServer_getRequestUser_rdh | /**
* Returns the user credentials associated with the current RPC request or not present if no
* credentials were provided.
*
* @return A User
*/
public static Optional<User> getRequestUser() {
Optional<RpcCall> ctx = getCurrentCall();
return ctx.isPresent() ? ctx.get().getRequestUser() : Optional.empty();
} | 3.26 |
hbase_RpcServer_authorize_rdh | /**
* Authorize the incoming client connection.
*
* @param user
* client user
* @param connection
* incoming connection
* @param addr
* InetAddress of incoming connection
* @throws AuthorizationException
* when the client isn't authorized to talk the protocol
*/public synchronized void authorize(User... | 3.26 |
hbase_RpcServer_channelRead_rdh | /**
* This is a wrapper around
* {@link java.nio.channels.ReadableByteChannel#read(java.nio.ByteBuffer)}. If the amount of data
* is large, it writes to channel in smaller chunks. This is to avoid jdk from creating many
* direct buffers as the size of ByteBuffer increases. There should not be any performance
* deg... | 3.26 |
hbase_RpcServer_getServiceAndInterface_rdh | /**
*
* @param serviceName
* Some arbitrary string that represents a 'service'.
* @param services
* Available service instances
* @return Matching BlockingServiceAndInterface pair
*/
protected static BlockingServiceAndInterface getServiceAndInterface(final List<BlockingServiceAndInterface> services, final St... | 3.26 |
hbase_RpcServer_getRemoteAddress_rdh | /**
* Returns Address of remote client if a request is ongoing, else null
*/
public static Optional<InetAddress>
getRemoteAddress() {
return getCurrentCall().map(RpcCall::getRemoteAddress);
} | 3.26 |
hbase_RpcServer_getCurrentCall_rdh | /**
* Needed for features such as delayed calls. We need to be able to store the current call so that
* we can complete it later or ask questions of what is supported by the current ongoing call.
*
* @return An RpcCallContext backed by the currently ongoing call (gotten from a thread local)
*/
public static Option... | 3.26 |
hbase_Response_getLocation_rdh | /**
* Returns the value of the Location header
*/
public String getLocation() {
return getHeader("Location");
} | 3.26 |
hbase_Response_hasBody_rdh | /**
* Returns true if a response body was sent
*/
public boolean hasBody() {
return body != null;
} | 3.26 |
hbase_Response_setBody_rdh | /**
*
* @param body
* the response body
*/
public void setBody(byte[] body) {
this.body = body;
} | 3.26 |
hbase_Response_setCode_rdh | /**
*
* @param code
* the HTTP response code
*/
public void setCode(int code) {
this.code = code;
} | 3.26 |
hbase_Response_setHeaders_rdh | /**
*
* @param headers
* the HTTP response headers
*/
public void setHeaders(Header[] headers) {
this.headers = headers;
} | 3.26 |
hbase_Response_getHeaders_rdh | /**
* Returns the HTTP response headers
*/public Header[] getHeaders() {
return headers;
} | 3.26 |
hbase_Response_getBody_rdh | /**
* Returns the HTTP response body
*/
public byte[] getBody() {
if (body == null) {
try {body = Client.getResponseBody(resp);
} catch (IOException ioe) {
LOG.debug("encountered ioe when obtaining body", ioe);
}
}
return
body;
} | 3.26 |
hbase_Response_getStream_rdh | /**
* Gets the input stream instance.
*
* @return an instance of InputStream class.
*/
public InputStream getStream() {
return this.stream;
} | 3.26 |
hbase_ServerSideScanMetrics_getMetricsMap_rdh | /**
* Get all of the values. If reset is true, we will reset the all AtomicLongs back to 0.
*
* @param reset
* whether to reset the AtomicLongs to 0.
* @return A Map of String -> Long for metrics
*/
public Map<String, Long> getMetricsMap(boolean reset) {
// Create a builder
ImmutableMap.Builder<Strin... | 3.26 |
hbase_ServerSideScanMetrics_hasCounter_rdh | /**
* Returns true if a counter exists with the counterName
*/public boolean hasCounter(String counterName) {
return this.counters.containsKey(counterName);
} | 3.26 |
hbase_ServerSideScanMetrics_getCounter_rdh | /**
* Returns {@link AtomicLong} instance for this counter name, null if counter does not exist.
*/
public AtomicLong getCounter(String counterName) {
return this.counters.get(counterName);
} | 3.26 |
hbase_ServerSideScanMetrics_createCounter_rdh | /**
* Create a new counter with the specified name
*
* @return {@link AtomicLong} instance for the counter with counterName
*/
protected AtomicLong createCounter(String counterName) {
AtomicLong c = new AtomicLong(0);
counters.put(counterName, c);
return c;
} | 3.26 |
hbase_ColumnCountGetFilter_parseFrom_rdh | /**
* Parse a serialized representation of {@link ColumnCountGetFilter}
*
* @param pbBytes
* A pb serialized {@link ColumnCountGetFilter} instance
* @return An instance of {@link ColumnCountGetFilter} made from <code>bytes</code>
* @throws DeserializationException
* if an error occurred
* @see #toByteArray
... | 3.26 |
hbase_ColumnCountGetFilter_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 ColumnCountGetFilter)) {
return f... | 3.26 |
hbase_ColumnCountGetFilter_toByteArray_rdh | /**
* Returns The filter serialized using pb
*/
@Override
public byte[] toByteArray() {
FilterProtos.ColumnCountGetFilter.Builder builder = FilterProtos.ColumnCountGetFilter.newBuilder();
builder.setLimit(this.limit);
return builder.build().toByteArray();
} | 3.26 |
hbase_ReplicationMarkerChore_getRowKey_rdh | /**
* Creates a rowkey with region server name and timestamp.
*
* @param serverName
* region server name
* @param timestamp
* timestamp
*/
public static byte[] getRowKey(String serverName, long timestamp) {
// converting to string since this will help seeing the timestamp in string format using
// hb... | 3.26 |
hbase_SplitTableRegionProcedure_prepareSplitRegion_rdh | /**
* Prepare to Split region.
*
* @param env
* MasterProcedureEnv
*/
public boolean prepareSplitRegion(final MasterProcedureEnv env) throws IOException { // Fail if we are taking snapshot for the given table
if (env.getMasterServices().getSnapshotManager().isTakingSnapshot(getParentRegion().getTable())) {
... | 3.26 |
hbase_SplitTableRegionProcedure_postRollBackSplitRegion_rdh | /**
* Action after rollback a split table region action.
*
* @param env
* MasterProcedureEnv
*/
private void postRollBackSplitRegion(final MasterProcedureEnv env) throws IOException {final MasterCoprocessorHost
cpHost = env.getMasterCoprocessorHost();
if (cpHost != null) {
cpHost.postRollBackSpli... | 3.26 |
hbase_SplitTableRegionProcedure_isRollbackSupported_rdh | /* Check whether we are in the state that can be rollback */
@Overrideprotected boolean isRollbackSupported(final SplitTableRegionState state) {
switch (state) {
case SPLIT_TABLE_REGION_POST_OPERATION :
case SPLIT_TABLE_REGION_OPEN_CHILD_REGIONS :
case SPLIT_TABLE_REGION_PRE_OPERATION_AFTER... | 3.26 |
hbase_SplitTableRegionProcedure_preSplitRegionAfterMETA_rdh | /**
* Pre split region actions after the Point-of-No-Return step
*
* @param env
* MasterProcedureEnv
*/
private void preSplitRegionAfterMETA(final MasterProcedureEnv env) throws IOException, InterruptedException {
final MasterCoprocessorHost cpHost = env.getMasterCoprocessorHost();
if (cpHost != null) {
... | 3.26 |
hbase_SplitTableRegionProcedure_openParentRegion_rdh | /**
* Rollback close parent region
*/
private void openParentRegion(MasterProcedureEnv env) throws IOException {
AssignmentManagerUtil.reopenRegionsForRollback(env, Collections.singletonList(getParentRegion()), getRegionReplication(env), getParentRegionServerName(env));
} | 3.26 |
hbase_SplitTableRegionProcedure_updateMeta_rdh | /**
* Add daughter regions to META
*
* @param env
* MasterProcedureEnv
*/
private void updateMeta(final MasterProcedureEnv env) throws IOException {
env.getAssignmentManager().markRegionAsSplit(getParentRegion(), getParentRegionServerName(env), daughterOneRI, daughterTwoRI);
} | 3.26 |
hbase_SplitTableRegionProcedure_createDaughterRegions_rdh | /**
* Create daughter regions
*/
public void createDaughterRegions(final MasterProcedureEnv env) throws IOException {
final MasterFileSystem mfs = env.getMasterServices().getMasterFileSystem();
final Path tabledir = CommonFSUtils.getTableDir(mfs.getRootDir(), getTableName());
final FileSystem fs = mfs.get... | 3.26 |
hbase_SplitTableRegionProcedure_splitStoreFiles_rdh | /**
* Create Split directory
*
* @param env
* MasterProcedureEnv
*/
private Pair<List<Path>, List<Path>> splitStoreFiles(final MasterProcedureEnv env, final HRegionFileSystem regionFs) throws IOException
{
... | 3.26 |
hbase_SplitTableRegionProcedure_checkSplittable_rdh | /**
* Check whether the region is splittable
*
* @param env
* MasterProcedureEnv
* @param regionToSplit
* parent Region to be split
*/
private void checkSplittable(final MasterProcedureEnv env, final RegionInfo regionToSplit) throws IOException {
// Ask the remote RS if this region is splittable.
// ... | 3.26 |
hbase_SplitTableRegionProcedure_getDaughterRegionIdTimestamp_rdh | /**
* Calculate daughter regionid to use.
*
* @param hri
* Parent {@link RegionInfo}
* @return Daughter region id (timestamp) to use.
*/
private static long getDaughterRegionIdTimestamp(final RegionInfo hri) {
long rid = EnvironmentEdgeManager.currentTime();
// Regionid is timestamp. Can't be less th... | 3.26 |
hbase_SplitTableRegionProcedure_postSplitRegion_rdh | /**
* Post split region actions
*
* @param env
* MasterProcedureEnv
*/
private void postSplitRegion(final MasterProcedureEnv env)
throws IOException {
final MasterCoprocessorHost cpHost = env.getMasterCoprocessorHost();
if (cpHost != null) {
cpHost.postCompletedSplitRegionAction(daughterOneRI, d... | 3.26 |
hbase_SplitTableRegionProcedure_preSplitRegion_rdh | /**
* Action before splitting region in a table.
*
* @param env
* MasterProcedureEnv
*/
private void preSplitRegion(final MasterProcedureEnv env) throws IOException, Interru... | 3.26 |
hbase_SplitTableRegionProcedure_m0_rdh | /**
* Post split region actions before the Point-of-No-Return step
*
* @param env
* MasterProcedureEnv
*/
private void m0(final MasterProcedureEnv env) throws IOException, InterruptedException {
final List<Mutation> metaEntries = new ArrayList<Mutation>();
final MasterCoprocessorHost cpHost = env.getMas... | 3.26 |
hbase_CatalogReplicaLoadBalanceSelectorFactory_createSelector_rdh | /**
* Create a CatalogReplicaLoadBalanceReplicaSelector based on input config.
*
* @param replicaSelectorClass
* Selector classname.
* @param tableName
* System table name.
* @param conn
* {@link AsyncConnectionImpl}
* @return {@link CatalogReplicaLoadBalanceSelector}
*/
public static CatalogReplicaLoad... | 3.26 |
hbase_ZKNodeTracker_checkIfBaseNodeAvailable_rdh | /**
* Checks if the baseznode set as per the property 'zookeeper.znode.parent' exists.
*
* @return true if baseznode exists. false if doesnot exists.
*/
public boolean checkIfBaseNodeAvailable() {
try {if (ZKUtil.checkExists(watcher, watcher.getZNodePaths().baseZNode) == (-1)) {
return false;
... | 3.26 |
hbase_ZKNodeTracker_postStart_rdh | /**
* Called after start is called. Sub classes could implement this method to load more data on zk.
*/
protected void postStart()
{
} | 3.26 |
hbase_ZKNodeTracker_getData_rdh | /**
* Gets the data of the node.
* <p>
* If the node is currently available, the most up-to-date known version of the data is returned.
* If the node is not currently available, null is returned.
*
* @param refresh
* whether to refresh the data by calling ZK directly.
* @return data of the node, null if unava... | 3.26 |
hbase_ZKNodeTracker_blockUntilAvailable_rdh | /**
* Gets the data of the node, blocking until the node is available or the specified timeout has
* elapsed.
*
* @param timeout
* maximum time to wait for the node data to be available, n milliseconds. Pass 0
* for no timeout.
* @return data of the node
* @throws InterruptedException
* if the waiting th... | 3.26 |
hbase_ZKNodeTracker_start_rdh | /**
* Starts the tracking of the node in ZooKeeper.
* <p/>
* Use {@link #blockUntilAvailable()} to block until the node is available or
* {@link #getData(boolean)} to get the data of the node if it is available.
*/
public synchronized void start() {this.watcher.registerListener(this);
try {
if (ZKUtil.... | 3.26 |
hbase_MobFileCleanupUtil_archiveMobFiles_rdh | /**
* Archives the mob files.
*
* @param conf
* The current configuration.
* @param tableName
* The table name.
* @param family
* The name of the column family.
* @param storeFiles
... | 3.26 |
hbase_MobFileCleanupUtil_m0_rdh | /**
* Performs housekeeping file cleaning (called by MOB Cleaner chore)
*
* @param conf
* configuration
* @param table
* table name
* @throws IOException
* exception
*/
public static void m0(Configuration conf, TableName table, Admin admin) throws IOException {
long minAgeToArchive = conf.getLong(Mo... | 3.26 |
hbase_BufferedDataBlockEncoder_copyFromNext_rdh | /**
* Copy the state from the next one into this instance (the previous state placeholder). Used to
* save the previous state when we are advancing the seeker to the next key/value.
*/
protected void copyFromNext(SeekerState nextState) {
if (keyBuffer.length != nextState.keyBuffer.length) {
keyBuffer = nextState.key... | 3.26 |
hbase_BufferedDataBlockEncoder_afterEncodingKeyValue_rdh | /**
* Returns unencoded size added
*/
protected final int afterEncodingKeyValue(Cell cell, DataOutputStream out, HFileBlockDefaultEncodingContext encodingCtx) throws IOException {
int size = 0;
if (encodingCtx.getHFileContext().isIncludesTags())
{
int tagsLength = cell.getTagsLength();
ByteBufferUtils.putCompresse... | 3.26 |
hbase_BufferedDataBlockEncoder_findCommonPrefixInRowPart_rdh | // These findCommonPrefix* methods rely on the fact that keyOnlyKv is the "right" cell argument
// and always on-heap
private static int findCommonPrefixInRowPart(Cell
left, KeyValue.KeyOnlyKeyValue right, int rowCommonPrefix) {
if (left instanceof ByteBufferExtendedCell) {
ByteBufferExtendedCell bbLeft = ((ByteBuff... | 3.26 |
hbase_BufferedDataBlockEncoder_compareCommonRowPrefix_rdh | /**
* ******************* common prefixes ************************
*/
// Having this as static is fine but if META is having DBE then we should
// change this.
public static int compareCommonRowPrefix(Cell left, Cell right, int rowCommonPrefix) {
if (left instanceof ByteBufferExtendedCell) {
ByteBufferEx... | 3.26 |
hbase_MultiTableHFileOutputFormat_createCompositeKey_rdh | /**
* Alternate api which accepts a String for the tableName and ImmutableBytesWritable for the
* suffix
*
* @see MultiTableHFileOutputFormat#createCompositeKey(byte[], byte[])
*/
public static byte[] createCompositeKey(String tableName, ImmutableBytesWritable suffix) {
return combineTableNameSuffix(tableName.... | 3.26 |
hbase_MultiTableHFileOutputFormat_configureIncrementalLoad_rdh | /**
* Analogous to
* {@link HFileOutputFormat2#configureIncrementalLoad(Job, TableDescriptor, RegionLocator)}, this
* function will configure the requisite number of reducers to write HFiles for multple tables
* simultaneously
*
* @param job
* See {@link org.apache.hadoop.mapreduce.Job}
* @param multiTableDes... | 3.26 |
hbase_ThrottledInputStream_toString_rdh | /**
* {@inheritDoc }
*/
@Override
public String toString() {
return (((((((("ThrottledInputStream{" + "bytesRead=") + bytesRead) + ", maxBytesPerSec=") + maxBytesPerSec) + ", bytesPerSec=") + getBytesPerSec()) + ", totalSleepTime=") + totalSleepTime) + '}';
} | 3.26 |
hbase_ThrottledInputStream_read_rdh | /**
* Read bytes starting from the specified position. This requires rawStream is an instance of
* {@link PositionedReadable}.
*
* @return the number of bytes read
*/
public int read(long position, byte[] buffer, int offset, int length) throws IOException {
if (!(f0 instanceof PositionedReadable)) {
t... | 3.26 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.