Examples of readFully()


Examples of org.apache.cassandra.io.util.BufferedRandomAccessFile.readFully()

                        if (checksum.getValue() != claimedSizeChecksum)
                            break; // entry wasn't synced correctly/fully.  that's ok.

                        if (serializedSize > bytes.length)
                            bytes = new byte[(int) (1.2 * serializedSize)];
                        reader.readFully(bytes, 0, serializedSize);
                        claimedCRC32 = reader.readLong();
                    }
                    catch(EOFException eof)
                    {
                        break; // last CL entry didn't get completely written.  that's ok.
View Full Code Here

Examples of org.apache.cassandra.io.util.RandomAccessReader.readFully()

                        break; // entry wasn't synced correctly/fully. that's
                               // ok.

                    if (serializedSize > buffer.length)
                        buffer = new byte[(int) (1.2 * serializedSize)];
                    reader.readFully(buffer, 0, serializedSize);
                    claimedCRC32 = reader.readLong();
                }
                catch (EOFException eof)
                {
                    break; // last CL entry didn't get completely written. that's ok.
View Full Code Here

Examples of org.apache.derby.io.StorageRandomAccessFile.readFully()

            if (controlFilelength < 16)
        onDiskChecksum = -1;
      else if (controlFilelength == 16)
      {
        barray = new byte[16];
        logControlFile.readFully(barray);
      }else if (controlFilelength > 16)
            {
        barray = new byte[(int) logControlFile.length() - 8];
        logControlFile.readFully(barray);
        onDiskChecksum = logControlFile.readLong();
View Full Code Here

Examples of org.apache.derby.io.StorageRandomAccessFile.readFully()

        barray = new byte[16];
        logControlFile.readFully(barray);
      }else if (controlFilelength > 16)
            {
        barray = new byte[(int) logControlFile.length() - 8];
        logControlFile.readFully(barray);
        onDiskChecksum = logControlFile.readLong();
        if (onDiskChecksum !=0 )
        {
          checksum.reset();
          checksum.update(barray, 0, barray.length);
View Full Code Here

Examples of org.apache.derby.io.StorageRandomAccessFile.readFully()

        barray = new byte[16];
        logControlFile.readFully(barray);
      }else if (controlFilelength > 16)
            {
        barray = new byte[(int) logControlFile.length() - 8];
        logControlFile.readFully(barray);
        onDiskChecksum = logControlFile.readLong();
        if (onDiskChecksum !=0 )
        {
          checksum.reset();
          checksum.update(barray, 0, barray.length);
View Full Code Here

Examples of org.apache.derby.io.StorageRandomAccessFile.readFully()

            if (controlFilelength < 16)
        onDiskChecksum = -1;
      else if (controlFilelength == 16)
      {
        barray = new byte[16];
        logControlFile.readFully(barray);
      }else if (controlFilelength > 16)
            {
        barray = new byte[(int) logControlFile.length() - 8];
        logControlFile.readFully(barray);
        onDiskChecksum = logControlFile.readLong();
View Full Code Here

Examples of org.apache.hadoop.fs.FSDataInputStream.readFully()

  }
 
  void readFile(FileSystem fs, Path path, int fileLen) throws IOException {
    byte [] arr = new byte[fileLen];
    FSDataInputStream in = fs.open(path);
    in.readFully(arr);
  }
 
  public void testDataTransferProtocol() throws IOException {
    Random random = new Random();
    int oneMil = 1024*1024;
 
View Full Code Here

Examples of org.apache.hadoop.fs.FSInputStream.readFully()

    assertEquals("Length", len, s3FileSystem.getLength(path));

    FSInputStream in = s3FileSystem.openRaw(path);
    byte[] buf = new byte[len];

    in.readFully(0, buf);

    assertEquals(len, buf.length);
    for (int i = 0; i < buf.length; i++) {
      assertEquals("Position " + i, data[i], buf[i]);
    }
View Full Code Here

Examples of org.apache.hadoop.hdfs.BlockReader.readFully()

    int readOffset = 0;
    int retries = 2;
    while ( amtToRead > 0 ) {
      int numRead = amtToRead;
      try {
        blockReader.readFully(buf, readOffset, amtToRead);
      }
      catch (IOException e) {
        retries--;
        if (retries == 0)
          throw new IOException("Could not read data from datanode");
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.datanode.BlockDataFile.RandomAccessor.readFully()

      // truncate blockFile
      ra.setLength(newlen);

      // read last chunk
      ra.seek(lastchunkoffset);
      ra.readFully(b, 0, lastchunksize);
    } finally {
      ra.close();
    }

    // compute checksum
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.