Skip to content

Commit

Permalink
Merge pull request #14 from VCNC/add-cache-blocks-option-in-intra-scan
Browse files Browse the repository at this point in the history
add cache blocks option in HaeinsaIntraScan
  • Loading branch information
eincs committed Mar 10, 2014
2 parents f420d16 + 433fa5e commit 2fb6806
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/main/java/kr/co/vcnc/haeinsa/HaeinsaIntraScan.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public class HaeinsaIntraScan {
private final byte[] maxColumn;
private final boolean maxColumnInclusive;
private int batch = 32;
private boolean cacheBlocks = true;

// if this set is empty, then scan every family
private final NavigableSet<byte[]> families = new TreeSet<byte[]>(Bytes.BYTES_COMPARATOR);
Expand Down Expand Up @@ -88,4 +89,12 @@ public int getBatch() {
public NavigableSet<byte[]> getFamilies() {
return families;
}

public void setCacheBlocks(boolean cacheBlocks) {
this.cacheBlocks = cacheBlocks;
}

public boolean getCacheBlocks() {
return cacheBlocks;
}
}
1 change: 1 addition & 0 deletions src/main/java/kr/co/vcnc/haeinsa/HaeinsaTable.java
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ public HaeinsaResultScanner getScanner(@Nullable HaeinsaTransaction tx, HaeinsaI
// scan from startRow ( inclusive ) to startRow + 0x00 ( exclusive )
Scan hScan = new Scan(intraScan.getRow(), Bytes.add(intraScan.getRow(), new byte[] { 0x00 }));
hScan.setBatch(intraScan.getBatch());
hScan.setCacheBlocks(intraScan.getCacheBlocks());

for (byte[] family : intraScan.getFamilies()) {
hScan.addFamily(family);
Expand Down

0 comments on commit 2fb6806

Please sign in to comment.