Skip to content

Commit

Permalink
spotlessapply
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Alfonsi <[email protected]>
  • Loading branch information
Peter Alfonsi committed Mar 29, 2024
1 parent b5bded2 commit bf30131
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,9 @@

import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.Set;
import java.util.UUID;

public class MultiDimensionCacheStatsTests extends OpenSearchTestCase {
Expand Down Expand Up @@ -149,7 +147,11 @@ private Map<List<String>, MultiDimensionCacheStats.DimensionNode> getAllLeafNode
return result;
}

private void getAllLeafNodesHelper(Map<List<String>, MultiDimensionCacheStats.DimensionNode> result, MultiDimensionCacheStats.DimensionNode current, List<String> pathToCurrent) {
private void getAllLeafNodesHelper(
Map<List<String>, MultiDimensionCacheStats.DimensionNode> result,
MultiDimensionCacheStats.DimensionNode current,
List<String> pathToCurrent
) {
if (current.children.isEmpty()) {
result.put(pathToCurrent, current);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.Set;

import static org.opensearch.common.cache.stats.MultiDimensionCacheStatsTests.getUsedDimensionValues;
import static org.opensearch.common.cache.stats.MultiDimensionCacheStatsTests.populateStats;
Expand Down Expand Up @@ -77,16 +76,12 @@ public void testKeyContainsAllDimensions() throws Exception {

List<CacheStatsDimension> dims = List.of(new CacheStatsDimension("dim1", "A"), new CacheStatsDimension("dim2", "B"));

StatsHolder.Key matchingKey = new StatsHolder.Key(List.of(
new CacheStatsDimension("dim1", "A"),
new CacheStatsDimension("dim2", "B"),
new CacheStatsDimension("dim3", "C")
));
StatsHolder.Key nonMatchingKey = new StatsHolder.Key(List.of(
new CacheStatsDimension("dim1", "A"),
new CacheStatsDimension("dim2", "Z"),
new CacheStatsDimension("dim3", "C")
));
StatsHolder.Key matchingKey = new StatsHolder.Key(
List.of(new CacheStatsDimension("dim1", "A"), new CacheStatsDimension("dim2", "B"), new CacheStatsDimension("dim3", "C"))
);
StatsHolder.Key nonMatchingKey = new StatsHolder.Key(
List.of(new CacheStatsDimension("dim1", "A"), new CacheStatsDimension("dim2", "Z"), new CacheStatsDimension("dim3", "C"))
);

assertTrue(statsHolder.keyContainsAllDimensions(matchingKey, dims));
assertFalse(statsHolder.keyContainsAllDimensions(nonMatchingKey, dims));
Expand Down

0 comments on commit bf30131

Please sign in to comment.