use of org.apache.cassandra.io.util.DataOutputBufferFixed in project cassandra by apache.
the class MutationBench method setup.
@Setup
public void setup() throws IOException {
Schema.instance.load(KeyspaceMetadata.create(keyspace, KeyspaceParams.simple(1)));
KeyspaceMetadata ksm = Schema.instance.getKeyspaceMetadata(keyspace);
TableMetadata metadata = CreateTableStatement.parse("CREATE TABLE userpics " + "( userid bigint," + "picid bigint," + "commentid bigint, " + "PRIMARY KEY(userid, picid))", keyspace).build();
Schema.instance.load(ksm.withSwapped(ksm.tables.with(metadata)));
mutation = (Mutation) UpdateBuilder.create(metadata, 1L).newRow(1L).add("commentid", 32L).makeMutation();
messageOut = mutation.createMessage();
buffer = ByteBuffer.allocate(messageOut.serializedSize(MessagingService.current_version));
outputBuffer = new DataOutputBufferFixed(buffer);
inputBuffer = new DataInputBuffer(buffer, false);
messageOut.serialize(outputBuffer, MessagingService.current_version);
}
Aggregations