本文整理汇总了Java中org.apache.hadoop.hbase.rest.model.TableListModel类的典型用法代码示例。如果您正苦于以下问题:Java TableListModel类的具体用法?Java TableListModel怎么用?Java TableListModel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TableListModel类属于org.apache.hadoop.hbase.rest.model包,在下文中一共展示了TableListModel类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: setUpBeforeClass
import org.apache.hadoop.hbase.rest.model.TableListModel; //导入依赖的package包/类
@BeforeClass
public static void setUpBeforeClass() throws Exception {
conf = TEST_UTIL.getConfiguration();
TEST_UTIL.startMiniCluster();
REST_TEST_UTIL.startServletContainer(conf);
client = new Client(new Cluster().add("localhost",
REST_TEST_UTIL.getServletPort()));
testNamespacesInstanceModel = new TestNamespacesInstanceModel();
context = JAXBContext.newInstance(NamespacesInstanceModel.class, TableListModel.class);
jsonMapper = new JacksonProvider()
.locateMapper(NamespacesInstanceModel.class, MediaType.APPLICATION_JSON_TYPE);
NAMESPACE1_PROPS.put("key1", "value1");
NAMESPACE2_PROPS.put("key2a", "value2a");
NAMESPACE2_PROPS.put("key2b", "value2b");
NAMESPACE3_PROPS.put("key3", "value3");
NAMESPACE4_PROPS.put("key4a", "value4a");
NAMESPACE4_PROPS.put("key4b", "value4b");
}
开发者ID:fengchen8086,项目名称:ditb,代码行数:19,代码来源:TestNamespacesInstanceResource.java
示例2: setUpBeforeClass
import org.apache.hadoop.hbase.rest.model.TableListModel; //导入依赖的package包/类
@BeforeClass
public static void setUpBeforeClass() throws Exception {
conf = TEST_UTIL.getConfiguration();
TEST_UTIL.startMiniCluster();
REST_TEST_UTIL.startServletContainer(conf);
client = new Client(new Cluster().add("localhost",
REST_TEST_UTIL.getServletPort()));
testNamespacesInstanceModel = new TestNamespacesInstanceModel();
context = JAXBContext.newInstance(NamespacesInstanceModel.class, TableListModel.class);
jsonMapper = new JacksonJaxbJsonProvider()
.locateMapper(NamespacesInstanceModel.class, MediaType.APPLICATION_JSON_TYPE);
NAMESPACE1_PROPS.put("key1", "value1");
NAMESPACE2_PROPS.put("key2a", "value2a");
NAMESPACE2_PROPS.put("key2b", "value2b");
NAMESPACE3_PROPS.put("key3", "value3");
NAMESPACE4_PROPS.put("key4a", "value4a");
NAMESPACE4_PROPS.put("key4b", "value4b");
}
开发者ID:apache,项目名称:hbase,代码行数:19,代码来源:TestNamespacesInstanceResource.java
示例3: getTableList
import org.apache.hadoop.hbase.rest.model.TableListModel; //导入依赖的package包/类
/**
* @return string representing the cluster's version
* @throws IOException
* if the endpoint does not exist, there is a timeout, or some other
* general failure mode
*/
public TableListModel getTableList() throws IOException {
StringBuilder path = new StringBuilder();
path.append('/');
if (accessToken != null) {
path.append(accessToken);
path.append('/');
}
int code = 0;
for (int i = 0; i < maxRetries; i++) {
// Response response = client.get(path.toString(),
// Constants.MIMETYPE_XML);
Response response = client.get(path.toString(),
Constants.MIMETYPE_PROTOBUF);
code = response.getCode();
switch (code) {
case 200:
TableListModel t = new TableListModel();
return (TableListModel) t.getObjectFromMessage(response.getBody());
case 404:
throw new IOException("Table list not found");
case 509:
try {
Thread.sleep(sleepTime);
} catch (InterruptedException e) {
throw (InterruptedIOException)new InterruptedIOException().initCause(e);
}
break;
default:
throw new IOException("get request to " + path.toString()
+ " request returned " + code);
}
}
throw new IOException("get request to " + path.toString()
+ " request timed out");
}
开发者ID:fengchen8086,项目名称:ditb,代码行数:44,代码来源:RemoteAdmin.java
示例4: getTableList
import org.apache.hadoop.hbase.rest.model.TableListModel; //导入依赖的package包/类
private final TableListModel getTableList() throws IOException {
TableListModel tableList = new TableListModel();
TableName[] tableNames = servlet.getAdmin().listTableNames();
for (TableName name: tableNames) {
tableList.add(new TableModel(name.getNameAsString()));
}
return tableList;
}
开发者ID:fengchen8086,项目名称:ditb,代码行数:9,代码来源:RootResource.java
示例5: checkTableList
import org.apache.hadoop.hbase.rest.model.TableListModel; //导入依赖的package包/类
private static void checkTableList(TableListModel model) {
boolean found = false;
Iterator<TableModel> tables = model.getTables().iterator();
assertTrue(tables.hasNext());
while (tables.hasNext()) {
TableModel table = tables.next();
if (table.getName().equals(TABLE.getNameAsString())) {
found = true;
break;
}
}
assertTrue(found);
}
开发者ID:fengchen8086,项目名称:ditb,代码行数:14,代码来源:TestTableResource.java
示例6: testTableListXML
import org.apache.hadoop.hbase.rest.model.TableListModel; //导入依赖的package包/类
@Test
public void testTableListXML() throws IOException, JAXBException {
Response response = client.get("/", Constants.MIMETYPE_XML);
assertEquals(response.getCode(), 200);
assertEquals(Constants.MIMETYPE_XML, response.getHeader("content-type"));
TableListModel model = (TableListModel)
context.createUnmarshaller()
.unmarshal(new ByteArrayInputStream(response.getBody()));
checkTableList(model);
}
开发者ID:fengchen8086,项目名称:ditb,代码行数:11,代码来源:TestTableResource.java
示例7: getTableList
import org.apache.hadoop.hbase.rest.model.TableListModel; //导入依赖的package包/类
/**
* @return string representing the cluster's version
* @throws IOEXception
* if the endpoint does not exist, there is a timeout, or some other
* general failure mode
*/
public TableListModel getTableList() throws IOException {
StringBuilder path = new StringBuilder();
path.append('/');
if (accessToken != null) {
path.append(accessToken);
path.append('/');
}
int code = 0;
for (int i = 0; i < maxRetries; i++) {
// Response response = client.get(path.toString(),
// Constants.MIMETYPE_XML);
Response response = client.get(path.toString(),
Constants.MIMETYPE_PROTOBUF);
code = response.getCode();
switch (code) {
case 200:
TableListModel t = new TableListModel();
return (TableListModel) t.getObjectFromMessage(response.getBody());
case 404:
throw new IOException("Table list not found");
case 509:
try {
Thread.sleep(sleepTime);
} catch (InterruptedException e) {
}
break;
default:
throw new IOException("get request to " + path.toString()
+ " request returned " + code);
}
}
throw new IOException("get request to " + path.toString()
+ " request timed out");
}
开发者ID:fengchen8086,项目名称:LCIndex-HBase-0.94.16,代码行数:43,代码来源:RemoteAdmin.java
示例8: getTableList
import org.apache.hadoop.hbase.rest.model.TableListModel; //导入依赖的package包/类
private final TableListModel getTableList() throws IOException {
TableListModel tableList = new TableListModel();
String[] tableNames = servlet.getAdmin().getTableNames();
for (String name: tableNames) {
tableList.add(new TableModel(name));
}
return tableList;
}
开发者ID:fengchen8086,项目名称:LCIndex-HBase-0.94.16,代码行数:9,代码来源:RootResource.java
示例9: checkTableList
import org.apache.hadoop.hbase.rest.model.TableListModel; //导入依赖的package包/类
private static void checkTableList(TableListModel model) {
boolean found = false;
Iterator<TableModel> tables = model.getTables().iterator();
assertTrue(tables.hasNext());
while (tables.hasNext()) {
TableModel table = tables.next();
if (table.getName().equals(TABLE)) {
found = true;
break;
}
}
assertTrue(found);
}
开发者ID:fengchen8086,项目名称:LCIndex-HBase-0.94.16,代码行数:14,代码来源:TestTableResource.java
示例10: testTableListXML
import org.apache.hadoop.hbase.rest.model.TableListModel; //导入依赖的package包/类
@Test
public void testTableListXML() throws IOException, JAXBException {
Response response = client.get("/", Constants.MIMETYPE_XML);
assertEquals(200, response.getCode());
assertEquals(Constants.MIMETYPE_XML, response.getHeader("content-type"));
TableListModel model = (TableListModel)
context.createUnmarshaller()
.unmarshal(new ByteArrayInputStream(response.getBody()));
checkTableList(model);
}
开发者ID:apache,项目名称:hbase,代码行数:11,代码来源:TestTableResource.java
示例11: getTableList
import org.apache.hadoop.hbase.rest.model.TableListModel; //导入依赖的package包/类
private final TableListModel getTableList() throws IOException {
TableListModel tableList = new TableListModel();
HBaseAdmin admin = new HBaseAdmin(servlet.getConfiguration());
HTableDescriptor[] list = admin.listTables();
for (HTableDescriptor htd: list) {
tableList.add(new TableModel(htd.getNameAsString()));
}
return tableList;
}
开发者ID:lifeng5042,项目名称:RStore,代码行数:10,代码来源:RootResource.java
示例12: getTableList
import org.apache.hadoop.hbase.rest.model.TableListModel; //导入依赖的package包/类
/**
* @return string representing the cluster's version
* @throws IOEXception
* if the endpoint does not exist, there is a timeout, or some other
* general failure mode
*/
public TableListModel getTableList() throws IOException {
StringBuilder path = new StringBuilder();
path.append('/');
if (accessToken != null) {
path.append(accessToken);
path.append('/');
}
int code = 0;
for (int i = 0; i < maxRetries; i++) {
// Response response = client.get(path.toString(),
// Constants.MIMETYPE_XML);
Response response = client.get(path.toString(),
Constants.MIMETYPE_PROTOBUF);
code = response.getCode();
switch (code) {
case 200:
TableListModel t = new TableListModel();
return (TableListModel) t.getObjectFromMessage(response.getBody());
case 404:
throw new IOException("Table list not found");
case 509:
try {
Thread.sleep(sleepTime);
} catch (InterruptedException e) {
throw (InterruptedIOException)new InterruptedIOException().initCause(e);
}
break;
default:
throw new IOException("get request to " + path.toString()
+ " request returned " + code);
}
}
throw new IOException("get request to " + path.toString()
+ " request timed out");
}
开发者ID:shenli-uiuc,项目名称:PyroDB,代码行数:44,代码来源:RemoteAdmin.java
示例13: getTableList
import org.apache.hadoop.hbase.rest.model.TableListModel; //导入依赖的package包/类
private final TableListModel getTableList() throws IOException {
TableListModel tableList = new TableListModel();
HTableDescriptor[] list = servlet.getAdmin().listTables();
for (HTableDescriptor htd: list) {
tableList.add(new TableModel(htd.getNameAsString()));
}
return tableList;
}
开发者ID:zwqjsj0404,项目名称:HBase-Research,代码行数:9,代码来源:RootResource.java
注:本文中的org.apache.hadoop.hbase.rest.model.TableListModel类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论