This runs the file transformer on a file before returning the result.
This is used for templating support.
Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
Instead of using do_with(), we open-code it and do it badly, dropping
the reference count on the remote shard.
Fix by dropping the reference count on the local core.
Use std::unordered_map instead of boost:bimap. std::unordered_map is
much much easier to use. It is a premature optimization to user bimap.
We can iterate the map to check if host_id is unique. Modification of
host_id is not a frequent or performance sensitive operation anyway.
We still need a lot of functions in Origin. Import the complete
TokenMetadata.java and convert as needed. For example, storage_service
will need updateHostId, addBootstrapTokens and more.
Empty parameter definition is not accepted by the swagger UI, instead,
the parameter list itself should be empty.
Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
From Amnon:
"This seriese adds functionality to the storage_service API. It focus on tokens
information, that are partially supported in the storage_service and the call
to the API will return an empty list."
After commit 3ae81e68a0, we already support
in input_stream::consume() the possibility of the consumer blocking by
returning a future. But the code for sstable consumption had now way to
use this capability. This patch adds a future<> return code for
consume_row_end(), allowing the consumer to pause after reading each
sstable row (but not, currently, after each cell in the row).
We also need to use this capability in read_range_rows(), which wrongly
ignored the future<> returned by the "walker" function - now this future<>
is returned to the sstable reader, and causes it to pause reading until
the future is fulfilled.
Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
The current scheme of creating temporary files inside the current directory is
very fragile.
First, whenever we start writing new files, the test breaks if we forget to
include it in the list of removed files (likely).
Second, because we have to manually delete the files after we're done with
them, we can either forget, or if the test crashes, the final condition may not
run.
Instead of doing that, let's move the files to a separate directory. That makes
it a lot easier to make sure we're deleting all the relevant files, because we
can just wipe out the whole directory.
All tests are then wrapped in a function that makes sure that the proper setup
is in place.
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
remove() is a convenient glibc wrapper that will unlink() a file and rmdir() a
directory. It will allow us to operate on both without creating a separate
function for a directory.
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>