Class CapacityCommitment (2.44.0)

public final class CapacityCommitment extends GeneratedMessageV3 implements CapacityCommitmentOrBuilder

Capacity commitment is a way to purchase compute capacity for BigQuery jobs (in the form of slots) with some committed period of usage. Annual commitments renew by default. Commitments can be removed after their commitment end time passes.

In order to remove annual commitment, its plan needs to be changed to monthly or flex first.

A capacity commitment resource exists as a child resource of the admin project.

Protobuf type google.cloud.bigquery.reservation.v1.CapacityCommitment

Static Fields

COMMITMENT_END_TIME_FIELD_NUMBER

public static final int COMMITMENT_END_TIME_FIELD_NUMBER
Field Value
Type Description
int

COMMITMENT_START_TIME_FIELD_NUMBER

public static final int COMMITMENT_START_TIME_FIELD_NUMBER
Field Value
Type Description
int

EDITION_FIELD_NUMBER

public static final int EDITION_FIELD_NUMBER
Field Value
Type Description
int

FAILURE_STATUS_FIELD_NUMBER

public static final int FAILURE_STATUS_FIELD_NUMBER
Field Value
Type Description
int

MULTI_REGION_AUXILIARY_FIELD_NUMBER

public static final int MULTI_REGION_AUXILIARY_FIELD_NUMBER
Field Value
Type Description
int

NAME_FIELD_NUMBER

public static final int NAME_FIELD_NUMBER
Field Value
Type Description
int

PLAN_FIELD_NUMBER

public static final int PLAN_FIELD_NUMBER
Field Value
Type Description
int

RENEWAL_PLAN_FIELD_NUMBER

public static final int RENEWAL_PLAN_FIELD_NUMBER
Field Value
Type Description
int

SLOT_COUNT_FIELD_NUMBER

public static final int SLOT_COUNT_FIELD_NUMBER
Field Value
Type Description
int

STATE_FIELD_NUMBER

public static final int STATE_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

public static CapacityCommitment getDefaultInstance()
Returns
Type Description
CapacityCommitment

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

newBuilder()

public static CapacityCommitment.Builder newBuilder()
Returns
Type Description
CapacityCommitment.Builder

newBuilder(CapacityCommitment prototype)

public static CapacityCommitment.Builder newBuilder(CapacityCommitment prototype)
Parameter
Name Description
prototype CapacityCommitment
Returns
Type Description
CapacityCommitment.Builder

parseDelimitedFrom(InputStream input)

public static CapacityCommitment parseDelimitedFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
CapacityCommitment
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static CapacityCommitment parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
CapacityCommitment
Exceptions
Type Description
IOException

parseFrom(byte[] data)

public static CapacityCommitment parseFrom(byte[] data)
Parameter
Name Description
data byte[]
Returns
Type Description
CapacityCommitment
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static CapacityCommitment parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
CapacityCommitment
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

public static CapacityCommitment parseFrom(ByteString data)
Parameter
Name Description
data ByteString
Returns
Type Description
CapacityCommitment
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static CapacityCommitment parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
CapacityCommitment
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static CapacityCommitment parseFrom(CodedInputStream input)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
CapacityCommitment
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static CapacityCommitment parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
CapacityCommitment
Exceptions
Type Description
IOException

parseFrom(InputStream input)

public static CapacityCommitment parseFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
CapacityCommitment
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static CapacityCommitment parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
CapacityCommitment
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

public static CapacityCommitment parseFrom(ByteBuffer data)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
CapacityCommitment
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static CapacityCommitment parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
CapacityCommitment
Exceptions
Type Description
InvalidProtocolBufferException

parser()

public static Parser<CapacityCommitment> parser()
Returns
Type Description
Parser<CapacityCommitment>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
Overrides

getCommitmentEndTime()

public Timestamp getCommitmentEndTime()

Output only. The end of the current commitment period. It is applicable only for ACTIVE capacity commitments.

.google.protobuf.Timestamp commitment_end_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Timestamp

The commitmentEndTime.

getCommitmentEndTimeOrBuilder()

public TimestampOrBuilder getCommitmentEndTimeOrBuilder()

Output only. The end of the current commitment period. It is applicable only for ACTIVE capacity commitments.

.google.protobuf.Timestamp commitment_end_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
TimestampOrBuilder

getCommitmentStartTime()

public Timestamp getCommitmentStartTime()

Output only. The start of the current commitment period. It is applicable only for ACTIVE capacity commitments.

.google.protobuf.Timestamp commitment_start_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Timestamp

The commitmentStartTime.

getCommitmentStartTimeOrBuilder()

public TimestampOrBuilder getCommitmentStartTimeOrBuilder()

Output only. The start of the current commitment period. It is applicable only for ACTIVE capacity commitments.

.google.protobuf.Timestamp commitment_start_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
TimestampOrBuilder

getDefaultInstanceForType()

public CapacityCommitment getDefaultInstanceForType()
Returns
Type Description
CapacityCommitment

getEdition()

