HBASE-7359. [REST] 'accessToken' in RemoteHTable is vestigial
git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1422158 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
c9a360e360
commit
2e3102f703
|
@ -78,7 +78,6 @@ public class RemoteHTable implements HTableInterface {
|
|||
final Client client;
|
||||
final Configuration conf;
|
||||
final byte[] name;
|
||||
final String accessToken;
|
||||
final int maxRetries;
|
||||
final long sleepTime;
|
||||
|
||||
|
@ -87,10 +86,6 @@ public class RemoteHTable implements HTableInterface {
|
|||
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));
|
||||
|
@ -208,17 +203,7 @@ public class RemoteHTable implements HTableInterface {
|
|||
* @param name
|
||||
*/
|
||||
public RemoteHTable(Client client, String name) {
|
||||
this(client, HBaseConfiguration.create(), Bytes.toBytes(name), null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* @param client
|
||||
* @param name
|
||||
* @param accessToken
|
||||
*/
|
||||
public RemoteHTable(Client client, String name, String accessToken) {
|
||||
this(client, HBaseConfiguration.create(), Bytes.toBytes(name), accessToken);
|
||||
this(client, HBaseConfiguration.create(), Bytes.toBytes(name));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -226,23 +211,21 @@ public class RemoteHTable implements HTableInterface {
|
|||
* @param client
|
||||
* @param conf
|
||||
* @param name
|
||||
* @param accessToken
|
||||
*/
|
||||
public RemoteHTable(Client client, Configuration conf, String name,
|
||||
String accessToken) {
|
||||
this(client, conf, Bytes.toBytes(name), accessToken);
|
||||
public RemoteHTable(Client client, Configuration conf, String name) {
|
||||
this(client, conf, Bytes.toBytes(name));
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* @param client
|
||||
* @param conf
|
||||
* @param name
|
||||
*/
|
||||
public RemoteHTable(Client client, Configuration conf, byte[] name,
|
||||
String accessToken) {
|
||||
public RemoteHTable(Client client, Configuration conf, byte[] name) {
|
||||
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);
|
||||
}
|
||||
|
@ -258,10 +241,6 @@ public class RemoteHTable implements HTableInterface {
|
|||
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");
|
||||
|
@ -371,10 +350,6 @@ public class RemoteHTable implements HTableInterface {
|
|||
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()));
|
||||
|
@ -429,10 +404,6 @@ public class RemoteHTable implements HTableInterface {
|
|||
// 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++) {
|
||||
|
@ -498,10 +469,6 @@ public class RemoteHTable implements HTableInterface {
|
|||
}
|
||||
StringBuffer sb = new StringBuffer();
|
||||
sb.append('/');
|
||||
if (accessToken != null) {
|
||||
sb.append(accessToken);
|
||||
sb.append('/');
|
||||
}
|
||||
sb.append(Bytes.toStringBinary(name));
|
||||
sb.append('/');
|
||||
sb.append("scanner");
|
||||
|
@ -656,10 +623,6 @@ public class RemoteHTable implements HTableInterface {
|
|||
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()));
|
||||
|
@ -695,10 +658,6 @@ public class RemoteHTable implements HTableInterface {
|
|||
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));
|
||||
|
|
|
@ -113,7 +113,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;
|
||||
|
@ -448,8 +447,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;
|
||||
|
@ -713,8 +711,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 {
|
||||
|
@ -1132,7 +1129,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 " +
|
||||
|
@ -1207,12 +1203,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);
|
||||
|
|
|
@ -96,7 +96,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
|
||||
|
|
Loading…
Reference in New Issue