----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/51358/#review147740 -----------------------------------------------------------
src/slave/containerizer/mesos/provisioner/paths.cpp (line 106) <https://reviews.apache.org/r/51358/#comment214966> I think it may be better to make this method just return `Try<string>` rather than `Try<Option<string>>` to simplify the work of the caller. If we return `Try<Option<string>>`, then the caller need to check 1) `result.isError()` and 2) `result.get().isSome()`. But if we just return `Try<string>`, then the caller only needs to check 1). src/slave/containerizer/mesos/provisioner/paths.cpp (line 113) <https://reviews.apache.org/r/51358/#comment214967> Shouldn't we return an `Error` in this case? src/slave/containerizer/mesos/provisioner/paths.cpp (line 127) <https://reviews.apache.org/r/51358/#comment214965> Do we have to call `findContainerDir()` in a recursive way to find out the sub-container directory? I think we can actually figure out this is a top level container or sub-container by checking `containerId.has_parent()`, so if it is a sub-container, we can directly locate its parent container's directory first (`getContainerDir(provisionerDir, containerId.parent())`), and then find out the sub-container directory under it. - Qian Zhang On Aug. 30, 2016, 5:20 a.m., Gilbert Song wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/51358/ > ----------------------------------------------------------- > > (Updated Aug. 30, 2016, 5:20 a.m.) > > > Review request for mesos, Benjamin Hindman, Artem Harutyunyan, Jie Yu, Joseph > Wu, and Kevin Klues. > > > Bugs: MESOS-6067 > https://issues.apache.org/jira/browse/MESOS-6067 > > > Repository: mesos > > > Description > ------- > > Implemented recursive helper method findContainerDir for provisioner. > > > Diffs > ----- > > src/slave/containerizer/mesos/provisioner/paths.hpp > 9829d6b52c8547ae22297a5bc47852ce5a219e4c > src/slave/containerizer/mesos/provisioner/paths.cpp > 86a45f30c22dc1e41f4779c0ce8c11d02dcc46bb > > Diff: https://reviews.apache.org/r/51358/diff/ > > > Testing > ------- > > make check > > > Thanks, > > Gilbert Song > >