Examples of writeInt()


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

      Path recoveredEditsDir = HLogUtil.getRegionDirRecoveredEditsDir(regiondir);
      for (int i = 1000; i < 1050; i += 10) {
        Path recoveredEdits = new Path(recoveredEditsDir, String.format("%019d", i));
        FSDataOutputStream dos = fs.create(recoveredEdits);
        dos.writeInt(i);
        dos.close();
      }
      long minSeqId = 2000;
      Path recoveredEdits = new Path(recoveredEditsDir, String.format("%019d", minSeqId - 1));
      FSDataOutputStream dos = fs.create(recoveredEdits);
View Full Code Here

Examples of org.apache.hadoop.io.DataOutputBuffer.writeInt()

            LOG.debug(getName() + " sending #" + call.id);
         
          //for serializing the
          //data to be written
          d = new DataOutputBuffer();
          d.writeInt(0); // placeholder for data length
          d.writeInt(call.id);
          call.param.write(d);
          byte[] data = d.getData();
          int dataLength = d.getLength() - 4;
          data[0] = (byte)((dataLength >>> 24) & 0xff);
View Full Code Here

Examples of org.apache.hadoop.oncrpc.XDR.writeInt()

    XDR xdr_req = new XDR();
    FileHandle handle = new FileHandle(dirId);
    handle.serialize(xdr_req);
    xdr_req.writeLongAsHyper(0); // cookie
    xdr_req.writeLongAsHyper(0); // verifier
    xdr_req.writeInt(100); // count

    READDIR3Response response = nfsd.readdir(xdr_req.asReadOnlyWrap(),
        securityHandler, new InetSocketAddress("localhost", 1234));
    List<Entry3> dirents = response.getDirList().getEntries();
    assertTrue(dirents.size() == 5); // inculding dot, dotdot
View Full Code Here

Examples of org.apache.hadoop.typedbytes.TypedBytesOutput.writeInt()

        protected TypedBytesWritable randomKey() throws IOException {
            ByteArrayOutputStream bytes = new ByteArrayOutputStream();
           
            TypedBytesOutput out =
                new TypedBytesOutput(new DataOutputStream(bytes));
            out.writeInt(rand.nextInt(2000000000));
           
            TypedBytesWritable val =
                new TypedBytesWritable(bytes.toByteArray());
           
            return val;
View Full Code Here

Examples of org.apache.jute.BinaryOutputArchive.writeInt()

            } else {
                try {
                    ByteArrayOutputStream baos = new ByteArrayOutputStream();
                    BinaryOutputArchive boa = BinaryOutputArchive
                            .getArchive(baos);
                    boa.writeInt(-1, "len"); // We'll fill this in later
                    header.serialize(boa, "header");
                    if (record != null) {
                        record.serialize(boa, "request");
                    }
                    baos.close();
View Full Code Here

Examples of org.apache.jute_voltpatches.BinaryOutputArchive.writeInt()

                    : 0, valid ? sessionId : 0, // send 0 if session is no
                    // longer valid
                    valid ? zk.generatePasswd(sessionId) : new byte[16]);
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            BinaryOutputArchive bos = BinaryOutputArchive.getArchive(baos);
            bos.writeInt(-1, "len");
            rsp.serialize(bos, "connect");
            baos.close();
            ByteBuffer bb = ByteBuffer.wrap(baos.toByteArray());
            bb.putInt(bb.remaining() - 4).rewind();
            sendBuffer(bb);
View Full Code Here

Examples of org.apache.kahadb.util.DataByteArrayOutputStream.writeInt()

    public static final byte[] BATCH_CONTROL_RECORD_HEADER = createBatchControlRecordHeader();

    private static byte[] createBatchControlRecordHeader() {
        try {
            DataByteArrayOutputStream os = new DataByteArrayOutputStream();
            os.writeInt(BATCH_CONTROL_RECORD_SIZE);
            os.writeByte(BATCH_CONTROL_RECORD_TYPE);
            os.write(BATCH_CONTROL_RECORD_MAGIC);
            ByteSequence sequence = os.toByteSequence();
            sequence.compact();
            return sequence.getData();
View Full Code Here

Examples of org.apache.lucene.store.ByteArrayDataOutput.writeInt()

    RANDOM_TEST_BYTES = new byte[COUNT * (5 + 4 + 9 + 8)];
    final ByteArrayDataOutput bdo = new ByteArrayDataOutput(RANDOM_TEST_BYTES);
    for (int i = 0; i < COUNT; i++) {
      final int i1 = INTS[i] = random.nextInt();
      bdo.writeVInt(i1);
      bdo.writeInt(i1);

      final long l1;
      if (rarely()) {
        // a long with lots of zeroes at the end
        l1 = LONGS[i] = _TestUtil.nextLong(random, 0, Integer.MAX_VALUE) << 32;
View Full Code Here

Examples of org.apache.lucene.store.ChecksumIndexOutput.writeInt()

    ChecksumIndexOutput segnOutput = new ChecksumIndexOutput(directory.createOutput(segmentFileName[0]),directory,segmentFileName[1]);

    boolean success = false;

    try {
      segnOutput.writeInt(CURRENT_FORMAT); // write FORMAT
      segnOutput.writeLong(version);
      segnOutput.writeInt(counter); // write counter
      segnOutput.writeInt(size()); // write infos
      for (SegmentInfo si : this) {
        si.write(segnOutput);
View Full Code Here

Examples of org.apache.lucene.store.IndexOutput.writeInt()

          indexStream.writeInt(FieldsWriterCompress.FORMAT_CURRENT);
          fieldsStream=new FdtCompressIndexOutput(fdt,1024*512);
          fieldsStream.writeInt(FieldsWriterCompress.FORMAT_CURRENT);

      }else{
          fdt.writeInt(FORMAT_CURRENT);
          indexStream.writeInt(FORMAT_CURRENT);
          fieldsStream=fdt;
          fieldsStream.writeInt(FieldsWriterCompress.FORMAT_CURRENT);
      }

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.