From ae82cbe716655417203cd545fda2e78f23d2584c Mon Sep 17 00:00:00 2001
From: jiangmichaellll <40044148+jiangmichaellll@users.noreply.github.com>
Date: Tue, 26 Jan 2021 17:00:58 -0500
Subject: [PATCH] feat: remove Spark connector module from this repo (#467)
The source code now lives in https://github.com/googleapis/java-pubsublite-spark
---
pom.xml | 1 -
pubsublite-spark-sql-streaming/README.md | 134 ---------
.../examples/simple_read.py | 33 ---
pubsublite-spark-sql-streaming/pom.xml | 273 ------------------
.../cloud/pubsublite/spark/Constants.java | 55 ----
.../spark/LimitingHeadOffsetReader.java | 100 -------
.../spark/MultiPartitionCommitter.java | 32 --
.../spark/MultiPartitionCommitterImpl.java | 78 -----
.../spark/PartitionSubscriberFactory.java | 31 --
.../spark/PerTopicHeadOffsetReader.java | 28 --
.../spark/PslContinuousInputPartition.java | 85 ------
.../PslContinuousInputPartitionReader.java | 88 ------
.../pubsublite/spark/PslContinuousReader.java | 133 ---------
.../spark/PslCredentialsProvider.java | 61 ----
.../cloud/pubsublite/spark/PslDataSource.java | 103 -------
.../spark/PslDataSourceOptions.java | 209 --------------
.../spark/PslMicroBatchInputPartition.java | 73 -----
.../PslMicroBatchInputPartitionReader.java | 100 -------
.../pubsublite/spark/PslMicroBatchReader.java | 143 ---------
.../pubsublite/spark/PslPartitionOffset.java | 45 ---
.../pubsublite/spark/PslSourceOffset.java | 40 ---
.../cloud/pubsublite/spark/PslSparkUtils.java | 135 ---------
.../spark/SparkPartitionOffset.java | 48 ---
.../pubsublite/spark/SparkSourceOffset.java | 121 --------
.../spark/LimitingHeadOffsetReaderTest.java | 69 -----
.../MultiPartitionCommitterImplTest.java | 90 ------
...PslContinuousInputPartitionReaderTest.java | 84 ------
.../spark/PslContinuousReaderTest.java | 125 --------
...PslMicroBatchInputPartitionReaderTest.java | 109 -------
.../spark/PslMicroBatchReaderTest.java | 122 --------
.../pubsublite/spark/PslSparkUtilsTest.java | 85 ------
.../spark/SparkSourceOffsetTest.java | 130 ---------
32 files changed, 2963 deletions(-)
delete mode 100644 pubsublite-spark-sql-streaming/README.md
delete mode 100644 pubsublite-spark-sql-streaming/examples/simple_read.py
delete mode 100644 pubsublite-spark-sql-streaming/pom.xml
delete mode 100644 pubsublite-spark-sql-streaming/src/main/java/com/google/cloud/pubsublite/spark/Constants.java
delete mode 100644 pubsublite-spark-sql-streaming/src/main/java/com/google/cloud/pubsublite/spark/LimitingHeadOffsetReader.java
delete mode 100644 pubsublite-spark-sql-streaming/src/main/java/com/google/cloud/pubsublite/spark/MultiPartitionCommitter.java
delete mode 100644 pubsublite-spark-sql-streaming/src/main/java/com/google/cloud/pubsublite/spark/MultiPartitionCommitterImpl.java
delete mode 100644 pubsublite-spark-sql-streaming/src/main/java/com/google/cloud/pubsublite/spark/PartitionSubscriberFactory.java
delete mode 100644 pubsublite-spark-sql-streaming/src/main/java/com/google/cloud/pubsublite/spark/PerTopicHeadOffsetReader.java
delete mode 100644 pubsublite-spark-sql-streaming/src/main/java/com/google/cloud/pubsublite/spark/PslContinuousInputPartition.java
delete mode 100644 pubsublite-spark-sql-streaming/src/main/java/com/google/cloud/pubsublite/spark/PslContinuousInputPartitionReader.java
delete mode 100644 pubsublite-spark-sql-streaming/src/main/java/com/google/cloud/pubsublite/spark/PslContinuousReader.java
delete mode 100644 pubsublite-spark-sql-streaming/src/main/java/com/google/cloud/pubsublite/spark/PslCredentialsProvider.java
delete mode 100644 pubsublite-spark-sql-streaming/src/main/java/com/google/cloud/pubsublite/spark/PslDataSource.java
delete mode 100644 pubsublite-spark-sql-streaming/src/main/java/com/google/cloud/pubsublite/spark/PslDataSourceOptions.java
delete mode 100644 pubsublite-spark-sql-streaming/src/main/java/com/google/cloud/pubsublite/spark/PslMicroBatchInputPartition.java
delete mode 100644 pubsublite-spark-sql-streaming/src/main/java/com/google/cloud/pubsublite/spark/PslMicroBatchInputPartitionReader.java
delete mode 100644 pubsublite-spark-sql-streaming/src/main/java/com/google/cloud/pubsublite/spark/PslMicroBatchReader.java
delete mode 100644 pubsublite-spark-sql-streaming/src/main/java/com/google/cloud/pubsublite/spark/PslPartitionOffset.java
delete mode 100644 pubsublite-spark-sql-streaming/src/main/java/com/google/cloud/pubsublite/spark/PslSourceOffset.java
delete mode 100644 pubsublite-spark-sql-streaming/src/main/java/com/google/cloud/pubsublite/spark/PslSparkUtils.java
delete mode 100644 pubsublite-spark-sql-streaming/src/main/java/com/google/cloud/pubsublite/spark/SparkPartitionOffset.java
delete mode 100644 pubsublite-spark-sql-streaming/src/main/java/com/google/cloud/pubsublite/spark/SparkSourceOffset.java
delete mode 100644 pubsublite-spark-sql-streaming/src/test/java/com/google/cloud/pubsublite/spark/LimitingHeadOffsetReaderTest.java
delete mode 100644 pubsublite-spark-sql-streaming/src/test/java/com/google/cloud/pubsublite/spark/MultiPartitionCommitterImplTest.java
delete mode 100644 pubsublite-spark-sql-streaming/src/test/java/com/google/cloud/pubsublite/spark/PslContinuousInputPartitionReaderTest.java
delete mode 100644 pubsublite-spark-sql-streaming/src/test/java/com/google/cloud/pubsublite/spark/PslContinuousReaderTest.java
delete mode 100644 pubsublite-spark-sql-streaming/src/test/java/com/google/cloud/pubsublite/spark/PslMicroBatchInputPartitionReaderTest.java
delete mode 100644 pubsublite-spark-sql-streaming/src/test/java/com/google/cloud/pubsublite/spark/PslMicroBatchReaderTest.java
delete mode 100644 pubsublite-spark-sql-streaming/src/test/java/com/google/cloud/pubsublite/spark/PslSparkUtilsTest.java
delete mode 100644 pubsublite-spark-sql-streaming/src/test/java/com/google/cloud/pubsublite/spark/SparkSourceOffsetTest.java
diff --git a/pom.xml b/pom.xml
index e278da134..80de096fd 100644
--- a/pom.xml
+++ b/pom.xml
@@ -121,7 +121,6 @@
google-cloud-pubsublite
grpc-google-cloud-pubsublite-v1
proto-google-cloud-pubsublite-v1
- pubsublite-spark-sql-streaming
pubsublite-beam-io
diff --git a/pubsublite-spark-sql-streaming/README.md b/pubsublite-spark-sql-streaming/README.md
deleted file mode 100644
index bd5ca9c27..000000000
--- a/pubsublite-spark-sql-streaming/README.md
+++ /dev/null
@@ -1,134 +0,0 @@
-# Apache Spark SQL Streaming connector for Google PubSub Lite (Unreleased)
-
-The connector is a custom implementation of [Spark Structured Streaming](https://spark.apache.org/docs/latest/structured-streaming-programming-guide.html)
-that supports reading messages from [Google PubSub Lite](https://cloud.google.com/pubsub/lite/docs) subscriptions into Spark.
-
-## Disclaimer
-
-This connector is still being worked on. Backwards-incompatible changes may be made until version 1.0.0 is released.
-
-## Requirements
-
-### Enable the PubSub Lite API
-
-Follow [these instructions](https://cloud.google.com/pubsub/lite/docs/quickstart#before-you-begin).
-
-### Create a new subscription or use existing subscription
-
-Follow [the instruction](https://cloud.google.com/pubsub/lite/docs/quickstart#create_a_lite_subscription) to create a new
-subscription or use existing subscription. If using existing subscription, the connector will read message from the
-oldest unacknowledged.
-
-### Create a Google Cloud Dataproc cluster (Optional)
-
-If you do not have an Apache Spark environment you can create a Cloud Dataproc cluster with pre-configured auth. The following examples assume you are using Cloud Dataproc, but you can use `spark-submit` on any cluster.
-
-```
-MY_CLUSTER=...
-gcloud dataproc clusters create "$MY_CLUSTER"
-```
-
-## Downloading and Using the Connector
-
-
-The latest version connector of the connector (Scala 2.11) is publicly available in
-gs://spark-lib/pubsublite/spark-pubsublite-latest.jar.
-
-
-The connector is also available from the Maven Central
-repository. It can be used using the `--packages` option or the
-`spark.jars.packages` configuration property. Use the following value
-
-| Scala version | Connector Artifact |
-| --- | --- |
-| Scala 2.11 | `com.google.cloud.pubsublite.spark:pubsublite-spark-sql-streaming-with-dependencies_2.11:0.1.0` |
-
-
-
-## Usage
-
-### Reading data from PubSub Lite
-
-```
-df = spark.readStream \
- .option("pubsublite.subscription", "projects/123456789/locations/us-central1-a/subscriptions/test-spark-subscription")
- .format("pubsublite") \
- .load
-```
-
-Note that the connector supports both MicroBatch Processing and [Continuous Processing](https://spark.apache.org/docs/latest/structured-streaming-programming-guide.html#continuous-processing).
-
-### Properties
-
-The connector supports a number of options to configure the read:
-
-| Option | Type | Required | Meaning |
-| ------ | ---- | -------- | ------- |
-| pubsublite.subscription | String | Y | Full subscription path that the connector will read from. |
-| pubsublite.flowcontrol.byteoutstandingperpartition | Long | N | Max number of bytes per partition that will be cached in workers before Spark processes the messages. Default to 50000000 bytes. |
-| pubsublite.flowcontrol.messageoutstandingperpartition | Long | N | Max number of messages per partition that will be cached in workers before Spark processes the messages. Default to Long.MAX_VALUE. |
-| gcp.credentials.key | String | N | Service account JSON in base64. Default to [Application Default Credentials](https://cloud.google.com/docs/authentication/production#automatically). |
-
-### Data Schema
-
-The connector has fixed data schema as follows:
-
-| Data Field | Spark Data Type | Notes |
-| ---------- | --------------- | ----- |
-| subscription | StringType | Full subscription path |
-| partition | LongType | |
-| offset | LongType | |
-| key | BinaryType | |
-| data | BinaryType | |
-| attributes | MapType\[StringType, ArrayType\[BinaryType\]\] | |
-| publish_timestamp | TimestampType | |
-| event_timestamp | TimestampType | Nullable |
-
-## Compiling with the connector
-
-To include the connector in your project:
-
-### Maven
-
-```xml
-
- com.google.cloud.pubsublite.spark
- pubsublite-spark-sql-streaming-with-dependencies_2.11
- 0.1.0
-
-```
-
-### SBT
-
-```sbt
-libraryDependencies += "com.google.cloud.pubsublite.spark" %% "pubsublite-spark-sql-streaming-with-dependencies_2.11" % "0.1.0"
-```
-
-## Building the Connector
-
-The connector is built using Maven. Following command creates a jar with shaded dependencies:
-
-```
-mvn package
-```
-
-## FAQ
-
-### What is the Pricing for the PubSub Lite?
-
-See the [PubSub Lite pricing documentation](https://cloud.google.com/pubsub/lite/pricing).
-
-### Can I configure the number of spark partitions?
-
-No, the number of spark partitions is set to be the number of PubSub Lite partitions of the topic that the supplied subscription is for.
-
-### How do I authenticate outside GCE / Dataproc?
-
-Use a service account JSON key and `GOOGLE_APPLICATION_CREDENTIALS` as described [here](https://cloud.google.com/docs/authentication/getting-started).
-
-Credentials can be provided with `gcp.credentials.key` option, it needs be passed in as a base64-encoded string directly.
-
-Example:
-```
-spark.readStream.format("pubsublite").option("gcp.credentials.key", "")
-```
diff --git a/pubsublite-spark-sql-streaming/examples/simple_read.py b/pubsublite-spark-sql-streaming/examples/simple_read.py
deleted file mode 100644
index de9887d68..000000000
--- a/pubsublite-spark-sql-streaming/examples/simple_read.py
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/usr/bin/env python
-# Copyright 2020 Google Inc. All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-from pyspark.sql import SparkSession
-import sys
-
-full_subscription_path = sys.argv[1]
-
-spark = SparkSession.builder.appName('Simple PubSub Lite Read').master('yarn').getOrCreate()
-
-spark \
- .readStream \
- .format('pubsublite') \
- .option('pubsublite.subscription', full_subscription_path) \
- .load() \
- .writeStream \
- .format('console') \
- .outputMode('append') \
- .trigger(processingTime='1 second') \
- .start() \
- .awaitTermination()
\ No newline at end of file
diff --git a/pubsublite-spark-sql-streaming/pom.xml b/pubsublite-spark-sql-streaming/pom.xml
deleted file mode 100644
index 113deb5bd..000000000
--- a/pubsublite-spark-sql-streaming/pom.xml
+++ /dev/null
@@ -1,273 +0,0 @@
-
-
-
- com.google.cloud
- google-cloud-pubsublite-parent
- 0.8.1-SNAPSHOT
- ../pom.xml
-
- 4.0.0
- com.google.cloud
- pubsublite-spark-sql-streaming
- 0.8.1-SNAPSHOT
- jar
- Pub/Sub Lite Spark SQL Streaming
- https://github.com/googleapis/java-pubsublite
- Spark SQL Streaming Connector for Google Cloud Pub/Sub Lite
-
- 1.8
- 1.8
- UTF-8
- 2.11.12
- 2.11
- 2.4.7
-
-
-
- org.apache.spark
- spark-sql_${scala.version.short}
- ${spark.version}
- provided
-
-
- org.apache.spark
- spark-catalyst_${scala.version.short}
- ${spark.version}
- provided
-
-
- org.apache.spark
- spark-unsafe_${scala.version.short}
- ${spark.version}
- provided
-
-
- com.google.cloud
- google-cloud-pubsublite
- 0.8.1-SNAPSHOT
-
-
- com.google.api.grpc
- proto-google-cloud-pubsublite-v1
- 0.8.1-SNAPSHOT
-
-
- com.google.guava
- guava
-
-
- com.google.api
- gax
-
-
- com.google.auto.value
- auto-value-annotations
-
-
- com.google.auto.service
- auto-service-annotations
-
-
- com.google.code.findbugs
- jsr305
-
-
- com.google.auth
- google-auth-library-credentials
-
-
- com.google.auth
- google-auth-library-oauth2-http
-
-
- com.google.http-client
- google-http-client
-
-
- com.google.protobuf
- protobuf-java
-
-
- com.google.protobuf
- protobuf-java-util
-
-
- com.google.flogger
- google-extensions
-
-
- com.google.api
- api-common
-
-
- com.fasterxml.jackson.core
- jackson-core
- 2.12.1
-
-
- com.github.ben-manes.caffeine
- caffeine
- 2.8.8
-
-
- com.fasterxml.jackson.core
- jackson-databind
- 2.12.1
-
-
- org.scala-lang
- scala-library
- ${scala.version}
- provided
-
-
-
-
- junit
- junit
- 4.13.1
- test
-
-
- com.google.truth
- truth
- 1.1.2
- test
-
-
- org.mockito
- mockito-core
- test
- 3.7.0
-
-
- com.google.guava
- guava-testlib
- test
-
-
-
-
- src/main/java
- src/test/java
- target/classes
- target/test-classes
-
-
- org.apache.maven.plugins
- maven-shade-plugin
- 3.2.4
-
-
- package
-
- shade
-
-
-
-
-
-
-
-
- *:*
-
- META-INF/maven/**
- META-INF/*.MF
- META-INF/*.SF
- META-INF/*.DSA
- META-INF/*.RSA
-
-
-
-
-
- com
- repackaged.com
-
- com.google.protobuf.**
- com.google.common.**
-
-
-
-
- io.grpc.netty.shaded
-
- com.google.cloud.pubsublite.repackaged.io.grpc.netty.shaded
-
-
-
- io
- com.google.cloud.pubsublite.repackaged.io
-
- io.grpc.**
- io.opencensus.**
- io.perfmark.**
-
-
-
- META-INF/native/io_grpc_netty_shaded_
-
- META-INF/native/com_google_cloud_pubsublite_repackaged_io_grpc_netty_shaded_
-
-
-
- META-INF/native/libio_grpc_netty_shaded_
-
- META-INF/native/libcom_google_cloud_pubsublite_repackaged_io_grpc_netty_shaded_
-
-
-
- true
- with-dependencies
-
-
-
-
-
- org.sonatype.plugins
- nexus-staging-maven-plugin
-
-
- true
-
-
-
- org.apache.maven.plugins
- maven-enforcer-plugin
- 3.0.0-M3
-
-
- enforce
-
-
-
- WARN
-
- org.checkerframework:checker-compat-qual
-
-
-
-
-
- org.apache.commons.logging.*
- org.apache.commons.collections.*
- org.apache.spark.unused.*
- org.apache.hadoop.yarn.*
- javax.ws.rs.*
-
- true
-
-
-
-
- enforce
-
-
-
-
-
-
-
diff --git a/pubsublite-spark-sql-streaming/src/main/java/com/google/cloud/pubsublite/spark/Constants.java b/pubsublite-spark-sql-streaming/src/main/java/com/google/cloud/pubsublite/spark/Constants.java
deleted file mode 100644
index bdc8a1bd4..000000000
--- a/pubsublite-spark-sql-streaming/src/main/java/com/google/cloud/pubsublite/spark/Constants.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright 2020 Google LLC
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.google.cloud.pubsublite.spark;
-
-import com.google.cloud.pubsublite.internal.wire.PubsubContext;
-import org.apache.spark.sql.types.DataTypes;
-import org.apache.spark.sql.types.Metadata;
-import org.apache.spark.sql.types.StructField;
-import org.apache.spark.sql.types.StructType;
-
-public class Constants {
- public static long DEFAULT_BYTES_OUTSTANDING = 50_000_000;
- public static long DEFAULT_MESSAGES_OUTSTANDING = Long.MAX_VALUE;
- public static int DEFAULT_BATCH_OFFSET_RANGE = 100_000;
- public static StructType DEFAULT_SCHEMA =
- new StructType(
- new StructField[] {
- new StructField("subscription", DataTypes.StringType, false, Metadata.empty()),
- new StructField("partition", DataTypes.LongType, false, Metadata.empty()),
- new StructField("offset", DataTypes.LongType, false, Metadata.empty()),
- new StructField("key", DataTypes.BinaryType, false, Metadata.empty()),
- new StructField("data", DataTypes.BinaryType, false, Metadata.empty()),
- new StructField("publish_timestamp", DataTypes.TimestampType, false, Metadata.empty()),
- new StructField("event_timestamp", DataTypes.TimestampType, true, Metadata.empty()),
- new StructField(
- "attributes",
- DataTypes.createMapType(
- DataTypes.StringType, DataTypes.createArrayType(DataTypes.BinaryType)),
- true,
- Metadata.empty())
- });
-
- public static final PubsubContext.Framework FRAMEWORK = PubsubContext.Framework.of("SPARK");
-
- public static String BYTES_OUTSTANDING_CONFIG_KEY =
- "pubsublite.flowcontrol.byteoutstandingperpartition";
- public static String MESSAGES_OUTSTANDING_CONFIG_KEY =
- "pubsublite.flowcontrol.messageoutstandingperparition";
- public static String SUBSCRIPTION_CONFIG_KEY = "pubsublite.subscription";
- public static String CREDENTIALS_KEY_CONFIG_KEY = "gcp.credentials.key";
-}
diff --git a/pubsublite-spark-sql-streaming/src/main/java/com/google/cloud/pubsublite/spark/LimitingHeadOffsetReader.java b/pubsublite-spark-sql-streaming/src/main/java/com/google/cloud/pubsublite/spark/LimitingHeadOffsetReader.java
deleted file mode 100644
index 5954492f8..000000000
--- a/pubsublite-spark-sql-streaming/src/main/java/com/google/cloud/pubsublite/spark/LimitingHeadOffsetReader.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Copyright 2020 Google LLC
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.google.cloud.pubsublite.spark;
-
-import com.github.benmanes.caffeine.cache.AsyncLoadingCache;
-import com.github.benmanes.caffeine.cache.Caffeine;
-import com.github.benmanes.caffeine.cache.Ticker;
-import com.google.api.core.ApiFutureCallback;
-import com.google.api.core.ApiFutures;
-import com.google.cloud.pubsublite.Offset;
-import com.google.cloud.pubsublite.Partition;
-import com.google.cloud.pubsublite.TopicPath;
-import com.google.cloud.pubsublite.internal.TopicStatsClient;
-import com.google.cloud.pubsublite.proto.Cursor;
-import com.google.common.annotations.VisibleForTesting;
-import com.google.common.util.concurrent.MoreExecutors;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.CompletableFuture;
-import java.util.concurrent.Executor;
-import java.util.concurrent.TimeUnit;
-
-/**
- * Rate limited HeadOffsetReader, utilizing a LoadingCache that refreshes all partitions head
- * offsets for the topic at most once per minute.
- */
-public class LimitingHeadOffsetReader implements PerTopicHeadOffsetReader {
-
- private final TopicStatsClient topicStatsClient;
- private final TopicPath topic;
- private final long topicPartitionCount;
- private final AsyncLoadingCache cachedHeadOffsets;
-
- @VisibleForTesting
- public LimitingHeadOffsetReader(
- TopicStatsClient topicStatsClient, TopicPath topic, long topicPartitionCount, Ticker ticker) {
- this.topicStatsClient = topicStatsClient;
- this.topic = topic;
- this.topicPartitionCount = topicPartitionCount;
- this.cachedHeadOffsets =
- Caffeine.newBuilder()
- .ticker(ticker)
- .expireAfterWrite(1, TimeUnit.MINUTES)
- .buildAsync(this::loadHeadOffset);
- }
-
- private CompletableFuture loadHeadOffset(Partition partition, Executor executor) {
-
- CompletableFuture result = new CompletableFuture<>();
- ApiFutures.addCallback(
- topicStatsClient.computeHeadCursor(topic, partition),
- new ApiFutureCallback() {
- @Override
- public void onFailure(Throwable t) {
- result.completeExceptionally(t);
- }
-
- @Override
- public void onSuccess(Cursor c) {
- result.complete(Offset.of(c.getOffset()));
- }
- },
- MoreExecutors.directExecutor());
- return result;
- }
-
- @Override
- public PslSourceOffset getHeadOffset() {
- Set keySet = new HashSet<>();
- for (int i = 0; i < topicPartitionCount; i++) {
- keySet.add(Partition.of(i));
- }
- CompletableFuture