You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by ji...@apache.org on 2016/03/03 03:06:22 UTC
[2/3] mesos git commit: Added support for file URI in Appc fetcher.
Added support for file URI in Appc fetcher.
Review: https://reviews.apache.org/r/44298/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/6903c6ee
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/6903c6ee
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/6903c6ee
Branch: refs/heads/master
Commit: 6903c6eeb8ffcbd1b40115d3f6f09198426f0adb
Parents: fc113e6
Author: Jojy Varghese <jo...@mesosphere.io>
Authored: Wed Mar 2 18:04:04 2016 -0800
Committer: Jie Yu <yu...@gmail.com>
Committed: Wed Mar 2 18:04:04 2016 -0800
----------------------------------------------------------------------
.../containerizer/mesos/provisioner/appc/fetcher.cpp | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/6903c6ee/src/slave/containerizer/mesos/provisioner/appc/fetcher.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/provisioner/appc/fetcher.cpp b/src/slave/containerizer/mesos/provisioner/appc/fetcher.cpp
index e12a6f2..b29fc79 100644
--- a/src/slave/containerizer/mesos/provisioner/appc/fetcher.cpp
+++ b/src/slave/containerizer/mesos/provisioner/appc/fetcher.cpp
@@ -22,6 +22,7 @@
#include "slave/containerizer/mesos/provisioner/appc/fetcher.hpp"
#include "slave/containerizer/mesos/provisioner/appc/paths.hpp"
+#include "uri/schemes/file.hpp"
#include "uri/schemes/http.hpp"
namespace http = process::http;
@@ -84,6 +85,13 @@ static Try<URI> getUri(const string& prefix, const string& path)
const string rawUrl = prefix + path;
// TODO(jojy): Add parse URI function in URI namespace.
+
+ // TODO(jojy): Add `Path::seperator` which abstracts the file
+ // separator character.
+ if (strings::startsWith(rawUrl, "/")) {
+ return uri::file(rawUrl);
+ }
+
Try<http::URL> _url = http::URL::parse(rawUrl);
if (_url.isError()) {
return Error(
@@ -132,7 +140,8 @@ Try<Owned<Fetcher>> Fetcher::create(
// TODO(jojy): Add support for hdfs.
if (!strings::startsWith(prefix, "http") &&
- !strings::startsWith(prefix, "https")) {
+ !strings::startsWith(prefix, "https") &&
+ !strings::startsWith(prefix, "/")) {
return Error("Invalid simple discovery uri prefix: " + prefix);
}