name stringlengths 12 178 | code_snippet stringlengths 8 36.5k | score float64 3.26 3.68 |
|---|---|---|
rocketmq-connect_JdbcSourceTask_buildAndAddQuerier_rdh | /**
* build and add querier
*
* @param loadMode
* @param querySuffix
* @param incrementingColumn
* @param timestampColumns
* @param timestampDelayInterval
* @param timeZone
* @param tableOrQuery
* @param offset
*/private void buildAndAddQuerier(TableLoadMode loadMode, String querySuffix, String incrementingC... | 3.26 |
rocketmq-connect_JdbcSourceTask_validate_rdh | /**
* Should invoke before start the connector.
*
* @param config
* @return error message
*/
@Override
public void validate(KeyValue config) {
} | 3.26 |
rocketmq-connect_JdbcSourceTask_sleepIfNeed_rdh | /**
* Sleep if need
*
* @param querier
* @return */
private boolean sleepIfNeed(Querier querier) {
if (!querier.querying()) {
final long nextUpdate = querier.getLastUpdate()
+ config.getPollIntervalMs();
final long now = System.currentTimeMillis()... | 3.26 |
rocketmq-connect_JdbcSourceTask_start_rdh | /**
* start jdbc task
*/
@Override
public void start(KeyValue props) {
// init config
config = new JdbcSourceTaskConfig(props);
this.dialect = DatabaseDialectLoader.getDatabaseDialect(config);
cachedConnectionProvider = connectionProvider(config.getAttempts(), config.getBackoffMs());
log.info("Usi... | 3.26 |
rocketmq-connect_JdbcSourceTask_getIncrementContext_rdh | // Increment context
private IncrementContext getIncrementContext(String querySuffix, String tableOrQuery, String topicPrefix, QueryMode queryMode, List<String> timestampColumnNames, String incrementingColumnName, Map<String, Object> offsetMap, Long timestampDelay, TimeZone timeZone) {IncrementContext context = new I... | 3.26 |
rocketmq-connect_TaskClassSetter_setTaskClass_rdh | /**
* set connector class
*
* @param config
*/
default void setTaskClass(KeyValue config) {config.put(TaskConfig.TASK_CLASS_CONFIG, getTaskClass());
} | 3.26 |
rocketmq-connect_ConnectorConfig_originalConfig_rdh | /**
* original config
*
* @return */
public Map<String, String> originalConfig() {
return config.getProperties();
} | 3.26 |
rocketmq-connect_JsonSchemaUtils_validate_rdh | /**
* validate object
*
* @param schema
* @param value
* @throws JsonProcessingException
* @throws ValidationException
*/
public static void validate(Schema schema, Object value) throws JsonProcessingException, ValidationException {
Object primitiveValue = NONE_MARKER;
if (isPrimitive(value)) {
p... | 3.26 |
rocketmq-connect_WorkerDirectTask_m1_rdh | /**
* Get the Task Name of connector.
*
* @return task name
*/
@Override
public String m1() {
return id().task() + "";
} | 3.26 |
rocketmq-connect_WorkerDirectTask_configs_rdh | /**
* Get the configurations of current task.
*
* @return the configuration of current task.
*/
@Override
public KeyValue configs() {
return taskConfig;
} | 3.26 |
rocketmq-connect_WorkerDirectTask_resetOffset_rdh | /**
* Reset the consumer offset for the given queue.
*
* @param recordPartition
* the partition to reset offset.
* @param recordOffset
* the offset to reset to.
*/
@Override
public void resetOffset(RecordPartition recordPartition, RecordOffset recordOffset) {
// no-op
} | 3.26 |
rocketmq-connect_WorkerDirectTask_getTaskName_rdh | /**
* Get the Task Id of connector.
*
* @return task name
*/
@Override
public String getTaskName() {
return id().task() + "";
} | 3.26 |
rocketmq-connect_WorkerDirectTask_m2_rdh | /**
* Current task assignment processing partition
*
* @return the partition list
*/
@Override
public Set<RecordPartition> m2() {
return null;
} | 3.26 |
rocketmq-connect_WorkerDirectTask_execute_rdh | /**
* execute poll and send record
*/
@Override
protected void execute() {
while (isRunning()) {
updateCommittableOffsets();if (shouldPause()) {
onPause();
try {
// wait unpause
if (awaitUnpause()) {onResume();
}
conti... | 3.26 |
rocketmq-connect_WorkerDirectTask_pause_rdh | /**
* Pause consumption of messages from the specified partition.
*
* @param partitions
* the partition list to be reset offset.
*/
@Override
public void pause(List<RecordPartition> partitions) {
// no-op
} | 3.26 |
rocketmq-connect_WorkerDirectTask_initializeAndStart_rdh | /**
* initinalize and start
*/
@Override
protected void initializeAndStart() {
m0();
startSourceTask();
log.info("Direct task start, config:{}", JSON.toJSONString(taskConfig));
} | 3.26 |
rocketmq-connect_WorkerDirectTask_resume_rdh | /**
* Resume consumption of messages from previously paused Partition.
*
* @param partitions
* the partition list to be resume.
*/
@Override
public void resume(List<RecordPartition> partitions) {
// no-op
} | 3.26 |
rocketmq-connect_JsonConverter_convertToJson_rdh | /**
* Convert this object, in the org.apache.kafka.connect.data format, into a JSON object, returning both the schema
* and the converted object.
*/
private Object convertToJson(Schema schema, Object
value) {
if (value == null) {... | 3.26 |
rocketmq-connect_JsonConverter_toConnectData_rdh | /**
* Convert a native object to a Rocketmq Connect data object.
*
* @param topic
* the topic associated with the data
* @param value
* the value to convert
* @return an object containing the {@link Schema} and the converted value
*/@Override
public SchemaAndValue toConnectData(String topic, byte[] value) {... | 3.26 |
rocketmq-connect_JsonConverter_fromConnectData_rdh | /**
* Convert a rocketmq Connect data object to a native object for serialization.
*
* @param topic
* the topic associated with the data
* @param schema
* the schema for the value
* @param value
* the value to convert
* @return the serialized value
*/
@Override
public byte[] fromConnectData(String topic... | 3.26 |
rocketmq-connect_JsonConverter_convertToJsonWithoutEnvelope_rdh | /**
* convert to json without envelop
*
* @param schema
* @param value
* @return */
private Object convertToJsonWithoutEnvelope(Schema schema, Object value) {
return convertToJson(schema, value);
} | 3.26 |
rocketmq-connect_JsonConverter_asConnectSchema_rdh | /**
* convert json to schema if not empty
*
* @param jsonSchema
* @return */
public Schema asConnectSchema(JSONObject jsonSchema) {
// schema null
if (jsonSchema == null) {return null;}
Schema cached = toConnectSchemaCache.get(jsonSchema);
if (cached != null) {
return cached;
}
S... | 3.26 |
rocketmq-connect_JsonConverter_configure_rdh | /**
* Configure this class.
*
* @param configs
* configs in key/value pairs
*/
@Override
public void configure(Map<String, ?> configs) {
converterConfig = new JsonConverterConfig(configs);
fromConnectSchemaCache = new LRUCache<>(converterConfig.cacheSize());
toConnectSchemaCache = new
LRUCache<>... | 3.26 |
rocketmq-connect_JsonConverter_convertToJsonWithEnvelope_rdh | /**
* convert to json with envelope
*
* @param schema
* @param value
* @return */
private JSONObject convertToJsonWithEnvelope(Schema schema, Object value) {
return new JsonSchema.Envelope(asJsonSchema(schema), convertToJson(schema, value)).toJsonNode();
} | 3.26 |
rocketmq-connect_JsonConverter_convertToConnect_rdh | /**
* convert to connect
*
* @param schema
* @param value
* @return */
private Object convertToConnect(Schema schema, Object value) {
final FieldType schemaType;
if (schema != null) {
schemaType = schema.getFieldType(... | 3.26 |
rocketmq-connect_JsonConverter_asJsonSchema_rdh | /**
* convert ConnectRecord schema to json schema
*
* @param schema
* @return */
public JSONObject asJsonSchema(Schema schema) {
if (schema == null) {return null;
}
// from cached
JSONObject cached = fromConnectSchemaCache.get(schema);
if (cached != null) {
return cached.clone();
... | 3.26 |
rocketmq-connect_ByteArrayConverter_m0_rdh | /**
* Configure this class.
*
* @param configs
* configs in key/value pairs
*/ @Override
public void m0(Map configs) {
// config
} | 3.26 |
rocketmq-connect_Base64Util_base64Decode_rdh | /**
* decode
*
* @param in
* @return */
public static byte[] base64Decode(String in) {
if (StringUtils.isEmpty(in)) {
return null;
}
return Base64.getDecoder().decode(in);
} | 3.26 |
rocketmq-connect_RmqSourceReplicator_ensureTargetTopic_rdh | /**
* ensure target topic eixst. if target topic does not exist, ensureTopic will create target topic on target
* cluster, with same TopicConfig but using target topic name. any exception will be caught and then throw
* IllegalStateException.
*
* @param srcTopic
* @param targetTopic
* @throws RemotingException
... | 3.26 |
rocketmq-connect_ReporterManagerUtil_m0_rdh | /**
* create worker error record reporter
*
* @param connConfig
* @param retryWithToleranceOperator
* @param converter
* @return */
public static WorkerErrorRecordReporter m0(ConnectKeyValue connConfig, RetryWithToleranceOperator
retryWithToleranceOperator, RecordConverter converter) {
DeadLetterQueueConfig ... | 3.26 |
rocketmq-connect_ReporterManagerUtil_sourceTaskReporters_rdh | /**
* build source task reporter
*
* @param connectorTaskId
* @param connConfig
* @return */
public static List<ErrorReporter> sourceTaskReporters(ConnectorTaskId connectorTaskId, ConnectKeyValue connConfig, ErrorMetricsGroup errorMetricsGroup) {
List<ErrorReporter> reporters = new ArrayList<>();
LogRepor... | 3.26 |
rocketmq-connect_ReporterManagerUtil_m1_rdh | /**
* build sink task reporter
*
* @param connectorTaskId
* @param connConfig
* @param workerConfig
* @return */
public static List<ErrorReporter> m1(ConnectorTaskId connectorTaskId, ConnectKeyValue connConfig, WorkerConfig workerConfig, ErrorMetricsGroup errorMetricsGroup) {
// ensure reporter order
... | 3.26 |
rocketmq-connect_ReporterManagerUtil_createRetryWithToleranceOperator_rdh | /**
* create retry operator
*
* @param connConfig
* @return */
public static RetryWithToleranceOperator createRetryWithToleranceOperator(ConnectKeyValue connConfig, ErrorMetricsGroup errorMetricsGroup) {
DeadLetterQueueConfig deadLetterQueueConfig = new DeadLetterQueueConfig(connConfig);
return new Re... | 3.26 |
hadoop_TimelineEvent_getInfoJAXB_rdh | // required by JAXB
@InterfaceAudience.Private
@XmlElement(name = "info")
public HashMap<String, Object> getInfoJAXB() {
return info;
} | 3.26 |
hadoop_SubClusterState_fromString_rdh | /**
* Convert a string into {@code SubClusterState}.
*
* @param state
* the string to convert in SubClusterState
* @return the respective {@code SubClusterState}
*/
public static SubClusterState fromString(String state) {
try {
... | 3.26 |
hadoop_SubClusterState_isUsable_rdh | /**
* Subcluster has unregistered.
*/
SC_UNREGISTERED; public boolean isUsable() {
return (this == SC_RUNNING) || (this == SC_NEW);
} | 3.26 |
hadoop_RolloverSignerSecretProvider_rollSecret_rdh | /**
* Rolls the secret. It is called automatically at the rollover interval.
*/
protected synchronized void rollSecret() {
if (!isDestroyed) {
LOG.debug("rolling secret");
byte[] newSecret =
generateNewSecret();
secrets = new byte[][]{ newSecret, secrets[0] };
}
} | 3.26 |
hadoop_RolloverSignerSecretProvider_init_rdh | /**
* Initialize the SignerSecretProvider. It initializes the current secret
* and starts the scheduler for the rollover to run at an interval of
* tokenValidity.
*
* @param config
* configuration properties
* @param servletContext
* servlet context
* @param tokenValidity
* The amount of time a token i... | 3.26 |
hadoop_RolloverSignerSecretProvider_initSecrets_rdh | /**
* Initializes the secrets array. This should typically be called only once,
* during init but some implementations may wish to call it other times.
* previousSecret can be null if there isn't a previous secret, but
* currentSecret should never be null.
*
* @param currentSecret
* The current secret
* @par... | 3.26 |
hadoop_RolloverSignerSecretProvider_startScheduler_rdh | /**
* Starts the scheduler for the rollover to run at an interval.
*
* @param initialDelay
* The initial delay in the rollover in milliseconds
* @param period
* The interval for the rollover in milliseconds
*/
protected synchronized void startScheduler(long initialDelay, long period) {
if (!schedulerRunn... | 3.26 |
hadoop_FederationRMFailoverProxyProvider_close_rdh | /**
* Close all the proxy objects which have been opened over the lifetime of
* this proxy provider.
*/
@Override
public synchronized void close() throws IOException {
closeInternal(current);
} | 3.26 |
hadoop_ServiceShutdownHook_run_rdh | /**
* Shutdown handler.
* Query the service hook reference -if it is still valid the
* {@link Service#stop()} operation is invoked.
*/
@Override
public void run() {
shutdown();
} | 3.26 |
hadoop_ServiceShutdownHook_shutdown_rdh | /**
* Shutdown operation.
* <p>
* Subclasses may extend it, but it is primarily
* made available for testing.
*
* @return true if the service was stopped and no exception was raised.
*/
protected boolean shutdown() {
Service service;
boolean result = false;
synchronized(this) {
service = serv... | 3.26 |
hadoop_ServiceShutdownHook_unregister_rdh | /**
* Unregister the hook.
*/
public synchronized void
unregister() {
try {
ShutdownHookManager.get().removeShutdownHook(this);
} catch (IllegalStateException e) {
LOG.info("Failed to unregister shutdown hook: {}", e, e);
}} | 3.26 |
hadoop_ServiceShutdownHook_register_rdh | /**
* Register the service for shutdown with Hadoop's
* {@link ShutdownHookManager}.
*
* @param priority
* shutdown hook priority
*/
public synchronized void
register(int priority) {
unregister();
ShutdownHookManager.get().addShutdownHook(this, priority);
} | 3.26 |
hadoop_NodeName_anonymize_rdh | // TODO There is no caching for saving memory.
private static String anonymize(String data, WordList wordList) {
if (data == null) {
return null;
}
if (!wordList.contains(data)) {
wordList.add(data);
}
return wordList.getName() + wordList.indexOf(data);
} | 3.26 |
hadoop_JavaCommandLineBuilder_addConfOptionToCLI_rdh | /**
* Ass a configuration option to the command line of the application
*
* @param conf
* configuration
* @param key
* key
* @param defVal
* default value
* @return the resolved configuration option
* @throws IllegalArgumentException
* if key is null or the looked up value
* is null (that is: the... | 3.26 |
hadoop_JavaCommandLineBuilder_define_rdh | /**
* Add a <code>-D key=val</code> command to the CLI. This is very Hadoop API
*
* @param key
* key
* @param val
* value
* @throws IllegalArgumentException
* if either argument is null
*/
public void define(String key, String val) {Preconditions.checkArgument(key != null, "null key");
Preconditions... | 3.26 |
hadoop_JavaCommandLineBuilder_addPrefixedConfOptions_rdh | /**
* Add all configuration options which match the prefix
*
* @param conf
* configuration
* @param prefix
* prefix, e.g {@code "slider."}
* @return the number of entries copied
*/
public int addPrefixedConfOptions(Configuration conf, String prefix) {
int copi... | 3.26 |
hadoop_JavaCommandLineBuilder_getJavaBinary_rdh | /**
* Get the java binary. This is called in the constructor so don't try and
* do anything other than return a constant.
*
* @return the path to the Java binary
*/
protected String getJavaBinary() {
return Environment.JAVA_HOME.$$() + "/bin/java";} | 3.26 |
hadoop_JavaCommandLineBuilder_setJVMOpts_rdh | /**
* Set JVM opts.
*
* @param jvmOpts
* JVM opts
*/
public void setJVMOpts(String jvmOpts) {
if (ServiceUtils.isSet(jvmOpts)) {
add(jvmOpts);
}
} | 3.26 |
hadoop_JavaCommandLineBuilder_enableJavaAssertions_rdh | /**
* Turn Java assertions on
*/
public void enableJavaAssertions() {
add("-ea");
add("-esa");
} | 3.26 |
hadoop_JavaCommandLineBuilder_sysprop_rdh | /**
* Add a system property definition -must be used before setting the main entry point
*
* @param property
* @param value
*/
public void sysprop(String property, String value) {
Preconditions.checkArgument(property != null, "null property name");Preconditions.checkArgument(value != null, "null value");
... | 3.26 |
hadoop_JavaCommandLineBuilder_defineIfSet_rdh | /**
* Add a <code>-D key=val</code> command to the CLI if <code>val</code>
* is not null
*
* @param key
* key
* @param val
* value
*/
public boolean defineIfSet(String key, String val) {
Preconditions.checkArgument(key != null, "null key");if (val != null) {
define(key, val);
return true;
... | 3.26 |
hadoop_JavaCommandLineBuilder_addMandatoryConfOption_rdh | /**
* Add a mandatory config option
*
* @param conf
* configuration
* @param key
* key
* @throws BadConfigException
* if the key is missing
*/
public void
addMandatoryConfOption(Configuration conf, String key) throws BadConfigException {
if (!addConfOption(conf, key)) {
throw new BadConfigEx... | 3.26 |
hadoop_DiffList_unmodifiableList_rdh | /**
* Returns an unmodifiable diffList.
*
* @param diffs
* DiffList
* @param <T>
* Type of the object in the the diffList
* @return Unmodifiable diffList
*/
static <T extends Comparable<Integer>> DiffList<T> unmodifiableList(DiffList<T> diffs)
{
return new DiffList<T>() {
@Override
publ... | 3.26 |
hadoop_DiffList_m0_rdh | /**
* Returns an empty DiffList.
*/
static <T extends Comparable<Integer>> DiffList<T> m0() {
return EMPTY_LIST;} | 3.26 |
hadoop_SequentialBlockGroupIdGenerator_nextValue_rdh | // NumberGenerator
@Override
public long nextValue() {
skipTo((getCurrentValue() & (~BLOCK_GROUP_INDEX_MASK)) + MAX_BLOCKS_IN_GROUP);
// Make sure there's no conflict with existing random block IDs
final Block b = new Block(getCurrentValue());
while (hasValidBlockInRange(b))... | 3.26 |
hadoop_RetriableCommand_setRetryPolicy_rdh | /**
* Fluent-interface to change the RetryHandler.
*
* @param retryHandler
* The new RetryHandler instance to be used.
* @return Self.
*/
public RetriableCommand setRetryPolicy(RetryPolicy retryHandler) {
this.retryPolicy = retryHandler;
return this;
} | 3.26 |
hadoop_RetriableCommand_execute_rdh | /**
* The execute() method invokes doExecute() until either:
* 1. doExecute() succeeds, or
* 2. the command may no longer be retried (e.g. runs out of retry-attempts).
*
* @param arguments
* The list of arguments for the command.
* @return Generic "Object" from doExecute(), on success.
* @throws Exception
... | 3.26 |
hadoop_ZKClient_registerService_rdh | /**
* register the service to a specific path.
*
* @param path
* the path in zookeeper namespace to register to
* @param data
* the data that is part of this registration
* @throws IOException
* if there are I/O errors.
* @throws InterruptedException
* if any thread has interrupted.
*/
public void re... | 3.26 |
hadoop_ZKClient_listServices_rdh | /**
* list the services registered under a path.
*
* @param path
* the path under which services are
* registered
* @return the list of names of services registered
* @throws IOException
* if there are I/O errors.
* @throws InterruptedException
* if any thread has interrupted.
*/
public List<String> ... | 3.26 |
hadoop_ZKClient_getServiceData_rdh | /**
* get data published by the service at the registration address.
*
* @param path
* the path where the service is registered
* @return the data of the registered service
* @throws IOException
* if there are I/O errors.
* @throws InterruptedException
* if any thread has interrupted.
*/
public String g... | 3.26 |
hadoop_ZKClient_unregisterService_rdh | /**
* unregister the service.
*
* @param path
* the path at which the service was registered
* @throws IOException
* if there are I/O errors.
* @throws InterruptedException
* if any thread has interrupted.
*/
public void unregisterService(String path) throws IO... | 3.26 |
hadoop_FlowActivitySubDoc_equals_rdh | // Only check if type and id are equal
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof FlowActivitySubDoc)) {
return false;
}
FlowActivitySubDoc m = ((FlowActivitySubDoc)
(o));
if (!flowVersion.equalsIgnoreCase(m.getFlowVersion(... | 3.26 |
hadoop_FederationRouterRMTokenInputValidator_validate_rdh | /**
* We will check with the RouterMasterKeyRequest{@link RouterMasterKeyRequest}
* to ensure that the request object is not empty and that the RouterMasterKey is not empty.
*
* @param request
* RouterMasterKey Request.
* @throws FederationStateStoreInvalidInputException
* if the request is invalid.
*/
publ... | 3.26 |
hadoop_MetricsCache_getTag_rdh | /**
* Lookup a tag value
*
* @param key
* name of the tag
* @return the tag value
*/public String getTag(String key) {
return tags.get(key);
} | 3.26 |
hadoop_MetricsCache_get_rdh | /**
* Get the cached record
*
* @param name
* of the record
* @param tags
* of the record
* @return the cached record or null
*/
public Record get(String name, Collection<MetricsTag> tags) {RecordCache rc = map.get(name);
if (rc == null)
return null;
return rc.get(tags);
} | 3.26 |
hadoop_MetricsCache_getMetricInstance_rdh | /**
* Lookup a metric instance
*
* @param key
* name of the metric
* @return the metric instance
*/
public AbstractMetric getMetricInstance(String key) {
return metrics.get(key);} | 3.26 |
hadoop_MetricsCache_update_rdh | /**
* Update the cache and return the current cache record
*
* @param mr
* the update record
* @return the updated cache record
*/
public Record update(MetricsRecord mr) {
return update(mr, false);
} | 3.26 |
hadoop_MetricsCache_getMetric_rdh | /**
* Lookup a metric value
*
* @param key
* name of the metric
* @return the metric value
*/
public Number getMetric(String key) {
AbstractMetric metric = metrics.get(key);
return metric != null ? metric.value() : null;
} | 3.26 |
hadoop_MetricsCache_metrics_rdh | /**
*
* @deprecated use metricsEntrySet() instead
* @return entry set of metrics
*/
@Deprecated
public Set<Map.Entry<String, Number>> metrics() {
Map<String, Number> v2 = new LinkedHashMap<String, Number>(metrics.size());
for (Map.Entry<String, AbstractMetric> mapEntry : metrics.entrySet()) {
v2.put... | 3.26 |
hadoop_MetricsCache_metricsEntrySet_rdh | /**
*
* @return entry set of metrics
*/
public Set<Map.Entry<String, AbstractMetric>> metricsEntrySet() {
return metrics.entrySet();
} | 3.26 |
hadoop_MetricsCache_tags_rdh | /**
*
* @return the entry set of the tags of the record
*/
public Set<Map.Entry<String, String>> tags() {return tags.entrySet();
} | 3.26 |
hadoop_AbstractJavaKeyStoreProvider_locateKeystore_rdh | /**
* Open up and initialize the keyStore.
*
* @throws IOException
* If there is a problem reading the password file
* or a problem reading the keystore.
*/
private void locateKeystore() throws IOException {
try {
password = ProviderUtils.locatePassword(CREDENTIAL_PASSWORD_ENV_VAR, conf.get(CREDENTIAL_PASSWOR... | 3.26 |
hadoop_GroupMappingServiceProvider_getGroupsSet_rdh | /**
* Get all various group memberships of a given user.
* Returns EMPTY set in case of non-existing user
*
* @param user
* User's name
* @return set of group memberships of user
* @throws IOException
* raised on errors performing I/O.
*/default Set<String> getGroups... | 3.26 |
hadoop_NormalizedResourceEvent_getTaskType_rdh | /**
* the tasktype for the event.
*
* @return the tasktype for the event.
*/
public TaskType getTaskType() {
return this.taskType;
} | 3.26 |
hadoop_PeriodicService_getRunCount_rdh | /**
* Get how many times we run the periodic service.
*
* @return Times we run the periodic service.
*/
protected long getRunCount() {
return this.runCount;
} | 3.26 |
hadoop_PeriodicService_stopPeriodic_rdh | /**
* Stop the periodic task.
*/
protected synchronized void stopPeriodic() {
if (this.isRunning) {
LOG.info("{} is shutting down", this.serviceName);
this.isRunning = false;
this.scheduler.shutdownNow();}
} | 3.26 |
hadoop_PeriodicService_startPeriodic_rdh | /**
* Start the periodic execution.
*/
protected synchronized void startPeriodic() {
stopPeriodic();
// Create the runnable service
Runnable updateRunnable = () -> {
LOG.debug("Running {} update task", serviceName);
try {
if (!isRunning) {
return;
}
... | 3.26 |
hadoop_PeriodicService_getErrorCount_rdh | /**
* Get how many times we failed to run the periodic service.
*
* @return Times we failed to run the periodic service.
*/
protected long getErrorCount() {
return
this.errorCount;
} | 3.26 |
hadoop_PeriodicService_setIntervalMs_rdh | /**
* Set the interval for the periodic service.
*
* @param interval
* Interval in milliseconds.
*/
protected void setIntervalMs(long interval) {
if (getServiceState() == STATE.STARTED) {
throw new ServiceStateException("Periodic service already started");
} else {
this.f0 = interval;
... | 3.26 |
hadoop_PeriodicService_getLastUpdate_rdh | /**
* Get the last time the periodic service was executed.
*
* @return Last time the periodic service was executed.
*/
protected long getLastUpdate()
{
return this.lastRun; } | 3.26 |
hadoop_PeriodicService_getIntervalMs_rdh | /**
* Get the interval for the periodic service.
*
* @return Interval in milliseconds.
*/
protected long getIntervalMs() {
return this.f0;
} | 3.26 |
hadoop_ConfigRedactor_redact_rdh | /**
* Given a key / value pair, decides whether or not to redact and returns
* either the original value or text indicating it has been redacted.
*
* @param key
* param key.
* @param value
* param value, will return if conditions permit.
* @return Original value, or text indicating it has been redacted
*/
... | 3.26 |
hadoop_ConfigRedactor_redactXml_rdh | /**
* Given a key / value pair, decides whether or not to redact and returns
* either the original value or text indicating it has been redacted.
*
* @param key
* param key.
* @param value
* param value, will return if conditions permit.
* @return Original value, or text indicating it has been redacted
*/
... | 3.26 |
hadoop_ConfigRedactor_configIsSensitive_rdh | /**
* Matches given config key against patterns and determines whether or not
* it should be considered sensitive enough to redact in logs and other
* plaintext displays.
*
* @param key
* @return True if parameter is considered sensitive
*/
private boolean configIsSensitive(String key) {
for (Pattern regex :... | 3.26 |
hadoop_StorageReceivedDeletedBlocks_getStorageID_rdh | /**
*
* @deprecated Use {@link #getStorage()} instead
*/
@Deprecated
public String getStorageID() {
return storage.getStorageID();
} | 3.26 |
hadoop_DelegatingSSLSocketFactory_bindToOpenSSLProvider_rdh | /**
* Bind to the OpenSSL provider via wildfly.
* This MUST be the only place where wildfly classes are referenced,
* so ensuring that any linkage problems only surface here where they may
* be caught by the initialization code.
*/
private void bindToOpenSSLProvider() throws NoSuchAlgorithmException, KeyManagement... | 3.26 |
hadoop_DelegatingSSLSocketFactory_getChannelMode_rdh | /**
* Get the channel mode of this instance.
*
* @return a channel mode.
*/
public SSLChannelMode
getChannelMode() {
return channelMode;
} | 3.26 |
hadoop_DelegatingSSLSocketFactory_initializeDefaultFactory_rdh | /**
* Initialize a singleton SSL socket factory.
*
* @param preferredMode
* applicable only if the instance is not initialized.
* @throws IOException
* if an error occurs.
*/
public static synchronized void initializeDefaultFactory(SSLChannelMode preferredMode) throws IOException {
if (instance == null... | 3.26 |
hadoop_DelegatingSSLSocketFactory_resetDefaultFactory_rdh | /**
* For testing only: reset the socket factory.
*/
@VisibleForTesting
public static synchronized void resetDefaultFactory() {
LOG.info("Resetting default SSL Socket Factory");
instance = null;
} | 3.26 |
hadoop_CustomTokenProviderAdapter_bind_rdh | /**
* Bind to the filesystem by passing the binding call on
* to any custom token provider adaptee which implements
* {@link BoundDTExtension}.
* No-op if they don't.
*
* @param fsURI
* URI of the filesystem.
* @param conf
* configuration of this extension.
* @throws IOException
* failure.
*/
@Overrid... | 3.26 |
hadoop_ServerWebApp_contextDestroyed_rdh | /**
* Destroys the <code>ServletContextListener</code> which destroys
* the Server.
*
* @param event
* servelt context event.
*/
@Override
public void contextDestroyed(ServletContextEvent event) {
destroy();
} | 3.26 |
hadoop_ServerWebApp_getHomeDir_rdh | /**
* Returns the server home directory.
* <p>
* It is looked up in the Java System property
* <code>#SERVER_NAME#.home.dir</code>.
*
* @param name
* the server home directory.
* @return the server home directory.
*/
static String getHomeDir(String name) {
String homeDir = f0.get();
if (homeDir == nu... | 3.26 |
hadoop_ServerWebApp_setAuthority_rdh | /**
* Sets an alternate hostname:port InetSocketAddress to use.
* <p>
* For testing purposes.
*
* @param authority
* alterante authority.
*/
@VisibleForTesting
public void setAuthority(InetSocketAddress authority) {
this.authority = authority;
} | 3.26 |
hadoop_ServerWebApp_isSslEnabled_rdh | /**
*/
public boolean isSslEnabled() {
return Boolean.parseBoolean(System.getProperty(getName() + SSL_ENABLED, "false"));
} | 3.26 |
hadoop_ServerWebApp_m0_rdh | /**
* Returns the hostname:port InetSocketAddress the webserver is listening to.
*
* @return the hostname:port InetSocketAddress the webserver is listening to.
*/
public InetSocketAddress m0() throws ServerException {
synchronized(this) {if (authority == null) { authority = resolveAuthority();
}
}... | 3.26 |
hadoop_ServerWebApp_setHomeDirForCurrentThread_rdh | /**
* Method for testing purposes.
*/
public static void setHomeDirForCurrentThread(String homeDir) {
f0.set(homeDir);
} | 3.26 |
hadoop_HdfsUtils_m0_rdh | /**
* Is the HDFS healthy?
* HDFS is considered as healthy if it is up and not in safemode.
*
* @param uri
* the HDFS URI. Note that the URI path is ignored.
* @return true if HDFS is healthy; false, otherwise.
*/
@SuppressWarnings("deprecation")
public static boolean m0(URI uri) {
// check scheme
fin... | 3.26 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.