diff --git a/hollow-explorer-ui/src/main/java/com/netflix/hollow/explorer/ui/model/TypeOverview.java b/hollow-explorer-ui/src/main/java/com/netflix/hollow/explorer/ui/model/TypeOverview.java index 5be267eb77..d47a32c698 100644 --- a/hollow-explorer-ui/src/main/java/com/netflix/hollow/explorer/ui/model/TypeOverview.java +++ b/hollow-explorer-ui/src/main/java/com/netflix/hollow/explorer/ui/model/TypeOverview.java @@ -30,8 +30,10 @@ public class TypeOverview { private final long approxHeapFootprint; private final PrimaryKey primaryKey; private final HollowSchema schema; + private final int numShards; - public TypeOverview(String typeName, int numRecords, int numHoles, long approxHoleFootprint, long approxHeapFootprint, PrimaryKey primaryKey, HollowSchema schema) { + public TypeOverview(String typeName, int numRecords, int numHoles, long approxHoleFootprint, long approxHeapFootprint, + PrimaryKey primaryKey, HollowSchema schema, int numShards) { this.typeName = typeName; this.numRecords = numRecords; this.numHoles = numHoles; @@ -39,6 +41,7 @@ public TypeOverview(String typeName, int numRecords, int numHoles, long approxHo this.approxHeapFootprint = approxHeapFootprint; this.primaryKey = primaryKey; this.schema = schema; + this.numShards = numShards; } public String getTypeName() { @@ -68,4 +71,11 @@ public String getPrimaryKey() { public String getSchema() { return schema.toString(); } + + public int getNumShardsInt() { + return numShards; + } + public String getNumShards() { + return NumberFormat.getIntegerInstance().format(numShards); + } } diff --git a/hollow-explorer-ui/src/main/java/com/netflix/hollow/explorer/ui/pages/ShowAllTypesPage.java b/hollow-explorer-ui/src/main/java/com/netflix/hollow/explorer/ui/pages/ShowAllTypesPage.java index ee6bc832e2..56edebd290 100644 --- a/hollow-explorer-ui/src/main/java/com/netflix/hollow/explorer/ui/pages/ShowAllTypesPage.java +++ b/hollow-explorer-ui/src/main/java/com/netflix/hollow/explorer/ui/pages/ShowAllTypesPage.java @@ -57,8 +57,9 @@ protected void setUpContext(HttpServletRequest req, HollowUISession session, Vel PrimaryKey primaryKey = typeState.getSchema().getSchemaType() == SchemaType.OBJECT ? ((HollowObjectSchema)typeState.getSchema()).getPrimaryKey() : null; long approxHeapFootprint = typeState.getApproximateHeapFootprintInBytes(); HollowSchema schema = typeState.getSchema(); + int numShards = typeState.numShards(); - typeOverviews.add(new TypeOverview(typeName, numRecords, numHoles, approxHoleFootprint, approxHeapFootprint, primaryKey, schema)); + typeOverviews.add(new TypeOverview(typeName, numRecords, numHoles, approxHoleFootprint, approxHeapFootprint, primaryKey, schema, numShards)); } switch(sort) { @@ -76,10 +77,10 @@ public int compare(TypeOverview o1, TypeOverview o2) { } }); break; - case "numHoles": + case "numHoles": typeOverviews.sort((o1, o2) -> Integer.compare(o2.getNumHolesInt(), o1.getNumHolesInt())); break; - case "holeSize": + case "holeSize": typeOverviews.sort((o1, o2) -> Long.compare(o2.getApproxHoleFootprintLong(), o1.getApproxHoleFootprintLong())); break; case "heapSize": @@ -89,6 +90,9 @@ public int compare(TypeOverview o1, TypeOverview o2) { } }); break; + case "numShards": + typeOverviews.sort((o1, o2) -> Integer.compare(o2.getNumShardsInt(), o1.getNumShardsInt())); + break; default: Collections.sort(typeOverviews, new Comparator() { public int compare(TypeOverview o1, TypeOverview o2) { diff --git a/hollow-explorer-ui/src/main/resources/show-all-types.vm b/hollow-explorer-ui/src/main/resources/show-all-types.vm index 3ad2b16ba5..a4137a2ba2 100644 --- a/hollow-explorer-ui/src/main/resources/show-all-types.vm +++ b/hollow-explorer-ui/src/main/resources/show-all-types.vm @@ -25,6 +25,7 @@ Heap Footprint Primary Key Schema + Shards #foreach($typeOverview in $typeOverviews) @@ -36,6 +37,7 @@ $typeOverview.getApproxHeapFootprint()
$esc.html($typeOverview.getPrimaryKey())
$esc.html($typeOverview.getSchema())
+ $typeOverview.getNumShards() #end