Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ public class GroupByQueryConfig
@JsonProperty
private int maxResults = 500000;

//max off-heap limit in bytes
@JsonProperty
private long maxOffheapSize = 1L<<34;

public boolean isSingleThreaded()
{
return singleThreaded;
Expand All @@ -53,4 +57,14 @@ public int getMaxResults()
{
return maxResults;
}

public void setMaxOffheapSize(long maxOffheapSize)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this size in bytes or row count, javadoc would be helpful ?

Copy link
Copy Markdown
Contributor Author

@himanshug himanshug Apr 19, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its size in bytes, added a comment on variable declared

{
this.maxOffheapSize = maxOffheapSize;
}

public long getMaxOffheapSize()
{
return maxOffheapSize;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
public class GroupByQueryHelper
{
private static final String CTX_KEY_MAX_RESULTS = "maxResults";
private static final String CTX_KEY_MAX_OFF_HEAP_SIZE = "groupByMaxOffheapSize";
public final static String CTX_KEY_SORT_RESULTS = "sortResults";

public static <T> Pair<IncrementalIndex, Accumulator<IncrementalIndex, T>> createIndexAccumulatorPair(
Expand Down Expand Up @@ -94,8 +95,7 @@ public String apply(DimensionSpec input)
false,
true,
sortResults,
Math.min(query.getContextValue(CTX_KEY_MAX_RESULTS, config.getMaxResults()), config.getMaxResults()),
bufferPool
Math.min(query.getContextValue(CTX_KEY_MAX_OFF_HEAP_SIZE, config.getMaxOffheapSize()), config.getMaxOffheapSize())
);
} else {
index = new OnheapIncrementalIndex(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ public int lookupId(String name)

private final Map<String, DimensionDesc> dimensionDescs;
private final Map<String, ColumnCapabilitiesImpl> columnCapabilities;
private final List<DimDim> dimValues;
protected final List<DimDim> dimValues;

// looks need a configuration
private final Ordering<Comparable> ordering = Ordering.natural().nullsFirst();
Expand Down
Loading