Search in sources :

Example 1 with NMLeveldbStateStoreService

use of org.apache.hadoop.yarn.server.nodemanager.recovery.NMLeveldbStateStoreService in project hadoop by apache.

the class NodeManager method initAndStartRecoveryStore.

private void initAndStartRecoveryStore(Configuration conf) throws IOException {
    boolean recoveryEnabled = conf.getBoolean(YarnConfiguration.NM_RECOVERY_ENABLED, YarnConfiguration.DEFAULT_NM_RECOVERY_ENABLED);
    if (recoveryEnabled) {
        FileSystem recoveryFs = FileSystem.getLocal(conf);
        String recoveryDirName = conf.get(YarnConfiguration.NM_RECOVERY_DIR);
        if (recoveryDirName == null) {
            throw new IllegalArgumentException("Recovery is enabled but " + YarnConfiguration.NM_RECOVERY_DIR + " is not set.");
        }
        Path recoveryRoot = new Path(recoveryDirName);
        recoveryFs.mkdirs(recoveryRoot, new FsPermission((short) 0700));
        nmStore = new NMLeveldbStateStoreService();
    } else {
        nmStore = new NMNullStateStoreService();
    }
    nmStore.init(conf);
    nmStore.start();
}
Also used : Path(org.apache.hadoop.fs.Path) FileSystem(org.apache.hadoop.fs.FileSystem) FsPermission(org.apache.hadoop.fs.permission.FsPermission) NMLeveldbStateStoreService(org.apache.hadoop.yarn.server.nodemanager.recovery.NMLeveldbStateStoreService) NMNullStateStoreService(org.apache.hadoop.yarn.server.nodemanager.recovery.NMNullStateStoreService)

Aggregations

FileSystem (org.apache.hadoop.fs.FileSystem)1 Path (org.apache.hadoop.fs.Path)1 FsPermission (org.apache.hadoop.fs.permission.FsPermission)1 NMLeveldbStateStoreService (org.apache.hadoop.yarn.server.nodemanager.recovery.NMLeveldbStateStoreService)1 NMNullStateStoreService (org.apache.hadoop.yarn.server.nodemanager.recovery.NMNullStateStoreService)1