You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by je...@apache.org on 2018/11/27 21:40:51 UTC

[incubator-pinot] branch master updated: Cleaning data dir so URI construction works as expected (#3549)

This is an automated email from the ASF dual-hosted git repository.

jenniferdai pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-pinot.git


The following commit(s) were added to refs/heads/master by this push:
     new 7d4ab9e  Cleaning data dir so URI construction works as expected (#3549)
7d4ab9e is described below

commit 7d4ab9e8fcf137c1e234645a874fd45cfb15b4fa
Author: Jennifer Dai <je...@users.noreply.github.com>
AuthorDate: Tue Nov 27 13:40:47 2018 -0800

    Cleaning data dir so URI construction works as expected (#3549)
    
    * Currently, in retention manager (and I am sure other places in the future), we have switched to deep storage. As a result, we have to construct URIs out of path strings, and we do not expect for these paths to already end with slashes. So that users can still declare whatever data directory they desire, we will clean this data directory before using it.
---
 .../linkedin/pinot/controller/api/resources/FileUploadPathProvider.java | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/pinot-controller/src/main/java/com/linkedin/pinot/controller/api/resources/FileUploadPathProvider.java b/pinot-controller/src/main/java/com/linkedin/pinot/controller/api/resources/FileUploadPathProvider.java
index c761b65..7da98cd 100644
--- a/pinot-controller/src/main/java/com/linkedin/pinot/controller/api/resources/FileUploadPathProvider.java
+++ b/pinot-controller/src/main/java/com/linkedin/pinot/controller/api/resources/FileUploadPathProvider.java
@@ -23,6 +23,7 @@ import com.linkedin.pinot.filesystem.PinotFSFactory;
 import java.io.File;
 import java.io.IOException;
 import java.net.URI;
+import org.apache.commons.lang.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -47,6 +48,7 @@ public class FileUploadPathProvider {
 
   public FileUploadPathProvider(ControllerConf controllerConf) throws InvalidControllerConfigException {
     String dataDir = controllerConf.getDataDir();
+    StringUtils.stripEnd(dataDir, "/");
     try {
       // URIs that are allowed to be remote
       _baseDataDirURI = ControllerConf.getUriFromPath(dataDir);


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org