Package org.apache.hadoop.fs

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


      @Override
      public void run() {
        try {
          IndexUtils.copyToLocal(fs, lfs, hdfsRealtime,localPath,localPathtmp,true);
          synchronized (plock.lock) {
                FileStatus[] filelist=lfs.listStatus(localPath);
                boolean needPurge=false;
                if(filelist!=null)
                {
                  for(FileStatus f:filelist)
                  {
View Full Code Here


      @Override
      public void run() {
        try {
          IndexUtils.copyToLocal(fs, lfs, hdfsRealtime,localPath,localPathtmp,true);
          synchronized (plock.lock) {
                FileStatus[] filelist=lfs.listStatus(localPath);
                boolean needPurge=false;
                if(filelist!=null)
                {
                  for(FileStatus f:filelist)
                  {
View Full Code Here

      Path clusterPath = new Path(clusterPathStr, "*");
      Collection<Path> result = new ArrayList<Path>();
 
      // get all filtered file names in result list
      FileSystem fs = clusterPath.getFileSystem(conf);
      FileStatus[] matches = fs.listStatus(FileUtil.stat2Paths(fs.globStatus(clusterPath, FILTER)),FILTER);
 
      for (FileStatus match : matches) {
        result.add(fs.makeQualified(match.getPath()));
      }
 
View Full Code Here

      }

      StringBuffer buff = new StringBuffer();

      FileStatus[] fsArrays = fs.listStatus(path);
      int index = 0;
      int savetime = 1000 * 600;
      for (FileStatus f : fsArrays) {
        index++;

View Full Code Here

        if(!fs.exists(txtpath))
        {
          fs.mkdirs(txtpath);
        }
       
        for( FileStatus outpath:fs.listStatus(new Path(store)))
        {
          if(!outpath.isDir())
          {
            fs.rename(outpath.getPath(), new Path(txtpath,outpath.getPath().getName()+"_"+System.currentTimeMillis()));
          }
View Full Code Here

          }
        }
        fs.delete(new Path(store),true);
       
        Path basepath=new Path(MdrillService.getBasePath());
        FileStatus[] tablelist=fs.listStatus(basepath);
        String solrHome=tablelist[0].getPath().toString();

        for(FileStatus tbl:tablelist){
          if(tbl.isDir()&&fs.exists(new Path(tbl.getPath(),"solr")))
          {
View Full Code Here

      long savedTxid=this.data.getMaxTxidFromLocal();
      if(isUsedHdfs)
    {
        Path realtimefinal=new Path(this.params.hdfsPath,"realtime");
        FileSystem fs=FileSystem.get(conf);
        FileStatus[] list=fs.listStatus(realtimefinal);
        if(list!=null)
        {
          for(FileStatus s:list)
          {
            try{
View Full Code Here

      long savedTxid=this.data.getMaxTxidFromLocal();
      if(isUsedHdfs)
    {
        Path realtimefinal=new Path(this.params.hdfsPath,"realtime");
        FileSystem fs=FileSystem.get(conf);
        FileStatus[] list=fs.listStatus(realtimefinal);
        if(list!=null)
        {
          for(FileStatus s:list)
          {
            try{
View Full Code Here

      job.go();

      fileSys = dfs.getFileSystem();
      String line = null;
      String line2 = null;
      Path[] fileList = FileUtil.stat2Paths(fileSys.listStatus(
                                   new Path(OUTPUT_DIR),
                                   new Utils.OutputFileUtils
                                     .OutputFilesFilter()));
      for (int i = 0; i < fileList.length; i++){
        System.out.println(fileList[i].toString());
View Full Code Here

      job = new StreamJob(argv, mayExit);     
      job.go();

      fileSys = dfs.getFileSystem();
      String line = null;
      Path[] fileList = FileUtil.stat2Paths(fileSys.listStatus(
                                              new Path(OUTPUT_DIR),
                                              new Utils.OutputFileUtils
                                              .OutputFilesFilter()));
      for (int i = 0; i < fileList.length; i++){
        System.out.println(fileList[i].toString());
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.