We now have partition_key_view, clustering_key_view, etc.
Database APIs will be extended to also accept views.
This will alows us to avoid allocations in certain scenarios.
Generic read-all-stream from a commit log segmen file.
Provides a byte view for each data entry, doing CRC checks and padding skips.
Signed-off-by: Calle Wilund <calle@cloudius-systems.com>
write() takes a reference to deletion_time which means that the
object must survive until the continuation is scheduled.
This patch fix the problem the use of do_with().
The problem was making debug version of urchin tests fail.
Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
In preparation for multiple memtables, move column_family::partitions into
its own class, and forward relevant calls from column_family.
A testonly_all_memtables() function was added to support sstable_test.
Currently we use the first byte of the token for determining the local
shard. This is suboptimal for two reasons:
1. the first bytes of the token were already used to select the node,
so they are not randomly distributed
2. using a single byte is not sufficient for large core counts, as the
modulo operation will not return evenly distributed results
Fix by using the final two bytes of the token.
This adds a static method to return a range object to smp.
with this patch it is possible to use:
for (auto i : smp::all_cpus())
Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
Fix replication strategy class lookup to support unqualified names such
as "SimpleStrategy". The AbstractReplicationStrategy.getClass() method
in origin does the same thing.
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
A lookup can cause several data sources to be merged, in which case we will
have to return a temporary (containing data from all the data sources).
For simplicity, we start by always returning a temporary.
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 ...