From 72b4a31951e0dad721b1f4b86586a7d5a1f40244 Mon Sep 17 00:00:00 2001 From: Robert Gruener Date: Thu, 21 Jul 2016 15:22:37 -0400 Subject: [PATCH] update bigtable version (#199) --- build.sbt | 7 +++---- .../com/spotify/scio/bigtable/BigtableUtil.java | 14 ++++++++------ 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/build.sbt b/build.sbt index f7062d464f..59f2f17ead 100644 --- a/build.sbt +++ b/build.sbt @@ -26,7 +26,7 @@ import com.trueaccord.scalapb.{ScalaPbPlugin => PB} val dataflowSdkVersion = "1.6.0" val algebirdVersion = "0.12.1" val avroVersion = "1.7.7" -val bigtableVersion = "0.9.0" +val bigtableVersion = "0.9.1" val breezeVersion ="0.12" val chillVersion = "0.8.0" val commonsIoVersion = "2.5" @@ -39,7 +39,7 @@ val hbaseVersion = "1.0.2" val javaLshVersion = "0.9" val jodaConvertVersion = "1.8.1" val junitVersion = "4.12" -val nettyTcNativeVersion = "1.1.33.Fork13" +val nettyTcNativeVersion = "1.1.33.Fork18" val scalaCheckVersion = "1.13.1" val scalaMacrosVersion = "2.1.0" val scalapbVersion = "0.5.19" // inner protobuf-java version must match beam/dataflow-sdk one @@ -247,8 +247,7 @@ lazy val scioBigtable: Project = Project( "com.google.cloud.bigtable" % "bigtable-hbase-dataflow" % bigtableVersion exclude ("org.slf4j", "slf4j-log4j12"), "org.apache.hadoop" % "hadoop-common" % hadoopVersion exclude ("org.slf4j", "slf4j-log4j12"), "org.apache.hbase" % "hbase-common" % hbaseVersion, - "io.netty" % "netty-tcnative" % nettyTcNativeVersion classifier "linux-x86_64", - "io.netty" % "netty-tcnative" % nettyTcNativeVersion classifier "osx-x86_64" + "io.netty" % "netty-tcnative-boringssl-static" % nettyTcNativeVersion ) ) ).dependsOn( diff --git a/scio-bigtable/src/main/java/com/spotify/scio/bigtable/BigtableUtil.java b/scio-bigtable/src/main/java/com/spotify/scio/bigtable/BigtableUtil.java index f8208fac82..f7293644f6 100644 --- a/scio-bigtable/src/main/java/com/spotify/scio/bigtable/BigtableUtil.java +++ b/scio-bigtable/src/main/java/com/spotify/scio/bigtable/BigtableUtil.java @@ -18,11 +18,11 @@ package com.spotify.scio.bigtable; import com.google.bigtable.repackaged.com.google.cloud.config.BigtableOptions; +import com.google.bigtable.repackaged.com.google.cloud.grpc.BigtableInstanceClient; +import com.google.bigtable.repackaged.com.google.cloud.grpc.BigtableInstanceGrpcClient; import com.google.bigtable.repackaged.com.google.cloud.grpc.io.ChannelPool; import com.google.bigtable.repackaged.com.google.com.google.bigtable.admin.v2.Cluster; import com.google.bigtable.repackaged.com.google.com.google.bigtable.admin.v2.ListClustersRequest; -import com.google.bigtable.repackaged.com.google.com.google.bigtable.admin.v2.BigtableInstanceAdminGrpc; -import com.google.bigtable.repackaged.com.google.com.google.bigtable.admin.v2.BigtableInstanceAdminGrpc.BigtableInstanceAdminBlockingStub; import com.google.bigtable.repackaged.com.google.com.google.bigtable.admin.v2.ListClustersResponse; import com.google.cloud.bigtable.dataflow.CloudBigtableConfiguration; import org.joda.time.Duration; @@ -53,14 +53,16 @@ public static void updateNumberOfBigtableNodes(final CloudBigtableConfiguration final int numberOfNodes, final Duration sleepDuration) throws IOException, InterruptedException { final BigtableOptions bigtableOptions = cloudBigtableConfiguration.toBigtableOptions(); - final ChannelPool channelPool = ChannelPoolCreator.createPool(bigtableOptions.getClusterAdminHost()); - final BigtableInstanceAdminBlockingStub adminGrpc = BigtableInstanceAdminGrpc.newBlockingStub(channelPool); + + final ChannelPool channelPool = ChannelPoolCreator.createPool(bigtableOptions.getInstanceAdminHost()); + + final BigtableInstanceClient bigtableInstanceClient = new BigtableInstanceGrpcClient(channelPool); final String instanceName = bigtableOptions.getInstanceName().toString(); // Fetch clusters in Bigtable instance final ListClustersRequest clustersRequest = ListClustersRequest.newBuilder().setParent(instanceName).build(); - final ListClustersResponse clustersResponse = adminGrpc.listClusters(clustersRequest); + final ListClustersResponse clustersResponse = bigtableInstanceClient.listCluster(clustersRequest); // For each cluster update the number of nodes for (Cluster cluster : clustersResponse.getClustersList()) { @@ -68,7 +70,7 @@ public static void updateNumberOfBigtableNodes(final CloudBigtableConfiguration .setName(cluster.getName()) .setServeNodes(numberOfNodes) .build(); - adminGrpc.updateCluster(updatedCluster); + bigtableInstanceClient.updateCluster(updatedCluster); } // Wait for the new nodes to be provisioned