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

Make random UUID a compliant type name in CorrelationIdentifier.uniqueID #1938

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -22,6 +22,7 @@

import com.apple.foundationdb.annotation.API;
import com.apple.foundationdb.record.query.plan.cascades.debug.Debugger;
import com.apple.foundationdb.record.query.plan.cascades.typing.Type;
import com.google.common.collect.ImmutableSet;

import javax.annotation.Nonnull;
Expand Down Expand Up @@ -89,7 +90,7 @@ public static CorrelationIdentifier uniqueID(@Nonnull final Class<?> clazz, @Non
final CorrelationIdentifier id =
Debugger.getIndexOptional(clazz)
.map(i -> CorrelationIdentifier.of(prefix + i))
.orElseGet(() -> new CorrelationIdentifier(UUID.randomUUID().toString()));
.orElseGet(() -> new CorrelationIdentifier(Type.uniqueCompliantTypeName()));
Copy link
Contributor

Choose a reason for hiding this comment

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

Doesn't this just want half of that method? This id needs to be protobuf-friendly but isn't a __type__, is it?

Debugger.updateIndex(clazz, i -> i + 1);
return id;
}
Expand Down