Package com.alvazan.orm.api.z8spi

Examples of com.alvazan.orm.api.z8spi.Row


    this.columnFamilyName = columnFamily;
  }

  public Row findOrCreateRow(byte[] key) {
    ByteArray array = new ByteArray(key);
    Row row = keyToRow.get(array);
    if(row == null) {
      row = createSortedMap();
      row.setKey(key);
      keyToRow.put(new ByteArray(key), row);
    }
    return row;
  }
View Full Code Here


    return row;
  }

  private Row createSortedMap() {
    TreeMap<ByteArray, Column> tree;
    Row row;
    switch (columnSortType) {
    case BYTES:
      tree = new TreeMap<ByteArray, Column>();
      row = new RowImpl(tree);
      break;
View Full Code Here

    keyToRow.remove(key);
  }

  public Row getRow(byte[] rowKey) {
    ByteArray key = new ByteArray(rowKey);
    Row row = keyToRow.get(key);
    if (row instanceof RowImpl) {
      if (((RowImpl) row).isExpired()) {
        keyToRow.remove(key);
        return null;
      }
View Full Code Here

      throw new RuntimeException("bug, unknown remove action="+action.getAction());
    }
  }

  private void removeColumns(Remove action, Table table) {
    Row row = table.getRow(action.getRowKey());
    if(row == null)
      return;
   
    for(byte[] name : action.getColumns()) {
      row.remove(name);
    }
  }
View Full Code Here

  private void removeColumn(RemoveColumn action, NoSqlEntityManager ormSession) {

    String colFamily = action.getColFamily().getColumnFamily();
    Table table = lookupColFamily(colFamily, (NoSqlEntityManager) ormSession);
    Row row = table.getRow(action.getRowKey());
    if(row == null)
      return;
    byte[] name = action.getColumn();
      row.remove(name);
  }
View Full Code Here

  }

  private void persist(Persist action, NoSqlEntityManager ormSession) {
    String colFamily = action.getColFamily().getColumnFamily();
    Table table = lookupColFamily(colFamily, (NoSqlEntityManager) ormSession);
    Row row = table.findOrCreateRow(action.getRowKey());
   
    for(Column col : action.getColumns()) {
      row.put(col.copy());
    }
  }
View Full Code Here

      byte[] from, byte[] to, Integer batchSize, BatchListener l) {
    Table table = database.findTable(colFamily.getColumnFamily());
    if(table == null) {
      return new HashSet<Column>();
    }
    Row row = table.findOrCreateRow(rowKey);
    if(row == null)
      return new HashSet<Column>();
   
    return row.columnSlice(from, to);
  }
View Full Code Here

    byte[] rowKey = info.getRowKey();
    Table table = database.findTable(colFamily);
    if(table == null) {
      return new HashSet<IndexColumn>();
    }
    Row row = table.findOrCreateRow(rowKey);
    if(row == null)
      return new HashSet<IndexColumn>();
   
    return row.columnSlice(from, to);
  }
View Full Code Here

  @Override
  public Holder<T> nextImpl() {
    Holder<Row> nextImpl = cursor.nextImpl();
    if(nextImpl == null)
      return null;
    Row kv = nextImpl.getValue();

    T result = translateRow(kv);
    return new Holder<T>(result);
  }
View Full Code Here

  @Override
  public Holder<T> previousImpl() {
    Holder<Row> prevImpl = cursor.previousImpl();
    if(prevImpl == null)
      return null;
    Row kv = prevImpl.getValue();
   
    T result = translateRow(kv);
    return new Holder<T>(result);
  }
View Full Code Here

TOP

Related Classes of com.alvazan.orm.api.z8spi.Row

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.