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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cassandra-plugins/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>io.cdap.plugin</groupId>
<artifactId>hydrator-plugins</artifactId>
<version>2.11.5</version>
<version>2.11.6-SNAPSHOT</version>
</parent>

<name>Cassandra Plugins</name>
Expand Down
7 changes: 6 additions & 1 deletion core-plugins/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<artifactId>hydrator-plugins</artifactId>
<groupId>io.cdap.plugin</groupId>
<version>2.11.5</version>
<version>2.11.6-SNAPSHOT</version>
</parent>

<name>Hydrator Core Plugins</name>
Expand Down Expand Up @@ -299,6 +299,11 @@
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
</dependency>
<dependency>
<groupId>com.google.api-client</groupId>
<artifactId>google-api-client</artifactId>
<version>1.32.1</version>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package io.cdap.plugin.batch.action;

import com.google.api.client.googleapis.json.GoogleJsonResponseException;
import com.google.common.annotations.VisibleForTesting;
import io.cdap.cdap.api.annotation.Description;
import io.cdap.cdap.api.annotation.Macro;
Expand Down Expand Up @@ -70,7 +71,23 @@ public void run(ActionContext context) throws Exception {
Path dest = new Path(config.destPath);

FileSystem fileSystem = source.getFileSystem(new Configuration());
fileSystem.mkdirs(dest.getParent());
try {
fileSystem.mkdirs(dest.getParent());
LOG.debug("mkdirs(): ensured destination parent directory exists: {}", dest.getParent());
} catch (IOException exception) {
if (exception instanceof GoogleJsonResponseException) {
GoogleJsonResponseException googleJsonResponseException = (GoogleJsonResponseException) exception;
if (googleJsonResponseException.getStatusCode() == 412 || (googleJsonResponseException.getStatusMessage()
!= null && googleJsonResponseException.getStatusMessage().contains("412 Precondition Failed"))) {
// Expected GCS directory marker race condition — safe to ignore
LOG.info("Directory already exists in GCS, skipping creation: {}", dest.getParent());
return;
}
throw googleJsonResponseException;
} else {
throw exception;
}
}

if (fileSystem.getFileStatus(source).isFile()) { //moving single file

Expand Down Expand Up @@ -119,7 +136,23 @@ public boolean accept(Path path) {
throw new IllegalArgumentException(String.format("destPath %s needs to be a directory since sourcePath is a " +
"directory", config.destPath));
}
fileSystem.mkdirs(dest); //create destination directory if necessary
try {
fileSystem.mkdirs(dest); //create destination directory if necessary
LOG.debug("mkdirs(): ensured destination parent directory exists: {}", dest);
} catch (IOException ex) {
if (ex instanceof GoogleJsonResponseException) {
GoogleJsonResponseException googleJsonResponseException = (GoogleJsonResponseException) ex;
if (googleJsonResponseException.getStatusCode() == 412 || (googleJsonResponseException.getStatusMessage()
!= null && googleJsonResponseException.getStatusMessage().contains("412 Precondition Failed"))) {
// Expected GCS directory marker race condition — safe to ignore
LOG.info("Directory already exists in GCS, skipping creation: {}", dest);
return;
}
throw googleJsonResponseException;
} else {
throw ex;
}
}

for (FileStatus file : listFiles) {
source = file.getPath();
Expand Down
2 changes: 1 addition & 1 deletion database-plugins/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<artifactId>hydrator-plugins</artifactId>
<groupId>io.cdap.plugin</groupId>
<version>2.11.5</version>
<version>2.11.6-SNAPSHOT</version>
</parent>

<name>Database Plugins</name>
Expand Down
2 changes: 1 addition & 1 deletion format-avro/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<artifactId>hydrator-plugins</artifactId>
<groupId>io.cdap.plugin</groupId>
<version>2.11.5</version>
<version>2.11.6-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion format-blob/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<artifactId>hydrator-plugins</artifactId>
<groupId>io.cdap.plugin</groupId>
<version>2.11.5</version>
<version>2.11.6-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion format-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<artifactId>hydrator-plugins</artifactId>
<groupId>io.cdap.plugin</groupId>
<version>2.11.5</version>
<version>2.11.6-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion format-delimited/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<artifactId>hydrator-plugins</artifactId>
<groupId>io.cdap.plugin</groupId>
<version>2.11.5</version>
<version>2.11.6-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion format-json/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<artifactId>hydrator-plugins</artifactId>
<groupId>io.cdap.plugin</groupId>
<version>2.11.5</version>
<version>2.11.6-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion format-orc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<artifactId>hydrator-plugins</artifactId>
<groupId>io.cdap.plugin</groupId>
<version>2.11.5</version>
<version>2.11.6-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion format-parquet/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<artifactId>hydrator-plugins</artifactId>
<groupId>io.cdap.plugin</groupId>
<version>2.11.5</version>
<version>2.11.6-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion format-text/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<artifactId>hydrator-plugins</artifactId>
<groupId>io.cdap.plugin</groupId>
<version>2.11.5</version>
<version>2.11.6-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion hbase-plugins/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<artifactId>hydrator-plugins</artifactId>
<groupId>io.cdap.plugin</groupId>
<version>2.11.5</version>
<version>2.11.6-SNAPSHOT</version>
</parent>

<name>HBase Plugins</name>
Expand Down
2 changes: 1 addition & 1 deletion http-plugins/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<artifactId>hydrator-plugins</artifactId>
<groupId>io.cdap.plugin</groupId>
<version>2.11.5</version>
<version>2.11.6-SNAPSHOT</version>
</parent>

<name>HTTP Plugins</name>
Expand Down
2 changes: 1 addition & 1 deletion hydrator-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<artifactId>hydrator-plugins</artifactId>
<groupId>io.cdap.plugin</groupId>
<version>2.11.5</version>
<version>2.11.6-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion mongodb-plugins/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<artifactId>hydrator-plugins</artifactId>
<groupId>io.cdap.plugin</groupId>
<version>2.11.5</version>
<version>2.11.6-SNAPSHOT</version>
</parent>

<name>MongoDB Plugins</name>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

<groupId>io.cdap.plugin</groupId>
<artifactId>hydrator-plugins</artifactId>
<version>2.11.5</version>
<version>2.11.6-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Hydrator Plugin Collection</name>
<description>A collection of plugins for CDAP</description>
Expand Down
2 changes: 1 addition & 1 deletion solrsearch-plugins/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<artifactId>hydrator-plugins</artifactId>
<groupId>io.cdap.plugin</groupId>
<version>2.11.5</version>
<version>2.11.6-SNAPSHOT</version>
</parent>

<name>Solr Search Plugins</name>
Expand Down
2 changes: 1 addition & 1 deletion spark-plugins/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<artifactId>hydrator-plugins</artifactId>
<groupId>io.cdap.plugin</groupId>
<version>2.11.5</version>
<version>2.11.6-SNAPSHOT</version>
</parent>

<name>Spark Hydrator Plugins</name>
Expand Down
2 changes: 1 addition & 1 deletion transform-plugins/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>io.cdap.plugin</groupId>
<artifactId>hydrator-plugins</artifactId>
<version>2.11.5</version>
<version>2.11.6-SNAPSHOT</version>
</parent>

<name>Transform Plugins</name>
Expand Down
Loading