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

Commit

Permalink
Excavator: Upgrades Baseline to the latest version (#5486)
Browse files Browse the repository at this point in the history
  • Loading branch information
svc-excavator-bot authored Jun 21, 2021
1 parent 372a467 commit a83ccaf
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .baseline/checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@
<property name="ignoredAnnotations" value="ParameterizedTest, Test, Before, BeforeEach, After, AfterEach, BeforeClass, BeforeAll, AfterClass, AfterAll"/>
</module>
<module name="JavadocMethod"> <!-- Java Style Guide: Where Javadoc is used -->
<property name="scope" value="public"/>
<property name="accessModifiers" value="public"/>
<property name="allowMissingParamTags" value="true"/>
<property name="allowMissingReturnTag" value="true"/>
<property name="allowedAnnotations" value="Override, Test"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import java.lang.management.ThreadMXBean;
import java.lang.reflect.Field;
import java.net.InetSocketAddress;
import java.time.Duration;
import java.time.Instant;
import java.time.format.DateTimeFormatter;
import java.util.NoSuchElementException;
Expand Down Expand Up @@ -280,15 +281,15 @@ private GenericObjectPool<CassandraClient> createClientPool() {
poolConfig.setTestOnBorrow(true);

poolConfig.setSoftMinEvictableIdleTimeMillis(
TimeUnit.MILLISECONDS.convert(config.idleConnectionTimeoutSeconds(), TimeUnit.SECONDS));
TimeUnit.MILLISECONDS.convert(Duration.ofSeconds(config.idleConnectionTimeoutSeconds())));
poolConfig.setMinEvictableIdleTimeMillis(Long.MAX_VALUE);

// the randomness here is to prevent all of the pools for all of the hosts
// evicting all at at once, which isn't great for C*.
int timeBetweenEvictionsSeconds = config.timeBetweenConnectionEvictionRunsSeconds();
int delta = ThreadLocalRandom.current().nextInt(Math.min(timeBetweenEvictionsSeconds / 2, 10));
poolConfig.setTimeBetweenEvictionRunsMillis(
TimeUnit.MILLISECONDS.convert(timeBetweenEvictionsSeconds + delta, TimeUnit.SECONDS));
TimeUnit.MILLISECONDS.convert(Duration.ofSeconds(timeBetweenEvictionsSeconds + delta)));
poolConfig.setNumTestsPerEvictionRun(-(int) (1.0 / config.proportionConnectionsToCheckPerEvictionRun()));
poolConfig.setTestWhileIdle(true);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
import java.time.Duration;
import java.util.Optional;
import java.util.concurrent.Callable;
import java.util.concurrent.TimeUnit;
import org.assertj.core.api.JUnitSoftAssertions;
import org.awaitility.Awaitility;
import org.immutables.value.Value;
Expand Down Expand Up @@ -184,7 +183,7 @@ private void downgradeAtlasClientFromTimelockWithoutMigration() {
// TODO (jkong): Be better.
// Realistically, this is enough time for the server to start up, and we value the test signal here
// if we're going to be doing these migrations...
Uninterruptibles.sleepUninterruptibly(30, TimeUnit.SECONDS);
Uninterruptibles.sleepUninterruptibly(Duration.ofSeconds(30));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class SweepPriorityCalculator {

// weights one month of no sweeping with the same priority as about 100000 expected cells to sweep.
private static final double MILLIS_SINCE_SWEEP_PRIORITY_WEIGHT =
100_000.0 / TimeUnit.MILLISECONDS.convert(30, TimeUnit.DAYS);
100_000.0 / TimeUnit.MILLISECONDS.convert(Duration.ofDays(30));

private final KeyValueService kvs;
private final SweepPriorityStore sweepPriorityStore;
Expand Down Expand Up @@ -234,13 +234,13 @@ private boolean tooFewWritesToBother(long writeCount, long cellTsPairsExamined,
// for large tables we're essentially just comparing writeCount <= cellTsPairsExamined / 100
boolean fewWrites = writeCount <= 100 + cellTsPairsExamined / 100;

long daysSinceLastSweep = TimeUnit.DAYS.convert(millisSinceSweep, TimeUnit.MILLISECONDS);
long daysSinceLastSweep = TimeUnit.DAYS.convert(Duration.ofMillis(millisSinceSweep));

return fewWrites && daysSinceLastSweep < 180;
}

private boolean weWantToAvoidOverloadingTheStoreWithTombstones(SweepPriority newPriority, long millisSinceSweep) {
long daysSinceLastSweep = TimeUnit.DAYS.convert(millisSinceSweep, TimeUnit.MILLISECONDS);
long daysSinceLastSweep = TimeUnit.DAYS.convert(Duration.ofMillis(millisSinceSweep));

return newPriority.staleValuesDeleted() > WAIT_BEFORE_SWEEPING_IF_WE_GENERATE_THIS_MANY_TOMBSTONES
&& daysSinceLastSweep < 1
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ buildscript {
classpath 'com.netflix.nebula:gradle-info-plugin:9.3.0'
classpath 'com.netflix.nebula:nebula-publishing-plugin:17.3.2'
classpath 'com.palantir.gradle.externalpublish:gradle-external-publish-plugin:1.2.1'
classpath 'com.palantir.baseline:gradle-baseline-java:3.87.0'
classpath 'com.palantir.baseline:gradle-baseline-java:3.92.0'
classpath 'com.palantir.gradle.conjure:gradle-conjure:5.10.0'
classpath 'com.palantir.javaformat:gradle-palantir-java-format:1.0.1'
classpath 'com.palantir.metricschema:gradle-metric-schema:0.6.0'
Expand Down

0 comments on commit a83ccaf

Please sign in to comment.