/** * 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 instancePaths instance paths * @throws IOException trouble * @throws SliderException slider-specific exceptions */ public void createClusterDirectories(InstancePaths instancePaths) throws IOException, SliderException { Path instanceDir = instancePaths.instanceDir; verifyDirectoryNonexistent(instanceDir); FsPermission clusterPerms = getInstanceDirectoryPermissions(); createWithPermissions(instanceDir, clusterPerms); createWithPermissions(instancePaths.snapshotConfPath, clusterPerms); createWithPermissions(instancePaths.generatedConfPath, clusterPerms); createWithPermissions(instancePaths.historyPath, clusterPerms); createWithPermissions(instancePaths.tmpPathAM, clusterPerms); // Data Directory String dataOpts = configuration.get(SliderXmlConfKeys.DATA_DIRECTORY_PERMISSIONS, SliderXmlConfKeys.DEFAULT_DATA_DIRECTORY_PERMISSIONS); log.debug("Setting data directory permissions to {}", dataOpts); createWithPermissions(instancePaths.dataPath, new FsPermission(dataOpts)); }
/** * 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 instancePaths instance paths * @throws IOException trouble * @throws SliderException slider-specific exceptions */ public void createClusterDirectories(InstancePaths instancePaths) throws IOException, SliderException { Path instanceDir = instancePaths.instanceDir; verifyDirectoryNonexistent(instanceDir); FsPermission clusterPerms = getInstanceDirectoryPermissions(); createWithPermissions(instanceDir, clusterPerms); createWithPermissions(instancePaths.snapshotConfPath, clusterPerms); createWithPermissions(instancePaths.generatedConfPath, clusterPerms); createWithPermissions(instancePaths.historyPath, clusterPerms); createWithPermissions(instancePaths.tmpPathAM, clusterPerms); // Data Directory String dataOpts = configuration.get(SliderXmlConfKeys.DATA_DIRECTORY_PERMISSIONS, SliderXmlConfKeys.DEFAULT_DATA_DIRECTORY_PERMISSIONS); log.debug("Setting data directory permissions to {}", dataOpts); createWithPermissions(instancePaths.dataPath, new FsPermission(dataOpts)); }