Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ service Plugin {
rpc Close(Close.Request) returns (Close.Response);
// Validate and test the connections used by the plugin
rpc TestConnection(TestConnection.Request) returns (TestConnection.Response);
// Assess how the destination plugin would apply table schema changes, without writing anything.
// Plugins that do not support assessment return Unimplemented.
rpc AssessTables(AssessTables.Request) returns (AssessTables.Response);
}

message GetName {
Expand Down Expand Up @@ -243,3 +246,53 @@ message TestConnection {
string failure_description = 3;
}
}

message AssessTables {
enum Category {
CATEGORY_UNKNOWN = 0;
CATEGORY_NO_CHANGE = 1;
CATEGORY_AUTOMATICALLY_MIGRATABLE = 2;
CATEGORY_MANUAL_MIGRATION_REQUIRED = 3;
CATEGORY_TABLE_REMOVED = 4;
CATEGORY_FILE_SCHEMA_CHANGED = 5;
}
message TablePair {
// marshalled arrow.Schema, empty when the table is added
bytes old_table = 1;
// marshalled arrow.Schema, empty when the table is removed
bytes new_table = 2;
}
message Evidence {
string synthetic_value = 1;
// Destination output for the synthetic value under the old and new schemas
string before = 2;
string after = 3;
}
message ColumnFinding {
string column_name = 1;
Category category = 2;
// Destination types, empty when the column is added or removed
string old_type = 3;
string new_type = 4;
string safe_mode_behavior = 5;
string forced_mode_behavior = 6;
repeated Evidence evidence = 7;
}
message TableFinding {
string table_name = 1;
Category category = 2;
string safe_mode_behavior = 3;
string forced_mode_behavior = 4;
repeated ColumnFinding columns = 5;
repeated Evidence evidence = 6;
bool coverage_incomplete = 7;
string coverage_incomplete_reason = 8;
}
message Request {
repeated TablePair tables = 1;
bool migrate_force = 2;
}
message Response {
repeated TableFinding tables = 1;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,37 @@ io.cloudquery.plugin.v3.TestConnection.Response> getTestConnectionMethod() {
return getTestConnectionMethod;
}

private static volatile io.grpc.MethodDescriptor<io.cloudquery.plugin.v3.AssessTables.Request,
io.cloudquery.plugin.v3.AssessTables.Response> getAssessTablesMethod;

@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "AssessTables",
requestType = io.cloudquery.plugin.v3.AssessTables.Request.class,
responseType = io.cloudquery.plugin.v3.AssessTables.Response.class,
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
public static io.grpc.MethodDescriptor<io.cloudquery.plugin.v3.AssessTables.Request,
io.cloudquery.plugin.v3.AssessTables.Response> getAssessTablesMethod() {
io.grpc.MethodDescriptor<io.cloudquery.plugin.v3.AssessTables.Request, io.cloudquery.plugin.v3.AssessTables.Response> getAssessTablesMethod;
if ((getAssessTablesMethod = PluginGrpc.getAssessTablesMethod) == null) {
synchronized (PluginGrpc.class) {
if ((getAssessTablesMethod = PluginGrpc.getAssessTablesMethod) == null) {
PluginGrpc.getAssessTablesMethod = getAssessTablesMethod =
io.grpc.MethodDescriptor.<io.cloudquery.plugin.v3.AssessTables.Request, io.cloudquery.plugin.v3.AssessTables.Response>newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "AssessTables"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
io.cloudquery.plugin.v3.AssessTables.Request.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
io.cloudquery.plugin.v3.AssessTables.Response.getDefaultInstance()))
.setSchemaDescriptor(new PluginMethodDescriptorSupplier("AssessTables"))
.build();
}
}
}
return getAssessTablesMethod;
}

/**
* Creates a new async stub that supports all call types for the service
*/
Expand Down Expand Up @@ -569,6 +600,17 @@ default void testConnection(io.cloudquery.plugin.v3.TestConnection.Request reque
io.grpc.stub.StreamObserver<io.cloudquery.plugin.v3.TestConnection.Response> responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getTestConnectionMethod(), responseObserver);
}

/**
* <pre>
* Assess how the destination plugin would apply table schema changes, without writing anything.
* Plugins that do not support assessment return Unimplemented.
* </pre>
*/
default void assessTables(io.cloudquery.plugin.v3.AssessTables.Request request,
io.grpc.stub.StreamObserver<io.cloudquery.plugin.v3.AssessTables.Response> responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getAssessTablesMethod(), responseObserver);
}
}

/**
Expand Down Expand Up @@ -732,6 +774,18 @@ public void testConnection(io.cloudquery.plugin.v3.TestConnection.Request reques
io.grpc.stub.ClientCalls.asyncUnaryCall(
getChannel().newCall(getTestConnectionMethod(), getCallOptions()), request, responseObserver);
}

/**
* <pre>
* Assess how the destination plugin would apply table schema changes, without writing anything.
* Plugins that do not support assessment return Unimplemented.
* </pre>
*/
public void assessTables(io.cloudquery.plugin.v3.AssessTables.Request request,
io.grpc.stub.StreamObserver<io.cloudquery.plugin.v3.AssessTables.Response> responseObserver) {
io.grpc.stub.ClientCalls.asyncUnaryCall(
getChannel().newCall(getAssessTablesMethod(), getCallOptions()), request, responseObserver);
}
}

