Avi Kivity
53e0dc7530
bytes_ostream: base on managed_bytes
...
bytes_ostream is an incremental builder for a discontiguous byte container.
managed_bytes is a non-incremental (size must be known up front) byte
container, that is also compatible with LSA. So far, conversion between
them involves copying. This is unfortunate, since query_result is generated
as a bytes_ostream, but is later converted to managed_bytes (today, this
is done in cql3::expr::get_non_pk_values() and
compound_view_wrapper::explode(). If the two types could be made compatible,
we could use managed_bytes_view instead of creating new objects and avoid
a copy. It's also nicer to have one less vocabulary type.
This patch makes bytes_ostream use managed_bytes' internal representation
(blob_storage instead of bytes_ostream::chunk) and provides a conversion
to managed_bytes. All bytes_ostream users are left in place, but the goal
is to make bytes_ostream a write-only type with the only observer a conversion
to managed_bytes.
It turns out to be relatively simple. The internal representations were
already similar. I made blob_storage::ref_type self-initializing to
reduce churn (good practice anyway) and added a private constructor
to managed_bytes for the conversion.
Note that bytes_ostream can only be used to construct a non-LSA managed_bytes,
but LSA uses of managed_bytes are very strictly controlled (the entry
points to memtable and cache) so that's not a problem.
A unit test is added.
Closes #10986
2022-07-12 00:23:29 +03:00
..
2022-02-13 14:16:16 +02:00
2022-01-18 12:15:18 +01:00
2022-01-18 12:15:18 +01:00
2022-01-18 12:15:18 +01:00
2022-01-18 12:15:18 +01:00
2022-01-18 12:15:18 +01:00
2022-01-18 12:15:18 +01:00
2022-05-01 08:33:55 +03:00
2022-02-13 14:16:16 +02:00
2022-01-18 12:15:18 +01:00
2022-01-18 12:15:18 +01:00
2022-01-18 12:15:18 +01:00
2022-07-12 00:23:29 +03:00
2022-04-20 10:59:09 +03:00
2022-02-25 01:42:15 +01:00
2022-01-18 12:15:18 +01:00
2022-01-18 12:15:18 +01:00
2022-01-18 12:15:18 +01:00
2022-01-18 12:15:18 +01:00
2022-01-18 12:15:18 +01:00
2022-06-23 16:14:41 +02:00
2022-01-18 12:15:18 +01:00
2022-06-21 11:58:13 +03:00
2022-04-12 16:37:11 +03:00
2022-04-12 16:35:17 +03:00
2022-01-18 12:15:18 +01:00
2022-01-18 12:15:18 +01:00
2022-06-29 13:26:51 +03:00
2022-01-18 12:15:18 +01:00
2022-01-18 12:15:18 +01:00
2022-07-11 09:17:30 +02:00
2022-01-18 12:15:18 +01:00
2022-01-18 12:15:18 +01:00
2022-01-18 12:15:18 +01:00
2022-02-07 11:33:57 +02:00
2022-02-08 11:08:42 +01:00
2022-01-18 12:15:18 +01:00
2022-01-18 12:15:18 +01:00
2022-01-18 12:15:18 +01:00
2022-06-17 09:32:58 +02:00
2022-01-18 12:15:18 +01:00
2022-03-30 15:42:51 +03:00
2022-06-20 19:37:31 +03:00
2022-01-18 12:15:18 +01:00
2022-01-18 12:15:18 +01:00
2022-01-18 12:15:18 +01:00
2022-01-18 12:15:18 +01:00
2022-01-18 12:15:18 +01:00
2022-06-21 11:58:13 +03:00
2022-01-18 12:15:18 +01:00
2022-02-16 10:06:10 +02:00
2022-07-05 16:41:09 +02:00
2022-07-05 16:41:09 +02:00
2022-07-05 16:41:09 +02:00
2022-06-15 08:47:24 +02:00
2022-05-10 09:56:44 +03:00
2022-04-26 14:46:42 +03:00
2022-06-15 11:30:01 +02:00
2022-01-18 12:15:18 +01:00
2022-01-18 12:15:18 +01:00
2022-05-31 23:42:34 +03:00
2022-05-03 10:57:40 +03:00
2022-05-19 17:21:35 +03:00
2022-01-18 12:15:18 +01:00
2022-01-18 12:15:18 +01:00
2022-01-18 12:15:18 +01:00
2022-05-18 19:24:18 +03:00
2022-01-18 12:15:18 +01:00
2022-01-18 12:15:18 +01:00
2022-01-18 12:15:18 +01:00
2022-02-22 12:55:38 +01:00
2022-01-18 12:15:18 +01:00
2022-01-18 12:15:18 +01:00
2022-01-18 12:15:18 +01:00
2022-01-18 12:15:18 +01:00
2022-01-18 12:15:18 +01:00
2022-01-18 12:15:18 +01:00
2022-03-16 12:31:50 +03:00
2022-06-28 19:58:06 -03:00
2022-01-18 12:15:18 +01:00
2022-01-18 12:15:18 +01:00
2022-01-18 12:15:18 +01:00
2022-01-18 12:15:18 +01:00
2022-01-18 12:15:18 +01:00
2022-07-06 12:19:02 +03:00
2022-05-31 23:42:34 +03:00
2022-02-21 12:29:25 +02:00
2022-01-18 12:15:18 +01:00
2022-03-31 13:29:11 +03:00
2022-05-05 13:32:25 +03:00
2022-06-20 19:37:31 +03:00
2022-05-27 16:37:21 +03:00
2022-05-31 23:42:34 +03:00
2022-06-15 11:30:01 +02:00
2022-05-03 10:57:40 +03:00
2022-01-18 12:15:18 +01:00
2022-01-18 12:15:18 +01:00
2022-01-18 12:15:18 +01:00
2022-06-22 20:16:49 +02:00
2022-03-31 10:36:23 +03:00
2022-05-01 08:33:55 +03:00
2022-01-18 12:15:18 +01:00
2022-01-18 12:15:18 +01:00
2022-01-18 12:15:18 +01:00
2022-01-18 12:15:18 +01:00
2022-01-18 12:15:18 +01:00
2022-06-22 20:16:48 +02:00
2022-04-06 16:55:54 +03:00
2022-05-31 23:42:34 +03:00
2022-05-24 00:17:41 +02:00
2022-03-15 11:42:42 +02:00
2022-01-18 12:15:18 +01:00
2022-01-18 12:15:18 +01:00
2022-06-15 11:30:01 +02:00
2022-05-11 16:49:31 +02:00
2022-07-11 09:17:30 +02:00
2022-05-10 22:10:40 +03:00
2022-02-17 15:24:24 +02:00
2022-05-05 13:06:04 +03:00
2022-06-23 13:36:20 +03:00
2022-05-18 19:10:13 +03:00
2022-01-18 12:15:18 +01:00
2022-01-18 12:15:18 +01:00
2022-01-18 12:15:18 +01:00
2022-05-03 10:57:40 +03:00
2022-06-20 19:37:31 +03:00
2022-07-06 18:18:45 +03:00
2022-05-10 22:10:40 +03:00
2022-06-20 19:37:31 +03:00
2022-06-20 19:37:31 +03:00
2022-06-20 19:37:31 +03:00
2022-06-03 07:26:29 +03:00
2022-05-25 09:27:04 +03:00
2022-06-20 19:37:31 +03:00
2022-06-21 11:58:13 +03:00
2022-06-20 19:37:31 +03:00
2022-06-20 19:37:31 +03:00
2022-01-18 12:15:18 +01:00
2022-05-27 16:36:49 +02:00
2022-02-01 21:14:41 +01:00
2021-08-02 22:26:26 +03:00
2022-01-18 12:15:18 +01:00
2022-01-18 12:15:18 +01:00
2022-01-18 12:15:18 +01:00
2022-01-18 12:15:18 +01:00
2022-01-18 12:15:18 +01:00
2022-06-27 08:28:56 +03:00
2022-07-11 09:17:30 +02:00
2022-06-07 11:16:12 +02:00
2022-01-18 12:15:18 +01:00
2022-02-16 10:19:47 +02:00
2022-03-30 15:42:51 +03:00
2022-01-18 12:15:18 +01:00
2022-01-18 12:15:18 +01:00
2022-03-08 15:34:26 +02:00
2022-01-18 12:15:18 +01:00
2022-01-18 12:15:18 +01:00
2022-01-18 12:15:18 +01:00
2022-05-31 23:42:34 +03:00
2022-01-18 12:15:18 +01:00