Package com.alvazan.orm.api.z5api

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


    indexView2.beforeFirst();
    int rowCounter = 0;
    int changedCounter = 0;
    while(indexView2.next()) {
      rowCounter++;
      IndexPoint pt = indexView2.getCurrent();
     
      KeyValue<TypedRow> row = keyToRow.get(pt.getKey());
      if(row == null) {
        if(log.isDebugEnabled())
          log.debug("row is null for key="+pt.getKey());
        //We are iterating over two views in batch mode soooo
        //one batch may not have any of the keys of the other batch.  This is very normal
      } else if(row.getException() != null || row.getValue() == null) {
        removeIndexPt(s, data, pt);
        changedCounter++;
View Full Code Here


        IndexColumn col = new IndexColumn();
        col.setColumnName(colName);
        col.setPrimaryKey(pt.getRawKey());
        byte[] indValue = StandardConverters.convertToBytes(value);
        col.setIndexedValue(indValue);
        IndexPoint newPoint = new IndexPoint(pt.getRowKeyMeta(), col,data.getColumnMeta());
        s.addIndexPoint(newPoint, data.getPartitionBy(), data.getPartitionId());
        return true;
      }
    }
    return false;
View Full Code Here

  private Map<Object, KeyValue<TypedRow>> findNextSetOfData(
      NoSqlTypedSession s, String cf, Cursor<IndexPoint> indexView) {
    int batchCounter = 0;
    List<Object> keys = new ArrayList<Object>();
    while(batchCounter < BATCH_SIZE && indexView.next()) {
      IndexPoint current = indexView.getCurrent();
      keys.add(current.getKey());
      batchCounter++;
    }
   
    Map<Object, KeyValue<TypedRow>> keyToRow = new HashMap<Object, KeyValue<TypedRow>>();
    Cursor<KeyValue<TypedRow>> cursor = s.createFindCursor(cf, keys, BATCH_SIZE);
    while(cursor.next()) {
      KeyValue<TypedRow> current = cursor.getCurrent();
      keyToRow.put(current.getKey(), current);
    }
    return keyToRow;
  }
View Full Code Here

    System.out.println("row key type="+meta.getIdColumnMeta().getStorageType());
    System.out.println("<indexed value>.<row key>");

    int count = 0;
    while(indexView.next()) {
      IndexPoint current = indexView.getCurrent();
      String indVal = current.getIndexedValueAsString();
      if(indVal == null)
        indVal = "";
      String key = current.getKeyAsString();
      System.out.println(count+" "+indVal+"."+key);
      count++;
    }
    System.out.println(count+" Columns Total")
  }
View Full Code Here

    //IF a table is partitioned multiple ways, you MUST supply partitionBy and you can supply a partitionId or null for null partition
    Cursor<IndexPoint> cursor = s.indexView("Activity", "numTimes", null, null);
   
    List<IndexPoint> points = new ArrayList<IndexPoint>();
    while(cursor.next()) {
      IndexPoint pt = cursor.getCurrent();
      points.add(pt);
    }
   
    log.info("All index values together are="+points);
    Assert.assertEquals("10", points.get(0).getIndexedValueAsString());
View Full Code Here

  }
 
  private void compareKeys2(Cursor<IndexColumnInfo> cursor, ViewInfo viewAct,
      String expectedKey) {
    IndexColumnInfo info = cursor.getCurrent();
    IndexPoint keyForActivity = info.getKeyForView(viewAct);
    String key = keyForActivity.getKeyAsString();
    Assert.assertEquals(expectedKey, key);
  }
View Full Code Here

      Assert.assertEquals("acc1", theJoinedRow2.getRowKey());
  }
 
  private void compareKeys(Cursor<IndexColumnInfo> cursor, ViewInfo viewAct, ViewInfo viewAcc, String expectedKey, String expectedAccKey) {
    IndexColumnInfo info = cursor.getCurrent();
    IndexPoint keyForActivity = info.getKeyForView(viewAct);
    String key = keyForActivity.getKeyAsString();
   
    String keyAcc = null;
    if(expectedAccKey != null) {
      IndexPoint keyForAccount = info.getKeyForView(viewAcc);
      keyAcc = keyForAccount.getKeyAsString();
    }
   
    Assert.assertEquals(expectedKey, key);
    Assert.assertEquals(expectedAccKey, keyAcc);
  }
View Full Code Here

    Holder<IndexColumn> next = indCol.nextImpl();
    if(next == null)
      return null;
   
    IndexColumn col = next.getValue();
    IndexPoint p = new IndexPoint(idMeta, col, valueMeta);
    return new Holder<IndexPoint>(p);
  }
View Full Code Here

    indexView2.beforeFirst();
    int rowCounter = 0;
    int changedCounter = 0;
    while(indexView2.next()) {
      rowCounter++;
      IndexPoint pt = indexView2.getCurrent();
     
      KeyValue<TypedRow> row = keyToRow.get(pt.getKey());
      if(row == null) {
        if(log.isDebugEnabled())
          log.debug("row is null for key="+pt.getKey());
        //We are iterating over two views in batch mode soooo
        //one batch may not have any of the keys of the other batch.  This is very normal
      } else if(row.getException() != null || row.getValue() == null) {
        removeIndexPt(s, data, pt);
        changedCounter++;
View Full Code Here

        col.setColumnName(colName);
        col.setPrimaryKey(pt.getRawKey());
        col.setTtl(typedRow.getRowTtl());
        byte[] indValue = StandardConverters.convertToBytes(value);
        col.setIndexedValue(indValue);
        IndexPoint newPoint = new IndexPoint(pt.getRowKeyMeta(), col,data.getColumnMeta());
        s.addIndexPoint(newPoint, data.getPartitionBy(), data.getPartitionId());
        return true;
      }
    }
    return false;
View Full Code Here

TOP

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

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.