use of com.tuplejump.stargate.lucene.IndexEntryCollector.IndexEntry in project stargate-core by tuplejump.
the class ResultMapper method getColumnSlices.
private ColumnSlice[] getColumnSlices(Collection<IndexEntry> entries) {
ColumnSlice[] columnSlices = new ColumnSlice[entries.size()];
int i = 0;
for (IndexEntry entry : entries) {
Composite start = tableMapper.start(entry.clusteringKey);
Composite end = tableMapper.end(start);
ColumnSlice columnSlice = new ColumnSlice(start, end);
columnSlices[i++] = columnSlice;
}
return columnSlices;
}
use of com.tuplejump.stargate.lucene.IndexEntryCollector.IndexEntry in project stargate-core by tuplejump.
the class ResultMapper method getPagedColumnSlices.
private ColumnSlice[] getPagedColumnSlices(DecoratedKey dk, Collection<IndexEntry> entries, int pageSize) {
ArrayList<ColumnSlice> columnSlices = new ArrayList<>(Math.min(entries.size(), pageSize));
for (IndexEntry entry : entries) {
CellName cellName = entry.clusteringKey;
if (!filter.columnFilter(dk.getKey()).maySelectPrefix(tableMapper.table.getComparator(), cellName.start())) {
continue;
}
Composite start = tableMapper.start(cellName);
Composite end = tableMapper.end(start);
ColumnSlice columnSlice = new ColumnSlice(start, end);
columnSlices.add(columnSlice);
if (columnSlices.size() == pageSize) {
break;
}
}
return columnSlices.toArray(new ColumnSlice[columnSlices.size()]);
}
Aggregations