Repository navigation
Conversation
b8feff1 to
fa397d3
Compare
fdb-build
left a comment
There was a problem hiding this comment.
SonarQube analysis found issues:



Including the following issue(s) which could not be reported in line:
Code Smell: Refactor this method to reduce its Cognitive Complexity from 33 to the 30 allowed. (more)
fa397d3 to
b339545
Compare
fdb-build
left a comment
There was a problem hiding this comment.
SonarQube analysis found issues:



Including the following issue(s) which could not be reported in line:
Code Smell: Refactor this method to reduce its Cognitive Complexity from 33 to the 30 allowed. (more)
| // TODO: need some state to avoid generating the same synthetic record via more than one self-join path for non-idempotent indexes. | ||
| final SyntheticRecordPlanner syntheticPlanner = new SyntheticRecordPlanner(store.getRecordMetaData(), store.getRecordStoreState().withWriteOnlyIndexes(Collections.singletonList(index.getName()))); | ||
| syntheticPlan = syntheticPlanner.forIndex(index); | ||
| syntheticMaintainer = (IndexMaintainer<Message>)maintainer; |
There was a problem hiding this comment.
I created #165 for the bigger issue (I think) here.
b339545 to
b44a8f6
Compare
fdb-build
left a comment
There was a problem hiding this comment.
SonarQube analysis found issues:



