Skip to content

Commit

Permalink
clean up Javadoc, and add a Javadoc build target
Browse files Browse the repository at this point in the history
  • Loading branch information
hegemonic committed Aug 26, 2015
1 parent a833f89 commit 1d458ec
Show file tree
Hide file tree
Showing 12 changed files with 357 additions and 78 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Expand Up @@ -10,4 +10,4 @@ release.properties
.settings
.gradle
dependency-reduced-pom.xml

.DS_Store
12 changes: 12 additions & 0 deletions bigtable-hbase-dataflow/javadoc/dataflow-docs/package-list
@@ -0,0 +1,12 @@
com.google.cloud.dataflow.sdk
com.google.cloud.dataflow.sdk.annotations
com.google.cloud.dataflow.sdk.coders
com.google.cloud.dataflow.sdk.io
com.google.cloud.dataflow.sdk.io.range
com.google.cloud.dataflow.sdk.options
com.google.cloud.dataflow.sdk.runners
com.google.cloud.dataflow.sdk.testing
com.google.cloud.dataflow.sdk.transforms
com.google.cloud.dataflow.sdk.transforms.join
com.google.cloud.dataflow.sdk.transforms.windowing
com.google.cloud.dataflow.sdk.values
47 changes: 47 additions & 0 deletions bigtable-hbase-dataflow/javadoc/hbase-docs/package-list
@@ -0,0 +1,47 @@
org.apache.hadoop.hbase
org.apache.hadoop.hbase.classification
org.apache.hadoop.hbase.classification.tools
org.apache.hadoop.hbase.client
org.apache.hadoop.hbase.client.backoff
org.apache.hadoop.hbase.client.example
org.apache.hadoop.hbase.client.replication
org.apache.hadoop.hbase.conf
org.apache.hadoop.hbase.coordination
org.apache.hadoop.hbase.coprocessor
org.apache.hadoop.hbase.errorhandling
org.apache.hadoop.hbase.exceptions
org.apache.hadoop.hbase.filter
org.apache.hadoop.hbase.http
org.apache.hadoop.hbase.http.conf
org.apache.hadoop.hbase.http.jmx
org.apache.hadoop.hbase.http.log
org.apache.hadoop.hbase.io
org.apache.hadoop.hbase.io.compress
org.apache.hadoop.hbase.io.crypto
org.apache.hadoop.hbase.io.crypto.aes
org.apache.hadoop.hbase.io.encoding
org.apache.hadoop.hbase.io.hadoopbackport
org.apache.hadoop.hbase.io.hfile
org.apache.hadoop.hbase.io.util
org.apache.hadoop.hbase.ipc
org.apache.hadoop.hbase.mapred
org.apache.hadoop.hbase.mapreduce
org.apache.hadoop.hbase.master
org.apache.hadoop.hbase.mob
org.apache.hadoop.hbase.mob.compactions
org.apache.hadoop.hbase.mob.mapreduce
org.apache.hadoop.hbase.namespace
org.apache.hadoop.hbase.nio
org.apache.hadoop.hbase.quotas
org.apache.hadoop.hbase.regionserver
org.apache.hadoop.hbase.regionserver.wal
org.apache.hadoop.hbase.replication
org.apache.hadoop.hbase.rest
org.apache.hadoop.hbase.rest.client
org.apache.hadoop.hbase.security
org.apache.hadoop.hbase.snapshot
org.apache.hadoop.hbase.types
org.apache.hadoop.hbase.util
org.apache.hadoop.hbase.util.hbck
org.apache.hadoop.hbase.wal
org.apache.hadoop.hbase.zookeeper
30 changes: 30 additions & 0 deletions bigtable-hbase-dataflow/pom.xml
Expand Up @@ -138,6 +138,36 @@ limitations under the License.
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<windowtitle>Google Cloud Dataflow + Cloud Bigtable Connector ${project.version} API</windowtitle>
<doctitle>Google Cloud Dataflow + Cloud Bigtable Connector ${project.version} API</doctitle>
<overview>../overview.html</overview>
<bottom><![CDATA[<br>]]></bottom>

