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

Java BigtableConfiguration类代码示例

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

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



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

示例1: connectToBigtable

import com.google.cloud.bigtable.hbase.BigtableConfiguration; //导入依赖的package包/类
private Connection connectToBigtable(List<ConfigIssue> issues) {
  Connection conn;
  try {
    conn = BigtableConfiguration.connect(conf.bigtableProjectID, conf.bigtableInstanceID);

  } catch (Exception ex) {
    LOG.error(Errors.BIGTABLE_01.getMessage(), conf.bigtableProjectID, ex.toString(), ex);
    issues.add(getContext().createConfigIssue(Groups.BIGTABLE.name(),
        CONFIG,
        Errors.BIGTABLE_01,
        conf.bigtableProjectID,
        ex.toString()
    ));
    return null;
  }
  return conn;
}
 
开发者ID:streamsets,项目名称:datacollector,代码行数:18,代码来源:BigtableTarget.java


示例2: createBigTableConnection

import com.google.cloud.bigtable.hbase.BigtableConfiguration; //导入依赖的package包/类
public static Connection createBigTableConnection(Config config) {
  final String projectId = config.getString(BIGTABLE_PROJECT_ID);
  final String instanceId = config.getString(BIGTABLE_INSTANCE_ID);

  LOG.info("Creating Bigtable connection for project:{}, instance:{}",
           projectId, instanceId);

  final Configuration bigtableConfiguration = new Configuration();
  bigtableConfiguration.set("google.bigtable.project.id", projectId);
  bigtableConfiguration.set("google.bigtable.instance.id", instanceId);
  bigtableConfiguration.setBoolean("google.bigtable.rpc.use.timeouts", true);

  return BigtableConfiguration.connect(bigtableConfiguration);
}
 
开发者ID:spotify,项目名称:styx,代码行数:15,代码来源:Connections.java


示例3: testConnect

import com.google.cloud.bigtable.hbase.BigtableConfiguration; //导入依赖的package包/类
/**
 * Really basic test to make sure that Cloud Bigtable connections can be made.
 */
@Test
public void testConnect() {
  Configuration conf = BigtableConfiguration.configure("someProjectId", "someInstanceId");
  @SuppressWarnings("unused")
  HBaseClient client = new HBaseClient(conf, null);
}
 
开发者ID:OpenTSDB,项目名称:asyncbigtable,代码行数:10,代码来源:TestHBaseClient.java


示例4: createTable

import com.google.cloud.bigtable.hbase.BigtableConfiguration; //导入依赖的package包/类
@BeforeClass
public static void createTable() throws IOException {
  String projectId = System.getProperty( "google.bigtable.project.id");
  String instanceId = System.getProperty( "google.bigtable.instance.id");
  client = new HBaseClient(BigtableConfiguration.configure(projectId, instanceId),
      Executors.newCachedThreadPool());
  Admin admin = client.getBigtableConnection().getAdmin();
  try {
    admin.createTable(
      new HTableDescriptor(TABLE_NAME)
        .addFamily(new HColumnDescriptor(FAMILY)));
  } finally {
    admin.close();
  }
}
 
开发者ID:OpenTSDB,项目名称:asyncbigtable,代码行数:16,代码来源:HBaseClientIT.java


示例5: connect

import com.google.cloud.bigtable.hbase.BigtableConfiguration; //导入依赖的package包/类
/** Connect will establish the connection to Cloud Bigtable. */
public static void connect() throws IOException {

  if (PROJECT_ID == null || INSTANCE_ID == null) {
    if (sc != null) {
      sc.log("environment variables BIGTABLE_PROJECT, and BIGTABLE_INSTANCE need to be defined.");
    }
    return;
  }

  connection = BigtableConfiguration.connect(PROJECT_ID, INSTANCE_ID);
}
 
开发者ID:GoogleCloudPlatform,项目名称:java-docs-samples,代码行数:13,代码来源:BigtableHelper.java


示例6: getTable

import com.google.cloud.bigtable.hbase.BigtableConfiguration; //导入依赖的package包/类
private Table getTable() {
  Connection conn = BigtableConfiguration.connect(projectID, instanceID);
  Table tab;
  try {
    tab = conn.getTable(TableName.valueOf(tableName));

  } catch (Exception ex) {
    tab = null;
  }
  return tab;
}
 
开发者ID:streamsets,项目名称:datacollector,代码行数:12,代码来源:BigtableTargetIT.java


示例7: dropTable

