From e073f2a98ddb65501e77d21bf096a9ab0cd71d74 Mon Sep 17 00:00:00 2001 From: Lars George Date: Thu, 12 Feb 2015 16:03:11 +0100 Subject: [PATCH] Removed as functionality was removed in API. 1.0 does not expose this anymore. --- .../java/client/GetRowOrBeforeExample.java | 49 ------------------- 1 file changed, 49 deletions(-) delete mode 100644 ch03/src/main/java/client/GetRowOrBeforeExample.java diff --git a/ch03/src/main/java/client/GetRowOrBeforeExample.java b/ch03/src/main/java/client/GetRowOrBeforeExample.java deleted file mode 100644 index 18cf480..0000000 --- a/ch03/src/main/java/client/GetRowOrBeforeExample.java +++ /dev/null @@ -1,49 +0,0 @@ -package client; - -// cc GetRowOrBeforeExample Example using a special retrieval method. -import org.apache.hadoop.conf.Configuration; -import org.apache.hadoop.hbase.HBaseConfiguration; -import org.apache.hadoop.hbase.KeyValue; -import org.apache.hadoop.hbase.TableName; -import org.apache.hadoop.hbase.client.Connection; -import org.apache.hadoop.hbase.client.ConnectionFactory; -import org.apache.hadoop.hbase.client.Result; -import org.apache.hadoop.hbase.client.Table; -import org.apache.hadoop.hbase.util.Bytes; -import util.HBaseHelper; - -import java.io.IOException; - -public class GetRowOrBeforeExample { - - public static void main(String[] args) throws IOException { - Configuration conf = HBaseConfiguration.create(); - HBaseHelper helper = HBaseHelper.getHelper(conf); - if (!helper.existsTable("testtable")) { - helper.createTable("testtable", "colfam1"); - } - Connection connection = ConnectionFactory.createConnection(conf); - Table table = connection.getTable(TableName.valueOf("testtable")); - - // vv GetRowOrBeforeExample -// Result result1 = table.getRowOrBefore(Bytes.toBytes("row1"), // co GetRowOrBeforeExample-1-GetRow1 Attempt to find an existing row. -// Bytes.toBytes("colfam1")); // todo: FIX! -// System.out.println("Found: " + Bytes.toString(result1.getRow())); // co GetRowOrBeforeExample-2-SOUT1 Print what was found. -// -// Result result2 = table.getRowOrBefore(Bytes.toBytes("row99"), // co GetRowOrBeforeExample-3-GetRow2 Attempt to find a non-existent row. -// Bytes.toBytes("colfam1")); -// System.out.println("Found: " + Bytes.toString(result2.getRow())); // co GetRowOrBeforeExample-4-SOUT2 Returns the row that was sorted at the end of the table. -// -// for (KeyValue kv : result2.raw()) { -// System.out.println(" Col: " + Bytes.toString(kv.getFamily()) + // co GetRowOrBeforeExample-5-Dump Print the returned values. -// "/" + Bytes.toString(kv.getQualifier()) + -// ", Value: " + Bytes.toString(kv.getValue())); -// } -// -// Result result3 = table.getRowOrBefore(Bytes.toBytes("abc"), // co GetRowOrBeforeExample-6-GetRow3 Attempt to find a row before the test rows. -// Bytes.toBytes("colfam1")); -// System.out.println("Found: " + result3); // co GetRowOrBeforeExample-7-SOUT3 Should return "null" since there is no match. -// // ^^ GetRowOrBeforeExample - table.close(); - } -}