Class Database (6.77.0)

public final class Database extends GeneratedMessageV3 implements DatabaseOrBuilder

A Cloud Spanner database.

Protobuf type google.spanner.admin.database.v1.Database

Implements

DatabaseOrBuilder

Static Fields

CREATE_TIME_FIELD_NUMBER

public static final int CREATE_TIME_FIELD_NUMBER
Field Value
Type Description
int

DATABASE_DIALECT_FIELD_NUMBER

public static final int DATABASE_DIALECT_FIELD_NUMBER
Field Value
Type Description
int

DEFAULT_LEADER_FIELD_NUMBER

public static final int DEFAULT_LEADER_FIELD_NUMBER
Field Value
Type Description
int

EARLIEST_VERSION_TIME_FIELD_NUMBER

public static final int EARLIEST_VERSION_TIME_FIELD_NUMBER
Field Value
Type Description
int

ENABLE_DROP_PROTECTION_FIELD_NUMBER

public static final int ENABLE_DROP_PROTECTION_FIELD_NUMBER
Field Value
Type Description
int

ENCRYPTION_CONFIG_FIELD_NUMBER

public static final int ENCRYPTION_CONFIG_FIELD_NUMBER
Field Value
Type Description
int

ENCRYPTION_INFO_FIELD_NUMBER

public static final int ENCRYPTION_INFO_FIELD_NUMBER
Field Value
Type Description
int

NAME_FIELD_NUMBER

public static final int NAME_FIELD_NUMBER
Field Value
Type Description
int

RECONCILING_FIELD_NUMBER

public static final int RECONCILING_FIELD_NUMBER
Field Value
Type Description
int

RESTORE_INFO_FIELD_NUMBER

public static final int RESTORE_INFO_FIELD_NUMBER
Field Value
Type Description
int

STATE_FIELD_NUMBER

public static final int STATE_FIELD_NUMBER
Field Value
Type Description
int

VERSION_RETENTION_PERIOD_FIELD_NUMBER

public static final int VERSION_RETENTION_PERIOD_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

public static Database getDefaultInstance()
Returns
Type Description
Database

getDescriptor()

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

newBuilder()

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

newBuilder(Database prototype)

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

parseDelimitedFrom(InputStream input)

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

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

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

parseFrom(byte[] data)

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

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

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

parseFrom(ByteString data)

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

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

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

parseFrom(CodedInputStream input)

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

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

parseFrom(InputStream input)

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

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

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

parseFrom(ByteBuffer data)

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

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

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

parser()

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

Methods

equals(Object obj)

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

getCreateTime()

public Timestamp getCreateTime()

Output only. If exists, the time at which the database creation started.

.google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Timestamp

The createTime.

getCreateTimeOrBuilder()

public TimestampOrBuilder getCreateTimeOrBuilder()

Output only. If exists, the time at which the database creation started.

.google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
TimestampOrBuilder

getDatabaseDialect()

public DatabaseDialect getDatabaseDialect()

Output only. The dialect of the Cloud Spanner Database.

.google.spanner.admin.database.v1.DatabaseDialect database_dialect = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
DatabaseDialect

The databaseDialect.

getDatabaseDialectValue()

public int getDatabaseDialectValue()

Output only. The dialect of the Cloud Spanner Database.

.google.spanner.admin.database.v1.DatabaseDialect database_dialect = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
int

The enum numeric value on the wire for databaseDialect.

getDefaultInstanceForType()

public Database getDefaultInstanceForType()
Returns
Type Description
Database

getDefaultLeader()

public String getDefaultLeader()

Output only. The read-write region which contains the database's leader replicas.

This is the same as the value of default_leader database option set using DatabaseAdmin.CreateDatabase or DatabaseAdmin.UpdateDatabaseDdl. If not explicitly set, this is empty.

string default_leader = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
String

The defaultLeader.

getDefaultLeaderBytes()

public ByteString getDefaultLeaderBytes()

Output only. The read-write region which contains the database's leader replicas.

This is the same as the value of default_leader database option set using DatabaseAdmin.CreateDatabase or DatabaseAdmin.UpdateDatabaseDdl. If not explicitly set, this is empty.

string default_leader = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
ByteString

The bytes for defaultLeader.

getEarliestVersionTime()

