-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Open
Description
Hey, been reading through some code to start using Versionstamps in my code, and I noticed some interesting behavior with the two pack methods.
Subspace#pack throws when there is an incomplete versionstamp in the tuple
and
Subspace#packWithVersionstamp throws when there is no incomplete versionstamp in the Tuple
I ended up doing something like the following, and I saw other people have done the same. Was wondering why the api exists like this rather than having a single pack method that delegates to either of these options. Is there a different pattern I should be using here? Is there a case where you would want to call the pack/packWithVersionstamp method and have the exception get thrown?
if (tuple.hasIncompleteVersionstamp()) {
return subspace.packWithVersionstamp(tuple);
} else {
return subspace.pack(tuple);
}
Metadata
Metadata
Assignees
Labels
No labels