From cdd57a00005529cbb808ca006a6ba3d1a5d8f2cb Mon Sep 17 00:00:00 2001 From: Sagar Agarwal <11091414+sagarwaal@users.noreply.github.com> Date: Mon, 26 May 2025 16:28:54 +0530 Subject: [PATCH 01/11] chore: Support INTERVAL in CloudClientExecutor (#3893) Co-authored-by: Sagar Agarwal --- .../executor/spanner/CloudClientExecutor.java | 74 +++++++++++++++---- 1 file changed, 59 insertions(+), 15 deletions(-) diff --git a/google-cloud-spanner-executor/src/main/java/com/google/cloud/executor/spanner/CloudClientExecutor.java b/google-cloud-spanner-executor/src/main/java/com/google/cloud/executor/spanner/CloudClientExecutor.java index 08cda1a808..999c54a83e 100644 --- a/google-cloud-spanner-executor/src/main/java/com/google/cloud/executor/spanner/CloudClientExecutor.java +++ b/google-cloud-spanner-executor/src/main/java/com/google/cloud/executor/spanner/CloudClientExecutor.java @@ -47,6 +47,7 @@ import com.google.cloud.spanner.InstanceConfigInfo; import com.google.cloud.spanner.InstanceId; import com.google.cloud.spanner.InstanceInfo; +import com.google.cloud.spanner.Interval; import com.google.cloud.spanner.Key; import com.google.cloud.spanner.KeyRange; import com.google.cloud.spanner.KeySet; @@ -2899,6 +2900,9 @@ private com.google.spanner.executor.v1.ValueList buildStruct(StructReader struct case DATE: value.setDateDaysValue(daysFromDate(struct.getDate(i))); break; + case INTERVAL: + value.setStringValue(struct.getInterval(i).toISO8601()); + break; case UUID: value.setStringValue(struct.getUuid(i).toString()); break; @@ -3048,43 +3052,62 @@ private com.google.spanner.executor.v1.ValueList buildStruct(StructReader struct com.google.spanner.v1.Type.newBuilder().setCode(TypeCode.DATE).build()); } break; - case UUID: + case TIMESTAMP: { com.google.spanner.executor.v1.ValueList.Builder builder = com.google.spanner.executor.v1.ValueList.newBuilder(); - List values = struct.getUuidList(i); - for (UUID uuidValue : values) { + List values = struct.getTimestampList(i); + for (Timestamp timestampValue : values) { com.google.spanner.executor.v1.Value.Builder valueProto = com.google.spanner.executor.v1.Value.newBuilder(); - if (uuidValue == null) { + if (timestampValue == null) { builder.addValue(valueProto.setIsNull(true).build()); } else { - builder.addValue(valueProto.setStringValue(uuidValue.toString()).build()); + builder.addValue( + valueProto.setTimestampValue(timestampToProto(timestampValue)).build()); } } value.setArrayValue(builder.build()); value.setArrayType( - com.google.spanner.v1.Type.newBuilder().setCode(TypeCode.UUID).build()); + com.google.spanner.v1.Type.newBuilder().setCode(TypeCode.TIMESTAMP).build()); } break; - case TIMESTAMP: + case INTERVAL: { com.google.spanner.executor.v1.ValueList.Builder builder = com.google.spanner.executor.v1.ValueList.newBuilder(); - List values = struct.getTimestampList(i); - for (Timestamp timestampValue : values) { + List values = struct.getIntervalList(i); + for (Interval interval : values) { com.google.spanner.executor.v1.Value.Builder valueProto = com.google.spanner.executor.v1.Value.newBuilder(); - if (timestampValue == null) { + if (interval == null) { builder.addValue(valueProto.setIsNull(true).build()); } else { - builder.addValue( - valueProto.setTimestampValue(timestampToProto(timestampValue)).build()); + builder.addValue(valueProto.setStringValue(interval.toISO8601()).build()); } } value.setArrayValue(builder.build()); value.setArrayType( - com.google.spanner.v1.Type.newBuilder().setCode(TypeCode.TIMESTAMP).build()); + com.google.spanner.v1.Type.newBuilder().setCode(TypeCode.INTERVAL).build()); + } + break; + case UUID: + { + com.google.spanner.executor.v1.ValueList.Builder builder = + com.google.spanner.executor.v1.ValueList.newBuilder(); + List values = struct.getUuidList(i); + for (UUID uuidValue : values) { + com.google.spanner.executor.v1.Value.Builder valueProto = + com.google.spanner.executor.v1.Value.newBuilder(); + if (uuidValue == null) { + builder.addValue(valueProto.setIsNull(true).build()); + } else { + builder.addValue(valueProto.setStringValue(uuidValue.toString()).build()); + } + } + value.setArrayValue(builder.build()); + value.setArrayType( + com.google.spanner.v1.Type.newBuilder().setCode(TypeCode.UUID).build()); } break; case NUMERIC: @@ -3340,6 +3363,9 @@ private static com.google.cloud.spanner.Value valueProtoToCloudValue( case DATE: return com.google.cloud.spanner.Value.date( value.hasIsNull() ? null : dateFromDays(value.getDateDaysValue())); + case INTERVAL: + return com.google.cloud.spanner.Value.interval( + value.hasIsNull() ? null : Interval.parseFromString(value.getStringValue())); case UUID: return com.google.cloud.spanner.Value.uuid( value.hasIsNull() ? null : UUID.fromString(value.getStringValue())); @@ -3467,6 +3493,20 @@ private static com.google.cloud.spanner.Value valueProtoToCloudValue( .collect(Collectors.toList()), CloudClientExecutor::dateFromDays)); } + case INTERVAL: + if (value.hasIsNull()) { + return com.google.cloud.spanner.Value.intervalArray(null); + } else { + return com.google.cloud.spanner.Value.intervalArray( + unmarshallValueList( + value.getArrayValue().getValueList().stream() + .map(com.google.spanner.executor.v1.Value::getIsNull) + .collect(Collectors.toList()), + value.getArrayValue().getValueList().stream() + .map(com.google.spanner.executor.v1.Value::getStringValue) + .collect(Collectors.toList()), + Interval::parseFromString)); + } case UUID: if (value.hasIsNull()) { return com.google.cloud.spanner.Value.uuidArray(null); @@ -3646,10 +3686,12 @@ private static com.google.cloud.spanner.Type typeProtoToCloudType( return com.google.cloud.spanner.Type.float64(); case DATE: return com.google.cloud.spanner.Type.date(); - case UUID: - return com.google.cloud.spanner.Type.uuid(); case TIMESTAMP: return com.google.cloud.spanner.Type.timestamp(); + case INTERVAL: + return com.google.cloud.spanner.Type.interval(); + case UUID: + return com.google.cloud.spanner.Type.uuid(); case NUMERIC: if (typeProto.getTypeAnnotation().equals(TypeAnnotationCode.PG_NUMERIC)) { return com.google.cloud.spanner.Type.pgNumeric(); @@ -3704,6 +3746,8 @@ private static com.google.spanner.v1.Type cloudTypeToTypeProto(@Nonnull Type clo return com.google.spanner.v1.Type.newBuilder().setCode(TypeCode.TIMESTAMP).build(); case DATE: return com.google.spanner.v1.Type.newBuilder().setCode(TypeCode.DATE).build(); + case INTERVAL: + return com.google.spanner.v1.Type.newBuilder().setCode(TypeCode.INTERVAL).build(); case UUID: return com.google.spanner.v1.Type.newBuilder().setCode(TypeCode.UUID).build(); case NUMERIC: From 94b879c8c1848fa0b14dbe8cda8390cfe9e8fce6 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 26 May 2025 13:02:41 +0200 Subject: [PATCH 02/11] deps: update dependency io.opentelemetry:opentelemetry-bom to v1.50.0 (#3887) --- benchmarks/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmarks/pom.xml b/benchmarks/pom.xml index c3ad2195e4..8cc37de9d8 100644 --- a/benchmarks/pom.xml +++ b/benchmarks/pom.xml @@ -90,7 +90,7 @@ io.opentelemetry opentelemetry-bom - 1.47.0 + 1.50.0 pom import From 140c02f5d680afce511e07472845ad0074ae86ac Mon Sep 17 00:00:00 2001 From: cloud-java-bot <122572305+cloud-java-bot@users.noreply.github.com> Date: Mon, 26 May 2025 07:03:11 -0400 Subject: [PATCH 03/11] chore: Update generation configuration at Sat May 24 02:29:44 UTC 2025 (#3890) * chore: Update generation configuration at Thu May 22 02:31:25 UTC 2025 * chore: Update generation configuration at Fri May 23 02:31:26 UTC 2025 * chore: Update generation configuration at Sat May 24 02:29:44 UTC 2025 * chore: generate libraries at Sat May 24 02:30:13 UTC 2025 --- README.md | 2 +- generation_config.yaml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d09cf10429..eec01dec15 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,7 @@ If you are using Maven without the BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies: ```Groovy -implementation platform('com.google.cloud:libraries-bom:26.60.0') +implementation platform('com.google.cloud:libraries-bom:26.61.0') implementation 'com.google.cloud:google-cloud-spanner' ``` diff --git a/generation_config.yaml b/generation_config.yaml index 4bb3f10afe..6651ac99fa 100644 --- a/generation_config.yaml +++ b/generation_config.yaml @@ -1,6 +1,6 @@ gapic_generator_version: 2.58.0 -googleapis_commitish: 5c929307255b1726cdc72855ffc67014fc897d11 -libraries_bom_version: 26.60.0 +googleapis_commitish: bbeb0530ac9d8a61d8156f0d4e111909fc2827aa +libraries_bom_version: 26.61.0 libraries: - api_shortname: spanner name_pretty: Cloud Spanner From 10c35639b3a82fab5d19e7f02c7032c59e86d2df Mon Sep 17 00:00:00 2001 From: Emmanuel T Odeke Date: Mon, 26 May 2025 04:35:09 -0700 Subject: [PATCH 04/11] chore(x-goog-spanner-request-id): plumb for BatchCreateSessions (#3815) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(x-goog-spanner-request-id): plumb for BatchCreateSessions This change plumbs x-goog-spanner-request-id into BatchCreateSessions and asserts that the header is present for that method. Updates #3537 * test: fix failing test cases * Add setRequestIdCreator inside session tests * Plumb in test for DatabaseClientImpl.runWithSessionRetry behavior * Remove unnecessary debugs * Address review feedback * More code review updates * Ensure that requestIdCreator is non-null * More code review updates * More updates * DatabaseClientImpl.runWithSessionRetry update on ID * Move reqId attempt increase out of runWithRetries * Apply allOptions copy everywhere * Update tests for createMultiplexedSession * chore(x-goog-spanner-request-id): plumb for BatchCreateSessions This change plumbs x-goog-spanner-request-id into BatchCreateSessions and asserts that the header is present for that method. Updates #3537 * test: fix failing test cases * Add setRequestIdCreator inside session tests * Remove unnecessary debugs * Address review feedback * More code review updates * More code review updates More updates DatabaseClientImpl.runWithSessionRetry update on ID Move reqId attempt increase out of runWithRetries Apply allOptions copy everywhere Complete testrunWithSessionRetry_withRequestId * chore: fix failing test cases --------- Co-authored-by: Knut Olav Løite --- .../cloud/spanner/DatabaseClientImpl.java | 88 +++++++++- .../com/google/cloud/spanner/Options.java | 46 +++++- .../google/cloud/spanner/SessionClient.java | 65 ++++++-- .../com/google/cloud/spanner/SessionImpl.java | 60 ++++++- .../com/google/cloud/spanner/SessionPool.java | 4 + .../cloud/spanner/XGoogSpannerRequestId.java | 74 +++++++++ .../cloud/spanner/spi/v1/GapicSpannerRpc.java | 30 +++- .../cloud/spanner/spi/v1/SpannerRpc.java | 3 +- .../cloud/spanner/DatabaseClientImplTest.java | 117 ++++++++++++- .../com/google/cloud/spanner/OptionsTest.java | 38 +++++ .../cloud/spanner/SessionClientTests.java | 21 ++- .../google/cloud/spanner/SessionImplTest.java | 23 +-- .../google/cloud/spanner/SessionPoolTest.java | 17 +- .../spanner/TransactionManagerImplTest.java | 4 +- .../spanner/TransactionRunnerImplTest.java | 2 +- .../spanner/XGoogSpannerRequestIdTest.java | 156 +++++++++++++++++- 16 files changed, 688 insertions(+), 60 deletions(-) diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/DatabaseClientImpl.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/DatabaseClientImpl.java index 624aba7547..fdc51ea3f3 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/DatabaseClientImpl.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/DatabaseClientImpl.java @@ -24,14 +24,17 @@ import com.google.cloud.spanner.SpannerImpl.ClosedException; import com.google.cloud.spanner.Statement.StatementFactory; import com.google.common.annotations.VisibleForTesting; -import com.google.common.base.Function; import com.google.common.util.concurrent.ListenableFuture; import com.google.spanner.v1.BatchWriteResponse; import io.opentelemetry.api.common.Attributes; +import java.util.HashMap; +import java.util.Map; import java.util.concurrent.ExecutionException; import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.function.BiFunction; import javax.annotation.Nullable; class DatabaseClientImpl implements DatabaseClient { @@ -45,6 +48,9 @@ class DatabaseClientImpl implements DatabaseClient { @VisibleForTesting final MultiplexedSessionDatabaseClient multiplexedSessionDatabaseClient; @VisibleForTesting final boolean useMultiplexedSessionPartitionedOps; @VisibleForTesting final boolean useMultiplexedSessionForRW; + private final int dbId; + private final AtomicInteger nthRequest; + private final Map clientIdToOrdinalMap; final boolean useMultiplexedSessionBlindWrite; @@ -91,6 +97,20 @@ class DatabaseClientImpl implements DatabaseClient { this.tracer = tracer; this.useMultiplexedSessionForRW = useMultiplexedSessionForRW; this.commonAttributes = commonAttributes; + + this.clientIdToOrdinalMap = new HashMap(); + this.dbId = this.dbIdFromClientId(this.clientId); + this.nthRequest = new AtomicInteger(0); + } + + @VisibleForTesting + synchronized int dbIdFromClientId(String clientId) { + Integer id = this.clientIdToOrdinalMap.get(clientId); + if (id == null) { + id = this.clientIdToOrdinalMap.size() + 1; + this.clientIdToOrdinalMap.put(clientId, id); + } + return id; } @VisibleForTesting @@ -188,7 +208,11 @@ public CommitResponse writeWithOptions( if (canUseMultiplexedSessionsForRW() && getMultiplexedSessionDatabaseClient() != null) { return getMultiplexedSessionDatabaseClient().writeWithOptions(mutations, options); } - return runWithSessionRetry(session -> session.writeWithOptions(mutations, options)); + + return runWithSessionRetry( + (session, reqId) -> { + return session.writeWithOptions(mutations, withReqId(reqId, options)); + }); } catch (RuntimeException e) { span.setStatus(e); throw e; @@ -213,7 +237,8 @@ public CommitResponse writeAtLeastOnceWithOptions( .writeAtLeastOnceWithOptions(mutations, options); } return runWithSessionRetry( - session -> session.writeAtLeastOnceWithOptions(mutations, options)); + (session, reqId) -> + session.writeAtLeastOnceWithOptions(mutations, withReqId(reqId, options))); } catch (RuntimeException e) { span.setStatus(e); throw e; @@ -222,6 +247,15 @@ public CommitResponse writeAtLeastOnceWithOptions( } } + private int nextNthRequest() { + return this.nthRequest.incrementAndGet(); + } + + @VisibleForTesting + int getNthRequest() { + return this.nthRequest.get(); + } + @Override public ServerStream batchWriteAtLeastOnce( final Iterable mutationGroups, final TransactionOption... options) @@ -231,7 +265,9 @@ public ServerStream batchWriteAtLeastOnce( if (canUseMultiplexedSessionsForRW() && getMultiplexedSessionDatabaseClient() != null) { return getMultiplexedSessionDatabaseClient().batchWriteAtLeastOnce(mutationGroups, options); } - return runWithSessionRetry(session -> session.batchWriteAtLeastOnce(mutationGroups, options)); + return runWithSessionRetry( + (session, reqId) -> + session.batchWriteAtLeastOnce(mutationGroups, withReqId(reqId, options))); } catch (RuntimeException e) { span.setStatus(e); throw e; @@ -383,11 +419,42 @@ private Future getDialectAsync() { return pool.getDialectAsync(); } + private UpdateOption[] withReqId( + final XGoogSpannerRequestId reqId, final UpdateOption... options) { + if (reqId == null) { + return options; + } + if (options == null || options.length == 0) { + return new UpdateOption[] {new Options.RequestIdOption(reqId)}; + } + UpdateOption[] allOptions = new UpdateOption[options.length + 1]; + System.arraycopy(options, 0, allOptions, 0, options.length); + allOptions[options.length] = new Options.RequestIdOption(reqId); + return allOptions; + } + + private TransactionOption[] withReqId( + final XGoogSpannerRequestId reqId, final TransactionOption... options) { + if (reqId == null) { + return options; + } + if (options == null || options.length == 0) { + return new TransactionOption[] {new Options.RequestIdOption(reqId)}; + } + TransactionOption[] allOptions = new TransactionOption[options.length + 1]; + System.arraycopy(options, 0, allOptions, 0, options.length); + allOptions[options.length] = new Options.RequestIdOption(reqId); + return allOptions; + } + private long executePartitionedUpdateWithPooledSession( final Statement stmt, final UpdateOption... options) { ISpan span = tracer.spanBuilder(PARTITION_DML_TRANSACTION, commonAttributes); try (IScope s = tracer.withSpan(span)) { - return runWithSessionRetry(session -> session.executePartitionedUpdate(stmt, options)); + return runWithSessionRetry( + (session, reqId) -> { + return session.executePartitionedUpdate(stmt, withReqId(reqId, options)); + }); } catch (RuntimeException e) { span.setStatus(e); span.end(); @@ -395,15 +462,22 @@ private long executePartitionedUpdateWithPooledSession( } } - private T runWithSessionRetry(Function callable) { + @VisibleForTesting + T runWithSessionRetry(BiFunction callable) { PooledSessionFuture session = getSession(); + XGoogSpannerRequestId reqId = + XGoogSpannerRequestId.of( + this.dbId, Long.valueOf(session.getChannel()), this.nextNthRequest(), 1); while (true) { try { - return callable.apply(session); + return callable.apply(session, reqId); } catch (SessionNotFoundException e) { session = (PooledSessionFuture) pool.getPooledSessionReplacementHandler().replaceSession(e, session); + reqId = + XGoogSpannerRequestId.of( + this.dbId, Long.valueOf(session.getChannel()), this.nextNthRequest(), 1); } } } diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/Options.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/Options.java index c36f190264..9771e2173f 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/Options.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/Options.java @@ -177,6 +177,10 @@ public static UpdateTransactionOption excludeTxnFromChangeStreams() { return EXCLUDE_TXN_FROM_CHANGE_STREAMS_OPTION; } + public static RequestIdOption requestId(XGoogSpannerRequestId reqId) { + return new RequestIdOption(reqId); + } + /** * Specifying this will cause the read to yield at most this many rows. This should be greater * than 0. @@ -535,6 +539,7 @@ void appendToOptions(Options options) { private RpcLockHint lockHint; private Boolean lastStatement; private IsolationLevel isolationLevel; + private XGoogSpannerRequestId reqId; // Construction is via factory methods below. private Options() {} @@ -599,6 +604,14 @@ String filter() { return filter; } + boolean hasReqId() { + return reqId != null; + } + + XGoogSpannerRequestId reqId() { + return reqId; + } + boolean hasPriority() { return priority != null; } @@ -756,6 +769,9 @@ public String toString() { if (isolationLevel != null) { b.append("isolationLevel: ").append(isolationLevel).append(' '); } + if (reqId != null) { + b.append("requestId: ").append(reqId.toString()); + } return b.toString(); } @@ -798,7 +814,8 @@ public boolean equals(Object o) { && Objects.equals(orderBy(), that.orderBy()) && Objects.equals(isLastStatement(), that.isLastStatement()) && Objects.equals(lockHint(), that.lockHint()) - && Objects.equals(isolationLevel(), that.isolationLevel()); + && Objects.equals(isolationLevel(), that.isolationLevel()) + && Objects.equals(reqId(), that.reqId()); } @Override @@ -867,6 +884,9 @@ public int hashCode() { if (isolationLevel != null) { result = 31 * result + isolationLevel.hashCode(); } + if (reqId != null) { + result = 31 * result + reqId.hashCode(); + } return result; } @@ -1052,4 +1072,28 @@ public boolean equals(Object o) { return o instanceof LastStatementUpdateOption; } } + + static final class RequestIdOption extends InternalOption + implements ReadOption, TransactionOption, UpdateOption { + private final XGoogSpannerRequestId reqId; + + RequestIdOption(XGoogSpannerRequestId reqId) { + this.reqId = reqId; + } + + @Override + void appendToOptions(Options options) { + options.reqId = this.reqId; + } + + @Override + public int hashCode() { + return RequestIdOption.class.hashCode(); + } + + @Override + public boolean equals(Object o) { + return o instanceof RequestIdOption; + } + } } diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SessionClient.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SessionClient.java index 2edfb66d89..605f1639c5 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SessionClient.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SessionClient.java @@ -22,6 +22,7 @@ import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.grpc.GrpcTransportOptions.ExecutorFactory; import com.google.cloud.spanner.spi.v1.SpannerRpc; +import com.google.cloud.spanner.spi.v1.SpannerRpc.Option; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Maps; @@ -31,10 +32,11 @@ import java.util.List; import java.util.Map; import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.atomic.AtomicInteger; import javax.annotation.concurrent.GuardedBy; /** Client for creating single sessions and batches of sessions. */ -class SessionClient implements AutoCloseable { +class SessionClient implements AutoCloseable, XGoogSpannerRequestId.RequestIdCreator { static class SessionId { private static final PathTemplate NAME_TEMPLATE = PathTemplate.create( @@ -108,6 +110,17 @@ Object value() { return ImmutableMap.copyOf(tmp); } + static Map createRequestOptions( + long channelId, XGoogSpannerRequestId requestId) { + return ImmutableMap.of( + Option.CHANNEL_HINT, channelId, + Option.REQUEST_ID, requestId); + } + + static Map createRequestOptions(XGoogSpannerRequestId requestId) { + return ImmutableMap.of(Option.REQUEST_ID, requestId); + } + private final class BatchCreateSessionsRunnable implements Runnable { private final long channelHint; private final int sessionCount; @@ -174,6 +187,12 @@ interface SessionConsumer { private final DatabaseId db; private final Attributes commonAttributes; + // SessionClient is created long before a DatabaseClientImpl is created, + // as batch sessions are firstly created then later attached to each Client. + private static final AtomicInteger NTH_ID = new AtomicInteger(0); + private final int nthId = NTH_ID.incrementAndGet(); + private final AtomicInteger nthRequest = new AtomicInteger(0); + @GuardedBy("this") private volatile long sessionChannelCounter; @@ -201,14 +220,22 @@ DatabaseId getDatabaseId() { return db; } + @Override + public XGoogSpannerRequestId nextRequestId(long channelId, int attempt) { + return XGoogSpannerRequestId.of( + this.nthId, this.nthRequest.incrementAndGet(), channelId, attempt); + } + /** Create a single session. */ SessionImpl createSession() { // The sessionChannelCounter could overflow, but that will just flip it to Integer.MIN_VALUE, // which is also a valid channel hint. - final Map options; + final long channelId; synchronized (this) { - options = optionMap(SessionOption.channelHint(sessionChannelCounter++)); + channelId = sessionChannelCounter; + sessionChannelCounter++; } + XGoogSpannerRequestId reqId = nextRequestId(channelId, 1); ISpan span = spanner.getTracer().spanBuilder(SpannerImpl.CREATE_SESSION, this.commonAttributes); try (IScope s = spanner.getTracer().withSpan(span)) { com.google.spanner.v1.Session session = @@ -218,11 +245,16 @@ SessionImpl createSession() { db.getName(), spanner.getOptions().getDatabaseRole(), spanner.getOptions().getSessionLabels(), - options); + createRequestOptions(channelId, reqId)); SessionReference sessionReference = new SessionReference( - session.getName(), session.getCreateTime(), session.getMultiplexed(), options); - return new SessionImpl(spanner, sessionReference); + session.getName(), + session.getCreateTime(), + session.getMultiplexed(), + optionMap(SessionOption.channelHint(channelId))); + SessionImpl sessionImpl = new SessionImpl(spanner, sessionReference); + sessionImpl.setRequestIdCreator(this); + return sessionImpl; } catch (RuntimeException e) { span.setStatus(e); throw e; @@ -258,6 +290,9 @@ SessionImpl createMultiplexedSession() { spanner .getTracer() .spanBuilder(SpannerImpl.CREATE_MULTIPLEXED_SESSION, this.commonAttributes); + // MultiplexedSession doesn't use a channelId hence this hard-coded value. + int channelId = 0; + XGoogSpannerRequestId reqId = nextRequestId(channelId, 1); try (IScope s = spanner.getTracer().withSpan(span)) { com.google.spanner.v1.Session session = spanner @@ -266,13 +301,14 @@ SessionImpl createMultiplexedSession() { db.getName(), spanner.getOptions().getDatabaseRole(), spanner.getOptions().getSessionLabels(), - null, + createRequestOptions(reqId), true); SessionImpl sessionImpl = new SessionImpl( spanner, new SessionReference( session.getName(), session.getCreateTime(), session.getMultiplexed(), null)); + sessionImpl.setRequestIdCreator(this); span.addAnnotation( String.format("Request for %d multiplexed session returned %d session", 1, 1)); return sessionImpl; @@ -379,7 +415,6 @@ void asyncBatchCreateSessions( */ private List internalBatchCreateSessions( final int sessionCount, final long channelHint) throws SpannerException { - final Map options = optionMap(SessionOption.channelHint(channelHint)); ISpan parent = spanner.getTracer().getCurrentSpan(); ISpan span = spanner @@ -387,6 +422,8 @@ private List internalBatchCreateSessions( .spanBuilderWithExplicitParent(SpannerImpl.BATCH_CREATE_SESSIONS_REQUEST, parent); span.addAnnotation(String.format("Requesting %d sessions", sessionCount)); try (IScope s = spanner.getTracer().withSpan(span)) { + XGoogSpannerRequestId reqId = + XGoogSpannerRequestId.of(this.nthId, this.nthRequest.incrementAndGet(), channelHint, 1); List sessions = spanner .getRpc() @@ -395,21 +432,23 @@ private List internalBatchCreateSessions( sessionCount, spanner.getOptions().getDatabaseRole(), spanner.getOptions().getSessionLabels(), - options); + createRequestOptions(channelHint, reqId)); span.addAnnotation( String.format( "Request for %d sessions returned %d sessions", sessionCount, sessions.size())); span.end(); List res = new ArrayList<>(sessionCount); for (com.google.spanner.v1.Session session : sessions) { - res.add( + SessionImpl sessionImpl = new SessionImpl( spanner, new SessionReference( session.getName(), session.getCreateTime(), session.getMultiplexed(), - options))); + optionMap(SessionOption.channelHint(channelHint)))); + sessionImpl.setRequestIdCreator(this); + res.add(sessionImpl); } return res; } catch (RuntimeException e) { @@ -425,6 +464,8 @@ SessionImpl sessionWithId(String name) { synchronized (this) { options = optionMap(SessionOption.channelHint(sessionChannelCounter++)); } - return new SessionImpl(spanner, new SessionReference(name, options)); + SessionImpl sessionImpl = new SessionImpl(spanner, new SessionReference(name, options)); + sessionImpl.setRequestIdCreator(this); + return sessionImpl; } } diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SessionImpl.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SessionImpl.java index 6b6113d41d..c78cfaeea3 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SessionImpl.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SessionImpl.java @@ -126,18 +126,31 @@ interface SessionTransaction { private final Clock clock; private final Map options; private final ErrorHandler errorHandler; + private XGoogSpannerRequestId.RequestIdCreator requestIdCreator; SessionImpl(SpannerImpl spanner, SessionReference sessionReference) { this(spanner, sessionReference, NO_CHANNEL_HINT); } SessionImpl(SpannerImpl spanner, SessionReference sessionReference, int channelHint) { + this(spanner, sessionReference, channelHint, new XGoogSpannerRequestId.NoopRequestIdCreator()); + } + + SessionImpl( + SpannerImpl spanner, + SessionReference sessionReference, + int channelHint, + XGoogSpannerRequestId.RequestIdCreator requestIdCreator) { this.spanner = spanner; this.tracer = spanner.getTracer(); this.sessionReference = sessionReference; this.clock = spanner.getOptions().getSessionPoolOptions().getPoolMaintainerClock(); this.options = createOptions(sessionReference, channelHint); this.errorHandler = createErrorHandler(spanner.getOptions()); + this.requestIdCreator = requestIdCreator; + if (this.requestIdCreator == null) { + throw new IllegalStateException("requestIdCreator must be non-null"); + } } static Map createOptions( @@ -287,9 +300,14 @@ public CommitResponse writeAtLeastOnceWithOptions( } CommitRequest request = requestBuilder.build(); ISpan span = tracer.spanBuilder(SpannerImpl.COMMIT); + final XGoogSpannerRequestId reqId = reqIdOrFresh(options); + try (IScope s = tracer.withSpan(span)) { return SpannerRetryHelper.runTxWithRetriesOnAborted( - () -> new CommitResponse(spanner.getRpc().commit(request, getOptions()))); + () -> { + return new CommitResponse( + spanner.getRpc().commit(request, reqId.withOptions(getOptions()))); + }); } catch (RuntimeException e) { span.setStatus(e); throw e; @@ -298,6 +316,14 @@ public CommitResponse writeAtLeastOnceWithOptions( } } + private XGoogSpannerRequestId reqIdOrFresh(Options options) { + XGoogSpannerRequestId reqId = options.reqId(); + if (reqId == null) { + reqId = this.getRequestIdCreator().nextRequestId(1 /* TODO: channelId */, 1); + } + return reqId; + } + private RequestOptions getRequestOptions(TransactionOption... transactionOptions) { Options requestOptions = Options.fromTransactionOptions(transactionOptions); if (requestOptions.hasPriority() || requestOptions.hasTag()) { @@ -325,16 +351,19 @@ public ServerStream batchWriteAtLeastOnce( .setSession(getName()) .addAllMutationGroups(mutationGroupsProto); RequestOptions batchWriteRequestOptions = getRequestOptions(transactionOptions); + Options allOptions = Options.fromTransactionOptions(transactionOptions); + final XGoogSpannerRequestId reqId = reqIdOrFresh(allOptions); if (batchWriteRequestOptions != null) { requestBuilder.setRequestOptions(batchWriteRequestOptions); } - if (Options.fromTransactionOptions(transactionOptions).withExcludeTxnFromChangeStreams() - == Boolean.TRUE) { + if (allOptions.withExcludeTxnFromChangeStreams() == Boolean.TRUE) { requestBuilder.setExcludeTxnFromChangeStreams(true); } ISpan span = tracer.spanBuilder(SpannerImpl.BATCH_WRITE); try (IScope s = tracer.withSpan(span)) { - return spanner.getRpc().batchWriteAtLeastOnce(requestBuilder.build(), getOptions()); + return spanner + .getRpc() + .batchWriteAtLeastOnce(requestBuilder.build(), reqId.withOptions(getOptions())); } catch (Throwable e) { span.setStatus(e); throw SpannerExceptionFactory.newSpannerException(e); @@ -435,14 +464,18 @@ public AsyncTransactionManagerImpl transactionManagerAsync(TransactionOption... @Override public ApiFuture asyncClose() { - return spanner.getRpc().asyncDeleteSession(getName(), getOptions()); + XGoogSpannerRequestId reqId = + this.getRequestIdCreator().nextRequestId(1 /* TODO: channelId */, 0); + return spanner.getRpc().asyncDeleteSession(getName(), reqId.withOptions(getOptions())); } @Override public void close() { ISpan span = tracer.spanBuilder(SpannerImpl.DELETE_SESSION); try (IScope s = tracer.withSpan(span)) { - spanner.getRpc().deleteSession(getName(), getOptions()); + XGoogSpannerRequestId reqId = + this.getRequestIdCreator().nextRequestId(1 /* TODO: channelId */, 0); + spanner.getRpc().deleteSession(getName(), reqId.withOptions(getOptions())); } catch (RuntimeException e) { span.setStatus(e); throw e; @@ -472,8 +505,13 @@ ApiFuture beginTransactionAsync( } final BeginTransactionRequest request = requestBuilder.build(); final ApiFuture requestFuture; + XGoogSpannerRequestId reqId = + this.getRequestIdCreator().nextRequestId(1 /* TODO: channelId */, 1); try (IScope ignore = tracer.withSpan(span)) { - requestFuture = spanner.getRpc().beginTransactionAsync(request, channelHint, routeToLeader); + requestFuture = + spanner + .getRpc() + .beginTransactionAsync(request, reqId.withOptions(channelHint), routeToLeader); } requestFuture.addListener( () -> { @@ -551,4 +589,12 @@ void onTransactionDone() {} TraceWrapper getTracer() { return tracer; } + + public void setRequestIdCreator(XGoogSpannerRequestId.RequestIdCreator creator) { + this.requestIdCreator = creator; + } + + public XGoogSpannerRequestId.RequestIdCreator getRequestIdCreator() { + return this.requestIdCreator; + } } diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SessionPool.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SessionPool.java index fa4e1d03d0..42a67a6629 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SessionPool.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SessionPool.java @@ -1585,6 +1585,10 @@ PooledSession get(final boolean eligibleForLongRunning) { throw SpannerExceptionFactory.propagateInterrupt(e); } } + + public int getChannel() { + return get().getChannel(); + } } interface CachedSession extends Session { diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/XGoogSpannerRequestId.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/XGoogSpannerRequestId.java index 4f6c011475..9c69838367 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/XGoogSpannerRequestId.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/XGoogSpannerRequestId.java @@ -17,10 +17,17 @@ package com.google.cloud.spanner; import com.google.api.core.InternalApi; +import com.google.cloud.spanner.spi.v1.SpannerRpc; import com.google.common.annotations.VisibleForTesting; +import io.grpc.Metadata; import java.math.BigInteger; import java.security.SecureRandom; +import java.util.HashMap; +import java.util.Map; import java.util.Objects; +import java.util.regex.MatchResult; +import java.util.regex.Matcher; +import java.util.regex.Pattern; @InternalApi public class XGoogSpannerRequestId { @@ -28,6 +35,9 @@ public class XGoogSpannerRequestId { @VisibleForTesting static final String RAND_PROCESS_ID = XGoogSpannerRequestId.generateRandProcessId(); + public static final Metadata.Key REQUEST_HEADER_KEY = + Metadata.Key.of("x-goog-spanner-request-id", Metadata.ASCII_STRING_MARSHALLER); + @VisibleForTesting static final long VERSION = 1; // The version of the specification being implemented. @@ -48,6 +58,36 @@ public static XGoogSpannerRequestId of( return new XGoogSpannerRequestId(nthClientId, nthChannelId, nthRequest, attempt); } + @VisibleForTesting + long getAttempt() { + return this.attempt; + } + + @VisibleForTesting + long getNthRequest() { + return this.nthRequest; + } + + @VisibleForTesting + static final Pattern REGEX = + Pattern.compile("^(\\d)\\.([0-9a-z]{16})\\.(\\d+)\\.(\\d+)\\.(\\d+)\\.(\\d+)$"); + + public static XGoogSpannerRequestId of(String s) { + Matcher m = XGoogSpannerRequestId.REGEX.matcher(s); + if (!m.matches()) { + throw new IllegalStateException( + s + " does not match " + XGoogSpannerRequestId.REGEX.pattern()); + } + + MatchResult mr = m.toMatchResult(); + + return new XGoogSpannerRequestId( + Long.parseLong(mr.group(3)), + Long.parseLong(mr.group(4)), + Long.parseLong(mr.group(5)), + Long.parseLong(mr.group(6))); + } + private static String generateRandProcessId() { // Expecting to use 64-bits of randomness to avoid clashes. BigInteger bigInt = new BigInteger(64, new SecureRandom()); @@ -66,6 +106,14 @@ public String toString() { this.attempt); } + @VisibleForTesting + boolean isGreaterThan(XGoogSpannerRequestId other) { + return this.nthClientId > other.nthClientId + && this.nthChannelId > other.nthChannelId + && this.nthRequest > other.nthRequest + && this.attempt > other.attempt; + } + @Override public boolean equals(Object other) { // instanceof for a null object returns false. @@ -81,8 +129,34 @@ public boolean equals(Object other) { && Objects.equals(this.attempt, otherReqId.attempt); } + public void incrementAttempt() { + this.attempt++; + } + + Map withOptions(Map options) { + Map copyOptions = new HashMap<>(); + if (options != null) { + copyOptions.putAll(options); + } + copyOptions.put(SpannerRpc.Option.REQUEST_ID, this); + return copyOptions; + } + @Override public int hashCode() { return Objects.hash(this.nthClientId, this.nthChannelId, this.nthRequest, this.attempt); } + + interface RequestIdCreator { + XGoogSpannerRequestId nextRequestId(long channelId, int attempt); + } + + static class NoopRequestIdCreator implements RequestIdCreator { + NoopRequestIdCreator() {} + + @Override + public XGoogSpannerRequestId nextRequestId(long channelId, int attempt) { + return XGoogSpannerRequestId.of(1, 1, 1, 0); + } + } } diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/spi/v1/GapicSpannerRpc.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/spi/v1/GapicSpannerRpc.java index c43bbe1f11..0b3c6c649b 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/spi/v1/GapicSpannerRpc.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/spi/v1/GapicSpannerRpc.java @@ -71,6 +71,7 @@ import com.google.cloud.spanner.SpannerOptions; import com.google.cloud.spanner.SpannerOptions.CallContextConfigurator; import com.google.cloud.spanner.SpannerOptions.CallCredentialsProvider; +import com.google.cloud.spanner.XGoogSpannerRequestId; import com.google.cloud.spanner.admin.database.v1.stub.DatabaseAdminStub; import com.google.cloud.spanner.admin.database.v1.stub.DatabaseAdminStubSettings; import com.google.cloud.spanner.admin.database.v1.stub.GrpcDatabaseAdminCallableFactory; @@ -88,6 +89,7 @@ import com.google.common.base.Supplier; import com.google.common.base.Suppliers; import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.io.Resources; import com.google.common.util.concurrent.RateLimiter; @@ -193,6 +195,7 @@ import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; import java.time.Duration; +import java.util.Collections; import java.util.Comparator; import java.util.HashMap; import java.util.List; @@ -407,6 +410,8 @@ public GapicSpannerRpc(final SpannerOptions options) { final String emulatorHost = System.getenv("SPANNER_EMULATOR_HOST"); try { + // TODO: make our retry settings to inject and increment + // XGoogSpannerRequestId whenever a retry occurs. SpannerStubSettings spannerStubSettings = options.getSpannerStubSettings().toBuilder() .setTransportChannelProvider(channelProvider) @@ -1658,7 +1663,7 @@ public Session createSession( @Nullable Map labels, @Nullable Map options) throws SpannerException { - // By default sessions are not multiplexed + // By default, sessions are not multiplexed return createSession(databaseName, databaseRole, labels, options, false); } @@ -2029,11 +2034,12 @@ GrpcCallContext newCallContext( MethodDescriptor method, boolean routeToLeader) { GrpcCallContext context = this.baseGrpcCallContext; - if (options != null) { + Long affinity = options == null ? null : Option.CHANNEL_HINT.getLong(options); + if (affinity != null) { if (this.isGrpcGcpExtensionEnabled) { // Set channel affinity in gRPC-GCP. // Compute bounded channel hint to prevent gRPC-GCP affinity map from getting unbounded. - int boundedChannelHint = Option.CHANNEL_HINT.getLong(options).intValue() % this.numChannels; + int boundedChannelHint = affinity.intValue() % this.numChannels; context = context.withCallOptions( context @@ -2042,9 +2048,12 @@ GrpcCallContext newCallContext( GcpManagedChannel.AFFINITY_KEY, String.valueOf(boundedChannelHint))); } else { // Set channel affinity in GAX. - context = context.withChannelAffinity(Option.CHANNEL_HINT.getLong(options).intValue()); + context = context.withChannelAffinity(affinity.intValue()); } } + if (options != null) { + context = withRequestId(context, options); + } context = context.withExtraHeaders(metadataProvider.newExtraHeaders(resource, projectName)); if (routeToLeader && leaderAwareRoutingEnabled) { context = context.withExtraHeaders(metadataProvider.newRouteToLeaderHeader()); @@ -2064,6 +2073,19 @@ GrpcCallContext newCallContext( return (GrpcCallContext) context.merge(apiCallContextFromContext); } + GrpcCallContext withRequestId(GrpcCallContext context, Map options) { + XGoogSpannerRequestId reqId = (XGoogSpannerRequestId) options.get(Option.REQUEST_ID); + if (reqId == null) { + return context; + } + + Map> withReqId = + ImmutableMap.of( + XGoogSpannerRequestId.REQUEST_HEADER_KEY.name(), + Collections.singletonList(reqId.toString())); + return context.withExtraHeaders(withReqId); + } + void registerResponseObserver(SpannerResponseObserver responseObserver) { responseObservers.add(responseObserver); } diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/spi/v1/SpannerRpc.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/spi/v1/SpannerRpc.java index 73671b91ff..4b5682bb2b 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/spi/v1/SpannerRpc.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/spi/v1/SpannerRpc.java @@ -78,7 +78,8 @@ public interface SpannerRpc extends ServiceRpc { /** Options passed in {@link SpannerRpc} methods to control how an RPC is issued. */ enum Option { - CHANNEL_HINT("Channel Hint"); + CHANNEL_HINT("Channel Hint"), + REQUEST_ID("Request Id"); private final String value; diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/DatabaseClientImplTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/DatabaseClientImplTest.java index 6ceb3e979b..1db7335ef9 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/DatabaseClientImplTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/DatabaseClientImplTest.java @@ -34,6 +34,7 @@ import static org.junit.Assert.assertTrue; import static org.junit.Assume.assumeFalse; import static org.junit.Assume.assumeTrue; +import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; @@ -105,6 +106,7 @@ import io.grpc.Metadata; import io.grpc.MethodDescriptor; import io.grpc.Server; +import io.grpc.ServerInterceptors; import io.grpc.Status; import io.grpc.StatusRuntimeException; import io.grpc.inprocess.InProcessServerBuilder; @@ -119,6 +121,7 @@ import java.util.Arrays; import java.util.Base64; import java.util.Collections; +import java.util.HashSet; import java.util.List; import java.util.Random; import java.util.Set; @@ -128,6 +131,7 @@ import java.util.concurrent.ScheduledThreadPoolExecutor; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicLong; import java.util.function.Function; import java.util.logging.Level; import java.util.logging.Logger; @@ -152,6 +156,7 @@ public class DatabaseClientImplTest { private static final String DATABASE_NAME = String.format( "projects/%s/instances/%s/databases/%s", TEST_PROJECT, TEST_INSTANCE, TEST_DATABASE); + private static XGoogSpannerRequestIdTest.ServerHeaderEnforcer xGoogReqIdInterceptor; private static MockSpannerServiceImpl mockSpanner; private static Server server; private static LocalChannelProvider channelProvider; @@ -220,13 +225,31 @@ public static void startStaticServer() throws IOException { StatementResult.query(SELECT1_FROM_TABLE, MockSpannerTestUtil.SELECT1_RESULTSET)); mockSpanner.setBatchWriteResult(BATCH_WRITE_RESPONSES); + Set checkMethods = + new HashSet( + Arrays.asList( + "google.spanner.v1.Spanner/BatchCreateSessions" + // As functionality is added, uncomment each method. + // "google.spanner.v1.Spanner/BatchWrite", + // "google.spanner.v1.Spanner/BeginTransaction", + // "google.spanner.v1.Spanner/CreateSession", + // "google.spanner.v1.Spanner/DeleteSession", + // "google.spanner.v1.Spanner/ExecuteBatchDml", + // "google.spanner.v1.Spanner/ExecuteSql", + // "google.spanner.v1.Spanner/ExecuteStreamingSql", + // "google.spanner.v1.Spanner/StreamingRead", + // "google.spanner.v1.Spanner/PartitionQuery", + // "google.spanner.v1.Spanner/PartitionRead", + // "google.spanner.v1.Spanner/Commit", + )); + xGoogReqIdInterceptor = new XGoogSpannerRequestIdTest.ServerHeaderEnforcer(checkMethods); executor = Executors.newSingleThreadExecutor(); String uniqueName = InProcessServerBuilder.generateName(); server = InProcessServerBuilder.forName(uniqueName) // We need to use a real executor for timeouts to occur. .scheduledExecutorService(new ScheduledThreadPoolExecutor(1)) - .addService(mockSpanner) + .addService(ServerInterceptors.intercept(mockSpanner, xGoogReqIdInterceptor)) .build() .start(); channelProvider = LocalChannelProvider.create(uniqueName); @@ -264,6 +287,7 @@ public void tearDown() { spanner.close(); spannerWithEmptySessionPool.close(); mockSpanner.reset(); + xGoogReqIdInterceptor.reset(); mockSpanner.removeAllExecutionTimes(); } @@ -1391,6 +1415,7 @@ public void testWriteAtLeastOnceAborted() { List commitRequests = mockSpanner.getRequestsOfType(CommitRequest.class); assertEquals(2, commitRequests.size()); + xGoogReqIdInterceptor.assertIntegrity(); } @Test @@ -5197,6 +5222,26 @@ public void testRetryOnResourceExhausted() { } } + @Test + public void testSelectHasXGoogRequestIdHeader() { + Statement statement = + Statement.newBuilder("select id from test where b=@p1") + .bind("p1") + .toBytesArray( + Arrays.asList(ByteArray.copyFrom("test1"), null, ByteArray.copyFrom("test2"))) + .build(); + mockSpanner.putStatementResult(StatementResult.query(statement, SELECT1_RESULTSET)); + DatabaseClient client = + spanner.getDatabaseClient(DatabaseId.of(TEST_PROJECT, TEST_INSTANCE, TEST_DATABASE)); + try (ResultSet resultSet = client.singleUse().executeQuery(statement)) { + assertTrue(resultSet.next()); + assertEquals(1L, resultSet.getLong(0)); + assertFalse(resultSet.next()); + } finally { + xGoogReqIdInterceptor.assertIntegrity(); + } + } + @Test public void testSessionPoolExhaustedError_containsStackTraces() { assumeFalse( @@ -5590,4 +5635,74 @@ private boolean isMultiplexedSessionsEnabledForRW() { } return spanner.getOptions().getSessionPoolOptions().getUseMultiplexedSessionForRW(); } + + @Test + public void testdbIdFromClientId() { + SessionPool pool = mock(SessionPool.class); + PooledSessionFuture session = mock(PooledSessionFuture.class); + when(pool.getSession()).thenReturn(session); + TransactionOption option = mock(TransactionOption.class); + DatabaseClientImpl client = new DatabaseClientImpl(pool, mock(TraceWrapper.class)); + + for (int i = 0; i < 10; i++) { + String dbId = String.format("%d", i); + int id = client.dbIdFromClientId(dbId); + assertEquals(id, i + 2); // There was already 1 dbId after new DatabaseClientImpl. + } + } + + @Test + public void testrunWithSessionRetry_withRequestId() { + // Tests that DatabaseClientImpl.runWithSessionRetry correctly returns a XGoogSpannerRequestId + // and correctly increases its nthRequest ordinal number and that attempts stay at 1, given + // a fresh session returned on SessionNotFoundException. + SessionPool pool = mock(SessionPool.class); + PooledSessionFuture sessionFut = mock(PooledSessionFuture.class); + when(pool.getSession()).thenReturn(sessionFut); + SessionPool.PooledSession pooledSession = mock(SessionPool.PooledSession.class); + when(sessionFut.get()).thenReturn(pooledSession); + SessionPool.PooledSessionReplacementHandler sessionReplacementHandler = + mock(SessionPool.PooledSessionReplacementHandler.class); + when(pool.getPooledSessionReplacementHandler()).thenReturn(sessionReplacementHandler); + when(sessionReplacementHandler.replaceSession(any(), any())).thenReturn(sessionFut); + DatabaseClientImpl client = new DatabaseClientImpl(pool, mock(TraceWrapper.class)); + + // 1. Run with no fail runs a single attempt. + final AtomicInteger nCalls = new AtomicInteger(0); + client.runWithSessionRetry( + (session, reqId) -> { + assertEquals(reqId.getAttempt(), 1); + nCalls.incrementAndGet(); + return 1; + }); + assertEquals(nCalls.get(), 1); + + // Reset the call counter. + nCalls.set(0); + + // 2. Run with SessionNotFoundException and ensure that a fresh requestId is returned each time. + SessionNotFoundException excSessionNotFound = + SpannerExceptionFactoryTest.newSessionNotFoundException( + "projects/p/instances/i/databases/d/sessions/s"); + + final AtomicLong priorNthRequest = new AtomicLong(client.getNthRequest()); + client.runWithSessionRetry( + (session, reqId) -> { + // Monotonically increasing priorNthRequest. + assertEquals(reqId.getNthRequest() - priorNthRequest.get(), 1); + priorNthRequest.set(reqId.getNthRequest()); + + // Attempts stay at 1 since with a SessionNotFound exception, + // a fresh requestId is generated. + assertEquals(reqId.getAttempt(), 1); + + if (nCalls.addAndGet(1) < 4) { + throw excSessionNotFound; + } + + return 1; + }); + + assertEquals(nCalls.get(), 4); + } } diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/OptionsTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/OptionsTest.java index e2bcc92fed..f8b5304a70 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/OptionsTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/OptionsTest.java @@ -83,6 +83,7 @@ public void zeroPrefetchChunksNotAllowed() { @Test public void allOptionsPresent() { + XGoogSpannerRequestId reqId1 = XGoogSpannerRequestId.of(2, 3, 4, 5); Options options = Options.fromReadOptions( Options.limit(10), @@ -90,6 +91,7 @@ public void allOptionsPresent() { Options.dataBoostEnabled(true), Options.directedRead(DIRECTED_READ_OPTIONS), Options.orderBy(RpcOrderBy.NO_ORDER), + Options.requestId(reqId1), Options.lockHint(Options.RpcLockHint.SHARED)); assertThat(options.hasLimit()).isTrue(); assertThat(options.limit()).isEqualTo(10); @@ -101,6 +103,7 @@ public void allOptionsPresent() { assertTrue(options.hasOrderBy()); assertTrue(options.hasLockHint()); assertEquals(DIRECTED_READ_OPTIONS, options.directedReadOptions()); + assertEquals(options.reqId(), reqId1); } @Test @@ -873,4 +876,39 @@ public void testOptions_WithMultipleDifferentIsolationLevels() { Options options = Options.fromTransactionOptions(transactionOptions); assertEquals(options.isolationLevel(), IsolationLevel.SERIALIZABLE); } + + @Test + public void testRequestId() { + XGoogSpannerRequestId reqId1 = XGoogSpannerRequestId.of(1, 2, 3, 4); + XGoogSpannerRequestId reqId2 = XGoogSpannerRequestId.of(2, 3, 4, 5); + Options option1 = Options.fromUpdateOptions(Options.requestId(reqId1)); + Options option1Prime = Options.fromUpdateOptions(Options.requestId(reqId1)); + Options option2 = Options.fromUpdateOptions(Options.requestId(reqId2)); + Options option3 = Options.fromUpdateOptions(); + + assertEquals(option1, option1Prime); + assertNotEquals(option1, option2); + assertEquals(option1.hashCode(), option1Prime.hashCode()); + assertNotEquals(option1, option2); + assertNotEquals(option1, option3); + assertNotEquals(option1.hashCode(), option3.hashCode()); + + assertTrue(option1.hasReqId()); + assertThat(option1.toString()).contains("requestId: " + reqId1.toString()); + + assertFalse(option3.hasReqId()); + assertThat(option3.toString()).doesNotContain("requestId"); + } + + @Test + public void testOptions_WithMultipleDifferentRequestIds() { + XGoogSpannerRequestId reqId1 = XGoogSpannerRequestId.of(1, 1, 1, 1); + XGoogSpannerRequestId reqId2 = XGoogSpannerRequestId.of(1, 1, 1, 2); + TransactionOption[] transactionOptions = { + Options.requestId(reqId1), Options.requestId(reqId2), + }; + Options options = Options.fromTransactionOptions(transactionOptions); + assertNotEquals(options.reqId(), reqId1); + assertEquals(options.reqId(), reqId2); + } } diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/SessionClientTests.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/SessionClientTests.java index bcba430c52..5d3ed2bca5 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/SessionClientTests.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/SessionClientTests.java @@ -18,7 +18,7 @@ import static com.google.common.truth.Truth.assertThat; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.doNothing; @@ -153,8 +153,17 @@ public void createAndCloseSession() { assertThat(session.getName()).isEqualTo(sessionName); session.close(); + + final ArgumentCaptor> deleteOptionsCaptor = + ArgumentCaptor.forClass(Map.class); + final ArgumentCaptor sessionNameCaptor = ArgumentCaptor.forClass(String.class); + Mockito.verify(rpc).deleteSession(sessionNameCaptor.capture(), deleteOptionsCaptor.capture()); + assertEquals(sessionName, sessionNameCaptor.getValue()); // The same channelHint is passed for deleteSession (contained in "options"). - Mockito.verify(rpc).deleteSession(sessionName, options.getValue()); + assertEquals( + deleteOptionsCaptor.getValue().get(SpannerRpc.Option.CHANNEL_HINT), + options.getValue().get(SpannerRpc.Option.CHANNEL_HINT)); + assertTrue(deleteOptionsCaptor.getValue().containsKey(SpannerRpc.Option.REQUEST_ID)); } } @@ -198,7 +207,9 @@ public void onSessionCreateFailure(Throwable t, int createFailureForSessionCount client.createMultiplexedSession(consumer); } // for multiplexed session there is no channel hint pass in the RPC options - assertNull(options.getValue()); + assertNotNull(options.getValue()); + assertEquals(options.getValue().get(Option.CHANNEL_HINT), null); + assertNotNull(options.getValue().get(Option.REQUEST_ID)); assertEquals(1, returnedSessionCount.get()); } @@ -230,7 +241,9 @@ public void onSessionCreateFailure(Throwable t, int createFailureForSessionCount client.createMultiplexedSession(consumer); } // for multiplexed session there is no channel hint pass in the RPC options - assertNull(options.getValue()); + assertNotNull(options.getValue()); + assertEquals(options.getValue().get(Option.CHANNEL_HINT), null); + assertNotNull(options.getValue().get(Option.REQUEST_ID)); } @SuppressWarnings("unchecked") diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/SessionImplTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/SessionImplTest.java index eed75bb67e..df957f75eb 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/SessionImplTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/SessionImplTest.java @@ -21,6 +21,7 @@ import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertThrows; import static org.junit.Assert.fail; +import static org.mockito.ArgumentMatchers.anyMap; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; @@ -144,6 +145,7 @@ public void setUp() { when(rpc.getCommitRetrySettings()) .thenReturn(SpannerStubSettings.newBuilder().commitSettings().getRetrySettings()); session = spanner.getSessionClient(db).createSession(); + ((SessionImpl) session).setRequestIdCreator(new XGoogSpannerRequestId.NoopRequestIdCreator()); Span oTspan = mock(Span.class); ISpan span = new OpenTelemetrySpan(oTspan); when(oTspan.makeCurrent()).thenReturn(mock(Scope.class)); @@ -219,10 +221,14 @@ public void nestedTxnSucceedsWhenAllowed() { @Test public void writeAtLeastOnce() throws ParseException { String timestampString = "2015-10-01T10:54:20.021Z"; + com.google.protobuf.Timestamp t = Timestamps.parse(timestampString); + Transaction txnMetadata = Transaction.newBuilder().setReadTimestamp(t).build(); + Mockito.when(rpc.beginTransaction(Mockito.any(), Mockito.eq(options), eq(false))) + .thenReturn(txnMetadata); ArgumentCaptor commit = ArgumentCaptor.forClass(CommitRequest.class); CommitResponse response = CommitResponse.newBuilder().setCommitTimestamp(Timestamps.parse(timestampString)).build(); - Mockito.when(rpc.commit(commit.capture(), Mockito.eq(options))).thenReturn(response); + Mockito.when(rpc.commit(commit.capture(), anyMap())).thenReturn(response); Timestamp timestamp = session.writeAtLeastOnce( @@ -254,7 +260,7 @@ public void writeAtLeastOnceWithOptions() throws ParseException { ArgumentCaptor commit = ArgumentCaptor.forClass(CommitRequest.class); CommitResponse response = CommitResponse.newBuilder().setCommitTimestamp(Timestamps.parse(timestampString)).build(); - Mockito.when(rpc.commit(commit.capture(), Mockito.eq(options))).thenReturn(response); + Mockito.when(rpc.commit(commit.capture(), anyMap())).thenReturn(response); session.writeAtLeastOnceWithOptions( Collections.singletonList(Mutation.newInsertBuilder("T").set("C").to("x").build()), Options.tag(tag)); @@ -339,7 +345,7 @@ public void newMultiUseReadOnlyTransactionContextClosesOldSingleUseContext() { public void writeClosesOldSingleUseContext() throws ParseException { ReadContext ctx = session.singleUse(TimestampBound.strong()); - Mockito.when(rpc.commit(Mockito.any(), Mockito.eq(options))) + Mockito.when(rpc.commit(Mockito.any(), anyMap())) .thenReturn( CommitResponse.newBuilder() .setCommitTimestamp(Timestamps.parse("2015-10-01T10:54:20.021Z")) @@ -440,7 +446,7 @@ public void request(int numMessages) {} private void mockRead(final PartialResultSet myResultSet) { final ArgumentCaptor consumer = ArgumentCaptor.forClass(SpannerRpc.ResultStreamConsumer.class); - Mockito.when(rpc.read(Mockito.any(), consumer.capture(), Mockito.eq(options), eq(false))) + Mockito.when(rpc.read(Mockito.any(), consumer.capture(), anyMap(), eq(false))) .then( invocation -> { consumer.getValue().onPartialResultSet(myResultSet); @@ -456,8 +462,7 @@ public void multiUseReadOnlyTransactionReturnsEmptyTransactionMetadata() { PartialResultSet.newBuilder() .setMetadata(newMetadata(Type.struct(Type.StructField.of("C", Type.string())))) .build(); - Mockito.when(rpc.beginTransaction(Mockito.any(), Mockito.eq(options), eq(false))) - .thenReturn(txnMetadata); + Mockito.when(rpc.beginTransaction(Mockito.any(), anyMap(), eq(false))).thenReturn(txnMetadata); mockRead(resultSet); ReadOnlyTransaction txn = session.readOnlyTransaction(TimestampBound.strong()); @@ -475,8 +480,7 @@ public void multiUseReadOnlyTransactionReturnsMissingTimestamp() { PartialResultSet.newBuilder() .setMetadata(newMetadata(Type.struct(Type.StructField.of("C", Type.string())))) .build(); - Mockito.when(rpc.beginTransaction(Mockito.any(), Mockito.eq(options), eq(false))) - .thenReturn(txnMetadata); + Mockito.when(rpc.beginTransaction(Mockito.any(), anyMap(), eq(false))).thenReturn(txnMetadata); mockRead(resultSet); ReadOnlyTransaction txn = session.readOnlyTransaction(TimestampBound.strong()); @@ -495,8 +499,7 @@ public void multiUseReadOnlyTransactionReturnsMissingTransactionId() throws Pars PartialResultSet.newBuilder() .setMetadata(newMetadata(Type.struct(Type.StructField.of("C", Type.string())))) .build(); - Mockito.when(rpc.beginTransaction(Mockito.any(), Mockito.eq(options), eq(false))) - .thenReturn(txnMetadata); + Mockito.when(rpc.beginTransaction(Mockito.any(), anyMap(), eq(false))).thenReturn(txnMetadata); mockRead(resultSet); ReadOnlyTransaction txn = session.readOnlyTransaction(TimestampBound.strong()); diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/SessionPoolTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/SessionPoolTest.java index b027ebbc07..df2c89fd76 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/SessionPoolTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/SessionPoolTest.java @@ -1644,13 +1644,15 @@ public void testSessionNotFoundWrite() { SpannerExceptionFactoryTest.newSessionNotFoundException(sessionName); List mutations = Collections.singletonList(Mutation.newInsertBuilder("FOO").build()); final SessionImpl closedSession = mockSession(); - when(closedSession.writeWithOptions(mutations)).thenThrow(sessionNotFound); + closedSession.setRequestIdCreator(new XGoogSpannerRequestId.NoopRequestIdCreator()); + when(closedSession.writeWithOptions(eq(mutations), any())).thenThrow(sessionNotFound); final SessionImpl openSession = mockSession(); com.google.cloud.spanner.CommitResponse response = mock(com.google.cloud.spanner.CommitResponse.class); when(response.getCommitTimestamp()).thenReturn(Timestamp.now()); - when(openSession.writeWithOptions(mutations)).thenReturn(response); + openSession.setRequestIdCreator(new XGoogSpannerRequestId.NoopRequestIdCreator()); + when(openSession.writeWithOptions(eq(mutations), any())).thenReturn(response); doAnswer( invocation -> { executor.submit( @@ -1687,13 +1689,16 @@ public void testSessionNotFoundWriteAtLeastOnce() { SpannerExceptionFactoryTest.newSessionNotFoundException(sessionName); List mutations = Collections.singletonList(Mutation.newInsertBuilder("FOO").build()); final SessionImpl closedSession = mockSession(); - when(closedSession.writeAtLeastOnceWithOptions(mutations)).thenThrow(sessionNotFound); + closedSession.setRequestIdCreator(new XGoogSpannerRequestId.NoopRequestIdCreator()); + when(closedSession.writeAtLeastOnceWithOptions(eq(mutations), any())) + .thenThrow(sessionNotFound); final SessionImpl openSession = mockSession(); com.google.cloud.spanner.CommitResponse response = mock(com.google.cloud.spanner.CommitResponse.class); when(response.getCommitTimestamp()).thenReturn(Timestamp.now()); - when(openSession.writeAtLeastOnceWithOptions(mutations)).thenReturn(response); + openSession.setRequestIdCreator(new XGoogSpannerRequestId.NoopRequestIdCreator()); + when(openSession.writeAtLeastOnceWithOptions(eq(mutations), any())).thenReturn(response); doAnswer( invocation -> { executor.submit( @@ -1729,10 +1734,10 @@ public void testSessionNotFoundPartitionedUpdate() { SpannerExceptionFactoryTest.newSessionNotFoundException(sessionName); Statement statement = Statement.of("UPDATE FOO SET BAR=1 WHERE 1=1"); final SessionImpl closedSession = mockSession(); - when(closedSession.executePartitionedUpdate(statement)).thenThrow(sessionNotFound); + when(closedSession.executePartitionedUpdate(eq(statement), any())).thenThrow(sessionNotFound); final SessionImpl openSession = mockSession(); - when(openSession.executePartitionedUpdate(statement)).thenReturn(1L); + when(openSession.executePartitionedUpdate(eq(statement), any())).thenReturn(1L); doAnswer( invocation -> { executor.submit( diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/TransactionManagerImplTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/TransactionManagerImplTest.java index 547f6b70a2..19c03859e6 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/TransactionManagerImplTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/TransactionManagerImplTest.java @@ -241,7 +241,7 @@ public void usesPreparedTransaction() { Mockito.anyString(), Mockito.anyString(), Mockito.anyMap(), - Mockito.eq(null), + Mockito.anyMap(), Mockito.eq(true))) .thenAnswer( invocation -> @@ -324,7 +324,7 @@ public void inlineBegin() { Mockito.anyString(), Mockito.anyString(), Mockito.anyMap(), - Mockito.eq(null), + Mockito.anyMap(), Mockito.eq(true))) .thenAnswer( invocation -> diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/TransactionRunnerImplTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/TransactionRunnerImplTest.java index 3068b38f3e..c2f1009b43 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/TransactionRunnerImplTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/TransactionRunnerImplTest.java @@ -193,7 +193,7 @@ public void usesPreparedTransaction() { Mockito.anyString(), Mockito.anyString(), Mockito.anyMap(), - Mockito.eq(null), + Mockito.anyMap(), Mockito.eq(true))) .thenAnswer( invocation -> diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/XGoogSpannerRequestIdTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/XGoogSpannerRequestIdTest.java index 12c9213c7d..fd1ddbbf24 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/XGoogSpannerRequestIdTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/XGoogSpannerRequestIdTest.java @@ -18,18 +18,29 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotEquals; +import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; +import io.grpc.Metadata; +import io.grpc.MethodDescriptor.MethodType; +import io.grpc.ServerCall; +import io.grpc.ServerCallHandler; +import io.grpc.ServerInterceptor; +import io.grpc.Status; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.CopyOnWriteArrayList; import java.util.regex.Matcher; -import java.util.regex.Pattern; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; @RunWith(JUnit4.class) public class XGoogSpannerRequestIdTest { - private static final Pattern REGEX_RAND_PROCESS_ID = - Pattern.compile("1.([0-9a-z]{16})(\\.\\d+){3}\\.(\\d+)$"); @Test public void testEquals() { @@ -48,7 +59,144 @@ public void testEquals() { @Test public void testEnsureHexadecimalFormatForRandProcessID() { String str = XGoogSpannerRequestId.of(1, 2, 3, 4).toString(); - Matcher m = XGoogSpannerRequestIdTest.REGEX_RAND_PROCESS_ID.matcher(str); + Matcher m = XGoogSpannerRequestId.REGEX.matcher(str); assertTrue(m.matches()); } + + public static class ServerHeaderEnforcer implements ServerInterceptor { + private Map> unaryResults; + private Map> streamingResults; + private List gotValues; + private Set checkMethods; + + ServerHeaderEnforcer(Set checkMethods) { + this.gotValues = new CopyOnWriteArrayList(); + this.unaryResults = + new ConcurrentHashMap>(); + this.streamingResults = + new ConcurrentHashMap>(); + this.checkMethods = checkMethods; + } + + @Override + public ServerCall.Listener interceptCall( + ServerCall call, + final Metadata requestHeaders, + ServerCallHandler next) { + boolean isUnary = call.getMethodDescriptor().getType() == MethodType.UNARY; + String methodName = call.getMethodDescriptor().getFullMethodName(); + String gotReqIdStr = requestHeaders.get(XGoogSpannerRequestId.REQUEST_HEADER_KEY); + if (!this.checkMethods.contains(methodName)) { + return next.startCall(call, requestHeaders); + } + + Map> saver = this.streamingResults; + if (isUnary) { + saver = this.unaryResults; + } + + if (Objects.equals(gotReqIdStr, null) || Objects.equals(gotReqIdStr, "")) { + Status status = + Status.fromCode(Status.Code.INVALID_ARGUMENT) + .augmentDescription( + methodName + " lacks " + XGoogSpannerRequestId.REQUEST_HEADER_KEY); + call.close(status, requestHeaders); + return next.startCall(call, requestHeaders); + } + + assertNotNull(gotReqIdStr); + // Firstly assert and validate that at least we've got a requestId. + Matcher m = XGoogSpannerRequestId.REGEX.matcher(gotReqIdStr); + assertTrue(m.matches()); + + XGoogSpannerRequestId reqId = XGoogSpannerRequestId.of(gotReqIdStr); + if (!saver.containsKey(methodName)) { + saver.put(methodName, new CopyOnWriteArrayList()); + } + + saver.get(methodName).add(reqId); + + // Finally proceed with the call. + return next.startCall(call, requestHeaders); + } + + public String[] accumulatedValues() { + return this.gotValues.toArray(new String[0]); + } + + public void assertIntegrity() { + this.unaryResults.forEach( + (String method, CopyOnWriteArrayList values) -> { + assertMonotonicityOfIds(method, values); + }); + this.streamingResults.forEach( + (String method, CopyOnWriteArrayList values) -> { + assertMonotonicityOfIds(method, values); + }); + } + + private void assertMonotonicityOfIds(String prefix, List reqIds) { + int size = reqIds.size(); + + List violations = new ArrayList<>(); + for (int i = 1; i < size; i++) { + XGoogSpannerRequestId prev = reqIds.get(i - 1); + XGoogSpannerRequestId curr = reqIds.get(i); + if (prev.isGreaterThan(curr)) { + violations.add(String.format("#%d(%s) > #%d(%s)", i - 1, prev, i, curr)); + } + } + + if (violations.isEmpty()) { + return; + } + + throw new IllegalStateException( + prefix + + " monotonicity violation:" + + String.join("\n\t", violations.toArray(new String[0]))); + } + + public static class methodAndRequestId { + String method; + String requestId; + + public methodAndRequestId(String method, String requestId) { + this.method = method; + this.requestId = requestId; + } + + public String toString() { + return "{" + this.method + ":" + this.requestId + "}"; + } + } + + public methodAndRequestId[] accumulatedUnaryValues() { + List accumulated = new ArrayList(); + this.unaryResults.forEach( + (String method, CopyOnWriteArrayList values) -> { + for (int i = 0; i < values.size(); i++) { + accumulated.add(new methodAndRequestId(method, values.get(i).toString())); + } + }); + return accumulated.toArray(new methodAndRequestId[0]); + } + + public methodAndRequestId[] accumulatedStreamingValues() { + List accumulated = new ArrayList(); + this.streamingResults.forEach( + (String method, CopyOnWriteArrayList values) -> { + for (int i = 0; i < values.size(); i++) { + accumulated.add(new methodAndRequestId(method, values.get(i).toString())); + } + }); + return accumulated.toArray(new methodAndRequestId[0]); + } + + public void reset() { + this.gotValues.clear(); + this.unaryResults.clear(); + this.streamingResults.clear(); + } + } } From 706f794f044c2cb1112cfdae6f379e5f2bc3f26f Mon Sep 17 00:00:00 2001 From: surbhigarg92 Date: Fri, 30 May 2025 15:10:31 +0530 Subject: [PATCH 05/11] feat: enable grpc and afe metrics (#3896) --- .../google/cloud/spanner/SpannerOptions.java | 12 +- .../cloud/spanner/spi/v1/GapicSpannerRpc.java | 10 +- ...OpenTelemetryBuiltInMetricsTracerTest.java | 105 ++---------------- 3 files changed, 13 insertions(+), 114 deletions(-) diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerOptions.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerOptions.java index a25e8bfa99..790c602d45 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerOptions.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerOptions.java @@ -923,16 +923,10 @@ public boolean isEnableBuiltInMetrics() { @Override public boolean isEnableGRPCBuiltInMetrics() { - // Enable gRPC built-in metrics if: - // 1. The env var SPANNER_DISABLE_DIRECT_ACCESS_GRPC_BUILTIN_METRICS is explicitly set to - // "false", OR - // 2. DirectPath is enabled AND the env var is not set to "true" - // This allows metrics to be enabled by default when DirectPath is on, unless explicitly + // Enable gRPC built-in metrics as default unless explicitly // disabled via env. - String grpcDisableEnv = System.getenv("SPANNER_DISABLE_DIRECT_ACCESS_GRPC_BUILTIN_METRICS"); - boolean isDirectPathEnabled = GapicSpannerRpc.isEnableDirectPathXdsEnv(); - return ("false".equalsIgnoreCase(grpcDisableEnv)) - || (isDirectPathEnabled && !"true".equalsIgnoreCase(grpcDisableEnv)); + return !Boolean.parseBoolean( + System.getenv(SPANNER_DISABLE_DIRECT_ACCESS_GRPC_BUILTIN_METRICS)); } @Override diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/spi/v1/GapicSpannerRpc.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/spi/v1/GapicSpannerRpc.java index 0b3c6c649b..27d63c930d 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/spi/v1/GapicSpannerRpc.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/spi/v1/GapicSpannerRpc.java @@ -682,15 +682,9 @@ private static boolean isEmulatorEnabled(SpannerOptions options, String emulator } public static boolean isEnableAFEServerTiming() { - // Enable AFE metrics and add AFE header if: - // 1. The env var SPANNER_DISABLE_AFE_SERVER_TIMING is explicitly set to "false", OR - // 2. DirectPath is enabled AND the env var is not set to "true" - // This allows metrics to be enabled by default when DirectPath is on, unless explicitly + // Enable AFE metrics as default unless explicitly // disabled via env. - String afeDisableEnv = System.getenv("SPANNER_DISABLE_AFE_SERVER_TIMING"); - boolean isDirectPathEnabled = isEnableDirectPathXdsEnv(); - return ("false".equalsIgnoreCase(afeDisableEnv)) - || (isDirectPathEnabled && !"true".equalsIgnoreCase(afeDisableEnv)); + return !Boolean.parseBoolean(System.getenv("SPANNER_DISABLE_AFE_SERVER_TIMING")); } public static boolean isEnableDirectPathXdsEnv() { diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/OpenTelemetryBuiltInMetricsTracerTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/OpenTelemetryBuiltInMetricsTracerTest.java index 55c5cf4771..c3b91ad6c5 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/OpenTelemetryBuiltInMetricsTracerTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/OpenTelemetryBuiltInMetricsTracerTest.java @@ -24,8 +24,6 @@ import static org.junit.Assert.assertThrows; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; -import static org.junit.Assume.assumeFalse; -import static org.junit.Assume.assumeTrue; import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; import com.google.api.gax.retrying.RetrySettings; @@ -34,7 +32,6 @@ import com.google.cloud.spanner.MockSpannerServiceImpl.SimulatedExecutionTime; import com.google.cloud.spanner.MockSpannerServiceImpl.StatementResult; import com.google.cloud.spanner.connection.RandomResultSetGenerator; -import com.google.cloud.spanner.spi.v1.GapicSpannerRpc; import com.google.common.base.Stopwatch; import com.google.common.collect.ImmutableList; import com.google.common.collect.Range; @@ -51,7 +48,6 @@ import io.opentelemetry.sdk.metrics.data.MetricData; import io.opentelemetry.sdk.testing.exporter.InMemoryMetricReader; import java.io.IOException; -import java.lang.reflect.Field; import java.net.InetSocketAddress; import java.time.Duration; import java.util.Collection; @@ -195,19 +191,11 @@ public void testMetricsSingleUseQuery() { checkIfMetricExists(metricReader, BuiltInMetricsConstant.GFE_CONNECTIVITY_ERROR_NAME)); assertFalse( checkIfMetricExists(metricReader, BuiltInMetricsConstant.AFE_CONNECTIVITY_ERROR_NAME)); - if (GapicSpannerRpc.isEnableDirectPathXdsEnv()) { - // AFE metrics are enabled for DirectPath. - MetricData afeLatencyMetricData = - getMetricData(metricReader, BuiltInMetricsConstant.AFE_LATENCIES_NAME); - double afeLatencyValue = getAggregatedValue(afeLatencyMetricData, expectedAttributes); - assertEquals(fakeAFEServerTiming.get(), afeLatencyValue, 1e-6); - } else { - MetricData gfeLatencyMetricData = - getMetricData(metricReader, BuiltInMetricsConstant.GFE_LATENCIES_NAME); - double gfeLatencyValue = getAggregatedValue(gfeLatencyMetricData, expectedAttributes); - assertEquals(fakeServerTiming.get(), gfeLatencyValue, 1e-6); - assertFalse(checkIfMetricExists(metricReader, BuiltInMetricsConstant.AFE_LATENCIES_NAME)); - } + // AFE metrics are enabled for DirectPath. + MetricData afeLatencyMetricData = + getMetricData(metricReader, BuiltInMetricsConstant.AFE_LATENCIES_NAME); + double afeLatencyValue = getAggregatedValue(afeLatencyMetricData, expectedAttributes); + assertEquals(fakeAFEServerTiming.get(), afeLatencyValue, 1e-6); } private boolean isJava8() { @@ -218,75 +206,6 @@ private boolean isWindows() { return System.getProperty("os.name").toLowerCase().contains("windows"); } - @Test - public void testMetricsSingleUseQueryWithAfeEnabled() throws Exception { - assumeTrue(isJava8() && !isWindows()); - assumeFalse(System.getenv().containsKey("SPANNER_DISABLE_AFE_SERVER_TIMING")); - - Class classOfMap = System.getenv().getClass(); - Field field = classOfMap.getDeclaredField("m"); - field.setAccessible(true); - Map writeableEnvironmentVariables = - (Map) field.get(System.getenv()); - - try { - writeableEnvironmentVariables.put("SPANNER_DISABLE_AFE_SERVER_TIMING", "false"); - - Stopwatch stopwatch = Stopwatch.createStarted(); - try (ResultSet resultSet = client.singleUse().executeQuery(SELECT_RANDOM)) { - assertTrue(resultSet.next()); - assertFalse(resultSet.next()); - } - - double elapsed = stopwatch.elapsed(TimeUnit.MILLISECONDS); - Attributes expectedAttributes = - expectedCommonBaseAttributes.toBuilder() - .putAll(expectedCommonRequestAttributes) - .put(BuiltInMetricsConstant.STATUS_KEY, "OK") - .put(BuiltInMetricsConstant.METHOD_KEY, "Spanner.ExecuteStreamingSql") - .build(); - - MetricData operationLatencyMetricData = - getMetricData(metricReader, BuiltInMetricsConstant.OPERATION_LATENCIES_NAME); - assertNotNull(operationLatencyMetricData); - double operationLatencyValue = - getAggregatedValue(operationLatencyMetricData, expectedAttributes); - assertThat(operationLatencyValue).isIn(Range.closed(MIN_LATENCY, elapsed)); - - MetricData attemptLatencyMetricData = - getMetricData(metricReader, BuiltInMetricsConstant.ATTEMPT_LATENCIES_NAME); - assertNotNull(attemptLatencyMetricData); - double attemptLatencyValue = getAggregatedValue(attemptLatencyMetricData, expectedAttributes); - assertThat(attemptLatencyValue).isIn(Range.closed(MIN_LATENCY, elapsed)); - - MetricData operationCountMetricData = - getMetricData(metricReader, BuiltInMetricsConstant.OPERATION_COUNT_NAME); - assertNotNull(operationCountMetricData); - assertThat(getAggregatedValue(operationCountMetricData, expectedAttributes)).isEqualTo(1); - - MetricData attemptCountMetricData = - getMetricData(metricReader, BuiltInMetricsConstant.ATTEMPT_COUNT_NAME); - assertNotNull(attemptCountMetricData); - assertThat(getAggregatedValue(attemptCountMetricData, expectedAttributes)).isEqualTo(1); - - assertFalse( - checkIfMetricExists(metricReader, BuiltInMetricsConstant.GFE_CONNECTIVITY_ERROR_NAME)); - assertFalse( - checkIfMetricExists(metricReader, BuiltInMetricsConstant.AFE_CONNECTIVITY_ERROR_NAME)); - MetricData afeLatencyMetricData = - getMetricData(metricReader, BuiltInMetricsConstant.AFE_LATENCIES_NAME); - double afeLatencyValue = getAggregatedValue(afeLatencyMetricData, expectedAttributes); - assertEquals(fakeAFEServerTiming.get(), afeLatencyValue, 1e-6); - - MetricData gfeLatencyMetricData = - getMetricData(metricReader, BuiltInMetricsConstant.GFE_LATENCIES_NAME); - double gfeLatencyValue = getAggregatedValue(gfeLatencyMetricData, expectedAttributes); - assertEquals(fakeServerTiming.get(), gfeLatencyValue, 1e-6); - } finally { - writeableEnvironmentVariables.remove("GOOGLE_CLOUD_SPANNER_MULTIPLEXED_SESSIONS"); - } - } - @Test public void testMetricsWithGaxRetryUnaryRpc() { Stopwatch stopwatch = Stopwatch.createStarted(); @@ -454,17 +373,9 @@ public void testNoServerTimingHeader() throws IOException, InterruptedException assertFalse(checkIfMetricExists(metricReader, BuiltInMetricsConstant.AFE_LATENCIES_NAME)); assertFalse(checkIfMetricExists(metricReader, BuiltInMetricsConstant.GFE_LATENCIES_NAME)); - if (GapicSpannerRpc.isEnableDirectPathXdsEnv()) { - MetricData afeConnectivityMetricData = - getMetricData(metricReader, BuiltInMetricsConstant.AFE_CONNECTIVITY_ERROR_NAME); - assertThat(getAggregatedValue(afeConnectivityMetricData, expectedAttributes)).isEqualTo(1); - } else { - MetricData gfeConnectivityMetricData = - getMetricData(metricReader, BuiltInMetricsConstant.GFE_CONNECTIVITY_ERROR_NAME); - assertThat(getAggregatedValue(gfeConnectivityMetricData, expectedAttributes)).isEqualTo(1); - assertFalse( - checkIfMetricExists(metricReader, BuiltInMetricsConstant.AFE_CONNECTIVITY_ERROR_NAME)); - } + MetricData afeConnectivityMetricData = + getMetricData(metricReader, BuiltInMetricsConstant.AFE_CONNECTIVITY_ERROR_NAME); + assertThat(getAggregatedValue(afeConnectivityMetricData, expectedAttributes)).isEqualTo(1); spannerNoHeader.close(); serverNoHeader.shutdown(); From 53bc510145921d00bc3df04aa4cf407179ed8d8e Mon Sep 17 00:00:00 2001 From: surbhigarg92 Date: Fri, 30 May 2025 16:27:41 +0530 Subject: [PATCH 06/11] fix: directpath_enabled attribute (#3897) --- .../cloud/spanner/spi/v1/GapicSpannerRpc.java | 18 +++++------------- .../spanner/spi/v1/HeaderInterceptor.java | 9 ++------- .../spi/v1/SpannerInterceptorProvider.java | 4 ++-- 3 files changed, 9 insertions(+), 22 deletions(-) diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/spi/v1/GapicSpannerRpc.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/spi/v1/GapicSpannerRpc.java index 27d63c930d..937367e3d3 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/spi/v1/GapicSpannerRpc.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/spi/v1/GapicSpannerRpc.java @@ -86,8 +86,6 @@ import com.google.common.base.Function; import com.google.common.base.MoreObjects; import com.google.common.base.Preconditions; -import com.google.common.base.Supplier; -import com.google.common.base.Suppliers; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; @@ -239,6 +237,7 @@ public class GapicSpannerRpc implements SpannerRpc { private static final String CLIENT_LIBRARY_LANGUAGE = "spanner-java"; public static final String DEFAULT_USER_AGENT = CLIENT_LIBRARY_LANGUAGE + "/" + GaxProperties.getLibraryVersion(GapicSpannerRpc.class); + public static boolean DIRECTPATH_CHANNEL_CREATED = false; private static final String API_FILE = "grpc-gcp-apiconfig.json"; private boolean rpcIsClosed; @@ -281,8 +280,6 @@ public class GapicSpannerRpc implements SpannerRpc { private final int numChannels; private final boolean isGrpcGcpExtensionEnabled; - private Supplier directPathEnabledSupplier = () -> false; - private final GrpcCallContext baseGrpcCallContext; public static GapicSpannerRpc create(SpannerOptions options) { @@ -361,9 +358,7 @@ public GapicSpannerRpc(final SpannerOptions options) { SpannerInterceptorProvider.create( MoreObjects.firstNonNull( options.getInterceptorProvider(), - SpannerInterceptorProvider.createDefault( - options.getOpenTelemetry(), - (() -> directPathEnabledSupplier.get())))) + SpannerInterceptorProvider.createDefault(options.getOpenTelemetry()))) // This sets the trace context headers. .withTraceContext(endToEndTracingEnabled, options.getOpenTelemetry()) // This sets the response compressor (Server -> Client). @@ -425,12 +420,9 @@ public GapicSpannerRpc(final SpannerOptions options) { this.spannerStub = GrpcSpannerStubWithStubSettingsAndClientContext.create( spannerStubSettings, clientContext); - this.directPathEnabledSupplier = - Suppliers.memoize( - () -> { - return ((GrpcTransportChannel) clientContext.getTransportChannel()).isDirectPath() - && isAttemptDirectPathXds; - }); + DIRECTPATH_CHANNEL_CREATED = + ((GrpcTransportChannel) clientContext.getTransportChannel()).isDirectPath() + && isAttemptDirectPathXds; this.readRetrySettings = options.getSpannerStubSettings().streamingReadSettings().getRetrySettings(); this.readRetryableCodes = diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/spi/v1/HeaderInterceptor.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/spi/v1/HeaderInterceptor.java index e3bc848dc1..01aa28d8d9 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/spi/v1/HeaderInterceptor.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/spi/v1/HeaderInterceptor.java @@ -56,7 +56,6 @@ import java.util.HashMap; import java.util.Map; import java.util.concurrent.ExecutionException; -import java.util.function.Supplier; import java.util.logging.Level; import java.util.logging.Logger; import java.util.regex.Matcher; @@ -99,12 +98,8 @@ class HeaderInterceptor implements ClientInterceptor { private static final Level LEVEL = Level.INFO; private final SpannerRpcMetrics spannerRpcMetrics; - private final Supplier directPathEnabledSupplier; - - HeaderInterceptor( - SpannerRpcMetrics spannerRpcMetrics, Supplier directPathEnabledSupplier) { + HeaderInterceptor(SpannerRpcMetrics spannerRpcMetrics) { this.spannerRpcMetrics = spannerRpcMetrics; - this.directPathEnabledSupplier = directPathEnabledSupplier; } @Override @@ -293,7 +288,7 @@ private Map getBuiltInMetricAttributes(String key, DatabaseName BuiltInMetricsConstant.INSTANCE_ID_KEY.getKey(), databaseName.getInstance()); attributes.put( BuiltInMetricsConstant.DIRECT_PATH_ENABLED_KEY.getKey(), - String.valueOf(this.directPathEnabledSupplier.get())); + String.valueOf(GapicSpannerRpc.DIRECTPATH_CHANNEL_CREATED)); return attributes; }); } diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/spi/v1/SpannerInterceptorProvider.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/spi/v1/SpannerInterceptorProvider.java index c3c05b8af1..ec7a4e54a0 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/spi/v1/SpannerInterceptorProvider.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/spi/v1/SpannerInterceptorProvider.java @@ -56,14 +56,14 @@ public static SpannerInterceptorProvider createDefault(OpenTelemetry openTelemet })); } + @ObsoleteApi("DirectPathEnabledSupplier is not used") public static SpannerInterceptorProvider createDefault( OpenTelemetry openTelemetry, Supplier directPathEnabledSupplier) { List defaultInterceptorList = new ArrayList<>(); defaultInterceptorList.add(new SpannerErrorInterceptor()); defaultInterceptorList.add( new LoggingInterceptor(Logger.getLogger(GapicSpannerRpc.class.getName()), Level.FINER)); - defaultInterceptorList.add( - new HeaderInterceptor(new SpannerRpcMetrics(openTelemetry), directPathEnabledSupplier)); + defaultInterceptorList.add(new HeaderInterceptor(new SpannerRpcMetrics(openTelemetry))); return new SpannerInterceptorProvider(ImmutableList.copyOf(defaultInterceptorList)); } From f38569865de7465ae9a37b844a9dd983571d3688 Mon Sep 17 00:00:00 2001 From: cloud-java-bot <122572305+cloud-java-bot@users.noreply.github.com> Date: Tue, 3 Jun 2025 11:47:42 -0400 Subject: [PATCH 07/11] chore: Update generation configuration at Tue Jun 3 02:32:00 UTC 2025 (#3895) * chore: Update generation configuration at Tue May 27 02:31:02 UTC 2025 * chore: Update generation configuration at Wed May 28 02:31:42 UTC 2025 * chore: generate libraries at Wed May 28 02:32:12 UTC 2025 * chore: Update generation configuration at Thu May 29 02:31:33 UTC 2025 * chore: Update generation configuration at Sat May 31 02:30:30 UTC 2025 * chore: Update generation configuration at Sun Jun 1 02:43:44 UTC 2025 * chore: Update generation configuration at Tue Jun 3 02:32:00 UTC 2025 * chore: generate libraries at Tue Jun 3 02:32:30 UTC 2025 --- generation_config.yaml | 2 +- .../admin/instance/v1/package-info.java | 2 +- .../v1/stub/HttpJsonInstanceAdminStub.java | 75 + .../reflect-config.json | 216 + .../google/spanner/v1/ChangeStreamProto.java | 292 + .../google/spanner/v1/ChangeStreamRecord.java | 21325 ++++++++++++++++ .../v1/ChangeStreamRecordOrBuilder.java | 228 + .../google/spanner/v1/change_stream.proto | 451 + 8 files changed, 22589 insertions(+), 2 deletions(-) create mode 100644 proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/ChangeStreamProto.java create mode 100644 proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/ChangeStreamRecord.java create mode 100644 proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/ChangeStreamRecordOrBuilder.java create mode 100644 proto-google-cloud-spanner-v1/src/main/proto/google/spanner/v1/change_stream.proto diff --git a/generation_config.yaml b/generation_config.yaml index 6651ac99fa..9fab2b12e9 100644 --- a/generation_config.yaml +++ b/generation_config.yaml @@ -1,5 +1,5 @@ gapic_generator_version: 2.58.0 -googleapis_commitish: bbeb0530ac9d8a61d8156f0d4e111909fc2827aa +googleapis_commitish: 5e49af896d45b0a0aa06de04354db58c05c79aca libraries_bom_version: 26.61.0 libraries: - api_shortname: spanner diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/instance/v1/package-info.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/instance/v1/package-info.java index e0c10822cb..c085e0a6e6 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/instance/v1/package-info.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/instance/v1/package-info.java @@ -15,7 +15,7 @@ */ /** - * A client to Cloud Spanner Instance Admin API + * A client to Cloud Spanner API * *

The interfaces provided are listed below, along with usage samples. * diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/instance/v1/stub/HttpJsonInstanceAdminStub.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/instance/v1/stub/HttpJsonInstanceAdminStub.java index 55a10bc243..5af29072b5 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/instance/v1/stub/HttpJsonInstanceAdminStub.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/instance/v1/stub/HttpJsonInstanceAdminStub.java @@ -1053,6 +1053,26 @@ protected HttpJsonInstanceAdminStub( HttpRule.newBuilder() .setPost("/v1/{name=projects/*/instances/*/operations/*}:cancel") .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/v1/{name=projects/*/instances/*/backups/*/operations/*}:cancel") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/v1/{name=projects/*/instances/*/instancePartitions/*/operations/*}:cancel") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/v1/{name=projects/*/instanceConfigs/*/operations/*}:cancel") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/v1/{name=projects/*/instanceConfigs/*/ssdCaches/*/operations/*}:cancel") + .build()) .build()) .put( "google.longrunning.Operations.DeleteOperation", @@ -1062,6 +1082,25 @@ protected HttpJsonInstanceAdminStub( HttpRule.newBuilder() .setDelete("/v1/{name=projects/*/instances/*/operations/*}") .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete( + "/v1/{name=projects/*/instances/*/backups/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete( + "/v1/{name=projects/*/instances/*/instancePartitions/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete("/v1/{name=projects/*/instanceConfigs/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete( + "/v1/{name=projects/*/instanceConfigs/*/ssdCaches/*/operations/*}") + .build()) .build()) .put( "google.longrunning.Operations.GetOperation", @@ -1071,6 +1110,24 @@ protected HttpJsonInstanceAdminStub( HttpRule.newBuilder() .setGet("/v1/{name=projects/*/instances/*/operations/*}") .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet("/v1/{name=projects/*/instances/*/backups/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1/{name=projects/*/instances/*/instancePartitions/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet("/v1/{name=projects/*/instanceConfigs/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1/{name=projects/*/instanceConfigs/*/ssdCaches/*/operations/*}") + .build()) .build()) .put( "google.longrunning.Operations.ListOperations", @@ -1080,6 +1137,24 @@ protected HttpJsonInstanceAdminStub( HttpRule.newBuilder() .setGet("/v1/{name=projects/*/instances/*/operations}") .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet("/v1/{name=projects/*/instances/*/backups/*/operations}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1/{name=projects/*/instances/*/instancePartitions/*/operations}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet("/v1/{name=projects/*/instanceConfigs/*/operations}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1/{name=projects/*/instanceConfigs/*/ssdCaches/*/operations}") + .build()) .build()) .build()); diff --git a/google-cloud-spanner/src/main/resources/META-INF/native-image/com.google.cloud.spanner.v1/reflect-config.json b/google-cloud-spanner/src/main/resources/META-INF/native-image/com.google.cloud.spanner.v1/reflect-config.json index 20a9391994..90fb979315 100644 --- a/google-cloud-spanner/src/main/resources/META-INF/native-image/com.google.cloud.spanner.v1/reflect-config.json +++ b/google-cloud-spanner/src/main/resources/META-INF/native-image/com.google.cloud.spanner.v1/reflect-config.json @@ -1403,6 +1403,222 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.spanner.v1.ChangeStreamRecord", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.v1.ChangeStreamRecord$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.v1.ChangeStreamRecord$DataChangeRecord", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.v1.ChangeStreamRecord$DataChangeRecord$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.v1.ChangeStreamRecord$DataChangeRecord$ColumnMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.v1.ChangeStreamRecord$DataChangeRecord$ColumnMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.v1.ChangeStreamRecord$DataChangeRecord$Mod", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.v1.ChangeStreamRecord$DataChangeRecord$Mod$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.v1.ChangeStreamRecord$DataChangeRecord$ModType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.v1.ChangeStreamRecord$DataChangeRecord$ModValue", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.v1.ChangeStreamRecord$DataChangeRecord$ModValue$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.v1.ChangeStreamRecord$DataChangeRecord$ValueCaptureType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.v1.ChangeStreamRecord$HeartbeatRecord", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.v1.ChangeStreamRecord$HeartbeatRecord$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.v1.ChangeStreamRecord$PartitionEndRecord", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.v1.ChangeStreamRecord$PartitionEndRecord$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.v1.ChangeStreamRecord$PartitionEventRecord", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.v1.ChangeStreamRecord$PartitionEventRecord$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.v1.ChangeStreamRecord$PartitionEventRecord$MoveInEvent", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.v1.ChangeStreamRecord$PartitionEventRecord$MoveInEvent$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.v1.ChangeStreamRecord$PartitionEventRecord$MoveOutEvent", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.v1.ChangeStreamRecord$PartitionEventRecord$MoveOutEvent$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.v1.ChangeStreamRecord$PartitionStartRecord", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.v1.ChangeStreamRecord$PartitionStartRecord$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.spanner.v1.CommitRequest", "queryAllDeclaredConstructors": true, diff --git a/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/ChangeStreamProto.java b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/ChangeStreamProto.java new file mode 100644 index 0000000000..773b0f4b97 --- /dev/null +++ b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/ChangeStreamProto.java @@ -0,0 +1,292 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/spanner/v1/change_stream.proto + +// Protobuf Java Version: 3.25.5 +package com.google.spanner.v1; + +public final class ChangeStreamProto { + private ChangeStreamProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_spanner_v1_ChangeStreamRecord_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_spanner_v1_ChangeStreamRecord_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_spanner_v1_ChangeStreamRecord_DataChangeRecord_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_spanner_v1_ChangeStreamRecord_DataChangeRecord_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_spanner_v1_ChangeStreamRecord_DataChangeRecord_ColumnMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_spanner_v1_ChangeStreamRecord_DataChangeRecord_ColumnMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_spanner_v1_ChangeStreamRecord_DataChangeRecord_ModValue_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_spanner_v1_ChangeStreamRecord_DataChangeRecord_ModValue_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_spanner_v1_ChangeStreamRecord_DataChangeRecord_Mod_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_spanner_v1_ChangeStreamRecord_DataChangeRecord_Mod_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_spanner_v1_ChangeStreamRecord_HeartbeatRecord_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_spanner_v1_ChangeStreamRecord_HeartbeatRecord_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_spanner_v1_ChangeStreamRecord_PartitionStartRecord_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_spanner_v1_ChangeStreamRecord_PartitionStartRecord_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_spanner_v1_ChangeStreamRecord_PartitionEndRecord_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_spanner_v1_ChangeStreamRecord_PartitionEndRecord_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_spanner_v1_ChangeStreamRecord_PartitionEventRecord_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_spanner_v1_ChangeStreamRecord_PartitionEventRecord_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_spanner_v1_ChangeStreamRecord_PartitionEventRecord_MoveInEvent_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_spanner_v1_ChangeStreamRecord_PartitionEventRecord_MoveInEvent_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_spanner_v1_ChangeStreamRecord_PartitionEventRecord_MoveOutEvent_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_spanner_v1_ChangeStreamRecord_PartitionEventRecord_MoveOutEvent_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n%google/spanner/v1/change_stream.proto\022" + + "\021google.spanner.v1\032\034google/protobuf/stru" + + "ct.proto\032\037google/protobuf/timestamp.prot" + + "o\032\034google/spanner/v1/type.proto\"\226\024\n\022Chan" + + "geStreamRecord\022T\n\022data_change_record\030\001 \001" + + "(\01326.google.spanner.v1.ChangeStreamRecor" + + "d.DataChangeRecordH\000\022Q\n\020heartbeat_record" + + "\030\002 \001(\01325.google.spanner.v1.ChangeStreamR" + + "ecord.HeartbeatRecordH\000\022\\\n\026partition_sta" + + "rt_record\030\003 \001(\0132:.google.spanner.v1.Chan" + + "geStreamRecord.PartitionStartRecordH\000\022X\n" + + "\024partition_end_record\030\004 \001(\01328.google.spa" + + "nner.v1.ChangeStreamRecord.PartitionEndR" + + "ecordH\000\022\\\n\026partition_event_record\030\005 \001(\0132" + + ":.google.spanner.v1.ChangeStreamRecord.P" + + "artitionEventRecordH\000\032\322\n\n\020DataChangeReco" + + "rd\0224\n\020commit_timestamp\030\001 \001(\0132\032.google.pr" + + "otobuf.Timestamp\022\027\n\017record_sequence\030\002 \001(" + + "\t\022\035\n\025server_transaction_id\030\003 \001(\t\0222\n*is_l" + + "ast_record_in_transaction_in_partition\030\004" + + " \001(\010\022\r\n\005table\030\005 \001(\t\022^\n\017column_metadata\030\006" + + " \003(\0132E.google.spanner.v1.ChangeStreamRec" + + "ord.DataChangeRecord.ColumnMetadata\022H\n\004m" + + "ods\030\007 \003(\0132:.google.spanner.v1.ChangeStre" + + "amRecord.DataChangeRecord.Mod\022P\n\010mod_typ" + + "e\030\010 \001(\0162>.google.spanner.v1.ChangeStream" + + "Record.DataChangeRecord.ModType\022c\n\022value" + + "_capture_type\030\t \001(\0162G.google.spanner.v1." + + "ChangeStreamRecord.DataChangeRecord.Valu" + + "eCaptureType\022(\n number_of_records_in_tra" + + "nsaction\030\n \001(\005\022+\n#number_of_partitions_i" + + "n_transaction\030\013 \001(\005\022\027\n\017transaction_tag\030\014" + + " \001(\t\022\035\n\025is_system_transaction\030\r \001(\010\032w\n\016C" + + "olumnMetadata\022\014\n\004name\030\001 \001(\t\022%\n\004type\030\002 \001(" + + "\0132\027.google.spanner.v1.Type\022\026\n\016is_primary" + + "_key\030\003 \001(\010\022\030\n\020ordinal_position\030\004 \001(\003\032P\n\010" + + "ModValue\022\035\n\025column_metadata_index\030\001 \001(\005\022" + + "%\n\005value\030\002 \001(\0132\026.google.protobuf.Value\032\376" + + "\001\n\003Mod\022M\n\004keys\030\001 \003(\0132?.google.spanner.v1" + + ".ChangeStreamRecord.DataChangeRecord.Mod" + + "Value\022S\n\nold_values\030\002 \003(\0132?.google.spann" + + "er.v1.ChangeStreamRecord.DataChangeRecor" + + "d.ModValue\022S\n\nnew_values\030\003 \003(\0132?.google." + + "spanner.v1.ChangeStreamRecord.DataChange" + + "Record.ModValue\"G\n\007ModType\022\030\n\024MOD_TYPE_U" + + "NSPECIFIED\020\000\022\n\n\006INSERT\020\n\022\n\n\006UPDATE\020\024\022\n\n\006" + + "DELETE\020\036\"\207\001\n\020ValueCaptureType\022\"\n\036VALUE_C" + + "APTURE_TYPE_UNSPECIFIED\020\000\022\026\n\022OLD_AND_NEW" + + "_VALUES\020\n\022\016\n\nNEW_VALUES\020\024\022\013\n\007NEW_ROW\020\036\022\032" + + "\n\026NEW_ROW_AND_OLD_VALUES\020(\032@\n\017HeartbeatR" + + "ecord\022-\n\ttimestamp\030\001 \001(\0132\032.google.protob" + + "uf.Timestamp\032~\n\024PartitionStartRecord\0223\n\017" + + "start_timestamp\030\001 \001(\0132\032.google.protobuf." + + "Timestamp\022\027\n\017record_sequence\030\002 \001(\t\022\030\n\020pa" + + "rtition_tokens\030\003 \003(\t\032y\n\022PartitionEndReco" + + "rd\0221\n\rend_timestamp\030\001 \001(\0132\032.google.proto" + + "buf.Timestamp\022\027\n\017record_sequence\030\002 \001(\t\022\027" + + "\n\017partition_token\030\003 \001(\t\032\244\003\n\024PartitionEve" + + "ntRecord\0224\n\020commit_timestamp\030\001 \001(\0132\032.goo" + + "gle.protobuf.Timestamp\022\027\n\017record_sequenc" + + "e\030\002 \001(\t\022\027\n\017partition_token\030\003 \001(\t\022^\n\016move" + + "_in_events\030\004 \003(\0132F.google.spanner.v1.Cha" + + "ngeStreamRecord.PartitionEventRecord.Mov" + + "eInEvent\022`\n\017move_out_events\030\005 \003(\0132G.goog" + + "le.spanner.v1.ChangeStreamRecord.Partiti" + + "onEventRecord.MoveOutEvent\032-\n\013MoveInEven" + + "t\022\036\n\026source_partition_token\030\001 \001(\t\0323\n\014Mov" + + "eOutEvent\022#\n\033destination_partition_token" + + "\030\001 \001(\tB\010\n\006recordB\264\001\n\025com.google.spanner." + + "v1B\021ChangeStreamProtoP\001Z5cloud.google.co" + + "m/go/spanner/apiv1/spannerpb;spannerpb\252\002" + + "\027Google.Cloud.Spanner.V1\312\002\027Google\\Cloud\\" + + "Spanner\\V1\352\002\032Google::Cloud::Spanner::V1b" + + "\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.protobuf.StructProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + com.google.spanner.v1.TypeProto.getDescriptor(), + }); + internal_static_google_spanner_v1_ChangeStreamRecord_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_spanner_v1_ChangeStreamRecord_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_spanner_v1_ChangeStreamRecord_descriptor, + new java.lang.String[] { + "DataChangeRecord", + "HeartbeatRecord", + "PartitionStartRecord", + "PartitionEndRecord", + "PartitionEventRecord", + "Record", + }); + internal_static_google_spanner_v1_ChangeStreamRecord_DataChangeRecord_descriptor = + internal_static_google_spanner_v1_ChangeStreamRecord_descriptor.getNestedTypes().get(0); + internal_static_google_spanner_v1_ChangeStreamRecord_DataChangeRecord_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_spanner_v1_ChangeStreamRecord_DataChangeRecord_descriptor, + new java.lang.String[] { + "CommitTimestamp", + "RecordSequence", + "ServerTransactionId", + "IsLastRecordInTransactionInPartition", + "Table", + "ColumnMetadata", + "Mods", + "ModType", + "ValueCaptureType", + "NumberOfRecordsInTransaction", + "NumberOfPartitionsInTransaction", + "TransactionTag", + "IsSystemTransaction", + }); + internal_static_google_spanner_v1_ChangeStreamRecord_DataChangeRecord_ColumnMetadata_descriptor = + internal_static_google_spanner_v1_ChangeStreamRecord_DataChangeRecord_descriptor + .getNestedTypes() + .get(0); + internal_static_google_spanner_v1_ChangeStreamRecord_DataChangeRecord_ColumnMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_spanner_v1_ChangeStreamRecord_DataChangeRecord_ColumnMetadata_descriptor, + new java.lang.String[] { + "Name", "Type", "IsPrimaryKey", "OrdinalPosition", + }); + internal_static_google_spanner_v1_ChangeStreamRecord_DataChangeRecord_ModValue_descriptor = + internal_static_google_spanner_v1_ChangeStreamRecord_DataChangeRecord_descriptor + .getNestedTypes() + .get(1); + internal_static_google_spanner_v1_ChangeStreamRecord_DataChangeRecord_ModValue_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_spanner_v1_ChangeStreamRecord_DataChangeRecord_ModValue_descriptor, + new java.lang.String[] { + "ColumnMetadataIndex", "Value", + }); + internal_static_google_spanner_v1_ChangeStreamRecord_DataChangeRecord_Mod_descriptor = + internal_static_google_spanner_v1_ChangeStreamRecord_DataChangeRecord_descriptor + .getNestedTypes() + .get(2); + internal_static_google_spanner_v1_ChangeStreamRecord_DataChangeRecord_Mod_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_spanner_v1_ChangeStreamRecord_DataChangeRecord_Mod_descriptor, + new java.lang.String[] { + "Keys", "OldValues", "NewValues", + }); + internal_static_google_spanner_v1_ChangeStreamRecord_HeartbeatRecord_descriptor = + internal_static_google_spanner_v1_ChangeStreamRecord_descriptor.getNestedTypes().get(1); + internal_static_google_spanner_v1_ChangeStreamRecord_HeartbeatRecord_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_spanner_v1_ChangeStreamRecord_HeartbeatRecord_descriptor, + new java.lang.String[] { + "Timestamp", + }); + internal_static_google_spanner_v1_ChangeStreamRecord_PartitionStartRecord_descriptor = + internal_static_google_spanner_v1_ChangeStreamRecord_descriptor.getNestedTypes().get(2); + internal_static_google_spanner_v1_ChangeStreamRecord_PartitionStartRecord_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_spanner_v1_ChangeStreamRecord_PartitionStartRecord_descriptor, + new java.lang.String[] { + "StartTimestamp", "RecordSequence", "PartitionTokens", + }); + internal_static_google_spanner_v1_ChangeStreamRecord_PartitionEndRecord_descriptor = + internal_static_google_spanner_v1_ChangeStreamRecord_descriptor.getNestedTypes().get(3); + internal_static_google_spanner_v1_ChangeStreamRecord_PartitionEndRecord_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_spanner_v1_ChangeStreamRecord_PartitionEndRecord_descriptor, + new java.lang.String[] { + "EndTimestamp", "RecordSequence", "PartitionToken", + }); + internal_static_google_spanner_v1_ChangeStreamRecord_PartitionEventRecord_descriptor = + internal_static_google_spanner_v1_ChangeStreamRecord_descriptor.getNestedTypes().get(4); + internal_static_google_spanner_v1_ChangeStreamRecord_PartitionEventRecord_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_spanner_v1_ChangeStreamRecord_PartitionEventRecord_descriptor, + new java.lang.String[] { + "CommitTimestamp", + "RecordSequence", + "PartitionToken", + "MoveInEvents", + "MoveOutEvents", + }); + internal_static_google_spanner_v1_ChangeStreamRecord_PartitionEventRecord_MoveInEvent_descriptor = + internal_static_google_spanner_v1_ChangeStreamRecord_PartitionEventRecord_descriptor + .getNestedTypes() + .get(0); + internal_static_google_spanner_v1_ChangeStreamRecord_PartitionEventRecord_MoveInEvent_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_spanner_v1_ChangeStreamRecord_PartitionEventRecord_MoveInEvent_descriptor, + new java.lang.String[] { + "SourcePartitionToken", + }); + internal_static_google_spanner_v1_ChangeStreamRecord_PartitionEventRecord_MoveOutEvent_descriptor = + internal_static_google_spanner_v1_ChangeStreamRecord_PartitionEventRecord_descriptor + .getNestedTypes() + .get(1); + internal_static_google_spanner_v1_ChangeStreamRecord_PartitionEventRecord_MoveOutEvent_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_spanner_v1_ChangeStreamRecord_PartitionEventRecord_MoveOutEvent_descriptor, + new java.lang.String[] { + "DestinationPartitionToken", + }); + com.google.protobuf.StructProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.spanner.v1.TypeProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/ChangeStreamRecord.java b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/ChangeStreamRecord.java new file mode 100644 index 0000000000..eaab3001b8 --- /dev/null +++ b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/ChangeStreamRecord.java @@ -0,0 +1,21325 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/spanner/v1/change_stream.proto + +// Protobuf Java Version: 3.25.5 +package com.google.spanner.v1; + +/** + * + * + *

+ * Spanner Change Streams enable customers to capture and stream out changes to
+ * their Spanner databases in real-time. A change stream
+ * can be created with option partition_mode='IMMUTABLE_KEY_RANGE' or
+ * partition_mode='MUTABLE_KEY_RANGE'.
+ *
+ * This message is only used in Change Streams created with the option
+ * partition_mode='MUTABLE_KEY_RANGE'. Spanner automatically creates a special
+ * Table-Valued Function (TVF) along with each Change Streams. The function
+ * provides access to the change stream's records. The function is named
+ * READ_<change_stream_name> (where <change_stream_name> is the
+ * name of the change stream), and it returns a table with only one column
+ * called ChangeRecord.
+ * 
+ * + * Protobuf type {@code google.spanner.v1.ChangeStreamRecord} + */ +public final class ChangeStreamRecord extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.spanner.v1.ChangeStreamRecord) + ChangeStreamRecordOrBuilder { + private static final long serialVersionUID = 0L; + + // Use ChangeStreamRecord.newBuilder() to construct. + private ChangeStreamRecord(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ChangeStreamRecord() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ChangeStreamRecord(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.v1.ChangeStreamProto + .internal_static_google_spanner_v1_ChangeStreamRecord_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.v1.ChangeStreamProto + .internal_static_google_spanner_v1_ChangeStreamRecord_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.v1.ChangeStreamRecord.class, + com.google.spanner.v1.ChangeStreamRecord.Builder.class); + } + + public interface DataChangeRecordOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.spanner.v1.ChangeStreamRecord.DataChangeRecord) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Indicates the timestamp in which the change was committed.
+     * DataChangeRecord.commit_timestamps,
+     * PartitionStartRecord.start_timestamps,
+     * PartitionEventRecord.commit_timestamps, and
+     * PartitionEndRecord.end_timestamps can have the same value in the same
+     * partition.
+     * 
+ * + * .google.protobuf.Timestamp commit_timestamp = 1; + * + * @return Whether the commitTimestamp field is set. + */ + boolean hasCommitTimestamp(); + + /** + * + * + *
+     * Indicates the timestamp in which the change was committed.
+     * DataChangeRecord.commit_timestamps,
+     * PartitionStartRecord.start_timestamps,
+     * PartitionEventRecord.commit_timestamps, and
+     * PartitionEndRecord.end_timestamps can have the same value in the same
+     * partition.
+     * 
+ * + * .google.protobuf.Timestamp commit_timestamp = 1; + * + * @return The commitTimestamp. + */ + com.google.protobuf.Timestamp getCommitTimestamp(); + + /** + * + * + *
+     * Indicates the timestamp in which the change was committed.
+     * DataChangeRecord.commit_timestamps,
+     * PartitionStartRecord.start_timestamps,
+     * PartitionEventRecord.commit_timestamps, and
+     * PartitionEndRecord.end_timestamps can have the same value in the same
+     * partition.
+     * 
+ * + * .google.protobuf.Timestamp commit_timestamp = 1; + */ + com.google.protobuf.TimestampOrBuilder getCommitTimestampOrBuilder(); + + /** + * + * + *
+     * Record sequence numbers are unique and monotonically increasing (but not
+     * necessarily contiguous) for a specific timestamp across record
+     * types in the same partition. To guarantee ordered processing, the reader
+     * should process records (of potentially different types) in
+     * record_sequence order for a specific timestamp in the same partition.
+     *
+     * The record sequence number ordering across partitions is only meaningful
+     * in the context of a specific transaction. Record sequence numbers are
+     * unique across partitions for a specific transaction. Sort the
+     * DataChangeRecords for the same
+     * [server_transaction_id][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.server_transaction_id]
+     * by
+     * [record_sequence][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.record_sequence]
+     * to reconstruct the ordering of the changes within the transaction.
+     * 
+ * + * string record_sequence = 2; + * + * @return The recordSequence. + */ + java.lang.String getRecordSequence(); + + /** + * + * + *
+     * Record sequence numbers are unique and monotonically increasing (but not
+     * necessarily contiguous) for a specific timestamp across record
+     * types in the same partition. To guarantee ordered processing, the reader
+     * should process records (of potentially different types) in
+     * record_sequence order for a specific timestamp in the same partition.
+     *
+     * The record sequence number ordering across partitions is only meaningful
+     * in the context of a specific transaction. Record sequence numbers are
+     * unique across partitions for a specific transaction. Sort the
+     * DataChangeRecords for the same
+     * [server_transaction_id][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.server_transaction_id]
+     * by
+     * [record_sequence][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.record_sequence]
+     * to reconstruct the ordering of the changes within the transaction.
+     * 
+ * + * string record_sequence = 2; + * + * @return The bytes for recordSequence. + */ + com.google.protobuf.ByteString getRecordSequenceBytes(); + + /** + * + * + *
+     * Provides a globally unique string that represents the transaction in
+     * which the change was committed. Multiple transactions can have the same
+     * commit timestamp, but each transaction has a unique
+     * server_transaction_id.
+     * 
+ * + * string server_transaction_id = 3; + * + * @return The serverTransactionId. + */ + java.lang.String getServerTransactionId(); + + /** + * + * + *
+     * Provides a globally unique string that represents the transaction in
+     * which the change was committed. Multiple transactions can have the same
+     * commit timestamp, but each transaction has a unique
+     * server_transaction_id.
+     * 
+ * + * string server_transaction_id = 3; + * + * @return The bytes for serverTransactionId. + */ + com.google.protobuf.ByteString getServerTransactionIdBytes(); + + /** + * + * + *
+     * Indicates whether this is the last record for a transaction in the
+     *  current partition. Clients can use this field to determine when all
+     *  records for a transaction in the current partition have been received.
+     * 
+ * + * bool is_last_record_in_transaction_in_partition = 4; + * + * @return The isLastRecordInTransactionInPartition. + */ + boolean getIsLastRecordInTransactionInPartition(); + + /** + * + * + *
+     * Name of the table affected by the change.
+     * 
+ * + * string table = 5; + * + * @return The table. + */ + java.lang.String getTable(); + + /** + * + * + *
+     * Name of the table affected by the change.
+     * 
+ * + * string table = 5; + * + * @return The bytes for table. + */ + com.google.protobuf.ByteString getTableBytes(); + + /** + * + * + *
+     * Provides metadata describing the columns associated with the
+     * [mods][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.mods] listed
+     * below.
+     * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata column_metadata = 6; + * + */ + java.util.List + getColumnMetadataList(); + + /** + * + * + *
+     * Provides metadata describing the columns associated with the
+     * [mods][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.mods] listed
+     * below.
+     * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata column_metadata = 6; + * + */ + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata getColumnMetadata( + int index); + + /** + * + * + *
+     * Provides metadata describing the columns associated with the
+     * [mods][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.mods] listed
+     * below.
+     * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata column_metadata = 6; + * + */ + int getColumnMetadataCount(); + + /** + * + * + *
+     * Provides metadata describing the columns associated with the
+     * [mods][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.mods] listed
+     * below.
+     * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata column_metadata = 6; + * + */ + java.util.List< + ? extends + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadataOrBuilder> + getColumnMetadataOrBuilderList(); + + /** + * + * + *
+     * Provides metadata describing the columns associated with the
+     * [mods][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.mods] listed
+     * below.
+     * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata column_metadata = 6; + * + */ + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadataOrBuilder + getColumnMetadataOrBuilder(int index); + + /** + * + * + *
+     * Describes the changes that were made.
+     * 
+ * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod mods = 7; + */ + java.util.List getModsList(); + + /** + * + * + *
+     * Describes the changes that were made.
+     * 
+ * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod mods = 7; + */ + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod getMods(int index); + + /** + * + * + *
+     * Describes the changes that were made.
+     * 
+ * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod mods = 7; + */ + int getModsCount(); + + /** + * + * + *
+     * Describes the changes that were made.
+     * 
+ * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod mods = 7; + */ + java.util.List + getModsOrBuilderList(); + + /** + * + * + *
+     * Describes the changes that were made.
+     * 
+ * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod mods = 7; + */ + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModOrBuilder getModsOrBuilder( + int index); + + /** + * + * + *
+     * Describes the type of change.
+     * 
+ * + * .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType mod_type = 8; + * + * @return The enum numeric value on the wire for modType. + */ + int getModTypeValue(); + + /** + * + * + *
+     * Describes the type of change.
+     * 
+ * + * .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType mod_type = 8; + * + * @return The modType. + */ + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType getModType(); + + /** + * + * + *
+     * Describes the value capture type that was specified in the change stream
+     * configuration when this change was captured.
+     * 
+ * + * + * .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType value_capture_type = 9; + * + * + * @return The enum numeric value on the wire for valueCaptureType. + */ + int getValueCaptureTypeValue(); + + /** + * + * + *
+     * Describes the value capture type that was specified in the change stream
+     * configuration when this change was captured.
+     * 
+ * + * + * .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType value_capture_type = 9; + * + * + * @return The valueCaptureType. + */ + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType + getValueCaptureType(); + + /** + * + * + *
+     * Indicates the number of data change records that are part of this
+     * transaction across all change stream partitions. This value can be used
+     * to assemble all the records associated with a particular transaction.
+     * 
+ * + * int32 number_of_records_in_transaction = 10; + * + * @return The numberOfRecordsInTransaction. + */ + int getNumberOfRecordsInTransaction(); + + /** + * + * + *
+     * Indicates the number of partitions that return data change records for
+     * this transaction. This value can be helpful in assembling all records
+     * associated with a particular transaction.
+     * 
+ * + * int32 number_of_partitions_in_transaction = 11; + * + * @return The numberOfPartitionsInTransaction. + */ + int getNumberOfPartitionsInTransaction(); + + /** + * + * + *
+     * Indicates the transaction tag associated with this transaction.
+     * 
+ * + * string transaction_tag = 12; + * + * @return The transactionTag. + */ + java.lang.String getTransactionTag(); + + /** + * + * + *
+     * Indicates the transaction tag associated with this transaction.
+     * 
+ * + * string transaction_tag = 12; + * + * @return The bytes for transactionTag. + */ + com.google.protobuf.ByteString getTransactionTagBytes(); + + /** + * + * + *
+     * Indicates whether the transaction is a system transaction. System
+     * transactions include those issued by time-to-live (TTL), column backfill,
+     * etc.
+     * 
+ * + * bool is_system_transaction = 13; + * + * @return The isSystemTransaction. + */ + boolean getIsSystemTransaction(); + } + + /** + * + * + *
+   * A data change record contains a set of changes to a table with the same
+   * modification type (insert, update, or delete) committed at the same commit
+   * timestamp in one change stream partition for the same transaction. Multiple
+   * data change records can be returned for the same transaction across
+   * multiple change stream partitions.
+   * 
+ * + * Protobuf type {@code google.spanner.v1.ChangeStreamRecord.DataChangeRecord} + */ + public static final class DataChangeRecord extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.spanner.v1.ChangeStreamRecord.DataChangeRecord) + DataChangeRecordOrBuilder { + private static final long serialVersionUID = 0L; + + // Use DataChangeRecord.newBuilder() to construct. + private DataChangeRecord(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DataChangeRecord() { + recordSequence_ = ""; + serverTransactionId_ = ""; + table_ = ""; + columnMetadata_ = java.util.Collections.emptyList(); + mods_ = java.util.Collections.emptyList(); + modType_ = 0; + valueCaptureType_ = 0; + transactionTag_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DataChangeRecord(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.v1.ChangeStreamProto + .internal_static_google_spanner_v1_ChangeStreamRecord_DataChangeRecord_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.v1.ChangeStreamProto + .internal_static_google_spanner_v1_ChangeStreamRecord_DataChangeRecord_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.class, + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Builder.class); + } + + /** + * + * + *
+     * Mod type describes the type of change Spanner applied to the data. For
+     * example, if the client submits an INSERT_OR_UPDATE request, Spanner will
+     * perform an insert if there is no existing row and return ModType INSERT.
+     * Alternatively, if there is an existing row, Spanner will perform an
+     * update and return ModType UPDATE.
+     * 
+ * + * Protobuf enum {@code google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType} + */ + public enum ModType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+       * Not specified.
+       * 
+ * + * MOD_TYPE_UNSPECIFIED = 0; + */ + MOD_TYPE_UNSPECIFIED(0), + /** + * + * + *
+       * Indicates data was inserted.
+       * 
+ * + * INSERT = 10; + */ + INSERT(10), + /** + * + * + *
+       * Indicates existing data was updated.
+       * 
+ * + * UPDATE = 20; + */ + UPDATE(20), + /** + * + * + *
+       * Indicates existing data was deleted.
+       * 
+ * + * DELETE = 30; + */ + DELETE(30), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+       * Not specified.
+       * 
+ * + * MOD_TYPE_UNSPECIFIED = 0; + */ + public static final int MOD_TYPE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+       * Indicates data was inserted.
+       * 
+ * + * INSERT = 10; + */ + public static final int INSERT_VALUE = 10; + + /** + * + * + *
+       * Indicates existing data was updated.
+       * 
+ * + * UPDATE = 20; + */ + public static final int UPDATE_VALUE = 20; + + /** + * + * + *
+       * Indicates existing data was deleted.
+       * 
+ * + * DELETE = 30; + */ + public static final int DELETE_VALUE = 30; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ModType valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static ModType forNumber(int value) { + switch (value) { + case 0: + return MOD_TYPE_UNSPECIFIED; + case 10: + return INSERT; + case 20: + return UPDATE; + case 30: + return DELETE; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public ModType findValueByNumber(int number) { + return ModType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final ModType[] VALUES = values(); + + public static ModType valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private ModType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType) + } + + /** + * + * + *
+     * Value capture type describes which values are recorded in the data
+     * change record.
+     * 
+ * + * Protobuf enum {@code google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType} + */ + public enum ValueCaptureType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+       * Not specified.
+       * 
+ * + * VALUE_CAPTURE_TYPE_UNSPECIFIED = 0; + */ + VALUE_CAPTURE_TYPE_UNSPECIFIED(0), + /** + * + * + *
+       * Records both old and new values of the modified watched columns.
+       * 
+ * + * OLD_AND_NEW_VALUES = 10; + */ + OLD_AND_NEW_VALUES(10), + /** + * + * + *
+       * Records only new values of the modified watched columns.
+       * 
+ * + * NEW_VALUES = 20; + */ + NEW_VALUES(20), + /** + * + * + *
+       * Records new values of all watched columns, including modified and
+       * unmodified columns.
+       * 
+ * + * NEW_ROW = 30; + */ + NEW_ROW(30), + /** + * + * + *
+       * Records the new values of all watched columns, including modified and
+       * unmodified columns. Also records the old values of the modified
+       * columns.
+       * 
+ * + * NEW_ROW_AND_OLD_VALUES = 40; + */ + NEW_ROW_AND_OLD_VALUES(40), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+       * Not specified.
+       * 
+ * + * VALUE_CAPTURE_TYPE_UNSPECIFIED = 0; + */ + public static final int VALUE_CAPTURE_TYPE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+       * Records both old and new values of the modified watched columns.
+       * 
+ * + * OLD_AND_NEW_VALUES = 10; + */ + public static final int OLD_AND_NEW_VALUES_VALUE = 10; + + /** + * + * + *
+       * Records only new values of the modified watched columns.
+       * 
+ * + * NEW_VALUES = 20; + */ + public static final int NEW_VALUES_VALUE = 20; + + /** + * + * + *
+       * Records new values of all watched columns, including modified and
+       * unmodified columns.
+       * 
+ * + * NEW_ROW = 30; + */ + public static final int NEW_ROW_VALUE = 30; + + /** + * + * + *
+       * Records the new values of all watched columns, including modified and
+       * unmodified columns. Also records the old values of the modified
+       * columns.
+       * 
+ * + * NEW_ROW_AND_OLD_VALUES = 40; + */ + public static final int NEW_ROW_AND_OLD_VALUES_VALUE = 40; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ValueCaptureType valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static ValueCaptureType forNumber(int value) { + switch (value) { + case 0: + return VALUE_CAPTURE_TYPE_UNSPECIFIED; + case 10: + return OLD_AND_NEW_VALUES; + case 20: + return NEW_VALUES; + case 30: + return NEW_ROW; + case 40: + return NEW_ROW_AND_OLD_VALUES; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public ValueCaptureType findValueByNumber(int number) { + return ValueCaptureType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.getDescriptor() + .getEnumTypes() + .get(1); + } + + private static final ValueCaptureType[] VALUES = values(); + + public static ValueCaptureType valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private ValueCaptureType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType) + } + + public interface ColumnMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * Name of the column.
+       * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+       * Name of the column.
+       * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+       * Type of the column.
+       * 
+ * + * .google.spanner.v1.Type type = 2; + * + * @return Whether the type field is set. + */ + boolean hasType(); + + /** + * + * + *
+       * Type of the column.
+       * 
+ * + * .google.spanner.v1.Type type = 2; + * + * @return The type. + */ + com.google.spanner.v1.Type getType(); + + /** + * + * + *
+       * Type of the column.
+       * 
+ * + * .google.spanner.v1.Type type = 2; + */ + com.google.spanner.v1.TypeOrBuilder getTypeOrBuilder(); + + /** + * + * + *
+       * Indicates whether the column is a primary key column.
+       * 
+ * + * bool is_primary_key = 3; + * + * @return The isPrimaryKey. + */ + boolean getIsPrimaryKey(); + + /** + * + * + *
+       * Ordinal position of the column based on the original table definition
+       * in the schema starting with a value of 1.
+       * 
+ * + * int64 ordinal_position = 4; + * + * @return The ordinalPosition. + */ + long getOrdinalPosition(); + } + + /** + * + * + *
+     * Metadata for a column.
+     * 
+ * + * Protobuf type {@code google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata} + */ + public static final class ColumnMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata) + ColumnMetadataOrBuilder { + private static final long serialVersionUID = 0L; + + // Use ColumnMetadata.newBuilder() to construct. + private ColumnMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ColumnMetadata() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ColumnMetadata(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.v1.ChangeStreamProto + .internal_static_google_spanner_v1_ChangeStreamRecord_DataChangeRecord_ColumnMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.v1.ChangeStreamProto + .internal_static_google_spanner_v1_ChangeStreamRecord_DataChangeRecord_ColumnMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata.class, + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata.Builder + .class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+       * Name of the column.
+       * 
+ * + * string name = 1; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + 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(); + name_ = s; + return s; + } + } + + /** + * + * + *
+       * Name of the column.
+       * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TYPE_FIELD_NUMBER = 2; + private com.google.spanner.v1.Type type_; + + /** + * + * + *
+       * Type of the column.
+       * 
+ * + * .google.spanner.v1.Type type = 2; + * + * @return Whether the type field is set. + */ + @java.lang.Override + public boolean hasType() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+       * Type of the column.
+       * 
+ * + * .google.spanner.v1.Type type = 2; + * + * @return The type. + */ + @java.lang.Override + public com.google.spanner.v1.Type getType() { + return type_ == null ? com.google.spanner.v1.Type.getDefaultInstance() : type_; + } + + /** + * + * + *
+       * Type of the column.
+       * 
+ * + * .google.spanner.v1.Type type = 2; + */ + @java.lang.Override + public com.google.spanner.v1.TypeOrBuilder getTypeOrBuilder() { + return type_ == null ? com.google.spanner.v1.Type.getDefaultInstance() : type_; + } + + public static final int IS_PRIMARY_KEY_FIELD_NUMBER = 3; + private boolean isPrimaryKey_ = false; + + /** + * + * + *
+       * Indicates whether the column is a primary key column.
+       * 
+ * + * bool is_primary_key = 3; + * + * @return The isPrimaryKey. + */ + @java.lang.Override + public boolean getIsPrimaryKey() { + return isPrimaryKey_; + } + + public static final int ORDINAL_POSITION_FIELD_NUMBER = 4; + private long ordinalPosition_ = 0L; + + /** + * + * + *
+       * Ordinal position of the column based on the original table definition
+       * in the schema starting with a value of 1.
+       * 
+ * + * int64 ordinal_position = 4; + * + * @return The ordinalPosition. + */ + @java.lang.Override + public long getOrdinalPosition() { + return ordinalPosition_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getType()); + } + if (isPrimaryKey_ != false) { + output.writeBool(3, isPrimaryKey_); + } + if (ordinalPosition_ != 0L) { + output.writeInt64(4, ordinalPosition_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getType()); + } + if (isPrimaryKey_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, isPrimaryKey_); + } + if (ordinalPosition_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(4, ordinalPosition_); + } + 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 com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata)) { + return super.equals(obj); + } + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata other = + (com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata) obj; + + if (!getName().equals(other.getName())) return false; + if (hasType() != other.hasType()) return false; + if (hasType()) { + if (!getType().equals(other.getType())) return false; + } + if (getIsPrimaryKey() != other.getIsPrimaryKey()) return false; + if (getOrdinalPosition() != other.getOrdinalPosition()) 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) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (hasType()) { + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + getType().hashCode(); + } + hash = (37 * hash) + IS_PRIMARY_KEY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getIsPrimaryKey()); + hash = (37 * hash) + ORDINAL_POSITION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getOrdinalPosition()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata + parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata + parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata 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.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+       * Metadata for a column.
+       * 
+ * + * Protobuf type {@code google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata) + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.v1.ChangeStreamProto + .internal_static_google_spanner_v1_ChangeStreamRecord_DataChangeRecord_ColumnMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.v1.ChangeStreamProto + .internal_static_google_spanner_v1_ChangeStreamRecord_DataChangeRecord_ColumnMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata.class, + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata.Builder + .class); + } + + // Construct using + // com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getTypeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + type_ = null; + if (typeBuilder_ != null) { + typeBuilder_.dispose(); + typeBuilder_ = null; + } + isPrimaryKey_ = false; + ordinalPosition_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.spanner.v1.ChangeStreamProto + .internal_static_google_spanner_v1_ChangeStreamRecord_DataChangeRecord_ColumnMetadata_descriptor; + } + + @java.lang.Override + public com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata + getDefaultInstanceForType() { + return com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata build() { + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata + buildPartial() { + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata result = + new com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.type_ = typeBuilder_ == null ? type_ : typeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.isPrimaryKey_ = isPrimaryKey_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.ordinalPosition_ = ordinalPosition_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata) { + return mergeFrom( + (com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata other) { + if (other + == com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata + .getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasType()) { + mergeType(other.getType()); + } + if (other.getIsPrimaryKey() != false) { + setIsPrimaryKey(other.getIsPrimaryKey()); + } + if (other.getOrdinalPosition() != 0L) { + setOrdinalPosition(other.getOrdinalPosition()); + } + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getTypeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + isPrimaryKey_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: + { + ordinalPosition_ = input.readInt64(); + bitField0_ |= 0x00000008; + break; + } // case 32 + 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 java.lang.Object name_ = ""; + + /** + * + * + *
+         * Name of the column.
+         * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+         * Name of the column.
+         * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+         * Name of the column.
+         * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+         * Name of the column.
+         * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+         * Name of the column.
+         * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.spanner.v1.Type type_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.v1.Type, + com.google.spanner.v1.Type.Builder, + com.google.spanner.v1.TypeOrBuilder> + typeBuilder_; + + /** + * + * + *
+         * Type of the column.
+         * 
+ * + * .google.spanner.v1.Type type = 2; + * + * @return Whether the type field is set. + */ + public boolean hasType() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+         * Type of the column.
+         * 
+ * + * .google.spanner.v1.Type type = 2; + * + * @return The type. + */ + public com.google.spanner.v1.Type getType() { + if (typeBuilder_ == null) { + return type_ == null ? com.google.spanner.v1.Type.getDefaultInstance() : type_; + } else { + return typeBuilder_.getMessage(); + } + } + + /** + * + * + *
+         * Type of the column.
+         * 
+ * + * .google.spanner.v1.Type type = 2; + */ + public Builder setType(com.google.spanner.v1.Type value) { + if (typeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + type_ = value; + } else { + typeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+         * Type of the column.
+         * 
+ * + * .google.spanner.v1.Type type = 2; + */ + public Builder setType(com.google.spanner.v1.Type.Builder builderForValue) { + if (typeBuilder_ == null) { + type_ = builderForValue.build(); + } else { + typeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+         * Type of the column.
+         * 
+ * + * .google.spanner.v1.Type type = 2; + */ + public Builder mergeType(com.google.spanner.v1.Type value) { + if (typeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && type_ != null + && type_ != com.google.spanner.v1.Type.getDefaultInstance()) { + getTypeBuilder().mergeFrom(value); + } else { + type_ = value; + } + } else { + typeBuilder_.mergeFrom(value); + } + if (type_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+         * Type of the column.
+         * 
+ * + * .google.spanner.v1.Type type = 2; + */ + public Builder clearType() { + bitField0_ = (bitField0_ & ~0x00000002); + type_ = null; + if (typeBuilder_ != null) { + typeBuilder_.dispose(); + typeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+         * Type of the column.
+         * 
+ * + * .google.spanner.v1.Type type = 2; + */ + public com.google.spanner.v1.Type.Builder getTypeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getTypeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+         * Type of the column.
+         * 
+ * + * .google.spanner.v1.Type type = 2; + */ + public com.google.spanner.v1.TypeOrBuilder getTypeOrBuilder() { + if (typeBuilder_ != null) { + return typeBuilder_.getMessageOrBuilder(); + } else { + return type_ == null ? com.google.spanner.v1.Type.getDefaultInstance() : type_; + } + } + + /** + * + * + *
+         * Type of the column.
+         * 
+ * + * .google.spanner.v1.Type type = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.v1.Type, + com.google.spanner.v1.Type.Builder, + com.google.spanner.v1.TypeOrBuilder> + getTypeFieldBuilder() { + if (typeBuilder_ == null) { + typeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.v1.Type, + com.google.spanner.v1.Type.Builder, + com.google.spanner.v1.TypeOrBuilder>( + getType(), getParentForChildren(), isClean()); + type_ = null; + } + return typeBuilder_; + } + + private boolean isPrimaryKey_; + + /** + * + * + *
+         * Indicates whether the column is a primary key column.
+         * 
+ * + * bool is_primary_key = 3; + * + * @return The isPrimaryKey. + */ + @java.lang.Override + public boolean getIsPrimaryKey() { + return isPrimaryKey_; + } + + /** + * + * + *
+         * Indicates whether the column is a primary key column.
+         * 
+ * + * bool is_primary_key = 3; + * + * @param value The isPrimaryKey to set. + * @return This builder for chaining. + */ + public Builder setIsPrimaryKey(boolean value) { + + isPrimaryKey_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+         * Indicates whether the column is a primary key column.
+         * 
+ * + * bool is_primary_key = 3; + * + * @return This builder for chaining. + */ + public Builder clearIsPrimaryKey() { + bitField0_ = (bitField0_ & ~0x00000004); + isPrimaryKey_ = false; + onChanged(); + return this; + } + + private long ordinalPosition_; + + /** + * + * + *
+         * Ordinal position of the column based on the original table definition
+         * in the schema starting with a value of 1.
+         * 
+ * + * int64 ordinal_position = 4; + * + * @return The ordinalPosition. + */ + @java.lang.Override + public long getOrdinalPosition() { + return ordinalPosition_; + } + + /** + * + * + *
+         * Ordinal position of the column based on the original table definition
+         * in the schema starting with a value of 1.
+         * 
+ * + * int64 ordinal_position = 4; + * + * @param value The ordinalPosition to set. + * @return This builder for chaining. + */ + public Builder setOrdinalPosition(long value) { + + ordinalPosition_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+         * Ordinal position of the column based on the original table definition
+         * in the schema starting with a value of 1.
+         * 
+ * + * int64 ordinal_position = 4; + * + * @return This builder for chaining. + */ + public Builder clearOrdinalPosition() { + bitField0_ = (bitField0_ & ~0x00000008); + ordinalPosition_ = 0L; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata) + } + + // @@protoc_insertion_point(class_scope:google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata) + private static final com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata(); + } + + public static com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ColumnMetadata 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 com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface ModValueOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * Index within the repeated
+       * [column_metadata][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.column_metadata]
+       * field, to obtain the column metadata for the column that was modified.
+       * 
+ * + * int32 column_metadata_index = 1; + * + * @return The columnMetadataIndex. + */ + int getColumnMetadataIndex(); + + /** + * + * + *
+       * The value of the column.
+       * 
+ * + * .google.protobuf.Value value = 2; + * + * @return Whether the value field is set. + */ + boolean hasValue(); + + /** + * + * + *
+       * The value of the column.
+       * 
+ * + * .google.protobuf.Value value = 2; + * + * @return The value. + */ + com.google.protobuf.Value getValue(); + + /** + * + * + *
+       * The value of the column.
+       * 
+ * + * .google.protobuf.Value value = 2; + */ + com.google.protobuf.ValueOrBuilder getValueOrBuilder(); + } + + /** + * + * + *
+     * Returns the value and associated metadata for a particular field of the
+     * [Mod][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod].
+     * 
+ * + * Protobuf type {@code google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue} + */ + public static final class ModValue extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue) + ModValueOrBuilder { + private static final long serialVersionUID = 0L; + + // Use ModValue.newBuilder() to construct. + private ModValue(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ModValue() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ModValue(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.v1.ChangeStreamProto + .internal_static_google_spanner_v1_ChangeStreamRecord_DataChangeRecord_ModValue_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.v1.ChangeStreamProto + .internal_static_google_spanner_v1_ChangeStreamRecord_DataChangeRecord_ModValue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.class, + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.Builder.class); + } + + private int bitField0_; + public static final int COLUMN_METADATA_INDEX_FIELD_NUMBER = 1; + private int columnMetadataIndex_ = 0; + + /** + * + * + *
+       * Index within the repeated
+       * [column_metadata][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.column_metadata]
+       * field, to obtain the column metadata for the column that was modified.
+       * 
+ * + * int32 column_metadata_index = 1; + * + * @return The columnMetadataIndex. + */ + @java.lang.Override + public int getColumnMetadataIndex() { + return columnMetadataIndex_; + } + + public static final int VALUE_FIELD_NUMBER = 2; + private com.google.protobuf.Value value_; + + /** + * + * + *
+       * The value of the column.
+       * 
+ * + * .google.protobuf.Value value = 2; + * + * @return Whether the value field is set. + */ + @java.lang.Override + public boolean hasValue() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+       * The value of the column.
+       * 
+ * + * .google.protobuf.Value value = 2; + * + * @return The value. + */ + @java.lang.Override + public com.google.protobuf.Value getValue() { + return value_ == null ? com.google.protobuf.Value.getDefaultInstance() : value_; + } + + /** + * + * + *
+       * The value of the column.
+       * 
+ * + * .google.protobuf.Value value = 2; + */ + @java.lang.Override + public com.google.protobuf.ValueOrBuilder getValueOrBuilder() { + return value_ == null ? com.google.protobuf.Value.getDefaultInstance() : value_; + } + + 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 (columnMetadataIndex_ != 0) { + output.writeInt32(1, columnMetadataIndex_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getValue()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (columnMetadataIndex_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, columnMetadataIndex_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getValue()); + } + 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 com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue)) { + return super.equals(obj); + } + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue other = + (com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue) obj; + + if (getColumnMetadataIndex() != other.getColumnMetadataIndex()) return false; + if (hasValue() != other.hasValue()) return false; + if (hasValue()) { + if (!getValue().equals(other.getValue())) 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) + COLUMN_METADATA_INDEX_FIELD_NUMBER; + hash = (53 * hash) + getColumnMetadataIndex(); + if (hasValue()) { + hash = (37 * hash) + VALUE_FIELD_NUMBER; + hash = (53 * hash) + getValue().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue + parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue 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.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+       * Returns the value and associated metadata for a particular field of the
+       * [Mod][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod].
+       * 
+ * + * Protobuf type {@code google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue) + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValueOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.v1.ChangeStreamProto + .internal_static_google_spanner_v1_ChangeStreamRecord_DataChangeRecord_ModValue_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.v1.ChangeStreamProto + .internal_static_google_spanner_v1_ChangeStreamRecord_DataChangeRecord_ModValue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.class, + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.Builder.class); + } + + // Construct using + // com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getValueFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + columnMetadataIndex_ = 0; + value_ = null; + if (valueBuilder_ != null) { + valueBuilder_.dispose(); + valueBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.spanner.v1.ChangeStreamProto + .internal_static_google_spanner_v1_ChangeStreamRecord_DataChangeRecord_ModValue_descriptor; + } + + @java.lang.Override + public com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue + getDefaultInstanceForType() { + return com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue build() { + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue buildPartial() { + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue result = + new com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.columnMetadataIndex_ = columnMetadataIndex_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.value_ = valueBuilder_ == null ? value_ : valueBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue) { + return mergeFrom( + (com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue other) { + if (other + == com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue + .getDefaultInstance()) return this; + if (other.getColumnMetadataIndex() != 0) { + setColumnMetadataIndex(other.getColumnMetadataIndex()); + } + if (other.hasValue()) { + mergeValue(other.getValue()); + } + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + columnMetadataIndex_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + input.readMessage(getValueFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + 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 int columnMetadataIndex_; + + /** + * + * + *
+         * Index within the repeated
+         * [column_metadata][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.column_metadata]
+         * field, to obtain the column metadata for the column that was modified.
+         * 
+ * + * int32 column_metadata_index = 1; + * + * @return The columnMetadataIndex. + */ + @java.lang.Override + public int getColumnMetadataIndex() { + return columnMetadataIndex_; + } + + /** + * + * + *
+         * Index within the repeated
+         * [column_metadata][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.column_metadata]
+         * field, to obtain the column metadata for the column that was modified.
+         * 
+ * + * int32 column_metadata_index = 1; + * + * @param value The columnMetadataIndex to set. + * @return This builder for chaining. + */ + public Builder setColumnMetadataIndex(int value) { + + columnMetadataIndex_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+         * Index within the repeated
+         * [column_metadata][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.column_metadata]
+         * field, to obtain the column metadata for the column that was modified.
+         * 
+ * + * int32 column_metadata_index = 1; + * + * @return This builder for chaining. + */ + public Builder clearColumnMetadataIndex() { + bitField0_ = (bitField0_ & ~0x00000001); + columnMetadataIndex_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Value value_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder> + valueBuilder_; + + /** + * + * + *
+         * The value of the column.
+         * 
+ * + * .google.protobuf.Value value = 2; + * + * @return Whether the value field is set. + */ + public boolean hasValue() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+         * The value of the column.
+         * 
+ * + * .google.protobuf.Value value = 2; + * + * @return The value. + */ + public com.google.protobuf.Value getValue() { + if (valueBuilder_ == null) { + return value_ == null ? com.google.protobuf.Value.getDefaultInstance() : value_; + } else { + return valueBuilder_.getMessage(); + } + } + + /** + * + * + *
+         * The value of the column.
+         * 
+ * + * .google.protobuf.Value value = 2; + */ + public Builder setValue(com.google.protobuf.Value value) { + if (valueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + value_ = value; + } else { + valueBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+         * The value of the column.
+         * 
+ * + * .google.protobuf.Value value = 2; + */ + public Builder setValue(com.google.protobuf.Value.Builder builderForValue) { + if (valueBuilder_ == null) { + value_ = builderForValue.build(); + } else { + valueBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+         * The value of the column.
+         * 
+ * + * .google.protobuf.Value value = 2; + */ + public Builder mergeValue(com.google.protobuf.Value value) { + if (valueBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && value_ != null + && value_ != com.google.protobuf.Value.getDefaultInstance()) { + getValueBuilder().mergeFrom(value); + } else { + value_ = value; + } + } else { + valueBuilder_.mergeFrom(value); + } + if (value_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+         * The value of the column.
+         * 
+ * + * .google.protobuf.Value value = 2; + */ + public Builder clearValue() { + bitField0_ = (bitField0_ & ~0x00000002); + value_ = null; + if (valueBuilder_ != null) { + valueBuilder_.dispose(); + valueBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+         * The value of the column.
+         * 
+ * + * .google.protobuf.Value value = 2; + */ + public com.google.protobuf.Value.Builder getValueBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getValueFieldBuilder().getBuilder(); + } + + /** + * + * + *
+         * The value of the column.
+         * 
+ * + * .google.protobuf.Value value = 2; + */ + public com.google.protobuf.ValueOrBuilder getValueOrBuilder() { + if (valueBuilder_ != null) { + return valueBuilder_.getMessageOrBuilder(); + } else { + return value_ == null ? com.google.protobuf.Value.getDefaultInstance() : value_; + } + } + + /** + * + * + *
+         * The value of the column.
+         * 
+ * + * .google.protobuf.Value value = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder> + getValueFieldBuilder() { + if (valueBuilder_ == null) { + valueBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder>( + getValue(), getParentForChildren(), isClean()); + value_ = null; + } + return valueBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue) + } + + // @@protoc_insertion_point(class_scope:google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue) + private static final com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue(); + } + + public static com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ModValue 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 com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface ModOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * Returns the value of the primary key of the modified row.
+       * 
+ * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue keys = 1; + * + */ + java.util.List + getKeysList(); + + /** + * + * + *
+       * Returns the value of the primary key of the modified row.
+       * 
+ * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue keys = 1; + * + */ + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue getKeys(int index); + + /** + * + * + *
+       * Returns the value of the primary key of the modified row.
+       * 
+ * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue keys = 1; + * + */ + int getKeysCount(); + + /** + * + * + *
+       * Returns the value of the primary key of the modified row.
+       * 
+ * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue keys = 1; + * + */ + java.util.List< + ? extends com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValueOrBuilder> + getKeysOrBuilderList(); + + /** + * + * + *
+       * Returns the value of the primary key of the modified row.
+       * 
+ * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue keys = 1; + * + */ + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValueOrBuilder getKeysOrBuilder( + int index); + + /** + * + * + *
+       * Returns the old values before the change for the modified columns.
+       * Always empty for
+       * [INSERT][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType.INSERT],
+       * or if old values are not being captured specified by
+       * [value_capture_type][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType].
+       * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue old_values = 2; + * + */ + java.util.List + getOldValuesList(); + + /** + * + * + *
+       * Returns the old values before the change for the modified columns.
+       * Always empty for
+       * [INSERT][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType.INSERT],
+       * or if old values are not being captured specified by
+       * [value_capture_type][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType].
+       * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue old_values = 2; + * + */ + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue getOldValues(int index); + + /** + * + * + *
+       * Returns the old values before the change for the modified columns.
+       * Always empty for
+       * [INSERT][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType.INSERT],
+       * or if old values are not being captured specified by
+       * [value_capture_type][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType].
+       * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue old_values = 2; + * + */ + int getOldValuesCount(); + + /** + * + * + *
+       * Returns the old values before the change for the modified columns.
+       * Always empty for
+       * [INSERT][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType.INSERT],
+       * or if old values are not being captured specified by
+       * [value_capture_type][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType].
+       * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue old_values = 2; + * + */ + java.util.List< + ? extends com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValueOrBuilder> + getOldValuesOrBuilderList(); + + /** + * + * + *
+       * Returns the old values before the change for the modified columns.
+       * Always empty for
+       * [INSERT][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType.INSERT],
+       * or if old values are not being captured specified by
+       * [value_capture_type][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType].
+       * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue old_values = 2; + * + */ + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValueOrBuilder + getOldValuesOrBuilder(int index); + + /** + * + * + *
+       * Returns the new values after the change for the modified columns.
+       * Always empty for
+       * [DELETE][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType.DELETE].
+       * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue new_values = 3; + * + */ + java.util.List + getNewValuesList(); + + /** + * + * + *
+       * Returns the new values after the change for the modified columns.
+       * Always empty for
+       * [DELETE][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType.DELETE].
+       * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue new_values = 3; + * + */ + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue getNewValues(int index); + + /** + * + * + *
+       * Returns the new values after the change for the modified columns.
+       * Always empty for
+       * [DELETE][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType.DELETE].
+       * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue new_values = 3; + * + */ + int getNewValuesCount(); + + /** + * + * + *
+       * Returns the new values after the change for the modified columns.
+       * Always empty for
+       * [DELETE][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType.DELETE].
+       * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue new_values = 3; + * + */ + java.util.List< + ? extends com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValueOrBuilder> + getNewValuesOrBuilderList(); + + /** + * + * + *
+       * Returns the new values after the change for the modified columns.
+       * Always empty for
+       * [DELETE][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType.DELETE].
+       * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue new_values = 3; + * + */ + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValueOrBuilder + getNewValuesOrBuilder(int index); + } + + /** + * + * + *
+     * A mod describes all data changes in a watched table row.
+     * 
+ * + * Protobuf type {@code google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod} + */ + public static final class Mod extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod) + ModOrBuilder { + private static final long serialVersionUID = 0L; + + // Use Mod.newBuilder() to construct. + private Mod(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Mod() { + keys_ = java.util.Collections.emptyList(); + oldValues_ = java.util.Collections.emptyList(); + newValues_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Mod(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.v1.ChangeStreamProto + .internal_static_google_spanner_v1_ChangeStreamRecord_DataChangeRecord_Mod_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.v1.ChangeStreamProto + .internal_static_google_spanner_v1_ChangeStreamRecord_DataChangeRecord_Mod_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod.class, + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod.Builder.class); + } + + public static final int KEYS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List + keys_; + + /** + * + * + *
+       * Returns the value of the primary key of the modified row.
+       * 
+ * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue keys = 1; + * + */ + @java.lang.Override + public java.util.List + getKeysList() { + return keys_; + } + + /** + * + * + *
+       * Returns the value of the primary key of the modified row.
+       * 
+ * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue keys = 1; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValueOrBuilder> + getKeysOrBuilderList() { + return keys_; + } + + /** + * + * + *
+       * Returns the value of the primary key of the modified row.
+       * 
+ * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue keys = 1; + * + */ + @java.lang.Override + public int getKeysCount() { + return keys_.size(); + } + + /** + * + * + *
+       * Returns the value of the primary key of the modified row.
+       * 
+ * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue keys = 1; + * + */ + @java.lang.Override + public com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue getKeys(int index) { + return keys_.get(index); + } + + /** + * + * + *
+       * Returns the value of the primary key of the modified row.
+       * 
+ * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue keys = 1; + * + */ + @java.lang.Override + public com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValueOrBuilder + getKeysOrBuilder(int index) { + return keys_.get(index); + } + + public static final int OLD_VALUES_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List + oldValues_; + + /** + * + * + *
+       * Returns the old values before the change for the modified columns.
+       * Always empty for
+       * [INSERT][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType.INSERT],
+       * or if old values are not being captured specified by
+       * [value_capture_type][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType].
+       * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue old_values = 2; + * + */ + @java.lang.Override + public java.util.List + getOldValuesList() { + return oldValues_; + } + + /** + * + * + *
+       * Returns the old values before the change for the modified columns.
+       * Always empty for
+       * [INSERT][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType.INSERT],
+       * or if old values are not being captured specified by
+       * [value_capture_type][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType].
+       * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue old_values = 2; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValueOrBuilder> + getOldValuesOrBuilderList() { + return oldValues_; + } + + /** + * + * + *
+       * Returns the old values before the change for the modified columns.
+       * Always empty for
+       * [INSERT][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType.INSERT],
+       * or if old values are not being captured specified by
+       * [value_capture_type][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType].
+       * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue old_values = 2; + * + */ + @java.lang.Override + public int getOldValuesCount() { + return oldValues_.size(); + } + + /** + * + * + *
+       * Returns the old values before the change for the modified columns.
+       * Always empty for
+       * [INSERT][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType.INSERT],
+       * or if old values are not being captured specified by
+       * [value_capture_type][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType].
+       * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue old_values = 2; + * + */ + @java.lang.Override + public com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue getOldValues( + int index) { + return oldValues_.get(index); + } + + /** + * + * + *
+       * Returns the old values before the change for the modified columns.
+       * Always empty for
+       * [INSERT][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType.INSERT],
+       * or if old values are not being captured specified by
+       * [value_capture_type][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType].
+       * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue old_values = 2; + * + */ + @java.lang.Override + public com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValueOrBuilder + getOldValuesOrBuilder(int index) { + return oldValues_.get(index); + } + + public static final int NEW_VALUES_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private java.util.List + newValues_; + + /** + * + * + *
+       * Returns the new values after the change for the modified columns.
+       * Always empty for
+       * [DELETE][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType.DELETE].
+       * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue new_values = 3; + * + */ + @java.lang.Override + public java.util.List + getNewValuesList() { + return newValues_; + } + + /** + * + * + *
+       * Returns the new values after the change for the modified columns.
+       * Always empty for
+       * [DELETE][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType.DELETE].
+       * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue new_values = 3; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValueOrBuilder> + getNewValuesOrBuilderList() { + return newValues_; + } + + /** + * + * + *
+       * Returns the new values after the change for the modified columns.
+       * Always empty for
+       * [DELETE][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType.DELETE].
+       * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue new_values = 3; + * + */ + @java.lang.Override + public int getNewValuesCount() { + return newValues_.size(); + } + + /** + * + * + *
+       * Returns the new values after the change for the modified columns.
+       * Always empty for
+       * [DELETE][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType.DELETE].
+       * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue new_values = 3; + * + */ + @java.lang.Override + public com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue getNewValues( + int index) { + return newValues_.get(index); + } + + /** + * + * + *
+       * Returns the new values after the change for the modified columns.
+       * Always empty for
+       * [DELETE][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType.DELETE].
+       * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue new_values = 3; + * + */ + @java.lang.Override + public com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValueOrBuilder + getNewValuesOrBuilder(int index) { + return newValues_.get(index); + } + + 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 { + for (int i = 0; i < keys_.size(); i++) { + output.writeMessage(1, keys_.get(i)); + } + for (int i = 0; i < oldValues_.size(); i++) { + output.writeMessage(2, oldValues_.get(i)); + } + for (int i = 0; i < newValues_.size(); i++) { + output.writeMessage(3, newValues_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < keys_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, keys_.get(i)); + } + for (int i = 0; i < oldValues_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, oldValues_.get(i)); + } + for (int i = 0; i < newValues_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, newValues_.get(i)); + } + 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 com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod)) { + return super.equals(obj); + } + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod other = + (com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod) obj; + + if (!getKeysList().equals(other.getKeysList())) return false; + if (!getOldValuesList().equals(other.getOldValuesList())) return false; + if (!getNewValuesList().equals(other.getNewValuesList())) 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(); + if (getKeysCount() > 0) { + hash = (37 * hash) + KEYS_FIELD_NUMBER; + hash = (53 * hash) + getKeysList().hashCode(); + } + if (getOldValuesCount() > 0) { + hash = (37 * hash) + OLD_VALUES_FIELD_NUMBER; + hash = (53 * hash) + getOldValuesList().hashCode(); + } + if (getNewValuesCount() > 0) { + hash = (37 * hash) + NEW_VALUES_FIELD_NUMBER; + hash = (53 * hash) + getNewValuesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod + parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod 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.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+       * A mod describes all data changes in a watched table row.
+       * 
+ * + * Protobuf type {@code google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod) + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.v1.ChangeStreamProto + .internal_static_google_spanner_v1_ChangeStreamRecord_DataChangeRecord_Mod_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.v1.ChangeStreamProto + .internal_static_google_spanner_v1_ChangeStreamRecord_DataChangeRecord_Mod_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod.class, + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod.Builder.class); + } + + // Construct using + // com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (keysBuilder_ == null) { + keys_ = java.util.Collections.emptyList(); + } else { + keys_ = null; + keysBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + if (oldValuesBuilder_ == null) { + oldValues_ = java.util.Collections.emptyList(); + } else { + oldValues_ = null; + oldValuesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + if (newValuesBuilder_ == null) { + newValues_ = java.util.Collections.emptyList(); + } else { + newValues_ = null; + newValuesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.spanner.v1.ChangeStreamProto + .internal_static_google_spanner_v1_ChangeStreamRecord_DataChangeRecord_Mod_descriptor; + } + + @java.lang.Override + public com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod + getDefaultInstanceForType() { + return com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod.getDefaultInstance(); + } + + @java.lang.Override + public com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod build() { + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod buildPartial() { + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod result = + new com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod result) { + if (keysBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + keys_ = java.util.Collections.unmodifiableList(keys_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.keys_ = keys_; + } else { + result.keys_ = keysBuilder_.build(); + } + if (oldValuesBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + oldValues_ = java.util.Collections.unmodifiableList(oldValues_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.oldValues_ = oldValues_; + } else { + result.oldValues_ = oldValuesBuilder_.build(); + } + if (newValuesBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + newValues_ = java.util.Collections.unmodifiableList(newValues_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.newValues_ = newValues_; + } else { + result.newValues_ = newValuesBuilder_.build(); + } + } + + private void buildPartial0( + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod result) { + int from_bitField0_ = bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod) { + return mergeFrom((com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod other) { + if (other + == com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod.getDefaultInstance()) + return this; + if (keysBuilder_ == null) { + if (!other.keys_.isEmpty()) { + if (keys_.isEmpty()) { + keys_ = other.keys_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureKeysIsMutable(); + keys_.addAll(other.keys_); + } + onChanged(); + } + } else { + if (!other.keys_.isEmpty()) { + if (keysBuilder_.isEmpty()) { + keysBuilder_.dispose(); + keysBuilder_ = null; + keys_ = other.keys_; + bitField0_ = (bitField0_ & ~0x00000001); + keysBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getKeysFieldBuilder() + : null; + } else { + keysBuilder_.addAllMessages(other.keys_); + } + } + } + if (oldValuesBuilder_ == null) { + if (!other.oldValues_.isEmpty()) { + if (oldValues_.isEmpty()) { + oldValues_ = other.oldValues_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureOldValuesIsMutable(); + oldValues_.addAll(other.oldValues_); + } + onChanged(); + } + } else { + if (!other.oldValues_.isEmpty()) { + if (oldValuesBuilder_.isEmpty()) { + oldValuesBuilder_.dispose(); + oldValuesBuilder_ = null; + oldValues_ = other.oldValues_; + bitField0_ = (bitField0_ & ~0x00000002); + oldValuesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getOldValuesFieldBuilder() + : null; + } else { + oldValuesBuilder_.addAllMessages(other.oldValues_); + } + } + } + if (newValuesBuilder_ == null) { + if (!other.newValues_.isEmpty()) { + if (newValues_.isEmpty()) { + newValues_ = other.newValues_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureNewValuesIsMutable(); + newValues_.addAll(other.newValues_); + } + onChanged(); + } + } else { + if (!other.newValues_.isEmpty()) { + if (newValuesBuilder_.isEmpty()) { + newValuesBuilder_.dispose(); + newValuesBuilder_ = null; + newValues_ = other.newValues_; + bitField0_ = (bitField0_ & ~0x00000004); + newValuesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getNewValuesFieldBuilder() + : null; + } else { + newValuesBuilder_.addAllMessages(other.newValues_); + } + } + } + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue m = + input.readMessage( + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue + .parser(), + extensionRegistry); + if (keysBuilder_ == null) { + ensureKeysIsMutable(); + keys_.add(m); + } else { + keysBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue m = + input.readMessage( + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue + .parser(), + extensionRegistry); + if (oldValuesBuilder_ == null) { + ensureOldValuesIsMutable(); + oldValues_.add(m); + } else { + oldValuesBuilder_.addMessage(m); + } + break; + } // case 18 + case 26: + { + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue m = + input.readMessage( + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue + .parser(), + extensionRegistry); + if (newValuesBuilder_ == null) { + ensureNewValuesIsMutable(); + newValues_.add(m); + } else { + newValuesBuilder_.addMessage(m); + } + break; + } // case 26 + 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 java.util.List + keys_ = java.util.Collections.emptyList(); + + private void ensureKeysIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + keys_ = + new java.util.ArrayList< + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue>(keys_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue, + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.Builder, + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValueOrBuilder> + keysBuilder_; + + /** + * + * + *
+         * Returns the value of the primary key of the modified row.
+         * 
+ * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue keys = 1; + * + */ + public java.util.List + getKeysList() { + if (keysBuilder_ == null) { + return java.util.Collections.unmodifiableList(keys_); + } else { + return keysBuilder_.getMessageList(); + } + } + + /** + * + * + *
+         * Returns the value of the primary key of the modified row.
+         * 
+ * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue keys = 1; + * + */ + public int getKeysCount() { + if (keysBuilder_ == null) { + return keys_.size(); + } else { + return keysBuilder_.getCount(); + } + } + + /** + * + * + *
+         * Returns the value of the primary key of the modified row.
+         * 
+ * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue keys = 1; + * + */ + public com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue getKeys( + int index) { + if (keysBuilder_ == null) { + return keys_.get(index); + } else { + return keysBuilder_.getMessage(index); + } + } + + /** + * + * + *
+         * Returns the value of the primary key of the modified row.
+         * 
+ * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue keys = 1; + * + */ + public Builder setKeys( + int index, com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue value) { + if (keysBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureKeysIsMutable(); + keys_.set(index, value); + onChanged(); + } else { + keysBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+         * Returns the value of the primary key of the modified row.
+         * 
+ * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue keys = 1; + * + */ + public Builder setKeys( + int index, + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.Builder + builderForValue) { + if (keysBuilder_ == null) { + ensureKeysIsMutable(); + keys_.set(index, builderForValue.build()); + onChanged(); + } else { + keysBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+         * Returns the value of the primary key of the modified row.
+         * 
+ * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue keys = 1; + * + */ + public Builder addKeys( + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue value) { + if (keysBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureKeysIsMutable(); + keys_.add(value); + onChanged(); + } else { + keysBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+         * Returns the value of the primary key of the modified row.
+         * 
+ * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue keys = 1; + * + */ + public Builder addKeys( + int index, com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue value) { + if (keysBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureKeysIsMutable(); + keys_.add(index, value); + onChanged(); + } else { + keysBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+         * Returns the value of the primary key of the modified row.
+         * 
+ * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue keys = 1; + * + */ + public Builder addKeys( + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.Builder + builderForValue) { + if (keysBuilder_ == null) { + ensureKeysIsMutable(); + keys_.add(builderForValue.build()); + onChanged(); + } else { + keysBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+         * Returns the value of the primary key of the modified row.
+         * 
+ * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue keys = 1; + * + */ + public Builder addKeys( + int index, + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.Builder + builderForValue) { + if (keysBuilder_ == null) { + ensureKeysIsMutable(); + keys_.add(index, builderForValue.build()); + onChanged(); + } else { + keysBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+         * Returns the value of the primary key of the modified row.
+         * 
+ * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue keys = 1; + * + */ + public Builder addAllKeys( + java.lang.Iterable< + ? extends com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue> + values) { + if (keysBuilder_ == null) { + ensureKeysIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, keys_); + onChanged(); + } else { + keysBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+         * Returns the value of the primary key of the modified row.
+         * 
+ * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue keys = 1; + * + */ + public Builder clearKeys() { + if (keysBuilder_ == null) { + keys_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + keysBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+         * Returns the value of the primary key of the modified row.
+         * 
+ * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue keys = 1; + * + */ + public Builder removeKeys(int index) { + if (keysBuilder_ == null) { + ensureKeysIsMutable(); + keys_.remove(index); + onChanged(); + } else { + keysBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+         * Returns the value of the primary key of the modified row.
+         * 
+ * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue keys = 1; + * + */ + public com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.Builder + getKeysBuilder(int index) { + return getKeysFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+         * Returns the value of the primary key of the modified row.
+         * 
+ * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue keys = 1; + * + */ + public com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValueOrBuilder + getKeysOrBuilder(int index) { + if (keysBuilder_ == null) { + return keys_.get(index); + } else { + return keysBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+         * Returns the value of the primary key of the modified row.
+         * 
+ * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue keys = 1; + * + */ + public java.util.List< + ? extends + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValueOrBuilder> + getKeysOrBuilderList() { + if (keysBuilder_ != null) { + return keysBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(keys_); + } + } + + /** + * + * + *
+         * Returns the value of the primary key of the modified row.
+         * 
+ * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue keys = 1; + * + */ + public com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.Builder + addKeysBuilder() { + return getKeysFieldBuilder() + .addBuilder( + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue + .getDefaultInstance()); + } + + /** + * + * + *
+         * Returns the value of the primary key of the modified row.
+         * 
+ * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue keys = 1; + * + */ + public com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.Builder + addKeysBuilder(int index) { + return getKeysFieldBuilder() + .addBuilder( + index, + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue + .getDefaultInstance()); + } + + /** + * + * + *
+         * Returns the value of the primary key of the modified row.
+         * 
+ * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue keys = 1; + * + */ + public java.util.List< + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.Builder> + getKeysBuilderList() { + return getKeysFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue, + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.Builder, + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValueOrBuilder> + getKeysFieldBuilder() { + if (keysBuilder_ == null) { + keysBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue, + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.Builder, + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValueOrBuilder>( + keys_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + keys_ = null; + } + return keysBuilder_; + } + + private java.util.List + oldValues_ = java.util.Collections.emptyList(); + + private void ensureOldValuesIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + oldValues_ = + new java.util.ArrayList< + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue>(oldValues_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue, + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.Builder, + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValueOrBuilder> + oldValuesBuilder_; + + /** + * + * + *
+         * Returns the old values before the change for the modified columns.
+         * Always empty for
+         * [INSERT][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType.INSERT],
+         * or if old values are not being captured specified by
+         * [value_capture_type][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType].
+         * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue old_values = 2; + * + */ + public java.util.List + getOldValuesList() { + if (oldValuesBuilder_ == null) { + return java.util.Collections.unmodifiableList(oldValues_); + } else { + return oldValuesBuilder_.getMessageList(); + } + } + + /** + * + * + *
+         * Returns the old values before the change for the modified columns.
+         * Always empty for
+         * [INSERT][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType.INSERT],
+         * or if old values are not being captured specified by
+         * [value_capture_type][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType].
+         * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue old_values = 2; + * + */ + public int getOldValuesCount() { + if (oldValuesBuilder_ == null) { + return oldValues_.size(); + } else { + return oldValuesBuilder_.getCount(); + } + } + + /** + * + * + *
+         * Returns the old values before the change for the modified columns.
+         * Always empty for
+         * [INSERT][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType.INSERT],
+         * or if old values are not being captured specified by
+         * [value_capture_type][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType].
+         * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue old_values = 2; + * + */ + public com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue getOldValues( + int index) { + if (oldValuesBuilder_ == null) { + return oldValues_.get(index); + } else { + return oldValuesBuilder_.getMessage(index); + } + } + + /** + * + * + *
+         * Returns the old values before the change for the modified columns.
+         * Always empty for
+         * [INSERT][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType.INSERT],
+         * or if old values are not being captured specified by
+         * [value_capture_type][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType].
+         * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue old_values = 2; + * + */ + public Builder setOldValues( + int index, com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue value) { + if (oldValuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOldValuesIsMutable(); + oldValues_.set(index, value); + onChanged(); + } else { + oldValuesBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+         * Returns the old values before the change for the modified columns.
+         * Always empty for
+         * [INSERT][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType.INSERT],
+         * or if old values are not being captured specified by
+         * [value_capture_type][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType].
+         * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue old_values = 2; + * + */ + public Builder setOldValues( + int index, + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.Builder + builderForValue) { + if (oldValuesBuilder_ == null) { + ensureOldValuesIsMutable(); + oldValues_.set(index, builderForValue.build()); + onChanged(); + } else { + oldValuesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+         * Returns the old values before the change for the modified columns.
+         * Always empty for
+         * [INSERT][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType.INSERT],
+         * or if old values are not being captured specified by
+         * [value_capture_type][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType].
+         * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue old_values = 2; + * + */ + public Builder addOldValues( + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue value) { + if (oldValuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOldValuesIsMutable(); + oldValues_.add(value); + onChanged(); + } else { + oldValuesBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+         * Returns the old values before the change for the modified columns.
+         * Always empty for
+         * [INSERT][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType.INSERT],
+         * or if old values are not being captured specified by
+         * [value_capture_type][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType].
+         * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue old_values = 2; + * + */ + public Builder addOldValues( + int index, com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue value) { + if (oldValuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOldValuesIsMutable(); + oldValues_.add(index, value); + onChanged(); + } else { + oldValuesBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+         * Returns the old values before the change for the modified columns.
+         * Always empty for
+         * [INSERT][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType.INSERT],
+         * or if old values are not being captured specified by
+         * [value_capture_type][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType].
+         * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue old_values = 2; + * + */ + public Builder addOldValues( + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.Builder + builderForValue) { + if (oldValuesBuilder_ == null) { + ensureOldValuesIsMutable(); + oldValues_.add(builderForValue.build()); + onChanged(); + } else { + oldValuesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+         * Returns the old values before the change for the modified columns.
+         * Always empty for
+         * [INSERT][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType.INSERT],
+         * or if old values are not being captured specified by
+         * [value_capture_type][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType].
+         * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue old_values = 2; + * + */ + public Builder addOldValues( + int index, + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.Builder + builderForValue) { + if (oldValuesBuilder_ == null) { + ensureOldValuesIsMutable(); + oldValues_.add(index, builderForValue.build()); + onChanged(); + } else { + oldValuesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+         * Returns the old values before the change for the modified columns.
+         * Always empty for
+         * [INSERT][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType.INSERT],
+         * or if old values are not being captured specified by
+         * [value_capture_type][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType].
+         * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue old_values = 2; + * + */ + public Builder addAllOldValues( + java.lang.Iterable< + ? extends com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue> + values) { + if (oldValuesBuilder_ == null) { + ensureOldValuesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, oldValues_); + onChanged(); + } else { + oldValuesBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+         * Returns the old values before the change for the modified columns.
+         * Always empty for
+         * [INSERT][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType.INSERT],
+         * or if old values are not being captured specified by
+         * [value_capture_type][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType].
+         * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue old_values = 2; + * + */ + public Builder clearOldValues() { + if (oldValuesBuilder_ == null) { + oldValues_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + oldValuesBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+         * Returns the old values before the change for the modified columns.
+         * Always empty for
+         * [INSERT][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType.INSERT],
+         * or if old values are not being captured specified by
+         * [value_capture_type][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType].
+         * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue old_values = 2; + * + */ + public Builder removeOldValues(int index) { + if (oldValuesBuilder_ == null) { + ensureOldValuesIsMutable(); + oldValues_.remove(index); + onChanged(); + } else { + oldValuesBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+         * Returns the old values before the change for the modified columns.
+         * Always empty for
+         * [INSERT][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType.INSERT],
+         * or if old values are not being captured specified by
+         * [value_capture_type][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType].
+         * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue old_values = 2; + * + */ + public com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.Builder + getOldValuesBuilder(int index) { + return getOldValuesFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+         * Returns the old values before the change for the modified columns.
+         * Always empty for
+         * [INSERT][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType.INSERT],
+         * or if old values are not being captured specified by
+         * [value_capture_type][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType].
+         * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue old_values = 2; + * + */ + public com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValueOrBuilder + getOldValuesOrBuilder(int index) { + if (oldValuesBuilder_ == null) { + return oldValues_.get(index); + } else { + return oldValuesBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+         * Returns the old values before the change for the modified columns.
+         * Always empty for
+         * [INSERT][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType.INSERT],
+         * or if old values are not being captured specified by
+         * [value_capture_type][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType].
+         * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue old_values = 2; + * + */ + public java.util.List< + ? extends + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValueOrBuilder> + getOldValuesOrBuilderList() { + if (oldValuesBuilder_ != null) { + return oldValuesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(oldValues_); + } + } + + /** + * + * + *
+         * Returns the old values before the change for the modified columns.
+         * Always empty for
+         * [INSERT][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType.INSERT],
+         * or if old values are not being captured specified by
+         * [value_capture_type][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType].
+         * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue old_values = 2; + * + */ + public com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.Builder + addOldValuesBuilder() { + return getOldValuesFieldBuilder() + .addBuilder( + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue + .getDefaultInstance()); + } + + /** + * + * + *
+         * Returns the old values before the change for the modified columns.
+         * Always empty for
+         * [INSERT][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType.INSERT],
+         * or if old values are not being captured specified by
+         * [value_capture_type][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType].
+         * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue old_values = 2; + * + */ + public com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.Builder + addOldValuesBuilder(int index) { + return getOldValuesFieldBuilder() + .addBuilder( + index, + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue + .getDefaultInstance()); + } + + /** + * + * + *
+         * Returns the old values before the change for the modified columns.
+         * Always empty for
+         * [INSERT][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType.INSERT],
+         * or if old values are not being captured specified by
+         * [value_capture_type][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType].
+         * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue old_values = 2; + * + */ + public java.util.List< + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.Builder> + getOldValuesBuilderList() { + return getOldValuesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue, + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.Builder, + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValueOrBuilder> + getOldValuesFieldBuilder() { + if (oldValuesBuilder_ == null) { + oldValuesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue, + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.Builder, + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValueOrBuilder>( + oldValues_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + oldValues_ = null; + } + return oldValuesBuilder_; + } + + private java.util.List + newValues_ = java.util.Collections.emptyList(); + + private void ensureNewValuesIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + newValues_ = + new java.util.ArrayList< + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue>(newValues_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue, + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.Builder, + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValueOrBuilder> + newValuesBuilder_; + + /** + * + * + *
+         * Returns the new values after the change for the modified columns.
+         * Always empty for
+         * [DELETE][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType.DELETE].
+         * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue new_values = 3; + * + */ + public java.util.List + getNewValuesList() { + if (newValuesBuilder_ == null) { + return java.util.Collections.unmodifiableList(newValues_); + } else { + return newValuesBuilder_.getMessageList(); + } + } + + /** + * + * + *
+         * Returns the new values after the change for the modified columns.
+         * Always empty for
+         * [DELETE][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType.DELETE].
+         * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue new_values = 3; + * + */ + public int getNewValuesCount() { + if (newValuesBuilder_ == null) { + return newValues_.size(); + } else { + return newValuesBuilder_.getCount(); + } + } + + /** + * + * + *
+         * Returns the new values after the change for the modified columns.
+         * Always empty for
+         * [DELETE][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType.DELETE].
+         * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue new_values = 3; + * + */ + public com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue getNewValues( + int index) { + if (newValuesBuilder_ == null) { + return newValues_.get(index); + } else { + return newValuesBuilder_.getMessage(index); + } + } + + /** + * + * + *
+         * Returns the new values after the change for the modified columns.
+         * Always empty for
+         * [DELETE][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType.DELETE].
+         * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue new_values = 3; + * + */ + public Builder setNewValues( + int index, com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue value) { + if (newValuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNewValuesIsMutable(); + newValues_.set(index, value); + onChanged(); + } else { + newValuesBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+         * Returns the new values after the change for the modified columns.
+         * Always empty for
+         * [DELETE][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType.DELETE].
+         * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue new_values = 3; + * + */ + public Builder setNewValues( + int index, + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.Builder + builderForValue) { + if (newValuesBuilder_ == null) { + ensureNewValuesIsMutable(); + newValues_.set(index, builderForValue.build()); + onChanged(); + } else { + newValuesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+         * Returns the new values after the change for the modified columns.
+         * Always empty for
+         * [DELETE][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType.DELETE].
+         * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue new_values = 3; + * + */ + public Builder addNewValues( + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue value) { + if (newValuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNewValuesIsMutable(); + newValues_.add(value); + onChanged(); + } else { + newValuesBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+         * Returns the new values after the change for the modified columns.
+         * Always empty for
+         * [DELETE][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType.DELETE].
+         * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue new_values = 3; + * + */ + public Builder addNewValues( + int index, com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue value) { + if (newValuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNewValuesIsMutable(); + newValues_.add(index, value); + onChanged(); + } else { + newValuesBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+         * Returns the new values after the change for the modified columns.
+         * Always empty for
+         * [DELETE][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType.DELETE].
+         * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue new_values = 3; + * + */ + public Builder addNewValues( + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.Builder + builderForValue) { + if (newValuesBuilder_ == null) { + ensureNewValuesIsMutable(); + newValues_.add(builderForValue.build()); + onChanged(); + } else { + newValuesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+         * Returns the new values after the change for the modified columns.
+         * Always empty for
+         * [DELETE][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType.DELETE].
+         * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue new_values = 3; + * + */ + public Builder addNewValues( + int index, + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.Builder + builderForValue) { + if (newValuesBuilder_ == null) { + ensureNewValuesIsMutable(); + newValues_.add(index, builderForValue.build()); + onChanged(); + } else { + newValuesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+         * Returns the new values after the change for the modified columns.
+         * Always empty for
+         * [DELETE][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType.DELETE].
+         * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue new_values = 3; + * + */ + public Builder addAllNewValues( + java.lang.Iterable< + ? extends com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue> + values) { + if (newValuesBuilder_ == null) { + ensureNewValuesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, newValues_); + onChanged(); + } else { + newValuesBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+         * Returns the new values after the change for the modified columns.
+         * Always empty for
+         * [DELETE][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType.DELETE].
+         * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue new_values = 3; + * + */ + public Builder clearNewValues() { + if (newValuesBuilder_ == null) { + newValues_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + newValuesBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+         * Returns the new values after the change for the modified columns.
+         * Always empty for
+         * [DELETE][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType.DELETE].
+         * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue new_values = 3; + * + */ + public Builder removeNewValues(int index) { + if (newValuesBuilder_ == null) { + ensureNewValuesIsMutable(); + newValues_.remove(index); + onChanged(); + } else { + newValuesBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+         * Returns the new values after the change for the modified columns.
+         * Always empty for
+         * [DELETE][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType.DELETE].
+         * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue new_values = 3; + * + */ + public com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.Builder + getNewValuesBuilder(int index) { + return getNewValuesFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+         * Returns the new values after the change for the modified columns.
+         * Always empty for
+         * [DELETE][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType.DELETE].
+         * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue new_values = 3; + * + */ + public com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValueOrBuilder + getNewValuesOrBuilder(int index) { + if (newValuesBuilder_ == null) { + return newValues_.get(index); + } else { + return newValuesBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+         * Returns the new values after the change for the modified columns.
+         * Always empty for
+         * [DELETE][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType.DELETE].
+         * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue new_values = 3; + * + */ + public java.util.List< + ? extends + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValueOrBuilder> + getNewValuesOrBuilderList() { + if (newValuesBuilder_ != null) { + return newValuesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(newValues_); + } + } + + /** + * + * + *
+         * Returns the new values after the change for the modified columns.
+         * Always empty for
+         * [DELETE][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType.DELETE].
+         * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue new_values = 3; + * + */ + public com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.Builder + addNewValuesBuilder() { + return getNewValuesFieldBuilder() + .addBuilder( + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue + .getDefaultInstance()); + } + + /** + * + * + *
+         * Returns the new values after the change for the modified columns.
+         * Always empty for
+         * [DELETE][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType.DELETE].
+         * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue new_values = 3; + * + */ + public com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.Builder + addNewValuesBuilder(int index) { + return getNewValuesFieldBuilder() + .addBuilder( + index, + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue + .getDefaultInstance()); + } + + /** + * + * + *
+         * Returns the new values after the change for the modified columns.
+         * Always empty for
+         * [DELETE][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType.DELETE].
+         * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue new_values = 3; + * + */ + public java.util.List< + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.Builder> + getNewValuesBuilderList() { + return getNewValuesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue, + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.Builder, + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValueOrBuilder> + getNewValuesFieldBuilder() { + if (newValuesBuilder_ == null) { + newValuesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue, + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.Builder, + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValueOrBuilder>( + newValues_, + ((bitField0_ & 0x00000004) != 0), + getParentForChildren(), + isClean()); + newValues_ = null; + } + return newValuesBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod) + } + + // @@protoc_insertion_point(class_scope:google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod) + private static final com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod(); + } + + public static com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Mod 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 com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int COMMIT_TIMESTAMP_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp commitTimestamp_; + + /** + * + * + *
+     * Indicates the timestamp in which the change was committed.
+     * DataChangeRecord.commit_timestamps,
+     * PartitionStartRecord.start_timestamps,
+     * PartitionEventRecord.commit_timestamps, and
+     * PartitionEndRecord.end_timestamps can have the same value in the same
+     * partition.
+     * 
+ * + * .google.protobuf.Timestamp commit_timestamp = 1; + * + * @return Whether the commitTimestamp field is set. + */ + @java.lang.Override + public boolean hasCommitTimestamp() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Indicates the timestamp in which the change was committed.
+     * DataChangeRecord.commit_timestamps,
+     * PartitionStartRecord.start_timestamps,
+     * PartitionEventRecord.commit_timestamps, and
+     * PartitionEndRecord.end_timestamps can have the same value in the same
+     * partition.
+     * 
+ * + * .google.protobuf.Timestamp commit_timestamp = 1; + * + * @return The commitTimestamp. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCommitTimestamp() { + return commitTimestamp_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : commitTimestamp_; + } + + /** + * + * + *
+     * Indicates the timestamp in which the change was committed.
+     * DataChangeRecord.commit_timestamps,
+     * PartitionStartRecord.start_timestamps,
+     * PartitionEventRecord.commit_timestamps, and
+     * PartitionEndRecord.end_timestamps can have the same value in the same
+     * partition.
+     * 
+ * + * .google.protobuf.Timestamp commit_timestamp = 1; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCommitTimestampOrBuilder() { + return commitTimestamp_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : commitTimestamp_; + } + + public static final int RECORD_SEQUENCE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object recordSequence_ = ""; + + /** + * + * + *
+     * Record sequence numbers are unique and monotonically increasing (but not
+     * necessarily contiguous) for a specific timestamp across record
+     * types in the same partition. To guarantee ordered processing, the reader
+     * should process records (of potentially different types) in
+     * record_sequence order for a specific timestamp in the same partition.
+     *
+     * The record sequence number ordering across partitions is only meaningful
+     * in the context of a specific transaction. Record sequence numbers are
+     * unique across partitions for a specific transaction. Sort the
+     * DataChangeRecords for the same
+     * [server_transaction_id][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.server_transaction_id]
+     * by
+     * [record_sequence][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.record_sequence]
+     * to reconstruct the ordering of the changes within the transaction.
+     * 
+ * + * string record_sequence = 2; + * + * @return The recordSequence. + */ + @java.lang.Override + public java.lang.String getRecordSequence() { + java.lang.Object ref = recordSequence_; + 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(); + recordSequence_ = s; + return s; + } + } + + /** + * + * + *
+     * Record sequence numbers are unique and monotonically increasing (but not
+     * necessarily contiguous) for a specific timestamp across record
+     * types in the same partition. To guarantee ordered processing, the reader
+     * should process records (of potentially different types) in
+     * record_sequence order for a specific timestamp in the same partition.
+     *
+     * The record sequence number ordering across partitions is only meaningful
+     * in the context of a specific transaction. Record sequence numbers are
+     * unique across partitions for a specific transaction. Sort the
+     * DataChangeRecords for the same
+     * [server_transaction_id][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.server_transaction_id]
+     * by
+     * [record_sequence][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.record_sequence]
+     * to reconstruct the ordering of the changes within the transaction.
+     * 
+ * + * string record_sequence = 2; + * + * @return The bytes for recordSequence. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRecordSequenceBytes() { + java.lang.Object ref = recordSequence_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + recordSequence_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SERVER_TRANSACTION_ID_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object serverTransactionId_ = ""; + + /** + * + * + *
+     * Provides a globally unique string that represents the transaction in
+     * which the change was committed. Multiple transactions can have the same
+     * commit timestamp, but each transaction has a unique
+     * server_transaction_id.
+     * 
+ * + * string server_transaction_id = 3; + * + * @return The serverTransactionId. + */ + @java.lang.Override + public java.lang.String getServerTransactionId() { + java.lang.Object ref = serverTransactionId_; + 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(); + serverTransactionId_ = s; + return s; + } + } + + /** + * + * + *
+     * Provides a globally unique string that represents the transaction in
+     * which the change was committed. Multiple transactions can have the same
+     * commit timestamp, but each transaction has a unique
+     * server_transaction_id.
+     * 
+ * + * string server_transaction_id = 3; + * + * @return The bytes for serverTransactionId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getServerTransactionIdBytes() { + java.lang.Object ref = serverTransactionId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serverTransactionId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int IS_LAST_RECORD_IN_TRANSACTION_IN_PARTITION_FIELD_NUMBER = 4; + private boolean isLastRecordInTransactionInPartition_ = false; + + /** + * + * + *
+     * Indicates whether this is the last record for a transaction in the
+     *  current partition. Clients can use this field to determine when all
+     *  records for a transaction in the current partition have been received.
+     * 
+ * + * bool is_last_record_in_transaction_in_partition = 4; + * + * @return The isLastRecordInTransactionInPartition. + */ + @java.lang.Override + public boolean getIsLastRecordInTransactionInPartition() { + return isLastRecordInTransactionInPartition_; + } + + public static final int TABLE_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object table_ = ""; + + /** + * + * + *
+     * Name of the table affected by the change.
+     * 
+ * + * string table = 5; + * + * @return The table. + */ + @java.lang.Override + public java.lang.String getTable() { + java.lang.Object ref = table_; + 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(); + table_ = s; + return s; + } + } + + /** + * + * + *
+     * Name of the table affected by the change.
+     * 
+ * + * string table = 5; + * + * @return The bytes for table. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTableBytes() { + java.lang.Object ref = table_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + table_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int COLUMN_METADATA_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private java.util.List + columnMetadata_; + + /** + * + * + *
+     * Provides metadata describing the columns associated with the
+     * [mods][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.mods] listed
+     * below.
+     * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata column_metadata = 6; + * + */ + @java.lang.Override + public java.util.List + getColumnMetadataList() { + return columnMetadata_; + } + + /** + * + * + *
+     * Provides metadata describing the columns associated with the
+     * [mods][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.mods] listed
+     * below.
+     * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata column_metadata = 6; + * + */ + @java.lang.Override + public java.util.List< + ? extends + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadataOrBuilder> + getColumnMetadataOrBuilderList() { + return columnMetadata_; + } + + /** + * + * + *
+     * Provides metadata describing the columns associated with the
+     * [mods][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.mods] listed
+     * below.
+     * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata column_metadata = 6; + * + */ + @java.lang.Override + public int getColumnMetadataCount() { + return columnMetadata_.size(); + } + + /** + * + * + *
+     * Provides metadata describing the columns associated with the
+     * [mods][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.mods] listed
+     * below.
+     * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata column_metadata = 6; + * + */ + @java.lang.Override + public com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata + getColumnMetadata(int index) { + return columnMetadata_.get(index); + } + + /** + * + * + *
+     * Provides metadata describing the columns associated with the
+     * [mods][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.mods] listed
+     * below.
+     * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata column_metadata = 6; + * + */ + @java.lang.Override + public com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadataOrBuilder + getColumnMetadataOrBuilder(int index) { + return columnMetadata_.get(index); + } + + public static final int MODS_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + private java.util.List mods_; + + /** + * + * + *
+     * Describes the changes that were made.
+     * 
+ * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod mods = 7; + */ + @java.lang.Override + public java.util.List + getModsList() { + return mods_; + } + + /** + * + * + *
+     * Describes the changes that were made.
+     * 
+ * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod mods = 7; + */ + @java.lang.Override + public java.util.List< + ? extends com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModOrBuilder> + getModsOrBuilderList() { + return mods_; + } + + /** + * + * + *
+     * Describes the changes that were made.
+     * 
+ * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod mods = 7; + */ + @java.lang.Override + public int getModsCount() { + return mods_.size(); + } + + /** + * + * + *
+     * Describes the changes that were made.
+     * 
+ * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod mods = 7; + */ + @java.lang.Override + public com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod getMods(int index) { + return mods_.get(index); + } + + /** + * + * + *
+     * Describes the changes that were made.
+     * 
+ * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod mods = 7; + */ + @java.lang.Override + public com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModOrBuilder getModsOrBuilder( + int index) { + return mods_.get(index); + } + + public static final int MOD_TYPE_FIELD_NUMBER = 8; + private int modType_ = 0; + + /** + * + * + *
+     * Describes the type of change.
+     * 
+ * + * .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType mod_type = 8; + * + * @return The enum numeric value on the wire for modType. + */ + @java.lang.Override + public int getModTypeValue() { + return modType_; + } + + /** + * + * + *
+     * Describes the type of change.
+     * 
+ * + * .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType mod_type = 8; + * + * @return The modType. + */ + @java.lang.Override + public com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType getModType() { + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType result = + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType.forNumber(modType_); + return result == null + ? com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType.UNRECOGNIZED + : result; + } + + public static final int VALUE_CAPTURE_TYPE_FIELD_NUMBER = 9; + private int valueCaptureType_ = 0; + + /** + * + * + *
+     * Describes the value capture type that was specified in the change stream
+     * configuration when this change was captured.
+     * 
+ * + * + * .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType value_capture_type = 9; + * + * + * @return The enum numeric value on the wire for valueCaptureType. + */ + @java.lang.Override + public int getValueCaptureTypeValue() { + return valueCaptureType_; + } + + /** + * + * + *
+     * Describes the value capture type that was specified in the change stream
+     * configuration when this change was captured.
+     * 
+ * + * + * .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType value_capture_type = 9; + * + * + * @return The valueCaptureType. + */ + @java.lang.Override + public com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType + getValueCaptureType() { + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType result = + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType.forNumber( + valueCaptureType_); + return result == null + ? com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType.UNRECOGNIZED + : result; + } + + public static final int NUMBER_OF_RECORDS_IN_TRANSACTION_FIELD_NUMBER = 10; + private int numberOfRecordsInTransaction_ = 0; + + /** + * + * + *
+     * Indicates the number of data change records that are part of this
+     * transaction across all change stream partitions. This value can be used
+     * to assemble all the records associated with a particular transaction.
+     * 
+ * + * int32 number_of_records_in_transaction = 10; + * + * @return The numberOfRecordsInTransaction. + */ + @java.lang.Override + public int getNumberOfRecordsInTransaction() { + return numberOfRecordsInTransaction_; + } + + public static final int NUMBER_OF_PARTITIONS_IN_TRANSACTION_FIELD_NUMBER = 11; + private int numberOfPartitionsInTransaction_ = 0; + + /** + * + * + *
+     * Indicates the number of partitions that return data change records for
+     * this transaction. This value can be helpful in assembling all records
+     * associated with a particular transaction.
+     * 
+ * + * int32 number_of_partitions_in_transaction = 11; + * + * @return The numberOfPartitionsInTransaction. + */ + @java.lang.Override + public int getNumberOfPartitionsInTransaction() { + return numberOfPartitionsInTransaction_; + } + + public static final int TRANSACTION_TAG_FIELD_NUMBER = 12; + + @SuppressWarnings("serial") + private volatile java.lang.Object transactionTag_ = ""; + + /** + * + * + *
+     * Indicates the transaction tag associated with this transaction.
+     * 
+ * + * string transaction_tag = 12; + * + * @return The transactionTag. + */ + @java.lang.Override + public java.lang.String getTransactionTag() { + java.lang.Object ref = transactionTag_; + 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(); + transactionTag_ = s; + return s; + } + } + + /** + * + * + *
+     * Indicates the transaction tag associated with this transaction.
+     * 
+ * + * string transaction_tag = 12; + * + * @return The bytes for transactionTag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTransactionTagBytes() { + java.lang.Object ref = transactionTag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + transactionTag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int IS_SYSTEM_TRANSACTION_FIELD_NUMBER = 13; + private boolean isSystemTransaction_ = false; + + /** + * + * + *
+     * Indicates whether the transaction is a system transaction. System
+     * transactions include those issued by time-to-live (TTL), column backfill,
+     * etc.
+     * 
+ * + * bool is_system_transaction = 13; + * + * @return The isSystemTransaction. + */ + @java.lang.Override + public boolean getIsSystemTransaction() { + return isSystemTransaction_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getCommitTimestamp()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(recordSequence_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, recordSequence_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(serverTransactionId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, serverTransactionId_); + } + if (isLastRecordInTransactionInPartition_ != false) { + output.writeBool(4, isLastRecordInTransactionInPartition_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(table_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, table_); + } + for (int i = 0; i < columnMetadata_.size(); i++) { + output.writeMessage(6, columnMetadata_.get(i)); + } + for (int i = 0; i < mods_.size(); i++) { + output.writeMessage(7, mods_.get(i)); + } + if (modType_ + != com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType.MOD_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(8, modType_); + } + if (valueCaptureType_ + != com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType + .VALUE_CAPTURE_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(9, valueCaptureType_); + } + if (numberOfRecordsInTransaction_ != 0) { + output.writeInt32(10, numberOfRecordsInTransaction_); + } + if (numberOfPartitionsInTransaction_ != 0) { + output.writeInt32(11, numberOfPartitionsInTransaction_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(transactionTag_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 12, transactionTag_); + } + if (isSystemTransaction_ != false) { + output.writeBool(13, isSystemTransaction_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getCommitTimestamp()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(recordSequence_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, recordSequence_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(serverTransactionId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, serverTransactionId_); + } + if (isLastRecordInTransactionInPartition_ != false) { + size += + com.google.protobuf.CodedOutputStream.computeBoolSize( + 4, isLastRecordInTransactionInPartition_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(table_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, table_); + } + for (int i = 0; i < columnMetadata_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, columnMetadata_.get(i)); + } + for (int i = 0; i < mods_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, mods_.get(i)); + } + if (modType_ + != com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType.MOD_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(8, modType_); + } + if (valueCaptureType_ + != com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType + .VALUE_CAPTURE_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(9, valueCaptureType_); + } + if (numberOfRecordsInTransaction_ != 0) { + size += + com.google.protobuf.CodedOutputStream.computeInt32Size( + 10, numberOfRecordsInTransaction_); + } + if (numberOfPartitionsInTransaction_ != 0) { + size += + com.google.protobuf.CodedOutputStream.computeInt32Size( + 11, numberOfPartitionsInTransaction_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(transactionTag_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(12, transactionTag_); + } + if (isSystemTransaction_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(13, isSystemTransaction_); + } + 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 com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord)) { + return super.equals(obj); + } + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord other = + (com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord) obj; + + if (hasCommitTimestamp() != other.hasCommitTimestamp()) return false; + if (hasCommitTimestamp()) { + if (!getCommitTimestamp().equals(other.getCommitTimestamp())) return false; + } + if (!getRecordSequence().equals(other.getRecordSequence())) return false; + if (!getServerTransactionId().equals(other.getServerTransactionId())) return false; + if (getIsLastRecordInTransactionInPartition() + != other.getIsLastRecordInTransactionInPartition()) return false; + if (!getTable().equals(other.getTable())) return false; + if (!getColumnMetadataList().equals(other.getColumnMetadataList())) return false; + if (!getModsList().equals(other.getModsList())) return false; + if (modType_ != other.modType_) return false; + if (valueCaptureType_ != other.valueCaptureType_) return false; + if (getNumberOfRecordsInTransaction() != other.getNumberOfRecordsInTransaction()) + return false; + if (getNumberOfPartitionsInTransaction() != other.getNumberOfPartitionsInTransaction()) + return false; + if (!getTransactionTag().equals(other.getTransactionTag())) return false; + if (getIsSystemTransaction() != other.getIsSystemTransaction()) 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(); + if (hasCommitTimestamp()) { + hash = (37 * hash) + COMMIT_TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + getCommitTimestamp().hashCode(); + } + hash = (37 * hash) + RECORD_SEQUENCE_FIELD_NUMBER; + hash = (53 * hash) + getRecordSequence().hashCode(); + hash = (37 * hash) + SERVER_TRANSACTION_ID_FIELD_NUMBER; + hash = (53 * hash) + getServerTransactionId().hashCode(); + hash = (37 * hash) + IS_LAST_RECORD_IN_TRANSACTION_IN_PARTITION_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashBoolean(getIsLastRecordInTransactionInPartition()); + hash = (37 * hash) + TABLE_FIELD_NUMBER; + hash = (53 * hash) + getTable().hashCode(); + if (getColumnMetadataCount() > 0) { + hash = (37 * hash) + COLUMN_METADATA_FIELD_NUMBER; + hash = (53 * hash) + getColumnMetadataList().hashCode(); + } + if (getModsCount() > 0) { + hash = (37 * hash) + MODS_FIELD_NUMBER; + hash = (53 * hash) + getModsList().hashCode(); + } + hash = (37 * hash) + MOD_TYPE_FIELD_NUMBER; + hash = (53 * hash) + modType_; + hash = (37 * hash) + VALUE_CAPTURE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + valueCaptureType_; + hash = (37 * hash) + NUMBER_OF_RECORDS_IN_TRANSACTION_FIELD_NUMBER; + hash = (53 * hash) + getNumberOfRecordsInTransaction(); + hash = (37 * hash) + NUMBER_OF_PARTITIONS_IN_TRANSACTION_FIELD_NUMBER; + hash = (53 * hash) + getNumberOfPartitionsInTransaction(); + hash = (37 * hash) + TRANSACTION_TAG_FIELD_NUMBER; + hash = (53 * hash) + getTransactionTag().hashCode(); + hash = (37 * hash) + IS_SYSTEM_TRANSACTION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getIsSystemTransaction()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord 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.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * A data change record contains a set of changes to a table with the same
+     * modification type (insert, update, or delete) committed at the same commit
+     * timestamp in one change stream partition for the same transaction. Multiple
+     * data change records can be returned for the same transaction across
+     * multiple change stream partitions.
+     * 
+ * + * Protobuf type {@code google.spanner.v1.ChangeStreamRecord.DataChangeRecord} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.spanner.v1.ChangeStreamRecord.DataChangeRecord) + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecordOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.v1.ChangeStreamProto + .internal_static_google_spanner_v1_ChangeStreamRecord_DataChangeRecord_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.v1.ChangeStreamProto + .internal_static_google_spanner_v1_ChangeStreamRecord_DataChangeRecord_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.class, + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Builder.class); + } + + // Construct using com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getCommitTimestampFieldBuilder(); + getColumnMetadataFieldBuilder(); + getModsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + commitTimestamp_ = null; + if (commitTimestampBuilder_ != null) { + commitTimestampBuilder_.dispose(); + commitTimestampBuilder_ = null; + } + recordSequence_ = ""; + serverTransactionId_ = ""; + isLastRecordInTransactionInPartition_ = false; + table_ = ""; + if (columnMetadataBuilder_ == null) { + columnMetadata_ = java.util.Collections.emptyList(); + } else { + columnMetadata_ = null; + columnMetadataBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000020); + if (modsBuilder_ == null) { + mods_ = java.util.Collections.emptyList(); + } else { + mods_ = null; + modsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000040); + modType_ = 0; + valueCaptureType_ = 0; + numberOfRecordsInTransaction_ = 0; + numberOfPartitionsInTransaction_ = 0; + transactionTag_ = ""; + isSystemTransaction_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.spanner.v1.ChangeStreamProto + .internal_static_google_spanner_v1_ChangeStreamRecord_DataChangeRecord_descriptor; + } + + @java.lang.Override + public com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord getDefaultInstanceForType() { + return com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.getDefaultInstance(); + } + + @java.lang.Override + public com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord build() { + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord buildPartial() { + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord result = + new com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord result) { + if (columnMetadataBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0)) { + columnMetadata_ = java.util.Collections.unmodifiableList(columnMetadata_); + bitField0_ = (bitField0_ & ~0x00000020); + } + result.columnMetadata_ = columnMetadata_; + } else { + result.columnMetadata_ = columnMetadataBuilder_.build(); + } + if (modsBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0)) { + mods_ = java.util.Collections.unmodifiableList(mods_); + bitField0_ = (bitField0_ & ~0x00000040); + } + result.mods_ = mods_; + } else { + result.mods_ = modsBuilder_.build(); + } + } + + private void buildPartial0(com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.commitTimestamp_ = + commitTimestampBuilder_ == null ? commitTimestamp_ : commitTimestampBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.recordSequence_ = recordSequence_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.serverTransactionId_ = serverTransactionId_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.isLastRecordInTransactionInPartition_ = isLastRecordInTransactionInPartition_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.table_ = table_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.modType_ = modType_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.valueCaptureType_ = valueCaptureType_; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.numberOfRecordsInTransaction_ = numberOfRecordsInTransaction_; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.numberOfPartitionsInTransaction_ = numberOfPartitionsInTransaction_; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.transactionTag_ = transactionTag_; + } + if (((from_bitField0_ & 0x00001000) != 0)) { + result.isSystemTransaction_ = isSystemTransaction_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord) { + return mergeFrom((com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord other) { + if (other == com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.getDefaultInstance()) + return this; + if (other.hasCommitTimestamp()) { + mergeCommitTimestamp(other.getCommitTimestamp()); + } + if (!other.getRecordSequence().isEmpty()) { + recordSequence_ = other.recordSequence_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getServerTransactionId().isEmpty()) { + serverTransactionId_ = other.serverTransactionId_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.getIsLastRecordInTransactionInPartition() != false) { + setIsLastRecordInTransactionInPartition(other.getIsLastRecordInTransactionInPartition()); + } + if (!other.getTable().isEmpty()) { + table_ = other.table_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (columnMetadataBuilder_ == null) { + if (!other.columnMetadata_.isEmpty()) { + if (columnMetadata_.isEmpty()) { + columnMetadata_ = other.columnMetadata_; + bitField0_ = (bitField0_ & ~0x00000020); + } else { + ensureColumnMetadataIsMutable(); + columnMetadata_.addAll(other.columnMetadata_); + } + onChanged(); + } + } else { + if (!other.columnMetadata_.isEmpty()) { + if (columnMetadataBuilder_.isEmpty()) { + columnMetadataBuilder_.dispose(); + columnMetadataBuilder_ = null; + columnMetadata_ = other.columnMetadata_; + bitField0_ = (bitField0_ & ~0x00000020); + columnMetadataBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getColumnMetadataFieldBuilder() + : null; + } else { + columnMetadataBuilder_.addAllMessages(other.columnMetadata_); + } + } + } + if (modsBuilder_ == null) { + if (!other.mods_.isEmpty()) { + if (mods_.isEmpty()) { + mods_ = other.mods_; + bitField0_ = (bitField0_ & ~0x00000040); + } else { + ensureModsIsMutable(); + mods_.addAll(other.mods_); + } + onChanged(); + } + } else { + if (!other.mods_.isEmpty()) { + if (modsBuilder_.isEmpty()) { + modsBuilder_.dispose(); + modsBuilder_ = null; + mods_ = other.mods_; + bitField0_ = (bitField0_ & ~0x00000040); + modsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getModsFieldBuilder() + : null; + } else { + modsBuilder_.addAllMessages(other.mods_); + } + } + } + if (other.modType_ != 0) { + setModTypeValue(other.getModTypeValue()); + } + if (other.valueCaptureType_ != 0) { + setValueCaptureTypeValue(other.getValueCaptureTypeValue()); + } + if (other.getNumberOfRecordsInTransaction() != 0) { + setNumberOfRecordsInTransaction(other.getNumberOfRecordsInTransaction()); + } + if (other.getNumberOfPartitionsInTransaction() != 0) { + setNumberOfPartitionsInTransaction(other.getNumberOfPartitionsInTransaction()); + } + if (!other.getTransactionTag().isEmpty()) { + transactionTag_ = other.transactionTag_; + bitField0_ |= 0x00000800; + onChanged(); + } + if (other.getIsSystemTransaction() != false) { + setIsSystemTransaction(other.getIsSystemTransaction()); + } + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + getCommitTimestampFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + recordSequence_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + serverTransactionId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + isLastRecordInTransactionInPartition_ = input.readBool(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 42: + { + table_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata m = + input.readMessage( + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata + .parser(), + extensionRegistry); + if (columnMetadataBuilder_ == null) { + ensureColumnMetadataIsMutable(); + columnMetadata_.add(m); + } else { + columnMetadataBuilder_.addMessage(m); + } + break; + } // case 50 + case 58: + { + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod m = + input.readMessage( + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod.parser(), + extensionRegistry); + if (modsBuilder_ == null) { + ensureModsIsMutable(); + mods_.add(m); + } else { + modsBuilder_.addMessage(m); + } + break; + } // case 58 + case 64: + { + modType_ = input.readEnum(); + bitField0_ |= 0x00000080; + break; + } // case 64 + case 72: + { + valueCaptureType_ = input.readEnum(); + bitField0_ |= 0x00000100; + break; + } // case 72 + case 80: + { + numberOfRecordsInTransaction_ = input.readInt32(); + bitField0_ |= 0x00000200; + break; + } // case 80 + case 88: + { + numberOfPartitionsInTransaction_ = input.readInt32(); + bitField0_ |= 0x00000400; + break; + } // case 88 + case 98: + { + transactionTag_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000800; + break; + } // case 98 + case 104: + { + isSystemTransaction_ = input.readBool(); + bitField0_ |= 0x00001000; + break; + } // case 104 + 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.Timestamp commitTimestamp_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + commitTimestampBuilder_; + + /** + * + * + *
+       * Indicates the timestamp in which the change was committed.
+       * DataChangeRecord.commit_timestamps,
+       * PartitionStartRecord.start_timestamps,
+       * PartitionEventRecord.commit_timestamps, and
+       * PartitionEndRecord.end_timestamps can have the same value in the same
+       * partition.
+       * 
+ * + * .google.protobuf.Timestamp commit_timestamp = 1; + * + * @return Whether the commitTimestamp field is set. + */ + public boolean hasCommitTimestamp() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+       * Indicates the timestamp in which the change was committed.
+       * DataChangeRecord.commit_timestamps,
+       * PartitionStartRecord.start_timestamps,
+       * PartitionEventRecord.commit_timestamps, and
+       * PartitionEndRecord.end_timestamps can have the same value in the same
+       * partition.
+       * 
+ * + * .google.protobuf.Timestamp commit_timestamp = 1; + * + * @return The commitTimestamp. + */ + public com.google.protobuf.Timestamp getCommitTimestamp() { + if (commitTimestampBuilder_ == null) { + return commitTimestamp_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : commitTimestamp_; + } else { + return commitTimestampBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * Indicates the timestamp in which the change was committed.
+       * DataChangeRecord.commit_timestamps,
+       * PartitionStartRecord.start_timestamps,
+       * PartitionEventRecord.commit_timestamps, and
+       * PartitionEndRecord.end_timestamps can have the same value in the same
+       * partition.
+       * 
+ * + * .google.protobuf.Timestamp commit_timestamp = 1; + */ + public Builder setCommitTimestamp(com.google.protobuf.Timestamp value) { + if (commitTimestampBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + commitTimestamp_ = value; + } else { + commitTimestampBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * Indicates the timestamp in which the change was committed.
+       * DataChangeRecord.commit_timestamps,
+       * PartitionStartRecord.start_timestamps,
+       * PartitionEventRecord.commit_timestamps, and
+       * PartitionEndRecord.end_timestamps can have the same value in the same
+       * partition.
+       * 
+ * + * .google.protobuf.Timestamp commit_timestamp = 1; + */ + public Builder setCommitTimestamp(com.google.protobuf.Timestamp.Builder builderForValue) { + if (commitTimestampBuilder_ == null) { + commitTimestamp_ = builderForValue.build(); + } else { + commitTimestampBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * Indicates the timestamp in which the change was committed.
+       * DataChangeRecord.commit_timestamps,
+       * PartitionStartRecord.start_timestamps,
+       * PartitionEventRecord.commit_timestamps, and
+       * PartitionEndRecord.end_timestamps can have the same value in the same
+       * partition.
+       * 
+ * + * .google.protobuf.Timestamp commit_timestamp = 1; + */ + public Builder mergeCommitTimestamp(com.google.protobuf.Timestamp value) { + if (commitTimestampBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && commitTimestamp_ != null + && commitTimestamp_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCommitTimestampBuilder().mergeFrom(value); + } else { + commitTimestamp_ = value; + } + } else { + commitTimestampBuilder_.mergeFrom(value); + } + if (commitTimestamp_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * Indicates the timestamp in which the change was committed.
+       * DataChangeRecord.commit_timestamps,
+       * PartitionStartRecord.start_timestamps,
+       * PartitionEventRecord.commit_timestamps, and
+       * PartitionEndRecord.end_timestamps can have the same value in the same
+       * partition.
+       * 
+ * + * .google.protobuf.Timestamp commit_timestamp = 1; + */ + public Builder clearCommitTimestamp() { + bitField0_ = (bitField0_ & ~0x00000001); + commitTimestamp_ = null; + if (commitTimestampBuilder_ != null) { + commitTimestampBuilder_.dispose(); + commitTimestampBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * Indicates the timestamp in which the change was committed.
+       * DataChangeRecord.commit_timestamps,
+       * PartitionStartRecord.start_timestamps,
+       * PartitionEventRecord.commit_timestamps, and
+       * PartitionEndRecord.end_timestamps can have the same value in the same
+       * partition.
+       * 
+ * + * .google.protobuf.Timestamp commit_timestamp = 1; + */ + public com.google.protobuf.Timestamp.Builder getCommitTimestampBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getCommitTimestampFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * Indicates the timestamp in which the change was committed.
+       * DataChangeRecord.commit_timestamps,
+       * PartitionStartRecord.start_timestamps,
+       * PartitionEventRecord.commit_timestamps, and
+       * PartitionEndRecord.end_timestamps can have the same value in the same
+       * partition.
+       * 
+ * + * .google.protobuf.Timestamp commit_timestamp = 1; + */ + public com.google.protobuf.TimestampOrBuilder getCommitTimestampOrBuilder() { + if (commitTimestampBuilder_ != null) { + return commitTimestampBuilder_.getMessageOrBuilder(); + } else { + return commitTimestamp_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : commitTimestamp_; + } + } + + /** + * + * + *
+       * Indicates the timestamp in which the change was committed.
+       * DataChangeRecord.commit_timestamps,
+       * PartitionStartRecord.start_timestamps,
+       * PartitionEventRecord.commit_timestamps, and
+       * PartitionEndRecord.end_timestamps can have the same value in the same
+       * partition.
+       * 
+ * + * .google.protobuf.Timestamp commit_timestamp = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCommitTimestampFieldBuilder() { + if (commitTimestampBuilder_ == null) { + commitTimestampBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCommitTimestamp(), getParentForChildren(), isClean()); + commitTimestamp_ = null; + } + return commitTimestampBuilder_; + } + + private java.lang.Object recordSequence_ = ""; + + /** + * + * + *
+       * Record sequence numbers are unique and monotonically increasing (but not
+       * necessarily contiguous) for a specific timestamp across record
+       * types in the same partition. To guarantee ordered processing, the reader
+       * should process records (of potentially different types) in
+       * record_sequence order for a specific timestamp in the same partition.
+       *
+       * The record sequence number ordering across partitions is only meaningful
+       * in the context of a specific transaction. Record sequence numbers are
+       * unique across partitions for a specific transaction. Sort the
+       * DataChangeRecords for the same
+       * [server_transaction_id][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.server_transaction_id]
+       * by
+       * [record_sequence][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.record_sequence]
+       * to reconstruct the ordering of the changes within the transaction.
+       * 
+ * + * string record_sequence = 2; + * + * @return The recordSequence. + */ + public java.lang.String getRecordSequence() { + java.lang.Object ref = recordSequence_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + recordSequence_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * Record sequence numbers are unique and monotonically increasing (but not
+       * necessarily contiguous) for a specific timestamp across record
+       * types in the same partition. To guarantee ordered processing, the reader
+       * should process records (of potentially different types) in
+       * record_sequence order for a specific timestamp in the same partition.
+       *
+       * The record sequence number ordering across partitions is only meaningful
+       * in the context of a specific transaction. Record sequence numbers are
+       * unique across partitions for a specific transaction. Sort the
+       * DataChangeRecords for the same
+       * [server_transaction_id][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.server_transaction_id]
+       * by
+       * [record_sequence][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.record_sequence]
+       * to reconstruct the ordering of the changes within the transaction.
+       * 
+ * + * string record_sequence = 2; + * + * @return The bytes for recordSequence. + */ + public com.google.protobuf.ByteString getRecordSequenceBytes() { + java.lang.Object ref = recordSequence_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + recordSequence_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * Record sequence numbers are unique and monotonically increasing (but not
+       * necessarily contiguous) for a specific timestamp across record
+       * types in the same partition. To guarantee ordered processing, the reader
+       * should process records (of potentially different types) in
+       * record_sequence order for a specific timestamp in the same partition.
+       *
+       * The record sequence number ordering across partitions is only meaningful
+       * in the context of a specific transaction. Record sequence numbers are
+       * unique across partitions for a specific transaction. Sort the
+       * DataChangeRecords for the same
+       * [server_transaction_id][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.server_transaction_id]
+       * by
+       * [record_sequence][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.record_sequence]
+       * to reconstruct the ordering of the changes within the transaction.
+       * 
+ * + * string record_sequence = 2; + * + * @param value The recordSequence to set. + * @return This builder for chaining. + */ + public Builder setRecordSequence(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + recordSequence_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * Record sequence numbers are unique and monotonically increasing (but not
+       * necessarily contiguous) for a specific timestamp across record
+       * types in the same partition. To guarantee ordered processing, the reader
+       * should process records (of potentially different types) in
+       * record_sequence order for a specific timestamp in the same partition.
+       *
+       * The record sequence number ordering across partitions is only meaningful
+       * in the context of a specific transaction. Record sequence numbers are
+       * unique across partitions for a specific transaction. Sort the
+       * DataChangeRecords for the same
+       * [server_transaction_id][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.server_transaction_id]
+       * by
+       * [record_sequence][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.record_sequence]
+       * to reconstruct the ordering of the changes within the transaction.
+       * 
+ * + * string record_sequence = 2; + * + * @return This builder for chaining. + */ + public Builder clearRecordSequence() { + recordSequence_ = getDefaultInstance().getRecordSequence(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+       * Record sequence numbers are unique and monotonically increasing (but not
+       * necessarily contiguous) for a specific timestamp across record
+       * types in the same partition. To guarantee ordered processing, the reader
+       * should process records (of potentially different types) in
+       * record_sequence order for a specific timestamp in the same partition.
+       *
+       * The record sequence number ordering across partitions is only meaningful
+       * in the context of a specific transaction. Record sequence numbers are
+       * unique across partitions for a specific transaction. Sort the
+       * DataChangeRecords for the same
+       * [server_transaction_id][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.server_transaction_id]
+       * by
+       * [record_sequence][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.record_sequence]
+       * to reconstruct the ordering of the changes within the transaction.
+       * 
+ * + * string record_sequence = 2; + * + * @param value The bytes for recordSequence to set. + * @return This builder for chaining. + */ + public Builder setRecordSequenceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + recordSequence_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object serverTransactionId_ = ""; + + /** + * + * + *
+       * Provides a globally unique string that represents the transaction in
+       * which the change was committed. Multiple transactions can have the same
+       * commit timestamp, but each transaction has a unique
+       * server_transaction_id.
+       * 
+ * + * string server_transaction_id = 3; + * + * @return The serverTransactionId. + */ + public java.lang.String getServerTransactionId() { + java.lang.Object ref = serverTransactionId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serverTransactionId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * Provides a globally unique string that represents the transaction in
+       * which the change was committed. Multiple transactions can have the same
+       * commit timestamp, but each transaction has a unique
+       * server_transaction_id.
+       * 
+ * + * string server_transaction_id = 3; + * + * @return The bytes for serverTransactionId. + */ + public com.google.protobuf.ByteString getServerTransactionIdBytes() { + java.lang.Object ref = serverTransactionId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serverTransactionId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * Provides a globally unique string that represents the transaction in
+       * which the change was committed. Multiple transactions can have the same
+       * commit timestamp, but each transaction has a unique
+       * server_transaction_id.
+       * 
+ * + * string server_transaction_id = 3; + * + * @param value The serverTransactionId to set. + * @return This builder for chaining. + */ + public Builder setServerTransactionId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + serverTransactionId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+       * Provides a globally unique string that represents the transaction in
+       * which the change was committed. Multiple transactions can have the same
+       * commit timestamp, but each transaction has a unique
+       * server_transaction_id.
+       * 
+ * + * string server_transaction_id = 3; + * + * @return This builder for chaining. + */ + public Builder clearServerTransactionId() { + serverTransactionId_ = getDefaultInstance().getServerTransactionId(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+       * Provides a globally unique string that represents the transaction in
+       * which the change was committed. Multiple transactions can have the same
+       * commit timestamp, but each transaction has a unique
+       * server_transaction_id.
+       * 
+ * + * string server_transaction_id = 3; + * + * @param value The bytes for serverTransactionId to set. + * @return This builder for chaining. + */ + public Builder setServerTransactionIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + serverTransactionId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private boolean isLastRecordInTransactionInPartition_; + + /** + * + * + *
+       * Indicates whether this is the last record for a transaction in the
+       *  current partition. Clients can use this field to determine when all
+       *  records for a transaction in the current partition have been received.
+       * 
+ * + * bool is_last_record_in_transaction_in_partition = 4; + * + * @return The isLastRecordInTransactionInPartition. + */ + @java.lang.Override + public boolean getIsLastRecordInTransactionInPartition() { + return isLastRecordInTransactionInPartition_; + } + + /** + * + * + *
+       * Indicates whether this is the last record for a transaction in the
+       *  current partition. Clients can use this field to determine when all
+       *  records for a transaction in the current partition have been received.
+       * 
+ * + * bool is_last_record_in_transaction_in_partition = 4; + * + * @param value The isLastRecordInTransactionInPartition to set. + * @return This builder for chaining. + */ + public Builder setIsLastRecordInTransactionInPartition(boolean value) { + + isLastRecordInTransactionInPartition_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+       * Indicates whether this is the last record for a transaction in the
+       *  current partition. Clients can use this field to determine when all
+       *  records for a transaction in the current partition have been received.
+       * 
+ * + * bool is_last_record_in_transaction_in_partition = 4; + * + * @return This builder for chaining. + */ + public Builder clearIsLastRecordInTransactionInPartition() { + bitField0_ = (bitField0_ & ~0x00000008); + isLastRecordInTransactionInPartition_ = false; + onChanged(); + return this; + } + + private java.lang.Object table_ = ""; + + /** + * + * + *
+       * Name of the table affected by the change.
+       * 
+ * + * string table = 5; + * + * @return The table. + */ + public java.lang.String getTable() { + java.lang.Object ref = table_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + table_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * Name of the table affected by the change.
+       * 
+ * + * string table = 5; + * + * @return The bytes for table. + */ + public com.google.protobuf.ByteString getTableBytes() { + java.lang.Object ref = table_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + table_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * Name of the table affected by the change.
+       * 
+ * + * string table = 5; + * + * @param value The table to set. + * @return This builder for chaining. + */ + public Builder setTable(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + table_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+       * Name of the table affected by the change.
+       * 
+ * + * string table = 5; + * + * @return This builder for chaining. + */ + public Builder clearTable() { + table_ = getDefaultInstance().getTable(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + + /** + * + * + *
+       * Name of the table affected by the change.
+       * 
+ * + * string table = 5; + * + * @param value The bytes for table to set. + * @return This builder for chaining. + */ + public Builder setTableBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + table_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private java.util.List< + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata> + columnMetadata_ = java.util.Collections.emptyList(); + + private void ensureColumnMetadataIsMutable() { + if (!((bitField0_ & 0x00000020) != 0)) { + columnMetadata_ = + new java.util.ArrayList< + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata>( + columnMetadata_); + bitField0_ |= 0x00000020; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata, + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata.Builder, + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadataOrBuilder> + columnMetadataBuilder_; + + /** + * + * + *
+       * Provides metadata describing the columns associated with the
+       * [mods][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.mods] listed
+       * below.
+       * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata column_metadata = 6; + * + */ + public java.util.List< + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata> + getColumnMetadataList() { + if (columnMetadataBuilder_ == null) { + return java.util.Collections.unmodifiableList(columnMetadata_); + } else { + return columnMetadataBuilder_.getMessageList(); + } + } + + /** + * + * + *
+       * Provides metadata describing the columns associated with the
+       * [mods][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.mods] listed
+       * below.
+       * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata column_metadata = 6; + * + */ + public int getColumnMetadataCount() { + if (columnMetadataBuilder_ == null) { + return columnMetadata_.size(); + } else { + return columnMetadataBuilder_.getCount(); + } + } + + /** + * + * + *
+       * Provides metadata describing the columns associated with the
+       * [mods][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.mods] listed
+       * below.
+       * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata column_metadata = 6; + * + */ + public com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata + getColumnMetadata(int index) { + if (columnMetadataBuilder_ == null) { + return columnMetadata_.get(index); + } else { + return columnMetadataBuilder_.getMessage(index); + } + } + + /** + * + * + *
+       * Provides metadata describing the columns associated with the
+       * [mods][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.mods] listed
+       * below.
+       * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata column_metadata = 6; + * + */ + public Builder setColumnMetadata( + int index, + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata value) { + if (columnMetadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureColumnMetadataIsMutable(); + columnMetadata_.set(index, value); + onChanged(); + } else { + columnMetadataBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+       * Provides metadata describing the columns associated with the
+       * [mods][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.mods] listed
+       * below.
+       * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata column_metadata = 6; + * + */ + public Builder setColumnMetadata( + int index, + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata.Builder + builderForValue) { + if (columnMetadataBuilder_ == null) { + ensureColumnMetadataIsMutable(); + columnMetadata_.set(index, builderForValue.build()); + onChanged(); + } else { + columnMetadataBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * Provides metadata describing the columns associated with the
+       * [mods][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.mods] listed
+       * below.
+       * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata column_metadata = 6; + * + */ + public Builder addColumnMetadata( + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata value) { + if (columnMetadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureColumnMetadataIsMutable(); + columnMetadata_.add(value); + onChanged(); + } else { + columnMetadataBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+       * Provides metadata describing the columns associated with the
+       * [mods][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.mods] listed
+       * below.
+       * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata column_metadata = 6; + * + */ + public Builder addColumnMetadata( + int index, + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata value) { + if (columnMetadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureColumnMetadataIsMutable(); + columnMetadata_.add(index, value); + onChanged(); + } else { + columnMetadataBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+       * Provides metadata describing the columns associated with the
+       * [mods][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.mods] listed
+       * below.
+       * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata column_metadata = 6; + * + */ + public Builder addColumnMetadata( + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata.Builder + builderForValue) { + if (columnMetadataBuilder_ == null) { + ensureColumnMetadataIsMutable(); + columnMetadata_.add(builderForValue.build()); + onChanged(); + } else { + columnMetadataBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * Provides metadata describing the columns associated with the
+       * [mods][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.mods] listed
+       * below.
+       * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata column_metadata = 6; + * + */ + public Builder addColumnMetadata( + int index, + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata.Builder + builderForValue) { + if (columnMetadataBuilder_ == null) { + ensureColumnMetadataIsMutable(); + columnMetadata_.add(index, builderForValue.build()); + onChanged(); + } else { + columnMetadataBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * Provides metadata describing the columns associated with the
+       * [mods][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.mods] listed
+       * below.
+       * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata column_metadata = 6; + * + */ + public Builder addAllColumnMetadata( + java.lang.Iterable< + ? extends + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata> + values) { + if (columnMetadataBuilder_ == null) { + ensureColumnMetadataIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, columnMetadata_); + onChanged(); + } else { + columnMetadataBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+       * Provides metadata describing the columns associated with the
+       * [mods][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.mods] listed
+       * below.
+       * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata column_metadata = 6; + * + */ + public Builder clearColumnMetadata() { + if (columnMetadataBuilder_ == null) { + columnMetadata_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + } else { + columnMetadataBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+       * Provides metadata describing the columns associated with the
+       * [mods][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.mods] listed
+       * below.
+       * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata column_metadata = 6; + * + */ + public Builder removeColumnMetadata(int index) { + if (columnMetadataBuilder_ == null) { + ensureColumnMetadataIsMutable(); + columnMetadata_.remove(index); + onChanged(); + } else { + columnMetadataBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+       * Provides metadata describing the columns associated with the
+       * [mods][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.mods] listed
+       * below.
+       * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata column_metadata = 6; + * + */ + public com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata.Builder + getColumnMetadataBuilder(int index) { + return getColumnMetadataFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+       * Provides metadata describing the columns associated with the
+       * [mods][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.mods] listed
+       * below.
+       * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata column_metadata = 6; + * + */ + public com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadataOrBuilder + getColumnMetadataOrBuilder(int index) { + if (columnMetadataBuilder_ == null) { + return columnMetadata_.get(index); + } else { + return columnMetadataBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+       * Provides metadata describing the columns associated with the
+       * [mods][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.mods] listed
+       * below.
+       * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata column_metadata = 6; + * + */ + public java.util.List< + ? extends + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadataOrBuilder> + getColumnMetadataOrBuilderList() { + if (columnMetadataBuilder_ != null) { + return columnMetadataBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(columnMetadata_); + } + } + + /** + * + * + *
+       * Provides metadata describing the columns associated with the
+       * [mods][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.mods] listed
+       * below.
+       * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata column_metadata = 6; + * + */ + public com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata.Builder + addColumnMetadataBuilder() { + return getColumnMetadataFieldBuilder() + .addBuilder( + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata + .getDefaultInstance()); + } + + /** + * + * + *
+       * Provides metadata describing the columns associated with the
+       * [mods][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.mods] listed
+       * below.
+       * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata column_metadata = 6; + * + */ + public com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata.Builder + addColumnMetadataBuilder(int index) { + return getColumnMetadataFieldBuilder() + .addBuilder( + index, + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata + .getDefaultInstance()); + } + + /** + * + * + *
+       * Provides metadata describing the columns associated with the
+       * [mods][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.mods] listed
+       * below.
+       * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata column_metadata = 6; + * + */ + public java.util.List< + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata.Builder> + getColumnMetadataBuilderList() { + return getColumnMetadataFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata, + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata.Builder, + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadataOrBuilder> + getColumnMetadataFieldBuilder() { + if (columnMetadataBuilder_ == null) { + columnMetadataBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata, + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata.Builder, + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord + .ColumnMetadataOrBuilder>( + columnMetadata_, + ((bitField0_ & 0x00000020) != 0), + getParentForChildren(), + isClean()); + columnMetadata_ = null; + } + return columnMetadataBuilder_; + } + + private java.util.List mods_ = + java.util.Collections.emptyList(); + + private void ensureModsIsMutable() { + if (!((bitField0_ & 0x00000040) != 0)) { + mods_ = + new java.util.ArrayList< + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod>(mods_); + bitField0_ |= 0x00000040; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod, + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod.Builder, + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModOrBuilder> + modsBuilder_; + + /** + * + * + *
+       * Describes the changes that were made.
+       * 
+ * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod mods = 7; + */ + public java.util.List + getModsList() { + if (modsBuilder_ == null) { + return java.util.Collections.unmodifiableList(mods_); + } else { + return modsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+       * Describes the changes that were made.
+       * 
+ * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod mods = 7; + */ + public int getModsCount() { + if (modsBuilder_ == null) { + return mods_.size(); + } else { + return modsBuilder_.getCount(); + } + } + + /** + * + * + *
+       * Describes the changes that were made.
+       * 
+ * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod mods = 7; + */ + public com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod getMods(int index) { + if (modsBuilder_ == null) { + return mods_.get(index); + } else { + return modsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+       * Describes the changes that were made.
+       * 
+ * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod mods = 7; + */ + public Builder setMods( + int index, com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod value) { + if (modsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureModsIsMutable(); + mods_.set(index, value); + onChanged(); + } else { + modsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+       * Describes the changes that were made.
+       * 
+ * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod mods = 7; + */ + public Builder setMods( + int index, + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod.Builder builderForValue) { + if (modsBuilder_ == null) { + ensureModsIsMutable(); + mods_.set(index, builderForValue.build()); + onChanged(); + } else { + modsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * Describes the changes that were made.
+       * 
+ * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod mods = 7; + */ + public Builder addMods(com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod value) { + if (modsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureModsIsMutable(); + mods_.add(value); + onChanged(); + } else { + modsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+       * Describes the changes that were made.
+       * 
+ * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod mods = 7; + */ + public Builder addMods( + int index, com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod value) { + if (modsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureModsIsMutable(); + mods_.add(index, value); + onChanged(); + } else { + modsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+       * Describes the changes that were made.
+       * 
+ * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod mods = 7; + */ + public Builder addMods( + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod.Builder builderForValue) { + if (modsBuilder_ == null) { + ensureModsIsMutable(); + mods_.add(builderForValue.build()); + onChanged(); + } else { + modsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * Describes the changes that were made.
+       * 
+ * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod mods = 7; + */ + public Builder addMods( + int index, + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod.Builder builderForValue) { + if (modsBuilder_ == null) { + ensureModsIsMutable(); + mods_.add(index, builderForValue.build()); + onChanged(); + } else { + modsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * Describes the changes that were made.
+       * 
+ * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod mods = 7; + */ + public Builder addAllMods( + java.lang.Iterable< + ? extends com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod> + values) { + if (modsBuilder_ == null) { + ensureModsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, mods_); + onChanged(); + } else { + modsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+       * Describes the changes that were made.
+       * 
+ * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod mods = 7; + */ + public Builder clearMods() { + if (modsBuilder_ == null) { + mods_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + } else { + modsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+       * Describes the changes that were made.
+       * 
+ * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod mods = 7; + */ + public Builder removeMods(int index) { + if (modsBuilder_ == null) { + ensureModsIsMutable(); + mods_.remove(index); + onChanged(); + } else { + modsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+       * Describes the changes that were made.
+       * 
+ * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod mods = 7; + */ + public com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod.Builder getModsBuilder( + int index) { + return getModsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+       * Describes the changes that were made.
+       * 
+ * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod mods = 7; + */ + public com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModOrBuilder + getModsOrBuilder(int index) { + if (modsBuilder_ == null) { + return mods_.get(index); + } else { + return modsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+       * Describes the changes that were made.
+       * 
+ * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod mods = 7; + */ + public java.util.List< + ? extends com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModOrBuilder> + getModsOrBuilderList() { + if (modsBuilder_ != null) { + return modsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(mods_); + } + } + + /** + * + * + *
+       * Describes the changes that were made.
+       * 
+ * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod mods = 7; + */ + public com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod.Builder + addModsBuilder() { + return getModsFieldBuilder() + .addBuilder( + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod.getDefaultInstance()); + } + + /** + * + * + *
+       * Describes the changes that were made.
+       * 
+ * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod mods = 7; + */ + public com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod.Builder addModsBuilder( + int index) { + return getModsFieldBuilder() + .addBuilder( + index, + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod.getDefaultInstance()); + } + + /** + * + * + *
+       * Describes the changes that were made.
+       * 
+ * + * repeated .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod mods = 7; + */ + public java.util.List + getModsBuilderList() { + return getModsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod, + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod.Builder, + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModOrBuilder> + getModsFieldBuilder() { + if (modsBuilder_ == null) { + modsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod, + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod.Builder, + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModOrBuilder>( + mods_, ((bitField0_ & 0x00000040) != 0), getParentForChildren(), isClean()); + mods_ = null; + } + return modsBuilder_; + } + + private int modType_ = 0; + + /** + * + * + *
+       * Describes the type of change.
+       * 
+ * + * .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType mod_type = 8; + * + * @return The enum numeric value on the wire for modType. + */ + @java.lang.Override + public int getModTypeValue() { + return modType_; + } + + /** + * + * + *
+       * Describes the type of change.
+       * 
+ * + * .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType mod_type = 8; + * + * @param value The enum numeric value on the wire for modType to set. + * @return This builder for chaining. + */ + public Builder setModTypeValue(int value) { + modType_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+       * Describes the type of change.
+       * 
+ * + * .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType mod_type = 8; + * + * @return The modType. + */ + @java.lang.Override + public com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType getModType() { + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType result = + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType.forNumber(modType_); + return result == null + ? com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType.UNRECOGNIZED + : result; + } + + /** + * + * + *
+       * Describes the type of change.
+       * 
+ * + * .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType mod_type = 8; + * + * @param value The modType to set. + * @return This builder for chaining. + */ + public Builder setModType( + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000080; + modType_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+       * Describes the type of change.
+       * 
+ * + * .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType mod_type = 8; + * + * @return This builder for chaining. + */ + public Builder clearModType() { + bitField0_ = (bitField0_ & ~0x00000080); + modType_ = 0; + onChanged(); + return this; + } + + private int valueCaptureType_ = 0; + + /** + * + * + *
+       * Describes the value capture type that was specified in the change stream
+       * configuration when this change was captured.
+       * 
+ * + * + * .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType value_capture_type = 9; + * + * + * @return The enum numeric value on the wire for valueCaptureType. + */ + @java.lang.Override + public int getValueCaptureTypeValue() { + return valueCaptureType_; + } + + /** + * + * + *
+       * Describes the value capture type that was specified in the change stream
+       * configuration when this change was captured.
+       * 
+ * + * + * .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType value_capture_type = 9; + * + * + * @param value The enum numeric value on the wire for valueCaptureType to set. + * @return This builder for chaining. + */ + public Builder setValueCaptureTypeValue(int value) { + valueCaptureType_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+       * Describes the value capture type that was specified in the change stream
+       * configuration when this change was captured.
+       * 
+ * + * + * .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType value_capture_type = 9; + * + * + * @return The valueCaptureType. + */ + @java.lang.Override + public com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType + getValueCaptureType() { + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType result = + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType.forNumber( + valueCaptureType_); + return result == null + ? com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType + .UNRECOGNIZED + : result; + } + + /** + * + * + *
+       * Describes the value capture type that was specified in the change stream
+       * configuration when this change was captured.
+       * 
+ * + * + * .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType value_capture_type = 9; + * + * + * @param value The valueCaptureType to set. + * @return This builder for chaining. + */ + public Builder setValueCaptureType( + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000100; + valueCaptureType_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+       * Describes the value capture type that was specified in the change stream
+       * configuration when this change was captured.
+       * 
+ * + * + * .google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType value_capture_type = 9; + * + * + * @return This builder for chaining. + */ + public Builder clearValueCaptureType() { + bitField0_ = (bitField0_ & ~0x00000100); + valueCaptureType_ = 0; + onChanged(); + return this; + } + + private int numberOfRecordsInTransaction_; + + /** + * + * + *
+       * Indicates the number of data change records that are part of this
+       * transaction across all change stream partitions. This value can be used
+       * to assemble all the records associated with a particular transaction.
+       * 
+ * + * int32 number_of_records_in_transaction = 10; + * + * @return The numberOfRecordsInTransaction. + */ + @java.lang.Override + public int getNumberOfRecordsInTransaction() { + return numberOfRecordsInTransaction_; + } + + /** + * + * + *
+       * Indicates the number of data change records that are part of this
+       * transaction across all change stream partitions. This value can be used
+       * to assemble all the records associated with a particular transaction.
+       * 
+ * + * int32 number_of_records_in_transaction = 10; + * + * @param value The numberOfRecordsInTransaction to set. + * @return This builder for chaining. + */ + public Builder setNumberOfRecordsInTransaction(int value) { + + numberOfRecordsInTransaction_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * + * + *
+       * Indicates the number of data change records that are part of this
+       * transaction across all change stream partitions. This value can be used
+       * to assemble all the records associated with a particular transaction.
+       * 
+ * + * int32 number_of_records_in_transaction = 10; + * + * @return This builder for chaining. + */ + public Builder clearNumberOfRecordsInTransaction() { + bitField0_ = (bitField0_ & ~0x00000200); + numberOfRecordsInTransaction_ = 0; + onChanged(); + return this; + } + + private int numberOfPartitionsInTransaction_; + + /** + * + * + *
+       * Indicates the number of partitions that return data change records for
+       * this transaction. This value can be helpful in assembling all records
+       * associated with a particular transaction.
+       * 
+ * + * int32 number_of_partitions_in_transaction = 11; + * + * @return The numberOfPartitionsInTransaction. + */ + @java.lang.Override + public int getNumberOfPartitionsInTransaction() { + return numberOfPartitionsInTransaction_; + } + + /** + * + * + *
+       * Indicates the number of partitions that return data change records for
+       * this transaction. This value can be helpful in assembling all records
+       * associated with a particular transaction.
+       * 
+ * + * int32 number_of_partitions_in_transaction = 11; + * + * @param value The numberOfPartitionsInTransaction to set. + * @return This builder for chaining. + */ + public Builder setNumberOfPartitionsInTransaction(int value) { + + numberOfPartitionsInTransaction_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + + /** + * + * + *
+       * Indicates the number of partitions that return data change records for
+       * this transaction. This value can be helpful in assembling all records
+       * associated with a particular transaction.
+       * 
+ * + * int32 number_of_partitions_in_transaction = 11; + * + * @return This builder for chaining. + */ + public Builder clearNumberOfPartitionsInTransaction() { + bitField0_ = (bitField0_ & ~0x00000400); + numberOfPartitionsInTransaction_ = 0; + onChanged(); + return this; + } + + private java.lang.Object transactionTag_ = ""; + + /** + * + * + *
+       * Indicates the transaction tag associated with this transaction.
+       * 
+ * + * string transaction_tag = 12; + * + * @return The transactionTag. + */ + public java.lang.String getTransactionTag() { + java.lang.Object ref = transactionTag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + transactionTag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * Indicates the transaction tag associated with this transaction.
+       * 
+ * + * string transaction_tag = 12; + * + * @return The bytes for transactionTag. + */ + public com.google.protobuf.ByteString getTransactionTagBytes() { + java.lang.Object ref = transactionTag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + transactionTag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * Indicates the transaction tag associated with this transaction.
+       * 
+ * + * string transaction_tag = 12; + * + * @param value The transactionTag to set. + * @return This builder for chaining. + */ + public Builder setTransactionTag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + transactionTag_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + + /** + * + * + *
+       * Indicates the transaction tag associated with this transaction.
+       * 
+ * + * string transaction_tag = 12; + * + * @return This builder for chaining. + */ + public Builder clearTransactionTag() { + transactionTag_ = getDefaultInstance().getTransactionTag(); + bitField0_ = (bitField0_ & ~0x00000800); + onChanged(); + return this; + } + + /** + * + * + *
+       * Indicates the transaction tag associated with this transaction.
+       * 
+ * + * string transaction_tag = 12; + * + * @param value The bytes for transactionTag to set. + * @return This builder for chaining. + */ + public Builder setTransactionTagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + transactionTag_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + + private boolean isSystemTransaction_; + + /** + * + * + *
+       * Indicates whether the transaction is a system transaction. System
+       * transactions include those issued by time-to-live (TTL), column backfill,
+       * etc.
+       * 
+ * + * bool is_system_transaction = 13; + * + * @return The isSystemTransaction. + */ + @java.lang.Override + public boolean getIsSystemTransaction() { + return isSystemTransaction_; + } + + /** + * + * + *
+       * Indicates whether the transaction is a system transaction. System
+       * transactions include those issued by time-to-live (TTL), column backfill,
+       * etc.
+       * 
+ * + * bool is_system_transaction = 13; + * + * @param value The isSystemTransaction to set. + * @return This builder for chaining. + */ + public Builder setIsSystemTransaction(boolean value) { + + isSystemTransaction_ = value; + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + + /** + * + * + *
+       * Indicates whether the transaction is a system transaction. System
+       * transactions include those issued by time-to-live (TTL), column backfill,
+       * etc.
+       * 
+ * + * bool is_system_transaction = 13; + * + * @return This builder for chaining. + */ + public Builder clearIsSystemTransaction() { + bitField0_ = (bitField0_ & ~0x00001000); + isSystemTransaction_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.spanner.v1.ChangeStreamRecord.DataChangeRecord) + } + + // @@protoc_insertion_point(class_scope:google.spanner.v1.ChangeStreamRecord.DataChangeRecord) + private static final com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord(); + } + + public static com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DataChangeRecord 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 com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface HeartbeatRecordOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.spanner.v1.ChangeStreamRecord.HeartbeatRecord) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Indicates the timestamp at which the query has returned all the records
+     * in the change stream partition with timestamp <= heartbeat timestamp.
+     * The heartbeat timestamp will not be the same as the timestamps of other
+     * record types in the same partition.
+     * 
+ * + * .google.protobuf.Timestamp timestamp = 1; + * + * @return Whether the timestamp field is set. + */ + boolean hasTimestamp(); + + /** + * + * + *
+     * Indicates the timestamp at which the query has returned all the records
+     * in the change stream partition with timestamp <= heartbeat timestamp.
+     * The heartbeat timestamp will not be the same as the timestamps of other
+     * record types in the same partition.
+     * 
+ * + * .google.protobuf.Timestamp timestamp = 1; + * + * @return The timestamp. + */ + com.google.protobuf.Timestamp getTimestamp(); + + /** + * + * + *
+     * Indicates the timestamp at which the query has returned all the records
+     * in the change stream partition with timestamp <= heartbeat timestamp.
+     * The heartbeat timestamp will not be the same as the timestamps of other
+     * record types in the same partition.
+     * 
+ * + * .google.protobuf.Timestamp timestamp = 1; + */ + com.google.protobuf.TimestampOrBuilder getTimestampOrBuilder(); + } + + /** + * + * + *
+   * A heartbeat record is returned as a progress indicator, when there are no
+   * data changes or any other partition record types in the change stream
+   * partition.
+   * 
+ * + * Protobuf type {@code google.spanner.v1.ChangeStreamRecord.HeartbeatRecord} + */ + public static final class HeartbeatRecord extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.spanner.v1.ChangeStreamRecord.HeartbeatRecord) + HeartbeatRecordOrBuilder { + private static final long serialVersionUID = 0L; + + // Use HeartbeatRecord.newBuilder() to construct. + private HeartbeatRecord(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private HeartbeatRecord() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new HeartbeatRecord(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.v1.ChangeStreamProto + .internal_static_google_spanner_v1_ChangeStreamRecord_HeartbeatRecord_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.v1.ChangeStreamProto + .internal_static_google_spanner_v1_ChangeStreamRecord_HeartbeatRecord_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord.class, + com.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord.Builder.class); + } + + private int bitField0_; + public static final int TIMESTAMP_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp timestamp_; + + /** + * + * + *
+     * Indicates the timestamp at which the query has returned all the records
+     * in the change stream partition with timestamp <= heartbeat timestamp.
+     * The heartbeat timestamp will not be the same as the timestamps of other
+     * record types in the same partition.
+     * 
+ * + * .google.protobuf.Timestamp timestamp = 1; + * + * @return Whether the timestamp field is set. + */ + @java.lang.Override + public boolean hasTimestamp() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Indicates the timestamp at which the query has returned all the records
+     * in the change stream partition with timestamp <= heartbeat timestamp.
+     * The heartbeat timestamp will not be the same as the timestamps of other
+     * record types in the same partition.
+     * 
+ * + * .google.protobuf.Timestamp timestamp = 1; + * + * @return The timestamp. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getTimestamp() { + return timestamp_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : timestamp_; + } + + /** + * + * + *
+     * Indicates the timestamp at which the query has returned all the records
+     * in the change stream partition with timestamp <= heartbeat timestamp.
+     * The heartbeat timestamp will not be the same as the timestamps of other
+     * record types in the same partition.
+     * 
+ * + * .google.protobuf.Timestamp timestamp = 1; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getTimestampOrBuilder() { + return timestamp_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : timestamp_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getTimestamp()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getTimestamp()); + } + 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 com.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord)) { + return super.equals(obj); + } + com.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord other = + (com.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord) obj; + + if (hasTimestamp() != other.hasTimestamp()) return false; + if (hasTimestamp()) { + if (!getTimestamp().equals(other.getTimestamp())) 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(); + if (hasTimestamp()) { + hash = (37 * hash) + TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + getTimestamp().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord 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.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * A heartbeat record is returned as a progress indicator, when there are no
+     * data changes or any other partition record types in the change stream
+     * partition.
+     * 
+ * + * Protobuf type {@code google.spanner.v1.ChangeStreamRecord.HeartbeatRecord} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.spanner.v1.ChangeStreamRecord.HeartbeatRecord) + com.google.spanner.v1.ChangeStreamRecord.HeartbeatRecordOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.v1.ChangeStreamProto + .internal_static_google_spanner_v1_ChangeStreamRecord_HeartbeatRecord_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.v1.ChangeStreamProto + .internal_static_google_spanner_v1_ChangeStreamRecord_HeartbeatRecord_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord.class, + com.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord.Builder.class); + } + + // Construct using com.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getTimestampFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + timestamp_ = null; + if (timestampBuilder_ != null) { + timestampBuilder_.dispose(); + timestampBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.spanner.v1.ChangeStreamProto + .internal_static_google_spanner_v1_ChangeStreamRecord_HeartbeatRecord_descriptor; + } + + @java.lang.Override + public com.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord getDefaultInstanceForType() { + return com.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord.getDefaultInstance(); + } + + @java.lang.Override + public com.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord build() { + com.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord buildPartial() { + com.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord result = + new com.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.timestamp_ = timestampBuilder_ == null ? timestamp_ : timestampBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord) { + return mergeFrom((com.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord other) { + if (other == com.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord.getDefaultInstance()) + return this; + if (other.hasTimestamp()) { + mergeTimestamp(other.getTimestamp()); + } + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getTimestampFieldBuilder().getBuilder(), extensionRegistry); + 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.Timestamp timestamp_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + timestampBuilder_; + + /** + * + * + *
+       * Indicates the timestamp at which the query has returned all the records
+       * in the change stream partition with timestamp <= heartbeat timestamp.
+       * The heartbeat timestamp will not be the same as the timestamps of other
+       * record types in the same partition.
+       * 
+ * + * .google.protobuf.Timestamp timestamp = 1; + * + * @return Whether the timestamp field is set. + */ + public boolean hasTimestamp() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+       * Indicates the timestamp at which the query has returned all the records
+       * in the change stream partition with timestamp <= heartbeat timestamp.
+       * The heartbeat timestamp will not be the same as the timestamps of other
+       * record types in the same partition.
+       * 
+ * + * .google.protobuf.Timestamp timestamp = 1; + * + * @return The timestamp. + */ + public com.google.protobuf.Timestamp getTimestamp() { + if (timestampBuilder_ == null) { + return timestamp_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : timestamp_; + } else { + return timestampBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * Indicates the timestamp at which the query has returned all the records
+       * in the change stream partition with timestamp <= heartbeat timestamp.
+       * The heartbeat timestamp will not be the same as the timestamps of other
+       * record types in the same partition.
+       * 
+ * + * .google.protobuf.Timestamp timestamp = 1; + */ + public Builder setTimestamp(com.google.protobuf.Timestamp value) { + if (timestampBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + timestamp_ = value; + } else { + timestampBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * Indicates the timestamp at which the query has returned all the records
+       * in the change stream partition with timestamp <= heartbeat timestamp.
+       * The heartbeat timestamp will not be the same as the timestamps of other
+       * record types in the same partition.
+       * 
+ * + * .google.protobuf.Timestamp timestamp = 1; + */ + public Builder setTimestamp(com.google.protobuf.Timestamp.Builder builderForValue) { + if (timestampBuilder_ == null) { + timestamp_ = builderForValue.build(); + } else { + timestampBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * Indicates the timestamp at which the query has returned all the records
+       * in the change stream partition with timestamp <= heartbeat timestamp.
+       * The heartbeat timestamp will not be the same as the timestamps of other
+       * record types in the same partition.
+       * 
+ * + * .google.protobuf.Timestamp timestamp = 1; + */ + public Builder mergeTimestamp(com.google.protobuf.Timestamp value) { + if (timestampBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && timestamp_ != null + && timestamp_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getTimestampBuilder().mergeFrom(value); + } else { + timestamp_ = value; + } + } else { + timestampBuilder_.mergeFrom(value); + } + if (timestamp_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * Indicates the timestamp at which the query has returned all the records
+       * in the change stream partition with timestamp <= heartbeat timestamp.
+       * The heartbeat timestamp will not be the same as the timestamps of other
+       * record types in the same partition.
+       * 
+ * + * .google.protobuf.Timestamp timestamp = 1; + */ + public Builder clearTimestamp() { + bitField0_ = (bitField0_ & ~0x00000001); + timestamp_ = null; + if (timestampBuilder_ != null) { + timestampBuilder_.dispose(); + timestampBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * Indicates the timestamp at which the query has returned all the records
+       * in the change stream partition with timestamp <= heartbeat timestamp.
+       * The heartbeat timestamp will not be the same as the timestamps of other
+       * record types in the same partition.
+       * 
+ * + * .google.protobuf.Timestamp timestamp = 1; + */ + public com.google.protobuf.Timestamp.Builder getTimestampBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getTimestampFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * Indicates the timestamp at which the query has returned all the records
+       * in the change stream partition with timestamp <= heartbeat timestamp.
+       * The heartbeat timestamp will not be the same as the timestamps of other
+       * record types in the same partition.
+       * 
+ * + * .google.protobuf.Timestamp timestamp = 1; + */ + public com.google.protobuf.TimestampOrBuilder getTimestampOrBuilder() { + if (timestampBuilder_ != null) { + return timestampBuilder_.getMessageOrBuilder(); + } else { + return timestamp_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : timestamp_; + } + } + + /** + * + * + *
+       * Indicates the timestamp at which the query has returned all the records
+       * in the change stream partition with timestamp <= heartbeat timestamp.
+       * The heartbeat timestamp will not be the same as the timestamps of other
+       * record types in the same partition.
+       * 
+ * + * .google.protobuf.Timestamp timestamp = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getTimestampFieldBuilder() { + if (timestampBuilder_ == null) { + timestampBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getTimestamp(), getParentForChildren(), isClean()); + timestamp_ = null; + } + return timestampBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.spanner.v1.ChangeStreamRecord.HeartbeatRecord) + } + + // @@protoc_insertion_point(class_scope:google.spanner.v1.ChangeStreamRecord.HeartbeatRecord) + private static final com.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord(); + } + + public static com.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public HeartbeatRecord 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 com.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface PartitionStartRecordOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.spanner.v1.ChangeStreamRecord.PartitionStartRecord) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Start timestamp at which the partitions should be queried to return
+     * change stream records with timestamps >= start_timestamp.
+     * DataChangeRecord.commit_timestamps,
+     * PartitionStartRecord.start_timestamps,
+     * PartitionEventRecord.commit_timestamps, and
+     * PartitionEndRecord.end_timestamps can have the same value in the same
+     * partition.
+     * 
+ * + * .google.protobuf.Timestamp start_timestamp = 1; + * + * @return Whether the startTimestamp field is set. + */ + boolean hasStartTimestamp(); + + /** + * + * + *
+     * Start timestamp at which the partitions should be queried to return
+     * change stream records with timestamps >= start_timestamp.
+     * DataChangeRecord.commit_timestamps,
+     * PartitionStartRecord.start_timestamps,
+     * PartitionEventRecord.commit_timestamps, and
+     * PartitionEndRecord.end_timestamps can have the same value in the same
+     * partition.
+     * 
+ * + * .google.protobuf.Timestamp start_timestamp = 1; + * + * @return The startTimestamp. + */ + com.google.protobuf.Timestamp getStartTimestamp(); + + /** + * + * + *
+     * Start timestamp at which the partitions should be queried to return
+     * change stream records with timestamps >= start_timestamp.
+     * DataChangeRecord.commit_timestamps,
+     * PartitionStartRecord.start_timestamps,
+     * PartitionEventRecord.commit_timestamps, and
+     * PartitionEndRecord.end_timestamps can have the same value in the same
+     * partition.
+     * 
+ * + * .google.protobuf.Timestamp start_timestamp = 1; + */ + com.google.protobuf.TimestampOrBuilder getStartTimestampOrBuilder(); + + /** + * + * + *
+     * Record sequence numbers are unique and monotonically increasing (but not
+     * necessarily contiguous) for a specific timestamp across record
+     * types in the same partition. To guarantee ordered processing, the reader
+     * should process records (of potentially different types) in
+     * record_sequence order for a specific timestamp in the same partition.
+     * 
+ * + * string record_sequence = 2; + * + * @return The recordSequence. + */ + java.lang.String getRecordSequence(); + + /** + * + * + *
+     * Record sequence numbers are unique and monotonically increasing (but not
+     * necessarily contiguous) for a specific timestamp across record
+     * types in the same partition. To guarantee ordered processing, the reader
+     * should process records (of potentially different types) in
+     * record_sequence order for a specific timestamp in the same partition.
+     * 
+ * + * string record_sequence = 2; + * + * @return The bytes for recordSequence. + */ + com.google.protobuf.ByteString getRecordSequenceBytes(); + + /** + * + * + *
+     * Unique partition identifiers to be used in queries.
+     * 
+ * + * repeated string partition_tokens = 3; + * + * @return A list containing the partitionTokens. + */ + java.util.List getPartitionTokensList(); + + /** + * + * + *
+     * Unique partition identifiers to be used in queries.
+     * 
+ * + * repeated string partition_tokens = 3; + * + * @return The count of partitionTokens. + */ + int getPartitionTokensCount(); + + /** + * + * + *
+     * Unique partition identifiers to be used in queries.
+     * 
+ * + * repeated string partition_tokens = 3; + * + * @param index The index of the element to return. + * @return The partitionTokens at the given index. + */ + java.lang.String getPartitionTokens(int index); + + /** + * + * + *
+     * Unique partition identifiers to be used in queries.
+     * 
+ * + * repeated string partition_tokens = 3; + * + * @param index The index of the value to return. + * @return The bytes of the partitionTokens at the given index. + */ + com.google.protobuf.ByteString getPartitionTokensBytes(int index); + } + + /** + * + * + *
+   * A partition start record serves as a notification that the client should
+   * schedule the partitions to be queried. PartitionStartRecord returns
+   * information about one or more partitions.
+   * 
+ * + * Protobuf type {@code google.spanner.v1.ChangeStreamRecord.PartitionStartRecord} + */ + public static final class PartitionStartRecord extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.spanner.v1.ChangeStreamRecord.PartitionStartRecord) + PartitionStartRecordOrBuilder { + private static final long serialVersionUID = 0L; + + // Use PartitionStartRecord.newBuilder() to construct. + private PartitionStartRecord(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PartitionStartRecord() { + recordSequence_ = ""; + partitionTokens_ = com.google.protobuf.LazyStringArrayList.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PartitionStartRecord(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.v1.ChangeStreamProto + .internal_static_google_spanner_v1_ChangeStreamRecord_PartitionStartRecord_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.v1.ChangeStreamProto + .internal_static_google_spanner_v1_ChangeStreamRecord_PartitionStartRecord_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord.class, + com.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord.Builder.class); + } + + private int bitField0_; + public static final int START_TIMESTAMP_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp startTimestamp_; + + /** + * + * + *
+     * Start timestamp at which the partitions should be queried to return
+     * change stream records with timestamps >= start_timestamp.
+     * DataChangeRecord.commit_timestamps,
+     * PartitionStartRecord.start_timestamps,
+     * PartitionEventRecord.commit_timestamps, and
+     * PartitionEndRecord.end_timestamps can have the same value in the same
+     * partition.
+     * 
+ * + * .google.protobuf.Timestamp start_timestamp = 1; + * + * @return Whether the startTimestamp field is set. + */ + @java.lang.Override + public boolean hasStartTimestamp() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Start timestamp at which the partitions should be queried to return
+     * change stream records with timestamps >= start_timestamp.
+     * DataChangeRecord.commit_timestamps,
+     * PartitionStartRecord.start_timestamps,
+     * PartitionEventRecord.commit_timestamps, and
+     * PartitionEndRecord.end_timestamps can have the same value in the same
+     * partition.
+     * 
+ * + * .google.protobuf.Timestamp start_timestamp = 1; + * + * @return The startTimestamp. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getStartTimestamp() { + return startTimestamp_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : startTimestamp_; + } + + /** + * + * + *
+     * Start timestamp at which the partitions should be queried to return
+     * change stream records with timestamps >= start_timestamp.
+     * DataChangeRecord.commit_timestamps,
+     * PartitionStartRecord.start_timestamps,
+     * PartitionEventRecord.commit_timestamps, and
+     * PartitionEndRecord.end_timestamps can have the same value in the same
+     * partition.
+     * 
+ * + * .google.protobuf.Timestamp start_timestamp = 1; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getStartTimestampOrBuilder() { + return startTimestamp_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : startTimestamp_; + } + + public static final int RECORD_SEQUENCE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object recordSequence_ = ""; + + /** + * + * + *
+     * Record sequence numbers are unique and monotonically increasing (but not
+     * necessarily contiguous) for a specific timestamp across record
+     * types in the same partition. To guarantee ordered processing, the reader
+     * should process records (of potentially different types) in
+     * record_sequence order for a specific timestamp in the same partition.
+     * 
+ * + * string record_sequence = 2; + * + * @return The recordSequence. + */ + @java.lang.Override + public java.lang.String getRecordSequence() { + java.lang.Object ref = recordSequence_; + 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(); + recordSequence_ = s; + return s; + } + } + + /** + * + * + *
+     * Record sequence numbers are unique and monotonically increasing (but not
+     * necessarily contiguous) for a specific timestamp across record
+     * types in the same partition. To guarantee ordered processing, the reader
+     * should process records (of potentially different types) in
+     * record_sequence order for a specific timestamp in the same partition.
+     * 
+ * + * string record_sequence = 2; + * + * @return The bytes for recordSequence. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRecordSequenceBytes() { + java.lang.Object ref = recordSequence_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + recordSequence_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PARTITION_TOKENS_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList partitionTokens_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + /** + * + * + *
+     * Unique partition identifiers to be used in queries.
+     * 
+ * + * repeated string partition_tokens = 3; + * + * @return A list containing the partitionTokens. + */ + public com.google.protobuf.ProtocolStringList getPartitionTokensList() { + return partitionTokens_; + } + + /** + * + * + *
+     * Unique partition identifiers to be used in queries.
+     * 
+ * + * repeated string partition_tokens = 3; + * + * @return The count of partitionTokens. + */ + public int getPartitionTokensCount() { + return partitionTokens_.size(); + } + + /** + * + * + *
+     * Unique partition identifiers to be used in queries.
+     * 
+ * + * repeated string partition_tokens = 3; + * + * @param index The index of the element to return. + * @return The partitionTokens at the given index. + */ + public java.lang.String getPartitionTokens(int index) { + return partitionTokens_.get(index); + } + + /** + * + * + *
+     * Unique partition identifiers to be used in queries.
+     * 
+ * + * repeated string partition_tokens = 3; + * + * @param index The index of the value to return. + * @return The bytes of the partitionTokens at the given index. + */ + public com.google.protobuf.ByteString getPartitionTokensBytes(int index) { + return partitionTokens_.getByteString(index); + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getStartTimestamp()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(recordSequence_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, recordSequence_); + } + for (int i = 0; i < partitionTokens_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, partitionTokens_.getRaw(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getStartTimestamp()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(recordSequence_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, recordSequence_); + } + { + int dataSize = 0; + for (int i = 0; i < partitionTokens_.size(); i++) { + dataSize += computeStringSizeNoTag(partitionTokens_.getRaw(i)); + } + size += dataSize; + size += 1 * getPartitionTokensList().size(); + } + 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 com.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord)) { + return super.equals(obj); + } + com.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord other = + (com.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord) obj; + + if (hasStartTimestamp() != other.hasStartTimestamp()) return false; + if (hasStartTimestamp()) { + if (!getStartTimestamp().equals(other.getStartTimestamp())) return false; + } + if (!getRecordSequence().equals(other.getRecordSequence())) return false; + if (!getPartitionTokensList().equals(other.getPartitionTokensList())) 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(); + if (hasStartTimestamp()) { + hash = (37 * hash) + START_TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + getStartTimestamp().hashCode(); + } + hash = (37 * hash) + RECORD_SEQUENCE_FIELD_NUMBER; + hash = (53 * hash) + getRecordSequence().hashCode(); + if (getPartitionTokensCount() > 0) { + hash = (37 * hash) + PARTITION_TOKENS_FIELD_NUMBER; + hash = (53 * hash) + getPartitionTokensList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord 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.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * A partition start record serves as a notification that the client should
+     * schedule the partitions to be queried. PartitionStartRecord returns
+     * information about one or more partitions.
+     * 
+ * + * Protobuf type {@code google.spanner.v1.ChangeStreamRecord.PartitionStartRecord} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.spanner.v1.ChangeStreamRecord.PartitionStartRecord) + com.google.spanner.v1.ChangeStreamRecord.PartitionStartRecordOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.v1.ChangeStreamProto + .internal_static_google_spanner_v1_ChangeStreamRecord_PartitionStartRecord_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.v1.ChangeStreamProto + .internal_static_google_spanner_v1_ChangeStreamRecord_PartitionStartRecord_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord.class, + com.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord.Builder.class); + } + + // Construct using com.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getStartTimestampFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + startTimestamp_ = null; + if (startTimestampBuilder_ != null) { + startTimestampBuilder_.dispose(); + startTimestampBuilder_ = null; + } + recordSequence_ = ""; + partitionTokens_ = com.google.protobuf.LazyStringArrayList.emptyList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.spanner.v1.ChangeStreamProto + .internal_static_google_spanner_v1_ChangeStreamRecord_PartitionStartRecord_descriptor; + } + + @java.lang.Override + public com.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord + getDefaultInstanceForType() { + return com.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord.getDefaultInstance(); + } + + @java.lang.Override + public com.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord build() { + com.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord buildPartial() { + com.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord result = + new com.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.startTimestamp_ = + startTimestampBuilder_ == null ? startTimestamp_ : startTimestampBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.recordSequence_ = recordSequence_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + partitionTokens_.makeImmutable(); + result.partitionTokens_ = partitionTokens_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord) { + return mergeFrom((com.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord other) { + if (other + == com.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord.getDefaultInstance()) + return this; + if (other.hasStartTimestamp()) { + mergeStartTimestamp(other.getStartTimestamp()); + } + if (!other.getRecordSequence().isEmpty()) { + recordSequence_ = other.recordSequence_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.partitionTokens_.isEmpty()) { + if (partitionTokens_.isEmpty()) { + partitionTokens_ = other.partitionTokens_; + bitField0_ |= 0x00000004; + } else { + ensurePartitionTokensIsMutable(); + partitionTokens_.addAll(other.partitionTokens_); + } + onChanged(); + } + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + getStartTimestampFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + recordSequence_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + ensurePartitionTokensIsMutable(); + partitionTokens_.add(s); + break; + } // case 26 + 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.Timestamp startTimestamp_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + startTimestampBuilder_; + + /** + * + * + *
+       * Start timestamp at which the partitions should be queried to return
+       * change stream records with timestamps >= start_timestamp.
+       * DataChangeRecord.commit_timestamps,
+       * PartitionStartRecord.start_timestamps,
+       * PartitionEventRecord.commit_timestamps, and
+       * PartitionEndRecord.end_timestamps can have the same value in the same
+       * partition.
+       * 
+ * + * .google.protobuf.Timestamp start_timestamp = 1; + * + * @return Whether the startTimestamp field is set. + */ + public boolean hasStartTimestamp() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+       * Start timestamp at which the partitions should be queried to return
+       * change stream records with timestamps >= start_timestamp.
+       * DataChangeRecord.commit_timestamps,
+       * PartitionStartRecord.start_timestamps,
+       * PartitionEventRecord.commit_timestamps, and
+       * PartitionEndRecord.end_timestamps can have the same value in the same
+       * partition.
+       * 
+ * + * .google.protobuf.Timestamp start_timestamp = 1; + * + * @return The startTimestamp. + */ + public com.google.protobuf.Timestamp getStartTimestamp() { + if (startTimestampBuilder_ == null) { + return startTimestamp_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : startTimestamp_; + } else { + return startTimestampBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * Start timestamp at which the partitions should be queried to return
+       * change stream records with timestamps >= start_timestamp.
+       * DataChangeRecord.commit_timestamps,
+       * PartitionStartRecord.start_timestamps,
+       * PartitionEventRecord.commit_timestamps, and
+       * PartitionEndRecord.end_timestamps can have the same value in the same
+       * partition.
+       * 
+ * + * .google.protobuf.Timestamp start_timestamp = 1; + */ + public Builder setStartTimestamp(com.google.protobuf.Timestamp value) { + if (startTimestampBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + startTimestamp_ = value; + } else { + startTimestampBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * Start timestamp at which the partitions should be queried to return
+       * change stream records with timestamps >= start_timestamp.
+       * DataChangeRecord.commit_timestamps,
+       * PartitionStartRecord.start_timestamps,
+       * PartitionEventRecord.commit_timestamps, and
+       * PartitionEndRecord.end_timestamps can have the same value in the same
+       * partition.
+       * 
+ * + * .google.protobuf.Timestamp start_timestamp = 1; + */ + public Builder setStartTimestamp(com.google.protobuf.Timestamp.Builder builderForValue) { + if (startTimestampBuilder_ == null) { + startTimestamp_ = builderForValue.build(); + } else { + startTimestampBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * Start timestamp at which the partitions should be queried to return
+       * change stream records with timestamps >= start_timestamp.
+       * DataChangeRecord.commit_timestamps,
+       * PartitionStartRecord.start_timestamps,
+       * PartitionEventRecord.commit_timestamps, and
+       * PartitionEndRecord.end_timestamps can have the same value in the same
+       * partition.
+       * 
+ * + * .google.protobuf.Timestamp start_timestamp = 1; + */ + public Builder mergeStartTimestamp(com.google.protobuf.Timestamp value) { + if (startTimestampBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && startTimestamp_ != null + && startTimestamp_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getStartTimestampBuilder().mergeFrom(value); + } else { + startTimestamp_ = value; + } + } else { + startTimestampBuilder_.mergeFrom(value); + } + if (startTimestamp_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * Start timestamp at which the partitions should be queried to return
+       * change stream records with timestamps >= start_timestamp.
+       * DataChangeRecord.commit_timestamps,
+       * PartitionStartRecord.start_timestamps,
+       * PartitionEventRecord.commit_timestamps, and
+       * PartitionEndRecord.end_timestamps can have the same value in the same
+       * partition.
+       * 
+ * + * .google.protobuf.Timestamp start_timestamp = 1; + */ + public Builder clearStartTimestamp() { + bitField0_ = (bitField0_ & ~0x00000001); + startTimestamp_ = null; + if (startTimestampBuilder_ != null) { + startTimestampBuilder_.dispose(); + startTimestampBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * Start timestamp at which the partitions should be queried to return
+       * change stream records with timestamps >= start_timestamp.
+       * DataChangeRecord.commit_timestamps,
+       * PartitionStartRecord.start_timestamps,
+       * PartitionEventRecord.commit_timestamps, and
+       * PartitionEndRecord.end_timestamps can have the same value in the same
+       * partition.
+       * 
+ * + * .google.protobuf.Timestamp start_timestamp = 1; + */ + public com.google.protobuf.Timestamp.Builder getStartTimestampBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getStartTimestampFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * Start timestamp at which the partitions should be queried to return
+       * change stream records with timestamps >= start_timestamp.
+       * DataChangeRecord.commit_timestamps,
+       * PartitionStartRecord.start_timestamps,
+       * PartitionEventRecord.commit_timestamps, and
+       * PartitionEndRecord.end_timestamps can have the same value in the same
+       * partition.
+       * 
+ * + * .google.protobuf.Timestamp start_timestamp = 1; + */ + public com.google.protobuf.TimestampOrBuilder getStartTimestampOrBuilder() { + if (startTimestampBuilder_ != null) { + return startTimestampBuilder_.getMessageOrBuilder(); + } else { + return startTimestamp_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : startTimestamp_; + } + } + + /** + * + * + *
+       * Start timestamp at which the partitions should be queried to return
+       * change stream records with timestamps >= start_timestamp.
+       * DataChangeRecord.commit_timestamps,
+       * PartitionStartRecord.start_timestamps,
+       * PartitionEventRecord.commit_timestamps, and
+       * PartitionEndRecord.end_timestamps can have the same value in the same
+       * partition.
+       * 
+ * + * .google.protobuf.Timestamp start_timestamp = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getStartTimestampFieldBuilder() { + if (startTimestampBuilder_ == null) { + startTimestampBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getStartTimestamp(), getParentForChildren(), isClean()); + startTimestamp_ = null; + } + return startTimestampBuilder_; + } + + private java.lang.Object recordSequence_ = ""; + + /** + * + * + *
+       * Record sequence numbers are unique and monotonically increasing (but not
+       * necessarily contiguous) for a specific timestamp across record
+       * types in the same partition. To guarantee ordered processing, the reader
+       * should process records (of potentially different types) in
+       * record_sequence order for a specific timestamp in the same partition.
+       * 
+ * + * string record_sequence = 2; + * + * @return The recordSequence. + */ + public java.lang.String getRecordSequence() { + java.lang.Object ref = recordSequence_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + recordSequence_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * Record sequence numbers are unique and monotonically increasing (but not
+       * necessarily contiguous) for a specific timestamp across record
+       * types in the same partition. To guarantee ordered processing, the reader
+       * should process records (of potentially different types) in
+       * record_sequence order for a specific timestamp in the same partition.
+       * 
+ * + * string record_sequence = 2; + * + * @return The bytes for recordSequence. + */ + public com.google.protobuf.ByteString getRecordSequenceBytes() { + java.lang.Object ref = recordSequence_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + recordSequence_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * Record sequence numbers are unique and monotonically increasing (but not
+       * necessarily contiguous) for a specific timestamp across record
+       * types in the same partition. To guarantee ordered processing, the reader
+       * should process records (of potentially different types) in
+       * record_sequence order for a specific timestamp in the same partition.
+       * 
+ * + * string record_sequence = 2; + * + * @param value The recordSequence to set. + * @return This builder for chaining. + */ + public Builder setRecordSequence(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + recordSequence_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * Record sequence numbers are unique and monotonically increasing (but not
+       * necessarily contiguous) for a specific timestamp across record
+       * types in the same partition. To guarantee ordered processing, the reader
+       * should process records (of potentially different types) in
+       * record_sequence order for a specific timestamp in the same partition.
+       * 
+ * + * string record_sequence = 2; + * + * @return This builder for chaining. + */ + public Builder clearRecordSequence() { + recordSequence_ = getDefaultInstance().getRecordSequence(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+       * Record sequence numbers are unique and monotonically increasing (but not
+       * necessarily contiguous) for a specific timestamp across record
+       * types in the same partition. To guarantee ordered processing, the reader
+       * should process records (of potentially different types) in
+       * record_sequence order for a specific timestamp in the same partition.
+       * 
+ * + * string record_sequence = 2; + * + * @param value The bytes for recordSequence to set. + * @return This builder for chaining. + */ + public Builder setRecordSequenceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + recordSequence_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList partitionTokens_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensurePartitionTokensIsMutable() { + if (!partitionTokens_.isModifiable()) { + partitionTokens_ = new com.google.protobuf.LazyStringArrayList(partitionTokens_); + } + bitField0_ |= 0x00000004; + } + + /** + * + * + *
+       * Unique partition identifiers to be used in queries.
+       * 
+ * + * repeated string partition_tokens = 3; + * + * @return A list containing the partitionTokens. + */ + public com.google.protobuf.ProtocolStringList getPartitionTokensList() { + partitionTokens_.makeImmutable(); + return partitionTokens_; + } + + /** + * + * + *
+       * Unique partition identifiers to be used in queries.
+       * 
+ * + * repeated string partition_tokens = 3; + * + * @return The count of partitionTokens. + */ + public int getPartitionTokensCount() { + return partitionTokens_.size(); + } + + /** + * + * + *
+       * Unique partition identifiers to be used in queries.
+       * 
+ * + * repeated string partition_tokens = 3; + * + * @param index The index of the element to return. + * @return The partitionTokens at the given index. + */ + public java.lang.String getPartitionTokens(int index) { + return partitionTokens_.get(index); + } + + /** + * + * + *
+       * Unique partition identifiers to be used in queries.
+       * 
+ * + * repeated string partition_tokens = 3; + * + * @param index The index of the value to return. + * @return The bytes of the partitionTokens at the given index. + */ + public com.google.protobuf.ByteString getPartitionTokensBytes(int index) { + return partitionTokens_.getByteString(index); + } + + /** + * + * + *
+       * Unique partition identifiers to be used in queries.
+       * 
+ * + * repeated string partition_tokens = 3; + * + * @param index The index to set the value at. + * @param value The partitionTokens to set. + * @return This builder for chaining. + */ + public Builder setPartitionTokens(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePartitionTokensIsMutable(); + partitionTokens_.set(index, value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+       * Unique partition identifiers to be used in queries.
+       * 
+ * + * repeated string partition_tokens = 3; + * + * @param value The partitionTokens to add. + * @return This builder for chaining. + */ + public Builder addPartitionTokens(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePartitionTokensIsMutable(); + partitionTokens_.add(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+       * Unique partition identifiers to be used in queries.
+       * 
+ * + * repeated string partition_tokens = 3; + * + * @param values The partitionTokens to add. + * @return This builder for chaining. + */ + public Builder addAllPartitionTokens(java.lang.Iterable values) { + ensurePartitionTokensIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, partitionTokens_); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+       * Unique partition identifiers to be used in queries.
+       * 
+ * + * repeated string partition_tokens = 3; + * + * @return This builder for chaining. + */ + public Builder clearPartitionTokens() { + partitionTokens_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + ; + onChanged(); + return this; + } + + /** + * + * + *
+       * Unique partition identifiers to be used in queries.
+       * 
+ * + * repeated string partition_tokens = 3; + * + * @param value The bytes of the partitionTokens to add. + * @return This builder for chaining. + */ + public Builder addPartitionTokensBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensurePartitionTokensIsMutable(); + partitionTokens_.add(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.spanner.v1.ChangeStreamRecord.PartitionStartRecord) + } + + // @@protoc_insertion_point(class_scope:google.spanner.v1.ChangeStreamRecord.PartitionStartRecord) + private static final com.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord(); + } + + public static com.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PartitionStartRecord 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 com.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface PartitionEndRecordOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.spanner.v1.ChangeStreamRecord.PartitionEndRecord) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * End timestamp at which the change stream partition is terminated. All
+     * changes generated by this partition will have timestamps <=
+     * end_timestamp. DataChangeRecord.commit_timestamps,
+     * PartitionStartRecord.start_timestamps,
+     * PartitionEventRecord.commit_timestamps, and
+     * PartitionEndRecord.end_timestamps can have the same value in the same
+     * partition. PartitionEndRecord is the last record returned for a
+     * partition.
+     * 
+ * + * .google.protobuf.Timestamp end_timestamp = 1; + * + * @return Whether the endTimestamp field is set. + */ + boolean hasEndTimestamp(); + + /** + * + * + *
+     * End timestamp at which the change stream partition is terminated. All
+     * changes generated by this partition will have timestamps <=
+     * end_timestamp. DataChangeRecord.commit_timestamps,
+     * PartitionStartRecord.start_timestamps,
+     * PartitionEventRecord.commit_timestamps, and
+     * PartitionEndRecord.end_timestamps can have the same value in the same
+     * partition. PartitionEndRecord is the last record returned for a
+     * partition.
+     * 
+ * + * .google.protobuf.Timestamp end_timestamp = 1; + * + * @return The endTimestamp. + */ + com.google.protobuf.Timestamp getEndTimestamp(); + + /** + * + * + *
+     * End timestamp at which the change stream partition is terminated. All
+     * changes generated by this partition will have timestamps <=
+     * end_timestamp. DataChangeRecord.commit_timestamps,
+     * PartitionStartRecord.start_timestamps,
+     * PartitionEventRecord.commit_timestamps, and
+     * PartitionEndRecord.end_timestamps can have the same value in the same
+     * partition. PartitionEndRecord is the last record returned for a
+     * partition.
+     * 
+ * + * .google.protobuf.Timestamp end_timestamp = 1; + */ + com.google.protobuf.TimestampOrBuilder getEndTimestampOrBuilder(); + + /** + * + * + *
+     * Record sequence numbers are unique and monotonically increasing (but not
+     * necessarily contiguous) for a specific timestamp across record
+     * types in the same partition. To guarantee ordered processing, the reader
+     * should process records (of potentially different types) in
+     * record_sequence order for a specific timestamp in the same partition.
+     * 
+ * + * string record_sequence = 2; + * + * @return The recordSequence. + */ + java.lang.String getRecordSequence(); + + /** + * + * + *
+     * Record sequence numbers are unique and monotonically increasing (but not
+     * necessarily contiguous) for a specific timestamp across record
+     * types in the same partition. To guarantee ordered processing, the reader
+     * should process records (of potentially different types) in
+     * record_sequence order for a specific timestamp in the same partition.
+     * 
+ * + * string record_sequence = 2; + * + * @return The bytes for recordSequence. + */ + com.google.protobuf.ByteString getRecordSequenceBytes(); + + /** + * + * + *
+     * Unique partition identifier describing the terminated change stream
+     * partition.
+     * [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEndRecord.partition_token]
+     * is equal to the partition token of the change stream partition currently
+     * queried to return this PartitionEndRecord.
+     * 
+ * + * string partition_token = 3; + * + * @return The partitionToken. + */ + java.lang.String getPartitionToken(); + + /** + * + * + *
+     * Unique partition identifier describing the terminated change stream
+     * partition.
+     * [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEndRecord.partition_token]
+     * is equal to the partition token of the change stream partition currently
+     * queried to return this PartitionEndRecord.
+     * 
+ * + * string partition_token = 3; + * + * @return The bytes for partitionToken. + */ + com.google.protobuf.ByteString getPartitionTokenBytes(); + } + + /** + * + * + *
+   * A partition end record serves as a notification that the client should stop
+   * reading the partition. No further records are expected to be retrieved on
+   * it.
+   * 
+ * + * Protobuf type {@code google.spanner.v1.ChangeStreamRecord.PartitionEndRecord} + */ + public static final class PartitionEndRecord extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.spanner.v1.ChangeStreamRecord.PartitionEndRecord) + PartitionEndRecordOrBuilder { + private static final long serialVersionUID = 0L; + + // Use PartitionEndRecord.newBuilder() to construct. + private PartitionEndRecord(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PartitionEndRecord() { + recordSequence_ = ""; + partitionToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PartitionEndRecord(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.v1.ChangeStreamProto + .internal_static_google_spanner_v1_ChangeStreamRecord_PartitionEndRecord_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.v1.ChangeStreamProto + .internal_static_google_spanner_v1_ChangeStreamRecord_PartitionEndRecord_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord.class, + com.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord.Builder.class); + } + + private int bitField0_; + public static final int END_TIMESTAMP_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp endTimestamp_; + + /** + * + * + *
+     * End timestamp at which the change stream partition is terminated. All
+     * changes generated by this partition will have timestamps <=
+     * end_timestamp. DataChangeRecord.commit_timestamps,
+     * PartitionStartRecord.start_timestamps,
+     * PartitionEventRecord.commit_timestamps, and
+     * PartitionEndRecord.end_timestamps can have the same value in the same
+     * partition. PartitionEndRecord is the last record returned for a
+     * partition.
+     * 
+ * + * .google.protobuf.Timestamp end_timestamp = 1; + * + * @return Whether the endTimestamp field is set. + */ + @java.lang.Override + public boolean hasEndTimestamp() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * End timestamp at which the change stream partition is terminated. All
+     * changes generated by this partition will have timestamps <=
+     * end_timestamp. DataChangeRecord.commit_timestamps,
+     * PartitionStartRecord.start_timestamps,
+     * PartitionEventRecord.commit_timestamps, and
+     * PartitionEndRecord.end_timestamps can have the same value in the same
+     * partition. PartitionEndRecord is the last record returned for a
+     * partition.
+     * 
+ * + * .google.protobuf.Timestamp end_timestamp = 1; + * + * @return The endTimestamp. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEndTimestamp() { + return endTimestamp_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : endTimestamp_; + } + + /** + * + * + *
+     * End timestamp at which the change stream partition is terminated. All
+     * changes generated by this partition will have timestamps <=
+     * end_timestamp. DataChangeRecord.commit_timestamps,
+     * PartitionStartRecord.start_timestamps,
+     * PartitionEventRecord.commit_timestamps, and
+     * PartitionEndRecord.end_timestamps can have the same value in the same
+     * partition. PartitionEndRecord is the last record returned for a
+     * partition.
+     * 
+ * + * .google.protobuf.Timestamp end_timestamp = 1; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEndTimestampOrBuilder() { + return endTimestamp_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : endTimestamp_; + } + + public static final int RECORD_SEQUENCE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object recordSequence_ = ""; + + /** + * + * + *
+     * Record sequence numbers are unique and monotonically increasing (but not
+     * necessarily contiguous) for a specific timestamp across record
+     * types in the same partition. To guarantee ordered processing, the reader
+     * should process records (of potentially different types) in
+     * record_sequence order for a specific timestamp in the same partition.
+     * 
+ * + * string record_sequence = 2; + * + * @return The recordSequence. + */ + @java.lang.Override + public java.lang.String getRecordSequence() { + java.lang.Object ref = recordSequence_; + 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(); + recordSequence_ = s; + return s; + } + } + + /** + * + * + *
+     * Record sequence numbers are unique and monotonically increasing (but not
+     * necessarily contiguous) for a specific timestamp across record
+     * types in the same partition. To guarantee ordered processing, the reader
+     * should process records (of potentially different types) in
+     * record_sequence order for a specific timestamp in the same partition.
+     * 
+ * + * string record_sequence = 2; + * + * @return The bytes for recordSequence. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRecordSequenceBytes() { + java.lang.Object ref = recordSequence_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + recordSequence_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PARTITION_TOKEN_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object partitionToken_ = ""; + + /** + * + * + *
+     * Unique partition identifier describing the terminated change stream
+     * partition.
+     * [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEndRecord.partition_token]
+     * is equal to the partition token of the change stream partition currently
+     * queried to return this PartitionEndRecord.
+     * 
+ * + * string partition_token = 3; + * + * @return The partitionToken. + */ + @java.lang.Override + public java.lang.String getPartitionToken() { + java.lang.Object ref = partitionToken_; + 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(); + partitionToken_ = s; + return s; + } + } + + /** + * + * + *
+     * Unique partition identifier describing the terminated change stream
+     * partition.
+     * [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEndRecord.partition_token]
+     * is equal to the partition token of the change stream partition currently
+     * queried to return this PartitionEndRecord.
+     * 
+ * + * string partition_token = 3; + * + * @return The bytes for partitionToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPartitionTokenBytes() { + java.lang.Object ref = partitionToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + partitionToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getEndTimestamp()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(recordSequence_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, recordSequence_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(partitionToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, partitionToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getEndTimestamp()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(recordSequence_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, recordSequence_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(partitionToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, partitionToken_); + } + 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 com.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord)) { + return super.equals(obj); + } + com.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord other = + (com.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord) obj; + + if (hasEndTimestamp() != other.hasEndTimestamp()) return false; + if (hasEndTimestamp()) { + if (!getEndTimestamp().equals(other.getEndTimestamp())) return false; + } + if (!getRecordSequence().equals(other.getRecordSequence())) return false; + if (!getPartitionToken().equals(other.getPartitionToken())) 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(); + if (hasEndTimestamp()) { + hash = (37 * hash) + END_TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + getEndTimestamp().hashCode(); + } + hash = (37 * hash) + RECORD_SEQUENCE_FIELD_NUMBER; + hash = (53 * hash) + getRecordSequence().hashCode(); + hash = (37 * hash) + PARTITION_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPartitionToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord 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.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * A partition end record serves as a notification that the client should stop
+     * reading the partition. No further records are expected to be retrieved on
+     * it.
+     * 
+ * + * Protobuf type {@code google.spanner.v1.ChangeStreamRecord.PartitionEndRecord} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.spanner.v1.ChangeStreamRecord.PartitionEndRecord) + com.google.spanner.v1.ChangeStreamRecord.PartitionEndRecordOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.v1.ChangeStreamProto + .internal_static_google_spanner_v1_ChangeStreamRecord_PartitionEndRecord_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.v1.ChangeStreamProto + .internal_static_google_spanner_v1_ChangeStreamRecord_PartitionEndRecord_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord.class, + com.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord.Builder.class); + } + + // Construct using com.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getEndTimestampFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + endTimestamp_ = null; + if (endTimestampBuilder_ != null) { + endTimestampBuilder_.dispose(); + endTimestampBuilder_ = null; + } + recordSequence_ = ""; + partitionToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.spanner.v1.ChangeStreamProto + .internal_static_google_spanner_v1_ChangeStreamRecord_PartitionEndRecord_descriptor; + } + + @java.lang.Override + public com.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord + getDefaultInstanceForType() { + return com.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord.getDefaultInstance(); + } + + @java.lang.Override + public com.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord build() { + com.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord buildPartial() { + com.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord result = + new com.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.endTimestamp_ = + endTimestampBuilder_ == null ? endTimestamp_ : endTimestampBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.recordSequence_ = recordSequence_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.partitionToken_ = partitionToken_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord) { + return mergeFrom((com.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord other) { + if (other + == com.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord.getDefaultInstance()) + return this; + if (other.hasEndTimestamp()) { + mergeEndTimestamp(other.getEndTimestamp()); + } + if (!other.getRecordSequence().isEmpty()) { + recordSequence_ = other.recordSequence_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getPartitionToken().isEmpty()) { + partitionToken_ = other.partitionToken_; + bitField0_ |= 0x00000004; + onChanged(); + } + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getEndTimestampFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + recordSequence_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + partitionToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + 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.Timestamp endTimestamp_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + endTimestampBuilder_; + + /** + * + * + *
+       * End timestamp at which the change stream partition is terminated. All
+       * changes generated by this partition will have timestamps <=
+       * end_timestamp. DataChangeRecord.commit_timestamps,
+       * PartitionStartRecord.start_timestamps,
+       * PartitionEventRecord.commit_timestamps, and
+       * PartitionEndRecord.end_timestamps can have the same value in the same
+       * partition. PartitionEndRecord is the last record returned for a
+       * partition.
+       * 
+ * + * .google.protobuf.Timestamp end_timestamp = 1; + * + * @return Whether the endTimestamp field is set. + */ + public boolean hasEndTimestamp() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+       * End timestamp at which the change stream partition is terminated. All
+       * changes generated by this partition will have timestamps <=
+       * end_timestamp. DataChangeRecord.commit_timestamps,
+       * PartitionStartRecord.start_timestamps,
+       * PartitionEventRecord.commit_timestamps, and
+       * PartitionEndRecord.end_timestamps can have the same value in the same
+       * partition. PartitionEndRecord is the last record returned for a
+       * partition.
+       * 
+ * + * .google.protobuf.Timestamp end_timestamp = 1; + * + * @return The endTimestamp. + */ + public com.google.protobuf.Timestamp getEndTimestamp() { + if (endTimestampBuilder_ == null) { + return endTimestamp_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : endTimestamp_; + } else { + return endTimestampBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * End timestamp at which the change stream partition is terminated. All
+       * changes generated by this partition will have timestamps <=
+       * end_timestamp. DataChangeRecord.commit_timestamps,
+       * PartitionStartRecord.start_timestamps,
+       * PartitionEventRecord.commit_timestamps, and
+       * PartitionEndRecord.end_timestamps can have the same value in the same
+       * partition. PartitionEndRecord is the last record returned for a
+       * partition.
+       * 
+ * + * .google.protobuf.Timestamp end_timestamp = 1; + */ + public Builder setEndTimestamp(com.google.protobuf.Timestamp value) { + if (endTimestampBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endTimestamp_ = value; + } else { + endTimestampBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * End timestamp at which the change stream partition is terminated. All
+       * changes generated by this partition will have timestamps <=
+       * end_timestamp. DataChangeRecord.commit_timestamps,
+       * PartitionStartRecord.start_timestamps,
+       * PartitionEventRecord.commit_timestamps, and
+       * PartitionEndRecord.end_timestamps can have the same value in the same
+       * partition. PartitionEndRecord is the last record returned for a
+       * partition.
+       * 
+ * + * .google.protobuf.Timestamp end_timestamp = 1; + */ + public Builder setEndTimestamp(com.google.protobuf.Timestamp.Builder builderForValue) { + if (endTimestampBuilder_ == null) { + endTimestamp_ = builderForValue.build(); + } else { + endTimestampBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * End timestamp at which the change stream partition is terminated. All
+       * changes generated by this partition will have timestamps <=
+       * end_timestamp. DataChangeRecord.commit_timestamps,
+       * PartitionStartRecord.start_timestamps,
+       * PartitionEventRecord.commit_timestamps, and
+       * PartitionEndRecord.end_timestamps can have the same value in the same
+       * partition. PartitionEndRecord is the last record returned for a
+       * partition.
+       * 
+ * + * .google.protobuf.Timestamp end_timestamp = 1; + */ + public Builder mergeEndTimestamp(com.google.protobuf.Timestamp value) { + if (endTimestampBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && endTimestamp_ != null + && endTimestamp_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getEndTimestampBuilder().mergeFrom(value); + } else { + endTimestamp_ = value; + } + } else { + endTimestampBuilder_.mergeFrom(value); + } + if (endTimestamp_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * End timestamp at which the change stream partition is terminated. All
+       * changes generated by this partition will have timestamps <=
+       * end_timestamp. DataChangeRecord.commit_timestamps,
+       * PartitionStartRecord.start_timestamps,
+       * PartitionEventRecord.commit_timestamps, and
+       * PartitionEndRecord.end_timestamps can have the same value in the same
+       * partition. PartitionEndRecord is the last record returned for a
+       * partition.
+       * 
+ * + * .google.protobuf.Timestamp end_timestamp = 1; + */ + public Builder clearEndTimestamp() { + bitField0_ = (bitField0_ & ~0x00000001); + endTimestamp_ = null; + if (endTimestampBuilder_ != null) { + endTimestampBuilder_.dispose(); + endTimestampBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * End timestamp at which the change stream partition is terminated. All
+       * changes generated by this partition will have timestamps <=
+       * end_timestamp. DataChangeRecord.commit_timestamps,
+       * PartitionStartRecord.start_timestamps,
+       * PartitionEventRecord.commit_timestamps, and
+       * PartitionEndRecord.end_timestamps can have the same value in the same
+       * partition. PartitionEndRecord is the last record returned for a
+       * partition.
+       * 
+ * + * .google.protobuf.Timestamp end_timestamp = 1; + */ + public com.google.protobuf.Timestamp.Builder getEndTimestampBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getEndTimestampFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * End timestamp at which the change stream partition is terminated. All
+       * changes generated by this partition will have timestamps <=
+       * end_timestamp. DataChangeRecord.commit_timestamps,
+       * PartitionStartRecord.start_timestamps,
+       * PartitionEventRecord.commit_timestamps, and
+       * PartitionEndRecord.end_timestamps can have the same value in the same
+       * partition. PartitionEndRecord is the last record returned for a
+       * partition.
+       * 
+ * + * .google.protobuf.Timestamp end_timestamp = 1; + */ + public com.google.protobuf.TimestampOrBuilder getEndTimestampOrBuilder() { + if (endTimestampBuilder_ != null) { + return endTimestampBuilder_.getMessageOrBuilder(); + } else { + return endTimestamp_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : endTimestamp_; + } + } + + /** + * + * + *
+       * End timestamp at which the change stream partition is terminated. All
+       * changes generated by this partition will have timestamps <=
+       * end_timestamp. DataChangeRecord.commit_timestamps,
+       * PartitionStartRecord.start_timestamps,
+       * PartitionEventRecord.commit_timestamps, and
+       * PartitionEndRecord.end_timestamps can have the same value in the same
+       * partition. PartitionEndRecord is the last record returned for a
+       * partition.
+       * 
+ * + * .google.protobuf.Timestamp end_timestamp = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getEndTimestampFieldBuilder() { + if (endTimestampBuilder_ == null) { + endTimestampBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEndTimestamp(), getParentForChildren(), isClean()); + endTimestamp_ = null; + } + return endTimestampBuilder_; + } + + private java.lang.Object recordSequence_ = ""; + + /** + * + * + *
+       * Record sequence numbers are unique and monotonically increasing (but not
+       * necessarily contiguous) for a specific timestamp across record
+       * types in the same partition. To guarantee ordered processing, the reader
+       * should process records (of potentially different types) in
+       * record_sequence order for a specific timestamp in the same partition.
+       * 
+ * + * string record_sequence = 2; + * + * @return The recordSequence. + */ + public java.lang.String getRecordSequence() { + java.lang.Object ref = recordSequence_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + recordSequence_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * Record sequence numbers are unique and monotonically increasing (but not
+       * necessarily contiguous) for a specific timestamp across record
+       * types in the same partition. To guarantee ordered processing, the reader
+       * should process records (of potentially different types) in
+       * record_sequence order for a specific timestamp in the same partition.
+       * 
+ * + * string record_sequence = 2; + * + * @return The bytes for recordSequence. + */ + public com.google.protobuf.ByteString getRecordSequenceBytes() { + java.lang.Object ref = recordSequence_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + recordSequence_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * Record sequence numbers are unique and monotonically increasing (but not
+       * necessarily contiguous) for a specific timestamp across record
+       * types in the same partition. To guarantee ordered processing, the reader
+       * should process records (of potentially different types) in
+       * record_sequence order for a specific timestamp in the same partition.
+       * 
+ * + * string record_sequence = 2; + * + * @param value The recordSequence to set. + * @return This builder for chaining. + */ + public Builder setRecordSequence(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + recordSequence_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * Record sequence numbers are unique and monotonically increasing (but not
+       * necessarily contiguous) for a specific timestamp across record
+       * types in the same partition. To guarantee ordered processing, the reader
+       * should process records (of potentially different types) in
+       * record_sequence order for a specific timestamp in the same partition.
+       * 
+ * + * string record_sequence = 2; + * + * @return This builder for chaining. + */ + public Builder clearRecordSequence() { + recordSequence_ = getDefaultInstance().getRecordSequence(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+       * Record sequence numbers are unique and monotonically increasing (but not
+       * necessarily contiguous) for a specific timestamp across record
+       * types in the same partition. To guarantee ordered processing, the reader
+       * should process records (of potentially different types) in
+       * record_sequence order for a specific timestamp in the same partition.
+       * 
+ * + * string record_sequence = 2; + * + * @param value The bytes for recordSequence to set. + * @return This builder for chaining. + */ + public Builder setRecordSequenceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + recordSequence_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object partitionToken_ = ""; + + /** + * + * + *
+       * Unique partition identifier describing the terminated change stream
+       * partition.
+       * [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEndRecord.partition_token]
+       * is equal to the partition token of the change stream partition currently
+       * queried to return this PartitionEndRecord.
+       * 
+ * + * string partition_token = 3; + * + * @return The partitionToken. + */ + public java.lang.String getPartitionToken() { + java.lang.Object ref = partitionToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + partitionToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * Unique partition identifier describing the terminated change stream
+       * partition.
+       * [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEndRecord.partition_token]
+       * is equal to the partition token of the change stream partition currently
+       * queried to return this PartitionEndRecord.
+       * 
+ * + * string partition_token = 3; + * + * @return The bytes for partitionToken. + */ + public com.google.protobuf.ByteString getPartitionTokenBytes() { + java.lang.Object ref = partitionToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + partitionToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * Unique partition identifier describing the terminated change stream
+       * partition.
+       * [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEndRecord.partition_token]
+       * is equal to the partition token of the change stream partition currently
+       * queried to return this PartitionEndRecord.
+       * 
+ * + * string partition_token = 3; + * + * @param value The partitionToken to set. + * @return This builder for chaining. + */ + public Builder setPartitionToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + partitionToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+       * Unique partition identifier describing the terminated change stream
+       * partition.
+       * [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEndRecord.partition_token]
+       * is equal to the partition token of the change stream partition currently
+       * queried to return this PartitionEndRecord.
+       * 
+ * + * string partition_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPartitionToken() { + partitionToken_ = getDefaultInstance().getPartitionToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+       * Unique partition identifier describing the terminated change stream
+       * partition.
+       * [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEndRecord.partition_token]
+       * is equal to the partition token of the change stream partition currently
+       * queried to return this PartitionEndRecord.
+       * 
+ * + * string partition_token = 3; + * + * @param value The bytes for partitionToken to set. + * @return This builder for chaining. + */ + public Builder setPartitionTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + partitionToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.spanner.v1.ChangeStreamRecord.PartitionEndRecord) + } + + // @@protoc_insertion_point(class_scope:google.spanner.v1.ChangeStreamRecord.PartitionEndRecord) + private static final com.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord(); + } + + public static com.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PartitionEndRecord 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 com.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface PartitionEventRecordOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.spanner.v1.ChangeStreamRecord.PartitionEventRecord) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Indicates the commit timestamp at which the key range change occurred.
+     * DataChangeRecord.commit_timestamps,
+     * PartitionStartRecord.start_timestamps,
+     * PartitionEventRecord.commit_timestamps, and
+     * PartitionEndRecord.end_timestamps can have the same value in the same
+     * partition.
+     * 
+ * + * .google.protobuf.Timestamp commit_timestamp = 1; + * + * @return Whether the commitTimestamp field is set. + */ + boolean hasCommitTimestamp(); + + /** + * + * + *
+     * Indicates the commit timestamp at which the key range change occurred.
+     * DataChangeRecord.commit_timestamps,
+     * PartitionStartRecord.start_timestamps,
+     * PartitionEventRecord.commit_timestamps, and
+     * PartitionEndRecord.end_timestamps can have the same value in the same
+     * partition.
+     * 
+ * + * .google.protobuf.Timestamp commit_timestamp = 1; + * + * @return The commitTimestamp. + */ + com.google.protobuf.Timestamp getCommitTimestamp(); + + /** + * + * + *
+     * Indicates the commit timestamp at which the key range change occurred.
+     * DataChangeRecord.commit_timestamps,
+     * PartitionStartRecord.start_timestamps,
+     * PartitionEventRecord.commit_timestamps, and
+     * PartitionEndRecord.end_timestamps can have the same value in the same
+     * partition.
+     * 
+ * + * .google.protobuf.Timestamp commit_timestamp = 1; + */ + com.google.protobuf.TimestampOrBuilder getCommitTimestampOrBuilder(); + + /** + * + * + *
+     * Record sequence numbers are unique and monotonically increasing (but not
+     * necessarily contiguous) for a specific timestamp across record
+     * types in the same partition. To guarantee ordered processing, the reader
+     * should process records (of potentially different types) in
+     * record_sequence order for a specific timestamp in the same partition.
+     * 
+ * + * string record_sequence = 2; + * + * @return The recordSequence. + */ + java.lang.String getRecordSequence(); + + /** + * + * + *
+     * Record sequence numbers are unique and monotonically increasing (but not
+     * necessarily contiguous) for a specific timestamp across record
+     * types in the same partition. To guarantee ordered processing, the reader
+     * should process records (of potentially different types) in
+     * record_sequence order for a specific timestamp in the same partition.
+     * 
+ * + * string record_sequence = 2; + * + * @return The bytes for recordSequence. + */ + com.google.protobuf.ByteString getRecordSequenceBytes(); + + /** + * + * + *
+     * Unique partition identifier describing the partition this event
+     * occurred on.
+     * [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token]
+     * is equal to the partition token of the change stream partition currently
+     * queried to return this PartitionEventRecord.
+     * 
+ * + * string partition_token = 3; + * + * @return The partitionToken. + */ + java.lang.String getPartitionToken(); + + /** + * + * + *
+     * Unique partition identifier describing the partition this event
+     * occurred on.
+     * [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token]
+     * is equal to the partition token of the change stream partition currently
+     * queried to return this PartitionEventRecord.
+     * 
+ * + * string partition_token = 3; + * + * @return The bytes for partitionToken. + */ + com.google.protobuf.ByteString getPartitionTokenBytes(); + + /** + * + * + *
+     * Set when one or more key ranges are moved into the change stream
+     * partition identified by
+     * [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token].
+     *
+     * Example: Two key ranges are moved into partition (P1) from partition (P2)
+     * and partition (P3) in a single transaction at timestamp T.
+     *
+     * The PartitionEventRecord returned in P1 will reflect the move as:
+     *
+     * PartitionEventRecord {
+     *   commit_timestamp: T
+     *   partition_token: "P1"
+     *   move_in_events {
+     *     source_partition_token: "P2"
+     *   }
+     *   move_in_events {
+     *     source_partition_token: "P3"
+     *   }
+     * }
+     *
+     * The PartitionEventRecord returned in P2 will reflect the move as:
+     *
+     * PartitionEventRecord {
+     *   commit_timestamp: T
+     *   partition_token: "P2"
+     *   move_out_events {
+     *     destination_partition_token: "P1"
+     *   }
+     * }
+     *
+     * The PartitionEventRecord returned in P3 will reflect the move as:
+     *
+     * PartitionEventRecord {
+     *   commit_timestamp: T
+     *   partition_token: "P3"
+     *   move_out_events {
+     *     destination_partition_token: "P1"
+     *   }
+     * }
+     * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent move_in_events = 4; + * + */ + java.util.List + getMoveInEventsList(); + + /** + * + * + *
+     * Set when one or more key ranges are moved into the change stream
+     * partition identified by
+     * [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token].
+     *
+     * Example: Two key ranges are moved into partition (P1) from partition (P2)
+     * and partition (P3) in a single transaction at timestamp T.
+     *
+     * The PartitionEventRecord returned in P1 will reflect the move as:
+     *
+     * PartitionEventRecord {
+     *   commit_timestamp: T
+     *   partition_token: "P1"
+     *   move_in_events {
+     *     source_partition_token: "P2"
+     *   }
+     *   move_in_events {
+     *     source_partition_token: "P3"
+     *   }
+     * }
+     *
+     * The PartitionEventRecord returned in P2 will reflect the move as:
+     *
+     * PartitionEventRecord {
+     *   commit_timestamp: T
+     *   partition_token: "P2"
+     *   move_out_events {
+     *     destination_partition_token: "P1"
+     *   }
+     * }
+     *
+     * The PartitionEventRecord returned in P3 will reflect the move as:
+     *
+     * PartitionEventRecord {
+     *   commit_timestamp: T
+     *   partition_token: "P3"
+     *   move_out_events {
+     *     destination_partition_token: "P1"
+     *   }
+     * }
+     * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent move_in_events = 4; + * + */ + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent getMoveInEvents( + int index); + + /** + * + * + *
+     * Set when one or more key ranges are moved into the change stream
+     * partition identified by
+     * [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token].
+     *
+     * Example: Two key ranges are moved into partition (P1) from partition (P2)
+     * and partition (P3) in a single transaction at timestamp T.
+     *
+     * The PartitionEventRecord returned in P1 will reflect the move as:
+     *
+     * PartitionEventRecord {
+     *   commit_timestamp: T
+     *   partition_token: "P1"
+     *   move_in_events {
+     *     source_partition_token: "P2"
+     *   }
+     *   move_in_events {
+     *     source_partition_token: "P3"
+     *   }
+     * }
+     *
+     * The PartitionEventRecord returned in P2 will reflect the move as:
+     *
+     * PartitionEventRecord {
+     *   commit_timestamp: T
+     *   partition_token: "P2"
+     *   move_out_events {
+     *     destination_partition_token: "P1"
+     *   }
+     * }
+     *
+     * The PartitionEventRecord returned in P3 will reflect the move as:
+     *
+     * PartitionEventRecord {
+     *   commit_timestamp: T
+     *   partition_token: "P3"
+     *   move_out_events {
+     *     destination_partition_token: "P1"
+     *   }
+     * }
+     * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent move_in_events = 4; + * + */ + int getMoveInEventsCount(); + + /** + * + * + *
+     * Set when one or more key ranges are moved into the change stream
+     * partition identified by
+     * [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token].
+     *
+     * Example: Two key ranges are moved into partition (P1) from partition (P2)
+     * and partition (P3) in a single transaction at timestamp T.
+     *
+     * The PartitionEventRecord returned in P1 will reflect the move as:
+     *
+     * PartitionEventRecord {
+     *   commit_timestamp: T
+     *   partition_token: "P1"
+     *   move_in_events {
+     *     source_partition_token: "P2"
+     *   }
+     *   move_in_events {
+     *     source_partition_token: "P3"
+     *   }
+     * }
+     *
+     * The PartitionEventRecord returned in P2 will reflect the move as:
+     *
+     * PartitionEventRecord {
+     *   commit_timestamp: T
+     *   partition_token: "P2"
+     *   move_out_events {
+     *     destination_partition_token: "P1"
+     *   }
+     * }
+     *
+     * The PartitionEventRecord returned in P3 will reflect the move as:
+     *
+     * PartitionEventRecord {
+     *   commit_timestamp: T
+     *   partition_token: "P3"
+     *   move_out_events {
+     *     destination_partition_token: "P1"
+     *   }
+     * }
+     * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent move_in_events = 4; + * + */ + java.util.List< + ? extends + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEventOrBuilder> + getMoveInEventsOrBuilderList(); + + /** + * + * + *
+     * Set when one or more key ranges are moved into the change stream
+     * partition identified by
+     * [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token].
+     *
+     * Example: Two key ranges are moved into partition (P1) from partition (P2)
+     * and partition (P3) in a single transaction at timestamp T.
+     *
+     * The PartitionEventRecord returned in P1 will reflect the move as:
+     *
+     * PartitionEventRecord {
+     *   commit_timestamp: T
+     *   partition_token: "P1"
+     *   move_in_events {
+     *     source_partition_token: "P2"
+     *   }
+     *   move_in_events {
+     *     source_partition_token: "P3"
+     *   }
+     * }
+     *
+     * The PartitionEventRecord returned in P2 will reflect the move as:
+     *
+     * PartitionEventRecord {
+     *   commit_timestamp: T
+     *   partition_token: "P2"
+     *   move_out_events {
+     *     destination_partition_token: "P1"
+     *   }
+     * }
+     *
+     * The PartitionEventRecord returned in P3 will reflect the move as:
+     *
+     * PartitionEventRecord {
+     *   commit_timestamp: T
+     *   partition_token: "P3"
+     *   move_out_events {
+     *     destination_partition_token: "P1"
+     *   }
+     * }
+     * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent move_in_events = 4; + * + */ + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEventOrBuilder + getMoveInEventsOrBuilder(int index); + + /** + * + * + *
+     * Set when one or more key ranges are moved out of the change stream
+     * partition identified by
+     * [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token].
+     *
+     * Example: Two key ranges are moved out of partition (P1) to partition (P2)
+     * and partition (P3) in a single transaction at timestamp T.
+     *
+     * The PartitionEventRecord returned in P1 will reflect the move as:
+     *
+     * PartitionEventRecord {
+     *   commit_timestamp: T
+     *   partition_token: "P1"
+     *   move_out_events {
+     *     destination_partition_token: "P2"
+     *   }
+     *   move_out_events {
+     *     destination_partition_token: "P3"
+     *   }
+     * }
+     *
+     * The PartitionEventRecord returned in P2 will reflect the move as:
+     *
+     * PartitionEventRecord {
+     *   commit_timestamp: T
+     *   partition_token: "P2"
+     *   move_in_events {
+     *     source_partition_token: "P1"
+     *   }
+     * }
+     *
+     * The PartitionEventRecord returned in P3 will reflect the move as:
+     *
+     * PartitionEventRecord {
+     *   commit_timestamp: T
+     *   partition_token: "P3"
+     *   move_in_events {
+     *     source_partition_token: "P1"
+     *   }
+     * }
+     * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent move_out_events = 5; + * + */ + java.util.List + getMoveOutEventsList(); + + /** + * + * + *
+     * Set when one or more key ranges are moved out of the change stream
+     * partition identified by
+     * [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token].
+     *
+     * Example: Two key ranges are moved out of partition (P1) to partition (P2)
+     * and partition (P3) in a single transaction at timestamp T.
+     *
+     * The PartitionEventRecord returned in P1 will reflect the move as:
+     *
+     * PartitionEventRecord {
+     *   commit_timestamp: T
+     *   partition_token: "P1"
+     *   move_out_events {
+     *     destination_partition_token: "P2"
+     *   }
+     *   move_out_events {
+     *     destination_partition_token: "P3"
+     *   }
+     * }
+     *
+     * The PartitionEventRecord returned in P2 will reflect the move as:
+     *
+     * PartitionEventRecord {
+     *   commit_timestamp: T
+     *   partition_token: "P2"
+     *   move_in_events {
+     *     source_partition_token: "P1"
+     *   }
+     * }
+     *
+     * The PartitionEventRecord returned in P3 will reflect the move as:
+     *
+     * PartitionEventRecord {
+     *   commit_timestamp: T
+     *   partition_token: "P3"
+     *   move_in_events {
+     *     source_partition_token: "P1"
+     *   }
+     * }
+     * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent move_out_events = 5; + * + */ + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent getMoveOutEvents( + int index); + + /** + * + * + *
+     * Set when one or more key ranges are moved out of the change stream
+     * partition identified by
+     * [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token].
+     *
+     * Example: Two key ranges are moved out of partition (P1) to partition (P2)
+     * and partition (P3) in a single transaction at timestamp T.
+     *
+     * The PartitionEventRecord returned in P1 will reflect the move as:
+     *
+     * PartitionEventRecord {
+     *   commit_timestamp: T
+     *   partition_token: "P1"
+     *   move_out_events {
+     *     destination_partition_token: "P2"
+     *   }
+     *   move_out_events {
+     *     destination_partition_token: "P3"
+     *   }
+     * }
+     *
+     * The PartitionEventRecord returned in P2 will reflect the move as:
+     *
+     * PartitionEventRecord {
+     *   commit_timestamp: T
+     *   partition_token: "P2"
+     *   move_in_events {
+     *     source_partition_token: "P1"
+     *   }
+     * }
+     *
+     * The PartitionEventRecord returned in P3 will reflect the move as:
+     *
+     * PartitionEventRecord {
+     *   commit_timestamp: T
+     *   partition_token: "P3"
+     *   move_in_events {
+     *     source_partition_token: "P1"
+     *   }
+     * }
+     * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent move_out_events = 5; + * + */ + int getMoveOutEventsCount(); + + /** + * + * + *
+     * Set when one or more key ranges are moved out of the change stream
+     * partition identified by
+     * [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token].
+     *
+     * Example: Two key ranges are moved out of partition (P1) to partition (P2)
+     * and partition (P3) in a single transaction at timestamp T.
+     *
+     * The PartitionEventRecord returned in P1 will reflect the move as:
+     *
+     * PartitionEventRecord {
+     *   commit_timestamp: T
+     *   partition_token: "P1"
+     *   move_out_events {
+     *     destination_partition_token: "P2"
+     *   }
+     *   move_out_events {
+     *     destination_partition_token: "P3"
+     *   }
+     * }
+     *
+     * The PartitionEventRecord returned in P2 will reflect the move as:
+     *
+     * PartitionEventRecord {
+     *   commit_timestamp: T
+     *   partition_token: "P2"
+     *   move_in_events {
+     *     source_partition_token: "P1"
+     *   }
+     * }
+     *
+     * The PartitionEventRecord returned in P3 will reflect the move as:
+     *
+     * PartitionEventRecord {
+     *   commit_timestamp: T
+     *   partition_token: "P3"
+     *   move_in_events {
+     *     source_partition_token: "P1"
+     *   }
+     * }
+     * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent move_out_events = 5; + * + */ + java.util.List< + ? extends + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEventOrBuilder> + getMoveOutEventsOrBuilderList(); + + /** + * + * + *
+     * Set when one or more key ranges are moved out of the change stream
+     * partition identified by
+     * [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token].
+     *
+     * Example: Two key ranges are moved out of partition (P1) to partition (P2)
+     * and partition (P3) in a single transaction at timestamp T.
+     *
+     * The PartitionEventRecord returned in P1 will reflect the move as:
+     *
+     * PartitionEventRecord {
+     *   commit_timestamp: T
+     *   partition_token: "P1"
+     *   move_out_events {
+     *     destination_partition_token: "P2"
+     *   }
+     *   move_out_events {
+     *     destination_partition_token: "P3"
+     *   }
+     * }
+     *
+     * The PartitionEventRecord returned in P2 will reflect the move as:
+     *
+     * PartitionEventRecord {
+     *   commit_timestamp: T
+     *   partition_token: "P2"
+     *   move_in_events {
+     *     source_partition_token: "P1"
+     *   }
+     * }
+     *
+     * The PartitionEventRecord returned in P3 will reflect the move as:
+     *
+     * PartitionEventRecord {
+     *   commit_timestamp: T
+     *   partition_token: "P3"
+     *   move_in_events {
+     *     source_partition_token: "P1"
+     *   }
+     * }
+     * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent move_out_events = 5; + * + */ + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEventOrBuilder + getMoveOutEventsOrBuilder(int index); + } + + /** + * + * + *
+   * A partition event record describes key range changes for a change stream
+   * partition. The changes to a row defined by its primary key can be captured
+   * in one change stream partition for a specific time range, and then be
+   * captured in a different change stream partition for a different time range.
+   * This movement of key ranges across change stream partitions is a reflection
+   * of activities, such as Spanner's dynamic splitting and load balancing, etc.
+   * Processing this event is needed if users want to guarantee processing of
+   * the changes for any key in timestamp order. If time ordered processing of
+   * changes for a primary key is not needed, this event can be ignored.
+   * To guarantee time ordered processing for each primary key, if the event
+   * describes move-ins, the reader of this partition needs to wait until the
+   * readers of the source partitions have processed all records with timestamps
+   * <= this PartitionEventRecord.commit_timestamp, before advancing beyond this
+   * PartitionEventRecord. If the event describes move-outs, the reader can
+   * notify the readers of the destination partitions that they can continue
+   * processing.
+   * 
+ * + * Protobuf type {@code google.spanner.v1.ChangeStreamRecord.PartitionEventRecord} + */ + public static final class PartitionEventRecord extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.spanner.v1.ChangeStreamRecord.PartitionEventRecord) + PartitionEventRecordOrBuilder { + private static final long serialVersionUID = 0L; + + // Use PartitionEventRecord.newBuilder() to construct. + private PartitionEventRecord(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PartitionEventRecord() { + recordSequence_ = ""; + partitionToken_ = ""; + moveInEvents_ = java.util.Collections.emptyList(); + moveOutEvents_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PartitionEventRecord(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.v1.ChangeStreamProto + .internal_static_google_spanner_v1_ChangeStreamRecord_PartitionEventRecord_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.v1.ChangeStreamProto + .internal_static_google_spanner_v1_ChangeStreamRecord_PartitionEventRecord_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.class, + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.Builder.class); + } + + public interface MoveInEventOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * An unique partition identifier describing the source change stream
+       * partition that recorded changes for the key range that is moving
+       * into this partition.
+       * 
+ * + * string source_partition_token = 1; + * + * @return The sourcePartitionToken. + */ + java.lang.String getSourcePartitionToken(); + + /** + * + * + *
+       * An unique partition identifier describing the source change stream
+       * partition that recorded changes for the key range that is moving
+       * into this partition.
+       * 
+ * + * string source_partition_token = 1; + * + * @return The bytes for sourcePartitionToken. + */ + com.google.protobuf.ByteString getSourcePartitionTokenBytes(); + } + + /** + * + * + *
+     * Describes move-in of the key ranges into the change stream partition
+     * identified by
+     * [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token].
+     *
+     * To maintain processing the changes for a particular key in timestamp
+     * order, the query processing the change stream partition identified by
+     * [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token]
+     * should not advance beyond the partition event record commit timestamp
+     * until the queries processing the source change stream partitions have
+     * processed all change stream records with timestamps <= the partition
+     * event record commit timestamp.
+     * 
+ * + * Protobuf type {@code google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent} + */ + public static final class MoveInEvent extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent) + MoveInEventOrBuilder { + private static final long serialVersionUID = 0L; + + // Use MoveInEvent.newBuilder() to construct. + private MoveInEvent(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private MoveInEvent() { + sourcePartitionToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new MoveInEvent(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.v1.ChangeStreamProto + .internal_static_google_spanner_v1_ChangeStreamRecord_PartitionEventRecord_MoveInEvent_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.v1.ChangeStreamProto + .internal_static_google_spanner_v1_ChangeStreamRecord_PartitionEventRecord_MoveInEvent_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent.class, + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent.Builder + .class); + } + + public static final int SOURCE_PARTITION_TOKEN_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object sourcePartitionToken_ = ""; + + /** + * + * + *
+       * An unique partition identifier describing the source change stream
+       * partition that recorded changes for the key range that is moving
+       * into this partition.
+       * 
+ * + * string source_partition_token = 1; + * + * @return The sourcePartitionToken. + */ + @java.lang.Override + public java.lang.String getSourcePartitionToken() { + java.lang.Object ref = sourcePartitionToken_; + 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(); + sourcePartitionToken_ = s; + return s; + } + } + + /** + * + * + *
+       * An unique partition identifier describing the source change stream
+       * partition that recorded changes for the key range that is moving
+       * into this partition.
+       * 
+ * + * string source_partition_token = 1; + * + * @return The bytes for sourcePartitionToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSourcePartitionTokenBytes() { + java.lang.Object ref = sourcePartitionToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sourcePartitionToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(sourcePartitionToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, sourcePartitionToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(sourcePartitionToken_)) { + size += + com.google.protobuf.GeneratedMessageV3.computeStringSize(1, sourcePartitionToken_); + } + 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 com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent)) { + return super.equals(obj); + } + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent other = + (com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent) obj; + + if (!getSourcePartitionToken().equals(other.getSourcePartitionToken())) 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) + SOURCE_PARTITION_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getSourcePartitionToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent + parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent + parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent 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.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+       * Describes move-in of the key ranges into the change stream partition
+       * identified by
+       * [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token].
+       *
+       * To maintain processing the changes for a particular key in timestamp
+       * order, the query processing the change stream partition identified by
+       * [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token]
+       * should not advance beyond the partition event record commit timestamp
+       * until the queries processing the source change stream partitions have
+       * processed all change stream records with timestamps <= the partition
+       * event record commit timestamp.
+       * 
+ * + * Protobuf type {@code google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent) + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEventOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.v1.ChangeStreamProto + .internal_static_google_spanner_v1_ChangeStreamRecord_PartitionEventRecord_MoveInEvent_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.v1.ChangeStreamProto + .internal_static_google_spanner_v1_ChangeStreamRecord_PartitionEventRecord_MoveInEvent_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent.class, + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent.Builder + .class); + } + + // Construct using + // com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + sourcePartitionToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.spanner.v1.ChangeStreamProto + .internal_static_google_spanner_v1_ChangeStreamRecord_PartitionEventRecord_MoveInEvent_descriptor; + } + + @java.lang.Override + public com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent + getDefaultInstanceForType() { + return com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent build() { + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent + buildPartial() { + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent result = + new com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.sourcePartitionToken_ = sourcePartitionToken_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent) { + return mergeFrom( + (com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent other) { + if (other + == com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent + .getDefaultInstance()) return this; + if (!other.getSourcePartitionToken().isEmpty()) { + sourcePartitionToken_ = other.sourcePartitionToken_; + bitField0_ |= 0x00000001; + onChanged(); + } + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + sourcePartitionToken_ = input.readStringRequireUtf8(); + 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 java.lang.Object sourcePartitionToken_ = ""; + + /** + * + * + *
+         * An unique partition identifier describing the source change stream
+         * partition that recorded changes for the key range that is moving
+         * into this partition.
+         * 
+ * + * string source_partition_token = 1; + * + * @return The sourcePartitionToken. + */ + public java.lang.String getSourcePartitionToken() { + java.lang.Object ref = sourcePartitionToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sourcePartitionToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+         * An unique partition identifier describing the source change stream
+         * partition that recorded changes for the key range that is moving
+         * into this partition.
+         * 
+ * + * string source_partition_token = 1; + * + * @return The bytes for sourcePartitionToken. + */ + public com.google.protobuf.ByteString getSourcePartitionTokenBytes() { + java.lang.Object ref = sourcePartitionToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sourcePartitionToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+         * An unique partition identifier describing the source change stream
+         * partition that recorded changes for the key range that is moving
+         * into this partition.
+         * 
+ * + * string source_partition_token = 1; + * + * @param value The sourcePartitionToken to set. + * @return This builder for chaining. + */ + public Builder setSourcePartitionToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + sourcePartitionToken_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+         * An unique partition identifier describing the source change stream
+         * partition that recorded changes for the key range that is moving
+         * into this partition.
+         * 
+ * + * string source_partition_token = 1; + * + * @return This builder for chaining. + */ + public Builder clearSourcePartitionToken() { + sourcePartitionToken_ = getDefaultInstance().getSourcePartitionToken(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+         * An unique partition identifier describing the source change stream
+         * partition that recorded changes for the key range that is moving
+         * into this partition.
+         * 
+ * + * string source_partition_token = 1; + * + * @param value The bytes for sourcePartitionToken to set. + * @return This builder for chaining. + */ + public Builder setSourcePartitionTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + sourcePartitionToken_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent) + } + + // @@protoc_insertion_point(class_scope:google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent) + private static final com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent(); + } + + public static com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MoveInEvent 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 com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface MoveOutEventOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * An unique partition identifier describing the destination change
+       * stream partition that will record changes for the key range that is
+       * moving out of this partition.
+       * 
+ * + * string destination_partition_token = 1; + * + * @return The destinationPartitionToken. + */ + java.lang.String getDestinationPartitionToken(); + + /** + * + * + *
+       * An unique partition identifier describing the destination change
+       * stream partition that will record changes for the key range that is
+       * moving out of this partition.
+       * 
+ * + * string destination_partition_token = 1; + * + * @return The bytes for destinationPartitionToken. + */ + com.google.protobuf.ByteString getDestinationPartitionTokenBytes(); + } + + /** + * + * + *
+     * Describes move-out of the key ranges out of the change stream partition
+     * identified by
+     * [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token].
+     *
+     * To maintain processing the changes for a particular key in timestamp
+     * order, the query processing the
+     * [MoveOutEvent][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent]
+     * in the partition identified by
+     * [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token]
+     * should inform the queries processing the destination partitions that
+     * they can unblock and proceed processing records past the
+     * [commit_timestamp][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.commit_timestamp].
+     * 
+ * + * Protobuf type {@code google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent} + */ + public static final class MoveOutEvent extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent) + MoveOutEventOrBuilder { + private static final long serialVersionUID = 0L; + + // Use MoveOutEvent.newBuilder() to construct. + private MoveOutEvent(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private MoveOutEvent() { + destinationPartitionToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new MoveOutEvent(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.v1.ChangeStreamProto + .internal_static_google_spanner_v1_ChangeStreamRecord_PartitionEventRecord_MoveOutEvent_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.v1.ChangeStreamProto + .internal_static_google_spanner_v1_ChangeStreamRecord_PartitionEventRecord_MoveOutEvent_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent.class, + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent.Builder + .class); + } + + public static final int DESTINATION_PARTITION_TOKEN_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object destinationPartitionToken_ = ""; + + /** + * + * + *
+       * An unique partition identifier describing the destination change
+       * stream partition that will record changes for the key range that is
+       * moving out of this partition.
+       * 
+ * + * string destination_partition_token = 1; + * + * @return The destinationPartitionToken. + */ + @java.lang.Override + public java.lang.String getDestinationPartitionToken() { + java.lang.Object ref = destinationPartitionToken_; + 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(); + destinationPartitionToken_ = s; + return s; + } + } + + /** + * + * + *
+       * An unique partition identifier describing the destination change
+       * stream partition that will record changes for the key range that is
+       * moving out of this partition.
+       * 
+ * + * string destination_partition_token = 1; + * + * @return The bytes for destinationPartitionToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDestinationPartitionTokenBytes() { + java.lang.Object ref = destinationPartitionToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + destinationPartitionToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(destinationPartitionToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, destinationPartitionToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(destinationPartitionToken_)) { + size += + com.google.protobuf.GeneratedMessageV3.computeStringSize( + 1, destinationPartitionToken_); + } + 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 + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent)) { + return super.equals(obj); + } + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent other = + (com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent) obj; + + if (!getDestinationPartitionToken().equals(other.getDestinationPartitionToken())) + 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) + DESTINATION_PARTITION_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getDestinationPartitionToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent + parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent + parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent 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.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+       * Describes move-out of the key ranges out of the change stream partition
+       * identified by
+       * [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token].
+       *
+       * To maintain processing the changes for a particular key in timestamp
+       * order, the query processing the
+       * [MoveOutEvent][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent]
+       * in the partition identified by
+       * [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token]
+       * should inform the queries processing the destination partitions that
+       * they can unblock and proceed processing records past the
+       * [commit_timestamp][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.commit_timestamp].
+       * 
+ * + * Protobuf type {@code + * google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent) + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEventOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.v1.ChangeStreamProto + .internal_static_google_spanner_v1_ChangeStreamRecord_PartitionEventRecord_MoveOutEvent_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.v1.ChangeStreamProto + .internal_static_google_spanner_v1_ChangeStreamRecord_PartitionEventRecord_MoveOutEvent_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent.class, + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent.Builder + .class); + } + + // Construct using + // com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + destinationPartitionToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.spanner.v1.ChangeStreamProto + .internal_static_google_spanner_v1_ChangeStreamRecord_PartitionEventRecord_MoveOutEvent_descriptor; + } + + @java.lang.Override + public com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent + getDefaultInstanceForType() { + return com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent build() { + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent + buildPartial() { + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent result = + new com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.destinationPartitionToken_ = destinationPartitionToken_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent) { + return mergeFrom( + (com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent other) { + if (other + == com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent + .getDefaultInstance()) return this; + if (!other.getDestinationPartitionToken().isEmpty()) { + destinationPartitionToken_ = other.destinationPartitionToken_; + bitField0_ |= 0x00000001; + onChanged(); + } + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + destinationPartitionToken_ = input.readStringRequireUtf8(); + 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 java.lang.Object destinationPartitionToken_ = ""; + + /** + * + * + *
+         * An unique partition identifier describing the destination change
+         * stream partition that will record changes for the key range that is
+         * moving out of this partition.
+         * 
+ * + * string destination_partition_token = 1; + * + * @return The destinationPartitionToken. + */ + public java.lang.String getDestinationPartitionToken() { + java.lang.Object ref = destinationPartitionToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + destinationPartitionToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+         * An unique partition identifier describing the destination change
+         * stream partition that will record changes for the key range that is
+         * moving out of this partition.
+         * 
+ * + * string destination_partition_token = 1; + * + * @return The bytes for destinationPartitionToken. + */ + public com.google.protobuf.ByteString getDestinationPartitionTokenBytes() { + java.lang.Object ref = destinationPartitionToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + destinationPartitionToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+         * An unique partition identifier describing the destination change
+         * stream partition that will record changes for the key range that is
+         * moving out of this partition.
+         * 
+ * + * string destination_partition_token = 1; + * + * @param value The destinationPartitionToken to set. + * @return This builder for chaining. + */ + public Builder setDestinationPartitionToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + destinationPartitionToken_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+         * An unique partition identifier describing the destination change
+         * stream partition that will record changes for the key range that is
+         * moving out of this partition.
+         * 
+ * + * string destination_partition_token = 1; + * + * @return This builder for chaining. + */ + public Builder clearDestinationPartitionToken() { + destinationPartitionToken_ = getDefaultInstance().getDestinationPartitionToken(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+         * An unique partition identifier describing the destination change
+         * stream partition that will record changes for the key range that is
+         * moving out of this partition.
+         * 
+ * + * string destination_partition_token = 1; + * + * @param value The bytes for destinationPartitionToken to set. + * @return This builder for chaining. + */ + public Builder setDestinationPartitionTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + destinationPartitionToken_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent) + } + + // @@protoc_insertion_point(class_scope:google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent) + private static final com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord + .MoveOutEvent + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent(); + } + + public static com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MoveOutEvent 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 com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int COMMIT_TIMESTAMP_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp commitTimestamp_; + + /** + * + * + *
+     * Indicates the commit timestamp at which the key range change occurred.
+     * DataChangeRecord.commit_timestamps,
+     * PartitionStartRecord.start_timestamps,
+     * PartitionEventRecord.commit_timestamps, and
+     * PartitionEndRecord.end_timestamps can have the same value in the same
+     * partition.
+     * 
+ * + * .google.protobuf.Timestamp commit_timestamp = 1; + * + * @return Whether the commitTimestamp field is set. + */ + @java.lang.Override + public boolean hasCommitTimestamp() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Indicates the commit timestamp at which the key range change occurred.
+     * DataChangeRecord.commit_timestamps,
+     * PartitionStartRecord.start_timestamps,
+     * PartitionEventRecord.commit_timestamps, and
+     * PartitionEndRecord.end_timestamps can have the same value in the same
+     * partition.
+     * 
+ * + * .google.protobuf.Timestamp commit_timestamp = 1; + * + * @return The commitTimestamp. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCommitTimestamp() { + return commitTimestamp_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : commitTimestamp_; + } + + /** + * + * + *
+     * Indicates the commit timestamp at which the key range change occurred.
+     * DataChangeRecord.commit_timestamps,
+     * PartitionStartRecord.start_timestamps,
+     * PartitionEventRecord.commit_timestamps, and
+     * PartitionEndRecord.end_timestamps can have the same value in the same
+     * partition.
+     * 
+ * + * .google.protobuf.Timestamp commit_timestamp = 1; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCommitTimestampOrBuilder() { + return commitTimestamp_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : commitTimestamp_; + } + + public static final int RECORD_SEQUENCE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object recordSequence_ = ""; + + /** + * + * + *
+     * Record sequence numbers are unique and monotonically increasing (but not
+     * necessarily contiguous) for a specific timestamp across record
+     * types in the same partition. To guarantee ordered processing, the reader
+     * should process records (of potentially different types) in
+     * record_sequence order for a specific timestamp in the same partition.
+     * 
+ * + * string record_sequence = 2; + * + * @return The recordSequence. + */ + @java.lang.Override + public java.lang.String getRecordSequence() { + java.lang.Object ref = recordSequence_; + 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(); + recordSequence_ = s; + return s; + } + } + + /** + * + * + *
+     * Record sequence numbers are unique and monotonically increasing (but not
+     * necessarily contiguous) for a specific timestamp across record
+     * types in the same partition. To guarantee ordered processing, the reader
+     * should process records (of potentially different types) in
+     * record_sequence order for a specific timestamp in the same partition.
+     * 
+ * + * string record_sequence = 2; + * + * @return The bytes for recordSequence. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRecordSequenceBytes() { + java.lang.Object ref = recordSequence_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + recordSequence_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PARTITION_TOKEN_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object partitionToken_ = ""; + + /** + * + * + *
+     * Unique partition identifier describing the partition this event
+     * occurred on.
+     * [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token]
+     * is equal to the partition token of the change stream partition currently
+     * queried to return this PartitionEventRecord.
+     * 
+ * + * string partition_token = 3; + * + * @return The partitionToken. + */ + @java.lang.Override + public java.lang.String getPartitionToken() { + java.lang.Object ref = partitionToken_; + 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(); + partitionToken_ = s; + return s; + } + } + + /** + * + * + *
+     * Unique partition identifier describing the partition this event
+     * occurred on.
+     * [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token]
+     * is equal to the partition token of the change stream partition currently
+     * queried to return this PartitionEventRecord.
+     * 
+ * + * string partition_token = 3; + * + * @return The bytes for partitionToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPartitionTokenBytes() { + java.lang.Object ref = partitionToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + partitionToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MOVE_IN_EVENTS_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private java.util.List< + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent> + moveInEvents_; + + /** + * + * + *
+     * Set when one or more key ranges are moved into the change stream
+     * partition identified by
+     * [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token].
+     *
+     * Example: Two key ranges are moved into partition (P1) from partition (P2)
+     * and partition (P3) in a single transaction at timestamp T.
+     *
+     * The PartitionEventRecord returned in P1 will reflect the move as:
+     *
+     * PartitionEventRecord {
+     *   commit_timestamp: T
+     *   partition_token: "P1"
+     *   move_in_events {
+     *     source_partition_token: "P2"
+     *   }
+     *   move_in_events {
+     *     source_partition_token: "P3"
+     *   }
+     * }
+     *
+     * The PartitionEventRecord returned in P2 will reflect the move as:
+     *
+     * PartitionEventRecord {
+     *   commit_timestamp: T
+     *   partition_token: "P2"
+     *   move_out_events {
+     *     destination_partition_token: "P1"
+     *   }
+     * }
+     *
+     * The PartitionEventRecord returned in P3 will reflect the move as:
+     *
+     * PartitionEventRecord {
+     *   commit_timestamp: T
+     *   partition_token: "P3"
+     *   move_out_events {
+     *     destination_partition_token: "P1"
+     *   }
+     * }
+     * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent move_in_events = 4; + * + */ + @java.lang.Override + public java.util.List + getMoveInEventsList() { + return moveInEvents_; + } + + /** + * + * + *
+     * Set when one or more key ranges are moved into the change stream
+     * partition identified by
+     * [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token].
+     *
+     * Example: Two key ranges are moved into partition (P1) from partition (P2)
+     * and partition (P3) in a single transaction at timestamp T.
+     *
+     * The PartitionEventRecord returned in P1 will reflect the move as:
+     *
+     * PartitionEventRecord {
+     *   commit_timestamp: T
+     *   partition_token: "P1"
+     *   move_in_events {
+     *     source_partition_token: "P2"
+     *   }
+     *   move_in_events {
+     *     source_partition_token: "P3"
+     *   }
+     * }
+     *
+     * The PartitionEventRecord returned in P2 will reflect the move as:
+     *
+     * PartitionEventRecord {
+     *   commit_timestamp: T
+     *   partition_token: "P2"
+     *   move_out_events {
+     *     destination_partition_token: "P1"
+     *   }
+     * }
+     *
+     * The PartitionEventRecord returned in P3 will reflect the move as:
+     *
+     * PartitionEventRecord {
+     *   commit_timestamp: T
+     *   partition_token: "P3"
+     *   move_out_events {
+     *     destination_partition_token: "P1"
+     *   }
+     * }
+     * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent move_in_events = 4; + * + */ + @java.lang.Override + public java.util.List< + ? extends + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEventOrBuilder> + getMoveInEventsOrBuilderList() { + return moveInEvents_; + } + + /** + * + * + *
+     * Set when one or more key ranges are moved into the change stream
+     * partition identified by
+     * [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token].
+     *
+     * Example: Two key ranges are moved into partition (P1) from partition (P2)
+     * and partition (P3) in a single transaction at timestamp T.
+     *
+     * The PartitionEventRecord returned in P1 will reflect the move as:
+     *
+     * PartitionEventRecord {
+     *   commit_timestamp: T
+     *   partition_token: "P1"
+     *   move_in_events {
+     *     source_partition_token: "P2"
+     *   }
+     *   move_in_events {
+     *     source_partition_token: "P3"
+     *   }
+     * }
+     *
+     * The PartitionEventRecord returned in P2 will reflect the move as:
+     *
+     * PartitionEventRecord {
+     *   commit_timestamp: T
+     *   partition_token: "P2"
+     *   move_out_events {
+     *     destination_partition_token: "P1"
+     *   }
+     * }
+     *
+     * The PartitionEventRecord returned in P3 will reflect the move as:
+     *
+     * PartitionEventRecord {
+     *   commit_timestamp: T
+     *   partition_token: "P3"
+     *   move_out_events {
+     *     destination_partition_token: "P1"
+     *   }
+     * }
+     * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent move_in_events = 4; + * + */ + @java.lang.Override + public int getMoveInEventsCount() { + return moveInEvents_.size(); + } + + /** + * + * + *
+     * Set when one or more key ranges are moved into the change stream
+     * partition identified by
+     * [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token].
+     *
+     * Example: Two key ranges are moved into partition (P1) from partition (P2)
+     * and partition (P3) in a single transaction at timestamp T.
+     *
+     * The PartitionEventRecord returned in P1 will reflect the move as:
+     *
+     * PartitionEventRecord {
+     *   commit_timestamp: T
+     *   partition_token: "P1"
+     *   move_in_events {
+     *     source_partition_token: "P2"
+     *   }
+     *   move_in_events {
+     *     source_partition_token: "P3"
+     *   }
+     * }
+     *
+     * The PartitionEventRecord returned in P2 will reflect the move as:
+     *
+     * PartitionEventRecord {
+     *   commit_timestamp: T
+     *   partition_token: "P2"
+     *   move_out_events {
+     *     destination_partition_token: "P1"
+     *   }
+     * }
+     *
+     * The PartitionEventRecord returned in P3 will reflect the move as:
+     *
+     * PartitionEventRecord {
+     *   commit_timestamp: T
+     *   partition_token: "P3"
+     *   move_out_events {
+     *     destination_partition_token: "P1"
+     *   }
+     * }
+     * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent move_in_events = 4; + * + */ + @java.lang.Override + public com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent + getMoveInEvents(int index) { + return moveInEvents_.get(index); + } + + /** + * + * + *
+     * Set when one or more key ranges are moved into the change stream
+     * partition identified by
+     * [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token].
+     *
+     * Example: Two key ranges are moved into partition (P1) from partition (P2)
+     * and partition (P3) in a single transaction at timestamp T.
+     *
+     * The PartitionEventRecord returned in P1 will reflect the move as:
+     *
+     * PartitionEventRecord {
+     *   commit_timestamp: T
+     *   partition_token: "P1"
+     *   move_in_events {
+     *     source_partition_token: "P2"
+     *   }
+     *   move_in_events {
+     *     source_partition_token: "P3"
+     *   }
+     * }
+     *
+     * The PartitionEventRecord returned in P2 will reflect the move as:
+     *
+     * PartitionEventRecord {
+     *   commit_timestamp: T
+     *   partition_token: "P2"
+     *   move_out_events {
+     *     destination_partition_token: "P1"
+     *   }
+     * }
+     *
+     * The PartitionEventRecord returned in P3 will reflect the move as:
+     *
+     * PartitionEventRecord {
+     *   commit_timestamp: T
+     *   partition_token: "P3"
+     *   move_out_events {
+     *     destination_partition_token: "P1"
+     *   }
+     * }
+     * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent move_in_events = 4; + * + */ + @java.lang.Override + public com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEventOrBuilder + getMoveInEventsOrBuilder(int index) { + return moveInEvents_.get(index); + } + + public static final int MOVE_OUT_EVENTS_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private java.util.List< + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent> + moveOutEvents_; + + /** + * + * + *
+     * Set when one or more key ranges are moved out of the change stream
+     * partition identified by
+     * [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token].
+     *
+     * Example: Two key ranges are moved out of partition (P1) to partition (P2)
+     * and partition (P3) in a single transaction at timestamp T.
+     *
+     * The PartitionEventRecord returned in P1 will reflect the move as:
+     *
+     * PartitionEventRecord {
+     *   commit_timestamp: T
+     *   partition_token: "P1"
+     *   move_out_events {
+     *     destination_partition_token: "P2"
+     *   }
+     *   move_out_events {
+     *     destination_partition_token: "P3"
+     *   }
+     * }
+     *
+     * The PartitionEventRecord returned in P2 will reflect the move as:
+     *
+     * PartitionEventRecord {
+     *   commit_timestamp: T
+     *   partition_token: "P2"
+     *   move_in_events {
+     *     source_partition_token: "P1"
+     *   }
+     * }
+     *
+     * The PartitionEventRecord returned in P3 will reflect the move as:
+     *
+     * PartitionEventRecord {
+     *   commit_timestamp: T
+     *   partition_token: "P3"
+     *   move_in_events {
+     *     source_partition_token: "P1"
+     *   }
+     * }
+     * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent move_out_events = 5; + * + */ + @java.lang.Override + public java.util.List< + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent> + getMoveOutEventsList() { + return moveOutEvents_; + } + + /** + * + * + *
+     * Set when one or more key ranges are moved out of the change stream
+     * partition identified by
+     * [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token].
+     *
+     * Example: Two key ranges are moved out of partition (P1) to partition (P2)
+     * and partition (P3) in a single transaction at timestamp T.
+     *
+     * The PartitionEventRecord returned in P1 will reflect the move as:
+     *
+     * PartitionEventRecord {
+     *   commit_timestamp: T
+     *   partition_token: "P1"
+     *   move_out_events {
+     *     destination_partition_token: "P2"
+     *   }
+     *   move_out_events {
+     *     destination_partition_token: "P3"
+     *   }
+     * }
+     *
+     * The PartitionEventRecord returned in P2 will reflect the move as:
+     *
+     * PartitionEventRecord {
+     *   commit_timestamp: T
+     *   partition_token: "P2"
+     *   move_in_events {
+     *     source_partition_token: "P1"
+     *   }
+     * }
+     *
+     * The PartitionEventRecord returned in P3 will reflect the move as:
+     *
+     * PartitionEventRecord {
+     *   commit_timestamp: T
+     *   partition_token: "P3"
+     *   move_in_events {
+     *     source_partition_token: "P1"
+     *   }
+     * }
+     * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent move_out_events = 5; + * + */ + @java.lang.Override + public java.util.List< + ? extends + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEventOrBuilder> + getMoveOutEventsOrBuilderList() { + return moveOutEvents_; + } + + /** + * + * + *
+     * Set when one or more key ranges are moved out of the change stream
+     * partition identified by
+     * [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token].
+     *
+     * Example: Two key ranges are moved out of partition (P1) to partition (P2)
+     * and partition (P3) in a single transaction at timestamp T.
+     *
+     * The PartitionEventRecord returned in P1 will reflect the move as:
+     *
+     * PartitionEventRecord {
+     *   commit_timestamp: T
+     *   partition_token: "P1"
+     *   move_out_events {
+     *     destination_partition_token: "P2"
+     *   }
+     *   move_out_events {
+     *     destination_partition_token: "P3"
+     *   }
+     * }
+     *
+     * The PartitionEventRecord returned in P2 will reflect the move as:
+     *
+     * PartitionEventRecord {
+     *   commit_timestamp: T
+     *   partition_token: "P2"
+     *   move_in_events {
+     *     source_partition_token: "P1"
+     *   }
+     * }
+     *
+     * The PartitionEventRecord returned in P3 will reflect the move as:
+     *
+     * PartitionEventRecord {
+     *   commit_timestamp: T
+     *   partition_token: "P3"
+     *   move_in_events {
+     *     source_partition_token: "P1"
+     *   }
+     * }
+     * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent move_out_events = 5; + * + */ + @java.lang.Override + public int getMoveOutEventsCount() { + return moveOutEvents_.size(); + } + + /** + * + * + *
+     * Set when one or more key ranges are moved out of the change stream
+     * partition identified by
+     * [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token].
+     *
+     * Example: Two key ranges are moved out of partition (P1) to partition (P2)
+     * and partition (P3) in a single transaction at timestamp T.
+     *
+     * The PartitionEventRecord returned in P1 will reflect the move as:
+     *
+     * PartitionEventRecord {
+     *   commit_timestamp: T
+     *   partition_token: "P1"
+     *   move_out_events {
+     *     destination_partition_token: "P2"
+     *   }
+     *   move_out_events {
+     *     destination_partition_token: "P3"
+     *   }
+     * }
+     *
+     * The PartitionEventRecord returned in P2 will reflect the move as:
+     *
+     * PartitionEventRecord {
+     *   commit_timestamp: T
+     *   partition_token: "P2"
+     *   move_in_events {
+     *     source_partition_token: "P1"
+     *   }
+     * }
+     *
+     * The PartitionEventRecord returned in P3 will reflect the move as:
+     *
+     * PartitionEventRecord {
+     *   commit_timestamp: T
+     *   partition_token: "P3"
+     *   move_in_events {
+     *     source_partition_token: "P1"
+     *   }
+     * }
+     * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent move_out_events = 5; + * + */ + @java.lang.Override + public com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent + getMoveOutEvents(int index) { + return moveOutEvents_.get(index); + } + + /** + * + * + *
+     * Set when one or more key ranges are moved out of the change stream
+     * partition identified by
+     * [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token].
+     *
+     * Example: Two key ranges are moved out of partition (P1) to partition (P2)
+     * and partition (P3) in a single transaction at timestamp T.
+     *
+     * The PartitionEventRecord returned in P1 will reflect the move as:
+     *
+     * PartitionEventRecord {
+     *   commit_timestamp: T
+     *   partition_token: "P1"
+     *   move_out_events {
+     *     destination_partition_token: "P2"
+     *   }
+     *   move_out_events {
+     *     destination_partition_token: "P3"
+     *   }
+     * }
+     *
+     * The PartitionEventRecord returned in P2 will reflect the move as:
+     *
+     * PartitionEventRecord {
+     *   commit_timestamp: T
+     *   partition_token: "P2"
+     *   move_in_events {
+     *     source_partition_token: "P1"
+     *   }
+     * }
+     *
+     * The PartitionEventRecord returned in P3 will reflect the move as:
+     *
+     * PartitionEventRecord {
+     *   commit_timestamp: T
+     *   partition_token: "P3"
+     *   move_in_events {
+     *     source_partition_token: "P1"
+     *   }
+     * }
+     * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent move_out_events = 5; + * + */ + @java.lang.Override + public com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEventOrBuilder + getMoveOutEventsOrBuilder(int index) { + return moveOutEvents_.get(index); + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getCommitTimestamp()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(recordSequence_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, recordSequence_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(partitionToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, partitionToken_); + } + for (int i = 0; i < moveInEvents_.size(); i++) { + output.writeMessage(4, moveInEvents_.get(i)); + } + for (int i = 0; i < moveOutEvents_.size(); i++) { + output.writeMessage(5, moveOutEvents_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getCommitTimestamp()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(recordSequence_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, recordSequence_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(partitionToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, partitionToken_); + } + for (int i = 0; i < moveInEvents_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, moveInEvents_.get(i)); + } + for (int i = 0; i < moveOutEvents_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, moveOutEvents_.get(i)); + } + 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 com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord)) { + return super.equals(obj); + } + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord other = + (com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord) obj; + + if (hasCommitTimestamp() != other.hasCommitTimestamp()) return false; + if (hasCommitTimestamp()) { + if (!getCommitTimestamp().equals(other.getCommitTimestamp())) return false; + } + if (!getRecordSequence().equals(other.getRecordSequence())) return false; + if (!getPartitionToken().equals(other.getPartitionToken())) return false; + if (!getMoveInEventsList().equals(other.getMoveInEventsList())) return false; + if (!getMoveOutEventsList().equals(other.getMoveOutEventsList())) 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(); + if (hasCommitTimestamp()) { + hash = (37 * hash) + COMMIT_TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + getCommitTimestamp().hashCode(); + } + hash = (37 * hash) + RECORD_SEQUENCE_FIELD_NUMBER; + hash = (53 * hash) + getRecordSequence().hashCode(); + hash = (37 * hash) + PARTITION_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPartitionToken().hashCode(); + if (getMoveInEventsCount() > 0) { + hash = (37 * hash) + MOVE_IN_EVENTS_FIELD_NUMBER; + hash = (53 * hash) + getMoveInEventsList().hashCode(); + } + if (getMoveOutEventsCount() > 0) { + hash = (37 * hash) + MOVE_OUT_EVENTS_FIELD_NUMBER; + hash = (53 * hash) + getMoveOutEventsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord 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.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * A partition event record describes key range changes for a change stream
+     * partition. The changes to a row defined by its primary key can be captured
+     * in one change stream partition for a specific time range, and then be
+     * captured in a different change stream partition for a different time range.
+     * This movement of key ranges across change stream partitions is a reflection
+     * of activities, such as Spanner's dynamic splitting and load balancing, etc.
+     * Processing this event is needed if users want to guarantee processing of
+     * the changes for any key in timestamp order. If time ordered processing of
+     * changes for a primary key is not needed, this event can be ignored.
+     * To guarantee time ordered processing for each primary key, if the event
+     * describes move-ins, the reader of this partition needs to wait until the
+     * readers of the source partitions have processed all records with timestamps
+     * <= this PartitionEventRecord.commit_timestamp, before advancing beyond this
+     * PartitionEventRecord. If the event describes move-outs, the reader can
+     * notify the readers of the destination partitions that they can continue
+     * processing.
+     * 
+ * + * Protobuf type {@code google.spanner.v1.ChangeStreamRecord.PartitionEventRecord} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.spanner.v1.ChangeStreamRecord.PartitionEventRecord) + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecordOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.v1.ChangeStreamProto + .internal_static_google_spanner_v1_ChangeStreamRecord_PartitionEventRecord_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.v1.ChangeStreamProto + .internal_static_google_spanner_v1_ChangeStreamRecord_PartitionEventRecord_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.class, + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.Builder.class); + } + + // Construct using com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getCommitTimestampFieldBuilder(); + getMoveInEventsFieldBuilder(); + getMoveOutEventsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + commitTimestamp_ = null; + if (commitTimestampBuilder_ != null) { + commitTimestampBuilder_.dispose(); + commitTimestampBuilder_ = null; + } + recordSequence_ = ""; + partitionToken_ = ""; + if (moveInEventsBuilder_ == null) { + moveInEvents_ = java.util.Collections.emptyList(); + } else { + moveInEvents_ = null; + moveInEventsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000008); + if (moveOutEventsBuilder_ == null) { + moveOutEvents_ = java.util.Collections.emptyList(); + } else { + moveOutEvents_ = null; + moveOutEventsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000010); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.spanner.v1.ChangeStreamProto + .internal_static_google_spanner_v1_ChangeStreamRecord_PartitionEventRecord_descriptor; + } + + @java.lang.Override + public com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord + getDefaultInstanceForType() { + return com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.getDefaultInstance(); + } + + @java.lang.Override + public com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord build() { + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord buildPartial() { + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord result = + new com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord result) { + if (moveInEventsBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0)) { + moveInEvents_ = java.util.Collections.unmodifiableList(moveInEvents_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.moveInEvents_ = moveInEvents_; + } else { + result.moveInEvents_ = moveInEventsBuilder_.build(); + } + if (moveOutEventsBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0)) { + moveOutEvents_ = java.util.Collections.unmodifiableList(moveOutEvents_); + bitField0_ = (bitField0_ & ~0x00000010); + } + result.moveOutEvents_ = moveOutEvents_; + } else { + result.moveOutEvents_ = moveOutEventsBuilder_.build(); + } + } + + private void buildPartial0( + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.commitTimestamp_ = + commitTimestampBuilder_ == null ? commitTimestamp_ : commitTimestampBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.recordSequence_ = recordSequence_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.partitionToken_ = partitionToken_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord) { + return mergeFrom((com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord other) { + if (other + == com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.getDefaultInstance()) + return this; + if (other.hasCommitTimestamp()) { + mergeCommitTimestamp(other.getCommitTimestamp()); + } + if (!other.getRecordSequence().isEmpty()) { + recordSequence_ = other.recordSequence_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getPartitionToken().isEmpty()) { + partitionToken_ = other.partitionToken_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (moveInEventsBuilder_ == null) { + if (!other.moveInEvents_.isEmpty()) { + if (moveInEvents_.isEmpty()) { + moveInEvents_ = other.moveInEvents_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureMoveInEventsIsMutable(); + moveInEvents_.addAll(other.moveInEvents_); + } + onChanged(); + } + } else { + if (!other.moveInEvents_.isEmpty()) { + if (moveInEventsBuilder_.isEmpty()) { + moveInEventsBuilder_.dispose(); + moveInEventsBuilder_ = null; + moveInEvents_ = other.moveInEvents_; + bitField0_ = (bitField0_ & ~0x00000008); + moveInEventsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getMoveInEventsFieldBuilder() + : null; + } else { + moveInEventsBuilder_.addAllMessages(other.moveInEvents_); + } + } + } + if (moveOutEventsBuilder_ == null) { + if (!other.moveOutEvents_.isEmpty()) { + if (moveOutEvents_.isEmpty()) { + moveOutEvents_ = other.moveOutEvents_; + bitField0_ = (bitField0_ & ~0x00000010); + } else { + ensureMoveOutEventsIsMutable(); + moveOutEvents_.addAll(other.moveOutEvents_); + } + onChanged(); + } + } else { + if (!other.moveOutEvents_.isEmpty()) { + if (moveOutEventsBuilder_.isEmpty()) { + moveOutEventsBuilder_.dispose(); + moveOutEventsBuilder_ = null; + moveOutEvents_ = other.moveOutEvents_; + bitField0_ = (bitField0_ & ~0x00000010); + moveOutEventsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getMoveOutEventsFieldBuilder() + : null; + } else { + moveOutEventsBuilder_.addAllMessages(other.moveOutEvents_); + } + } + } + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + getCommitTimestampFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + recordSequence_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + partitionToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent m = + input.readMessage( + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent + .parser(), + extensionRegistry); + if (moveInEventsBuilder_ == null) { + ensureMoveInEventsIsMutable(); + moveInEvents_.add(m); + } else { + moveInEventsBuilder_.addMessage(m); + } + break; + } // case 34 + case 42: + { + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent m = + input.readMessage( + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent + .parser(), + extensionRegistry); + if (moveOutEventsBuilder_ == null) { + ensureMoveOutEventsIsMutable(); + moveOutEvents_.add(m); + } else { + moveOutEventsBuilder_.addMessage(m); + } + break; + } // case 42 + 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.Timestamp commitTimestamp_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + commitTimestampBuilder_; + + /** + * + * + *
+       * Indicates the commit timestamp at which the key range change occurred.
+       * DataChangeRecord.commit_timestamps,
+       * PartitionStartRecord.start_timestamps,
+       * PartitionEventRecord.commit_timestamps, and
+       * PartitionEndRecord.end_timestamps can have the same value in the same
+       * partition.
+       * 
+ * + * .google.protobuf.Timestamp commit_timestamp = 1; + * + * @return Whether the commitTimestamp field is set. + */ + public boolean hasCommitTimestamp() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+       * Indicates the commit timestamp at which the key range change occurred.
+       * DataChangeRecord.commit_timestamps,
+       * PartitionStartRecord.start_timestamps,
+       * PartitionEventRecord.commit_timestamps, and
+       * PartitionEndRecord.end_timestamps can have the same value in the same
+       * partition.
+       * 
+ * + * .google.protobuf.Timestamp commit_timestamp = 1; + * + * @return The commitTimestamp. + */ + public com.google.protobuf.Timestamp getCommitTimestamp() { + if (commitTimestampBuilder_ == null) { + return commitTimestamp_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : commitTimestamp_; + } else { + return commitTimestampBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * Indicates the commit timestamp at which the key range change occurred.
+       * DataChangeRecord.commit_timestamps,
+       * PartitionStartRecord.start_timestamps,
+       * PartitionEventRecord.commit_timestamps, and
+       * PartitionEndRecord.end_timestamps can have the same value in the same
+       * partition.
+       * 
+ * + * .google.protobuf.Timestamp commit_timestamp = 1; + */ + public Builder setCommitTimestamp(com.google.protobuf.Timestamp value) { + if (commitTimestampBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + commitTimestamp_ = value; + } else { + commitTimestampBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * Indicates the commit timestamp at which the key range change occurred.
+       * DataChangeRecord.commit_timestamps,
+       * PartitionStartRecord.start_timestamps,
+       * PartitionEventRecord.commit_timestamps, and
+       * PartitionEndRecord.end_timestamps can have the same value in the same
+       * partition.
+       * 
+ * + * .google.protobuf.Timestamp commit_timestamp = 1; + */ + public Builder setCommitTimestamp(com.google.protobuf.Timestamp.Builder builderForValue) { + if (commitTimestampBuilder_ == null) { + commitTimestamp_ = builderForValue.build(); + } else { + commitTimestampBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * Indicates the commit timestamp at which the key range change occurred.
+       * DataChangeRecord.commit_timestamps,
+       * PartitionStartRecord.start_timestamps,
+       * PartitionEventRecord.commit_timestamps, and
+       * PartitionEndRecord.end_timestamps can have the same value in the same
+       * partition.
+       * 
+ * + * .google.protobuf.Timestamp commit_timestamp = 1; + */ + public Builder mergeCommitTimestamp(com.google.protobuf.Timestamp value) { + if (commitTimestampBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && commitTimestamp_ != null + && commitTimestamp_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCommitTimestampBuilder().mergeFrom(value); + } else { + commitTimestamp_ = value; + } + } else { + commitTimestampBuilder_.mergeFrom(value); + } + if (commitTimestamp_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * Indicates the commit timestamp at which the key range change occurred.
+       * DataChangeRecord.commit_timestamps,
+       * PartitionStartRecord.start_timestamps,
+       * PartitionEventRecord.commit_timestamps, and
+       * PartitionEndRecord.end_timestamps can have the same value in the same
+       * partition.
+       * 
+ * + * .google.protobuf.Timestamp commit_timestamp = 1; + */ + public Builder clearCommitTimestamp() { + bitField0_ = (bitField0_ & ~0x00000001); + commitTimestamp_ = null; + if (commitTimestampBuilder_ != null) { + commitTimestampBuilder_.dispose(); + commitTimestampBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * Indicates the commit timestamp at which the key range change occurred.
+       * DataChangeRecord.commit_timestamps,
+       * PartitionStartRecord.start_timestamps,
+       * PartitionEventRecord.commit_timestamps, and
+       * PartitionEndRecord.end_timestamps can have the same value in the same
+       * partition.
+       * 
+ * + * .google.protobuf.Timestamp commit_timestamp = 1; + */ + public com.google.protobuf.Timestamp.Builder getCommitTimestampBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getCommitTimestampFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * Indicates the commit timestamp at which the key range change occurred.
+       * DataChangeRecord.commit_timestamps,
+       * PartitionStartRecord.start_timestamps,
+       * PartitionEventRecord.commit_timestamps, and
+       * PartitionEndRecord.end_timestamps can have the same value in the same
+       * partition.
+       * 
+ * + * .google.protobuf.Timestamp commit_timestamp = 1; + */ + public com.google.protobuf.TimestampOrBuilder getCommitTimestampOrBuilder() { + if (commitTimestampBuilder_ != null) { + return commitTimestampBuilder_.getMessageOrBuilder(); + } else { + return commitTimestamp_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : commitTimestamp_; + } + } + + /** + * + * + *
+       * Indicates the commit timestamp at which the key range change occurred.
+       * DataChangeRecord.commit_timestamps,
+       * PartitionStartRecord.start_timestamps,
+       * PartitionEventRecord.commit_timestamps, and
+       * PartitionEndRecord.end_timestamps can have the same value in the same
+       * partition.
+       * 
+ * + * .google.protobuf.Timestamp commit_timestamp = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCommitTimestampFieldBuilder() { + if (commitTimestampBuilder_ == null) { + commitTimestampBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCommitTimestamp(), getParentForChildren(), isClean()); + commitTimestamp_ = null; + } + return commitTimestampBuilder_; + } + + private java.lang.Object recordSequence_ = ""; + + /** + * + * + *
+       * Record sequence numbers are unique and monotonically increasing (but not
+       * necessarily contiguous) for a specific timestamp across record
+       * types in the same partition. To guarantee ordered processing, the reader
+       * should process records (of potentially different types) in
+       * record_sequence order for a specific timestamp in the same partition.
+       * 
+ * + * string record_sequence = 2; + * + * @return The recordSequence. + */ + public java.lang.String getRecordSequence() { + java.lang.Object ref = recordSequence_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + recordSequence_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * Record sequence numbers are unique and monotonically increasing (but not
+       * necessarily contiguous) for a specific timestamp across record
+       * types in the same partition. To guarantee ordered processing, the reader
+       * should process records (of potentially different types) in
+       * record_sequence order for a specific timestamp in the same partition.
+       * 
+ * + * string record_sequence = 2; + * + * @return The bytes for recordSequence. + */ + public com.google.protobuf.ByteString getRecordSequenceBytes() { + java.lang.Object ref = recordSequence_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + recordSequence_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * Record sequence numbers are unique and monotonically increasing (but not
+       * necessarily contiguous) for a specific timestamp across record
+       * types in the same partition. To guarantee ordered processing, the reader
+       * should process records (of potentially different types) in
+       * record_sequence order for a specific timestamp in the same partition.
+       * 
+ * + * string record_sequence = 2; + * + * @param value The recordSequence to set. + * @return This builder for chaining. + */ + public Builder setRecordSequence(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + recordSequence_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * Record sequence numbers are unique and monotonically increasing (but not
+       * necessarily contiguous) for a specific timestamp across record
+       * types in the same partition. To guarantee ordered processing, the reader
+       * should process records (of potentially different types) in
+       * record_sequence order for a specific timestamp in the same partition.
+       * 
+ * + * string record_sequence = 2; + * + * @return This builder for chaining. + */ + public Builder clearRecordSequence() { + recordSequence_ = getDefaultInstance().getRecordSequence(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+       * Record sequence numbers are unique and monotonically increasing (but not
+       * necessarily contiguous) for a specific timestamp across record
+       * types in the same partition. To guarantee ordered processing, the reader
+       * should process records (of potentially different types) in
+       * record_sequence order for a specific timestamp in the same partition.
+       * 
+ * + * string record_sequence = 2; + * + * @param value The bytes for recordSequence to set. + * @return This builder for chaining. + */ + public Builder setRecordSequenceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + recordSequence_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object partitionToken_ = ""; + + /** + * + * + *
+       * Unique partition identifier describing the partition this event
+       * occurred on.
+       * [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token]
+       * is equal to the partition token of the change stream partition currently
+       * queried to return this PartitionEventRecord.
+       * 
+ * + * string partition_token = 3; + * + * @return The partitionToken. + */ + public java.lang.String getPartitionToken() { + java.lang.Object ref = partitionToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + partitionToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * Unique partition identifier describing the partition this event
+       * occurred on.
+       * [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token]
+       * is equal to the partition token of the change stream partition currently
+       * queried to return this PartitionEventRecord.
+       * 
+ * + * string partition_token = 3; + * + * @return The bytes for partitionToken. + */ + public com.google.protobuf.ByteString getPartitionTokenBytes() { + java.lang.Object ref = partitionToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + partitionToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * Unique partition identifier describing the partition this event
+       * occurred on.
+       * [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token]
+       * is equal to the partition token of the change stream partition currently
+       * queried to return this PartitionEventRecord.
+       * 
+ * + * string partition_token = 3; + * + * @param value The partitionToken to set. + * @return This builder for chaining. + */ + public Builder setPartitionToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + partitionToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+       * Unique partition identifier describing the partition this event
+       * occurred on.
+       * [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token]
+       * is equal to the partition token of the change stream partition currently
+       * queried to return this PartitionEventRecord.
+       * 
+ * + * string partition_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPartitionToken() { + partitionToken_ = getDefaultInstance().getPartitionToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+       * Unique partition identifier describing the partition this event
+       * occurred on.
+       * [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token]
+       * is equal to the partition token of the change stream partition currently
+       * queried to return this PartitionEventRecord.
+       * 
+ * + * string partition_token = 3; + * + * @param value The bytes for partitionToken to set. + * @return This builder for chaining. + */ + public Builder setPartitionTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + partitionToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.util.List< + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent> + moveInEvents_ = java.util.Collections.emptyList(); + + private void ensureMoveInEventsIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + moveInEvents_ = + new java.util.ArrayList< + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent>( + moveInEvents_); + bitField0_ |= 0x00000008; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent, + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent.Builder, + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEventOrBuilder> + moveInEventsBuilder_; + + /** + * + * + *
+       * Set when one or more key ranges are moved into the change stream
+       * partition identified by
+       * [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token].
+       *
+       * Example: Two key ranges are moved into partition (P1) from partition (P2)
+       * and partition (P3) in a single transaction at timestamp T.
+       *
+       * The PartitionEventRecord returned in P1 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P1"
+       *   move_in_events {
+       *     source_partition_token: "P2"
+       *   }
+       *   move_in_events {
+       *     source_partition_token: "P3"
+       *   }
+       * }
+       *
+       * The PartitionEventRecord returned in P2 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P2"
+       *   move_out_events {
+       *     destination_partition_token: "P1"
+       *   }
+       * }
+       *
+       * The PartitionEventRecord returned in P3 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P3"
+       *   move_out_events {
+       *     destination_partition_token: "P1"
+       *   }
+       * }
+       * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent move_in_events = 4; + * + */ + public java.util.List< + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent> + getMoveInEventsList() { + if (moveInEventsBuilder_ == null) { + return java.util.Collections.unmodifiableList(moveInEvents_); + } else { + return moveInEventsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+       * Set when one or more key ranges are moved into the change stream
+       * partition identified by
+       * [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token].
+       *
+       * Example: Two key ranges are moved into partition (P1) from partition (P2)
+       * and partition (P3) in a single transaction at timestamp T.
+       *
+       * The PartitionEventRecord returned in P1 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P1"
+       *   move_in_events {
+       *     source_partition_token: "P2"
+       *   }
+       *   move_in_events {
+       *     source_partition_token: "P3"
+       *   }
+       * }
+       *
+       * The PartitionEventRecord returned in P2 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P2"
+       *   move_out_events {
+       *     destination_partition_token: "P1"
+       *   }
+       * }
+       *
+       * The PartitionEventRecord returned in P3 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P3"
+       *   move_out_events {
+       *     destination_partition_token: "P1"
+       *   }
+       * }
+       * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent move_in_events = 4; + * + */ + public int getMoveInEventsCount() { + if (moveInEventsBuilder_ == null) { + return moveInEvents_.size(); + } else { + return moveInEventsBuilder_.getCount(); + } + } + + /** + * + * + *
+       * Set when one or more key ranges are moved into the change stream
+       * partition identified by
+       * [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token].
+       *
+       * Example: Two key ranges are moved into partition (P1) from partition (P2)
+       * and partition (P3) in a single transaction at timestamp T.
+       *
+       * The PartitionEventRecord returned in P1 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P1"
+       *   move_in_events {
+       *     source_partition_token: "P2"
+       *   }
+       *   move_in_events {
+       *     source_partition_token: "P3"
+       *   }
+       * }
+       *
+       * The PartitionEventRecord returned in P2 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P2"
+       *   move_out_events {
+       *     destination_partition_token: "P1"
+       *   }
+       * }
+       *
+       * The PartitionEventRecord returned in P3 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P3"
+       *   move_out_events {
+       *     destination_partition_token: "P1"
+       *   }
+       * }
+       * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent move_in_events = 4; + * + */ + public com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent + getMoveInEvents(int index) { + if (moveInEventsBuilder_ == null) { + return moveInEvents_.get(index); + } else { + return moveInEventsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+       * Set when one or more key ranges are moved into the change stream
+       * partition identified by
+       * [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token].
+       *
+       * Example: Two key ranges are moved into partition (P1) from partition (P2)
+       * and partition (P3) in a single transaction at timestamp T.
+       *
+       * The PartitionEventRecord returned in P1 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P1"
+       *   move_in_events {
+       *     source_partition_token: "P2"
+       *   }
+       *   move_in_events {
+       *     source_partition_token: "P3"
+       *   }
+       * }
+       *
+       * The PartitionEventRecord returned in P2 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P2"
+       *   move_out_events {
+       *     destination_partition_token: "P1"
+       *   }
+       * }
+       *
+       * The PartitionEventRecord returned in P3 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P3"
+       *   move_out_events {
+       *     destination_partition_token: "P1"
+       *   }
+       * }
+       * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent move_in_events = 4; + * + */ + public Builder setMoveInEvents( + int index, + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent value) { + if (moveInEventsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMoveInEventsIsMutable(); + moveInEvents_.set(index, value); + onChanged(); + } else { + moveInEventsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+       * Set when one or more key ranges are moved into the change stream
+       * partition identified by
+       * [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token].
+       *
+       * Example: Two key ranges are moved into partition (P1) from partition (P2)
+       * and partition (P3) in a single transaction at timestamp T.
+       *
+       * The PartitionEventRecord returned in P1 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P1"
+       *   move_in_events {
+       *     source_partition_token: "P2"
+       *   }
+       *   move_in_events {
+       *     source_partition_token: "P3"
+       *   }
+       * }
+       *
+       * The PartitionEventRecord returned in P2 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P2"
+       *   move_out_events {
+       *     destination_partition_token: "P1"
+       *   }
+       * }
+       *
+       * The PartitionEventRecord returned in P3 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P3"
+       *   move_out_events {
+       *     destination_partition_token: "P1"
+       *   }
+       * }
+       * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent move_in_events = 4; + * + */ + public Builder setMoveInEvents( + int index, + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent.Builder + builderForValue) { + if (moveInEventsBuilder_ == null) { + ensureMoveInEventsIsMutable(); + moveInEvents_.set(index, builderForValue.build()); + onChanged(); + } else { + moveInEventsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * Set when one or more key ranges are moved into the change stream
+       * partition identified by
+       * [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token].
+       *
+       * Example: Two key ranges are moved into partition (P1) from partition (P2)
+       * and partition (P3) in a single transaction at timestamp T.
+       *
+       * The PartitionEventRecord returned in P1 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P1"
+       *   move_in_events {
+       *     source_partition_token: "P2"
+       *   }
+       *   move_in_events {
+       *     source_partition_token: "P3"
+       *   }
+       * }
+       *
+       * The PartitionEventRecord returned in P2 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P2"
+       *   move_out_events {
+       *     destination_partition_token: "P1"
+       *   }
+       * }
+       *
+       * The PartitionEventRecord returned in P3 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P3"
+       *   move_out_events {
+       *     destination_partition_token: "P1"
+       *   }
+       * }
+       * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent move_in_events = 4; + * + */ + public Builder addMoveInEvents( + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent value) { + if (moveInEventsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMoveInEventsIsMutable(); + moveInEvents_.add(value); + onChanged(); + } else { + moveInEventsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+       * Set when one or more key ranges are moved into the change stream
+       * partition identified by
+       * [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token].
+       *
+       * Example: Two key ranges are moved into partition (P1) from partition (P2)
+       * and partition (P3) in a single transaction at timestamp T.
+       *
+       * The PartitionEventRecord returned in P1 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P1"
+       *   move_in_events {
+       *     source_partition_token: "P2"
+       *   }
+       *   move_in_events {
+       *     source_partition_token: "P3"
+       *   }
+       * }
+       *
+       * The PartitionEventRecord returned in P2 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P2"
+       *   move_out_events {
+       *     destination_partition_token: "P1"
+       *   }
+       * }
+       *
+       * The PartitionEventRecord returned in P3 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P3"
+       *   move_out_events {
+       *     destination_partition_token: "P1"
+       *   }
+       * }
+       * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent move_in_events = 4; + * + */ + public Builder addMoveInEvents( + int index, + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent value) { + if (moveInEventsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMoveInEventsIsMutable(); + moveInEvents_.add(index, value); + onChanged(); + } else { + moveInEventsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+       * Set when one or more key ranges are moved into the change stream
+       * partition identified by
+       * [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token].
+       *
+       * Example: Two key ranges are moved into partition (P1) from partition (P2)
+       * and partition (P3) in a single transaction at timestamp T.
+       *
+       * The PartitionEventRecord returned in P1 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P1"
+       *   move_in_events {
+       *     source_partition_token: "P2"
+       *   }
+       *   move_in_events {
+       *     source_partition_token: "P3"
+       *   }
+       * }
+       *
+       * The PartitionEventRecord returned in P2 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P2"
+       *   move_out_events {
+       *     destination_partition_token: "P1"
+       *   }
+       * }
+       *
+       * The PartitionEventRecord returned in P3 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P3"
+       *   move_out_events {
+       *     destination_partition_token: "P1"
+       *   }
+       * }
+       * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent move_in_events = 4; + * + */ + public Builder addMoveInEvents( + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent.Builder + builderForValue) { + if (moveInEventsBuilder_ == null) { + ensureMoveInEventsIsMutable(); + moveInEvents_.add(builderForValue.build()); + onChanged(); + } else { + moveInEventsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * Set when one or more key ranges are moved into the change stream
+       * partition identified by
+       * [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token].
+       *
+       * Example: Two key ranges are moved into partition (P1) from partition (P2)
+       * and partition (P3) in a single transaction at timestamp T.
+       *
+       * The PartitionEventRecord returned in P1 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P1"
+       *   move_in_events {
+       *     source_partition_token: "P2"
+       *   }
+       *   move_in_events {
+       *     source_partition_token: "P3"
+       *   }
+       * }
+       *
+       * The PartitionEventRecord returned in P2 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P2"
+       *   move_out_events {
+       *     destination_partition_token: "P1"
+       *   }
+       * }
+       *
+       * The PartitionEventRecord returned in P3 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P3"
+       *   move_out_events {
+       *     destination_partition_token: "P1"
+       *   }
+       * }
+       * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent move_in_events = 4; + * + */ + public Builder addMoveInEvents( + int index, + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent.Builder + builderForValue) { + if (moveInEventsBuilder_ == null) { + ensureMoveInEventsIsMutable(); + moveInEvents_.add(index, builderForValue.build()); + onChanged(); + } else { + moveInEventsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * Set when one or more key ranges are moved into the change stream
+       * partition identified by
+       * [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token].
+       *
+       * Example: Two key ranges are moved into partition (P1) from partition (P2)
+       * and partition (P3) in a single transaction at timestamp T.
+       *
+       * The PartitionEventRecord returned in P1 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P1"
+       *   move_in_events {
+       *     source_partition_token: "P2"
+       *   }
+       *   move_in_events {
+       *     source_partition_token: "P3"
+       *   }
+       * }
+       *
+       * The PartitionEventRecord returned in P2 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P2"
+       *   move_out_events {
+       *     destination_partition_token: "P1"
+       *   }
+       * }
+       *
+       * The PartitionEventRecord returned in P3 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P3"
+       *   move_out_events {
+       *     destination_partition_token: "P1"
+       *   }
+       * }
+       * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent move_in_events = 4; + * + */ + public Builder addAllMoveInEvents( + java.lang.Iterable< + ? extends + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent> + values) { + if (moveInEventsBuilder_ == null) { + ensureMoveInEventsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, moveInEvents_); + onChanged(); + } else { + moveInEventsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+       * Set when one or more key ranges are moved into the change stream
+       * partition identified by
+       * [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token].
+       *
+       * Example: Two key ranges are moved into partition (P1) from partition (P2)
+       * and partition (P3) in a single transaction at timestamp T.
+       *
+       * The PartitionEventRecord returned in P1 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P1"
+       *   move_in_events {
+       *     source_partition_token: "P2"
+       *   }
+       *   move_in_events {
+       *     source_partition_token: "P3"
+       *   }
+       * }
+       *
+       * The PartitionEventRecord returned in P2 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P2"
+       *   move_out_events {
+       *     destination_partition_token: "P1"
+       *   }
+       * }
+       *
+       * The PartitionEventRecord returned in P3 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P3"
+       *   move_out_events {
+       *     destination_partition_token: "P1"
+       *   }
+       * }
+       * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent move_in_events = 4; + * + */ + public Builder clearMoveInEvents() { + if (moveInEventsBuilder_ == null) { + moveInEvents_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + } else { + moveInEventsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+       * Set when one or more key ranges are moved into the change stream
+       * partition identified by
+       * [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token].
+       *
+       * Example: Two key ranges are moved into partition (P1) from partition (P2)
+       * and partition (P3) in a single transaction at timestamp T.
+       *
+       * The PartitionEventRecord returned in P1 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P1"
+       *   move_in_events {
+       *     source_partition_token: "P2"
+       *   }
+       *   move_in_events {
+       *     source_partition_token: "P3"
+       *   }
+       * }
+       *
+       * The PartitionEventRecord returned in P2 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P2"
+       *   move_out_events {
+       *     destination_partition_token: "P1"
+       *   }
+       * }
+       *
+       * The PartitionEventRecord returned in P3 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P3"
+       *   move_out_events {
+       *     destination_partition_token: "P1"
+       *   }
+       * }
+       * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent move_in_events = 4; + * + */ + public Builder removeMoveInEvents(int index) { + if (moveInEventsBuilder_ == null) { + ensureMoveInEventsIsMutable(); + moveInEvents_.remove(index); + onChanged(); + } else { + moveInEventsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+       * Set when one or more key ranges are moved into the change stream
+       * partition identified by
+       * [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token].
+       *
+       * Example: Two key ranges are moved into partition (P1) from partition (P2)
+       * and partition (P3) in a single transaction at timestamp T.
+       *
+       * The PartitionEventRecord returned in P1 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P1"
+       *   move_in_events {
+       *     source_partition_token: "P2"
+       *   }
+       *   move_in_events {
+       *     source_partition_token: "P3"
+       *   }
+       * }
+       *
+       * The PartitionEventRecord returned in P2 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P2"
+       *   move_out_events {
+       *     destination_partition_token: "P1"
+       *   }
+       * }
+       *
+       * The PartitionEventRecord returned in P3 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P3"
+       *   move_out_events {
+       *     destination_partition_token: "P1"
+       *   }
+       * }
+       * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent move_in_events = 4; + * + */ + public com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent.Builder + getMoveInEventsBuilder(int index) { + return getMoveInEventsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+       * Set when one or more key ranges are moved into the change stream
+       * partition identified by
+       * [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token].
+       *
+       * Example: Two key ranges are moved into partition (P1) from partition (P2)
+       * and partition (P3) in a single transaction at timestamp T.
+       *
+       * The PartitionEventRecord returned in P1 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P1"
+       *   move_in_events {
+       *     source_partition_token: "P2"
+       *   }
+       *   move_in_events {
+       *     source_partition_token: "P3"
+       *   }
+       * }
+       *
+       * The PartitionEventRecord returned in P2 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P2"
+       *   move_out_events {
+       *     destination_partition_token: "P1"
+       *   }
+       * }
+       *
+       * The PartitionEventRecord returned in P3 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P3"
+       *   move_out_events {
+       *     destination_partition_token: "P1"
+       *   }
+       * }
+       * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent move_in_events = 4; + * + */ + public com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEventOrBuilder + getMoveInEventsOrBuilder(int index) { + if (moveInEventsBuilder_ == null) { + return moveInEvents_.get(index); + } else { + return moveInEventsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+       * Set when one or more key ranges are moved into the change stream
+       * partition identified by
+       * [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token].
+       *
+       * Example: Two key ranges are moved into partition (P1) from partition (P2)
+       * and partition (P3) in a single transaction at timestamp T.
+       *
+       * The PartitionEventRecord returned in P1 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P1"
+       *   move_in_events {
+       *     source_partition_token: "P2"
+       *   }
+       *   move_in_events {
+       *     source_partition_token: "P3"
+       *   }
+       * }
+       *
+       * The PartitionEventRecord returned in P2 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P2"
+       *   move_out_events {
+       *     destination_partition_token: "P1"
+       *   }
+       * }
+       *
+       * The PartitionEventRecord returned in P3 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P3"
+       *   move_out_events {
+       *     destination_partition_token: "P1"
+       *   }
+       * }
+       * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent move_in_events = 4; + * + */ + public java.util.List< + ? extends + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord + .MoveInEventOrBuilder> + getMoveInEventsOrBuilderList() { + if (moveInEventsBuilder_ != null) { + return moveInEventsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(moveInEvents_); + } + } + + /** + * + * + *
+       * Set when one or more key ranges are moved into the change stream
+       * partition identified by
+       * [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token].
+       *
+       * Example: Two key ranges are moved into partition (P1) from partition (P2)
+       * and partition (P3) in a single transaction at timestamp T.
+       *
+       * The PartitionEventRecord returned in P1 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P1"
+       *   move_in_events {
+       *     source_partition_token: "P2"
+       *   }
+       *   move_in_events {
+       *     source_partition_token: "P3"
+       *   }
+       * }
+       *
+       * The PartitionEventRecord returned in P2 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P2"
+       *   move_out_events {
+       *     destination_partition_token: "P1"
+       *   }
+       * }
+       *
+       * The PartitionEventRecord returned in P3 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P3"
+       *   move_out_events {
+       *     destination_partition_token: "P1"
+       *   }
+       * }
+       * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent move_in_events = 4; + * + */ + public com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent.Builder + addMoveInEventsBuilder() { + return getMoveInEventsFieldBuilder() + .addBuilder( + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent + .getDefaultInstance()); + } + + /** + * + * + *
+       * Set when one or more key ranges are moved into the change stream
+       * partition identified by
+       * [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token].
+       *
+       * Example: Two key ranges are moved into partition (P1) from partition (P2)
+       * and partition (P3) in a single transaction at timestamp T.
+       *
+       * The PartitionEventRecord returned in P1 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P1"
+       *   move_in_events {
+       *     source_partition_token: "P2"
+       *   }
+       *   move_in_events {
+       *     source_partition_token: "P3"
+       *   }
+       * }
+       *
+       * The PartitionEventRecord returned in P2 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P2"
+       *   move_out_events {
+       *     destination_partition_token: "P1"
+       *   }
+       * }
+       *
+       * The PartitionEventRecord returned in P3 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P3"
+       *   move_out_events {
+       *     destination_partition_token: "P1"
+       *   }
+       * }
+       * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent move_in_events = 4; + * + */ + public com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent.Builder + addMoveInEventsBuilder(int index) { + return getMoveInEventsFieldBuilder() + .addBuilder( + index, + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent + .getDefaultInstance()); + } + + /** + * + * + *
+       * Set when one or more key ranges are moved into the change stream
+       * partition identified by
+       * [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token].
+       *
+       * Example: Two key ranges are moved into partition (P1) from partition (P2)
+       * and partition (P3) in a single transaction at timestamp T.
+       *
+       * The PartitionEventRecord returned in P1 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P1"
+       *   move_in_events {
+       *     source_partition_token: "P2"
+       *   }
+       *   move_in_events {
+       *     source_partition_token: "P3"
+       *   }
+       * }
+       *
+       * The PartitionEventRecord returned in P2 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P2"
+       *   move_out_events {
+       *     destination_partition_token: "P1"
+       *   }
+       * }
+       *
+       * The PartitionEventRecord returned in P3 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P3"
+       *   move_out_events {
+       *     destination_partition_token: "P1"
+       *   }
+       * }
+       * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent move_in_events = 4; + * + */ + public java.util.List< + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent.Builder> + getMoveInEventsBuilderList() { + return getMoveInEventsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent, + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent.Builder, + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEventOrBuilder> + getMoveInEventsFieldBuilder() { + if (moveInEventsBuilder_ == null) { + moveInEventsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent, + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent.Builder, + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord + .MoveInEventOrBuilder>( + moveInEvents_, + ((bitField0_ & 0x00000008) != 0), + getParentForChildren(), + isClean()); + moveInEvents_ = null; + } + return moveInEventsBuilder_; + } + + private java.util.List< + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent> + moveOutEvents_ = java.util.Collections.emptyList(); + + private void ensureMoveOutEventsIsMutable() { + if (!((bitField0_ & 0x00000010) != 0)) { + moveOutEvents_ = + new java.util.ArrayList< + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent>( + moveOutEvents_); + bitField0_ |= 0x00000010; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent, + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent.Builder, + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEventOrBuilder> + moveOutEventsBuilder_; + + /** + * + * + *
+       * Set when one or more key ranges are moved out of the change stream
+       * partition identified by
+       * [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token].
+       *
+       * Example: Two key ranges are moved out of partition (P1) to partition (P2)
+       * and partition (P3) in a single transaction at timestamp T.
+       *
+       * The PartitionEventRecord returned in P1 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P1"
+       *   move_out_events {
+       *     destination_partition_token: "P2"
+       *   }
+       *   move_out_events {
+       *     destination_partition_token: "P3"
+       *   }
+       * }
+       *
+       * The PartitionEventRecord returned in P2 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P2"
+       *   move_in_events {
+       *     source_partition_token: "P1"
+       *   }
+       * }
+       *
+       * The PartitionEventRecord returned in P3 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P3"
+       *   move_in_events {
+       *     source_partition_token: "P1"
+       *   }
+       * }
+       * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent move_out_events = 5; + * + */ + public java.util.List< + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent> + getMoveOutEventsList() { + if (moveOutEventsBuilder_ == null) { + return java.util.Collections.unmodifiableList(moveOutEvents_); + } else { + return moveOutEventsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+       * Set when one or more key ranges are moved out of the change stream
+       * partition identified by
+       * [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token].
+       *
+       * Example: Two key ranges are moved out of partition (P1) to partition (P2)
+       * and partition (P3) in a single transaction at timestamp T.
+       *
+       * The PartitionEventRecord returned in P1 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P1"
+       *   move_out_events {
+       *     destination_partition_token: "P2"
+       *   }
+       *   move_out_events {
+       *     destination_partition_token: "P3"
+       *   }
+       * }
+       *
+       * The PartitionEventRecord returned in P2 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P2"
+       *   move_in_events {
+       *     source_partition_token: "P1"
+       *   }
+       * }
+       *
+       * The PartitionEventRecord returned in P3 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P3"
+       *   move_in_events {
+       *     source_partition_token: "P1"
+       *   }
+       * }
+       * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent move_out_events = 5; + * + */ + public int getMoveOutEventsCount() { + if (moveOutEventsBuilder_ == null) { + return moveOutEvents_.size(); + } else { + return moveOutEventsBuilder_.getCount(); + } + } + + /** + * + * + *
+       * Set when one or more key ranges are moved out of the change stream
+       * partition identified by
+       * [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token].
+       *
+       * Example: Two key ranges are moved out of partition (P1) to partition (P2)
+       * and partition (P3) in a single transaction at timestamp T.
+       *
+       * The PartitionEventRecord returned in P1 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P1"
+       *   move_out_events {
+       *     destination_partition_token: "P2"
+       *   }
+       *   move_out_events {
+       *     destination_partition_token: "P3"
+       *   }
+       * }
+       *
+       * The PartitionEventRecord returned in P2 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P2"
+       *   move_in_events {
+       *     source_partition_token: "P1"
+       *   }
+       * }
+       *
+       * The PartitionEventRecord returned in P3 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P3"
+       *   move_in_events {
+       *     source_partition_token: "P1"
+       *   }
+       * }
+       * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent move_out_events = 5; + * + */ + public com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent + getMoveOutEvents(int index) { + if (moveOutEventsBuilder_ == null) { + return moveOutEvents_.get(index); + } else { + return moveOutEventsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+       * Set when one or more key ranges are moved out of the change stream
+       * partition identified by
+       * [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token].
+       *
+       * Example: Two key ranges are moved out of partition (P1) to partition (P2)
+       * and partition (P3) in a single transaction at timestamp T.
+       *
+       * The PartitionEventRecord returned in P1 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P1"
+       *   move_out_events {
+       *     destination_partition_token: "P2"
+       *   }
+       *   move_out_events {
+       *     destination_partition_token: "P3"
+       *   }
+       * }
+       *
+       * The PartitionEventRecord returned in P2 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P2"
+       *   move_in_events {
+       *     source_partition_token: "P1"
+       *   }
+       * }
+       *
+       * The PartitionEventRecord returned in P3 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P3"
+       *   move_in_events {
+       *     source_partition_token: "P1"
+       *   }
+       * }
+       * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent move_out_events = 5; + * + */ + public Builder setMoveOutEvents( + int index, + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent value) { + if (moveOutEventsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMoveOutEventsIsMutable(); + moveOutEvents_.set(index, value); + onChanged(); + } else { + moveOutEventsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+       * Set when one or more key ranges are moved out of the change stream
+       * partition identified by
+       * [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token].
+       *
+       * Example: Two key ranges are moved out of partition (P1) to partition (P2)
+       * and partition (P3) in a single transaction at timestamp T.
+       *
+       * The PartitionEventRecord returned in P1 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P1"
+       *   move_out_events {
+       *     destination_partition_token: "P2"
+       *   }
+       *   move_out_events {
+       *     destination_partition_token: "P3"
+       *   }
+       * }
+       *
+       * The PartitionEventRecord returned in P2 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P2"
+       *   move_in_events {
+       *     source_partition_token: "P1"
+       *   }
+       * }
+       *
+       * The PartitionEventRecord returned in P3 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P3"
+       *   move_in_events {
+       *     source_partition_token: "P1"
+       *   }
+       * }
+       * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent move_out_events = 5; + * + */ + public Builder setMoveOutEvents( + int index, + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent.Builder + builderForValue) { + if (moveOutEventsBuilder_ == null) { + ensureMoveOutEventsIsMutable(); + moveOutEvents_.set(index, builderForValue.build()); + onChanged(); + } else { + moveOutEventsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * Set when one or more key ranges are moved out of the change stream
+       * partition identified by
+       * [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token].
+       *
+       * Example: Two key ranges are moved out of partition (P1) to partition (P2)
+       * and partition (P3) in a single transaction at timestamp T.
+       *
+       * The PartitionEventRecord returned in P1 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P1"
+       *   move_out_events {
+       *     destination_partition_token: "P2"
+       *   }
+       *   move_out_events {
+       *     destination_partition_token: "P3"
+       *   }
+       * }
+       *
+       * The PartitionEventRecord returned in P2 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P2"
+       *   move_in_events {
+       *     source_partition_token: "P1"
+       *   }
+       * }
+       *
+       * The PartitionEventRecord returned in P3 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P3"
+       *   move_in_events {
+       *     source_partition_token: "P1"
+       *   }
+       * }
+       * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent move_out_events = 5; + * + */ + public Builder addMoveOutEvents( + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent value) { + if (moveOutEventsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMoveOutEventsIsMutable(); + moveOutEvents_.add(value); + onChanged(); + } else { + moveOutEventsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+       * Set when one or more key ranges are moved out of the change stream
+       * partition identified by
+       * [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token].
+       *
+       * Example: Two key ranges are moved out of partition (P1) to partition (P2)
+       * and partition (P3) in a single transaction at timestamp T.
+       *
+       * The PartitionEventRecord returned in P1 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P1"
+       *   move_out_events {
+       *     destination_partition_token: "P2"
+       *   }
+       *   move_out_events {
+       *     destination_partition_token: "P3"
+       *   }
+       * }
+       *
+       * The PartitionEventRecord returned in P2 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P2"
+       *   move_in_events {
+       *     source_partition_token: "P1"
+       *   }
+       * }
+       *
+       * The PartitionEventRecord returned in P3 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P3"
+       *   move_in_events {
+       *     source_partition_token: "P1"
+       *   }
+       * }
+       * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent move_out_events = 5; + * + */ + public Builder addMoveOutEvents( + int index, + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent value) { + if (moveOutEventsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMoveOutEventsIsMutable(); + moveOutEvents_.add(index, value); + onChanged(); + } else { + moveOutEventsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+       * Set when one or more key ranges are moved out of the change stream
+       * partition identified by
+       * [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token].
+       *
+       * Example: Two key ranges are moved out of partition (P1) to partition (P2)
+       * and partition (P3) in a single transaction at timestamp T.
+       *
+       * The PartitionEventRecord returned in P1 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P1"
+       *   move_out_events {
+       *     destination_partition_token: "P2"
+       *   }
+       *   move_out_events {
+       *     destination_partition_token: "P3"
+       *   }
+       * }
+       *
+       * The PartitionEventRecord returned in P2 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P2"
+       *   move_in_events {
+       *     source_partition_token: "P1"
+       *   }
+       * }
+       *
+       * The PartitionEventRecord returned in P3 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P3"
+       *   move_in_events {
+       *     source_partition_token: "P1"
+       *   }
+       * }
+       * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent move_out_events = 5; + * + */ + public Builder addMoveOutEvents( + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent.Builder + builderForValue) { + if (moveOutEventsBuilder_ == null) { + ensureMoveOutEventsIsMutable(); + moveOutEvents_.add(builderForValue.build()); + onChanged(); + } else { + moveOutEventsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * Set when one or more key ranges are moved out of the change stream
+       * partition identified by
+       * [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token].
+       *
+       * Example: Two key ranges are moved out of partition (P1) to partition (P2)
+       * and partition (P3) in a single transaction at timestamp T.
+       *
+       * The PartitionEventRecord returned in P1 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P1"
+       *   move_out_events {
+       *     destination_partition_token: "P2"
+       *   }
+       *   move_out_events {
+       *     destination_partition_token: "P3"
+       *   }
+       * }
+       *
+       * The PartitionEventRecord returned in P2 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P2"
+       *   move_in_events {
+       *     source_partition_token: "P1"
+       *   }
+       * }
+       *
+       * The PartitionEventRecord returned in P3 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P3"
+       *   move_in_events {
+       *     source_partition_token: "P1"
+       *   }
+       * }
+       * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent move_out_events = 5; + * + */ + public Builder addMoveOutEvents( + int index, + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent.Builder + builderForValue) { + if (moveOutEventsBuilder_ == null) { + ensureMoveOutEventsIsMutable(); + moveOutEvents_.add(index, builderForValue.build()); + onChanged(); + } else { + moveOutEventsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * Set when one or more key ranges are moved out of the change stream
+       * partition identified by
+       * [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token].
+       *
+       * Example: Two key ranges are moved out of partition (P1) to partition (P2)
+       * and partition (P3) in a single transaction at timestamp T.
+       *
+       * The PartitionEventRecord returned in P1 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P1"
+       *   move_out_events {
+       *     destination_partition_token: "P2"
+       *   }
+       *   move_out_events {
+       *     destination_partition_token: "P3"
+       *   }
+       * }
+       *
+       * The PartitionEventRecord returned in P2 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P2"
+       *   move_in_events {
+       *     source_partition_token: "P1"
+       *   }
+       * }
+       *
+       * The PartitionEventRecord returned in P3 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P3"
+       *   move_in_events {
+       *     source_partition_token: "P1"
+       *   }
+       * }
+       * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent move_out_events = 5; + * + */ + public Builder addAllMoveOutEvents( + java.lang.Iterable< + ? extends + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent> + values) { + if (moveOutEventsBuilder_ == null) { + ensureMoveOutEventsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, moveOutEvents_); + onChanged(); + } else { + moveOutEventsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+       * Set when one or more key ranges are moved out of the change stream
+       * partition identified by
+       * [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token].
+       *
+       * Example: Two key ranges are moved out of partition (P1) to partition (P2)
+       * and partition (P3) in a single transaction at timestamp T.
+       *
+       * The PartitionEventRecord returned in P1 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P1"
+       *   move_out_events {
+       *     destination_partition_token: "P2"
+       *   }
+       *   move_out_events {
+       *     destination_partition_token: "P3"
+       *   }
+       * }
+       *
+       * The PartitionEventRecord returned in P2 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P2"
+       *   move_in_events {
+       *     source_partition_token: "P1"
+       *   }
+       * }
+       *
+       * The PartitionEventRecord returned in P3 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P3"
+       *   move_in_events {
+       *     source_partition_token: "P1"
+       *   }
+       * }
+       * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent move_out_events = 5; + * + */ + public Builder clearMoveOutEvents() { + if (moveOutEventsBuilder_ == null) { + moveOutEvents_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + } else { + moveOutEventsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+       * Set when one or more key ranges are moved out of the change stream
+       * partition identified by
+       * [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token].
+       *
+       * Example: Two key ranges are moved out of partition (P1) to partition (P2)
+       * and partition (P3) in a single transaction at timestamp T.
+       *
+       * The PartitionEventRecord returned in P1 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P1"
+       *   move_out_events {
+       *     destination_partition_token: "P2"
+       *   }
+       *   move_out_events {
+       *     destination_partition_token: "P3"
+       *   }
+       * }
+       *
+       * The PartitionEventRecord returned in P2 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P2"
+       *   move_in_events {
+       *     source_partition_token: "P1"
+       *   }
+       * }
+       *
+       * The PartitionEventRecord returned in P3 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P3"
+       *   move_in_events {
+       *     source_partition_token: "P1"
+       *   }
+       * }
+       * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent move_out_events = 5; + * + */ + public Builder removeMoveOutEvents(int index) { + if (moveOutEventsBuilder_ == null) { + ensureMoveOutEventsIsMutable(); + moveOutEvents_.remove(index); + onChanged(); + } else { + moveOutEventsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+       * Set when one or more key ranges are moved out of the change stream
+       * partition identified by
+       * [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token].
+       *
+       * Example: Two key ranges are moved out of partition (P1) to partition (P2)
+       * and partition (P3) in a single transaction at timestamp T.
+       *
+       * The PartitionEventRecord returned in P1 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P1"
+       *   move_out_events {
+       *     destination_partition_token: "P2"
+       *   }
+       *   move_out_events {
+       *     destination_partition_token: "P3"
+       *   }
+       * }
+       *
+       * The PartitionEventRecord returned in P2 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P2"
+       *   move_in_events {
+       *     source_partition_token: "P1"
+       *   }
+       * }
+       *
+       * The PartitionEventRecord returned in P3 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P3"
+       *   move_in_events {
+       *     source_partition_token: "P1"
+       *   }
+       * }
+       * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent move_out_events = 5; + * + */ + public com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent.Builder + getMoveOutEventsBuilder(int index) { + return getMoveOutEventsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+       * Set when one or more key ranges are moved out of the change stream
+       * partition identified by
+       * [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token].
+       *
+       * Example: Two key ranges are moved out of partition (P1) to partition (P2)
+       * and partition (P3) in a single transaction at timestamp T.
+       *
+       * The PartitionEventRecord returned in P1 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P1"
+       *   move_out_events {
+       *     destination_partition_token: "P2"
+       *   }
+       *   move_out_events {
+       *     destination_partition_token: "P3"
+       *   }
+       * }
+       *
+       * The PartitionEventRecord returned in P2 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P2"
+       *   move_in_events {
+       *     source_partition_token: "P1"
+       *   }
+       * }
+       *
+       * The PartitionEventRecord returned in P3 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P3"
+       *   move_in_events {
+       *     source_partition_token: "P1"
+       *   }
+       * }
+       * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent move_out_events = 5; + * + */ + public com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEventOrBuilder + getMoveOutEventsOrBuilder(int index) { + if (moveOutEventsBuilder_ == null) { + return moveOutEvents_.get(index); + } else { + return moveOutEventsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+       * Set when one or more key ranges are moved out of the change stream
+       * partition identified by
+       * [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token].
+       *
+       * Example: Two key ranges are moved out of partition (P1) to partition (P2)
+       * and partition (P3) in a single transaction at timestamp T.
+       *
+       * The PartitionEventRecord returned in P1 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P1"
+       *   move_out_events {
+       *     destination_partition_token: "P2"
+       *   }
+       *   move_out_events {
+       *     destination_partition_token: "P3"
+       *   }
+       * }
+       *
+       * The PartitionEventRecord returned in P2 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P2"
+       *   move_in_events {
+       *     source_partition_token: "P1"
+       *   }
+       * }
+       *
+       * The PartitionEventRecord returned in P3 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P3"
+       *   move_in_events {
+       *     source_partition_token: "P1"
+       *   }
+       * }
+       * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent move_out_events = 5; + * + */ + public java.util.List< + ? extends + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord + .MoveOutEventOrBuilder> + getMoveOutEventsOrBuilderList() { + if (moveOutEventsBuilder_ != null) { + return moveOutEventsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(moveOutEvents_); + } + } + + /** + * + * + *
+       * Set when one or more key ranges are moved out of the change stream
+       * partition identified by
+       * [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token].
+       *
+       * Example: Two key ranges are moved out of partition (P1) to partition (P2)
+       * and partition (P3) in a single transaction at timestamp T.
+       *
+       * The PartitionEventRecord returned in P1 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P1"
+       *   move_out_events {
+       *     destination_partition_token: "P2"
+       *   }
+       *   move_out_events {
+       *     destination_partition_token: "P3"
+       *   }
+       * }
+       *
+       * The PartitionEventRecord returned in P2 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P2"
+       *   move_in_events {
+       *     source_partition_token: "P1"
+       *   }
+       * }
+       *
+       * The PartitionEventRecord returned in P3 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P3"
+       *   move_in_events {
+       *     source_partition_token: "P1"
+       *   }
+       * }
+       * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent move_out_events = 5; + * + */ + public com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent.Builder + addMoveOutEventsBuilder() { + return getMoveOutEventsFieldBuilder() + .addBuilder( + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent + .getDefaultInstance()); + } + + /** + * + * + *
+       * Set when one or more key ranges are moved out of the change stream
+       * partition identified by
+       * [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token].
+       *
+       * Example: Two key ranges are moved out of partition (P1) to partition (P2)
+       * and partition (P3) in a single transaction at timestamp T.
+       *
+       * The PartitionEventRecord returned in P1 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P1"
+       *   move_out_events {
+       *     destination_partition_token: "P2"
+       *   }
+       *   move_out_events {
+       *     destination_partition_token: "P3"
+       *   }
+       * }
+       *
+       * The PartitionEventRecord returned in P2 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P2"
+       *   move_in_events {
+       *     source_partition_token: "P1"
+       *   }
+       * }
+       *
+       * The PartitionEventRecord returned in P3 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P3"
+       *   move_in_events {
+       *     source_partition_token: "P1"
+       *   }
+       * }
+       * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent move_out_events = 5; + * + */ + public com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent.Builder + addMoveOutEventsBuilder(int index) { + return getMoveOutEventsFieldBuilder() + .addBuilder( + index, + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent + .getDefaultInstance()); + } + + /** + * + * + *
+       * Set when one or more key ranges are moved out of the change stream
+       * partition identified by
+       * [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token].
+       *
+       * Example: Two key ranges are moved out of partition (P1) to partition (P2)
+       * and partition (P3) in a single transaction at timestamp T.
+       *
+       * The PartitionEventRecord returned in P1 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P1"
+       *   move_out_events {
+       *     destination_partition_token: "P2"
+       *   }
+       *   move_out_events {
+       *     destination_partition_token: "P3"
+       *   }
+       * }
+       *
+       * The PartitionEventRecord returned in P2 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P2"
+       *   move_in_events {
+       *     source_partition_token: "P1"
+       *   }
+       * }
+       *
+       * The PartitionEventRecord returned in P3 will reflect the move as:
+       *
+       * PartitionEventRecord {
+       *   commit_timestamp: T
+       *   partition_token: "P3"
+       *   move_in_events {
+       *     source_partition_token: "P1"
+       *   }
+       * }
+       * 
+ * + * + * repeated .google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent move_out_events = 5; + * + */ + public java.util.List< + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent.Builder> + getMoveOutEventsBuilderList() { + return getMoveOutEventsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent, + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent.Builder, + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEventOrBuilder> + getMoveOutEventsFieldBuilder() { + if (moveOutEventsBuilder_ == null) { + moveOutEventsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent, + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent + .Builder, + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord + .MoveOutEventOrBuilder>( + moveOutEvents_, + ((bitField0_ & 0x00000010) != 0), + getParentForChildren(), + isClean()); + moveOutEvents_ = null; + } + return moveOutEventsBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.spanner.v1.ChangeStreamRecord.PartitionEventRecord) + } + + // @@protoc_insertion_point(class_scope:google.spanner.v1.ChangeStreamRecord.PartitionEventRecord) + private static final com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord(); + } + + public static com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PartitionEventRecord 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 com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int recordCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object record_; + + public enum RecordCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + DATA_CHANGE_RECORD(1), + HEARTBEAT_RECORD(2), + PARTITION_START_RECORD(3), + PARTITION_END_RECORD(4), + PARTITION_EVENT_RECORD(5), + RECORD_NOT_SET(0); + private final int value; + + private RecordCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static RecordCase valueOf(int value) { + return forNumber(value); + } + + public static RecordCase forNumber(int value) { + switch (value) { + case 1: + return DATA_CHANGE_RECORD; + case 2: + return HEARTBEAT_RECORD; + case 3: + return PARTITION_START_RECORD; + case 4: + return PARTITION_END_RECORD; + case 5: + return PARTITION_EVENT_RECORD; + case 0: + return RECORD_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public RecordCase getRecordCase() { + return RecordCase.forNumber(recordCase_); + } + + public static final int DATA_CHANGE_RECORD_FIELD_NUMBER = 1; + + /** + * + * + *
+   * Data change record describing a data change for a change stream
+   * partition.
+   * 
+ * + * .google.spanner.v1.ChangeStreamRecord.DataChangeRecord data_change_record = 1; + * + * @return Whether the dataChangeRecord field is set. + */ + @java.lang.Override + public boolean hasDataChangeRecord() { + return recordCase_ == 1; + } + + /** + * + * + *
+   * Data change record describing a data change for a change stream
+   * partition.
+   * 
+ * + * .google.spanner.v1.ChangeStreamRecord.DataChangeRecord data_change_record = 1; + * + * @return The dataChangeRecord. + */ + @java.lang.Override + public com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord getDataChangeRecord() { + if (recordCase_ == 1) { + return (com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord) record_; + } + return com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.getDefaultInstance(); + } + + /** + * + * + *
+   * Data change record describing a data change for a change stream
+   * partition.
+   * 
+ * + * .google.spanner.v1.ChangeStreamRecord.DataChangeRecord data_change_record = 1; + */ + @java.lang.Override + public com.google.spanner.v1.ChangeStreamRecord.DataChangeRecordOrBuilder + getDataChangeRecordOrBuilder() { + if (recordCase_ == 1) { + return (com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord) record_; + } + return com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.getDefaultInstance(); + } + + public static final int HEARTBEAT_RECORD_FIELD_NUMBER = 2; + + /** + * + * + *
+   * Heartbeat record describing a heartbeat for a change stream partition.
+   * 
+ * + * .google.spanner.v1.ChangeStreamRecord.HeartbeatRecord heartbeat_record = 2; + * + * @return Whether the heartbeatRecord field is set. + */ + @java.lang.Override + public boolean hasHeartbeatRecord() { + return recordCase_ == 2; + } + + /** + * + * + *
+   * Heartbeat record describing a heartbeat for a change stream partition.
+   * 
+ * + * .google.spanner.v1.ChangeStreamRecord.HeartbeatRecord heartbeat_record = 2; + * + * @return The heartbeatRecord. + */ + @java.lang.Override + public com.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord getHeartbeatRecord() { + if (recordCase_ == 2) { + return (com.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord) record_; + } + return com.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord.getDefaultInstance(); + } + + /** + * + * + *
+   * Heartbeat record describing a heartbeat for a change stream partition.
+   * 
+ * + * .google.spanner.v1.ChangeStreamRecord.HeartbeatRecord heartbeat_record = 2; + */ + @java.lang.Override + public com.google.spanner.v1.ChangeStreamRecord.HeartbeatRecordOrBuilder + getHeartbeatRecordOrBuilder() { + if (recordCase_ == 2) { + return (com.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord) record_; + } + return com.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord.getDefaultInstance(); + } + + public static final int PARTITION_START_RECORD_FIELD_NUMBER = 3; + + /** + * + * + *
+   * Partition start record describing a new change stream partition.
+   * 
+ * + * .google.spanner.v1.ChangeStreamRecord.PartitionStartRecord partition_start_record = 3; + * + * + * @return Whether the partitionStartRecord field is set. + */ + @java.lang.Override + public boolean hasPartitionStartRecord() { + return recordCase_ == 3; + } + + /** + * + * + *
+   * Partition start record describing a new change stream partition.
+   * 
+ * + * .google.spanner.v1.ChangeStreamRecord.PartitionStartRecord partition_start_record = 3; + * + * + * @return The partitionStartRecord. + */ + @java.lang.Override + public com.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord getPartitionStartRecord() { + if (recordCase_ == 3) { + return (com.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord) record_; + } + return com.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord.getDefaultInstance(); + } + + /** + * + * + *
+   * Partition start record describing a new change stream partition.
+   * 
+ * + * .google.spanner.v1.ChangeStreamRecord.PartitionStartRecord partition_start_record = 3; + * + */ + @java.lang.Override + public com.google.spanner.v1.ChangeStreamRecord.PartitionStartRecordOrBuilder + getPartitionStartRecordOrBuilder() { + if (recordCase_ == 3) { + return (com.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord) record_; + } + return com.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord.getDefaultInstance(); + } + + public static final int PARTITION_END_RECORD_FIELD_NUMBER = 4; + + /** + * + * + *
+   * Partition end record describing a terminated change stream partition.
+   * 
+ * + * .google.spanner.v1.ChangeStreamRecord.PartitionEndRecord partition_end_record = 4; + * + * @return Whether the partitionEndRecord field is set. + */ + @java.lang.Override + public boolean hasPartitionEndRecord() { + return recordCase_ == 4; + } + + /** + * + * + *
+   * Partition end record describing a terminated change stream partition.
+   * 
+ * + * .google.spanner.v1.ChangeStreamRecord.PartitionEndRecord partition_end_record = 4; + * + * @return The partitionEndRecord. + */ + @java.lang.Override + public com.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord getPartitionEndRecord() { + if (recordCase_ == 4) { + return (com.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord) record_; + } + return com.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord.getDefaultInstance(); + } + + /** + * + * + *
+   * Partition end record describing a terminated change stream partition.
+   * 
+ * + * .google.spanner.v1.ChangeStreamRecord.PartitionEndRecord partition_end_record = 4; + */ + @java.lang.Override + public com.google.spanner.v1.ChangeStreamRecord.PartitionEndRecordOrBuilder + getPartitionEndRecordOrBuilder() { + if (recordCase_ == 4) { + return (com.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord) record_; + } + return com.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord.getDefaultInstance(); + } + + public static final int PARTITION_EVENT_RECORD_FIELD_NUMBER = 5; + + /** + * + * + *
+   * Partition event record describing key range changes for a change stream
+   * partition.
+   * 
+ * + * .google.spanner.v1.ChangeStreamRecord.PartitionEventRecord partition_event_record = 5; + * + * + * @return Whether the partitionEventRecord field is set. + */ + @java.lang.Override + public boolean hasPartitionEventRecord() { + return recordCase_ == 5; + } + + /** + * + * + *
+   * Partition event record describing key range changes for a change stream
+   * partition.
+   * 
+ * + * .google.spanner.v1.ChangeStreamRecord.PartitionEventRecord partition_event_record = 5; + * + * + * @return The partitionEventRecord. + */ + @java.lang.Override + public com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord getPartitionEventRecord() { + if (recordCase_ == 5) { + return (com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord) record_; + } + return com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.getDefaultInstance(); + } + + /** + * + * + *
+   * Partition event record describing key range changes for a change stream
+   * partition.
+   * 
+ * + * .google.spanner.v1.ChangeStreamRecord.PartitionEventRecord partition_event_record = 5; + * + */ + @java.lang.Override + public com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecordOrBuilder + getPartitionEventRecordOrBuilder() { + if (recordCase_ == 5) { + return (com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord) record_; + } + return com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.getDefaultInstance(); + } + + 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 (recordCase_ == 1) { + output.writeMessage(1, (com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord) record_); + } + if (recordCase_ == 2) { + output.writeMessage(2, (com.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord) record_); + } + if (recordCase_ == 3) { + output.writeMessage( + 3, (com.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord) record_); + } + if (recordCase_ == 4) { + output.writeMessage(4, (com.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord) record_); + } + if (recordCase_ == 5) { + output.writeMessage( + 5, (com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord) record_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (recordCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord) record_); + } + if (recordCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord) record_); + } + if (recordCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, (com.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord) record_); + } + if (recordCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, (com.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord) record_); + } + if (recordCase_ == 5) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 5, (com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord) record_); + } + 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 com.google.spanner.v1.ChangeStreamRecord)) { + return super.equals(obj); + } + com.google.spanner.v1.ChangeStreamRecord other = (com.google.spanner.v1.ChangeStreamRecord) obj; + + if (!getRecordCase().equals(other.getRecordCase())) return false; + switch (recordCase_) { + case 1: + if (!getDataChangeRecord().equals(other.getDataChangeRecord())) return false; + break; + case 2: + if (!getHeartbeatRecord().equals(other.getHeartbeatRecord())) return false; + break; + case 3: + if (!getPartitionStartRecord().equals(other.getPartitionStartRecord())) return false; + break; + case 4: + if (!getPartitionEndRecord().equals(other.getPartitionEndRecord())) return false; + break; + case 5: + if (!getPartitionEventRecord().equals(other.getPartitionEventRecord())) return false; + break; + case 0: + default: + } + 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(); + switch (recordCase_) { + case 1: + hash = (37 * hash) + DATA_CHANGE_RECORD_FIELD_NUMBER; + hash = (53 * hash) + getDataChangeRecord().hashCode(); + break; + case 2: + hash = (37 * hash) + HEARTBEAT_RECORD_FIELD_NUMBER; + hash = (53 * hash) + getHeartbeatRecord().hashCode(); + break; + case 3: + hash = (37 * hash) + PARTITION_START_RECORD_FIELD_NUMBER; + hash = (53 * hash) + getPartitionStartRecord().hashCode(); + break; + case 4: + hash = (37 * hash) + PARTITION_END_RECORD_FIELD_NUMBER; + hash = (53 * hash) + getPartitionEndRecord().hashCode(); + break; + case 5: + hash = (37 * hash) + PARTITION_EVENT_RECORD_FIELD_NUMBER; + hash = (53 * hash) + getPartitionEventRecord().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.spanner.v1.ChangeStreamRecord parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.v1.ChangeStreamRecord parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.v1.ChangeStreamRecord parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.v1.ChangeStreamRecord parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.v1.ChangeStreamRecord parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.v1.ChangeStreamRecord parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.v1.ChangeStreamRecord parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.v1.ChangeStreamRecord parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.v1.ChangeStreamRecord parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.spanner.v1.ChangeStreamRecord parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.v1.ChangeStreamRecord parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.v1.ChangeStreamRecord parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.spanner.v1.ChangeStreamRecord 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.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Spanner Change Streams enable customers to capture and stream out changes to
+   * their Spanner databases in real-time. A change stream
+   * can be created with option partition_mode='IMMUTABLE_KEY_RANGE' or
+   * partition_mode='MUTABLE_KEY_RANGE'.
+   *
+   * This message is only used in Change Streams created with the option
+   * partition_mode='MUTABLE_KEY_RANGE'. Spanner automatically creates a special
+   * Table-Valued Function (TVF) along with each Change Streams. The function
+   * provides access to the change stream's records. The function is named
+   * READ_<change_stream_name> (where <change_stream_name> is the
+   * name of the change stream), and it returns a table with only one column
+   * called ChangeRecord.
+   * 
+ * + * Protobuf type {@code google.spanner.v1.ChangeStreamRecord} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.spanner.v1.ChangeStreamRecord) + com.google.spanner.v1.ChangeStreamRecordOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.v1.ChangeStreamProto + .internal_static_google_spanner_v1_ChangeStreamRecord_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.v1.ChangeStreamProto + .internal_static_google_spanner_v1_ChangeStreamRecord_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.v1.ChangeStreamRecord.class, + com.google.spanner.v1.ChangeStreamRecord.Builder.class); + } + + // Construct using com.google.spanner.v1.ChangeStreamRecord.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (dataChangeRecordBuilder_ != null) { + dataChangeRecordBuilder_.clear(); + } + if (heartbeatRecordBuilder_ != null) { + heartbeatRecordBuilder_.clear(); + } + if (partitionStartRecordBuilder_ != null) { + partitionStartRecordBuilder_.clear(); + } + if (partitionEndRecordBuilder_ != null) { + partitionEndRecordBuilder_.clear(); + } + if (partitionEventRecordBuilder_ != null) { + partitionEventRecordBuilder_.clear(); + } + recordCase_ = 0; + record_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.spanner.v1.ChangeStreamProto + .internal_static_google_spanner_v1_ChangeStreamRecord_descriptor; + } + + @java.lang.Override + public com.google.spanner.v1.ChangeStreamRecord getDefaultInstanceForType() { + return com.google.spanner.v1.ChangeStreamRecord.getDefaultInstance(); + } + + @java.lang.Override + public com.google.spanner.v1.ChangeStreamRecord build() { + com.google.spanner.v1.ChangeStreamRecord result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.spanner.v1.ChangeStreamRecord buildPartial() { + com.google.spanner.v1.ChangeStreamRecord result = + new com.google.spanner.v1.ChangeStreamRecord(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.spanner.v1.ChangeStreamRecord result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(com.google.spanner.v1.ChangeStreamRecord result) { + result.recordCase_ = recordCase_; + result.record_ = this.record_; + if (recordCase_ == 1 && dataChangeRecordBuilder_ != null) { + result.record_ = dataChangeRecordBuilder_.build(); + } + if (recordCase_ == 2 && heartbeatRecordBuilder_ != null) { + result.record_ = heartbeatRecordBuilder_.build(); + } + if (recordCase_ == 3 && partitionStartRecordBuilder_ != null) { + result.record_ = partitionStartRecordBuilder_.build(); + } + if (recordCase_ == 4 && partitionEndRecordBuilder_ != null) { + result.record_ = partitionEndRecordBuilder_.build(); + } + if (recordCase_ == 5 && partitionEventRecordBuilder_ != null) { + result.record_ = partitionEventRecordBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.spanner.v1.ChangeStreamRecord) { + return mergeFrom((com.google.spanner.v1.ChangeStreamRecord) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.spanner.v1.ChangeStreamRecord other) { + if (other == com.google.spanner.v1.ChangeStreamRecord.getDefaultInstance()) return this; + switch (other.getRecordCase()) { + case DATA_CHANGE_RECORD: + { + mergeDataChangeRecord(other.getDataChangeRecord()); + break; + } + case HEARTBEAT_RECORD: + { + mergeHeartbeatRecord(other.getHeartbeatRecord()); + break; + } + case PARTITION_START_RECORD: + { + mergePartitionStartRecord(other.getPartitionStartRecord()); + break; + } + case PARTITION_END_RECORD: + { + mergePartitionEndRecord(other.getPartitionEndRecord()); + break; + } + case PARTITION_EVENT_RECORD: + { + mergePartitionEventRecord(other.getPartitionEventRecord()); + break; + } + case RECORD_NOT_SET: + { + break; + } + } + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + getDataChangeRecordFieldBuilder().getBuilder(), extensionRegistry); + recordCase_ = 1; + break; + } // case 10 + case 18: + { + input.readMessage(getHeartbeatRecordFieldBuilder().getBuilder(), extensionRegistry); + recordCase_ = 2; + break; + } // case 18 + case 26: + { + input.readMessage( + getPartitionStartRecordFieldBuilder().getBuilder(), extensionRegistry); + recordCase_ = 3; + break; + } // case 26 + case 34: + { + input.readMessage( + getPartitionEndRecordFieldBuilder().getBuilder(), extensionRegistry); + recordCase_ = 4; + break; + } // case 34 + case 42: + { + input.readMessage( + getPartitionEventRecordFieldBuilder().getBuilder(), extensionRegistry); + recordCase_ = 5; + break; + } // case 42 + 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 recordCase_ = 0; + private java.lang.Object record_; + + public RecordCase getRecordCase() { + return RecordCase.forNumber(recordCase_); + } + + public Builder clearRecord() { + recordCase_ = 0; + record_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord, + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Builder, + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecordOrBuilder> + dataChangeRecordBuilder_; + + /** + * + * + *
+     * Data change record describing a data change for a change stream
+     * partition.
+     * 
+ * + * .google.spanner.v1.ChangeStreamRecord.DataChangeRecord data_change_record = 1; + * + * @return Whether the dataChangeRecord field is set. + */ + @java.lang.Override + public boolean hasDataChangeRecord() { + return recordCase_ == 1; + } + + /** + * + * + *
+     * Data change record describing a data change for a change stream
+     * partition.
+     * 
+ * + * .google.spanner.v1.ChangeStreamRecord.DataChangeRecord data_change_record = 1; + * + * @return The dataChangeRecord. + */ + @java.lang.Override + public com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord getDataChangeRecord() { + if (dataChangeRecordBuilder_ == null) { + if (recordCase_ == 1) { + return (com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord) record_; + } + return com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.getDefaultInstance(); + } else { + if (recordCase_ == 1) { + return dataChangeRecordBuilder_.getMessage(); + } + return com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Data change record describing a data change for a change stream
+     * partition.
+     * 
+ * + * .google.spanner.v1.ChangeStreamRecord.DataChangeRecord data_change_record = 1; + */ + public Builder setDataChangeRecord( + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord value) { + if (dataChangeRecordBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + record_ = value; + onChanged(); + } else { + dataChangeRecordBuilder_.setMessage(value); + } + recordCase_ = 1; + return this; + } + + /** + * + * + *
+     * Data change record describing a data change for a change stream
+     * partition.
+     * 
+ * + * .google.spanner.v1.ChangeStreamRecord.DataChangeRecord data_change_record = 1; + */ + public Builder setDataChangeRecord( + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Builder builderForValue) { + if (dataChangeRecordBuilder_ == null) { + record_ = builderForValue.build(); + onChanged(); + } else { + dataChangeRecordBuilder_.setMessage(builderForValue.build()); + } + recordCase_ = 1; + return this; + } + + /** + * + * + *
+     * Data change record describing a data change for a change stream
+     * partition.
+     * 
+ * + * .google.spanner.v1.ChangeStreamRecord.DataChangeRecord data_change_record = 1; + */ + public Builder mergeDataChangeRecord( + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord value) { + if (dataChangeRecordBuilder_ == null) { + if (recordCase_ == 1 + && record_ + != com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.getDefaultInstance()) { + record_ = + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.newBuilder( + (com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord) record_) + .mergeFrom(value) + .buildPartial(); + } else { + record_ = value; + } + onChanged(); + } else { + if (recordCase_ == 1) { + dataChangeRecordBuilder_.mergeFrom(value); + } else { + dataChangeRecordBuilder_.setMessage(value); + } + } + recordCase_ = 1; + return this; + } + + /** + * + * + *
+     * Data change record describing a data change for a change stream
+     * partition.
+     * 
+ * + * .google.spanner.v1.ChangeStreamRecord.DataChangeRecord data_change_record = 1; + */ + public Builder clearDataChangeRecord() { + if (dataChangeRecordBuilder_ == null) { + if (recordCase_ == 1) { + recordCase_ = 0; + record_ = null; + onChanged(); + } + } else { + if (recordCase_ == 1) { + recordCase_ = 0; + record_ = null; + } + dataChangeRecordBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Data change record describing a data change for a change stream
+     * partition.
+     * 
+ * + * .google.spanner.v1.ChangeStreamRecord.DataChangeRecord data_change_record = 1; + */ + public com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Builder + getDataChangeRecordBuilder() { + return getDataChangeRecordFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Data change record describing a data change for a change stream
+     * partition.
+     * 
+ * + * .google.spanner.v1.ChangeStreamRecord.DataChangeRecord data_change_record = 1; + */ + @java.lang.Override + public com.google.spanner.v1.ChangeStreamRecord.DataChangeRecordOrBuilder + getDataChangeRecordOrBuilder() { + if ((recordCase_ == 1) && (dataChangeRecordBuilder_ != null)) { + return dataChangeRecordBuilder_.getMessageOrBuilder(); + } else { + if (recordCase_ == 1) { + return (com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord) record_; + } + return com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Data change record describing a data change for a change stream
+     * partition.
+     * 
+ * + * .google.spanner.v1.ChangeStreamRecord.DataChangeRecord data_change_record = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord, + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Builder, + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecordOrBuilder> + getDataChangeRecordFieldBuilder() { + if (dataChangeRecordBuilder_ == null) { + if (!(recordCase_ == 1)) { + record_ = com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.getDefaultInstance(); + } + dataChangeRecordBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord, + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Builder, + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecordOrBuilder>( + (com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord) record_, + getParentForChildren(), + isClean()); + record_ = null; + } + recordCase_ = 1; + onChanged(); + return dataChangeRecordBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord, + com.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord.Builder, + com.google.spanner.v1.ChangeStreamRecord.HeartbeatRecordOrBuilder> + heartbeatRecordBuilder_; + + /** + * + * + *
+     * Heartbeat record describing a heartbeat for a change stream partition.
+     * 
+ * + * .google.spanner.v1.ChangeStreamRecord.HeartbeatRecord heartbeat_record = 2; + * + * @return Whether the heartbeatRecord field is set. + */ + @java.lang.Override + public boolean hasHeartbeatRecord() { + return recordCase_ == 2; + } + + /** + * + * + *
+     * Heartbeat record describing a heartbeat for a change stream partition.
+     * 
+ * + * .google.spanner.v1.ChangeStreamRecord.HeartbeatRecord heartbeat_record = 2; + * + * @return The heartbeatRecord. + */ + @java.lang.Override + public com.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord getHeartbeatRecord() { + if (heartbeatRecordBuilder_ == null) { + if (recordCase_ == 2) { + return (com.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord) record_; + } + return com.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord.getDefaultInstance(); + } else { + if (recordCase_ == 2) { + return heartbeatRecordBuilder_.getMessage(); + } + return com.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Heartbeat record describing a heartbeat for a change stream partition.
+     * 
+ * + * .google.spanner.v1.ChangeStreamRecord.HeartbeatRecord heartbeat_record = 2; + */ + public Builder setHeartbeatRecord( + com.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord value) { + if (heartbeatRecordBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + record_ = value; + onChanged(); + } else { + heartbeatRecordBuilder_.setMessage(value); + } + recordCase_ = 2; + return this; + } + + /** + * + * + *
+     * Heartbeat record describing a heartbeat for a change stream partition.
+     * 
+ * + * .google.spanner.v1.ChangeStreamRecord.HeartbeatRecord heartbeat_record = 2; + */ + public Builder setHeartbeatRecord( + com.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord.Builder builderForValue) { + if (heartbeatRecordBuilder_ == null) { + record_ = builderForValue.build(); + onChanged(); + } else { + heartbeatRecordBuilder_.setMessage(builderForValue.build()); + } + recordCase_ = 2; + return this; + } + + /** + * + * + *
+     * Heartbeat record describing a heartbeat for a change stream partition.
+     * 
+ * + * .google.spanner.v1.ChangeStreamRecord.HeartbeatRecord heartbeat_record = 2; + */ + public Builder mergeHeartbeatRecord( + com.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord value) { + if (heartbeatRecordBuilder_ == null) { + if (recordCase_ == 2 + && record_ + != com.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord.getDefaultInstance()) { + record_ = + com.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord.newBuilder( + (com.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord) record_) + .mergeFrom(value) + .buildPartial(); + } else { + record_ = value; + } + onChanged(); + } else { + if (recordCase_ == 2) { + heartbeatRecordBuilder_.mergeFrom(value); + } else { + heartbeatRecordBuilder_.setMessage(value); + } + } + recordCase_ = 2; + return this; + } + + /** + * + * + *
+     * Heartbeat record describing a heartbeat for a change stream partition.
+     * 
+ * + * .google.spanner.v1.ChangeStreamRecord.HeartbeatRecord heartbeat_record = 2; + */ + public Builder clearHeartbeatRecord() { + if (heartbeatRecordBuilder_ == null) { + if (recordCase_ == 2) { + recordCase_ = 0; + record_ = null; + onChanged(); + } + } else { + if (recordCase_ == 2) { + recordCase_ = 0; + record_ = null; + } + heartbeatRecordBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Heartbeat record describing a heartbeat for a change stream partition.
+     * 
+ * + * .google.spanner.v1.ChangeStreamRecord.HeartbeatRecord heartbeat_record = 2; + */ + public com.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord.Builder + getHeartbeatRecordBuilder() { + return getHeartbeatRecordFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Heartbeat record describing a heartbeat for a change stream partition.
+     * 
+ * + * .google.spanner.v1.ChangeStreamRecord.HeartbeatRecord heartbeat_record = 2; + */ + @java.lang.Override + public com.google.spanner.v1.ChangeStreamRecord.HeartbeatRecordOrBuilder + getHeartbeatRecordOrBuilder() { + if ((recordCase_ == 2) && (heartbeatRecordBuilder_ != null)) { + return heartbeatRecordBuilder_.getMessageOrBuilder(); + } else { + if (recordCase_ == 2) { + return (com.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord) record_; + } + return com.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Heartbeat record describing a heartbeat for a change stream partition.
+     * 
+ * + * .google.spanner.v1.ChangeStreamRecord.HeartbeatRecord heartbeat_record = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord, + com.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord.Builder, + com.google.spanner.v1.ChangeStreamRecord.HeartbeatRecordOrBuilder> + getHeartbeatRecordFieldBuilder() { + if (heartbeatRecordBuilder_ == null) { + if (!(recordCase_ == 2)) { + record_ = com.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord.getDefaultInstance(); + } + heartbeatRecordBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord, + com.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord.Builder, + com.google.spanner.v1.ChangeStreamRecord.HeartbeatRecordOrBuilder>( + (com.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord) record_, + getParentForChildren(), + isClean()); + record_ = null; + } + recordCase_ = 2; + onChanged(); + return heartbeatRecordBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord, + com.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord.Builder, + com.google.spanner.v1.ChangeStreamRecord.PartitionStartRecordOrBuilder> + partitionStartRecordBuilder_; + + /** + * + * + *
+     * Partition start record describing a new change stream partition.
+     * 
+ * + * .google.spanner.v1.ChangeStreamRecord.PartitionStartRecord partition_start_record = 3; + * + * + * @return Whether the partitionStartRecord field is set. + */ + @java.lang.Override + public boolean hasPartitionStartRecord() { + return recordCase_ == 3; + } + + /** + * + * + *
+     * Partition start record describing a new change stream partition.
+     * 
+ * + * .google.spanner.v1.ChangeStreamRecord.PartitionStartRecord partition_start_record = 3; + * + * + * @return The partitionStartRecord. + */ + @java.lang.Override + public com.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord getPartitionStartRecord() { + if (partitionStartRecordBuilder_ == null) { + if (recordCase_ == 3) { + return (com.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord) record_; + } + return com.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord.getDefaultInstance(); + } else { + if (recordCase_ == 3) { + return partitionStartRecordBuilder_.getMessage(); + } + return com.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Partition start record describing a new change stream partition.
+     * 
+ * + * .google.spanner.v1.ChangeStreamRecord.PartitionStartRecord partition_start_record = 3; + * + */ + public Builder setPartitionStartRecord( + com.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord value) { + if (partitionStartRecordBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + record_ = value; + onChanged(); + } else { + partitionStartRecordBuilder_.setMessage(value); + } + recordCase_ = 3; + return this; + } + + /** + * + * + *
+     * Partition start record describing a new change stream partition.
+     * 
+ * + * .google.spanner.v1.ChangeStreamRecord.PartitionStartRecord partition_start_record = 3; + * + */ + public Builder setPartitionStartRecord( + com.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord.Builder builderForValue) { + if (partitionStartRecordBuilder_ == null) { + record_ = builderForValue.build(); + onChanged(); + } else { + partitionStartRecordBuilder_.setMessage(builderForValue.build()); + } + recordCase_ = 3; + return this; + } + + /** + * + * + *
+     * Partition start record describing a new change stream partition.
+     * 
+ * + * .google.spanner.v1.ChangeStreamRecord.PartitionStartRecord partition_start_record = 3; + * + */ + public Builder mergePartitionStartRecord( + com.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord value) { + if (partitionStartRecordBuilder_ == null) { + if (recordCase_ == 3 + && record_ + != com.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord + .getDefaultInstance()) { + record_ = + com.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord.newBuilder( + (com.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord) record_) + .mergeFrom(value) + .buildPartial(); + } else { + record_ = value; + } + onChanged(); + } else { + if (recordCase_ == 3) { + partitionStartRecordBuilder_.mergeFrom(value); + } else { + partitionStartRecordBuilder_.setMessage(value); + } + } + recordCase_ = 3; + return this; + } + + /** + * + * + *
+     * Partition start record describing a new change stream partition.
+     * 
+ * + * .google.spanner.v1.ChangeStreamRecord.PartitionStartRecord partition_start_record = 3; + * + */ + public Builder clearPartitionStartRecord() { + if (partitionStartRecordBuilder_ == null) { + if (recordCase_ == 3) { + recordCase_ = 0; + record_ = null; + onChanged(); + } + } else { + if (recordCase_ == 3) { + recordCase_ = 0; + record_ = null; + } + partitionStartRecordBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Partition start record describing a new change stream partition.
+     * 
+ * + * .google.spanner.v1.ChangeStreamRecord.PartitionStartRecord partition_start_record = 3; + * + */ + public com.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord.Builder + getPartitionStartRecordBuilder() { + return getPartitionStartRecordFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Partition start record describing a new change stream partition.
+     * 
+ * + * .google.spanner.v1.ChangeStreamRecord.PartitionStartRecord partition_start_record = 3; + * + */ + @java.lang.Override + public com.google.spanner.v1.ChangeStreamRecord.PartitionStartRecordOrBuilder + getPartitionStartRecordOrBuilder() { + if ((recordCase_ == 3) && (partitionStartRecordBuilder_ != null)) { + return partitionStartRecordBuilder_.getMessageOrBuilder(); + } else { + if (recordCase_ == 3) { + return (com.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord) record_; + } + return com.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Partition start record describing a new change stream partition.
+     * 
+ * + * .google.spanner.v1.ChangeStreamRecord.PartitionStartRecord partition_start_record = 3; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord, + com.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord.Builder, + com.google.spanner.v1.ChangeStreamRecord.PartitionStartRecordOrBuilder> + getPartitionStartRecordFieldBuilder() { + if (partitionStartRecordBuilder_ == null) { + if (!(recordCase_ == 3)) { + record_ = + com.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord.getDefaultInstance(); + } + partitionStartRecordBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord, + com.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord.Builder, + com.google.spanner.v1.ChangeStreamRecord.PartitionStartRecordOrBuilder>( + (com.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord) record_, + getParentForChildren(), + isClean()); + record_ = null; + } + recordCase_ = 3; + onChanged(); + return partitionStartRecordBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord, + com.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord.Builder, + com.google.spanner.v1.ChangeStreamRecord.PartitionEndRecordOrBuilder> + partitionEndRecordBuilder_; + + /** + * + * + *
+     * Partition end record describing a terminated change stream partition.
+     * 
+ * + * .google.spanner.v1.ChangeStreamRecord.PartitionEndRecord partition_end_record = 4; + * + * + * @return Whether the partitionEndRecord field is set. + */ + @java.lang.Override + public boolean hasPartitionEndRecord() { + return recordCase_ == 4; + } + + /** + * + * + *
+     * Partition end record describing a terminated change stream partition.
+     * 
+ * + * .google.spanner.v1.ChangeStreamRecord.PartitionEndRecord partition_end_record = 4; + * + * + * @return The partitionEndRecord. + */ + @java.lang.Override + public com.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord getPartitionEndRecord() { + if (partitionEndRecordBuilder_ == null) { + if (recordCase_ == 4) { + return (com.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord) record_; + } + return com.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord.getDefaultInstance(); + } else { + if (recordCase_ == 4) { + return partitionEndRecordBuilder_.getMessage(); + } + return com.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Partition end record describing a terminated change stream partition.
+     * 
+ * + * .google.spanner.v1.ChangeStreamRecord.PartitionEndRecord partition_end_record = 4; + * + */ + public Builder setPartitionEndRecord( + com.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord value) { + if (partitionEndRecordBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + record_ = value; + onChanged(); + } else { + partitionEndRecordBuilder_.setMessage(value); + } + recordCase_ = 4; + return this; + } + + /** + * + * + *
+     * Partition end record describing a terminated change stream partition.
+     * 
+ * + * .google.spanner.v1.ChangeStreamRecord.PartitionEndRecord partition_end_record = 4; + * + */ + public Builder setPartitionEndRecord( + com.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord.Builder builderForValue) { + if (partitionEndRecordBuilder_ == null) { + record_ = builderForValue.build(); + onChanged(); + } else { + partitionEndRecordBuilder_.setMessage(builderForValue.build()); + } + recordCase_ = 4; + return this; + } + + /** + * + * + *
+     * Partition end record describing a terminated change stream partition.
+     * 
+ * + * .google.spanner.v1.ChangeStreamRecord.PartitionEndRecord partition_end_record = 4; + * + */ + public Builder mergePartitionEndRecord( + com.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord value) { + if (partitionEndRecordBuilder_ == null) { + if (recordCase_ == 4 + && record_ + != com.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord + .getDefaultInstance()) { + record_ = + com.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord.newBuilder( + (com.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord) record_) + .mergeFrom(value) + .buildPartial(); + } else { + record_ = value; + } + onChanged(); + } else { + if (recordCase_ == 4) { + partitionEndRecordBuilder_.mergeFrom(value); + } else { + partitionEndRecordBuilder_.setMessage(value); + } + } + recordCase_ = 4; + return this; + } + + /** + * + * + *
+     * Partition end record describing a terminated change stream partition.
+     * 
+ * + * .google.spanner.v1.ChangeStreamRecord.PartitionEndRecord partition_end_record = 4; + * + */ + public Builder clearPartitionEndRecord() { + if (partitionEndRecordBuilder_ == null) { + if (recordCase_ == 4) { + recordCase_ = 0; + record_ = null; + onChanged(); + } + } else { + if (recordCase_ == 4) { + recordCase_ = 0; + record_ = null; + } + partitionEndRecordBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Partition end record describing a terminated change stream partition.
+     * 
+ * + * .google.spanner.v1.ChangeStreamRecord.PartitionEndRecord partition_end_record = 4; + * + */ + public com.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord.Builder + getPartitionEndRecordBuilder() { + return getPartitionEndRecordFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Partition end record describing a terminated change stream partition.
+     * 
+ * + * .google.spanner.v1.ChangeStreamRecord.PartitionEndRecord partition_end_record = 4; + * + */ + @java.lang.Override + public com.google.spanner.v1.ChangeStreamRecord.PartitionEndRecordOrBuilder + getPartitionEndRecordOrBuilder() { + if ((recordCase_ == 4) && (partitionEndRecordBuilder_ != null)) { + return partitionEndRecordBuilder_.getMessageOrBuilder(); + } else { + if (recordCase_ == 4) { + return (com.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord) record_; + } + return com.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Partition end record describing a terminated change stream partition.
+     * 
+ * + * .google.spanner.v1.ChangeStreamRecord.PartitionEndRecord partition_end_record = 4; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord, + com.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord.Builder, + com.google.spanner.v1.ChangeStreamRecord.PartitionEndRecordOrBuilder> + getPartitionEndRecordFieldBuilder() { + if (partitionEndRecordBuilder_ == null) { + if (!(recordCase_ == 4)) { + record_ = + com.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord.getDefaultInstance(); + } + partitionEndRecordBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord, + com.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord.Builder, + com.google.spanner.v1.ChangeStreamRecord.PartitionEndRecordOrBuilder>( + (com.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord) record_, + getParentForChildren(), + isClean()); + record_ = null; + } + recordCase_ = 4; + onChanged(); + return partitionEndRecordBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord, + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.Builder, + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecordOrBuilder> + partitionEventRecordBuilder_; + + /** + * + * + *
+     * Partition event record describing key range changes for a change stream
+     * partition.
+     * 
+ * + * .google.spanner.v1.ChangeStreamRecord.PartitionEventRecord partition_event_record = 5; + * + * + * @return Whether the partitionEventRecord field is set. + */ + @java.lang.Override + public boolean hasPartitionEventRecord() { + return recordCase_ == 5; + } + + /** + * + * + *
+     * Partition event record describing key range changes for a change stream
+     * partition.
+     * 
+ * + * .google.spanner.v1.ChangeStreamRecord.PartitionEventRecord partition_event_record = 5; + * + * + * @return The partitionEventRecord. + */ + @java.lang.Override + public com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord getPartitionEventRecord() { + if (partitionEventRecordBuilder_ == null) { + if (recordCase_ == 5) { + return (com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord) record_; + } + return com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.getDefaultInstance(); + } else { + if (recordCase_ == 5) { + return partitionEventRecordBuilder_.getMessage(); + } + return com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Partition event record describing key range changes for a change stream
+     * partition.
+     * 
+ * + * .google.spanner.v1.ChangeStreamRecord.PartitionEventRecord partition_event_record = 5; + * + */ + public Builder setPartitionEventRecord( + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord value) { + if (partitionEventRecordBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + record_ = value; + onChanged(); + } else { + partitionEventRecordBuilder_.setMessage(value); + } + recordCase_ = 5; + return this; + } + + /** + * + * + *
+     * Partition event record describing key range changes for a change stream
+     * partition.
+     * 
+ * + * .google.spanner.v1.ChangeStreamRecord.PartitionEventRecord partition_event_record = 5; + * + */ + public Builder setPartitionEventRecord( + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.Builder builderForValue) { + if (partitionEventRecordBuilder_ == null) { + record_ = builderForValue.build(); + onChanged(); + } else { + partitionEventRecordBuilder_.setMessage(builderForValue.build()); + } + recordCase_ = 5; + return this; + } + + /** + * + * + *
+     * Partition event record describing key range changes for a change stream
+     * partition.
+     * 
+ * + * .google.spanner.v1.ChangeStreamRecord.PartitionEventRecord partition_event_record = 5; + * + */ + public Builder mergePartitionEventRecord( + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord value) { + if (partitionEventRecordBuilder_ == null) { + if (recordCase_ == 5 + && record_ + != com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord + .getDefaultInstance()) { + record_ = + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.newBuilder( + (com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord) record_) + .mergeFrom(value) + .buildPartial(); + } else { + record_ = value; + } + onChanged(); + } else { + if (recordCase_ == 5) { + partitionEventRecordBuilder_.mergeFrom(value); + } else { + partitionEventRecordBuilder_.setMessage(value); + } + } + recordCase_ = 5; + return this; + } + + /** + * + * + *
+     * Partition event record describing key range changes for a change stream
+     * partition.
+     * 
+ * + * .google.spanner.v1.ChangeStreamRecord.PartitionEventRecord partition_event_record = 5; + * + */ + public Builder clearPartitionEventRecord() { + if (partitionEventRecordBuilder_ == null) { + if (recordCase_ == 5) { + recordCase_ = 0; + record_ = null; + onChanged(); + } + } else { + if (recordCase_ == 5) { + recordCase_ = 0; + record_ = null; + } + partitionEventRecordBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Partition event record describing key range changes for a change stream
+     * partition.
+     * 
+ * + * .google.spanner.v1.ChangeStreamRecord.PartitionEventRecord partition_event_record = 5; + * + */ + public com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.Builder + getPartitionEventRecordBuilder() { + return getPartitionEventRecordFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Partition event record describing key range changes for a change stream
+     * partition.
+     * 
+ * + * .google.spanner.v1.ChangeStreamRecord.PartitionEventRecord partition_event_record = 5; + * + */ + @java.lang.Override + public com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecordOrBuilder + getPartitionEventRecordOrBuilder() { + if ((recordCase_ == 5) && (partitionEventRecordBuilder_ != null)) { + return partitionEventRecordBuilder_.getMessageOrBuilder(); + } else { + if (recordCase_ == 5) { + return (com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord) record_; + } + return com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Partition event record describing key range changes for a change stream
+     * partition.
+     * 
+ * + * .google.spanner.v1.ChangeStreamRecord.PartitionEventRecord partition_event_record = 5; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord, + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.Builder, + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecordOrBuilder> + getPartitionEventRecordFieldBuilder() { + if (partitionEventRecordBuilder_ == null) { + if (!(recordCase_ == 5)) { + record_ = + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.getDefaultInstance(); + } + partitionEventRecordBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord, + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.Builder, + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecordOrBuilder>( + (com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord) record_, + getParentForChildren(), + isClean()); + record_ = null; + } + recordCase_ = 5; + onChanged(); + return partitionEventRecordBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.spanner.v1.ChangeStreamRecord) + } + + // @@protoc_insertion_point(class_scope:google.spanner.v1.ChangeStreamRecord) + private static final com.google.spanner.v1.ChangeStreamRecord DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.spanner.v1.ChangeStreamRecord(); + } + + public static com.google.spanner.v1.ChangeStreamRecord getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ChangeStreamRecord 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 com.google.spanner.v1.ChangeStreamRecord getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/ChangeStreamRecordOrBuilder.java b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/ChangeStreamRecordOrBuilder.java new file mode 100644 index 0000000000..278e1fc8a2 --- /dev/null +++ b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/ChangeStreamRecordOrBuilder.java @@ -0,0 +1,228 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/spanner/v1/change_stream.proto + +// Protobuf Java Version: 3.25.5 +package com.google.spanner.v1; + +public interface ChangeStreamRecordOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.spanner.v1.ChangeStreamRecord) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Data change record describing a data change for a change stream
+   * partition.
+   * 
+ * + * .google.spanner.v1.ChangeStreamRecord.DataChangeRecord data_change_record = 1; + * + * @return Whether the dataChangeRecord field is set. + */ + boolean hasDataChangeRecord(); + + /** + * + * + *
+   * Data change record describing a data change for a change stream
+   * partition.
+   * 
+ * + * .google.spanner.v1.ChangeStreamRecord.DataChangeRecord data_change_record = 1; + * + * @return The dataChangeRecord. + */ + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecord getDataChangeRecord(); + + /** + * + * + *
+   * Data change record describing a data change for a change stream
+   * partition.
+   * 
+ * + * .google.spanner.v1.ChangeStreamRecord.DataChangeRecord data_change_record = 1; + */ + com.google.spanner.v1.ChangeStreamRecord.DataChangeRecordOrBuilder getDataChangeRecordOrBuilder(); + + /** + * + * + *
+   * Heartbeat record describing a heartbeat for a change stream partition.
+   * 
+ * + * .google.spanner.v1.ChangeStreamRecord.HeartbeatRecord heartbeat_record = 2; + * + * @return Whether the heartbeatRecord field is set. + */ + boolean hasHeartbeatRecord(); + + /** + * + * + *
+   * Heartbeat record describing a heartbeat for a change stream partition.
+   * 
+ * + * .google.spanner.v1.ChangeStreamRecord.HeartbeatRecord heartbeat_record = 2; + * + * @return The heartbeatRecord. + */ + com.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord getHeartbeatRecord(); + + /** + * + * + *
+   * Heartbeat record describing a heartbeat for a change stream partition.
+   * 
+ * + * .google.spanner.v1.ChangeStreamRecord.HeartbeatRecord heartbeat_record = 2; + */ + com.google.spanner.v1.ChangeStreamRecord.HeartbeatRecordOrBuilder getHeartbeatRecordOrBuilder(); + + /** + * + * + *
+   * Partition start record describing a new change stream partition.
+   * 
+ * + * .google.spanner.v1.ChangeStreamRecord.PartitionStartRecord partition_start_record = 3; + * + * + * @return Whether the partitionStartRecord field is set. + */ + boolean hasPartitionStartRecord(); + + /** + * + * + *
+   * Partition start record describing a new change stream partition.
+   * 
+ * + * .google.spanner.v1.ChangeStreamRecord.PartitionStartRecord partition_start_record = 3; + * + * + * @return The partitionStartRecord. + */ + com.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord getPartitionStartRecord(); + + /** + * + * + *
+   * Partition start record describing a new change stream partition.
+   * 
+ * + * .google.spanner.v1.ChangeStreamRecord.PartitionStartRecord partition_start_record = 3; + * + */ + com.google.spanner.v1.ChangeStreamRecord.PartitionStartRecordOrBuilder + getPartitionStartRecordOrBuilder(); + + /** + * + * + *
+   * Partition end record describing a terminated change stream partition.
+   * 
+ * + * .google.spanner.v1.ChangeStreamRecord.PartitionEndRecord partition_end_record = 4; + * + * @return Whether the partitionEndRecord field is set. + */ + boolean hasPartitionEndRecord(); + + /** + * + * + *
+   * Partition end record describing a terminated change stream partition.
+   * 
+ * + * .google.spanner.v1.ChangeStreamRecord.PartitionEndRecord partition_end_record = 4; + * + * @return The partitionEndRecord. + */ + com.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord getPartitionEndRecord(); + + /** + * + * + *
+   * Partition end record describing a terminated change stream partition.
+   * 
+ * + * .google.spanner.v1.ChangeStreamRecord.PartitionEndRecord partition_end_record = 4; + */ + com.google.spanner.v1.ChangeStreamRecord.PartitionEndRecordOrBuilder + getPartitionEndRecordOrBuilder(); + + /** + * + * + *
+   * Partition event record describing key range changes for a change stream
+   * partition.
+   * 
+ * + * .google.spanner.v1.ChangeStreamRecord.PartitionEventRecord partition_event_record = 5; + * + * + * @return Whether the partitionEventRecord field is set. + */ + boolean hasPartitionEventRecord(); + + /** + * + * + *
+   * Partition event record describing key range changes for a change stream
+   * partition.
+   * 
+ * + * .google.spanner.v1.ChangeStreamRecord.PartitionEventRecord partition_event_record = 5; + * + * + * @return The partitionEventRecord. + */ + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord getPartitionEventRecord(); + + /** + * + * + *
+   * Partition event record describing key range changes for a change stream
+   * partition.
+   * 
+ * + * .google.spanner.v1.ChangeStreamRecord.PartitionEventRecord partition_event_record = 5; + * + */ + com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecordOrBuilder + getPartitionEventRecordOrBuilder(); + + com.google.spanner.v1.ChangeStreamRecord.RecordCase getRecordCase(); +} diff --git a/proto-google-cloud-spanner-v1/src/main/proto/google/spanner/v1/change_stream.proto b/proto-google-cloud-spanner-v1/src/main/proto/google/spanner/v1/change_stream.proto new file mode 100644 index 0000000000..53c71078d0 --- /dev/null +++ b/proto-google-cloud-spanner-v1/src/main/proto/google/spanner/v1/change_stream.proto @@ -0,0 +1,451 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.spanner.v1; + +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; +import "google/spanner/v1/type.proto"; + +option csharp_namespace = "Google.Cloud.Spanner.V1"; +option go_package = "cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb"; +option java_multiple_files = true; +option java_outer_classname = "ChangeStreamProto"; +option java_package = "com.google.spanner.v1"; +option php_namespace = "Google\\Cloud\\Spanner\\V1"; +option ruby_package = "Google::Cloud::Spanner::V1"; + +// Spanner Change Streams enable customers to capture and stream out changes to +// their Spanner databases in real-time. A change stream +// can be created with option partition_mode='IMMUTABLE_KEY_RANGE' or +// partition_mode='MUTABLE_KEY_RANGE'. +// +// This message is only used in Change Streams created with the option +// partition_mode='MUTABLE_KEY_RANGE'. Spanner automatically creates a special +// Table-Valued Function (TVF) along with each Change Streams. The function +// provides access to the change stream's records. The function is named +// READ_ (where is the +// name of the change stream), and it returns a table with only one column +// called ChangeRecord. +message ChangeStreamRecord { + // A data change record contains a set of changes to a table with the same + // modification type (insert, update, or delete) committed at the same commit + // timestamp in one change stream partition for the same transaction. Multiple + // data change records can be returned for the same transaction across + // multiple change stream partitions. + message DataChangeRecord { + // Metadata for a column. + message ColumnMetadata { + // Name of the column. + string name = 1; + + // Type of the column. + Type type = 2; + + // Indicates whether the column is a primary key column. + bool is_primary_key = 3; + + // Ordinal position of the column based on the original table definition + // in the schema starting with a value of 1. + int64 ordinal_position = 4; + } + + // Returns the value and associated metadata for a particular field of the + // [Mod][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod]. + message ModValue { + // Index within the repeated + // [column_metadata][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.column_metadata] + // field, to obtain the column metadata for the column that was modified. + int32 column_metadata_index = 1; + + // The value of the column. + google.protobuf.Value value = 2; + } + + // A mod describes all data changes in a watched table row. + message Mod { + // Returns the value of the primary key of the modified row. + repeated ModValue keys = 1; + + // Returns the old values before the change for the modified columns. + // Always empty for + // [INSERT][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType.INSERT], + // or if old values are not being captured specified by + // [value_capture_type][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType]. + repeated ModValue old_values = 2; + + // Returns the new values after the change for the modified columns. + // Always empty for + // [DELETE][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType.DELETE]. + repeated ModValue new_values = 3; + } + + // Mod type describes the type of change Spanner applied to the data. For + // example, if the client submits an INSERT_OR_UPDATE request, Spanner will + // perform an insert if there is no existing row and return ModType INSERT. + // Alternatively, if there is an existing row, Spanner will perform an + // update and return ModType UPDATE. + enum ModType { + // Not specified. + MOD_TYPE_UNSPECIFIED = 0; + + // Indicates data was inserted. + INSERT = 10; + + // Indicates existing data was updated. + UPDATE = 20; + + // Indicates existing data was deleted. + DELETE = 30; + } + + // Value capture type describes which values are recorded in the data + // change record. + enum ValueCaptureType { + // Not specified. + VALUE_CAPTURE_TYPE_UNSPECIFIED = 0; + + // Records both old and new values of the modified watched columns. + OLD_AND_NEW_VALUES = 10; + + // Records only new values of the modified watched columns. + NEW_VALUES = 20; + + // Records new values of all watched columns, including modified and + // unmodified columns. + NEW_ROW = 30; + + // Records the new values of all watched columns, including modified and + // unmodified columns. Also records the old values of the modified + // columns. + NEW_ROW_AND_OLD_VALUES = 40; + } + + // Indicates the timestamp in which the change was committed. + // DataChangeRecord.commit_timestamps, + // PartitionStartRecord.start_timestamps, + // PartitionEventRecord.commit_timestamps, and + // PartitionEndRecord.end_timestamps can have the same value in the same + // partition. + google.protobuf.Timestamp commit_timestamp = 1; + + // Record sequence numbers are unique and monotonically increasing (but not + // necessarily contiguous) for a specific timestamp across record + // types in the same partition. To guarantee ordered processing, the reader + // should process records (of potentially different types) in + // record_sequence order for a specific timestamp in the same partition. + // + // The record sequence number ordering across partitions is only meaningful + // in the context of a specific transaction. Record sequence numbers are + // unique across partitions for a specific transaction. Sort the + // DataChangeRecords for the same + // [server_transaction_id][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.server_transaction_id] + // by + // [record_sequence][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.record_sequence] + // to reconstruct the ordering of the changes within the transaction. + string record_sequence = 2; + + // Provides a globally unique string that represents the transaction in + // which the change was committed. Multiple transactions can have the same + // commit timestamp, but each transaction has a unique + // server_transaction_id. + string server_transaction_id = 3; + + // Indicates whether this is the last record for a transaction in the + // current partition. Clients can use this field to determine when all + // records for a transaction in the current partition have been received. + bool is_last_record_in_transaction_in_partition = 4; + + // Name of the table affected by the change. + string table = 5; + + // Provides metadata describing the columns associated with the + // [mods][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.mods] listed + // below. + repeated ColumnMetadata column_metadata = 6; + + // Describes the changes that were made. + repeated Mod mods = 7; + + // Describes the type of change. + ModType mod_type = 8; + + // Describes the value capture type that was specified in the change stream + // configuration when this change was captured. + ValueCaptureType value_capture_type = 9; + + // Indicates the number of data change records that are part of this + // transaction across all change stream partitions. This value can be used + // to assemble all the records associated with a particular transaction. + int32 number_of_records_in_transaction = 10; + + // Indicates the number of partitions that return data change records for + // this transaction. This value can be helpful in assembling all records + // associated with a particular transaction. + int32 number_of_partitions_in_transaction = 11; + + // Indicates the transaction tag associated with this transaction. + string transaction_tag = 12; + + // Indicates whether the transaction is a system transaction. System + // transactions include those issued by time-to-live (TTL), column backfill, + // etc. + bool is_system_transaction = 13; + } + + // A heartbeat record is returned as a progress indicator, when there are no + // data changes or any other partition record types in the change stream + // partition. + message HeartbeatRecord { + // Indicates the timestamp at which the query has returned all the records + // in the change stream partition with timestamp <= heartbeat timestamp. + // The heartbeat timestamp will not be the same as the timestamps of other + // record types in the same partition. + google.protobuf.Timestamp timestamp = 1; + } + + // A partition start record serves as a notification that the client should + // schedule the partitions to be queried. PartitionStartRecord returns + // information about one or more partitions. + message PartitionStartRecord { + // Start timestamp at which the partitions should be queried to return + // change stream records with timestamps >= start_timestamp. + // DataChangeRecord.commit_timestamps, + // PartitionStartRecord.start_timestamps, + // PartitionEventRecord.commit_timestamps, and + // PartitionEndRecord.end_timestamps can have the same value in the same + // partition. + google.protobuf.Timestamp start_timestamp = 1; + + // Record sequence numbers are unique and monotonically increasing (but not + // necessarily contiguous) for a specific timestamp across record + // types in the same partition. To guarantee ordered processing, the reader + // should process records (of potentially different types) in + // record_sequence order for a specific timestamp in the same partition. + string record_sequence = 2; + + // Unique partition identifiers to be used in queries. + repeated string partition_tokens = 3; + } + + // A partition end record serves as a notification that the client should stop + // reading the partition. No further records are expected to be retrieved on + // it. + message PartitionEndRecord { + // End timestamp at which the change stream partition is terminated. All + // changes generated by this partition will have timestamps <= + // end_timestamp. DataChangeRecord.commit_timestamps, + // PartitionStartRecord.start_timestamps, + // PartitionEventRecord.commit_timestamps, and + // PartitionEndRecord.end_timestamps can have the same value in the same + // partition. PartitionEndRecord is the last record returned for a + // partition. + google.protobuf.Timestamp end_timestamp = 1; + + // Record sequence numbers are unique and monotonically increasing (but not + // necessarily contiguous) for a specific timestamp across record + // types in the same partition. To guarantee ordered processing, the reader + // should process records (of potentially different types) in + // record_sequence order for a specific timestamp in the same partition. + string record_sequence = 2; + + // Unique partition identifier describing the terminated change stream + // partition. + // [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEndRecord.partition_token] + // is equal to the partition token of the change stream partition currently + // queried to return this PartitionEndRecord. + string partition_token = 3; + } + + // A partition event record describes key range changes for a change stream + // partition. The changes to a row defined by its primary key can be captured + // in one change stream partition for a specific time range, and then be + // captured in a different change stream partition for a different time range. + // This movement of key ranges across change stream partitions is a reflection + // of activities, such as Spanner's dynamic splitting and load balancing, etc. + // Processing this event is needed if users want to guarantee processing of + // the changes for any key in timestamp order. If time ordered processing of + // changes for a primary key is not needed, this event can be ignored. + // To guarantee time ordered processing for each primary key, if the event + // describes move-ins, the reader of this partition needs to wait until the + // readers of the source partitions have processed all records with timestamps + // <= this PartitionEventRecord.commit_timestamp, before advancing beyond this + // PartitionEventRecord. If the event describes move-outs, the reader can + // notify the readers of the destination partitions that they can continue + // processing. + message PartitionEventRecord { + // Describes move-in of the key ranges into the change stream partition + // identified by + // [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token]. + // + // To maintain processing the changes for a particular key in timestamp + // order, the query processing the change stream partition identified by + // [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token] + // should not advance beyond the partition event record commit timestamp + // until the queries processing the source change stream partitions have + // processed all change stream records with timestamps <= the partition + // event record commit timestamp. + message MoveInEvent { + // An unique partition identifier describing the source change stream + // partition that recorded changes for the key range that is moving + // into this partition. + string source_partition_token = 1; + } + + // Describes move-out of the key ranges out of the change stream partition + // identified by + // [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token]. + // + // To maintain processing the changes for a particular key in timestamp + // order, the query processing the + // [MoveOutEvent][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent] + // in the partition identified by + // [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token] + // should inform the queries processing the destination partitions that + // they can unblock and proceed processing records past the + // [commit_timestamp][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.commit_timestamp]. + message MoveOutEvent { + // An unique partition identifier describing the destination change + // stream partition that will record changes for the key range that is + // moving out of this partition. + string destination_partition_token = 1; + } + + // Indicates the commit timestamp at which the key range change occurred. + // DataChangeRecord.commit_timestamps, + // PartitionStartRecord.start_timestamps, + // PartitionEventRecord.commit_timestamps, and + // PartitionEndRecord.end_timestamps can have the same value in the same + // partition. + google.protobuf.Timestamp commit_timestamp = 1; + + // Record sequence numbers are unique and monotonically increasing (but not + // necessarily contiguous) for a specific timestamp across record + // types in the same partition. To guarantee ordered processing, the reader + // should process records (of potentially different types) in + // record_sequence order for a specific timestamp in the same partition. + string record_sequence = 2; + + // Unique partition identifier describing the partition this event + // occurred on. + // [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token] + // is equal to the partition token of the change stream partition currently + // queried to return this PartitionEventRecord. + string partition_token = 3; + + // Set when one or more key ranges are moved into the change stream + // partition identified by + // [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token]. + // + // Example: Two key ranges are moved into partition (P1) from partition (P2) + // and partition (P3) in a single transaction at timestamp T. + // + // The PartitionEventRecord returned in P1 will reflect the move as: + // + // PartitionEventRecord { + // commit_timestamp: T + // partition_token: "P1" + // move_in_events { + // source_partition_token: "P2" + // } + // move_in_events { + // source_partition_token: "P3" + // } + // } + // + // The PartitionEventRecord returned in P2 will reflect the move as: + // + // PartitionEventRecord { + // commit_timestamp: T + // partition_token: "P2" + // move_out_events { + // destination_partition_token: "P1" + // } + // } + // + // The PartitionEventRecord returned in P3 will reflect the move as: + // + // PartitionEventRecord { + // commit_timestamp: T + // partition_token: "P3" + // move_out_events { + // destination_partition_token: "P1" + // } + // } + repeated MoveInEvent move_in_events = 4; + + // Set when one or more key ranges are moved out of the change stream + // partition identified by + // [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token]. + // + // Example: Two key ranges are moved out of partition (P1) to partition (P2) + // and partition (P3) in a single transaction at timestamp T. + // + // The PartitionEventRecord returned in P1 will reflect the move as: + // + // PartitionEventRecord { + // commit_timestamp: T + // partition_token: "P1" + // move_out_events { + // destination_partition_token: "P2" + // } + // move_out_events { + // destination_partition_token: "P3" + // } + // } + // + // The PartitionEventRecord returned in P2 will reflect the move as: + // + // PartitionEventRecord { + // commit_timestamp: T + // partition_token: "P2" + // move_in_events { + // source_partition_token: "P1" + // } + // } + // + // The PartitionEventRecord returned in P3 will reflect the move as: + // + // PartitionEventRecord { + // commit_timestamp: T + // partition_token: "P3" + // move_in_events { + // source_partition_token: "P1" + // } + // } + repeated MoveOutEvent move_out_events = 5; + } + + // One of the change stream subrecords. + oneof record { + // Data change record describing a data change for a change stream + // partition. + DataChangeRecord data_change_record = 1; + + // Heartbeat record describing a heartbeat for a change stream partition. + HeartbeatRecord heartbeat_record = 2; + + // Partition start record describing a new change stream partition. + PartitionStartRecord partition_start_record = 3; + + // Partition end record describing a terminated change stream partition. + PartitionEndRecord partition_end_record = 4; + + // Partition event record describing key range changes for a change stream + // partition. + PartitionEventRecord partition_event_record = 5; + } +} From 2f62816b0af9aced1b73e25525f60f8e3e923454 Mon Sep 17 00:00:00 2001 From: sgorse123 <72293954+sgorse123@users.noreply.github.com> Date: Tue, 3 Jun 2025 20:52:22 -0700 Subject: [PATCH 08/11] feat: Last statement sample (#3830) Support of the last statement option was added in https://togithub.com/googleapis/java-spanner/pull/3647 by @olavloite. This change adds a sample of how to use the option in the last DML statement of a transaction. --- .../example/spanner/LastStatementSample.java | 70 +++++++++++++++++ .../spanner/PgLastStatementSample.java | 69 +++++++++++++++++ .../spanner/LastStatementSampleIT.java | 61 +++++++++++++++ .../spanner/PgLastStatementSampleIT.java | 75 +++++++++++++++++++ 4 files changed, 275 insertions(+) create mode 100644 samples/snippets/src/main/java/com/example/spanner/LastStatementSample.java create mode 100644 samples/snippets/src/main/java/com/example/spanner/PgLastStatementSample.java create mode 100644 samples/snippets/src/test/java/com/example/spanner/LastStatementSampleIT.java create mode 100644 samples/snippets/src/test/java/com/example/spanner/PgLastStatementSampleIT.java diff --git a/samples/snippets/src/main/java/com/example/spanner/LastStatementSample.java b/samples/snippets/src/main/java/com/example/spanner/LastStatementSample.java new file mode 100644 index 0000000000..ef03ed7d88 --- /dev/null +++ b/samples/snippets/src/main/java/com/example/spanner/LastStatementSample.java @@ -0,0 +1,70 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.example.spanner; + +import com.google.cloud.spanner.DatabaseClient; +import com.google.cloud.spanner.DatabaseId; +import com.google.cloud.spanner.Options; +import com.google.cloud.spanner.Spanner; +import com.google.cloud.spanner.SpannerOptions; +import com.google.cloud.spanner.Statement; + +/** + * Sample showing how to set the last statement option when a DML statement is the last statement in + * a transaction. + */ +public class LastStatementSample { + + static void insertAndUpdateUsingLastStatement() { + // TODO(developer): Replace these variables before running the sample. + final String projectId = "my-project"; + final String instanceId = "my-instance"; + final String databaseId = "my-database"; + + try (Spanner spanner = + SpannerOptions.newBuilder().setProjectId(projectId).build().getService()) { + final DatabaseClient databaseClient = + spanner.getDatabaseClient(DatabaseId.of(projectId, instanceId, databaseId)); + insertAndUpdateUsingLastStatement(databaseClient); + } + } + + // [START spanner_dml_last_statement] + static void insertAndUpdateUsingLastStatement(DatabaseClient client) { + client + .readWriteTransaction() + .run( + transaction -> { + transaction.executeUpdate( + Statement.of( + "INSERT Singers (SingerId, FirstName, LastName)\n" + + "VALUES (54213, 'John', 'Do')")); + System.out.println("New singer inserted."); + + // Pass in the `lastStatement` option to the last DML statement of the transaction. + transaction.executeUpdate( + Statement.of( + "UPDATE Singers SET Singers.LastName = 'Doe' WHERE SingerId = 54213\n"), + Options.lastStatement()); + System.out.println("Singer last name updated."); + + return null; + }); + } + // [END spanner_dml_last_statement] + +} diff --git a/samples/snippets/src/main/java/com/example/spanner/PgLastStatementSample.java b/samples/snippets/src/main/java/com/example/spanner/PgLastStatementSample.java new file mode 100644 index 0000000000..1c583a71b3 --- /dev/null +++ b/samples/snippets/src/main/java/com/example/spanner/PgLastStatementSample.java @@ -0,0 +1,69 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.example.spanner; + +import com.google.cloud.spanner.DatabaseClient; +import com.google.cloud.spanner.DatabaseId; +import com.google.cloud.spanner.Options; +import com.google.cloud.spanner.Spanner; +import com.google.cloud.spanner.SpannerOptions; +import com.google.cloud.spanner.Statement; + +/** + * Sample showing how to set the last statement option when a DML statement is the last statement in + * a transaction. + */ +public class PgLastStatementSample { + + static void insertAndUpdateUsingLastStatement() { + // TODO(developer): Replace these variables before running the sample. + final String projectId = "my-project"; + final String instanceId = "my-instance"; + final String databaseId = "my-database"; + + try (Spanner spanner = + SpannerOptions.newBuilder().setProjectId(projectId).build().getService()) { + final DatabaseClient databaseClient = + spanner.getDatabaseClient(DatabaseId.of(projectId, instanceId, databaseId)); + insertAndUpdateUsingLastStatement(databaseClient); + } + } + + // [START spanner_postgresql_dml_last_statement] + static void insertAndUpdateUsingLastStatement(DatabaseClient client) { + client + .readWriteTransaction() + .run( + transaction -> { + transaction.executeUpdate( + Statement.of( + "INSERT INTO Singers (SingerId, FirstName, LastName) " + + "VALUES (54214, 'John', 'Do')")); + System.out.println("New singer inserted."); + + // Pass in the `lastStatement` option to the last DML statement of the transaction. + transaction.executeUpdate( + Statement.of("UPDATE Singers SET LastName = 'Doe' WHERE SingerId = 54214\n"), + Options.lastStatement()); + System.out.println("Singer last name updated."); + + return null; + }); + } + // [END spanner_postgresql_dml_last_statement] + +} diff --git a/samples/snippets/src/test/java/com/example/spanner/LastStatementSampleIT.java b/samples/snippets/src/test/java/com/example/spanner/LastStatementSampleIT.java new file mode 100644 index 0000000000..89026b5f92 --- /dev/null +++ b/samples/snippets/src/test/java/com/example/spanner/LastStatementSampleIT.java @@ -0,0 +1,61 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.example.spanner; + +import static com.example.spanner.SampleRunner.runSample; +import static com.google.common.truth.Truth.assertThat; + +import com.google.cloud.spanner.DatabaseClient; +import com.google.cloud.spanner.DatabaseId; +import com.google.common.collect.ImmutableList; +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +/** Integration tests for {@link LastStatementSample} */ +@RunWith(JUnit4.class) +public class LastStatementSampleIT extends SampleTestBase { + + private static DatabaseId databaseId; + + @BeforeClass + public static void createTestDatabase() throws Exception { + final String database = idGenerator.generateDatabaseId(); + databaseAdminClient + .createDatabase( + instanceId, + database, + ImmutableList.of( + "CREATE TABLE Singers (" + + " SingerId INT64 NOT NULL," + + " FirstName STRING(1024)," + + " LastName STRING(1024)," + + " SingerInfo BYTES(MAX)" + + ") PRIMARY KEY (SingerId)")) + .get(); + databaseId = DatabaseId.of(projectId, instanceId, database); + } + + @Test + public void testSetLastStatementOptionSample() throws Exception { + final DatabaseClient client = spanner.getDatabaseClient(databaseId); + String out = runSample(() -> LastStatementSample.insertAndUpdateUsingLastStatement(client)); + assertThat(out).contains("New singer inserted."); + assertThat(out).contains("Singer last name updated."); + } +} diff --git a/samples/snippets/src/test/java/com/example/spanner/PgLastStatementSampleIT.java b/samples/snippets/src/test/java/com/example/spanner/PgLastStatementSampleIT.java new file mode 100644 index 0000000000..d6d8d43f6a --- /dev/null +++ b/samples/snippets/src/test/java/com/example/spanner/PgLastStatementSampleIT.java @@ -0,0 +1,75 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.example.spanner; + +import static com.example.spanner.SampleRunner.runSample; +import static com.google.common.truth.Truth.assertThat; + +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.spanner.DatabaseClient; +import com.google.cloud.spanner.DatabaseId; +import com.google.cloud.spanner.Dialect; +import com.google.common.collect.ImmutableList; +import com.google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata; +import java.util.Collections; +import java.util.concurrent.TimeUnit; +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +/** Integration tests for {@link PgLastStatementSample} */ +@RunWith(JUnit4.class) +public class PgLastStatementSampleIT extends SampleTestBase { + + private static DatabaseId databaseId; + + @BeforeClass + public static void createTestDatabase() throws Exception { + final String database = idGenerator.generateDatabaseId(); + databaseAdminClient + .createDatabase( + databaseAdminClient + .newDatabaseBuilder(DatabaseId.of(projectId, instanceId, database)) + .setDialect(Dialect.POSTGRESQL) + .build(), + Collections.emptyList()) + .get(10, TimeUnit.MINUTES); + final OperationFuture updateOperation = + databaseAdminClient.updateDatabaseDdl( + instanceId, + database, + ImmutableList.of( + "CREATE TABLE Singers (" + + " SingerId bigint NOT NULL," + + " FirstName character varying(1024)," + + " LastName character varying(1024)," + + " PRIMARY KEY (SingerId)" + + ")"), + null); + updateOperation.get(10, TimeUnit.MINUTES); + databaseId = DatabaseId.of(projectId, instanceId, database); + } + + @Test + public void testSetLastStatementOptionSample() throws Exception { + final DatabaseClient client = spanner.getDatabaseClient(databaseId); + String out = runSample(() -> PgLastStatementSample.insertAndUpdateUsingLastStatement(client)); + assertThat(out).contains("New singer inserted."); + assertThat(out).contains("Singer last name updated."); + } +} From 0906eac32b4088656b3c5459162081affa8cae59 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 4 Jun 2025 10:59:47 +0530 Subject: [PATCH 09/11] chore(main): release 6.94.1-SNAPSHOT (#3891) * chore(main): release 6.94.1-SNAPSHOT * chore: generate libraries at Wed Jun 4 04:31:04 UTC 2025 --------- Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: cloud-java-bot --- README.md | 2 ++ benchmarks/pom.xml | 2 +- google-cloud-spanner-bom/pom.xml | 18 ++++++++--------- google-cloud-spanner-executor/pom.xml | 4 ++-- google-cloud-spanner/pom.xml | 4 ++-- .../pom.xml | 4 ++-- .../pom.xml | 4 ++-- grpc-google-cloud-spanner-executor-v1/pom.xml | 4 ++-- grpc-google-cloud-spanner-v1/pom.xml | 4 ++-- pom.xml | 20 +++++++++---------- .../pom.xml | 4 ++-- .../pom.xml | 4 ++-- .../pom.xml | 4 ++-- proto-google-cloud-spanner-v1/pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 20 +++++++++---------- 16 files changed, 53 insertions(+), 51 deletions(-) diff --git a/README.md b/README.md index eec01dec15..e8d8bf6216 100644 --- a/README.md +++ b/README.md @@ -538,6 +538,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/java-spanner/tree/ | Get Database Ddl Sample | [source code](https://github.com/googleapis/java-spanner/blob/main/samples/snippets/src/main/java/com/example/spanner/GetDatabaseDdlSample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-spanner&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/spanner/GetDatabaseDdlSample.java) | | Get Instance Config Sample | [source code](https://github.com/googleapis/java-spanner/blob/main/samples/snippets/src/main/java/com/example/spanner/GetInstanceConfigSample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-spanner&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/spanner/GetInstanceConfigSample.java) | | Insert Using Dml Returning Sample | [source code](https://github.com/googleapis/java-spanner/blob/main/samples/snippets/src/main/java/com/example/spanner/InsertUsingDmlReturningSample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-spanner&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/spanner/InsertUsingDmlReturningSample.java) | +| Last Statement Sample | [source code](https://github.com/googleapis/java-spanner/blob/main/samples/snippets/src/main/java/com/example/spanner/LastStatementSample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-spanner&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/spanner/LastStatementSample.java) | | List Backup Schedules Sample | [source code](https://github.com/googleapis/java-spanner/blob/main/samples/snippets/src/main/java/com/example/spanner/ListBackupSchedulesSample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-spanner&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/spanner/ListBackupSchedulesSample.java) | | List Database Roles | [source code](https://github.com/googleapis/java-spanner/blob/main/samples/snippets/src/main/java/com/example/spanner/ListDatabaseRoles.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-spanner&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/spanner/ListDatabaseRoles.java) | | List Databases Sample | [source code](https://github.com/googleapis/java-spanner/blob/main/samples/snippets/src/main/java/com/example/spanner/ListDatabasesSample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-spanner&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/spanner/ListDatabasesSample.java) | @@ -554,6 +555,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/java-spanner/tree/ | Pg Drop Sequence Sample | [source code](https://github.com/googleapis/java-spanner/blob/main/samples/snippets/src/main/java/com/example/spanner/PgDropSequenceSample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-spanner&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/spanner/PgDropSequenceSample.java) | | Pg Insert Using Dml Returning Sample | [source code](https://github.com/googleapis/java-spanner/blob/main/samples/snippets/src/main/java/com/example/spanner/PgInsertUsingDmlReturningSample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-spanner&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/spanner/PgInsertUsingDmlReturningSample.java) | | Pg Interleaved Table Sample | [source code](https://github.com/googleapis/java-spanner/blob/main/samples/snippets/src/main/java/com/example/spanner/PgInterleavedTableSample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-spanner&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/spanner/PgInterleavedTableSample.java) | +| Pg Last Statement Sample | [source code](https://github.com/googleapis/java-spanner/blob/main/samples/snippets/src/main/java/com/example/spanner/PgLastStatementSample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-spanner&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/spanner/PgLastStatementSample.java) | | Pg Partitioned Dml Sample | [source code](https://github.com/googleapis/java-spanner/blob/main/samples/snippets/src/main/java/com/example/spanner/PgPartitionedDmlSample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-spanner&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/spanner/PgPartitionedDmlSample.java) | | Pg Query With Numeric Parameter Sample | [source code](https://github.com/googleapis/java-spanner/blob/main/samples/snippets/src/main/java/com/example/spanner/PgQueryWithNumericParameterSample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-spanner&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/spanner/PgQueryWithNumericParameterSample.java) | | Pg Spanner Sample | [source code](https://github.com/googleapis/java-spanner/blob/main/samples/snippets/src/main/java/com/example/spanner/PgSpannerSample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-spanner&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/spanner/PgSpannerSample.java) | diff --git a/benchmarks/pom.xml b/benchmarks/pom.xml index 8cc37de9d8..653e24fc03 100644 --- a/benchmarks/pom.xml +++ b/benchmarks/pom.xml @@ -24,7 +24,7 @@ com.google.cloud google-cloud-spanner-parent - 6.94.0 + 6.94.1-SNAPSHOT diff --git a/google-cloud-spanner-bom/pom.xml b/google-cloud-spanner-bom/pom.xml index 6b1ffa683c..7dd9a35269 100644 --- a/google-cloud-spanner-bom/pom.xml +++ b/google-cloud-spanner-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-spanner-bom - 6.94.0 + 6.94.1-SNAPSHOT pom com.google.cloud @@ -53,43 +53,43 @@ com.google.cloud google-cloud-spanner - 6.94.0 + 6.94.1-SNAPSHOT com.google.cloud google-cloud-spanner test-jar - 6.94.0 + 6.94.1-SNAPSHOT com.google.api.grpc grpc-google-cloud-spanner-v1 - 6.94.0 + 6.94.1-SNAPSHOT com.google.api.grpc grpc-google-cloud-spanner-admin-instance-v1 - 6.94.0 + 6.94.1-SNAPSHOT com.google.api.grpc grpc-google-cloud-spanner-admin-database-v1 - 6.94.0 + 6.94.1-SNAPSHOT com.google.api.grpc proto-google-cloud-spanner-admin-instance-v1 - 6.94.0 + 6.94.1-SNAPSHOT com.google.api.grpc proto-google-cloud-spanner-v1 - 6.94.0 + 6.94.1-SNAPSHOT com.google.api.grpc proto-google-cloud-spanner-admin-database-v1 - 6.94.0 + 6.94.1-SNAPSHOT diff --git a/google-cloud-spanner-executor/pom.xml b/google-cloud-spanner-executor/pom.xml index 73611071a6..a8259e4658 100644 --- a/google-cloud-spanner-executor/pom.xml +++ b/google-cloud-spanner-executor/pom.xml @@ -5,14 +5,14 @@ 4.0.0 com.google.cloud google-cloud-spanner-executor - 6.94.0 + 6.94.1-SNAPSHOT jar Google Cloud Spanner Executor com.google.cloud google-cloud-spanner-parent - 6.94.0 + 6.94.1-SNAPSHOT diff --git a/google-cloud-spanner/pom.xml b/google-cloud-spanner/pom.xml index 3f352f9118..eaaaff724d 100644 --- a/google-cloud-spanner/pom.xml +++ b/google-cloud-spanner/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-spanner - 6.94.0 + 6.94.1-SNAPSHOT jar Google Cloud Spanner https://github.com/googleapis/java-spanner @@ -11,7 +11,7 @@ com.google.cloud google-cloud-spanner-parent - 6.94.0 + 6.94.1-SNAPSHOT google-cloud-spanner diff --git a/grpc-google-cloud-spanner-admin-database-v1/pom.xml b/grpc-google-cloud-spanner-admin-database-v1/pom.xml index ce01db18e0..5bdbe7f605 100644 --- a/grpc-google-cloud-spanner-admin-database-v1/pom.xml +++ b/grpc-google-cloud-spanner-admin-database-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-spanner-admin-database-v1 - 6.94.0 + 6.94.1-SNAPSHOT grpc-google-cloud-spanner-admin-database-v1 GRPC library for grpc-google-cloud-spanner-admin-database-v1 com.google.cloud google-cloud-spanner-parent - 6.94.0 + 6.94.1-SNAPSHOT diff --git a/grpc-google-cloud-spanner-admin-instance-v1/pom.xml b/grpc-google-cloud-spanner-admin-instance-v1/pom.xml index c6e3e9860e..4dab5bc3fa 100644 --- a/grpc-google-cloud-spanner-admin-instance-v1/pom.xml +++ b/grpc-google-cloud-spanner-admin-instance-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-spanner-admin-instance-v1 - 6.94.0 + 6.94.1-SNAPSHOT grpc-google-cloud-spanner-admin-instance-v1 GRPC library for grpc-google-cloud-spanner-admin-instance-v1 com.google.cloud google-cloud-spanner-parent - 6.94.0 + 6.94.1-SNAPSHOT diff --git a/grpc-google-cloud-spanner-executor-v1/pom.xml b/grpc-google-cloud-spanner-executor-v1/pom.xml index 290acc16ed..49bc4d33f3 100644 --- a/grpc-google-cloud-spanner-executor-v1/pom.xml +++ b/grpc-google-cloud-spanner-executor-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-spanner-executor-v1 - 6.94.0 + 6.94.1-SNAPSHOT grpc-google-cloud-spanner-executor-v1 GRPC library for google-cloud-spanner com.google.cloud google-cloud-spanner-parent - 6.94.0 + 6.94.1-SNAPSHOT diff --git a/grpc-google-cloud-spanner-v1/pom.xml b/grpc-google-cloud-spanner-v1/pom.xml index d26ce227a2..ee7fb15691 100644 --- a/grpc-google-cloud-spanner-v1/pom.xml +++ b/grpc-google-cloud-spanner-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-spanner-v1 - 6.94.0 + 6.94.1-SNAPSHOT grpc-google-cloud-spanner-v1 GRPC library for grpc-google-cloud-spanner-v1 com.google.cloud google-cloud-spanner-parent - 6.94.0 + 6.94.1-SNAPSHOT diff --git a/pom.xml b/pom.xml index a2075f1ac4..8c6ad6bcd7 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-spanner-parent pom - 6.94.0 + 6.94.1-SNAPSHOT Google Cloud Spanner Parent https://github.com/googleapis/java-spanner @@ -61,47 +61,47 @@ com.google.api.grpc proto-google-cloud-spanner-admin-instance-v1 - 6.94.0 + 6.94.1-SNAPSHOT com.google.api.grpc proto-google-cloud-spanner-executor-v1 - 6.94.0 + 6.94.1-SNAPSHOT com.google.api.grpc grpc-google-cloud-spanner-executor-v1 - 6.94.0 + 6.94.1-SNAPSHOT com.google.api.grpc proto-google-cloud-spanner-v1 - 6.94.0 + 6.94.1-SNAPSHOT com.google.api.grpc proto-google-cloud-spanner-admin-database-v1 - 6.94.0 + 6.94.1-SNAPSHOT com.google.api.grpc grpc-google-cloud-spanner-v1 - 6.94.0 + 6.94.1-SNAPSHOT com.google.api.grpc grpc-google-cloud-spanner-admin-instance-v1 - 6.94.0 + 6.94.1-SNAPSHOT com.google.api.grpc grpc-google-cloud-spanner-admin-database-v1 - 6.94.0 + 6.94.1-SNAPSHOT com.google.cloud google-cloud-spanner - 6.94.0 + 6.94.1-SNAPSHOT diff --git a/proto-google-cloud-spanner-admin-database-v1/pom.xml b/proto-google-cloud-spanner-admin-database-v1/pom.xml index 931beff968..52ed061ef8 100644 --- a/proto-google-cloud-spanner-admin-database-v1/pom.xml +++ b/proto-google-cloud-spanner-admin-database-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-spanner-admin-database-v1 - 6.94.0 + 6.94.1-SNAPSHOT proto-google-cloud-spanner-admin-database-v1 PROTO library for proto-google-cloud-spanner-admin-database-v1 com.google.cloud google-cloud-spanner-parent - 6.94.0 + 6.94.1-SNAPSHOT diff --git a/proto-google-cloud-spanner-admin-instance-v1/pom.xml b/proto-google-cloud-spanner-admin-instance-v1/pom.xml index 6db2494d4d..e2e8a96064 100644 --- a/proto-google-cloud-spanner-admin-instance-v1/pom.xml +++ b/proto-google-cloud-spanner-admin-instance-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-spanner-admin-instance-v1 - 6.94.0 + 6.94.1-SNAPSHOT proto-google-cloud-spanner-admin-instance-v1 PROTO library for proto-google-cloud-spanner-admin-instance-v1 com.google.cloud google-cloud-spanner-parent - 6.94.0 + 6.94.1-SNAPSHOT diff --git a/proto-google-cloud-spanner-executor-v1/pom.xml b/proto-google-cloud-spanner-executor-v1/pom.xml index 5f52c82f5a..e9a8fe1c2e 100644 --- a/proto-google-cloud-spanner-executor-v1/pom.xml +++ b/proto-google-cloud-spanner-executor-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-spanner-executor-v1 - 6.94.0 + 6.94.1-SNAPSHOT proto-google-cloud-spanner-executor-v1 Proto library for google-cloud-spanner com.google.cloud google-cloud-spanner-parent - 6.94.0 + 6.94.1-SNAPSHOT diff --git a/proto-google-cloud-spanner-v1/pom.xml b/proto-google-cloud-spanner-v1/pom.xml index 3467a0b42c..bf37131442 100644 --- a/proto-google-cloud-spanner-v1/pom.xml +++ b/proto-google-cloud-spanner-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-spanner-v1 - 6.94.0 + 6.94.1-SNAPSHOT proto-google-cloud-spanner-v1 PROTO library for proto-google-cloud-spanner-v1 com.google.cloud google-cloud-spanner-parent - 6.94.0 + 6.94.1-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 6362fc44af..cf5adb90b1 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -32,7 +32,7 @@ com.google.cloud google-cloud-spanner - 6.94.0 + 6.94.1-SNAPSHOT diff --git a/versions.txt b/versions.txt index 067002c8e0..1bd933e52a 100644 --- a/versions.txt +++ b/versions.txt @@ -1,13 +1,13 @@ # Format: # module:released-version:current-version -proto-google-cloud-spanner-admin-instance-v1:6.94.0:6.94.0 -proto-google-cloud-spanner-v1:6.94.0:6.94.0 -proto-google-cloud-spanner-admin-database-v1:6.94.0:6.94.0 -grpc-google-cloud-spanner-v1:6.94.0:6.94.0 -grpc-google-cloud-spanner-admin-instance-v1:6.94.0:6.94.0 -grpc-google-cloud-spanner-admin-database-v1:6.94.0:6.94.0 -google-cloud-spanner:6.94.0:6.94.0 -google-cloud-spanner-executor:6.94.0:6.94.0 -proto-google-cloud-spanner-executor-v1:6.94.0:6.94.0 -grpc-google-cloud-spanner-executor-v1:6.94.0:6.94.0 +proto-google-cloud-spanner-admin-instance-v1:6.94.0:6.94.1-SNAPSHOT +proto-google-cloud-spanner-v1:6.94.0:6.94.1-SNAPSHOT +proto-google-cloud-spanner-admin-database-v1:6.94.0:6.94.1-SNAPSHOT +grpc-google-cloud-spanner-v1:6.94.0:6.94.1-SNAPSHOT +grpc-google-cloud-spanner-admin-instance-v1:6.94.0:6.94.1-SNAPSHOT +grpc-google-cloud-spanner-admin-database-v1:6.94.0:6.94.1-SNAPSHOT +google-cloud-spanner:6.94.0:6.94.1-SNAPSHOT +google-cloud-spanner-executor:6.94.0:6.94.1-SNAPSHOT +proto-google-cloud-spanner-executor-v1:6.94.0:6.94.1-SNAPSHOT +grpc-google-cloud-spanner-executor-v1:6.94.0:6.94.1-SNAPSHOT From 2b0f2ff214f4b68dd5957bc4280edb713b77a763 Mon Sep 17 00:00:00 2001 From: Luwei Ge Date: Thu, 5 Jun 2025 11:27:06 -0700 Subject: [PATCH 10/11] feat: enable ALTS hard bound token in DirectPath (#3904) --- .../java/com/google/cloud/spanner/spi/v1/GapicSpannerRpc.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/spi/v1/GapicSpannerRpc.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/spi/v1/GapicSpannerRpc.java index 937367e3d3..09aec6f3eb 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/spi/v1/GapicSpannerRpc.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/spi/v1/GapicSpannerRpc.java @@ -368,6 +368,10 @@ public GapicSpannerRpc(final SpannerOptions options) { boolean isAttemptDirectPathXds = isEnableDirectPathXdsEnv(); if (isAttemptDirectPathXds) { defaultChannelProviderBuilder.setAttemptDirectPath(true); + // This will let the credentials try to fetch a hard-bound access token if the runtime + // environment supports it. + defaultChannelProviderBuilder.setAllowHardBoundTokenTypes( + Collections.singletonList(InstantiatingGrpcChannelProvider.HardBoundTokenTypes.ALTS)); defaultChannelProviderBuilder.setAttemptDirectPathXds(); } From a956f4a9137f87d55c10479209a91c730f312668 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 6 Jun 2025 11:46:06 +0200 Subject: [PATCH 11/11] chore(main): release 6.95.0 (#3902) * chore(main): release 6.95.0 * chore: generate libraries at Fri Jun 6 05:46:44 UTC 2025 --------- Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: cloud-java-bot --- CHANGELOG.md | 20 +++++++++++++++++++ README.md | 6 +++--- benchmarks/pom.xml | 2 +- google-cloud-spanner-bom/pom.xml | 18 ++++++++--------- google-cloud-spanner-executor/pom.xml | 4 ++-- google-cloud-spanner/pom.xml | 4 ++-- .../pom.xml | 4 ++-- .../pom.xml | 4 ++-- grpc-google-cloud-spanner-executor-v1/pom.xml | 4 ++-- grpc-google-cloud-spanner-v1/pom.xml | 4 ++-- pom.xml | 20 +++++++++---------- .../pom.xml | 4 ++-- .../pom.xml | 4 ++-- .../pom.xml | 4 ++-- proto-google-cloud-spanner-v1/pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 20 +++++++++---------- 17 files changed, 74 insertions(+), 54 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ab2077e3d8..a78460a580 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,25 @@ # Changelog +## [6.95.0](https://github.com/googleapis/java-spanner/compare/v6.94.0...v6.95.0) (2025-06-05) + + +### Features + +* Enable ALTS hard bound token in DirectPath ([#3904](https://github.com/googleapis/java-spanner/issues/3904)) ([2b0f2ff](https://github.com/googleapis/java-spanner/commit/2b0f2ff214f4b68dd5957bc4280edb713b77a763)) +* Enable grpc and afe metrics ([#3896](https://github.com/googleapis/java-spanner/issues/3896)) ([706f794](https://github.com/googleapis/java-spanner/commit/706f794f044c2cb1112cfdae6f379e5f2bc3f26f)) +* Last statement sample ([#3830](https://github.com/googleapis/java-spanner/issues/3830)) ([2f62816](https://github.com/googleapis/java-spanner/commit/2f62816b0af9aced1b73e25525f60f8e3e923454)) +* **spanner:** Add new change_stream.proto ([f385698](https://github.com/googleapis/java-spanner/commit/f38569865de7465ae9a37b844a9dd983571d3688)) + + +### Bug Fixes + +* Directpath_enabled attribute ([#3897](https://github.com/googleapis/java-spanner/issues/3897)) ([53bc510](https://github.com/googleapis/java-spanner/commit/53bc510145921d00bc3df04aa4cf407179ed8d8e)) + + +### Dependencies + +* Update dependency io.opentelemetry:opentelemetry-bom to v1.50.0 ([#3887](https://github.com/googleapis/java-spanner/issues/3887)) ([94b879c](https://github.com/googleapis/java-spanner/commit/94b879c8c1848fa0b14dbe8cda8390cfe9e8fce6)) + ## [6.94.0](https://github.com/googleapis/java-spanner/compare/v6.93.0...v6.94.0) (2025-05-21) diff --git a/README.md b/README.md index e8d8bf6216..a67903e7d3 100644 --- a/README.md +++ b/README.md @@ -56,13 +56,13 @@ implementation 'com.google.cloud:google-cloud-spanner' If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-spanner:6.94.0' +implementation 'com.google.cloud:google-cloud-spanner:6.95.0' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-spanner" % "6.94.0" +libraryDependencies += "com.google.cloud" % "google-cloud-spanner" % "6.95.0" ``` ## Authentication @@ -731,7 +731,7 @@ Java is a registered trademark of Oracle and/or its affiliates. [kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-spanner/java11.html [stability-image]: https://img.shields.io/badge/stability-stable-green [maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-spanner.svg -[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-spanner/6.94.0 +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-spanner/6.95.0 [authentication]: https://github.com/googleapis/google-cloud-java#authentication [auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes [predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles diff --git a/benchmarks/pom.xml b/benchmarks/pom.xml index 653e24fc03..b76e5c18ce 100644 --- a/benchmarks/pom.xml +++ b/benchmarks/pom.xml @@ -24,7 +24,7 @@ com.google.cloud google-cloud-spanner-parent - 6.94.1-SNAPSHOT + 6.95.0 diff --git a/google-cloud-spanner-bom/pom.xml b/google-cloud-spanner-bom/pom.xml index 7dd9a35269..4c9c024932 100644 --- a/google-cloud-spanner-bom/pom.xml +++ b/google-cloud-spanner-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-spanner-bom - 6.94.1-SNAPSHOT + 6.95.0 pom com.google.cloud @@ -53,43 +53,43 @@ com.google.cloud google-cloud-spanner - 6.94.1-SNAPSHOT + 6.95.0 com.google.cloud google-cloud-spanner test-jar - 6.94.1-SNAPSHOT + 6.95.0 com.google.api.grpc grpc-google-cloud-spanner-v1 - 6.94.1-SNAPSHOT + 6.95.0 com.google.api.grpc grpc-google-cloud-spanner-admin-instance-v1 - 6.94.1-SNAPSHOT + 6.95.0 com.google.api.grpc grpc-google-cloud-spanner-admin-database-v1 - 6.94.1-SNAPSHOT + 6.95.0 com.google.api.grpc proto-google-cloud-spanner-admin-instance-v1 - 6.94.1-SNAPSHOT + 6.95.0 com.google.api.grpc proto-google-cloud-spanner-v1 - 6.94.1-SNAPSHOT + 6.95.0 com.google.api.grpc proto-google-cloud-spanner-admin-database-v1 - 6.94.1-SNAPSHOT + 6.95.0 diff --git a/google-cloud-spanner-executor/pom.xml b/google-cloud-spanner-executor/pom.xml index a8259e4658..58604d748c 100644 --- a/google-cloud-spanner-executor/pom.xml +++ b/google-cloud-spanner-executor/pom.xml @@ -5,14 +5,14 @@ 4.0.0 com.google.cloud google-cloud-spanner-executor - 6.94.1-SNAPSHOT + 6.95.0 jar Google Cloud Spanner Executor com.google.cloud google-cloud-spanner-parent - 6.94.1-SNAPSHOT + 6.95.0 diff --git a/google-cloud-spanner/pom.xml b/google-cloud-spanner/pom.xml index eaaaff724d..fe8d5f821f 100644 --- a/google-cloud-spanner/pom.xml +++ b/google-cloud-spanner/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-spanner - 6.94.1-SNAPSHOT + 6.95.0 jar Google Cloud Spanner https://github.com/googleapis/java-spanner @@ -11,7 +11,7 @@ com.google.cloud google-cloud-spanner-parent - 6.94.1-SNAPSHOT + 6.95.0 google-cloud-spanner diff --git a/grpc-google-cloud-spanner-admin-database-v1/pom.xml b/grpc-google-cloud-spanner-admin-database-v1/pom.xml index 5bdbe7f605..aff524a482 100644 --- a/grpc-google-cloud-spanner-admin-database-v1/pom.xml +++ b/grpc-google-cloud-spanner-admin-database-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-spanner-admin-database-v1 - 6.94.1-SNAPSHOT + 6.95.0 grpc-google-cloud-spanner-admin-database-v1 GRPC library for grpc-google-cloud-spanner-admin-database-v1 com.google.cloud google-cloud-spanner-parent - 6.94.1-SNAPSHOT + 6.95.0 diff --git a/grpc-google-cloud-spanner-admin-instance-v1/pom.xml b/grpc-google-cloud-spanner-admin-instance-v1/pom.xml index 4dab5bc3fa..14eff94254 100644 --- a/grpc-google-cloud-spanner-admin-instance-v1/pom.xml +++ b/grpc-google-cloud-spanner-admin-instance-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-spanner-admin-instance-v1 - 6.94.1-SNAPSHOT + 6.95.0 grpc-google-cloud-spanner-admin-instance-v1 GRPC library for grpc-google-cloud-spanner-admin-instance-v1 com.google.cloud google-cloud-spanner-parent - 6.94.1-SNAPSHOT + 6.95.0 diff --git a/grpc-google-cloud-spanner-executor-v1/pom.xml b/grpc-google-cloud-spanner-executor-v1/pom.xml index 49bc4d33f3..a9ae2514c6 100644 --- a/grpc-google-cloud-spanner-executor-v1/pom.xml +++ b/grpc-google-cloud-spanner-executor-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-spanner-executor-v1 - 6.94.1-SNAPSHOT + 6.95.0 grpc-google-cloud-spanner-executor-v1 GRPC library for google-cloud-spanner com.google.cloud google-cloud-spanner-parent - 6.94.1-SNAPSHOT + 6.95.0 diff --git a/grpc-google-cloud-spanner-v1/pom.xml b/grpc-google-cloud-spanner-v1/pom.xml index ee7fb15691..1240468fef 100644 --- a/grpc-google-cloud-spanner-v1/pom.xml +++ b/grpc-google-cloud-spanner-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-spanner-v1 - 6.94.1-SNAPSHOT + 6.95.0 grpc-google-cloud-spanner-v1 GRPC library for grpc-google-cloud-spanner-v1 com.google.cloud google-cloud-spanner-parent - 6.94.1-SNAPSHOT + 6.95.0 diff --git a/pom.xml b/pom.xml index 8c6ad6bcd7..b5c8e12e68 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-spanner-parent pom - 6.94.1-SNAPSHOT + 6.95.0 Google Cloud Spanner Parent https://github.com/googleapis/java-spanner @@ -61,47 +61,47 @@ com.google.api.grpc proto-google-cloud-spanner-admin-instance-v1 - 6.94.1-SNAPSHOT + 6.95.0 com.google.api.grpc proto-google-cloud-spanner-executor-v1 - 6.94.1-SNAPSHOT + 6.95.0 com.google.api.grpc grpc-google-cloud-spanner-executor-v1 - 6.94.1-SNAPSHOT + 6.95.0 com.google.api.grpc proto-google-cloud-spanner-v1 - 6.94.1-SNAPSHOT + 6.95.0 com.google.api.grpc proto-google-cloud-spanner-admin-database-v1 - 6.94.1-SNAPSHOT + 6.95.0 com.google.api.grpc grpc-google-cloud-spanner-v1 - 6.94.1-SNAPSHOT + 6.95.0 com.google.api.grpc grpc-google-cloud-spanner-admin-instance-v1 - 6.94.1-SNAPSHOT + 6.95.0 com.google.api.grpc grpc-google-cloud-spanner-admin-database-v1 - 6.94.1-SNAPSHOT + 6.95.0 com.google.cloud google-cloud-spanner - 6.94.1-SNAPSHOT + 6.95.0 diff --git a/proto-google-cloud-spanner-admin-database-v1/pom.xml b/proto-google-cloud-spanner-admin-database-v1/pom.xml index 52ed061ef8..e372fb55f4 100644 --- a/proto-google-cloud-spanner-admin-database-v1/pom.xml +++ b/proto-google-cloud-spanner-admin-database-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-spanner-admin-database-v1 - 6.94.1-SNAPSHOT + 6.95.0 proto-google-cloud-spanner-admin-database-v1 PROTO library for proto-google-cloud-spanner-admin-database-v1 com.google.cloud google-cloud-spanner-parent - 6.94.1-SNAPSHOT + 6.95.0 diff --git a/proto-google-cloud-spanner-admin-instance-v1/pom.xml b/proto-google-cloud-spanner-admin-instance-v1/pom.xml index e2e8a96064..5a116e1ac8 100644 --- a/proto-google-cloud-spanner-admin-instance-v1/pom.xml +++ b/proto-google-cloud-spanner-admin-instance-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-spanner-admin-instance-v1 - 6.94.1-SNAPSHOT + 6.95.0 proto-google-cloud-spanner-admin-instance-v1 PROTO library for proto-google-cloud-spanner-admin-instance-v1 com.google.cloud google-cloud-spanner-parent - 6.94.1-SNAPSHOT + 6.95.0 diff --git a/proto-google-cloud-spanner-executor-v1/pom.xml b/proto-google-cloud-spanner-executor-v1/pom.xml index e9a8fe1c2e..4621b272a0 100644 --- a/proto-google-cloud-spanner-executor-v1/pom.xml +++ b/proto-google-cloud-spanner-executor-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-spanner-executor-v1 - 6.94.1-SNAPSHOT + 6.95.0 proto-google-cloud-spanner-executor-v1 Proto library for google-cloud-spanner com.google.cloud google-cloud-spanner-parent - 6.94.1-SNAPSHOT + 6.95.0 diff --git a/proto-google-cloud-spanner-v1/pom.xml b/proto-google-cloud-spanner-v1/pom.xml index bf37131442..77102b72a9 100644 --- a/proto-google-cloud-spanner-v1/pom.xml +++ b/proto-google-cloud-spanner-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-spanner-v1 - 6.94.1-SNAPSHOT + 6.95.0 proto-google-cloud-spanner-v1 PROTO library for proto-google-cloud-spanner-v1 com.google.cloud google-cloud-spanner-parent - 6.94.1-SNAPSHOT + 6.95.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index cf5adb90b1..83dc3cf9ab 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -32,7 +32,7 @@ com.google.cloud google-cloud-spanner - 6.94.1-SNAPSHOT + 6.95.0 diff --git a/versions.txt b/versions.txt index 1bd933e52a..b7d05cd143 100644 --- a/versions.txt +++ b/versions.txt @@ -1,13 +1,13 @@ # Format: # module:released-version:current-version -proto-google-cloud-spanner-admin-instance-v1:6.94.0:6.94.1-SNAPSHOT -proto-google-cloud-spanner-v1:6.94.0:6.94.1-SNAPSHOT -proto-google-cloud-spanner-admin-database-v1:6.94.0:6.94.1-SNAPSHOT -grpc-google-cloud-spanner-v1:6.94.0:6.94.1-SNAPSHOT -grpc-google-cloud-spanner-admin-instance-v1:6.94.0:6.94.1-SNAPSHOT -grpc-google-cloud-spanner-admin-database-v1:6.94.0:6.94.1-SNAPSHOT -google-cloud-spanner:6.94.0:6.94.1-SNAPSHOT -google-cloud-spanner-executor:6.94.0:6.94.1-SNAPSHOT -proto-google-cloud-spanner-executor-v1:6.94.0:6.94.1-SNAPSHOT -grpc-google-cloud-spanner-executor-v1:6.94.0:6.94.1-SNAPSHOT +proto-google-cloud-spanner-admin-instance-v1:6.95.0:6.95.0 +proto-google-cloud-spanner-v1:6.95.0:6.95.0 +proto-google-cloud-spanner-admin-database-v1:6.95.0:6.95.0 +grpc-google-cloud-spanner-v1:6.95.0:6.95.0 +grpc-google-cloud-spanner-admin-instance-v1:6.95.0:6.95.0 +grpc-google-cloud-spanner-admin-database-v1:6.95.0:6.95.0 +google-cloud-spanner:6.95.0:6.95.0 +google-cloud-spanner-executor:6.95.0:6.95.0 +proto-google-cloud-spanner-executor-v1:6.95.0:6.95.0 +grpc-google-cloud-spanner-executor-v1:6.95.0:6.95.0