private static TimeRange getRowTimestampColumnRange(List<List<KeyRange>> ranges, RowKeySchema schema, int rowTimestampColPos) { try { if (rowTimestampColPos != -1) { if (ranges != null && ranges.size() > rowTimestampColPos) { List<KeyRange> rowTimestampColRange = ranges.get(rowTimestampColPos); List<KeyRange> sortedRange = new ArrayList<>(rowTimestampColRange); Collections.sort(sortedRange, KeyRange.COMPARATOR); //ranges.set(rowTimestampColPos, sortedRange); //TODO: do I really need to do this? Field f = schema.getField(rowTimestampColPos); SortOrder order = f.getSortOrder(); KeyRange lowestRange = sortedRange.get(0); KeyRange highestRange = sortedRange.get(rowTimestampColRange.size() - 1); if (order == SortOrder.DESC) { return getDescTimeRange(lowestRange, highestRange, f); } return getAscTimeRange( lowestRange, highestRange, f); } } } catch (IOException e) { Throwables.propagate(e); } return null; }
private static TimeRange getRowTimestampColumnRange(List<List<KeyRange>> ranges, RowKeySchema schema, int rowTimestampColPos) { try { if (rowTimestampColPos != -1) { if (ranges != null && ranges.size() > rowTimestampColPos) { List<KeyRange> rowTimestampColRange = ranges.get(rowTimestampColPos); List<KeyRange> sortedRange = new ArrayList<>(rowTimestampColRange); Collections.sort(sortedRange, KeyRange.COMPARATOR); //ranges.set(rowTimestampColPos, sortedRange); //TODO: do I really need to do this? Field f = schema.getField(rowTimestampColPos); SortOrder order = f.getSortOrder(); KeyRange lowestRange = sortedRange.get(0); KeyRange highestRange = sortedRange.get(rowTimestampColRange.size() - 1); if (order == SortOrder.DESC) { return getDescTimeRange(lowestRange, highestRange, f); } return getAscTimeRange( lowestRange, highestRange, f); } } } catch (IOException e) { Throwables.propagate(e); } return null; }
private static TimeRange getRowTimestampColumnRange(List<List<KeyRange>> ranges, RowKeySchema schema, int rowTimestampColPos) { try { if (rowTimestampColPos != -1) { if (ranges != null && ranges.size() > rowTimestampColPos) { List<KeyRange> rowTimestampColRange = ranges.get(rowTimestampColPos); List<KeyRange> sortedRange = new ArrayList<>(rowTimestampColRange); Collections.sort(sortedRange, KeyRange.COMPARATOR); //ranges.set(rowTimestampColPos, sortedRange); //TODO: do I really need to do this? Field f = schema.getField(rowTimestampColPos); SortOrder order = f.getSortOrder(); KeyRange lowestRange = sortedRange.get(0); KeyRange highestRange = sortedRange.get(rowTimestampColRange.size() - 1); if (order == SortOrder.DESC) { return getDescTimeRange(lowestRange, highestRange, f); } return getAscTimeRange( lowestRange, highestRange, f); } } } catch (IOException e) { Throwables.propagate(e); } return null; }