Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add String type with Utf8Raw encoding to Bigtable API #2191

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Original file line number Diff line number Diff line change
Expand Up @@ -455,15 +455,6 @@ public BigtableInstanceAdminStub createStub() throws IOException {
"Transport not supported: %s", getTransportChannelProvider().getTransportName()));
}

/** Returns the endpoint set by the user or the the service's default endpoint. */
@Override
public String getEndpoint() {
if (super.getEndpoint() != null) {
return super.getEndpoint();
}
return getDefaultEndpoint();
}

/** Returns the default service name. */
@Override
public String getServiceName() {
Expand Down Expand Up @@ -1229,15 +1220,6 @@ public UnaryCallSettings.Builder<SetIamPolicyRequest, Policy> setIamPolicySettin
return listHotTabletsSettings;
}

/** Returns the endpoint set by the user or the the service's default endpoint. */
@Override
public String getEndpoint() {
if (super.getEndpoint() != null) {
return super.getEndpoint();
}
return getDefaultEndpoint();
}

@Override
public BigtableInstanceAdminStubSettings build() throws IOException {
return new BigtableInstanceAdminStubSettings(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -671,15 +671,6 @@ public BigtableTableAdminStub createStub() throws IOException {
"Transport not supported: %s", getTransportChannelProvider().getTransportName()));
}

/** Returns the endpoint set by the user or the the service's default endpoint. */
@Override
public String getEndpoint() {
if (super.getEndpoint() != null) {
return super.getEndpoint();
}
return getDefaultEndpoint();
}

/** Returns the default service name. */
@Override
public String getServiceName() {
Expand Down Expand Up @@ -1722,15 +1713,6 @@ public UnaryCallSettings.Builder<SetIamPolicyRequest, Policy> setIamPolicySettin
return testIamPermissionsSettings;
}

/** Returns the endpoint set by the user or the the service's default endpoint. */
@Override
public String getEndpoint() {
if (super.getEndpoint() != null) {
return super.getEndpoint();
}
return getDefaultEndpoint();
}

@Override
public BigtableTableAdminStubSettings build() throws IOException {
return new BigtableTableAdminStubSettings(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,15 +158,6 @@ public BigtableStub createStub() throws IOException {
"Transport not supported: %s", getTransportChannelProvider().getTransportName()));
}

/** Returns the endpoint set by the user or the the service's default endpoint. */
@Override
public String getEndpoint() {
if (super.getEndpoint() != null) {
return super.getEndpoint();
}
return getDefaultEndpoint();
}

/** Returns the default service name. */
@Override
public String getServiceName() {
Expand Down Expand Up @@ -547,15 +538,6 @@ public UnaryCallSettings.Builder<MutateRowRequest, MutateRowResponse> mutateRowS
return readChangeStreamSettings;
}

/** Returns the endpoint set by the user or the the service's default endpoint. */
@Override
public String getEndpoint() {
if (super.getEndpoint() != null) {
return super.getEndpoint();
}
return getDefaultEndpoint();
}