public Edition getEdition()

Edition of the capacity commitment.

.google.cloud.bigquery.reservation.v1.Edition edition = 12;

Returns
Type Description
Edition

The edition.

getEditionValue()

public int getEditionValue()

Edition of the capacity commitment.

.google.cloud.bigquery.reservation.v1.Edition edition = 12;

Returns
Type Description
int

The enum numeric value on the wire for edition.

getFailureStatus()

public Status getFailureStatus()

Output only. For FAILED commitment plan, provides the reason of failure.

.google.rpc.Status failure_status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
com.google.rpc.Status

The failureStatus.

getFailureStatusOrBuilder()

public StatusOrBuilder getFailureStatusOrBuilder()

Output only. For FAILED commitment plan, provides the reason of failure.

.google.rpc.Status failure_status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
com.google.rpc.StatusOrBuilder

getMultiRegionAuxiliary()

public boolean getMultiRegionAuxiliary()

Applicable only for commitments located within one of the BigQuery multi-regions (US or EU).

If set to true, this commitment is placed in the organization's secondary region which is designated for disaster recovery purposes. If false, this commitment is placed in the organization's default region.

NOTE: this is a preview feature. Project must be allow-listed in order to set this field.

bool multi_region_auxiliary = 10;

Returns
Type Description
boolean

The multiRegionAuxiliary.

getName()

public String getName()

Output only. The resource name of the capacity commitment, e.g., projects/myproject/locations/US/capacityCommitments/123 The commitment_id must only contain lower case alphanumeric characters or dashes. It must start with a letter and must not end with a dash. Its maximum length is 64 characters.

string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
String

The name.

getNameBytes()

public ByteString getNameBytes()

Output only. The resource name of the capacity commitment, e.g., projects/myproject/locations/US/capacityCommitments/123 The commitment_id must only contain lower case alphanumeric characters or dashes. It must start with a letter and must not end with a dash. Its maximum length is 64 characters.

string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
ByteString

The bytes for name.

getParserForType()

public Parser<CapacityCommitment> getParserForType()
Returns
Type Description
Parser<CapacityCommitment>
Overrides

getPlan()

public CapacityCommitment.CommitmentPlan getPlan()

Capacity commitment commitment plan.

.google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan plan = 3;

Returns
Type Description
CapacityCommitment.CommitmentPlan

The plan.

getPlanValue()

public int getPlanValue()

Capacity commitment commitment plan.

.google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan plan = 3;

Returns
Type Description
int

The enum numeric value on the wire for plan.

getRenewalPlan()

public CapacityCommitment.CommitmentPlan getRenewalPlan()

The plan this capacity commitment is converted to after commitment_end_time passes. Once the plan is changed, committed period is extended according to commitment plan. Only applicable for ANNUAL and TRIAL commitments.

.google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan renewal_plan = 8;

Returns
Type Description
CapacityCommitment.CommitmentPlan

The renewalPlan.

getRenewalPlanValue()

public int getRenewalPlanValue()

The plan this capacity commitment is converted to after commitment_end_time passes. Once the plan is changed, committed period is extended according to commitment plan. Only applicable for ANNUAL and TRIAL commitments.

.google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan renewal_plan = 8;

Returns
Type Description
int

The enum numeric value on the wire for renewalPlan.

getSerializedSize()

public int getSerializedSize()
Returns
Type Description
int
Overrides

getSlotCount()

public long getSlotCount()

Number of slots in this commitment.

int64 slot_count = 2;

Returns
Type Description
long

The slotCount.

getState()

public CapacityCommitment.State getState()

Output only. State of the commitment.

.google.cloud.bigquery.reservation.v1.CapacityCommitment.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
CapacityCommitment.State

The state.

getStateValue()

public int getStateValue()

Output only. State of the commitment.

.google.cloud.bigquery.reservation.v1.CapacityCommitment.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
int

The enum numeric value on the wire for state.

hasCommitmentEndTime()

public boolean hasCommitmentEndTime()

Output only. The end of the current commitment period. It is applicable only for ACTIVE capacity commitments.

.google.protobuf.Timestamp commitment_end_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
boolean

Whether the commitmentEndTime field is set.

hasCommitmentStartTime()

public boolean hasCommitmentStartTime()

Output only. The start of the current commitment period. It is applicable only for ACTIVE capacity commitments.

.google.protobuf.Timestamp commitment_start_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
boolean

Whether the commitmentStartTime field is set.

hasFailureStatus()

public boolean hasFailureStatus()

Output only. For FAILED commitment plan, provides the reason of failure.

.google.rpc.Status failure_status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
boolean

Whether the failureStatus field is set.

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

public CapacityCommitment.Builder newBuilderForType()
Returns
Type Description
CapacityCommitment.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected CapacityCommitment.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
CapacityCommitment.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
Name Description
unused UnusedPrivateParameter
Returns
Type Description
Object
Overrides

toBuilder()

public CapacityCommitment.Builder toBuilder()
Returns
Type Description
CapacityCommitment.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException