Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
import org.openjdk.jmh.infra.Blackhole;

import javax.annotation.Nullable;

import java.nio.ByteBuffer;
import java.util.concurrent.TimeUnit;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,17 +74,17 @@

for (int j = 0; j < numSegmentPerDataSource; j++) {
segments.add(
new DataSegment(
dataSource,
TEST_SEGMENT_INTERVAL,
String.valueOf(j),
Collections.emptyMap(),
Collections.emptyList(),
Collections.emptyList(),
NoneShardSpec.instance(),
0,
10L
)

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation Note test

Invoking
DataSegment.DataSegment
should be avoided because it has been deprecated.
);
}
}
Expand Down Expand Up @@ -116,4 +116,3 @@
blackhole.consume(totalSize);
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
import org.openjdk.jmh.infra.Blackhole;

import javax.annotation.Nullable;

import java.nio.ByteBuffer;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
import org.openjdk.jmh.infra.Blackhole;

import javax.annotation.Nullable;

import java.util.concurrent.TimeUnit;


Expand Down Expand Up @@ -105,7 +106,7 @@
this.closer = Closer.create();

final GeneratorSchemaInfo schemaInfo = GeneratorBasicSchemas.SCHEMA_MAP.get("expression-testbench");

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation Note test

Invoking
DataSegment.builder
should be avoided because it has been deprecated.
final DataSegment dataSegment = DataSegment.builder()
.dataSource("foo")
.interval(schemaInfo.getDataInterval())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
import org.openjdk.jmh.runner.options.OptionsBuilder;

import javax.annotation.Nullable;

import java.net.Inet4Address;
import java.net.InetAddress;
import java.util.ArrayList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@
final String[] split = joinColumns.split(",");
final String lhsJoinColumn = split[0];
final String rhsJoinColumn = split[1];

