From 83d356433fa6915c6be66783ec61ebb7dfc1020c Mon Sep 17 00:00:00 2001 From: "cloudquery-ci[bot]" <271027272+cloudquery-ci[bot]@users.noreply.github.com> Date: Fri, 16 Oct 2026 09:44:07 +0000 Subject: [PATCH] fix: Generate Java Code from `plugin-pb` --- .../main/cloudquery/plugin/v3/plugin.proto | 47 +- .../io/cloudquery/plugin/v3/PluginGrpc.java | 88 ++ .../java/io/cloudquery/plugin/v3/Init.java | 105 ++ .../plugin/v3/PluginOuterClass.java | 302 ++-- .../java/io/cloudquery/plugin/v3/Sync.java | 805 ++++++++++ .../java/io/cloudquery/plugin/v3/Write.java | 1306 ++++++++++++++++- .../proto/cloudquery/plugin/v3/plugin.proto | 47 +- 7 files changed, 2544 insertions(+), 156 deletions(-) diff --git a/build/generated/proto-resources/main/cloudquery/plugin/v3/plugin.proto b/build/generated/proto-resources/main/cloudquery/plugin/v3/plugin.proto index 740e366..1136b82 100644 --- a/build/generated/proto-resources/main/cloudquery/plugin/v3/plugin.proto +++ b/build/generated/proto-resources/main/cloudquery/plugin/v3/plugin.proto @@ -38,6 +38,12 @@ service Plugin { // 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); + // Write resources, like Write, and also accept Write.MessageFlush. + // The plugin sends one Write.Response per Write.MessageFlush, once it has tried to commit every message sent before + // the flush. Write.Response.flush_error is set if some messages sent since the previous flush may not have been + // committed. + // Only use it with plugins that set Init.Response.supports_flush. + rpc WriteStream(stream Write.Request) returns (stream Write.Response); } message GetName { @@ -69,7 +75,10 @@ message Init { bool no_connection = 2; // A flag to indicate plugins should skip establishing a connection string invocation_id = 3; // unique execution_id that will identify the invocation (sync, migrate etc) } - message Response {} + message Response { + // The plugin supports WriteStream and Write.MessageFlush + bool supports_flush = 1; + } } message GetTables { @@ -102,6 +111,19 @@ message Sync { string table_name = 1; string error = 2; } + // State backend rows to persist once every message sent before the checkpoint is committed to all destinations. + // Only sent when Sync.Request.supports_checkpoints is set. + // + // The record must: + // - have the cq:table_name schema metadata set to Sync.BackendOptions.table_name + // - have a "key" column and a "value" column, both of the arrow utf8 type (not large_utf8) + // - have a "version" column of the arrow uint64 type, if the state table has one + // - hold only the keys that changed. Each row is an upsert of its key; keys not in the record keep their state. + // When the same key is in several checkpoints, the row with the highest version wins, or the last row without a version column. + message MessageCheckpoint { + // marshalled arrow.Record + bytes record = 1; + } message BackendOptions { @@ -122,6 +144,9 @@ message Sync { BackendOptions backend = 5; optional Shard shard = 6; bool withErrorMessages = 7; // If true, the plugin will send error messages in the response stream + // If true, the client persists state backend writes from Sync.MessageCheckpoint, + // so the plugin sends them on the stream instead of writing to the state backend + bool supports_checkpoints = 8; } message Response { oneof message { @@ -129,6 +154,7 @@ message Sync { Sync.MessageInsert insert = 2; Sync.MessageDeleteRecord delete_record = 3; Sync.MessageError error = 4; + Sync.MessageCheckpoint checkpoint = 5; } } } @@ -198,15 +224,30 @@ message Write { repeated PredicatesGroup where_clause = 2; repeated TableRelation table_relations = 3; } + // Commit every message sent before this one. Only valid on WriteStream. + message MessageFlush { + uint64 id = 1; + } message Request { oneof message { Write.MessageMigrateTable migrate_table = 1; Write.MessageInsert insert = 2; Write.MessageDeleteStale delete = 3; - Write.MessageDeleteRecord delete_record = 4; + Write.MessageDeleteRecord delete_record = 4; + Write.MessageFlush flush = 5; } } - message Response {} + message Response { + // WriteStream only: id of the Write.MessageFlush that completed + uint64 flush_id = 1; + // WriteStream only: why some messages sent since the previous flush may not have been committed. A failure may be + // reported only once, so a later flush can succeed although earlier messages were lost: clients must treat the + // first failure as final. A plugin may end the stream after reporting a failure, or instead of reporting it. + string flush_error = 2; + // WriteStream only: with flush_error, the tables whose messages may not have been committed. Empty if the plugin + // cannot tell, in which case messages of any table may have been lost. + repeated string failed_tables = 3; + } } message Transform { diff --git a/build/generated/sources/proto/main/grpc/io/cloudquery/plugin/v3/PluginGrpc.java b/build/generated/sources/proto/main/grpc/io/cloudquery/plugin/v3/PluginGrpc.java index 801b442..ef77bdc 100644 --- a/build/generated/sources/proto/main/grpc/io/cloudquery/plugin/v3/PluginGrpc.java +++ b/build/generated/sources/proto/main/grpc/io/cloudquery/plugin/v3/PluginGrpc.java @@ -415,6 +415,37 @@ io.cloudquery.plugin.v3.AssessTables.Response> getAssessTablesMethod() { return getAssessTablesMethod; } + private static volatile io.grpc.MethodDescriptor getWriteStreamMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "WriteStream", + requestType = io.cloudquery.plugin.v3.Write.Request.class, + responseType = io.cloudquery.plugin.v3.Write.Response.class, + methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) + public static io.grpc.MethodDescriptor getWriteStreamMethod() { + io.grpc.MethodDescriptor getWriteStreamMethod; + if ((getWriteStreamMethod = PluginGrpc.getWriteStreamMethod) == null) { + synchronized (PluginGrpc.class) { + if ((getWriteStreamMethod = PluginGrpc.getWriteStreamMethod) == null) { + PluginGrpc.getWriteStreamMethod = getWriteStreamMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "WriteStream")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.cloudquery.plugin.v3.Write.Request.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.cloudquery.plugin.v3.Write.Response.getDefaultInstance())) + .setSchemaDescriptor(new PluginMethodDescriptorSupplier("WriteStream")) + .build(); + } + } + } + return getWriteStreamMethod; + } + /** * Creates a new async stub that supports all call types for the service */ @@ -611,6 +642,20 @@ default void assessTables(io.cloudquery.plugin.v3.AssessTables.Request request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getAssessTablesMethod(), responseObserver); } + + /** + *
+     * Write resources, like Write, and also accept Write.MessageFlush.
+     * The plugin sends one Write.Response per Write.MessageFlush, once it has tried to commit every message sent before
+     * the flush. Write.Response.flush_error is set if some messages sent since the previous flush may not have been
+     * committed.
+     * Only use it with plugins that set Init.Response.supports_flush.
+     * 
+ */ + default io.grpc.stub.StreamObserver writeStream( + io.grpc.stub.StreamObserver responseObserver) { + return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getWriteStreamMethod(), responseObserver); + } } /** @@ -786,6 +831,21 @@ public void assessTables(io.cloudquery.plugin.v3.AssessTables.Request request, io.grpc.stub.ClientCalls.asyncUnaryCall( getChannel().newCall(getAssessTablesMethod(), getCallOptions()), request, responseObserver); } + + /** + *
+     * Write resources, like Write, and also accept Write.MessageFlush.
+     * The plugin sends one Write.Response per Write.MessageFlush, once it has tried to commit every message sent before
+     * the flush. Write.Response.flush_error is set if some messages sent since the previous flush may not have been
+     * committed.
+     * Only use it with plugins that set Init.Response.supports_flush.
+     * 
+ */ + public io.grpc.stub.StreamObserver writeStream( + io.grpc.stub.StreamObserver responseObserver) { + return io.grpc.stub.ClientCalls.asyncBidiStreamingCall( + getChannel().newCall(getWriteStreamMethod(), getCallOptions()), responseObserver); + } } /** @@ -945,6 +1005,22 @@ public io.cloudquery.plugin.v3.AssessTables.Response assessTables(io.cloudquery. return io.grpc.stub.ClientCalls.blockingV2UnaryCall( getChannel(), getAssessTablesMethod(), getCallOptions(), request); } + + /** + *
+     * Write resources, like Write, and also accept Write.MessageFlush.
+     * The plugin sends one Write.Response per Write.MessageFlush, once it has tried to commit every message sent before
+     * the flush. Write.Response.flush_error is set if some messages sent since the previous flush may not have been
+     * committed.
+     * Only use it with plugins that set Init.Response.supports_flush.
+     * 
+ */ + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/10918") + public io.grpc.stub.BlockingClientCall + writeStream() { + return io.grpc.stub.ClientCalls.blockingBidiStreamingCall( + getChannel(), getWriteStreamMethod(), getCallOptions()); + } } /** @@ -1212,6 +1288,7 @@ public com.google.common.util.concurrent.ListenableFuture implements io.grpc.stub.ServerCalls.UnaryMethod, @@ -1290,6 +1367,9 @@ public io.grpc.stub.StreamObserver invoke( case METHODID_TRANSFORM: return (io.grpc.stub.StreamObserver) serviceImpl.transform( (io.grpc.stub.StreamObserver) responseObserver); + case METHODID_WRITE_STREAM: + return (io.grpc.stub.StreamObserver) serviceImpl.writeStream( + (io.grpc.stub.StreamObserver) responseObserver); default: throw new AssertionError(); } @@ -1389,6 +1469,13 @@ public static final io.grpc.ServerServiceDefinition bindService(AsyncService ser io.cloudquery.plugin.v3.AssessTables.Request, io.cloudquery.plugin.v3.AssessTables.Response>( service, METHODID_ASSESS_TABLES))) + .addMethod( + getWriteStreamMethod(), + io.grpc.stub.ServerCalls.asyncBidiStreamingCall( + new MethodHandlers< + io.cloudquery.plugin.v3.Write.Request, + io.cloudquery.plugin.v3.Write.Response>( + service, METHODID_WRITE_STREAM))) .build(); } @@ -1450,6 +1537,7 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() { .addMethod(getCloseMethod()) .addMethod(getTestConnectionMethod()) .addMethod(getAssessTablesMethod()) + .addMethod(getWriteStreamMethod()) .build(); } } diff --git a/build/generated/sources/proto/main/java/io/cloudquery/plugin/v3/Init.java b/build/generated/sources/proto/main/java/io/cloudquery/plugin/v3/Init.java index da19bb8..2294a45 100644 --- a/build/generated/sources/proto/main/java/io/cloudquery/plugin/v3/Init.java +++ b/build/generated/sources/proto/main/java/io/cloudquery/plugin/v3/Init.java @@ -790,6 +790,16 @@ public io.cloudquery.plugin.v3.Init.Request getDefaultInstanceForType() { public interface ResponseOrBuilder extends // @@protoc_insertion_point(interface_extends:cloudquery.plugin.v3.Init.Response) com.google.protobuf.MessageOrBuilder { + + /** + *
+     * The plugin supports WriteStream and Write.MessageFlush
+     * 
+ * + * bool supports_flush = 1; + * @return The supportsFlush. + */ + boolean getSupportsFlush(); } /** * Protobuf type {@code cloudquery.plugin.v3.Init.Response} @@ -833,6 +843,21 @@ public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { io.cloudquery.plugin.v3.Init.Response.class, io.cloudquery.plugin.v3.Init.Response.Builder.class); } + public static final int SUPPORTS_FLUSH_FIELD_NUMBER = 1; + private boolean supportsFlush_ = false; + /** + *
+     * The plugin supports WriteStream and Write.MessageFlush
+     * 
+ * + * bool supports_flush = 1; + * @return The supportsFlush. + */ + @java.lang.Override + public boolean getSupportsFlush() { + return supportsFlush_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { @@ -847,14 +872,26 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (supportsFlush_ != false) { + output.writeBool(1, supportsFlush_); + } getUnknownFields().writeTo(output); } + private int computeSerializedSize_0() { + int size = 0; + if (supportsFlush_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(1, supportsFlush_); + } + return size; + } @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; + size += computeSerializedSize_0(); size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -870,6 +907,8 @@ public boolean equals(final java.lang.Object obj) { } io.cloudquery.plugin.v3.Init.Response other = (io.cloudquery.plugin.v3.Init.Response) obj; + if (getSupportsFlush() + != other.getSupportsFlush()) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -881,6 +920,9 @@ public int hashCode() { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + SUPPORTS_FLUSH_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getSupportsFlush()); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -1011,6 +1053,8 @@ private Builder( @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; + supportsFlush_ = false; return this; } @@ -1037,10 +1081,18 @@ public io.cloudquery.plugin.v3.Init.Response build() { @java.lang.Override public io.cloudquery.plugin.v3.Init.Response buildPartial() { io.cloudquery.plugin.v3.Init.Response result = new io.cloudquery.plugin.v3.Init.Response(this); + if (bitField0_ != 0) { buildPartial0(result); } onBuilt(); return result; } + private void buildPartial0(io.cloudquery.plugin.v3.Init.Response result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.supportsFlush_ = supportsFlush_; + } + } + @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof io.cloudquery.plugin.v3.Init.Response) { @@ -1053,6 +1105,9 @@ public Builder mergeFrom(com.google.protobuf.Message other) { public Builder mergeFrom(io.cloudquery.plugin.v3.Init.Response other) { if (other == io.cloudquery.plugin.v3.Init.Response.getDefaultInstance()) return this; + if (other.getSupportsFlush() != false) { + setSupportsFlush(other.getSupportsFlush()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -1077,6 +1132,11 @@ public Builder mergeFrom( case 0: done = true; break; + case 8: { + supportsFlush_ = input.readBool(); + bitField0_ |= 0x00000001; + break; + } // case 8 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { done = true; // was an endgroup tag @@ -1092,6 +1152,51 @@ public Builder mergeFrom( } // finally return this; } + private int bitField0_; + + private boolean supportsFlush_ ; + /** + *
+       * The plugin supports WriteStream and Write.MessageFlush
+       * 
+ * + * bool supports_flush = 1; + * @return The supportsFlush. + */ + @java.lang.Override + public boolean getSupportsFlush() { + return supportsFlush_; + } + /** + *
+       * The plugin supports WriteStream and Write.MessageFlush
+       * 
+ * + * bool supports_flush = 1; + * @param value The supportsFlush to set. + * @return This builder for chaining. + */ + public Builder setSupportsFlush(boolean value) { + + supportsFlush_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
+       * The plugin supports WriteStream and Write.MessageFlush
+       * 
+ * + * bool supports_flush = 1; + * @return This builder for chaining. + */ + public Builder clearSupportsFlush() { + bitField0_ = (bitField0_ & ~0x00000001); + supportsFlush_ = false; + onChanged(); + return this; + } // @@protoc_insertion_point(builder_scope:cloudquery.plugin.v3.Init.Response) } diff --git a/build/generated/sources/proto/main/java/io/cloudquery/plugin/v3/PluginOuterClass.java b/build/generated/sources/proto/main/java/io/cloudquery/plugin/v3/PluginOuterClass.java index f39e390..1cdf7a2 100644 --- a/build/generated/sources/proto/main/java/io/cloudquery/plugin/v3/PluginOuterClass.java +++ b/build/generated/sources/proto/main/java/io/cloudquery/plugin/v3/PluginOuterClass.java @@ -126,6 +126,11 @@ public static void registerAllExtensions( static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_cloudquery_plugin_v3_Sync_MessageError_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_cloudquery_plugin_v3_Sync_MessageCheckpoint_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_cloudquery_plugin_v3_Sync_MessageCheckpoint_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_cloudquery_plugin_v3_Sync_BackendOptions_descriptor; static final @@ -201,6 +206,11 @@ public static void registerAllExtensions( static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_cloudquery_plugin_v3_Write_MessageDeleteRecord_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_cloudquery_plugin_v3_Write_MessageFlush_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_cloudquery_plugin_v3_Write_MessageFlush_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_cloudquery_plugin_v3_Write_Request_descriptor; static final @@ -321,133 +331,143 @@ public static void registerAllExtensions( "onse\022\014\n\004name\030\001 \001(\t\"4\n\nGetVersion\032\t\n\007Requ" + "est\032\033\n\010Response\022\017\n\007version\030\001 \001(\t\"P\n\rGetS" + "pecSchema\032\t\n\007Request\0324\n\010Response\022\030\n\013json" + - "_schema\030\001 \001(\tH\000\210\001\001B\016\n\014_json_schema\"Y\n\004In" + + "_schema\030\001 \001(\tH\000\210\001\001B\016\n\014_json_schema\"q\n\004In" + "it\032E\n\007Request\022\014\n\004spec\030\001 \001(\014\022\025\n\rno_connec" + - "tion\030\002 \001(\010\022\025\n\rinvocation_id\030\003 \001(\t\032\n\n\010Res" + - "ponse\"v\n\tGetTables\032M\n\007Request\022\016\n\006tables\030" + - "\001 \003(\t\022\023\n\013skip_tables\030\002 \003(\t\022\035\n\025skip_depen" + - "dent_tables\030\003 \001(\010\032\032\n\010Response\022\016\n\006tables\030" + - "\001 \003(\014\"\262\007\n\004Sync\032\037\n\rMessageInsert\022\016\n\006recor" + - "d\030\001 \001(\014\032$\n\023MessageMigrateTable\022\r\n\005table\030" + - "\001 \001(\014\032\244\001\n\023MessageDeleteRecord\022\022\n\ntable_n" + - "ame\030\001 \001(\t\022;\n\014where_clause\030\002 \003(\0132%.cloudq" + - "uery.plugin.v3.PredicatesGroup\022<\n\017table_" + - "relations\030\003 \003(\0132#.cloudquery.plugin.v3.T" + - "ableRelation\0321\n\014MessageError\022\022\n\ntable_na" + - "me\030\001 \001(\t\022\r\n\005error\030\002 \001(\t\0328\n\016BackendOption" + - "s\022\022\n\ntable_name\030\001 \001(\t\022\022\n\nconnection\030\002 \001(" + - "\t\032\256\002\n\007Request\022\016\n\006tables\030\001 \003(\t\022\023\n\013skip_ta" + + "tion\030\002 \001(\010\022\025\n\rinvocation_id\030\003 \001(\t\032\"\n\010Res" + + "ponse\022\026\n\016supports_flush\030\001 \001(\010\"v\n\tGetTabl" + + "es\032M\n\007Request\022\016\n\006tables\030\001 \003(\t\022\023\n\013skip_ta" + "bles\030\002 \003(\t\022\035\n\025skip_dependent_tables\030\003 \001(" + - "\010\022\033\n\023deterministic_cq_id\030\004 \001(\010\022:\n\007backen" + - "d\030\005 \001(\0132).cloudquery.plugin.v3.Sync.Back" + - "endOptions\022<\n\005shard\030\006 \001(\0132(.cloudquery.p" + - "lugin.v3.Sync.Request.ShardH\000\210\001\001\022\031\n\021with" + - "ErrorMessages\030\007 \001(\010\032#\n\005Shard\022\013\n\003num\030\001 \001(" + - "\005\022\r\n\005total\030\002 \001(\005B\010\n\006_shard\032\235\002\n\010Response\022" + - "G\n\rmigrate_table\030\001 \001(\0132..cloudquery.plug" + - "in.v3.Sync.MessageMigrateTableH\000\022:\n\006inse" + - "rt\030\002 \001(\0132(.cloudquery.plugin.v3.Sync.Mes" + - "sageInsertH\000\022G\n\rdelete_record\030\003 \001(\0132..cl" + - "oudquery.plugin.v3.Sync.MessageDeleteRec" + - "ordH\000\0228\n\005error\030\004 \001(\0132\'.cloudquery.plugin" + - ".v3.Sync.MessageErrorH\000B\t\n\007message\"<\n\004Re" + - "ad\032\030\n\007Request\022\r\n\005table\030\001 \001(\014\032\032\n\010Response" + - "\022\016\n\006record\030\001 \001(\014\"9\n\rTableRelation\022\022\n\ntab" + - "le_name\030\001 \001(\t\022\024\n\014parent_table\030\002 \001(\t\"{\n\tP" + - "redicate\022:\n\010operator\030\001 \001(\0162(.cloudquery." + - "plugin.v3.Predicate.Operator\022\016\n\006column\030\002" + - " \001(\t\022\016\n\006record\030\003 \001(\014\"\022\n\010Operator\022\006\n\002EQ\020\000" + - "\"\262\001\n\017PredicatesGroup\022I\n\rgrouping_type\030\001 " + - "\001(\01622.cloudquery.plugin.v3.PredicatesGro" + - "up.GroupingType\0223\n\npredicates\030\002 \003(\0132\037.cl" + - "oudquery.plugin.v3.Predicate\"\037\n\014Grouping" + - "Type\022\007\n\003AND\020\000\022\006\n\002OR\020\001\"\303\005\n\005Write\032;\n\023Messa" + - "geMigrateTable\022\r\n\005table\030\001 \001(\014\022\025\n\rmigrate" + - "_force\030\002 \001(\010\032\037\n\rMessageInsert\022\016\n\006record\030" + - "\001 \001(\014\032\177\n\022MessageDeleteStale\022\021\n\005table\030\001 \001" + - "(\014B\002\030\001\022\023\n\013source_name\030\002 \001(\t\022-\n\tsync_time" + - "\030\003 \001(\0132\032.google.protobuf.Timestamp\022\022\n\nta" + - "ble_name\030\004 \001(\t\032\244\001\n\023MessageDeleteRecord\022\022" + - "\n\ntable_name\030\001 \001(\t\022;\n\014where_clause\030\002 \003(\013" + - "2%.cloudquery.plugin.v3.PredicatesGroup\022" + - "<\n\017table_relations\030\003 \003(\0132#.cloudquery.pl" + - "ugin.v3.TableRelation\032\247\002\n\007Request\022H\n\rmig" + - "rate_table\030\001 \001(\0132/.cloudquery.plugin.v3." + - "Write.MessageMigrateTableH\000\022;\n\006insert\030\002 " + - "\001(\0132).cloudquery.plugin.v3.Write.Message" + - "InsertH\000\022@\n\006delete\030\003 \001(\0132..cloudquery.pl" + - "ugin.v3.Write.MessageDeleteStaleH\000\022H\n\rde" + - "lete_record\030\004 \001(\0132/.cloudquery.plugin.v3" + - ".Write.MessageDeleteRecordH\000B\t\n\007message\032" + - "\n\n\010Response\"B\n\tTransform\032\031\n\007Request\022\016\n\006r" + - "ecord\030\001 \001(\014\032\032\n\010Response\022\016\n\006record\030\001 \001(\014\"" + - "H\n\017TransformSchema\032\031\n\007Request\022\016\n\006schema\030" + - "\001 \001(\014\032\032\n\010Response\022\016\n\006schema\030\001 \001(\014\"\036\n\005Clo" + - "se\032\t\n\007Request\032\n\n\010Response\"y\n\016TestConnect" + - "ion\032\027\n\007Request\022\014\n\004spec\030\001 \001(\014\032N\n\010Response" + - "\022\017\n\007success\030\001 \001(\010\022\024\n\014failure_code\030\002 \001(\t\022" + - "\033\n\023failure_description\030\003 \001(\t\"\301\010\n\014AssessT" + - "ables\0321\n\tTablePair\022\021\n\told_table\030\001 \001(\014\022\021\n" + - "\tnew_table\030\002 \001(\014\032B\n\010Evidence\022\027\n\017syntheti" + - "c_value\030\001 \001(\t\022\016\n\006before\030\002 \001(\t\022\r\n\005after\030\003" + - " \001(\t\032\200\002\n\rColumnFinding\022\023\n\013column_name\030\001 " + - "\001(\t\022=\n\010category\030\002 \001(\0162+.cloudquery.plugi" + - "n.v3.AssessTables.Category\022\020\n\010old_type\030\003" + - " \001(\t\022\020\n\010new_type\030\004 \001(\t\022\032\n\022safe_mode_beha" + - "vior\030\005 \001(\t\022\034\n\024forced_mode_behavior\030\006 \001(\t" + - "\022=\n\010evidence\030\007 \003(\0132+.cloudquery.plugin.v" + - "3.AssessTables.Evidence\032\301\002\n\014TableFinding" + - "\022\022\n\ntable_name\030\001 \001(\t\022=\n\010category\030\002 \001(\0162+" + - ".cloudquery.plugin.v3.AssessTables.Categ" + - "ory\022\032\n\022safe_mode_behavior\030\003 \001(\t\022\034\n\024force" + - "d_mode_behavior\030\004 \001(\t\022A\n\007columns\030\005 \003(\01320" + - ".cloudquery.plugin.v3.AssessTables.Colum" + - "nFinding\022=\n\010evidence\030\006 \003(\0132+.cloudquery." + - "plugin.v3.AssessTables.Evidence\022\"\n\032incom" + - "plete_coverage_reason\030\007 \001(\t\032^\n\007Request\022<" + - "\n\006tables\030\001 \003(\0132,.cloudquery.plugin.v3.As" + - "sessTables.TablePair\022\025\n\rmigrate_force\030\002 " + - "\001(\010\032K\n\010Response\022?\n\006tables\030\001 \003(\0132/.cloudq" + - "uery.plugin.v3.AssessTables.TableFinding" + - "\"\305\001\n\010Category\022\024\n\020CATEGORY_UNKNOWN\020\000\022\026\n\022C" + - "ATEGORY_NO_CHANGE\020\001\022%\n!CATEGORY_AUTOMATI" + - "CALLY_MIGRATABLE\020\002\022&\n\"CATEGORY_MANUAL_MI" + - "GRATION_REQUIRED\020\003\022\032\n\026CATEGORY_TABLE_REM" + - "OVED\020\004\022 \n\034CATEGORY_FILE_SCHEMA_CHANGED\020\005" + - "2\340\t\n\006Plugin\022X\n\007GetName\022%.cloudquery.plug" + - "in.v3.GetName.Request\032&.cloudquery.plugi" + - "n.v3.GetName.Response\022a\n\nGetVersion\022(.cl" + - "oudquery.plugin.v3.GetVersion.Request\032)." + - "cloudquery.plugin.v3.GetVersion.Response" + - "\022j\n\rGetSpecSchema\022+.cloudquery.plugin.v3" + - ".GetSpecSchema.Request\032,.cloudquery.plug" + - "in.v3.GetSpecSchema.Response\022O\n\004Init\022\".c" + - "loudquery.plugin.v3.Init.Request\032#.cloud" + - "query.plugin.v3.Init.Response\022^\n\tGetTabl" + - "es\022\'.cloudquery.plugin.v3.GetTables.Requ" + - "est\032(.cloudquery.plugin.v3.GetTables.Res" + - "ponse\022Q\n\004Sync\022\".cloudquery.plugin.v3.Syn" + - "c.Request\032#.cloudquery.plugin.v3.Sync.Re" + - "sponse0\001\022Q\n\004Read\022\".cloudquery.plugin.v3." + - "Read.Request\032#.cloudquery.plugin.v3.Read" + - ".Response0\001\022T\n\005Write\022#.cloudquery.plugin" + - ".v3.Write.Request\032$.cloudquery.plugin.v3" + - ".Write.Response(\001\022b\n\tTransform\022\'.cloudqu" + - "ery.plugin.v3.Transform.Request\032(.cloudq" + - "uery.plugin.v3.Transform.Response(\0010\001\022p\n" + - "\017TransformSchema\022-.cloudquery.plugin.v3." + - "TransformSchema.Request\032..cloudquery.plu" + - "gin.v3.TransformSchema.Response\022R\n\005Close" + - "\022#.cloudquery.plugin.v3.Close.Request\032$." + - "cloudquery.plugin.v3.Close.Response\022m\n\016T" + - "estConnection\022,.cloudquery.plugin.v3.Tes" + - "tConnection.Request\032-.cloudquery.plugin." + - "v3.TestConnection.Response\022g\n\014AssessTabl" + - "es\022*.cloudquery.plugin.v3.AssessTables.R" + - "equest\032+.cloudquery.plugin.v3.AssessTabl" + - "es.ResponseBS\n\027io.cloudquery.plugin.v3P\001" + - "Z6github.com/cloudquery/plugin-pb-go/pb/" + - "plugin/v3;pluginb\006proto3" + "\010\032\032\n\010Response\022\016\n\006tables\030\001 \003(\014\"\271\010\n\004Sync\032\037" + + "\n\rMessageInsert\022\016\n\006record\030\001 \001(\014\032$\n\023Messa" + + "geMigrateTable\022\r\n\005table\030\001 \001(\014\032\244\001\n\023Messag" + + "eDeleteRecord\022\022\n\ntable_name\030\001 \001(\t\022;\n\014whe" + + "re_clause\030\002 \003(\0132%.cloudquery.plugin.v3.P" + + "redicatesGroup\022<\n\017table_relations\030\003 \003(\0132" + + "#.cloudquery.plugin.v3.TableRelation\0321\n\014" + + "MessageError\022\022\n\ntable_name\030\001 \001(\t\022\r\n\005erro" + + "r\030\002 \001(\t\032#\n\021MessageCheckpoint\022\016\n\006record\030\001" + + " \001(\014\0328\n\016BackendOptions\022\022\n\ntable_name\030\001 \001" + + "(\t\022\022\n\nconnection\030\002 \001(\t\032\314\002\n\007Request\022\016\n\006ta" + + "bles\030\001 \003(\t\022\023\n\013skip_tables\030\002 \003(\t\022\035\n\025skip_" + + "dependent_tables\030\003 \001(\010\022\033\n\023deterministic_" + + "cq_id\030\004 \001(\010\022:\n\007backend\030\005 \001(\0132).cloudquer" + + "y.plugin.v3.Sync.BackendOptions\022<\n\005shard" + + "\030\006 \001(\0132(.cloudquery.plugin.v3.Sync.Reque" + + "st.ShardH\000\210\001\001\022\031\n\021withErrorMessages\030\007 \001(\010" + + "\022\034\n\024supports_checkpoints\030\010 \001(\010\032#\n\005Shard\022" + + "\013\n\003num\030\001 \001(\005\022\r\n\005total\030\002 \001(\005B\010\n\006_shard\032\341\002" + + "\n\010Response\022G\n\rmigrate_table\030\001 \001(\0132..clou" + + "dquery.plugin.v3.Sync.MessageMigrateTabl" + + "eH\000\022:\n\006insert\030\002 \001(\0132(.cloudquery.plugin." + + "v3.Sync.MessageInsertH\000\022G\n\rdelete_record" + + "\030\003 \001(\0132..cloudquery.plugin.v3.Sync.Messa" + + "geDeleteRecordH\000\0228\n\005error\030\004 \001(\0132\'.cloudq" + + "uery.plugin.v3.Sync.MessageErrorH\000\022B\n\nch" + + "eckpoint\030\005 \001(\0132,.cloudquery.plugin.v3.Sy" + + "nc.MessageCheckpointH\000B\t\n\007message\"<\n\004Rea" + + "d\032\030\n\007Request\022\r\n\005table\030\001 \001(\014\032\032\n\010Response\022" + + "\016\n\006record\030\001 \001(\014\"9\n\rTableRelation\022\022\n\ntabl" + + "e_name\030\001 \001(\t\022\024\n\014parent_table\030\002 \001(\t\"{\n\tPr" + + "edicate\022:\n\010operator\030\001 \001(\0162(.cloudquery.p" + + "lugin.v3.Predicate.Operator\022\016\n\006column\030\002 " + + "\001(\t\022\016\n\006record\030\003 \001(\014\"\022\n\010Operator\022\006\n\002EQ\020\000\"" + + "\262\001\n\017PredicatesGroup\022I\n\rgrouping_type\030\001 \001" + + "(\01622.cloudquery.plugin.v3.PredicatesGrou" + + "p.GroupingType\0223\n\npredicates\030\002 \003(\0132\037.clo" + + "udquery.plugin.v3.Predicate\"\037\n\014GroupingT" + + "ype\022\007\n\003AND\020\000\022\006\n\002OR\020\001\"\330\006\n\005Write\032;\n\023Messag" + + "eMigrateTable\022\r\n\005table\030\001 \001(\014\022\025\n\rmigrate_" + + "force\030\002 \001(\010\032\037\n\rMessageInsert\022\016\n\006record\030\001" + + " \001(\014\032\177\n\022MessageDeleteStale\022\021\n\005table\030\001 \001(" + + "\014B\002\030\001\022\023\n\013source_name\030\002 \001(\t\022-\n\tsync_time\030" + + "\003 \001(\0132\032.google.protobuf.Timestamp\022\022\n\ntab" + + "le_name\030\004 \001(\t\032\244\001\n\023MessageDeleteRecord\022\022\n" + + "\ntable_name\030\001 \001(\t\022;\n\014where_clause\030\002 \003(\0132" + + "%.cloudquery.plugin.v3.PredicatesGroup\022<" + + "\n\017table_relations\030\003 \003(\0132#.cloudquery.plu" + + "gin.v3.TableRelation\032\032\n\014MessageFlush\022\n\n\002" + + "id\030\001 \001(\004\032\342\002\n\007Request\022H\n\rmigrate_table\030\001 " + + "\001(\0132/.cloudquery.plugin.v3.Write.Message" + + "MigrateTableH\000\022;\n\006insert\030\002 \001(\0132).cloudqu" + + "ery.plugin.v3.Write.MessageInsertH\000\022@\n\006d" + + "elete\030\003 \001(\0132..cloudquery.plugin.v3.Write" + + ".MessageDeleteStaleH\000\022H\n\rdelete_record\030\004" + + " \001(\0132/.cloudquery.plugin.v3.Write.Messag" + + "eDeleteRecordH\000\0229\n\005flush\030\005 \001(\0132(.cloudqu" + + "ery.plugin.v3.Write.MessageFlushH\000B\t\n\007me" + + "ssage\032H\n\010Response\022\020\n\010flush_id\030\001 \001(\004\022\023\n\013f" + + "lush_error\030\002 \001(\t\022\025\n\rfailed_tables\030\003 \003(\t\"" + + "B\n\tTransform\032\031\n\007Request\022\016\n\006record\030\001 \001(\014\032" + + "\032\n\010Response\022\016\n\006record\030\001 \001(\014\"H\n\017Transform" + + "Schema\032\031\n\007Request\022\016\n\006schema\030\001 \001(\014\032\032\n\010Res" + + "ponse\022\016\n\006schema\030\001 \001(\014\"\036\n\005Close\032\t\n\007Reques" + + "t\032\n\n\010Response\"y\n\016TestConnection\032\027\n\007Reque" + + "st\022\014\n\004spec\030\001 \001(\014\032N\n\010Response\022\017\n\007success\030" + + "\001 \001(\010\022\024\n\014failure_code\030\002 \001(\t\022\033\n\023failure_d" + + "escription\030\003 \001(\t\"\301\010\n\014AssessTables\0321\n\tTab" + + "lePair\022\021\n\told_table\030\001 \001(\014\022\021\n\tnew_table\030\002" + + " \001(\014\032B\n\010Evidence\022\027\n\017synthetic_value\030\001 \001(" + + "\t\022\016\n\006before\030\002 \001(\t\022\r\n\005after\030\003 \001(\t\032\200\002\n\rCol" + + "umnFinding\022\023\n\013column_name\030\001 \001(\t\022=\n\010categ" + + "ory\030\002 \001(\0162+.cloudquery.plugin.v3.AssessT" + + "ables.Category\022\020\n\010old_type\030\003 \001(\t\022\020\n\010new_" + + "type\030\004 \001(\t\022\032\n\022safe_mode_behavior\030\005 \001(\t\022\034" + + "\n\024forced_mode_behavior\030\006 \001(\t\022=\n\010evidence" + + "\030\007 \003(\0132+.cloudquery.plugin.v3.AssessTabl" + + "es.Evidence\032\301\002\n\014TableFinding\022\022\n\ntable_na" + + "me\030\001 \001(\t\022=\n\010category\030\002 \001(\0162+.cloudquery." + + "plugin.v3.AssessTables.Category\022\032\n\022safe_" + + "mode_behavior\030\003 \001(\t\022\034\n\024forced_mode_behav" + + "ior\030\004 \001(\t\022A\n\007columns\030\005 \003(\01320.cloudquery." + + "plugin.v3.AssessTables.ColumnFinding\022=\n\010" + + "evidence\030\006 \003(\0132+.cloudquery.plugin.v3.As" + + "sessTables.Evidence\022\"\n\032incomplete_covera" + + "ge_reason\030\007 \001(\t\032^\n\007Request\022<\n\006tables\030\001 \003" + + "(\0132,.cloudquery.plugin.v3.AssessTables.T" + + "ablePair\022\025\n\rmigrate_force\030\002 \001(\010\032K\n\010Respo" + + "nse\022?\n\006tables\030\001 \003(\0132/.cloudquery.plugin." + + "v3.AssessTables.TableFinding\"\305\001\n\010Categor" + + "y\022\024\n\020CATEGORY_UNKNOWN\020\000\022\026\n\022CATEGORY_NO_C" + + "HANGE\020\001\022%\n!CATEGORY_AUTOMATICALLY_MIGRAT" + + "ABLE\020\002\022&\n\"CATEGORY_MANUAL_MIGRATION_REQU" + + "IRED\020\003\022\032\n\026CATEGORY_TABLE_REMOVED\020\004\022 \n\034CA" + + "TEGORY_FILE_SCHEMA_CHANGED\020\0052\276\n\n\006Plugin\022" + + "X\n\007GetName\022%.cloudquery.plugin.v3.GetNam" + + "e.Request\032&.cloudquery.plugin.v3.GetName" + + ".Response\022a\n\nGetVersion\022(.cloudquery.plu" + + "gin.v3.GetVersion.Request\032).cloudquery.p" + + "lugin.v3.GetVersion.Response\022j\n\rGetSpecS" + + "chema\022+.cloudquery.plugin.v3.GetSpecSche" + + "ma.Request\032,.cloudquery.plugin.v3.GetSpe" + + "cSchema.Response\022O\n\004Init\022\".cloudquery.pl" + + "ugin.v3.Init.Request\032#.cloudquery.plugin" + + ".v3.Init.Response\022^\n\tGetTables\022\'.cloudqu" + + "ery.plugin.v3.GetTables.Request\032(.cloudq" + + "uery.plugin.v3.GetTables.Response\022Q\n\004Syn" + + "c\022\".cloudquery.plugin.v3.Sync.Request\032#." + + "cloudquery.plugin.v3.Sync.Response0\001\022Q\n\004" + + "Read\022\".cloudquery.plugin.v3.Read.Request" + + "\032#.cloudquery.plugin.v3.Read.Response0\001\022" + + "T\n\005Write\022#.cloudquery.plugin.v3.Write.Re" + + "quest\032$.cloudquery.plugin.v3.Write.Respo" + + "nse(\001\022b\n\tTransform\022\'.cloudquery.plugin.v" + + "3.Transform.Request\032(.cloudquery.plugin." + + "v3.Transform.Response(\0010\001\022p\n\017TransformSc" + + "hema\022-.cloudquery.plugin.v3.TransformSch" + + "ema.Request\032..cloudquery.plugin.v3.Trans" + + "formSchema.Response\022R\n\005Close\022#.cloudquer" + + "y.plugin.v3.Close.Request\032$.cloudquery.p" + + "lugin.v3.Close.Response\022m\n\016TestConnectio" + + "n\022,.cloudquery.plugin.v3.TestConnection." + + "Request\032-.cloudquery.plugin.v3.TestConne" + + "ction.Response\022g\n\014AssessTables\022*.cloudqu" + + "ery.plugin.v3.AssessTables.Request\032+.clo" + + "udquery.plugin.v3.AssessTables.Response\022" + + "\\\n\013WriteStream\022#.cloudquery.plugin.v3.Wr" + + "ite.Request\032$.cloudquery.plugin.v3.Write" + + ".Response(\0010\001BS\n\027io.cloudquery.plugin.v3" + + "P\001Z6github.com/cloudquery/plugin-pb-go/p" + + "b/plugin/v3;pluginb\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, @@ -525,7 +545,7 @@ public static void registerAllExtensions( internal_static_cloudquery_plugin_v3_Init_Response_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_cloudquery_plugin_v3_Init_Response_descriptor, - new java.lang.String[] { }); + new java.lang.String[] { "SupportsFlush", }); internal_static_cloudquery_plugin_v3_GetTables_descriptor = getDescriptor().getMessageType(4); internal_static_cloudquery_plugin_v3_GetTables_fieldAccessorTable = new @@ -574,18 +594,24 @@ public static void registerAllExtensions( com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_cloudquery_plugin_v3_Sync_MessageError_descriptor, new java.lang.String[] { "TableName", "Error", }); - internal_static_cloudquery_plugin_v3_Sync_BackendOptions_descriptor = + internal_static_cloudquery_plugin_v3_Sync_MessageCheckpoint_descriptor = internal_static_cloudquery_plugin_v3_Sync_descriptor.getNestedType(4); + internal_static_cloudquery_plugin_v3_Sync_MessageCheckpoint_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_cloudquery_plugin_v3_Sync_MessageCheckpoint_descriptor, + new java.lang.String[] { "Record", }); + internal_static_cloudquery_plugin_v3_Sync_BackendOptions_descriptor = + internal_static_cloudquery_plugin_v3_Sync_descriptor.getNestedType(5); internal_static_cloudquery_plugin_v3_Sync_BackendOptions_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_cloudquery_plugin_v3_Sync_BackendOptions_descriptor, new java.lang.String[] { "TableName", "Connection", }); internal_static_cloudquery_plugin_v3_Sync_Request_descriptor = - internal_static_cloudquery_plugin_v3_Sync_descriptor.getNestedType(5); + internal_static_cloudquery_plugin_v3_Sync_descriptor.getNestedType(6); internal_static_cloudquery_plugin_v3_Sync_Request_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_cloudquery_plugin_v3_Sync_Request_descriptor, - new java.lang.String[] { "Tables", "SkipTables", "SkipDependentTables", "DeterministicCqId", "Backend", "Shard", "WithErrorMessages", }); + new java.lang.String[] { "Tables", "SkipTables", "SkipDependentTables", "DeterministicCqId", "Backend", "Shard", "WithErrorMessages", "SupportsCheckpoints", }); internal_static_cloudquery_plugin_v3_Sync_Request_Shard_descriptor = internal_static_cloudquery_plugin_v3_Sync_Request_descriptor.getNestedType(0); internal_static_cloudquery_plugin_v3_Sync_Request_Shard_fieldAccessorTable = new @@ -593,11 +619,11 @@ public static void registerAllExtensions( internal_static_cloudquery_plugin_v3_Sync_Request_Shard_descriptor, new java.lang.String[] { "Num", "Total", }); internal_static_cloudquery_plugin_v3_Sync_Response_descriptor = - internal_static_cloudquery_plugin_v3_Sync_descriptor.getNestedType(6); + internal_static_cloudquery_plugin_v3_Sync_descriptor.getNestedType(7); internal_static_cloudquery_plugin_v3_Sync_Response_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_cloudquery_plugin_v3_Sync_Response_descriptor, - new java.lang.String[] { "MigrateTable", "Insert", "DeleteRecord", "Error", "Message", }); + new java.lang.String[] { "MigrateTable", "Insert", "DeleteRecord", "Error", "Checkpoint", "Message", }); internal_static_cloudquery_plugin_v3_Read_descriptor = getDescriptor().getMessageType(6); internal_static_cloudquery_plugin_v3_Read_fieldAccessorTable = new @@ -664,18 +690,24 @@ public static void registerAllExtensions( com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_cloudquery_plugin_v3_Write_MessageDeleteRecord_descriptor, new java.lang.String[] { "TableName", "WhereClause", "TableRelations", }); - internal_static_cloudquery_plugin_v3_Write_Request_descriptor = + internal_static_cloudquery_plugin_v3_Write_MessageFlush_descriptor = internal_static_cloudquery_plugin_v3_Write_descriptor.getNestedType(4); + internal_static_cloudquery_plugin_v3_Write_MessageFlush_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_cloudquery_plugin_v3_Write_MessageFlush_descriptor, + new java.lang.String[] { "Id", }); + internal_static_cloudquery_plugin_v3_Write_Request_descriptor = + internal_static_cloudquery_plugin_v3_Write_descriptor.getNestedType(5); internal_static_cloudquery_plugin_v3_Write_Request_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_cloudquery_plugin_v3_Write_Request_descriptor, - new java.lang.String[] { "MigrateTable", "Insert", "Delete", "DeleteRecord", "Message", }); + new java.lang.String[] { "MigrateTable", "Insert", "Delete", "DeleteRecord", "Flush", "Message", }); internal_static_cloudquery_plugin_v3_Write_Response_descriptor = - internal_static_cloudquery_plugin_v3_Write_descriptor.getNestedType(5); + internal_static_cloudquery_plugin_v3_Write_descriptor.getNestedType(6); internal_static_cloudquery_plugin_v3_Write_Response_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_cloudquery_plugin_v3_Write_Response_descriptor, - new java.lang.String[] { }); + new java.lang.String[] { "FlushId", "FlushError", "FailedTables", }); internal_static_cloudquery_plugin_v3_Transform_descriptor = getDescriptor().getMessageType(11); internal_static_cloudquery_plugin_v3_Transform_fieldAccessorTable = new diff --git a/build/generated/sources/proto/main/java/io/cloudquery/plugin/v3/Sync.java b/build/generated/sources/proto/main/java/io/cloudquery/plugin/v3/Sync.java index 03433e1..445d5fa 100644 --- a/build/generated/sources/proto/main/java/io/cloudquery/plugin/v3/Sync.java +++ b/build/generated/sources/proto/main/java/io/cloudquery/plugin/v3/Sync.java @@ -2904,6 +2904,492 @@ public io.cloudquery.plugin.v3.Sync.MessageError getDefaultInstanceForType() { } + public interface MessageCheckpointOrBuilder extends + // @@protoc_insertion_point(interface_extends:cloudquery.plugin.v3.Sync.MessageCheckpoint) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * marshalled arrow.Record
+     * 
+ * + * bytes record = 1; + * @return The record. + */ + com.google.protobuf.ByteString getRecord(); + } + /** + *
+   * State backend rows to persist once every message sent before the checkpoint is committed to all destinations.
+   * Only sent when Sync.Request.supports_checkpoints is set.
+   *
+   * The record must:
+   * - have the cq:table_name schema metadata set to Sync.BackendOptions.table_name
+   * - have a "key" column and a "value" column, both of the arrow utf8 type (not large_utf8)
+   * - have a "version" column of the arrow uint64 type, if the state table has one
+   * - hold only the keys that changed. Each row is an upsert of its key; keys not in the record keep their state.
+   * When the same key is in several checkpoints, the row with the highest version wins, or the last row without a version column.
+   * 
+ * + * Protobuf type {@code cloudquery.plugin.v3.Sync.MessageCheckpoint} + */ + public static final class MessageCheckpoint extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:cloudquery.plugin.v3.Sync.MessageCheckpoint) + MessageCheckpointOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 36, + /* patch= */ 2, + /* suffix= */ "", + "MessageCheckpoint"); + } + // Use MessageCheckpoint.newBuilder() to construct. + private MessageCheckpoint(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private MessageCheckpoint() { + record_ = com.google.protobuf.ByteString.EMPTY; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.cloudquery.plugin.v3.PluginOuterClass.internal_static_cloudquery_plugin_v3_Sync_MessageCheckpoint_descriptor; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return io.cloudquery.plugin.v3.PluginOuterClass.internal_static_cloudquery_plugin_v3_Sync_MessageCheckpoint_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.cloudquery.plugin.v3.PluginOuterClass.internal_static_cloudquery_plugin_v3_Sync_MessageCheckpoint_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.cloudquery.plugin.v3.Sync.MessageCheckpoint.class, io.cloudquery.plugin.v3.Sync.MessageCheckpoint.Builder.class); + } + + public static final int RECORD_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString record_ = com.google.protobuf.ByteString.EMPTY; + /** + *
+     * marshalled arrow.Record
+     * 
+ * + * bytes record = 1; + * @return The record. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRecord() { + return record_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!record_.isEmpty()) { + output.writeBytes(1, record_); + } + getUnknownFields().writeTo(output); + } + private int computeSerializedSize_0() { + int size = 0; + if (!record_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(1, record_); + } + return size; + } + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += computeSerializedSize_0(); + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.cloudquery.plugin.v3.Sync.MessageCheckpoint)) { + return super.equals(obj); + } + io.cloudquery.plugin.v3.Sync.MessageCheckpoint other = (io.cloudquery.plugin.v3.Sync.MessageCheckpoint) obj; + + if (!getRecord() + .equals(other.getRecord())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + RECORD_FIELD_NUMBER; + hash = (53 * hash) + getRecord().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.cloudquery.plugin.v3.Sync.MessageCheckpoint parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.cloudquery.plugin.v3.Sync.MessageCheckpoint parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.cloudquery.plugin.v3.Sync.MessageCheckpoint parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.cloudquery.plugin.v3.Sync.MessageCheckpoint parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.cloudquery.plugin.v3.Sync.MessageCheckpoint parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.cloudquery.plugin.v3.Sync.MessageCheckpoint parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.cloudquery.plugin.v3.Sync.MessageCheckpoint parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.cloudquery.plugin.v3.Sync.MessageCheckpoint parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static io.cloudquery.plugin.v3.Sync.MessageCheckpoint parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static io.cloudquery.plugin.v3.Sync.MessageCheckpoint parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.cloudquery.plugin.v3.Sync.MessageCheckpoint parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.cloudquery.plugin.v3.Sync.MessageCheckpoint parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.cloudquery.plugin.v3.Sync.MessageCheckpoint prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+     * State backend rows to persist once every message sent before the checkpoint is committed to all destinations.
+     * Only sent when Sync.Request.supports_checkpoints is set.
+     *
+     * The record must:
+     * - have the cq:table_name schema metadata set to Sync.BackendOptions.table_name
+     * - have a "key" column and a "value" column, both of the arrow utf8 type (not large_utf8)
+     * - have a "version" column of the arrow uint64 type, if the state table has one
+     * - hold only the keys that changed. Each row is an upsert of its key; keys not in the record keep their state.
+     * When the same key is in several checkpoints, the row with the highest version wins, or the last row without a version column.
+     * 
+ * + * Protobuf type {@code cloudquery.plugin.v3.Sync.MessageCheckpoint} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:cloudquery.plugin.v3.Sync.MessageCheckpoint) + io.cloudquery.plugin.v3.Sync.MessageCheckpointOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.cloudquery.plugin.v3.PluginOuterClass.internal_static_cloudquery_plugin_v3_Sync_MessageCheckpoint_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.cloudquery.plugin.v3.PluginOuterClass.internal_static_cloudquery_plugin_v3_Sync_MessageCheckpoint_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.cloudquery.plugin.v3.Sync.MessageCheckpoint.class, io.cloudquery.plugin.v3.Sync.MessageCheckpoint.Builder.class); + } + + // Construct using io.cloudquery.plugin.v3.Sync.MessageCheckpoint.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + record_ = com.google.protobuf.ByteString.EMPTY; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.cloudquery.plugin.v3.PluginOuterClass.internal_static_cloudquery_plugin_v3_Sync_MessageCheckpoint_descriptor; + } + + @java.lang.Override + public io.cloudquery.plugin.v3.Sync.MessageCheckpoint getDefaultInstanceForType() { + return io.cloudquery.plugin.v3.Sync.MessageCheckpoint.getDefaultInstance(); + } + + @java.lang.Override + public io.cloudquery.plugin.v3.Sync.MessageCheckpoint build() { + io.cloudquery.plugin.v3.Sync.MessageCheckpoint result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.cloudquery.plugin.v3.Sync.MessageCheckpoint buildPartial() { + io.cloudquery.plugin.v3.Sync.MessageCheckpoint result = new io.cloudquery.plugin.v3.Sync.MessageCheckpoint(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(io.cloudquery.plugin.v3.Sync.MessageCheckpoint result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.record_ = record_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.cloudquery.plugin.v3.Sync.MessageCheckpoint) { + return mergeFrom((io.cloudquery.plugin.v3.Sync.MessageCheckpoint)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.cloudquery.plugin.v3.Sync.MessageCheckpoint other) { + if (other == io.cloudquery.plugin.v3.Sync.MessageCheckpoint.getDefaultInstance()) return this; + if (!other.getRecord().isEmpty()) { + setRecord(other.getRecord()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + java.util.Objects.requireNonNull(extensionRegistry); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + record_ = input.readBytes(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private com.google.protobuf.ByteString record_ = com.google.protobuf.ByteString.EMPTY; + /** + *
+       * marshalled arrow.Record
+       * 
+ * + * bytes record = 1; + * @return The record. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRecord() { + return record_; + } + /** + *
+       * marshalled arrow.Record
+       * 
+ * + * bytes record = 1; + * @param value The record to set. + * @return This builder for chaining. + */ + public Builder setRecord(com.google.protobuf.ByteString value) { + java.util.Objects.requireNonNull(value); + record_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
+       * marshalled arrow.Record
+       * 
+ * + * bytes record = 1; + * @return This builder for chaining. + */ + public Builder clearRecord() { + bitField0_ = (bitField0_ & ~0x00000001); + record_ = getDefaultInstance().getRecord(); + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:cloudquery.plugin.v3.Sync.MessageCheckpoint) + } + + // @@protoc_insertion_point(class_scope:cloudquery.plugin.v3.Sync.MessageCheckpoint) + private static final io.cloudquery.plugin.v3.Sync.MessageCheckpoint DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.cloudquery.plugin.v3.Sync.MessageCheckpoint(); + } + + public static io.cloudquery.plugin.v3.Sync.MessageCheckpoint getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MessageCheckpoint parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.cloudquery.plugin.v3.Sync.MessageCheckpoint getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + public interface BackendOptionsOrBuilder extends // @@protoc_insertion_point(interface_extends:cloudquery.plugin.v3.Sync.BackendOptions) com.google.protobuf.MessageOrBuilder { @@ -3746,6 +4232,17 @@ public interface RequestOrBuilder extends * @return The withErrorMessages. */ boolean getWithErrorMessages(); + + /** + *
+     * If true, the client persists state backend writes from Sync.MessageCheckpoint,
+     * so the plugin sends them on the stream instead of writing to the state backend
+     * 
+ * + * bool supports_checkpoints = 8; + * @return The supportsCheckpoints. + */ + boolean getSupportsCheckpoints(); } /** * Protobuf type {@code cloudquery.plugin.v3.Sync.Request} @@ -4470,6 +4967,22 @@ public boolean getWithErrorMessages() { return withErrorMessages_; } + public static final int SUPPORTS_CHECKPOINTS_FIELD_NUMBER = 8; + private boolean supportsCheckpoints_ = false; + /** + *
+     * If true, the client persists state backend writes from Sync.MessageCheckpoint,
+     * so the plugin sends them on the stream instead of writing to the state backend
+     * 
+ * + * bool supports_checkpoints = 8; + * @return The supportsCheckpoints. + */ + @java.lang.Override + public boolean getSupportsCheckpoints() { + return supportsCheckpoints_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { @@ -4505,6 +5018,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) if (withErrorMessages_ != false) { output.writeBool(7, withErrorMessages_); } + if (supportsCheckpoints_ != false) { + output.writeBool(8, supportsCheckpoints_); + } getUnknownFields().writeTo(output); } private int computeSerializedSize_0() { @@ -4545,6 +5061,10 @@ private int computeSerializedSize_0() { size += com.google.protobuf.CodedOutputStream .computeBoolSize(7, withErrorMessages_); } + if (supportsCheckpoints_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(8, supportsCheckpoints_); + } return size; } @java.lang.Override @@ -4589,6 +5109,8 @@ public boolean equals(final java.lang.Object obj) { } if (getWithErrorMessages() != other.getWithErrorMessages()) return false; + if (getSupportsCheckpoints() + != other.getSupportsCheckpoints()) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -4625,6 +5147,9 @@ public int hashCode() { hash = (37 * hash) + WITHERRORMESSAGES_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( getWithErrorMessages()); + hash = (37 * hash) + SUPPORTS_CHECKPOINTS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getSupportsCheckpoints()); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -4780,6 +5305,7 @@ public Builder clear() { shardBuilder_ = null; } withErrorMessages_ = false; + supportsCheckpoints_ = false; return this; } @@ -4843,6 +5369,9 @@ private void buildPartial0(io.cloudquery.plugin.v3.Sync.Request result) { if (((from_bitField0_ & 0x00000040) != 0)) { result.withErrorMessages_ = withErrorMessages_; } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.supportsCheckpoints_ = supportsCheckpoints_; + } result.bitField0_ |= to_bitField0_; } @@ -4893,6 +5422,9 @@ public Builder mergeFrom(io.cloudquery.plugin.v3.Sync.Request other) { if (other.getWithErrorMessages() != false) { setWithErrorMessages(other.getWithErrorMessages()); } + if (other.getSupportsCheckpoints() != false) { + setSupportsCheckpoints(other.getSupportsCheckpoints()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -4956,6 +5488,11 @@ public Builder mergeFrom( bitField0_ |= 0x00000040; break; } // case 56 + case 64: { + supportsCheckpoints_ = input.readBool(); + bitField0_ |= 0x00000080; + break; + } // case 64 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { done = true; // was an endgroup tag @@ -5541,6 +6078,53 @@ public Builder clearWithErrorMessages() { return this; } + private boolean supportsCheckpoints_ ; + /** + *
+       * If true, the client persists state backend writes from Sync.MessageCheckpoint,
+       * so the plugin sends them on the stream instead of writing to the state backend
+       * 
+ * + * bool supports_checkpoints = 8; + * @return The supportsCheckpoints. + */ + @java.lang.Override + public boolean getSupportsCheckpoints() { + return supportsCheckpoints_; + } + /** + *
+       * If true, the client persists state backend writes from Sync.MessageCheckpoint,
+       * so the plugin sends them on the stream instead of writing to the state backend
+       * 
+ * + * bool supports_checkpoints = 8; + * @param value The supportsCheckpoints to set. + * @return This builder for chaining. + */ + public Builder setSupportsCheckpoints(boolean value) { + + supportsCheckpoints_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + *
+       * If true, the client persists state backend writes from Sync.MessageCheckpoint,
+       * so the plugin sends them on the stream instead of writing to the state backend
+       * 
+ * + * bool supports_checkpoints = 8; + * @return This builder for chaining. + */ + public Builder clearSupportsCheckpoints() { + bitField0_ = (bitField0_ & ~0x00000080); + supportsCheckpoints_ = false; + onChanged(); + return this; + } + // @@protoc_insertion_point(builder_scope:cloudquery.plugin.v3.Sync.Request) } @@ -5656,6 +6240,21 @@ public interface ResponseOrBuilder extends */ io.cloudquery.plugin.v3.Sync.MessageErrorOrBuilder getErrorOrBuilder(); + /** + * .cloudquery.plugin.v3.Sync.MessageCheckpoint checkpoint = 5; + * @return Whether the checkpoint field is set. + */ + boolean hasCheckpoint(); + /** + * .cloudquery.plugin.v3.Sync.MessageCheckpoint checkpoint = 5; + * @return The checkpoint. + */ + io.cloudquery.plugin.v3.Sync.MessageCheckpoint getCheckpoint(); + /** + * .cloudquery.plugin.v3.Sync.MessageCheckpoint checkpoint = 5; + */ + io.cloudquery.plugin.v3.Sync.MessageCheckpointOrBuilder getCheckpointOrBuilder(); + io.cloudquery.plugin.v3.Sync.Response.MessageCase getMessageCase(); } /** @@ -5710,6 +6309,7 @@ public enum MessageCase INSERT(2), DELETE_RECORD(3), ERROR(4), + CHECKPOINT(5), MESSAGE_NOT_SET(0); private final int value; private MessageCase(int value) { @@ -5731,6 +6331,7 @@ public static MessageCase forNumber(int value) { case 2: return INSERT; case 3: return DELETE_RECORD; case 4: return ERROR; + case 5: return CHECKPOINT; case 0: return MESSAGE_NOT_SET; default: return null; } @@ -5870,6 +6471,37 @@ public io.cloudquery.plugin.v3.Sync.MessageErrorOrBuilder getErrorOrBuilder() { return io.cloudquery.plugin.v3.Sync.MessageError.getDefaultInstance(); } + public static final int CHECKPOINT_FIELD_NUMBER = 5; + /** + * .cloudquery.plugin.v3.Sync.MessageCheckpoint checkpoint = 5; + * @return Whether the checkpoint field is set. + */ + @java.lang.Override + public boolean hasCheckpoint() { + return messageCase_ == 5; + } + /** + * .cloudquery.plugin.v3.Sync.MessageCheckpoint checkpoint = 5; + * @return The checkpoint. + */ + @java.lang.Override + public io.cloudquery.plugin.v3.Sync.MessageCheckpoint getCheckpoint() { + if (messageCase_ == 5) { + return (io.cloudquery.plugin.v3.Sync.MessageCheckpoint) message_; + } + return io.cloudquery.plugin.v3.Sync.MessageCheckpoint.getDefaultInstance(); + } + /** + * .cloudquery.plugin.v3.Sync.MessageCheckpoint checkpoint = 5; + */ + @java.lang.Override + public io.cloudquery.plugin.v3.Sync.MessageCheckpointOrBuilder getCheckpointOrBuilder() { + if (messageCase_ == 5) { + return (io.cloudquery.plugin.v3.Sync.MessageCheckpoint) message_; + } + return io.cloudquery.plugin.v3.Sync.MessageCheckpoint.getDefaultInstance(); + } + private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { @@ -5896,6 +6528,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) if (messageCase_ == 4) { output.writeMessage(4, (io.cloudquery.plugin.v3.Sync.MessageError) message_); } + if (messageCase_ == 5) { + output.writeMessage(5, (io.cloudquery.plugin.v3.Sync.MessageCheckpoint) message_); + } getUnknownFields().writeTo(output); } private int computeSerializedSize_0() { @@ -5916,6 +6551,10 @@ private int computeSerializedSize_0() { size += com.google.protobuf.CodedOutputStream .computeMessageSize(4, (io.cloudquery.plugin.v3.Sync.MessageError) message_); } + if (messageCase_ == 5) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, (io.cloudquery.plugin.v3.Sync.MessageCheckpoint) message_); + } return size; } @java.lang.Override @@ -5958,6 +6597,10 @@ public boolean equals(final java.lang.Object obj) { if (!getError() .equals(other.getError())) return false; break; + case 5: + if (!getCheckpoint() + .equals(other.getCheckpoint())) return false; + break; case 0: default: } @@ -5989,6 +6632,10 @@ public int hashCode() { hash = (37 * hash) + ERROR_FIELD_NUMBER; hash = (53 * hash) + getError().hashCode(); break; + case 5: + hash = (37 * hash) + CHECKPOINT_FIELD_NUMBER; + hash = (53 * hash) + getCheckpoint().hashCode(); + break; case 0: default: } @@ -6135,6 +6782,9 @@ public Builder clear() { if (errorBuilder_ != null) { errorBuilder_.clear(); } + if (checkpointBuilder_ != null) { + checkpointBuilder_.clear(); + } messageCase_ = 0; message_ = null; return this; @@ -6192,6 +6842,10 @@ private void buildPartialOneofs(io.cloudquery.plugin.v3.Sync.Response result) { errorBuilder_ != null) { result.message_ = errorBuilder_.build(); } + if (messageCase_ == 5 && + checkpointBuilder_ != null) { + result.message_ = checkpointBuilder_.build(); + } } @java.lang.Override @@ -6223,6 +6877,10 @@ public Builder mergeFrom(io.cloudquery.plugin.v3.Sync.Response other) { mergeError(other.getError()); break; } + case CHECKPOINT: { + mergeCheckpoint(other.getCheckpoint()); + break; + } case MESSAGE_NOT_SET: { break; } @@ -6279,6 +6937,13 @@ public Builder mergeFrom( messageCase_ = 4; break; } // case 34 + case 42: { + input.readMessage( + internalGetCheckpointFieldBuilder().getBuilder(), + extensionRegistry); + messageCase_ = 5; + break; + } // case 42 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { done = true; // was an endgroup tag @@ -6871,6 +7536,146 @@ public io.cloudquery.plugin.v3.Sync.MessageErrorOrBuilder getErrorOrBuilder() { return errorBuilder_; } + private com.google.protobuf.SingleFieldBuilder< + io.cloudquery.plugin.v3.Sync.MessageCheckpoint, io.cloudquery.plugin.v3.Sync.MessageCheckpoint.Builder, io.cloudquery.plugin.v3.Sync.MessageCheckpointOrBuilder> checkpointBuilder_; + /** + * .cloudquery.plugin.v3.Sync.MessageCheckpoint checkpoint = 5; + * @return Whether the checkpoint field is set. + */ + @java.lang.Override + public boolean hasCheckpoint() { + return messageCase_ == 5; + } + /** + * .cloudquery.plugin.v3.Sync.MessageCheckpoint checkpoint = 5; + * @return The checkpoint. + */ + @java.lang.Override + public io.cloudquery.plugin.v3.Sync.MessageCheckpoint getCheckpoint() { + if (checkpointBuilder_ == null) { + if (messageCase_ == 5) { + return (io.cloudquery.plugin.v3.Sync.MessageCheckpoint) message_; + } + return io.cloudquery.plugin.v3.Sync.MessageCheckpoint.getDefaultInstance(); + } else { + if (messageCase_ == 5) { + return checkpointBuilder_.getMessage(); + } + return io.cloudquery.plugin.v3.Sync.MessageCheckpoint.getDefaultInstance(); + } + } + /** + * .cloudquery.plugin.v3.Sync.MessageCheckpoint checkpoint = 5; + */ + public Builder setCheckpoint(io.cloudquery.plugin.v3.Sync.MessageCheckpoint value) { + if (checkpointBuilder_ == null) { + java.util.Objects.requireNonNull(value); + message_ = value; + onChanged(); + } else { + checkpointBuilder_.setMessage(value); + } + messageCase_ = 5; + return this; + } + /** + * .cloudquery.plugin.v3.Sync.MessageCheckpoint checkpoint = 5; + */ + public Builder setCheckpoint( + io.cloudquery.plugin.v3.Sync.MessageCheckpoint.Builder builderForValue) { + if (checkpointBuilder_ == null) { + message_ = builderForValue.build(); + onChanged(); + } else { + checkpointBuilder_.setMessage(builderForValue.build()); + } + messageCase_ = 5; + return this; + } + /** + * .cloudquery.plugin.v3.Sync.MessageCheckpoint checkpoint = 5; + */ + public Builder mergeCheckpoint(io.cloudquery.plugin.v3.Sync.MessageCheckpoint value) { + if (checkpointBuilder_ == null) { + if (messageCase_ == 5 && + message_ != io.cloudquery.plugin.v3.Sync.MessageCheckpoint.getDefaultInstance()) { + message_ = io.cloudquery.plugin.v3.Sync.MessageCheckpoint.newBuilder((io.cloudquery.plugin.v3.Sync.MessageCheckpoint) message_) + .mergeFrom(value).buildPartial(); + } else { + message_ = value; + } + onChanged(); + } else { + if (messageCase_ == 5) { + checkpointBuilder_.mergeFrom(value); + } else { + checkpointBuilder_.setMessage(value); + } + } + messageCase_ = 5; + return this; + } + /** + * .cloudquery.plugin.v3.Sync.MessageCheckpoint checkpoint = 5; + */ + public Builder clearCheckpoint() { + if (checkpointBuilder_ == null) { + if (messageCase_ == 5) { + messageCase_ = 0; + message_ = null; + onChanged(); + } + } else { + if (messageCase_ == 5) { + messageCase_ = 0; + message_ = null; + } + checkpointBuilder_.clear(); + } + return this; + } + /** + * .cloudquery.plugin.v3.Sync.MessageCheckpoint checkpoint = 5; + */ + public io.cloudquery.plugin.v3.Sync.MessageCheckpoint.Builder getCheckpointBuilder() { + return internalGetCheckpointFieldBuilder().getBuilder(); + } + /** + * .cloudquery.plugin.v3.Sync.MessageCheckpoint checkpoint = 5; + */ + @java.lang.Override + public io.cloudquery.plugin.v3.Sync.MessageCheckpointOrBuilder getCheckpointOrBuilder() { + if ((messageCase_ == 5) && (checkpointBuilder_ != null)) { + return checkpointBuilder_.getMessageOrBuilder(); + } else { + if (messageCase_ == 5) { + return (io.cloudquery.plugin.v3.Sync.MessageCheckpoint) message_; + } + return io.cloudquery.plugin.v3.Sync.MessageCheckpoint.getDefaultInstance(); + } + } + /** + * .cloudquery.plugin.v3.Sync.MessageCheckpoint checkpoint = 5; + */ + private com.google.protobuf.SingleFieldBuilder< + io.cloudquery.plugin.v3.Sync.MessageCheckpoint, io.cloudquery.plugin.v3.Sync.MessageCheckpoint.Builder, io.cloudquery.plugin.v3.Sync.MessageCheckpointOrBuilder> + internalGetCheckpointFieldBuilder() { + if (checkpointBuilder_ == null) { + if (!(messageCase_ == 5)) { + message_ = io.cloudquery.plugin.v3.Sync.MessageCheckpoint.getDefaultInstance(); + } + checkpointBuilder_ = new com.google.protobuf.SingleFieldBuilder< + io.cloudquery.plugin.v3.Sync.MessageCheckpoint, io.cloudquery.plugin.v3.Sync.MessageCheckpoint.Builder, io.cloudquery.plugin.v3.Sync.MessageCheckpointOrBuilder>( + (io.cloudquery.plugin.v3.Sync.MessageCheckpoint) message_, + getParentForChildren(), + isClean()); + message_ = null; + } + messageCase_ = 5; + onChanged(); + return checkpointBuilder_; + } + // @@protoc_insertion_point(builder_scope:cloudquery.plugin.v3.Sync.Response) } diff --git a/build/generated/sources/proto/main/java/io/cloudquery/plugin/v3/Write.java b/build/generated/sources/proto/main/java/io/cloudquery/plugin/v3/Write.java index 2ab4f33..68944d6 100644 --- a/build/generated/sources/proto/main/java/io/cloudquery/plugin/v3/Write.java +++ b/build/generated/sources/proto/main/java/io/cloudquery/plugin/v3/Write.java @@ -1056,7 +1056,7 @@ public interface MessageDeleteStaleOrBuilder extends * * bytes table = 1 [deprecated = true]; * @deprecated cloudquery.plugin.v3.Write.MessageDeleteStale.table is deprecated. - * See cloudquery/plugin/v3/plugin.proto;l=190 + * See cloudquery/plugin/v3/plugin.proto;l=216 * @return The table. */ @java.lang.Deprecated com.google.protobuf.ByteString getTable(); @@ -1155,7 +1155,7 @@ public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { * * bytes table = 1 [deprecated = true]; * @deprecated cloudquery.plugin.v3.Write.MessageDeleteStale.table is deprecated. - * See cloudquery/plugin/v3/plugin.proto;l=190 + * See cloudquery/plugin/v3/plugin.proto;l=216 * @return The table. */ @java.lang.Override @@ -1663,7 +1663,7 @@ public Builder mergeFrom( * * bytes table = 1 [deprecated = true]; * @deprecated cloudquery.plugin.v3.Write.MessageDeleteStale.table is deprecated. - * See cloudquery/plugin/v3/plugin.proto;l=190 + * See cloudquery/plugin/v3/plugin.proto;l=216 * @return The table. */ @java.lang.Override @@ -1677,7 +1677,7 @@ public Builder mergeFrom( * * bytes table = 1 [deprecated = true]; * @deprecated cloudquery.plugin.v3.Write.MessageDeleteStale.table is deprecated. - * See cloudquery/plugin/v3/plugin.proto;l=190 + * See cloudquery/plugin/v3/plugin.proto;l=216 * @param value The table to set. * @return This builder for chaining. */ @@ -1695,7 +1695,7 @@ public Builder mergeFrom( * * bytes table = 1 [deprecated = true]; * @deprecated cloudquery.plugin.v3.Write.MessageDeleteStale.table is deprecated. - * See cloudquery/plugin/v3/plugin.proto;l=190 + * See cloudquery/plugin/v3/plugin.proto;l=216 * @return This builder for chaining. */ @java.lang.Deprecated public Builder clearTable() { @@ -3286,6 +3286,456 @@ public io.cloudquery.plugin.v3.Write.MessageDeleteRecord getDefaultInstanceForTy } + public interface MessageFlushOrBuilder extends + // @@protoc_insertion_point(interface_extends:cloudquery.plugin.v3.Write.MessageFlush) + com.google.protobuf.MessageOrBuilder { + + /** + * uint64 id = 1; + * @return The id. + */ + long getId(); + } + /** + *
+   * Commit every message sent before this one. Only valid on WriteStream.
+   * 
+ * + * Protobuf type {@code cloudquery.plugin.v3.Write.MessageFlush} + */ + public static final class MessageFlush extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:cloudquery.plugin.v3.Write.MessageFlush) + MessageFlushOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 36, + /* patch= */ 2, + /* suffix= */ "", + "MessageFlush"); + } + // Use MessageFlush.newBuilder() to construct. + private MessageFlush(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private MessageFlush() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.cloudquery.plugin.v3.PluginOuterClass.internal_static_cloudquery_plugin_v3_Write_MessageFlush_descriptor; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return io.cloudquery.plugin.v3.PluginOuterClass.internal_static_cloudquery_plugin_v3_Write_MessageFlush_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.cloudquery.plugin.v3.PluginOuterClass.internal_static_cloudquery_plugin_v3_Write_MessageFlush_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.cloudquery.plugin.v3.Write.MessageFlush.class, io.cloudquery.plugin.v3.Write.MessageFlush.Builder.class); + } + + public static final int ID_FIELD_NUMBER = 1; + private long id_ = 0L; + /** + * uint64 id = 1; + * @return The id. + */ + @java.lang.Override + public long getId() { + return id_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (id_ != 0L) { + output.writeUInt64(1, id_); + } + getUnknownFields().writeTo(output); + } + private int computeSerializedSize_0() { + int size = 0; + if (id_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(1, id_); + } + return size; + } + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += computeSerializedSize_0(); + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.cloudquery.plugin.v3.Write.MessageFlush)) { + return super.equals(obj); + } + io.cloudquery.plugin.v3.Write.MessageFlush other = (io.cloudquery.plugin.v3.Write.MessageFlush) obj; + + if (getId() + != other.getId()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getId()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.cloudquery.plugin.v3.Write.MessageFlush parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.cloudquery.plugin.v3.Write.MessageFlush parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.cloudquery.plugin.v3.Write.MessageFlush parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.cloudquery.plugin.v3.Write.MessageFlush parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.cloudquery.plugin.v3.Write.MessageFlush parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.cloudquery.plugin.v3.Write.MessageFlush parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.cloudquery.plugin.v3.Write.MessageFlush parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.cloudquery.plugin.v3.Write.MessageFlush parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static io.cloudquery.plugin.v3.Write.MessageFlush parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static io.cloudquery.plugin.v3.Write.MessageFlush parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.cloudquery.plugin.v3.Write.MessageFlush parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.cloudquery.plugin.v3.Write.MessageFlush parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.cloudquery.plugin.v3.Write.MessageFlush prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+     * Commit every message sent before this one. Only valid on WriteStream.
+     * 
+ * + * Protobuf type {@code cloudquery.plugin.v3.Write.MessageFlush} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:cloudquery.plugin.v3.Write.MessageFlush) + io.cloudquery.plugin.v3.Write.MessageFlushOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.cloudquery.plugin.v3.PluginOuterClass.internal_static_cloudquery_plugin_v3_Write_MessageFlush_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.cloudquery.plugin.v3.PluginOuterClass.internal_static_cloudquery_plugin_v3_Write_MessageFlush_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.cloudquery.plugin.v3.Write.MessageFlush.class, io.cloudquery.plugin.v3.Write.MessageFlush.Builder.class); + } + + // Construct using io.cloudquery.plugin.v3.Write.MessageFlush.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + id_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.cloudquery.plugin.v3.PluginOuterClass.internal_static_cloudquery_plugin_v3_Write_MessageFlush_descriptor; + } + + @java.lang.Override + public io.cloudquery.plugin.v3.Write.MessageFlush getDefaultInstanceForType() { + return io.cloudquery.plugin.v3.Write.MessageFlush.getDefaultInstance(); + } + + @java.lang.Override + public io.cloudquery.plugin.v3.Write.MessageFlush build() { + io.cloudquery.plugin.v3.Write.MessageFlush result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.cloudquery.plugin.v3.Write.MessageFlush buildPartial() { + io.cloudquery.plugin.v3.Write.MessageFlush result = new io.cloudquery.plugin.v3.Write.MessageFlush(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(io.cloudquery.plugin.v3.Write.MessageFlush result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.id_ = id_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.cloudquery.plugin.v3.Write.MessageFlush) { + return mergeFrom((io.cloudquery.plugin.v3.Write.MessageFlush)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.cloudquery.plugin.v3.Write.MessageFlush other) { + if (other == io.cloudquery.plugin.v3.Write.MessageFlush.getDefaultInstance()) return this; + if (other.getId() != 0L) { + setId(other.getId()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + java.util.Objects.requireNonNull(extensionRegistry); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + id_ = input.readUInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long id_ ; + /** + * uint64 id = 1; + * @return The id. + */ + @java.lang.Override + public long getId() { + return id_; + } + /** + * uint64 id = 1; + * @param value The id to set. + * @return This builder for chaining. + */ + public Builder setId(long value) { + + id_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * uint64 id = 1; + * @return This builder for chaining. + */ + public Builder clearId() { + bitField0_ = (bitField0_ & ~0x00000001); + id_ = 0L; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:cloudquery.plugin.v3.Write.MessageFlush) + } + + // @@protoc_insertion_point(class_scope:cloudquery.plugin.v3.Write.MessageFlush) + private static final io.cloudquery.plugin.v3.Write.MessageFlush DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.cloudquery.plugin.v3.Write.MessageFlush(); + } + + public static io.cloudquery.plugin.v3.Write.MessageFlush getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MessageFlush parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.cloudquery.plugin.v3.Write.MessageFlush getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + public interface RequestOrBuilder extends // @@protoc_insertion_point(interface_extends:cloudquery.plugin.v3.Write.Request) com.google.protobuf.MessageOrBuilder { @@ -3350,6 +3800,21 @@ public interface RequestOrBuilder extends */ io.cloudquery.plugin.v3.Write.MessageDeleteRecordOrBuilder getDeleteRecordOrBuilder(); + /** + * .cloudquery.plugin.v3.Write.MessageFlush flush = 5; + * @return Whether the flush field is set. + */ + boolean hasFlush(); + /** + * .cloudquery.plugin.v3.Write.MessageFlush flush = 5; + * @return The flush. + */ + io.cloudquery.plugin.v3.Write.MessageFlush getFlush(); + /** + * .cloudquery.plugin.v3.Write.MessageFlush flush = 5; + */ + io.cloudquery.plugin.v3.Write.MessageFlushOrBuilder getFlushOrBuilder(); + io.cloudquery.plugin.v3.Write.Request.MessageCase getMessageCase(); } /** @@ -3404,6 +3869,7 @@ public enum MessageCase INSERT(2), DELETE(3), DELETE_RECORD(4), + FLUSH(5), MESSAGE_NOT_SET(0); private final int value; private MessageCase(int value) { @@ -3425,6 +3891,7 @@ public static MessageCase forNumber(int value) { case 2: return INSERT; case 3: return DELETE; case 4: return DELETE_RECORD; + case 5: return FLUSH; case 0: return MESSAGE_NOT_SET; default: return null; } @@ -3564,6 +4031,37 @@ public io.cloudquery.plugin.v3.Write.MessageDeleteRecordOrBuilder getDeleteRecor return io.cloudquery.plugin.v3.Write.MessageDeleteRecord.getDefaultInstance(); } + public static final int FLUSH_FIELD_NUMBER = 5; + /** + * .cloudquery.plugin.v3.Write.MessageFlush flush = 5; + * @return Whether the flush field is set. + */ + @java.lang.Override + public boolean hasFlush() { + return messageCase_ == 5; + } + /** + * .cloudquery.plugin.v3.Write.MessageFlush flush = 5; + * @return The flush. + */ + @java.lang.Override + public io.cloudquery.plugin.v3.Write.MessageFlush getFlush() { + if (messageCase_ == 5) { + return (io.cloudquery.plugin.v3.Write.MessageFlush) message_; + } + return io.cloudquery.plugin.v3.Write.MessageFlush.getDefaultInstance(); + } + /** + * .cloudquery.plugin.v3.Write.MessageFlush flush = 5; + */ + @java.lang.Override + public io.cloudquery.plugin.v3.Write.MessageFlushOrBuilder getFlushOrBuilder() { + if (messageCase_ == 5) { + return (io.cloudquery.plugin.v3.Write.MessageFlush) message_; + } + return io.cloudquery.plugin.v3.Write.MessageFlush.getDefaultInstance(); + } + private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { @@ -3590,6 +4088,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) if (messageCase_ == 4) { output.writeMessage(4, (io.cloudquery.plugin.v3.Write.MessageDeleteRecord) message_); } + if (messageCase_ == 5) { + output.writeMessage(5, (io.cloudquery.plugin.v3.Write.MessageFlush) message_); + } getUnknownFields().writeTo(output); } private int computeSerializedSize_0() { @@ -3610,6 +4111,10 @@ private int computeSerializedSize_0() { size += com.google.protobuf.CodedOutputStream .computeMessageSize(4, (io.cloudquery.plugin.v3.Write.MessageDeleteRecord) message_); } + if (messageCase_ == 5) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, (io.cloudquery.plugin.v3.Write.MessageFlush) message_); + } return size; } @java.lang.Override @@ -3652,6 +4157,10 @@ public boolean equals(final java.lang.Object obj) { if (!getDeleteRecord() .equals(other.getDeleteRecord())) return false; break; + case 5: + if (!getFlush() + .equals(other.getFlush())) return false; + break; case 0: default: } @@ -3683,6 +4192,10 @@ public int hashCode() { hash = (37 * hash) + DELETE_RECORD_FIELD_NUMBER; hash = (53 * hash) + getDeleteRecord().hashCode(); break; + case 5: + hash = (37 * hash) + FLUSH_FIELD_NUMBER; + hash = (53 * hash) + getFlush().hashCode(); + break; case 0: default: } @@ -3829,6 +4342,9 @@ public Builder clear() { if (deleteRecordBuilder_ != null) { deleteRecordBuilder_.clear(); } + if (flushBuilder_ != null) { + flushBuilder_.clear(); + } messageCase_ = 0; message_ = null; return this; @@ -3886,6 +4402,10 @@ private void buildPartialOneofs(io.cloudquery.plugin.v3.Write.Request result) { deleteRecordBuilder_ != null) { result.message_ = deleteRecordBuilder_.build(); } + if (messageCase_ == 5 && + flushBuilder_ != null) { + result.message_ = flushBuilder_.build(); + } } @java.lang.Override @@ -3917,6 +4437,10 @@ public Builder mergeFrom(io.cloudquery.plugin.v3.Write.Request other) { mergeDeleteRecord(other.getDeleteRecord()); break; } + case FLUSH: { + mergeFlush(other.getFlush()); + break; + } case MESSAGE_NOT_SET: { break; } @@ -3973,6 +4497,13 @@ public Builder mergeFrom( messageCase_ = 4; break; } // case 34 + case 42: { + input.readMessage( + internalGetFlushFieldBuilder().getBuilder(), + extensionRegistry); + messageCase_ = 5; + break; + } // case 42 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { done = true; // was an endgroup tag @@ -4565,6 +5096,146 @@ public io.cloudquery.plugin.v3.Write.MessageDeleteRecordOrBuilder getDeleteRecor return deleteRecordBuilder_; } + private com.google.protobuf.SingleFieldBuilder< + io.cloudquery.plugin.v3.Write.MessageFlush, io.cloudquery.plugin.v3.Write.MessageFlush.Builder, io.cloudquery.plugin.v3.Write.MessageFlushOrBuilder> flushBuilder_; + /** + * .cloudquery.plugin.v3.Write.MessageFlush flush = 5; + * @return Whether the flush field is set. + */ + @java.lang.Override + public boolean hasFlush() { + return messageCase_ == 5; + } + /** + * .cloudquery.plugin.v3.Write.MessageFlush flush = 5; + * @return The flush. + */ + @java.lang.Override + public io.cloudquery.plugin.v3.Write.MessageFlush getFlush() { + if (flushBuilder_ == null) { + if (messageCase_ == 5) { + return (io.cloudquery.plugin.v3.Write.MessageFlush) message_; + } + return io.cloudquery.plugin.v3.Write.MessageFlush.getDefaultInstance(); + } else { + if (messageCase_ == 5) { + return flushBuilder_.getMessage(); + } + return io.cloudquery.plugin.v3.Write.MessageFlush.getDefaultInstance(); + } + } + /** + * .cloudquery.plugin.v3.Write.MessageFlush flush = 5; + */ + public Builder setFlush(io.cloudquery.plugin.v3.Write.MessageFlush value) { + if (flushBuilder_ == null) { + java.util.Objects.requireNonNull(value); + message_ = value; + onChanged(); + } else { + flushBuilder_.setMessage(value); + } + messageCase_ = 5; + return this; + } + /** + * .cloudquery.plugin.v3.Write.MessageFlush flush = 5; + */ + public Builder setFlush( + io.cloudquery.plugin.v3.Write.MessageFlush.Builder builderForValue) { + if (flushBuilder_ == null) { + message_ = builderForValue.build(); + onChanged(); + } else { + flushBuilder_.setMessage(builderForValue.build()); + } + messageCase_ = 5; + return this; + } + /** + * .cloudquery.plugin.v3.Write.MessageFlush flush = 5; + */ + public Builder mergeFlush(io.cloudquery.plugin.v3.Write.MessageFlush value) { + if (flushBuilder_ == null) { + if (messageCase_ == 5 && + message_ != io.cloudquery.plugin.v3.Write.MessageFlush.getDefaultInstance()) { + message_ = io.cloudquery.plugin.v3.Write.MessageFlush.newBuilder((io.cloudquery.plugin.v3.Write.MessageFlush) message_) + .mergeFrom(value).buildPartial(); + } else { + message_ = value; + } + onChanged(); + } else { + if (messageCase_ == 5) { + flushBuilder_.mergeFrom(value); + } else { + flushBuilder_.setMessage(value); + } + } + messageCase_ = 5; + return this; + } + /** + * .cloudquery.plugin.v3.Write.MessageFlush flush = 5; + */ + public Builder clearFlush() { + if (flushBuilder_ == null) { + if (messageCase_ == 5) { + messageCase_ = 0; + message_ = null; + onChanged(); + } + } else { + if (messageCase_ == 5) { + messageCase_ = 0; + message_ = null; + } + flushBuilder_.clear(); + } + return this; + } + /** + * .cloudquery.plugin.v3.Write.MessageFlush flush = 5; + */ + public io.cloudquery.plugin.v3.Write.MessageFlush.Builder getFlushBuilder() { + return internalGetFlushFieldBuilder().getBuilder(); + } + /** + * .cloudquery.plugin.v3.Write.MessageFlush flush = 5; + */ + @java.lang.Override + public io.cloudquery.plugin.v3.Write.MessageFlushOrBuilder getFlushOrBuilder() { + if ((messageCase_ == 5) && (flushBuilder_ != null)) { + return flushBuilder_.getMessageOrBuilder(); + } else { + if (messageCase_ == 5) { + return (io.cloudquery.plugin.v3.Write.MessageFlush) message_; + } + return io.cloudquery.plugin.v3.Write.MessageFlush.getDefaultInstance(); + } + } + /** + * .cloudquery.plugin.v3.Write.MessageFlush flush = 5; + */ + private com.google.protobuf.SingleFieldBuilder< + io.cloudquery.plugin.v3.Write.MessageFlush, io.cloudquery.plugin.v3.Write.MessageFlush.Builder, io.cloudquery.plugin.v3.Write.MessageFlushOrBuilder> + internalGetFlushFieldBuilder() { + if (flushBuilder_ == null) { + if (!(messageCase_ == 5)) { + message_ = io.cloudquery.plugin.v3.Write.MessageFlush.getDefaultInstance(); + } + flushBuilder_ = new com.google.protobuf.SingleFieldBuilder< + io.cloudquery.plugin.v3.Write.MessageFlush, io.cloudquery.plugin.v3.Write.MessageFlush.Builder, io.cloudquery.plugin.v3.Write.MessageFlushOrBuilder>( + (io.cloudquery.plugin.v3.Write.MessageFlush) message_, + getParentForChildren(), + isClean()); + message_ = null; + } + messageCase_ = 5; + onChanged(); + return flushBuilder_; + } + // @@protoc_insertion_point(builder_scope:cloudquery.plugin.v3.Write.Request) } @@ -4619,6 +5290,85 @@ public io.cloudquery.plugin.v3.Write.Request getDefaultInstanceForType() { public interface ResponseOrBuilder extends // @@protoc_insertion_point(interface_extends:cloudquery.plugin.v3.Write.Response) com.google.protobuf.MessageOrBuilder { + + /** + *
+     * WriteStream only: id of the Write.MessageFlush that completed
+     * 
+ * + * uint64 flush_id = 1; + * @return The flushId. + */ + long getFlushId(); + + /** + *
+     * WriteStream only: why some messages sent since the previous flush may not have been committed. A failure may be
+     * reported only once, so a later flush can succeed although earlier messages were lost: clients must treat the
+     * first failure as final. A plugin may end the stream after reporting a failure, or instead of reporting it.
+     * 
+ * + * string flush_error = 2; + * @return The flushError. + */ + java.lang.String getFlushError(); + /** + *
+     * WriteStream only: why some messages sent since the previous flush may not have been committed. A failure may be
+     * reported only once, so a later flush can succeed although earlier messages were lost: clients must treat the
+     * first failure as final. A plugin may end the stream after reporting a failure, or instead of reporting it.
+     * 
+ * + * string flush_error = 2; + * @return The bytes for flushError. + */ + com.google.protobuf.ByteString + getFlushErrorBytes(); + + /** + *
+     * WriteStream only: with flush_error, the tables whose messages may not have been committed. Empty if the plugin
+     * cannot tell, in which case messages of any table may have been lost.
+     * 
+ * + * repeated string failed_tables = 3; + * @return A list containing the failedTables. + */ + java.util.List + getFailedTablesList(); + /** + *
+     * WriteStream only: with flush_error, the tables whose messages may not have been committed. Empty if the plugin
+     * cannot tell, in which case messages of any table may have been lost.
+     * 
+ * + * repeated string failed_tables = 3; + * @return The count of failedTables. + */ + int getFailedTablesCount(); + /** + *
+     * WriteStream only: with flush_error, the tables whose messages may not have been committed. Empty if the plugin
+     * cannot tell, in which case messages of any table may have been lost.
+     * 
+ * + * repeated string failed_tables = 3; + * @param index The index of the element to return. + * @return The failedTables at the given index. + */ + java.lang.String getFailedTables(int index); + /** + *
+     * WriteStream only: with flush_error, the tables whose messages may not have been committed. Empty if the plugin
+     * cannot tell, in which case messages of any table may have been lost.
+     * 
+ * + * repeated string failed_tables = 3; + * @param index The index of the value to return. + * @return The bytes of the failedTables at the given index. + */ + com.google.protobuf.ByteString + getFailedTablesBytes(int index); } /** * Protobuf type {@code cloudquery.plugin.v3.Write.Response} @@ -4642,6 +5392,9 @@ private Response(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } private Response() { + flushError_ = ""; + failedTables_ = + com.google.protobuf.LazyStringArrayList.emptyList(); } public static final com.google.protobuf.Descriptors.Descriptor @@ -4649,17 +5402,140 @@ private Response() { return io.cloudquery.plugin.v3.PluginOuterClass.internal_static_cloudquery_plugin_v3_Write_Response_descriptor; } - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.cloudquery.plugin.v3.PluginOuterClass.internal_static_cloudquery_plugin_v3_Write_Response_descriptor; + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return io.cloudquery.plugin.v3.PluginOuterClass.internal_static_cloudquery_plugin_v3_Write_Response_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.cloudquery.plugin.v3.PluginOuterClass.internal_static_cloudquery_plugin_v3_Write_Response_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.cloudquery.plugin.v3.Write.Response.class, io.cloudquery.plugin.v3.Write.Response.Builder.class); + } + + public static final int FLUSH_ID_FIELD_NUMBER = 1; + private long flushId_ = 0L; + /** + *
+     * WriteStream only: id of the Write.MessageFlush that completed
+     * 
+ * + * uint64 flush_id = 1; + * @return The flushId. + */ + @java.lang.Override + public long getFlushId() { + return flushId_; + } + + public static final int FLUSH_ERROR_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object flushError_ = ""; + /** + *
+     * WriteStream only: why some messages sent since the previous flush may not have been committed. A failure may be
+     * reported only once, so a later flush can succeed although earlier messages were lost: clients must treat the
+     * first failure as final. A plugin may end the stream after reporting a failure, or instead of reporting it.
+     * 
+ * + * string flush_error = 2; + * @return The flushError. + */ + @java.lang.Override + public java.lang.String getFlushError() { + java.lang.Object ref = flushError_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + flushError_ = s; + return s; + } + } + /** + *
+     * WriteStream only: why some messages sent since the previous flush may not have been committed. A failure may be
+     * reported only once, so a later flush can succeed although earlier messages were lost: clients must treat the
+     * first failure as final. A plugin may end the stream after reporting a failure, or instead of reporting it.
+     * 
+ * + * string flush_error = 2; + * @return The bytes for flushError. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getFlushErrorBytes() { + java.lang.Object ref = flushError_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + flushError_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FAILED_TABLES_FIELD_NUMBER = 3; + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList failedTables_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + *
+     * WriteStream only: with flush_error, the tables whose messages may not have been committed. Empty if the plugin
+     * cannot tell, in which case messages of any table may have been lost.
+     * 
+ * + * repeated string failed_tables = 3; + * @return A list containing the failedTables. + */ + public com.google.protobuf.ProtocolStringList + getFailedTablesList() { + return failedTables_; } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.cloudquery.plugin.v3.PluginOuterClass.internal_static_cloudquery_plugin_v3_Write_Response_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.cloudquery.plugin.v3.Write.Response.class, io.cloudquery.plugin.v3.Write.Response.Builder.class); + /** + *
+     * WriteStream only: with flush_error, the tables whose messages may not have been committed. Empty if the plugin
+     * cannot tell, in which case messages of any table may have been lost.
+     * 
+ * + * repeated string failed_tables = 3; + * @return The count of failedTables. + */ + public int getFailedTablesCount() { + return failedTables_.size(); + } + /** + *
+     * WriteStream only: with flush_error, the tables whose messages may not have been committed. Empty if the plugin
+     * cannot tell, in which case messages of any table may have been lost.
+     * 
+ * + * repeated string failed_tables = 3; + * @param index The index of the element to return. + * @return The failedTables at the given index. + */ + public java.lang.String getFailedTables(int index) { + return failedTables_.get(index); + } + /** + *
+     * WriteStream only: with flush_error, the tables whose messages may not have been committed. Empty if the plugin
+     * cannot tell, in which case messages of any table may have been lost.
+     * 
+ * + * repeated string failed_tables = 3; + * @param index The index of the value to return. + * @return The bytes of the failedTables at the given index. + */ + public com.google.protobuf.ByteString + getFailedTablesBytes(int index) { + return failedTables_.getByteString(index); } private byte memoizedIsInitialized = -1; @@ -4676,14 +5552,43 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (flushId_ != 0L) { + output.writeUInt64(1, flushId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(flushError_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, flushError_); + } + for (int i = 0; i < failedTables_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, failedTables_.getRaw(i)); + } getUnknownFields().writeTo(output); } + private int computeSerializedSize_0() { + int size = 0; + if (flushId_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(1, flushId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(flushError_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, flushError_); + } + { + int dataSize = 0; + for (int i = 0; i < failedTables_.size(); i++) { + dataSize += computeStringSizeNoTag(failedTables_.getRaw(i)); + } + size += dataSize; + size += 1 * getFailedTablesList().size(); + } + return size; + } @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; + size += computeSerializedSize_0(); size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -4699,6 +5604,12 @@ public boolean equals(final java.lang.Object obj) { } io.cloudquery.plugin.v3.Write.Response other = (io.cloudquery.plugin.v3.Write.Response) obj; + if (getFlushId() + != other.getFlushId()) return false; + if (!getFlushError() + .equals(other.getFlushError())) return false; + if (!getFailedTablesList() + .equals(other.getFailedTablesList())) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -4710,6 +5621,15 @@ public int hashCode() { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + FLUSH_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getFlushId()); + hash = (37 * hash) + FLUSH_ERROR_FIELD_NUMBER; + hash = (53 * hash) + getFlushError().hashCode(); + if (getFailedTablesCount() > 0) { + hash = (37 * hash) + FAILED_TABLES_FIELD_NUMBER; + hash = (53 * hash) + getFailedTablesList().hashCode(); + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -4840,6 +5760,11 @@ private Builder( @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; + flushId_ = 0L; + flushError_ = ""; + failedTables_ = + com.google.protobuf.LazyStringArrayList.emptyList(); return this; } @@ -4866,10 +5791,25 @@ public io.cloudquery.plugin.v3.Write.Response build() { @java.lang.Override public io.cloudquery.plugin.v3.Write.Response buildPartial() { io.cloudquery.plugin.v3.Write.Response result = new io.cloudquery.plugin.v3.Write.Response(this); + if (bitField0_ != 0) { buildPartial0(result); } onBuilt(); return result; } + private void buildPartial0(io.cloudquery.plugin.v3.Write.Response result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.flushId_ = flushId_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.flushError_ = flushError_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + failedTables_.makeImmutable(); + result.failedTables_ = failedTables_; + } + } + @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof io.cloudquery.plugin.v3.Write.Response) { @@ -4882,6 +5822,24 @@ public Builder mergeFrom(com.google.protobuf.Message other) { public Builder mergeFrom(io.cloudquery.plugin.v3.Write.Response other) { if (other == io.cloudquery.plugin.v3.Write.Response.getDefaultInstance()) return this; + if (other.getFlushId() != 0L) { + setFlushId(other.getFlushId()); + } + if (!other.getFlushError().isEmpty()) { + flushError_ = other.flushError_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.failedTables_.isEmpty()) { + if (failedTables_.isEmpty()) { + failedTables_ = other.failedTables_; + bitField0_ |= 0x00000004; + } else { + ensureFailedTablesIsMutable(); + failedTables_.addAll(other.failedTables_); + } + onChanged(); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -4906,6 +5864,21 @@ public Builder mergeFrom( case 0: done = true; break; + case 8: { + flushId_ = input.readUInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: { + flushError_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: { + ensureFailedTablesIsMutable(); + failedTables_.add(input.readStringRequireUtf8()); + break; + } // case 26 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { done = true; // was an endgroup tag @@ -4921,6 +5894,309 @@ public Builder mergeFrom( } // finally return this; } + private int bitField0_; + + private long flushId_ ; + /** + *
+       * WriteStream only: id of the Write.MessageFlush that completed
+       * 
+ * + * uint64 flush_id = 1; + * @return The flushId. + */ + @java.lang.Override + public long getFlushId() { + return flushId_; + } + /** + *
+       * WriteStream only: id of the Write.MessageFlush that completed
+       * 
+ * + * uint64 flush_id = 1; + * @param value The flushId to set. + * @return This builder for chaining. + */ + public Builder setFlushId(long value) { + + flushId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
+       * WriteStream only: id of the Write.MessageFlush that completed
+       * 
+ * + * uint64 flush_id = 1; + * @return This builder for chaining. + */ + public Builder clearFlushId() { + bitField0_ = (bitField0_ & ~0x00000001); + flushId_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object flushError_ = ""; + /** + *
+       * WriteStream only: why some messages sent since the previous flush may not have been committed. A failure may be
+       * reported only once, so a later flush can succeed although earlier messages were lost: clients must treat the
+       * first failure as final. A plugin may end the stream after reporting a failure, or instead of reporting it.
+       * 
+ * + * string flush_error = 2; + * @return The flushError. + */ + public java.lang.String getFlushError() { + java.lang.Object ref = flushError_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + flushError_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * WriteStream only: why some messages sent since the previous flush may not have been committed. A failure may be
+       * reported only once, so a later flush can succeed although earlier messages were lost: clients must treat the
+       * first failure as final. A plugin may end the stream after reporting a failure, or instead of reporting it.
+       * 
+ * + * string flush_error = 2; + * @return The bytes for flushError. + */ + public com.google.protobuf.ByteString + getFlushErrorBytes() { + java.lang.Object ref = flushError_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + flushError_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * WriteStream only: why some messages sent since the previous flush may not have been committed. A failure may be
+       * reported only once, so a later flush can succeed although earlier messages were lost: clients must treat the
+       * first failure as final. A plugin may end the stream after reporting a failure, or instead of reporting it.
+       * 
+ * + * string flush_error = 2; + * @param value The flushError to set. + * @return This builder for chaining. + */ + public Builder setFlushError( + java.lang.String value) { + java.util.Objects.requireNonNull(value); + flushError_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
+       * WriteStream only: why some messages sent since the previous flush may not have been committed. A failure may be
+       * reported only once, so a later flush can succeed although earlier messages were lost: clients must treat the
+       * first failure as final. A plugin may end the stream after reporting a failure, or instead of reporting it.
+       * 
+ * + * string flush_error = 2; + * @return This builder for chaining. + */ + public Builder clearFlushError() { + flushError_ = getDefaultInstance().getFlushError(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
+       * WriteStream only: why some messages sent since the previous flush may not have been committed. A failure may be
+       * reported only once, so a later flush can succeed although earlier messages were lost: clients must treat the
+       * first failure as final. A plugin may end the stream after reporting a failure, or instead of reporting it.
+       * 
+ * + * string flush_error = 2; + * @param value The bytes for flushError to set. + * @return This builder for chaining. + */ + public Builder setFlushErrorBytes( + com.google.protobuf.ByteString value) { + java.util.Objects.requireNonNull(value); + checkByteStringIsUtf8(value); + flushError_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList failedTables_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + private void ensureFailedTablesIsMutable() { + if (!failedTables_.isModifiable()) { + failedTables_ = new com.google.protobuf.LazyStringArrayList(failedTables_); + } + bitField0_ |= 0x00000004; + } + /** + *
+       * WriteStream only: with flush_error, the tables whose messages may not have been committed. Empty if the plugin
+       * cannot tell, in which case messages of any table may have been lost.
+       * 
+ * + * repeated string failed_tables = 3; + * @return A list containing the failedTables. + */ + public com.google.protobuf.ProtocolStringList + getFailedTablesList() { + failedTables_.makeImmutable(); + return failedTables_; + } + /** + *
+       * WriteStream only: with flush_error, the tables whose messages may not have been committed. Empty if the plugin
+       * cannot tell, in which case messages of any table may have been lost.
+       * 
+ * + * repeated string failed_tables = 3; + * @return The count of failedTables. + */ + public int getFailedTablesCount() { + return failedTables_.size(); + } + /** + *
+       * WriteStream only: with flush_error, the tables whose messages may not have been committed. Empty if the plugin
+       * cannot tell, in which case messages of any table may have been lost.
+       * 
+ * + * repeated string failed_tables = 3; + * @param index The index of the element to return. + * @return The failedTables at the given index. + */ + public java.lang.String getFailedTables(int index) { + return failedTables_.get(index); + } + /** + *
+       * WriteStream only: with flush_error, the tables whose messages may not have been committed. Empty if the plugin
+       * cannot tell, in which case messages of any table may have been lost.
+       * 
+ * + * repeated string failed_tables = 3; + * @param index The index of the value to return. + * @return The bytes of the failedTables at the given index. + */ + public com.google.protobuf.ByteString + getFailedTablesBytes(int index) { + return failedTables_.getByteString(index); + } + /** + *
+       * WriteStream only: with flush_error, the tables whose messages may not have been committed. Empty if the plugin
+       * cannot tell, in which case messages of any table may have been lost.
+       * 
+ * + * repeated string failed_tables = 3; + * @param index The index to set the value at. + * @param value The failedTables to set. + * @return This builder for chaining. + */ + public Builder setFailedTables( + int index, java.lang.String value) { + java.util.Objects.requireNonNull(value); + ensureFailedTablesIsMutable(); + failedTables_.set(index, value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
+       * WriteStream only: with flush_error, the tables whose messages may not have been committed. Empty if the plugin
+       * cannot tell, in which case messages of any table may have been lost.
+       * 
+ * + * repeated string failed_tables = 3; + * @param value The failedTables to add. + * @return This builder for chaining. + */ + public Builder addFailedTables( + java.lang.String value) { + java.util.Objects.requireNonNull(value); + ensureFailedTablesIsMutable(); + failedTables_.add(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
+       * WriteStream only: with flush_error, the tables whose messages may not have been committed. Empty if the plugin
+       * cannot tell, in which case messages of any table may have been lost.
+       * 
+ * + * repeated string failed_tables = 3; + * @param values The failedTables to add. + * @return This builder for chaining. + */ + public Builder addAllFailedTables( + java.lang.Iterable values) { + ensureFailedTablesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, failedTables_); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
+       * WriteStream only: with flush_error, the tables whose messages may not have been committed. Empty if the plugin
+       * cannot tell, in which case messages of any table may have been lost.
+       * 
+ * + * repeated string failed_tables = 3; + * @return This builder for chaining. + */ + public Builder clearFailedTables() { + failedTables_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004);; + onChanged(); + return this; + } + /** + *
+       * WriteStream only: with flush_error, the tables whose messages may not have been committed. Empty if the plugin
+       * cannot tell, in which case messages of any table may have been lost.
+       * 
+ * + * repeated string failed_tables = 3; + * @param value The bytes of the failedTables to add. + * @return This builder for chaining. + */ + public Builder addFailedTablesBytes( + com.google.protobuf.ByteString value) { + java.util.Objects.requireNonNull(value); + checkByteStringIsUtf8(value); + ensureFailedTablesIsMutable(); + failedTables_.add(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } // @@protoc_insertion_point(builder_scope:cloudquery.plugin.v3.Write.Response) } diff --git a/src/main/proto/cloudquery/plugin/v3/plugin.proto b/src/main/proto/cloudquery/plugin/v3/plugin.proto index 740e366..1136b82 100644 --- a/src/main/proto/cloudquery/plugin/v3/plugin.proto +++ b/src/main/proto/cloudquery/plugin/v3/plugin.proto @@ -38,6 +38,12 @@ service Plugin { // 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); + // Write resources, like Write, and also accept Write.MessageFlush. + // The plugin sends one Write.Response per Write.MessageFlush, once it has tried to commit every message sent before + // the flush. Write.Response.flush_error is set if some messages sent since the previous flush may not have been + // committed. + // Only use it with plugins that set Init.Response.supports_flush. + rpc WriteStream(stream Write.Request) returns (stream Write.Response); } message GetName { @@ -69,7 +75,10 @@ message Init { bool no_connection = 2; // A flag to indicate plugins should skip establishing a connection string invocation_id = 3; // unique execution_id that will identify the invocation (sync, migrate etc) } - message Response {} + message Response { + // The plugin supports WriteStream and Write.MessageFlush + bool supports_flush = 1; + } } message GetTables { @@ -102,6 +111,19 @@ message Sync { string table_name = 1; string error = 2; } + // State backend rows to persist once every message sent before the checkpoint is committed to all destinations. + // Only sent when Sync.Request.supports_checkpoints is set. + // + // The record must: + // - have the cq:table_name schema metadata set to Sync.BackendOptions.table_name + // - have a "key" column and a "value" column, both of the arrow utf8 type (not large_utf8) + // - have a "version" column of the arrow uint64 type, if the state table has one + // - hold only the keys that changed. Each row is an upsert of its key; keys not in the record keep their state. + // When the same key is in several checkpoints, the row with the highest version wins, or the last row without a version column. + message MessageCheckpoint { + // marshalled arrow.Record + bytes record = 1; + } message BackendOptions { @@ -122,6 +144,9 @@ message Sync { BackendOptions backend = 5; optional Shard shard = 6; bool withErrorMessages = 7; // If true, the plugin will send error messages in the response stream + // If true, the client persists state backend writes from Sync.MessageCheckpoint, + // so the plugin sends them on the stream instead of writing to the state backend + bool supports_checkpoints = 8; } message Response { oneof message { @@ -129,6 +154,7 @@ message Sync { Sync.MessageInsert insert = 2; Sync.MessageDeleteRecord delete_record = 3; Sync.MessageError error = 4; + Sync.MessageCheckpoint checkpoint = 5; } } } @@ -198,15 +224,30 @@ message Write { repeated PredicatesGroup where_clause = 2; repeated TableRelation table_relations = 3; } + // Commit every message sent before this one. Only valid on WriteStream. + message MessageFlush { + uint64 id = 1; + } message Request { oneof message { Write.MessageMigrateTable migrate_table = 1; Write.MessageInsert insert = 2; Write.MessageDeleteStale delete = 3; - Write.MessageDeleteRecord delete_record = 4; + Write.MessageDeleteRecord delete_record = 4; + Write.MessageFlush flush = 5; } } - message Response {} + message Response { + // WriteStream only: id of the Write.MessageFlush that completed + uint64 flush_id = 1; + // WriteStream only: why some messages sent since the previous flush may not have been committed. A failure may be + // reported only once, so a later flush can succeed although earlier messages were lost: clients must treat the + // first failure as final. A plugin may end the stream after reporting a failure, or instead of reporting it. + string flush_error = 2; + // WriteStream only: with flush_error, the tables whose messages may not have been committed. Empty if the plugin + // cannot tell, in which case messages of any table may have been lost. + repeated string failed_tables = 3; + } } message Transform {