File tree 3 files changed +33
-2
lines changed
cloud_gcp/src/main/scala/ai/chronon/integrations/cloud_gcp
3 files changed +33
-2
lines changed Original file line number Diff line number Diff line change @@ -226,7 +226,6 @@ lazy val cloud_gcp = project
226
226
libraryDependencies += " org.json4s" %% " json4s-native" % " 3.7.0-M11" ,
227
227
libraryDependencies += " org.json4s" %% " json4s-core" % " 3.7.0-M11" ,
228
228
libraryDependencies += " org.yaml" % " snakeyaml" % " 2.3" ,
229
- libraryDependencies += " com.google.cloud.bigtable" % " bigtable-hbase-2.x" % " 2.14.2" ,
230
229
libraryDependencies ++= avro,
231
230
libraryDependencies ++= spark_all_provided,
232
231
dependencyOverrides ++= jackson,
Original file line number Diff line number Diff line change
1
+ package ai .chronon .integrations .cloud_gcp
2
+
3
+ import com .google .api .core .ApiFuture
4
+ import com .google .api .core .ApiFutureCallback
5
+ import com .google .api .core .ApiFutures
6
+ import com .google .common .util .concurrent .MoreExecutors
7
+
8
+ import java .util .concurrent .CompletableFuture
9
+
10
+ // Fork of the bigtable-hbase ApiFutureUtils class to avoid taking a dependency on bigtable-hbase for one class
11
+ // BigTable hbase brings in a ton of dependencies that we don't need for this one class
12
+ object ApiFutureUtils {
13
+ def toCompletableFuture [T ](apiFuture : ApiFuture [T ]): CompletableFuture [T ] = {
14
+ val completableFuture : CompletableFuture [T ] = new CompletableFuture [T ]() {
15
+ override def cancel (mayInterruptIfRunning : Boolean ): Boolean = {
16
+ val result : Boolean = apiFuture.cancel(mayInterruptIfRunning)
17
+ super .cancel(mayInterruptIfRunning)
18
+ result
19
+ }
20
+ }
21
+ val callback : ApiFutureCallback [T ] = new ApiFutureCallback [T ]() {
22
+ override def onFailure (throwable : Throwable ): Unit = {
23
+ completableFuture.completeExceptionally(throwable)
24
+ }
25
+
26
+ override def onSuccess (t : T ): Unit = {
27
+ completableFuture.complete(t)
28
+ }
29
+ }
30
+ ApiFutures .addCallback(apiFuture, callback, MoreExecutors .directExecutor)
31
+ completableFuture
32
+ }
33
+ }
Original file line number Diff line number Diff line change @@ -29,7 +29,6 @@ import com.google.cloud.bigtable.data.v2.models.Query
29
29
import com .google .cloud .bigtable .data .v2 .models .Range .ByteStringRange
30
30
import com .google .cloud .bigtable .data .v2 .models .RowMutation
31
31
import com .google .cloud .bigtable .data .v2 .models .{TableId => BTTableId }
32
- import com .google .cloud .bigtable .hbase2_x .ApiFutureUtils
33
32
import com .google .protobuf .ByteString
34
33
import org .slf4j .Logger
35
34
import org .slf4j .LoggerFactory
You can’t perform that action at this time.
0 commit comments