1) Rename "orderBy" on DefaultLimitSpec to "columns"

This commit is contained in:
cheddar 2013-05-06 15:43:28 -05:00
parent 9324b2337b
commit a25469eba6
1 changed files with 7 additions and 7 deletions

View File

@ -43,25 +43,25 @@ import java.util.Map;
*/
public class DefaultLimitSpec implements LimitSpec
{
private final List<OrderByColumnSpec> orderBy;
private final List<OrderByColumnSpec> columns;
private final int limit;
@JsonCreator
public DefaultLimitSpec(
@JsonProperty("orderBy") List<OrderByColumnSpec> orderBy,
@JsonProperty("columns") List<OrderByColumnSpec> columns,
@JsonProperty("limit") Integer limit
)
{
this.orderBy = (orderBy == null) ? ImmutableList.<OrderByColumnSpec>of() : orderBy;
this.columns = (columns == null) ? ImmutableList.<OrderByColumnSpec>of() : columns;
this.limit = (limit == null) ? Integer.MAX_VALUE : limit;
Preconditions.checkState(limit > 0, "limit[%s] must be >0", limit);
}
@JsonProperty
public List<OrderByColumnSpec> getOrderBy()
public List<OrderByColumnSpec> getColumns()
{
return orderBy;
return columns;
}
@JsonProperty
@ -117,7 +117,7 @@ public class DefaultLimitSpec implements LimitSpec
possibleOrderings.put(column, metricOrdering(column, postAgg.getComparator()));
}
for (OrderByColumnSpec columnSpec : orderBy) {
for (OrderByColumnSpec columnSpec : columns) {
Ordering<Row> nextOrdering = possibleOrderings.get(columnSpec.getDimension());
if (nextOrdering == null) {
@ -170,7 +170,7 @@ public class DefaultLimitSpec implements LimitSpec
public String toString()
{
return "DefaultLimitSpec{" +
"orderBy='" + orderBy + '\'' +
"columns='" + columns + '\'' +
", limit=" + limit +
'}';
}