public Timestamp getEarliestVersionTime()

Output only. Earliest timestamp at which older versions of the data can be read. This value is continuously updated by Cloud Spanner and becomes stale the moment it is queried. If you are using this value to recover data, make sure to account for the time from the moment when the value is queried to the moment when you initiate the recovery.

.google.protobuf.Timestamp earliest_version_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Timestamp

The earliestVersionTime.

getEarliestVersionTimeOrBuilder()

public TimestampOrBuilder getEarliestVersionTimeOrBuilder()

Output only. Earliest timestamp at which older versions of the data can be read. This value is continuously updated by Cloud Spanner and becomes stale the moment it is queried. If you are using this value to recover data, make sure to account for the time from the moment when the value is queried to the moment when you initiate the recovery.

.google.protobuf.Timestamp earliest_version_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
TimestampOrBuilder

getEnableDropProtection()

public boolean getEnableDropProtection()

Whether drop protection is enabled for this database. Defaults to false, if not set. For more details, please see how to prevent accidental database deletion.

bool enable_drop_protection = 11;

Returns
Type Description
boolean

The enableDropProtection.

getEncryptionConfig()

public EncryptionConfig getEncryptionConfig()

Output only. For databases that are using customer managed encryption, this field contains the encryption configuration for the database. For databases that are using Google default or other types of encryption, this field is empty.

.google.spanner.admin.database.v1.EncryptionConfig encryption_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
EncryptionConfig

The encryptionConfig.

getEncryptionConfigOrBuilder()

public EncryptionConfigOrBuilder getEncryptionConfigOrBuilder()

Output only. For databases that are using customer managed encryption, this field contains the encryption configuration for the database. For databases that are using Google default or other types of encryption, this field is empty.

.google.spanner.admin.database.v1.EncryptionConfig encryption_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
EncryptionConfigOrBuilder

getEncryptionInfo(int index)

public EncryptionInfo getEncryptionInfo(int index)

Output only. For databases that are using customer managed encryption, this field contains the encryption information for the database, such as all Cloud KMS key versions that are in use. The encryption_status' field inside of each EncryptionInfo` is not populated.

For databases that are using Google default or other types of encryption, this field is empty.

This field is propagated lazily from the backend. There might be a delay from when a key version is being used and when it appears in this field.

repeated .google.spanner.admin.database.v1.EncryptionInfo encryption_info = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
index int
Returns
Type Description
EncryptionInfo

getEncryptionInfoCount()

public int getEncryptionInfoCount()

Output only. For databases that are using customer managed encryption, this field contains the encryption information for the database, such as all Cloud KMS key versions that are in use. The encryption_status' field inside of each EncryptionInfo` is not populated.

For databases that are using Google default or other types of encryption, this field is empty.

This field is propagated lazily from the backend. There might be a delay from when a key version is being used and when it appears in this field.

repeated .google.spanner.admin.database.v1.EncryptionInfo encryption_info = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
int

getEncryptionInfoList()

public List<EncryptionInfo> getEncryptionInfoList()

Output only. For databases that are using customer managed encryption, this field contains the encryption information for the database, such as all Cloud KMS key versions that are in use. The encryption_status' field inside of each EncryptionInfo` is not populated.

For databases that are using Google default or other types of encryption, this field is empty.

This field is propagated lazily from the backend. There might be a delay from when a key version is being used and when it appears in this field.

repeated .google.spanner.admin.database.v1.EncryptionInfo encryption_info = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
List<EncryptionInfo>

getEncryptionInfoOrBuilder(int index)

public EncryptionInfoOrBuilder getEncryptionInfoOrBuilder(int index)

Output only. For databases that are using customer managed encryption, this field contains the encryption information for the database, such as all Cloud KMS key versions that are in use. The encryption_status' field inside of each EncryptionInfo` is not populated.

For databases that are using Google default or other types of encryption, this field is empty.

This field is propagated lazily from the backend. There might be a delay from when a key version is being used and when it appears in this field.

repeated .google.spanner.admin.database.v1.EncryptionInfo encryption_info = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
index int
Returns
Type Description
EncryptionInfoOrBuilder

getEncryptionInfoOrBuilderList()

public List<? extends EncryptionInfoOrBuilder> getEncryptionInfoOrBuilderList()

