hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apurt...@apache.org
Subject svn commit: r1422310 - in /hbase/branches/0.94/src: main/java/org/apache/hadoop/hbase/rest/client/RemoteHTable.java test/java/org/apache/hadoop/hbase/rest/PerformanceEvaluation.java test/java/org/apache/hadoop/hbase/rest/client/TestRemoteTable.java
Date Sat, 15 Dec 2012 18:40:53 GMT
Author: apurtell
Date: Sat Dec 15 18:40:52 2012
New Revision: 1422310

URL: http://svn.apache.org/viewvc?rev=1422310&view=rev
Log:
HBASE-7359. [REST] 'accessToken' in RemoteHTable is vestigial

Modified:
    hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/rest/client/RemoteHTable.java
    hbase/branches/0.94/src/test/java/org/apache/hadoop/hbase/rest/PerformanceEvaluation.java
    hbase/branches/0.94/src/test/java/org/apache/hadoop/hbase/rest/client/TestRemoteTable.java

Modified: hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/rest/client/RemoteHTable.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/rest/client/RemoteHTable.java?rev=1422310&r1=1422309&r2=1422310&view=diff
==============================================================================
--- hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/rest/client/RemoteHTable.java
(original)
+++ hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/rest/client/RemoteHTable.java
Sat Dec 15 18:40:52 2012
@@ -72,7 +72,6 @@ public class RemoteHTable implements HTa
   final Client client;
   final Configuration conf;
   final byte[] name;
-  final String accessToken;
   final int maxRetries;
   final long sleepTime;
 
