Package com.netflix.astyanax.model

Examples of com.netflix.astyanax.model.ColumnFamily


    }
    return range;
  }
 
  private RowQuery createBasicRowQuery(byte[] rowKey, Info info1, ByteBufferRange range) {
    ColumnFamily cf = info1.getColumnFamilyObj();
   
    Keyspace keyspace = columnFamilies.getKeyspace();
    ColumnFamilyQuery query = keyspace.prepareQuery(cf);
    //ColumnFamilyQuery query = query1.setConsistencyLevel(ConsistencyLevel.CL_QUORUM);
    RowQuery rowQuery = query.getKey(rowKey)
View Full Code Here


    Info info = new Info();
    info.setColumnType(type);
    info.setRowKeyType(keyType);
   
    //should we cache this and just look it up each time or is KISS fine for now....
    ColumnFamily cf = null;
    switch(type) {
      case ANY_EXCEPT_COMPOSITE:
        cf = new ColumnFamily(colFamily, BytesArraySerializer.get(), BytesArraySerializer.get());
        break;
      case COMPOSITE_DECIMALPREFIX:
      case COMPOSITE_INTEGERPREFIX:
      case COMPOSITE_STRINGPREFIX:
        com.netflix.astyanax.serializers.
View Full Code Here

    this.reverse = reverse;
  }

  @Override
  public List<Future<OperationResult<ColumnList<byte[]>>>> start() {
    ColumnFamily cf = info1.getColumnFamilyObj();
    Keyspace keyspace = columnFamilies.getKeyspace();
   
    List<Future<OperationResult<ColumnList<byte[]>>>> futures = new ArrayList<Future<OperationResult<ColumnList<byte[]>>>>();

    for(byte[] val : values) {
View Full Code Here

     * @return
     */
    @SuppressWarnings({"unchecked", "rawtypes"})
    protected ColumnFamily getColumnFamilyViaColumnName(String columnFamilyName, Class rowKeyClass) {
        if (rowKeyClass == String.class) {
            return new ColumnFamily(columnFamilyName, StringSerializer.get(), StringSerializer.get());
        } else if (rowKeyClass == Integer.class) {
            return new ColumnFamily(columnFamilyName, IntegerSerializer.get(), StringSerializer.get());
        } else if (rowKeyClass == Long.class) {
            return new ColumnFamily(columnFamilyName, LongSerializer.get(), StringSerializer.get());
        } else {
            throw new IllegalArgumentException("RowKeyType is not supported: " + rowKeyClass.getSimpleName() + ". String/Integer/Long are supported, or you can define the ColumnFamily yourself and use the other constructor.");
        }
    }
View Full Code Here

 
  private void remove(Remove 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();
   
    switch(action.getAction()) {
    case REMOVE_ENTIRE_ROW:
      m.withRow(cf, action.getRowKey()).delete();
      break;
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

    String indexCfName = action.getIndexCfName();
    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

    return toPersist;
  }
 
  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;
View Full Code Here

      range = range.reverse();
    return range;
  }
 
  private RowQuery createBasicRowQuery(byte[] rowKey, Info info1, ByteBufferRange range) {
    ColumnFamily cf = info1.getColumnFamilyObj();
   
    Keyspace keyspace = columnFamilies.getKeyspace();
    ColumnFamilyQuery query = keyspace.prepareQuery(cf);
    //ColumnFamilyQuery query = query1.setConsistencyLevel(ConsistencyLevel.CL_QUORUM);
    RowQuery rowQuery = query.getKey(rowKey)
View Full Code Here

TOP

Related Classes of com.netflix.astyanax.model.ColumnFamily

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.