Package com.alvazan.orm.api.z5api

Examples of com.alvazan.orm.api.z5api.IndexColumnInfo


      //  rightResultsExhausted = true;
        break;
      } else if(batchSize != null && batchSize.intValue() < counter)
        break;
     
      IndexColumnInfo rightResult = rightHolder.getValue();
      ByteArray pk = rightResult.getPrimaryKey(rightView);
      values.add(pk.getKey());
      rightListResults.add(rightResult);
      counter++;
    }
   
View Full Code Here


  }

  private Holder<IndexColumnInfo> createResult(
      com.alvazan.orm.api.z8spi.iter.AbstractCursor.Holder<IndexColumn> next) {
    IndexColumn indCol = next.getValue();
    IndexColumnInfo info = new IndexColumnInfo();   
   
    if(cachedFromRightResults.hasNext()) {
      //We need to compare lastCachedRightSide with our incoming to make see if they pair up
      //or else move to the next right side answer.
      ByteArray pkOfRightView = lastCachedRightSide.getPrimaryKey(rightView);
      ByteArray valueOfLeft = new ByteArray(indCol.getIndexedValue());
      if(!valueOfLeft.equals(pkOfRightView)) {
        lastCachedRightSide = cachedFromRightResults.next();
      }   
 
      info.mergeResults(lastCachedRightSide);
    }
   
    info.putIndexNode(newView, indCol, colMeta);
    return new Holder<IndexColumnInfo>(info);
  }
View Full Code Here

    @Override
    public IterHolder<byte[]> nextImpl() {
      Holder<IndexColumnInfo> next = cursor.nextImpl();
      if(next == null)
        return null;
      IndexColumnInfo info = next.getValue();
      Wrapper wrapper = info.getIndexNode(view);
      IndexColumn indNode = wrapper.getCol();
      byte[] key = indNode.getPrimaryKey();
      if(key == null)
        throw new IllegalArgumentException("key was null, index data seems corrupt on view="+view+" col="
            +wrapper.getColMeta()+" some value is tied to a null primary key.  Should" +
View Full Code Here

  public Holder<IndexColumnInfo> nextImpl() {
    while(true) {
      Holder<IndexColumnInfo> nextFromCursor = leftResults.nextImpl();
      if(nextFromCursor == null)
        break;
      IndexColumnInfo next = nextFromCursor.getValue();

      if(cachedMap != null) {
        Holder<IndexColumnInfo> result = quickHashLookup(next);
        if(result != null)
          return result;
View Full Code Here

    Holder<IndexColumnInfo> matchedResult = null;
    while(true) {
      Holder<IndexColumnInfo> nextFromCursor = rightResults.nextImpl();
      if(nextFromCursor == null)
        break;
      IndexColumnInfo andedInfo = nextFromCursor.getValue();
      ByteArray key1 = next.getPrimaryKey(leftView);
      ByteArray key2 = andedInfo.getPrimaryKey(rightView);
      if(pkToRightSide.size() < 500)
        pkToRightSide.put(key2, andedInfo);
      if(matchedResult == null && key1.equals(key2)) {
        next.mergeResults(andedInfo);
        matchedResult = new Holder<IndexColumnInfo>(next);
View Full Code Here

    return matchedResult;
  }

  private Holder<IndexColumnInfo> quickHashLookup(IndexColumnInfo next) {
    ByteArray key1 = next.getPrimaryKey(leftView);
    IndexColumnInfo andedInfo = cachedMap.get(key1);
    if(andedInfo == null)
      return null;
    next.mergeResults(andedInfo);
    return new Holder<IndexColumnInfo>(next);
  }
View Full Code Here

      Holder<IndexColumnInfo> next = cursor.nextImpl();
      if(next == null)
        break;
     
     
      IndexColumnInfo index = next.getValue();
      for(ViewInfo info : eagerlyJoinedViews) {
        byte[] pk = index.getPrimaryKeyRaw(info);
        TwoLists twoLists = map.get(info);
        twoLists.getFullKeyList().add(pk);
        if(pk != null) {
          List<byte[]> list = twoLists.getListWithNoNulls();
          list.add(pk);
View Full Code Here

  private Holder<IndexColumnInfo> runInnerLoop(IndexColumnInfo next) {
    while(true) {
      Holder<IndexColumnInfo> nextFromCursor = rightResults.nextImpl();
      if(nextFromCursor == null)
        break;
      IndexColumnInfo andedInfo = nextFromCursor.getValue();
      ByteArray key1 = next.getPrimaryKey(leftView);
      ByteArray key2 = andedInfo.getPrimaryKey(rightView);
      if(key1.equals(key2)) {
        next.mergeResults(andedInfo);
        return new Holder<IndexColumnInfo>(next);
      }
    }
View Full Code Here

    if(holder == null)
      return null;
    IndexColumn indCol = holder.getValue();
    if(indCol == null)
      return new Holder<IndexColumnInfo>(null);
    IndexColumnInfo info = new IndexColumnInfo();
    info.putIndexNode(viewInfo, indCol, colMeta);
    return new Holder<IndexColumnInfo>(info);
  }
View Full Code Here

  public Holder<IndexColumnInfo> nextImpl() {
    while(true) {
      Holder<IndexColumnInfo> nextFromLeftCursor = leftResults.nextImpl();
      if(nextFromLeftCursor == null)
        break;
      IndexColumnInfo leftResult = nextFromLeftCursor.getValue();
      ByteArray pk = leftResult.getPrimaryKey(leftView);
      pksToAlreadyFound.put(pk, leftResult);
      return new Holder<IndexColumnInfo>(leftResult);
    }
   
    //NOW, as we go through the results on the right side, make sure we filter out
    //duplicate primary keys by checking ones that we already returned.
    while(true) {
      Holder<IndexColumnInfo> fromRightCursor = rightResults.nextImpl();
      if(fromRightCursor == null)
        break;
      IndexColumnInfo rightResult = fromRightCursor.getValue();
      IndexColumnInfo found = pksToAlreadyFound.get(rightResult.getPrimaryKey(rightView));
      if(found != null) {
        found.mergeResults(rightResult);
      } else {
        return new Holder<IndexColumnInfo>(rightResult);
      }
    }
   
View Full Code Here

TOP

Related Classes of com.alvazan.orm.api.z5api.IndexColumnInfo

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.