Package com.alvazan.orm.api.z8spi

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


  @Override
  public AbstractCursor<IndexColumn> scanIndex(ScanInfo scanInfo, List<byte[]> values, BatchListener list, MetaLookup mgr) {
    List<IndexColumn> results = new ArrayList<IndexColumn>();
    for(byte[] val : values) {
      Key from = new Key(val, true);
      Key to = new Key(val, true);
      Collection<IndexColumn> iter = scanIndexImpl(scanInfo, from, to, null, null);
      results.addAll(iter);
    }
    return new ProxyTempCursor<IndexColumn>(results);
  }
View Full Code Here


  private DirectCursor<IndexColumnInfo> processIndexColumn(ExpressionNode root, ScanInfo scanInfo, ViewInfoImpl viewInfo, DboColumnMeta info) {
    AbstractCursor<IndexColumn> scan;
    if(root.getType() == NoSqlLexer.EQ) {
      byte[] data = retrieveValue(info, root.getChild(ChildSide.RIGHT));
      Key key = new Key(data, true);
      scan = session.scanIndex(scanInfo, key, key, batchSize);
    } else if(root.getType() == NoSqlLexer.GT
        || root.getType() == NoSqlLexer.GE
        || root.getType() == NoSqlLexer.LT
        || root.getType() == NoSqlLexer.LE
        || root.isInBetweenExpression()) {
      Key from = null;
      Key to = null;
      if(root.isInBetweenExpression()) {
        ExpressionNode node = root.getGreaterThan();
        ExpressionNode node2 = root.getLessThan();
        from = createLeftKey(node, info);
        to = createRightKey(node2, info);
View Full Code Here

  }

  private Key createRightKey(ExpressionNode node, DboColumnMeta info) {
    byte[] data = retrieveValue(info, node.getChild(ChildSide.RIGHT));
    if(node.getType() == NoSqlLexer.LT)
      return new Key(data, false);
    else if(node.getType() == NoSqlLexer.LE)
      return new Key(data, true);
    else
      throw new RuntimeException("bug, should never happen, but should be easy to fix this one");
  }
View Full Code Here

  }

  private Key createLeftKey(ExpressionNode node, DboColumnMeta info) {
    byte[] data = retrieveValue(info, node.getChild(ChildSide.RIGHT));
    if(node.getType() == NoSqlLexer.GT)
      return new Key(data, false);
    else if(node.getType() == NoSqlLexer.GE)
      return new Key(data, true);
    else
      throw new RuntimeException("bug, should never happen, but should be easy to fix this one. type="+node.getType())
  }
View Full Code Here

    alreadyJoinedViews.add(viewInfo);
   
    AbstractCursor<IndexColumn> scan;
    if(root.getType() == NoSqlLexer.EQ) {
      byte[] data = retrieveValue(info, root.getChild(ChildSide.RIGHT));
      Key key = new Key(data, true);
      scan = session.scanIndex(scanInfo, key, key, batchSize);
    } else if(root.getType() == NoSqlLexer.GT
        || root.getType() == NoSqlLexer.GE
        || root.getType() == NoSqlLexer.LT
        || root.getType() == NoSqlLexer.LE
        || root.isInBetweenExpression()) {
      Key from = null;
      Key to = null;
      if(root.isInBetweenExpression()) {
        ExpressionNode node = root.getGreaterThan();
        ExpressionNode node2 = root.getLessThan();
        from = createLeftKey(node, info);
        to = createRightKey(node2, info);
View Full Code Here

  }

  private Key createRightKey(ExpressionNode node, DboColumnMeta info) {
    byte[] data = retrieveValue(info, node.getChild(ChildSide.RIGHT));
    if(node.getType() == NoSqlLexer.LT)
      return new Key(data, false);
    else if(node.getType() == NoSqlLexer.LE)
      return new Key(data, true);
    else
      throw new RuntimeException("bug, should never happen, but should be easy to fix this one");
  }
View Full Code Here

  }

  private Key createLeftKey(ExpressionNode node, DboColumnMeta info) {
    byte[] data = retrieveValue(info, node.getChild(ChildSide.RIGHT));
    if(node.getType() == NoSqlLexer.GT)
      return new Key(data, false);
    else if(node.getType() == NoSqlLexer.GE)
      return new Key(data, true);
    else
      throw new RuntimeException("bug, should never happen, but should be easy to fix this one. type="+node.getType())
  }
View Full Code Here

    Keyspace keyspace = columnFamilies.getKeyspace();
   
    List<Future<OperationResult<ColumnList<byte[]>>>> futures = new ArrayList<Future<OperationResult<ColumnList<byte[]>>>>();

    for(byte[] val : values) {
      Key from = new Key(val, true);
      Key to = new Key(val, true);
      byte[] rowKey = scanInfo.getRowKey();
     
      CompositeRangeBuilder range = CassandraSession.setupRangeBuilder(from, to, info1, reverse);
      ColumnFamilyQuery query = keyspace.prepareQuery(cf);
      RowQuery<byte[], byte[]> rowQuery = query.getKey(rowKey).withColumnRange(range);
View Full Code Here

  private DirectCursor<IndexColumnInfo> processIndexColumn(ExpressionNode root, ScanInfo scanInfo, ViewInfoImpl viewInfo, DboColumnMeta info) {
    AbstractCursor<IndexColumn> scan;
    if(root.getType() == NoSqlLexer.EQ) {
      byte[] data = retrieveValue(info, root.getChild(ChildSide.RIGHT));
      Key key = new Key(data, true);
      scan = session.scanIndex(scanInfo, key, key, batchSize);
    } else if(root.getType() == NoSqlLexer.GT
        || root.getType() == NoSqlLexer.GE
        || root.getType() == NoSqlLexer.LT
        || root.getType() == NoSqlLexer.LE
        || root.isBetweenExpression()) {
      Key from = null;
      Key to = null;
      if(root.isBetweenExpression()) {
        ExpressionNode node = root.getGreaterThan();
        ExpressionNode node2 = root.getLessThan();
        from = createLeftKey(node, info);
        to = createRightKey(node2, info);
View Full Code Here

  }

  private Key createRightKey(ExpressionNode node, DboColumnMeta info) {
    byte[] data = retrieveValue(info, node.getChild(ChildSide.RIGHT));
    if(node.getType() == NoSqlLexer.LT)
      return new Key(data, false);
    else if(node.getType() == NoSqlLexer.LE)
      return new Key(data, true);
    else
      throw new RuntimeException("bug, should never happen, but should be easy to fix this one");
  }
View Full Code Here

TOP

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

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.