Package org.apache.hadoop.fs

Examples of org.apache.hadoop.fs.FileSystem.makeQualified()


        FileSystem fs = path.getFileSystem(config);
        Path output = path.getParent();
        Path target;
        if (output == null) {
            LOG.warn("エクスポート先のディレクトリはベースディレクトリなので削除されません: {}", path);
            target = fs.makeQualified(path);
        } else {
            LOG.warn("エクスポート先をディレクトリごと削除します: {}", output);
            target = fs.makeQualified(output);
        }
        LOG.debug("ファイルを削除します: {}", target);
View Full Code Here


        if (output == null) {
            LOG.warn("エクスポート先のディレクトリはベースディレクトリなので削除されません: {}", path);
            target = fs.makeQualified(path);
        } else {
            LOG.warn("エクスポート先をディレクトリごと削除します: {}", output);
            target = fs.makeQualified(output);
        }
        LOG.debug("ファイルを削除します: {}", target);
        boolean succeed = fs.delete(target, true);
        LOG.debug("ファイルを削除しました (succeed={}): {}", succeed, target);
    }
View Full Code Here

    // Create a number of filenames in the JobTracker's fs namespace
    FileSystem fs = getFs();
    LOG.debug("default FileSystem: " + fs.getUri());
    fs.delete(submitJobDir, true);
    submitJobDir = fs.makeQualified(submitJobDir);
    submitJobDir = new Path(submitJobDir.toUri().getPath());
    FsPermission mapredSysPerms = new FsPermission(JOB_DIR_PERMISSION);
    FileSystem.mkdirs(fs, submitJobDir, mapredSysPerms);
    Path filesDir = new Path(submitJobDir, "files");
    Path archivesDir = new Path(submitJobDir, "archives");
View Full Code Here

      Path path = new Path("/");
      assertTrue("/ should be a directory", fs.getFileStatus(path)
          .isDirectory() == true);
     
      byte[] fileData = AppendTestUtil.randomBytes(seed, size);
      Path file1 = fs.makeQualified(new Path("filelocal.dat"));
      FSDataOutputStream stm = createFile(fs, file1, 1);
      stm.write(fileData);
      stm.close();
     
      URI uri = cluster.getURI();
View Full Code Here

                                              Path matrixOutputPath,
                                              int numInputRows) throws IOException {
    JobConf conf = new JobConf(TransposeJob.class);
    conf.setJobName("TransposeJob: " + matrixInputPath + " transpose -> " + matrixOutputPath);
    FileSystem fs = FileSystem.get(conf);
    matrixInputPath = fs.makeQualified(matrixInputPath);
    matrixOutputPath = fs.makeQualified(matrixOutputPath);
    conf.setInt(NUM_ROWS_KEY, numInputRows);

    FileInputFormat.addInputPath(conf, matrixInputPath);
    conf.setInputFormat(SequenceFileInputFormat.class);
View Full Code Here

                                              int numInputRows) throws IOException {
    JobConf conf = new JobConf(TransposeJob.class);
    conf.setJobName("TransposeJob: " + matrixInputPath + " transpose -> " + matrixOutputPath);
    FileSystem fs = FileSystem.get(conf);
    matrixInputPath = fs.makeQualified(matrixInputPath);
    matrixOutputPath = fs.makeQualified(matrixOutputPath);
    conf.setInt(NUM_ROWS_KEY, numInputRows);

    FileInputFormat.addInputPath(conf, matrixInputPath);
    conf.setInputFormat(SequenceFileInputFormat.class);
    FileOutputFormat.setOutputPath(conf, matrixOutputPath);
View Full Code Here

                                                  Class<? extends TimesSquaredMapper> mapClass,
                                                  Class<? extends VectorSummingReducer> redClass) throws IOException {
    JobConf conf = new JobConf(TimesSquaredJob.class);
    conf.setJobName("TimesSquaredJob: " + matrixInputPath + " timesSquared(" + v.getName() + ')');
    FileSystem fs = FileSystem.get(conf);
    matrixInputPath = fs.makeQualified(matrixInputPath);
    outputVectorPathBase = fs.makeQualified(outputVectorPathBase);

    long now = System.nanoTime();
    Path inputVectorPath = new Path(outputVectorPathBase, INPUT_VECTOR + '/' + now);
    SequenceFile.Writer inputVectorPathWriter = new SequenceFile.Writer(fs,
View Full Code Here

                                                  Class<? extends VectorSummingReducer> redClass) throws IOException {
    JobConf conf = new JobConf(TimesSquaredJob.class);
    conf.setJobName("TimesSquaredJob: " + matrixInputPath + " timesSquared(" + v.getName() + ')');
    FileSystem fs = FileSystem.get(conf);
    matrixInputPath = fs.makeQualified(matrixInputPath);
    outputVectorPathBase = fs.makeQualified(outputVectorPathBase);

    long now = System.nanoTime();
    Path inputVectorPath = new Path(outputVectorPathBase, INPUT_VECTOR + '/' + now);
    SequenceFile.Writer inputVectorPathWriter = new SequenceFile.Writer(fs,
            conf, inputVectorPath, NullWritable.class, VectorWritable.class);
View Full Code Here

  @Override
  public int run(String[] strings) throws Exception {
    Map<String,String> parsedArgs = parseArguments(strings);
    Configuration conf = getConf();
    FileSystem fs = FileSystem.get(conf);
    Path inputPath = fs.makeQualified(new Path(parsedArgs.get("--input")));
    Path outputPath = fs.makeQualified(new Path(parsedArgs.get("--output")));
    Path indexPath = new Path(outputPath, "docIndex");
    Path matrixPath = new Path(outputPath, "matrix");
    SequenceFile.Writer indexWriter = SequenceFile.createWriter(fs,
                                                                conf,
View Full Code Here

  public int run(String[] strings) throws Exception {
    Map<String,String> parsedArgs = parseArguments(strings);
    Configuration conf = getConf();
    FileSystem fs = FileSystem.get(conf);
    Path inputPath = fs.makeQualified(new Path(parsedArgs.get("--input")));
    Path outputPath = fs.makeQualified(new Path(parsedArgs.get("--output")));
    Path indexPath = new Path(outputPath, "docIndex");
    Path matrixPath = new Path(outputPath, "matrix");
    SequenceFile.Writer indexWriter = SequenceFile.createWriter(fs,
                                                                conf,
                                                                indexPath,
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.