<offlineLinks>
<offlineLink>
<url>https://cloud.google.com/dataflow/java-sdk/JavaDoc/</url>
<location>${basedir}/javadoc/dataflow-docs</location>
</offlineLink>
<offlineLink>
<url>http://hbase.apache.org/apidocs/</url>
<location>${basedir}/javadoc/hbase-docs</location>
</offlineLink>
</offlineLinks>
</configuration>
<executions>
<execution>
<goals>
<goal>jar</goal>
</goals>
<phase>package</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Expand Up @@ -23,34 +23,56 @@
import com.google.cloud.bigtable.hbase.BigtableOptionsFactory;

/**
* This class defines all of the information Cloud Bigtable client needs to connect to a user's
* Cloud Bigtable cluster.
* This class defines information that a Cloud Bigtable client needs to connect to a user's Cloud
* Bigtable cluster.
*/
public class CloudBigtableConfiguration implements Serializable {

private static final long serialVersionUID = 1655181275627002133L;

/**
* Builds a {@link CloudBigtableConfiguration}.
*/
@SuppressWarnings("unchecked")
public static class Builder<T extends Builder<?>> {
protected String projectId;
protected String zoneId;
protected String clusterId;

/**
* Specifies the project ID for the Cloud Bigtable cluster.
* @param projectId The project ID for the cluster.
* @return The original {@link CloudBigtableConfiguration.Builder} for chaining convenience.
*/
public T withProjectId(String projectId) {
this.projectId = projectId;
return (T) this;
}

/**
* Specifies the zone where the Cloud Bigtable cluster is located.
* @param zoneId The zone where the cluster is located.
* @return The original {@link CloudBigtableConfiguration.Builder} for chaining convenience.
*/
public T withZoneId(String zoneId) {
this.zoneId = zoneId;
return (T) this;
}

/**
* Specifies the cluster ID for the Cloud Bigtable cluster.
* @param clusterId The cluster ID for the cluster.
* @return The original {@link CloudBigtableConfiguration.Builder} for chaining convenience.
*/
public T withClusterId(String clusterId) {
this.clusterId = clusterId;
return (T) this;
}

/**
* Builds the {@link CloudBigtableConfiguration}.
* @return The new {@link CloudBigtableConfiguration}.
*/
public CloudBigtableConfiguration build() {
return new CloudBigtableConfiguration(projectId, zoneId, clusterId);
}
Expand All @@ -65,24 +87,47 @@ public CloudBigtableConfiguration build() {
CloudBigtableConfiguration() {
}

/**
* Creates a {@link CloudBigtableConfiguration} using the specified project ID, zone, and cluster
* ID.
* @param projectId The project ID for the cluster.
* @param zoneId The zone where the cluster is located.
* @param clusterId The cluster ID for the cluster.
*/
public CloudBigtableConfiguration(String projectId, String zoneId, String clusterId) {
this.projectId = projectId;
this.zoneId = zoneId;
this.clusterId = clusterId;
}

/**
* Gets the project ID for the Cloud Bigtable cluster.
* @return The project ID for the cluster.
*/
public String getProjectId() {
return projectId;
}

/**
* Gets the zone where the Cloud Bigtable cluster is located.
* @return The zone where the cluster is located.
*/
public String getZoneId() {
return zoneId;
}

/**
* Gets the cluster ID for the Cloud Bigtable cluster.
* @return The cluster ID for the cluster.
*/
public String getClusterId() {
return clusterId;
}

/**
* Converts the {@link CloudBigtableConfiguration} to a {@link BigtableOptions} object.
* @return The {@link BigtableOptions} object.
*/
public BigtableOptions toBigtableOptions() {
return new BigtableOptions.Builder()
.setProjectId(getProjectId())
Expand All @@ -92,6 +137,10 @@ public BigtableOptions toBigtableOptions() {
.build();
}

/**
* Converts the {@link CloudBigtableConfiguration} to an HBase {@link Configuration}.
* @return The {@link Configuration}.
*/
public Configuration toHBaseConfig() {
Configuration config = new Configuration();
config.set(BigtableOptionsFactory.PROJECT_ID_KEY, getProjectId());
Expand Down

0 comments on commit 1d458ec

Please sign in to comment.