Package lupos.datastructures.buffermanager

Examples of lupos.datastructures.buffermanager.PageOutputStream


    protected void init(final Triple leftKey) {
      try {
        if (this.out != null) {
          this.out.close();
        }
        this.out = new PageOutputStream(this.filename,
            LazyLiteralTripleKeyDBBPTreeStatistics.this.pageManager, true);
        OutHelper.writeLuposBoolean(this.leaf, this.out);
        this.lastKey = null;
        this.lastValue = null;
        this.numberOfTriples = 0;
View Full Code Here


    return result + s + "\n-> " + this.nextLeafNode;
  }

  public void writeLeafNode(final boolean overwrite) {
    try {
      final OutputStream out = new PageOutputStream(this.filename, this.pageManager, !overwrite);
      OutHelper.writeLuposBoolean(true, out);
      final Iterator<V> it = this.readValues.iterator();
      V lastValue = null;
      K lastKey = null;
      for (final K k : this.readKeys) {
        final V v = it.next();
        this.writeLeafEntry(k, v, lastKey, lastValue, out);
        lastKey = k;
        lastValue = v;
      }
      if (this.nextLeafNode != null) {
        this.nodeDeSerializer.writeLeafEntryNextFileName(this.nextLeafNode, out);
      }
      out.close();
    } catch (final IOException e) {
      System.err.println(e);
      e.printStackTrace();
    }
  }
View Full Code Here

    this.readReferences = readReferences;
  }

  public void writeInnerNode(final boolean overwrite) {
    try {
      final OutputStream out = new PageOutputStream(this.filename, this.pageManager, !overwrite);
      OutHelper.writeLuposBoolean(false, out);

      K lastKey = null;
      final Iterator<Integer> it = this.readReferences.iterator();
      for (final K k : this.readKeys) {
        this.nodeDeSerializer
            .writeInnerNodeEntry(it.next(), k, out, lastKey);
        lastKey = k;
      }
      if (it.hasNext()) {
        this.nodeDeSerializer.writeInnerNodeEntry(it.next(), out);
      }
      out.close();
    } catch (final IOException e) {
      System.err.println(e);
      e.printStackTrace();
    }
  }
View Full Code Here

    if (this.rootPage < 0 || this.size == 0) {
      // just create one new leaf node as root node of the B+-tree...
      this.rootPage = this.newFilename();
      this.firstLeafPage = this.rootPage;
      try {
        final OutputStream outRoot = new PageOutputStream(this.rootPage, this.pageManager, true);
        OutHelper.writeLuposBoolean(true, outRoot);
        this.writeLeafEntry(arg0, arg1, outRoot, null, null);
        this.size = 1;
        outRoot.close();
      } catch (final FileNotFoundException e) {
        System.err.println(e);
        e.printStackTrace();
        this.rootPage = -1;
        this.firstLeafPage = -1;
View Full Code Here

   *            Index of the DBNode
   * @return NodeOutputStream to write to
   */
  protected NodeOutputStream getOutputStream(final int idx) {
    try {
      return new NodeOutputStream(new PageOutputStream(idx, this.pageManager));
    } catch (IOException e) {
      e.printStackTrace();
    }
   
    return null;
View Full Code Here

    protected void init() {
      try {
        if (this.out != null) {
          this.out.close();
        }
        this.out = new PageOutputStream(this.filename, DBBPTree.this.pageManager, true);
        OutHelper.writeLuposBoolean(this.leaf,this.out);
        this.lastKey = null;
        this.lastValue = null;
      } catch (final FileNotFoundException e) {
        e.printStackTrace();
View Full Code Here

TOP

Related Classes of lupos.datastructures.buffermanager.PageOutputStream

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.