Ensure that read-side accessors are const. This is important in preparation
for multiple memtables (and later, sstables) since a read-side
mutation_partition may be a temporary object coming from multiple memtables
(and sstables) while a write-side mutation_partition is guaranteed to belong
to a single memtable (and thus, not be temporary).
Since writers will want non-const mutation_partitions to write to, they won't
be able to use the read-side accessors by accident.
pop_front() is a more relaxed requirement than erase() -- it is provided
by more containers, specifically boost::iterator_range<>, which we'd like
to use.
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]
In some situations, we already have the token computed, and there is no need to
compute it again during binary search. As a matter of fact, even in the
simplest of the situations, we'll run a binary search over the summary, and if
the key is believed to be in a particular bucket, we will run a search over the
index. That's two token computations right away.
It would be better to have an interface that allows the token to be passed
directly if known. We provide a wrapper that allows the binary search to
operate on a key only.
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
From Avi:
'''
start() returns immediately, then the listen object is destroyed (it is
on the stack), then the lambda runs. [&] is also very dangerous.
'''
This fixes a bug in initialization of messaging_service.
[asias@hjpc urchin]$ ./message --listen-address 127.0.0.100
listen =127.0.0.100
protocol::server::server: addr=127.0.0.100:7000
opts.reuse_address=1, _reuseport=1
messaging_service on cpu_id=0, ip=127.0.0.100,
listen_address=127.0.0.100
protocol::server::server: addr=0.36.145.24:7000
opts.reuse_address=1, _reuseport=1
messaging_service on cpu_id=1, ip=0.36.145.24,
listen_address=0.36.145.24
Messaging server listening on port 7000 ...
Each testcase generates a data file from a given schema + a mutation,
and then check the correctness of the generated data file.
The data used to check the correctness of the generated data file
is from C* data file itself.
Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
This initial version supports:
Regular columns
Clustering key
Compound Partition key
Compound Clustering key
Static Row
What's not supported:
Counters
Range tombstones
Collections
Compression
anything else that wasn't mentioned in the support list.
The generation of the data file consists of iterating through
a set of mutation_partition from a column_family, then writing
the SSTable rows according to the format.
Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
Reviewed-by: Nadav Har'El <nyh@cloudius-systems.com>
tombstone from mutation partition is also used for static row purposes,
but under the hood, it's the partition tombstone.
Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
disk_string provides an easy way of serializing a string into the form
{ size, string[size] }. sstables::key, atomic_cell, among other types
provides a bytes_view for the view of data, so that's why this change
is needed. Otherwise, I would have to convert bytes_view into bytes,
which requires copy.
Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
Reviewed-by: Nadav Har'El <nyh@cloudius-systems.com>
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>
There is one gossiper instance per node and it runs on cpu0 only. We can
not guarantee there will always be a core to core tcp connection within
messaging service, so messaging service needs to listen on all cpus.
When a remote node connects to local node with a connection bound to cpu
other than cpu0, we need to forward this message to cpu0.
The nature of how boost::program_options are applied made
alias definitions clash and overwrite each other.
Make aliases not have default, and overrride bpo handling
of defaults so that they are not applied to the config object
(only used in pretty-print)
Signed-off-by: Calle Wilund <calle@cloudius-systems.com>
message_service: create object using placement new()
Object reference may point to a unit member that was not properly
created, so assign will not work on it. Use placement new() instead.
db/config.o db/config.cc
db/config.cc:6:27: fatal error: yaml-cpp/yaml.h: No such file or directory
#include <yaml-cpp/yaml.h>
^
A README for Urchin is added.
Use a semaphore as gatekeeper to make sure we finish creating a segment
before starting a new one.
Signed-off-by: Calle Wilund <calle@cloudius-systems.com>
Currently it is not possible because a type is instantiated before been
deserialized. Fix that by allocating space for an object by using
std::aligned_storage.
It would be useful in some situations to know where does the data ends. If the
file is uncompressed, this is equivalent to the file length. If the data file
is compressed, this information needs to come from the compression structure.
Provide a method that encodes that.
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
compare_unsigned cannot be used directly on a token. We need to use the
dht-provided token comparators.
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>