id
stringlengths
29
30
content
stringlengths
152
2.6k
codereview_new_java_data_12105
public void close() throws Exception { } } -class MemeoryMetadataStoreProvider implements MetadataStoreProvider { @Override public String urlScheme() { spelling mistake in class name public void close() throws Exception { } } +class MemoryMetadataStoreProvider implements MetadataStorePro...
codereview_new_java_data_12106
public class WebSocketProxyConfiguration implements PulsarConfiguration { @FieldContext(doc = "Timeout of idling WebSocket session (in milliseconds)") private int webSocketSessionIdleTimeoutMillis = 300000; - @FieldContext(doc = "Interval of time to sending the ping to keep alive") private int webS...
codereview_new_java_data_12107
public CompletableFuture<Optional<Topic>> getTopic(final TopicName topicName, bo CompletableFuture<Optional<Topic>> res = createNonPersistentTopic(name); - CompletableFuture eventFuture = topicEventsDispatcher .notifyOnCompletion(res,...
codereview_new_java_data_12108
private void internalReadFromLedger(ReadHandle ledger, OpReadEntry opReadEntry) if (firstValidEntry == -1L) { firstValidEntry = entryId; } - } - if (firstValidEntry != -1L) { lastValidEntry = entryId...
codereview_new_java_data_12109
public void testMessageRedeliveryWhenTimeoutInListener() throws Exception { BlockingQueue<Message<byte[]>> receivedMsgs = new LinkedBlockingQueue<>(); MessageListener<byte[]> listener = (consumer, msg) -> { try { - // the first msg will wait until timeout ...
codereview_new_java_data_12110
private void handleReleaseEvent(String serviceUnit, ServiceUnitStateData data) { private void handleSplitEvent(String serviceUnit, ServiceUnitStateData data) { if (isTargetBroker(data.broker())) { splitServiceUnit(serviceUnit, data) - .whenComplete((__, e) -> { - ...
codereview_new_java_data_12111
void createNameSpace(String cluster, String publicTenant, NamespaceName ns) thro try { broker.getAdminClient().namespaces().createNamespace(ns.toString()); } catch (Exception e) { - log.warn(e.getMessage()); } } } ```suggestion ...
codereview_new_java_data_12112
public void testCreateSchemaAfterDeletion() throws Exception { Student student = new Student(); student.setName("Tom Jerry"); student.setAge(30); - student.setGpa(6); student.setGpa(10); producer.send(student); Is there any reason to invoke...
codereview_new_java_data_12308
public class ImagesServiceInfoImpl extends ServiceInfoImpl implements ImagesServ @Override public String getType() { - return "ImagesService"; } @Override ```suggestion return "Images"; ``` public class ImagesServiceInfoImpl extends ServiceInfoImpl implements ImagesServ ...
codereview_new_java_data_12309
public String getType() { return simpleName.substring(0, truncate); } else { // this default, while incorrect, has the greatest chance of - // success acorss data directories return getName().toUpperCase(); } } ```suggestion // succ...
codereview_new_java_data_12310
public GeoJSONGetFeatureResponse(GeoServer gs, String format) { /** * Constructor to be used by subclasses. * - * @param outputFormat The well-known name of the format, not <code>null</code> - * @param jsonp <code>true</code> if specified format uses JSONP */ protected GeoJSONGetFea...
codereview_new_java_data_12311
private void setupNetCDFoutSettings(QName name) { private void setupNetCDFoutSettings(QName name, boolean setNoData) { CoverageInfo info = getCatalog().getCoverageByName(getLayerId(name)); - // // Set the Declared SRS - // info.setSRS("EPSG:4326"); - // info.se...
codereview_new_java_data_12312
import org.geoserver.security.filter.GeoServerSecurityFilter; import org.geoserver.security.oauth2.bearer.TokenValidator; public class OpenIdConnectAuthenticationProvider extends GeoServerOAuthAuthenticationProvider { TokenValidator bearerTokenValidator; ```suggestion /** * AuthenticationProvider for O...
codereview_new_java_data_12313
public class OpenIdConnectFilterConfig extends GeoServerOAuth2FilterConfig { String tokenRolesClaim; String responseMode; boolean sendClientSecret = false; - boolean allowBearerTokens = false; /** Supports extraction of roles among the token claims */ public static enum OpenIdRoleSource i...
codereview_new_java_data_12314
static ResourceAccessManager lookupResourceAccessManager() throws Exception { } // should never happen,just in case we have multiple singleton beans // of type DefaultResourceAccessManager - if (manager == null) manager = managers.get(size - 1); CatalogFilterAccessManager l...
codereview_new_java_data_12315
public void disAssociateRoleFromGroup(GeoServerRole role, String groupname) thro roles.remove(role); setModified(true); } - if (helper.group_roleMap.get(groupname) != null && roles != null && roles.size() == 0) { helper.group_roleMap.remove(groupname); } ...
codereview_new_java_data_12389
private static String maybeTransformAbsoluteUri( throw newInvalidPathException(path); } - if (path.equals(newPath) || !isValidHttp2Path(newPath)) { throw newInvalidPathException(path); } minor question) Is it possible to just check `isValidHttp2Path`? I'm think...
codereview_new_java_data_12390
import org.slf4j.LoggerFactory; import com.linecorp.armeria.common.annotation.Nullable; -import com.linecorp.armeria.common.annotation.UnstableApi; import io.netty.handler.codec.dns.DnsRecord; /** * A default implementation of {@link DnsQuestionListener} interface. */ -@UnstableApi final class DefaultDn...
codereview_new_java_data_12391
/** * A default implementation of {@link DnsQueryListener} interface. */ -final class DefaultDnsQueryListener implements DnsQueryListener { - static final DnsQueryListener DEFAULT_INSTANCE = new DefaultDnsQueryListener(); private final Logger logger = LoggerFactory.getLogger(getClass()); nit: We co...
codereview_new_java_data_12392
public String path() { * Returns a wrapped {@link RoutingContext} which holds the specified {@code path}. * It is usually used to find an {@link HttpService} with a prefix-stripped path. * - * @deprecated Use {@link #withPath} instead. */ @Deprecated default RoutingContext overrid...
codereview_new_java_data_12393
static <T> StreamMessage<T> aborted(Throwable cause) { } /** - * Creates a new {@link StreamMessageWriter} that produces the objects to be published - * by {@link StreamMessage}. */ static <T> StreamMessageWriter<T> streaming() { return new DefaultStreamMessage<>(); https://git...
codereview_new_java_data_12394
public ServerBuilder setHeaders( * By default, a {@link RequestId} is generated from a random 64-bit integer. * * @deprecated this method is replaced by - * {@link #requestIdGenerator(Function<? super RoutingContext, ? extends RequestId>)} */ @Deprecated public ServerBuilder reque...
codereview_new_java_data_12395
private volatile boolean callClosed; DeferredListener(ServerCall<I, ?> serverCall, CompletableFuture<ServerCall.Listener<I>> listenerFuture) { - checkState(serverCall instanceof AbstractServerCall, "Cannot use %s with non-Armeria gRPC server", AsyncServerInterceptor.class.getName...
codereview_new_java_data_12396
private volatile boolean callClosed; DeferredListener(ServerCall<I, ?> serverCall, CompletableFuture<ServerCall.Listener<I>> listenerFuture) { - checkState(serverCall instanceof AbstractServerCall, "Cannot use %s with non-Armeria gRPC server", AsyncServerInterceptor.class.getName...
codereview_new_java_data_12397
private static Map<String, Field> buildFields(Descriptor desc, throw new RecursiveTypeException(field.getMessageType()); } - @Nullable - Descriptor typeDesc = - desc.getNestedTypes().stream() - ...
codereview_new_java_data_12398
void error_withMessage(UnitTestServiceBlockingStub blockingClient) throws Except assertThat(grpcStatus).isNotNull(); assertThat(grpcStatus.getCode()).isEqualTo(Code.ABORTED); assertThat(grpcStatus.getDescription()).isEqualTo("aborted call"); - final StatusException ex ...
codereview_new_java_data_12399
private void close(Status status, Metadata metadata) { if (status.isOk()) { req.abort(); } else { - req.abort(status.asRuntimeException(metadata)); } if (upstream != null) { upstream.cancel(); We also need to use `StatusException` here instead o...
codereview_new_java_data_12400
protected HttpData fetchDecoderOutput() { } private void maybeCheckOverflow(@Nullable ByteBuf decoded, ByteBuf newBuf) { - if (maxLength <= 0) { return; } How about also returning if it's `Integer.MAX_VALUE`? protected HttpData fetchDecoderOutput() { } private ...
codereview_new_java_data_12401
static final class ExceptionOverview extends RuntimeException { private static final long serialVersionUID = 3875212506787802066L; - private static final ReentrantLock reentrantLock = new ReentrantLock(); - ExceptionOverview(String message) { super(message); } ...
codereview_new_java_data_12402
import io.netty.util.AttributeMap; /** - * A {@link ConnectionPoolListener} to count the number of connections which has been open and closed. */ public final class CountingConnectionPoolListener implements ConnectionPoolListener { since connections is plural ```suggestion * A {@link ConnectionPoolListe...
codereview_new_java_data_12403
protected final void onConnectionError(ChannelHandlerContext ctx, boolean outbou handlingConnectionError = true; if (Exceptions.isExpected(cause) || isGoAwaySentException(cause, connection())) { - logger.debug("{} HTTP/2 connection error:", ctx.channel(), cause); } else { ...
codereview_new_java_data_12404
public String toString() { if (!isEndOfStream()) { return toString; } - return "{EOS}, " + toString; } } nit: place EOS after `toString`? Users might be less interested in EOS than the actual content. public String toString() { if (!isEndOfStream()) { ...
codereview_new_java_data_12405
import java.lang.annotation.Target; import java.util.concurrent.TimeUnit; import com.linecorp.armeria.server.annotation.DecoratorFactory; /** - * Annotation for request timeout */ @DecoratorFactory(RequestTimeoutDecoratorFunction.class) @Retention(RetentionPolicy.RUNTIME) @Target({ ElementType.TYPE, Eleme...
codereview_new_java_data_12406
public String timeoutSeconds(ServiceRequestContext ctx, HttpRequest req) { AnnotatedServiceTest.validateContextAndRequest(ctx, req); return Long.toString(ctx.requestTimeoutMillis()); } - - @Get("/subscriberIsInitialized") - public String subscriberIsInitialized(ServiceR...
codereview_new_java_data_12407
public void subscribe(Subscriber<? super HttpObject> subscriber, EventExecutor e SubscriptionOption... options) { requireNonNull(subscriber, "subscriber"); requireNonNull(executor, "executor"); - executor.execute(() -> { - subscriber.onSubscribe(NoopSubscr...
codereview_new_java_data_12408
import graphql.GraphQLError; /** - * Error handler which map a GraphQL errors to an {@link HttpResponse}. */ @FunctionalInterface public interface GraphqlErrorsHandler { ```suggestion * A handler that maps GraphQL errors to an {@link HttpResponse}. ``` import graphql.GraphQLError; /** + * A handler t...
codereview_new_java_data_12409
protected void configure(ServerBuilder sb) throws Exception { final File graphqlSchemaFile = new File(getClass().getResource("/test.graphqls").toURI()); - final GraphqlErrorHandler errorsHandler = (ctx, input, result, negotiatedProduceType, cause) -> ...
codereview_new_java_data_12410
public boolean isOpen() { @Override public boolean isEmpty() { return false; } Should it be `true` if `parts` is an `EmptyStreamMessage`? public boolean isOpen() { @Override public boolean isEmpty() { + // This is always false even parts.isEmpty() == true. + // ...
codereview_new_java_data_12411
static HttpJsonTranscodingOptions of() { } /** - * Returns the {@link HttpJsonTranscodingQueryParamNaming}s which is used to match fields in a * {@link Message} with query parameters. */ - Set<HttpJsonTranscodingQueryParamNaming> queryParamNamings(); /** * Return the {@link ...
codereview_new_java_data_12412
private void respond(ChannelHandlerContext ctx, ServiceRequestContext reqCtx, respond(reqCtx, false, resHeaders, resContent, cause).addListener(CLOSE); } -// if (!isReading) { ctx.flush(); -// } } private ChannelFuture respond(ServiceRequestContext reqCtx,...
codereview_new_java_data_12413
void writeAfterAborted() { .peek(x -> { if (x == 13) { streamMessage.abort(); - await().untilAsserted(() -> assertThat(streamMessage.isOpen()).isFalse()); } }) .map(ByteStreamMes...
codereview_new_java_data_12414
void onRemoval(DnsQuestion question, @Nullable List<DnsRecord> records, /** * Invoked when an eviction occurred for the {@link DnsRecord}s. The eviction may occur due to exceeding - * a maximum size or timed expiration. The cause may vary according to the * {@link DnsCacheBuilder#cacheSpec(Strin...
codereview_new_java_data_12415
public static List<AnnotatedServiceElement> find( private static HttpStatus defaultResponseStatus(Method method, Class<?> clazz) { final StatusCode statusCodeAnnotation = AnnotationUtil.findFirst(method, StatusCode.class); if (statusCodeAnnotation != null) { - final int statusCode = s...
codereview_new_java_data_12416
private void cleanup() { } if (!unfinishedRequests.isEmpty()) { - final boolean cancel; - final Exception cause; - if (protocol.isMultiplex()) { - // An HTTP2 request is cancelled by Http2RequestDecoder.onRstStreamRead() - cancel = fals...
codereview_new_java_data_12417
abstract class AggregationSupport { * Aggregates an {@link HttpMessage} into an {@link AggregatedHttpMessage} using * the specified {@link AggregationOptions}. * - * <p>Note that this method is added for internal usage. Therefore, <strong>must not</strong> override or * call this method if ...
codereview_new_java_data_12418
import io.netty.util.concurrent.EventExecutor; -final class FuseableStreamMessage<T, U> extends AbstractStreamMessage<U> { static <T> FuseableStreamMessage<T, T> of(StreamMessage<? extends T> source, Predicate<? super T> predicate) { Question) I guess there i...
codereview_new_java_data_12419
default HttpRequest withHeaders(RequestHeadersBuilder newHeadersBuilder) { /** * Aggregates this request with the specified {@link AggregationOptions}. The returned * {@link CompletableFuture} will be notified when the content and the trailers of the request are - * received fully. * <pre>{@...
codereview_new_java_data_12420
static void deframeAndRespond(ServiceRequestContext ctx, } final MediaType grpcMediaType = grpcResponse.contentType(); - requireNonNull(grpcMediaType); final ResponseHeadersBuilder unframedHeaders = grpcResponse.headers().toBuilder(); unframedHeaders.set(GrpcHeaderNames.GRP...
codereview_new_java_data_12421
void shouldClosePooledObjectsForNonOK() { void shouldClosePooledObjectsForMissingGrpcStatus() { final CompletableFuture<HttpResponse> res = new CompletableFuture<>(); final ByteBuf byteBuf = Unpooled.buffer(); - final ResponseHeaders responseHeaders = ResponseHeaders.builder(HttpStatus.OK...
codereview_new_java_data_12422
void protobufStreamResponse(String path) { final AggregatedHttpResponse response = client.get(path).aggregate().join(); assertThat(response.status()).isEqualTo(HttpStatus.INTERNAL_SERVER_ERROR); assertThat(cause).isInstanceOf(IllegalStateException.class) - .hasMessage...
codereview_new_java_data_12423
/** * A {@link ResponseConverterFunction} provider interface which provides a - * {@link ResponseConverterFunction} for converting an object of the given type. */ @UnstableApi @FunctionalInterface How about ```suggestion * A {@link ResponseConverterFunction} provider interface which provides a * {@link ...
codereview_new_java_data_12424
package com.linecorp.armeria.server.annotation; /** * Supported markup types in {@link Description}. */ public enum Markup { NONE, MARKDOWN, Let's add `@UnstableApi`. package com.linecorp.armeria.server.annotation; +import com.linecorp.armeria.common.annotation.UnstableApi; + /** * Sup...
codereview_new_java_data_12425
public interface DocServicePlugin { // TODO(trustin): How do we specify the docstring of a method return value? /** - * Loads the documentation description infos include strings and markup types * that describes services and their methods, enums and their values and * structs/exceptions and...
codereview_new_java_data_12426
public interface NamedTypeInfo { String name(); /** - * Returns the description object. If not available, an null value is returned. */ @JsonProperty @JsonInclude(Include.NON_NULL) ```suggestion * Returns the description information. If not available, a null value is returned. `...
codereview_new_java_data_12427
default StreamMessage<T> recoverAndResume( * // In this case, CompletionException is returned. (can't recover exception) * misMatchRecovered.collect().join(); * }</pre> - * */ @UnstableApi default <E extends Throwable> StreamMessage<T> recoverAndResume(Class<E> causeClass, ...
codereview_new_java_data_12428
public void testNoBrokerAclAuthorizer() throws Exception { when(describeAclsResult.values()).thenReturn(describeAclsFuture); when(sourceAdmin.describeAcls(any())).thenReturn(describeAclsResult); - try (LogCaptureAppender connectorLogs = LogCaptureAppender.createAndRegister(MirrorSourceConnec...
codereview_new_java_data_12430
public boolean equals(Object o) { public int hashCode() { int result = fetchedData != null ? fetchedData.hashCode() : 0; result = 31 * result + (divergingEpoch != null ? divergingEpoch.hashCode() : 0); - result = 31 * result + (int) (highWatermark ^ (highWatermark >>> 32)); - resul...
codereview_new_java_data_12431
public void commitAsync(Map<TopicPartition, OffsetAndMetadata> offsets, OffsetCo CompletableFuture<Void> future = commit(offsets); future.whenComplete((r, t) -> { if (t != null) { - callback.onComplete(offsets, new RuntimeException(t)); } else { ...
codereview_new_java_data_12432
protected synchronized long timeToNextHeartbeat(long now) { // we don't need to send heartbeats if (state.hasNotJoinedGroup()) return Long.MAX_VALUE; - if (heartbeatThread != null) { - if (heartbeatThread.hasFailed()) { - // if an exception occurs in the ...
codereview_new_java_data_12433
public RollParams(long maxSegmentMs, this.now = now; } - public static RollParams create(LogConfig config, LogAppendInfo appendInfo, int messagesSize, long now) { - return new RollParams(config.maxSegmentMs(), - config.segmentSize, - appendInfo.maxTimestamp(), - ...
codereview_new_java_data_12435
public void shouldRecordPollIdleRatio() { raftMetrics.updatePollStart(time.milliseconds()); time.sleep(5); - // Measurement arrives before poll end assertEquals(0.6, getMetric(metrics, "poll-idle-ratio-avg").metricValue()); // More idle time for 5ms time.sleep(5)...
codereview_new_java_data_12436
import java.util.Optional; public class ReplicaAlterLogDirsTierStateMachine implements TierStateMachine { public PartitionFetchState start(TopicPartition topicPartition, PartitionFetchState currentFetchState, FetchRequest.Partitio...
codereview_new_java_data_12438
public R apply(R record) { @Override public void close() { - Utils.closeQuietly(delegate, "predicated transformation"); Utils.closeQuietly(predicate, "predicate"); } ```suggestion Utils.closeQuietly(delegate, "transformation"); ``` nit: Since this may or may not be a pred...
codereview_new_java_data_12439
import java.util.Set; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertThrows; This unused import is causing a checkstyle failure. import jav...
codereview_new_java_data_12440
import org.apache.kafka.connect.transforms.predicates.Predicate; /** - * Wrapper for a {@link Transformation} and corresponding optional {@link Predicate } * which applies the transformation when the {@link Predicate} is true (or false, according to {@code negate}). * If no {@link Predicate} is provided, the t...
codereview_new_java_data_12441
protected Consumer<K, V> createConsumer() { } /** - * Test whether a topic partition should be read by this log. - * <p>Overridden by subclasses when only a subset of the assigned partitions should be read into memory. - * By default, this will read all partitions. * @param topicPartition...
codereview_new_java_data_12447
public NavigableMap<Integer, Object> read(ByteBuffer buffer) { } prevTag = tag; int size = ByteUtils.readUnsignedVarint(buffer); - if (size < 0 && isNullable()) - return null; - else if (size < 0) throw new SchemaException("fi...
codereview_new_java_data_12449
private static void createTopic(Optional<String> propertiesFile, String brokers, Properties adminProps = loadPropsWithBootstrapServers(propertiesFile, brokers); Admin adminClient = Admin.create(adminProps); NewTopic newTopic = new NewTopic(topic, defaultNumPartitions, defaultReplicationFacto...
codereview_new_java_data_12450
import org.apache.kafka.common.IsolationLevel; import org.apache.kafka.common.requests.FetchRequest; -import org.apache.kafka.common.utils.FetchRequestUtils; public enum FetchIsolation { LOG_END, HIGH_WATERMARK, TXN_COMMITTED; - public static FetchIsolation apply(FetchRequest request) { - ...
codereview_new_java_data_12452
public static long offsetFromFileName(String fileName) { return Long.parseLong(fileName.substring(0, fileName.indexOf('.'))); } - private volatile File file; public final long offset; public SnapshotFile(File file) { this(file, offsetFromFileName(file.getName())); Nit: let's pl...
codereview_new_java_data_12453
public static String toLogDateTimeFormat(long timestamp) { /** * Replace the given string suffix with the new suffix. If the string doesn't end with the given suffix throw an exception. */ - public static String replaceSuffix(String name, String oldSuffix, String newSuffix) { - if (!name.end...
codereview_new_java_data_12454
*/ public class LogOffsetMetadata { - //TODO remove once UnifiedLog has been moved to the storage module private static final long UNIFIED_LOG_UNKNOWN_OFFSET = -1L; public static final LogOffsetMetadata UNKNOWN_OFFSET_METADATA = new LogOffsetMetadata(-1L, 0L, 0); Can we please use Jira tickets ins...
codereview_new_java_data_12455
public void testFetchDisconnectedShouldNotClearPreferredReadReplicaIfUnassigned( consumerClient.poll(time.timer(0)); assertFalse(fetcher.hasCompletedFetches()); fetchedRecords(); } @Test Should we add the following assertion to be consistent with other tests? ``` selec...
codereview_new_java_data_12459
public Builder(ConsumerGroupHeartbeatRequestData data) { this.data = data; } - @Override public ConsumerGroupHeartbeatRequest build(short version) { return new ConsumerGroupHeartbeatRequest(data, version); nit: double space here public Builder(ConsumerGroupHear...
codereview_new_java_data_12460
public enum Errors { INELIGIBLE_REPLICA(107, "The new ISR contains at least one ineligible replica.", IneligibleReplicaException::new), NEW_LEADER_ELECTED(108, "The AlterPartition request successfully updated the partition state but the leader has changed.", NewLeaderElectedException::new), OFFSET_MOVED...
codereview_new_java_data_12464
* limitations under the License. */ /** - * Provides API for application-defined metadata attached to Connect records. */ package org.apache.kafka.connect.header; \ No newline at end of file Nit: ```suggestion * Provides an API for application-defined metadata attached to Connect records. ``` * limita...
codereview_new_java_data_12465
* limitations under the License. */ /** - * Provides pluggable interface for altering the behavior of the Connect REST API. */ package org.apache.kafka.connect.rest; \ No newline at end of file Nit: ```suggestion * Provides a pluggable interface for altering the behavior of the Connect REST API. ``` ...
codereview_new_java_data_12466
* limitations under the License. */ /** - * Provides API for implementing connectors which read data from external applications into Kafka. */ package org.apache.kafka.connect.source; \ No newline at end of file Same nits: ```suggestion * Provides an API for implementing connectors which read data from e...
codereview_new_java_data_12467
* limitations under the License. */ /** - * Provides high-level abstractions of streaming data and computation over that streaming data. */ package org.apache.kafka.streams.kstream; \ No newline at end of file What about this: ``` Provides a high-level programming model (DSL) to express a (stateful) data fl...
codereview_new_java_data_12468
* limitations under the License. */ /** - * Provides low-level abstractions of streaming data and computation over that streaming data. */ package org.apache.kafka.streams.processor.api; \ No newline at end of file What about this: ``` Provides a low-level programming model (Processor API, aka, PAPI) to exp...
codereview_new_java_data_12469
* limitations under the License. */ /** - * Kafka Client for performing administrative operations on a Kafka cluster */ package org.apache.kafka.clients.admin; \ No newline at end of file ```suggestion * Provides a Kafka client for performing administrative operations (such as creating topics and configurin...
codereview_new_java_data_12470
* limitations under the License. */ /** - * Kafka Client for consuming events from a Kafka Cluster */ package org.apache.kafka.clients.consumer; \ No newline at end of file ```suggestion * Provides a Kafka client for consuming records from topics and/or partitions in a Kafka cluster. ``` * limitations ...
codereview_new_java_data_12471
* limitations under the License. */ /** - * Provides mechanisms for emitting monitoring metrics. */ package org.apache.kafka.common.metrics; \ No newline at end of file ```suggestion * Provides the API used by Kafka clients to emit metrics which are then exposed using the {@link MetricsReporter} interface. ...
codereview_new_java_data_12472
*/ /** * This package is deprecated. */ package org.apache.kafka.common.security.oauthbearer.secured; \ No newline at end of file You could add the `@Deprecated` annotation and the `@deprecated` Javadoc tag. */ /** * This package is deprecated. + * @deprecated See {@link org.apache.kafka.common.securit...
codereview_new_java_data_12473
private TopicAssignment place( PlacementSpec placementSpec = new PlacementSpec(startPartition, numPartitions, replicationFactor); - ClusterDescriber cluster = () -> brokers.iterator(); - return placer.place(placementSpec, cluster); } /** How about `brokers:...
codereview_new_java_data_12475
KTable<Windowed<K>, V> reduce(final Reducer<V> reducer, * For example, for {@link EmitStrategy#onWindowClose} strategy, the aggregated result for a * window will only be emitted when the window closes. For {@link EmitStrategy#onWindowUpdate()} * strategy, the aggregated result for a window will be em...
codereview_new_java_data_12476
public FindCoordinatorResponse(FindCoordinatorResponseData data) { this.data = data; } - public Optional<Coordinator> getCoordinatorByKey(String key) { Objects.requireNonNull(key); if (this.data.coordinators().isEmpty()) { // version <= 3 Can we write a test case whic...
codereview_new_java_data_12486
public class ConnectorsResource implements ConnectResource { private final boolean isTopicTrackingDisabled; private final boolean isTopicTrackingResetDisabled; - public ConnectorsResource(Herder herder, WorkerConfig config) { - this(herder, config, new RestClient(config)); - } public Conn...
codereview_new_java_data_12487
* */ default Optional<Set<Integer>> partitions(String topic, K key, V value, int numPartitions) { final Integer partition = partition(topic, key, value, numPartitions); - return partition == null ? Optional.empty() : Optional.of(Collections.singleton(partition(topic, key, value, numPartition...
codereview_new_java_data_12488
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_12493
public void shouldRethrowTaskCorruptedExceptionFromInitialization() { .withInputPartitions(taskId01Partitions).build(); final StreamTask statefulTask2 = statefulTask(taskId02, taskId02ChangelogPartitions) .inState(State.CREATED) - .withInputPartitions(taskId01Partition...
codereview_new_java_data_12494
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_12495
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_12497
* This is the abstract definition of the events created by the KafkaConsumer API */ abstract public class ApplicationEvent { - public final EventType type; - - public ApplicationEvent(EventType type) { - this.type = type; - } - - public enum EventType { - COMMIT, - NOOP, - } }...
codereview_new_java_data_12498
private void addTasksToStateUpdater() { } private void pauseTasksInStateUpdater() { - for (final Task task : stateUpdater.getUpdatingTasks()) { - if (topologyMetadata.isPaused(task.id().topologyName())) { - stateUpdater.pause(task.id()); - } - } } ...
codereview_new_java_data_12499
private void rewriteSingleStoreSelfJoin( parent.removeChild(right); joinNode.setSelfJoin(); } else { - throw new StreamsException(String.format("Expected the left node %s to have smaller build priority than the right node %s.", left, right)); }...
codereview_new_java_data_12500
public interface ChangelogRegister { */ void register(final TopicPartition partition, final ProcessorStateManager stateManager); - void register(final Set<TopicPartition> partition, final ProcessorStateManager stateManager); /** * Unregisters and removes the passed in partitions from the s...
codereview_new_java_data_12501
public interface ChangelogRegister { */ void register(final TopicPartition partition, final ProcessorStateManager stateManager); - void register(final Set<TopicPartition> partition, final ProcessorStateManager stateManager); /** * Unregisters and removes the passed in partitions from the s...
codereview_new_java_data_12502
public boolean poll(RequestFuture<?> future, Timer timer) { * @param disableWakeup true if we should not check for wakeups, false otherwise * * @return true if the future is done, false otherwise - * @throws WakeupException if {@link #wakeup()} is called from another thread * @throws Interr...
codereview_new_java_data_12503
public void testMarkingPartitionPending() { assertTrue(state.isFetchable(tp0)); state.markPendingRevocation(singleton(tp0)); assertFalse(state.isFetchable(tp0)); } @Test Perhaps we can also assert `isPaused` is false? public void testMarkingPartitionPending() { assert...