column.setTtl(ttl);
/** * Set the time-to-live value for this column in seconds. * The server will mark this column as deleted once the number of seconds has elapsed. */ @Override public HColumn<N,V> setTtl(int ttl) { this.column.setTtl(ttl); return this; }
@Override public HColumn<N, V> apply(V value, long clock, int ttl) { setValue(value); column.setTimestamp(clock); column.setTtl(ttl); return this; }
/** * Prepare column. * * @param value * the value * @param name * the name * @param timestamp * the timestamp * @param ttl * TODO * @return the column */ private Column prepareColumn(byte[] value, byte[] name, long timestamp, int ttl) { Column column = new Column(); column.setName(name); column.setValue(value); column.setTimestamp(timestamp); if (ttl != 0) { column.setTtl(ttl); } return column; }
/** * Set the time-to-live value for this column in seconds. * The server will mark this column as deleted once the number of seconds has elapsed. */ @Override public HColumn<N,V> setTtl(int ttl) { this.column.setTtl(ttl); return this; }
/** * Set the time-to-live value for this column in seconds. * The server will mark this column as deleted once the number of seconds has elapsed. */ @Override public HColumn<N,V> setTtl(int ttl) { this.column.setTtl(ttl); return this; }
@Override public HColumn<N, V> apply(V value, long clock, int ttl) { setValue(value); column.setTimestamp(clock); column.setTtl(ttl); return this; }
@Override public HColumn<N, V> apply(V value, long clock, int ttl) { setValue(value); column.setTimestamp(clock); column.setTtl(ttl); 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; }
@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; }
@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; }
@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; }
@Override public ColumnListMutation<C> putEmptyColumn(C columnName, Integer ttl) { Preconditions.checkNotNull(columnName, "Column name cannot be null"); Column column = new Column(); column.setName(columnSerializer.toByteBuffer(columnName)); if (column.getName().length == 0) { throw new RuntimeException("Column name cannot be empty"); } column.setValue(ThriftUtils.EMPTY_BYTE_BUFFER); column.setTimestamp(timestamp); if (ttl != null) { // Treat TTL of 0 or -1 as no TTL if (ttl > 0) column.setTtl(ttl); } else if (defaultTtl != null) column.setTtl(defaultTtl); // 2. Create a mutation and append to the mutation list. Mutation mutation = new Mutation(); mutation.setColumn_or_supercolumn(new ColumnOrSuperColumn().setColumn(column)); mutationList.add(mutation); return this; }
@Override public ColumnListMutation<C> putEmptyColumn(C columnName, Integer ttl) { Preconditions.checkNotNull(columnName, "Column name cannot be null"); Column column = new Column(); column.setName(columnSerializer.toByteBuffer(columnName)); if (column.getName().length == 0) { throw new RuntimeException("Column name cannot be empty"); } column.setValue(ThriftUtils.EMPTY_BYTE_BUFFER); column.setTimestamp(timestamp); if (ttl != null) { // Treat TTL of 0 or -1 as no TTL if (ttl > 0) column.setTtl(ttl); } else if (defaultTtl != null) column.setTtl(defaultTtl); // 2. Create a mutation and append to the mutation list. Mutation mutation = new Mutation(); mutation.setColumn_or_supercolumn(new ColumnOrSuperColumn().setColumn(column)); mutationList.add(mutation); return this; }
private Column thriftifySubColumn(LegacyLayout.LegacyCell cell, ByteBuffer name) { assert !cell.isCounter(); Column thrift_column = new Column(name).setValue(cell.value).setTimestamp(cell.timestamp); if (cell.isExpiring()) thrift_column.setTtl(cell.ttl); return thrift_column; }
private Column thriftifySubColumn(LegacyLayout.LegacyCell cell, ByteBuffer name) { assert !cell.isCounter(); Column thrift_column = new Column(name).setValue(cell.value).setTimestamp(cell.timestamp); if (cell.isExpiring()) thrift_column.setTtl(cell.ttl); return thrift_column; }
/** * Prepare column. * * @param value * the value * @param name * the name * @param timestamp * the timestamp * @param ttl * TODO * @return the column */ private Column prepareColumn(byte[] value, byte[] name, long timestamp, int ttl) { Column column = new Column(); column.setName(name); column.setValue(value); column.setTimestamp(timestamp); if (ttl != 0) column.setTtl(ttl); return column; }
@Override public <V> ColumnListMutation<C> putColumn(C columnName, V value, Serializer<V> valueSerializer, Integer ttl) { Preconditions.checkNotNull(columnName, "Column name cannot be null"); // 1. Set up the column with all the data Column column = new Column(); column.setName(columnSerializer.toByteBuffer(columnName)); if (column.getName().length == 0) { throw new RuntimeException("Column name cannot be empty"); } if (value == null) column.setValue(ThriftUtils.EMPTY_BYTE_BUFFER); else column.setValue(valueSerializer.toByteBuffer(value)); column.setTimestamp(timestamp); if (ttl != null) { // Treat TTL of 0 or -1 as no TTL if (ttl > 0) column.setTtl(ttl); } else if (defaultTtl != null) column.setTtl(defaultTtl); // 2. Create a mutation and append to the mutation list. Mutation mutation = new Mutation(); mutation.setColumn_or_supercolumn(new ColumnOrSuperColumn().setColumn(column)); mutationList.add(mutation); return this; }
@Override public <V> ColumnListMutation<C> putColumn(C columnName, V value, Serializer<V> valueSerializer, Integer ttl) { Preconditions.checkNotNull(columnName, "Column name cannot be null"); // 1. Set up the column with all the data Column column = new Column(); column.setName(columnSerializer.toByteBuffer(columnName)); if (column.getName().length == 0) { throw new RuntimeException("Column name cannot be empty"); } if (value == null) column.setValue(ThriftUtils.EMPTY_BYTE_BUFFER); else column.setValue(valueSerializer.toByteBuffer(value)); column.setTimestamp(timestamp); if (ttl != null) { // Treat TTL of 0 or -1 as no TTL if (ttl > 0) column.setTtl(ttl); } else if (defaultTtl != null) column.setTtl(defaultTtl); // 2. Create a mutation and append to the mutation list. Mutation mutation = new Mutation(); mutation.setColumn_or_supercolumn(new ColumnOrSuperColumn().setColumn(column)); mutationList.add(mutation); return this; }
private Column thriftifySubColumn(Cell cell) { assert !(cell instanceof CounterCell); Column thrift_column = new Column(cell.name().toByteBuffer()).setValue(cell.value()).setTimestamp(cell.timestamp()); if (cell instanceof ExpiringCell) { thrift_column.setTtl(((ExpiringCell) cell).getTimeToLive()); } return thrift_column; }