Jeremy Lv created WHIRR-736:
-------------------------------

             Summary: It will be nice to upload a group of local files to the 
remote instance
                 Key: WHIRR-736
                 URL: https://issues.apache.org/jira/browse/WHIRR-736
             Project: Whirr
          Issue Type: Improvement
          Components: core
    Affects Versions: 0.8.2
         Environment: ubuntu, Openstack
            Reporter: Jeremy Lv
             Fix For: 0.9.0


{code:title=ClusterActionHandlerSupport.java|borderStyle=solid}
  public static String prepareRemoteFileUrl(ClusterActionEvent event, String 
rawUrl)
    throws IOException {
    if (rawUrl != null && rawUrl.startsWith("file://")) {
      try {
        URI uri = new URI(rawUrl);
        File localFile = new File(uri);

        BlobCache cache = BlobCache.getInstance(event.getCompute(), 
event.getClusterSpec());
        cache.putIfAbsent(localFile);

        final String basePath = "/tmp/whirr/cache/files/";
        addStatement(event, cache.getAsSaveToStatement(basePath, uri));
        cache.removeContainer();
        return "file://" + basePath + localFile.getName();

      } catch (URISyntaxException e) {
        throw new IOException(e);
      }
    } else if(rawUrl != null && rawUrl.startsWith("remote://")) {
      return rawUrl.replaceFirst("remote://", "file://");
    }
    return rawUrl;
  }
{code} 

As we can see from the above codes, the whirr will only support to upload only 
one file defined as "whirr.zookeeper.tarball.url" to the remote instance, I 
think it will be nice to upload a group of local files to the remote instance 
instead of just upload only one file.

For example: we can define the whirr.zookeeper.tarball.url = "file1, file2, 
file3" which is separated by comma or colon.


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to