Merge pull request #1806 from himanshug/fix_index_exceeded_msg

Fix index exceeded msg to give maxRowCount as well
This commit is contained in:
Xavier Léauté 2015-10-07 14:04:56 -07:00
commit e797d222c7
3 changed files with 6 additions and 6 deletions

View File

@ -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)

View File

@ -187,7 +187,7 @@ public class OffheapIncrementalIndex extends IncrementalIndex<BufferAggregator>
synchronized (this) {
if (!facts.containsKey(key)) {
if (!canAppendRow(false)) {
throw new IndexSizeExceededException(getOutOfRowsReason());
throw new IndexSizeExceededException("%s", getOutOfRowsReason());
}
}
rowOffset = totalAggSize * numEntries.get();

View File

@ -151,7 +151,7 @@ public class OnheapIncrementalIndex extends IncrementalIndex<Aggregator>
// 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) {