Skip to content

Commit

Permalink
Fix enum name in CountingAccessMetadata
Browse files Browse the repository at this point in the history
The class name is "entity name", should generally be singular.
  • Loading branch information
findepi committed May 5, 2023
1 parent ee66294 commit 0d409dd
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,20 +76,20 @@
public class CountingAccessMetadata
implements Metadata
{
public enum Methods
public enum Method
{
GET_TABLE_STATISTICS,
}

private final Metadata delegate;
private final ConcurrentHashMultiset<Methods> methodInvocations = ConcurrentHashMultiset.create();
private final ConcurrentHashMultiset<Method> methodInvocations = ConcurrentHashMultiset.create();

public CountingAccessMetadata(Metadata delegate)
{
this.delegate = delegate;
}

public Multiset<Methods> getMethodInvocations()
public Multiset<Method> getMethodInvocations()
{
return ImmutableMultiset.copyOf(methodInvocations);
}
Expand Down Expand Up @@ -210,7 +210,7 @@ public TableMetadata getTableMetadata(Session session, TableHandle tableHandle)
@Override
public TableStatistics getTableStatistics(Session session, TableHandle tableHandle)
{
methodInvocations.add(Methods.GET_TABLE_STATISTICS);
methodInvocations.add(Method.GET_TABLE_STATISTICS);
return delegate.getTableStatistics(session, tableHandle);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ public void testTwoWayJoin()
"FROM iceberg.tiny.orders o, iceberg.tiny.lineitem l " +
"WHERE o.orderkey = l.orderkey");
assertThat(metadata.getMethodInvocations()).containsExactlyInAnyOrderElementsOf(
ImmutableMultiset.<CountingAccessMetadata.Methods>builder()
.addCopies(CountingAccessMetadata.Methods.GET_TABLE_STATISTICS, 2)
ImmutableMultiset.<CountingAccessMetadata.Method>builder()
.addCopies(CountingAccessMetadata.Method.GET_TABLE_STATISTICS, 2)
.build());
}

Expand All @@ -128,8 +128,8 @@ public void testThreeWayJoin()
"FROM iceberg.tiny.customer c, iceberg.tiny.orders o, iceberg.tiny.lineitem l " +
"WHERE o.orderkey = l.orderkey AND c.custkey = o.custkey");
assertThat(metadata.getMethodInvocations()).containsExactlyInAnyOrderElementsOf(
ImmutableMultiset.<CountingAccessMetadata.Methods>builder()
.addCopies(CountingAccessMetadata.Methods.GET_TABLE_STATISTICS, 3)
ImmutableMultiset.<CountingAccessMetadata.Method>builder()
.addCopies(CountingAccessMetadata.Method.GET_TABLE_STATISTICS, 3)
.build());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ public void testTwoWayJoin()
"FROM tpch.tiny.orders o, tpch.tiny.lineitem l " +
"WHERE o.orderkey = l.orderkey");
assertThat(metadata.getMethodInvocations()).containsExactlyInAnyOrderElementsOf(
ImmutableMultiset.<CountingAccessMetadata.Methods>builder()
.addCopies(CountingAccessMetadata.Methods.GET_TABLE_STATISTICS, 2)
ImmutableMultiset.<CountingAccessMetadata.Method>builder()
.addCopies(CountingAccessMetadata.Method.GET_TABLE_STATISTICS, 2)
.build());
}

Expand All @@ -87,8 +87,8 @@ public void testThreeWayJoin()
"FROM tpch.tiny.customer c, tpch.tiny.orders o, tpch.tiny.lineitem l " +
"WHERE o.orderkey = l.orderkey AND c.custkey = o.custkey");
assertThat(metadata.getMethodInvocations()).containsExactlyInAnyOrderElementsOf(
ImmutableMultiset.<CountingAccessMetadata.Methods>builder()
.addCopies(CountingAccessMetadata.Methods.GET_TABLE_STATISTICS, 3)
ImmutableMultiset.<CountingAccessMetadata.Method>builder()
.addCopies(CountingAccessMetadata.Method.GET_TABLE_STATISTICS, 3)
.build());
}

Expand Down

0 comments on commit 0d409dd

Please sign in to comment.