Package com.alvazan.orm.api.z8spi

Examples of com.alvazan.orm.api.z8spi.ScanInfo


    ExpressionNode root = spiMeta.getASTTree();
    if(root == null) {
      ViewInfoImpl tableInfo = (ViewInfoImpl) spiMeta.getTargetViews().get(0);
      DboTableMeta tableMeta = tableInfo.getTableMeta();
      DboColumnMeta metaCol = tableMeta.getAnyIndex(indexedColumn);
      ScanInfo scanInfo = createScanInfo(tableInfo, metaCol);

      alreadyJoinedViews.add(tableInfo);
      AbstractCursor<IndexColumn> scan = session.scanIndex(scanInfo, null, null, batchSize);
      return processKeys(tableInfo, null, scan);
    }
View Full Code Here


      byte[] partId = retrieveValue(colMeta, (ExpressionNode) partitionMeta.getNode());
      Object partIdObj = colMeta.convertFromStorage2(partId);
      partitionId = colMeta.convertTypeToString(partIdObj);
    }

    ScanInfo scanInfo = ScanInfo.createScanInfo(metaCol, partitionBy, partitionId);
    return scanInfo;
  }
View Full Code Here

      //We need to proxy the right results to translate to the same primary key as the
      //left results and our And and Or Cursor can then take care of the rest
      JoinInfo joinInfo = root.getJoinMeta().getPrimaryJoinInfo();
      ViewInfoImpl newView = joinInfo.getPrimaryTable();
      DboColumnMeta col = joinInfo.getPrimaryCol();
      ScanInfo scanInfo = createScanInfo(newView, col);
      //FROM an ORM perspective, we join to smaller tables in general as we don't want to blow out memory so do the
      //join first(ie. we process left sides first in and and or cursors)
      CursorForJoin temp = new CursorForJoin(newView, leftView, leftResults, joinType);
      temp.setColMeta(col);
      temp.setScanInfo(scanInfo);
View Full Code Here

      attr = (StateAttribute) root.getChild(ChildSide.LEFT).getState();
    }
   
    DboColumnMeta info = attr.getColumnInfo();
    ViewInfoImpl viewInfo = attr.getViewInfo();   
    ScanInfo scanInfo = createScanInfo(viewInfo, info);
    alreadyJoinedViews.add(viewInfo);
   
    if(info.isIndexed()) {
      //its an indexed column
      return processIndexColumn(root, scanInfo, viewInfo, info);
View Full Code Here

  }
 
  @Override
  public void removeIndexPoint(IndexPoint pt, String partitionBy, String partitionId) {
    DboColumnMeta colMeta = pt.getColumnMeta();
    ScanInfo info = ScanInfo.createScanInfo(colMeta, partitionBy, partitionId);
    byte[] rowKey = info.getRowKey();
    String indColFamily = info.getIndexColFamily();
    DboTableMeta cf = info.getEntityColFamily();
   
    IndexColumn col = new IndexColumn();
    col.setIndexedValue(pt.getRawIndexedValue());
    col.setPrimaryKey(pt.getRawKey());
    session.removeFromIndex(cf, indColFamily, rowKey, col);
View Full Code Here

    col.setPrimaryKey(pt.getRawKey());
    session.removeFromIndex(cf, indColFamily, rowKey, col);
  }
  public void addIndexPoint(IndexPoint pt, String partitionBy, String partitionId) {
    DboColumnMeta colMeta = pt.getColumnMeta();
    ScanInfo info = ScanInfo.createScanInfo(colMeta, partitionBy, partitionId);
    byte[] rowKey = info.getRowKey();
    String indColFamily = info.getIndexColFamily();
    DboTableMeta cf = info.getEntityColFamily();
   
    IndexColumn col = new IndexColumn();
    col.setIndexedValue(pt.getRawIndexedValue());
    col.setPrimaryKey(pt.getRawKey());
    session.persistIndex(cf, indColFamily, rowKey, col);
View Full Code Here

    else if(!colMeta.isIndexed())
      throw new IllegalArgumentException("Column="+column+" is not an indexed column");
    else if(meta.getPartitionedColumns().size() > 1 && partitionBy == null)
      throw new IllegalArgumentException("Must supply partitionBy parameter BECAUSE this column family="+columnFamily+" is partitioned multiple ways");
   
    ScanInfo info = ScanInfo.createScanInfo(colMeta, partitionBy, partitionId);
    AbstractCursor<IndexColumn> indCol = session.scanIndex(info, null, null, null);
    AbstractCursor<IndexPoint> results = new CursorToIndexPoint(meta.getIdColumnMeta(), colMeta, indCol);
    return results;
  }
View Full Code Here

  public void translateFromColumn(Row row, OWNER entity, NoSqlSession session) {
    String indexColFamily = getMetaDbo().getIndexTableName();
    String rowKey = formRowKey(row.getKey());
   
    byte[] key = StandardConverters.convertToBytes(rowKey);
    ScanInfo info = new ScanInfo(ownerMeta.getMetaDbo(), getMetaDbo(), indexColFamily, key);
    int batchSize = 200;
    AbstractCursor<IndexColumn> indexCursor = session.scanIndex(info , null, null, batchSize);
   
    CursorProxy<PROXY> cursor = new CursorProxy<PROXY>(entity, session, indexCursor, classMeta, batchSize);
    ReflectionUtil.putFieldValue(entity, field, cursor);
View Full Code Here

    ExpressionNode root = spiMeta.getASTTree();
    if(root == null) {
      ViewInfoImpl tableInfo = (ViewInfoImpl) spiMeta.getTargetViews().get(0);
      DboTableMeta tableMeta = tableInfo.getTableMeta();
      DboColumnMeta metaCol = tableMeta.getAnyIndex();
      ScanInfo scanInfo = createScanInfo(tableInfo, metaCol);

      alreadyJoinedViews.add(tableInfo);
      AbstractCursor<IndexColumn> scan = session.scanIndex(scanInfo, null, null, batchSize);
      return processKeys(tableInfo, null, scan);
    }
View Full Code Here

      byte[] partId = retrieveValue(colMeta, (ExpressionNode) partitionMeta.getNode());
      Object partIdObj = colMeta.convertFromStorage2(partId);
      partitionId = colMeta.convertTypeToString(partIdObj);
    }

    ScanInfo scanInfo = ScanInfo.createScanInfo(metaCol, partitionBy, partitionId);
    return scanInfo;
  }
View Full Code Here

TOP

Related Classes of com.alvazan.orm.api.z8spi.ScanInfo

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.