val connection = BigtableConfiguration.connect(projectID, instanceID)
val admin = connection.getAdmin
Try {
admin.tableExists(TableName.valueOf(tableName)) match {
case true => connection.getTable(TableName.valueOf(tableName))
case false => throw new IllegalStateException("The requested table do not exist.")
}
}
This code can check if the table exists for a valid project ID and instance ID. Otherwise it will error out. Is there any way to check if the project ID and instance ID are valid using bigtable HBase API? I couldn't find a method to do that.