Package org.apache.hadoop.fs

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


    }

    Path regioninfo = new Path(regionDir, HRegion.REGIONINFO_FILE);
    FileSystem fs = regioninfo.getFileSystem(getConf());

    FSDataInputStream in = fs.open(regioninfo);
    HRegionInfo hri = new HRegionInfo();
    hri.readFields(in);
    in.close();
    LOG.debug("HRegionInfo read: " + hri.toString());
    hbi.hdfsEntry.hri = hri;
View Full Code Here


        LOG.error("Snapshot information for " + snapshot.getPath() + " doesn't exist");
        continue;
      }
      FSDataInputStream in = null;
      try {
        in = fs.open(info);
        SnapshotDescription desc = SnapshotDescription.parseFrom(in);
        snapshotDescs.add(desc);
      } catch (IOException e) {
        LOG.warn("Found a corrupted snapshot " + snapshot.getPath(), e);
      } finally {
View Full Code Here

        /**
         * Read the index file to get the information about where
         * the map-output for the given reducer is available.
         */
        //open index file
        indexIn = fileSys.open(indexFileName);

        //seek to the correct offset for the given reduce
        indexIn.seek(reduce * 16);
         
        //read the offset and length of the partition data
View Full Code Here

        /**
         * Read the data from the sigle map-output file and
         * send it to the reducer.
         */
        //open the map-output file
        mapOutputIn = fileSys.open(mapOutputFileName);
        //seek to the correct offset for the reduce
        mapOutputIn.seek(startOffset);
         
        long totalRead = 0;
        int len = mapOutputIn.read(buffer, 0,
View Full Code Here

  private static List<Path> fetchFileList(Configuration conf, Path srcList)
      throws IOException {
    List<Path> result = new ArrayList<Path>();
    FileSystem fs = srcList.getFileSystem(conf);
    DataInputStream raw = fs.open(srcList);
    BufferedReader input = null;
    try {
      input = new BufferedReader(new InputStreamReader(raw));
      String line = input.readLine();
      while (line != null) {
View Full Code Here

    //
    String jobFile = profile.getJobFile();

    FileSystem fs = FileSystem.get(conf);
    DataInputStream splitFile =
      fs.open(new Path(conf.get("mapred.job.split.file")));
    JobClient.RawSplit[] splits;
    try {
      splits = JobClient.readSplitFile(splitFile);
    } finally {
      splitFile.close();
View Full Code Here

        /**
         * Read the index file to get the information about where
         * the map-output for the given reducer is available.
         */
        //open index file
        indexIn = fileSys.open(indexFileName);

        //seek to the correct offset for the given reduce
        indexIn.seek(reduce * 16);
         
        //read the offset and length of the partition data
View Full Code Here

        /**
         * Read the data from the sigle map-output file and
         * send it to the reducer.
         */
        //open the map-output file
        mapOutputIn = fileSys.open(mapOutputFileName);
        //seek to the correct offset for the reduce
        mapOutputIn.seek(startOffset);
         
        long totalRead = 0;
        int len = mapOutputIn.read(buffer, 0,
View Full Code Here

       
        OutputStream baos = new ByteArrayOutputStream();
        String str = null;
       
        try {
            fsdis = fs.open(path);
            IOUtils.copyBytes(fsdis, baos, 4096, false);
            str = baos.toString()
        } finally {
            IOUtils.closeStream(fsdis);
            fs.close();
View Full Code Here

    Properties properties = null;
    IOException ioe = null;
    try {
      fs = path.getFileSystem(configuration);
      if (fs.exists(path)) {
        in = fs.open(path);
        properties = new Properties();
        properties.load(in);
      }
    }
    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.