diff --git a/client/src/main/java/com/flipkart/yak/client/AsyncStoreClientUtis.java b/client/src/main/java/com/flipkart/yak/client/AsyncStoreClientUtis.java index f35ec05..444149a 100644 --- a/client/src/main/java/com/flipkart/yak/client/AsyncStoreClientUtis.java +++ b/client/src/main/java/com/flipkart/yak/client/AsyncStoreClientUtis.java @@ -328,8 +328,8 @@ public static Scan buildScan(ScanData scanData, Map keyD byte[] startRowKey = keyDistributor.enrichKey(scanData.getStartRow(), scanData.getPartitionKey()); byte[] stopRowKey = keyDistributor.enrichKey(scanData.getStopRow(), scanData.getPartitionKey()); - scan.setStartRow(startRowKey); - scan.setStopRow(stopRowKey); + scan.withStartRow(startRowKey, scanData.shouldIncludeStartRow()); + scan.withStopRow(stopRowKey, scanData.shouldIncludeStopRow()); if (scanData.getCaching() == -1 || (scanData.getLimit() != -1 && scanData.getCaching() > scanData.getLimit())) { scan.setCaching(scanData.getLimit()); diff --git a/client/src/main/java/com/flipkart/yak/models/ScanData.java b/client/src/main/java/com/flipkart/yak/models/ScanData.java index ef69b94..892a45e 100644 --- a/client/src/main/java/com/flipkart/yak/models/ScanData.java +++ b/client/src/main/java/com/flipkart/yak/models/ScanData.java @@ -28,6 +28,25 @@ public class ScanData { private List columnfamilies = new ArrayList<>(); private final String tableName; private byte[] partitionKey; + private boolean includeStopRow = false; + private boolean includeStartRow = true; + + public boolean shouldIncludeStopRow() { + return includeStopRow; + } + + public void setIncludeStopRow(boolean includeStopRow) { + this.includeStopRow = includeStopRow; + } + + public boolean shouldIncludeStartRow() { + return includeStartRow; + } + + public void setIncludeStartRow(boolean includeStartRow) { + this.includeStartRow = includeStartRow; + } + public ScanData(String tableName) { this.tableName = tableName;