* {@inheritDoc}
*/
@Override
public Filter filter(AbstractBounds<RowPosition> keyRange)
{
RowPosition startPosition = keyRange.left;
RowPosition stopPosition = keyRange.right;
Long start = (Long) startPosition.getToken().token;
Long stop = (Long) stopPosition.getToken().token;
if (startPosition.isMinimum())
{
start = null;
}
if (stopPosition.isMinimum())
{
stop = null;
}
boolean includeLower = includeLower(startPosition.kind());
boolean includeUpper = includeUpper(stopPosition.kind());
Log.debug("Filtering %s %d, %d %s", includeLower ? "[" : "(", start, stop, includeUpper ? "]" : ")");
return NumericRangeFilter.newLongRange(FIELD_NAME, start, stop, includeLower, includeUpper);
}