File tree Expand file tree Collapse file tree 2 files changed +36
-5
lines changed
src/main/java/io/cdap/plugin/gcp Expand file tree Collapse file tree 2 files changed +36
-5
lines changed Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright © 2024 Cask Data, Inc.
3+ *
4+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5+ * use this file except in compliance with the License. You may obtain a copy of
6+ * the License at
7+ *
8+ * http://www.apache.org/licenses/LICENSE-2.0
9+ *
10+ * Unless required by applicable law or agreed to in writing, software
11+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13+ * License for the specific language governing permissions and limitations under
14+ * the License.
15+ *
16+ */
17+
18+ package io .cdap .plugin .gcp .common ;
19+
20+ import io .cdap .plugin .format .input .AbstractEmptyInputFormat ;
21+
22+
23+ /**
24+ * An InputFormat that returns no data.
25+ * @param <K> the type of key
26+ * @param <V> the type of value
27+ */
28+ public class GCSEmptyInputFormat <K , V > extends AbstractEmptyInputFormat <K , V > {
29+ // no-op
30+ }
Original file line number Diff line number Diff line change 4343import io .cdap .plugin .format .plugin .FileSourceProperties ;
4444import io .cdap .plugin .gcp .common .GCPConnectorConfig ;
4545import io .cdap .plugin .gcp .common .GCPUtils ;
46+ import io .cdap .plugin .gcp .common .GCSEmptyInputFormat ;
4647import io .cdap .plugin .gcp .crypto .EncryptedFileSystem ;
4748import io .cdap .plugin .gcp .gcs .GCSPath ;
4849import io .cdap .plugin .gcp .gcs .connector .GCSConnector ;
@@ -77,6 +78,11 @@ public void configurePipeline(PipelineConfigurer pipelineConfigurer) {
7778 super .configurePipeline (pipelineConfigurer );
7879 }
7980
81+ @ Override
82+ protected String getEmptyInputFormatClassName () {
83+ return GCSEmptyInputFormat .class .getName ();
84+ }
85+
8086 @ Override
8187 public void prepareRun (BatchSourceContext context ) throws Exception {
8288 // Get location of the source for lineage
@@ -268,11 +274,6 @@ public Long getMinSplitSize() {
268274 return minSplitSize ;
269275 }
270276
271- @ Override
272- public boolean shouldAllowEmptyInput () {
273- return false ;
274- }
275-
276277 public boolean isCopyHeader () {
277278 return shouldCopyHeader ();
278279 }
You can’t perform that action at this time.
0 commit comments