aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/parallelai/spyglass
diff options
context:
space:
mode:
authorGracia Fernandez <Gracia.FernandezLopez@bskyb.com>2013-07-04 16:49:09 +0100
committerGracia Fernandez <Gracia.FernandezLopez@bskyb.com>2013-07-04 16:49:09 +0100
commit20a18b4388f0cd06bec0b43d083150f6e1bb2c5e (patch)
tree97c532e6e07abf4c6d0312749662080b315163f6 /src/main/java/parallelai/spyglass
parente8ba249d5ce2ec293a4d19b54fc8298d4eac0271 (diff)
downloadSpyGlass-20a18b4388f0cd06bec0b43d083150f6e1bb2c5e.tar.gz
SpyGlass-20a18b4388f0cd06bec0b43d083150f6e1bb2c5e.zip
Changed HBaseSource and JDBCSource to allow testing with JobTest. Samples of tests included.
Diffstat (limited to 'src/main/java/parallelai/spyglass')
-rw-r--r--src/main/java/parallelai/spyglass/hbase/HBaseScheme.java15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/main/java/parallelai/spyglass/hbase/HBaseScheme.java b/src/main/java/parallelai/spyglass/hbase/HBaseScheme.java
index a7d36fd..3c64e52 100644
--- a/src/main/java/parallelai/spyglass/hbase/HBaseScheme.java
+++ b/src/main/java/parallelai/spyglass/hbase/HBaseScheme.java
@@ -238,12 +238,17 @@ public class HBaseScheme
OutputCollector outputCollector = sinkCall.getOutput();
Tuple key = tupleEntry.selectTuple(keyField);
ImmutableBytesWritable keyBytes = (ImmutableBytesWritable) key.getObject(0);
-
- if( useSalt ) {
- keyBytes = HBaseSalter.addSaltPrefix(keyBytes);
+
+ if (useSalt) {
+ keyBytes = HBaseSalter.addSaltPrefix(keyBytes);
+ }
+
+ Put put;
+ if (this.timeStamp == 0L) {
+ put = new Put(keyBytes.get());
+ } else {
+ put = new Put(keyBytes.get(), this.timeStamp);
}
-
- Put put = new Put(keyBytes.get(), this.timeStamp);
for (int i = 0; i < valueFields.length; i++) {
Fields fieldSelector = valueFields[i];