Skip to content

Commit 837e02e

Browse files
authored
Remove QueryHashable (#3392)
This removes the unused `QueryHashable` interface
1 parent 43a59ba commit 837e02e

File tree

61 files changed

+8
-1356
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+8
-1356
lines changed

fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/ObjectPlanHash.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
* member of the model apart. Using this class we can implement a stable (withstand JVM restart and class refactorings)
3030
* base hash for each object that can be added to the rest of the plan.
3131
*/
32-
public class ObjectPlanHash implements PlanHashable, QueryHashable {
32+
public class ObjectPlanHash implements PlanHashable {
3333
@Nonnull
3434
private final Object id;
3535
private final int hashCode;
@@ -44,11 +44,6 @@ public int planHash(@Nonnull final PlanHashable.PlanHashMode mode) {
4444
return hashCode;
4545
}
4646

47-
@Override
48-
public int queryHash(@Nonnull final QueryHashable.QueryHashKind hashKind) {
49-
return hashCode;
50-
}
51-
5247
@Override
5348
public int hashCode() {
5449
return hashCode;

fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/QueryHashable.java

Lines changed: 0 additions & 55 deletions
This file was deleted.

fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/RecordFunction.java

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
package com.apple.foundationdb.record;
2222

2323
import com.apple.foundationdb.annotation.API;
24-
import com.apple.foundationdb.record.util.HashUtils;
2524
import com.google.protobuf.Descriptors;
2625

2726
import javax.annotation.Nonnull;
@@ -31,7 +30,7 @@
3130
* @param <T> the result type of the function
3231
*/
3332
@API(API.Status.UNSTABLE)
34-
public abstract class RecordFunction<T> implements PlanHashable, QueryHashable {
33+
public abstract class RecordFunction<T> implements PlanHashable {
3534

3635
@Nonnull
3736
private final String name;
@@ -88,18 +87,4 @@ protected int basePlanHash(@Nonnull final PlanHashMode mode, ObjectPlanHash base
8887
throw new UnsupportedOperationException("Hash kind " + mode.getKind() + " is not supported");
8988
}
9089
}
91-
92-
/**
93-
* Base implementation of {@link #queryHash}.
94-
* This implementation makes each concrete subclass implement its own version of {@link #queryHash} so that they are
95-
* guided to add their own class modifier (See {@link com.apple.foundationdb.record.ObjectPlanHash ObjectPlanHash}).
96-
* This implementation is meant to give subclasses common functionality for their own implementation.
97-
* @param hashKind the query hash kind to use
98-
* @param baseHash the subclass' base hash (concrete identifier)
99-
* @param hashables the rest of the subclass' hashable parameters (if any)
100-
* @return the query hash value calculated
101-
*/
102-
protected int baseQueryHash(@Nonnull final QueryHashable.QueryHashKind hashKind, ObjectPlanHash baseHash, Object... hashables) {
103-
return HashUtils.queryHash(hashKind, baseHash, name, hashables);
104-
}
10590
}

fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/metadata/IndexRecordFunction.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,4 @@ public int planHash(@Nonnull final PlanHashable.PlanHashMode mode) {
118118
return super.basePlanHash(mode, BASE_HASH, operand, index);
119119
}
120120

121-
@Override
122-
public int queryHash(@Nonnull final QueryHashKind hashKind) {
123-
return super.baseQueryHash(hashKind, BASE_HASH, operand, index);
124-
}
125121
}

fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/metadata/StoreRecordFunction.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,4 @@ public int planHash(@Nonnull final PlanHashable.PlanHashMode mode) {
6767
return super.basePlanHash(mode, BASE_HASH);
6868
}
6969

70-
@Override
71-
public int queryHash(@Nonnull final QueryHashKind hashKind) {
72-
return super.baseQueryHash(hashKind, BASE_HASH);
73-
}
7470
}

fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/metadata/expressions/CollateFunctionKeyExpression.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,4 @@ public int planHash(@Nonnull final PlanHashable.PlanHashMode mode) {
211211
return super.basePlanHash(mode, BASE_HASH);
212212
}
213213

214-
@Override
215-
public int queryHash(@Nonnull final QueryHashKind hashKind) {
216-
return super.baseQueryHash(hashKind, BASE_HASH);
217-
}
218214
}

fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/metadata/expressions/DimensionsKeyExpression.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
import com.apple.foundationdb.record.metadata.Key;
2828
import com.apple.foundationdb.record.provider.foundationdb.FDBRecord;
2929
import com.apple.foundationdb.record.query.plan.cascades.KeyExpressionVisitor;
30-
import com.apple.foundationdb.record.util.HashUtils;
3130
import com.google.common.base.Verify;
3231
import com.google.common.collect.ImmutableList;
3332
import com.google.protobuf.Descriptors;
@@ -229,11 +228,6 @@ public int planHash(@Nonnull final PlanHashMode mode) {
229228
}
230229
}
231230