/**
Expand Down Expand Up @@ -880,6 +934,17 @@ public io.cloudquery.plugin.v3.TestConnection.Response testConnection(io.cloudqu
return io.grpc.stub.ClientCalls.blockingV2UnaryCall(
getChannel(), getTestConnectionMethod(), getCallOptions(), request);
}

/**
* <pre>
* Assess how the destination plugin would apply table schema changes, without writing anything.
* Plugins that do not support assessment return Unimplemented.
* </pre>
*/
public io.cloudquery.plugin.v3.AssessTables.Response assessTables(io.cloudquery.plugin.v3.AssessTables.Request request) throws io.grpc.StatusException {
return io.grpc.stub.ClientCalls.blockingV2UnaryCall(
getChannel(), getAssessTablesMethod(), getCallOptions(), request);
}
}

/**
Expand Down Expand Up @@ -1002,6 +1067,17 @@ public io.cloudquery.plugin.v3.TestConnection.Response testConnection(io.cloudqu
return io.grpc.stub.ClientCalls.blockingUnaryCall(
getChannel(), getTestConnectionMethod(), getCallOptions(), request);
}

/**
* <pre>
* Assess how the destination plugin would apply table schema changes, without writing anything.
* Plugins that do not support assessment return Unimplemented.
* </pre>
*/
public io.cloudquery.plugin.v3.AssessTables.Response assessTables(io.cloudquery.plugin.v3.AssessTables.Request request) {
return io.grpc.stub.ClientCalls.blockingUnaryCall(
getChannel(), getAssessTablesMethod(), getCallOptions(), request);
}
}

/**
Expand Down Expand Up @@ -1109,6 +1185,18 @@ public com.google.common.util.concurrent.ListenableFuture<io.cloudquery.plugin.v
return io.grpc.stub.ClientCalls.futureUnaryCall(
getChannel().newCall(getTestConnectionMethod(), getCallOptions()), request);
}

/**
* <pre>
* Assess how the destination plugin would apply table schema changes, without writing anything.
* Plugins that do not support assessment return Unimplemented.
* </pre>
*/
public com.google.common.util.concurrent.ListenableFuture<io.cloudquery.plugin.v3.AssessTables.Response> assessTables(
io.cloudquery.plugin.v3.AssessTables.Request request) {
return io.grpc.stub.ClientCalls.futureUnaryCall(
getChannel().newCall(getAssessTablesMethod(), getCallOptions()), request);
}
}

private static final int METHODID_GET_NAME = 0;
Expand All @@ -1121,8 +1209,9 @@ public com.google.common.util.concurrent.ListenableFuture<io.cloudquery.plugin.v
private static final int METHODID_TRANSFORM_SCHEMA = 7;
private static final int METHODID_CLOSE = 8;
private static final int METHODID_TEST_CONNECTION = 9;
private static final int METHODID_WRITE = 10;
private static final int METHODID_TRANSFORM = 11;
private static final int METHODID_ASSESS_TABLES = 10;
private static final int METHODID_WRITE = 11;
private static final int METHODID_TRANSFORM = 12;

private static final class MethodHandlers<Req, Resp> implements
io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>,
Expand Down Expand Up @@ -1181,6 +1270,10 @@ public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserv
serviceImpl.testConnection((io.cloudquery.plugin.v3.TestConnection.Request) request,
(io.grpc.stub.StreamObserver<io.cloudquery.plugin.v3.TestConnection.Response>) responseObserver);
break;
case METHODID_ASSESS_TABLES:
serviceImpl.assessTables((io.cloudquery.plugin.v3.AssessTables.Request) request,
(io.grpc.stub.StreamObserver<io.cloudquery.plugin.v3.AssessTables.Response>) responseObserver);
break;
default:
throw new AssertionError();
}
Expand Down Expand Up @@ -1289,6 +1382,13 @@ public static final io.grpc.ServerServiceDefinition bindService(AsyncService ser
io.cloudquery.plugin.v3.TestConnection.Request,
io.cloudquery.plugin.v3.TestConnection.Response>(
service, METHODID_TEST_CONNECTION)))
.addMethod(
getAssessTablesMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
io.cloudquery.plugin.v3.AssessTables.Request,
io.cloudquery.plugin.v3.AssessTables.Response>(
service, METHODID_ASSESS_TABLES)))
.build();
}

Expand Down Expand Up @@ -1349,6 +1449,7 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() {
.addMethod(getTransformSchemaMethod())
.addMethod(getCloseMethod())
.addMethod(getTestConnectionMethod())
.addMethod(getAssessTablesMethod())
.build();
}
}
Expand Down
Loading
Loading