• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Client类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.hadoop.hbase.rest.client.Client的典型用法代码示例。如果您正苦于以下问题:Java Client类的具体用法?Java Client怎么用?Java Client使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Client类属于org.apache.hadoop.hbase.rest.client包,在下文中一共展示了Client类的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: setUpBeforeClass

import org.apache.hadoop.hbase.rest.client.Client; //导入依赖的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()));
  context = JAXBContext.newInstance(
    CellModel.class,
    CellSetModel.class,
    RowModel.class,
    ScannerModel.class);
  marshaller = context.createMarshaller();
  unmarshaller = context.createUnmarshaller();
  Admin admin = TEST_UTIL.getHBaseAdmin();
  if (admin.tableExists(TABLE)) {
    return;
  }
  HTableDescriptor htd = new HTableDescriptor(TABLE);
  htd.addFamily(new HColumnDescriptor(CFA));
  htd.addFamily(new HColumnDescriptor(CFB));
  admin.createTable(htd);
  expectedRows1 = insertData(TEST_UTIL.getConfiguration(), TABLE, COLUMN_1, 1.0);
  expectedRows2 = insertData(TEST_UTIL.getConfiguration(), TABLE, COLUMN_2, 0.5);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:26,代码来源:TestScannerResource.java


示例2: setUpBeforeClass

import org.apache.hadoop.hbase.rest.client.Client; //导入依赖的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


示例3: setUpBeforeClass

