public final class DatastreamResourceManager
extends java.lang.Object
implements org.apache.beam.it.common.ResourceManager
This class is thread safe.
| Modifier and Type | Class and Description |
|---|---|
static class |
DatastreamResourceManager.Builder
Builder for
DatastreamResourceManager. |
| Constructor and Description |
|---|
DatastreamResourceManager(com.google.cloud.datastream.v1.DatastreamClient datastreamClient,
DatastreamResourceManager.Builder builder) |
| Modifier and Type | Method and Description |
|---|---|
com.google.cloud.datastream.v1.DestinationConfig |
buildBQDestinationConfig(java.lang.String connectionProfileId,
long stalenessLimitSeconds,
java.lang.String datasetId) |
static DatastreamResourceManager.Builder |
builder(java.lang.String projectId,
java.lang.String location,
com.google.api.gax.core.CredentialsProvider credentialsProvider) |
com.google.cloud.datastream.v1.DestinationConfig |
buildGCSDestinationConfig(java.lang.String connectionProfileId,
java.lang.String path,
org.apache.beam.it.gcp.datastream.DatastreamResourceManager.DestinationOutputFormat destinationOutputFormat) |
com.google.cloud.datastream.v1.SourceConfig |
buildSourceConfig(java.lang.String sourceConnectionProfileId,
JDBCSource source) |
void |
cleanupAll() |
com.google.cloud.datastream.v1.ConnectionProfile |
createBQDestinationConnectionProfile(java.lang.String connectionProfileId) |
com.google.cloud.datastream.v1.ConnectionProfile |
createGCSDestinationConnectionProfile(java.lang.String connectionProfileId,
java.lang.String gcsBucketName,
java.lang.String gcsRootPath) |
com.google.cloud.datastream.v1.Stream |
createStream(java.lang.String streamId,
com.google.cloud.datastream.v1.SourceConfig sourceConfig,
com.google.cloud.datastream.v1.DestinationConfig destinationConfig) |
com.google.cloud.datastream.v1.Stream |
pauseStream(java.lang.String streamId) |
com.google.cloud.datastream.v1.Stream |
startStream(java.lang.String streamId) |
com.google.cloud.datastream.v1.Stream |
updateStreamState(java.lang.String streamId,
com.google.cloud.datastream.v1.Stream.State state) |
public DatastreamResourceManager(com.google.cloud.datastream.v1.DatastreamClient datastreamClient,
DatastreamResourceManager.Builder builder)
public static DatastreamResourceManager.Builder builder(java.lang.String projectId, java.lang.String location, com.google.api.gax.core.CredentialsProvider credentialsProvider)
public com.google.cloud.datastream.v1.SourceConfig buildSourceConfig(java.lang.String sourceConnectionProfileId,
JDBCSource source)
sourceConnectionProfileId - The ID of the connection profile.source - An object representing the JDBC source.public com.google.cloud.datastream.v1.ConnectionProfile createGCSDestinationConnectionProfile(java.lang.String connectionProfileId,
java.lang.String gcsBucketName,
java.lang.String gcsRootPath)
connectionProfileId - The ID of the GCS connection profile.gcsBucketName - The GCS Bucket to connect to.gcsRootPath - The Path prefix to specific gcs location. Can either be empty or must start
with '/'.public com.google.cloud.datastream.v1.DestinationConfig buildGCSDestinationConfig(java.lang.String connectionProfileId,
java.lang.String path,
org.apache.beam.it.gcp.datastream.DatastreamResourceManager.DestinationOutputFormat destinationOutputFormat)
connectionProfileId - The ID of the connection profile.path - The Path prefix to specific GCS location. Can either be empty or must start with
'/'.destinationOutputFormat - The format of the files written to GCS.public com.google.cloud.datastream.v1.ConnectionProfile createBQDestinationConnectionProfile(java.lang.String connectionProfileId)
connectionProfileId - The ID of the connection profile.public com.google.cloud.datastream.v1.DestinationConfig buildBQDestinationConfig(java.lang.String connectionProfileId,
long stalenessLimitSeconds,
java.lang.String datasetId)
connectionProfileId - The ID of the connection profile.stalenessLimitSeconds - The desired data freshness in seconds.datasetId - The ID of the BigQuery dataset.public com.google.cloud.datastream.v1.Stream createStream(java.lang.String streamId,
com.google.cloud.datastream.v1.SourceConfig sourceConfig,
com.google.cloud.datastream.v1.DestinationConfig destinationConfig)
streamId - The ID of the stream.sourceConfig - A SourceConfig object representing the source configuration.destinationConfig - A DestinationConfig object representing the destination configuration.public com.google.cloud.datastream.v1.Stream updateStreamState(java.lang.String streamId,
com.google.cloud.datastream.v1.Stream.State state)
public com.google.cloud.datastream.v1.Stream startStream(java.lang.String streamId)
public com.google.cloud.datastream.v1.Stream pauseStream(java.lang.String streamId)
public void cleanupAll()
cleanupAll in interface org.apache.beam.it.common.ResourceManager