Package org.apache.hadoop.fs

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


       
       
        Path txtpath=new Path(tableInfo.get("txtStorePath"));
        if(!fs.exists(txtpath))
        {
          fs.mkdirs(txtpath);
        }
       
        for( FileStatus outpath:fs.listStatus(new Path(store)))
        {
          if(!outpath.isDir())
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>();
    FSDataOutputStream out=fs.create(new Path(store,String.valueOf(System.currentTimeMillis())));
      OutputStreamWriter osw = new OutputStreamWriter(out, "UTF-8");
View Full Code Here

    Configuration conf=params.getConf();
    FileSystem fs=FileSystem.get(conf);
    if(!status.isInit.get())
    {
      fs.mkdirs(new Path(hdfsPath).getParent());
    }
   
    boolean isUsedHdfs=false;
    if(!status.isInit.get())
    {
View Full Code Here

    Path tmpDir=new Path(params.hdfsPath,"realtime_tmp");
    if(fs.exists(tmpDir))
    {
      fs.delete(tmpDir, true);
    }
    fs.mkdirs(tmpDir);
   
    Path tsdst=new Path(tmpDir,"realtime_ts");
   
    OutputStreamWriter fwriterTs= new OutputStreamWriter(fs.create(tsdst));
    fwriterTs.write(tsstr);
View Full Code Here

    Configuration conf=params.getConf();
    FileSystem fs=FileSystem.get(conf);
    if(!status.isInit.get())
    {
      fs.mkdirs(new Path(hdfsPath).getParent());
    }
   
    boolean isUsedHdfs=false;
    if(!status.isInit.get())
    {
View Full Code Here

    Path tmpDir=new Path(params.hdfsPath,"realtime_tmp");
    if(fs.exists(tmpDir))
    {
      fs.delete(tmpDir, true);
    }
    fs.mkdirs(tmpDir);
   
    Path tsdst=new Path(tmpDir,"realtime_ts");
   
    OutputStreamWriter fwriterTs= new OutputStreamWriter(fs.create(tsdst));
    fwriterTs.write(tsstr);
View Full Code Here

   

    parse.setup(conf);
//    HadoopUtil.delete(conf, output);

    fs.mkdirs(output);
    if(callback!=null)
    {
      callback.setPercent("Stage-"+(this.percentStage++)+" map = 100.0%, reduce = 100.0%");
      callback.maybeSync();
    }
View Full Code Here

  }
  public Path buildRandom(Configuration conf, Path input, Path output, int k)
      throws IOException {
    FileSystem fs = FileSystem.get(output.toUri(), conf);
    Path outFile = new Path(output, "part-randomSeed");
    fs.mkdirs(outFile);

    Path inputPathPattern;
    System.out.println(input);
    if (fs.getFileStatus(input).isDir()) {
      inputPathPattern = new Path(input, "*");
 
View Full Code Here

          // will return null. In this case, use '/' as its own parent to prevent
          // NPE errors below.
          parent = args.dst;
        }
        if (!dstfs.exists(parent)) {
          dstfs.mkdirs(parent);
        }
        logPath = new Path(parent, filename);
      } else {
        logPath = new Path(args.dst, filename);
      }
View Full Code Here

        FileSystem fs = FileSystem.get(theJobConf);
        Path inputPaths[] = FileInputFormat.getInputPaths(theJobConf);
        for (int i = 0; i < inputPaths.length; i++) {
          if (!fs.exists(inputPaths[i])) {
            try {
              fs.mkdirs(inputPaths[i]);
            } catch (IOException e) {

            }
          }
        }
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.