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

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


 
  public DirectCursor<IndexColumnInfo> getResultListImpl(Set<ViewInfo> alreadyJoinedViews, String indexedColumn) {
    ExpressionNode root = spiMeta.getASTTree();
    if(root == null) {
      ViewInfoImpl tableInfo = (ViewInfoImpl) spiMeta.getTargetViews().get(0);
      DboTableMeta tableMeta = tableInfo.getTableMeta();
      PartitionMeta partitionMeta = tableInfo.getPartition();
      DboColumnMeta partColMeta = null;
      if (partitionMeta != null)
        partColMeta = partitionMeta.getPartitionColumn();
      DboColumnMeta metaCol = tableMeta.getAnyIndex(indexedColumn, partColMeta);

      ScanInfo scanInfo = createScanInfo(tableInfo, metaCol);

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


      }
    }
   
    RowToPersist row = metaClass.translateToRow(entity);
   
    DboTableMeta metaDbo = metaClass.getMetaDbo();
    if (metaDbo.isEmbeddable())
      throw new IllegalArgumentException("Entity type="+entity.getClass().getName()+" can not be saved as it is Embedded Entity. And Embeddable entitites are only saved along with their parent entity");
    //This is if we need to be removing columns from the row that represents the entity in a oneToMany or ManyToMany
    //as the entity.accounts may have removed one of the accounts!!!
    if(row.hasRemoves())
      session.remove(metaDbo, row.getKey(), row.getColumnNamesToRemove());
View Full Code Here

          if(type != StorageTypeEnum.DECIMAL
              && type != StorageTypeEnum.INTEGER
              && type != StorageTypeEnum.STRING)
            continue;
         
          DboTableMeta cf = new DboTableMeta();

          //TODO: PUT this in virtual partition????
          cf.setup(null, type.getIndexTableName(), false);
          cf.setColNamePrefixType(type);
         
          DboColumnIdMeta idMeta = new DboColumnIdMeta();
          idMeta.setup(cf, "id", String.class, false);
         
          tempMgr.put(idMeta);
View Full Code Here

    Object proxy = entity;
    Object pk = metaClass.fetchId(entity);
    MetaIdField idField = metaClass.getIdField();
    byte[] rowKey = idField.convertIdToNonVirtKey(pk);
    byte[] virtKey = idField.formVirtRowKey(rowKey);
    DboTableMeta metaDbo = metaClass.getMetaDbo();
   
    if(!metaClass.hasIndexedField(entity)) {
      session.remove(metaDbo, virtKey);
      return;
    } else if(!(entity instanceof NoSqlProxy)) {
View Full Code Here

    String by = data.getPartitionBy();
    String id = data.getPartitionId();
    Cursor<IndexPoint> indexView = s.indexView(cf, field, by, id);
    Cursor<IndexPoint> indexView2 = 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("It is safe to kill this process at any time since it only removes duplicates");
    System.out.println("Beginning re-index");

    int totalChanges = 0;
    int rowCountProcessed = 0;
View Full Code Here

    String by = data.getPartitionBy();
    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()) {
      IndexPoint current = indexView.getCurrent();
View Full Code Here

      partitionBy = partitionPart.substring(0, index);
      partitionId = partitionPart.substring(index);
    }
   
    DboTableMeta meta = mgr.find(DboTableMeta.class, cf);
    if (meta == null) {
      System.out.println("Column family meta not found for " + cf);
      System.out.println("You can select from following tables:");
      QueryResult result = mgr.getTypedSession().createQueryCursor("select * from DboTableMeta", 100);
      Cursor<List<TypedRow>> cursor = result.getAllViewsCursor();
      while (cursor.next()) {
        List<TypedRow> joinedRow = cursor.getCurrent();
        for (TypedRow r : joinedRow) {
          System.out.println(r.getRowKeyString());
        }
      }
      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());
        }
        System.out.println("");
        throw new InvalidCommand("Column= "+field+" not found on table "+cf);
      }
View Full Code Here

    return session;
  }

  @Override
  public void put(String colFamily, TypedRow typedRow) {
    DboTableMeta metaClass = cachedMeta.getMeta(colFamily);
    if(metaClass == null)
      throw new IllegalArgumentException("DboTableMeta for colFamily="+colFamily+" was not found");

    RowToPersist row = metaClass.translateToRow(typedRow);
   
    byte[] virtualKey = row.getVirtualKey();
    //This is if we need to be removing columns from the row that represents the entity in a oneToMany or ManyToMany
    //as the entity.accounts may have removed one of the accounts!!!
    if(row.hasRemoves())
View Full Code Here

  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();
   
    IndexColumn col = new IndexColumn();
    col.setIndexedValue(pt.getRawIndexedValue());
    col.setPrimaryKey(pt.getRawKey());
    session.removeFromIndex(cf, indColFamily, rowKey, col);
View Full Code Here

  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();
   
    IndexColumn col = new IndexColumn();
    if(colMeta != null)
      col.setColumnName(colMeta.getColumnName());
    col.setIndexedValue(pt.getRawIndexedValue());
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.