Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Making rowKey inclusivity configurable #2

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -328,8 +328,8 @@ public static Scan buildScan(ScanData scanData, Map<String, KeyDistributor> 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());
Expand Down
19 changes: 19 additions & 0 deletions client/src/main/java/com/flipkart/yak/models/ScanData.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,25 @@ public class ScanData {
private List<ColTupple> 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;
Expand Down