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

Commit

Permalink
Gozakdag/revert supplier change (#3995)
Browse files Browse the repository at this point in the history
* Revert "Remove usages of guava Supplier (#3978)"

This reverts commit 17864ae.

* use guava supplier
  • Loading branch information
gozakdag authored May 9, 2019
1 parent 0d3fa82 commit 0d9afb5
Show file tree
Hide file tree
Showing 151 changed files with 305 additions and 367 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
*/
package com.palantir.atlasdb.transaction.api;

import java.util.function.Supplier;

import com.google.common.base.Supplier;
import com.palantir.atlasdb.cleaner.api.Cleaner;
import com.palantir.atlasdb.keyvalue.api.KeyValueService;
import com.palantir.atlasdb.transaction.service.TransactionService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
import java.io.InputStreamReader;
import java.io.PrintStream;
import java.nio.charset.StandardCharsets;
import java.util.function.Supplier;

import com.google.common.base.Supplier;
import com.google.common.base.Suppliers;
import com.google.common.io.CharStreams;

Expand All @@ -33,7 +33,7 @@ public final class AtlasDbVersion {

private static volatile boolean versionPrinted = false;

private static final Supplier<String> version = Suppliers.memoize(AtlasDbVersion::readVersion);
private static final Supplier<String> version = Suppliers.memoize(() -> readVersion());

private AtlasDbVersion() {
// static class
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ public static CassandraKeyValueService create(
public static CassandraKeyValueService create(
MetricsManager metricsManager,
CassandraKeyValueServiceConfig config,
Supplier<CassandraKeyValueServiceRuntimeConfig> runtimeConfig,
java.util.function.Supplier<CassandraKeyValueServiceRuntimeConfig> runtimeConfig,
CassandraMutationTimestampProvider mutationTimestampProvider,
boolean initializeAsync) {
return create(metricsManager,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,10 @@

package com.palantir.atlasdb.keyvalue.cassandra;

import java.util.function.Supplier;

import org.apache.cassandra.thrift.ConsistencyLevel;
import org.apache.cassandra.thrift.SlicePredicate;

import com.google.common.base.Supplier;
import com.google.common.collect.ImmutableList;
import com.palantir.atlasdb.keyvalue.api.RangeRequest;
import com.palantir.atlasdb.keyvalue.api.RowResult;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
import java.nio.ByteBuffer;
import java.util.List;
import java.util.Map;
import java.util.function.Supplier;

import org.apache.cassandra.thrift.ColumnOrSuperColumn;
import org.apache.cassandra.thrift.KeyRange;
import org.apache.cassandra.thrift.KeySlice;
import org.apache.cassandra.thrift.SlicePredicate;

import com.google.common.base.Supplier;
import com.palantir.atlasdb.keyvalue.api.ColumnSelection;
import com.palantir.atlasdb.keyvalue.api.RangeRequest;
import com.palantir.atlasdb.keyvalue.api.RangeRequests;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
import java.util.HashMap;
import java.util.Map;
import java.util.function.Consumer;
import java.util.function.Supplier;

import com.codahale.metrics.Meter;
import com.google.common.base.Supplier;
import com.palantir.atlasdb.keyvalue.cassandra.CassandraClientPool;
import com.palantir.atlasdb.keyvalue.cassandra.CassandraClientPoolingContainer;
import com.palantir.atlasdb.util.MetricsManager;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
import java.util.concurrent.Callable;
import java.util.concurrent.TimeUnit;
import java.util.function.BiFunction;
import java.util.function.Supplier;
import java.util.stream.Stream;

import javax.annotation.Generated;

import com.google.common.base.Function;
import com.google.common.base.Joiner;
import com.google.common.base.MoreObjects;
import com.google.common.base.Supplier;
import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.Collections2;
import com.google.common.collect.ComparisonChain;
Expand Down Expand Up @@ -2107,5 +2107,5 @@ public List<String> findConstraintFailuresNoRead(Map<Cell, byte[]> writes,
* {@link UnsignedBytes}
* {@link ValueType}
*/
static String __CLASS_HASH = "r4GAOsoxikdmFU+sqUQzQA==";
static String __CLASS_HASH = "7ICgYboWGmlASXKikUY+zQ==";
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,12 @@ private ApiTestTableFactory(List<Function<? super Transaction, SharedTriggers>>
this.namespace = namespace;
}

public static ApiTestTableFactory of(
List<Function<? super Transaction, SharedTriggers>> sharedTriggers,
public static ApiTestTableFactory of(List<Function<? super Transaction, SharedTriggers>> sharedTriggers,
Namespace namespace) {
return new ApiTestTableFactory(sharedTriggers, namespace);
}

public static ApiTestTableFactory of(
List<Function<? super Transaction, SharedTriggers>> sharedTriggers) {
public static ApiTestTableFactory of(List<Function<? super Transaction, SharedTriggers>> sharedTriggers) {
return new ApiTestTableFactory(sharedTriggers, defaultNamespace);
}

Expand Down Expand Up @@ -67,20 +65,17 @@ public interface SharedTriggers extends AllValueTypesTestTable.AllValueTypesTest

public abstract static class NullSharedTriggers implements SharedTriggers {
@Override
public void putAllValueTypesTest(
Multimap<AllValueTypesTestTable.AllValueTypesTestRow, ? extends AllValueTypesTestTable.AllValueTypesTestNamedColumnValue<?>> newRows) {
public void putAllValueTypesTest(Multimap<AllValueTypesTestTable.AllValueTypesTestRow, ? extends AllValueTypesTestTable.AllValueTypesTestNamedColumnValue<?>> newRows) {
// do nothing
}

@Override
public void putHashComponentsTest(
Multimap<HashComponentsTestTable.HashComponentsTestRow, ? extends HashComponentsTestTable.HashComponentsTestNamedColumnValue<?>> newRows) {
public void putHashComponentsTest(Multimap<HashComponentsTestTable.HashComponentsTestRow, ? extends HashComponentsTestTable.HashComponentsTestNamedColumnValue<?>> newRows) {
// do nothing
}

@Override
public void putSchemaApiTest(
Multimap<SchemaApiTestTable.SchemaApiTestRow, ? extends SchemaApiTestTable.SchemaApiTestNamedColumnValue<?>> newRows) {
public void putSchemaApiTest(Multimap<SchemaApiTestTable.SchemaApiTestRow, ? extends SchemaApiTestTable.SchemaApiTestNamedColumnValue<?>> newRows) {
// do nothing
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
import java.util.concurrent.Callable;
import java.util.concurrent.TimeUnit;
import java.util.function.BiFunction;
import java.util.function.Supplier;
import java.util.stream.Stream;

import javax.annotation.Generated;

import com.google.common.base.Function;
import com.google.common.base.Joiner;
import com.google.common.base.MoreObjects;
import com.google.common.base.Supplier;
import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.Collections2;
import com.google.common.collect.ComparisonChain;
Expand Down Expand Up @@ -749,5 +749,5 @@ public List<String> findConstraintFailuresNoRead(Map<Cell, byte[]> writes,
* {@link UnsignedBytes}
* {@link ValueType}
*/
static String __CLASS_HASH = "wcMKuy9F9wZNt8f7UQPeUg==";
static String __CLASS_HASH = "D7jBjvqrJyVDhFQlvw9TRA==";
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
import java.util.concurrent.Callable;
import java.util.concurrent.TimeUnit;
import java.util.function.BiFunction;
import java.util.function.Supplier;
import java.util.stream.Stream;

import javax.annotation.Generated;

import com.google.common.base.Function;
import com.google.common.base.Joiner;
import com.google.common.base.MoreObjects;
import com.google.common.base.Supplier;
import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.Collections2;
import com.google.common.collect.ComparisonChain;
Expand Down Expand Up @@ -833,5 +833,5 @@ public List<String> findConstraintFailuresNoRead(Map<Cell, byte[]> writes,
* {@link UnsignedBytes}
* {@link ValueType}
*/
static String __CLASS_HASH = "h9whmxJpFX2yqVXafsa5AQ==";
static String __CLASS_HASH = "gJjGs7nehodvK83lsXBdyA==";
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,14 @@
*/
package com.palantir.atlasdb.cache;

import java.util.function.Supplier;

import javax.annotation.Nullable;

import com.codahale.metrics.MetricRegistry;
import com.github.benmanes.caffeine.cache.Cache;
import com.github.benmanes.caffeine.cache.Caffeine;
import com.github.benmanes.caffeine.cache.Policy;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Supplier;
import com.palantir.atlasdb.util.AtlasDbMetrics;

public class TimestampCache {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
package com.palantir.atlasdb.schema;

import java.io.File;
import java.util.function.Supplier;

import com.google.common.base.Supplier;
import com.google.common.base.Suppliers;
import com.palantir.atlasdb.keyvalue.api.Namespace;
import com.palantir.atlasdb.table.description.OptionalType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
package com.palantir.atlasdb.schema;

import java.io.File;
import java.util.function.Supplier;

import com.google.common.base.Supplier;
import com.google.common.base.Suppliers;
import com.palantir.atlasdb.keyvalue.api.Namespace;
import com.palantir.atlasdb.table.description.OptionalType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
import java.util.concurrent.Callable;
import java.util.concurrent.TimeUnit;
import java.util.function.BiFunction;
import java.util.function.Supplier;
import java.util.stream.Stream;

import javax.annotation.Generated;

import com.google.common.base.Function;
import com.google.common.base.Joiner;
import com.google.common.base.MoreObjects;
import com.google.common.base.Supplier;
import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.Collections2;
import com.google.common.collect.ComparisonChain;
Expand Down Expand Up @@ -657,5 +657,5 @@ public List<String> findConstraintFailuresNoRead(Map<Cell, byte[]> writes,
* {@link UnsignedBytes}
* {@link ValueType}
*/
static String __CLASS_HASH = "vX96N598CtO5B/gkmgCmsg==";
static String __CLASS_HASH = "0WtSpbMMOvlM3AribPiPxQ==";
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,12 @@ private CompactTableFactory(List<Function<? super Transaction, SharedTriggers>>
this.namespace = namespace;
}

public static CompactTableFactory of(
List<Function<? super Transaction, SharedTriggers>> sharedTriggers,
public static CompactTableFactory of(List<Function<? super Transaction, SharedTriggers>> sharedTriggers,
Namespace namespace) {
return new CompactTableFactory(sharedTriggers, namespace);
}

public static CompactTableFactory of(
List<Function<? super Transaction, SharedTriggers>> sharedTriggers) {
public static CompactTableFactory of(List<Function<? super Transaction, SharedTriggers>> sharedTriggers) {
return new CompactTableFactory(sharedTriggers, defaultNamespace);
}

Expand All @@ -53,8 +51,7 @@ public interface SharedTriggers extends CompactMetadataTable.CompactMetadataTrig

public abstract static class NullSharedTriggers implements SharedTriggers {
@Override
public void putCompactMetadata(
Multimap<CompactMetadataTable.CompactMetadataRow, ? extends CompactMetadataTable.CompactMetadataNamedColumnValue<?>> newRows) {
public void putCompactMetadata(Multimap<CompactMetadataTable.CompactMetadataRow, ? extends CompactMetadataTable.CompactMetadataNamedColumnValue<?>> newRows) {
// do nothing
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
import java.util.concurrent.Callable;
import java.util.concurrent.TimeUnit;
import java.util.function.BiFunction;
import java.util.function.Supplier;
import java.util.stream.Stream;

import javax.annotation.Generated;

import com.google.common.base.Function;
import com.google.common.base.Joiner;
import com.google.common.base.MoreObjects;
import com.google.common.base.Supplier;
import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.Collections2;
import com.google.common.collect.ComparisonChain;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
import java.util.concurrent.Callable;
import java.util.concurrent.TimeUnit;
import java.util.function.BiFunction;
import java.util.function.Supplier;
import java.util.stream.Stream;

import javax.annotation.Generated;

import com.google.common.base.Function;
import com.google.common.base.Joiner;
import com.google.common.base.MoreObjects;
import com.google.common.base.Supplier;
import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.Collections2;
import com.google.common.collect.ComparisonChain;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
import java.util.concurrent.Callable;
import java.util.concurrent.TimeUnit;
import java.util.function.BiFunction;
import java.util.function.Supplier;
import java.util.stream.Stream;

import javax.annotation.Generated;

import com.google.common.base.Function;
import com.google.common.base.Joiner;
import com.google.common.base.MoreObjects;
import com.google.common.base.Supplier;
import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.Collections2;
import com.google.common.collect.ComparisonChain;
Expand Down Expand Up @@ -1214,5 +1214,5 @@ public List<String> findConstraintFailuresNoRead(Map<Cell, byte[]> writes,
* {@link UnsignedBytes}
* {@link ValueType}
*/
static String __CLASS_HASH = "P4pMrqwez6sbaQ8bCukCWA==";
static String __CLASS_HASH = "SQZh8Tiuo9hisseHEHNpnA==";
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
import java.util.concurrent.Callable;
import java.util.concurrent.TimeUnit;
import java.util.function.BiFunction;
import java.util.function.Supplier;
import java.util.stream.Stream;

import javax.annotation.Generated;

import com.google.common.base.Function;
import com.google.common.base.Joiner;
import com.google.common.base.MoreObjects;
import com.google.common.base.Supplier;
import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.Collections2;
import com.google.common.collect.ComparisonChain;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,12 @@ private SweepTableFactory(List<Function<? super Transaction, SharedTriggers>> sh
this.namespace = namespace;
}

public static SweepTableFactory of(
List<Function<? super Transaction, SharedTriggers>> sharedTriggers,
public static SweepTableFactory of(List<Function<? super Transaction, SharedTriggers>> sharedTriggers,
Namespace namespace) {
return new SweepTableFactory(sharedTriggers, namespace);
}

public static SweepTableFactory of(
List<Function<? super Transaction, SharedTriggers>> sharedTriggers) {
public static SweepTableFactory of(List<Function<? super Transaction, SharedTriggers>> sharedTriggers) {
return new SweepTableFactory(sharedTriggers, defaultNamespace);
}

Expand All @@ -53,8 +51,7 @@ public interface SharedTriggers extends SweepPriorityTable.SweepPriorityTrigger

public abstract static class NullSharedTriggers implements SharedTriggers {
@Override
public void putSweepPriority(
Multimap<SweepPriorityTable.SweepPriorityRow, ? extends SweepPriorityTable.SweepPriorityNamedColumnValue<?>> newRows) {
public void putSweepPriority(Multimap<SweepPriorityTable.SweepPriorityRow, ? extends SweepPriorityTable.SweepPriorityNamedColumnValue<?>> newRows) {
// do nothing
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
import java.util.concurrent.Callable;
import java.util.concurrent.TimeUnit;
import java.util.function.BiFunction;
import java.util.function.Supplier;
import java.util.stream.Stream;

import javax.annotation.Generated;

import com.google.common.base.Function;
import com.google.common.base.Joiner;
import com.google.common.base.MoreObjects;
import com.google.common.base.Supplier;
import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.Collections2;
import com.google.common.collect.ComparisonChain;
Expand Down
Loading

0 comments on commit 0d9afb5

Please sign in to comment.