diff options
Diffstat (limited to 'node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/nodeagent/NodeAgentContext.java')
-rw-r--r-- | node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/nodeagent/NodeAgentContext.java | 39 |
1 files changed, 4 insertions, 35 deletions
diff --git a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/nodeagent/NodeAgentContext.java b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/nodeagent/NodeAgentContext.java index c585bd14e94..8cf8553bc34 100644 --- a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/nodeagent/NodeAgentContext.java +++ b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/nodeagent/NodeAgentContext.java @@ -11,8 +11,8 @@ import com.yahoo.vespa.hosted.node.admin.component.TaskContext; import com.yahoo.vespa.hosted.node.admin.configserver.noderepository.Acl; import com.yahoo.vespa.hosted.node.admin.configserver.noderepository.NodeSpec; import com.yahoo.vespa.hosted.node.admin.container.ContainerNetworkMode; +import com.yahoo.vespa.hosted.node.admin.task.util.fs.ContainerPath; -import java.nio.file.FileSystem; import java.nio.file.Path; import java.util.Optional; @@ -58,42 +58,11 @@ public interface NodeAgentContext extends TaskContext { */ double vcpuOnThisHost(); - /** The file system used by the NodeAgentContext. All paths must have the same provider. */ - FileSystem fileSystem(); + ContainerPath containerPath(String pathInNode); - /** - * This method is the inverse of {@link #pathInNodeFromPathOnHost(Path)}} - * - * @param pathInNode absolute path in the container - * @return the absolute path on host pointing at the same inode - */ - Path pathOnHostFromPathInNode(Path pathInNode); - - default Path pathOnHostFromPathInNode(String pathInNode) { - return pathOnHostFromPathInNode(fileSystem().getPath(pathInNode)); - } + ContainerPath containerPathUnderVespaHome(String relativePath); - /** - * This method is the inverse of {@link #pathOnHostFromPathInNode(Path)} - * - * @param pathOnHost absolute path on host - * @return the absolute path in the container pointing at the same inode - */ - Path pathInNodeFromPathOnHost(Path pathOnHost); - - default Path pathInNodeFromPathOnHost(String pathOnHost) { - return pathInNodeFromPathOnHost(fileSystem().getPath(pathOnHost)); - } - - /** - * @param relativePath relative path under Vespa home in container - * @return the absolute path under Vespa home in the container - */ - Path pathInNodeUnderVespaHome(Path relativePath); - - default Path pathInNodeUnderVespaHome(String relativePath) { - return pathInNodeUnderVespaHome(fileSystem().getPath(relativePath)); - } + ContainerPath containerPathFromPathOnHost(Path pathOnHost); Optional<ApplicationId> hostExclusiveTo(); } |