import org.apache.hadoop.hbase.rest.client.Client; //导入依赖的package包/类
@BeforeClass
public static void setUpBeforeClass() throws Exception {
  conf = TEST_UTIL.getConfiguration();
  TEST_UTIL.startMiniCluster();
  REST_TEST_UTIL.startServletContainer(conf);
  context = JAXBContext.newInstance(
          CellModel.class,
          CellSetModel.class,
          RowModel.class);
  marshaller = context.createMarshaller();
  unmarshaller = context.createUnmarshaller();
  client = new Client(new Cluster().add("localhost", REST_TEST_UTIL.getServletPort()));
  Admin admin = TEST_UTIL.getHBaseAdmin();
  if (admin.tableExists(TABLE)) {
    return;
  }
  HTableDescriptor htd = new HTableDescriptor(TABLE);
  htd.addFamily(new HColumnDescriptor(CFA));
  htd.addFamily(new HColumnDescriptor(CFB));
  admin.createTable(htd);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:22,代码来源:TestMultiRowResource.java


示例4: setUpBeforeClass

import org.apache.hadoop.hbase.rest.client.Client; //导入依赖的package包/类
@BeforeClass
public static void setUpBeforeClass() throws Exception {
  conf = TEST_UTIL.getConfiguration();
  conf.set(Constants.CUSTOM_FILTERS, "CustomFilter:" + CustomFilter.class.getName()); 
  TEST_UTIL.startMiniCluster();
  REST_TEST_UTIL.startServletContainer(conf);
  client = new Client(new Cluster().add("localhost",
    REST_TEST_UTIL.getServletPort()));
  Admin admin = TEST_UTIL.getHBaseAdmin();
  if (!admin.tableExists(TABLE)) {
  HTableDescriptor htd = new HTableDescriptor(TABLE);
  htd.addFamily(new HColumnDescriptor(CFA));
  htd.addFamily(new HColumnDescriptor(CFB));
  admin.createTable(htd);
  expectedRows1 = TestScannerResource.insertData(conf, TABLE, COLUMN_1, 1.0);
  expectedRows2 = TestScannerResource.insertData(conf, TABLE, COLUMN_2, 0.5);
  }
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:19,代码来源:TestTableScan.java


示例5: setUpBeforeClass

import org.apache.hadoop.hbase.rest.client.Client; //导入依赖的package包/类
@BeforeClass
public static void setUpBeforeClass() throws Exception {
  conf = TEST_UTIL.getConfiguration();
  TEST_UTIL.startMiniCluster(3);
  REST_TEST_UTIL.startServletContainer(conf);
  context = JAXBContext.newInstance(
      CellModel.class,
      CellSetModel.class,
      RowModel.class);
  xmlMarshaller = context.createMarshaller();
  xmlUnmarshaller = context.createUnmarshaller();
  jsonMapper = new JacksonProvider()
  .locateMapper(CellSetModel.class, MediaType.APPLICATION_JSON_TYPE);
  client = new Client(new Cluster().add("localhost",
    REST_TEST_UTIL.getServletPort()));
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:17,代码来源:RowResourceBase.java


示例6: setUpBeforeClass

import org.apache.hadoop.hbase.rest.client.Client; //导入依赖的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()));
  context = JAXBContext.newInstance(
    CellModel.class,
    CellSetModel.class,
    RowModel.class,
    ScannerModel.class);
  marshaller = context.createMarshaller();
  unmarshaller = context.createUnmarshaller();
  HBaseAdmin admin = TEST_UTIL.getHBaseAdmin();
  if (admin.tableExists(TABLE)) {
    return;
  }
  HTableDescriptor htd = new HTableDescriptor(TABLE);
  htd.addFamily(new HColumnDescriptor(CFA));
  htd.addFamily(new HColumnDescriptor(CFB));
  admin.createTable(htd);
  expectedRows1 = insertData(TABLE, COLUMN_1, 1.0);
  expectedRows2 = insertData(TABLE, COLUMN_2, 0.5);
}
 
开发者ID:fengchen8086,项目名称:LCIndex-HBase-0.94.16,代码行数:26,代码来源:TestScannerResource.java


示例7: setUpBeforeClass

import org.apache.hadoop.hbase.rest.client.Client; //导入依赖的package包/类
@BeforeClass
public static void setUpBeforeClass() throws Exception {
  conf = TEST_UTIL.getConfiguration();
  TEST_UTIL.startMiniCluster();
  REST_TEST_UTIL.startServletContainer(conf);
  context = JAXBContext.newInstance(
          CellModel.class,
          CellSetModel.class,
          RowModel.class);
  marshaller = context.createMarshaller();
  unmarshaller = context.createUnmarshaller();
  client = new Client(new Cluster().add("localhost", REST_TEST_UTIL.getServletPort()));
  HBaseAdmin admin = TEST_UTIL.getHBaseAdmin();
  if (admin.tableExists(TABLE)) {
    return;
  }
  HTableDescriptor htd = new HTableDescriptor(TABLE);
  htd.addFamily(new HColumnDescriptor(CFA));
  htd.addFamily(new HColumnDescriptor(CFB));
  admin.createTable(htd);
}
 
开发者ID:fengchen8086,项目名称:LCIndex-HBase-0.94.16,代码行数:22,代码来源:TestMultiRowResource.java


示例8: setUpBeforeClass

import org.apache.hadoop.hbase.rest.client.Client; //导入依赖的package包/类
@BeforeClass
public static void setUpBeforeClass() throws Exception {
  conf = TEST_UTIL.getConfiguration();
  TEST_UTIL.startMiniCluster(3);
  REST_TEST_UTIL.startServletContainer(conf);
  context = JAXBContext.newInstance(
      CellModel.class,
      CellSetModel.class,
      RowModel.class);
  marshaller = context.createMarshaller();
  unmarshaller = context.createUnmarshaller();
  client = new Client(new Cluster().add("localhost", 
    REST_TEST_UTIL.getServletPort()));
  HBaseAdmin admin = TEST_UTIL.getHBaseAdmin();
  if (admin.tableExists(TABLE)) {
    return;
  }
  HTableDescriptor htd = new HTableDescriptor(TABLE);
  htd.addFamily(new HColumnDescriptor(CFA));
  htd.addFamily(new HColumnDescriptor(CFB));
  admin.createTable(htd);
}
 
开发者ID:fengchen8086,项目名称:LCIndex-HBase-0.94.16,代码行数:23,代码来源:TestRowResource.java


示例9: setUpBeforeClass

import org.apache.hadoop.hbase.rest.client.Client; //导入依赖的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()));
  context = JAXBContext.newInstance(
    CellModel.class,
    CellSetModel.class,
    RowModel.class,
    ScannerModel.class);
  marshaller = context.createMarshaller();
  unmarshaller = context.createUnmarshaller();
  HBaseAdmin admin = TEST_UTIL.getHBaseAdmin();
  if (admin.tableExists(TABLE)) {
    return;
  }
  HTableDescriptor htd = new HTableDescriptor(TableName.valueOf(TABLE));
  htd.addFamily(new HColumnDescriptor(CFA));
  htd.addFamily(new HColumnDescriptor(CFB));
  admin.createTable(htd);
  expectedRows1 = insertData(TEST_UTIL.getConfiguration(), TABLE, COLUMN_1, 1.0);
  expectedRows2 = insertData(TEST_UTIL.getConfiguration(), TABLE, COLUMN_2, 0.5);
}
 
开发者ID:tenggyut,项目名称:HIndex,代码行数:26,代码来源:TestScannerResource.java


示例10: setUpBeforeClass

import org.apache.hadoop.hbase.rest.client.Client; //导入依赖的package包/类
@BeforeClass
public static void setUpBeforeClass() throws Exception {
  conf = TEST_UTIL.getConfiguration();
  TEST_UTIL.startMiniCluster();
  REST_TEST_UTIL.startServletContainer(conf);
  context = JAXBContext.newInstance(
          CellModel.class,
          CellSetModel.class,
          RowModel.class);
  marshaller = context.createMarshaller();
  unmarshaller = context.createUnmarshaller();
  client = new Client(new Cluster().add("localhost", REST_TEST_UTIL.getServletPort()));
  HBaseAdmin admin = TEST_UTIL.getHBaseAdmin();
  if (admin.tableExists(TABLE)) {
    return;
  }
  HTableDescriptor htd = new HTableDescriptor(TableName.valueOf(TABLE));
  htd.addFamily(new HColumnDescriptor(CFA));
  htd.addFamily(new HColumnDescriptor(CFB));
  admin.createTable(htd);
}
 
开发者ID:tenggyut,项目名称:HIndex,代码行数:22,代码来源:TestMultiRowResource.java


示例11: setUpBeforeClass

import org.apache.hadoop.hbase.rest.client.Client; //导入依赖的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()));
  HBaseAdmin admin = TEST_UTIL.getHBaseAdmin();
  if (!admin.tableExists(TABLE)) {
  HTableDescriptor htd = new HTableDescriptor(TableName.valueOf(TABLE));
  htd.addFamily(new HColumnDescriptor(CFA));
  htd.addFamily(new HColumnDescriptor(CFB));
  admin.createTable(htd);
  expectedRows1 = TestScannerResource.insertData(conf, TABLE, COLUMN_1, 1.0);
  expectedRows2 = TestScannerResource.insertData(conf, TABLE, COLUMN_2, 0.5);
  }
}
 
