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 Client client;
|
||||||
final Configuration conf;
|
final Configuration conf;
|
||||||
final byte[] name;
|
final byte[] name;
|
||||||
final String accessToken;
|
|
||||||
final int maxRetries;
|
final int maxRetries;
|
||||||
final long sleepTime;
|
final long sleepTime;
|
||||||
|
|
||||||
@ -87,10 +86,6 @@ public class RemoteHTable implements HTableInterface {
|
|||||||
final long startTime, final long endTime, final int maxVersions) {
|
final long startTime, final long endTime, final int maxVersions) {
|
||||||
StringBuffer sb = new StringBuffer();
|
StringBuffer sb = new StringBuffer();
|
||||||
sb.append('/');
|
sb.append('/');
|
||||||
if (accessToken != null) {
|
|
||||||
sb.append(accessToken);
|
|
||||||
sb.append('/');
|
|
||||||
}
|
|
||||||
sb.append(Bytes.toStringBinary(name));
|
sb.append(Bytes.toStringBinary(name));
|
||||||
sb.append('/');
|
sb.append('/');
|
||||||
sb.append(Bytes.toStringBinary(row));
|
sb.append(Bytes.toStringBinary(row));
|
||||||
@ -208,17 +203,7 @@ public class RemoteHTable implements HTableInterface {
|
|||||||
* @param name
|
* @param name
|
||||||
*/
|
*/
|
||||||
public RemoteHTable(Client client, String name) {
|
public RemoteHTable(Client client, String name) {
|
||||||
this(client, HBaseConfiguration.create(), Bytes.toBytes(name), null);
|
this(client, HBaseConfiguration.create(), Bytes.toBytes(name));
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructor
|
|
||||||
* @param client
|
|
||||||
* @param name
|
|
||||||
* @param accessToken
|
|
||||||
*/
|
|
||||||
public RemoteHTable(Client client, String name, String accessToken) {
|
|
||||||
this(client, HBaseConfiguration.create(), Bytes.toBytes(name), accessToken);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -226,23 +211,21 @@ public class RemoteHTable implements HTableInterface {
|
|||||||
* @param client
|
* @param client
|
||||||
* @param conf
|
* @param conf
|
||||||
* @param name
|
* @param name
|
||||||
* @param accessToken
|
|
||||||
*/
|
*/
|
||||||
public RemoteHTable(Client client, Configuration conf, String name,
|
public RemoteHTable(Client client, Configuration conf, String name) {
|
||||||
String accessToken) {
|
this(client, conf, Bytes.toBytes(name));
|
||||||
this(client, conf, Bytes.toBytes(name), accessToken);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
|
* @param client
|
||||||
* @param conf
|
* @param conf
|
||||||
|
* @param name
|
||||||
*/
|
*/
|
||||||
public RemoteHTable(Client client, Configuration conf, byte[] name,
|
public RemoteHTable(Client client, Configuration conf, byte[] name) {
|
||||||
String accessToken) {
|
|
||||||
this.client = client;
|
this.client = client;
|
||||||
this.conf = conf;
|
this.conf = conf;
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.accessToken = accessToken;
|
|
||||||
this.maxRetries = conf.getInt("hbase.rest.client.max.retries", 10);
|
this.maxRetries = conf.getInt("hbase.rest.client.max.retries", 10);
|
||||||
this.sleepTime = conf.getLong("hbase.rest.client.sleep", 1000);
|
this.sleepTime = conf.getLong("hbase.rest.client.sleep", 1000);
|
||||||
}
|
}
|
||||||
@ -258,10 +241,6 @@ public class RemoteHTable implements HTableInterface {
|
|||||||
public HTableDescriptor getTableDescriptor() throws IOException {
|
public HTableDescriptor getTableDescriptor() throws IOException {
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.append('/');
|
sb.append('/');
|
||||||
if (accessToken != null) {
|
|
||||||
sb.append(accessToken);
|
|
||||||
sb.append('/');
|
|
||||||
}
|
|
||||||
sb.append(Bytes.toStringBinary(name));
|
sb.append(Bytes.toStringBinary(name));
|
||||||
sb.append('/');
|
sb.append('/');
|
||||||
sb.append("schema");
|
sb.append("schema");
|
||||||
@ -371,10 +350,6 @@ public class RemoteHTable implements HTableInterface {
|
|||||||
CellSetModel model = buildModelFromPut(put);
|
CellSetModel model = buildModelFromPut(put);
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.append('/');
|
sb.append('/');
|
||||||
if (accessToken != null) {
|
|
||||||
sb.append(accessToken);
|
|
||||||
sb.append('/');
|
|
||||||
}
|
|
||||||
sb.append(Bytes.toStringBinary(name));
|
sb.append(Bytes.toStringBinary(name));
|
||||||
sb.append('/');
|
sb.append('/');
|
||||||
sb.append(Bytes.toStringBinary(put.getRow()));
|
sb.append(Bytes.toStringBinary(put.getRow()));
|
||||||
@ -429,10 +404,6 @@ public class RemoteHTable implements HTableInterface {
|
|||||||
// build path for multiput
|
// build path for multiput
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.append('/');
|
sb.append('/');
|
||||||
if (accessToken != null) {
|
|
||||||
sb.append(accessToken);
|
|
||||||
sb.append('/');
|
|
||||||
}
|
|
||||||
sb.append(Bytes.toStringBinary(name));
|
sb.append(Bytes.toStringBinary(name));
|
||||||
sb.append("/$multiput"); // can be any nonexistent row
|
sb.append("/$multiput"); // can be any nonexistent row
|
||||||
for (int i = 0; i < maxRetries; i++) {
|
for (int i = 0; i < maxRetries; i++) {
|
||||||
@ -498,10 +469,6 @@ public class RemoteHTable implements HTableInterface {
|
|||||||
}
|
}
|
||||||
StringBuffer sb = new StringBuffer();
|
StringBuffer sb = new StringBuffer();
|
||||||
sb.append('/');
|
sb.append('/');
|
||||||
if (accessToken != null) {
|
|
||||||
sb.append(accessToken);
|
|
||||||
sb.append('/');
|
|
||||||
}
|
|
||||||
sb.append(Bytes.toStringBinary(name));
|
sb.append(Bytes.toStringBinary(name));
|
||||||
sb.append('/');
|
sb.append('/');
|
||||||
sb.append("scanner");
|
sb.append("scanner");
|
||||||
@ -656,10 +623,6 @@ public class RemoteHTable implements HTableInterface {
|
|||||||
CellSetModel model = buildModelFromPut(put);
|
CellSetModel model = buildModelFromPut(put);
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.append('/');
|
sb.append('/');
|
||||||
if (accessToken != null) {
|
|
||||||
sb.append(accessToken);
|
|
||||||
sb.append('/');
|
|
||||||
}
|
|
||||||
sb.append(Bytes.toStringBinary(name));
|
sb.append(Bytes.toStringBinary(name));
|
||||||
sb.append('/');
|
sb.append('/');
|
||||||
sb.append(Bytes.toStringBinary(put.getRow()));
|
sb.append(Bytes.toStringBinary(put.getRow()));
|
||||||
@ -695,10 +658,6 @@ public class RemoteHTable implements HTableInterface {
|
|||||||
CellSetModel model = buildModelFromPut(put);
|
CellSetModel model = buildModelFromPut(put);
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.append('/');
|
sb.append('/');
|
||||||
if (accessToken != null) {
|
|
||||||
sb.append(accessToken);
|
|
||||||
sb.append('/');
|
|
||||||
}
|
|
||||||
sb.append(Bytes.toStringBinary(name));
|
sb.append(Bytes.toStringBinary(name));
|
||||||
sb.append('/');
|
sb.append('/');
|
||||||
sb.append(Bytes.toStringBinary(row));
|
sb.append(Bytes.toStringBinary(row));
|
||||||
|
@ -113,7 +113,6 @@ public class PerformanceEvaluation {
|
|||||||
|
|
||||||
protected Map<String, CmdDescriptor> commands = new TreeMap<String, CmdDescriptor>();
|
protected Map<String, CmdDescriptor> commands = new TreeMap<String, CmdDescriptor>();
|
||||||
protected static Cluster cluster = new Cluster();
|
protected static Cluster cluster = new Cluster();
|
||||||
protected static String accessToken = null;
|
|
||||||
|
|
||||||
volatile Configuration conf;
|
volatile Configuration conf;
|
||||||
private boolean nomapred = false;
|
private boolean nomapred = false;
|
||||||
@ -448,8 +447,7 @@ public class PerformanceEvaluation {
|
|||||||
*/
|
*/
|
||||||
private boolean checkTable() throws IOException {
|
private boolean checkTable() throws IOException {
|
||||||
HTableDescriptor tableDescriptor = getTableDescriptor();
|
HTableDescriptor tableDescriptor = getTableDescriptor();
|
||||||
RemoteAdmin admin =
|
RemoteAdmin admin = new RemoteAdmin(new Client(cluster), conf);
|
||||||
new RemoteAdmin(new Client(cluster), conf, accessToken);
|
|
||||||
if (!admin.isTableAvailable(tableDescriptor.getName())) {
|
if (!admin.isTableAvailable(tableDescriptor.getName())) {
|
||||||
admin.createTable(tableDescriptor);
|
admin.createTable(tableDescriptor);
|
||||||
return true;
|
return true;
|
||||||
@ -713,8 +711,7 @@ public class PerformanceEvaluation {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void testSetup() throws IOException {
|
void testSetup() throws IOException {
|
||||||
this.table = new RemoteHTable(new Client(cluster), conf, tableName,
|
this.table = new RemoteHTable(new Client(cluster), conf, tableName);
|
||||||
accessToken);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void testTakedown() throws IOException {
|
void testTakedown() throws IOException {
|
||||||
@ -1132,7 +1129,6 @@ public class PerformanceEvaluation {
|
|||||||
System.err.println();
|
System.err.println();
|
||||||
System.err.println("Options:");
|
System.err.println("Options:");
|
||||||
System.err.println(" host String. Specify Stargate endpoint.");
|
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(" rows Integer. Rows each client runs. Default: One million");
|
||||||
System.err.println(" rowsPerPut Integer. Rows each Stargate (multi)Put. Default: 100");
|
System.err.println(" rowsPerPut Integer. Rows each Stargate (multi)Put. Default: 100");
|
||||||
System.err.println(" nomapred (Flag) Run multiple clients using threads " +
|
System.err.println(" nomapred (Flag) Run multiple clients using threads " +
|
||||||
@ -1207,12 +1203,6 @@ public class PerformanceEvaluation {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
final String token = "--token=";
|
|
||||||
if (cmd.startsWith(token)) {
|
|
||||||
accessToken = cmd.substring(token.length());
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
Class<? extends Test> cmdClass = determineCommandClass(cmd);
|
Class<? extends Test> cmdClass = determineCommandClass(cmd);
|
||||||
if (cmdClass != null) {
|
if (cmdClass != null) {
|
||||||
getArgs(i + 1, args);
|
getArgs(i + 1, args);
|
||||||
|
@ -96,7 +96,7 @@ public class TestRemoteTable {
|
|||||||
remoteTable = new RemoteHTable(
|
remoteTable = new RemoteHTable(
|
||||||
new Client(new Cluster().add("localhost",
|
new Client(new Cluster().add("localhost",
|
||||||
REST_TEST_UTIL.getServletPort())),
|
REST_TEST_UTIL.getServletPort())),
|
||||||
TEST_UTIL.getConfiguration(), TABLE, null);
|
TEST_UTIL.getConfiguration(), TABLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@AfterClass
|
@AfterClass
|
||||||
|
Loading…
x
Reference in New Issue
Block a user