/** * Build up the path string for app def folder -no attempt to * create the directory is made * * @param clustername name of the cluster * @return the path for persistent data */ public Path buildAppDefDirPath(String clustername) { Path path = buildClusterDirPath(clustername); return new Path(path, SliderKeys.APP_DEF_DIR); }
/** * Get the temp path for this cluster * @param clustername name of the cluster * @return path for temp files (is not purged) */ public Path getTempPathForCluster(String clustername) { Path clusterDir = buildClusterDirPath(clustername); return new Path(clusterDir, SliderKeys.TMP_DIR_PREFIX); }
/** * Build up the path string for app def folder -no attempt to * create the directory is made * * @param clustername name of the cluster * @return the path for persistent data */ public Path buildAppDefDirPath(String clustername) { Path path = buildClusterDirPath(clustername); return new Path(path, SliderKeys.APP_DEF_DIR); }
/** * Get the temp path for this cluster * @param clustername name of the cluster * @return path for temp files (is not purged) */ public Path getTempPathForCluster(String clustername) { Path clusterDir = buildClusterDirPath(clustername); return new Path(clusterDir, SliderKeys.TMP_DIR_PREFIX); }
/** * Build up the path string for cluster resource install location -no * attempt to create the directory is made * * @return the path for resource */ public Path buildClusterResourcePath(String clusterName) { Preconditions.checkNotNull(clusterName); Path path = buildClusterDirPath(clusterName); return new Path(path, SliderKeys.RESOURCE_DIR); }
/** * Build up the path string for addon folder -no attempt to * create the directory is made * * @param clustername name of the cluster * @return the path for persistent data */ public Path buildAddonDirPath(String clustername, String addonId) { Preconditions.checkNotNull(addonId); Path path = buildClusterDirPath(clustername); return new Path(path, SliderKeys.ADDONS_DIR + "/" + addonId); }
/** * Build up the path string for package install location -no attempt to * create the directory is made * * @return the path for persistent app package */ public Path buildClusterSecurityDirPath(String clusterName) { Preconditions.checkNotNull(clusterName); Path path = buildClusterDirPath(clusterName); return new Path(path, SliderKeys.SECURITY_DIR); }
/** * Build up the path string for addon folder -no attempt to * create the directory is made * * @param clustername name of the cluster * @return the path for persistent data */ public Path buildAddonDirPath(String clustername, String addonId) { Preconditions.checkNotNull(addonId); Path path = buildClusterDirPath(clustername); return new Path(path, SliderKeys.ADDONS_DIR + "/" + addonId); }
/** * Build up the path string for cluster resource install location -no * attempt to create the directory is made * * @return the path for resource */ public Path buildClusterResourcePath(String clusterName, String component) { Preconditions.checkNotNull(clusterName); Path path = buildClusterDirPath(clusterName); return new Path(path, SliderKeys.RESOURCE_DIR + "/" + component); }
/** * Build up the path string for package install location -no attempt to * create the directory is made * * @return the path for persistent app package */ public Path buildClusterSecurityDirPath(String clusterName) { Preconditions.checkNotNull(clusterName); Path path = buildClusterDirPath(clusterName); return new Path(path, SliderKeys.SECURITY_DIR); }
/** * Build up the path string for cluster resource install location -no * attempt to create the directory is made * * @return the path for resource */ public Path buildClusterResourcePath(String clusterName, String component) { Preconditions.checkNotNull(clusterName); Path path = buildClusterDirPath(clusterName); return new Path(path, SliderKeys.RESOURCE_DIR + "/" + component); }
/** * Build up the path string for cluster resource install location -no * attempt to create the directory is made * * @return the path for resource */ public Path buildClusterResourcePath(String clusterName) { Preconditions.checkNotNull(clusterName); Path path = buildClusterDirPath(clusterName); return new Path(path, SliderKeys.RESOURCE_DIR); }
public InstanceBuilder(CoreFileSystem coreFileSystem, Configuration conf, String clustername) { this.clustername = clustername; this.conf = conf; this.coreFS = coreFileSystem; Path instanceDir = coreFileSystem.buildClusterDirPath(clustername); instancePaths = new InstancePaths(instanceDir); }
public InstanceBuilder(CoreFileSystem coreFileSystem, Configuration conf, String clustername) { this.clustername = clustername; this.conf = conf; this.coreFS = coreFileSystem; Path instanceDir = coreFileSystem.buildClusterDirPath(clustername); instancePaths = new InstancePaths(instanceDir); }
/** * Locate an application conf json in the FS. This includes a check to verify * that the file is there. * * @param clustername name of the cluster * @return the path to the spec. * @throws IOException IO problems * @throws SliderException if the path isn't there */ public Path locateInstanceDefinition(String clustername) throws IOException, SliderException { Path clusterDirectory = buildClusterDirPath(clustername); Path appConfPath = new Path(clusterDirectory, Filenames.APPCONF); verifyClusterSpecExists(clustername, appConfPath); return appConfPath; }
/** * Build up the path string for keytab install location -no attempt to * create the directory is made * * @return the path for keytab installation location */ public Path buildKeytabPath(String keytabDir, String keytabName, String clusterName) { Path homePath = getHomeDirectory(); Path baseKeytabDir; if (keytabDir != null) { baseKeytabDir = new Path(homePath, keytabDir); } else { baseKeytabDir = new Path(buildClusterDirPath(clusterName), SliderKeys.KEYTAB_DIR); } return keytabName == null ? baseKeytabDir : new Path(baseKeytabDir, keytabName); }
/** * Locate an application conf json in the FS. This includes a check to verify * that the file is there. * * @param clustername name of the cluster * @return the path to the spec. * @throws IOException IO problems * @throws SliderException if the path isn't there */ public Path locateInstanceDefinition(String clustername) throws IOException, SliderException { Path clusterDirectory = buildClusterDirPath(clustername); Path appConfPath = new Path(clusterDirectory, Filenames.APPCONF); verifyClusterSpecExists(clustername, appConfPath); return appConfPath; }
/** * Build up the path string for keytab install location -no attempt to * create the directory is made * * @return the path for keytab installation location */ public Path buildKeytabPath(String keytabDir, String keytabName, String clusterName) { Path homePath = getHomeDirectory(); Path baseKeytabDir; if (keytabDir != null) { baseKeytabDir = new Path(homePath, keytabDir); } else { baseKeytabDir = new Path(buildClusterDirPath(clusterName), SliderKeys.KEYTAB_DIR); } return keytabName == null ? baseKeytabDir : new Path(baseKeytabDir, keytabName); }
/** * Create the Slider cluster path for a named cluster and all its subdirs * This is a directory; a mkdirs() operation is executed * to ensure that it is there. * * @param clustername name of the cluster * @return the path to the cluster directory * @throws java.io.IOException trouble * @throws SliderException slider-specific exceptions */ public Path createClusterDirectories(String clustername, Configuration conf) throws IOException, SliderException { Path clusterDirectory = buildClusterDirPath(clustername); InstancePaths instancePaths = new InstancePaths(clusterDirectory); createClusterDirectories(instancePaths); return clusterDirectory; }
/** * Create the Slider cluster path for a named cluster and all its subdirs * This is a directory; a mkdirs() operation is executed * to ensure that it is there. * * @param clustername name of the cluster * @return the path to the cluster directory * @throws java.io.IOException trouble * @throws SliderException slider-specific exceptions */ public Path createClusterDirectories(String clustername, Configuration conf) throws IOException, SliderException { Path clusterDirectory = buildClusterDirPath(clustername); InstancePaths instancePaths = new InstancePaths(clusterDirectory); createClusterDirectories(instancePaths); return clusterDirectory; }