name
stringlengths
12
178
code_snippet
stringlengths
8
36.5k
score
float64
3.26
3.68
shardingsphere-elasticjob_JobNodePath_getInstancesNodePath_rdh
/** * Get instances node path. * * @return instances node path */ public String getInstancesNodePath() { return String.format("/%s/%s", jobName, INSTANCES_NODE); }
3.26
shardingsphere-elasticjob_JobNodePath_getFullPath_rdh
/** * Get full path. * * @param node * node * @return full path */ public String getFullPath(final String node) { return String.format("/%s/%s", jobName, node); }
3.26
shardingsphere-elasticjob_JobNodePath_getServerNodePath_rdh
/** * Get server node path. * * @param serverIp * server IP address * @return server node path */ public String getServerNodePath(final String serverIp) { return String.format("%s/%s", getServerNodePath(), serverIp); }
3.26
shardingsphere-elasticjob_ConfigurationService_load_rdh
/** * Load job configuration. * * @param fromCache * load from cache or not * @return job configuration */ public JobConfiguration load(final boolean fromCache) { String result; if (fromCache) { result = jobNodeStorage.getJobNodeData(ConfigurationNode.ROOT); if (null == result) { ...
3.26
shardingsphere-elasticjob_ConfigurationService_checkMaxTimeDiffSecondsTolerable_rdh
/** * Check max time different seconds tolerable between job server and registry center. * * @throws JobExecutionEnvironmentException * throe JobExecutionEnvironmentException if exceed max time different seconds */ public void checkMaxTimeDiffSecondsTolerable() throws JobExecutionEnvironmentException { int ...
3.26
shardingsphere-elasticjob_ConfigurationService_setUpJobConfiguration_rdh
/** * Set up job configuration. * * @param jobClassName * job class name * @param jobConfig * job configuration to be updated * @return accepted job configuration */ public JobConfiguration setUpJobConfiguration(final String job...
3.26
shardingsphere-elasticjob_ElasticJobListener_order_rdh
/** * Listener order, default is the lowest. * * @return order */ default int order() { return LOWEST; }
3.26
shardingsphere-elasticjob_RDBTracingStorageConfiguration_getDataSourceConfiguration_rdh
/** * Get data source configuration. * * @param dataSource * data source * @return data source configuration */ public static RDBTracingStorageConfiguration getDataSourceConfiguration(final DataSource dataSource) { RDBTracingStorageConfiguration result = new RDBTracingSt...
3.26
shardingsphere-elasticjob_RDBTracingStorageConfiguration_createDataSource_rdh
/** * Create data source. * * @return data source */@SuppressWarnings({ "unchecked", "rawtypes" }) @SneakyThrows(ReflectiveOperationException.class) public DataSource createDataSource() { DataSource result = ((DataSource) (Class.forName(dataSourceClassName).getConstructor().newInstance())); Method[] methods...
3.26
shardingsphere-elasticjob_DataflowJobExecutor_process_rdh
/** * Dataflow job executor. */public final class DataflowJobExecutor implements ClassedJobItemExecutor<DataflowJob> { @Override public void process(final DataflowJob elasticJob, final JobConfiguration jobConfig, final JobRuntimeService jobRuntimeService, final ShardingContext shardingContext) { if (B...
3.26
shardingsphere-elasticjob_SetUpFacade_registerStartUpInfo_rdh
/** * Register start up info. * * @param enabled * enable job on startup */ public void registerStartUpInfo(final boolean enabled) { listenerManager.startAllListeners(); leaderService.electLeader(); serverService.persistOnline(enabled); instanceService.persistOnline(); if (!reconcileService.i...
3.26
shardingsphere-elasticjob_SetUpFacade_tearDown_rdh
/** * Tear down. */ public void tearDown() { f0.removeConnStateListener("/" + this.jobName); f0.removeDataListeners("/" + this.jobName); if (reconcileService.isRunning()) { reconcileService.stopAsync(); } }
3.26
shardingsphere-elasticjob_RegistryCenterFactory_createCoordinatorRegistryCenter_rdh
/** * Create a {@link CoordinatorRegistryCenter} or return the existing one if there is one set up with the same {@code connectionString}, {@code namespace} and {@code digest} already. * * @param connectString * registry center connect string * @param namespace * registry center namespace * @param digest * ...
3.26
shardingsphere-elasticjob_DataSourceRegistry_registerDataSource_rdh
/** * Register data source. * * @param dataSourceConfig * data source configuration * @param dataSource * data source */ public void registerDataSource(final RDBTracingStorageConfiguration dataSourceConfig, final DataSource dataSource) { dataSources.putIfAbsent(dataSourceConfig, dataSource); }
3.26
shardingsphere-elasticjob_DataSourceRegistry_getDataSource_rdh
/** * Get {@link DataSource} by {@link RDBTracingStorageConfiguration}. * * @param dataSourceConfig * data source configuration * @return instance of {@link DataSource} */ public DataSource getDataSource(final RDBTracingStorageConfiguration dataSourceConfig) { return dataSources.computeIfAbsent(dataSourceC...
3.26
shardingsphere-elasticjob_DataSourceRegistry_getInstance_rdh
/** * Get instance of {@link DataSourceRegistry}. * * @return {@link DataSourceRegistry} singleton */ public static DataSourceRegistry getInstance() { if (null == f0) { synchronized(DataSourceRegistry.class) { if (null == f0) { f0 = new DataSourceRegistry(); } ...
3.26
shardingsphere-elasticjob_ExecutorServiceReloader_reloadIfNecessary_rdh
/** * Reload if necessary. * * @param jobConfig * job configuration */ public synchronized void reloadIfNecessary(final JobConfiguration jobConfig) { if (jobExecutorThreadPoolSizeProviderType.equals(jobConfig.getJobExecutorThreadPoolSizeProviderType())) { return; } executorService.shutdown();...
3.26
shardingsphere-elasticjob_JobAnnotationBuilder_generateJobConfiguration_rdh
/** * Generate job configuration from @ElasticJobConfiguration. * * @param type * The job of @ElasticJobConfiguration annotation class * @return job configuration */ public static JobConfiguration generateJobConfiguration(final Class<?> type) { ElasticJobConfiguration annotation = type.getAnnotation(ElasticJobC...
3.26
shardingsphere-elasticjob_TimeService_getCurrentMillis_rdh
/** * Get current millis. * * @return current millis */ public long getCurrentMillis() { return System.currentTimeMillis(); }
3.26
shardingsphere-elasticjob_JobScheduler_shutdown_rdh
/** * Shutdown job. */ public void shutdown() { setUpFacade.tearDown();schedulerFacade.shutdownInstance(); jobExecutor.shutdown(); }
3.26
shardingsphere-elasticjob_SQLPropertiesFactory_getProperties_rdh
/** * Get SQL properties. * * @param type * tracing storage database type * @return SQL properties */ public static Properties getProperties(final TracingStorageDatabaseType type) { return loadProps(String.format("%s.properties", type.getType())); }
3.26
shardingsphere-elasticjob_AbstractDistributeOnceElasticJobListener_notifyWaitingTaskStart_rdh
/** * Notify waiting task start. */ public void notifyWaitingTaskStart() { synchronized(startedWait) {startedWait.notifyAll(); } }
3.26
shardingsphere-elasticjob_AbstractDistributeOnceElasticJobListener_notifyWaitingTaskComplete_rdh
/** * Notify waiting task complete. */ public void notifyWaitingTaskComplete() { synchronized(completedWait) { completedWait.notifyAll(); } }
3.26
shardingsphere-elasticjob_JobItemExecutorFactory_m0_rdh
/** * Get executor. * * @param elasticJobClass * elastic job class * @return job item executor */ @SuppressWarnings("unchecked") public static JobItemExecutor m0(final Class<? extends ElasticJob> elasticJobClass) { for (ClassedJobItemExecutor each : ShardingSphere...
3.26
shardingsphere-elasticjob_JobExecutionEvent_m0_rdh
/** * Execution success. * * @return job execution event */ public JobExecutionEvent m0() { JobExecutionEvent result = new JobExecutionEvent(id, hostname, ip, taskId, f0, source, f1, startTime, completeTime, f2, failureCause); result.setCompleteTime(new Date()); result.setSuccess(true); return re...
3.26
shardingsphere-elasticjob_ElasticJobExecutor_execute_rdh
/** * Execute job. */ public void execute() { JobConfiguration jobConfig = jobFacade.loadJobConfiguration(true); executorServiceReloader.reloadIfNecessary(jobConfig);jobErrorHandlerReloader.reloadIfNecessary(jobConfig); JobErrorHandler jobErrorHandler = jobErrorHandlerReloa...
3.26
shardingsphere-elasticjob_ElasticJobExecutor_shutdown_rdh
/** * Shutdown executor. */ public void shutdown() {executorServiceReloader.close(); jobErrorHandlerReloader.close(); }
3.26
shardingsphere-elasticjob_TriggerService_removeTriggerFlag_rdh
/** * Remove trigger flag. */ public void removeTriggerFlag() { f0.removeJobNodeIfExisted(triggerNode.getLocalTriggerPath()); }
3.26
shardingsphere-elasticjob_JobRegistry_setJobRunning_rdh
/** * Set job running status. * * @param jobName * job name * @param isRunning * job running status */ public void setJobRunning(final String jobName, final boolean isRunning) { jobRunningMap.put(jobName, isRunning); }
3.26
shardingsphere-elasticjob_JobRegistry_getJobInstance_rdh
/** * Get job instance. * * @param jobName * job name * @return job instance */ public JobInstance getJobInstance(final String jobName) { return jobInstanceMap.get(jobName); }
3.26
shardingsphere-elasticjob_JobRegistry_shutdown_rdh
/** * Shutdown job schedule. * * @param jobName * job name */ public void shutdown(final String jobName) {Optional.ofNullable(schedulerMap.remove(jobName)).ifPresent(JobScheduleController::shutdown); Optional.ofNullable(regCenterMap.remove(jobName)).ifPresent(regCenter -> regCenter.evictCacheData("/" + jobNa...
3.26
shardingsphere-elasticjob_JobRegistry_getInstance_rdh
/** * Get instance of job registry. * * @return instance of job registry */ public static JobRegistry getInstance() { if (null == instance) { synchronized(JobRegistry.class) { if (null == instance) { instance = new JobRegistry(); } } } return inst...
3.26
shardingsphere-elasticjob_JobRegistry_registerJob_rdh
/** * Register job. * * @param jobName * job name * @param jobScheduleController * job schedule controller */ public void registerJob(final String jobName, final JobScheduleController jobScheduleController) { schedulerMap.put(jobName, jobScheduleController); }
3.26
shardingsphere-elasticjob_JobRegistry_addJobInstance_rdh
/** * Add job instance. * * @param jobName * job name * @param jobInstance * job instance */ public void addJobInstance(final String jobName, final JobInstance jobInstance) { jobInstanceMap.put(jobName, jobInstance); }
3.26
shardingsphere-elasticjob_JobRegistry_isJobRunning_rdh
/** * Judge job is running or not. * * @param jobName * job name * @return job is running or not */public boolean isJobRunning(final String jobName) { return jobRunningMap.getOrDefault(jobName, false); }
3.26
shardingsphere-elasticjob_JobRegistry_getCurrentShardingTotalCount_rdh
/** * Get sharding total count which running on current job server. * * @param jobName * job name * @return sharding total count which running on current job server */ public int getCurrentShardingTotalCount(final String jobName) { return currentShardingTotalCountMap.getOrDefault(jobName, 0); }
3.26
shardingsphere-elasticjob_JobRegistry_setCurrentShardingTotalCount_rdh
/** * Set sharding total count which running on current job server. * * @param jobName * job name * @param currentShardingTotalCount * sharding total count which running on current job server */ public void setCurrentShardingTotalCount(final String jobName, final int currentShardingTotalCount) { currentS...
3.26
shardingsphere-elasticjob_JobRegistry_getJobScheduleController_rdh
/** * Get job schedule controller. * * @param jobName * job name * @return job schedule controller */ public JobScheduleController getJobScheduleController(final String jobName) { return schedulerMap.get(jobName); }
3.26
shardingsphere-elasticjob_JobRegistry_registerRegistryCenter_rdh
/** * Register registry center. * * @param jobName * job name * @param regCenter * registry center */ public void registerRegistryCenter(final String jobName, final CoordinatorRegistryCenter regCenter) { regCenterMap.put(jobName, regCenter); regCenter.addCacheData("/" + jobName); }
3.26
shardingsphere-elasticjob_JobRegistry_isShutdown_rdh
/** * Judge job is shutdown or not. * * @param jobName * job name * @return job is shutdown or not */ public boolean isShutdown(final String jobName) { return (!schedulerMap.containsKey(jobName)) || (!jobInstanceMap.containsKey(jobName)); }
3.26
shardingsphere-elasticjob_ShardingNode_getRunningNode_rdh
/** * Get job running node. * * @param item * sharding item * @return job running node */ public static String getRunningNode(final int item) { return String.format(f0, item); }
3.26
shardingsphere-elasticjob_ShardingNode_getInstanceNode_rdh
/** * Get the path of instance node. * * @param item * sharding item * @return the path of instance node */ public static String getInstanceNode(final int item) { return String.format(INSTANCE, item); }
3.26
shardingsphere-elasticjob_ShardingNode_getItemByRunningItemPath_rdh
/** * Get item by running item path. * * @param path * running item path * @return running item, return null if sharding item is not running */ public Integer getItemByRunningItemPath(final String path) { if (!isRunningItemPath(path)) { return null; } return Integer.parseInt(path.substring(j...
3.26
shardingsphere-elasticjob_ZookeeperElectionService_start_rdh
/** * Start election. */ public void start() { log.debug("Elastic job: {} start to elect leadership", leaderSelector.getId()); leaderSelector.start(); }
3.26
shardingsphere-elasticjob_ZookeeperElectionService_stop_rdh
/** * Stop election. */ public void stop() { log.info("Elastic job: stop leadership election"); leaderLatch.countDown(); try { leaderSelector.close(); // CHECKSTYLE:OFF } catch (final Exception ignore) { }// CHECKSTYLE:ON }
3.26
shardingsphere-elasticjob_DefaultYamlTupleProcessor_process_rdh
/** * Process node tuple. * * @param nodeTuple * node tuple * @return processed node tuple */ public NodeTuple process(final NodeTuple nodeTuple) { return isUnsetNodeTuple(nodeTuple.getValueNode()) ? null : nodeTuple; }
3.26
shardingsphere-elasticjob_TaskContext_setSlaveId_rdh
/** * Set job server ID. * * @param slaveId * job server ID */ public void setSlaveId(final String slaveId) { id = id.replaceAll(this.slaveId, slaveId); this.slaveId = slaveId; }
3.26
shardingsphere-elasticjob_TaskContext_getIdForUnassignedSlave_rdh
/** * Get unassigned task ID before job execute. * * @param id * task ID * @return unassigned task ID before job execute */public static String getIdForUnassignedSlave(final String id) { return id.replaceAll(TaskContext.from(id).getSlaveId(), UNASSIGNED_SLAVE_ID); }
3.26
shardingsphere-elasticjob_TaskContext_from_rdh
/** * Get task meta data info via string. * * @param value * task meta data info string * @return task meta data info */ public static MetaInfo from(final String value) { String[] v1 = value.split(DELIMITER); Preconditions.checkState(((1 == v1.length) || (2 == v1.length)) || (5 == v1.length)); ...
3.26
shardingsphere-elasticjob_TaskContext_getTaskName_rdh
/** * Get task name. * * @return task name */ public String getTaskName() { return String.join(DELIMITER, metaInfo.m0(), type.toString(), slaveId); }
3.26
shardingsphere-elasticjob_TaskContext_getExecutorId_rdh
/** * Get executor ID. * * @param appName * application name * @return executor ID */ public String getExecutorId(final String appName) { return String.join(DELIMITER, appName, slaveId); }
3.26
shardingsphere-elasticjob_SnapshotService_listen_rdh
/** * Start to listen. */ public void listen() {try { log.info("ElasticJob: Snapshot service is running on port '{}'", m0(port)); } catch (final IOException ex) { log.error("ElasticJob: Snapshot service listen failure, error is: ", ex); } }
3.26
shardingsphere-elasticjob_SnapshotService_dumpJobDirectly_rdh
/** * Dump job. * * @param jobName * job's name * @return dump job's info */ public String dumpJobDirectly(final String jobName) {String path = "/" + jobName; final List<String> result = new ArrayList<>(); dumpDirectly(path, jobName, result); return String.join("\n", SensitiveInfoUtils.filterSensi...
3.26
shardingsphere-elasticjob_SnapshotService_close_rdh
/** * Close listener. */ public void close() { closed = true; if ((null != serverSocket) && (!serverSocket.isClosed())) { try { serverSocket.close(); } catch (final IOException ex) {log.error("ElasticJob: Snapshot service close failure, error is: ", ex); } } }
3.26
shardingsphere-elasticjob_SnapshotService_dumpJob_rdh
/** * Dump job. * * @param instanceIp * job instance ip addr * @param dumpPort * dump port * @param jobName * job's name * @return dump job's info * @throws IOException * i/o exception */ public static String dumpJob(final String instanceIp, final int dumpPort, final String jobName) throws IOExcep...
3.26
shardingsphere-elasticjob_RegExceptionHandler_handleException_rdh
/** * Handle exception. * * @param cause * exception to be handled */ public static void handleException(final Exception cause) { if (null == cause) { return; }if (isIgnoredException(cause) || ((null != cause.getCause()) && isIgnoredException(cause.getCause(...
3.26
shardingsphere-elasticjob_ExecutionContextService_m0_rdh
/** * Get job sharding context. * * @param shardingItems * sharding items * @return job sharding context */ public ShardingContexts m0(final List<Integer> shardingItems) { JobConfiguration jobConfig = configService.load(false); removeRunningIfMonitorExecution(jobConfig.isMonitorExecution(), shardin...
3.26
shardingsphere-elasticjob_ExecutionService_setMisfire_rdh
/** * Set misfire flag if sharding items still running. * * @param items * sharding items need to be set misfire flag */ public void setMisfire(final Collection<Integer> items) { for (int each : items) {jobNodeStorage.createJobNodeIfNeeded(Shar...
3.26
shardingsphere-elasticjob_ExecutionService_misfireIfHasRunningItems_rdh
/** * Set misfire flag if sharding items still running. * * @param items * sharding items need to be set misfire flag * @return is misfired for this schedule time or not */ public boolean misfireIfHasRunningItems(final Collection<Integer> items) { if (!hasRunningItems(items)) { return false; } ...
3.26
shardingsphere-elasticjob_ExecutionService_clearMisfire_rdh
/** * Clear misfire flag. * * @param items * sharding items need to be cleared */ public void clearMisfire(final Collection<Integer> items) { for (int each : items) { jobNodeStorage.removeJobNodeIfExisted(ShardingNode.getMisfireNode(each)); } }
3.26
shardingsphere-elasticjob_ExecutionService_clearRunningInfo_rdh
/** * Clear running info. * * @param items * sharding items which need to be cleared */ public void clearRunningInfo(final List<Integer> items) { for (int v4 : items) { jobNodeStorage.removeJobNodeIfExisted(ShardingNode.getRunningNode(v4)); } }
3.26
shardingsphere-elasticjob_ExecutionService_getAllRunningItems_rdh
/** * Get all running items with instance. * * @return running items with instance. */ public Map<Integer, JobInstance> getAllRunningItems() { int shardingTotalCount = configService.load(true).getShardingTotalCount();Map<Integer, JobInstance> result = new LinkedHashMap<>(shardingTotalCount, 1); for (int i ...
3.26
shardingsphere-elasticjob_ExecutionService_getMisfiredJobItems_rdh
/** * Get misfired job sharding items. * * @param items * sharding items need to be judged * @return misfired job sharding items */ public List<Integer> getMisfiredJobItems(final Collection<Integer> items) { List<Integer> result = new ArrayList<>(items.size()); for (int each : items) { if (jobNo...
3.26
shardingsphere-elasticjob_ExecutionService_registerJobBegin_rdh
/** * Register job begin. * * @param shardingContexts * sharding contexts */ public void registerJobBegin(final ShardingContexts shardingContexts) { JobRegistry.getInstance().setJobRunning(jobName, true); JobConfiguration jobConfig = configService.load(true); if (!jobConfig.isMonitorExecution()) { ...
3.26
shardingsphere-elasticjob_ExecutionService_getDisabledItems_rdh
/** * Get disabled sharding items. * * @param items * sharding items need to be got * @return disabled sharding items */ public List<Integer> getDisabledItems(final List<Integer> items) { List<Integer> result = new ArrayList<>(items.size()); for (int each : items) { if (jobNodeStorage.isJobN...
3.26
shardingsphere-elasticjob_ElasticJobBootstrapConfiguration_createJobBootstrapBeans_rdh
/** * Create job bootstrap instances and register them into container. */ public void createJobBootstrapBeans() { ElasticJobProperties elasticJobProperties = applicationContext.getBean(ElasticJobProperties.class); SingletonBeanRegistry singletonBeanRegistry = ((ConfigurableApplicationContext) (applicationCont...
3.26
hbase_DelayedUtil_getRemainingTime_rdh
/** * Returns Time remaining as milliseconds. */public static long getRemainingTime(final TimeUnit resultUnit, final long timeout) { final long currentTime = EnvironmentEdgeManager.currentTime(); if (currentTime >= timeout) { return 0; } return resultUnit.convert(timeout - currentTime, TimeUnit.MILLISECONDS); }
3.26
hbase_DelayedUtil_takeWithoutInterrupt_rdh
/** * Returns null (if an interrupt) or an instance of E; resets interrupt on calling thread. */ public static <E extends Delayed> E takeWithoutInterrupt(final DelayQueue<E> queue, final long timeout, final TimeUnit timeUnit) { try { return queue.poll(timeout, timeUnit); } catch (InterruptedException e)...
3.26
hbase_CellVisibility_getExpression_rdh
/** * Returns The visibility expression */ public String getExpression() { return this.expression; }
3.26
hbase_CellVisibility_quote_rdh
/** * Helps in quoting authentication Strings. Use this if unicode characters to be used in * expression or special characters like '(', ')', '"','\','&amp;','|','!' */public static String quote(byte[] auth) { int escapeChars = 0; for (int i = 0; i < auth.length; i++) if ((auth[i] == '"') || (auth[i...
3.26
hbase_ProcedureTree_checkReady_rdh
// In this method first we will check whether the given root procedure and all its sub procedures // are valid, through the procedure stack. And we will also remove all these procedures from the // remainingProcMap, so at last, if there are still procedures in the map, we know that there are // orphan procedures. priva...
3.26
hbase_IdentityTableReducer_reduce_rdh
/** * Writes each given record, consisting of the row key and the given values, to the configured * {@link org.apache.hadoop.mapreduce.OutputFormat}. It is emitting the row key and each * {@link org.apache.hadoop.hbase.client.Put Put} or {@link org.apache.hadoop.hbase.client.Delete * Delete} as separate pairs. * ...
3.26
hbase_MetricsRegionServerSourceImpl_getMetrics_rdh
/** * Yes this is a get function that doesn't return anything. Thanks Hadoop for breaking all * expectations of java programmers. Instead of returning anything Hadoop metrics expects * getMetrics to push the metrics into the collector. * * @param metricsCollector * Collector to accept metrics * @param all * ...
3.26
hbase_SimpleRegionNormalizer_skipForMerge_rdh
/** * Determine if a {@link RegionInfo} should be considered for a merge operation. * </p> * Callers beware: for safe concurrency, be sure to pass in the local instance of * {@link NormalizerConfiguration}, don't use {@code this}'s instance. */ private boolean skipForMerge(final NormalizerConfiguration normalizerC...
3.26
hbase_SimpleRegionNormalizer_computeMergeNormalizationPlans_rdh
/** * Computes the merge plans that should be executed for this table to converge average region * towards target average or target region count. */ private List<NormalizationPlan> computeMergeNormalizationPlans(final NormalizeContext ctx) { final NormalizerConfiguration configuration = normalizerConfiguration; if (...
3.26
hbase_SimpleRegionNormalizer_computeSplitNormalizationPlans_rdh
/** * Computes the split plans that should be executed for this table to converge average region size * towards target average or target region count. <br /> * if the region is > 2 times larger than average, we split it. split is more high priority * normalization action than merge. */ private List<NormalizationPl...
3.26
hbase_SimpleRegionNormalizer_skipForSplit_rdh
/** * Determine if a region in {@link RegionState} should be considered for a split operation. */ private static boolean skipForSplit(final RegionState state, final RegionInfo regionInfo) { final String name = regionInfo.getEncodedName(); return logTraceReason(() -> state == null, "skipping split of region {} becaus...
3.26
hbase_SimpleRegionNormalizer_isOldEnoughForMerge_rdh
/** * Return {@code true} when {@code regionInfo} has a creation date that is old enough to be * considered for a merge operation, {@code false} otherwise. */ private static boolean isOldEnoughForMerge(final NormalizerConfiguration normalizerConfiguration, final NormalizeContext ctx, final RegionInfo regionInfo) { f...
3.26
hbase_SimpleRegionNormalizer_getMergeMinRegionCount_rdh
/** * Return this instance's configured value for {@value #MERGE_MIN_REGION_COUNT_KEY}. */ public int getMergeMinRegionCount() { return normalizerConfiguration.getMergeMinRegionCount(); }
3.26
hbase_SimpleRegionNormalizer_getMergeMinRegionAge_rdh
/** * Return this instance's configured value for {@value #MERGE_MIN_REGION_AGE_DAYS_KEY}. */ public Period getMergeMinRegionAge() { return normalizerConfiguration.getMergeMinRegionAge(); } /** * Return this instance's configured value for {@value #MERGE_MIN_REGION_SIZE_MB_KEY}
3.26
hbase_SimpleRegionNormalizer_shuffleNormalizationPlans_rdh
/** * This very simple method exists so we can verify it was called in a unit test. Visible for * testing. */ void shuffleNormalizationPlans(List<NormalizationPlan> plans) { Collections.shuffle(plans); }
3.26
hbase_SimpleRegionNormalizer_isSplitEnabled_rdh
/** * Return this instance's configured value for {@value #SPLIT_ENABLED_KEY}. */ public boolean isSplitEnabled() { return normalizerConfiguration.isSplitEnabled(); }
3.26
hbase_SimpleRegionNormalizer_getRegionSizeMB_rdh
/** * Returns size of region in MB and if region is not found than -1 */ private long getRegionSizeMB(RegionInfo hri) { ServerName sn = masterServices.getAssignmentManager().getRegionStates().getRegionServerOfRegion(hri); if (sn == null) { LOG.debug("{} region was not found on any Server", hri.getRegionNameAsString(...
3.26
hbase_SimpleRegionNormalizer_isMergeEnabled_rdh
/** * Return this instance's configured value for {@value #MERGE_ENABLED_KEY}. */ public boolean isMergeEnabled() { return normalizerConfiguration.isMergeEnabled(); }
3.26
hbase_SimpleRegionNormalizer_isLargeEnoughForMerge_rdh
/** * Return {@code true} when {@code regionInfo} has a size that is sufficient to be considered for * a merge operation, {@code false} otherwise. * </p> * Callers beware: for safe concurrency, be sure to pass in the local instance of * {@link NormalizerConfiguration}, don't use {@code this}'s instance. */ privat...
3.26
hbase_ReversedMobStoreScanner_next_rdh
/** * Firstly reads the cells from the HBase. If the cell is a reference cell (which has the * reference tag), the scanner need seek this cell from the mob file, and use the cell found from * the mob file as the result. */ @Override public boolean next(List<Cell> outResult, ScannerContext ctx) throws IOException { ...
3.26
hbase_DeadServer_copyDeadServersSince_rdh
/** * Extract all the servers dead since a given time, and sort them. * * @param ts * the time, 0 for all * @return a sorted array list, by death time, lowest values first. */ synchronized List<Pair<ServerName, Long>> copyDeadServersSince(long ts) { List<Pair<ServerName, Long>> res = new ArrayList<>(size()); fo...
3.26
hbase_DeadServer_m0_rdh
/** * Handles restart of a server. The new server instance has a different start code. The new start * code should be greater than the old one. We don't check that here. Removes the old server from * deadserver list. * * @param newServerName * Servername as either <code>host:port</co...
3.26
hbase_DeadServer_isDeadServer_rdh
/** * * @param serverName * server name. * @return true if this server is on the dead servers list false otherwise */public synchronized boolean isDeadServer(final ServerName serverName) { return deadServers.containsKey(serverName); }
3.26
hbase_DeadServer_putIfAbsent_rdh
/** * Adds the server to the dead server list if it's not there already. */ synchronized void putIfAbsent(ServerName sn) { this.deadServers.putIfAbsent(sn, EnvironmentEdgeManager.currentTime()); }
3.26
hbase_DeadServer_getTimeOfDeath_rdh
/** * Get the time when a server died * * @param deadServerName * the dead server name * @return the date when the server died */ public synchronized Date getTimeOfDeath(final ServerName deadServerName) { Long time = deadServers.get(deadServerName); return time == null ? null : new Date(time); }
3.26
hbase_DeadServer_removeDeadServer_rdh
/** * Called from rpc by operator cleaning up deadserver list. * * @param deadServerName * the dead server name * @return true if this server was removed */ public synchronized boolean removeDeadServer(final ServerName deadServerName) { return this.deadServers.remove(deadServerName) != null; }
3.26
hbase_TransitRegionStateProcedure_execute_rdh
// Override to lock RegionStateNode @SuppressWarnings("rawtypes") @Override protected Procedure[] execute(MasterProcedureEnv env) throws ProcedureSuspendedException, ProcedureYieldException, InterruptedException {RegionStateNode regionNode = env.getAssignmentManager().getRegionStates().getOrCreateRegionStateNode(ge...
3.26
hbase_TransitRegionStateProcedure_serverCrashed_rdh
// Should be called with RegionStateNode locked public void serverCrashed(MasterProcedureEnv env, RegionStateNode regionNode, ServerName serverName, boolean forceNewPlan) throws IOException { this.forceNewPlan = forceNewPlan; if (remoteProc != null) { // this means we are waiting for the sub procedure, so wake it...
3.26
hbase_TransitRegionStateProcedure_m0_rdh
/** * At end of timeout, wake ourselves up so we run again. */ @Override protected synchronized boolean m0(MasterProcedureEnv env) { setState(ProcedureState.RUNNABLE); env.getProcedureScheduler().addFront(this); return false;// 'false' means that this procedure handled the timeout }
3.26
hbase_TransitRegionStateProcedure_assign_rdh
// Be careful that, when you call these 4 methods below, you need to manually attach the returned // procedure with the RegionStateNode, otherwise the procedure will quit immediately without doing // anything. See the comment in executeFromState to find out why we need this assumption. public static TransitRegionStateP...
3.26
hbase_TransitRegionStateProcedure_reportTransition_rdh
// Should be called with RegionStateNode locked public void reportTransition(MasterProcedureEnv env, RegionStateNode regionNode, ServerName serverName, TransitionCode code, long seqId, long procId) throws IOException { if (remoteProc == null) { LOG.warn("There is no outstanding remote region procedure for {}, serve...
3.26
hbase_TransitRegionStateProcedure_stateLoaded_rdh
// the state to meta yet. See the code in RegionRemoteProcedureBase.execute for more details. void stateLoaded(AssignmentManager am, RegionStateNode regionNode) { if (remoteProc != null) { remoteProc.stateLoaded(am, regionNode); } }
3.26
hbase_MetaTableLocator_setMetaLocation_rdh
/** * Sets the location of <code>hbase:meta</code> in ZooKeeper to the specified server address. * * @param zookeeper * reference to the {@link ZKWatcher} which also contains configuration and * operation * @param serverName * the name of the server * @param replicaId * the ID of the replica * @param ...
3.26
hbase_MetaTableLocator_blockUntilAvailable_rdh
/** * Wait until the meta region is available and is not in transition. * * @param zkw * reference to the {@link ZKWatcher} which also contains configuration and * constants * @param replicaId * the ID of the re...
3.26