embulk-input-pubsub 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +2 -0
  3. data/.scalafmt.conf +13 -0
  4. data/LICENSE +21 -0
  5. data/README.md +75 -0
  6. data/build.gradle +87 -0
  7. data/classpath/animal-sniffer-annotations-1.18.jar +0 -0
  8. data/classpath/annotations-4.1.1.4.jar +0 -0
  9. data/classpath/auto-value-annotations-1.6.6.jar +0 -0
  10. data/classpath/checker-compat-qual-2.5.5.jar +0 -0
  11. data/classpath/commons-codec-1.11.jar +0 -0
  12. data/classpath/commons-lang3-3.5.jar +0 -0
  13. data/classpath/commons-logging-1.2.jar +0 -0
  14. data/classpath/embulk-input-pubsub-0.0.1-shadow.jar +0 -0
  15. data/classpath/error_prone_annotations-2.3.2.jar +0 -0
  16. data/classpath/google-auth-library-credentials-0.18.0.jar +0 -0
  17. data/classpath/google-auth-library-oauth2-http-0.18.0.jar +0 -0
  18. data/classpath/google-cloud-core-1.91.3.jar +0 -0
  19. data/classpath/google-cloud-core-grpc-1.91.3.jar +0 -0
  20. data/classpath/google-http-client-1.32.1.jar +0 -0
  21. data/classpath/google-http-client-jackson2-1.32.1.jar +0 -0
  22. data/classpath/grpc-alts-1.23.0.jar +0 -0
  23. data/classpath/grpc-auth-1.23.0.jar +0 -0
  24. data/classpath/grpc-context-1.24.1.jar +0 -0
  25. data/classpath/grpc-google-cloud-pubsub-v1-1.82.0.jar +0 -0
  26. data/classpath/grpc-grpclb-1.23.0.jar +0 -0
  27. data/classpath/grpc-protobuf-1.24.1.jar +0 -0
  28. data/classpath/grpc-protobuf-lite-1.24.1.jar +0 -0
  29. data/classpath/gson-2.8.5.jar +0 -0
  30. data/classpath/httpclient-4.5.10.jar +0 -0
  31. data/classpath/httpcore-4.4.12.jar +0 -0
  32. data/classpath/j2objc-annotations-1.3.jar +0 -0
  33. data/classpath/jackson-core-2.9.9.jar +0 -0
  34. data/classpath/javax.annotation-api-1.3.2.jar +0 -0
  35. data/classpath/jsr305-3.0.2.jar +0 -0
  36. data/classpath/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar +0 -0
  37. data/classpath/opencensus-api-0.24.0.jar +0 -0
  38. data/classpath/opencensus-contrib-grpc-metrics-0.21.0.jar +0 -0
  39. data/classpath/opencensus-contrib-http-util-0.24.0.jar +0 -0
  40. data/classpath/perfmark-api-0.17.0.jar +0 -0
  41. data/classpath/proto-google-cloud-pubsub-v1-1.82.0.jar +0 -0
  42. data/classpath/proto-google-common-protos-1.17.0.jar +0 -0
  43. data/classpath/proto-google-iam-v1-0.13.0.jar +0 -0
  44. data/classpath/protobuf-java-3.10.0.jar +0 -0
  45. data/classpath/protobuf-java-util-3.10.0.jar +0 -0
  46. data/classpath/scala-library-2.13.1.jar +0 -0
  47. data/classpath/threetenbp-1.3.3.jar +0 -0
  48. data/examples/pubsub2stdout.yaml +10 -0
  49. data/gradle.properties +1 -0
  50. data/gradle/wrapper/gradle-wrapper.jar +0 -0
  51. data/gradle/wrapper/gradle-wrapper.properties +6 -0
  52. data/gradlew +172 -0
  53. data/gradlew.bat +84 -0
  54. data/lib/embulk/input/pubsub.rb +3 -0
  55. data/src/main/java/com/embulk/input/pubsub/checkpoint/Checkpoint.java +734 -0
  56. data/src/main/java/com/embulk/input/pubsub/checkpoint/CheckpointOrBuilder.java +33 -0
  57. data/src/main/java/com/embulk/input/pubsub/checkpoint/CheckpointProtos.java +61 -0
  58. data/src/main/resources/checkpoint.proto +11 -0
  59. data/src/main/scala/org/embulk/input/pubsub/PluginTask.scala +42 -0
  60. data/src/main/scala/org/embulk/input/pubsub/PubsubBatchSubscriber.scala +103 -0
  61. data/src/main/scala/org/embulk/input/pubsub/PubsubInputPlugin.scala +142 -0
  62. data/src/main/scala/org/embulk/input/pubsub/checkpoint/StoredCheckpoint.scala +123 -0
  63. metadata +105 -0
