Index: CHANGES.txt =================================================================== --- CHANGES.txt (revision 1029105) +++ CHANGES.txt (revision 1029117) @@ -1063,6 +1063,8 @@ (Nicolas Spiegelberg via Stack) HBASE-3169 NPE when master joins running cluster if a RIT references a RS no longer present + HBASE-3174 Add ability for Get operations to enable/disable use of block + caching NEW FEATURES HBASE-1961 HBase EC2 scripts Index: src/main/java/org/apache/hadoop/hbase/ipc/HBaseRPCProtocolVersion.java =================================================================== --- src/main/java/org/apache/hadoop/hbase/ipc/HBaseRPCProtocolVersion.java (revision 1029105) +++ src/main/java/org/apache/hadoop/hbase/ipc/HBaseRPCProtocolVersion.java (revision 1029117) @@ -77,11 +77,8 @@ *
  • Version 23: HBASE-2066, multi-put.
  • *
  • Version 24: HBASE-2473, create table with regions.
  • *
  • Version 25: Added openRegion and Stoppable/Abortable to API.
  • - *
  • Version 26: New master.
  • - * REVERTED TO 25 TEMPORARILY -- TESTTABLEMAPREDUCE IS FAILING WITH - * HBaseRPC$VersionMismatch: Protocol org.apache.hadoop.hbase.ipc.HRegionInterface version mismatch. (client = 26, server = 25) - * ON HUDSON. + *
  • Version 26: New master and Increment, 0.90 version bump.
  • * */ - public static final long versionID = 25L; + public static final long versionID = 26L; } Index: src/main/java/org/apache/hadoop/hbase/client/Get.java =================================================================== --- src/main/java/org/apache/hadoop/hbase/client/Get.java (revision 1029105) +++ src/main/java/org/apache/hadoop/hbase/client/Get.java (revision 1029117) @@ -66,6 +66,7 @@ private byte [] row = null; private long lockId = -1L; private int maxVersions = 1; + private boolean cacheBlocks = true; private Filter filter = null; private TimeRange tr = new TimeRange(); private Map> familyMap = @@ -204,6 +205,29 @@ } /** + * Set whether blocks should be cached for this Get. + *

    + * This is true by default. When true, default settings of the table and + * family are used (this will never override caching blocks if the block + * cache is disabled for that family or entirely). + * + * @param cacheBlocks if false, default settings are overridden and blocks + * will not be cached + */ + public void setCacheBlocks(boolean cacheBlocks) { + this.cacheBlocks = cacheBlocks; + } + + /** + * Get whether blocks should be cached for this Get. + * @return true if default caching should be used, false if blocks should not + * be cached + */ + public boolean getCacheBlocks() { + return cacheBlocks; + } + + /** * Method for retrieving the get's row * @return row */ @@ -285,6 +309,8 @@ sb.append(Bytes.toString(this.row)); sb.append(", maxVersions="); sb.append("").append(this.maxVersions); + sb.append(", cacheBlocks="); + sb.append(this.cacheBlocks); sb.append(", timeRange="); sb.append("[").append(this.tr.getMin()).append(","); sb.append(this.tr.getMax()).append(")"); @@ -345,6 +371,7 @@ this.filter = (Filter)createForName(Bytes.toString(Bytes.readByteArray(in))); this.filter.readFields(in); } + this.cacheBlocks = in.readBoolean(); this.tr = new TimeRange(); tr.readFields(in); int numFamilies = in.readInt(); @@ -379,6 +406,7 @@ Bytes.writeByteArray(out, Bytes.toBytes(filter.getClass().getName())); filter.write(out); } + out.writeBoolean(this.cacheBlocks); tr.write(out); out.writeInt(familyMap.size()); for(Map.Entry> entry : Index: src/main/java/org/apache/hadoop/hbase/client/Scan.java =================================================================== --- src/main/java/org/apache/hadoop/hbase/client/Scan.java (revision 1029105) +++ src/main/java/org/apache/hadoop/hbase/client/Scan.java (revision 1029117) @@ -163,6 +163,7 @@ this.startRow = get.getRow(); this.stopRow = get.getRow(); this.filter = get.getFilter(); + this.cacheBlocks = get.getCacheBlocks(); this.maxVersions = get.getMaxVersions(); this.tr = get.getTimeRange(); this.familyMap = get.getFamilyMap();