Examples of PageInputStream


Examples of lupos.datastructures.buffermanager.PageInputStream

  private V getMaximum(final int filename, final K arg0) {
    if (filename < 0) {
      return null;
    }
    try {
      final InputStream in = new PageInputStream(filename, this.pageManager);
      final boolean leaf = InputHelper.readLuposBoolean(in);
      if (leaf) { // leaf node reached!
        V lastTriple = null;
        K lastKey = null;
        while (true) {
          final DBBPTreeEntry<K, V> e = this.nodeDeSerializer
          .getNextLeafEntry(in, lastKey, lastTriple);
          if (e == null || e.key == null) {
            in.close();
            return lastTriple;
          }
          final K key = e.key;
          final int compare = this.comparator.compare(key, arg0);
          if (compare > 0) {
            in.close();
            return lastTriple;
          }
          if (e.value != null) {
            lastTriple = e.value;
            lastKey = e.key;
          }
        }
      } else {
        K lastKey = null;
        int lastFilename = -1;
        while (true) {
          final Tuple<K, Integer> nextEntry = this.getNextInnerNodeEntry(
              lastKey, in);
          if (nextEntry == null || nextEntry.getSecond() == 0
              || nextEntry.getSecond() < 0) {
            in.close();
            return null;
          }
          if (nextEntry.getFirst() == null) {
            in.close();
            return this.getMaximum(nextEntry.getSecond(), arg0);
          }
          final int compare = this.comparator.compare(
              nextEntry.getFirst(), arg0);
          if (compare > 0) {
            in.close();
            final V t = this.getMaximum(nextEntry.getSecond(), arg0);
            if (t != null) {
              return t;
            }
            if (lastFilename > 0) {
View Full Code Here

Examples of lupos.datastructures.buffermanager.PageInputStream

   *            Index of the DBNode
   * @return NodeInputStream to read from
   */
  protected NodeInputStream getInputStream(final int idx) {
    try {
      return new NodeInputStream(new PageInputStream(idx, this.pageManager));
    } catch (IOException e) {
      e.printStackTrace();
    }
   
    return null;
View Full Code Here

Examples of lupos.datastructures.buffermanager.PageInputStream

      if (filename < 0) {
        return null;
      }
      final InputStream fis;
      try {
        final InputStream in = new PageInputStream(filename, DBBPTree.this.pageManager);
        final boolean leaf = InputHelper.readLuposBoolean(in);
        if (leaf) { // leaf node reached!
          while (true) {
            final DBBPTreeEntry<K, V> e = DBBPTree.this.nodeDeSerializer
            .getNextLeafEntry(in, this.lastKey, this.lastTriple);
            if (e == null || e.key == null) {
              this.currentLeafIn = in;
              this.close();
              return null;
            }
            this.lastTriple = e.value;
            this.lastKey = e.key;
            final int compare = DBBPTree.this.comparator.compare(this.lastKey, this.arg0);
            if (compare == 0) {
              this.currentLeafIn = in;
              return e.value;
            } else if (compare > 0) {
              this.currentLeafIn = in;
              this.close();
              return null;
            }
          }
        } else {
          K lastKey = null;
          while (true) {
            final Tuple<K, Integer> nextEntry = DBBPTree.this.getNextInnerNodeEntry(
                lastKey, in);
            if (nextEntry == null || nextEntry.getSecond() == 0
                || nextEntry.getSecond() < 0) {
              in.close();
              this.close();
              return null;
            }
            if (nextEntry.getFirst() == null) {
              this.innerNodes.add(new Tuple<K, InputStream>(null, in));
View Full Code Here

Examples of lupos.datastructures.buffermanager.PageInputStream

      if (filename < 0) {
        return null;
      }
      final InputStream fis;
      try {
        final InputStream in = new PageInputStream(filename, DBBPTree.this.pageManager);
        final boolean leaf = InputHelper.readLuposBoolean(in);
        this.lastTriple = null;
        this.lastKey = null;
        if (leaf) { // leaf node reached!
          while (true) {
            final DBBPTreeEntry<K, V> e = DBBPTree.this.nodeDeSerializer
            .getNextLeafEntry(in, this.lastKey, this.lastTriple);
            if (e == null || e.key == null) {
              this.currentLeafIn = in;
              this.close();
              return null;
            }
            this.lastTriple = e.value;
            this.lastKey = e.key;
            final int compare = DBBPTree.this.comparator.compare(this.lastKey,
                triplekey);
            if (compare == 0) {
              this.currentLeafIn = in;
              return e.value;
            } else if (compare > 0) {
              if (DBBPTree.this.comparator.compare(this.lastKey, this.arg0) > 0) {
                this.currentLeafIn = in;
                this.close();
                return null;
              } else {
                this.currentLeafIn = in;
                return e.value;
              }
            }
          }
        } else {
          K lastKey = null;
          while (true) {
            final Tuple<K, Integer> nextEntry = DBBPTree.this.getNextInnerNodeEntry(
                lastKey, in);
            if (nextEntry == null || nextEntry.getSecond() <= 0) {
              in.close();
              this.close();
              return null;
            }
            lastKey = nextEntry.getFirst();
            if (nextEntry.getFirst() == null) {
View Full Code Here

Examples of lupos.datastructures.buffermanager.PageInputStream

          // next leaf node!
          if (e.filenameOfNextLeafNode >= 0) {
            this.currentLeafIn.close();
            this.lastTriple = null;
            this.lastKey = null;
            this.currentLeafIn = new PageInputStream(e.filenameOfNextLeafNode, DBBPTree.this.pageManager);
            // read over the leaf flag!
            InputHelper.readLuposBoolean(this.currentLeafIn);
            e = DBBPTree.this.nodeDeSerializer.getNextLeafEntry(this.currentLeafIn,
                this.lastKey, this.lastTriple);
            if (e == null || e.key == null) {
View Full Code Here

Examples of lupos.datastructures.buffermanager.PageInputStream

          // next leaf node!
          if (e.filenameOfNextLeafNode >= 0) {
            this.currentLeafIn.close();
            this.lastTriple = null;
            this.lastKey = null;
            this.currentLeafIn = new PageInputStream(e.filenameOfNextLeafNode, DBBPTree.this.pageManager);
            // read over the leaf flag!
            InputHelper.readLuposBoolean(this.currentLeafIn);
            e = DBBPTree.this.nodeDeSerializer.getNextLeafEntry(this.currentLeafIn, this.lastKey, this.lastTriple);
            if (e == null || e.key == null) {
              // should never happen!
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.