@Test public void testCreateTable() throws Exception { assertFalse(remoteAdmin.isTableAvailable(TABLE_1)); remoteAdmin.createTable(DESC_1); assertTrue(remoteAdmin.isTableAvailable(TABLE_1)); }
public void createTable(HTableDescriptor desc) throws IOException { TableSchemaModel model = new TableSchemaModel(desc); StringBuilder sb = new StringBuilder(); sb.append('/'); if (accessToken != null) { sb.append(accessToken); sb.append('/'); } sb.append(Bytes.toStringBinary(desc.getName())); sb.append('/'); sb.append("schema"); int code = 0; for (int i = 0; i < maxRetries; i++) { Response response = client.put(sb.toString(), Constants.MIMETYPE_PROTOBUF, model.createProtobufOutput()); code = response.getCode(); switch (code) { case 201: return; case 509: try { Thread.sleep(sleepTime); } catch (InterruptedException e) { } break; default: throw new IOException("create request returned " + code); } } throw new IOException("create request timed out"); }
RemoteAdmin { public void createTable(HTableDescriptor desc) throws IOException { TableSchemaModel model = new TableSchemaModel(desc); StringBuilder sb = new StringBuilder(); sb.append('/'); if (accessToken != null) { sb.append(accessToken); sb.append('/'); } sb.append(Bytes.toStringBinary(desc.getName())); sb.append('/'); sb.append("schema"); int code = 0; for (int i = 0; i < maxRetries; i++) { Response response = client.put(sb.toString(), Constants.MIMETYPE_PROTOBUF, model.createProtobufOutput()); code = response.getCode(); switch (code) { case 201: return; case 509: try { Thread.sleep(sleepTime); } catch (InterruptedException e) { } break; default: throw new IOException("create request returned " + code); } } throw new IOException("create request timed out"); } }
RemoteAdmin { public void createTable(HTableDescriptor desc) throws IOException { TableSchemaModel model = new TableSchemaModel(desc); StringBuilder sb = new StringBuilder(); sb.append('/'); if (accessToken != null) { sb.append(accessToken); sb.append('/'); } sb.append(Bytes.toStringBinary(desc.getName())); sb.append('/'); sb.append("schema"); int code = 0; for (int i = 0; i < maxRetries; i++) { Response response = client.put(sb.toString(), Constants.MIMETYPE_PROTOBUF, model.createProtobufOutput()); code = response.getCode(); switch (code) { case 201: return; case 509: try { Thread.sleep(sleepTime); } catch (InterruptedException e) { } break; default: throw new IOException("create request returned " + code); } } throw new IOException("create request timed out"); } RemoteAdmin(Client client, Configuration conf);  RemoteAdmin(Client client, Configuration conf, String accessToken); }
RemoteAdmin { public void createTable(HTableDescriptor desc) throws IOException { TableSchemaModel model = new TableSchemaModel(desc); StringBuilder sb = new StringBuilder(); sb.append('/'); if (accessToken != null) { sb.append(accessToken); sb.append('/'); } sb.append(Bytes.toStringBinary(desc.getName())); sb.append('/'); sb.append("schema"); int code = 0; for (int i = 0; i < maxRetries; i++) { Response response = client.put(sb.toString(), Constants.MIMETYPE_PROTOBUF, model.createProtobufOutput()); code = response.getCode(); switch (code) { case 201: return; case 509: try { Thread.sleep(sleepTime); } catch (InterruptedException e) { } break; default: throw new IOException("create request returned " + code); } } throw new IOException("create request timed out"); } RemoteAdmin(Client client, Configuration conf);  RemoteAdmin(Client client, Configuration conf, String accessToken); boolean isTableAvailable(String tableName); boolean isTableAvailable(byte[] tableName); void createTable(HTableDescriptor desc); void deleteTable(final String tableName); void deleteTable(final byte [] tableName); }
RemoteAdmin { public void createTable(HTableDescriptor desc) throws IOException { TableSchemaModel model = new TableSchemaModel(desc); StringBuilder sb = new StringBuilder(); sb.append('/'); if (accessToken != null) { sb.append(accessToken); sb.append('/'); } sb.append(Bytes.toStringBinary(desc.getName())); sb.append('/'); sb.append("schema"); int code = 0; for (int i = 0; i < maxRetries; i++) { Response response = client.put(sb.toString(), Constants.MIMETYPE_PROTOBUF, model.createProtobufOutput()); code = response.getCode(); switch (code) { case 201: return; case 509: try { Thread.sleep(sleepTime); } catch (InterruptedException e) { } break; default: throw new IOException("create request returned " + code); } } throw new IOException("create request timed out"); } RemoteAdmin(Client client, Configuration conf);  RemoteAdmin(Client client, Configuration conf, String accessToken); boolean isTableAvailable(String tableName); boolean isTableAvailable(byte[] tableName); void createTable(HTableDescriptor desc); void deleteTable(final String tableName); void deleteTable(final byte [] tableName);  }