hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apurt...@apache.org
Subject svn commit: r785453 - in /hadoop/hbase/trunk/src/test/org/apache/hadoop/hbase: HBaseTestCase.java client/TestOldAPITimestamp.java client/TestTimestamp.java
Date Wed, 17 Jun 2009 00:06:45 GMT
Author: apurtell
Date: Wed Jun 17 00:06:44 2009
New Revision: 785453

URL: http://svn.apache.org/viewvc?rev=785453&view=rev
Log:
test suite working again

Modified:
    hadoop/hbase/trunk/src/test/org/apache/hadoop/hbase/HBaseTestCase.java
    hadoop/hbase/trunk/src/test/org/apache/hadoop/hbase/client/TestOldAPITimestamp.java
    hadoop/hbase/trunk/src/test/org/apache/hadoop/hbase/client/TestTimestamp.java

Modified: hadoop/hbase/trunk/src/test/org/apache/hadoop/hbase/HBaseTestCase.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/test/org/apache/hadoop/hbase/HBaseTestCase.java?rev=785453&r1=785452&r2=785453&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/test/org/apache/hadoop/hbase/HBaseTestCase.java (original)
+++ hadoop/hbase/trunk/src/test/org/apache/hadoop/hbase/HBaseTestCase.java Wed Jun 17 00:06:44
2009
@@ -58,9 +58,9 @@
   /** configuration parameter name for test directory */
   public static final String TEST_DIRECTORY_KEY = "test.build.data";
 
-  protected final static byte [] fam1 = Bytes.toBytes("colfamily1:");
-  protected final static byte [] fam2 = Bytes.toBytes("colfamily2:");
-  protected final static byte [] fam3 = Bytes.toBytes("colfamily3:");
+  protected final static byte [] fam1 = Bytes.toBytes("colfamily1");
+  protected final static byte [] fam2 = Bytes.toBytes("colfamily2");
+  protected final static byte [] fam3 = Bytes.toBytes("colfamily3");
   protected static final byte [][] COLUMNS = {fam1,
     fam2, fam3};
 
@@ -309,8 +309,22 @@
               put.setTimeStamp(ts);
             }
             try {
-              String col = column != null ? column : columnFamily;
-              byte[][] split = KeyValue.parseColumn(Bytes.toBytes(col));
+              StringBuilder sb = new StringBuilder();
+              if (column != null && column.contains(":")) {
+                sb.append(column);
+              } else {
+                if (columnFamily != null) {
+                  sb.append(columnFamily);
+                  if (!columnFamily.endsWith(":")) {
+                    sb.append(":");
+                  }
+                  if (column != null) {
+                    sb.append(column);
+                  }
+                }
+              }
+              byte[][] split =
+                KeyValue.parseColumn(Bytes.toBytes(sb.toString()));
               put.add(split[0], split[1], t);
               updater.put(put);
               count++;

Modified: hadoop/hbase/trunk/src/test/org/apache/hadoop/hbase/client/TestOldAPITimestamp.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/test/org/apache/hadoop/hbase/client/TestOldAPITimestamp.java?rev=785453&r1=785452&r2=785453&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/test/org/apache/hadoop/hbase/client/TestOldAPITimestamp.java (original)
+++ hadoop/hbase/trunk/src/test/org/apache/hadoop/hbase/client/TestOldAPITimestamp.java Wed
Jun 17 00:06:44 2009
@@ -24,7 +24,6 @@
 import org.apache.hadoop.hbase.HColumnDescriptor;
 import org.apache.hadoop.hbase.HTableDescriptor;
 import org.apache.hadoop.hbase.TimestampTestBase;
-import org.apache.hadoop.hbase.util.Bytes;
 
 /**
  * Tests user specifiable time stamps putting, getting and scanning.  Also
@@ -32,7 +31,7 @@
  * run against an HRegion and against an HTable: i.e. both local and remote.
  */
 public class TestOldAPITimestamp extends HBaseClusterTestCase {
-  public static byte[] COLUMN_NAME = Bytes.toBytes("contents:");
+  public static String COLUMN_NAME = "contents:";
 
   /**
    * Basic test of timestamps.
@@ -64,9 +63,6 @@
    */
   private HTable createTable() throws IOException {
     HTableDescriptor desc = new HTableDescriptor(getName());
-    for (byte[] col: COLUMNS) {
-      desc.addFamily(new HColumnDescriptor(col));
-    }
     desc.addFamily(new HColumnDescriptor(COLUMN_NAME));
     HBaseAdmin admin = new HBaseAdmin(conf);
     admin.createTable(desc);

Modified: hadoop/hbase/trunk/src/test/org/apache/hadoop/hbase/client/TestTimestamp.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/test/org/apache/hadoop/hbase/client/TestTimestamp.java?rev=785453&r1=785452&r2=785453&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/test/org/apache/hadoop/hbase/client/TestTimestamp.java (original)
+++ hadoop/hbase/trunk/src/test/org/apache/hadoop/hbase/client/TestTimestamp.java Wed Jun
17 00:06:44 2009
@@ -24,7 +24,6 @@
 import org.apache.hadoop.hbase.HColumnDescriptor;
 import org.apache.hadoop.hbase.HTableDescriptor;
 import org.apache.hadoop.hbase.TimestampTestBase;
-import org.apache.hadoop.hbase.util.Bytes;
 
 /**
  * Tests user specifiable time stamps putting, getting and scanning.  Also
@@ -32,7 +31,7 @@
  * run against an HRegion and against an HTable: i.e. both local and remote.
  */
 public class TestTimestamp extends HBaseClusterTestCase {
-  public static byte[] COLUMN_NAME = Bytes.toBytes("contents:");
+  public static String COLUMN_NAME = "contents";
   
   /** constructor */
   public TestTimestamp() {
@@ -69,9 +68,6 @@
    */
   private HTable createTable() throws IOException {
     HTableDescriptor desc = new HTableDescriptor(getName());
-    for (byte[] col: COLUMNS) {
-      desc.addFamily(new HColumnDescriptor(col));
-    }
     desc.addFamily(new HColumnDescriptor(COLUMN_NAME));
     HBaseAdmin admin = new HBaseAdmin(conf);
     admin.createTable(desc);



Mime
View raw message