From f12e1b21d0106cbb552db7b53189514996c4ece8 Mon Sep 17 00:00:00 2001 From: Brad Kim Date: Mon, 10 Mar 2014 17:01:27 +0900 Subject: [PATCH 1/2] add cache blocks option in HaeinsaIntraScan --- src/main/java/kr/co/vcnc/haeinsa/HaeinsaIntraScan.java | 9 +++++++++ src/main/java/kr/co/vcnc/haeinsa/HaeinsaTable.java | 1 + 2 files changed, 10 insertions(+) diff --git a/src/main/java/kr/co/vcnc/haeinsa/HaeinsaIntraScan.java b/src/main/java/kr/co/vcnc/haeinsa/HaeinsaIntraScan.java index 00d797f..fb63715 100644 --- a/src/main/java/kr/co/vcnc/haeinsa/HaeinsaIntraScan.java +++ b/src/main/java/kr/co/vcnc/haeinsa/HaeinsaIntraScan.java @@ -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 families = new TreeSet(Bytes.BYTES_COMPARATOR); @@ -88,4 +89,12 @@ public int getBatch() { public NavigableSet getFamilies() { return families; } + + public void setCacheBlocks(boolean cacheBlocks) { + this.cacheBlocks = cacheBlocks; + } + + public boolean getCacheBlocks() { + return cacheBlocks; + } } diff --git a/src/main/java/kr/co/vcnc/haeinsa/HaeinsaTable.java b/src/main/java/kr/co/vcnc/haeinsa/HaeinsaTable.java index 8e23f6a..b41c1be 100644 --- a/src/main/java/kr/co/vcnc/haeinsa/HaeinsaTable.java +++ b/src/main/java/kr/co/vcnc/haeinsa/HaeinsaTable.java @@ -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); From 433fa5e18e2d3734481b55c0f2b2f270908b695d Mon Sep 17 00:00:00 2001 From: Brad Kim Date: Mon, 10 Mar 2014 17:13:38 +0900 Subject: [PATCH 2/2] apply coding style --- .../java/kr/co/vcnc/haeinsa/HaeinsaIntraScan.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/kr/co/vcnc/haeinsa/HaeinsaIntraScan.java b/src/main/java/kr/co/vcnc/haeinsa/HaeinsaIntraScan.java index fb63715..db51ead 100644 --- a/src/main/java/kr/co/vcnc/haeinsa/HaeinsaIntraScan.java +++ b/src/main/java/kr/co/vcnc/haeinsa/HaeinsaIntraScan.java @@ -89,12 +89,12 @@ public int getBatch() { public NavigableSet getFamilies() { return families; } - + public void setCacheBlocks(boolean cacheBlocks) { - this.cacheBlocks = cacheBlocks; - } - + this.cacheBlocks = cacheBlocks; + } + public boolean getCacheBlocks() { - return cacheBlocks; - } + return cacheBlocks; + } }