@Test public void createColumnWithGivenValueCreatesItWithAssociatedCassandraTimestamp() { assertThat(CassandraKeyValueServices.createColumn(CELL, Value.create(DATA, 1000)).getTimestamp()) .isEqualTo(1000); assertThat(CassandraKeyValueServices.createColumn(CELL, Value.create(DATA, 5000)).getTimestamp()) .isEqualTo(5000); }
e.getValue(), overrideTimestamp) : CassandraKeyValueServices.createColumn(cell, e.getValue());
e.getValue(), overrideTimestamp) : CassandraKeyValueServices.createColumn(cell, e.getValue());
private MutationMap convertToMutations(List<TableCellAndValue> batch, long timestamp) { MutationMap mutationMap = new MutationMap(); for (TableCellAndValue tableCellAndValue : batch) { Cell cell = tableCellAndValue.cell; Column col = CassandraKeyValueServices.createColumn( cell, Value.create(tableCellAndValue.value, timestamp)); ColumnOrSuperColumn colOrSup = new ColumnOrSuperColumn(); colOrSup.setColumn(col); Mutation mutation = new Mutation(); mutation.setColumn_or_supercolumn(colOrSup); mutationMap.addMutationForCell(cell, tableCellAndValue.tableRef, mutation); } return mutationMap; }
private MutationMap convertToMutations(List<TableCellAndValue> batch, long timestamp) { MutationMap mutationMap = new MutationMap(); for (TableCellAndValue tableCellAndValue : batch) { Cell cell = tableCellAndValue.cell; Column col = CassandraKeyValueServices.createColumn( cell, Value.create(tableCellAndValue.value, timestamp)); ColumnOrSuperColumn colOrSup = new ColumnOrSuperColumn(); colOrSup.setColumn(col); Mutation mutation = new Mutation(); mutation.setColumn_or_supercolumn(colOrSup); mutationMap.addMutationForCell(cell, tableCellAndValue.tableRef, mutation); } return mutationMap; }