Package java.io

Examples of java.io.RandomAccessFile.readLong()


      // v3 due to meta file, version will be checked by backing store
      if(metaDataExists) {
        return new EventQueueBackingStoreFileV3(checkpointFile, capacity, name);
      }
      checkpointFileHandle = new RandomAccessFile(checkpointFile, "r");
      int version = (int)checkpointFileHandle.readLong();
      if(Serialization.VERSION_2 == version) {
        if(upgrade) {
          return upgrade(checkpointFile, capacity, name);
        }
        return new EventQueueBackingStoreFileV2(checkpointFile, capacity, name);
View Full Code Here


        if (fid != logFileID) {
          throw new IOException("The file id of log file: "
              + file.getCanonicalPath() + " is different from expected "
              + " id: expected = " + logFileID + ", found = " + fid);
        }
        setLastCheckpointOffset(writeFileHandle.readLong());
        setLastCheckpointWriteOrderID(writeFileHandle.readLong());
        LOGGER.info("File: " + file.getCanonicalPath() + " was last checkpointed "
            + "at position: " + getLastCheckpointOffset()
            + ", logWriteOrderID: " + getLastCheckpointWriteOrderID());
        error = false;
View Full Code Here

          throw new IOException("The file id of log file: "
              + file.getCanonicalPath() + " is different from expected "
              + " id: expected = " + logFileID + ", found = " + fid);
        }
        setLastCheckpointOffset(writeFileHandle.readLong());
        setLastCheckpointWriteOrderID(writeFileHandle.readLong());
        LOGGER.info("File: " + file.getCanonicalPath() + " was last checkpointed "
            + "at position: " + getLastCheckpointOffset()
            + ", logWriteOrderID: " + getLastCheckpointWriteOrderID());
        error = false;
      } finally {
View Full Code Here

        throw new IOException("Version is " + Integer.toHexString(version) +
            " expected " + Integer.toHexString(getVersion())
            + " file: " + file.getCanonicalPath());
      }
      setLogFileID(fileHandle.readInt());
      setLastCheckpointPosition(fileHandle.readLong());
      setLastCheckpointWriteOrderID(fileHandle.readLong());
    }
    @Override
    public int getVersion() {
      return Serialization.VERSION_2;
View Full Code Here

            " expected " + Integer.toHexString(getVersion())
            + " file: " + file.getCanonicalPath());
      }
      setLogFileID(fileHandle.readInt());
      setLastCheckpointPosition(fileHandle.readLong());
      setLastCheckpointWriteOrderID(fileHandle.readLong());
    }
    @Override
    public int getVersion() {
      return Serialization.VERSION_2;
    }
View Full Code Here

      if(metaDataExists) {
        return new EventQueueBackingStoreFileV3(checkpointFile, capacity,
          name, backupCheckpointDir, shouldBackup, compressBackup);
      }
      checkpointFileHandle = new RandomAccessFile(checkpointFile, "r");
      int version = (int)checkpointFileHandle.readLong();
      if(Serialization.VERSION_2 == version) {
        if(upgrade) {
          return upgrade(checkpointFile, capacity, name, backupCheckpointDir,
            shouldBackup, compressBackup);
        }
View Full Code Here

              Logger.debug(this, "Encrypting (new) with "+HexUtil.bytesToHex(salt)+" from "+HexUtil.bytesToHex(diskSalt));
          }

          cipherManager = new CipherManager(salt, diskSalt);

          storeSize = raf.readLong();
          if(storeSize <= 0) throw new IOException("Bogus datastore size");
          prevStoreSize = raf.readLong();
          keyCount.set(raf.readLong());
          generation = raf.readInt();
          flags = raf.readInt();
View Full Code Here

          cipherManager = new CipherManager(salt, diskSalt);

          storeSize = raf.readLong();
          if(storeSize <= 0) throw new IOException("Bogus datastore size");
          prevStoreSize = raf.readLong();
          keyCount.set(raf.readLong());
          generation = raf.readInt();
          flags = raf.readInt();

          if (((flags & FLAG_DIRTY) != 0) &&
View Full Code Here

          cipherManager = new CipherManager(salt, diskSalt);

          storeSize = raf.readLong();
          if(storeSize <= 0) throw new IOException("Bogus datastore size");
          prevStoreSize = raf.readLong();
          keyCount.set(raf.readLong());
          generation = raf.readInt();
          flags = raf.readInt();

          if (((flags & FLAG_DIRTY) != 0) &&
              // FIXME figure out a way to do this consistently!
View Full Code Here

            flags |= FLAG_REBUILD_BLOOM;

          try {
            raf.readInt(); // bloomFilterK
            raf.readInt(); // reserved
            raf.readLong(); // reserved
            long w = raf.readLong();
            writes.set(w);
            initialWrites = w;
            Logger.normal(this, "Set writes to saved value "+w);
            hits.set(raf.readLong());
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.