Search in sources :

Example 6 with Stream

use of com.google.api.services.datastream.v1alpha1.model.Stream in project DataflowTemplates by GoogleCloudPlatform.

the class DataStreamClient method discoverOracleTableSchema.

/**
 * Return a {@link OracleTable} object with schema and PK information.
 *
 * @param streamName A fully qualified Stream name (ie. projects/my-project/stream/my-stream)
 * @param schemaName The name of the schema for the table being discovered.
 * @param tableName The name of the table to discover.
 * @param sourceConnProfile The SourceConfig connection profile to be discovered.
 */
public OracleTable discoverOracleTableSchema(String streamName, String schemaName, String tableName, SourceConfig sourceConnProfile) throws IOException {
    DataStream.Projects.Locations.ConnectionProfiles.Discover discoverConnProfile = getDiscoverTableRequest(streamName, schemaName, tableName, sourceConnProfile);
    OracleRdbms tableResponse = discoverConnProfile.execute().getOracleRdbms();
    OracleSchema schema = tableResponse.getOracleSchemas().get(0);
    OracleTable table = schema.getOracleTables().get(0);
    return table;
}
Also used : OracleSchema(com.google.api.services.datastream.v1alpha1.model.OracleSchema) OracleTable(com.google.api.services.datastream.v1alpha1.model.OracleTable) OracleRdbms(com.google.api.services.datastream.v1alpha1.model.OracleRdbms)

Aggregations

DataStream (com.google.api.services.datastream.v1alpha1.DataStream)2 SourceConfig (com.google.api.services.datastream.v1alpha1.model.SourceConfig)2 Stream (com.google.api.services.datastream.v1alpha1.model.Stream)2 DescribeStreamRequest (com.amazonaws.services.dynamodbv2.model.DescribeStreamRequest)1 DescribeStreamResult (com.amazonaws.services.dynamodbv2.model.DescribeStreamResult)1 GetShardIteratorRequest (com.amazonaws.services.dynamodbv2.model.GetShardIteratorRequest)1 GetShardIteratorResult (com.amazonaws.services.dynamodbv2.model.GetShardIteratorResult)1 ListStreamsRequest (com.amazonaws.services.dynamodbv2.model.ListStreamsRequest)1 ListStreamsResult (com.amazonaws.services.dynamodbv2.model.ListStreamsResult)1 Stream (com.amazonaws.services.dynamodbv2.model.Stream)1 StreamDescription (com.amazonaws.services.dynamodbv2.model.StreamDescription)1 MysqlDatabase (com.google.api.services.datastream.v1alpha1.model.MysqlDatabase)1 MysqlRdbms (com.google.api.services.datastream.v1alpha1.model.MysqlRdbms)1 MysqlTable (com.google.api.services.datastream.v1alpha1.model.MysqlTable)1 OracleRdbms (com.google.api.services.datastream.v1alpha1.model.OracleRdbms)1 OracleSchema (com.google.api.services.datastream.v1alpha1.model.OracleSchema)1 OracleTable (com.google.api.services.datastream.v1alpha1.model.OracleTable)1 DataStreamClient (com.google.cloud.teleport.v2.utils.DataStreamClient)1 IOException (java.io.IOException)1 GcpOptions (org.apache.beam.sdk.extensions.gcp.options.GcpOptions)1