id stringlengths 29 30 | content stringlengths 152 2.6k |
|---|---|
codereview_new_java_data_7298 | public static long[] andAckSet(long[] firstAckSet, long[] secondAckSet) {
public static boolean isAckSetEmpty(long[] ackSet) {
BitSetRecyclable bitSet = BitSetRecyclable.create().resetWords(ackSet);
return bitSet.isEmpty();
}
please recycle this bitSet or use `BitSetRecyclable.valueOf... |
codereview_new_java_data_7299 | private Pair<Boolean, String> getMaxUsageBroker(
return Pair.of(hasBrokerBelowLowerBound, maxUsageBrokerName);
}
@Override
- public void onBrokerChange(Set<String> newBrokers) {
synchronized (activeBrokers) {
activeBrokers.clear();
activeBrokers.addAll(newBroker... |
codereview_new_java_data_7300 | public interface LoadSheddingStrategy {
*
* @param activeBrokers active Brokers
*/
- default void onBrokerChange(Set<String> activeBrokers) {}
}
```suggestion
default void onActiveBrokersChange(Set<String> activeBrokers) {}
```
public interface LoadSheddingStrategy {
*
* @par... |
codereview_new_java_data_7301 | public String printResourceUsage() {
cpu.percentUsage(), memory.percentUsage(), directMemory.percentUsage(), bandwidthIn.percentUsage(),
bandwidthOut.percentUsage());
}
- @Deprecated
public double getMaxResourceUsageWithWeight(final double cpuWeight, final double memoryWe... |
codereview_new_java_data_7302 |
public class InMemoryRedeliveryTracker implements RedeliveryTracker {
private ConcurrentLongLongPairHashMap trackerCache = ConcurrentLongLongPairHashMap.newBuilder()
- .concurrencyLevel(2)
- .expectedItems(128)
.autoShrink(true)
.build();
Any reason to change ... |
codereview_new_java_data_7303 | public void testTopicsDistribution() throws Exception {
log.info("Topics are distributed to consumers as {}", eventListener.getActiveConsumers());
Map<String, Integer> assigned = new HashMap<>();
eventListener.getActiveConsumers().forEach((k, v) -> assigned.compute(v, (t, c) -> c == null ? 1... |
codereview_new_java_data_7304 | public LedgerOffloader getManagedLedgerOffloader(NamespaceName namespaceName, Of
});
}
- public boolean isRunning() {
- return this.state == State.Started || this.state == State.Init;
- }
-
public LedgerOffloader createManagedLedgerOffloader(OffloadPoliciesImpl offloadPolicies)
... |
codereview_new_java_data_7305 | protected synchronized void initializeBookKeeper(final ManagedLedgerInitializeLe
}
// Calculate total entries and size
- final List<Long> emptyLedgersToBeDeleted = new ArrayList<>();
Iterator<LedgerInfo> iterator = ledgers.values().iterator();
while (iterator.hasNext()) {
... |
codereview_new_java_data_7306 | public class ExtensibleLoadManagerImpl implements ExtensibleLoadManager {
private final SplitCounter splitCounter = new SplitCounter();
// record load metrics
- private AtomicReference<List<Metrics>> brokerLoadMetrics = new AtomicReference<>();
// record unload metrics
private final AtomicRefe... |
codereview_new_java_data_7307 | public List<Metrics> toMetrics() {
m.put("brk_lb_bundles_split_total", splitCount);
metrics.add(m);
- for (var etr : breakdownCounters.entrySet()) {
var result = etr.getKey();
- for (var counter : etr.getValue().entrySet()) {
var reason = counter.getK... |
codereview_new_java_data_7308 | private synchronized long recoverBucketSnapshot() throws RuntimeException {
deletionFutures.add(immutableBucket.asyncDeleteBucketSnapshot());
}
- // Wait for all deletion futures to complete before proceeding
- try {
- FutureUtil.waitForAll(deletionFutures).get(AsyncOpe... |
codereview_new_java_data_7309 | public class ElasticSearchConfig implements Serializable {
@FieldDoc(
required = false,
defaultValue = "30000",
- help = "Idle connection timeout to prevent a connection timeouts."
)
private int connectionIdleTimeoutInMs = 30000;
I wonder if this config should be ... |
codereview_new_java_data_7310 | protected void updateTopicPolicyByNamespacePolicy(Policies namespacePolicies) {
if (log.isDebugEnabled()) {
log.debug("[{}]updateTopicPolicyByNamespacePolicy,data={}", topic, namespacePolicies);
}
- if (namespacePolicies.deleted) {
- return;
- }
topicPol... |
codereview_new_java_data_7311 | public CompletableFuture<Void> initialize() {
Policies policies = optPolicies.get();
- updateTopicPolicyByNamespacePolicy(policies);
initializeDispatchRateLimiterIfNeeded();
nit: unnecessary change for this PR
public CompletableFuture<Void> initia... |
codereview_new_java_data_7312 | public CompletableFuture<Void> initialize() {
Policies policies = optPolicies.get();
- updateTopicPolicyByNamespacePolicy(policies);
initializeDispatchRateLimiterIfNeeded();
```suggestion
this.updateTopicPolicyByNamespacePolicy(... |
codereview_new_java_data_7313 | public CompletableFuture<Transaction> build() {
return;
}
if (log.isDebugEnabled()) {
- log.debug("Success to new txn. txnID: {}", txnID);
}
TransactionImpl transaction = new TransactionI... |
codereview_new_java_data_7314 | void deleteNonDurableCursorWithName() throws Exception {
@Test
public void testMessagesConsumedCounterInitializedCorrect() throws Exception {
- ManagedLedger ledger = factory.open("testMessagesConsumedCounterInitializedCorrect",
new ManagedLedgerConfig().setRetentionTime(1, ... |
codereview_new_java_data_7315 | public void testDoNotReplicateSystemTopic() throws Exception {
assertNull(consumerFromR2.receive(5, TimeUnit.SECONDS));
transaction.commit();
- // wait before evaluating stats for the system topics
Thread.sleep(500L);
Assert.assertEquals(admin1.topics().getStats(systemTop... |
codereview_new_java_data_7316 | public void testGetWebSocketReadUri(String msgId, String msgIdQueryParam) throws
}
@Test
- public void testPrseMessageId() {
assertEquals(CmdRead.parseMessageId("latest"), MessageId.latest);
assertEquals(CmdRead.parseMessageId("earliest"), MessageId.earliest);
assertEquals(Cmd... |
codereview_new_java_data_7317 |
-/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
Need to add `*`
+/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements... |
codereview_new_java_data_7318 | private void recoveredCursor(PositionImpl position, Map<String, Long> properties
}
log.info("[{}] Cursor {} recovered to position {}", ledger.getName(), name, position);
this.cursorProperties = cursorProperties;
markDeletePosition = position;
persistentMarkDeletePosition = ... |
codereview_new_java_data_7319 | public void setMetadataStoreProperty() {
originalProperty = System.getProperties().get(MetadataStoreFactoryImpl.METADATASTORE_PROVIDERS_PROPERTY);
System.setProperty(MetadataStoreFactoryImpl.METADATASTORE_PROVIDERS_PROPERTY,
MyMetadataStoreProvider.class.getName());
- Metadata... |
codereview_new_java_data_7320 | default long getLowWaterMark() {
* @return {@link TxnMeta} the txnMetas of slow transactions
*/
List<TxnMeta> getSlowTransactions(long timeout);
-
- /**
- * set recover end time.
- * @param time
- */
- void setRecoverEndTime(long time);
}
Sorry, forgot this one.
I think we don't... |
codereview_new_java_data_7321 | private static void notify(TopicEventsListener listener,
try {
listener.handleEvent(topic, event, stage, t);
} catch (Throwable ex) {
- log.error("TopicEventsListener exception while handling {}_{} for topic {}", event, stage, topic, ex);
}
}
We can print the ... |
codereview_new_java_data_7322 |
import org.apache.pulsar.common.util.collections.TripleLongPriorityQueue;
@NotThreadSafe
-public class TripleLongPriorityDelayedIndexQueue implements DelayedIndexQueue {
private final TripleLongPriorityQueue queue;
I notice that this class is used to make `peek` and `pop` easier to use, and it is only us... |
codereview_new_java_data_7323 |
import java.util.Objects;
import org.apache.pulsar.broker.delayed.proto.DelayedMessageIndexBucketSnapshotFormat;
-public interface DelayedIndexQueue {
-
Comparator<DelayedMessageIndexBucketSnapshotFormat.DelayedIndex> COMPARATOR = (o1, o2) -> {
if (!Objects.equals(o1.getTimestamp(), o2.getTimestamp(... |
codereview_new_java_data_7324 | public DelayedIndex pop() {
}
private DelayedIndex getValue(boolean needAdvanceCursor) {
while (segmentListACursor < segmentListA.size()
- && segmentACursor >= segmentListA.get(segmentListACursor).getIndexesCount()) {
segmentListACursor++;
}
while (seg... |
codereview_new_java_data_7325 | public synchronized void close() throws PulsarServerException {
}
try {
this.brokerRegistry.close();
- } catch (Exception e) {
- throw new PulsarServerException(e);
}
- this.serviceUnitStateChannel.close();
- this.started = false;
}
pr... |
codereview_new_java_data_7326 | void run() throws PulsarAdminException {
}
@Parameters(commandDescription = "Trim a topic")
private class TrimTopic extends CliCommand {
- @Parameter(description = "tenant/namespace", required = true)
private java.util.List<String> params;
@Override
It should be `topic name`?... |
codereview_new_java_data_7327 | public void getLastMessageId(
}
}
- @PUT
@Path("/{tenant}/{namespace}/{topic}/trim")
@ApiOperation(value = " Trim a topic")
@ApiResponses(value = {
And is it better to change to @POST?
As I understand, the @PUT method usually used to create some resources.
public void getLastMessa... |
codereview_new_java_data_7328 | public void testFailedUpdatePartitionedTopic() throws Exception {
try {
admin.topics().createSubscription(partitionedTopicName + "-partition-" + startPartitions, subName1,
MessageId.earliest);
} catch (PulsarAdminException.PreconditionFailedException ex) {
... |
codereview_new_java_data_7329 | public void createPartitionedTopic(
}
}
- private static final Logger log = LoggerFactory.getLogger(PersistentTopics.class);
}
`PersistentTopics.class` -> `NonPersistentTopics.class` ?
public void createPartitionedTopic(
}
}
+ private static final Logger log = LoggerFactory.ge... |
codereview_new_java_data_7330 | public boolean trackDelayedDelivery(long ledgerId, long entryId, MessageMetadata
}
}
- protected synchronized NavigableSet<PositionImpl> getMessagesToReplayNow(int maxMessagesToRead) {
if (!redeliveryMessages.isEmpty()) {
return redeliveryMessages.getMessagesToReplayNow(maxMes... |
codereview_new_java_data_7331 | protected void internalGetMessageById(AsyncResponse asyncResponse, long ledgerId
// will redirect if the topic not owned by current broker
getPartitionedTopicMetadataAsync(topicName, authoritative, false)
.thenAccept(partitionMetadata -> {
- if (!topicName.isPartit... |
codereview_new_java_data_7332 | public void testCreateBytesSchema() {
// forbid admin api creating BYTES schema to be consistent with client side
try {
testSchemaInfoApi(Schema.BYTES, "schematest/test/test-BYTES");
} catch (Exception e) {
assertTrue(e.getMessage().contains("Do not upload a BYTES s... |
codereview_new_java_data_7333 | public CompletableFuture<SchemaVersion> deleteSchemaAsync(boolean authoritative,
public CompletableFuture<SchemaVersion> postSchemaAsync(PostSchemaPayload payload, boolean authoritative) {
if (SchemaType.BYTES.name().equals(payload.getType())) {
- throw new RestException(Response.Status.NOT_... |
codereview_new_java_data_7334 | public TransactionPendingAckStats getStats(boolean lowWaterMarks) {
}
public void completeHandleFuture() {
- if (!this.pendingAckHandleCompletableFuture.isDone()) {
- this.pendingAckHandleCompletableFuture.complete(PendingAckHandleImpl.this);
- }
- if (recoverTime.getRecover... |
codereview_new_java_data_7335 | public void checkEncryption() {
public void publishTxnMessage(TxnID txnID, long producerId, long sequenceId, long highSequenceId,
ByteBuf headersAndPayload, long batchSize, boolean isChunked, boolean isMarker) {
- if (!checkAndStartPublish(producerId, sequenceId, header... |
codereview_new_java_data_7336 | protected void splitServiceUnitOnceAndRetry(NamespaceService namespaceService,
// Retry several times on BadVersion
if ((ex.getCause() instanceof MetadataStoreException.BadVersionException)
&& (counter.incrementAndGet() < NamespaceService.BUNDLE_SPLIT_RETRY_LIMIT)) {
- ... |
codereview_new_java_data_7337 | public int hashCode() {
return messageIdHashCode(ledgerId, entryId, partitionIndex, batchIndex);
}
- @Override
- public boolean equals(Object o) {
- if (o instanceof MessageId) {
- return compareTo((MessageId) o) == 0;
- }
- return false;
- }
-
@Override
... |
codereview_new_java_data_7338 | protected void cleanup() throws Exception {
}
@DataProvider(name = "testTopic")
- public Object[][] testTopic() {
- return new Object[][] {
- {RECOVER_ABORT},
- {RECOVER_COMMIT}
};
}
@DataProvider(name = "enableSnapshotSegment")
- public Objec... |
codereview_new_java_data_7339 | public abstract class CmdBase {
@Parameter(names = { "--help", "-h" }, help = true, hidden = true)
private boolean help = false;
public CmdBase(String cmdName, Supplier<PulsarAdmin> adminSupplier) {
this.adminSupplier = adminSupplier;
jcommander = new JCommander(this);
Is this varia... |
codereview_new_java_data_7340 | public void calculateBrokerHostUsage() {
}
@VisibleForTesting
- public double getTotalNicLimitWithConfiguration(List<String> nics) {
// Use the override value as configured. Return the total max speed across all available NICs, converted
// from Gbps into Kbps
return overrideB... |
codereview_new_java_data_7341 | public void testGetChildren(String provider, Supplier<String> urlSupplier) throw
@Test(dataProvider = "impl", enabled = false)
public void testPut(String provider, Supplier<String> urlSupplier) throws Exception {
@Cleanup
- MetadataStore store = MetadataStoreFactory.create(urlSupplier.get(),
... |
codereview_new_java_data_7342 | protected synchronized boolean trySendMessagesToConsumers(ReadType readType, Lis
}
for (Map.Entry<Consumer, List<Entry>> current : groupedEntries.entrySet()) {
Consumer consumer = current.getKey();
List<Entry> entriesWithSameKey = current.getValue();
int entries... |
codereview_new_java_data_7343 | public int filterEntriesForConsumer(@Nullable MessageMetadata[] metadataArray, i
MessageMetadata msgMetadata;
if (metadataArray != null) {
msgMetadata = metadataArray[metadataIndex];
- } else if (entry instanceof EntryAndMetadata entryAndMetadata) {
- ... |
codereview_new_java_data_7344 | public int filterEntriesForConsumer(@Nullable MessageMetadata[] metadataArray, i
MessageMetadata msgMetadata;
if (metadataArray != null) {
msgMetadata = metadataArray[metadataIndex];
- } else if (entry instanceof EntryAndMetadata entryAndMetadata) {
- ... |
codereview_new_java_data_7345 | public class DnsResolverUtil {
log.warn("Cannot get DNS TTL settings from sun.net.InetAddressCachePolicy class", e);
}
TTL = ttl <= 0 ? DEFAULT_TTL : ttl;
- NEGATIVE_TTL = negativeTtl < 0 ? DEFAULT_TTL : negativeTtl;
}
private DnsResolverUtil() {
```suggestion
... |
codereview_new_java_data_7346 | public void run() {
Assert.assertEquals(0, datas.size());
}
- /**
- * see https://github.com/apache/pulsar/pull/18491
- */
@Test
public void testMultiTopicConsumerConcurrentRedeliverAndReceive() throws Exception {
final String topic = BrokerTestUtil.newUniqueName("my-topic... |
codereview_new_java_data_7914 |
-/* (c) 2017 Open Source Geospatial Foundation - all rights reserved
* This code is licensed under the GPL 2.0 license, available at the root
* application directory.
*/
```suggestion
/* (c) 2023 Open Source Geospatial Foundation - all rights reserved
```
+/* (c) 2023 Open Source Geospatial Foundation - all... |
codereview_new_java_data_7915 |
-/* (c) 2017 Open Source Geospatial Foundation - all rights reserved
* This code is licensed under the GPL 2.0 license, available at the root
* application directory.
*/
```suggestion
/* (c) 2023 Open Source Geospatial Foundation - all rights reserved
```
+/* (c) 2023 Open Source Geospatial Foundation - all... |
codereview_new_java_data_7916 | private static void callLifecycleHandlers(
try {
callback.accept(handler);
} catch (Throwable t) {
- LOGGER.logp(
Level.SEVERE,
- handler.getClass().getName(),
- name,
- ... |
codereview_new_java_data_7917 | protected MockHttpServletResponse dispatch(HttpServletRequest request, String ch
}
/**
- * Remove parmeters from mime type.
*
* @param mimeType the mime type
* @return with mime type without parameters
```suggestion
* Remove parameters from mime type.
```
protected MockHttpS... |
codereview_new_java_data_7918 | protected void registerHandlerMethod(
if (patternsRequestCondition != null && patternsRequestCondition.getPatterns() != null) {
for (String pattern : patternsRequestCondition.getPatterns()) {
if (pattern.contains(GWC_URL_PATTERN)) {
- // this is an handler for ... |
codereview_new_java_data_7919 |
-/* (c) 2026 Open Source Geospatial Foundation - all rights reserved
* This code is licensed under the GPL 2.0 license, available at the root
* application directory.
*/
```suggestion
/* (c) 2018 Open Source Geospatial Foundation - all rights reserved
```
+/* (c) 2018 Open Source Geospatial Foundation - all... |
codereview_new_java_data_7920 |
-/* (c) 20189 Open Source Geospatial Foundation - all rights reserved
* This code is licensed under the GPL 2.0 license, available at the root
* application directory.
*/
```suggestion
/* (c) 2018 Open Source Geospatial Foundation - all rights reserved
```
+/* (c) 2018 Open Source Geospatial Foundation - al... |
codereview_new_java_data_7921 |
import org.opengis.filter.sort.SortBy;
import org.springframework.beans.FatalBeanException;
public abstract class QueryableMappingRecordDescriptor extends AbstractRecordDescriptor {
private static final Logger LOGGER = Logging.getLogger(QueryableMappingRecordDescriptor.class);
Javadoc for public class? In... |
codereview_new_java_data_7922 | public void testValidatesAgainstDTD() throws Exception {
// get the wms 1.1.1 DTD
URL dtdURL =
GetCapabilitiesTransformer.class.getResource(
- "/schemas/wms/1.1.1/wms_ms_capabilities.dtd");
String dtd = Resources.toString(dtdURL, StandardCharsets.UTF_8... |
codereview_new_java_data_7923 | public void testValidatesAgainstDTD() throws Exception {
// get the wms 1.1.1 DTD
URL dtdURL =
GetCapabilitiesTransformer.class.getResource(
- "/schemas/wms/1.1.1/wms_ms_capabilities.dtd");
String dtd = Resources.toString(dtdURL, StandardCharsets.UTF_8... |
codereview_new_java_data_7924 |
*/
public class SpatialJSONGetFeatureResponse extends GeoJSONGetFeatureResponse {
- // currently no logger required
- // private final Logger LOGGER = org.geotools.util.logging.Logging.getLogger(this.getClass());
private static String parseMimeType(String format) {
int pos = format.indexOf('... |
codereview_new_java_data_7925 | protected ServiceDescription description(
}
/**
- * gets the name of the "version" parameter for the service. This will usually be "version", but
- * some (i.e. WCS 2+) it will be "acceptversions". To overrided by subclasses.
*
* @param service
- * @return
*/
protected St... |
codereview_new_java_data_7926 | public void testLogLocationFromEmptyContext() throws Exception {
context.setInitParameter(
"GEOSERVER_LOG_LOCATION", new File(tmp, "foo.log").getAbsolutePath());
- ServletContextListener listener = new LoggingStartupContextListener();
- listener.contextInitialized(new Servle... |
codereview_new_java_data_7927 |
package org.geoserver.wfs.v2_0;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.notNullValue;
import static org.junit.Assert.assertEquals;
import java.net.URL;
import org.custommonkey.xmlunit.XMLUnit;
import org.custommonkey.xmlunit.XpathEngine;
import org.geoserver... |
codereview_new_java_data_7928 | protected void onSetUp(SystemTestData testData) throws Exception {
// alter the native BBOX of one raster for at least a pixel to make sure the declared
// bounds are used, but also fitted to the grid to avoid resampling.
- // Compared to the native bbox we are expanding by almost one pixel ... |
codereview_new_java_data_7929 | protected void onSetUp(SystemTestData testData) throws Exception {
// alter the native BBOX of one raster for at least a pixel to make sure the declared
// bounds are used, but also fitted to the grid to avoid resampling.
- // Compared to the native bbox we are expanding by almost one pixel ... |
codereview_new_java_data_7930 | public void cleanupLimitedSRS() {
@Test
public void testBasicKVP() throws Exception {
Document dom = getAsDOM("wcs?request=GetCapabilities&service=WCS");
- print(dom);
checkFullCapabilitiesDocument(dom);
}
Should that be commented again after development?
public void cleanu... |
codereview_new_java_data_7931 |
-/* (c) 2022 Open Source Geospatial Foundation - all rights reserved
- * This code is licensed under the GPL 2.0 license, available at the root
- * application directory.
- */
-package org.geoserver.gwc.controller;
-
-import org.geoserver.catalog.Catalog;
-
-/**
- * Handler for mapping workspace-based web (i.e. web/op... |
codereview_new_java_data_7932 |
/*
- * (c) 2018 Open Source Geospatial Foundation - all rights reserved
* This code is licensed under the GPL 2.0 license, available at the root
* application directory.
*
*/
-/* (c) 2016 Open Source Geospatial Foundation - all rights reserved
- * This code is licensed under the GPL 2.0 license, available a... |
codereview_new_java_data_7933 |
import net.sf.json.JSONObject;
/**
- * make sure your Azure AD application has "GroupMember.Read.All" permission: a) go to your
* application in Azure AD (in the portal) b) On the left, go to "API permissions" c) click "Add a
* permission" d) press "Microsoft Graph" e) press "Delegated permission" f) Scroll do... |
codereview_new_java_data_7934 |
import org.springframework.security.oauth2.provider.token.RemoteTokenServices;
/** OpenID Connect authentication filter. */
public class OpenIdConnectAuthenticationFilter extends GeoServerOAuthAuthenticationFilter {
static final String ID_TOKEN_VALUE = "OpenIdConnect-IdTokenValue";
```suggestion
/**
* ... |
codereview_new_java_data_7935 |
import org.geoserver.security.oauth2.OpenIdConnectFilterConfig;
/**
- * This is a simple token validator that runs a list of TokenValidators. This doesn't do any
- * validation on its own...
*/
public class MultiTokenValidator implements TokenValidator {
```suggestion
* This is a token validator that runs ... |
codereview_new_java_data_7936 |
* Dispatcher callback that sets and clears the {@link LocalWorkspace} and {@link LocalPublished}
* thread locals.
*
* @author Justin Deoliveira, OpenGeo
*/
public class LocalWorkspaceCallback implements DispatcherCallback, ExtensionPriority {
I don't get the intent of this change.
* Dispatcher callback... |
codereview_new_java_data_7937 | public interface StoreInfo extends CatalogInfo {
*/
// <T extends Resource> Iterator<T> getResources(ProgressListener monitor) throws IOException;
}
```suggestion
* When true, the {@link ResourcePool} will automatically disable the store on connection failure. Defaults to false.
```
(I should ... |
codereview_new_java_data_7938 |
import org.geoserver.config.util.XStreamPersister;
import org.geoserver.config.util.XStreamPersisterInitializer;
-/** Extension point to enable emsa package name in the SecureXStream. */
public class JMSXStreamPersisterInitializer implements XStreamPersisterInitializer {
@Override
```suggestion
/** Exten... |
codereview_new_java_data_7939 | public void mangleURL(
// (for two reasons: a) speed; b) to make the admin aware of
// possible security liabilities)
- boolean workspaceEnabled = this.geoServer.getSettings().getWorkspace() != null;
- boolean doMangleHeaders =
- workspaceEnabled
- ... |
codereview_new_java_data_8122 |
/**
* Default {@link HttpRequest} implementation.
- *
- * @deprecated Use {@link HttpRequest#streaming(RequestHeaders)} instead.
*/
-@Deprecated
public class DefaultHttpRequest extends DefaultStreamMessage<HttpObject> implements HttpRequestWriter {
private final RequestHeaders headers;
/**
... |
codereview_new_java_data_8123 | public DnsAddressEndpointGroupBuilder selectionTimeoutMillis(long selectionTimeo
@Override
public DnsAddressEndpointGroupBuilder addDnsQuestionListeners(
- Iterable<DnsQuestionListener> dnsQuestionListeners) {
return (DnsAddressEndpointGroupBuilder) super.addDnsQuestionListeners(dnsQues... |
codereview_new_java_data_8124 |
*/
enum DefaultDnsQueryListener implements DnsQueryListener {
- DEFAULT_INSTANCE;
private final Logger logger = LoggerFactory.getLogger(getClass());
nit: just `INSTANCE`?
*/
enum DefaultDnsQueryListener implements DnsQueryListener {
+ INSTANCE;
private final Logger logger = LoggerFac... |
codereview_new_java_data_8125 | enum DefaultDnsQueryListener implements DnsQueryListener {
INSTANCE;
- private final Logger logger = LoggerFactory.getLogger(getClass());
@Override
public void onSuccess(List<DnsRecord> oldRecords, List<DnsRecord> newRecords, String logPrefix) {}
nit:
```suggestion
private static final L... |
codereview_new_java_data_8126 | public interface RoutingContext {
/**
* Returns a wrapped {@link RoutingContext} which holds the specified {@link HttpMethod}.
*/
- default RoutingContext overrideMethod(HttpMethod method) {
requireNonNull(method, "method");
return new RoutingContextWrapper(this) {
@O... |
codereview_new_java_data_8127 | 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_8128 | void hashcodeRecalculateWhenMethodChange() {
MediaType.XML_UTF_8 + "; q=0.8"),
"/hello", null, null, RoutingStatus.OK);
final RoutingContext ctx3 = ctx1.withMethod(HttpMethod.POST);
- assertThat(ctx1... |
codereview_new_java_data_8129 | public Routed<ServiceConfig> findServiceConfig(RoutingContext routingCtx, boolea
return routed;
case NOT_MATCHED:
if (routingCtx.method() == HttpMethod.HEAD) {
- return findServiceConfig(routingCtx.withMethod(HttpMethod.GET));
}
... |
codereview_new_java_data_8130 |
import com.linecorp.armeria.server.annotation.Get;
import com.linecorp.armeria.testing.junit5.server.ServerExtension;
-public class AnnotatedServiceImplicitHeadTest {
@RegisterExtension
static final ServerExtension server = new ServerExtension() {
junit5 classes don't have to be public
```suggestio... |
codereview_new_java_data_8131 | void hashcodeRecalculateWhenMethodChange() {
MediaType.XML_UTF_8 + "; q=0.8"),
"/hello", null, null, RoutingStatus.OK);
final RoutingContext ctx3 = ctx1.withMethod(HttpMethod.POST);
- assertThat(ctx1... |
codereview_new_java_data_8132 |
package com.linecorp.armeria.common.stream;
/**
- * A type which is both a {@link StreamMessage} and a {@link StreamWriter}. This type is mainly used by tests
- * which need to exercise both functionality.
*/
public interface StreamMessageWriter<T> extends StreamMessage<T>, StreamWriter<T> {
}
Could you also ... |
codereview_new_java_data_8133 | static <T> StreamMessage<T> aborted(Throwable cause) {
* Creates a new {@link StreamMessageWriter} that publishes the objects written via
* {@link StreamWriter#write(Object)}.
*/
static <T> StreamMessageWriter<T> streaming() {
return new DefaultStreamMessage<>();
}
So you want to ... |
codereview_new_java_data_8134 |
package com.linecorp.armeria.common.stream;
/**
* A type which is both a {@link StreamMessage} and a {@link StreamWriter}.
* {@link StreamMessageWriter} publishes the objects written via {@link StreamWriter#write(Object)}.
*/
public interface StreamMessageWriter<T> extends StreamMessage<T>, StreamWriter<T... |
codereview_new_java_data_8135 | static <T> StreamMessage<T> aborted(Throwable cause) {
* Creates a new {@link StreamMessageWriter} that publishes the objects written via
* {@link StreamWriter#write(Object)}.
*/
static <T> StreamMessageWriter<T> streaming() {
return new DefaultStreamMessage<>();
}
```suggestion
... |
codereview_new_java_data_8136 | static void maybeCompletePreferredRecords(CompletableFuture<List<DnsRecord>> fut
results[order] = records;
}
- for (int i = 0; i < results.length; i++) {
- final Object result = results[i];
if (result == null) {
// A highly preferred question hasn... |
codereview_new_java_data_8137 | default boolean shutdownBlockingTaskExecutorOnStop() {
boolean isServerHeaderEnabled();
/**
- * Returns the {@link Supplier} that generates a {@link RequestId} for each {@link Request}.
*/
Function<RoutingContext, RequestId> requestIdGenerator();
I think we can also change the javadoc for... |
codereview_new_java_data_8138 | public ServerBuilder setHeaders(
* Sets the {@link Supplier} which generates a {@link RequestId}.
* By default, a {@link RequestId} is generated from a random 64-bit integer.
*
- * @see RequestContext#id()
*/
- public ServerBuilder requestIdGenerator(Supplier<? extends RequestId> request... |
codereview_new_java_data_8139 | public ServerBuilder setHeaders(
* Sets the {@link Supplier} which generates a {@link RequestId}.
* By default, a {@link RequestId} is generated from a random 64-bit integer.
*
- * @see RequestContext#id()
*/
- public ServerBuilder requestIdGenerator(Supplier<? extends RequestId> request... |
codereview_new_java_data_8140 | public ServerBuilder setHeaders(
* Sets the {@link Supplier} which generates a {@link RequestId}.
* By default, a {@link RequestId} is generated from a random 64-bit integer.
*
- * @see RequestContext#id()
*/
- public ServerBuilder requestIdGenerator(Supplier<? extends RequestId> request... |
codereview_new_java_data_8141 | public ServerBuilder setHeaders(
*/
@Deprecated
public ServerBuilder requestIdGenerator(Supplier<? extends RequestId> requestIdSupplier) {
return requestIdGenerator(routingContext -> requestIdSupplier.get());
}
nit:
```suggestion
public ServerBuilder requestIdGenerator(Supplier<?... |
codereview_new_java_data_8142 |
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_8143 | static Set<AnnotatedValueResolver> uniqueResolverSet() {
String o2Name = o2.httpElementName();
final Class<? extends Annotation> o1AnnotationType = o1.annotationType();
final Class<? extends Annotation> o2AnnotationType = o2.annotationType();
- if (o1Name.equals(o2Name... |
codereview_new_java_data_8144 | void assertSquareBracketsInPath() {
assertThat(res2).isNotNull();
assertThat(res2.path()).isNotEqualTo("/#%2F:@!$&'()*+,;=?");
}
-
}
@ikhoon not sure about this, but kindly guide/let me know your view
void assertSquareBracketsInPath() {
assertThat(res2).isNotNull();
assertT... |
codereview_new_java_data_8145 | private static PathAndQuery parse(@Nullable String rawPath, boolean allowDoubleD
@Test
void assertSquareBracketsInPath() {
- final PathAndQuery res = parse("/#/:@[]!$&'()*+,;=");
assertThat(res).isNotNull();
- assertThat(res.path()).isNotEqualTo("/#/:@!$&'()*+,;=");
... |
codereview_new_java_data_8146 | private static PathAndQuery parse(@Nullable String rawPath, boolean allowDoubleD
@Test
void assertSquareBracketsInPath() {
- final PathAndQuery res = parse("/#/:@[]!$&'()*+,;=");
assertThat(res).isNotNull();
- assertThat(res.path()).isNotEqualTo("/#/:@!$&'()*+,;=");
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.