]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
cls/fifo: FIFO over RADOS
authorYehuda Sadeh <yehuda@redhat.com>
Thu, 5 Sep 2019 11:15:15 +0000 (04:15 -0700)
committerAdam C. Emerson <aemerson@redhat.com>
Wed, 9 Sep 2020 02:09:40 +0000 (22:09 -0400)
commit55255343f786057f6b87d1352473d554cfe68eb2
tree8520166b9bc1cb9c351d00a573f7f77cb0c72ad5
parenta29695e82ec8a93b000322773949f30694abf3d3
cls/fifo: FIFO over RADOS

This is an implementation of fifo queue over rados. Data is appended
to rados object until it's full. At that point data will be written to
a new object. Data is read from the tail sequentially (can be iterated
using marker). Data can be trimmed (up to and including marker).

Queue has a header object (meta), and zero or more data objects (parts).

The software has two layers: the higher level client operations side
that deals with the application apis, and manages the meta and parts,
and there’s the objclass level that deals with the rados layout of
meta and part objects. There are different objclass methods that deal
with reading and modifying each of these entities.

A single part has max possible size, however, it may become full once
a certain smaller size is reached (full_size_threshold). It is
imperative that once a part has reached its capacity, it will not
allow any more writes into it. For this reason, it is important that
data being written to the queue does not exceed max_entry_size . This
is enforced, by the higher level client api.

Written entries go to the current head object, and when it’s full, a
new head part is created. When listing entries, data is iterated from
tail to the current head. Trim can either change the pointer within
the current tail object, and if needed it removes tail objects.

A unitest has been created to test functionality.

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
Squashed-by: Adam C. Emerson <aemerson@redhat.com>
src/cls/CMakeLists.txt
src/cls/fifo/cls_fifo.cc [new file with mode: 0644]
src/cls/fifo/cls_fifo_client.cc [new file with mode: 0644]
src/cls/fifo/cls_fifo_client.h [new file with mode: 0644]
src/cls/fifo/cls_fifo_ops.cc [new file with mode: 0644]
src/cls/fifo/cls_fifo_ops.h [new file with mode: 0644]
src/cls/fifo/cls_fifo_types.cc [new file with mode: 0644]
src/cls/fifo/cls_fifo_types.h [new file with mode: 0644]
src/test/CMakeLists.txt
src/test/cls_fifo/CMakeLists.txt [new file with mode: 0644]
src/test/cls_fifo/test_cls_fifo.cc [new file with mode: 0644]