name stringlengths 12 178 | code_snippet stringlengths 8 36.5k | score float64 3.26 3.68 |
|---|---|---|
zilla_ManyToOneRingBuffer_producerPosition_rdh | /**
* {@inheritDoc }
*/
public long producerPosition() {
return buffer.getLongVolatile(tailPositionIndex);
} | 3.26 |
zilla_ManyToOneRingBuffer_consumerPosition_rdh | /**
* {@inheritDoc }
*/
public long consumerPosition() {
return buffer.getLongVolatile(headPositionIndex);
} | 3.26 |
zilla_ManyToOneRingBuffer_consumerHeartbeatTime_rdh | /**
* {@inheritDoc }
*/
public long consumerHeartbeatTime() {
return buffer.getLongVolatile(consumerHeartbeatIndex);
} | 3.26 |
zilla_ManyToOneRingBuffer_write_rdh | /**
* {@inheritDoc }
*/
public boolean write(final int msgTypeId, final DirectBuffer srcBuffer, final int srcIndex, final int length) {
checkTypeId(msgTypeId);
checkMsgLength(length);
boolean isSuccessful = false;
final AtomicBuffer buffer = this.buffer;
final int recordLength = length + HEADER_... | 3.26 |
zilla_ManyToOneRingBuffer_maxMsgLength_rdh | /**
* {@inheritDoc }
*/
public int maxMsgLength() {
return maxMsgLength;
} | 3.26 |
zilla_ManyToOneRingBuffer_tryClaim_rdh | /**
* {@inheritDoc }
*/
public int tryClaim(final int msgTypeId, final int length) {checkTypeId(msgTypeId);
checkMsgLength(length);
final AtomicBuffer buffer = this.buffer;
final int recordLength = length + HEADER_LENGTH;
final int recordIndex = claimCapacity(buffer, recordLength);
... | 3.26 |
zilla_ManyToOneRingBuffer_buffer_rdh | /**
* {@inheritDoc }
*/
public AtomicBuffer buffer() {
return buffer;} | 3.26 |
zilla_WsClientFactory_assembleHeader_rdh | // @return no bytes consumed to assemble websocket header
private int assembleHeader(DirectBuffer buffer,
int offset, int length) {
int remaining = Math.min(length, MAXIMUM_HEADER_SIZE - headerLength);
// may copy more than actual header length (up to max header length), but will adjust at the end
header.putBytes(head... | 3.26 |
rocketmq-connect_WorkerSinkTask_pauseAll_rdh | // pause all consumer topic queue
private void pauseAll() {
consumer.pause(f1);
} | 3.26 |
rocketmq-connect_WorkerSinkTask_consumeFromOffset_rdh | /**
* consume fro offset
*
* @param messageQueue
* @param taskConfig
*/
public long consumeFromOffset(MessageQueue messageQueue, ConnectKeyValue taskConfig) {
// -1 when started
long offset = consumer.getOffsetStore().readOffset(messageQueue, ReadOffsetType.READ_FROM_MEMORY);
if (0 > offset) {
// query from broker... | 3.26 |
rocketmq-connect_WorkerSinkTask_errorRecordReporter_rdh | /**
* error record reporter
*
* @return */
public WorkerErrorRecordReporter errorRecordReporter() {
return errorRecordReporter;
} | 3.26 |
rocketmq-connect_WorkerSinkTask_execute_rdh | /**
* execute poll and send record
*/
@Override
protected void execute() {
while
(isRunning()) {
try {
long startTimeStamp = System.currentTimeMillis();
log.info("START pullMessageFromQueues, time started : {}", startTimeStamp);
if (f1.size() == 0) {
log.info("messageQueuesOffsetMap is null, : {}", startTimeStamp... | 3.26 |
rocketmq-connect_WorkerSinkTask_initializeAndStart_rdh | /**
* initinalize and start
*/
@Override
protected void initializeAndStart() {
Set<String> topics = new SinkConnectorConfig(taskConfig).parseTopicList();
if (collections4.CollectionUtils.isEmpty(topics)) {
throw new ConnectException("Sink connector topics config can be null, please check sink connector config info... | 3.26 |
rocketmq-connect_WorkerSinkTask_pollConsumer_rdh | /**
* poll consumer
*
* @param timeoutMs
* @return */
private List<MessageExt> pollConsumer(long
timeoutMs) {List<MessageExt> msgs = consumer.poll(timeoutMs);
// metrics
recordReadSuccess(msgs.size());
return msgs;
} | 3.26 |
rocketmq-connect_WorkerSinkTask_m0_rdh | /**
* do commit
*
* @param offsets
* @param seqno
*/
private void m0(Map<MessageQueue, Long> offsets, int seqno) {
log.debug("{} Committing offsets synchronously using sequence number {}: {}", this, seqno, offsets);
try {
for (Map.Entry<MessageQueue, Long> offsetEntry : offsets.entrySet()) {
consumer.g... | 3.26 |
rocketmq-connect_WorkerSinkTask_resumeAll_rdh | // resume all consumer topic queue
private void resumeAll() {
for (MessageQueue queue : f1) {
if (!sinkTaskContext.getPausedQueues().contains(queue)) {
consumer.resume(singleton(queue));
}
}} | 3.26 |
rocketmq-connect_WorkerSinkTask_commitOffsets_rdh | /**
* commit offset
*
* @param now
* @param closing
*/
private void commitOffsets(long now, boolean closing) {
commitOffsets(now, closing, f1);
} | 3.26 |
rocketmq-connect_WorkerSinkTask_compareAndCommit_rdh | /**
* compare and commit
*
* @param offsetsToCommit
* @param lastCommittedQueuesOffsets
* @param taskProvidedOffsets
*/
private void compareAndCommit(Map<MessageQueue, Long> offsetsToCommit, Map<MessageQueue, Long> lastCommittedQueuesOffsets, Map<MessageQueue, Long> taskProvidedOffsets) {
// Get all assign topic... | 3.26 |
rocketmq-connect_WorkerSinkTask_preCommit_rdh | /**
* reset offset by custom
*/
private void preCommit() {
Map<MessageQueue, Long>
offsets = sinkTaskContext.queuesOffsets();if (offsets.isEmpty()) {return;
}
for (Map.Entry<MessageQueue, Long> entry : offsets.entrySet()) {
MessageQueue queue = entry.getKey();
Long offset = entry.getValue();
if (offset != null) {l... | 3.26 |
rocketmq-connect_WorkerSinkTask_closeMessageQueues_rdh | /**
* remove offset from currentOffsets/lastCommittedOffsets
* remove message from messageBatch
*
* @param queues
* @param lost
*/
private void closeMessageQueues(Set<MessageQueue> queues, boolean lost) {
if (!lost) {
commitOffsets(System.currentTimeMillis(),
true, queues);
} else {
log.trace("{} Closing the ta... | 3.26 |
rocketmq-connect_WorkerSinkTask_onCommitCompleted_rdh | /**
* commit
*
* @param error
* @param seqno
* @param committedOffsets
*/
private void onCommitCompleted(Throwable error, long seqno, Map<MessageQueue, Long> committedOffsets) {
if (commitSeqno
!= seqno) {
// skip this commit
sinkTaskMetricsGroup.recordOffsetCommitSkip();
return;
}
if (error != null) {
log.err... | 3.26 |
rocketmq-connect_WorkerSinkTask_m1_rdh | /**
* receive message from MQ.
*
* @param messages
*/
private void m1(List<MessageExt> messages) {
if (messageBatch.isEmpty()) {originalOffsets.clear();
}
for (MessageExt
message : messages) {
this.retryWithToleranceOperator.consumerRecord(message); ConnectRecord connectRecord = convertMessages(message);
originalOf... | 3.26 |
rocketmq-connect_WorkerSinkTask_removeAndCloseMessageQueue_rdh | /**
* remove and close message queue
*
* @param queues
*/
public void removeAndCloseMessageQueue(String
topic, Set<MessageQueue> queues) {
Set<MessageQueue> removeMessageQueues;
if (queues == null) {
removeMessageQueues = new HashSet<>();
for (MessageQueue messageQueue : f1) {
if (messageQueue.getTopic().equa... | 3.26 |
rocketmq-connect_JdbcSourceConnector_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(("Conne... | 3.26 |
rocketmq-connect_JdbcSourceConnector_start_rdh | /**
* Start the component
*
* @param config
* component context
*/@Override
public void
start(KeyValue config) {
originalConfig = config;
} | 3.26 |
rocketmq-connect_JdbcSourceConnector_validate_rdh | /**
* Should invoke before start the connector.
*
* @param config
* @return error message
*/
@Override
public void validate(KeyValue config) {
jdbcSourceConfig = new JdbcSourceConfig(config);
// validate config
} | 3.26 |
rocketmq-connect_ClusterManagementService_configure_rdh | /**
* Configure class with the given key-value pairs
*
* @param config
* can be DistributedConfig or StandaloneConfig
*/
default void configure(WorkerConfig config) {
} | 3.26 |
rocketmq-connect_PositionStorageWriter_beginFlush_rdh | /**
* begin flush offset
*
* @return */
public synchronized boolean beginFlush() {
if (isFlushing()) {
throw new ConnectException("PositionStorageWriter is already flushing");}
if (data.isEmpty()) {
return false;
}
this.toFlush = this.data;
this.data = new HashMap<>();
retur... | 3.26 |
rocketmq-connect_PositionStorageWriter_call_rdh | /**
* Computes a result, or throws an exception if unable to do so.
*
* @return computed result
* @throws Exception
* if unable to compute a result
*/
@Override
public Void call() {
try {
// has been canceled
if (flushId != currentFlushId) {
return null;
}
positio... | 3.26 |
rocketmq-connect_PositionStorageWriter_writeOffset_rdh | /**
* write offsets
*
* @param positions
* positions
*/
@Override
public void writeOffset(Map<RecordPartition, RecordOffset> positions) {
for (Map.Entry<RecordPartition, RecordOffset> offset : positions.entrySet()) {
writeOffset(offset.getKey(), offset.getValue());
}
} | 3.26 |
rocketmq-connect_PositionStorageWriter_close_rdh | /**
* Closes this stream and releases any system resources associated
* with it. If the stream is already closed then invoking this
* method has no effect.
*
* @throws IOException
* if an I/O error occurs
*/
@Override
public void close() throws IOException {if (executorService != null) {
executorServ... | 3.26 |
rocketmq-connect_IdentifierRules_trailingQuoteString_rdh | /**
* Get the string used as a trailing quote.
*
* @return the trailing quote string; never null
*/
public String trailingQuoteString() {
return trailingQuoteString;
} | 3.26 |
rocketmq-connect_IdentifierRules_leadingQuoteString_rdh | /**
* Get the string used as a leading quote.
*
* @return the leading quote string; never null
*/
public String leadingQuoteString() {
return leadingQuoteString;
} | 3.26 |
rocketmq-connect_IdentifierRules_identifierDelimiter_rdh | /**
* Get the delimiter that is used to delineate segments within fully-qualified identifiers.
*
* @return the identifier delimiter; never null
*/
public String identifierDelimiter() {
return identifierDelimiter;
} | 3.26 |
rocketmq-connect_ColumnDefinition_scale_rdh | /**
* Gets the column's number of digits to right of the decimal point. 0 is returned for data types
* where the scale is not applicable.
*
* @return scale
*/
public int scale() {
return scale;} | 3.26 |
rocketmq-connect_ColumnDefinition_displaySize_rdh | /**
* Indicates the column's normal maximum width in characters.
*
* @return the normal maximum number of characters allowed as the width of the designated column
*/ public int displaySize() {
return displaySize;
} | 3.26 |
rocketmq-connect_ColumnDefinition_nullability_rdh | /**
* Indicates the nullability of values in the column.
*
* @return the nullability status of the given column; never null
*/
public Nullability nullability() {
return f2;
} | 3.26 |
rocketmq-connect_ColumnDefinition_isCurrency_rdh | /**
* Indicates whether the column is a cash value.
*
* @return <code>true</code> if so; <code>false</code> otherwise
*/
public boolean isCurrency() {
return currency;
} | 3.26 |
rocketmq-connect_ColumnDefinition_mutability_rdh | /**
* Indicates whether the designated column is mutable.
*
* @return the mutability; never null
*/
public Mutability mutability() {
return mutability;
}
/**
* Returns the fully-qualified name of the Java class whose instances are manufactured if the
* method {@link java.sql.ResultSet#getObject(int)} is call... | 3.26 |
rocketmq-connect_ColumnDefinition_isOptional_rdh | /**
* Indicates whether values in the column are optional. This is equivalent to calling:
* <pre>
* nullability() == Nullability.NULL || nullability() == Nullability.UNKNOWN
* </pre>
*
* @return <code>true</code> if so; <code>false</code> otherwise
*/
public boolean isOptional() {
return (f2 == Nullability... | 3.26 |
rocketmq-connect_ColumnDefinition_id_rdh | /**
* Get the column's identifier.
*
* @return column identifier; never null
*/
public ColumnId id() {
return f1;
} | 3.26 |
rocketmq-connect_ColumnDefinition_isSignedNumber_rdh | /**
* Indicates whether values in the column are signed numbers.
*
* @return <code>true</code> if so; <code>false</code> otherwise
*/
public boolean isSignedNumber() {
return signedNumbers;
} | 3.26 |
rocketmq-connect_ColumnDefinition_m0_rdh | /**
* Indicates whether the column is automatically numbered.
*
* @return <code>true</code> if so; <code>false</code> otherwise
*/
public boolean m0() {
return autoIncremented;
} | 3.26 |
rocketmq-connect_ColumnDefinition_precision_rdh | /**
* Get the column's table identifier.
*
* @return the table identifier; never null
*/
// public TableId tableId() {
// return id.tableId();
// }
/**
* Get the column's specified column size. For numeric data, this is the maximum precision. For
* character data, this is the length in characters. For datetime d... | 3.26 |
rocketmq-connect_ServiceProviderUtil_getConfigManagementService_rdh | /**
* Get config management service by class name
*
* @param configManagementServiceClazz
* @return */
@NotNull
public static ConfigManagementService getConfigManagementService(String configManagementServiceClazz) {
if (StringUtils.isEmpty(configManagementServiceClazz)) {
configManagementServiceClazz =... | 3.26 |
rocketmq-connect_ServiceProviderUtil_getStateManagementService_rdh | /**
* Get state management service by class name
*
* @param stateManagementServiceClazz
* @return */
@NotNull
public static StateManagementService getStateManagementService(String
stateManagementServiceClazz) {
if (StringUtils.isEmpty(stateManagementServiceClazz)) {
stateManagementServiceClazz = LocalStateManageme... | 3.26 |
rocketmq-connect_ServiceProviderUtil_getPositionManagementService_rdh | /**
* Get position management service by class name
*
* @param positionManagementServiceClazz
* @return */
@NotNull
public static PositionManagementService getPositionManagementService(String positionManagementServiceClazz) {
if (StringUtils.isEmpty(positionManagementServiceCla... | 3.26 |
rocketmq-connect_ServiceProviderUtil_getClusterManagementService_rdh | /**
* Get custer management service by class name
*
* @param clusterManagementServiceClazz
* @return */@NotNull
public static ClusterManagementService getClusterManagementService(String clusterManagementServiceClazz) {
if (StringUtils.isEmpty(clusterManagementServiceClazz)) {
... | 3.26 |
rocketmq-connect_JsonSchemaSerializer_serialize_rdh | /**
* serialize
*
* @param topic
* @param isKey
* @param value
* @param schema
* @return */
public byte[] serialize(String topic, boolean isKey, JsonSchema schema, Object value) {
if (value == null) {
return null;
}
String subjectName = TopicNameStrategy.subjectName(topic, isKey);
try {
... | 3.26 |
rocketmq-connect_LocalStateManagementServiceImpl_start_rdh | /**
* Start dependent services (if needed)
*/
@Override
public void start() {
connectorStatusStore.load();
taskStatusStore.load();
dataSynchronizer.start();
startSignal();
} | 3.26 |
rocketmq-connect_LocalStateManagementServiceImpl_prePersist_rdh | /**
* pre persist
*/
private void prePersist() {
Map<String, ConnAndTaskStatus.CacheEntry<ConnectorStatus>> connectors = connAndTaskStatus.getConnectors();
if (connectors.isEmpty()) {
return;
}
connectors.forEach((connectName, connect... | 3.26 |
rocketmq-connect_LocalStateManagementServiceImpl_replicaTargetState_rdh | /**
* sync send online config
*/
@Override
public void replicaTargetState() {
/**
* connector status store
*/
Map<String, ConnectorStatus> connectorStatusMap = connectorStatusStore.getKVMap();
connectorStatusMap.forEach((connectorName, connectorStatus) -> {
if (connectorStatus == null) {... | 3.26 |
rocketmq-connect_LocalStateManagementServiceImpl_initialize_rdh | /**
* initialize cb config
*
* @param config
*/
@Override
public void initialize(WorkerConfig config, RecordConverter converter)
{
super.initialize(config, converter);/**
* connector status store
*/
this.connectorStatusStore = new FileBaseKeyValueStore<>(FilePathConfigUtil.getConnectorStatusConf... | 3.26 |
rocketmq-connect_ExtendKeyValue_getList_rdh | /**
* get list by class
*
* @param s
* @param clazz
* @param <T>
* @return */
public <T> List<T> getList(String s, Class<T> clazz) {
List configs = getList(s);
List<T> castConfigs = new ArrayList<>();
configs.forEach(config -> {
castConfigs.add(clazz.cast(config));
});
return castConfigs;
} | 3.26 |
rocketmq-connect_Deserializer_close_rdh | /**
* Close this deserializer.
* <p>
* This method must be idempotent as it may be called multiple times.
*/
@Override
default void close() {
// intentionally left blank
} | 3.26 |
rocketmq-connect_Deserializer_configure_rdh | /**
* Configure this class.
*
* @param configs
* configs in key/value pairs
*/
default void configure(Map<String, ?> configs) {
// intentionally left blank
} | 3.26 |
rocketmq-connect_Deserializer_deserialize_rdh | /**
* Deserialize a record value from a byte array into a value or object.
*/
default T deserialize(String topic, KeyValue extensions, byte[] data) {
return m0(topic, data);
} | 3.26 |
rocketmq-connect_WorkerErrorRecordReporter_report_rdh | /**
* report record
*
* @param record
* @param error
* @return */
@Override
public void report(ConnectRecord record, Throwable error) {
RecordPartition partition = record.getPosition().getPartition();
String topic = (partition.getPartition().containsKey("topic")) ? String.valueOf(partition.getPartition().... | 3.26 |
rocketmq-connect_RetryWithToleranceOperator_error_rdh | /**
* error
*
* @return */
public Throwable error() {
return this.context.error();
} | 3.26 |
rocketmq-connect_RetryWithToleranceOperator_sourceRecord_rdh | /**
* Set the source record being processed in the connect pipeline.
*
* @param preTransformRecord
* the source record
*/
public void sourceRecord(ConnectRecord preTransformRecord) {
this.context.sourceRecord(preTransformRecord);
} | 3.26 |
rocketmq-connect_RetryWithToleranceOperator_consumerRecord_rdh | /**
* Set the record consumed rocketmq in a sink
*
* @param messageExt
*/
public void consumerRecord(MessageExt messageExt) {
this.context.consumerRecord(messageExt);
} | 3.26 |
rocketmq-connect_RetryWithToleranceOperator_execAndRetry_rdh | /**
* Attempt to execute an operation.
*/
protected <V> V execAndRetry(Operation<V> operation) throws Exception {
int v1 = 0;
long startTime = System.currentTimeMillis();
long deadline = startTime + retryTimeout;
do {
try {
v1++;
return operation.call();
} catch (RetriableException e) {
log.trace("Caught a retriabl... | 3.26 |
rocketmq-connect_RetryWithToleranceOperator_execAndHandleError_rdh | /**
* Execute a given operation multiple times (if needed), and tolerate certain exceptions.
*/
protected <V> V execAndHandleError(Operation<V> operation, Class<? extends Exception> tolerated) {
try {
V result = execAndRetry(operation);
if (context.failed()) {
markAsFailed();
errorMetricsGroup.recordSkipped();
}
ret... | 3.26 |
rocketmq-connect_RetryWithToleranceOperator_execute_rdh | /**
* Execute the recoverable operation. If the operation is already in a failed state, then simply return
* with the existing failure.
*/public <V> V execute(Operation<V> operation, ErrorReporter.Stage stage, Class<?> executingClass) {
context.currentContext(stage, executingClass);
if (context.failed()) {log.debug(... | 3.26 |
rocketmq-connect_RetryWithToleranceOperator_failed_rdh | /**
* failed
*
* @return */
public boolean failed() {
return this.context.failed();
} | 3.26 |
rocketmq-connect_RetryWithToleranceOperator_reporters_rdh | /**
* Set the error reporters for this connector.
*
* @param reporters
* the error reporters (should not be null).
*/
public void reporters(List<ErrorReporter> reporters) {
this.context.reporters(reporters);
} | 3.26 |
rocketmq-connect_ExpressionBuilder_appendTableName_rdh | /**
* Append to this builder's expression the specified Column identifier, possibly surrounded by
* the leading and trailing quotes based upon {@link #setQuoteIdentifiers(QuoteMethod)}.
*
* @param name
* the name to be appended
* @param quote
* the quote method to be used
* @return this builder to enable me... | 3.26 |
rocketmq-connect_ExpressionBuilder_of_rdh | /**
* Append to this list all of the items in the specified {@link Iterable} objects.
*
* @param objects1
* the first collection of objects to be added to the list
* @param objects2
* a second collection of objects to be added to the list
* @return this builder to enable methods to be chained; never null
*/... | 3.26 |
rocketmq-connect_ExpressionBuilder_appendStringQuoted_rdh | /**
* Append to this builder's expression a string surrounded by single quote characters ({@code '}).
* Use {@link #appendIdentifier(String, QuoteMethod)} for identifiers,
* {@link #appendColumnName(String, QuoteMethod)} for column names, or
* {@link #appendTableName(String, QuoteMethod)} for table names.
*
* @pa... | 3.26 |
rocketmq-connect_ExpressionBuilder_m0_rdh | /**
* Get a {@link Transform} that will quote just the column names.
*
* @return the transform; never null
*/
// public static Transform<ColumnId> columnNames() {
// return (builder, input) -> builder.appendColumnName(input.name());
// }
/**
* Get a {@link Transform} that will quote just the column names and appen... | 3.26 |
rocketmq-connect_ExpressionBuilder_escapeQuotesWith_rdh | /**
* Return a new ExpressionBuilder that escapes quotes with the specified prefix.
* This builder remains unaffected.
*
* @param prefix
* the prefix
* @return the new ExpressionBuilder, or this builder if the prefix is null or empty
*/
public ExpressionBuilder escapeQuotesWith(String prefix) {
if ((prefix... | 3.26 |
rocketmq-connect_ExpressionBuilder_appendBinaryLiteral_rdh | /**
* Append to this builder's expression the binary value as a hex string, prefixed and
* suffixed by a single quote character.
*
* @param value
* the value to be appended
* @return this builder to enable methods to be chained; never null
*/
public ExpressionBuilder appendBinaryLiteral(byte[]
value) {
ret... | 3.26 |
rocketmq-connect_ExpressionBuilder_quote_rdh | /**
* Get a {@link Transform} that will surround the inputs with quotes.
*
* @return the transform; never null
*/
public static Transform<String> quote() {
return (builder, input) -> builder.appendColumnName(input);
} | 3.26 |
rocketmq-connect_ExpressionBuilder_appendTo_rdh | /**
* Append this object to the specified builder.
*
* @param builder
* the builder to use; may not be null
* @param useQuotes
* whether quotes should be used for this object
*/
default void appendTo(ExpressionBuilder builder, QuoteMethod useQuotes) {
switch (useQuotes) {
case ALWAYS :appendTo(... | 3.26 |
rocketmq-connect_ExpressionBuilder_appendIdentifierDelimiter_rdh | /**
* Append to this builder's expression the delimiter defined by this builder's
* {@link IdentifierRules}.
*
* @return this builder to enable methods to be chained; never null
*/
public ExpressionBuilder appendIdentifierDelimiter() {
sb.append(rules.identifierDelimiter());
return this;
} | 3.26 |
rocketmq-connect_ExpressionBuilder_appendIdentifier_rdh | /**
* Append to this builder's expression the identifier.
*
* @param name
* the name to be appended
* @param quoted
* true if the name should be quoted, or false otherwise
* @return this builder to enable methods to be chained; never null
*/
public ExpressionBuilder appendIdentifier(String name, QuoteMethod... | 3.26 |
rocketmq-connect_ExpressionBuilder_appendLeadingQuote_rdh | /**
* Always append to this builder's expression the leading quote character(s) defined by this
* builder's {@link IdentifierRules}.
*
* @return this builder to enable methods to be chained; never null
*/
public ExpressionBuilder appendLeadingQuote() {return appendLeadingQuote(QuoteMethod.ALWAYS);
} | 3.26 |
rocketmq-connect_ExpressionBuilder_append_rdh | /**
* Append to this builder's expression the specified object surrounded by quotes. If the object
* is {@link Expressable}, then this builder delegates to the object's
* {@link Expressable#appendTo(ExpressionBuilder, boolean)} method. Otherwise, the string
* representation of the object is appe... | 3.26 |
rocketmq-connect_ExpressionBuilder_appendColumnName_rdh | /**
* Append to this builder's expression the specified Column identifier, possibly surrounded by
* the leading and trailing quotes based upon {@link #setQuoteIdentifiers(QuoteMethod)}.
*
* @param name
* the name to be appended
* @param quote
* whether to quote the column name; may not be null
* @return thi... | 3.26 |
rocketmq-connect_ExpressionBuilder_setQuoteIdentifiers_rdh | /**
* Set when this expression builder should quote identifiers, such as table and column names.
*
* @param method
* the quoting method; may be null if the default method
* ({@link QuoteMethod#ALWAYS always}) should be used
* @return this expression builder; never null
*/
public ExpressionBuilder setQuoteId... | 3.26 |
rocketmq-connect_ExpressionBuilder_appendIdentifierQuoted_rdh | /**
* Append to this builder's expression the specified identifier, surrounded by the leading and
* trailing quotes.
*
* @param name
* the name to be appended
* @return this builder to enable methods to be chained; never null
*/
public ExpressionBuilder appendIdentifierQuoted(String name) {
appendLeadingQu... | 3.26 |
rocketmq-connect_RocketMqDatabaseHistory_recoverRecords_rdh | /**
* Recover records
*
* @param records
*/
@Override
protected void recoverRecords(Consumer<HistoryRecord> records) {
DefaultLitePullConsumer consumer = null;
try {
consumer = RocketMqAdminUtil.initDefaultLitePullConsumer(rocketMqConfig, false);
consumer.start();
// Select message q... | 3.26 |
rocketmq-connect_JsonSerializer_serialize_rdh | /**
* Convert {@code data} into a byte array.
*
* @param topic
* topic associated with data
* @param data
* typed data
* @return serialized bytes
*/
@Override
public byte[] serialize(String
topic, Object data) {
if (Objects.isNull(data)) {return null;
}
try {
return JSON.toJSONString(d... | 3.26 |
rocketmq-connect_PluginUtils_shouldLoadInIsolation_rdh | /**
* Return whether the class with the given name should be loaded in isolation using a plugin
* classloader.
*
* @param name
* the fully qualified name of the class.
* @return true if this class should be loaded in isolation, false otherwise.
*/
public static boolean shouldLoadInIsolation(String name) {
... | 3.26 |
rocketmq-connect_PluginUtils_prunedName_rdh | /**
* Remove the plugin type name at the end of a plugin class name, if such suffix is present.
* This method is meant to be used to extract plugin aliases.
*/
public static String prunedName(PluginWrapper<?> plugin) {
switch (plugin.type()) {
case
SOURCE :
case SINK :case CONNECTOR :
... | 3.26 |
rocketmq-connect_PluginUtils_isAliasUnique_rdh | /**
* Verify whether a given plugin's alias matches another alias in a collection of plugins.
*
* @param alias
* the plugin descriptor to test for alias matching.
* @param plugins
* the collection of plugins to test against.
* @param <U>
* the plugin type.
* @return false if a match was found in the coll... | 3.26 |
rocketmq-connect_PluginUtils_isConcrete_rdh | /**
* Verify the given class corresponds to a concrete class and not to an abstract class or
*/
public static boolean isConcrete(Class<?> klass) {
int mod = klass.getModifiers();return (!Modifier.isAbstract(mod)) && (!Modifier.isInterface(mod));
} | 3.26 |
rocketmq-connect_PluginUtils_simpleName_rdh | /**
* Return the simple class name of a plugin as {@code String}.
*
* @param plugin
* the plugin descriptor.
* @return the plugin's simple class name.
*/
public static String simpleName(PluginWrapper<?> plugin) {
return plugin.pluginClass().getSimpleName();
} | 3.26 |
rocketmq-connect_FilterTransform_start_rdh | /**
* Start the component
*
* @param config
* component context
*/
@Override
public void start(KeyValue config) {
this.keyValue = config;log.info("transform config {}", this.keyValue);
} | 3.26 |
rocketmq-connect_FilterTransform_stop_rdh | /**
* Stop the component.
*/
@Override
public void stop() {
} | 3.26 |
rocketmq-connect_KafkaSourceAdaptorConnector_start_rdh | /**
* Start the component
*
* @param config
* component context
*/
@Override
public void start(KeyValue config) {
super.start(config);
sourceConnector.validate(taskConfig);sourceConnector.initialize(new KafkaConnectorContext(connectorContext));sourceConnector.start(taskConfig);
} | 3.26 |
rocketmq-connect_StringConverter_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_StringConverter_toConnectData_rdh | /**
* Convert a native object to a Rocketmq Connect data object.
*/
@Overridepublic SchemaAndValue toConnectData(String topic, byte[] value) {
try {
return new SchemaAndValue(SchemaBuilder.string().build(), deserializer.deserialize(topic, value));
} catch (Exception
e) {
throw new Conn... | 3.26 |
rocketmq-connect_StringConverter_configure_rdh | /**
* Configure this class.
*
* @param configs
* configs in key/value pairs
*/
@Override
public void configure(Map<String, ?> configs) {
serializer.configure(configs);
deserializer.configure(configs);
} | 3.26 |
rocketmq-connect_ProcessingContext_sourceRecord_rdh | /**
* Set the source record being processed in the connect pipeline.
*
* @param record
* the source record
*/
public void sourceRecord(ConnectRecord
record) {
this.sourceRecord = record;
reset();
} | 3.26 |
rocketmq-connect_ProcessingContext_executingClass_rdh | /**
*
* @param klass
* set the class which is currently executing.
*/
public void executingClass(Class<?> klass) {
this.klass = klass;
} | 3.26 |
rocketmq-connect_ProcessingContext_report_rdh | /**
* report errors
*/
public void report() {if (reporters.size()
== 1) {
reporters.iterator().next().report(this);
}
reporters.stream().forEach(r -> r.report(this));
} | 3.26 |
rocketmq-connect_ProcessingContext_consumerRecord_rdh | /**
*
* @param consumedMessage
* the record
*/
public void consumerRecord(MessageExt consumedMessage) {
this.consumedMessage = consumedMessage;
reset();
} | 3.26 |
rocketmq-connect_ProcessingContext_failed_rdh | /**
*
* @return */
public boolean failed() { return error() != null;
} | 3.26 |
rocketmq-connect_ProcessingContext_stage_rdh | /**
*
* @return the stage in the connector pipeline which is currently executing.
*/
public Stage stage() {
return stage;
} | 3.26 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.