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

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


  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


    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);
    }
   
    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;
    }
   
    msg+=" scanning index for value in range:"+range+" with batchSize="+batchSize;
    log.info("[rawlogger]"+msg);
View Full Code Here

      throw new IllegalArgumentException("parameter='" + name
          + "' is not found in the query="+meta.getQuery());
    } else if(typeInfo.getConstantType() != null)
      throw new UnsupportedOperationException("not done here yet, need to validate constant type");

    DboColumnMeta metaFieldDbo = typeInfo.getColumnInfo();
    String colFamily = metaFieldDbo.getOwner().getColumnFamily();
    String columnName = metaFieldDbo.getColumnName();
    MetaClass metaClass = metaInfo.getMetaClass(colFamily);
    MetaField metaField = metaClass.getMetaFieldByCol(columnName);
   
    Field field = metaField.getField();
    Class fieldType = field.getType();
View Full Code Here

    }
  }

  private void printColumns(TypedRow r, DboTableMeta meta) {
    for(TypedColumn c : r.getColumnsAsColl()) {
      DboColumnMeta colMeta = meta.getColumnMeta(c.getName());
      if(colMeta != null) {
        String fullName = c.getName();
        String val = c.getValueAsString();
        println("=> "+fullName+" = "+val);
      } else {
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

    col.setIndexedValue(pt.getRawIndexedValue());
    col.setPrimaryKey(pt.getRawKey());
    session.removeFromIndex(cf, indColFamily, rowKey, col);
  }
  public void addIndexPoint(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

    if(keys == null)
      throw new IllegalArgumentException("keys list cannot be null");
    DboTableMeta meta = cachedMeta.getMeta(colFamily);
    if(meta == null)
      throw new IllegalArgumentException("Meta for columnfamily="+colFamily+" was not found");
    DboColumnMeta idMeta = meta.getIdColumnMeta();
    Iterable<byte[]> noSqlKeys = new IterableTypedProxy<Object>(idMeta, keys);
    return findAllImpl2(meta, keys, noSqlKeys, null, batchSize);
  }
View Full Code Here

  public Cursor<IndexPoint> indexView(String columnFamily, String column,
      String partitionBy, String partitionId) {
    DboTableMeta meta = cachedMeta.getMeta(columnFamily);
    if(meta == null)
      throw new IllegalArgumentException("columnFamily="+columnFamily+" not found");
    DboColumnMeta colMeta = meta.getColumnMeta(column);
    if(colMeta == null)
      throw new IllegalArgumentException("Column="+column+" not found on meta info for column family="+columnFamily);
    else if(!colMeta.isIndexed())
      throw new IllegalArgumentException("Column="+column+" is not an indexed column");
    else if(meta.getPartitionedColumns().size() > 1 && partitionBy == null)
      throw new IllegalArgumentException("Must supply partitionBy parameter BECAUSE this column family="+columnFamily+" is partitioned multiple ways");
   
    ScanInfo info = ScanInfo.createScanInfo(colMeta, partitionBy, partitionId);
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.