import com.google.cloud.bigtable.hbase.BigtableConfiguration; //导入依赖的package包/类
private static void dropTable() {
  Connection conn = BigtableConfiguration.connect(projectID, instanceID);
  try {
    Admin admin = conn.getAdmin();
    admin.disableTable(TableName.valueOf(tableName));
    admin.deleteTable(TableName.valueOf(tableName));
  } catch (Exception ex) {
    LOG.info("dropTable(): exception {} ", ex.toString());
  }
}
 
开发者ID:streamsets,项目名称:datacollector,代码行数:11,代码来源:BigtableTargetIT.java


示例8: connect

import com.google.cloud.bigtable.hbase.BigtableConfiguration; //导入依赖的package包/类
/**
* Connect will establish the connection to Cloud Bigtable.
**/
 public static void connect() throws IOException {

   if (PROJECT_ID == null || INSTANCE_ID == null ) {
     if (sc != null) {
       sc.log("environment variables BIGTABLE_PROJECT, and BIGTABLE_INSTANCE need to be defined.");
     }
     return;
   }

   connection = BigtableConfiguration.connect(PROJECT_ID, INSTANCE_ID);
 }
 
开发者ID:GoogleCloudPlatform,项目名称:cloud-bigtable-examples,代码行数:15,代码来源:BigtableHelper.java


示例9: writeTestData

import com.google.cloud.bigtable.hbase.BigtableConfiguration; //导入依赖的package包/类
public static void writeTestData(String projectId, String instanceId,
    TableName tableName, long rowCount, int valueSize) throws IOException {
  System.out.println("Writing to table: " + tableName);
  try (Connection conn = BigtableConfiguration.connect(projectId, instanceId)) {
    BigtableUtilities.createTable(tableName, conn);
    runMutationTests(conn, tableName, rowCount, valueSize);
  }
  System.out.println("Closed the connection");
}
 
开发者ID:GoogleCloudPlatform,项目名称:cloud-bigtable-examples,代码行数:10,代码来源:WritePerfTest.java


示例10: connect

import com.google.cloud.bigtable.hbase.BigtableConfiguration; //导入依赖的package包/类
/**
 * Connect will establish the connection to Cloud Bigtable.
 **/
public static void connect() throws IOException {
  if (PROJECT_ID == null || INSTANCE_ID == null) {
    sc.log(
        "environment variables "
            + "BIGTABLE_PROJECT, and INSTANCE_ID "
            + "need to be defined.");
    return;
  }

  connection = BigtableConfiguration.connect(PROJECT_ID, INSTANCE_ID);
}
 
开发者ID:GoogleCloudPlatform,项目名称:cloud-bigtable-examples,代码行数:15,代码来源:BigtableHelper.java


示例11: getConnection

import com.google.cloud.bigtable.hbase.BigtableConfiguration; //导入依赖的package包/类
private static Connection getConnection(
		final String projectId,
		final String instanceId ) {

	final Configuration config = BigtableConfiguration.configure(
			projectId,
			instanceId);

	// TODO: Bigtable configgy things? What about connection pooling?
	config.setBoolean(
			"hbase.online.schema.update.enable",
			true);

	return BigtableConfiguration.connect(config);
}
 
开发者ID:locationtech,项目名称:geowave,代码行数:16,代码来源:BigTableOperations.java


示例12: HBaseClient

import com.google.cloud.bigtable.hbase.BigtableConfiguration; //导入依赖的package包/类
public HBaseClient(final Configuration configuration, final ExecutorService executor) {
  this.executor = executor;
  hbase_config = configuration;
  LOG.info("BigTable API: Connecting with config: {}", hbase_config);
  hbase_connection = BigtableConfiguration.connect(hbase_config);
}
 
开发者ID:OpenTSDB,项目名称:asyncbigtable,代码行数:7,代码来源:HBaseClient.java


示例13: createTable

import com.google.cloud.bigtable.hbase.BigtableConfiguration; //导入依赖的package包/类
private void createTable(String tab) throws Exception {
  Connection conn = BigtableConfiguration.connect(projectID, instanceID);
  Admin admin = conn.getAdmin();
  admin.createTable(new HTableDescriptor(TableName.valueOf(tab)));
}
 
开发者ID:streamsets,项目名称:datacollector,代码行数:6,代码来源:BigtableTargetIT.java


示例14: createColumnFamily

import com.google.cloud.bigtable.hbase.BigtableConfiguration; //导入依赖的package包/类
private void createColumnFamily(String tab, String cf) throws Exception {
  Connection conn = BigtableConfiguration.connect(projectID, instanceID);
  Admin admin = conn.getAdmin();
  admin.addColumn(TableName.valueOf(tab), new HColumnDescriptor(cf));
}
 
开发者ID:streamsets,项目名称:datacollector,代码行数:6,代码来源:BigtableTargetIT.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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