Examples of ColumnParent


Examples of org.apache.cassandra.thrift.ColumnParent

        for (int nRows = minRow; nRows < maxRow; nRows++)
        {
            ByteBuffer row = ByteBuffer.wrap((rowPrefix + nRows).getBytes());
            ColumnPath col = new ColumnPath("Standard1").setSuper_column((ByteBuffer)null).setColumn("col1".getBytes());
            ColumnParent parent = new ColumnParent("Standard1").setSuper_column((ByteBuffer)null);

            Collection<InetAddress> endpoints = tester.ringCache.getEndpoint(row);
            InetAddress firstEndpoint = endpoints.iterator().next();
            System.out.printf("hosts with key %s : %s; choose %s%n",
                              new String(row.array()), StringUtils.join(endpoints, ","), firstEndpoint);
View Full Code Here

Examples of org.apache.cassandra.thrift.ColumnParent

    return predicate;
  }

  public Select addColumnName(String superColumnFamily, String superColumn,
      String columnName) {
    ColumnParent parent = new ColumnParent(superColumnFamily);
    parent.setSuper_column(ByteUtils.toBytes(superColumn));
    SlicePredicate predicate = getOrCreate(parent);
    if (predicate.getSlice_range() != null) {
      // TODO: Make this another exception
      throw new RuntimeException("Can't add columns if slice_range is not null");
    }
View Full Code Here

Examples of org.apache.cassandra.thrift.ColumnParent

    predicate.addToColumn_names(ByteUtils.toBytes(columnName));
    return this;
  }

  public Select addColumnName(String columnFamily, String columnName) {
    SlicePredicate predicate = getOrCreate(new ColumnParent(columnFamily));
    if (predicate.getSlice_range() != null) {
      // TODO: Make this another exception
      throw new RuntimeException("Can't add columns if slice_range is not null");
    }
    predicate.addToColumn_names(ByteUtils.toBytes(columnName));
View Full Code Here

Examples of org.apache.cassandra.thrift.ColumnParent

  public Select addSuperColumnAll(String superColumnFamily) {
    return addColumnAll(superColumnFamily);
  }

  public Select addAllColumnsForSuperColumn(String superColumnFamily, String superColumnName) {
    ColumnParent parent = new ColumnParent(superColumnFamily);
    parent.setSuper_column(ByteUtils.toBytes(superColumnName));
    predicateMap.put(parent, ALL_PREDICATE);
    return this;
  }
View Full Code Here

Examples of org.apache.cassandra.thrift.ColumnParent

    predicateMap.put(parent, ALL_PREDICATE);
    return this;
  }

  public Select addColumnAll(String columnFamily) {
    predicateMap.put(new ColumnParent(columnFamily), ALL_PREDICATE);
    return this;
  }
View Full Code Here

Examples of org.apache.cassandra.thrift.ColumnParent

        pair = f.get();
      } catch (Exception e1) {
        throw new IOException(e1);
      }
      for (ColumnOrSuperColumn csc : pair.getSecond()) {
        ColumnParent parent = pair.getFirst();
        row.addColumnOrSuperColumn(parent.column_family, parent.super_column, csc);
      }
    }
    return row;
  }
View Full Code Here

Examples of org.apache.cassandra.thrift.ColumnParent

        for (int nRows = minRow; nRows < maxRow; nRows++)
        {
            ByteBuffer row = ByteBufferUtil.bytes((rowPrefix + nRows));
            ColumnPath col = new ColumnPath("Standard1").setSuper_column((ByteBuffer)null).setColumn("col1".getBytes());
            ColumnParent parent = new ColumnParent("Standard1").setSuper_column((ByteBuffer)null);

            Collection<InetAddress> endpoints = tester.ringCache.getEndpoint(row);
            InetAddress firstEndpoint = endpoints.iterator().next();
            System.out.printf("hosts with key %s : %s; choose %s%n",
                              new String(row.array()), StringUtils.join(endpoints, ","), firstEndpoint);
View Full Code Here

Examples of org.apache.cassandra.thrift.ColumnParent

            this.settings = settings;
            this.keyGen = settings.keys.newKeyGen();
            this.rowGen = settings.columns.newRowGen();
            this.metrics = metrics;
            if (!settings.columns.useSuperColumns)
                columnParents = Collections.singletonList(new ColumnParent(settings.schema.columnFamily));
            else
            {
                ColumnParent[] cp = new ColumnParent[settings.columns.superColumns];
                for (int i = 0 ; i < cp.length ; i++)
                    cp[i] = new ColumnParent("Super1").setSuper_column(ByteBufferUtil.bytes("S" + i));
                columnParents = Arrays.asList(cp);
            }
        }
View Full Code Here

Examples of org.apache.cassandra.thrift.ColumnParent

        // to make sure we have SSTable
        cfs.forceBlockingFlush();

        // reads to cache key position
        cfs.getColumnFamily(QueryFilter.getSliceFilter(key1,
                                                       new QueryPath(new ColumnParent(COLUMN_FAMILY1)),
                                                       ByteBufferUtil.EMPTY_BYTE_BUFFER,
                                                       ByteBufferUtil.EMPTY_BYTE_BUFFER,
                                                       false,
                                                       10));

        cfs.getColumnFamily(QueryFilter.getSliceFilter(key2,
                                                       new QueryPath(new ColumnParent(COLUMN_FAMILY1)),
                                                       ByteBufferUtil.EMPTY_BYTE_BUFFER,
                                                       ByteBufferUtil.EMPTY_BYTE_BUFFER,
                                                       false,
                                                       10));

        assert CacheService.instance.keyCache.size() == 2;

        Util.compactAll(cfs).get();
        keyCacheSize = CacheService.instance.keyCache.size();
        // after compaction cache should have entries for
        // new SSTables, if we had 2 keys in cache previously it should become 4
        assert keyCacheSize == 4 : keyCacheSize;

        // re-read same keys to verify that key cache didn't grow further
        cfs.getColumnFamily(QueryFilter.getSliceFilter(key1,
                                                       new QueryPath(new ColumnParent(COLUMN_FAMILY1)),
                                                       ByteBufferUtil.EMPTY_BYTE_BUFFER,
                                                       ByteBufferUtil.EMPTY_BYTE_BUFFER,
                                                       false,
                                                       10));

        cfs.getColumnFamily(QueryFilter.getSliceFilter(key2,
                                                       new QueryPath(new ColumnParent(COLUMN_FAMILY1)),
                                                       ByteBufferUtil.EMPTY_BYTE_BUFFER,
                                                       ByteBufferUtil.EMPTY_BYTE_BUFFER,
                                                       false,
                                                       10));
View Full Code Here

Examples of org.apache.cassandra.thrift.ColumnParent

        }

        private List<ColumnParent> columnParents(Command type, StressSettings settings)
        {
            if (!settings.columns.useSuperColumns)
                return Collections.singletonList(new ColumnParent(type.table));
            else
            {
                ColumnParent[] cp = new ColumnParent[settings.columns.superColumns];
                for (int i = 0 ; i < cp.length ; i++)
                    cp[i] = new ColumnParent(type.supertable).setSuper_column(ByteBufferUtil.bytes("S" + i));
                return Arrays.asList(cp);
            }
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.