Package com.netflix.astyanax

Examples of com.netflix.astyanax.Keyspace


  }

  @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) {
      Key from = new Key(val, true);
      Key to = new Key(val, true);
      byte[] rowKey = scanInfo.getRowKey();
     
      CompositeRangeBuilder range = CassandraSession.setupRangeBuilder(from, to, info1, reverse);
      ColumnFamilyQuery query = keyspace.prepareQuery(cf);
      RowQuery<byte[], byte[]> rowQuery = query.getKey(rowKey).withColumnRange(range);
      Future future = executeAsync(rowQuery);
      futures.add(future);
    }
   
View Full Code Here


    }

    void initCassandra() throws Exception {
        if (cassandraEnabled.get()) {
            LOG.info("Getting AstyanaxContext");
            Keyspace keyspace = CassandraHelper.getInstance().getZuulCassKeyspace();
            LOG.info("Initializing Cassandra ZuulFilterDAO");
            ZuulFilterDAO dao = new ZuulFilterDAOCassandra(keyspace);
            LOG.info("Starting ZuulFilter Poller");
            ZuulFilterPoller.start(dao);
        }
View Full Code Here

    ColumnType type = info.getColumnType();
    if(type != ColumnType.ANY_EXCEPT_COMPOSITE) {
      throw new UnsupportedOperationException("Finding on composite type="+colFamily+" not allowed here, you should be using column slice as these rows are HUGE!!!!");
    }
   
    Keyspace keyspace = columnFamilies.getKeyspace();
    CursorKeysToRows2 cursor = new CursorKeysToRows2(rowKeys, batchSize, list, rowProvider);
    cursor.setupMore(keyspace, colFamily, info, cache);
    return cursor;
  }
View Full Code Here

    } catch (ConnectionException e) {
      throw new RuntimeException(e);
    }
  }
  public void sendChangesImpl(List<Action> actions, MetaLookup ormSession) throws ConnectionException {
    Keyspace keyspace = columnFamilies.getKeyspace();
    MutationBatch m = keyspace.prepareMutationBatch();
    //MutationBatch m = m1.setConsistencyLevel(ConsistencyLevel.CL_QUORUM);
   
    for(Action action : actions) {
      if(action instanceof Persist) {
        persist((Persist)action, ormSession, m);
View Full Code Here

  }
 
  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)
              .autoPaginate(true)
              .withColumnRange(range);
    return rowQuery;
View Full Code Here

    ColumnType type = info.getColumnType();
    if(type != ColumnType.ANY_EXCEPT_COMPOSITE) {
      throw new UnsupportedOperationException("Finding on composite type="+colFamily+" not allowed here, you should be using column slice as these rows are HUGE!!!!");
    }
   
    Keyspace keyspace = columnFamilies.getKeyspace();
    CursorKeysToRows2 cursor = new CursorKeysToRows2(rowKeys, batchSize, list, rowProvider);
    cursor.setupMore(keyspace, colFamily, info, cache);
    return cursor;
  }
View Full Code Here

    } catch (ConnectionException e) {
      throw new RuntimeException(e);
    }
  }
  public void sendChangesImpl(List<Action> actions, MetaLookup ormSession) throws ConnectionException {
    Keyspace keyspace = columnFamilies.getKeyspace();
    MutationBatch m = keyspace.prepareMutationBatch();
    //MutationBatch m = m1.setConsistencyLevel(ConsistencyLevel.CL_QUORUM);
   
    for(Action action : actions) {
      if(action instanceof Persist) {
        persist((Persist)action, ormSession, m);
View Full Code Here

  }
 
  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)
              .autoPaginate(true)
              .withColumnRange(range);
    return rowQuery;
View Full Code Here

  }

  @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) {
      Key from = new Key(val, true);
      Key to = new Key(val, true);
      byte[] rowKey = scanInfo.getRowKey();
     
      CompositeRangeBuilder range = CassandraSession.setupRangeBuilder(from, to, info1, reverse);
      ColumnFamilyQuery query = keyspace.prepareQuery(cf);
      RowQuery<byte[], byte[]> rowQuery = query.getKey(rowKey).withColumnRange(range);
      Future future = executeAsync(rowQuery);
      futures.add(future);
    }
   
View Full Code Here

  }

  @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) {
      Key from = new Key(val, true);
      Key to = new Key(val, true);
      byte[] rowKey = scanInfo.getRowKey();
     
      CompositeRangeBuilder range = CassandraSession.setupRangeBuilder(from, to, info1);
      ColumnFamilyQuery query = keyspace.prepareQuery(cf);
      RowQuery<byte[], byte[]> rowQuery = query.getKey(rowKey).withColumnRange(range);
      Future future = executeAsync(rowQuery);
      futures.add(future);
    }
   
View Full Code Here

TOP

Related Classes of com.netflix.astyanax.Keyspace

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.