-
Notifications
You must be signed in to change notification settings - Fork 112
Indexing: remove subspaceProvider and subspace arguments to iterating functions #3611
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
Indexing: remove subspaceProvider and subspace arguments to iterating functions #3611
Conversation
… functions These two parameters, that are used for logging only, can be determined from common at the relevant logging functions. This resolves FoundationDB#3610.
…ch now contains subspace)
if (subspaceProvider != null) { | ||
logIf(true, keyValues, | ||
subspaceProvider.logKey(), subspaceProvider); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why use logIf
here? It seems like you would either want to do:
if (subspaceProvider != null) { | |
logIf(true, keyValues, | |
subspaceProvider.logKey(), subspaceProvider); | |
} | |
logIf(subspaceProvider != null, keyValues, | |
subspaceProvider.logKey(), subspaceProvider); |
Or:
if (subspaceProvider != null) { | |
logIf(true, keyValues, | |
subspaceProvider.logKey(), subspaceProvider); | |
} | |
if (subspaceProvider != null) { | |
keyValues.add(subspaceProvider.logKey()); | |
keyValues.add(subspaceProvider); | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logIf was just for uniformity. The first suggestion may cause a null pointer exception as the subspaceProvider.logKey()
part will be evaluated before calling the logIf
function. I'll go with the second.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
√
.thenCompose( store -> context.getReadVersionAsync() | ||
.thenCompose(vignore -> { | ||
SubspaceProvider subspaceProvider = common.getRecordStoreBuilder().getSubspaceProvider(); | ||
// validation checks, if any, will be performed here |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this comment intended to be that:
buildMultiTargetIndex will do any necessary validation checks
Or, the more problematic for this change:
getSubspaceAsync will do any necessary validation checks
? I'm pretty sure the answer is that buildMultiTargetIndex
is doing the validation checks, but wanted to confirm.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment appeared in the indexers as a hint/reminder where to add validations. I think that appears because IndexingByIndex
had a source/target indexes validations at the post context.getReadVersionAsync
lambda, and then its structure was copied by the other indexers. I did not think that this comment is needed anymore.
These two parameters, that are used for logging only, can be determined from common at the relevant logging functions.
This resolves #3610.