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();
    CursorOfIndexes cursor = new CursorOfIndexes(rowKey, batchSize, l, indexTableName, from, to);
    cursor.setupMore(db, colMeta);
    return cursor;
  }
View Full Code Here


  @Override
  public AbstractCursor<IndexColumn> scanIndex(ScanInfo scanInfo,
      List<byte[]> values, BatchListener list, MetaLookup mgr) {
    byte[] rowKey = scanInfo.getRowKey();
    String indexTableName = scanInfo.getIndexColFamily();
    DboColumnMeta colMeta = scanInfo.getColumnName();
    CursorForValues cursor = new CursorForValues(rowKey, list, indexTableName, values);
    cursor.setupMore(db, colMeta);
    return cursor;
  }
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();
    DirectCursor<byte[]> noSqlKeys = new TypedProxyWrappingCursor<Object>(idMeta, new IterableWrappingCursor<Object>(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

  public int count(String columnFamily, String indexedColName, Object value) {
    DboTableMeta meta = cachedMeta.getMeta(columnFamily);
    if(meta == null)
      throw new IllegalArgumentException("columnFamily="+columnFamily+" not found");
    DboColumnMeta colMeta = meta.getColumnMeta(indexedColName);
    if(colMeta == null)
      throw new IllegalArgumentException("Column="+indexedColName+" not found on meta info for column family="+columnFamily);
    else if(!colMeta.isIndexed())
      throw new IllegalArgumentException("Column="+indexedColName+" is not an indexed column");
    String query = "SELECT * FROM " +  columnFamily + " WHERE " + indexedColName + " = ";
    String valueString = new String();
    if (value != null) {
      if (value instanceof String)
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

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.