Send feedback
Class RemoteSpannerHelper
Stay organized with collections
Save and categorize content based on your preferences.
Version 6.24.0 keyboard_arrow_down
public class RemoteSpannerHelper
Utility that provides access to a Cloud Spanner instance to use for tests, and allows uniquely
named test databases to be created within that instance.
Static Methods
create(InstanceId instanceId)
public static RemoteSpannerHelper create ( InstanceId instanceId )
Creates a RemoteSpannerHelper
bound to the given instance ID. All databases created
using this will be created in the given instance.
Parameter
Returns
create(SpannerOptions options, InstanceId instanceId)
public static RemoteSpannerHelper create ( SpannerOptions options , InstanceId instanceId )
Creates a RemoteSpannerHelper
for the given option and bound to the given instance ID.
All databases created using this will be created in the given instance.
Parameters
Returns
Constructors
RemoteSpannerHelper(SpannerOptions options, InstanceId instanceId, Spanner client)
protected RemoteSpannerHelper ( SpannerOptions options , InstanceId instanceId , Spanner client )
Parameters
Methods
cleanUp()
Deletes all the databases created via createTestDatabase
. Shuts down the client.
createTestDatabase(Dialect dialect, Iterable<String> statements)
public Database createTestDatabase ( Dialect dialect , Iterable<String> statements )
Creates a test database defined by statements
in the test instance. A CREATE
DATABASE ...
statement should not be included; an appropriate name will be chosen and the
statement generated accordingly.
Parameters
Returns
Exceptions
createTestDatabase(Iterable<String> statements)
public Database createTestDatabase ( Iterable<String> statements )
Parameter
Returns
Exceptions
createTestDatabase(String[] statements)
public Database createTestDatabase ( String [] statements )
Creates a test database defined by statements
. A CREATE DATABASE ...
statement
should not be included; an appropriate name will be chosen and the statement generated
accordingly.
Parameter
Name Description statements String []
Returns
Exceptions
getBatchClient(Database db)
public BatchClient getBatchClient ( Database db )
Parameter
Returns
getClient()
public Spanner getClient ()
Returns
getDatabaseClient(Database db)
public DatabaseClient getDatabaseClient ( Database db )
Parameter
Returns
getInstanceId()
public InstanceId getInstanceId ()
Returns
getOptions()
public SpannerOptions getOptions ()
Returns
getUniqueBackupId()
public String getUniqueBackupId ()
Returns a backup id which is guaranteed to be unique within the context of this environment.
Returns
getUniqueDatabaseId()
public String getUniqueDatabaseId ()
Returns a database id which is guaranteed to be unique within the context of this environment.
Returns
isEmulator() (deprecated)
public boolean isEmulator ()
Returns
Type Description boolean true if the emulator is being used. Returns false otherwise.
Send feedback
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-09-19 UTC.
[{
"type": "thumb-down",
"id": "hardToUnderstand",
"label":"Hard to understand"
},{
"type": "thumb-down",
"id": "incorrectInformationOrSampleCode",
"label":"Incorrect information or sample code"
},{
"type": "thumb-down",
"id": "missingTheInformationSamplesINeed",
"label":"Missing the information/samples I need"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]
Need to tell us more?
{"lastModified": "Last updated 2024-09-19 UTC."}
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-09-19 UTC."]]