Example usage for org.apache.hadoop.fs Path SEPARATOR

List of usage examples for org.apache.hadoop.fs Path SEPARATOR

Introduction

In this page you can find the example usage for org.apache.hadoop.fs Path SEPARATOR.

Prototype

String SEPARATOR

To view the source code for org.apache.hadoop.fs Path SEPARATOR.

Click Source Link

Document

The directory separator, a slash.

Usage

From source file:org.apache.tez.common.TestTezCommonUtils.java

License:Apache License

@Test(timeout = 5000)
public void testTezRecoveryStagingPath() throws Exception {
    String strAppId = "testAppId";
    Path stageDir = TezCommonUtils.getTezSystemStagingPath(conf, strAppId);
    Path confStageDir = TezCommonUtils.getRecoveryPath(stageDir, conf);
    String expectedDir = RESOLVED_STAGE_DIR + Path.SEPARATOR + TezCommonUtils.TEZ_SYSTEM_SUB_DIR
            + Path.SEPARATOR + strAppId + Path.SEPARATOR + TezConstants.DAG_RECOVERY_DATA_DIR_NAME;
    Assert.assertEquals(confStageDir.toString(), expectedDir);
}

From source file:org.apache.tez.common.TestTezCommonUtils.java

License:Apache License

@Test(timeout = 5000)
public void testTezAttemptRecoveryStagingPath() throws Exception {
    String strAppId = "testAppId";
    Path stageDir = TezCommonUtils.getTezSystemStagingPath(conf, strAppId);
    Path recoveryPath = TezCommonUtils.getRecoveryPath(stageDir, conf);
    Path recoveryStageDir = TezCommonUtils.getAttemptRecoveryPath(recoveryPath, 2);

    String expectedDir = RESOLVED_STAGE_DIR + Path.SEPARATOR + TezCommonUtils.TEZ_SYSTEM_SUB_DIR
            + Path.SEPARATOR + strAppId + Path.SEPARATOR + TezConstants.DAG_RECOVERY_DATA_DIR_NAME
            + Path.SEPARATOR + "2";
    Assert.assertEquals(recoveryStageDir.toString(), expectedDir);
}

From source file:org.apache.tez.common.TestTezCommonUtils.java

License:Apache License

@Test(timeout = 5000)
public void testTezDAGRecoveryStagingPath() throws Exception {
    String strAppId = "testAppId";
    Path stageDir = TezCommonUtils.getTezSystemStagingPath(conf, strAppId);
    Path recoveryPath = TezCommonUtils.getRecoveryPath(stageDir, conf);
    Path recoveryStageDir = TezCommonUtils.getAttemptRecoveryPath(recoveryPath, 2);

    Path dagRecoveryPathj = TezCommonUtils.getDAGRecoveryPath(recoveryStageDir, "dag_123");

    String expectedDir = RESOLVED_STAGE_DIR + Path.SEPARATOR + TezCommonUtils.TEZ_SYSTEM_SUB_DIR
            + Path.SEPARATOR + strAppId + Path.SEPARATOR + TezConstants.DAG_RECOVERY_DATA_DIR_NAME
            + Path.SEPARATOR + "2" + Path.SEPARATOR + "dag_123" + TezConstants.DAG_RECOVERY_RECOVER_FILE_SUFFIX;
    Assert.assertEquals(expectedDir, dagRecoveryPathj.toString());
}

From source file:org.apache.tez.common.TestTezCommonUtils.java

License:Apache License