@@ -81,10 +80,6 @@ public class RemoteHTable implements HTa
       final long startTime, final long endTime, final int maxVersions) {
     StringBuffer sb = new StringBuffer();
     sb.append('/');
-    if (accessToken != null) {
-      sb.append(accessToken);
-      sb.append('/');
-    }
     sb.append(Bytes.toStringBinary(name));
     sb.append('/');
     sb.append(Bytes.toStringBinary(row));
@@ -210,7 +205,9 @@ public class RemoteHTable implements HTa
    * @param client
    * @param name
    * @param accessToken
+   * @deprecated accessToken is not used and will be removed
    */
+  @Deprecated
   public RemoteHTable(Client client, String name, String accessToken) {
     this(client, HBaseConfiguration.create(), Bytes.toBytes(name), accessToken);
   }
@@ -220,8 +217,20 @@ public class RemoteHTable implements HTa
    * @param client
    * @param conf
    * @param name
+   */
+  public RemoteHTable(Client client, Configuration conf, String name) {
+    this(client, conf, Bytes.toBytes(name), null);
+  }
+
+  /**
+   * Constructor
+   * @param client
+   * @param conf
+   * @param name
    * @param accessToken
+   * @deprecated accessToken is not used and will be removed
    */
+  @Deprecated
   public RemoteHTable(Client client, Configuration conf, String name,
       String accessToken) {
     this(client, conf, Bytes.toBytes(name), accessToken);
@@ -229,14 +238,28 @@ public class RemoteHTable implements HTa
 
   /**
    * Constructor
+   * @param client
    * @param conf
+   * @param name
    */
+  public RemoteHTable(Client client, Configuration conf, byte[] name) {
+    this(client, conf, name, null);
+  }
+
+  /**
+   * Constructor
+   * @param client
+   * @param conf
+   * @param name
+   * @param accessToken
+   * @deprecated accessToken is not used and will be removed
+   */
+  @Deprecated
   public RemoteHTable(Client client, Configuration conf, byte[] name,
       String accessToken) {
     this.client = client;
     this.conf = conf;
     this.name = name;
-    this.accessToken = accessToken;
     this.maxRetries = conf.getInt("hbase.rest.client.max.retries", 10);
     this.sleepTime = conf.getLong("hbase.rest.client.sleep", 1000);
   }
@@ -252,10 +275,6 @@ public class RemoteHTable implements HTa
   public HTableDescriptor getTableDescriptor() throws IOException {
     StringBuilder sb = new StringBuilder();
     sb.append('/');
-    if (accessToken != null) {
-      sb.append(accessToken);
-      sb.append('/');
-    }
     sb.append(Bytes.toStringBinary(name));
     sb.append('/');
     sb.append("schema");
@@ -367,10 +386,6 @@ public class RemoteHTable implements HTa
     CellSetModel model = buildModelFromPut(put);
     StringBuilder sb = new StringBuilder();
     sb.append('/');
-    if (accessToken != null) {
-      sb.append(accessToken);
-      sb.append('/');      
-    }
     sb.append(Bytes.toStringBinary(name));
     sb.append('/');
     sb.append(Bytes.toStringBinary(put.getRow()));
@@ -425,10 +440,6 @@ public class RemoteHTable implements HTa
     // build path for multiput
     StringBuilder sb = new StringBuilder();
     sb.append('/');
-    if (accessToken != null) {
-      sb.append(accessToken);
-      sb.append('/');      
-    }
     sb.append(Bytes.toStringBinary(name));
     sb.append("/$multiput"); // can be any nonexistent row
     for (int i = 0; i < maxRetries; i++) {
@@ -494,10 +505,6 @@ public class RemoteHTable implements HTa
       }
       StringBuffer sb = new StringBuffer();
       sb.append('/');
-      if (accessToken != null) {
-        sb.append(accessToken);
-        sb.append('/');
-      }
       sb.append(Bytes.toStringBinary(name));
       sb.append('/');
       sb.append("scanner");
@@ -658,10 +665,6 @@ public class RemoteHTable implements HTa
     CellSetModel model = buildModelFromPut(put);
     StringBuilder sb = new StringBuilder();
     sb.append('/');
-    if (accessToken != null) {
-      sb.append(accessToken);
-      sb.append('/');
-    }
     sb.append(Bytes.toStringBinary(name));
     sb.append('/');
     sb.append(Bytes.toStringBinary(put.getRow()));
@@ -697,10 +700,6 @@ public class RemoteHTable implements HTa
     CellSetModel model = buildModelFromPut(put);
     StringBuilder sb = new StringBuilder();
     sb.append('/');
-    if (accessToken != null) {
-      sb.append(accessToken);
-      sb.append('/');
-    }
     sb.append(Bytes.toStringBinary(name));
     sb.append('/');
     sb.append(Bytes.toStringBinary(row));

Modified: hbase/branches/0.94/src/test/java/org/apache/hadoop/hbase/rest/PerformanceEvaluation.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.94/src/test/java/org/apache/hadoop/hbase/rest/PerformanceEvaluation.java?rev=1422310&r1=1422309&r2=1422310&view=diff
==============================================================================
--- hbase/branches/0.94/src/test/java/org/apache/hadoop/hbase/rest/PerformanceEvaluation.java
(original)
+++ hbase/branches/0.94/src/test/java/org/apache/hadoop/hbase/rest/PerformanceEvaluation.java
Sat Dec 15 18:40:52 2012
@@ -114,7 +114,6 @@ public class PerformanceEvaluation  {
 
   protected Map<String, CmdDescriptor> commands = new TreeMap<String, CmdDescriptor>();
   protected static Cluster cluster = new Cluster();
-  protected static String accessToken = null;
 
   volatile Configuration conf;
   private boolean nomapred = false;
@@ -449,8 +448,7 @@ public class PerformanceEvaluation  {
    */
   private boolean checkTable() throws IOException {
     HTableDescriptor tableDescriptor = getTableDescriptor();
-    RemoteAdmin admin =
-      new RemoteAdmin(new Client(cluster), conf, accessToken);
+    RemoteAdmin admin = new RemoteAdmin(new Client(cluster), conf);
     if (!admin.isTableAvailable(tableDescriptor.getName())) {
       admin.createTable(tableDescriptor);
       return true;
@@ -714,8 +712,7 @@ public class PerformanceEvaluation  {
     }
     
     void testSetup() throws IOException {
-      this.table = new RemoteHTable(new Client(cluster), conf, tableName,
-        accessToken);
+      this.table = new RemoteHTable(new Client(cluster), conf, tableName);
     }
 
     void testTakedown()  throws IOException {
@@ -1133,7 +1130,6 @@ public class PerformanceEvaluation  {
     System.err.println();
     System.err.println("Options:");
     System.err.println(" host          String. Specify Stargate endpoint.");
-    System.err.println(" token         String. API access token.");
     System.err.println(" rows          Integer. Rows each client runs. Default: One million");
     System.err.println(" rowsPerPut    Integer. Rows each Stargate (multi)Put. Default: 100");
     System.err.println(" nomapred      (Flag) Run multiple clients using threads " +
@@ -1208,12 +1204,6 @@ public class PerformanceEvaluation  {
           continue;
         }
 
-        final String token = "--token=";
-        if (cmd.startsWith(token)) {
-          accessToken = cmd.substring(token.length());
-          continue;
-        }
-
         Class<? extends Test> cmdClass = determineCommandClass(cmd);
         if (cmdClass != null) {
           getArgs(i + 1, args);

Modified: hbase/branches/0.94/src/test/java/org/apache/hadoop/hbase/rest/client/TestRemoteTable.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.94/src/test/java/org/apache/hadoop/hbase/rest/client/TestRemoteTable.java?rev=1422310&r1=1422309&r2=1422310&view=diff
==============================================================================
--- hbase/branches/0.94/src/test/java/org/apache/hadoop/hbase/rest/client/TestRemoteTable.java
(original)
+++ hbase/branches/0.94/src/test/java/org/apache/hadoop/hbase/rest/client/TestRemoteTable.java
Sat Dec 15 18:40:52 2012
@@ -101,7 +101,7 @@ public class TestRemoteTable {
     remoteTable = new RemoteHTable(
       new Client(new Cluster().add("localhost", 
           REST_TEST_UTIL.getServletPort())),
-        TEST_UTIL.getConfiguration(), TABLE, null);
+        TEST_UTIL.getConfiguration(), TABLE);
   }
 
   @AfterClass



Mime
View raw message