From b44940d5c82952e33b198fc1c20ab66a29abc1a6 Mon Sep 17 00:00:00 2001 From: Adrian Cole <64215+codefromthecrypt@users.noreply.github.com> Date: Mon, 15 Apr 2024 20:44:13 -1000 Subject: [PATCH] Raises floor JRE version from 11 to 17 except core (#3763) This raises the floor JRE version of libraries except core from 11 to 17. The only reason we had 17 in the past was due to Spark limitations that affected zipkin-dependencies. After this, folks can also consider getting rid of AutoValue for the record type (sadly no OpenRewrite for that ;). This change was manual except the parts about string formatting, exception coercing and multi-line literals. Those parts were done with OpenRewrite via below (reverting changes to core): ```bash $ mvn -U org.openrewrite.maven:rewrite-maven-plugin:run -Drewrite.recipeArtifactCoordinates=org.openrewrite.recipe:rewrite-migrate-java:RELEASE -Drewrite.activeRecipes=org.openrewrite.java.migrate.UpgradeToJava17 ``` The other non-manual step was about JOOQ, which was copy/pasting commands from the README, which worked without any issue. --------- Signed-off-by: Adrian Cole --- README.md | 2 +- benchmarks/pom.xml | 2 +- docker/test-images/zipkin-eureka/pom.xml | 6 +- pom.xml | 14 +-- zipkin-collector/README.md | 2 +- zipkin-collector/activemq/pom.xml | 2 +- .../collector/activemq/ActiveMQCollector.java | 4 +- .../activemq/ActiveMQSpanConsumer.java | 7 +- zipkin-collector/core/pom.xml | 2 +- .../java/zipkin2/collector/Collector.java | 3 +- zipkin-collector/kafka/pom.xml | 2 +- zipkin-collector/pom.xml | 2 +- zipkin-collector/rabbitmq/pom.xml | 2 +- zipkin-collector/scribe/pom.xml | 2 +- .../collector/scribe/ScribeSpanConsumer.java | 2 +- .../collector/scribe/generated/LogEntry.java | 4 +- .../collector/scribe/generated/Scribe.java | 12 +- zipkin-junit5/pom.xml | 2 +- .../java/zipkin2/junit5/ZipkinExtension.java | 2 +- zipkin-lens/pom.xml | 2 +- zipkin-server/RATIONALE.md | 5 +- zipkin-server/README.md | 2 +- zipkin-server/pom.xml | 2 +- zipkin-storage/cassandra/pom.xml | 2 +- .../zipkin2/storage/cassandra/Schema.java | 12 +- .../cassandra/SelectTraceIdsFromSpan.java | 12 +- .../internal/call/ResultSetFutureCall.java | 8 +- zipkin-storage/elasticsearch/pom.xml | 2 +- .../VersionSpecificTemplates.java | 36 +++--- .../internal/IndexNameFormatter.java | 5 +- .../internal/client/HttpCall.java | 6 +- zipkin-storage/mysql-v1/pom.xml | 5 +- .../storage/mysql/v1/HasErrorCount.java | 6 +- .../zipkin2/storage/mysql/v1/HasIpv6.java | 6 +- .../v1/HasPreAggregatedDependencies.java | 6 +- .../mysql/v1/HasRemoteServiceName.java | 8 +- .../storage/mysql/v1/HasTraceIdHigh.java | 20 +-- .../v1/internal/generated/DefaultCatalog.java | 6 +- .../mysql/v1/internal/generated/Indexes.java | 20 +++ .../mysql/v1/internal/generated/Keys.java | 2 + .../generated/tables/ZipkinAnnotations.java | 119 ++++++++++++++++-- .../generated/tables/ZipkinDependencies.java | 115 +++++++++++++++-- .../generated/tables/ZipkinSpans.java | 117 +++++++++++++++-- zipkin-storage/pom.xml | 2 +- zipkin-tests/pom.xml | 2 +- zipkin/pom.xml | 2 +- 46 files changed, 467 insertions(+), 137 deletions(-) diff --git a/README.md b/README.md index 41c8ec73738..7f4ef0046e4 100644 --- a/README.md +++ b/README.md @@ -112,7 +112,7 @@ does not use this library. So, [brave](https://github.com/openzipkin/brave) stil ## Storage Component Zipkin includes a [StorageComponent](zipkin/src/main/java/zipkin2/storage/StorageComponent.java), used to store and query spans and dependency links. This is used by the server and those making collectors, or span reporters. -For this reason, storage components have minimal dependencies, though require Java 11+. +For this reason, storage components have minimal dependencies, though require Java 17+. Ex. ```java diff --git a/benchmarks/pom.xml b/benchmarks/pom.xml index 76e98b30585..4ef8af5a388 100644 --- a/benchmarks/pom.xml +++ b/benchmarks/pom.xml @@ -11,7 +11,7 @@ io.zipkin zipkin-parent - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT benchmarks diff --git a/docker/test-images/zipkin-eureka/pom.xml b/docker/test-images/zipkin-eureka/pom.xml index 9778d2099a0..06f4d570d87 100644 --- a/docker/test-images/zipkin-eureka/pom.xml +++ b/docker/test-images/zipkin-eureka/pom.xml @@ -18,9 +18,9 @@ Netflix Eureka test binary - 11 - 11 - 11 + 17 + 17 + 17 diff --git a/pom.xml b/pom.xml index 5b500bca397..c3604b06e8e 100755 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ io.zipkin zipkin-parent - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT pom @@ -30,12 +30,12 @@ UTF-8 UTF-8 - - 11 - 11 - 11 + + 17 + 17 + 17 17 17 17 diff --git a/zipkin-collector/README.md b/zipkin-collector/README.md index 51d3bcaa0f0..572f59334c7 100644 --- a/zipkin-collector/README.md +++ b/zipkin-collector/README.md @@ -3,7 +3,7 @@ Modules here implement popular transport options available by default in the [server build](../zipkin-server). -Please note all modules here require JRE 11+ +Please note all modules here require JRE 17+ These libraries are also usable outside the server, for example in custom collectors or storage pipelines. While compatibility guarantees diff --git a/zipkin-collector/activemq/pom.xml b/zipkin-collector/activemq/pom.xml index 464af29606a..b704a5e163f 100644 --- a/zipkin-collector/activemq/pom.xml +++ b/zipkin-collector/activemq/pom.xml @@ -11,7 +11,7 @@ io.zipkin.zipkin2 zipkin-collector-parent - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT zipkin-collector-activemq diff --git a/zipkin-collector/activemq/src/main/java/zipkin2/collector/activemq/ActiveMQCollector.java b/zipkin-collector/activemq/src/main/java/zipkin2/collector/activemq/ActiveMQCollector.java index 8157aa0f089..af286027022 100644 --- a/zipkin-collector/activemq/src/main/java/zipkin2/collector/activemq/ActiveMQCollector.java +++ b/zipkin-collector/activemq/src/main/java/zipkin2/collector/activemq/ActiveMQCollector.java @@ -105,8 +105,8 @@ public Builder concurrency(int concurrency) { static RuntimeException uncheckedException(String prefix, JMSException e) { Exception cause = e.getLinkedException(); - if (cause instanceof IOException) { - return new UncheckedIOException(prefix + message(cause), (IOException) cause); + if (cause instanceof IOException exception) { + return new UncheckedIOException(prefix + message(cause), exception); } return new RuntimeException(prefix + message(e), e); } diff --git a/zipkin-collector/activemq/src/main/java/zipkin2/collector/activemq/ActiveMQSpanConsumer.java b/zipkin-collector/activemq/src/main/java/zipkin2/collector/activemq/ActiveMQSpanConsumer.java index ec8ac094cef..157de0de626 100644 --- a/zipkin-collector/activemq/src/main/java/zipkin2/collector/activemq/ActiveMQSpanConsumer.java +++ b/zipkin-collector/activemq/src/main/java/zipkin2/collector/activemq/ActiveMQSpanConsumer.java @@ -88,12 +88,11 @@ void registerInNewSession(ActiveMQConnection connection, String queue) throws JM metrics.incrementMessages(); byte[] serialized; // TODO: consider how to reuse buffers here try { - if (message instanceof BytesMessage) { - BytesMessage bytesMessage = (BytesMessage) message; + if (message instanceof BytesMessage bytesMessage) { serialized = new byte[(int) bytesMessage.getBodyLength()]; bytesMessage.readBytes(serialized); - } else if (message instanceof TextMessage) { - String text = ((TextMessage) message).getText(); + } else if (message instanceof TextMessage textMessage) { + String text = textMessage.getText(); serialized = text.getBytes(UTF_8); } else { metrics.incrementMessagesDropped(); diff --git a/zipkin-collector/core/pom.xml b/zipkin-collector/core/pom.xml index 34b7ebea653..f39c89422d0 100644 --- a/zipkin-collector/core/pom.xml +++ b/zipkin-collector/core/pom.xml @@ -11,7 +11,7 @@ io.zipkin.zipkin2 zipkin-collector-parent - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT zipkin-collector diff --git a/zipkin-collector/core/src/main/java/zipkin2/collector/Collector.java b/zipkin-collector/core/src/main/java/zipkin2/collector/Collector.java index 38276faaffe..65290958668 100644 --- a/zipkin-collector/core/src/main/java/zipkin2/collector/Collector.java +++ b/zipkin-collector/core/src/main/java/zipkin2/collector/Collector.java @@ -19,7 +19,6 @@ import zipkin2.codec.SpanBytesDecoder; import zipkin2.storage.StorageComponent; -import static java.lang.String.format; import static zipkin2.Call.propagateIfFatal; /** @@ -265,7 +264,7 @@ void handleError(Throwable e, Supplier defaultLogMessage, Callback logger.debug(error, e); } else { // otherwise, beautify the message String message = - format("%s due to %s(%s)", defaultLogMessage.get(), e.getClass().getSimpleName(), error); + "%s due to %s(%s)".formatted(defaultLogMessage.get(), e.getClass().getSimpleName(), error); logger.debug(message, e); } } diff --git a/zipkin-collector/kafka/pom.xml b/zipkin-collector/kafka/pom.xml index 93eb73fc4e8..8d5fde4a943 100644 --- a/zipkin-collector/kafka/pom.xml +++ b/zipkin-collector/kafka/pom.xml @@ -11,7 +11,7 @@ io.zipkin.zipkin2 zipkin-collector-parent - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT zipkin-collector-kafka diff --git a/zipkin-collector/pom.xml b/zipkin-collector/pom.xml index 07639f1b327..096de6c9606 100644 --- a/zipkin-collector/pom.xml +++ b/zipkin-collector/pom.xml @@ -11,7 +11,7 @@ io.zipkin zipkin-parent - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT io.zipkin.zipkin2 diff --git a/zipkin-collector/rabbitmq/pom.xml b/zipkin-collector/rabbitmq/pom.xml index 0894e46baad..63c64a71874 100644 --- a/zipkin-collector/rabbitmq/pom.xml +++ b/zipkin-collector/rabbitmq/pom.xml @@ -11,7 +11,7 @@ io.zipkin.zipkin2 zipkin-collector-parent - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT zipkin-collector-rabbitmq diff --git a/zipkin-collector/scribe/pom.xml b/zipkin-collector/scribe/pom.xml index da79fb4a3e2..3ef67ebb934 100644 --- a/zipkin-collector/scribe/pom.xml +++ b/zipkin-collector/scribe/pom.xml @@ -11,7 +11,7 @@ io.zipkin.zipkin2 zipkin-collector-parent - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT zipkin-collector-scribe diff --git a/zipkin-collector/scribe/src/main/java/zipkin2/collector/scribe/ScribeSpanConsumer.java b/zipkin-collector/scribe/src/main/java/zipkin2/collector/scribe/ScribeSpanConsumer.java index caeb44ee92e..9c4196e4e97 100644 --- a/zipkin-collector/scribe/src/main/java/zipkin2/collector/scribe/ScribeSpanConsumer.java +++ b/zipkin-collector/scribe/src/main/java/zipkin2/collector/scribe/ScribeSpanConsumer.java @@ -57,7 +57,7 @@ public void Log(List messages, AsyncMethodCallback resultH } @Override public void onError(Throwable t) { - Exception error = t instanceof Exception ? (Exception) t : new RuntimeException(t); + Exception error = t instanceof Exception e ? e : new RuntimeException(t); resultHandler.onError(error); } // Collectors may not be asynchronous so switch to blocking executor here. diff --git a/zipkin-collector/scribe/src/main/java/zipkin2/collector/scribe/generated/LogEntry.java b/zipkin-collector/scribe/src/main/java/zipkin2/collector/scribe/generated/LogEntry.java index 395867f8f04..dadd6c9312b 100644 --- a/zipkin-collector/scribe/src/main/java/zipkin2/collector/scribe/generated/LogEntry.java +++ b/zipkin-collector/scribe/src/main/java/zipkin2/collector/scribe/generated/LogEntry.java @@ -232,8 +232,8 @@ public boolean isSet(_Fields field) { public boolean equals(java.lang.Object that) { if (that == null) return false; - if (that instanceof LogEntry) - return this.equals((LogEntry)that); + if (that instanceof LogEntry entry) + return this.equals(entry); return false; } diff --git a/zipkin-collector/scribe/src/main/java/zipkin2/collector/scribe/generated/Scribe.java b/zipkin-collector/scribe/src/main/java/zipkin2/collector/scribe/generated/Scribe.java index 56be78c2195..203d34a4132 100644 --- a/zipkin-collector/scribe/src/main/java/zipkin2/collector/scribe/generated/Scribe.java +++ b/zipkin-collector/scribe/src/main/java/zipkin2/collector/scribe/generated/Scribe.java @@ -207,10 +207,10 @@ public void onError(java.lang.Exception e) { _LOGGER.error("TTransportException inside handler", e); fb.close(); return; - } else if (e instanceof org.apache.thrift.TApplicationException) { + } else if (e instanceof org.apache.thrift.TApplicationException exception) { _LOGGER.error("TApplicationException inside handler", e); msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TApplicationException)e; + msg = exception; } else { _LOGGER.error("Exception inside handler", e); msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; @@ -431,8 +431,8 @@ public boolean isSet(_Fields field) { public boolean equals(java.lang.Object that) { if (that == null) return false; - if (that instanceof Log_args) - return this.equals((Log_args)that); + if (that instanceof Log_args log_args) + return this.equals(log_args); return false; } @@ -848,8 +848,8 @@ public boolean isSet(_Fields field) { public boolean equals(java.lang.Object that) { if (that == null) return false; - if (that instanceof Log_result) - return this.equals((Log_result)that); + if (that instanceof Log_result log_result) + return this.equals(log_result); return false; } diff --git a/zipkin-junit5/pom.xml b/zipkin-junit5/pom.xml index cef841eca9b..2377819b06e 100644 --- a/zipkin-junit5/pom.xml +++ b/zipkin-junit5/pom.xml @@ -11,7 +11,7 @@ io.zipkin zipkin-parent - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT io.zipkin.zipkin2 diff --git a/zipkin-junit5/src/main/java/zipkin2/junit5/ZipkinExtension.java b/zipkin-junit5/src/main/java/zipkin2/junit5/ZipkinExtension.java index d7cdb092f6a..10a5caf4113 100644 --- a/zipkin-junit5/src/main/java/zipkin2/junit5/ZipkinExtension.java +++ b/zipkin-junit5/src/main/java/zipkin2/junit5/ZipkinExtension.java @@ -64,7 +64,7 @@ public ZipkinExtension() { /** Use this to connect. The zipkin v1 interface will be under "/api/v1" */ public String httpUrl() { - return String.format("http://%s:%s", server.getHostName(), server.getPort()); + return "http://%s:%s".formatted(server.getHostName(), server.getPort()); } /** Use this to see how many requests you've sent to any zipkin http endpoint. */ diff --git a/zipkin-lens/pom.xml b/zipkin-lens/pom.xml index 0fb3f2e0a05..5e0eecd80e5 100644 --- a/zipkin-lens/pom.xml +++ b/zipkin-lens/pom.xml @@ -11,7 +11,7 @@ io.zipkin zipkin-parent - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT zipkin-lens diff --git a/zipkin-server/RATIONALE.md b/zipkin-server/RATIONALE.md index 0d676eb2025..eed907e59d6 100644 --- a/zipkin-server/RATIONALE.md +++ b/zipkin-server/RATIONALE.md @@ -7,9 +7,8 @@ such as our ability to change spring boot or armeria whenever we want. ## Java 17 As Zipkin Server is a Spring Boot 3 application, it requires minimum JRE 17 to -run. The collector and storage modules it uses remain at Java 11 bytecode until -the zipkin-dependencies job can run on JRE 17, or its tests no longer share -storage classes. +run. Its collector and storage modules are also used by zipkin-dependencies +which as of version 3.2 can operate on JRE 17 (due to Spark 3.4+). ## Modules diff --git a/zipkin-server/README.md b/zipkin-server/README.md index 8b280863370..3e2755965ae 100644 --- a/zipkin-server/README.md +++ b/zipkin-server/README.md @@ -1,5 +1,5 @@ # zipkin-server -Zipkin Server is a Java 11+ service, packaged as an executable jar. +Zipkin Server is a Java 17+ service, packaged as an executable jar. Span storage and collectors are [configurable](#configuration). By default, storage is in-memory, the HTTP collector (POST /api/v2/spans endpoint) is enabled, and the server listens on port 9411. diff --git a/zipkin-server/pom.xml b/zipkin-server/pom.xml index b6b91733306..0f494fae80e 100644 --- a/zipkin-server/pom.xml +++ b/zipkin-server/pom.xml @@ -11,7 +11,7 @@ io.zipkin zipkin-parent - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT zipkin-server diff --git a/zipkin-storage/cassandra/pom.xml b/zipkin-storage/cassandra/pom.xml index 28afea81f87..5e93574f638 100644 --- a/zipkin-storage/cassandra/pom.xml +++ b/zipkin-storage/cassandra/pom.xml @@ -11,7 +11,7 @@ io.zipkin.zipkin2 zipkin-storage-parent - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT zipkin-storage-cassandra diff --git a/zipkin-storage/cassandra/src/main/java/zipkin2/storage/cassandra/Schema.java b/zipkin-storage/cassandra/src/main/java/zipkin2/storage/cassandra/Schema.java index 50ffc07100f..7df1d860765 100644 --- a/zipkin-storage/cassandra/src/main/java/zipkin2/storage/cassandra/Schema.java +++ b/zipkin-storage/cassandra/src/main/java/zipkin2/storage/cassandra/Schema.java @@ -89,7 +89,7 @@ static Metadata validate(CassandraStorage cassandra, CqlSession session) { } static void logAndThrow(String messageFormat, Object... args) { - String message = String.format(messageFormat, args); + String message = messageFormat.formatted(args); // Ensure we can look at logs to see the problem. Otherwise, it may only // be visible in API error responses, such as /health or /api/v2/traces. LOG.error(message); @@ -124,8 +124,8 @@ static KeyspaceMetadata ensureKeyspaceMetadata(CqlSession session, String keyspa KeyspaceMetadata keyspaceMetadata = session.getMetadata().getKeyspace(keyspace).orElse(null); if (keyspaceMetadata == null) { throw new IllegalStateException( - String.format( - "Cannot read keyspace metadata for keyspace: %s and cluster: %s", + + "Cannot read keyspace metadata for keyspace: %s and cluster: %s".formatted( keyspace, session.getMetadata().getClusterName())); } return keyspaceMetadata; @@ -137,8 +137,8 @@ static Version ensureVersion(com.datastax.oss.driver.api.core.metadata.Metadata version = entry.getValue().getCassandraVersion(); if (version == null) throw new RuntimeException("node had no version: " + entry.getValue()); if (Version.parse("3.11.3").compareTo(version) > 0) { - throw new RuntimeException(String.format( - "Node %s is running Cassandra %s, but minimum version is 3.11.3", + throw new RuntimeException( + "Node %s is running Cassandra %s, but minimum version is 3.11.3".formatted( entry.getKey(), entry.getValue().getCassandraVersion())); } } @@ -194,7 +194,7 @@ static void applyCqlFile(Version version, String keyspace, CqlSession session, S session.execute(cmd); } catch (InvalidQueryException e) { // Add context so it is obvious which line was wrong - String message = String.format("Failed to execute [%s]: %s", cmd, e.getMessage()); + String message = "Failed to execute [%s]: %s".formatted(cmd, e.getMessage()); // Ensure we can look at logs to see the problem. Otherwise, it may only // be visible in API error responses, such as /health or /api/v2/traces. LOG.error(message); diff --git a/zipkin-storage/cassandra/src/main/java/zipkin2/storage/cassandra/SelectTraceIdsFromSpan.java b/zipkin-storage/cassandra/src/main/java/zipkin2/storage/cassandra/SelectTraceIdsFromSpan.java index 7c54c48cd26..611725abb78 100644 --- a/zipkin-storage/cassandra/src/main/java/zipkin2/storage/cassandra/SelectTraceIdsFromSpan.java +++ b/zipkin-storage/cassandra/src/main/java/zipkin2/storage/cassandra/SelectTraceIdsFromSpan.java @@ -57,11 +57,13 @@ static final class Factory { Factory(CqlSession session) { this.session = session; - String querySuffix = "annotation_query LIKE ?" - + " AND ts_uuid>=?" - + " AND ts_uuid<=?" - + " LIMIT ?" - + " ALLOW FILTERING"; + String querySuffix = """ + annotation_query LIKE ?\ + AND ts_uuid>=?\ + AND ts_uuid<=?\ + LIMIT ?\ + ALLOW FILTERING\ + """; this.withAnnotationQuery = session.prepare("SELECT trace_id,ts" + " FROM " + TABLE_SPAN + " WHERE " + querySuffix); diff --git a/zipkin-storage/cassandra/src/main/java/zipkin2/storage/cassandra/internal/call/ResultSetFutureCall.java b/zipkin-storage/cassandra/src/main/java/zipkin2/storage/cassandra/internal/call/ResultSetFutureCall.java index b28a8be6c43..c237c3ca4b7 100644 --- a/zipkin-storage/cassandra/src/main/java/zipkin2/storage/cassandra/internal/call/ResultSetFutureCall.java +++ b/zipkin-storage/cassandra/src/main/java/zipkin2/storage/cassandra/internal/call/ResultSetFutureCall.java @@ -95,11 +95,11 @@ static T getUninterruptibly(CompletionStage stage) { interrupted = true; } catch (ExecutionException e) { Throwable cause = e.getCause(); - if (cause instanceof DriverException) { - throw ((DriverException) cause).copy(); + if (cause instanceof DriverException exception) { + throw exception.copy(); } - if (cause instanceof RuntimeException) throw (RuntimeException) cause; - if (cause instanceof Error) throw (Error) cause; + if (cause instanceof RuntimeException exception) throw exception; + if (cause instanceof Error error) throw error; throw new DriverExecutionException(cause); } } diff --git a/zipkin-storage/elasticsearch/pom.xml b/zipkin-storage/elasticsearch/pom.xml index 1fac66ee151..e11b5232c1a 100644 --- a/zipkin-storage/elasticsearch/pom.xml +++ b/zipkin-storage/elasticsearch/pom.xml @@ -11,7 +11,7 @@ io.zipkin.zipkin2 zipkin-storage-parent - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT zipkin-storage-elasticsearch diff --git a/zipkin-storage/elasticsearch/src/main/java/zipkin2/elasticsearch/VersionSpecificTemplates.java b/zipkin-storage/elasticsearch/src/main/java/zipkin2/elasticsearch/VersionSpecificTemplates.java index 585b61cac08..b40f66423b4 100644 --- a/zipkin-storage/elasticsearch/src/main/java/zipkin2/elasticsearch/VersionSpecificTemplates.java +++ b/zipkin-storage/elasticsearch/src/main/java/zipkin2/elasticsearch/VersionSpecificTemplates.java @@ -111,23 +111,25 @@ String spanIndexTemplate(ElasticsearchVersion version) { // in a transition, and keep trace ID length transitions as short time as possible. traceIdMapping = "{ \"type\": \"text\", \"fielddata\": \"true\", \"analyzer\": \"traceId_analyzer\" }"; - result += (",\n" - + " \"analysis\": {\n" - + " \"analyzer\": {\n" - + " \"traceId_analyzer\": {\n" - + " \"type\": \"custom\",\n" - + " \"tokenizer\": \"keyword\",\n" - + " \"filter\": \"traceId_filter\"\n" - + " }\n" - + " },\n" - + " \"filter\": {\n" - + " \"traceId_filter\": {\n" - + " \"type\": \"pattern_capture\",\n" - + " \"patterns\": [\"([0-9a-f]{1,16})$\"],\n" - + " \"preserve_original\": true\n" - + " }\n" - + " }\n" - + " }\n"); + result += (""" + , + "analysis": { + "analyzer": { + "traceId_analyzer": { + "type": "custom", + "tokenizer": "keyword", + "filter": "traceId_filter" + } + }, + "filter": { + "traceId_filter": { + "type": "pattern_capture", + "patterns": ["([0-9a-f]{1,16})$"], + "preserve_original": true + } + } + } + """); } result += " },\n"; diff --git a/zipkin-storage/elasticsearch/src/main/java/zipkin2/elasticsearch/internal/IndexNameFormatter.java b/zipkin-storage/elasticsearch/src/main/java/zipkin2/elasticsearch/internal/IndexNameFormatter.java index 40cb1469b93..98c0a27fa39 100644 --- a/zipkin-storage/elasticsearch/src/main/java/zipkin2/elasticsearch/internal/IndexNameFormatter.java +++ b/zipkin-storage/elasticsearch/src/main/java/zipkin2/elasticsearch/internal/IndexNameFormatter.java @@ -111,7 +111,7 @@ public List formatTypeAndRange(@Nullable String type, long beginMillis, current.set(Calendar.DAY_OF_YEAR, current.getActualMaximum(Calendar.DAY_OF_YEAR)); if (current.compareTo(end) <= 0) { indices.add( - String.format("%s-%s%c*", prefix, current.get(Calendar.YEAR), dateSeparator())); + "%s-%s%c*".formatted(prefix, current.get(Calendar.YEAR), dateSeparator())); current.add(DAY_OF_MONTH, 1); // rollover to next year continue; } else { @@ -156,8 +156,7 @@ public List formatTypeAndRange(@Nullable String type, long beginMillis, } String formatIndexPattern(String format, GregorianCalendar current, String prefix) { - return String.format( - format, + return format.formatted( prefix, current.get(Calendar.YEAR), dateSeparator(), diff --git a/zipkin-storage/elasticsearch/src/main/java/zipkin2/elasticsearch/internal/client/HttpCall.java b/zipkin-storage/elasticsearch/src/main/java/zipkin2/elasticsearch/internal/client/HttpCall.java index 2e400c65bdf..f4d2e78aa9b 100644 --- a/zipkin-storage/elasticsearch/src/main/java/zipkin2/elasticsearch/internal/client/HttpCall.java +++ b/zipkin-storage/elasticsearch/src/main/java/zipkin2/elasticsearch/internal/client/HttpCall.java @@ -122,8 +122,10 @@ public HttpCall newCall( // TODO: testme for (EventExecutor eventLoop : httpClient.options().factory().eventLoopGroup()) { if (eventLoop.inEventLoop()) { - throw new RuntimeException("Attempting to make a blocking request from an event loop. " - + "Either use doEnqueue() or run this in a separate thread."); + throw new RuntimeException(""" + Attempting to make a blocking request from an event loop. \ + Either use doEnqueue() or run this in a separate thread.\ + """); } } final AggregatedHttpResponse response; diff --git a/zipkin-storage/mysql-v1/pom.xml b/zipkin-storage/mysql-v1/pom.xml index 54d69054962..842aab6751b 100644 --- a/zipkin-storage/mysql-v1/pom.xml +++ b/zipkin-storage/mysql-v1/pom.xml @@ -11,7 +11,7 @@ io.zipkin.zipkin2 zipkin-storage-parent - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT zipkin-storage-mysql-v1 @@ -20,8 +20,7 @@ ${project.basedir}/../.. - - 3.16.23 + 3.19.7 -Xep:InconsistentCapitalization:OFF diff --git a/zipkin-storage/mysql-v1/src/main/java/zipkin2/storage/mysql/v1/HasErrorCount.java b/zipkin-storage/mysql-v1/src/main/java/zipkin2/storage/mysql/v1/HasErrorCount.java index 2a166a0a01b..4cdb2508db9 100644 --- a/zipkin-storage/mysql-v1/src/main/java/zipkin2/storage/mysql/v1/HasErrorCount.java +++ b/zipkin-storage/mysql-v1/src/main/java/zipkin2/storage/mysql/v1/HasErrorCount.java @@ -25,8 +25,10 @@ static boolean test(DataSource datasource, DSLContexts context) { } catch (DataAccessException e) { if (e.sqlState().equals("42S22")) { LOG.warning( - "zipkin_dependencies.error_count doesn't exist, so DependencyLink.errorCount is not supported. " - + "Execute: alter table zipkin_dependencies add `error_count` BIGINT"); + """ + zipkin_dependencies.error_count doesn't exist, so DependencyLink.errorCount is not supported. \ + Execute: alter table zipkin_dependencies add `error_count` BIGINT\ + """); return false; } problemReading(e); diff --git a/zipkin-storage/mysql-v1/src/main/java/zipkin2/storage/mysql/v1/HasIpv6.java b/zipkin-storage/mysql-v1/src/main/java/zipkin2/storage/mysql/v1/HasIpv6.java index b98899261aa..596f7ab8783 100644 --- a/zipkin-storage/mysql-v1/src/main/java/zipkin2/storage/mysql/v1/HasIpv6.java +++ b/zipkin-storage/mysql-v1/src/main/java/zipkin2/storage/mysql/v1/HasIpv6.java @@ -25,8 +25,10 @@ static boolean test(DataSource datasource, DSLContexts context) { } catch (DataAccessException e) { if (e.sqlState().equals("42S22")) { LOG.warning( - "zipkin_annotations.ipv6 doesn't exist, so Endpoint.ipv6 is not supported. " - + "Execute: alter table zipkin_annotations add `endpoint_ipv6` BINARY(16)"); + """ + zipkin_annotations.ipv6 doesn't exist, so Endpoint.ipv6 is not supported. \ + Execute: alter table zipkin_annotations add `endpoint_ipv6` BINARY(16)\ + """); return false; } problemReading(e); diff --git a/zipkin-storage/mysql-v1/src/main/java/zipkin2/storage/mysql/v1/HasPreAggregatedDependencies.java b/zipkin-storage/mysql-v1/src/main/java/zipkin2/storage/mysql/v1/HasPreAggregatedDependencies.java index 17286fd008b..402867463e1 100644 --- a/zipkin-storage/mysql-v1/src/main/java/zipkin2/storage/mysql/v1/HasPreAggregatedDependencies.java +++ b/zipkin-storage/mysql-v1/src/main/java/zipkin2/storage/mysql/v1/HasPreAggregatedDependencies.java @@ -29,8 +29,10 @@ static boolean test(DataSource datasource, DSLContexts context) { } catch (DataAccessException e) { if (e.sqlState().equals("42S02")) { LOG.warning( - "zipkin_dependencies doesn't exist, so pre-aggregated dependencies are not " - + "supported. Execute mysql.sql located in this jar to add the table"); + """ + zipkin_dependencies doesn't exist, so pre-aggregated dependencies are not \ + supported. Execute mysql.sql located in this jar to add the table\ + """); return false; } problemReading(e); diff --git a/zipkin-storage/mysql-v1/src/main/java/zipkin2/storage/mysql/v1/HasRemoteServiceName.java b/zipkin-storage/mysql-v1/src/main/java/zipkin2/storage/mysql/v1/HasRemoteServiceName.java index fd9dfcc6f74..a5ce820ffc6 100644 --- a/zipkin-storage/mysql-v1/src/main/java/zipkin2/storage/mysql/v1/HasRemoteServiceName.java +++ b/zipkin-storage/mysql-v1/src/main/java/zipkin2/storage/mysql/v1/HasRemoteServiceName.java @@ -17,9 +17,11 @@ final class HasRemoteServiceName { static final Logger LOG = Logger.getLogger(HasRemoteServiceName.class.getName()); static final String MESSAGE = - "zipkin_spans.remote_service_name doesn't exist, so queries for remote service names will return empty.\n" - + "Execute: ALTER TABLE zipkin_spans ADD `remote_service_name` VARCHAR(255);\n" - + "ALTER TABLE zipkin_spans ADD INDEX `remote_service_name`;"; + """ + zipkin_spans.remote_service_name doesn't exist, so queries for remote service names will return empty. + Execute: ALTER TABLE zipkin_spans ADD `remote_service_name` VARCHAR(255); + ALTER TABLE zipkin_spans ADD INDEX `remote_service_name`;\ + """; static boolean test(DataSource datasource, DSLContexts context) { try (Connection conn = datasource.getConnection()) { diff --git a/zipkin-storage/mysql-v1/src/main/java/zipkin2/storage/mysql/v1/HasTraceIdHigh.java b/zipkin-storage/mysql-v1/src/main/java/zipkin2/storage/mysql/v1/HasTraceIdHigh.java index af02644b67e..add0d7df429 100644 --- a/zipkin-storage/mysql-v1/src/main/java/zipkin2/storage/mysql/v1/HasTraceIdHigh.java +++ b/zipkin-storage/mysql-v1/src/main/java/zipkin2/storage/mysql/v1/HasTraceIdHigh.java @@ -17,15 +17,17 @@ final class HasTraceIdHigh { static final Logger LOG = Logger.getLogger(HasTraceIdHigh.class.getName()); static final String MESSAGE = - "zipkin_spans.trace_id_high doesn't exist, so 128-bit trace ids are not supported. " - + "Execute: ALTER TABLE zipkin_spans ADD `trace_id_high` BIGINT NOT NULL DEFAULT 0;\n" - + "ALTER TABLE zipkin_annotations ADD `trace_id_high` BIGINT NOT NULL DEFAULT 0;\n" - + "ALTER TABLE zipkin_spans" - + " DROP INDEX trace_id,\n" - + " ADD UNIQUE KEY(`trace_id_high`, `trace_id`, `id`);\n" - + "ALTER TABLE zipkin_annotations\n" - + " DROP INDEX trace_id,\n" - + " ADD UNIQUE KEY(`trace_id_high`, `trace_id`, `span_id`, `a_key`, `a_timestamp`);"; + """ + zipkin_spans.trace_id_high doesn't exist, so 128-bit trace ids are not supported. \ + Execute: ALTER TABLE zipkin_spans ADD `trace_id_high` BIGINT NOT NULL DEFAULT 0; + ALTER TABLE zipkin_annotations ADD `trace_id_high` BIGINT NOT NULL DEFAULT 0; + ALTER TABLE zipkin_spans\ + DROP INDEX trace_id, + ADD UNIQUE KEY(`trace_id_high`, `trace_id`, `id`); + ALTER TABLE zipkin_annotations + DROP INDEX trace_id, + ADD UNIQUE KEY(`trace_id_high`, `trace_id`, `span_id`, `a_key`, `a_timestamp`);\ + """; static boolean test(DataSource datasource, DSLContexts context) { try (Connection conn = datasource.getConnection()) { diff --git a/zipkin-storage/mysql-v1/src/main/java/zipkin2/storage/mysql/v1/internal/generated/DefaultCatalog.java b/zipkin-storage/mysql-v1/src/main/java/zipkin2/storage/mysql/v1/internal/generated/DefaultCatalog.java index d7830ada5ae..42641c88539 100644 --- a/zipkin-storage/mysql-v1/src/main/java/zipkin2/storage/mysql/v1/internal/generated/DefaultCatalog.java +++ b/zipkin-storage/mysql-v1/src/main/java/zipkin2/storage/mysql/v1/internal/generated/DefaultCatalog.java @@ -45,10 +45,10 @@ public final List getSchemas() { } /** - * A reference to the 3.16 minor release of the code generator. If this + * A reference to the 3.19 minor release of the code generator. If this * doesn't compile, it's because the runtime library uses an older minor - * release, namely: 3.16. You can turn off the generation of this reference + * release, namely: 3.19. You can turn off the generation of this reference * by specifying /configuration/generator/generate/jooqVersionReference */ - private static final String REQUIRE_RUNTIME_JOOQ_VERSION = Constants.VERSION_3_16; + private static final String REQUIRE_RUNTIME_JOOQ_VERSION = Constants.VERSION_3_19; } diff --git a/zipkin-storage/mysql-v1/src/main/java/zipkin2/storage/mysql/v1/internal/generated/Indexes.java b/zipkin-storage/mysql-v1/src/main/java/zipkin2/storage/mysql/v1/internal/generated/Indexes.java index 1d689da4447..d9c0193ce23 100644 --- a/zipkin-storage/mysql-v1/src/main/java/zipkin2/storage/mysql/v1/internal/generated/Indexes.java +++ b/zipkin-storage/mysql-v1/src/main/java/zipkin2/storage/mysql/v1/internal/generated/Indexes.java @@ -25,22 +25,42 @@ public class Indexes { public static final Index ZIPKIN_ANNOTATIONS_A_KEY = Internal.createIndex(DSL.name("a_key"), ZipkinAnnotations.ZIPKIN_ANNOTATIONS, new OrderField[] { ZipkinAnnotations.ZIPKIN_ANNOTATIONS.A_KEY }, false); public static final Index ZIPKIN_ANNOTATIONS_A_KEY_2 = Internal.createIndex(DSL.name("a_key_2"), ZipkinAnnotations.ZIPKIN_ANNOTATIONS, new OrderField[] { ZipkinAnnotations.ZIPKIN_ANNOTATIONS.A_KEY }, false); + public static final Index ZIPKIN_ANNOTATIONS_A_KEY_3 = Internal.createIndex(DSL.name("a_key_3"), ZipkinAnnotations.ZIPKIN_ANNOTATIONS, new OrderField[] { ZipkinAnnotations.ZIPKIN_ANNOTATIONS.A_KEY }, false); + public static final Index ZIPKIN_ANNOTATIONS_A_KEY_4 = Internal.createIndex(DSL.name("a_key_4"), ZipkinAnnotations.ZIPKIN_ANNOTATIONS, new OrderField[] { ZipkinAnnotations.ZIPKIN_ANNOTATIONS.A_KEY }, false); public static final Index ZIPKIN_ANNOTATIONS_A_TYPE = Internal.createIndex(DSL.name("a_type"), ZipkinAnnotations.ZIPKIN_ANNOTATIONS, new OrderField[] { ZipkinAnnotations.ZIPKIN_ANNOTATIONS.A_TYPE }, false); public static final Index ZIPKIN_ANNOTATIONS_A_TYPE_2 = Internal.createIndex(DSL.name("a_type_2"), ZipkinAnnotations.ZIPKIN_ANNOTATIONS, new OrderField[] { ZipkinAnnotations.ZIPKIN_ANNOTATIONS.A_TYPE }, false); + public static final Index ZIPKIN_ANNOTATIONS_A_TYPE_3 = Internal.createIndex(DSL.name("a_type_3"), ZipkinAnnotations.ZIPKIN_ANNOTATIONS, new OrderField[] { ZipkinAnnotations.ZIPKIN_ANNOTATIONS.A_TYPE }, false); + public static final Index ZIPKIN_ANNOTATIONS_A_TYPE_4 = Internal.createIndex(DSL.name("a_type_4"), ZipkinAnnotations.ZIPKIN_ANNOTATIONS, new OrderField[] { ZipkinAnnotations.ZIPKIN_ANNOTATIONS.A_TYPE }, false); public static final Index ZIPKIN_ANNOTATIONS_ENDPOINT_SERVICE_NAME = Internal.createIndex(DSL.name("endpoint_service_name"), ZipkinAnnotations.ZIPKIN_ANNOTATIONS, new OrderField[] { ZipkinAnnotations.ZIPKIN_ANNOTATIONS.ENDPOINT_SERVICE_NAME }, false); public static final Index ZIPKIN_ANNOTATIONS_ENDPOINT_SERVICE_NAME_2 = Internal.createIndex(DSL.name("endpoint_service_name_2"), ZipkinAnnotations.ZIPKIN_ANNOTATIONS, new OrderField[] { ZipkinAnnotations.ZIPKIN_ANNOTATIONS.ENDPOINT_SERVICE_NAME }, false); + public static final Index ZIPKIN_ANNOTATIONS_ENDPOINT_SERVICE_NAME_3 = Internal.createIndex(DSL.name("endpoint_service_name_3"), ZipkinAnnotations.ZIPKIN_ANNOTATIONS, new OrderField[] { ZipkinAnnotations.ZIPKIN_ANNOTATIONS.ENDPOINT_SERVICE_NAME }, false); + public static final Index ZIPKIN_ANNOTATIONS_ENDPOINT_SERVICE_NAME_4 = Internal.createIndex(DSL.name("endpoint_service_name_4"), ZipkinAnnotations.ZIPKIN_ANNOTATIONS, new OrderField[] { ZipkinAnnotations.ZIPKIN_ANNOTATIONS.ENDPOINT_SERVICE_NAME }, false); public static final Index ZIPKIN_SPANS_NAME = Internal.createIndex(DSL.name("name"), ZipkinSpans.ZIPKIN_SPANS, new OrderField[] { ZipkinSpans.ZIPKIN_SPANS.NAME }, false); public static final Index ZIPKIN_SPANS_NAME_2 = Internal.createIndex(DSL.name("name_2"), ZipkinSpans.ZIPKIN_SPANS, new OrderField[] { ZipkinSpans.ZIPKIN_SPANS.NAME }, false); + public static final Index ZIPKIN_SPANS_NAME_3 = Internal.createIndex(DSL.name("name_3"), ZipkinSpans.ZIPKIN_SPANS, new OrderField[] { ZipkinSpans.ZIPKIN_SPANS.NAME }, false); + public static final Index ZIPKIN_SPANS_NAME_4 = Internal.createIndex(DSL.name("name_4"), ZipkinSpans.ZIPKIN_SPANS, new OrderField[] { ZipkinSpans.ZIPKIN_SPANS.NAME }, false); public static final Index ZIPKIN_SPANS_REMOTE_SERVICE_NAME = Internal.createIndex(DSL.name("remote_service_name"), ZipkinSpans.ZIPKIN_SPANS, new OrderField[] { ZipkinSpans.ZIPKIN_SPANS.REMOTE_SERVICE_NAME }, false); public static final Index ZIPKIN_SPANS_REMOTE_SERVICE_NAME_2 = Internal.createIndex(DSL.name("remote_service_name_2"), ZipkinSpans.ZIPKIN_SPANS, new OrderField[] { ZipkinSpans.ZIPKIN_SPANS.REMOTE_SERVICE_NAME }, false); + public static final Index ZIPKIN_SPANS_REMOTE_SERVICE_NAME_3 = Internal.createIndex(DSL.name("remote_service_name_3"), ZipkinSpans.ZIPKIN_SPANS, new OrderField[] { ZipkinSpans.ZIPKIN_SPANS.REMOTE_SERVICE_NAME }, false); + public static final Index ZIPKIN_SPANS_REMOTE_SERVICE_NAME_4 = Internal.createIndex(DSL.name("remote_service_name_4"), ZipkinSpans.ZIPKIN_SPANS, new OrderField[] { ZipkinSpans.ZIPKIN_SPANS.REMOTE_SERVICE_NAME }, false); public static final Index ZIPKIN_SPANS_START_TS = Internal.createIndex(DSL.name("start_ts"), ZipkinSpans.ZIPKIN_SPANS, new OrderField[] { ZipkinSpans.ZIPKIN_SPANS.START_TS }, false); public static final Index ZIPKIN_SPANS_START_TS_2 = Internal.createIndex(DSL.name("start_ts_2"), ZipkinSpans.ZIPKIN_SPANS, new OrderField[] { ZipkinSpans.ZIPKIN_SPANS.START_TS }, false); + public static final Index ZIPKIN_SPANS_START_TS_3 = Internal.createIndex(DSL.name("start_ts_3"), ZipkinSpans.ZIPKIN_SPANS, new OrderField[] { ZipkinSpans.ZIPKIN_SPANS.START_TS }, false); + public static final Index ZIPKIN_SPANS_START_TS_4 = Internal.createIndex(DSL.name("start_ts_4"), ZipkinSpans.ZIPKIN_SPANS, new OrderField[] { ZipkinSpans.ZIPKIN_SPANS.START_TS }, false); public static final Index ZIPKIN_ANNOTATIONS_TRACE_ID = Internal.createIndex(DSL.name("trace_id"), ZipkinAnnotations.ZIPKIN_ANNOTATIONS, new OrderField[] { ZipkinAnnotations.ZIPKIN_ANNOTATIONS.TRACE_ID, ZipkinAnnotations.ZIPKIN_ANNOTATIONS.SPAN_ID, ZipkinAnnotations.ZIPKIN_ANNOTATIONS.A_KEY }, false); public static final Index ZIPKIN_ANNOTATIONS_TRACE_ID_2 = Internal.createIndex(DSL.name("trace_id_2"), ZipkinAnnotations.ZIPKIN_ANNOTATIONS, new OrderField[] { ZipkinAnnotations.ZIPKIN_ANNOTATIONS.TRACE_ID, ZipkinAnnotations.ZIPKIN_ANNOTATIONS.SPAN_ID, ZipkinAnnotations.ZIPKIN_ANNOTATIONS.A_KEY }, false); + public static final Index ZIPKIN_ANNOTATIONS_TRACE_ID_3 = Internal.createIndex(DSL.name("trace_id_3"), ZipkinAnnotations.ZIPKIN_ANNOTATIONS, new OrderField[] { ZipkinAnnotations.ZIPKIN_ANNOTATIONS.TRACE_ID, ZipkinAnnotations.ZIPKIN_ANNOTATIONS.SPAN_ID, ZipkinAnnotations.ZIPKIN_ANNOTATIONS.A_KEY }, false); + public static final Index ZIPKIN_ANNOTATIONS_TRACE_ID_4 = Internal.createIndex(DSL.name("trace_id_4"), ZipkinAnnotations.ZIPKIN_ANNOTATIONS, new OrderField[] { ZipkinAnnotations.ZIPKIN_ANNOTATIONS.TRACE_ID, ZipkinAnnotations.ZIPKIN_ANNOTATIONS.SPAN_ID, ZipkinAnnotations.ZIPKIN_ANNOTATIONS.A_KEY }, false); public static final Index ZIPKIN_SPANS_TRACE_ID_HIGH = Internal.createIndex(DSL.name("trace_id_high"), ZipkinSpans.ZIPKIN_SPANS, new OrderField[] { ZipkinSpans.ZIPKIN_SPANS.TRACE_ID_HIGH, ZipkinSpans.ZIPKIN_SPANS.TRACE_ID }, false); + public static final Index ZIPKIN_ANNOTATIONS_TRACE_ID_HIGH_11 = Internal.createIndex(DSL.name("trace_id_high_11"), ZipkinAnnotations.ZIPKIN_ANNOTATIONS, new OrderField[] { ZipkinAnnotations.ZIPKIN_ANNOTATIONS.TRACE_ID_HIGH, ZipkinAnnotations.ZIPKIN_ANNOTATIONS.TRACE_ID, ZipkinAnnotations.ZIPKIN_ANNOTATIONS.SPAN_ID }, false); + public static final Index ZIPKIN_ANNOTATIONS_TRACE_ID_HIGH_12 = Internal.createIndex(DSL.name("trace_id_high_12"), ZipkinAnnotations.ZIPKIN_ANNOTATIONS, new OrderField[] { ZipkinAnnotations.ZIPKIN_ANNOTATIONS.TRACE_ID_HIGH, ZipkinAnnotations.ZIPKIN_ANNOTATIONS.TRACE_ID }, false); public static final Index ZIPKIN_ANNOTATIONS_TRACE_ID_HIGH_2 = Internal.createIndex(DSL.name("trace_id_high_2"), ZipkinAnnotations.ZIPKIN_ANNOTATIONS, new OrderField[] { ZipkinAnnotations.ZIPKIN_ANNOTATIONS.TRACE_ID_HIGH, ZipkinAnnotations.ZIPKIN_ANNOTATIONS.TRACE_ID, ZipkinAnnotations.ZIPKIN_ANNOTATIONS.SPAN_ID }, false); public static final Index ZIPKIN_SPANS_TRACE_ID_HIGH_2 = Internal.createIndex(DSL.name("trace_id_high_2"), ZipkinSpans.ZIPKIN_SPANS, new OrderField[] { ZipkinSpans.ZIPKIN_SPANS.TRACE_ID_HIGH, ZipkinSpans.ZIPKIN_SPANS.TRACE_ID }, false); public static final Index ZIPKIN_ANNOTATIONS_TRACE_ID_HIGH_3 = Internal.createIndex(DSL.name("trace_id_high_3"), ZipkinAnnotations.ZIPKIN_ANNOTATIONS, new OrderField[] { ZipkinAnnotations.ZIPKIN_ANNOTATIONS.TRACE_ID_HIGH, ZipkinAnnotations.ZIPKIN_ANNOTATIONS.TRACE_ID }, false); + public static final Index ZIPKIN_SPANS_TRACE_ID_HIGH_3 = Internal.createIndex(DSL.name("trace_id_high_3"), ZipkinSpans.ZIPKIN_SPANS, new OrderField[] { ZipkinSpans.ZIPKIN_SPANS.TRACE_ID_HIGH, ZipkinSpans.ZIPKIN_SPANS.TRACE_ID }, false); + public static final Index ZIPKIN_SPANS_TRACE_ID_HIGH_4 = Internal.createIndex(DSL.name("trace_id_high_4"), ZipkinSpans.ZIPKIN_SPANS, new OrderField[] { ZipkinSpans.ZIPKIN_SPANS.TRACE_ID_HIGH, ZipkinSpans.ZIPKIN_SPANS.TRACE_ID }, false); public static final Index ZIPKIN_ANNOTATIONS_TRACE_ID_HIGH_5 = Internal.createIndex(DSL.name("trace_id_high_5"), ZipkinAnnotations.ZIPKIN_ANNOTATIONS, new OrderField[] { ZipkinAnnotations.ZIPKIN_ANNOTATIONS.TRACE_ID_HIGH, ZipkinAnnotations.ZIPKIN_ANNOTATIONS.TRACE_ID, ZipkinAnnotations.ZIPKIN_ANNOTATIONS.SPAN_ID }, false); public static final Index ZIPKIN_ANNOTATIONS_TRACE_ID_HIGH_6 = Internal.createIndex(DSL.name("trace_id_high_6"), ZipkinAnnotations.ZIPKIN_ANNOTATIONS, new OrderField[] { ZipkinAnnotations.ZIPKIN_ANNOTATIONS.TRACE_ID_HIGH, ZipkinAnnotations.ZIPKIN_ANNOTATIONS.TRACE_ID }, false); + public static final Index ZIPKIN_ANNOTATIONS_TRACE_ID_HIGH_8 = Internal.createIndex(DSL.name("trace_id_high_8"), ZipkinAnnotations.ZIPKIN_ANNOTATIONS, new OrderField[] { ZipkinAnnotations.ZIPKIN_ANNOTATIONS.TRACE_ID_HIGH, ZipkinAnnotations.ZIPKIN_ANNOTATIONS.TRACE_ID, ZipkinAnnotations.ZIPKIN_ANNOTATIONS.SPAN_ID }, false); + public static final Index ZIPKIN_ANNOTATIONS_TRACE_ID_HIGH_9 = Internal.createIndex(DSL.name("trace_id_high_9"), ZipkinAnnotations.ZIPKIN_ANNOTATIONS, new OrderField[] { ZipkinAnnotations.ZIPKIN_ANNOTATIONS.TRACE_ID_HIGH, ZipkinAnnotations.ZIPKIN_ANNOTATIONS.TRACE_ID }, false); } diff --git a/zipkin-storage/mysql-v1/src/main/java/zipkin2/storage/mysql/v1/internal/generated/Keys.java b/zipkin-storage/mysql-v1/src/main/java/zipkin2/storage/mysql/v1/internal/generated/Keys.java index 626f9bbeb02..642869048b8 100644 --- a/zipkin-storage/mysql-v1/src/main/java/zipkin2/storage/mysql/v1/internal/generated/Keys.java +++ b/zipkin-storage/mysql-v1/src/main/java/zipkin2/storage/mysql/v1/internal/generated/Keys.java @@ -27,7 +27,9 @@ public class Keys { // ------------------------------------------------------------------------- public static final UniqueKey KEY_ZIPKIN_ANNOTATIONS_TRACE_ID_HIGH = Internal.createUniqueKey(ZipkinAnnotations.ZIPKIN_ANNOTATIONS, DSL.name("KEY_zipkin_annotations_trace_id_high"), new TableField[] { ZipkinAnnotations.ZIPKIN_ANNOTATIONS.TRACE_ID_HIGH, ZipkinAnnotations.ZIPKIN_ANNOTATIONS.TRACE_ID, ZipkinAnnotations.ZIPKIN_ANNOTATIONS.SPAN_ID, ZipkinAnnotations.ZIPKIN_ANNOTATIONS.A_KEY, ZipkinAnnotations.ZIPKIN_ANNOTATIONS.A_TIMESTAMP }, true); + public static final UniqueKey KEY_ZIPKIN_ANNOTATIONS_TRACE_ID_HIGH_10 = Internal.createUniqueKey(ZipkinAnnotations.ZIPKIN_ANNOTATIONS, DSL.name("KEY_zipkin_annotations_trace_id_high_10"), new TableField[] { ZipkinAnnotations.ZIPKIN_ANNOTATIONS.TRACE_ID_HIGH, ZipkinAnnotations.ZIPKIN_ANNOTATIONS.TRACE_ID, ZipkinAnnotations.ZIPKIN_ANNOTATIONS.SPAN_ID, ZipkinAnnotations.ZIPKIN_ANNOTATIONS.A_KEY, ZipkinAnnotations.ZIPKIN_ANNOTATIONS.A_TIMESTAMP }, true); public static final UniqueKey KEY_ZIPKIN_ANNOTATIONS_TRACE_ID_HIGH_4 = Internal.createUniqueKey(ZipkinAnnotations.ZIPKIN_ANNOTATIONS, DSL.name("KEY_zipkin_annotations_trace_id_high_4"), new TableField[] { ZipkinAnnotations.ZIPKIN_ANNOTATIONS.TRACE_ID_HIGH, ZipkinAnnotations.ZIPKIN_ANNOTATIONS.TRACE_ID, ZipkinAnnotations.ZIPKIN_ANNOTATIONS.SPAN_ID, ZipkinAnnotations.ZIPKIN_ANNOTATIONS.A_KEY, ZipkinAnnotations.ZIPKIN_ANNOTATIONS.A_TIMESTAMP }, true); + public static final UniqueKey KEY_ZIPKIN_ANNOTATIONS_TRACE_ID_HIGH_7 = Internal.createUniqueKey(ZipkinAnnotations.ZIPKIN_ANNOTATIONS, DSL.name("KEY_zipkin_annotations_trace_id_high_7"), new TableField[] { ZipkinAnnotations.ZIPKIN_ANNOTATIONS.TRACE_ID_HIGH, ZipkinAnnotations.ZIPKIN_ANNOTATIONS.TRACE_ID, ZipkinAnnotations.ZIPKIN_ANNOTATIONS.SPAN_ID, ZipkinAnnotations.ZIPKIN_ANNOTATIONS.A_KEY, ZipkinAnnotations.ZIPKIN_ANNOTATIONS.A_TIMESTAMP }, true); public static final UniqueKey KEY_ZIPKIN_DEPENDENCIES_PRIMARY = Internal.createUniqueKey(ZipkinDependencies.ZIPKIN_DEPENDENCIES, DSL.name("KEY_zipkin_dependencies_PRIMARY"), new TableField[] { ZipkinDependencies.ZIPKIN_DEPENDENCIES.DAY, ZipkinDependencies.ZIPKIN_DEPENDENCIES.PARENT, ZipkinDependencies.ZIPKIN_DEPENDENCIES.CHILD }, true); public static final UniqueKey KEY_ZIPKIN_SPANS_PRIMARY = Internal.createUniqueKey(ZipkinSpans.ZIPKIN_SPANS, DSL.name("KEY_zipkin_spans_PRIMARY"), new TableField[] { ZipkinSpans.ZIPKIN_SPANS.TRACE_ID_HIGH, ZipkinSpans.ZIPKIN_SPANS.TRACE_ID, ZipkinSpans.ZIPKIN_SPANS.ID }, true); } diff --git a/zipkin-storage/mysql-v1/src/main/java/zipkin2/storage/mysql/v1/internal/generated/tables/ZipkinAnnotations.java b/zipkin-storage/mysql-v1/src/main/java/zipkin2/storage/mysql/v1/internal/generated/tables/ZipkinAnnotations.java index 0d9d94dcdab..a6bfc1624b5 100644 --- a/zipkin-storage/mysql-v1/src/main/java/zipkin2/storage/mysql/v1/internal/generated/tables/ZipkinAnnotations.java +++ b/zipkin-storage/mysql-v1/src/main/java/zipkin2/storage/mysql/v1/internal/generated/tables/ZipkinAnnotations.java @@ -5,14 +5,20 @@ import java.util.Arrays; +import java.util.Collection; import java.util.List; +import org.jooq.Condition; import org.jooq.Field; -import org.jooq.ForeignKey; import org.jooq.Index; import org.jooq.Name; +import org.jooq.PlainSQL; +import org.jooq.QueryPart; import org.jooq.Record; +import org.jooq.SQL; import org.jooq.Schema; +import org.jooq.Select; +import org.jooq.Stringly; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; @@ -114,11 +120,11 @@ public Class getRecordType() { public final TableField ENDPOINT_SERVICE_NAME = createField(DSL.name("endpoint_service_name"), SQLDataType.VARCHAR(255), this, "Null when Binary/Annotation.endpoint is null"); private ZipkinAnnotations(Name alias, Table aliased) { - this(alias, aliased, null); + this(alias, aliased, (Field[]) null, null); } - private ZipkinAnnotations(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + private ZipkinAnnotations(Name alias, Table aliased, Field[] parameters, Condition where) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table(), where); } /** @@ -142,10 +148,6 @@ public ZipkinAnnotations() { this(DSL.name("zipkin_annotations"), null); } - public ZipkinAnnotations(Table child, ForeignKey key) { - super(child, key, ZIPKIN_ANNOTATIONS); - } - @Override public Schema getSchema() { return aliased() ? null : Zipkin.ZIPKIN; @@ -153,12 +155,12 @@ public Schema getSchema() { @Override public List getIndexes() { - return Arrays.asList(Indexes.ZIPKIN_ANNOTATIONS_A_KEY, Indexes.ZIPKIN_ANNOTATIONS_A_KEY_2, Indexes.ZIPKIN_ANNOTATIONS_A_TYPE, Indexes.ZIPKIN_ANNOTATIONS_A_TYPE_2, Indexes.ZIPKIN_ANNOTATIONS_ENDPOINT_SERVICE_NAME, Indexes.ZIPKIN_ANNOTATIONS_ENDPOINT_SERVICE_NAME_2, Indexes.ZIPKIN_ANNOTATIONS_TRACE_ID, Indexes.ZIPKIN_ANNOTATIONS_TRACE_ID_2, Indexes.ZIPKIN_ANNOTATIONS_TRACE_ID_HIGH_2, Indexes.ZIPKIN_ANNOTATIONS_TRACE_ID_HIGH_3, Indexes.ZIPKIN_ANNOTATIONS_TRACE_ID_HIGH_5, Indexes.ZIPKIN_ANNOTATIONS_TRACE_ID_HIGH_6); + return Arrays.asList(Indexes.ZIPKIN_ANNOTATIONS_A_KEY, Indexes.ZIPKIN_ANNOTATIONS_A_KEY_2, Indexes.ZIPKIN_ANNOTATIONS_A_KEY_3, Indexes.ZIPKIN_ANNOTATIONS_A_KEY_4, Indexes.ZIPKIN_ANNOTATIONS_A_TYPE, Indexes.ZIPKIN_ANNOTATIONS_A_TYPE_2, Indexes.ZIPKIN_ANNOTATIONS_A_TYPE_3, Indexes.ZIPKIN_ANNOTATIONS_A_TYPE_4, Indexes.ZIPKIN_ANNOTATIONS_ENDPOINT_SERVICE_NAME, Indexes.ZIPKIN_ANNOTATIONS_ENDPOINT_SERVICE_NAME_2, Indexes.ZIPKIN_ANNOTATIONS_ENDPOINT_SERVICE_NAME_3, Indexes.ZIPKIN_ANNOTATIONS_ENDPOINT_SERVICE_NAME_4, Indexes.ZIPKIN_ANNOTATIONS_TRACE_ID, Indexes.ZIPKIN_ANNOTATIONS_TRACE_ID_2, Indexes.ZIPKIN_ANNOTATIONS_TRACE_ID_3, Indexes.ZIPKIN_ANNOTATIONS_TRACE_ID_4, Indexes.ZIPKIN_ANNOTATIONS_TRACE_ID_HIGH_11, Indexes.ZIPKIN_ANNOTATIONS_TRACE_ID_HIGH_12, Indexes.ZIPKIN_ANNOTATIONS_TRACE_ID_HIGH_2, Indexes.ZIPKIN_ANNOTATIONS_TRACE_ID_HIGH_3, Indexes.ZIPKIN_ANNOTATIONS_TRACE_ID_HIGH_5, Indexes.ZIPKIN_ANNOTATIONS_TRACE_ID_HIGH_6, Indexes.ZIPKIN_ANNOTATIONS_TRACE_ID_HIGH_8, Indexes.ZIPKIN_ANNOTATIONS_TRACE_ID_HIGH_9); } @Override public List> getUniqueKeys() { - return Arrays.asList(Keys.KEY_ZIPKIN_ANNOTATIONS_TRACE_ID_HIGH, Keys.KEY_ZIPKIN_ANNOTATIONS_TRACE_ID_HIGH_4); + return Arrays.asList(Keys.KEY_ZIPKIN_ANNOTATIONS_TRACE_ID_HIGH, Keys.KEY_ZIPKIN_ANNOTATIONS_TRACE_ID_HIGH_10, Keys.KEY_ZIPKIN_ANNOTATIONS_TRACE_ID_HIGH_4, Keys.KEY_ZIPKIN_ANNOTATIONS_TRACE_ID_HIGH_7); } @Override @@ -171,6 +173,11 @@ public ZipkinAnnotations as(Name alias) { return new ZipkinAnnotations(alias, this); } + @Override + public ZipkinAnnotations as(Table alias) { + return new ZipkinAnnotations(alias.getQualifiedName(), this); + } + /** * Rename this table */ @@ -186,4 +193,96 @@ public ZipkinAnnotations rename(String name) { public ZipkinAnnotations rename(Name name) { return new ZipkinAnnotations(name, null); } + + /** + * Rename this table + */ + @Override + public ZipkinAnnotations rename(Table name) { + return new ZipkinAnnotations(name.getQualifiedName(), null); + } + + /** + * Create an inline derived table from this table + */ + @Override + public ZipkinAnnotations where(Condition condition) { + return new ZipkinAnnotations(getQualifiedName(), aliased() ? this : null, null, condition); + } + + /** + * Create an inline derived table from this table + */ + @Override + public ZipkinAnnotations where(Collection conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public ZipkinAnnotations where(Condition... conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public ZipkinAnnotations where(Field condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public ZipkinAnnotations where(SQL condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public ZipkinAnnotations where(@Stringly.SQL String condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public ZipkinAnnotations where(@Stringly.SQL String condition, Object... binds) { + return where(DSL.condition(condition, binds)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public ZipkinAnnotations where(@Stringly.SQL String condition, QueryPart... parts) { + return where(DSL.condition(condition, parts)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public ZipkinAnnotations whereExists(Select select) { + return where(DSL.exists(select)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public ZipkinAnnotations whereNotExists(Select select) { + return where(DSL.notExists(select)); + } } diff --git a/zipkin-storage/mysql-v1/src/main/java/zipkin2/storage/mysql/v1/internal/generated/tables/ZipkinDependencies.java b/zipkin-storage/mysql-v1/src/main/java/zipkin2/storage/mysql/v1/internal/generated/tables/ZipkinDependencies.java index cece414b6ea..490f4d4d611 100644 --- a/zipkin-storage/mysql-v1/src/main/java/zipkin2/storage/mysql/v1/internal/generated/tables/ZipkinDependencies.java +++ b/zipkin-storage/mysql-v1/src/main/java/zipkin2/storage/mysql/v1/internal/generated/tables/ZipkinDependencies.java @@ -5,12 +5,18 @@ import java.time.LocalDate; +import java.util.Collection; +import org.jooq.Condition; import org.jooq.Field; -import org.jooq.ForeignKey; import org.jooq.Name; +import org.jooq.PlainSQL; +import org.jooq.QueryPart; import org.jooq.Record; +import org.jooq.SQL; import org.jooq.Schema; +import org.jooq.Select; +import org.jooq.Stringly; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; @@ -70,11 +76,11 @@ public Class getRecordType() { public final TableField ERROR_COUNT = createField(DSL.name("error_count"), SQLDataType.BIGINT, this, ""); private ZipkinDependencies(Name alias, Table aliased) { - this(alias, aliased, null); + this(alias, aliased, (Field[]) null, null); } - private ZipkinDependencies(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + private ZipkinDependencies(Name alias, Table aliased, Field[] parameters, Condition where) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table(), where); } /** @@ -98,10 +104,6 @@ public ZipkinDependencies() { this(DSL.name("zipkin_dependencies"), null); } - public ZipkinDependencies(Table child, ForeignKey key) { - super(child, key, ZIPKIN_DEPENDENCIES); - } - @Override public Schema getSchema() { return aliased() ? null : Zipkin.ZIPKIN; @@ -122,6 +124,11 @@ public ZipkinDependencies as(Name alias) { return new ZipkinDependencies(alias, this); } + @Override + public ZipkinDependencies as(Table alias) { + return new ZipkinDependencies(alias.getQualifiedName(), this); + } + /** * Rename this table */ @@ -137,4 +144,96 @@ public ZipkinDependencies rename(String name) { public ZipkinDependencies rename(Name name) { return new ZipkinDependencies(name, null); } + + /** + * Rename this table + */ + @Override + public ZipkinDependencies rename(Table name) { + return new ZipkinDependencies(name.getQualifiedName(), null); + } + + /** + * Create an inline derived table from this table + */ + @Override + public ZipkinDependencies where(Condition condition) { + return new ZipkinDependencies(getQualifiedName(), aliased() ? this : null, null, condition); + } + + /** + * Create an inline derived table from this table + */ + @Override + public ZipkinDependencies where(Collection conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public ZipkinDependencies where(Condition... conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public ZipkinDependencies where(Field condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public ZipkinDependencies where(SQL condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public ZipkinDependencies where(@Stringly.SQL String condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public ZipkinDependencies where(@Stringly.SQL String condition, Object... binds) { + return where(DSL.condition(condition, binds)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public ZipkinDependencies where(@Stringly.SQL String condition, QueryPart... parts) { + return where(DSL.condition(condition, parts)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public ZipkinDependencies whereExists(Select select) { + return where(DSL.exists(select)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public ZipkinDependencies whereNotExists(Select select) { + return where(DSL.notExists(select)); + } } diff --git a/zipkin-storage/mysql-v1/src/main/java/zipkin2/storage/mysql/v1/internal/generated/tables/ZipkinSpans.java b/zipkin-storage/mysql-v1/src/main/java/zipkin2/storage/mysql/v1/internal/generated/tables/ZipkinSpans.java index 00b23b38e54..09f021e1789 100644 --- a/zipkin-storage/mysql-v1/src/main/java/zipkin2/storage/mysql/v1/internal/generated/tables/ZipkinSpans.java +++ b/zipkin-storage/mysql-v1/src/main/java/zipkin2/storage/mysql/v1/internal/generated/tables/ZipkinSpans.java @@ -5,14 +5,20 @@ import java.util.Arrays; +import java.util.Collection; import java.util.List; +import org.jooq.Condition; import org.jooq.Field; -import org.jooq.ForeignKey; import org.jooq.Index; import org.jooq.Name; +import org.jooq.PlainSQL; +import org.jooq.QueryPart; import org.jooq.Record; +import org.jooq.SQL; import org.jooq.Schema; +import org.jooq.Select; +import org.jooq.Stringly; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; @@ -96,11 +102,11 @@ public Class getRecordType() { public final TableField DURATION = createField(DSL.name("duration"), SQLDataType.BIGINT, this, "Span.duration(): micros used for minDuration and maxDuration query"); private ZipkinSpans(Name alias, Table aliased) { - this(alias, aliased, null); + this(alias, aliased, (Field[]) null, null); } - private ZipkinSpans(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + private ZipkinSpans(Name alias, Table aliased, Field[] parameters, Condition where) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table(), where); } /** @@ -124,10 +130,6 @@ public ZipkinSpans() { this(DSL.name("zipkin_spans"), null); } - public ZipkinSpans(Table child, ForeignKey key) { - super(child, key, ZIPKIN_SPANS); - } - @Override public Schema getSchema() { return aliased() ? null : Zipkin.ZIPKIN; @@ -135,7 +137,7 @@ public Schema getSchema() { @Override public List getIndexes() { - return Arrays.asList(Indexes.ZIPKIN_SPANS_NAME, Indexes.ZIPKIN_SPANS_NAME_2, Indexes.ZIPKIN_SPANS_REMOTE_SERVICE_NAME, Indexes.ZIPKIN_SPANS_REMOTE_SERVICE_NAME_2, Indexes.ZIPKIN_SPANS_START_TS, Indexes.ZIPKIN_SPANS_START_TS_2, Indexes.ZIPKIN_SPANS_TRACE_ID_HIGH, Indexes.ZIPKIN_SPANS_TRACE_ID_HIGH_2); + return Arrays.asList(Indexes.ZIPKIN_SPANS_NAME, Indexes.ZIPKIN_SPANS_NAME_2, Indexes.ZIPKIN_SPANS_NAME_3, Indexes.ZIPKIN_SPANS_NAME_4, Indexes.ZIPKIN_SPANS_REMOTE_SERVICE_NAME, Indexes.ZIPKIN_SPANS_REMOTE_SERVICE_NAME_2, Indexes.ZIPKIN_SPANS_REMOTE_SERVICE_NAME_3, Indexes.ZIPKIN_SPANS_REMOTE_SERVICE_NAME_4, Indexes.ZIPKIN_SPANS_START_TS, Indexes.ZIPKIN_SPANS_START_TS_2, Indexes.ZIPKIN_SPANS_START_TS_3, Indexes.ZIPKIN_SPANS_START_TS_4, Indexes.ZIPKIN_SPANS_TRACE_ID_HIGH, Indexes.ZIPKIN_SPANS_TRACE_ID_HIGH_2, Indexes.ZIPKIN_SPANS_TRACE_ID_HIGH_3, Indexes.ZIPKIN_SPANS_TRACE_ID_HIGH_4); } @Override @@ -153,6 +155,11 @@ public ZipkinSpans as(Name alias) { return new ZipkinSpans(alias, this); } + @Override + public ZipkinSpans as(Table alias) { + return new ZipkinSpans(alias.getQualifiedName(), this); + } + /** * Rename this table */ @@ -168,4 +175,96 @@ public ZipkinSpans rename(String name) { public ZipkinSpans rename(Name name) { return new ZipkinSpans(name, null); } + + /** + * Rename this table + */ + @Override + public ZipkinSpans rename(Table name) { + return new ZipkinSpans(name.getQualifiedName(), null); + } + + /** + * Create an inline derived table from this table + */ + @Override + public ZipkinSpans where(Condition condition) { + return new ZipkinSpans(getQualifiedName(), aliased() ? this : null, null, condition); + } + + /** + * Create an inline derived table from this table + */ + @Override + public ZipkinSpans where(Collection conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public ZipkinSpans where(Condition... conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public ZipkinSpans where(Field condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public ZipkinSpans where(SQL condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public ZipkinSpans where(@Stringly.SQL String condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public ZipkinSpans where(@Stringly.SQL String condition, Object... binds) { + return where(DSL.condition(condition, binds)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public ZipkinSpans where(@Stringly.SQL String condition, QueryPart... parts) { + return where(DSL.condition(condition, parts)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public ZipkinSpans whereExists(Select select) { + return where(DSL.exists(select)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public ZipkinSpans whereNotExists(Select select) { + return where(DSL.notExists(select)); + } } diff --git a/zipkin-storage/pom.xml b/zipkin-storage/pom.xml index 291bba25388..fdff1640513 100644 --- a/zipkin-storage/pom.xml +++ b/zipkin-storage/pom.xml @@ -11,7 +11,7 @@ io.zipkin zipkin-parent - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT io.zipkin.zipkin2 diff --git a/zipkin-tests/pom.xml b/zipkin-tests/pom.xml index 0d53101fc92..46c97348232 100644 --- a/zipkin-tests/pom.xml +++ b/zipkin-tests/pom.xml @@ -11,7 +11,7 @@ io.zipkin zipkin-parent - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT io.zipkin.zipkin2 diff --git a/zipkin/pom.xml b/zipkin/pom.xml index 34b06b73686..d76a8ae0e1b 100644 --- a/zipkin/pom.xml +++ b/zipkin/pom.xml @@ -11,7 +11,7 @@ io.zipkin zipkin-parent - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT io.zipkin.zipkin2