use of com.datastax.oss.protocol.internal.response.result.DefaultRows in project java-driver by datastax.
the class ReprepareOnUpTest method preparedIdRows.
private Rows preparedIdRows(char... values) {
ColumnSpec preparedIdSpec = new ColumnSpec("system", "prepared_statements", "prepared_id", 0, RawType.PRIMITIVES.get(ProtocolConstants.DataType.BLOB));
RowsMetadata rowsMetadata = new RowsMetadata(ImmutableList.of(preparedIdSpec), null, null, null);
Queue<List<ByteBuffer>> data = new ArrayDeque<>();
for (char value : values) {
data.add(ImmutableList.of(Bytes.fromHexString("0x0" + value)));
}
return new DefaultRows(rowsMetadata, data);
}
use of com.datastax.oss.protocol.internal.response.result.DefaultRows in project java-driver by datastax.
the class TestResponses method clusterNameResponse.
/**
* The response to the query run by each connection to check if the cluster name matches.
*/
public static Rows clusterNameResponse(String actualClusterName) {
ColumnSpec colSpec = new ColumnSpec("system", "local", "cluster_name", 0, RawType.PRIMITIVES.get(ProtocolConstants.DataType.VARCHAR));
RowsMetadata metadata = new RowsMetadata(ImmutableList.of(colSpec), null, null, null);
Queue<List<ByteBuffer>> data = Lists.newLinkedList();
data.add(Lists.newArrayList(ByteBuffer.wrap(actualClusterName.getBytes(Charsets.UTF_8))));
return new DefaultRows(metadata, data);
}
Aggregations