You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by ti...@apache.org on 2020/08/19 17:05:20 UTC
[incubator-pinot] branch release-0.5.0-rc updated: Fix gcsFS
copyToLocal to precreate local destination directory (#5890)
This is an automated email from the ASF dual-hosted git repository.
tingchen pushed a commit to branch release-0.5.0-rc
in repository https://gitbox.apache.org/repos/asf/incubator-pinot.git
The following commit(s) were added to refs/heads/release-0.5.0-rc by this push:
new 94b36b6 Fix gcsFS copyToLocal to precreate local destination directory (#5890)
94b36b6 is described below
commit 94b36b6aa2028491121122b2b99e919fb6acaed9
Author: Laxman Ch <60...@users.noreply.github.com>
AuthorDate: Wed Aug 19 01:31:34 2020 +0530
Fix gcsFS copyToLocal to precreate local destination directory (#5890)
---
.../src/main/java/org/apache/pinot/plugin/filesystem/GcsPinotFS.java | 2 ++
1 file changed, 2 insertions(+)
diff --git a/pinot-plugins/pinot-file-system/pinot-gcs/src/main/java/org/apache/pinot/plugin/filesystem/GcsPinotFS.java b/pinot-plugins/pinot-file-system/pinot-gcs/src/main/java/org/apache/pinot/plugin/filesystem/GcsPinotFS.java
index 265ac90..b36c1f4 100644
--- a/pinot-plugins/pinot-file-system/pinot-gcs/src/main/java/org/apache/pinot/plugin/filesystem/GcsPinotFS.java
+++ b/pinot-plugins/pinot-file-system/pinot-gcs/src/main/java/org/apache/pinot/plugin/filesystem/GcsPinotFS.java
@@ -36,6 +36,7 @@ import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
+import org.apache.commons.io.FileUtils;
import org.apache.pinot.spi.env.PinotConfiguration;
import org.apache.pinot.spi.filesystem.PinotFS;
import org.slf4j.Logger;
@@ -325,6 +326,7 @@ public class GcsPinotFS extends PinotFS {
@Override
public void copyToLocalFile(URI srcUri, File dstFile) throws Exception {
LOGGER.info("Copy {} to local {}", srcUri, dstFile.getAbsolutePath());
+ FileUtils.forceMkdir(dstFile.getParentFile());
Blob blob = getBlob(srcUri);
checkState(existsBlob(blob), "File '%s' does not exists", srcUri);
blob.downloadTo(dstFile.toPath());
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org