From 8654732ef606d81e4b6d9925e9bf9c243fa1cbfb Mon Sep 17 00:00:00 2001 From: Himanshu Gupta Date: Tue, 6 Oct 2015 13:44:22 -0500 Subject: [PATCH 1/2] make IndexSizeExceededException constructor take formatString and arguments than just fixed String like ISE, IAE etc --- .../segment/incremental/IndexSizeExceededException.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/processing/src/main/java/io/druid/segment/incremental/IndexSizeExceededException.java b/processing/src/main/java/io/druid/segment/incremental/IndexSizeExceededException.java index 25cb141e6fb..f410ccb20fd 100644 --- a/processing/src/main/java/io/druid/segment/incremental/IndexSizeExceededException.java +++ b/processing/src/main/java/io/druid/segment/incremental/IndexSizeExceededException.java @@ -25,14 +25,14 @@ public class IndexSizeExceededException extends IOException { } - public IndexSizeExceededException(String message) + public IndexSizeExceededException(String formatText, Object... arguments) { - super(message); + super(String.format(formatText, arguments)); } - public IndexSizeExceededException(String message, Throwable cause) + public IndexSizeExceededException(Throwable cause, String formatText, Object... arguments) { - super(message, cause); + super(String.format(formatText, arguments), cause); } public IndexSizeExceededException(Throwable cause) From 2737fd83f545b7cbdbe8ab897ff88fbfedcdbf7a Mon Sep 17 00:00:00 2001 From: Himanshu Gupta Date: Tue, 6 Oct 2015 13:46:54 -0500 Subject: [PATCH 2/2] in the IndexSizeExceededException put maxRowCount to confirm if it is correctly picked up from configuration --- .../io/druid/segment/incremental/OffheapIncrementalIndex.java | 2 +- .../io/druid/segment/incremental/OnheapIncrementalIndex.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/processing/src/main/java/io/druid/segment/incremental/OffheapIncrementalIndex.java b/processing/src/main/java/io/druid/segment/incremental/OffheapIncrementalIndex.java index dffdd2de79f..a7c850b5cd7 100644 --- a/processing/src/main/java/io/druid/segment/incremental/OffheapIncrementalIndex.java +++ b/processing/src/main/java/io/druid/segment/incremental/OffheapIncrementalIndex.java @@ -187,7 +187,7 @@ public class OffheapIncrementalIndex extends IncrementalIndex synchronized (this) { if (!facts.containsKey(key)) { if (!canAppendRow(false)) { - throw new IndexSizeExceededException(getOutOfRowsReason()); + throw new IndexSizeExceededException("%s", getOutOfRowsReason()); } } rowOffset = totalAggSize * numEntries.get(); diff --git a/processing/src/main/java/io/druid/segment/incremental/OnheapIncrementalIndex.java b/processing/src/main/java/io/druid/segment/incremental/OnheapIncrementalIndex.java index cbc034c49e0..23e147169e3 100644 --- a/processing/src/main/java/io/druid/segment/incremental/OnheapIncrementalIndex.java +++ b/processing/src/main/java/io/druid/segment/incremental/OnheapIncrementalIndex.java @@ -151,7 +151,7 @@ public class OnheapIncrementalIndex extends IncrementalIndex // Last ditch sanity checks if (numEntries.get() >= maxRowCount && !facts.containsKey(key)) { - throw new IndexSizeExceededException("Maximum number of rows reached"); + throw new IndexSizeExceededException("Maximum number of rows [%d] reached", maxRowCount); } final Integer prev = facts.putIfAbsent(key, rowIndex); if (null == prev) {