Package org.apache.hadoop.fs

Examples of org.apache.hadoop.fs.FSDataOutputStream.writeLong()


            }
            // we need to close the writer to flush buffered data, obtaining
            // the correct offset
            writer.close();
            writer = null;
            indexOut.writeLong(segmentStart);
            indexOut.writeLong(out.getPos() - segmentStart);
          } finally {
            if (null != writer) writer.close();
          }
        }
View Full Code Here


            // we need to close the writer to flush buffered data, obtaining
            // the correct offset
            writer.close();
            writer = null;
            indexOut.writeLong(segmentStart);
            indexOut.writeLong(out.getPos() - segmentStart);
          } finally {
            if (null != writer) writer.close();
          }
        }
        ++numSpills;
View Full Code Here

              // Note that our map byte count will not be accurate with
              // compression
              mapOutputByteCounter.increment(out.getPos() - recordStart);
            }
            writer.close();
            indexOut.writeLong(segmentStart);
            indexOut.writeLong(out.getPos() - segmentStart);
          } catch (IOException e) {
            if (null != writer) writer.close();
            throw e;
          }
View Full Code Here

              // compression
              mapOutputByteCounter.increment(out.getPos() - recordStart);
            }
            writer.close();
            indexOut.writeLong(segmentStart);
            indexOut.writeLong(out.getPos() - segmentStart);
          } catch (IOException e) {
            if (null != writer) writer.close();
            throw e;
          }
        }
View Full Code Here

          segmentStart = finalOut.getPos();
          Writer writer = SequenceFile.createWriter(job, finalOut,
                                                    job.getMapOutputKeyClass(),
                                                    job.getMapOutputValueClass(),
                                                    compressionType, codec);
          finalIndexOut.writeLong(segmentStart);
          finalIndexOut.writeLong(finalOut.getPos() - segmentStart);
          writer.close();
        }
        finalOut.close();
        finalIndexOut.close();
View Full Code Here

          Writer writer = SequenceFile.createWriter(job, finalOut,
                                                    job.getMapOutputKeyClass(),
                                                    job.getMapOutputValueClass(),
                                                    compressionType, codec);
          finalIndexOut.writeLong(segmentStart);
          finalIndexOut.writeLong(finalOut.getPos() - segmentStart);
          writer.close();
        }
        finalOut.close();
        finalIndexOut.close();
        return;
View Full Code Here

          //when we write the offset/length to the final index file, we write
          //longs for both. This helps us to reliably seek directly to the
          //offset/length for a partition when we start serving the byte-ranges
          //to the reduces. We probably waste some space in the file by doing
          //this as opposed to writing VLong but it helps us later on.
          finalIndexOut.writeLong(segmentStart);
          finalIndexOut.writeLong(finalOut.getPos()-segmentStart);
        }
        finalOut.close();
        finalIndexOut.close();
        //cleanup
View Full Code Here

          //longs for both. This helps us to reliably seek directly to the
          //offset/length for a partition when we start serving the byte-ranges
          //to the reduces. We probably waste some space in the file by doing
          //this as opposed to writing VLong but it helps us later on.
          finalIndexOut.writeLong(segmentStart);
          finalIndexOut.writeLong(finalOut.getPos()-segmentStart);
        }
        finalOut.close();
        finalIndexOut.close();
        //cleanup
        for(int i = 0; i < numSpills; i++) {
View Full Code Here

  throws IOException {
    Path p = getInfoFilePath();
    FSDataOutputStream out = filesystem.create(p);
    try {
      out.writeByte(INFO_SEQ_NUM);
      out.writeLong(infonum);
      if (mc) {
        // Set whether major compaction flag on this file.
        this.majorCompaction = mc;
        out.writeByte(MAJOR_COMPACTION);
        out.writeBoolean(mc);
View Full Code Here

        //create a file
        FSDataOutputStream out = dfs.create(filepath);
        assertTrue(dfs.dfs.isLeaseCheckerStarted());
 
        //write something and close
        out.writeLong(millis);
        assertTrue(dfs.dfs.isLeaseCheckerStarted());
        out.close();
        assertTrue(dfs.dfs.isLeaseCheckerStarted());
        dfs.close();
      }
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.