Output only. For databases that are using customer managed encryption, this field contains the encryption information for the database, such as all Cloud KMS key versions that are in use. The encryption_status' field inside of each EncryptionInfo` is not populated.

For databases that are using Google default or other types of encryption, this field is empty.

This field is propagated lazily from the backend. There might be a delay from when a key version is being used and when it appears in this field.

repeated .google.spanner.admin.database.v1.EncryptionInfo encryption_info = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
List<? extends com.google.spanner.admin.database.v1.EncryptionInfoOrBuilder>

getName()

public String getName()

Required. The name of the database. Values are of the form projects/<project>/instances/<instance>/databases/<database>, where <database> is as specified in the CREATE DATABASE statement. This name can be passed to other API methods to identify the database.

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

Returns
Type Description
String

The name.

getNameBytes()

public ByteString getNameBytes()

Required. The name of the database. Values are of the form projects/<project>/instances/<instance>/databases/<database>, where <database> is as specified in the CREATE DATABASE statement. This name can be passed to other API methods to identify the database.

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

Returns
Type Description
ByteString

The bytes for name.

getParserForType()

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

getReconciling()

public boolean getReconciling()

Output only. If true, the database is being updated. If false, there are no ongoing update operations for the database.

bool reconciling = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
boolean

The reconciling.

getRestoreInfo()

public RestoreInfo getRestoreInfo()

Output only. Applicable only for restored databases. Contains information about the restore source.

.google.spanner.admin.database.v1.RestoreInfo restore_info = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
RestoreInfo

The restoreInfo.

getRestoreInfoOrBuilder()

public RestoreInfoOrBuilder getRestoreInfoOrBuilder()

Output only. Applicable only for restored databases. Contains information about the restore source.

.google.spanner.admin.database.v1.RestoreInfo restore_info = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
RestoreInfoOrBuilder

getSerializedSize()

public int getSerializedSize()
Returns
Type Description
int
Overrides

getState()

public Database.State getState()

Output only. The current database state.

.google.spanner.admin.database.v1.Database.State state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Database.State

The state.

getStateValue()

public int getStateValue()

Output only. The current database state.

.google.spanner.admin.database.v1.Database.State state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
int

The enum numeric value on the wire for state.

getVersionRetentionPeriod()

public String getVersionRetentionPeriod()

Output only. The period in which Cloud Spanner retains all versions of data for the database. This is the same as the value of version_retention_period database option set using UpdateDatabaseDdl. Defaults to 1 hour, if not set.

string version_retention_period = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
String

The versionRetentionPeriod.

getVersionRetentionPeriodBytes()

public ByteString getVersionRetentionPeriodBytes()

Output only. The period in which Cloud Spanner retains all versions of data for the database. This is the same as the value of version_retention_period database option set using UpdateDatabaseDdl. Defaults to 1 hour, if not set.

string version_retention_period = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
ByteString

The bytes for versionRetentionPeriod.

hasCreateTime()

public boolean hasCreateTime()

Output only. If exists, the time at which the database creation started.

.google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
boolean

Whether the createTime field is set.

hasEarliestVersionTime()

public boolean hasEarliestVersionTime()

Output only. Earliest timestamp at which older versions of the data can be read. This value is continuously updated by Cloud Spanner and becomes stale the moment it is queried. If you are using this value to recover data, make sure to account for the time from the moment when the value is queried to the moment when you initiate the recovery.

.google.protobuf.Timestamp earliest_version_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
boolean

Whether the earliestVersionTime field is set.

hasEncryptionConfig()

public boolean hasEncryptionConfig()

Output only. For databases that are using customer managed encryption, this field contains the encryption configuration for the database. For databases that are using Google default or other types of encryption, this field is empty.

.google.spanner.admin.database.v1.EncryptionConfig encryption_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
boolean

Whether the encryptionConfig field is set.

hasRestoreInfo()

public boolean hasRestoreInfo()

Output only. Applicable only for restored databases. Contains information about the restore source.

.google.spanner.admin.database.v1.RestoreInfo restore_info = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
boolean

Whether the restoreInfo 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 Database.Builder newBuilderForType()
Returns
Type Description
Database.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

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

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

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

toBuilder()

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

writeTo(CodedOutputStream output)

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