Fix integer overflow in SegmentMetadataQuery numRows. (#2890)

This commit is contained in:
Gian Merlino 2016-04-27 14:37:04 -07:00 committed by Xavier Léauté
parent c29cb7d711
commit 90ce03c66f
3 changed files with 5 additions and 5 deletions

View File

@ -76,7 +76,7 @@ public class SegmentAnalyzer
this.analysisTypes = analysisTypes;
}
public int numRows(Segment segment)
public long numRows(Segment segment)
{
return Preconditions.checkNotNull(segment, "segment").asStorageAdapter().getNumRows();
}

View File

@ -87,7 +87,7 @@ public class SegmentMetadataQueryRunnerFactory implements QueryRunnerFactory<Seg
SegmentMetadataQuery query = (SegmentMetadataQuery) inQ;
final SegmentAnalyzer analyzer = new SegmentAnalyzer(query.getAnalysisTypes());
final Map<String, ColumnAnalysis> analyzedColumns = analyzer.analyze(segment);
final int numRows = analyzer.numRows(segment);
final long numRows = analyzer.numRows(segment);
long totalSize = 0;
if (analyzer.analyzingSize()) {

View File

@ -34,7 +34,7 @@ public class SegmentAnalysis implements Comparable<SegmentAnalysis>
private final List<Interval> interval;
private final Map<String, ColumnAnalysis> columns;
private final long size;
private final int numRows;
private final long numRows;
private final Map<String, AggregatorFactory> aggregators;
@JsonCreator
@ -43,7 +43,7 @@ public class SegmentAnalysis implements Comparable<SegmentAnalysis>
@JsonProperty("intervals") List<Interval> interval,
@JsonProperty("columns") Map<String, ColumnAnalysis> columns,
@JsonProperty("size") long size,
@JsonProperty("numRows") int numRows,
@JsonProperty("numRows") long numRows,
@JsonProperty("aggregators") Map<String, AggregatorFactory> aggregators
)
{
@ -80,7 +80,7 @@ public class SegmentAnalysis implements Comparable<SegmentAnalysis>
}
@JsonProperty
public int getNumRows()
public long getNumRows()
{
return numRows;
}