[
https://issues.apache.org/jira/browse/TEPHRA-245?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16174458#comment-16174458
]
ASF GitHub Bot commented on TEPHRA-245:
---------------------------------------
Github user poornachandra commented on a diff in the pull request:
https://github.com/apache/incubator-tephra/pull/62#discussion_r140183652
--- Diff:
tephra-hbase-compat-1.1-base/src/test/java/org/apache/tephra/hbase/txprune/InvalidListPruningDebugTest.java
---
@@ -280,29 +282,36 @@ public void testIdleRegions() throws Exception {
try (PrintWriter out = new PrintWriter(outputStream)) {
// Get the list of regions that have the lowest prune upper bounds
for the latest record time
Long latestRecordTime = compactedRegions.asMap().lastKey();
- SortedSet<InvalidListPruningDebugTool.RegionPruneInfoPretty>
latestExpected =
- ImmutableSortedSet.copyOf(pruneUpperBoundComparator(),
compactedRegions.get(latestRecordTime));
+ List<InvalidListPruningDebugTool.RegionPruneInfoPretty>
latestExpected =
+ Lists.newArrayList(compactedRegions.get(latestRecordTime));
pruningDebug.execute(new String[]{"idle-regions", "-1"}, out);
out.flush();
- Assert.assertEquals(GSON.toJson(latestExpected),
readOutputStream(outputStream));
+ assertEquals(latestExpected, readOutputStream(outputStream));
// Same command with explicit time
outputStream.reset();
pruningDebug.execute(new String[]{"idle-regions", "-1",
String.valueOf(latestRecordTime)}, out);
out.flush();
- Assert.assertEquals(GSON.toJson(latestExpected),
readOutputStream(outputStream));
+ assertEquals(latestExpected, readOutputStream(outputStream));
// Same command with relative time
outputStream.reset();
pruningDebug.execute(new String[]{"idle-regions", "-1", "now-2s"},
out);
out.flush();
- Assert.assertEquals(GSON.toJson(latestExpected),
readOutputStream(outputStream));
+ assertEquals(latestExpected, readOutputStream(outputStream));
// Same command with reduced number of regions
outputStream.reset();
- pruningDebug.execute(new String[]{"idle-regions", "2",
String.valueOf(latestRecordTime)}, out);
+ int limit = 2;
+ pruningDebug.execute(new String[]{"idle-regions",
String.valueOf(limit), String.valueOf(latestRecordTime)}, out);
out.flush();
- Assert.assertEquals(GSON.toJson(subset(latestExpected, 0, 2)),
readOutputStream(outputStream));
+ List<RegionPruneInfo> actualPruneInfos =
GSON.fromJson(readOutputStream(outputStream), PRUNE_INFO_LIST_TYPE);
+ Set<String> actualRegions =
Sets.newHashSet(Iterables.transform(actualPruneInfos, PRUNE_INFO_TO_STRING));
+ // Just comparing sizes, since returned order can be different when
prune upper bounds are the same
--- End diff --
Done
> Improve the prune debug tool
> ----------------------------
>
> Key: TEPHRA-245
> URL: https://issues.apache.org/jira/browse/TEPHRA-245
> Project: Tephra
> Issue Type: Improvement
> Components: core, manager
> Affects Versions: 0.12.0-incubating
> Reporter: Andreas Neumann
> Assignee: Poorna Chandra
> Fix For: 0.14.0-incubating
>
>
> The current tool is not very intuitive and it requires deep understanding of
> how pruning works to use it, It would be better if the tool could provide
> instructions: what is needed to make pruning proceed?
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)