You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2018/10/17 19:31:33 UTC
[GitHub] keith-turner closed pull request #707: Fix summarizer bug with
empty loc group
keith-turner closed pull request #707: Fix summarizer bug with empty loc group
URL: https://github.com/apache/accumulo/pull/707
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/core/src/main/java/org/apache/accumulo/core/summary/SummarySerializer.java b/core/src/main/java/org/apache/accumulo/core/summary/SummarySerializer.java
index d84f91084b..e3a6f61d3b 100644
--- a/core/src/main/java/org/apache/accumulo/core/summary/SummarySerializer.java
+++ b/core/src/main/java/org/apache/accumulo/core/summary/SummarySerializer.java
@@ -433,6 +433,10 @@ static SummarySerializer load(SummarizerConfiguration sconf, DataInputStream in)
boolean exceedsRange(Text startRow, Text endRow) {
+ if (summaries.length == 0) {
+ return false;
+ }
+
Text lastRow = summaries[summaries.length - 1].lastRow;
if (startRow != null && firstRow.compareTo(startRow) <= 0
&& startRow.compareTo(lastRow) < 0) {
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/SummaryIT.java b/test/src/main/java/org/apache/accumulo/test/functional/SummaryIT.java
index 78baa7fdc8..749d1d71af 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/SummaryIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/SummaryIT.java
@@ -717,13 +717,15 @@ public void testLocalityGroups() throws Exception {
SummarizerConfiguration sc1 = SummarizerConfiguration.builder(FamilySummarizer.class).build();
SummarizerConfiguration sc2 = SummarizerConfiguration.builder(BasicSummarizer.class).build();
ntc.enableSummarization(sc1, sc2);
- c.tableOperations().create(table, ntc);
Map<String,Set<Text>> lgroups = new HashMap<>();
lgroups.put("lg1", ImmutableSet.of(new Text("chocolate"), new Text("coffee")));
lgroups.put("lg2", ImmutableSet.of(new Text(" broccoli "), new Text("cabbage")));
+ // create a locality group that will not have data in it
+ lgroups.put("lg3", ImmutableSet.of(new Text(" apple "), new Text("orange")));
- c.tableOperations().setLocalityGroups(table, lgroups);
+ ntc.setLocalityGroups(lgroups);
+ c.tableOperations().create(table, ntc);
Map<Key,Value> expected = new HashMap<>();
try (BatchWriter bw = c.createBatchWriter(table, new BatchWriterConfig())) {
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services