Package lupos.datastructures.buffermanager

Examples of lupos.datastructures.buffermanager.PageManager


  private final Triple<V, Long, Long> getElement(final long address) {
    final int pagenumber = (int) (address / PageManager.getDefaultPageSize());
    final int index = (int) (address % PageManager.getDefaultPageSize());
    try {
      final InputStream in = new ContinousPagesInputStream(pagenumber, new PageManager(this.valuesFilename, false, false), index);
      final long numberOfElements = InputHelper.readLuposLong(in);
      final long addressOfNextElement = InputHelper.readLuposLong(in);
      final V element = Registration.deserializeWithoutId(this.classOfValues, in);
      in.close();
      return new Triple<V, Long, Long>(element, numberOfElements, addressOfNextElement);
View Full Code Here


      final File f = new File(DBBPTree.mainFolder);
      f.mkdirs();
      if(this.currentID==0){
        FileHelper.deleteFilesStartingWithPattern(DBBPTree.mainFolder, this.currentID + ".dbbptree_");
      }
      this.pageManager = new PageManager(DBBPTree.mainFolder + this.currentID + ".dbbptree");
    } finally {
      lock.unlock();
    }

    if (comparator == null) {
View Full Code Here

    FileHelper.deleteFile(DBBPTree.mainFolder+this.currentID+ ".dbbptree_*");
    final File f = new File(DBBPTree.mainFolder);
    f.mkdirs();
    try {
      this.pageManager.close();
      this.pageManager = new PageManager(DBBPTree.mainFolder + this.currentID
          + ".dbbptree");
    } catch (final IOException e) {
      System.err.println(e);
      e.printStackTrace();
    }
View Full Code Here

    this.firstLeafPage = firstLeafFileName;
    this.keyClass = keyClass;
    this.valueClass = valueClass;
    this.currentID = currentID;
    this.nodeDeSerializer = nodeDeSerializer;
    this.pageManager = new PageManager(DBBPTree.mainFolder + currentID + ".dbbptree", false);
  }
View Full Code Here

   * @param pageSize
   *            The number of bytes in a page to be stored on disk
   * @throws IOException
   */
  public NodeManager(final Trie trie, final String fileName, final int bufferSize, final int pageSize) throws IOException {
    this.pageManager = new PageManager(fileName, pageSize);

    // If the given file contains data at page 1, it can be assumed that the
    // root node of a trie is stored on that page
    if (!this.isEmpty(1)){
      this.pageManager.initAfterLoading();
View Full Code Here

   * @param filename the filename under which this collection is stored!
   * @throws IOException
   */
  public PagedCollection(final String filename, final Class<? extends E> classname) throws IOException {
    this.filename = filename;
    this.pageManager = new PageManager(this.filename, false);
    final byte[] page = this.pageManager.getPage(0);
    final InputStream in = new ByteArrayInputStream(page, 0, 12);
    this.size = InputHelper.readLuposInteger(in);
    this.endOfCollection = InputHelper.readLuposLong(in);
    in.close();
View Full Code Here

TOP

Related Classes of lupos.datastructures.buffermanager.PageManager

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.