@Override
public BigtableStubSettings build() throws IOException {
return new BigtableStubSettings(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,11 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde
.setJwtEnabledScopes(JWT_ENABLED_SCOPES);
}

@Override
public String getServiceName() {
return "bigtable";
}
Comment on lines +376 to +379
Copy link
Contributor

@lqiu96 lqiu96 Apr 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed that EnhancedBigtableStubSettings inherits directly from StubSettings and not BigtableStubSettings:

public class EnhancedBigtableStubSettings extends StubSettings<EnhancedBigtableStubSettings> {

EnhancedBigtableStubSettings will not be able to determine the serviceName because that is generated inside BigtableStubSettings. I have duplicated this here so the EnhancedStubSettings can determine the serviceName.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes sense, though Im curious why getServiceName() is not abstract in the base StubSettings class?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC, StubSettings is a public abstract class that is not marked with @InternalApi. We were afraid that there may be some use external use cases where users have extended or implemented StubSettings and now would need to implement getServiceName(). We provided a default implementation so that it would not break anyone.


/**
* Returns the object with the settings used for calls to ReadRows.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2114,6 +2114,24 @@
"allDeclaredClasses": true,
"allPublicClasses": true
},
{
"name": "com.google.bigtable.admin.v2.Table$AutomatedBackupPolicy",
"queryAllDeclaredConstructors": true,
"queryAllPublicConstructors": true,
"queryAllDeclaredMethods": true,
"allPublicMethods": true,
"allDeclaredClasses": true,
"allPublicClasses": true
},
{
"name": "com.google.bigtable.admin.v2.Table$AutomatedBackupPolicy$Builder",
"queryAllDeclaredConstructors": true,
"queryAllPublicConstructors": true,
"queryAllDeclaredMethods": true,
"allPublicMethods": true,
"allDeclaredClasses": true,
"allPublicClasses": true
},
{
"name": "com.google.bigtable.admin.v2.Table$Builder",
"queryAllDeclaredConstructors": true,
Expand Down Expand Up @@ -2330,6 +2348,60 @@
"allDeclaredClasses": true,
"allPublicClasses": true
},
{
"name": "com.google.bigtable.admin.v2.Type$String",
"queryAllDeclaredConstructors": true,
"queryAllPublicConstructors": true,
"queryAllDeclaredMethods": true,
"allPublicMethods": true,
"allDeclaredClasses": true,
"allPublicClasses": true
},
{
"name": "com.google.bigtable.admin.v2.Type$String$Builder",
"queryAllDeclaredConstructors": true,
"queryAllPublicConstructors": true,
"queryAllDeclaredMethods": true,
"allPublicMethods": true,
"allDeclaredClasses": true,
"allPublicClasses": true
},
{
"name": "com.google.bigtable.admin.v2.Type$String$Encoding",
"queryAllDeclaredConstructors": true,
"queryAllPublicConstructors": true,
"queryAllDeclaredMethods": true,
"allPublicMethods": true,
"allDeclaredClasses": true,
"allPublicClasses": true
},
{
"name": "com.google.bigtable.admin.v2.Type$String$Encoding$Builder",
"queryAllDeclaredConstructors": true,
"queryAllPublicConstructors": true,
"queryAllDeclaredMethods": true,
"allPublicMethods": true,
"allDeclaredClasses": true,
"allPublicClasses": true
},
{
"name": "com.google.bigtable.admin.v2.Type$String$Encoding$Utf8Raw",
"queryAllDeclaredConstructors": true,
"queryAllPublicConstructors": true,
"queryAllDeclaredMethods": true,
"allPublicMethods": true,
"allDeclaredClasses": true,
"allPublicClasses": true
},
{
"name": "com.google.bigtable.admin.v2.Type$String$Encoding$Utf8Raw$Builder",
"queryAllDeclaredConstructors": true,
"queryAllPublicConstructors": true,
"queryAllDeclaredMethods": true,
"allPublicMethods": true,
"allDeclaredClasses": true,
"allPublicClasses": true
},
{
"name": "com.google.bigtable.admin.v2.UndeleteTableMetadata",
"queryAllDeclaredConstructors": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/bigtable/admin/v2/instance.proto

// Protobuf Java Version: 3.25.2
// Protobuf Java Version: 3.25.3
package com.google.bigtable.admin.v2;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/bigtable/admin/v2/instance.proto

// Protobuf Java Version: 3.25.2
// Protobuf Java Version: 3.25.3
package com.google.bigtable.admin.v2;

public interface AppProfileOrBuilder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/bigtable/admin/v2/table.proto

// Protobuf Java Version: 3.25.2
// Protobuf Java Version: 3.25.3
package com.google.bigtable.admin.v2;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/bigtable/admin/v2/table.proto

// Protobuf Java Version: 3.25.2
// Protobuf Java Version: 3.25.3
package com.google.bigtable.admin.v2;

public interface AuthorizedViewOrBuilder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/bigtable/admin/v2/instance.proto

// Protobuf Java Version: 3.25.2
// Protobuf Java Version: 3.25.3
package com.google.bigtable.admin.v2;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/bigtable/admin/v2/instance.proto

// Protobuf Java Version: 3.25.2
// Protobuf Java Version: 3.25.3
package com.google.bigtable.admin.v2;

public interface AutoscalingLimitsOrBuilder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/bigtable/admin/v2/instance.proto

// Protobuf Java Version: 3.25.2
// Protobuf Java Version: 3.25.3
package com.google.bigtable.admin.v2;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/bigtable/admin/v2/instance.proto

// Protobuf Java Version: 3.25.2
// Protobuf Java Version: 3.25.3
package com.google.bigtable.admin.v2;

public interface AutoscalingTargetsOrBuilder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/bigtable/admin/v2/table.proto

// Protobuf Java Version: 3.25.2
// Protobuf Java Version: 3.25.3
package com.google.bigtable.admin.v2;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/bigtable/admin/v2/table.proto

// Protobuf Java Version: 3.25.2
// Protobuf Java Version: 3.25.3
package com.google.bigtable.admin.v2;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/bigtable/admin/v2/table.proto

// Protobuf Java Version: 3.25.2
// Protobuf Java Version: 3.25.3
package com.google.bigtable.admin.v2;

public interface BackupInfoOrBuilder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/bigtable/admin/v2/table.proto

// Protobuf Java Version: 3.25.2
// Protobuf Java Version: 3.25.3
package com.google.bigtable.admin.v2;

public interface BackupOrBuilder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/bigtable/admin/v2/bigtable_instance_admin.proto

// Protobuf Java Version: 3.25.2
// Protobuf Java Version: 3.25.3
package com.google.bigtable.admin.v2;

public final class BigtableInstanceAdminProto {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/bigtable/admin/v2/bigtable_table_admin.proto

// Protobuf Java Version: 3.25.2
// Protobuf Java Version: 3.25.3
package com.google.bigtable.admin.v2;

public final class BigtableTableAdminProto {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/bigtable/admin/v2/table.proto

// Protobuf Java Version: 3.25.2
// Protobuf Java Version: 3.25.3
package com.google.bigtable.admin.v2;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/bigtable/admin/v2/table.proto

// Protobuf Java Version: 3.25.2
// Protobuf Java Version: 3.25.3
package com.google.bigtable.admin.v2;

public interface ChangeStreamConfigOrBuilder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/bigtable/admin/v2/bigtable_table_admin.proto

// Protobuf Java Version: 3.25.2
// Protobuf Java Version: 3.25.3
package com.google.bigtable.admin.v2;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/bigtable/admin/v2/bigtable_table_admin.proto

// Protobuf Java Version: 3.25.2
// Protobuf Java Version: 3.25.3
package com.google.bigtable.admin.v2;

public interface CheckConsistencyRequestOrBuilder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/bigtable/admin/v2/bigtable_table_admin.proto

// Protobuf Java Version: 3.25.2
// Protobuf Java Version: 3.25.3
package com.google.bigtable.admin.v2;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/bigtable/admin/v2/bigtable_table_admin.proto

// Protobuf Java Version: 3.25.2
// Protobuf Java Version: 3.25.3
package com.google.bigtable.admin.v2;

public interface CheckConsistencyResponseOrBuilder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/bigtable/admin/v2/instance.proto

// Protobuf Java Version: 3.25.2
// Protobuf Java Version: 3.25.3
package com.google.bigtable.admin.v2;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/bigtable/admin/v2/instance.proto

// Protobuf Java Version: 3.25.2
// Protobuf Java Version: 3.25.3
package com.google.bigtable.admin.v2;

public interface ClusterOrBuilder
Expand Down