Package com.netflix.astyanax

Examples of com.netflix.astyanax.ColumnListMutation


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

  private void removeColumns(Remove action, ColumnFamily cf, MutationBatch m) {
    ColumnListMutation row = m.withRow(cf, action.getRowKey());
   
    for(byte[] name : action.getColumns()) {
      row.deleteColumn(name);
    }
  }
View Full Code Here


  private void removeColumn(RemoveColumn action, MetaLookup mgr, MutationBatch m) {
    Info info = columnFamilies.fetchColumnFamilyInfo(action.getColFamily().getColumnFamily(), mgr);
    if(info == null)
      return; //if no cf exist/returned, nothing to do
    ColumnFamily cf = info.getColumnFamilyObj();
    ColumnListMutation row = m.withRow(cf, action.getRowKey());
    if(row == null)
      return;
    byte[] name = action.getColumn();
      row.deleteColumn(name);
  }
View Full Code Here

  private void persistIndex(PersistIndex action, MetaLookup mgr, MutationBatch m) {
    String indexCfName = action.getIndexCfName();
    Info info = columnFamilies.lookupOrCreate2(indexCfName, mgr);

    ColumnFamily cf = info.getColumnFamilyObj();
    ColumnListMutation colMutation = m.withRow(cf, action.getRowKey());
    Object toPersist = createObjectToUse(action, info);
   
    colMutation.putEmptyColumn(toPersist);
  }
View Full Code Here

    Info info = columnFamilies.fetchColumnFamilyInfo(indexCfName, mgr);
    if(info == null)
      return; //nothing to do since it doesn't exist
   
    ColumnFamily cf = info.getColumnFamilyObj();
    ColumnListMutation colMutation = m.withRow(cf, action.getRowKey());
    Object toRemove = createObjectToUse(action, info);
   
    colMutation.deleteColumn(toRemove);
  }
View Full Code Here

 
  private void persist(Persist action, MetaLookup ormSession, MutationBatch m) {
    Info info = columnFamilies.lookupOrCreate2(action.getColFamily().getColumnFamily(), ormSession);
    ColumnFamily cf = info.getColumnFamilyObj();
   
    ColumnListMutation colMutation = m.withRow(cf, action.getRowKey());
   
    for(Column col : action.getColumns()) {
      Integer theTime = null;
      Long time = col.getTimestamp();
      if(time != null)
        theTime = (int)time.longValue();
      byte[] value = new byte[0];
      if(col.getValue() != null)
        value = col.getValue();
     
      colMutation.putColumn(col.getName(), value, theTime);
    }
  }
View Full Code Here

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

  private void removeColumns(Remove action, ColumnFamily cf, MutationBatch m) {
    ColumnListMutation row = m.withRow(cf, action.getRowKey());
   
    for(byte[] name : action.getColumns()) {
      row.deleteColumn(name);
    }
  }
View Full Code Here

  private void removeColumn(RemoveColumn action, MetaLookup mgr, MutationBatch m) {
    Info info = columnFamilies.fetchColumnFamilyInfo(action.getColFamily().getColumnFamily(), mgr);
    if(info == null)
      return; //if no cf exist/returned, nothing to do
    ColumnFamily cf = info.getColumnFamilyObj();
    ColumnListMutation row = m.withRow(cf, action.getRowKey());
    if(row == null)
      return;
    byte[] name = action.getColumn();
      row.deleteColumn(name);
  }
View Full Code Here

  private void persistIndex(PersistIndex action, MetaLookup mgr, MutationBatch m) {
    String indexCfName = action.getIndexCfName();
    Info info = columnFamilies.lookupOrCreate2(indexCfName, mgr);

    ColumnFamily cf = info.getColumnFamilyObj();
    ColumnListMutation colMutation = m.withRow(cf, action.getRowKey());
    Object toPersist = createObjectToUse(action, info);
    colMutation.putEmptyColumn(toPersist, action.getRowTtl());
  }
View Full Code Here

    Info info = columnFamilies.fetchColumnFamilyInfo(indexCfName, mgr);
    if(info == null)
      return; //nothing to do since it doesn't exist
   
    ColumnFamily cf = info.getColumnFamilyObj();
    ColumnListMutation colMutation = m.withRow(cf, action.getRowKey());
    Object toRemove = createObjectToUse(action, info);
   
    colMutation.deleteColumn(toRemove);
  }
View Full Code Here

 
  private void persist(Persist action, MetaLookup ormSession, MutationBatch m) {
    Info info = columnFamilies.lookupOrCreate2(action.getColFamily().getColumnFamily(), ormSession);
    ColumnFamily cf = info.getColumnFamilyObj();
   
    ColumnListMutation colMutation = m.withRow(cf, action.getRowKey());
   
    for(Column col : action.getColumns()) {
      byte[] value = new byte[0];
      if(col.getValue() != null)
        value = col.getValue();

      colMutation.putColumn(col.getName(), value, col.getTtl());
    }
  }
View Full Code Here

TOP

Related Classes of com.netflix.astyanax.ColumnListMutation

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.