开发者ID:tenggyut,项目名称:HIndex,代码行数:18,代码来源:TestTableScan.java


示例12: setUpBeforeClass

import org.apache.hadoop.hbase.rest.client.Client; //导入依赖的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


示例13: setUpBeforeClass

import org.apache.hadoop.hbase.rest.client.Client; //导入依赖的package包/类
@BeforeClass
public static void setUpBeforeClass() throws Exception {
  conf = TEST_UTIL.getConfiguration();
  conf.setBoolean(RESTServer.REST_CSRF_ENABLED_KEY, csrfEnabled);
  extraHdr = new BasicHeader(RESTServer.REST_CSRF_CUSTOM_HEADER_DEFAULT, "");
  TEST_UTIL.startMiniCluster();
  REST_TEST_UTIL.startServletContainer(conf);
  context = JAXBContext.newInstance(
          CellModel.class,
          CellSetModel.class,
          RowModel.class);
  marshaller = context.createMarshaller();
  unmarshaller = context.createUnmarshaller();
  client = new Client(new Cluster().add("localhost", REST_TEST_UTIL.getServletPort()));
  Admin admin = TEST_UTIL.getAdmin();
  if (admin.tableExists(TABLE)) {
    return;
  }
  HTableDescriptor htd = new HTableDescriptor(TABLE);
  htd.addFamily(new HColumnDescriptor(CFA));
  htd.addFamily(new HColumnDescriptor(CFB));
  admin.createTable(htd);
}
 
