@Override public ColumnListMutation<C> delete() { // Delete the entire super column Deletion d = new Deletion().setSuper_column(path.get(0)).setTimestamp(timestamp); mutationList.add(new Mutation().setDeletion(d)); timestamp++; return this; }
cp.setColumn_family(columnFamily.getName()); if (path != null) { Iterator<ByteBuffer> columns = path.iterator(); if (columnFamily.getType() == ColumnType.SUPER && columns.hasNext()) { cp.setSuper_column(columns.next()); throw new BadRequestException("Path depth of " + path.length() + " not supported for column family \'" + columnFamily.getName() + "\'");
public <C2> ColumnPath<C> append(String name) { append(name, StringSerializer.get()); return this; }
@Override public ColumnListMutation<C> deleteColumn(C columnName) { if (deletionPredicate == null) { deletionPredicate = new SlicePredicate(); Deletion d = new Deletion().setTimestamp(timestamp).setSuper_column(path.get(0)) .setPredicate(deletionPredicate); mutationList.add(new Mutation().setDeletion(d)); } deletionPredicate.addToColumn_names(path.getSerializer().toByteBuffer(columnName)); return this; }
@Override public ColumnListMutation<C> putEmptyColumn(C columnName, Integer ttl) { Column column = new Column(); column.setName(path.getSerializer().toByteBuffer(columnName)); column.setValue(ThriftUtils.EMPTY_BYTE_BUFFER); column.setTimestamp(timestamp); if (ttl != null) column.setTtl(ttl); else if (defaultTtl != null) column.setTtl(defaultTtl); addMutation(column); return this; }
/** * Construct a Hector ColumnParent based on the information in the query and * the type of column family being queried. * * @param <K> * @param columnFamily * @param path * @return * @throws BadRequestException */ public static <K> ColumnParent getColumnParent(ColumnFamily<?, ?> columnFamily, ColumnPath<?> path) throws BadRequestException { ColumnParent cp = new ColumnParent(); cp.setColumn_family(columnFamily.getName()); if (path != null) { Iterator<ByteBuffer> columns = path.iterator(); if (columnFamily.getType() == ColumnType.SUPER && columns.hasNext()) { cp.setSuper_column(columns.next()); } } return cp; }
@Override public ColumnListMutation<C> deleteColumn(C columnName) { if (deletionPredicate == null) { deletionPredicate = new SlicePredicate(); Deletion d = new Deletion().setTimestamp(timestamp).setSuper_column(path.get(0)) .setPredicate(deletionPredicate); mutationList.add(new Mutation().setDeletion(d)); } deletionPredicate.addToColumn_names(path.getSerializer().toByteBuffer(columnName)); return this; }
@Override public ColumnListMutation<C> putEmptyColumn(C columnName, Integer ttl) { Column column = new Column(); column.setName(path.getSerializer().toByteBuffer(columnName)); column.setValue(ThriftUtils.EMPTY_BYTE_BUFFER); column.setTimestamp(timestamp); if (ttl != null) column.setTtl(ttl); else if (defaultTtl != null) column.setTtl(defaultTtl); addMutation(column); return this; }
/** * Construct a Hector ColumnParent based on the information in the query and * the type of column family being queried. * * @param <K> * @param columnFamily * @param path * @return * @throws BadRequestException */ public static <K> ColumnParent getColumnParent(ColumnFamily<?, ?> columnFamily, ColumnPath<?> path) throws BadRequestException { ColumnParent cp = new ColumnParent(); cp.setColumn_family(columnFamily.getName()); if (path != null) { Iterator<ByteBuffer> columns = path.iterator(); if (columnFamily.getType() == ColumnType.SUPER && columns.hasNext()) { cp.setSuper_column(columns.next()); } } return cp; }
@Override public ColumnListMutation<C> deleteColumn(C columnName) { if (deletionPredicate == null) { deletionPredicate = new SlicePredicate(); Deletion d = new Deletion(); d.setTimestamp(timestamp); d.setSuper_column(path.get(0)); d.setPredicate(deletionPredicate); mutationList.add(new Mutation().setDeletion(d)); } deletionPredicate.addToColumn_names(path.getSerializer().toByteBuffer(columnName)); return this; }
cp.setColumn_family(columnFamily.getName()); if (path != null) { Iterator<ByteBuffer> columns = path.iterator(); if (columnFamily.getType() == ColumnType.SUPER && columns.hasNext()) { cp.setSuper_column(columns.next()); throw new BadRequestException("Path depth of " + path.length() + " not supported for column family \'" + columnFamily.getName() + "\'");
@Override public ColumnListMutation<C> delete() { // Delete the entire super column Deletion d = new Deletion().setSuper_column(path.get(0)).setTimestamp(timestamp); mutationList.add(new Mutation().setDeletion(d)); timestamp++; return this; }
@Override public <V> ColumnListMutation<C> putColumn(C columnName, V value, Serializer<V> valueSerializer, Integer ttl) { Column column = new Column(); column.setName(path.getSerializer().toByteBuffer(columnName)); column.setValue(valueSerializer.toByteBuffer(value)); column.setTimestamp(timestamp); if (ttl != null) column.setTtl(ttl); else if (defaultTtl != null) column.setTtl(defaultTtl); addMutation(column); return this; }
public <C2> ColumnPath<C> append(int name) { append(name, IntegerSerializer.get()); return this; }
@Override public ColumnListMutation<C> deleteColumn(C columnName) { if (deletionPredicate == null) { deletionPredicate = new SlicePredicate(); Deletion d = new Deletion(); d.setTimestamp(timestamp); d.setSuper_column(path.get(0)); d.setPredicate(deletionPredicate); mutationList.add(new Mutation().setDeletion(d)); } deletionPredicate.addToColumn_names(path.getSerializer().toByteBuffer(columnName)); return this; }
@Override public ColumnListMutation<C> delete() { Deletion d = new Deletion(); d.setSuper_column(path.get(0)); d.setTimestamp(timestamp); mutationList.add(new Mutation().setDeletion(d)); timestamp++; return this; }
@Override public <V> ColumnListMutation<C> putColumn(C columnName, V value, Serializer<V> valueSerializer, Integer ttl) { Column column = new Column(); column.setName(path.getSerializer().toByteBuffer(columnName)); column.setValue(valueSerializer.toByteBuffer(value)); column.setTimestamp(timestamp); if (ttl != null) column.setTtl(ttl); else if (defaultTtl != null) column.setTtl(defaultTtl); addMutation(column); return this; }
public <C2> ColumnPath<C> append(double name) { append(name, DoubleSerializer.get()); return this; }
@Override public ColumnListMutation<C> incrementCounterColumn(C columnName, long amount) { // 1. Set up the column with all the data CounterColumn column = new CounterColumn(); column.setName(path.getSerializer().toByteBuffer(columnName)); column.setValue(amount); // 2. Create the super column mutation if this is the first call if (superColumn == null) { superColumn = new CounterSuperColumn().setName(path.get(0)); Mutation mutation = new Mutation(); mutation.setColumn_or_supercolumn(new ColumnOrSuperColumn().setCounter_super_column(superColumn)); mutationList.add(mutation); } superColumn.addToColumns(column); return this; }
@Override public ColumnListMutation<C> delete() { Deletion d = new Deletion(); d.setSuper_column(path.get(0)); d.setTimestamp(timestamp); mutationList.add(new Mutation().setDeletion(d)); timestamp++; return this; }