/** * 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; }
/** * Persist this * @param appconfdir conf dir * @param overwrite if true, we don't need to create cluster dir * @throws IOException * @throws SliderException * @throws LockAcquireFailedException */ public void persist(Path appconfdir, boolean overwrite) throws IOException, SliderException, LockAcquireFailedException { if (!overwrite) { coreFS.createClusterDirectories(instancePaths); } ConfPersister persister = new ConfPersister(coreFS, getInstanceDir()); ConfDirSnapshotAction action = null; if (appconfdir != null) { action = new ConfDirSnapshotAction(appconfdir); } persister.save(instanceDescription, action); for (Entry<String, Path> appDef : externalAppDefs.entrySet()) { SliderUtils.copy(conf, new Path(appDef.getKey()), appDef.getValue()); } }
/** * Persist this * @param appconfdir conf dir * @param overwrite if true, we don't need to create cluster dir * @throws IOException * @throws SliderException * @throws LockAcquireFailedException */ public void persist(Path appconfdir, boolean overwrite) throws IOException, SliderException, LockAcquireFailedException { if (!overwrite) { coreFS.createClusterDirectories(instancePaths); } ConfPersister persister = new ConfPersister(coreFS, getInstanceDir()); ConfDirSnapshotAction action = null; if (appconfdir != null) { action = new ConfDirSnapshotAction(appconfdir); } persister.save(instanceDescription, action); for (Entry<String, Path> appDef : externalAppDefs.entrySet()) { SliderUtils.copy(conf, new Path(appDef.getKey()), appDef.getValue()); } }