Package com.alvazan.orm.api.z8spi.meta

Examples of com.alvazan.orm.api.z8spi.meta.DboColumnMeta


    @Override
    public AbstractCursor<IndexColumn> scanIndex(ScanInfo scan, Key from, Key to, Integer batchSize, BatchListener l, MetaLookup mgr) {
        byte[] rowKey = scan.getRowKey();
        String indexTableName = scan.getIndexColFamily();
        DboColumnMeta colMeta = scan.getColumnName();
        DboTableMeta entityDbCollection = scan.getEntityColFamily();

        // Here we don't bother using an index at all since there is no where clause to begin with
        // ALSO, we don't want this code to be the case if we are doing a CursorToMany which has to
        // use an index so check the column type
View Full Code Here


  public void addMetaField(MetaField<T> field) {
    if(field == null)
      throw new IllegalArgumentException("field cannot be null");
    columnNameToField.put(field.getColumnName(), field);
   
    DboColumnMeta metaCol = field.getMetaDbo();
    if(metaCol.isIndexed())
      indexedColumns.add(field);
   
    if(metaCol.isPartitionedByThisColumn())
      partitionColumns.add(field);
  }
View Full Code Here

    String cf = data.getColFamily();
    String field = data.getColumn();
    String by = data.getPartitionBy();
    String id = data.getPartitionId();
        DboTableMeta meta = data.getTableMeta();
        DboColumnMeta colMeta = data.getColumnMeta();
        if (!colMeta.isIndexed()) {
            // check if it was indexed earlier and now not indexed. If yes, then remove the indices.
            // Issue #120
            System.out.println("The column " + field + " is not indexed");
            ScanInfo info = ScanInfo.createScanInfo(colMeta, by, id);
            DboTableMeta indexTableMeta = mgr.find(DboTableMeta.class, info.getIndexColFamily());
            System.out.println("Wait...we are checking if it was indexed earlier and removing all its old indexes.");
            mgr.getSession().remove(indexTableMeta, info.getRowKey());
            s.flush();
            return;
        }

    Cursor<IndexPoint> indexView = s.indexView(cf, field, by, id);
    Cursor<IndexPoint> indexView2 = s.indexView(cf, field, by, id);
   
    System.out.println("indexed value type="+colMeta.getStorageType());
    System.out.println("row key type="+meta.getIdColumnMeta().getStorageType());
    System.out.println("It is safe to kill this process at any time since it only removes duplicates");
    System.out.println("Beginning re-index");

    int totalChanges = 0;
View Full Code Here

      //It means column was deleted by user. Doing nothing as of now
      return false;
    }
    else {
      Object value = column.getValue();
      DboColumnMeta colMeta = data.getColumnMeta();
      if (value == null && colMeta instanceof DboColumnToOneMeta) {
        DboColumnToOneMeta one = (DboColumnToOneMeta) colMeta;
        value = one.convertFromStorage2(column.getCompositeSubName());
      }
      if(!valuesEqual(pt.getIndexedValue(), value)) {
View Full Code Here

    String id = data.getPartitionId();

    Cursor<IndexPoint> indexView = s.indexView(cf, field, by, id);

    DboTableMeta meta = data.getTableMeta();
    DboColumnMeta colMeta = data.getColumnMeta();
    System.out.println("indexed value type="+colMeta.getStorageType());
    System.out.println("row key type="+meta.getIdColumnMeta().getStorageType());
    System.out.println("<indexed value>.<row key>");

    int count = 0;
    while(indexView.next()) {
View Full Code Here

      }
      System.out.println("");
      throw new InvalidCommand("Column family meta not found for " + cf);
    }
   
    DboColumnMeta colMeta = meta.getColumnMeta(field);
    if(colMeta == null) {
      colMeta = meta.getIdColumnMeta();
      if(!(colMeta != null && colMeta.getColumnName().equals(field))) {
        System.out.println("Column= "+field+" not found on table "+cf);
        System.out.println("You can view index for following columns:");
        for(DboColumnMeta colMetaOther : meta.getIndexedColumns()) {
          System.out.println(colMetaOther.getColumnName());
        }
View Full Code Here

    try {
      DboTableMeta meta = r.getColFamily();
      if(meta == null)
        return msg+" (meta not found)";
      String colName = r.getColumn().getColumnName();
      DboColumnMeta colMeta = meta.getColumnMeta(colName);
      if(colMeta == null)
        return msg+" (table found, colmeta not found)";
   
      byte[] indexedValue = r.getColumn().getIndexedValue();
      byte[] pk = r.getColumn().getPrimaryKey();
      Object theId = meta.getIdColumnMeta().convertFromStorage2(pk);
      String idStr = meta.getIdColumnMeta().convertTypeToString(theId);
      Object valObj = colMeta.convertFromStorage2(indexedValue);
      String valStr = colMeta.convertTypeToString(valObj);
     
      return msg+"[indexval="+valStr+",to pk="+idStr+"]";
    } catch(Exception e) {
      if(log.isTraceEnabled())
        log.trace("excpetion logging", e);
View Full Code Here

      return msg + " (meta for main CF can't be looked up)";

    DboTableMeta meta = info.getEntityColFamily();
    if(meta == null)
      return msg + " (meta for main CF was not found)";
    DboColumnMeta colMeta = info.getColumnName();
    if(colMeta == null)
      return msg + " (CF meta found but columnMeta not found)";
   
    List<String> strVals = new ArrayList<String>();
    for(byte[] val : values) {
      Object fromObj = colMeta.convertFromStorage2(val);
      String str = colMeta.convertTypeToString(fromObj);
      strVals.add(str);
    }
    if (log.isInfoEnabled()) {
      msg+=" finding non-contiguous keys index rowkey="+rowKey+" for keys:"+strVals;
      log.info("[rawlogger]"+msg);
View Full Code Here

      return msg + " (meta for main CF can't be looked up)";

    DboTableMeta meta = info.getEntityColFamily();
    if(meta == null)
      return msg + " (meta for main CF was not found)";
    DboColumnMeta colMeta = info.getColumnName();
    if(colMeta == null)
      return msg + " (CF meta found but columnMeta not found)";
   
    String range = "";
    if(from != null) {
      Object fromObj = colMeta.convertFromStorage2(from.getKey());
      range += colMeta.convertTypeToString(fromObj);
      String firstSign = " < ";
      if(from.isInclusive())
        firstSign = " <= ";
      range += firstSign;
    }
    if(from != null || to != null)
      range += "VALUE";
    else
      range += "ALL DATA";
   
    if(to != null) {
      String secondSign = " < ";
      if(to.isInclusive())
        secondSign = " <= ";
      range += secondSign;
     
      Object toObj = colMeta.convertFromStorage2(to.getKey());
      String toStr = colMeta.convertTypeToString(toObj);
      range += toStr;
    }
   
    if (log.isInfoEnabled()) {
      msg+=" scanning index for value in range:"+range+" with batchSize="+batchSize;
View Full Code Here

    session.put(metaClass, virtualKey, cols);
  }
 
  @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();
   
View Full Code Here

TOP

Related Classes of com.alvazan.orm.api.z8spi.meta.DboColumnMeta

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.