Package com.alvazan.orm.api.z8spi.action

Examples of com.alvazan.orm.api.z8spi.action.IndexColumn


    keyList = new ArrayList<byte[]>();
    while(true) {
      Holder<IndexColumn> holder = cursor.nextImpl();
      if(holder == null)
        break;
      IndexColumn val = holder.getValue();
      //NOTE: Here the indCol.getPrimaryKey is our owning entities primary key
      // and the indexedValue is the actual foreign key to the other table
      byte[] indexedValue = val.getIndexedValue();
      keyList.add(indexedValue);
      T proxy = convertIdToProxy(indexedValue, session);
      proxyList.add(proxy);
      if(proxyList.size() > batchSize)
        break;
View Full Code Here


    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

    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

  @Override
  public com.alvazan.orm.api.z8spi.iter.AbstractCursor.Holder<IndexColumn> nextImpl() {
    loadCache(false);
    if (cachedRows == null || !cachedRows.hasNext())
      return null;
    IndexColumn indexCol = convertToIndexCol(cachedRows.next());
    return new Holder<IndexColumn>(indexCol);
  }
View Full Code Here

  @Override
  public com.alvazan.orm.api.z8spi.iter.AbstractCursor.Holder<IndexColumn> previousImpl() {
    loadCache(true);
    if (cachedRows == null || !cachedRows.hasPrevious())
      return null;
    IndexColumn indexCol = convertToIndexCol(cachedRows.previous());
    return new Holder<IndexColumn>(indexCol);
  }
View Full Code Here

  }

  public static IndexColumn convertToIndexCol(KeyValue col) {
    byte[] pk = col.getQualifier();
    byte[] indValue = col.getValue();
    IndexColumn c = new IndexColumn();
    if (pk != null) {
      c.setPrimaryKey(pk);
    }
    if (indValue != null) {
      c.setIndexedValue(indValue);
    }
    c.setValue(null);
    return c;

  }
View Full Code Here

    @Override
    public com.alvazan.orm.api.z8spi.iter.AbstractCursor.Holder<IndexColumn> nextImpl() {
        loadCache(false);
        if (cachedRows == null || !cachedRows.hasNext())
            return null;
        IndexColumn indexCol = Cql3Util.convertToIndexCol(cachedRows.next(), indTable);
        return new Holder<IndexColumn>(indexCol);
    }
View Full Code Here

    @Override
    public com.alvazan.orm.api.z8spi.iter.AbstractCursor.Holder<IndexColumn> previousImpl() {
        loadCache(true);
        if (cachedRows == null || !cachedRows.hasPrevious())
            return null;
        IndexColumn indexCol = Cql3Util.convertToIndexCol(cachedRows.previous(), indTable);
        return new Holder<IndexColumn>(indexCol);
    }
View Full Code Here

  public Holder<IndexColumn> nextImpl() {
    if(batchListener != null)
      batchListener.beforeFetchingNextBatch();
    loadBatchIfNeeded();
    if(cachedLastCols != null && cachedLastCols.hasNext()) {
        IndexColumn indexedCol = cachedLastCols.next();      
      return new Holder<IndexColumn>(indexedCol);
    }
   
    while(true) {
      if(!theOneBatch.hasNext())
        return null;     

      Future<ResultSet> future = theOneBatch.next();
      ResultSet results = get(future)
      cachedLastCols = new ArrayList<IndexColumn>().listIterator();

      if(!results.isExhausted()) {
          com.datastax.driver.core.Row row = results.one();
          IndexColumn indexCol = Cql3Util.convertToIndexCol(row, indTable);
          cachedLastCols.add(indexCol);
        if(batchListener != null)
          batchListener.afterFetchingNextBatch(10);
        return new Holder<IndexColumn>(indexCol);
      }
View Full Code Here

  public Holder<IndexColumn> previousImpl() {
    if(batchListener != null)
      batchListener.beforeFetchingNextBatch();
    loadBatchIfNeeded();
    if(cachedLastCols != null && cachedLastCols.hasPrevious()) {
        IndexColumn indexedCol = cachedLastCols.previous();
      return new Holder<IndexColumn>(indexedCol);
    }
   
    while(true) {
      if(!theOneBatch.hasNext())
        return null;     
            Future<ResultSet> future = theOneBatch.next();
            ResultSet results = get(future);   
            cachedLastCols = new ArrayList<IndexColumn>().listIterator();

            while(cachedLastCols.hasNext())cachedLastCols.next();


      if(cachedLastCols.hasPrevious()) {
          IndexColumn indexCol = cachedLastCols.previous();
          if(batchListener != null)
          batchListener.afterFetchingNextBatch(10);
        return new Holder<IndexColumn>(indexCol);
      }
    }
View Full Code Here

TOP

Related Classes of com.alvazan.orm.api.z8spi.action.IndexColumn

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.