public class PubsubliteResourceManager
extends java.lang.Object
implements org.apache.beam.it.common.ResourceManager
Modifier and Type | Field and Description |
---|---|
static java.lang.Integer |
DEFAULT_NUM_PARTITIONS |
static java.lang.Long |
DEFAULT_PARTITION_SIZE |
static com.google.protobuf.Duration |
DEFAULT_RETENTION_PERIOD |
Constructor and Description |
---|
PubsubliteResourceManager() |
Modifier and Type | Method and Description |
---|---|
void |
cleanupAll()
Delete any topics or subscriptions created by this manager.
|
com.google.cloud.pubsublite.ReservationPath |
createReservation(java.lang.String reservationName,
java.lang.String cloudRegion,
java.lang.String projectId,
java.lang.Long capacity)
Creates a new PubsubLite reservation with the specified number of capacity units.
|
com.google.cloud.pubsublite.SubscriptionName |
createSubscription(com.google.cloud.pubsublite.ReservationPath reservationPath,
com.google.cloud.pubsublite.TopicName topicName,
java.lang.String subscriptionName)
Creates a new Pub/Sub Lite subscription for a specified topic.
|
com.google.cloud.pubsublite.TopicName |
createTopic(java.lang.String topicName,
com.google.cloud.pubsublite.ReservationPath reservationPath)
Creates a topic with the given name on Pub/Sub.
|
public static final java.lang.Integer DEFAULT_NUM_PARTITIONS
public static final com.google.protobuf.Duration DEFAULT_RETENTION_PERIOD
public static final java.lang.Long DEFAULT_PARTITION_SIZE
public com.google.cloud.pubsublite.ReservationPath createReservation(java.lang.String reservationName, java.lang.String cloudRegion, java.lang.String projectId, java.lang.Long capacity)
reservationName
- the name of the reservation to create.cloudRegion
- the region in which the reservation will be created.projectId
- the project id associated with the reservation.capacity
- the number of capacity units for the reservation.public com.google.cloud.pubsublite.TopicName createTopic(java.lang.String topicName, com.google.cloud.pubsublite.ReservationPath reservationPath)
https://cloud.google.com/pubsub/lite/docs/reservations
topicName
- Topic name to create. The underlying implementation may not use the topic name
directly, and can add a prefix or a suffix to identify specific executions.reservationPath
- the path of the reservation under which to create the topic.public com.google.cloud.pubsublite.SubscriptionName createSubscription(com.google.cloud.pubsublite.ReservationPath reservationPath, com.google.cloud.pubsublite.TopicName topicName, java.lang.String subscriptionName)
reservationPath
- the path of the reservation to add the subscription.topicName
- the name of the topic to add the subscription to.subscriptionName
- the name to use for the subscription.SubscriptionName
instance.public void cleanupAll()
cleanupAll
in interface org.apache.beam.it.common.ResourceManager