@Test(timeout = 5000)
public void testTezSummaryRecoveryStagingPath() throws Exception {
    String strAppId = "testAppId";
    Path stageDir = TezCommonUtils.getTezSystemStagingPath(conf, strAppId);
    Path recoveryPath = TezCommonUtils.getRecoveryPath(stageDir, conf);
    Path recoveryStageDir = TezCommonUtils.getAttemptRecoveryPath(recoveryPath, 2);
    Path summaryRecoveryPathj = TezCommonUtils.getSummaryRecoveryPath(recoveryStageDir);

    String expectedDir = RESOLVED_STAGE_DIR + Path.SEPARATOR + TezCommonUtils.TEZ_SYSTEM_SUB_DIR
            + Path.SEPARATOR + strAppId + Path.SEPARATOR + TezConstants.DAG_RECOVERY_DATA_DIR_NAME
            + Path.SEPARATOR + "2" + Path.SEPARATOR + TezConstants.DAG_RECOVERY_SUMMARY_FILE_SUFFIX;
    Assert.assertEquals(expectedDir, summaryRecoveryPathj.toString());
}

From source file:org.apache.tez.dag.utils.DAGApps.java

License:Apache License

public static Path getStagingAreaDir(TezConfiguration conf, String user) {
    return new Path(conf.get(TezConfiguration.TEZ_AM_STAGING_DIR, TezConfiguration.TEZ_AM_STAGING_DIR_DEFAULT)
            + Path.SEPARATOR + user + Path.SEPARATOR + STAGING_CONSTANT);
}

From source file:org.apache.tez.dag.utils.TezEngineChildJVM.java

License:Apache License

private static String getTaskLogFile(LogName filter) {
    return ApplicationConstants.LOG_DIR_EXPANSION_VAR + Path.SEPARATOR + filter.toString();
}

From source file:org.apache.tez.engine.common.task.local.output.TezLocalTaskOutputFiles.java

License:Apache License

/**
 * Return the path to local map output file created earlier
 *
 * @return path//from w  w w .j a va2  s  .c  om
 * @throws IOException
 */
@Override
public Path getOutputFile() throws IOException {
    return lDirAlloc.getLocalPathToRead(
            Constants.TASK_OUTPUT_DIR + Path.SEPARATOR + Constants.TEZ_ENGINE_TASK_OUTPUT_FILENAME_STRING,
            getConf());
}

From source file:org.apache.tez.engine.common.task.local.output.TezLocalTaskOutputFiles.java

License:Apache License

/**
 * Create a local map output file name./*from w w  w .  j a va 2s .  c  o m*/
 *
 * @param size the size of the file
 * @return path
 * @throws IOException
 */
@Override
public Path getOutputFileForWrite(long size) throws IOException {
    return lDirAlloc.getLocalPathForWrite(
            Constants.TASK_OUTPUT_DIR + Path.SEPARATOR + Constants.TEZ_ENGINE_TASK_OUTPUT_FILENAME_STRING, size,
            getConf());
}

From source file:org.apache.tez.engine.common.task.local.output.TezLocalTaskOutputFiles.java

License:Apache License

/**
 * Return the path to a local map output index file created earlier
 *
 * @return path//from w  ww. j  a v  a  2  s  .c  o  m
 * @throws IOException
 */
@Override
public Path getOutputIndexFile() throws IOException {
    return lDirAlloc.getLocalPathToRead(
            Constants.TASK_OUTPUT_DIR + Path.SEPARATOR + Constants.TEZ_ENGINE_TASK_OUTPUT_FILENAME_STRING
                    + Constants.TEZ_ENGINE_TASK_OUTPUT_INDEX_SUFFIX_STRING,
            getConf());
}

From source file:org.apache.tez.engine.common.task.local.output.TezLocalTaskOutputFiles.java

License:Apache License

/**
 * Create a local map output index file name.
 *
 * @param size the size of the file//from   ww  w .  jav  a  2s .  c  om
 * @return path
 * @throws IOException
 */
@Override
public Path getOutputIndexFileForWrite(long size) throws IOException {
    return lDirAlloc.getLocalPathForWrite(
            Constants.TASK_OUTPUT_DIR + Path.SEPARATOR + Constants.TEZ_ENGINE_TASK_OUTPUT_FILENAME_STRING
                    + Constants.TEZ_ENGINE_TASK_OUTPUT_INDEX_SUFFIX_STRING,
            size, getConf());
}