Package com.alvazan.orm.api.z5api

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


    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


    String colName = data.getColumn();
   
    int rowCounter = 0;
    int changedCounter = 0;
    while(indexView2.next()) {
      IndexPoint pt = indexView2.getCurrent();
     
      KeyValue<TypedRow> row = keyToRow.get(pt.getKey());
      if(row.getException() != null) {
        System.out.println("Entity with rowkey="+pt.getKeyAsString()+" does not exist, WILL remove from index");
        s.removeIndexPoint(pt, data.getPartitionBy(), data.getPartitionBy());
        changedCounter++;
      } else {
        TypedRow val = row.getValue();
       
        TypedColumn column = val.getColumn(colName);
        Object value = column.getValue();

        if(!valuesEqual(pt.getIndexedValue(), value)) {
          System.out.println("Entity with rowkey="+pt.getKeyAsString()+" has extra incorrect index point with value="+pt.getIndexedValueAsString()+" correct value should be="+column.getValueAsString());
          s.removeIndexPoint(pt, data.getPartitionBy(), data.getPartitionId());
         
          IndexColumn col = new IndexColumn();
          col.setColumnName(colName);
          col.setPrimaryKey(pt.getRawKey());
          byte[] indValue = column.getValueRaw();
          col.setIndexedValue(indValue);
          IndexPoint newPoint = new IndexPoint(pt.getRowKeyMeta(), col , data.getColumnMeta());
          s.addIndexPoint(newPoint, data.getPartitionBy(), data.getPartitionId());
          changedCounter++;
        }
      }
      rowCounter++;
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(indexView.next() && batchCounter < BATCH_SIZE) {
      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

    System.out.println("/"+cf+"/<AnyIndexedColumn>");
   
    int counter = 1;
    while(cursor.next()) {
      IndexColumnInfo current = cursor.getCurrent();
      IndexPoint pt = current.getKeyForView(oneView);
      String key = pt.getKeyAsString();
      System.out.println(firstPart+key);
      counter++;
    }
    System.out.println(counter+" Total Partitions");
  }
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.