Package com.gpudb.protocol
Class RestoreBackupRequest
java.lang.Object
com.gpudb.protocol.RestoreBackupRequest
All Implemented Interfaces:
org.apache.avro.generic.GenericContainer, org.apache.avro.generic.IndexedRecordA set of parameters for
GPUdb.restoreBackup.
Restores database objects from a backup accessible via the data source specified by datasourceName.
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA set of string constants for theRestoreBackupRequestparameteroptions.static final classA set of string constants for theRestoreBackupRequestparameterrestoreObjectsMap.Constructor Summary
ConstructorsMethod Summary
Modifier and TypeMethodDescriptionbooleanget(int index) This method supports the Avro framework and is not intended to be called directly by the user.Name of the backup to restore from, which must refer to an existing backup.static org.apache.avro.SchemaThis method supports the Avro framework and is not intended to be called directly by the user.Data source through which the backup will be restored.Optional parameters.Map of database objects to be restored from the backup.org.apache.avro.SchemaThis method supports the Avro framework and is not intended to be called directly by the user.inthashCode()voidThis method supports the Avro framework and is not intended to be called directly by the user.setBackupName(String backupName) Name of the backup to restore from, which must refer to an existing backup.setDatasourceName(String datasourceName) Data source through which the backup will be restored.setOptions(Map<String, String> options) Optional parameters.setRestoreObjectsMap(Map<String, String> restoreObjectsMap) Map of database objects to be restored from the backup.toString()
Constructor Details
RestoreBackupRequest
public RestoreBackupRequest()Constructs a RestoreBackupRequest object with default parameters.RestoreBackupRequest
public RestoreBackupRequest(String backupName, Map<String, String> restoreObjectsMap, String datasourceName, Map<String, String> options) Constructs a RestoreBackupRequest object with the specified parameters.Parameters:backupName- Name of the backup to restore from, which must refer to an existing backup. The default value is ”.restoreObjectsMap- Map of database objects to be restored from the backup.ALL: All object types and data contained in the given schema(s).CONTEXT: Context(s).CREDENTIAL: Credential(s).DATASINK: Data sink(s).DATASOURCE: Data source(s).FUNCTION_ENVIRONMENT: Python UDF function environment(s).GRAPH: Graph(s) definition.MONITOR: Table monitor(s) / SQL stream(s).RESOURCE_GROUP: Resource group(s).ROLE: Role(s), role members (roles or users, recursively), and associated permissions.STORED_PROCEDURE: SQL procedure(s).TABLE: Table(s) and SQL view(s). Tables with subscriptions will by default be restored in the state they were in at the time of the snapshot. SeeRESTORE_SUBSCRIPTIONSfor options to override the default behavior.USER: User(s) (internal and external) and associated permissions.USER_DEFINED_FUNCTION: UDF(s).
datasourceName- Data source through which the backup will be restored.options- Optional parameters.BACKUP_ID: ID of the snapshot to restore. Leave empty to restore the most recent snapshot in the backup. The default value is ”.CHECKSUM: Whether or not to verify checksums for backup files when restoring. Supported values:The default value isFALSE.CREATE_SCHEMA_IF_NOT_EXIST: Behavior to apply when the schema containing any database object to restore does not already exist. Supported values:TRUE: If the schema containing any restored object does not exist, create it automatically.FALSE: If the schema containing any restored object does not exist, return an error.
TRUE.DDL_ONLY: Behavior to apply when restoring tables. Supported values:The default value isFALSE.DRY_RUN: Whether or not to perform a dry run of the restoration operation. Supported values:The default value isFALSE.RESTORE_SUBSCRIPTIONS: Behavior to apply when restoring datasource subscriptions on tables. Supported values:RESUME: Resume subscriptions that were active when the backup was made.PAUSE: Pause subscriptions that were active when the backup was made.CANCEL: Cancel active subscriptions.
RESUME.REINGEST: Behavior to apply when restoring table data. Supported values:TRUE: Restore table data by re-ingesting it. This is the default behavior if the cluster topology differs from that of the contained backup.FALSE: Restore the persisted data files directly.
FALSE.RENAMED_OBJECTS_SCHEMA: If theRESTORE_POLICYisRENAME, use this schema for relocated existing objects instead of the default generated one. The default value is ”.RESTORE_POLICY: Behavior to apply when any database object to restore already exists. Supported values:NONE: If an object to be restored already exists with the same name, abort and return error.REPLACE: If an object to be restored already exists with the same name, replace it with the backup version.RENAME: If an object to be restored already exists with the same name, move that existing one to the schema specified byRENAMED_OBJECTS_SCHEMA. This policy does not apply to non-schema objects.
NONE.
Map.
Method Details
getClassSchema
public static org.apache.avro.Schema getClassSchema()This method supports the Avro framework and is not intended to be called directly by the user.Returns:The schema for the class.setBackupName
Name of the backup to restore from, which must refer to an existing backup. The default value is ”.Parameters:backupName- The new value forbackupName.Returns:thisto mimic the builder pattern.getRestoreObjectsMap
Map of database objects to be restored from the backup.ALL: All object types and data contained in the given schema(s).CONTEXT: Context(s).CREDENTIAL: Credential(s).DATASINK: Data sink(s).DATASOURCE: Data source(s).FUNCTION_ENVIRONMENT: Python UDF function environment(s).GRAPH: Graph(s) definition.MONITOR: Table monitor(s) / SQL stream(s).RESOURCE_GROUP: Resource group(s).ROLE: Role(s), role members (roles or users, recursively), and associated permissions.STORED_PROCEDURE: SQL procedure(s).TABLE: Table(s) and SQL view(s). Tables with subscriptions will by default be restored in the state they were in at the time of the snapshot. SeeRESTORE_SUBSCRIPTIONSfor options to override the default behavior.USER: User(s) (internal and external) and associated permissions.USER_DEFINED_FUNCTION: UDF(s).
Returns:The current value ofrestoreObjectsMap.setRestoreObjectsMap
Map of database objects to be restored from the backup.ALL: All object types and data contained in the given schema(s).CONTEXT: Context(s).CREDENTIAL: Credential(s).DATASINK: Data sink(s).DATASOURCE: Data source(s).FUNCTION_ENVIRONMENT: Python UDF function environment(s).GRAPH: Graph(s) definition.MONITOR: Table monitor(s) / SQL stream(s).RESOURCE_GROUP: Resource group(s).ROLE: Role(s), role members (roles or users, recursively), and associated permissions.STORED_PROCEDURE: SQL procedure(s).TABLE: Table(s) and SQL view(s). Tables with subscriptions will by default be restored in the state they were in at the time of the snapshot. SeeRESTORE_SUBSCRIPTIONSfor options to override the default behavior.USER: User(s) (internal and external) and associated permissions.USER_DEFINED_FUNCTION: UDF(s).
Parameters:restoreObjectsMap- The new value forrestoreObjectsMap.Returns:thisto mimic the builder pattern.setDatasourceName
Data source through which the backup will be restored.Parameters:datasourceName- The new value fordatasourceName.Returns:thisto mimic the builder pattern.getOptions
Optional parameters.BACKUP_ID: ID of the snapshot to restore. Leave empty to restore the most recent snapshot in the backup. The default value is ”.CHECKSUM: Whether or not to verify checksums for backup files when restoring. Supported values:The default value isFALSE.CREATE_SCHEMA_IF_NOT_EXIST: Behavior to apply when the schema containing any database object to restore does not already exist. Supported values:TRUE: If the schema containing any restored object does not exist, create it automatically.FALSE: If the schema containing any restored object does not exist, return an error.
TRUE.DDL_ONLY: Behavior to apply when restoring tables. Supported values:The default value isFALSE.DRY_RUN: Whether or not to perform a dry run of the restoration operation. Supported values:The default value isFALSE.RESTORE_SUBSCRIPTIONS: Behavior to apply when restoring datasource subscriptions on tables. Supported values:RESUME: Resume subscriptions that were active when the backup was made.PAUSE: Pause subscriptions that were active when the backup was made.CANCEL: Cancel active subscriptions.
RESUME.REINGEST: Behavior to apply when restoring table data. Supported values:TRUE: Restore table data by re-ingesting it. This is the default behavior if the cluster topology differs from that of the contained backup.FALSE: Restore the persisted data files directly.
FALSE.RENAMED_OBJECTS_SCHEMA: If theRESTORE_POLICYisRENAME, use this schema for relocated existing objects instead of the default generated one. The default value is ”.RESTORE_POLICY: Behavior to apply when any database object to restore already exists. Supported values:NONE: If an object to be restored already exists with the same name, abort and return error.REPLACE: If an object to be restored already exists with the same name, replace it with the backup version.RENAME: If an object to be restored already exists with the same name, move that existing one to the schema specified byRENAMED_OBJECTS_SCHEMA. This policy does not apply to non-schema objects.
NONE.
Map.Returns:The current value ofoptions.setOptions
Optional parameters.BACKUP_ID: ID of the snapshot to restore. Leave empty to restore the most recent snapshot in the backup. The default value is ”.CHECKSUM: Whether or not to verify checksums for backup files when restoring. Supported values:The default value isFALSE.CREATE_SCHEMA_IF_NOT_EXIST: Behavior to apply when the schema containing any database object to restore does not already exist. Supported values:TRUE: If the schema containing any restored object does not exist, create it automatically.FALSE: If the schema containing any restored object does not exist, return an error.
TRUE.DDL_ONLY: Behavior to apply when restoring tables. Supported values:The default value isFALSE.DRY_RUN: Whether or not to perform a dry run of the restoration operation. Supported values:The default value isFALSE.RESTORE_SUBSCRIPTIONS: Behavior to apply when restoring datasource subscriptions on tables. Supported values:RESUME: Resume subscriptions that were active when the backup was made.PAUSE: Pause subscriptions that were active when the backup was made.CANCEL: Cancel active subscriptions.
RESUME.REINGEST: Behavior to apply when restoring table data. Supported values:TRUE: Restore table data by re-ingesting it. This is the default behavior if the cluster topology differs from that of the contained backup.FALSE: Restore the persisted data files directly.
FALSE.RENAMED_OBJECTS_SCHEMA: If theRESTORE_POLICYisRENAME, use this schema for relocated existing objects instead of the default generated one. The default value is ”.RESTORE_POLICY: Behavior to apply when any database object to restore already exists. Supported values:NONE: If an object to be restored already exists with the same name, abort and return error.REPLACE: If an object to be restored already exists with the same name, replace it with the backup version.RENAME: If an object to be restored already exists with the same name, move that existing one to the schema specified byRENAMED_OBJECTS_SCHEMA. This policy does not apply to non-schema objects.
NONE.
Map.Parameters:options- The new value foroptions.Returns:thisto mimic the builder pattern.getSchema
public org.apache.avro.Schema getSchema()This method supports the Avro framework and is not intended to be called directly by the user.Specified by:getSchemain interfaceorg.apache.avro.generic.GenericContainerReturns:The schema object describing this class.get
This method supports the Avro framework and is not intended to be called directly by the user.Specified by:getin interfaceorg.apache.avro.generic.IndexedRecordParameters:index- the position of the field to getReturns:value of the field with the given index.Throws:put
This method supports the Avro framework and is not intended to be called directly by the user.Specified by:putin interfaceorg.apache.avro.generic.IndexedRecordParameters:index- the position of the field to setvalue- the value to setThrows: