name stringlengths 12 178 | code_snippet stringlengths 8 36.5k | score float64 3.26 3.68 |
|---|---|---|
rocketmq-connect_ProcessingContext_currentContext_rdh | /**
* A helper method to set both the stage and the class.
*
* @param stage
* the stage
* @param klass
* the class which will execute the operation in this stage.
*/
public void currentContext(ErrorReporter.Stage stage, Class<?> klass) {
stage(stage);
executingClass(klass);
} | 3.26 |
rocketmq-connect_ProcessingContext_attempt_rdh | /**
*
* @param attempt
* the number of attempts made to execute the current operation.
*/
public void attempt(int attempt) {
this.attempt = attempt;
} | 3.26 |
rocketmq-connect_DebeziumMongoDBSource_getTaskClass_rdh | /**
* get task class
*/
@Override
public String getTaskClass() {
return DEFAULT_TASK;
} | 3.26 |
rocketmq-connect_JsonConverterConfig_cacheSize_rdh | /**
* return cache size
*
* @return */
public int cacheSize() {
return cacheSize;
} | 3.26 |
rocketmq-connect_JsonConverterConfig_m0_rdh | /**
* Return whether schemas are enabled.
*
* @return true if enabled, or false otherwise
*/
public boolean m0() {
return schemasEnabled;
} | 3.26 |
rocketmq-connect_JsonConverterConfig_decimalFormat_rdh | /**
* Get the serialization format for decimal types.
*
* @return the decimal serialization format
*/
public DecimalFormat decimalFormat()
{return decimalFormat;
} | 3.26 |
rocketmq-connect_KafkaConnectAdaptorSink_transforms_rdh | /**
* convert by kafka sink transform
*
* @param record
*/
@Override
protected SinkRecord transforms(SinkRecord record) {
List<Transformation> transformations = transformationWrapper.transformations();
Iterator transformationIterator = transformations.iterator();while (transformationIterator.hasNext()) {
... | 3.26 |
rocketmq-connect_KafkaConnectAdaptorSink_processSinkRecord_rdh | /**
* convert ConnectRecord to SinkRecord
*
* @param record
* @return */@Override
public SinkRecord processSinkRecord(ConnectRecord record) {
SinkRecord sinkRecord = Converters.fromConnectRecord(record);
return transforms(sinkRecord);
} | 3.26 |
rocketmq-connect_DorisSinkConnector_m0_rdh | /**
* Should invoke before start the connector.
*
* @param config
* @return error message
*/
@Override
public void m0(KeyValue config) {
// do validate config
} | 3.26 |
rocketmq-connect_DorisSinkConnector_taskConfigs_rdh | /**
* Returns a set of configurations for Tasks based on the current configuration,
* producing at most count configurations.
*
* @param maxTasks
* maximum number of configurations to generate
* @return configurations for Tasks
*/
@Override
public List<KeyValue> taskConfigs(int maxTasks) {
log.info("Starti... | 3.26 |
rocketmq-connect_DistributedConnectStartup_createConnectController_rdh | /**
* Read configs from command line and create connect controller.
*
* @param args
* @return */
private static DistributedConnectController createConnectController(String[] args) {
try {
// Build the command line options.
Options
options = ServerUtil.buildCommandlineOptions(new Options... | 3.26 |
rocketmq-connect_ClusterConfigState_targetState_rdh | /**
* Get the target state of the connector
*
* @param connector
* @return */
public TargetState targetState(String
connector) {
return connectorTargetStates.get(connector);
} | 3.26 |
rocketmq-connect_ClusterConfigState_taskCount_rdh | /**
* Get the number of tasks assigned for the given connector.
*
* @param connectorName
* name of the connector to look up tasks for
* @return the number of tasks
*/
public int taskCount(String connectorName) {
Integer count = connectorTaskCounts.get(connectorName);
return count == null ? 0 : count;
} | 3.26 |
rocketmq-connect_ClusterConfigState_tasks_rdh | /**
* Get the current set of task IDs for the specified connector.
*
* @param connectorName
* the name of the connector to look up task configs for
* @return the current set of connector task IDs
*/
public List<ConnectorTaskId> tasks(String connectorName) {
Integer numTasks = connectorTaskCounts.get(connect... | 3.26 |
rocketmq-connect_ClusterConfigState_taskConfig_rdh | /**
* task config
*
* @param task
* @return */
public Map<String, String> taskConfig(ConnectorTaskId task) {
return taskConfigs.get(task);
} | 3.26 |
rocketmq-connect_ClusterConfigState_allTaskConfigs_rdh | /**
* get all task configs
*
* @param connector
* @return */
public List<Map<String, String>> allTaskConfigs(String connector) {
Map<Integer, Map<String, String>> taskConfigs = new TreeMap<>();
for (Map.Entry<ConnectorTaskId, Map<String, String>> taskConfigEntry : this.taskConfigs.entrySet()) {
i... | 3.26 |
rocketmq-connect_ClusterConfigState_contains_rdh | /**
* Check whether this snapshot contains configuration for a connector.
*
* @param connector
* name of the connector
* @return true if this state contains configuration for the connector, false otherwise
*/
public boolean contains(String connector) {
return connectorConfigs.containsKey(connector);
} | 3.26 |
rocketmq-connect_TimestampIncrementingCriteria_extractOffsetTimestamp_rdh | /**
* Extract the timestamp from the row.
*
* @param schema
* the record's schema; never null
* @param record
* the record's struct; never null
* @return the timestamp for this row; may not be null
*/
protected Timestamp extractOffsetTimestamp(Schema schema, Struct record) {
for (ColumnId timestampColum... | 3.26 |
rocketmq-connect_TimestampIncrementingCriteria_extractOffsetIncrementedId_rdh | /**
* Extract the incrementing column value from the row.
*
* @param schema
* the record's schema; never null
* @param record
* the record's struct; never null
* @return the incrementing ID for this row; may not be null
*/
protected Long extractOffsetIncrementedId(Schema schema, Struct record) {
final L... | 3.26 |
rocketmq-connect_TimestampIncrementingCriteria_extractValues_rdh | /**
* Extract the offset values from the row.
*
* @param schema
* the record's schema; never null
* @param record
* the record's struct; never null
* @param previousOffset
* a previous timestamp off... | 3.26 |
rocketmq-connect_ConnectorPluginsResource_listConnectorPlugins_rdh | /**
* list connector plugins
*
* @param context
* @return */
public void listConnectorPlugins(Context context) {
synchronized(this) {
List<PluginInfo> pluginInfos = Collections.unmodifiableList(connectorPlugins.stream().filter(p -> PluginType.SINK.equals(p.getType()) || PluginType.SOURCE.equals(p.ge... | 3.26 |
rocketmq-connect_ConnectorPluginsResource_getConnectorConfigDef_rdh | /**
* Get connector config def
*
* @param context
* @return */
public void getConnectorConfigDef(Context context) {
// No-op
context.json(new HttpResponse<>(HttpStatus.BAD_REQUEST_400, "This function has not been implemented yet"));
} | 3.26 |
rocketmq-connect_ConnectorPluginsResource_listPlugins_rdh | /**
* list connector plugins
*
* @param context
* @return */
public void listPlugins(Context context) {
synchronized(this) {
context.json(new HttpResponse<>(context.status(), Collections.unmodifiableList(connectorPlugins)));
}
} | 3.26 |
rocketmq-connect_ConnectorPluginsResource_reloadPlugins_rdh | /**
* reload plugins
*
* @param context
*/
public void reloadPlugins(Context context) {
try {
connectController.reloadPlugins();
context.json(new HttpResponse<>(context.status(), "Plugin reload succeeded"));
} catch (Exception ex) {
log.error("Reload plugin failed .", ex); context.... | 3.26 |
rocketmq-connect_FieldsMetadata_extract_rdh | /**
* extract metadata info
*
* @param tableName
* @param pkMode
* @param configuredPkFields
* @param fieldsWhitelist
* @param schema
* @param headers
* @return */public static FieldsMetadata extract(final String tableName, final JdbcSinkConfig.PrimaryKeyMode pkMode, final List<String> configuredPkFields, fin... | 3.26 |
rocketmq-connect_FieldsMetadata_extractRecordValuePk_rdh | /**
* record value
*
* @param tableName
* @param configuredPkFields
* @param valueSchema
* @param headers
* @param allFields
* @param keyFieldNames
*/
private static void extractRecordValuePk(final String tableName, final List<String> configuredPkFields, final Schema valueSchema, final KeyValue headers, final... | 3.26 |
rocketmq-connect_MetricUtils_getMeterValue_rdh | /**
* get meter value
*
* @param name
* @param meter
* @return */
public static Double getMeterValue(MetricName name, Meter meter) {
if (name.getType().equals(NoneType.none.name())) {
throw new IllegalArgumentException("Meter type configuration error");
}
Stat.RateType rateTyp... | 3.26 |
rocketmq-connect_MetricUtils_metricNameToString_rdh | /**
* MetricName to string
*
* @param name
* @return */
public static String metricNameToString(MetricName name) {
if (StringUtils.isEmpty(name.getType())) {
name.setType("none");
}
StringBuilder sb = new StringBuilder(ROCKETMQ_CONNECT).append(name.getGroup()).append(SPLIT_COMMA... | 3.26 |
rocketmq-connect_MetricUtils_stringToMetricName_rdh | /**
* string to MetricName
*
* @param name
* @return */
public static MetricName stringToMetricName(String name) {
if (StringUtils.isEmpty(name)) {throw new IllegalArgumentException("Metric name str is empty");
}
String[]
splits = name.replace(ROCKETMQ_CONNECT, "").replace(SPLIT_KV, SPLIT_COMMA).s... | 3.26 |
rocketmq-connect_DorisSinkTask_start_rdh | /**
* Start the component
*
* @param keyValue
*/
@Override
public void start(KeyValue keyValue) {
originalConfig = keyValue;
config = new DorisSinkConfig(keyValue);
remainingRetries = config.getMaxRetries();
log.info("Initializing doris writer");
this.updater
= new Updater(config);
} | 3.26 |
rocketmq-connect_DorisSinkTask_put_rdh | /**
* Put the records to the sink
*
* @param records
*/
@Override
public void put(List<ConnectRecord> records) throws ConnectException {
if (records.isEmpty()) {
return;
}
final int
recordsCount = records.size();
log.debug("Received {} records.", recordsCount);
try {
updater.... | 3.26 |
rocketmq-connect_DeadLetterQueueReporter_populateContextHeaders_rdh | /**
* pop context property
*
* @param producerRecord
* @param context
*/
void populateContextHeaders(Message producerRecord, ProcessingContext context) {
Map<String, String>
headers = producerRecord.getProperties();
if (context.consumerRecord() != null) {
producerRecord.putUserProperty(ERROR_HE... | 3.26 |
rocketmq-connect_DeadLetterQueueReporter_report_rdh | /**
* Write the raw records into a topic
*/
@Override
public void report(ProcessingContext context) {
if (this.f1.dlqTopicName().trim().isEmpty()) {
return;
}
f2.recordDeadLetterQueueProduceRequest();
MessageExt originalMessage
= context.consumerRecord();
if (originalMessage == null)... | 3.26 |
rocketmq-connect_DeadLetterQueueReporter_build_rdh | /**
* build reporter
*
* @param connectorTaskId
* @param sinkConfig
* @param workerConfig
* @return */
public static DeadLetterQueueReporter build(ConnectorTaskId connectorTaskId, ConnectKeyValue sinkConfig, WorkerConfig workerConfig, ErrorMetricsGroup errorMetricsGroup) {
... | 3.26 |
rocketmq-connect_ToleranceType_value_rdh | /**
* Tolerate all errors.
*/
ALL;public String value() {
return name().toLowerCase(Locale.ROOT);
} | 3.26 |
rocketmq-connect_BufferedRecords_executeUpdates_rdh | /**
*
* @return an optional count of all updated rows or an empty optional if no info is available
*/
private Optional<Long> executeUpdates() throws DorisException {
Optional<Long> count = Optional.empty();
if (updatePreparedRecords.isEmpty()) {
return count;
}
for (ConnectRecord record : up... | 3.26 |
rocketmq-connect_BufferedRecords_add_rdh | /**
* add record
*
* @param record
* @return * @throws SQLException
*/
public List<ConnectRecord> add(ConnectRecord record) throws SQLException {
recordValidator.validate(record);
final List<ConnectRecord> flushed = new ArrayList<>();
boolean schemaChanged = false;
if (!Objects.equals(keySchema, ... | 3.26 |
rocketmq-connect_TransformChain_retryWithToleranceOperator_rdh | /**
* set retryWithToleranceOperator
*/
public void retryWithToleranceOperator(RetryWithToleranceOperator retryWithToleranceOperator) {
this.retryWithToleranceOperator = retryWithToleranceOperator;
} | 3.26 |
rocketmq-connect_TransformChain_close_rdh | /**
* close transforms
*
* @throws Exception
* if this resource cannot be closed
*/
@Override
public void close() throws Exception {
for (Transform transform : transformList) {
transform.stop();
}} | 3.26 |
rocketmq-connect_LRUCache_get_rdh | /**
*
* @param key
* @return */
@Override
public V get(K key) {
return cache.get(key);
} | 3.26 |
rocketmq-connect_LRUCache_put_rdh | /**
* put a data to cache
*
* @param key
* @param value
*/@Override
public void
put(K key, V value) {
cache.put(key, value);
} | 3.26 |
rocketmq-connect_LRUCache_remove_rdh | /**
* remove a data to cache
*
* @param key
* @return */
@Override
public boolean remove(K key) {
return cache.remove(key) != null;
} | 3.26 |
rocketmq-connect_LRUCache_size_rdh | /**
* cache size
*
* @return */@Override public long size() {
return cache.size();
} | 3.26 |
rocketmq-connect_JdbcDriverInfo_jdbcMajorVersion_rdh | /**
* Get the major version of the JDBC specification supported by the driver.
*
* @return the major version number
*/
public int jdbcMajorVersion()
{
return jdbcMajorVersion;
} | 3.26 |
rocketmq-connect_DorisStreamLoader_loadJson_rdh | /**
* JSON import
*
* @param jsonData
* @throws Exception
*/
public void loadJson(String jsonData, String table) throws Exception {
try (CloseableHttpClient client = httpClientBuilder.build()) {
HttpPut put = new HttpPut(getLoadURL(table));
put.removeHe... | 3.26 |
rocketmq-connect_DorisStreamLoader_basicAuthHeader_rdh | /**
* Construct authentication information, the authentication method used by doris here is Basic Auth
*
* @param username
* @param password
* @return */
private String
basicAuthHeader(String username, String password) {
final String tobeEncode = (username + ":") + password;
byte[] encoded = Base64.encod... | 3.26 |
rocketmq-connect_AbstractConnectController_taskConfigs_rdh | /**
* task configs
*
* @param connName
* @return */
public List<TaskInfo> taskConfigs(final String connName) {
ClusterConfigState configState = configManagementService.snapshot();
List<TaskInfo> result = new ArrayList<>();
for (int i = 0; i < configState.taskCount(connName); i++) {
ConnectorTaskId id = new Connect... | 3.26 |
rocketmq-connect_AbstractConnectController_putConnectorConfig_rdh | /**
* add connector
*
* @param connectorName
* @param configs
* @return * @throws Exception
*/
public String putConnectorConfig(String connectorName, ConnectKeyValue configs) throws Exception {
return configManagementService.putConnectorConfig(connectorName, configs);
} | 3.26 |
rocketmq-connect_AbstractConnectController_connectors_rdh | /**
* Get a list of connectors currently running in this cluster.
*
* @return A list of connector names
*/
public Collection<String> connectors() {
return configManagementService.snapshot().connectors();
} | 3.26 |
rocketmq-connect_AbstractConnectController_connectorTypeForClass_rdh | /**
* Retrieves ConnectorType for the corresponding connector class
*
* @param connClass
* class of the connector
*/
public ConnectorType connectorTypeForClass(String connClass) {
return ConnectorType.from(plugin.newConnector(connClass).getClass());
} | 3.26 |
rocketmq-connect_AbstractConnectController_connectorInfo_rdh | /**
* Get the definition and status of a connector.
*
* @param connector
* name of the connector
*/
public ConnectorInfo connectorInfo(String connector) {
final ClusterConfigState configState = configManagementService.snapshot();
if (!configState.contains(connector)) {
throw new ConnectException(("Connector[" ... | 3.26 |
rocketmq-connect_AbstractConnectController_pauseConnector_rdh | /**
* Pause the connector. This call will asynchronously suspend processing by the connector and all
* of its tasks.
*
* @param connector
* name of the connector
*/
public void pauseConnector(String connector) {
configManagementService.pauseConnector(connector);
} | 3.26 |
rocketmq-connect_AbstractConnectController_reloadPlugins_rdh | /**
* reload plugins
*/
public void reloadPlugins() {
configManagementService.getPlugin().initLoaders();
} | 3.26 |
rocketmq-connect_AbstractConnectController_deleteConnectorConfig_rdh | /**
* Remove the connector with the specified connector name in the cluster.
*
* @param connectorName
*/
public void deleteConnectorConfig(String connectorName) {
configManagementService.deleteConnectorConfig(connectorName);
} | 3.26 |
rocketmq-connect_AbstractConnectController_resumeConnector_rdh | /**
* Resume the connector. This call will asynchronously start the connector and its tasks (if
* not started already).
*
* @param connector
* name of the connector
*/
public void resumeConnector(String connector) {
configManagementService.resumeConnector(connector);
} | 3.26 |
rocketmq-connect_CountDownLatch2_await_rdh | /**
* Causes the current thread to wait until the latch has counted down to zero, unless the thread is {@linkplain Thread#interrupt interrupted}.
*
* <p>If the current count is zero then this method returns immediately.
*
* <p>If the current count is greater than zero then the current
* thread becomes disabled fo... | 3.26 |
rocketmq-connect_CountDownLatch2_toString_rdh | /**
* Returns a string identifying this latch, as well as its state. The state, in brackets, includes the String {@code "Count ="} followed by the current count.
*
* @return a string identifying this latch, as well as its state
*/public String toString() {
return ((super.toString() + "[Count = ") + sync.getCoun... | 3.26 |
rocketmq-connect_ClusterManagementServiceImpl_prepare_rdh | /**
* Preparation before startup
*
* @param connectConfig
*/
private void prepare(WorkerConfig connectConfig) {
String consumerGroup = this.defaultMQPullConsumer.getConsumerGroup();
Set<String> consumerGroupSet = ConnectUtil.fetchAllConsumerGroupList(connectConfig);
if (!consumerGroupSet.contains(consu... | 3.26 |
rocketmq-connect_AbstractPositionManagementService_mergeOffset_rdh | /**
* Merge new received position info with local store.
*
* @param partition
* @param offset
* @return */
private boolean mergeOffset(ExtendRecordPartition partition, RecordOffset offset) {
if ((null == partition) || partition.getPartition().isEmpty()) {
return false;
}
if (positionStore.ge... | 3.26 |
rocketmq-connect_AbstractPositionManagementService_set_rdh | /**
* send position
*
* @param partition
* @param position
*/
protected synchronized void set(PositionChange change, ExtendRecordPartition partition, RecordOffset position) {
String v5
= partition.getNamespace();
// When serializing the key, we add in the namespace information so the key is [namespace,... | 3.26 |
rocketmq-connect_DebeziumPostgresConnector_taskClass_rdh | /**
* Return the current connector class
*
* @return task implement class
*/
@Override
public Class<? extends Task> taskClass() {
return DebeziumPostgresSource.class;
} | 3.26 |
rocketmq-connect_DatabaseDialect_buildDropTableStatement_rdh | // drop table
default String buildDropTableStatement(TableId table, boolean ifExists, boolean cascade) {
ExpressionBuilder builder = expressionBuilder();
builder.append("DROP TABLE ");
builder.append(table);
if (ifExists) {
builder.append(" IF EXISTS");
}
if (cascade) {
builder.... | 3.26 |
rocketmq-connect_DatabaseDialect_parseTableNameToTableId_rdh | /**
* parse to Table Id
*
* @param fqn
* @return */
default TableId parseTableNameToTableId(String fqn) {
List<String> parts = identifierRules().parseQualifiedIdentifier(fqn);
if (parts.isEmpty()) {
throw new IllegalArgumentException(("Invalid fully qualified name: '" + fqn) + "'");
}
... | 3.26 |
rocketmq-connect_AvroSerdeFactory_addLogicalTypeConversion_rdh | /**
* add logical type conversion
*
* @param avroData
*/
public void addLogicalTypeConversion(GenericData avroData) {
avroData.addLogicalTypeConversion(new Conversions.DecimalConversion());
avroData.addLogicalTypeConversion(new TimeConversions.DateConversion());
avroData.addLogicalTypeConversion(new Tim... | 3.26 |
rocketmq-connect_Serdes_Integer_rdh | /**
* A serde for nullable {@code Integer} type.
*/
public static Serde<Integer> Integer() {
return new IntegerSerde();
} | 3.26 |
rocketmq-connect_Serdes_Float_rdh | /**
* A serde for nullable {@code Float} type.
*/
public static Serde<Float> Float() {
return new FloatSerde();
} | 3.26 |
rocketmq-connect_Serdes_Long_rdh | /**
* A serde for nullable {@code Long} type.
*/
public static Serde<Long> Long() {
return new LongSerde();
} | 3.26 |
rocketmq-connect_Serdes_Short_rdh | /**
* A serde for nullable {@code Short} type.
*/public static Serde<Short> Short() {
return new ShortSerde();
} | 3.26 |
rocketmq-connect_Serdes_ByteArray_rdh | /**
* A serde for nullable {@code byte[]} type.
*/
public static Serde<byte[]> ByteArray() {
return new ByteArraySerde();
} | 3.26 |
rocketmq-connect_Serdes_Double_rdh | /**
* A serde for nullable {@code Double} type.
*/
public static Serde<Double> Double() {
return new DoubleSerde();
} | 3.26 |
rocketmq-connect_Serdes_String_rdh | /**
* A serde for nullable {@code String} type.
*/public static Serde<String> String() {
return new StringSerde();
} | 3.26 |
rocketmq-connect_Serdes_ByteBuffer_rdh | /**
* A serde for nullable {@code ByteBuffer} type.
*/
public static Serde<ByteBuffer> ByteBuffer() {
return new ByteBufferSerde();
} | 3.26 |
rocketmq-connect_Serdes_serdeFrom_rdh | /**
* Construct a serde object from separate serializer and deserializer
*
* @param serializer
* must not be null.
* @param deserializer
* must not be null.
*/
public static <T> Serde<T> serdeFrom(final Serializer<T> serializer, final Deserializer<T> deserializer) {
if (serializer == null) {throw new I... | 3.26 |
rocketmq-connect_MetricsReporter_onCounterAdded_rdh | /**
* Called when a {@link Counter} is added to the registry.
*
* @param name
* the counter's name
* @param counter
* the counter
*/public void onCounterAdded(String name, Counter counter) {
this.onCounterAdded(MetricUtils.stringToMetricName(name), counter.getCount());
} | 3.26 |
rocketmq-connect_MetricsReporter_m0_rdh | /**
* Called when a {@link Meter} is removed from the registry.
*
* @param name
* the meter's name
*/
public void m0(String name) { this.m0(MetricUtils.stringToMetricName(name));
} | 3.26 |
rocketmq-connect_MetricsReporter_onHistogramRemoved_rdh | /**
* Called when a {@link Histogram} is removed from the registry.
*
* @param name
* the histogram's name
*/
public void onHistogramRemoved(String name) {
this.onCounterRemoved(MetricUtils.stringToMetricName(name));
} | 3.26 |
rocketmq-connect_MetricsReporter_onTimerAdded_rdh | /**
* Called when a {@link Timer} is added to the registry.
*
* @param name
* the timer's name
* @param timer
* the timer
*/public void onTimerAdded(String name,
Timer timer) {
this.onTimerAdded(MetricUtils.stringToMetricName(name), timer);
} | 3.26 |
rocketmq-connect_MetricsReporter_onHistogramAdded_rdh | /**
* Called when a {@link Histogram} is added to the registry.
*
* @param name
* the histogram's name
* @param histogram
* the histogram
*/
public void onHistogramAdded(String name, Histogram histogram) {
MetricName metricName = MetricUtils.stringToMetricName(name);
this.onHistogramAdded(metricName,... | 3.26 |
rocketmq-connect_MetricsReporter_onGaugeRemoved_rdh | /**
* Called when a {@link Gauge} is removed from the registry.
*
* @param name
* the gauge's name
*/
public void onGaugeRemoved(String name) {
this.onGaugeRemoved(MetricUtils.stringToMetricName(name));
} | 3.26 |
rocketmq-connect_MetricsReporter_onMeterAdded_rdh | /**
* Called when a {@link Meter} is added to the registry.
*
* @param name
* the meter's name
* @param meter
* the meter
*/
public void onMeterAdded(String name, Meter meter) {
MetricName metricName = MetricUtils.stringToMetricName(name);
onMeterAdded(metricName, MetricUtils.getMeterValue(metricNa... | 3.26 |
rocketmq-connect_MetricsReporter_onGaugeAdded_rdh | /**
* Called when a {@link Gauge} is added to the registry.
*
* @param name
* the gauge's name
* @param gauge
* the gauge
*/
public void onGaugeAdded(String name, Gauge<?> gauge) {
this.onGaugeAdded(MetricUtils.stringToMetricName(name), gauge.getValue());
} | 3.26 |
rocketmq-connect_MetricsReporter_onCounterRemoved_rdh | /**
* Called when a {@link Counter} is removed from the registry.
*
* @param name
* the counter's name
*/
public void onCounterRemoved(String name) {
this.onCounterRemoved(MetricUtils.stringToMetricName(name));
} | 3.26 |
rocketmq-connect_ConnectKeyValueSerde_serde_rdh | /**
* serializer and deserializer
*
* @return */
public static ConnectKeyValueSerde serde() {
return new ConnectKeyValueSerde(new ConnectKeyValueSerializer(), new ConnectKeyValueDeserializer());
} | 3.26 |
rocketmq-connect_RestHandler_getAllocatedConnectors_rdh | // old rest api
private void getAllocatedConnectors(Context context)
{
try {
ConcurrentMap<String, WorkerConnector> workerConnectors = connectController.getWorker().getConnectors();
Map<String, Map<String, String>> connectors = new HashMap<>();
for (Map.Entry<String, WorkerConnector> entry :... | 3.26 |
rocketmq-connect_RestHandler_listConnectors_rdh | /**
* list all connectors
*
* @param context
*/
private void listConnectors(Context context) {
try {
Map<String, Map<String, Object>> out = new HashMap<>();
for (String connector : connectController.connectors()) {
Map<String, Object> connectorExpansions = new HashMap<>();
... | 3.26 |
rocketmq-connect_Stat_type_rdh | /**
* type
*
* @return */
default String type() {
return NoneType.none.name();
} | 3.26 |
rocketmq-connect_JsonSchemaConverterConfig_decimalFormat_rdh | /**
* decimal format
*
* @return */
public DecimalFormat decimalFormat() {
return props.containsKey(DECIMAL_FORMAT_CONFIG) ? DecimalFormat.valueOf(props.get(DECIMAL_FORMAT_CONFIG).toString().toUpperCase(Locale.ROOT)) : DECIMAL_FORMAT_DEFAULT;
} | 3.26 |
rocketmq-connect_RedisSourceConnector_validate_rdh | /**
* Should invoke before start the connector.
*
* @param config
* @return error message
*/
@Override
public void validate(KeyValue config) {
this.redisConfig.load(config);
} | 3.26 |
rocketmq-connect_StandaloneConnectStartup_createConnectController_rdh | /**
* Read configs from command line and create connect controller.
*
* @param args
* @return */
private static StandaloneConnectController createConnectController(String[] args) {
try {
// Build the command line options.
Options options = ServerUtil.buildCommandlineOptions(new Options());
commandLine ... | 3.26 |
rocketmq-connect_KafkaSinkAdaptorConnector_start_rdh | /**
* Start the component
*
* @param config
* component context
*/
@Override
public void start(KeyValue config) {
super.start(config);
sinkConnector.validate(taskConfig);
sinkConnector.initialize(new KafkaConnectorContext(connectorContext));
sinkConnector.start(taskConfig);
} | 3.26 |
rocketmq-connect_DebeziumOracleConnector_taskClass_rdh | /**
* Return the current connector class
*
* @return task implement class
*/
@Override
public Class<? extends Task> taskClass() {
return DebeziumOracleSource.class;
} | 3.26 |
rocketmq-connect_DebeziumOracleConnector_getConnectorClass_rdh | /**
* get connector class
*/@Override
public String getConnectorClass() {
return DEFAULT_CONNECTOR;
} | 3.26 |
rocketmq-connect_SetMaximumPrecision_m0_rdh | /**
* transform key
*/public static class Key extends SetMaximumPrecision<ConnectRecord> {
@Override
public ConnectRecord m0(ConnectRecord r) {
SchemaAndValue v13 = this.process(r, r.getKeySchema(), r.getKey());
ConnectRecord record = new ConnectRecord(r.getPosition().getPartition(), r.getPosition().getOffset... | 3.26 |
rocketmq-connect_LogReporter_report_rdh | /**
* Log error context.
*
* @param context
* the processing context.
*/
@Override
public void report(ProcessingContext context) {
errorMetricsGroup.recordErrorLogged();
log.error(message(context), context.error());
} | 3.26 |
rocketmq-connect_LogReporter_message_rdh | /**
* format error message
*
* @param context
* @return */
String message(ProcessingContext context) {
return String.format("Error encountered in task %s. %s", id.toString(), context.toString(deadLetterQueueConfig.includeRecordDetailsInErrorLog()));
} | 3.26 |
rocketmq-connect_ParsedSchema_validate_rdh | /**
* validate data
*/
default void validate()
{
} | 3.26 |
rocketmq-connect_ParsedSchema_deepEquals_rdh | /**
* deep equals
*
* @param schema
* @return */
default boolean deepEquals(ParsedSchema schema) {
return Objects.equals(rawSchema(), schema.rawSchema());
} | 3.26 |
rocketmq-connect_WorkerConnector_getConnector_rdh | /**
* connector object
*
* @return */
public Connector getConnector() {
return connector;
} | 3.26 |
rocketmq-connect_WorkerConnector_getConnectorName_rdh | /**
* connector name
*
* @return */
public String getConnectorName() {
return connectorName;} | 3.26 |
rocketmq-connect_WorkerConnector_shutdown_rdh | /**
* Stop this connector. This method does not block, it only triggers shutdown. Use
* #{@link #awaitShutdown} to block until completion.
*/
public synchronized void shutdown() {
log.info("Scheduled shutdown for {}",
this);
stopping = true;
notify();
} | 3.26 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.