Package org.fusesource.hawtjournal.api

Examples of org.fusesource.hawtjournal.api.Location


  }

  @Override
  public User getUser(int userId) {
    try {
      Location location = new Location();
      JournalUserStorage.MetaData metaData = metaDataList.get(userId);
      location.readExternal(ByteStreams.newDataInput(metaData.getLocation()));
      return User.fromByteBuffer(userJournal.read(location));
    } catch (IOException e) {
      throw new RuntimeException(e);
    }
  }
View Full Code Here


  }

  @Override
  public Event getEvent(long eventId) {
    try {
      Location location = new Location();
      JournalEventStorage.MetaData metaData = metaDataList.get(eventId);
      location.readExternal(ByteStreams.newDataInput(metaData.getLocation()));
      return Event.fromByteBuffer(eventJournal.read(location));
    } catch (IOException e) {
      throw new RuntimeException(e);
    }
  }
View Full Code Here

    }

    public Location decode(DataInput dataIn) throws IOException {
        int fileId = VarIntegerCodec.INSTANCE.decode(dataIn);
        int offset = VarIntegerCodec.INSTANCE.decode(dataIn);
        return new Location(fileId, offset);
    }
View Full Code Here

    public int getFixedSize() {
        return -1;
    }

    public Location deepCopy(Location source) {
        return new Location(source);
    }
View Full Code Here

TOP

Related Classes of org.fusesource.hawtjournal.api.Location

Copyright © 2018 www.massapicom. 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.