Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support UDF in planner #2995

Open
wants to merge 79 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 70 commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
3a5a44b
save
pengpeng-lu Jul 28, 2023
53416bf
Revert "save"
pengpeng-lu Jul 28, 2023
3f88bb4
Merge remote-tracking branch 'upstream/main'
pengpeng-lu Jul 28, 2023
773e0dd
Merge remote-tracking branch 'upstream/main'
pengpeng-lu Aug 11, 2023
fa472d7
Merge remote-tracking branch 'upstream/main'
pengpeng-lu Sep 18, 2023
4c32432
Merge remote-tracking branch 'upstream/main'
pengpeng-lu Sep 25, 2023
ccd8e8d
Merge remote-tracking branch 'upstream/main'
pengpeng-lu Oct 17, 2023
403a4a2
Merge remote-tracking branch 'upstream/main'
pengpeng-lu Nov 30, 2023
cada59a
Merge remote-tracking branch 'upstream/main'
pengpeng-lu Nov 30, 2023
3b02019
Merge remote-tracking branch 'upstream/main'
pengpeng-lu Jan 16, 2024
138a7fc
Merge remote-tracking branch 'upstream/main'
pengpeng-lu Jan 17, 2024
f8b3658
Merge branch 'main' of github.com:pengpeng-lu/fdb-record-layer
pengpeng-lu Feb 13, 2024
b4edc0a
Merge remote-tracking branch 'upstream/main'
pengpeng-lu Feb 20, 2024
c42c0ce
Merge remote-tracking branch 'upstream/main'
pengpeng-lu Feb 21, 2024
a570479
Merge remote-tracking branch 'upstream/main'
pengpeng-lu Feb 27, 2024
f4e5cac
Merge remote-tracking branch 'upstream/main'
pengpeng-lu Mar 4, 2024
c10ec5b
Merge remote-tracking branch 'upstream/main'
pengpeng-lu Apr 2, 2024
0d9cc50
Merge remote-tracking branch 'upstream/main'
pengpeng-lu Apr 12, 2024
057fee0
Merge remote-tracking branch 'upstream/main'
pengpeng-lu May 8, 2024
37c8641
Merge remote-tracking branch 'upstream/main'
pengpeng-lu Jun 7, 2024
a52d15a
Merge remote-tracking branch 'upstream/main'
pengpeng-lu Jun 11, 2024
74c24fb
Merge remote-tracking branch 'upstream/main'
pengpeng-lu Jul 11, 2024
2f33668
Merge remote-tracking branch 'upstream/main'
pengpeng-lu Jul 17, 2024
01c4d01
Merge remote-tracking branch 'upstream/main'
pengpeng-lu Aug 7, 2024
8c70b2a
Merge remote-tracking branch 'upstream/main'
pengpeng-lu Aug 13, 2024
5d59fa2
Merge remote-tracking branch 'upstream/main'
pengpeng-lu Aug 15, 2024
7e84176
Merge remote-tracking branch 'upstream/main'
pengpeng-lu Aug 26, 2024
0d54f1e
Merge remote-tracking branch 'upstream/main'
pengpeng-lu Aug 29, 2024
543a79c
Merge remote-tracking branch 'upstream/main'
pengpeng-lu Sep 5, 2024
8fd8208
Merge remote-tracking branch 'upstream/main'
pengpeng-lu Sep 11, 2024
f5b3314
Merge remote-tracking branch 'upstream/main'
pengpeng-lu Sep 13, 2024
9956a9f
Merge remote-tracking branch 'upstream/main'
pengpeng-lu Sep 19, 2024
5476bb4
Merge remote-tracking branch 'upstream/main'
pengpeng-lu Nov 20, 2024
f9fd6a9
Merge remote-tracking branch 'upstream/main'
pengpeng-lu Nov 20, 2024
651816c
save
pengpeng-lu Nov 20, 2024
2c886c8
save
pengpeng-lu Dec 5, 2024
38a8004
save
pengpeng-lu Dec 11, 2024
4f7a23f
save
pengpeng-lu Dec 12, 2024
25eb6cf
save
pengpeng-lu Dec 12, 2024
6ebd19b
reformat
pengpeng-lu Dec 13, 2024
f8088f5
replace
pengpeng-lu Dec 16, 2024
157ab0c
put keyexpression in separate proto
pengpeng-lu Dec 18, 2024
0daa4ce
checkstyle
pengpeng-lu Dec 18, 2024
9a325bf
checksylte
pengpeng-lu Dec 19, 2024
bffaca4
Merge remote-tracking branch 'upstream/main'
pengpeng-lu Dec 19, 2024
b3589d2
Merge branch 'main' into udf
pengpeng-lu Dec 19, 2024
46eaaf1
checkstyle
pengpeng-lu Dec 19, 2024
523859e
save
pengpeng-lu Jan 9, 2025
18312ed
Merge remote-tracking branch 'upstream/main'
pengpeng-lu Jan 9, 2025
0a70d6e
merge main
pengpeng-lu Jan 9, 2025
d058c09
MacroFunction
pengpeng-lu Jan 10, 2025
67fad06
save
pengpeng-lu Jan 10, 2025
e11b315
add test
pengpeng-lu Jan 11, 2025
29b9cb2
pmd
pengpeng-lu Jan 13, 2025
52b3ba4
comments
pengpeng-lu Jan 14, 2025
91e6117
change package
pengpeng-lu Jan 14, 2025
262f03b
fix test compile error
pengpeng-lu Jan 15, 2025
b8eb6f1
remove gradle change
pengpeng-lu Feb 3, 2025
94bc71d
remove redundant cast
pengpeng-lu Feb 3, 2025
8549291
merge main
pengpeng-lu Feb 3, 2025
9610aa4
remove more cast
pengpeng-lu Feb 3, 2025
6ff48c0
checkstyle
pengpeng-lu Feb 4, 2025
bd1cd47
pass tests
pengpeng-lu Feb 4, 2025
b67cbb7
save
pengpeng-lu Feb 5, 2025
2cb7ebd
rename function to CatalogedFunction
pengpeng-lu Feb 5, 2025
c82fa36
save
pengpeng-lu Feb 5, 2025
1635552
SerializableFunction
pengpeng-lu Feb 6, 2025
3bda453
clean
pengpeng-lu Feb 6, 2025
8ba674f
pmd
pengpeng-lu Feb 6, 2025
385aa1d
remove * in imports
pengpeng-lu Feb 6, 2025
25aa001
restructure function classes
pengpeng-lu Feb 12, 2025
32c0e42
pmd
pengpeng-lu Feb 12, 2025
cd3114c
rename AbstractCatalogedFunction to UserDefinedFunction
pengpeng-lu Feb 14, 2025
67cb050
Merge branch 'main' into udf
pengpeng-lu Feb 14, 2025
e61289b
checkstyle
pengpeng-lu Feb 17, 2025
7e3ebf9
Merge branch 'main' into udf
pengpeng-lu Feb 20, 2025
59ec547
Merge branch 'main' into udf
pengpeng-lu Feb 21, 2025
d7bc203
pmd
pengpeng-lu Feb 22, 2025
d0c881f
Merge branch 'main' into udf
pengpeng-lu Feb 26, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import com.apple.foundationdb.record.metadata.JoinedRecordType;
import com.apple.foundationdb.record.metadata.MetaDataException;
import com.apple.foundationdb.record.metadata.RecordType;
import com.apple.foundationdb.record.metadata.SerializableFunction;
import com.apple.foundationdb.record.metadata.SyntheticRecordType;
import com.apple.foundationdb.record.metadata.UnnestedRecordType;
import com.apple.foundationdb.record.metadata.expressions.KeyExpression;
Expand All @@ -48,6 +49,7 @@
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;
import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Collectors;
Expand Down Expand Up @@ -83,6 +85,8 @@ public class RecordMetaData implements RecordMetaDataProvider {
@Nonnull
private final Map<Object, SyntheticRecordType<?>> recordTypeKeyToSyntheticTypeMap;
@Nonnull
private final Set<SerializableFunction> serializableFunctions;
@Nonnull
private final Map<String, Index> indexes;
@Nonnull
private final Map<String, Index> universalIndexes;
Expand Down Expand Up @@ -112,6 +116,7 @@ protected RecordMetaData(@Nonnull RecordMetaData orig) {
Collections.unmodifiableMap(orig.indexes),
Collections.unmodifiableMap(orig.universalIndexes),
Collections.unmodifiableList(orig.formerIndexes),
Collections.unmodifiableSet(orig.serializableFunctions),
orig.splitLongRecords,
orig.storeRecordVersions,
orig.version,
Expand All @@ -131,6 +136,7 @@ protected RecordMetaData(@Nonnull Descriptors.FileDescriptor recordsDescriptor,
@Nonnull Map<String, Index> indexes,
@Nonnull Map<String, Index> universalIndexes,
@Nonnull List<FormerIndex> formerIndexes,
@Nonnull Set<SerializableFunction> serializableFunctions,
boolean splitLongRecords,
boolean storeRecordVersions,
int version,
Expand All @@ -147,6 +153,7 @@ protected RecordMetaData(@Nonnull Descriptors.FileDescriptor recordsDescriptor,
this.indexes = indexes;
this.universalIndexes = universalIndexes;
this.formerIndexes = formerIndexes;
this.serializableFunctions = serializableFunctions;
this.splitLongRecords = splitLongRecords;
this.storeRecordVersions = storeRecordVersions;
this.version = version;
Expand Down Expand Up @@ -342,6 +349,11 @@ public List<FormerIndex> getFormerIndexes() {
return formerIndexes;
}

@Nonnull
public Collection<SerializableFunction> getAllSerializableFunctions() {
return serializableFunctions;
}

public boolean isSplitLongRecords() {
return splitLongRecords;
}
Expand Down Expand Up @@ -692,7 +704,7 @@ public RecordMetaDataProto.MetaData toProto(@Nullable Descriptors.FileDescriptor
builder.addFormerIndexes(formerIndex.toProto());
}

// Add in the final options.
builder.addAllSerializableFunction(serializableFunctions.stream().map(SerializableFunction::toProto).collect(Collectors.toList()));
builder.setSplitLongRecords(splitLongRecords);
builder.setStoreRecordVersions(storeRecordVersions);
builder.setVersion(version);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import com.apple.foundationdb.record.metadata.RecordType;
import com.apple.foundationdb.record.metadata.RecordTypeBuilder;
import com.apple.foundationdb.record.metadata.RecordTypeIndexesBuilder;
import com.apple.foundationdb.record.metadata.SerializableFunction;
import com.apple.foundationdb.record.metadata.SyntheticRecordType;
import com.apple.foundationdb.record.metadata.SyntheticRecordTypeBuilder;
import com.apple.foundationdb.record.metadata.UnnestedRecordTypeBuilder;
Expand All @@ -42,6 +43,7 @@
import com.apple.foundationdb.record.provider.foundationdb.IndexMaintainerRegistry;
import com.apple.foundationdb.record.provider.foundationdb.IndexMaintainerRegistryImpl;
import com.apple.foundationdb.record.provider.foundationdb.MetaDataProtoEditor;
import com.apple.foundationdb.record.query.plan.serialization.DefaultPlanSerializationRegistry;
import com.google.common.base.Verify;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Maps;
Expand Down Expand Up @@ -110,6 +112,8 @@ public class RecordMetaDataBuilder implements RecordMetaDataProvider {
@Nonnull
private final Map<String, SyntheticRecordTypeBuilder<?>> syntheticRecordTypes;
@Nonnull
private final Set<SerializableFunction> serializableFunctions;
@Nonnull
private final Map<String, Index> indexes;
@Nonnull
private final Map<String, Index> universalIndexes;
Expand Down Expand Up @@ -144,6 +148,7 @@ public class RecordMetaDataBuilder implements RecordMetaDataProvider {
indexMaintainerRegistry = IndexMaintainerRegistryImpl.instance();
evolutionValidator = MetaDataEvolutionValidator.getDefaultInstance();
syntheticRecordTypes = new HashMap<>();
serializableFunctions = new HashSet<>();
}

private void processSchemaOptions(boolean processExtensionOptions) {
Expand Down Expand Up @@ -222,6 +227,14 @@ private void loadProtoExceptRecords(@Nonnull RecordMetaDataProto.MetaData metaDa
typeBuilder.setRecordTypeKey(LiteralKeyExpression.fromProtoValue(typeProto.getExplicitKey()));
}
}
PlanSerializationContext serializationContext = new PlanSerializationContext(DefaultPlanSerializationRegistry.INSTANCE,
PlanHashable.CURRENT_FOR_CONTINUATION);
for (RecordMetaDataProto.SerializableFunction serializableFunction: metaDataProto.getSerializableFunctionList()) {
SerializableFunction func = SerializableFunction.fromProto(serializationContext, serializableFunction);
if (func != null) {
serializableFunctions.add(func);
}
}
if (metaDataProto.hasSplitLongRecords()) {
splitLongRecords = metaDataProto.getSplitLongRecords();
}
Expand Down Expand Up @@ -1179,6 +1192,14 @@ public void addFormerIndex(@Nonnull FormerIndex formerIndex) {
formerIndexes.add(formerIndex);
}

public void addSerializableFunction(@Nonnull SerializableFunction serializableFunction) {
serializableFunctions.add(serializableFunction);
}

public void addSerializableFunctions(@Nonnull Iterable<? extends SerializableFunction> functions) {
functions.forEach(this.serializableFunctions::add);
}

public boolean isSplitLongRecords() {
return splitLongRecords;
}
Expand Down Expand Up @@ -1420,7 +1441,7 @@ public RecordMetaData build(boolean validate) {
Map<Object, SyntheticRecordType<?>> recordTypeKeyToSyntheticRecordTypeMap = Maps.newHashMapWithExpectedSize(syntheticRecordTypes.size());
RecordMetaData metaData = new RecordMetaData(recordsDescriptor, getUnionDescriptor(), unionFields,
builtRecordTypes, builtSyntheticRecordTypes, recordTypeKeyToSyntheticRecordTypeMap,
indexes, universalIndexes, formerIndexes,
indexes, universalIndexes, formerIndexes, serializableFunctions,
splitLongRecords, storeRecordVersions, version, subspaceKeyCounter, usesSubspaceKeyCounter, recordCountKey, localFileDescriptor != null);
for (RecordTypeBuilder recordTypeBuilder : recordTypes.values()) {
KeyExpression primaryKey = recordTypeBuilder.getPrimaryKey();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

import com.apple.foundationdb.annotation.API;
import com.apple.foundationdb.annotation.SpotBugsSuppressWarnings;
import com.apple.foundationdb.record.RecordMetaDataProto;
import com.apple.foundationdb.record.expressions.RecordKeyExpressionProto;
import com.apple.foundationdb.record.logging.LogMessageKeys;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to make review easier, all changes in this file is to change the package.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you ask Alec to review the proto stuff as well?

import com.apple.foundationdb.record.metadata.expressions.EmptyKeyExpression;
import com.apple.foundationdb.record.metadata.expressions.FieldKeyExpression;
Expand Down Expand Up @@ -392,21 +392,21 @@ public static class Evaluated {
* Values used in index keys in place of missing fields.
*/
public enum NullStandin {
NULL(RecordMetaDataProto.Field.NullInterpretation.NOT_UNIQUE), // Missing field here skips uniqueness checks.
NULL_UNIQUE(RecordMetaDataProto.Field.NullInterpretation.UNIQUE), // Missing field here like ordinary value, but null, for uniqueness.
NOT_NULL(RecordMetaDataProto.Field.NullInterpretation.NOT_NULL); // Missing field has type's ordinary default value.
NULL(RecordKeyExpressionProto.Field.NullInterpretation.NOT_UNIQUE), // Missing field here skips uniqueness checks.
NULL_UNIQUE(RecordKeyExpressionProto.Field.NullInterpretation.UNIQUE), // Missing field here like ordinary value, but null, for uniqueness.
NOT_NULL(RecordKeyExpressionProto.Field.NullInterpretation.NOT_NULL); // Missing field has type's ordinary default value.

private RecordMetaDataProto.Field.NullInterpretation proto;
private RecordKeyExpressionProto.Field.NullInterpretation proto;

NullStandin(RecordMetaDataProto.Field.NullInterpretation nullInterpretation) {
NullStandin(RecordKeyExpressionProto.Field.NullInterpretation nullInterpretation) {
proto = nullInterpretation;
}

public RecordMetaDataProto.Field.NullInterpretation toProto() {
public RecordKeyExpressionProto.Field.NullInterpretation toProto() {
return proto;
}

public static NullStandin valueOf(RecordMetaDataProto.Field.NullInterpretation nullInterpretation) throws KeyExpression.DeserializationException {
public static NullStandin valueOf(RecordKeyExpressionProto.Field.NullInterpretation nullInterpretation) throws KeyExpression.DeserializationException {
switch (nullInterpretation) {
case NOT_UNIQUE:
return NULL;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* SerializableFunction.java
*
* This source file is part of the FoundationDB open source project
*
* Copyright 2015-2025 Apple Inc. and the FoundationDB project authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.apple.foundationdb.record.metadata;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This approach you have taken is not what I had in mind:

  • BuiltInFunction should give up most of its attributes/functionality, encapsulation to this class. Only the encapsulation lambda should stay that is used to implement the encapsulate() method.
  • BuiltInFunction should be THE base for all internal functions that are not domain specific (like length(string) or similar).
  • MacroFunction should be extending this class and adding the functionality that you coded up to expand an arbitrary body

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

discussed offline, restructured the code.


import com.apple.foundationdb.record.PlanSerializationContext;
import com.apple.foundationdb.record.RecordMetaDataProto;
import com.apple.foundationdb.record.query.plan.cascades.MacroFunction;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;

public interface SerializableFunction {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be called something that encompasses more than just serialization. I had suggested CatalogedFunction.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

discussed offline, renamed.

@Nonnull
RecordMetaDataProto.SerializableFunction toProto();

@Nullable
static SerializableFunction fromProto(@Nonnull final PlanSerializationContext serializationContext, @Nonnull final RecordMetaDataProto.SerializableFunction proto) {
if (proto.hasMacroFunction()) {
return MacroFunction.fromProto(serializationContext, proto.getMacroFunction());
} else {
return null;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can add more if blocks when we have more items in the oneof

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will do dynamic dispatch in a follow-up PR

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import com.apple.foundationdb.annotation.API;
import com.apple.foundationdb.record.ObjectPlanHash;
import com.apple.foundationdb.record.PlanHashable;
import com.apple.foundationdb.record.RecordMetaDataProto;
import com.apple.foundationdb.record.expressions.RecordKeyExpressionProto;
import com.apple.foundationdb.record.metadata.Key;
import com.apple.foundationdb.record.provider.foundationdb.FDBRecord;
import com.apple.foundationdb.record.query.plan.cascades.KeyExpressionVisitor;
Expand Down Expand Up @@ -63,7 +63,7 @@ private DimensionsKeyExpression(@Nonnull final KeyExpression wholeKey,
this.dimensionsSize = dimensionsSize;
}

DimensionsKeyExpression(@Nonnull final RecordMetaDataProto.Dimensions dimensions) throws DeserializationException {
DimensionsKeyExpression(@Nonnull final RecordKeyExpressionProto.Dimensions dimensions) throws DeserializationException {
this(KeyExpression.fromProto(dimensions.getWholeKey()), dimensions.getPrefixSize(), dimensions.getDimensionsSize());
}

Expand Down Expand Up @@ -114,8 +114,8 @@ public boolean needsCopyingToPartialRecord() {

@Nonnull
@Override
public RecordMetaDataProto.Dimensions toProto() throws SerializationException {
final RecordMetaDataProto.Dimensions.Builder builder = RecordMetaDataProto.Dimensions.newBuilder();
public RecordKeyExpressionProto.Dimensions toProto() throws SerializationException {
final RecordKeyExpressionProto.Dimensions.Builder builder = RecordKeyExpressionProto.Dimensions.newBuilder();
builder.setWholeKey(getWholeKey().toKeyExpression());
builder.setPrefixSize(prefixSize);
builder.setDimensionsSize(dimensionsSize);
Expand All @@ -124,8 +124,8 @@ public RecordMetaDataProto.Dimensions toProto() throws SerializationException {

@Nonnull
@Override
public RecordMetaDataProto.KeyExpression toKeyExpression() {
return RecordMetaDataProto.KeyExpression.newBuilder().setDimensions(toProto()).build();
public RecordKeyExpressionProto.KeyExpression toKeyExpression() {
return RecordKeyExpressionProto.KeyExpression.newBuilder().setDimensions(toProto()).build();
}

@Nonnull
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import com.apple.foundationdb.annotation.API;
import com.apple.foundationdb.record.ObjectPlanHash;
import com.apple.foundationdb.record.PlanHashable;
import com.apple.foundationdb.record.RecordMetaDataProto;
import com.apple.foundationdb.record.expressions.RecordKeyExpressionProto;
import com.apple.foundationdb.record.metadata.Key;
import com.apple.foundationdb.record.provider.foundationdb.FDBRecord;
import com.apple.foundationdb.record.query.plan.cascades.KeyExpressionVisitor;
Expand All @@ -45,8 +45,8 @@ public class EmptyKeyExpression extends BaseKeyExpression implements KeyExpressi
private static final ObjectPlanHash BASE_HASH = new ObjectPlanHash("Empty-Key-Expression");

public static final EmptyKeyExpression EMPTY = new EmptyKeyExpression();
public static final RecordMetaDataProto.KeyExpression EMPTY_PROTO =
RecordMetaDataProto.KeyExpression.newBuilder().setEmpty(EMPTY.toProto()).build();
public static final RecordKeyExpressionProto.KeyExpression EMPTY_PROTO =
RecordKeyExpressionProto.KeyExpression.newBuilder().setEmpty(EMPTY.toProto()).build();

private EmptyKeyExpression() {
// nothing to initialize
Expand Down Expand Up @@ -75,8 +75,8 @@ public int getColumnSize() {

@Nonnull
@Override
public RecordMetaDataProto.Empty toProto() throws SerializationException {
return RecordMetaDataProto.Empty.getDefaultInstance();
public RecordKeyExpressionProto.Empty toProto() throws SerializationException {
return RecordKeyExpressionProto.Empty.getDefaultInstance();
}

@Nonnull
Expand All @@ -87,7 +87,7 @@ public <S extends KeyExpressionVisitor.State, R> R expand(@Nonnull final KeyExpr

@Nonnull
@Override
public RecordMetaDataProto.KeyExpression toKeyExpression() {
public RecordKeyExpressionProto.KeyExpression toKeyExpression() {
return EMPTY_PROTO;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import com.apple.foundationdb.record.ObjectPlanHash;
import com.apple.foundationdb.record.PlanHashable;
import com.apple.foundationdb.record.RecordCoreException;
import com.apple.foundationdb.record.RecordMetaDataProto;
import com.apple.foundationdb.record.expressions.RecordKeyExpressionProto;
import com.apple.foundationdb.record.logging.LogMessageKeys;
import com.apple.foundationdb.record.metadata.Key;
import com.apple.foundationdb.record.provider.foundationdb.FDBRecord;
Expand Down Expand Up @@ -71,7 +71,7 @@ public FieldKeyExpression(@Nonnull String fieldName, @Nonnull FanType fanType, @
this.nullStandin = nullStandin;
}

public FieldKeyExpression(@Nonnull RecordMetaDataProto.Field field) throws DeserializationException {
public FieldKeyExpression(@Nonnull RecordKeyExpressionProto.Field field) throws DeserializationException {
if (!field.hasFieldName()) {
throw new DeserializationException("Serialized Field is missing field name");
}
Expand Down Expand Up @@ -193,8 +193,8 @@ public int getColumnSize() {

@Nonnull
@Override
public RecordMetaDataProto.Field toProto() throws SerializationException {
return RecordMetaDataProto.Field.newBuilder()
public RecordKeyExpressionProto.Field toProto() throws SerializationException {
return RecordKeyExpressionProto.Field.newBuilder()
.setFieldName(fieldName)
.setFanType(fanType.toProto())
.setNullInterpretation(nullStandin.toProto())
Expand All @@ -203,8 +203,8 @@ public RecordMetaDataProto.Field toProto() throws SerializationException {

@Nonnull
@Override
public RecordMetaDataProto.KeyExpression toKeyExpression() {
return RecordMetaDataProto.KeyExpression.newBuilder().setField(toProto()).build();
public RecordKeyExpressionProto.KeyExpression toKeyExpression() {
return RecordKeyExpressionProto.KeyExpression.newBuilder().setField(toProto()).build();
}

@Nonnull
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import com.apple.foundationdb.record.PlanHashable;
import com.apple.foundationdb.record.RecordCoreArgumentException;
import com.apple.foundationdb.record.RecordCoreException;
import com.apple.foundationdb.record.RecordMetaDataProto;
import com.apple.foundationdb.record.expressions.RecordKeyExpressionProto;
import com.apple.foundationdb.record.logging.LogMessageKeys;
import com.apple.foundationdb.record.metadata.Key;
import com.apple.foundationdb.record.provider.foundationdb.FDBRecord;
Expand Down Expand Up @@ -232,7 +232,7 @@ public boolean equalsAtomic(AtomKeyExpression other) {
* implementation, or the arguments provided are not suitable for the function.
*/
@Nonnull
public static FunctionKeyExpression fromProto(RecordMetaDataProto.Function function) throws DeserializationException {
public static FunctionKeyExpression fromProto(RecordKeyExpressionProto.Function function) throws DeserializationException {
try {
return create(function.getName(), KeyExpression.fromProto(function.getArguments()));
} catch (RecordCoreException e) {
Expand All @@ -242,17 +242,17 @@ public static FunctionKeyExpression fromProto(RecordMetaDataProto.Function funct

@Nonnull
@Override
public final RecordMetaDataProto.Function toProto() throws SerializationException {
RecordMetaDataProto.Function.Builder builder = RecordMetaDataProto.Function.newBuilder()
public final RecordKeyExpressionProto.Function toProto() throws SerializationException {
RecordKeyExpressionProto.Function.Builder builder = RecordKeyExpressionProto.Function.newBuilder()
.setName(getName());
builder.setArguments(getArguments().toKeyExpression());
return builder.build();
}

@Nonnull
@Override
public final RecordMetaDataProto.KeyExpression toKeyExpression() {
return RecordMetaDataProto.KeyExpression.newBuilder().setFunction(toProto()).build();
public final RecordKeyExpressionProto.KeyExpression toKeyExpression() {
return RecordKeyExpressionProto.KeyExpression.newBuilder().setFunction(toProto()).build();
}

@Nonnull
Expand Down
Loading
Loading