开发者ID:apache,项目名称:hbase,代码行数:24,代码来源:TestMultiRowResource.java


示例14: setUpBeforeClass

import org.apache.hadoop.hbase.rest.client.Client; //导入依赖的package包/类
@BeforeClass
public static void setUpBeforeClass() throws Exception {
  conf = TEST_UTIL.getConfiguration();
  TEST_UTIL.startMiniCluster(1, 1);
  TEST_UTIL.createTable(TableName.valueOf("TestStatusResource"), Bytes.toBytes("D"));
  TEST_UTIL.createTable(TableName.valueOf("TestStatusResource2"), Bytes.toBytes("D"));
  REST_TEST_UTIL.startServletContainer(conf);
  Cluster cluster = new Cluster();
  cluster.add("localhost", REST_TEST_UTIL.getServletPort());
  client = new Client(cluster);
  context = JAXBContext.newInstance(StorageClusterStatusModel.class);
  TEST_UTIL.waitFor(6000, new Waiter.Predicate<IOException>() {
    @Override
    public boolean evaluate() throws IOException {
      return TEST_UTIL.getMiniHBaseCluster().getClusterStatus().getAverageLoad() > 0;
    }
  });
}
 
开发者ID:apache,项目名称:hbase,代码行数:19,代码来源:TestStatusResource.java


示例15: setUpBeforeClass

import org.apache.hadoop.hbase.rest.client.Client; //导入依赖的package包/类
@BeforeClass
public static void setUpBeforeClass() throws Exception {
  conf = TEST_UTIL.getConfiguration();
  conf.set(Constants.CUSTOM_FILTERS, "CustomFilter:" + CustomFilter.class.getName());
  TEST_UTIL.startMiniCluster();
  REST_TEST_UTIL.startServletContainer(conf);
  client = new Client(new Cluster().add("localhost",
    REST_TEST_UTIL.getServletPort()));
  Admin admin = TEST_UTIL.getAdmin();
  if (!admin.tableExists(TABLE)) {
  HTableDescriptor htd = new HTableDescriptor(TABLE);
  htd.addFamily(new HColumnDescriptor(CFA));
  htd.addFamily(new HColumnDescriptor(CFB));
  admin.createTable(htd);
  expectedRows1 = TestScannerResource.insertData(conf, TABLE, COLUMN_1, 1.0);
  expectedRows2 = TestScannerResource.insertData(conf, TABLE, COLUMN_2, 0.5);
  }
}
 
开发者ID:apache,项目名称:hbase,代码行数:19,代码来源:TestTableScan.java


示例16: setUpBeforeClass

import org.apache.hadoop.hbase.rest.client.Client; //导入依赖的package包/类
@BeforeClass
public static void setUpBeforeClass() throws Exception {
  conf = TEST_UTIL.getConfiguration();
  TEST_UTIL.startMiniCluster(3);
  REST_TEST_UTIL.startServletContainer(conf);
  context = JAXBContext.newInstance(
      CellModel.class,
      CellSetModel.class,
      RowModel.class);
  xmlMarshaller = context.createMarshaller();
  xmlUnmarshaller = context.createUnmarshaller();
  jsonMapper = new JacksonJaxbJsonProvider()
  .locateMapper(CellSetModel.class, MediaType.APPLICATION_JSON_TYPE);
  client = new Client(new Cluster().add("localhost",
    REST_TEST_UTIL.getServletPort()));
}
 