232-
@Override
233-
public int queryHash(@Nonnull final QueryHashKind hashKind) {
234-
return HashUtils.queryHash(hashKind, BASE_HASH, getWholeKey(), prefixSize, dimensionsSize);
235-
}
236-
237231
@Nonnull
238232
public static DimensionsKeyExpression of(@Nullable final KeyExpression prefix,
239233
@Nonnull final KeyExpression dimensions) {

fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/metadata/expressions/EmptyKeyExpression.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
import com.apple.foundationdb.record.metadata.Key;
2828
import com.apple.foundationdb.record.provider.foundationdb.FDBRecord;
2929
import com.apple.foundationdb.record.query.plan.cascades.KeyExpressionVisitor;
30-
import com.apple.foundationdb.record.util.HashUtils;
3130
import com.google.protobuf.Descriptors;
3231
import com.google.protobuf.Message;
3332

@@ -135,8 +134,4 @@ public int planHash(@Nonnull final PlanHashMode mode) {
135134
}
136135
}
137136

138-
@Override
139-
public int queryHash(@Nonnull final QueryHashKind hashKind) {
140-
return HashUtils.queryHash(hashKind, BASE_HASH);
141-
}
142137
}

fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/metadata/expressions/FieldKeyExpression.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
import com.apple.foundationdb.record.query.plan.cascades.KeyExpressionVisitor;
3434
import com.apple.foundationdb.record.query.plan.cascades.Quantifier;
3535
import com.apple.foundationdb.record.query.plan.cascades.expressions.ExplodeExpression;
36-
import com.apple.foundationdb.record.util.HashUtils;
3736
import com.google.common.collect.ImmutableList;
3837
import com.google.protobuf.Descriptors;
3938
import com.google.protobuf.Message;
@@ -370,11 +369,6 @@ public int planHash(@Nonnull final PlanHashMode mode) {
370369
}
371370
}
372371

373-
@Override
374-
public int queryHash(@Nonnull final QueryHashKind hashKind) {
375-
return HashUtils.queryHash(hashKind, BASE_HASH, fieldName, fanType);
376-
}
377-
378372
@Override
379373
public boolean equalsAtomic(AtomKeyExpression other) {
380374
return equals(other);

fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/metadata/expressions/FunctionKeyExpression.java

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
import com.apple.foundationdb.record.query.plan.cascades.KeyExpressionVisitor;
3434
import com.apple.foundationdb.record.query.plan.cascades.values.BuiltInFunctionCatalog;
3535
import com.apple.foundationdb.record.query.plan.cascades.values.Value;
36-
import com.apple.foundationdb.record.util.HashUtils;
3736
import com.apple.foundationdb.record.util.ServiceLoaderProvider;
3837
import com.google.protobuf.Descriptors;
3938
import com.google.protobuf.Message;
@@ -325,20 +324,6 @@ protected int basePlanHash(@Nonnull final PlanHashMode mode, ObjectPlanHash base
325324
}
326325
}
327326

328-
/**
329-
* Base implementation of {@link #queryHash}.
330-
* This implementation makes each concrete subclass implement its own version of {@link #queryHash} so that they are
331-
* guided to add their own class modifier (See {@link com.apple.foundationdb.record.ObjectPlanHash ObjectPlanHash}).
332-
* This implementation is meant to give subclasses common functionality for their own implementation.
333-
* @param hashKind the query hash kind to use
334-
* @param baseHash the subclass' base hash (concrete identifier)
335-
* @param hashables the rest of the subclass' hashable parameters (if any)
336-
* @return the query hash value calculated
337-
*/
338-
protected int baseQueryHash(@Nonnull final QueryHashKind hashKind, ObjectPlanHash baseHash, Object... hashables) {
339-
return HashUtils.queryHash(hashKind, baseHash, getName(), getArguments(), hashables);
340-
}
341-
342327
@Override
343328
public String toString() {
344329
return getName() + "(" + getArguments() + ")";

0 commit comments

Comments
 (0)