final List<JoinableClause> clauses = ImmutableList.of(
new JoinableClause(
prefix,
Expand Down Expand Up @@ -293,7 +293,7 @@
interval,
false
);
final DataSegment dataSegment = DataSegment.builder()

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation Note test

Invoking
DataSegment.builder
should be avoided because it has been deprecated.
.dataSource(dataSource)
.interval(schema.getDataInterval())
.version("1")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,4 +191,3 @@ public void precompileGranularityPathRegexAndMatch(final Blackhole blackhole)
}
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
public class TopNTypeInterfaceBenchmark
{
private static final SegmentId Q_INDEX_SEGMENT_ID = SegmentId.dummy("qIndex");

@Param({"1"})
private int numSegments;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
import org.openjdk.jmh.infra.Blackhole;

import javax.annotation.Nullable;

import java.util.Collections;
import java.util.concurrent.TimeUnit;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
import org.openjdk.jmh.infra.Blackhole;

import javax.annotation.Nullable;

import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
Expand Down Expand Up @@ -141,7 +142,7 @@
public void setup() throws JsonProcessingException
{
final GeneratorSchemaInfo schemaInfo = GeneratorBasicSchemas.SCHEMA_MAP.get("in-testbench");

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation Note test

Invoking
DataSegment.builder
should be avoided because it has been deprecated.
final DataSegment dataSegment = DataSegment.builder()
.dataSource("foo")
.interval(schemaInfo.getDataInterval())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@

import javax.annotation.Nonnull;
import javax.annotation.Nullable;

import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,36 +66,36 @@

@Param({"10000", "100000", "1000000"})
private int numberOfSegments;

@Param({"10", "100", "1000"})
private int maxSegmentsToMove;

private final List<ServerHolder> serverHolders = new ArrayList<>();
private int reservoirSize = 1;

@Setup(Level.Trial)
public void setup()
{
reservoirSize = maxSegmentsToMove;

List<List<DataSegment>> segmentList = new ArrayList<>(NUMBER_OF_SERVERS);
IntStream.range(0, NUMBER_OF_SERVERS).forEach(i -> segmentList.add(new ArrayList<>()));
for (int i = 0; i < numberOfSegments; i++) {
segmentList.get(RANDOM.nextInt(NUMBER_OF_SERVERS)).add(
new DataSegment(
"test",
TEST_SEGMENT_INTERVAL,
String.valueOf(i),
Collections.emptyMap(),
Collections.emptyList(),
Collections.emptyList(),
null,
0,
10L
)

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation Note test

Invoking
DataSegment.DataSegment
should be avoided because it has been deprecated.
);
}

for (List<DataSegment> segments : segmentList) {
serverHolders.add(
new ServerHolder(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@

import javax.validation.Validation;
import javax.validation.Validator;

import java.util.Properties;
import java.util.UUID;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ public String getPassword()
* @see User
*/
protected abstract Properties getAvaticaConnectionPropertiesForUser(User user);

private final EmbeddedOverlord overlord = new EmbeddedOverlord();
private final EmbeddedCoordinator coordinator = new EmbeddedCoordinator();
private final EmbeddedRouter router = new EmbeddedRouter();
Expand Down Expand Up @@ -1040,5 +1040,5 @@ protected static List<Map<String, Object>> getServersWithoutNonConfigurableField
return newServer;
}
);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

import javax.annotation.Nullable;
import javax.ws.rs.core.MediaType;

import java.net.URL;

public class HttpUtil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
import java.util.function.Function;

/**
* Client to call various basic auth APIs on the Coordinator.
* Client to call various basic auth APIs on the Coordinator.
*/
public class SecurityClient
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@

import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLException;

import java.io.IOException;
import java.net.URL;
import java.nio.channels.ClosedChannelException;
Expand Down Expand Up @@ -439,7 +440,7 @@ private void verifyGetStatusIsOk(HttpClient httpClient, EmbeddedDruidServer<?> s
{
makeRequest(httpClient, HttpMethod.GET, getServerUrl(server) + "/status");
}

private void verifyGetStatusHttpsIsOk(HttpClient httpClient, EmbeddedDruidServer<?> server)
{
makeRequest(httpClient, HttpMethod.GET, getServerHttpsUrl(server) + "/status");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

import javax.net.ssl.SSLEngine;
import javax.net.ssl.X509ExtendedTrustManager;

import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ public List<TableMetadata> listTablesInSchema(String schemaName)
);
return getFromCoordinator(url, new TypeReference<>() {});
}

private EmbeddedServiceClient serviceClient()
{
return cluster.callApi().serviceClient();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ public static List<ClusterCompactionConfig> getClusterCompactionConfig()
new ClusterCompactionConfig(0.5, 10, null, true, CompactionEngine.MSQ, true)
);
}

@Override
protected EmbeddedDruidCluster createCluster()
{
Expand Down Expand Up @@ -1987,7 +1987,7 @@ private void getAndAssertCompactionStatus(
Assertions.assertEquals(actualStatus.getIntervalCountCompacted(), intervalCountCompacted);
Assertions.assertEquals(actualStatus.getIntervalCountSkipped(), intervalCountSkipped);
}

private List<TaskStatusPlus> getCompleteTasksForDataSource(String dataSource)
{
return ImmutableList.copyOf(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@
import org.junit.jupiter.params.provider.MethodSource;

import javax.annotation.Nullable;

import java.nio.charset.StandardCharsets;
import java.time.Duration;
import java.util.ArrayList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import org.testcontainers.utility.DockerImageName;

import javax.annotation.Nullable;

import java.net.URI;
import java.time.Duration;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
import javax.net.ssl.KeyManagerFactory;
import javax.net.ssl.SSLContext;
import javax.net.ssl.TrustManagerFactory;

import java.io.FileInputStream;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import org.testcontainers.containers.wait.strategy.Wait;

import javax.annotation.Nullable;

import java.io.File;
import java.util.HashMap;
import java.util.Map;
Expand Down Expand Up @@ -133,7 +134,7 @@ public void createNamespace(String namespace)
}

/**
* Drops a namespace from the REST catalog.
* Drops a namespace from the REST catalog.
*/
public void dropNamespace(String namespace)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import org.apache.druid.testing.embedded.EmbeddedDruidCluster;

import javax.annotation.Nonnull;

import java.io.Closeable;
import java.util.Collections;
import java.util.Map;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,23 +155,23 @@ public void test_avroDataFormat() throws Exception
streamResource.createTopicWithPartitions(dataSource, 3);
EventSerializer serializer = new AvroEventSerializer();
int recordCount = generateStreamAndPublish(dataSource, serializer, false);

Map<String, Object> avroSchema = createWikipediaAvroSchemaMap();

InlineSchemaAvroBytesDecoder avroBytesDecoder = new InlineSchemaAvroBytesDecoder(
overlord.bindings().jsonMapper(),
avroSchema
);

JSONPathSpec flattenSpec = new JSONPathSpec(true, null);

AvroStreamInputFormat inputFormat = new AvroStreamInputFormat(
flattenSpec,
avroBytesDecoder,
false,
null
);

SupervisorSpec supervisorSpec = createSupervisor(dataSource, dataSource, inputFormat);
final String supervisorId = cluster.callApi().postSupervisor(supervisorSpec);
Assertions.assertEquals(dataSource, supervisorId);
Expand Down Expand Up @@ -383,7 +383,7 @@ private Map<String, Object> createWikipediaAvroSchemaMap()
schema.put("namespace", "org.apache.druid");
schema.put("name", "wikipedia");
schema.put("type", "record");

List<Map<String, Object>> fields = new ArrayList<>();
fields.add(Map.of("name", "timestamp", "type", "string"));
fields.add(Map.of("name", "page", "type", "string"));
Expand All @@ -401,7 +401,7 @@ private Map<String, Object> createWikipediaAvroSchemaMap()
fields.add(Map.of("name", "added", "type", "long"));
fields.add(Map.of("name", "deleted", "type", "long"));
fields.add(Map.of("name", "delta", "type", "long"));

schema.put("fields", fields);
return schema;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ protected EmbeddedDruidCluster addServers(EmbeddedDruidCluster cluster)
// Add an EmbeddedOverlord and EmbeddedBroker to use their client and mapper bindings.
overlord.addProperty("druid.plaintextPort", "7090");
broker.addProperty("druid.plaintextPort", "7082");

return cluster
.useContainerFriendlyHostname()
.useDefaultTimeoutForLatchableEmitter(120)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
import org.jboss.netty.handler.codec.http.HttpResponseStatus;

import javax.annotation.Nullable;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;


import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.DriverManager;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
import org.junit.jupiter.api.BeforeAll;

import javax.ws.rs.core.MediaType;

import java.net.MalformedURLException;
import java.net.URL;
import java.nio.charset.StandardCharsets;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
import org.testcontainers.shaded.com.google.common.io.ByteStreams;

import javax.annotation.Nullable;

import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import org.junit.jupiter.params.provider.FieldSource;

import javax.ws.rs.core.MediaType;

import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ public void test_serverPropertiesTable_specificProperty()
String[] actualRows = result.split("\n");
Arrays.sort(actualRows, String::compareTo);
Assertions.assertArrayEquals(expectedRows, actualRows);

}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import org.apache.druid.java.util.common.StringUtils;

import javax.annotation.Nullable;

import java.util.Iterator;
import java.util.List;
import java.util.Map;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@

import javax.annotation.Nonnull;
import javax.annotation.Nullable;

import java.net.URI;
import java.util.Iterator;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
import org.apache.druid.utils.CompressionUtils;

import javax.tools.FileObject;

import java.io.File;
import java.io.FilterInputStream;
import java.io.IOException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import org.apache.druid.java.util.common.StringUtils;

import javax.annotation.Nullable;

import java.net.URI;
import java.util.Collections;
import java.util.Iterator;
Expand Down
Loading
Loading