开发者ID:apache,项目名称:hbase,代码行数:17,代码来源:RowResourceBase.java


示例17: setUpBeforeClass

import org.apache.hadoop.hbase.rest.client.Client; //导入依赖的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()));
  context = JAXBContext.newInstance(
    CellModel.class,
    CellSetModel.class,
    RowModel.class,
    ScannerModel.class);
  marshaller = context.createMarshaller();
  unmarshaller = context.createUnmarshaller();
  HBaseAdmin admin = TEST_UTIL.getHBaseAdmin();
  if (admin.tableExists(TABLE)) {
    return;
  }
  HTableDescriptor htd = new HTableDescriptor(TableName.valueOf(TABLE));
  htd.addFamily(new HColumnDescriptor(CFA));
  htd.addFamily(new HColumnDescriptor(CFB));
  admin.createTable(htd);
  expectedRows1 = insertData(TABLE, COLUMN_1, 1.0);
  expectedRows2 = insertData(TABLE, COLUMN_2, 0.5);
}
 
开发者ID:cloud-software-foundation,项目名称:c5,代码行数:26,代码来源:TestScannerResource.java


示例18: createTable

import org.apache.hadoop.hbase.rest.client.Client; //导入依赖的package包/类
/**
 * Helper method to create an HBase table in an Amazon EMR cluster with HBase installed
 * 
 * @param tableName - name for table to create
 * @param dnsId - Amazon EMR master node public DNS
 * @param hbaseRestPort - HBase Rest port
 */
public static void createTable(String tableName, String dnsId, int hbaseRestPort) {
	Configuration config = HBaseConfiguration.create();
	RemoteAdmin admin = new RemoteAdmin(new Client(new Cluster().add(dnsId, hbaseRestPort)), config);
	String [] families = {"user", "address", "contact", "likes"};
	try {
		if (admin.isTableAvailable(tableName)) {
			LOG.info("table already exists!");
			return;
		} else {
			HTableDescriptor tableDesc = new HTableDescriptor(tableName);
			for (int i = 0; i < families.length; i++) {
				tableDesc.addFamily(new HColumnDescriptor(families[i]));
			}
			admin.createTable(tableDesc);
			isTableAvailable = true;
			LOG.info("create table " + tableName + " ok.");
		} 

	} catch (IOException e) {
		LOG.error(e, e.getCause()); 
	}

}
 
开发者ID:awslabs,项目名称:aws-big-data-blog,代码行数:31,代码来源:HBaseUtils.java


示例19: tablesExists

import org.apache.hadoop.hbase.rest.client.Client; //导入依赖的package包/类
/**
 * Helper method that checks if a table exists in HBase
 * 
 * @param tableName - table to check
 * @param dnsId - Amazon EMR master node public DNS
 * @param hbaseRestPort - HBase Rest port
 * @return
 */
public static boolean tablesExists(String tableName, String dnsId, int hbaseRestPort) {
	Configuration config = HBaseConfiguration.create();
	RemoteAdmin admin = new RemoteAdmin(new Client(new Cluster().add(dnsId, hbaseRestPort)), config);
	try {
		if (admin.isTableAvailable(tableName)) {
			LOG.info("table already exists!");
			System.out.println("table already exists!");
			return true;
		}
		
	} catch (IOException e) {
		e.printStackTrace();
		LOG.error(e, e.getCause()); 
	}
	return false;
}
 
开发者ID:awslabs,项目名称:aws-big-data-blog,代码行数:25,代码来源:HBaseUtils.java



注:本文中的org.apache.hadoop.hbase.rest.client.Client类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ObjectStreamConstants类代码示例发布时间:2022-05-21
下一篇:
Java KafkaServerStartable类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap