Package com.netflix.astyanax.model

Examples of com.netflix.astyanax.model.ColumnFamily


    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


            ctx.stop();
        }
    }

    public void writeMetadata(Table<Locator, String, String> metaTable) throws ConnectionException {
        ColumnFamily cf = CassandraModel.CF_METRIC_METADATA;
        Timer.Context ctx = Instrumentation.getBatchWriteTimerContext(cf);
        MutationBatch batch = keyspace.prepareMutationBatch();

        try {
            for (Locator locator : metaTable.rowKeySet()) {
View Full Code Here

                new ImmutableTable.Builder<Granularity, RollupType, TimeValue>();

        for (Granularity granularity : Granularity.granularities()) {
            for (RollupType type : RollupType.values()) {
                try {
                    ColumnFamily cf = CassandraModel.getColumnFamily(RollupType.classOf(type, granularity), granularity);

                    if (cf instanceof CassandraModel.MetricColumnFamily) {
                        CassandraModel.MetricColumnFamily metricCF = (CassandraModel.MetricColumnFamily) cf;
                        TimeValue ttl = new TimeValue(metricCF.getDefaultTTL().getValue() * 5, metricCF.getDefaultTTL().getUnit());
                        ttlMapBuilder.put(granularity, type, ttl);
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

 
  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, action.getRowTtl());
  }
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()) {
      byte[] value = new byte[0];
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.