Examples of listStatus()


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

    }

    sink.stop();

    // loop through all the files generated and check their contains
    FileStatus[] dirStat = fs.listStatus(dirPath);
    Path fList[] = FileUtil.stat2Paths(dirStat);

    // check that the roll happened correctly for the given data
    long expectedFiles = totalEvents / rollCount;
    if (totalEvents % rollCount > 0) expectedFiles++;
View Full Code Here

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

    String applicationBaseDir = springYarnProperties.getApplicationBaseDir();
    Path path = new Path(applicationBaseDir);
    FileSystem fs = path.getFileSystem(yarnConfiguration);
    FileStatus[] listStatus = new FileStatus[0];
    if (fs.exists(path)) {
      listStatus = fs.listStatus(path);
    }
    return ApplicationsReport.installedReportBuilder()
        .add(InstalledField.NAME)
        .add(InstalledField.PATH)
        .from(listStatus)
View Full Code Here

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

          for (FileStatus status : fileStatus) {
            results.put(status.getPath(), srcFs.getContentSummary(status.getPath()).getLength());
          }
        }
        else {
          FileStatus items[] = srcFs.listStatus(FileUtil.stat2Paths(fileStatus, srcPath));
          if (ObjectUtils.isEmpty(items) && (!srcFs.exists(srcPath))) {
            throw new HadoopException("Cannot access " + src + ": No such file or directory.");
          }
          for (FileStatus status : items) {
            Long size = (status.isDir() ? srcFs.getContentSummary(status.getPath()).getLength() : status.getLen());
View Full Code Here

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

            te.printStackTrace();
            logger.error("Error thrown while trying to get Hadoop filesystem");
            System.exit(-1);
        }

        FileStatus status = fs.listStatus(p)[0];
        long size = status.getLen();
        HdfsFetcher fetcher = new HdfsFetcher(null,
                                              maxBytesPerSec,
                                              VoldemortConfig.REPORTING_INTERVAL_BYTES,
                                              VoldemortConfig.DEFAULT_BUFFER_SIZE,
View Full Code Here

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

    private List<FileStatus> getAllSubFileStatus(JobConf inputConf, Path filterMemberPath)
            throws IOException {
        List<FileStatus> list = new ArrayList<FileStatus>();

        FileSystem fs = filterMemberPath.getFileSystem(inputConf);
        FileStatus[] subFiles = fs.listStatus(filterMemberPath);

        if(null != subFiles) {
            if(fs.isDirectory(filterMemberPath)) {
                for(FileStatus subFile: subFiles) {
                    if(!HadoopUtils.shouldPathBeIgnored(subFile.getPath())) {
View Full Code Here

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

        }

        final FileSystem fs = path.getFileSystem(conf);

        if(fs.exists(path)) {
            for(FileStatus status: fs.listStatus(path)) {
                if(!shouldPathBeIgnored(status.getPath())) {
                    if(status.isDir()) {
                        addAllSubPaths(conf, status.getPath());
                    } else {
                        FileInputFormat.addInputPath(conf, status.getPath());
View Full Code Here

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

    FileStatus status2 = mock(FileStatus.class);
    Path path2 = mock(Path.class);
    when(path2.getName()).thenReturn("part-yyyyy");
    when(status2.getPath()).thenReturn(path2);
    FileSystem fs = mock(FileSystem.class);
    when(fs.listStatus(path)).thenReturn(
        new FileStatus[] { status1, status2 });
    when(path.getFileSystem(conf)).thenReturn(fs);
    when(conf.get(HIHOConf.EXTERNAL_TABLE_DML))
        .thenReturn(
            "create table age(  i   Number,  n   Varchar(20),  a   Number)organization external (  type  oracle_loader default directory ext_dir access parameters (records delimited  by newlinefields  terminated by ','missing field values are null )location  (/home/nube/:file.txt) reject' limit unlimited;");
View Full Code Here

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

    //lets verify the result now
    FileSystem outputFS = getFileSystem();
    //Path outputPath = getOutputDir();
   
    Path outputPath = new Path(outputFS.getHomeDirectory(), "testBasicTableImport");
    FileStatus[] status = outputFS.listStatus(outputPath, getOutputPathFilter());
    assertTrue(outputFS.exists(outputPath));
    List<String> expectedOutput = new ArrayList<String>();
    expectedOutput.add("/aDELIM1000");
    expectedOutput.add("/bDELIM2000");
    expectedOutput.add("/cDELIM3000");
View Full Code Here

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

    //lets verify the result now
    FileSystem outputFS = getFileSystem();
    //Path outputPath = getOutputDir();
   
    Path outputPath = new Path(outputFS.getHomeDirectory(), "testBasicTableImport");
    FileStatus[] status = outputFS.listStatus(outputPath, getOutputPathFilter());
    assertTrue(outputFS.exists(outputPath));
  /*  List<String> expectedOutput = new ArrayList<String>();
    expectedOutput.add("/aDELIM1000");
    expectedOutput.add("/bDELIM2000");
    expectedOutput.add("/cDELIM3000");
View Full Code Here

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

    int res = ToolRunner.run(createJobConf(), job, args);
    assertEquals(0, res);
    //lets verify the result now
    FileSystem outputFS = getFileSystem();
    Path outputPath = new Path(outputFS.getHomeDirectory(), "testQueryBasedImport");
    FileStatus[] status = outputFS.listStatus(outputPath, getOutputPathFilter());
    assertTrue(outputFS.exists(outputPath));
    List<String> expectedOutput = new ArrayList<String>();
    expectedOutput.add("/aDELIM1000DELIM10");
    expectedOutput.add("/bDELIM2000DELIM10");
    expectedOutput.add("/cDELIM3000DELIM10");
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.