Package org.apache.hadoop.fs

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


    JobConf conf = mr.createJobConf();
    FileSystem fs = FileSystem.get(fileSys, conf);
    fs.delete(new Path(TEST_ROOT_DIR), true);
    fs.delete(outDir, true);
    if (!fs.mkdirs(inDir)) {
      LOG.warn("Can't create " + inDir);
      return false;
    }

    // use WordCount example
View Full Code Here


    // if temp directory path is not absolute, prepend it with workDir.
    if (!tmpDir.isAbsolute()) {
      tmpDir = new Path(workDir.toString(), tmp);

      FileSystem localFs = FileSystem.getLocal(conf);
      if (!localFs.mkdirs(tmpDir) && !localFs.getFileStatus(tmpDir).isDir()) {
        throw new IOException("Mkdirs failed to create " + tmpDir.toString());
      }
    }
    return tmpDir;
  }
View Full Code Here

    FileSystem.mkdirs(jobDirectory.getFileSystem(conf), jobDirectory,
                      mapredSysPerms);
    conf.set(JOB_DIR_LABEL, jobDirectory.toString());
    //get a tmp directory for input splits
    FileSystem jobfs = jobDirectory.getFileSystem(conf);
    jobfs.mkdirs(jobDirectory);
    Path srcFiles = new Path(jobDirectory, "_har_src_files");
    conf.set(SRC_LIST_LABEL, srcFiles.toString());
    SequenceFile.Writer srcWriter = SequenceFile.createWriter(jobfs, conf,
        srcFiles, LongWritable.class, Text.class,
        SequenceFile.CompressionType.NONE);
View Full Code Here

         
        String partionDisk = IndexUtils.getPath(RealTimeDirectoryParams.diskDirList, taskIndex,hashcode,lfs);
        String tablename=this.Partion==null?"default":this.Partion.tablename;
        String partionName=this.Partion==null?"default":this.Partion.partion;
        Path localPartionStorePath = new Path(new Path(partionDisk, "higo"),tablename + "/" + partionName + "/" + taskIndex );
        lfs.mkdirs(localPartionStorePath);
        return localPartionStorePath.toString();
        } catch (IOException e) {
          LOG.error("getIndexMalloc",e);
        }
      }
View Full Code Here

   
    Configuration conf=new Configuration();
     HadoopBaseUtils.grabConfiguration(confdir, conf);
    try {
      FileSystem fs = FileSystem.get(conf);
        fs.mkdirs(new Path(this.storedir).getParent());
    } catch (IOException e) {}
   
    this.callback.setPercent("started");
    this.callback.sync();
       Process process = null;
View Full Code Here

         
        String partionDisk = IndexUtils.getPath(RealTimeDirectoryParams.diskDirList, taskIndex,hashcode,lfs);
        String tablename=this.Partion==null?"default":this.Partion.tablename;
        String partionName=this.Partion==null?"default":this.Partion.partion;
        Path localPartionStorePath = new Path(new Path(partionDisk, "higo"),tablename + "/" + partionName + "/" + taskIndex );
        lfs.mkdirs(localPartionStorePath);
        return localPartionStorePath.toString();
        } catch (IOException e) {
          LOG.error("getIndexMalloc",e);
        }
      }
View Full Code Here

    public String cleandir(Path path, Configuration conf)
        throws IOException {
      FileSystem fs = FileSystem.get(conf);

      fs.mkdirs(path);
      Date now = new Date();
      synchronized (lock) {
        if (now.getTime() - 1000 * 60 < lasttime) {
          return "skip";
        }
View Full Code Here

      if(this.istmp)
      {
        cleandir(path.getParent(), conf);
      }
      FileSystem fs = FileSystem.get(conf);
      fs.mkdirs(path.getParent());
    }

  @Override
  public void load(SolrQueryRequest rq, SolrQueryResponse pq,
        ContentStream stream) throws Exception {
View Full Code Here

   
    Configuration conf=getConf(stormconf);
    FileSystem fs=FileSystem.get(conf);
    if(!fs.exists(new Path(store)))
    {
      fs.mkdirs(new Path(store));
    }
   
    HashMap<String,String> params=new HashMap<String, String>();
    Path outpath=new Path(store,String.valueOf(System.currentTimeMillis()));
    FSDataOutputStream out=fs.create(outpath);
View Full Code Here

        SimpleDateFormat fmt = new SimpleDateFormat("yyyyMMdd");
        String day = fmt.format(new Date());
       
        if(!fs.exists(new Path(store)))
        {
          fs.mkdirs(new Path(store));
        }
       
       
        Path txtpath=new Path(tableInfo.get("txtStorePath"));
        if(!fs.exists(txtpath))
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.