Skip to content
This repository has been archived by the owner on Nov 14, 2024. It is now read-only.

Commit

Permalink
Enable check exact dependencies tasks (#6742)
Browse files Browse the repository at this point in the history
  • Loading branch information
pkoenig10 authored Sep 26, 2023
1 parent 64e7944 commit 944bd54
Show file tree
Hide file tree
Showing 63 changed files with 208 additions and 271 deletions.
5 changes: 0 additions & 5 deletions atlasdb-api/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,9 @@ dependencies {
implementation 'org.apache.commons:commons-lang3'
implementation 'com.fasterxml.jackson.core:jackson-annotations'
implementation 'com.fasterxml.jackson.core:jackson-databind'
implementation 'javax.annotation:javax.annotation-api'
implementation 'javax.validation:validation-api'
implementation 'javax.xml.bind:jaxb-api'

implementation 'com.github.ben-manes.caffeine:caffeine'
implementation 'com.palantir.conjure.java.api:ssl-config'
implementation 'com.palantir.conjure.java.runtime:conjure-java-jaxrs-client'
implementation 'com.palantir.tritium:tritium-ids'
implementation ('com.palantir.tritium:tritium-registry') {
exclude (group: 'io.dropwizard.metrics', module: 'metrics-core')
Expand All @@ -31,7 +27,6 @@ dependencies {
implementation 'com.palantir.safe-logging:preconditions'
implementation 'com.palantir.safe-logging:safe-logging'
implementation 'io.dropwizard.metrics:metrics-core'
implementation 'org.slf4j:slf4j-api'
implementation project(':commons-annotations')
implementation project(':lock-api-objects')

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import java.time.Duration;
import java.util.Optional;
import java.util.Set;
import javax.validation.constraints.Size;
import org.immutables.value.Value;

@JsonDeserialize(as = ImmutableLeaderConfig.class)
Expand All @@ -48,7 +47,6 @@ public File acceptorLogDir() {

public abstract String localServer();

@Size(min = 1)
public abstract Set<String> leaders();

public abstract Optional<SslConfiguration> sslConfiguration();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import com.palantir.atlasdb.encoding.PtBytes;
import java.io.Serializable;
import java.util.regex.Pattern;
import org.checkerframework.checker.nullness.qual.Nullable;
import javax.annotation.Nullable;

public final class BatchColumnRangeSelection implements Serializable {
private static final long serialVersionUID = 1L;
Expand All @@ -41,8 +41,8 @@ public static BatchColumnRangeSelection create(ColumnRangeSelection columnRangeS

@JsonCreator
public static BatchColumnRangeSelection create(
@JsonProperty("startCol") byte @Nullable [] startCol,
@JsonProperty("endCol") byte @Nullable [] endCol,
@JsonProperty("startCol") @Nullable byte[] startCol,
@JsonProperty("endCol") @Nullable byte[] endCol,
@JsonProperty("batchHint") int batchHint) {
return new BatchColumnRangeSelection(new ColumnRangeSelection(startCol, endCol), batchHint);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import java.util.Arrays;
import java.util.Objects;
import java.util.regex.Pattern;
import org.checkerframework.checker.nullness.qual.Nullable;
import javax.annotation.Nullable;

public class ColumnRangeSelection implements Serializable {
private static final long serialVersionUID = 1L;
Expand All @@ -38,7 +38,7 @@ public class ColumnRangeSelection implements Serializable {

@JsonCreator
public ColumnRangeSelection(
@JsonProperty("startCol") byte @Nullable [] startCol, @JsonProperty("endCol") byte @Nullable [] endCol) {
@JsonProperty("startCol") @Nullable byte[] startCol, @JsonProperty("endCol") @Nullable byte[] endCol) {
this.startCol = Objects.requireNonNullElse(startCol, PtBytes.EMPTY_BYTE_ARRAY);
this.endCol = Objects.requireNonNullElse(endCol, PtBytes.EMPTY_BYTE_ARRAY);
if (!isValidRange(this.startCol, this.endCol)) {
Expand Down
1 change: 0 additions & 1 deletion atlasdb-autobatch/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ dependencies {
implementation 'com.palantir.safe-logging:preconditions'
implementation 'com.palantir.tracing:tracing'
implementation 'io.dropwizard.metrics:metrics-core'
implementation 'org.slf4j:slf4j-api'
implementation project(':commons-executors')

testImplementation 'com.google.errorprone:error_prone_annotations'
Expand Down
4 changes: 4 additions & 0 deletions atlasdb-cassandra-integration-tests/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
apply from: "../gradle/shared.gradle"
apply from: "../gradle/tests.gradle"

versionsLock {
testProject()
}

dependencies {
testImplementation 'com.google.guava:guava'
testImplementation 'com.palantir.common:streams'
Expand Down
4 changes: 4 additions & 0 deletions atlasdb-cassandra-multinode-tests/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@

apply from: "../gradle/shared.gradle"

versionsLock {
testProject()
}

dependencies {
testImplementation 'com.google.guava:guava'
testImplementation 'org.apache.thrift:libthrift'
Expand Down
5 changes: 2 additions & 3 deletions atlasdb-cassandra/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ dependencies {
implementation 'com.palantir.conjure.java.api:service-config'
implementation 'com.palantir.refreshable:refreshable'
implementation 'com.palantir.safe-logging:preconditions'
implementation 'com.palantir.safe-logging:safe-logging'
implementation 'com.palantir.tritium:tritium-caffeine'
implementation 'com.palantir.tritium:tritium-metrics'
implementation 'com.palantir.tritium:tritium-registry'
implementation 'io.dropwizard.metrics:metrics-core'
implementation 'one.util:streamex'
Expand All @@ -56,6 +56,7 @@ dependencies {
implementation project(':atlasdb-commons')
implementation project(':commons-annotations')
implementation project(':commons-executors')
implementation project(':timelock-api')
implementation project(':timestamp-api')

// transitive from cassandra-driver-core
Expand All @@ -72,7 +73,6 @@ dependencies {
testImplementation 'com.palantir.tracing:tracing-api'
testImplementation 'com.palantir.tritium:tritium-registry'
testImplementation 'io.dropwizard.metrics:metrics-core'
testImplementation 'javax.xml.bind:jaxb-api'
testImplementation 'org.apache.commons:commons-lang3'
testImplementation 'org.apache.thrift:libthrift'
testImplementation 'com.palantir.safe-logging:preconditions-assertj'
Expand All @@ -98,7 +98,6 @@ dependencies {
annotationProcessor 'org.derive4j:derive4j'
annotationProcessor 'org.immutables:value'
annotationProcessor project(":atlasdb-processors")
compileOnly 'com.google.auto.service:auto-service'
compileOnly 'org.derive4j:derive4j-annotation'
compileOnly 'org.immutables:value::annotations'
compileOnly project(":atlasdb-processors")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@

package com.datastax.driver.core;

import com.google.common.io.BaseEncoding;
import java.nio.ByteBuffer;
import javax.xml.bind.DatatypeConverter;

// Utility class - it's in com.datastax.driver.core package in order to allow us to create Tokens and TokenRanges
// on the fly for unit testing purposes.
public final class CassandraTokenRanges {
private static final Token.Factory FACTORY = Token.OPPToken.FACTORY;
private static final BaseEncoding HEX = BaseEncoding.base16().lowerCase();

private CassandraTokenRanges() {
// utility class
Expand All @@ -37,7 +38,7 @@ public static TokenRange create(Token start, Token end) {
}

public static Token getToken(String hexBinary) {
return FACTORY.hash(ByteBuffer.wrap(DatatypeConverter.parseHexBinary(hexBinary)));
return FACTORY.hash(ByteBuffer.wrap(HEX.decode(hexBinary)));
}

public static Token getToken(ByteBuffer byteBuffer) {
Expand Down
1 change: 0 additions & 1 deletion atlasdb-cli/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ dependencies {

compileOnly 'com.google.dagger:dagger'
implementation 'io.airlift:airline'
implementation 'ch.qos.logback:logback-classic'

implementation 'com.google.errorprone:error_prone_annotations'
implementation 'com.google.guava:guava'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,6 @@ public void testWithoutFile() throws Exception {
String output = runner.run(true, false);
try {
Scanner scanner = new Scanner(output);
String shouldBeDeprecationLine = scanner.nextLine();
verifyDeprecation(shouldBeDeprecationLine);
long timestamp = getTimestampFromStdout(scanner);
scanner.nextLine();
long wallClockTimestamp = getWallClockTimestamp(scanner);
Expand Down Expand Up @@ -224,8 +222,6 @@ private void runAndVerifyCliForFile(String inputFileString) throws Exception {
String output = runner.run(true, false);
try {
Scanner scanner = new Scanner(output);
String shouldBeDeprecationLine = scanner.nextLine();
verifyDeprecation(shouldBeDeprecationLine);
long timestamp = getTimestampFromFile(inputFileString);
scanner.nextLine();
long wallClockTimestamp = getWallClockTimestamp(scanner);
Expand Down Expand Up @@ -332,8 +328,4 @@ private void verifyImmutableTs(
assertThat(timestamp).isLessThan(lastFreshTs);
assertThat(timestamp).isLessThan(newFreshTs);
}

private void verifyDeprecation(String shouldBeDeprecationLine) {
assertThat(shouldBeDeprecationLine).contains("This CLI has been deprecated.");
}
}
25 changes: 4 additions & 21 deletions atlasdb-client/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ dependencies {
api 'com.google.code.findbugs:jsr305'
api 'com.google.guava:guava'
api 'com.google.protobuf:protobuf-java'
api 'javax.annotation:javax.annotation-api'
api 'org.slf4j:slf4j-api'
api project(':atlasdb-api')
api project(':atlasdb-client-protobufs')
Expand All @@ -46,12 +45,10 @@ dependencies {
implementation 'com.fasterxml.jackson.core:jackson-annotations'
implementation 'com.fasterxml.jackson.core:jackson-core'
implementation 'com.fasterxml.jackson.core:jackson-databind'
implementation 'com.fasterxml.jackson.datatype:jackson-datatype-guava'
implementation 'com.github.ben-manes.caffeine:caffeine'
implementation 'com.github.rholder:guava-retrying'
implementation 'com.google.errorprone:error_prone_annotations'
implementation 'com.google.guava:guava'
implementation 'com.googlecode.protobuf-java-format:protobuf-java-format'
implementation 'com.palantir.common:streams'
implementation 'com.palantir.conjure.java:conjure-lib'
implementation 'com.palantir.goethe:goethe'
Expand All @@ -60,37 +57,23 @@ dependencies {
implementation 'com.palantir.safe-logging:preconditions'
implementation 'com.palantir.safe-logging:safe-logging'
implementation 'com.palantir.tracing:tracing'
implementation 'com.palantir.tracing:tracing-api'
implementation 'com.palantir.tritium:tritium-api'
implementation 'com.palantir.tritium:tritium-caffeine'
implementation 'com.palantir.tritium:tritium-core'
implementation 'com.palantir.tritium:tritium-ids'
implementation 'com.palantir.tritium:tritium-lib'
implementation 'com.palantir.tritium:tritium-registry'
implementation 'com.palantir.tritium:tritium-slf4j'
implementation 'com.squareup:javapoet'
implementation 'io.dropwizard.metrics:metrics-core'
implementation 'org.apache.commons:commons-lang3'
implementation 'org.hdrhistogram:HdrHistogram'
implementation 'org.xerial.snappy:snappy-java'
implementation project(':atlasdb-autobatch')
implementation project(':commons-annotations')
implementation project(':commons-executors')
implementation project(':commons-executors-api')
implementation project(':lock-api-objects')
implementation project(':timestamp-api')
implementation ('com.palantir.tritium:tritium-caffeine') {
exclude (group: 'io.dropwizard.metrics', module: 'metrics-core')
exclude (group: 'org.hdrhistogram', module: 'HdrHistogram')
}
implementation ('com.palantir.tritium:tritium-registry') {
exclude (group: 'io.dropwizard.metrics', module: 'metrics-core')
exclude (group: 'org.hdrhistogram', module: 'HdrHistogram')
}
implementation ('com.palantir.tritium:tritium-metrics') {
exclude (group: 'io.dropwizard.metrics', module: 'metrics-core')
exclude (group: 'org.hdrhistogram', module: 'HdrHistogram')
}
implementation ('com.palantir.tritium:tritium-lib') {
exclude (group: 'io.dropwizard.metrics', module: 'metrics-core')
exclude (group: 'org.hdrhistogram', module: 'HdrHistogram')
}

testImplementation sourceSets.integrationInput.output
testImplementation 'ch.qos.logback:logback-core'
Expand Down
14 changes: 4 additions & 10 deletions atlasdb-config/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,22 @@ dependencies {
api project(':timestamp-client')
api project(':atlasdb-conjure')
implementation project(':atlasdb-impl-shared')
implementation project(':atlasdb-remoting-api')
implementation project(':lock-impl')
implementation project(':timelock-api')

implementation 'javax.validation:validation-api'
implementation 'com.palantir.config.crypto:encrypted-config-value-module'
implementation 'com.palantir.refreshable:refreshable'
implementation 'com.palantir.safe-logging:safe-logging'
implementation ('com.palantir.tritium:tritium-lib') {
exclude (group: 'io.dropwizard.metrics', module: 'metrics-core')
exclude (group: 'org.hdrhistogram', module: 'HdrHistogram')
}
implementation 'org.hdrhistogram:HdrHistogram'

implementation 'com.fasterxml.jackson.core:jackson-databind'
implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml'
implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jdk8'
implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310'

implementation 'com.fasterxml.jackson.core:jackson-annotations'
implementation 'com.fasterxml.jackson.core:jackson-core'
implementation 'com.fasterxml.jackson.datatype:jackson-datatype-guava'
implementation 'com.google.auto.service:auto-service-annotations'
implementation 'com.google.errorprone:error_prone_annotations'
implementation 'com.google.guava:guava'
implementation 'com.palantir.common:streams'
Expand All @@ -39,11 +35,11 @@ dependencies {
implementation 'com.palantir.safe-logging:preconditions'
implementation 'com.palantir.tokens:auth-tokens'
implementation 'com.palantir.tritium:tritium-registry'
implementation 'com.palantir.tritium:tritium-registry'
implementation 'io.dropwizard.metrics:metrics-core'
implementation 'javax.inject:javax.inject'
implementation 'javax.ws.rs:javax.ws.rs-api'
implementation 'org.glassfish.jersey.core:jersey-common'
implementation 'org.slf4j:slf4j-api'
implementation project(':atlasdb-client')
implementation project(':atlasdb-commons')
implementation project(':atlasdb-coordination-impl')
Expand All @@ -68,10 +64,8 @@ dependencies {
annotationProcessor 'org.immutables:value'
compileOnly 'org.immutables:value::annotations'
annotationProcessor 'com.google.auto.service:auto-service'
compileOnly 'com.google.auto.service:auto-service'

testAnnotationProcessor 'com.google.auto.service:auto-service'
testCompileOnly 'com.google.auto.service:auto-service'
testAnnotationProcessor 'org.immutables:value'
testCompileOnly 'org.immutables:value::annotations'

Expand Down
3 changes: 1 addition & 2 deletions atlasdb-conjure/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@ dependencies {
implementation project(':atlasdb-commons')

implementation 'com.palantir.refreshable:refreshable'
implementation 'com.palantir.dialogue:dialogue-clients'
implementation 'com.palantir.dialogue:dialogue-serde'
implementation 'com.palantir.conjure.java.runtime:conjure-java-jaxrs-client'
implementation 'com.palantir.tritium:tritium-lib'
implementation 'com.google.errorprone:error_prone_annotations'
implementation 'com.google.guava:guava'
implementation 'com.palantir.common:streams'
Expand All @@ -17,6 +15,7 @@ dependencies {
implementation 'com.palantir.conjure.java.api:ssl-config'
implementation 'com.palantir.conjure.java.runtime:client-config'
implementation 'com.palantir.conjure.java.runtime:conjure-java-jaxrs-client'
implementation 'com.palantir.conjure.java.runtime:conjure-java-legacy-clients'
implementation 'com.palantir.conjure.java.runtime:keystores'
implementation 'com.palantir.dialogue:dialogue-target'
implementation 'com.palantir.safe-logging:preconditions'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,14 @@

import com.google.common.reflect.AbstractInvocationHandler;
import com.google.common.util.concurrent.RateLimiter;
import com.palantir.common.base.Throwables;
import com.palantir.conjure.java.api.errors.UnknownRemoteException;
import com.palantir.logsafe.SafeArg;
import com.palantir.logsafe.logger.SafeLogger;
import com.palantir.logsafe.logger.SafeLoggerFactory;
import com.palantir.refreshable.Refreshable;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import org.checkerframework.checker.nullness.qual.Nullable;

@SuppressWarnings("ProxyNonConstantType")
public final class UnknownRemoteDebuggingProxy<T, V> extends AbstractInvocationHandler {
Expand All @@ -42,18 +41,18 @@ private UnknownRemoteDebuggingProxy(Refreshable<SafeArg<T>> safeLoggableRefresha
}

@Override
protected Object handleInvocation(Object proxy, Method method, @Nullable Object[] args) throws Throwable {
protected Object handleInvocation(Object proxy, Method method, Object[] args) throws Throwable {
try {
return method.invoke(delegate, args);
} catch (Throwable th) {
Throwable ex = Throwables.unwrapIfPossible(th);
if (ex instanceof UnknownRemoteException && rateLimiter.tryAcquire()) {
} catch (InvocationTargetException e) {
Throwable cause = e.getCause();
if (cause instanceof UnknownRemoteException && rateLimiter.tryAcquire()) {
log.warn(
"Encountered UnknownRemoteException; logging current state of refreshable",
safeLoggableRefreshable.get(),
ex);
cause);
}
throw ex;
throw cause;
}
}

Expand Down
3 changes: 3 additions & 0 deletions atlasdb-console/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,6 @@ dependencies {
}
testImplementation 'org.gmock:gmock'
}

tasks.checkImplicitDependenciesMain.enabled = false
tasks.checkUnusedDependenciesMain.enabled = false
Loading

0 comments on commit 944bd54

Please sign in to comment.