From 147a423b345ea365c22af48727c83ea4f31b948c Mon Sep 17 00:00:00 2001 From: Chandan Rajah Date: Wed, 21 Aug 2013 14:41:54 +0100 Subject: Added minor echanges to code and more testing --- .../java/parallelai/spyglass/hbase/HBaseOutputFormat.java | 4 ++-- src/main/java/parallelai/spyglass/hbase/HBaseRawScheme.java | 2 +- src/main/java/parallelai/spyglass/hbase/HBaseSalter.java | 11 +++++++++++ 3 files changed, 14 insertions(+), 3 deletions(-) (limited to 'src/main/java/parallelai/spyglass/hbase') diff --git a/src/main/java/parallelai/spyglass/hbase/HBaseOutputFormat.java b/src/main/java/parallelai/spyglass/hbase/HBaseOutputFormat.java index c145eb0..3c62f82 100644 --- a/src/main/java/parallelai/spyglass/hbase/HBaseOutputFormat.java +++ b/src/main/java/parallelai/spyglass/hbase/HBaseOutputFormat.java @@ -52,8 +52,8 @@ FileOutputFormat implements JobConfigurable { LOG.error(e); throw e; } - // TODO: Should Autoflush be set to true ???? - table.setAutoFlush(false); + // TODO: Should Autoflush be set to true ???? - DONE + table.setAutoFlush(true); HBaseRecordWriter recordWriter = new HBaseRecordWriter(table); recordWriter.setSinkMode(sinkMode); return recordWriter; diff --git a/src/main/java/parallelai/spyglass/hbase/HBaseRawScheme.java b/src/main/java/parallelai/spyglass/hbase/HBaseRawScheme.java index 832ce95..7b62c88 100644 --- a/src/main/java/parallelai/spyglass/hbase/HBaseRawScheme.java +++ b/src/main/java/parallelai/spyglass/hbase/HBaseRawScheme.java @@ -278,7 +278,7 @@ public class HBaseRawScheme extends Scheme subSet = prefixSet.subSet(startPrefix, true, stopPrefix, true); + + LOG.info("".format("Prefix subset (%s)", subSet)); return getAllKeys(originalKey, subSet.toArray(new Byte[]{})); } public static byte[][] getAllKeys(byte[] originalKey, Byte [] prefixArray) { + LOG.info("".format("getAllKeys: OKEY (%s) PARRAY (%s)", + Bytes.toString(originalKey), prefixArray )); + byte[][] keys = new byte[prefixArray.length][]; for (byte i = 0; i < prefixArray.length; i++) { keys[i] = Bytes.add(new byte[] {prefixArray[i].byteValue()}, Bytes.add( Bytes.toBytes("_"), originalKey)); } + for(int i = 0; i < keys.length; i ++) { + for(int j = 0; j < keys[i].length; j++) { + LOG.info("" + i + " : " + j + " : " + keys[i][j]); + } + } + return keys; } -- cgit v1.2.3