id
stringlengths
29
30
content
stringlengths
152
2.6k
codereview_new_java_data_8399
* limitations under the License. */ /** - * Reusable implementations of cache primitives */ package org.apache.kafka.common.cache; \ No newline at end of file ```suggestion * Reusable implementations of cache primitives. * <strong>This package is not a supported Kafka API; the implementation may change wi...
codereview_new_java_data_8400
* limitations under the License. */ /** - * Mechanisms for compressing data handled by Kafka */ package org.apache.kafka.common.compress; \ No newline at end of file ```suggestion * Mechanisms for compressing data handled by Kafka. * <strong>This package is not a supported Kafka API; the implementation ma...
codereview_new_java_data_8401
* limitations under the License. */ /** - * Standard mechanisms for defining, parsing, validating, and documenting user-configurable parameters */ package org.apache.kafka.common.config; \ No newline at end of file ```suggestion * Provides common mechanisms for defining, parsing, validating, and documenting...
codereview_new_java_data_8402
* limitations under the License. */ /** - * Pluggable interface and implementations for late-binding in configuration values */ package org.apache.kafka.common.config.provider; \ No newline at end of file ```suggestion * Provides a pluggable interface and some implementations for late-binding in configurati...
codereview_new_java_data_8403
* limitations under the License. */ /** - * Custom non-primitive types of configuration properties */ package org.apache.kafka.common.config.types; \ No newline at end of file ```suggestion * Provides custom non-primitive types of configuration properties. * <strong>This package is not a supported Kafka A...
codereview_new_java_data_8404
* limitations under the License. */ /** - * Errors that are thrown by Kafka Clients */ package org.apache.kafka.common.errors; \ No newline at end of file ```suggestion * Provides common exception classes. ``` * limitations under the License. */ /** + * Provides common exception classes. */ packa...
codereview_new_java_data_8405
* limitations under the License. */ /** - * Provides API for application defined metadata attached to Kafka records. */ package org.apache.kafka.common.header; \ No newline at end of file ```suggestion * Provides API for application-defined metadata attached to Kafka records. ``` * limitations under th...
codereview_new_java_data_8406
* limitations under the License. */ /** - * Provides mechanism for sending to and receiving data from remote machines. * <strong>This package is not a supported Kafka API; the implementation may change without warning between minor or patch releases.</strong> */ package org.apache.kafka.common.network; \ No ...
codereview_new_java_data_8407
* limitations under the License. */ /** - * Provide classes representing a single record in a Kafka topic and/or partition. * <strong>This package is not a supported Kafka API; the implementation may change without warning between minor or patch releases.</strong> */ package org.apache.kafka.common.record; \...
codereview_new_java_data_8408
* limitations under the License. */ /** - * Provides pluggable interface for implementing Kafka authentication mechanisms. */ package org.apache.kafka.common.security.auth; \ No newline at end of file ```suggestion * Provides pluggable interfaces for implementing Kafka authentication mechanisms. ``` * ...
codereview_new_java_data_8409
* limitations under the License. */ /** - * Provides adaptor for using OAuth Bearer Token Authentication for securing Kafka clusters. */ package org.apache.kafka.common.security.oauthbearer; \ No newline at end of file ```suggestion * Provides a {@code LoginModule} for using OAuth Bearer Token authenticatio...
codereview_new_java_data_8410
* limitations under the License. */ /** - * Provides pluggable interface for authorization policies. */ package org.apache.kafka.server.policy; \ No newline at end of file ```suggestion * Provides pluggable interfaces for expressing policies on topics and configs. ``` * limitations under the License. ...
codereview_new_java_data_8411
void createPartitions(CreatePartitionsTopic topic, isrs.add(isr); } } else { - partitionAssignments = clusterControl.replicaPlacer().place(new PlacementSpec( - startPartitionId, - additional, - replicationFactor - ...
codereview_new_java_data_8412
void createPartitions(CreatePartitionsTopic topic, isrs.add(isr); } } else { - partitionAssignments = clusterControl.replicaPlacer().place(new PlacementSpec( - startPartitionId, - additional, - replicationFactor - ...
codereview_new_java_data_8413
public TopicAssignment place( for (int partition = 0; partition < placement.numPartitions(); partition++) { placements.add(rackList.place(placement.numReplicas())); } - return new TopicAssignment(placements.stream().map(x -> new PartitionAssignment(x)).collect(Collectors.toList())...
codereview_new_java_data_8418
public void tick() { } else if (now >= next.at) { requests.pollFirst(); } else { - scheduledTick = Math.min(scheduledTick, next.at); break; } We will only reach this line if `scheduledTick` is `Long.MAX_VALUE`: ```suggestion ...
codereview_new_java_data_8419
import org.apache.kafka.clients.consumer.ConsumerConfig; import org.apache.kafka.common.utils.ExponentialBackoff; -// Visible for testing class RequestState { final static int RECONNECT_BACKOFF_EXP_BASE = 2; final static double RECONNECT_BACKOFF_JITTER = 0.2; We can get rid of these comments. A general...
codereview_new_java_data_8420
public FindCoordinatorResponse(FindCoordinatorResponseData data) { this.data = data; } - public Optional<Coordinator> getCoordinatorByKey(String key) { Objects.requireNonNull(key); if (this.data.coordinators().isEmpty()) { // version <= 3 nit: usually we drop `get` fr...
codereview_new_java_data_8421
public String toString() { return type + " ApplicationEvent"; } public enum Type { - NOOP, - COMMIT, } } Perhaps we can leave this for a follow-up since we are not implementing the COMMIT type here. public String toString() { return type + " ApplicationEvent"; } ...
codereview_new_java_data_8422
*/ package org.apache.kafka.migration; public class ZkControllerState { public static final ZkControllerState EMPTY = new ZkControllerState(-1, -1, -1); Can you add a comment explaining this state as well? */ package org.apache.kafka.migration; +/** + * The ZooKeeper state of the KRaft controller ...
codereview_new_java_data_8424
public LeaveGroupResponse(LeaveGroupResponseData data, short version) { " can only contain one member, got " + data.members().size() + " members."); } - this.data = new LeaveGroupResponseData() - .setErrorCode(getError(Errors.forCode(data.errorCode()), data...
codereview_new_java_data_8433
public Connect startConnect(Map<String, String> workerProps) { // herder is stopped. This is easier than having to track and own the lifecycle ourselves. DistributedHerder herder = new DistributedHerder(config, time, worker, kafkaClusterId, statusBackingStore, configBackingStore, - ...
codereview_new_java_data_8434
public class DistributedHerderTest { public void setUp() throws Exception { time = new MockTime(); metrics = new MockConnectMetrics(time); - restClient = PowerMock.createMock(RestClient.class); worker = PowerMock.createMock(Worker.class); EasyMock.expect(worker.isSinkCon...
codereview_new_java_data_8435
ConfigInfos validateConnectorConfig(Map<String, String> connectorProps, boolean throw new BadRequestException("Connector config " + connectorProps + " contains no connector type"); Connector connector = getConnector(connType); - org.apache.kafka.connect.health.ConnectorType connectorType...
codereview_new_java_data_8436
private void handleProduceResponse(ClientResponse response, Map<TopicPartition, RequestHeader requestHeader = response.requestHeader(); int correlationId = requestHeader.correlationId(); if (response.wasTimedOut()) { - log.trace("Cancelled request with header {} due to node {} bei...
codereview_new_java_data_8437
public void handle(SyncGroupResponse syncResponse, } /** - * Discover the current coordinator for the group. Sends a GroupMetadata request to * one of the brokers. The returned future should be polled to get the result of the request. * @return A request future which indicates the completio...
codereview_new_java_data_8438
private <VR, KO, VO> KTable<K, VR> doJoinOnForeignKey(final KTable<KO, VO> forei Objects.requireNonNull(tableJoined, "tableJoined can't be null"); Objects.requireNonNull(materialized, "materialized can't be null"); - //Old values are a useful optimization. The old values from the foreignKe...
codereview_new_java_data_8439
protected void stopServices() { // Timeout for herderExecutor to gracefully terminate is set to a value to accommodate // reading to the end of the config topic + successfully attempting to stop all connectors and tasks and a buffer of 10s - private long getHerderExecutorTimeoutMs() { return th...
codereview_new_java_data_8440
protected void stopServices() { // reading to the end of the config topic + successfully attempting to stop all connectors and tasks and a buffer of 10s private long herderExecutorTimeoutMs() { return this.workerSyncTimeoutMs + - config.getInt(DistributedConfig.WORKER_SYNC_TIMEOUT_MS_...
codereview_new_java_data_8442
public Future<Void> set(final Map<ByteBuffer, ByteBuffer> values, final Callback return producerCallback; } - protected final Callback<ConsumerRecord<byte[], byte[]>> consumedCallback = new Callback<ConsumerRecord<byte[], byte[]>>() { - @Override - public void onCompletion(Throwable er...
codereview_new_java_data_8443
private enum SourceSink { @Before public void setup() { worker = PowerMock.createMock(Worker.class); - String[] methodNames = new String[]{"connectorType"/*, "validateConnectorConfig"*/, "buildRestartPlan", "recordRestarting"}; herder = PowerMock.createPartialMock(StandaloneHerder.cl...
codereview_new_java_data_8452
public void commitSync(final Duration timeout) { * @return The set of topics currently subscribed to */ public Set<String> subscription() { - return Collections.unmodifiableSet(new HashSet<>(this.subscriptions.subscription())); } /** Why create a new, intermediate `HashSet` instead...
codereview_new_java_data_8453
public void commitSync(final Duration timeout) { * @return The set of topics currently subscribed to */ public Set<String> subscription() { - return Collections.unmodifiableSet(new HashSet<>(this.subscriptions.subscription())); } /** ```suggestion Set<String> subscription() { ...
codereview_new_java_data_8454
public void testRefreshTopicPartitionsTopicOnTargetFirst() throws Exception { } @Test - public void testIsCycleWithNullUpstreamTopic() throws Exception { class BadReplicationPolicy extends DefaultReplicationPolicy { @Override public String upstreamTopic(String topic) {...
codereview_new_java_data_8455
public void shouldNotTransitToStandbyAgainAfterStandbyTaskFailed() throws Except mkEntry(task1.id(), task1), mkEntry(task2.id(), task2) ); - final TaskCorruptedException taskCorruptedException = - new TaskCorruptedException(mkSet(task1.id())); - f...
codereview_new_java_data_8456
default void beginShutdown() {} * Returns the snapshot id of the latest snapshot, if it exists. If a snapshot doesn't exists, returns an * {@link Optional#empty()}. * - * @return the snapshot of the latest snaphost, if it exists */ Optional<OffsetAndEpoch> latestSnapshotId(); } %s/th...
codereview_new_java_data_8459
private void handleTaskMigrated(final TaskMigratedException e) { subscribeConsumer(); } - public long getCacheSize() { - return cacheResizeSize.get(); - } - private void subscribeConsumer() { if (topologyMetadata.usesPatternSubscription()) { mainConsumer.subscrib...
codereview_new_java_data_8460
public BuiltInPartitioner(LogContext logContext, String topic, int stickyBatchSi this.log = logContext.logger(BuiltInPartitioner.class); this.topic = topic; if (stickyBatchSize < 1) { - throw new IllegalArgumentException("stickyBatchSize must at least 1"); } this...
codereview_new_java_data_8461
public RecordAccumulator(LogContext logContext, this.closed = false; this.flushesInProgress = new AtomicInteger(0); this.appendsInProgress = new AtomicInteger(0); - // As per Kafka producer configuration documentation batch.size may be set to 0 to explicitly disable - // batchi...
codereview_new_java_data_8463
public String toString() { "topics=" + topics + (userData == null ? "" : ", userDataSize=" + userData.remaining()) + ", ownedPartitions=" + ownedPartitions + - ", groupInstanceId=" + (groupInstanceId.map(String::toString).orElse("null")) + - ...
codereview_new_java_data_8464
private boolean allSubscriptionsEqual(Set<String> allTopics, // visible for testing MemberData memberDataFromSubscription(Subscription subscription) { - if (!subscription.ownedPartitions().isEmpty() && subscription.generationId().isPresent()) { // In ConsumerProtocolSubscription v2 or h...
codereview_new_java_data_8465
public static String[] enumOptions(Class<? extends Enum<?>> enumClass) { * @return string value of a given timestamp in the format "yyyy-MM-dd HH:mm:ss,SSS" */ public static String toLogDateTimeFormat(long timestamp) { - final DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("y...
codereview_new_java_data_8466
public void shouldUpgradeWithTopologyOptimizationOff() throws Exception { @Test @SuppressWarnings("unchecked") - public void shouldUpgradeWithTopologyOptimizationOn() throws Exception { final StreamsBuilder streamsBuilderOld = new StreamsBuilder(); final KStream<String, String> leftO...
codereview_new_java_data_8467
import java.io.Closeable; /** - * The {@code EventHandler} constructs a thread that runs {@code BackgroundThreadRunnable} to handle network requests - * and responses. */ public interface BackgroundThreadRunnable extends Runnable, Closeable { } Using `{@link EventHander}` is a little nicer when navigating via...
codereview_new_java_data_8468
*/ package org.apache.kafka.clients.consumer.internals.events; /** * The event is NoOp. This is intentionally left here for demonstration purpose. */ public class NoopApplicationEvent extends ApplicationEvent { public final String message; - public NoopApplicationEvent(String message) { - s...
codereview_new_java_data_8469
public class NoopBackgroundEvent extends BackgroundEvent { public final String message; - public NoopBackgroundEvent(String message) { super(EventType.NOOP); this.message = message; } Ditto here, I think we should move it to test package, not main package. public class NoopBackgro...
codereview_new_java_data_8470
public ConsumerRecords<K, V> poll(final Duration timeout) { processEvent(backgroundEvent.get(), timeout); // might trigger callbacks or handle exceptions } } - - maybeSendFetches(); // send new fetches } while (time.timer(timeou...
codereview_new_java_data_8471
public int hashCode() { */ Set<Task> getUpdatingTasks(); - /** - * Gets active tasks that are managed by the state updater. - * - * The state updater manages all active tasks that were added with the {@link StateUpdater#add(Task)} and that have - * not been removed from the state update...
codereview_new_java_data_8472
public class WorkerConfig extends AbstractConfig { public static final String OFFSET_COMMIT_INTERVAL_MS_CONFIG = "offset.flush.interval.ms"; private static final String OFFSET_COMMIT_INTERVAL_MS_DOC - = "Interval at which to try committing offsets for source tasks."; public static final lon...
codereview_new_java_data_8473
public class StandaloneConfig extends WorkerConfig { * <code>offset.storage.file.filename</code> */ public static final String OFFSET_STORAGE_FILE_FILENAME_CONFIG = "offset.storage.file.filename"; - private static final String OFFSET_STORAGE_FILE_FILENAME_DOC = "File to store source task offsets"; ...
codereview_new_java_data_8475
public ApiKeys apiKey() { return apiKey; } public abstract int throttleTimeMs(); - public abstract void setThrottleTimeMs(int throttleTimeMs); public String toString() { return data().toString(); How about `maybeSetThrottleTimeMs` since not all response schemas support it. ...
codereview_new_java_data_8476
public boolean equals(Object o) { } /** - * Return the metadata for the next error response. */ public FetchMetadata nextCloseExisting() { return new FetchMetadata(sessionId, INITIAL_EPOCH); } FYI reviewer Server handles this message at `FetchSession.scala` at https://git...
codereview_new_java_data_8477
public boolean equals(Object o) { } /** - * Return the metadata for the next error response. */ public FetchMetadata nextCloseExisting() { return new FetchMetadata(sessionId, INITIAL_EPOCH); } Checked KIP-227, found nothing about the meaning of `$ID FINAL_EPOCH` in `FetchReq...
codereview_new_java_data_8478
public void testNodeIfOffline() { @Test public void testNodeIfOnlineNonExistentTopicPartition() { - Node node0 = new Node(0, "localhost", 9092); - - MetadataResponse metadataResponse = RequestTestUtils.metadataUpdateWith("dummy", 2, Collections.emptyMap(), Collections.emptyMap(), _tp -> 99, -...
codereview_new_java_data_8479
public void testNodeIfOffline() { @Test public void testNodeIfOnlineNonExistentTopicPartition() { - Node node0 = new Node(0, "localhost", 9092); - - MetadataResponse metadataResponse = RequestTestUtils.metadataUpdateWith("dummy", 2, Collections.emptyMap(), Collections.emptyMap(), _tp -> 99, -...
codereview_new_java_data_8480
public void testNodeIfOffline() { @Test public void testNodeIfOnlineNonExistentTopicPartition() { - Node node0 = new Node(0, "localhost", 9092); - - MetadataResponse metadataResponse = RequestTestUtils.metadataUpdateWith("dummy", 2, Collections.emptyMap(), Collections.emptyMap(), _tp -> 99, -...
codereview_new_java_data_8481
static void createCompactedTopic(String topicName, short partitions, short repli } if (cause instanceof UnsupportedVersionException) { log.debug("Unable to create topic '{}' since the brokers do not support the CreateTopics API." + - " Falling b...
codereview_new_java_data_8482
static void createCompactedTopic(String topicName, short partitions, short repli } if (cause instanceof UnsupportedVersionException) { log.debug("Unable to create topic '{}' since the brokers do not support the CreateTopics API." + - " Falling b...
codereview_new_java_data_8483
import java.util.Set; /** - * ForwardingAdmin is the default value of `forwarding.admin.class` in MM2. - * MM2 users who wish to use customized behaviour Admin; they can extend the ForwardingAdmin and override some behaviours - * without need to provide a whole implementation of Admin. - * The class must have a co...
codereview_new_java_data_8484
import java.util.Set; /** - * ForwardingAdmin is the default value of `forwarding.admin.class` in MM2. - * MM2 users who wish to use customized behaviour Admin; they can extend the ForwardingAdmin and override some behaviours - * without need to provide a whole implementation of Admin. - * The class must have a co...
codereview_new_java_data_8485
public class MirrorClientConfig extends AbstractConfig { DefaultReplicationPolicy.SEPARATOR_DEFAULT; public static final String FORWARDING_ADMIN_CLASS = "forwarding.admin.class"; - public static final String FORWARDING_ADMIN_CLASS_DOC = "Class which extends ForwardingAdmin to define custom cluster r...
codereview_new_java_data_8486
public ForwardingAdmin(Map<String, Object> configs) { @Override public void close(Duration timeout) { - delegate.close(); } @Override Should we pass the timeout to the delegate? public ForwardingAdmin(Map<String, Object> configs) { @Override public void close(Duration time...
codereview_new_java_data_8487
/** * {@code ForwardingAdmin} is the default value of {@code forwarding.admin.class} in MirrorMaker. * Users who wish to customize the MirrorMaker behaviour for the creation of topics and access control lists can extend this - * class without needing to provide a whole implementation of {@code Admin}. * The cl...
codereview_new_java_data_8488
public class MirrorClientConfig extends AbstractConfig { public static final String FORWARDING_ADMIN_CLASS = "forwarding.admin.class"; public static final String FORWARDING_ADMIN_CLASS_DOC = "Class which extends ForwardingAdmin to define custom cluster resource management (topics, configs, etc). " + - ...
codereview_new_java_data_8489
/** Internal utility methods. */ final class MirrorUtils { - private static final Logger log = LoggerFactory.getLogger(MirrorCheckpointTask.class); // utility class private MirrorUtils() {} `MirrorCheckpointTask` -> `MirrorUtils` /** Internal utility methods. */ final class MirrorUtils { + ...
codereview_new_java_data_8490
public void onCompletion(RecordMetadata metadata, Exception exception) { assertEquals(partition1, partition.get()); assertEquals(1, mockRandom.get()); - // Produce large record, we switched to next partition by previous produce, but - // for this produce the switch wou...
codereview_new_java_data_8491
public void testPollRedelivery() throws Exception { assertTaskMetricValue("running-ratio", 1.0); assertTaskMetricValue("batch-size-max", 1.0); assertTaskMetricValue("batch-size-avg", 0.5); - - assertEquals(workerCurrentOffsets, Whitebox.<Map<TopicPartition, OffsetAndMetadata>>getInter...
codereview_new_java_data_8492
* Write an arbitrary set of metadata records into a Kafka metadata log batch format. * * This is similar to the binary format used for metadata snapshot files, but the log epoch - * and initial offset are set to zero. */ public class BatchFileWriter implements AutoCloseable { private final FileChannel ch...
codereview_new_java_data_8493
ClusterAssignment performTaskAssignment( log.debug("Skipping revocations in the current round with a delay of {}ms. Next scheduled rebalance:{}", delay, scheduledRebalance); } else { - log.debug("Revoking assignments as scheduled.reb...
codereview_new_java_data_8494
public int hashCode() { /** * Returns if the state updater restores active tasks. * - * The state updater restores active tasks if at least one active task was added with the {@link StateUpdater#add(Task)} - * and the active task was not removed from the state updater with one of the following...
codereview_new_java_data_8495
public static String RESTART_KEY(String connectorName) { @Deprecated public KafkaConfigBackingStore(Converter converter, DistributedConfig config, WorkerConfigTransformer configTransformer) { - this(converter, config, configTransformer, null, "connect-distributed"); } public KafkaConfigB...
codereview_new_java_data_8496
public class KafkaStatusBackingStore implements StatusBackingStore { @Deprecated public KafkaStatusBackingStore(Time time, Converter converter) { - this(time, converter, null, "connect-distributed"); } public KafkaStatusBackingStore(Time time, Converter converter, Supplier<TopicAdmin> to...
codereview_new_java_data_8499
class MetadataVersionTest { @Test - public void testFeatureLevel() { - int i = 0; - while (i < MetadataVersion.VERSIONS.length && - MetadataVersion.VERSIONS[i].featureLevel() < 0) { - i++; } - int j = 1; - while (i < MetadataVersion.VERSIONS.len...
codereview_new_java_data_8500
private void renounce() { snapshotRegistry.revertToSnapshot(lastCommittedOffset); authorizer.ifPresent(a -> a.loadSnapshot(aclControlManager.idToAcl())); } else { - log.warn("Unable to find last committed offset {} in snapshot registry; resetting " + - ...
codereview_new_java_data_8501
import org.slf4j.Logger; public class LogReplayTracker { public static class Builder { private LogContext logContext = null; Brief javadoc would be nice. Should probably mention this is not thread safe import org.slf4j.Logger; +/** + * The LogReplayTracker manages state associated with repl...
codereview_new_java_data_8502
public boolean hasNext() { public List<ApiMessageAndVersion> next() { // Write the metadata.version first if (!wroteVersion) { - if (!metadataVersion.isLessThan(minimumBootstrapVersion)) { wroteVersion = true; return Collection...
codereview_new_java_data_8503
import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -@RunWith(MockitoJUnitRunner.class) public class RootResourceTest { @Mock private Herder herder; To align this test with others we are currenclt migrating, can you please use `MockitoJUnitRunner.StrictStubs.class` instead of...
codereview_new_java_data_8507
public class KStreamPrintTest { private Processor<Integer, String, Void, Void> printProcessor; @Mock - ProcessorContext<Void, Void> processorContext; @Before public void setUp() { [optional] Can you please double check if we can set `private` access modifier to the `ProcessorContext<Void, V...
codereview_new_java_data_8512
void backoff(int attempt, long deadline) { if (delay > errorMaxDelayInMillis) { delay = ThreadLocalRandom.current().nextLong(errorMaxDelayInMillis); } - if (delay + time.milliseconds() > deadline) { - delay = deadline - time.milliseconds(); } log.debug...
codereview_new_java_data_8514
private void addToResetList(final TopicPartition partition, final Set<TopicParti partitions.add(partition); } /** * Try to commit all active tasks owned by this thread. * Note that adding this public method does not require a KIP because this class is not part of the public API at htt...
codereview_new_java_data_8515
public void shouldRecordStatisticsBasedMetrics() { verify(statisticsToAdd1, times(17)).getAndResetTickerCount(isA(TickerType.class)); verify(statisticsToAdd2, times(17)).getAndResetTickerCount(isA(TickerType.class)); - verify(statisticsToAdd2, times(2)).getHistogramData(isA(HistogramType.cla...
codereview_new_java_data_8516
public static <T> RecordsSnapshotReader<T> of( RawSnapshotReader snapshot, RecordSerde<T> serde, BufferSupplier bufferSupplier, - int maxBatchSize ) { return new RecordsSnapshotReader<>( snapshot.snapshotId(), - new RecordsIterator<>(snapshot.reco...
codereview_new_java_data_8518
*/ public class FileStreamSinkConnector extends SinkConnector { - static final String FILE_CONFIG = "file"; static final ConfigDef CONFIG_DEF = new ConfigDef() .define(FILE_CONFIG, Type.STRING, null, Importance.HIGH, "Destination filename. If not specified, the standard output will be used"); ...
codereview_new_java_data_8519
public void testTaskClass() { @Test public void testConnectorConfigsPropagateToTaskConfigs() { sinkProperties.put("transforms", "insert"); connector.start(sinkProperties); List<Map<String, String>> taskConfigs = connector.taskConfigs(1); Might be worth adding a comment here (and...
codereview_new_java_data_8520
public class FileStreamSourceConnector extends SourceConnector { .define(FILE_CONFIG, Type.STRING, null, Importance.HIGH, "Source filename. If not specified, the standard input will be used") .define(TOPIC_CONFIG, Type.STRING, ConfigDef.NO_DEFAULT_VALUE, new ConfigDef.NonEmptyString(), Importance.HIG...
codereview_new_java_data_8521
/** - * A metadata fault. */ public class MetadataFaultException extends RuntimeException { public MetadataFaultException(String message, Throwable cause) { Can we elaborate on when it's expected to use this exception? Is it just when applying records? /** + * A fault that we encountered while we ...
codereview_new_java_data_8522
void syncGroupOffset(String consumerGroupId, Map<TopicPartition, OffsetAndMetada } else { log.error("Unable to sync offsets for consumer group {}.", consumerGroupId, throwable); } } }); - log.trace("sync-ed the ...
codereview_new_java_data_8523
protected void finalOffsetCommit(boolean failed) { log.debug("Skipping final offset commit as task has failed"); return; } else if (isCancelled()) { - log.debug("Skipping final offset commit as task has been cancelled and its producer has already been closed"); ...
codereview_new_java_data_8527
public CompletableFuture<List<CreatePartitionsTopicResult>> createPartitions( }); } - // TODO: Figure out the reason as to why is a snapshot starting here? Who is calling beginWritingSnapshot()? @Override public CompletableFuture<Long> beginWritingSnapshot() { CompletableFuture<Lo...
codereview_new_java_data_8531
import static org.apache.kafka.streams.integration.utils.IntegrationTestUtils.waitForEmptyConsumerGroup; @Category({IntegrationTest.class}) -public class KafkaStreamsCloseOptionsIntegrationTest { @Rule public Timeout globalTimeout = Timeout.seconds(600); @Rule I'm not wild about this IT as written....
codereview_new_java_data_8532
public void testCloseOptions() throws Exception { IntegrationTestUtils.startApplicationAndWaitUntilRunning(singletonList(streams), Duration.ofSeconds(2)); IntegrationTestUtils.waitUntilMinKeyValueRecordsReceived(resultConsumerConfig, OUTPUT_TOPIC, 10); - streams.close(new CloseOptions().leav...
codereview_new_java_data_8533
public synchronized boolean close(final Duration timeout) throws IllegalArgument * @throws IllegalArgumentException if {@code timeout} can't be represented as {@code long milliseconds} */ public synchronized boolean close(final CloseOptions options) throws IllegalArgumentException { - Objects.r...
codereview_new_java_data_8534
public void testCloseOptions() throws Exception { IntegrationTestUtils.startApplicationAndWaitUntilRunning(singletonList(streams), Duration.ofSeconds(2)); IntegrationTestUtils.waitUntilMinKeyValueRecordsReceived(resultConsumerConfig, OUTPUT_TOPIC, 10); - streams.close(new CloseOptions().leav...
codereview_new_java_data_8535
public void testCloseOptions() throws Exception { // RUN streams = new KafkaStreams(setupTopologyWithoutIntermediateUserTopic(), streamsConfig); - IntegrationTestUtils.startApplicationAndWaitUntilRunning(singletonList(streams), Duration.ofSeconds(2)); IntegrationTestUtils.waitUntilM...
codereview_new_java_data_8536
public void testCloseOptions() throws Exception { // RUN streams = new KafkaStreams(setupTopologyWithoutIntermediateUserTopic(), streamsConfig); - IntegrationTestUtils.startApplicationAndWaitUntilRunning(singletonList(streams), Duration.ofSeconds(2)); IntegrationTestUtils.waitUntilM...
codereview_new_java_data_8538
public Set<Characteristics> characteristics() { } @SafeVarargs - public static <E> Set<E> union(final Supplier<Set<E>> constructor, final Collection<E>... set) { final Set<E> result = constructor.get(); - for (final Collection<E> s : set) { result.addAll(s); } ...
codereview_new_java_data_8539
public static void validateGroupInstanceId(String id) { /** * Ensures that the provided {@code reason} remains within a range of 255 chars. * @param reason This is the reason that is sent to the broker over the wire - * as a part of {@code JoinGroupRequest}, {@code LeaveGroupRequest}...
codereview_new_java_data_8540
public static TaskAndAction createPauseTask(final TaskId taskId) { } public static TaskAndAction createResumeTask(final TaskId taskId) { - Objects.requireNonNull(taskId, "Task ID of task to pause is null!"); return new TaskAndAction(null, taskId, Action.RESUME); } Could you please a...
codereview_new_java_data_8541
public TopologyConfig(final String topologyName, final StreamsConfig globalAppCo if (isTopologyOverride(MAX_TASK_IDLE_MS_CONFIG, topologyOverrides)) { maxTaskIdleMs = getLong(MAX_TASK_IDLE_MS_CONFIG); - log.info("Topology {} is overridding {} to {}", topologyName, MAX_TASK_IDLE_MS_CO...
codereview_new_java_data_8543
void runOnce() { log.info("Buffered records size {} bytes falls below {}. Resuming all the paused partitions {} in the consumer", bufferSize, maxBufferSizeBytes.get(), pausedPartitions); mainConsumer.resume(pausedPartitions); ...