Including the following issue(s) which could not be reported in line:
| import java.util.List; | ||
| import java.util.Map; | ||
|
|
||
| // TODO: This could be just FDBRecord<Message> if we were willing to change the signature of the IndexMaintainer methods. |
There was a problem hiding this comment.
Maybe FDBIndexableRecord in the middle.
| if (syntheticIndex) { | ||
| // Need to do this each transaction because other index enabled state might have changed. Could cache based on that. | ||
| // Copying the state also guards against changes made by other online building from check version. | ||
| // TODO: need some state to avoid generating the same synthetic record via more than one self-join path for non-idempotent indexes. |
There was a problem hiding this comment.
Maybe some overall approach to duplicate detection / elimination here and in regular queries.
b44a8f6 to
2cfc18f
Compare
fdb-build
left a comment
There was a problem hiding this comment.
SonarQube analysis found issues:



Including the following issue(s) which could not be reported in line:
2cfc18f to
10fa7b1
Compare
fdb-build
left a comment
There was a problem hiding this comment.
SonarQube analysis found issues:



Including the following issue(s) which could not be reported in line:
10fa7b1 to
4453ad8
Compare
fdb-build
left a comment
There was a problem hiding this comment.
SonarQube analysis found issues:



Including the following issue(s) which could not be reported in line:
4453ad8 to
3295dcf
Compare
fdb-build
left a comment
There was a problem hiding this comment.
SonarQube analysis found issues:



Including the following issue(s) which could not be reported in line:
Code Smell: Remove this expression which always evaluates to "true" (more)
Code Smell: Remove this expression which always evaluates to "true" (more)
Code Smell: Define a constant instead of duplicating this literal "Index " 3 times. (more)
Code Smell: Complete the task associated to this TODO comment. (more)
Code Smell: Refactor this method to reduce its Cognitive Complexity from 33 to the 30 allowed. (more)
Code Smell: Rename "recordType" which hides the field declared at line 1888. (more)
Bug: A "NullPointerException" could be thrown; "evaluated" is nullable here. (more)
Code Smell: Complete the task associated to this TODO comment. (more)
Code Smell: 2 duplicated blocks of code must be removed. (more)
Code Smell: Rename "evaluated" which hides the field declared at line 1898. (more)
Code Smell: Remove usage of generic wildcard type. (more)
Code Smell: Remove this use of "getIndexed"; it is deprecated. (more)
Code Smell: Complete the task associated to this TODO comment. (more)
Code Smell: Remove this use of "getIndexed"; it is deprecated. (more)
Vulnerability: Make this member "protected". (more)
Code Smell: Complete the task associated to this TODO comment. (more)
Code Smell: Remove this use of "getRecordCountKey"; it is deprecated. (more)
Vulnerability: Make this member "protected". (more)
Code Smell: Do not forget to remove this deprecated code someday. (more)
Code Smell: Reduce the total number of break and continue statements in this loop to use at most one. (more)
Code Smell: Do not forget to remove this deprecated code someday. (more)
Code Smell: Remove the declaration of thrown exception 'com.apple.foundationdb.record.metadata.expressions.KeyExpression$SerializationException' which is a runtime exception. (more)
Code Smell: 2 duplicated blocks of code must be removed. (more)
Code Smell: Remove this use of "hasIndexed"; it is deprecated. (more)
Code Smell: 2 duplicated blocks of code must be removed. (more)
Code Smell: Remove this use of "hasRecordCountKey"; it is deprecated. (more)
3295dcf to
641937b
Compare
fdb-build
left a comment
There was a problem hiding this comment.
SonarQube analysis found issues:



Including the following issue(s) which could not be reported in line:
Code Smell: Do not forget to remove this deprecated code someday. (more)
Code Smell: Do not forget to remove this deprecated code someday. (more)
Code Smell: Remove this use of "hasRecordCountKey"; it is deprecated. (more)
Code Smell: Remove this expression which always evaluates to "true" (more)
Code Smell: Complete the task associated to this TODO comment. (more)
Code Smell: Do not forget to remove this deprecated code someday. (more)
Code Smell: Complete the task associated to this TODO comment. (more)
Code Smell: Remove this use of "hasIndexed"; it is deprecated. (more)
Code Smell: Define a constant instead of duplicating this literal "No records added yet" 5 times. (more)
Vulnerability: Make this member "protected". (more)
Code Smell: Remove the declaration of thrown exception 'com.apple.foundationdb.record.metadata.expressions.KeyExpression$SerializationException' which is a runtime exception. (more)
Code Smell: 2 duplicated blocks of code must be removed. (more)
Code Smell: Remove usage of generic wildcard type. (more)
Code Smell: Reduce the total number of break and continue statements in this loop to use at most one. (more)
Vulnerability: Make this member "protected". (more)
Code Smell: Do not forget to remove this deprecated code someday. (more)
Code Smell: Do not forget to remove this deprecated code someday. (more)
Code Smell: Do not forget to remove this deprecated code someday. (more)
Code Smell: Remove this use of "getRecordCountKey"; it is deprecated. (more)
Code Smell: Rename "recordType" which hides the field declared at line 1888. (more)
Code Smell: Remove this use of "getIndexed"; it is deprecated. (more)
Code Smell: Complete the task associated to this TODO comment. (more)
Code Smell: Do not forget to remove this deprecated code someday. (more)
Code Smell: Refactor this method to reduce its Cognitive Complexity from 33 to the 30 allowed. (more)
Code Smell: 2 duplicated blocks of code must be removed. (more)
Bug: A "NullPointerException" could be thrown; "evaluated" is nullable here. (more)
Code Smell: Define a constant instead of duplicating this literal "Index " 3 times. (more)
Code Smell: Rename "evaluated" which hides the field declared at line 1898. (more)
Code Smell: Remove this use of "getIndexed"; it is deprecated. (more)
Code Smell: Refactor this method to reduce its Cognitive Complexity from 31 to the 30 allowed. (more)
Code Smell: Do not forget to remove this deprecated code someday. (more)
Code Smell: Remove this expression which always evaluates to "true" (more)
Code Smell: Complete the task associated to this TODO comment. (more)
Code Smell: 2 duplicated blocks of code must be removed. (more)
6ae033a to
67a6cca
Compare
…are made from stored records. In particular, joined record types, which synthesize by means of equi-joins.
67a6cca to
b77b154
Compare
fdb-build
left a comment
There was a problem hiding this comment.
SonarQube analysis found issues:



Including the following issue(s) which could not be reported in line:
Code Smell: Complete the task associated to this TODO comment. (more)
Code Smell: Complete the task associated to this TODO comment. (more)
Code Smell: Do not forget to remove this deprecated code someday. (more)
Code Smell: Remove this use of "hasIndexed"; it is deprecated. (more)
Code Smell: Do not forget to remove this deprecated code someday. (more)
Code Smell: Do not forget to remove this deprecated code someday. (more)
Code Smell: 2 duplicated blocks of code must be removed. (more)
Code Smell: Refactor this method to reduce its Cognitive Complexity from 31 to the 30 allowed. (more)
Code Smell: Remove the declaration of thrown exception 'com.apple.foundationdb.record.metadata.expressions.KeyExpression$SerializationException' which is a runtime exception. (more)
Code Smell: Do not forget to remove this deprecated code someday. (more)
Code Smell: Remove this use of "getIndexed"; it is deprecated. (more)
Code Smell: Define a constant instead of duplicating this literal "Union field " 3 times. (more)
Code Smell: Reduce the total number of break and continue statements in this loop to use at most one. (more)
Code Smell: Define a constant instead of duplicating this literal "Index " 3 times. (more)
Code Smell: Remove this use of "getIndexed"; it is deprecated. (more)
Code Smell: Refactor this method to reduce its Cognitive Complexity from 33 to the 30 allowed. (more)
Code Smell: Define a constant instead of duplicating this literal "No records added yet" 5 times. (more)
Code Smell: Do not forget to remove this deprecated code someday. (more)
Code Smell: Do not forget to remove this deprecated code someday. (more)
Code Smell: 2 duplicated blocks of code must be removed. (more)
Code Smell: Remove this expression which always evaluates to "true" (more)
Code Smell: Complete the task associated to this TODO comment. (more)
Code Smell: Rename "evaluated" which hides the field declared at line 1219. (more)
Code Smell: Remove this use of "hasRecordCountKey"; it is deprecated. (more)
Code Smell: Complete the task associated to this TODO comment. (more)
Code Smell: 2 duplicated blocks of code must be removed. (more)
Code Smell: 2 duplicated blocks of code must be removed. (more)
Code Smell: Do not forget to remove this deprecated code someday. (more)
Bug: A "NullPointerException" could be thrown; "evaluated" is nullable here. (more)
Code Smell: Do not forget to remove this deprecated code someday. (more)
Code Smell: Remove this use of "getRecordCountKey"; it is deprecated. (more)
Code Smell: Rename "recordType" which hides the field declared at line 1209. (more)
Code Smell: Do not forget to remove this deprecated code someday. (more)
Code Smell: Remove this expression which always evaluates to "true" (more)
… synthetic records from stored records using query plans.
Resolves #159: Join indexes.
b77b154 to
6075586
Compare
fdb-build
left a comment
There was a problem hiding this comment.
SonarQube analysis found issues:



Including the following issue(s) which could not be reported in line:
Code Smell: 2 duplicated blocks of code must be removed. (more)
Code Smell: Do not forget to remove this deprecated code someday. (more)
Code Smell: Do not forget to remove this deprecated code someday. (more)
Code Smell: Do not forget to remove this deprecated code someday. (more)
Code Smell: Remove this expression which always evaluates to "true" (more)
Code Smell: Refactor this method to reduce its Cognitive Complexity from 33 to the 30 allowed. (more)
Code Smell: Remove the declaration of thrown exception 'com.apple.foundationdb.record.metadata.expressions.KeyExpression$SerializationException' which is a runtime exception. (more)
Code Smell: Remove this use of "getIndexed"; it is deprecated. (more)
Code Smell: Complete the task associated to this TODO comment. (more)
Code Smell: Remove this expression which always evaluates to "true" (more)
Code Smell: Do not forget to remove this deprecated code someday. (more)
Code Smell: Do not forget to remove this deprecated code someday. (more)
Code Smell: Do not forget to remove this deprecated code someday. (more)
Code Smell: Do not forget to remove this deprecated code someday. (more)
Code Smell: Complete the task associated to this TODO comment. (more)
Code Smell: Complete the task associated to this TODO comment. (more)
Code Smell: Reduce the total number of break and continue statements in this loop to use at most one. (more)
Code Smell: 2 duplicated blocks of code must be removed. (more)
Code Smell: Define a constant instead of duplicating this literal "No records added yet" 5 times. (more)
Code Smell: Remove this use of "getRecordCountKey"; it is deprecated. (more)
Code Smell: Remove this use of "getIndexed"; it is deprecated. (more)
Code Smell: Do not forget to remove this deprecated code someday. (more)
Code Smell: Complete the task associated to this TODO comment. (more)
Code Smell: Rename "evaluated" which hides the field declared at line 1219. (more)
Code Smell: 2 duplicated blocks of code must be removed. (more)
Bug: A "NullPointerException" could be thrown; "evaluated" is nullable here. (more)
Code Smell: Rename "recordType" which hides the field declared at line 1209. (more)
Code Smell: Define a constant instead of duplicating this literal "Union field " 3 times. (more)
Code Smell: Refactor this method to reduce its Cognitive Complexity from 31 to the 30 allowed. (more)
Code Smell: Define a constant instead of duplicating this literal "Index " 3 times. (more)
Code Smell: 2 duplicated blocks of code must be removed. (more)
Code Smell: Do not forget to remove this deprecated code someday. (more)
Code Smell: Remove this use of "hasRecordCountKey"; it is deprecated. (more)
Code Smell: Remove this use of "hasIndexed"; it is deprecated. (more)
| if (!conditions.isEmpty()) { | ||
| builder.setFilter(conditions.size() > 1 ? Query.and(conditions) : conditions.get(0)); | ||
| } | ||
| // TODO: Would it be better to do this more centrally? |
There was a problem hiding this comment.

| for (Constituent constituent : constituents) { | ||
| keys.add(constituent.getRecordType().getPrimaryKey()); | ||
| } | ||
| // TODO: Would a non-flattened version of concat be easier to deal with? |
There was a problem hiding this comment.

| public void addMultiTypeIndex(@Nullable List<RecordTypeBuilder> recordTypes, @Nonnull Index index) { | ||
| public void addMultiTypeIndex(@Nullable List<? extends RecordTypeIndexesBuilder> recordTypes, @Nonnull Index index) { | ||
| addIndexCommon(index); | ||
| if (recordTypes == null || recordTypes.size() == 0) { |
There was a problem hiding this comment.

| final SyntheticRecordFromStoredRecordPlan fromRecord = forType(syntheticRecordType); | ||
| // Query to get all records of the needed type(s). | ||
| RecordQueryPlan query = queryPlanner.plan(RecordQuery.newBuilder().setRecordTypes(fromRecord.getStoredRecordTypes()).build()); | ||
| return new SyntheticRecordScanPlan(query, fromRecord, true); // TODO: better needDistinct calculation |
There was a problem hiding this comment.

| @@ -395,6 +457,12 @@ public RecordMetaDataProto.MetaData toProto(@Nullable Descriptors.FileDescriptor | |||
| builder.setRecordCountKey(recordCountKey.toKeyExpression()); | |||
There was a problem hiding this comment.

| if (syntheticIndex) { | ||
| // Need to do this each transaction because other index enabled state might have changed. Could cache based on that. | ||
| // Copying the state also guards against changes made by other online building from check version. | ||
| // TODO: need some state to avoid generating the same synthetic record via more than one self-join path for non-idempotent indexes. |
There was a problem hiding this comment.

|
Reopening after repo switchover. |
No description provided.