com.google.cloud.bigtable.beam
Class CloudBigtableConfiguration
- java.lang.Object
-
- com.google.cloud.bigtable.beam.CloudBigtableConfiguration
-
- All Implemented Interfaces:
- Serializable
- Direct Known Subclasses:
- CloudBigtableTableConfiguration
public class CloudBigtableConfiguration extends Object implements Serializable
This class defines configuration that a Cloud Bigtable client needs to connect to a Cloud Bigtable instance.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static class
CloudBigtableConfiguration.Builder
Builds aCloudBigtableConfiguration
.
-
Field Summary
Fields Modifier and Type Field and Description static String
VALUE_UNAVAILABLE
-
Constructor Summary
Constructors Modifier Constructor and Description protected
CloudBigtableConfiguration(ValueProvider<String> projectId, ValueProvider<String> instanceId, Map<String,ValueProvider<String>> additionalConfiguration)
Creates aCloudBigtableConfiguration
using the specified project ID and instance ID.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description protected boolean
areParametersAccessible()
Checks if the parameters are accessible.protected static void
checkNotNullOrEmpty(String value, String name)
void
copyConfig(CloudBigtableConfiguration.Builder builder)
boolean
equals(Object obj)
Compares this configuration with the specified object.String
getAppProfileId()
Get the Cloud Bigtable App Profile id.protected com.google.bigtable.repackaged.com.google.common.collect.ImmutableMap<String,ValueProvider<String>>
getConfiguration()
Gets an immutable copy of the configuration map.protected static <T> String
getDisplayValue(ValueProvider<T> parameter)
String
getInstanceId()
Gets the Cloud Bigtable instance id.String
getProjectId()
Gets the project ID for the Cloud Bigtable instance.void
populateDisplayData(DisplayData.Builder builder)
com.google.bigtable.repackaged.com.google.cloud.bigtable.config.BigtableOptions
toBigtableOptions()
Converts theCloudBigtableConfiguration
to aBigtableOptions
object.CloudBigtableConfiguration.Builder
toBuilder()
Creates a newCloudBigtableConfiguration.Builder
object containing the existing configuration.org.apache.hadoop.conf.Configuration
toHBaseConfig()
Converts theCloudBigtableConfiguration
to an HBaseConfiguration
.void
validate()
-
-
-
Field Detail
-
VALUE_UNAVAILABLE
public static final String VALUE_UNAVAILABLE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CloudBigtableConfiguration
protected CloudBigtableConfiguration(ValueProvider<String> projectId, ValueProvider<String> instanceId, Map<String,ValueProvider<String>> additionalConfiguration)
Creates aCloudBigtableConfiguration
using the specified project ID and instance ID.- Parameters:
projectId
- The project ID for the instance.instanceId
- The instance ID.additionalConfiguration
- AMap
with additional connection configuration. SeeBigtableOptionsFactory.fromConfiguration(Configuration)
for more information about configuration options.
-
-
Method Detail
-
getProjectId
public String getProjectId()
Gets the project ID for the Cloud Bigtable instance.- Returns:
- The project ID for the instance.
-
getInstanceId
public String getInstanceId()
Gets the Cloud Bigtable instance id.- Returns:
- The Cloud Bigtable instance id.
-
getAppProfileId
public String getAppProfileId()
Get the Cloud Bigtable App Profile id.
-
toBigtableOptions
public com.google.bigtable.repackaged.com.google.cloud.bigtable.config.BigtableOptions toBigtableOptions() throws IOException
Converts theCloudBigtableConfiguration
to aBigtableOptions
object.- Returns:
- The
BigtableOptions
object. - Throws:
IOException
-
toHBaseConfig
public org.apache.hadoop.conf.Configuration toHBaseConfig()
Converts theCloudBigtableConfiguration
to an HBaseConfiguration
.- Returns:
- The
Configuration
.
-
toBuilder
public CloudBigtableConfiguration.Builder toBuilder()
Creates a newCloudBigtableConfiguration.Builder
object containing the existing configuration.- Returns:
- A new
CloudBigtableConfiguration.Builder
.
-
getConfiguration
protected com.google.bigtable.repackaged.com.google.common.collect.ImmutableMap<String,ValueProvider<String>> getConfiguration()
Gets an immutable copy of the configuration map.
-
equals
public boolean equals(Object obj)
Compares this configuration with the specified object.
-
copyConfig
public void copyConfig(CloudBigtableConfiguration.Builder builder)
-
areParametersAccessible
protected boolean areParametersAccessible()
Checks if the parameters are accessible. Runtime parameters are not accessible at pipeline construction time.
-
getDisplayValue
protected static <T> String getDisplayValue(ValueProvider<T> parameter)
- Type Parameters:
T
- parameter The runtime parameter.- Returns:
- the String value of runtime parameter if the parameter is accessible, returns "Unavailable during pipeline construction" otherwise for debugging purpose.
-
populateDisplayData
public void populateDisplayData(DisplayData.Builder builder)
-
validate
public void validate()
-
-