Skip to content

Rename variable to keep naming convention #5209

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

Merged
merged 3 commits into from
Jul 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 @@ -353,9 +353,9 @@ public Task<Void> configureFieldIndexes(List<FieldIndex> fieldIndices) {
return asyncQueue.enqueue(() -> localStore.configureFieldIndexes(fieldIndices));
}

public void setIndexAutoCreationEnabled(boolean enabled) {
public void setIndexAutoCreationEnabled(boolean isEnabled) {
verifyNotTerminated();
asyncQueue.enqueueAndForget(() -> localStore.setIndexAutoCreationEnabled(enabled));
asyncQueue.enqueueAndForget(() -> localStore.setIndexAutoCreationEnabled(isEnabled));
}

public void deleteAllFieldIndexes() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -806,8 +806,8 @@ public void deleteAllFieldIndexes() {
persistence.runTransaction("Delete All Indexes", () -> indexManager.deleteAllFieldIndexes());
}

public void setIndexAutoCreationEnabled(boolean enabled) {
queryEngine.setIndexAutoCreationEnabled(enabled);
public void setIndexAutoCreationEnabled(boolean isEnabled) {
queryEngine.setIndexAutoCreationEnabled(isEnabled);
}

/** Mutable state for the transaction in allocateQuery. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ public void initialize(LocalDocumentsView localDocumentsView, IndexManager index
this.initialized = true;
}

public void setIndexAutoCreationEnabled(boolean enabled) {
this.indexAutoCreationEnabled = enabled;
public void setIndexAutoCreationEnabled(boolean isEnabled) {
this.indexAutoCreationEnabled = isEnabled;
}

public ImmutableSortedMap<DocumentKey, Document> getDocumentsMatchingQuery(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ public boolean servedByIndex(FieldIndex index) {
/** Returns a full matched field index for this target. */
public FieldIndex buildTargetIndex() {
// We want to make sure only one segment created for one field. For example, in case like
// a == 3 and a > 2, index, a ASCENDING, will only be created once.
// a == 3 and a > 2, Index: {a ASCENDING} will only be created once.
Set<FieldPath> uniqueFields = new HashSet<>();
List<FieldIndex.Segment> segments = new ArrayList<>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ public ImmutableSortedMap<DocumentKey, Document> getDocumentsMatchingQuery(
}

@Override
public void setIndexAutoCreationEnabled(boolean enabled) {
queryEngine.setIndexAutoCreationEnabled(enabled);
public void setIndexAutoCreationEnabled(boolean isEnabled) {
queryEngine.setIndexAutoCreationEnabled(isEnabled);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,13 +217,13 @@ protected void executeQuery(Query query) {
lastQueryResult = localStore.executeQuery(query, /* usePreviousResults= */ true);
}

protected void setIndexAutoCreationEnabled(boolean enabled) {
protected void setIndexAutoCreationEnabled(boolean isEnabled) {
// Noted: there are two queryEngines here, the first one is extended by CountingQueryEngine,
// which is set by localStore function; The second one a pointer inside CountingQueryEngine,
// which is set by queryEngine function.
// Only the second function takes effect in the tests. Adding first one here for compatibility.
localStore.setIndexAutoCreationEnabled(enabled);
queryEngine.setIndexAutoCreationEnabled(enabled);
localStore.setIndexAutoCreationEnabled(isEnabled);
queryEngine.setIndexAutoCreationEnabled(isEnabled);
}

protected void setMinCollectionSizeToAutoCreateIndex(int newMin) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public class TargetIndexMatcherTest {
query("collId")
.filter(filter("a", "array-contains-any", Collections.singletonList("a"))));

List<Query> queriesWithOrderBy =
List<Query> queriesWithOrderBys =
Arrays.asList(
query("collId").orderBy(orderBy("a")),
query("collId").orderBy(orderBy("a", "desc")),
Expand Down Expand Up @@ -665,7 +665,7 @@ public void testBuildTargetIndexWithQueriesWithArrayContains() {

@Test
public void testBuildTargetIndexWithQueriesWithOrderBy() {
for (Query query : queriesWithOrderBy) {
for (Query query : queriesWithOrderBys) {
validateBuildTargetIndexCreateFullMatchIndex(query);
}
}
Expand Down