Commit Graph

17 Commits

Author SHA1 Message Date
Avi Kivity
6ca6f0c3a4 sstables: add conversion function from sstable key to partition key 2015-08-03 20:17:40 +03:00
Tomasz Grabiec
0b5f908a0b sstables: Make key_view comparable with partition_key_view 2015-07-22 10:27:48 +02:00
Asias He
fa2aee57ac utils: Move util/serialization.hh to utils/serialization.hh
Now we will not have the ugly utils and util directories, only utils.
2015-07-21 16:12:54 +08:00
Glauber Costa
f1bda42537 sstable: update marker in composite
We can insert markers in the end of composites, which can be used to identify
the presence of ranges in a column.

One option, would be to change all methods in sstables/key.hh to take an
optional marker parameter, and append that as the last marker.

But because we are talking about a single byte, and always added to the end,
it's a lot easier to allow the composite to be created normally, and then
replace the last byte with the marker.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-06-08 01:47:11 +03:00
Glauber Costa
b38748032a sstables: clean up sstable components code
Tomek got confused with the fact that we had to pass bytes_type for this code
to work. And well, that's understandable: that code evolved quite a bit since
its first user, and now the interface is not quite the best for the job,
forcing us to employ weird tricks like that for the code to work.

In this cleanup, I am creating a serializer object, that will encode
information about how to serialize the component passed. In the majority of the
cases, a simple sstable_serializer will just serialize to itself - accepting as
parameters byte_views.

In the case we need to operate on a deeply exploded view - the only case for
which we truly needed types, the respective serializer will take a types vector
and use it accordingly.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-06-08 01:47:11 +03:00
Glauber Costa
f7b9977830 sstables: extend composite::from_clustering_key
Make sure it is also suitable to operate on a clustering_key_prefix

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-06-08 01:47:11 +03:00
Glauber Costa
eaa61ba86c sstables: encode logic for creating a static key component in composite
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-05-25 21:09:39 -04:00
Glauber Costa
299a185376 sstable: create a key from an exploded view
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-05-25 21:02:55 -04:00
Glauber Costa
f04f7f2819 sstables: turn composite into a class
Encapsulating it into a composite class is a more natural way to handle this,
and will allow for extending that class later.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-05-25 20:58:50 -04:00
Glauber Costa
e69411cf32 sstables: allow a key_view to be exploded as well
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
Reviewed-by: Nadav Har'El <nyh@cloudius-systems.com>
2015-05-21 16:27:35 -04:00
Glauber Costa
c4dfefe3d1 sstable key: accept markers other than zero
Composites have an extra byte at the end of each element. The middle bytes
are expected to be zero, but the last one may not always be. In cases like
those of a range tombstone, we will have a marker with special significance.

Since we are exploding the composite into its components, we don't actually
need to retrieve it. We merely need to make sure that the marker is the one
we expect.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-05-13 17:14:03 -04:00
Avi Kivity
00dfa05833 Merge branch 'mutation-v2' of github.com:glommer/urchin into db
Read mutations from sstables, from Glauber.

Conflicts:
	sstables/key.cc
	sstables/key.hh
	sstables/sstables.cc
	sstables/sstables.hh

[avi: adjust sstables/partition.cc:149 for ambiguity due to new
      basic_sstring range constructor]
2015-05-05 17:17:08 +03:00
Glauber Costa
ea81c44095 sstable key: composite view
Can be used to parse a composite value (like a column name)

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-05-05 09:28:48 -04:00
Glauber Costa
d977220b8e sstable key: explode a partition key
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
Reviewed-by: Nadav Har'El <nyh@cloudius-systems.com>
2015-05-05 09:28:48 -04:00
Raphael S. Carvalho
e0949cdb82 sstables: add support to create composite from clustering_key
from_components() is made more generic so as to be re-used for
the creation of a composite from a clustering_key.

Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
Reviewed-by: Nadav Har'El <nyh@cloudius-systems.com>
2015-05-05 11:15:45 +03:00
Avi Kivity
65b8b19ca7 Merge branch 'tgrabiec/order-partitions-by-decorated-key' of github.com:cloudius-systems/seastar-dev into db
Use decorated_key in partition maps, from Tomasz:

"Partitions should be ordered using Origin's ordering, which is the natural
ordering of decorated_key. This is achieved by switching column_family's
partition map to use decorated_key instead of a bare partition_key.

This also includes some cleanups."

[avi] trivial adjustments to sstables/keys.cc
2015-04-25 19:22:51 +03:00
Glauber Costa
5b8b2e835a sstable: add sstable::key type
We have our own representation of a partition_key, clustering_key, etc. They
may different slightly from a legacy sstable key because we don't necessarily
serialize composites in our internal representation the same way as Origin
does. This patch encodes the Origin composite serialization, so we can create
keys that are compatible with Origin's understanding of what a partition key
should look like.

This whould be used when serializing or deserializing to/from an sstable.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-04-24 10:11:49 -04:00