@@ -0,0 +1,84 @@
1
+ @if "%DEBUG%" == "" @echo off
2
+ @rem ##########################################################################
3
+ @rem
4
+ @rem Gradle startup script for Windows
5
+ @rem
6
+ @rem ##########################################################################
7
+
8
+ @rem Set local scope for the variables with windows NT shell
9
+ if "%OS%"=="Windows_NT" setlocal
10
+
11
+ set DIRNAME=%~dp0
12
+ if "%DIRNAME%" == "" set DIRNAME=.
13
+ set APP_BASE_NAME=%~n0
14
+ set APP_HOME=%DIRNAME%
15
+
16
+ @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17
+ set DEFAULT_JVM_OPTS="-Xmx64m"
18
+
19
+ @rem Find java.exe
20
+ if defined JAVA_HOME goto findJavaFromJavaHome
21
+
22
+ set JAVA_EXE=java.exe
23
+ %JAVA_EXE% -version >NUL 2>&1
24
+ if "%ERRORLEVEL%" == "0" goto init
25
+
26
+ echo.
27
+ echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28
+ echo.
29
+ echo Please set the JAVA_HOME variable in your environment to match the
30
+ echo location of your Java installation.
31
+
32
+ goto fail
33
+
34
+ :findJavaFromJavaHome
35
+ set JAVA_HOME=%JAVA_HOME:"=%
36
+ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37
+
38
+ if exist "%JAVA_EXE%" goto init
39
+
40
+ echo.
41
+ echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42
+ echo.
43
+ echo Please set the JAVA_HOME variable in your environment to match the
44
+ echo location of your Java installation.
45
+
46
+ goto fail
47
+
48
+ :init
49
+ @rem Get command-line arguments, handling Windows variants
50
+
51
+ if not "%OS%" == "Windows_NT" goto win9xME_args
52
+
53
+ :win9xME_args
54
+ @rem Slurp the command line arguments.
55
+ set CMD_LINE_ARGS=
56
+ set _SKIP=2
57
+
58
+ :win9xME_args_slurp
59
+ if "x%~1" == "x" goto execute
60
+
61
+ set CMD_LINE_ARGS=%*
62
+
63
+ :execute
64
+ @rem Setup the command line
65
+
66
+ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
67
+
68
+ @rem Execute Gradle
69
+ "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
70
+
71
+ :end
72
+ @rem End local scope for the variables with windows NT shell
73
+ if "%ERRORLEVEL%"=="0" goto mainEnd
74
+
75
+ :fail
76
+ rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
77
+ rem the _cmd.exe /c_ return code!
78
+ if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
79
+ exit /b 1
80
+
81
+ :mainEnd
82
+ if "%OS%"=="Windows_NT" endlocal
83
+
84
+ :omega
@@ -0,0 +1,3 @@
1
+ Embulk::JavaPlugin.register_input(
2
+ "pubsub", "org.embulk.input.pubsub.PubsubInputPlugin",
3
+ File.expand_path('../../../../classpath', __FILE__))
@@ -0,0 +1,734 @@
1
+ // Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ // source: src/main/resources/checkpoint.proto
3
+
4
+ package com.embulk.input.pubsub.checkpoint;
5
+
6
+ /**
7
+ * Protobuf type {@code Checkpoint}
8
+ */
9
+ public final class Checkpoint extends
10
+ com.google.protobuf.GeneratedMessageV3 implements
11
+ // @@protoc_insertion_point(message_implements:Checkpoint)
12
+ CheckpointOrBuilder {
13
+ private static final long serialVersionUID = 0L;
14
+ // Use Checkpoint.newBuilder() to construct.
15
+ private Checkpoint(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
16
+ super(builder);
17
+ }
18
+ private Checkpoint() {
19
+ messages_ = java.util.Collections.emptyList();
20
+ }
21
+
22
+ @java.lang.Override
23
+ public final com.google.protobuf.UnknownFieldSet
24
+ getUnknownFields() {
25
+ return this.unknownFields;
26
+ }
27
+ private Checkpoint(
28
+ com.google.protobuf.CodedInputStream input,
29
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
30
+ throws com.google.protobuf.InvalidProtocolBufferException {
31
+ this();
32
+ if (extensionRegistry == null) {
33
+ throw new java.lang.NullPointerException();
34
+ }
35
+ int mutable_bitField0_ = 0;
36
+ com.google.protobuf.UnknownFieldSet.Builder unknownFields =
37
+ com.google.protobuf.UnknownFieldSet.newBuilder();
38
+ try {
39
+ boolean done = false;
40
+ while (!done) {
41
+ int tag = input.readTag();
42
+ switch (tag) {
43
+ case 0:
44
+ done = true;
45
+ break;
46
+ default: {
47
+ if (!parseUnknownFieldProto3(
48
+ input, unknownFields, extensionRegistry, tag)) {
49
+ done = true;
50
+ }
51
+ break;
52
+ }
53
+ case 10: {
54
+ if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
55
+ messages_ = new java.util.ArrayList<com.google.pubsub.v1.PubsubMessage>();
56
+ mutable_bitField0_ |= 0x00000001;
57
+ }
58
+ messages_.add(
59
+ input.readMessage(com.google.pubsub.v1.PubsubMessage.parser(), extensionRegistry));
60
+ break;
61
+ }
62
+ }
63
+ }
64
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
65
+ throw e.setUnfinishedMessage(this);
66
+ } catch (java.io.IOException e) {
67
+ throw new com.google.protobuf.InvalidProtocolBufferException(
68
+ e).setUnfinishedMessage(this);
69
+ } finally {
70
+ if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
71
+ messages_ = java.util.Collections.unmodifiableList(messages_);
72
+ }
73
+ this.unknownFields = unknownFields.build();
74
+ makeExtensionsImmutable();
75
+ }
76
+ }
77
+ public static final com.google.protobuf.Descriptors.Descriptor
78
+ getDescriptor() {
79
+ return com.embulk.input.pubsub.checkpoint.CheckpointProtos.internal_static_Checkpoint_descriptor;
80
+ }
81
+
82
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
83
+ internalGetFieldAccessorTable() {
84
+ return com.embulk.input.pubsub.checkpoint.CheckpointProtos.internal_static_Checkpoint_fieldAccessorTable
85
+ .ensureFieldAccessorsInitialized(
86
+ com.embulk.input.pubsub.checkpoint.Checkpoint.class, com.embulk.input.pubsub.checkpoint.Checkpoint.Builder.class);
87
+ }
88
+
89
+ public static final int MESSAGES_FIELD_NUMBER = 1;
90
+ private java.util.List<com.google.pubsub.v1.PubsubMessage> messages_;
91
+ /**
92
+ * <code>repeated .google.pubsub.v1.PubsubMessage messages = 1;</code>
93
+ */
94
+ public java.util.List<com.google.pubsub.v1.PubsubMessage> getMessagesList() {
95
+ return messages_;
96
+ }
97
+ /**
98
+ * <code>repeated .google.pubsub.v1.PubsubMessage messages = 1;</code>
99
+ */
100
+ public java.util.List<? extends com.google.pubsub.v1.PubsubMessageOrBuilder>
101
+ getMessagesOrBuilderList() {
102
+ return messages_;
103
+ }
104
+ /**
105
+ * <code>repeated .google.pubsub.v1.PubsubMessage messages = 1;</code>
106
+ */
107
+ public int getMessagesCount() {
108
+ return messages_.size();
109
+ }
110
+ /**
111
+ * <code>repeated .google.pubsub.v1.PubsubMessage messages = 1;</code>
112
+ */
113
+ public com.google.pubsub.v1.PubsubMessage getMessages(int index) {
114
+ return messages_.get(index);
115
+ }
116
+ /**
117
+ * <code>repeated .google.pubsub.v1.PubsubMessage messages = 1;</code>
118
+ */
119
+ public com.google.pubsub.v1.PubsubMessageOrBuilder getMessagesOrBuilder(
120
+ int index) {
121
+ return messages_.get(index);
122
+ }
123
+
124
+ private byte memoizedIsInitialized = -1;
125
+ public final boolean isInitialized() {
126
+ byte isInitialized = memoizedIsInitialized;
127
+ if (isInitialized == 1) return true;
128
+ if (isInitialized == 0) return false;
129
+
130
+ memoizedIsInitialized = 1;
131
+ return true;
132
+ }
133
+
134
+ public void writeTo(com.google.protobuf.CodedOutputStream output)
135
+ throws java.io.IOException {
136
+ for (int i = 0; i < messages_.size(); i++) {
137
+ output.writeMessage(1, messages_.get(i));
138
+ }
139
+ unknownFields.writeTo(output);
140
+ }
141
+
142
+ public int getSerializedSize() {
143
+ int size = memoizedSize;
144
+ if (size != -1) return size;
145
+
146
+ size = 0;
147
+ for (int i = 0; i < messages_.size(); i++) {
148
+ size += com.google.protobuf.CodedOutputStream
149
+ .computeMessageSize(1, messages_.get(i));
150
+ }
151
+ size += unknownFields.getSerializedSize();
152
+ memoizedSize = size;
153
+ return size;
154
+ }
155
+
156
+ @java.lang.Override
157
+ public boolean equals(final java.lang.Object obj) {
158
+ if (obj == this) {
159
+ return true;
160
+ }
161
+ if (!(obj instanceof com.embulk.input.pubsub.checkpoint.Checkpoint)) {
162
+ return super.equals(obj);
163
+ }
164
+ com.embulk.input.pubsub.checkpoint.Checkpoint other = (com.embulk.input.pubsub.checkpoint.Checkpoint) obj;
165
+
166
+ boolean result = true;
167
+ result = result && getMessagesList()
168
+ .equals(other.getMessagesList());
169
+ result = result && unknownFields.equals(other.unknownFields);
170
+ return result;
171
+ }
172
+
173
+ @java.lang.Override
174
+ public int hashCode() {
175
+ if (memoizedHashCode != 0) {
176
+ return memoizedHashCode;
177
+ }
178
+ int hash = 41;
179
+ hash = (19 * hash) + getDescriptor().hashCode();
180
+ if (getMessagesCount() > 0) {
181
+ hash = (37 * hash) + MESSAGES_FIELD_NUMBER;
182
+ hash = (53 * hash) + getMessagesList().hashCode();
183
+ }
184
+ hash = (29 * hash) + unknownFields.hashCode();
185
+ memoizedHashCode = hash;
186
+ return hash;
187
+ }
188
+
189
+ public static com.embulk.input.pubsub.checkpoint.Checkpoint parseFrom(
190
+ java.nio.ByteBuffer data)
191
+ throws com.google.protobuf.InvalidProtocolBufferException {
192
+ return PARSER.parseFrom(data);
193
+ }
194
+ public static com.embulk.input.pubsub.checkpoint.Checkpoint parseFrom(
195
+ java.nio.ByteBuffer data,
196
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
197
+ throws com.google.protobuf.InvalidProtocolBufferException {
198
+ return PARSER.parseFrom(data, extensionRegistry);
199
+ }
200
+ public static com.embulk.input.pubsub.checkpoint.Checkpoint parseFrom(
201
+ com.google.protobuf.ByteString data)
202
+ throws com.google.protobuf.InvalidProtocolBufferException {
203
+ return PARSER.parseFrom(data);
204
+ }
205
+ public static com.embulk.input.pubsub.checkpoint.Checkpoint parseFrom(
206
+ com.google.protobuf.ByteString data,
207
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
208
+ throws com.google.protobuf.InvalidProtocolBufferException {
209
+ return PARSER.parseFrom(data, extensionRegistry);
210
+ }
211
+ public static com.embulk.input.pubsub.checkpoint.Checkpoint parseFrom(byte[] data)
212
+ throws com.google.protobuf.InvalidProtocolBufferException {
213
+ return PARSER.parseFrom(data);
214
+ }
215
+ public static com.embulk.input.pubsub.checkpoint.Checkpoint parseFrom(
216
+ byte[] data,
217
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
218
+ throws com.google.protobuf.InvalidProtocolBufferException {
219
+ return PARSER.parseFrom(data, extensionRegistry);
220
+ }
221
+ public static com.embulk.input.pubsub.checkpoint.Checkpoint parseFrom(java.io.InputStream input)
222
+ throws java.io.IOException {
223
+ return com.google.protobuf.GeneratedMessageV3
224
+ .parseWithIOException(PARSER, input);
225
+ }
226
+ public static com.embulk.input.pubsub.checkpoint.Checkpoint parseFrom(
227
+ java.io.InputStream input,
228
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
229
+ throws java.io.IOException {
230
+ return com.google.protobuf.GeneratedMessageV3
231
+ .parseWithIOException(PARSER, input, extensionRegistry);
232
+ }
233
+ public static com.embulk.input.pubsub.checkpoint.Checkpoint parseDelimitedFrom(java.io.InputStream input)
234
+ throws java.io.IOException {
235
+ return com.google.protobuf.GeneratedMessageV3
236
+ .parseDelimitedWithIOException(PARSER, input);
237
+ }
238
+ public static com.embulk.input.pubsub.checkpoint.Checkpoint parseDelimitedFrom(
239
+ java.io.InputStream input,
240
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
241
+ throws java.io.IOException {
242
+ return com.google.protobuf.GeneratedMessageV3
243
+ .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
244
+ }
245
+ public static com.embulk.input.pubsub.checkpoint.Checkpoint parseFrom(
246
+ com.google.protobuf.CodedInputStream input)
247
+ throws java.io.IOException {
248
+ return com.google.protobuf.GeneratedMessageV3
249
+ .parseWithIOException(PARSER, input);
250
+ }
251
+ public static com.embulk.input.pubsub.checkpoint.Checkpoint parseFrom(
252
+ com.google.protobuf.CodedInputStream input,
253
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
254
+ throws java.io.IOException {
255
+ return com.google.protobuf.GeneratedMessageV3
256
+ .parseWithIOException(PARSER, input, extensionRegistry);
257
+ }
258
+
259
+ public Builder newBuilderForType() { return newBuilder(); }
260
+ public static Builder newBuilder() {
261
+ return DEFAULT_INSTANCE.toBuilder();
262
+ }
263
+ public static Builder newBuilder(com.embulk.input.pubsub.checkpoint.Checkpoint prototype) {
264
+ return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
265
+ }
266
+ public Builder toBuilder() {
267
+ return this == DEFAULT_INSTANCE
268
+ ? new Builder() : new Builder().mergeFrom(this);
269
+ }
270
+
271
+ @java.lang.Override
272
+ protected Builder newBuilderForType(
273
+ com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
274
+ Builder builder = new Builder(parent);
275
+ return builder;
276
+ }
277
+ /**
278
+ * Protobuf type {@code Checkpoint}
279
+ */
280
+ public static final class Builder extends
281
+ com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
282
+ // @@protoc_insertion_point(builder_implements:Checkpoint)
283
+ com.embulk.input.pubsub.checkpoint.CheckpointOrBuilder {
284
+ public static final com.google.protobuf.Descriptors.Descriptor
285
+ getDescriptor() {
286
+ return com.embulk.input.pubsub.checkpoint.CheckpointProtos.internal_static_Checkpoint_descriptor;
287
+ }
288
+
289
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
290
+ internalGetFieldAccessorTable() {
291
+ return com.embulk.input.pubsub.checkpoint.CheckpointProtos.internal_static_Checkpoint_fieldAccessorTable
292
+ .ensureFieldAccessorsInitialized(
293
+ com.embulk.input.pubsub.checkpoint.Checkpoint.class, com.embulk.input.pubsub.checkpoint.Checkpoint.Builder.class);
294
+ }
295
+
296
+ // Construct using com.embulk.input.pubsub.checkpoint.Checkpoint.newBuilder()
297
+ private Builder() {
298
+ maybeForceBuilderInitialization();
299
+ }
300
+
301
+ private Builder(
302
+ com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
303
+ super(parent);
304
+ maybeForceBuilderInitialization();
305
+ }
306
+ private void maybeForceBuilderInitialization() {
307
+ if (com.google.protobuf.GeneratedMessageV3
308
+ .alwaysUseFieldBuilders) {
309
+ getMessagesFieldBuilder();
310
+ }
311
+ }
312
+ public Builder clear() {
313
+ super.clear();
314
+ if (messagesBuilder_ == null) {
315
+ messages_ = java.util.Collections.emptyList();
316
+ bitField0_ = (bitField0_ & ~0x00000001);
317
+ } else {
318
+ messagesBuilder_.clear();
319
+ }
320
+ return this;
321
+ }
322
+
323
+ public com.google.protobuf.Descriptors.Descriptor
324
+ getDescriptorForType() {
325
+ return com.embulk.input.pubsub.checkpoint.CheckpointProtos.internal_static_Checkpoint_descriptor;
326
+ }
327
+
328
+ public com.embulk.input.pubsub.checkpoint.Checkpoint getDefaultInstanceForType() {
329
+ return com.embulk.input.pubsub.checkpoint.Checkpoint.getDefaultInstance();
330
+ }
331
+
332
+ public com.embulk.input.pubsub.checkpoint.Checkpoint build() {
333
+ com.embulk.input.pubsub.checkpoint.Checkpoint result = buildPartial();
334
+ if (!result.isInitialized()) {
335
+ throw newUninitializedMessageException(result);
336
+ }
337
+ return result;
338
+ }
339
+
340
+ public com.embulk.input.pubsub.checkpoint.Checkpoint buildPartial() {
341
+ com.embulk.input.pubsub.checkpoint.Checkpoint result = new com.embulk.input.pubsub.checkpoint.Checkpoint(this);
342
+ int from_bitField0_ = bitField0_;
343
+ if (messagesBuilder_ == null) {
344
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
345
+ messages_ = java.util.Collections.unmodifiableList(messages_);
346
+ bitField0_ = (bitField0_ & ~0x00000001);
347
+ }
348
+ result.messages_ = messages_;
349
+ } else {
350
+ result.messages_ = messagesBuilder_.build();
351
+ }
352
+ onBuilt();
353
+ return result;
354
+ }
355
+
356
+ public Builder clone() {
357
+ return (Builder) super.clone();
358
+ }
359
+ public Builder setField(
360
+ com.google.protobuf.Descriptors.FieldDescriptor field,
361
+ java.lang.Object value) {
362
+ return (Builder) super.setField(field, value);
363
+ }
364
+ public Builder clearField(
365
+ com.google.protobuf.Descriptors.FieldDescriptor field) {
366
+ return (Builder) super.clearField(field);
367
+ }
368
+ public Builder clearOneof(
369
+ com.google.protobuf.Descriptors.OneofDescriptor oneof) {
370
+ return (Builder) super.clearOneof(oneof);
371
+ }
372
+ public Builder setRepeatedField(
373
+ com.google.protobuf.Descriptors.FieldDescriptor field,
374
+ int index, java.lang.Object value) {
375
+ return (Builder) super.setRepeatedField(field, index, value);
376
+ }
377
+ public Builder addRepeatedField(
378
+ com.google.protobuf.Descriptors.FieldDescriptor field,
379
+ java.lang.Object value) {
380
+ return (Builder) super.addRepeatedField(field, value);
381
+ }
382
+ public Builder mergeFrom(com.google.protobuf.Message other) {
383
+ if (other instanceof com.embulk.input.pubsub.checkpoint.Checkpoint) {
384
+ return mergeFrom((com.embulk.input.pubsub.checkpoint.Checkpoint)other);
385
+ } else {
386
+ super.mergeFrom(other);
387
+ return this;
388
+ }
389
+ }
390
+
391
+ public Builder mergeFrom(com.embulk.input.pubsub.checkpoint.Checkpoint other) {
392
+ if (other == com.embulk.input.pubsub.checkpoint.Checkpoint.getDefaultInstance()) return this;
393
+ if (messagesBuilder_ == null) {
394
+ if (!other.messages_.isEmpty()) {
395
+ if (messages_.isEmpty()) {
396
+ messages_ = other.messages_;
397
+ bitField0_ = (bitField0_ & ~0x00000001);
398
+ } else {
399
+ ensureMessagesIsMutable();
400
+ messages_.addAll(other.messages_);
401
+ }
402
+ onChanged();
403
+ }
404
+ } else {
405
+ if (!other.messages_.isEmpty()) {
406
+ if (messagesBuilder_.isEmpty()) {
407
+ messagesBuilder_.dispose();
408
+ messagesBuilder_ = null;
409
+ messages_ = other.messages_;
410
+ bitField0_ = (bitField0_ & ~0x00000001);
411
+ messagesBuilder_ =
412
+ com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
413
+ getMessagesFieldBuilder() : null;
414
+ } else {
415
+ messagesBuilder_.addAllMessages(other.messages_);
416
+ }
417
+ }
418
+ }
419
+ this.mergeUnknownFields(other.unknownFields);
420
+ onChanged();
421
+ return this;
422
+ }
423
+
424
+ public final boolean isInitialized() {
425
+ return true;
426
+ }
427
+
428
+ public Builder mergeFrom(
429
+ com.google.protobuf.CodedInputStream input,
430
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
431
+ throws java.io.IOException {
432
+ com.embulk.input.pubsub.checkpoint.Checkpoint parsedMessage = null;
433
+ try {
434
+ parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
435
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
436
+ parsedMessage = (com.embulk.input.pubsub.checkpoint.Checkpoint) e.getUnfinishedMessage();
437
+ throw e.unwrapIOException();
438
+ } finally {
439
+ if (parsedMessage != null) {
440
+ mergeFrom(parsedMessage);
441
+ }
442
+ }
443
+ return this;
444
+ }
445
+ private int bitField0_;
446
+
447
+ private java.util.List<com.google.pubsub.v1.PubsubMessage> messages_ =
448
+ java.util.Collections.emptyList();
449
+ private void ensureMessagesIsMutable() {
450
+ if (!((bitField0_ & 0x00000001) == 0x00000001)) {
451
+ messages_ = new java.util.ArrayList<com.google.pubsub.v1.PubsubMessage>(messages_);
452
+ bitField0_ |= 0x00000001;
453
+ }
454
+ }
455
+
456
+ private com.google.protobuf.RepeatedFieldBuilderV3<
457
+ com.google.pubsub.v1.PubsubMessage, com.google.pubsub.v1.PubsubMessage.Builder, com.google.pubsub.v1.PubsubMessageOrBuilder> messagesBuilder_;
458
+
459
+ /**
460
+ * <code>repeated .google.pubsub.v1.PubsubMessage messages = 1;</code>
461
+ */
462
+ public java.util.List<com.google.pubsub.v1.PubsubMessage> getMessagesList() {
463
+ if (messagesBuilder_ == null) {
464
+ return java.util.Collections.unmodifiableList(messages_);
465
+ } else {
466
+ return messagesBuilder_.getMessageList();
467
+ }
468
+ }
469
+ /**
470
+ * <code>repeated .google.pubsub.v1.PubsubMessage messages = 1;</code>
471
+ */
472
+ public int getMessagesCount() {
473
+ if (messagesBuilder_ == null) {
474
+ return messages_.size();
475
+ } else {
476
+ return messagesBuilder_.getCount();
477
+ }
478
+ }
479
+ /**
480
+ * <code>repeated .google.pubsub.v1.PubsubMessage messages = 1;</code>
481
+ */
482
+ public com.google.pubsub.v1.PubsubMessage getMessages(int index) {
483
+ if (messagesBuilder_ == null) {
484
+ return messages_.get(index);
485
+ } else {
486
+ return messagesBuilder_.getMessage(index);
487
+ }
488
+ }
489
+ /**
490
+ * <code>repeated .google.pubsub.v1.PubsubMessage messages = 1;</code>
491
+ */
492
+ public Builder setMessages(
493
+ int index, com.google.pubsub.v1.PubsubMessage value) {
494
+ if (messagesBuilder_ == null) {
495
+ if (value == null) {
496
+ throw new NullPointerException();
497
+ }
498
+ ensureMessagesIsMutable();
499
+ messages_.set(index, value);
500
+ onChanged();
501
+ } else {
502
+ messagesBuilder_.setMessage(index, value);
503
+ }
504
+ return this;
505
+ }
506
+ /**
507
+ * <code>repeated .google.pubsub.v1.PubsubMessage messages = 1;</code>
508
+ */
509
+ public Builder setMessages(
510
+ int index, com.google.pubsub.v1.PubsubMessage.Builder builderForValue) {
511
+ if (messagesBuilder_ == null) {
512
+ ensureMessagesIsMutable();
513
+ messages_.set(index, builderForValue.build());
514
+ onChanged();
515
+ } else {
516
+ messagesBuilder_.setMessage(index, builderForValue.build());
517
+ }
518
+ return this;
519
+ }
520
+ /**
521
+ * <code>repeated .google.pubsub.v1.PubsubMessage messages = 1;</code>
522
+ */
523
+ public Builder addMessages(com.google.pubsub.v1.PubsubMessage value) {
524
+ if (messagesBuilder_ == null) {
525
+ if (value == null) {
526
+ throw new NullPointerException();
527
+ }
528
+ ensureMessagesIsMutable();
529
+ messages_.add(value);
530
+ onChanged();
531
+ } else {
532
+ messagesBuilder_.addMessage(value);
533
+ }
534
+ return this;
535
+ }
536
+ /**
537
+ * <code>repeated .google.pubsub.v1.PubsubMessage messages = 1;</code>
538
+ */
539
+ public Builder addMessages(
540
+ int index, com.google.pubsub.v1.PubsubMessage value) {
541
+ if (messagesBuilder_ == null) {
542
+ if (value == null) {
543
+ throw new NullPointerException();
544
+ }
545
+ ensureMessagesIsMutable();
546
+ messages_.add(index, value);
547
+ onChanged();
548
+ } else {
549
+ messagesBuilder_.addMessage(index, value);
550
+ }
551
+ return this;
552
+ }
553
+ /**
554
+ * <code>repeated .google.pubsub.v1.PubsubMessage messages = 1;</code>
555
+ */
556
+ public Builder addMessages(
557
+ com.google.pubsub.v1.PubsubMessage.Builder builderForValue) {
558
+ if (messagesBuilder_ == null) {
559
+ ensureMessagesIsMutable();
560
+ messages_.add(builderForValue.build());
561
+ onChanged();
562
+ } else {
563
+ messagesBuilder_.addMessage(builderForValue.build());
564
+ }
565
+ return this;
566
+ }
567
+ /**
568
+ * <code>repeated .google.pubsub.v1.PubsubMessage messages = 1;</code>
569
+ */
570
+ public Builder addMessages(
571
+ int index, com.google.pubsub.v1.PubsubMessage.Builder builderForValue) {
572
+ if (messagesBuilder_ == null) {
573
+ ensureMessagesIsMutable();
574
+ messages_.add(index, builderForValue.build());
575
+ onChanged();
576
+ } else {
577
+ messagesBuilder_.addMessage(index, builderForValue.build());
578
+ }
579
+ return this;
580
+ }
581
+ /**
582
+ * <code>repeated .google.pubsub.v1.PubsubMessage messages = 1;</code>
583
+ */
584
+ public Builder addAllMessages(
585
+ java.lang.Iterable<? extends com.google.pubsub.v1.PubsubMessage> values) {
586
+ if (messagesBuilder_ == null) {
587
+ ensureMessagesIsMutable();
588
+ com.google.protobuf.AbstractMessageLite.Builder.addAll(
589
+ values, messages_);
590
+ onChanged();
591
+ } else {
592
+ messagesBuilder_.addAllMessages(values);
593
+ }
594
+ return this;
595
+ }
596
+ /**
597
+ * <code>repeated .google.pubsub.v1.PubsubMessage messages = 1;</code>
598
+ */
599
+ public Builder clearMessages() {
600
+ if (messagesBuilder_ == null) {
601
+ messages_ = java.util.Collections.emptyList();
602
+ bitField0_ = (bitField0_ & ~0x00000001);
603
+ onChanged();
604
+ } else {
605
+ messagesBuilder_.clear();
606
+ }
607
+ return this;
608
+ }
609
+ /**
610
+ * <code>repeated .google.pubsub.v1.PubsubMessage messages = 1;</code>
611
+ */
612
+ public Builder removeMessages(int index) {
613
+ if (messagesBuilder_ == null) {
614
+ ensureMessagesIsMutable();
615
+ messages_.remove(index);
616
+ onChanged();
617
+ } else {
618
+ messagesBuilder_.remove(index);
619
+ }
620
+ return this;
621
+ }
622
+ /**
623
+ * <code>repeated .google.pubsub.v1.PubsubMessage messages = 1;</code>
624
+ */
625
+ public com.google.pubsub.v1.PubsubMessage.Builder getMessagesBuilder(
626
+ int index) {
627
+ return getMessagesFieldBuilder().getBuilder(index);
628
+ }
629
+ /**
630
+ * <code>repeated .google.pubsub.v1.PubsubMessage messages = 1;</code>
631
+ */
632
+ public com.google.pubsub.v1.PubsubMessageOrBuilder getMessagesOrBuilder(
633
+ int index) {
634
+ if (messagesBuilder_ == null) {
635
+ return messages_.get(index); } else {
636
+ return messagesBuilder_.getMessageOrBuilder(index);
637
+ }
638
+ }
639
+ /**
640
+ * <code>repeated .google.pubsub.v1.PubsubMessage messages = 1;</code>
641
+ */
642
+ public java.util.List<? extends com.google.pubsub.v1.PubsubMessageOrBuilder>
643
+ getMessagesOrBuilderList() {
644
+ if (messagesBuilder_ != null) {
645
+ return messagesBuilder_.getMessageOrBuilderList();
646
+ } else {
647
+ return java.util.Collections.unmodifiableList(messages_);
648
+ }
649
+ }
650
+ /**
651
+ * <code>repeated .google.pubsub.v1.PubsubMessage messages = 1;</code>
652
+ */
653
+ public com.google.pubsub.v1.PubsubMessage.Builder addMessagesBuilder() {
654
+ return getMessagesFieldBuilder().addBuilder(
655
+ com.google.pubsub.v1.PubsubMessage.getDefaultInstance());
656
+ }
657
+ /**
658
+ * <code>repeated .google.pubsub.v1.PubsubMessage messages = 1;</code>
659
+ */
660
+ public com.google.pubsub.v1.PubsubMessage.Builder addMessagesBuilder(
661
+ int index) {
662
+ return getMessagesFieldBuilder().addBuilder(
663
+ index, com.google.pubsub.v1.PubsubMessage.getDefaultInstance());
664
+ }
665
+ /**
666
+ * <code>repeated .google.pubsub.v1.PubsubMessage messages = 1;</code>
667
+ */
668
+ public java.util.List<com.google.pubsub.v1.PubsubMessage.Builder>
669
+ getMessagesBuilderList() {
670
+ return getMessagesFieldBuilder().getBuilderList();
671
+ }
672
+ private com.google.protobuf.RepeatedFieldBuilderV3<
673
+ com.google.pubsub.v1.PubsubMessage, com.google.pubsub.v1.PubsubMessage.Builder, com.google.pubsub.v1.PubsubMessageOrBuilder>
674
+ getMessagesFieldBuilder() {
675
+ if (messagesBuilder_ == null) {
676
+ messagesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
677
+ com.google.pubsub.v1.PubsubMessage, com.google.pubsub.v1.PubsubMessage.Builder, com.google.pubsub.v1.PubsubMessageOrBuilder>(
678
+ messages_,
679
+ ((bitField0_ & 0x00000001) == 0x00000001),
680
+ getParentForChildren(),
681
+ isClean());
682
+ messages_ = null;
683
+ }
684
+ return messagesBuilder_;
685
+ }
686
+ public final Builder setUnknownFields(
687
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
688
+ return super.setUnknownFieldsProto3(unknownFields);
689
+ }
690
+
691
+ public final Builder mergeUnknownFields(
692
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
693
+ return super.mergeUnknownFields(unknownFields);
694
+ }
695
+
696
+
697
+ // @@protoc_insertion_point(builder_scope:Checkpoint)
698
+ }
699
+
700
+ // @@protoc_insertion_point(class_scope:Checkpoint)
701
+ private static final com.embulk.input.pubsub.checkpoint.Checkpoint DEFAULT_INSTANCE;
702
+ static {
703
+ DEFAULT_INSTANCE = new com.embulk.input.pubsub.checkpoint.Checkpoint();
704
+ }
705
+
706
+ public static com.embulk.input.pubsub.checkpoint.Checkpoint getDefaultInstance() {
707
+ return DEFAULT_INSTANCE;
708
+ }
709
+
710
+ private static final com.google.protobuf.Parser<Checkpoint>
711
+ PARSER = new com.google.protobuf.AbstractParser<Checkpoint>() {
712
+ public Checkpoint parsePartialFrom(
713
+ com.google.protobuf.CodedInputStream input,
714
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
715
+ throws com.google.protobuf.InvalidProtocolBufferException {
716
+ return new Checkpoint(input, extensionRegistry);
717
+ }
718
+ };
719
+
720
+ public static com.google.protobuf.Parser<Checkpoint> parser() {
721
+ return PARSER;
722
+ }
723
+
724
+ @java.lang.Override
725
+ public com.google.protobuf.Parser<Checkpoint> getParserForType() {
726
+ return PARSER;
727
+ }
728
+
729
+ public com.embulk.input.pubsub.checkpoint.Checkpoint getDefaultInstanceForType() {
730
+ return DEFAULT_INSTANCE;
731
+ }
732
+
733
+ }
734
+