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

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


        if(info != null) {
          return cfNameToCassandra.get(cfName);
        }
      }

      DboTableMeta table = loadFromInMemoryOrDb(virtCf, lookup);
     
      String realCf = table.getRealColumnFamily();

      String realCfLower = realCf.toLowerCase();
      Info info = cfNameToCassandra.get(realCfLower);
      if(info != null) {
        if (log.isInfoEnabled())
View Full Code Here


  }

  private DboTableMeta loadFromInMemoryOrDb(String virtCf, MetaLookup lookup) {
    if (log.isInfoEnabled())
      log.info("looking up meta="+virtCf+" so we can add table to memory(one time operation)");
    DboTableMeta meta = dbMetaFromOrmOnly.getMeta(virtCf);
    if(meta != null) {
      if (log.isInfoEnabled())
        log.info("found meta="+virtCf+" locally");
      return meta;
    }
   
    DboTableMeta table = lookup.find(DboTableMeta.class, virtCf);
    if(table == null)
      throw new IllegalArgumentException("We can't load the meta for virtual or real CF="+virtCf+" because there is not meta found in DboTableMeta table");
    if (log.isInfoEnabled())
      log.info("found meta="+virtCf+" in database");
    return table;
View Full Code Here

    String keysp = keyspace.getKeyspaceName();
    if (log.isInfoEnabled())
      log.info("CREATING column family="+virtualCf+" in cassandra keyspace="+keysp);
   
    DboTableMeta meta = loadFromInMemoryOrDb(virtualCf, ormSession);
    if (log.isInfoEnabled())
      log.info("CREATING REAL cf="+meta.getRealColumnFamily()+" (virtual CF="+meta.getRealVirtual()+")");

    createColFamilyInCassandra(meta);
  }
View Full Code Here

      return table;
   
    if (log.isInfoEnabled())
      log.info("CREATING column family="+colFamily+" in the in memory nosql store");
     
    DboTableMeta cf = dbMetaFromOrmOnly.getMeta(colFamily);
    if(cf == null) {
      //check the database now for the meta since it was not found in the ORM meta data.  This is for
      //those that are modifying meta data themselves
      //DboDatabaseMeta db = mgr.find(DboDatabaseMeta.class, DboDatabaseMeta.META_DB_ROWKEY);
      cf = mgr.find(DboTableMeta.class, colFamily);
      if (log.isInfoEnabled())
        log.info("cf from db="+cf);
      //cf = db.getMeta(colFamily);
    }
   
    if(cf == null) {
      throw new IllegalStateException("Column family='"+colFamily+"' was not found AND we looked up meta data for this column" +
          " family to create it AND we could not find that data so we can't create it for you");
    }

    SortType sortType;
    StorageTypeEnum prefixType = cf.getColNamePrefixType();
    if(prefixType == null) {
      switch (cf.getNameStorageType()) {
      case BYTES:
        sortType = SortType.BYTES;
        break;
      case DECIMAL:
        sortType = SortType.DECIMAL;
        break;
      case INTEGER:
        sortType = SortType.INTEGER;
        break;
      case STRING:
        sortType = SortType.UTF8;
        break;
      default:
        throw new UnsupportedOperationException("type not supported="+cf.getNameStorageType());
      }
    } else {
      switch(prefixType) {
      case DECIMAL:
        sortType = SortType.DECIMAL_PREFIX;
View Full Code Here

    private static void processBatch(Cursor<List<TypedRow>> cursor) {
        while(cursor.next()) {
            List<TypedRow> joinedRow = cursor.getCurrent();
            for(TypedRow r: joinedRow) {
                if (r!=null){             
                    DboTableMeta meta = r.getView().getTableMeta();
                    DboColumnIdMeta idColumnMeta = meta.getIdColumnMeta();
                    String columnName = idColumnMeta.getColumnName();
                    System.out.println("RowKey:"+r.getRowKeyString()+" ("+columnName+")");
                    for(TypedColumn c : r.getColumnsAsColl()) {
                        DboColumnMeta colMeta = c.getColumnMeta();
                        if(colMeta != null) {
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

  private void fillInThisOneInstance(T self) {
    MetaIdField<T> idField = classMeta.getIdField();
    Converter converter = idField.getConverter();
    byte[] nonVirtKey = converter.convertToNoSql(entityId);
    DboTableMeta metaDbo = classMeta.getMetaDbo();
    DboColumnIdMeta idMeta = metaDbo.getIdColumnMeta();
    byte[] virtKey = idMeta.formVirtRowKey(nonVirtKey);
   
    List<byte[]> rowKeys = new ArrayList<byte[]>();
    rowKeys.add(virtKey);
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.