Skip to content

Commit

Permalink
Rename variable to keep naming convention (#5209)
Browse files Browse the repository at this point in the history
* Rename valuable to keep naming convention

* improve comment's readability

* change naming
  • Loading branch information
cherylEnkidu committed Jul 28, 2023
1 parent c5cd536 commit 824195e
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 14 deletions.
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

0 comments on commit 824195e

Please sign in to comment.