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

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


    }
    return false;
  }

  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 + " = ";
View Full Code Here


    //BEFORE Timer, let's get setup first
    Map<String, Object> props = new HashMap<String, Object>();
    props.put(Bootstrap.AUTO_CREATE_KEY, "create");
    Bootstrap.createAndAddBestCassandraConfiguration(props, clusterName, "PlayOrmPerfTest", host);
    NoSqlEntityManagerFactory factory = Bootstrap.create(DbTypeEnum.CASSANDRA, props, null, null);
    DboTableMeta table = setupMetaData(numColumns, factory);
   
    timer.schedule(new StopTask(), timeInMinutes*1000);
   
    for(int i = 0; i < NUM_THREADS; i++) {
      Runnable r = new SlamDataIn(factory, table, i);
View Full Code Here

    DboDatabaseMeta meta = mgr.find(DboDatabaseMeta.class, DboDatabaseMeta.META_DB_ROWKEY);
    if(meta != null) {
      meta = new DboDatabaseMeta();
    }

    DboTableMeta table = new DboTableMeta();
    table.setup(null, "testWrites", false);
   
    DboColumnIdMeta idMeta = new DboColumnIdMeta();
    idMeta.setup(table, "id", String.class, false);
   
    for(int i = 0; i < numColumns; i++) {
View Full Code Here

  }
 
  private void logInformationImpl(List<Action> actions) {
    String msg = "[rawlogger] Data being flushed to database in one go=";
    for(Action act : actions) {
      DboTableMeta cf = act.getColFamily();
      if(act instanceof Persist) {
        msg += "\nCF="+cf;
        Persist p = (Persist) act;
        String key = convert(cf, p.getRowKey());
        msg += " persist rowkey="+key;
View Full Code Here

  private String convert(RemoveIndex r) {
    String msg = "cf="+r.getColFamily()+")=";
    msg += "[rowkey="+StandardConverters.convertFromBytesNoExc(String.class, r.getRowKey())+"]";
   
    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) {
View Full Code Here

   
    String msg = cfAndIndex+"(in CF="+info.getIndexColFamily()+")";
    if(info.getEntityColFamily() == null)
      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)";
View Full Code Here

   
    String msg = cfAndIndex+"(in CF="+info.getIndexColFamily()+")";
    if(info.getEntityColFamily() == null)
      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)";
View Full Code Here

 
  public DirectCursor<IndexColumnInfo> getResultListImpl(Set<ViewInfo> alreadyJoinedViews) {
    ExpressionNode root = spiMeta.getASTTree();
    if(root == null) {
      ViewInfoImpl tableInfo = (ViewInfoImpl) spiMeta.getTargetViews().get(0);
      DboTableMeta tableMeta = tableInfo.getTableMeta();
      DboColumnMeta metaCol = tableMeta.getAnyIndex();
      ScanInfo scanInfo = createScanInfo(tableInfo, metaCol);

      alreadyJoinedViews.add(tableInfo);
      AbstractCursor<IndexColumn> scan = session.scanIndex(scanInfo, null, null, batchSize);
      return processKeys(tableInfo, null, scan);
View Full Code Here

    List<List<byte[]>> fullKeyLists = new ArrayList<List<byte[]>>();
   
    for(ViewInfo view : eagerlyJoinedViews) {
      TwoLists twoLists = map.get(view);
      List<byte[]> rowKeys = twoLists.getListWithNoNulls();
      DboTableMeta meta = view.getTableMeta();
      DirectCursor<KeyValue<TypedRow>> cursor = session.findAllImpl2(meta, null, rowKeys, query, batchSize);
      DirectCursor<KeyValue<TypedRow>> fillCursor = new CursorFillNulls(cursor, twoLists.getFullKeyList(), view);
      cursors.add(fillCursor);
      fullKeyLists.add(twoLists.getFullKeyList());
    }
View Full Code Here

  public Cursor<KeyValue<TypedRow>> getPrimaryViewCursor() {
    directCursor.beforeFirst();
    ViewInfo mainView = metaQuery.getTargetViews().get(0);
    Iterable<byte[]> indexIterable = new IterableCursorProxy(mainView, directCursor);

    DboTableMeta meta = mainView.getTableMeta();
    Cursor<KeyValue<TypedRow>> results = session.findAllImpl2(meta, null, indexIterable, metaQuery.getQuery(), batchSize);
   
    return results;
  }
View Full Code Here

TOP

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

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.