Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #2 from matt-martin/master

Fixing a minor off by one error
  • Loading branch information...
commit 6cbb40c64ee05c7db0eb0e0ecde940d3a429569a 2 parents f339c86 + 66d9b7c
@larsgeorge authored
View
2  ch03/src/main/java/util/HBaseHelper.java
@@ -151,7 +151,7 @@ public void put(String table, String[] rows, String[] fams, String[] quals,
for (String fam : fams) {
int v = 0;
for (String qual : quals) {
- String val = vals[v < vals.length ? v : vals.length];
+ String val = vals[v < vals.length ? v : vals.length - 1];
long t = ts[v < ts.length ? v : ts.length - 1];
put.add(Bytes.toBytes(fam), Bytes.toBytes(qual), t,
Bytes.toBytes(val));
View
2  ch04/src/main/java/util/HBaseHelper.java
@@ -142,7 +142,7 @@ public void put(String table, String[] rows, String[] fams, String[] quals,
for (String fam : fams) {
int v = 0;
for (String qual : quals) {
- String val = vals[v < vals.length ? v : vals.length];
+ String val = vals[v < vals.length ? v : vals.length - 1];
long t = ts[v < ts.length ? v : ts.length - 1];
put.add(Bytes.toBytes(fam), Bytes.toBytes(qual), t,
Bytes.toBytes(val));
View
2  ch05/src/main/java/util/HBaseHelper.java
@@ -142,7 +142,7 @@ public void put(String table, String[] rows, String[] fams, String[] quals,
for (String fam : fams) {
int v = 0;
for (String qual : quals) {
- String val = vals[v < vals.length ? v : vals.length];
+ String val = vals[v < vals.length ? v : vals.length - 1];
long t = ts[v < ts.length ? v : ts.length - 1];
put.add(Bytes.toBytes(fam), Bytes.toBytes(qual), t,
Bytes.toBytes(val));
View
2  ch06/src/main/java/util/HBaseHelper.java
@@ -142,7 +142,7 @@ public void put(String table, String[] rows, String[] fams, String[] quals,
for (String fam : fams) {
int v = 0;
for (String qual : quals) {
- String val = vals[v < vals.length ? v : vals.length];
+ String val = vals[v < vals.length ? v : vals.length - 1];
long t = ts[v < ts.length ? v : ts.length - 1];
put.add(Bytes.toBytes(fam), Bytes.toBytes(qual), t,
Bytes.toBytes(val));
View
2  ch07/src/main/java/util/HBaseHelper.java
@@ -142,7 +142,7 @@ public void put(String table, String[] rows, String[] fams, String[] quals,
for (String fam : fams) {
int v = 0;
for (String qual : quals) {
- String val = vals[v < vals.length ? v : vals.length];
+ String val = vals[v < vals.length ? v : vals.length - 1];
long t = ts[v < ts.length ? v : ts.length - 1];
put.add(Bytes.toBytes(fam), Bytes.toBytes(qual), t,
Bytes.toBytes(val));
View
2  ch09/src/main/java/util/HBaseHelper.java
@@ -151,7 +151,7 @@ public void put(String table, String[] rows, String[] fams, String[] quals,
for (String fam : fams) {
int v = 0;
for (String qual : quals) {
- String val = vals[v < vals.length ? v : vals.length];
+ String val = vals[v < vals.length ? v : vals.length - 1];
long t = ts[v < ts.length ? v : ts.length - 1];
put.add(Bytes.toBytes(fam), Bytes.toBytes(qual), t,
Bytes.toBytes(val));
Please sign in to comment.
Something went wrong with that request. Please try again.