Package com.netflix.astyanax.model

Examples of com.netflix.astyanax.model.ColumnFamily


    }

    @Override
    public void serlizers(AbstractSerializer<?> keySerializer, AbstractSerializer<?> columnSerializer, AbstractSerializer<?> valueSerializer)
    {
        this.cfs = new ColumnFamily(cfName, keySerializer, columnSerializer);
        this.columnSerializer = columnSerializer;
        this.valueSerializer = valueSerializer;
    }
View Full Code Here


        {
            SerializerPackage sp = AstyanaxConnection.instance.keyspace().getSerializerPackage(cfName, false);
            // work around
            ByteBuffer rowKey = sp.keyAsByteBuffer(key);
            ByteBuffer column = sp.columnAsByteBuffer(colName);
            ColumnFamily<ByteBuffer, ByteBuffer> columnFamily = new ColumnFamily(cfName, ByteBufferSerializer.get(), ByteBufferSerializer.get());
            ColumnMutation mutation = AstyanaxConnection.instance.keyspace().prepareColumnMutation(columnFamily, rowKey, column);
            OperationResult<Void> result;
            if (isCounter)
                result = mutation.incrementCounterColumn(LongSerializer.get().fromByteBuffer(value)).execute();
            else
View Full Code Here

        try
        {
            SerializerPackage sp = AstyanaxConnection.instance.keyspace().getSerializerPackage(cfName, false);
            ByteBuffer bbName = sp.columnAsByteBuffer(colName);
            ByteBuffer bbKey = sp.keyAsByteBuffer(key);
            ColumnFamily<ByteBuffer, ByteBuffer> columnFamily = new ColumnFamily(cfName, ByteBufferSerializer.get(), ByteBufferSerializer.get());
            opResult = AstyanaxConnection.instance.keyspace().prepareQuery(columnFamily).getKey(bbKey).getColumn(bbName).execute();
            bytes = opResult.getResult().getByteBufferValue().capacity();
            bytes += opResult.getResult().getRawName().capacity();
            String value = SystemUtils.convertToString(valueSerializer, opResult.getResult().getByteBufferValue());
            response.append(value);
View Full Code Here

    this.isCounter = isCounter;
  }

  @Override
  public void serlizers(AbstractSerializer<?> keySerializer, AbstractSerializer<?> columnSerializer, AbstractSerializer<?> valueSerializer) {
    this.cfs = new ColumnFamily(cfName, keySerializer, columnSerializer);
    this.columnSerializer = columnSerializer;
    this.valueSerializer = valueSerializer;
  }
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

      return;
    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.