Skip to content

Commit 0ea9033

Browse files
committed
Fix using namespace arrow, arrow::io
1 parent ead329b commit 0ea9033

File tree

2 files changed

+19
-20
lines changed

2 files changed

+19
-20
lines changed

Framework/Core/include/Framework/FairMQResizableBuffer.h

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,19 @@
2424
namespace o2::framework
2525
{
2626

27-
using namespace arrow;
28-
using namespace arrow::io;
29-
30-
class FairMQOutputStream : public OutputStream
27+
class FairMQOutputStream : public arrow::io::OutputStream
3128
{
3229
public:
33-
explicit FairMQOutputStream(const std::shared_ptr<ResizableBuffer>& buffer);
30+
explicit FairMQOutputStream(const std::shared_ptr<arrow::ResizableBuffer>& buffer);
3431

3532
/// \brief Create in-memory output stream with indicated capacity using a
3633
/// memory pool
3734
/// \param[in] initial_capacity the initial allocated internal capacity of
3835
/// the OutputStream
3936
/// \param[in,out] pool a MemoryPool to use for allocations
4037
/// \return the created stream
41-
static Result<std::shared_ptr<FairMQOutputStream>> Create(
42-
int64_t initial_capacity = 4096, MemoryPool* pool = default_memory_pool());
38+
static arrow::Result<std::shared_ptr<FairMQOutputStream>> Create(
39+
int64_t initial_capacity = 4096, arrow::MemoryPool* pool = arrow::default_memory_pool());
4340

4441
// By the time we call the destructor, the contents
4542
// of the buffer are already moved to fairmq
@@ -49,34 +46,34 @@ class FairMQOutputStream : public OutputStream
4946
// Implement the OutputStream interface
5047

5148
/// Close the stream, preserving the buffer (retrieve it with Finish()).
52-
Status Close() override;
49+
arrow::Status Close() override;
5350
[[nodiscard]] bool closed() const override;
54-
[[nodiscard]] Result<int64_t> Tell() const override;
55-
Status Write(const void* data, int64_t nbytes) override;
51+
[[nodiscard]] arrow::Result<int64_t> Tell() const override;
52+
arrow::Status Write(const void* data, int64_t nbytes) override;
5653

5754
/// \cond FALSE
5855
using OutputStream::Write;
5956
/// \endcond
6057

6158
/// Close the stream and return the buffer
62-
Result<std::shared_ptr<Buffer>> Finish();
59+
arrow::Result<std::shared_ptr<arrow::Buffer>> Finish();
6360

6461
/// \brief Initialize state of OutputStream with newly allocated memory and
6562
/// set position to 0
6663
/// \param[in] initial_capacity the starting allocated capacity
6764
/// \param[in,out] pool the memory pool to use for allocations
6865
/// \return Status
69-
Status Reset(int64_t initial_capacity = 1024, MemoryPool* pool = default_memory_pool());
66+
arrow::Status Reset(int64_t initial_capacity = 1024, arrow::MemoryPool* pool = arrow::default_memory_pool());
7067

7168
[[nodiscard]] int64_t capacity() const { return capacity_; }
7269

7370
private:
7471
FairMQOutputStream();
7572

7673
// Ensures there is sufficient space available to write nbytes
77-
Status Reserve(int64_t nbytes);
74+
arrow::Status Reserve(int64_t nbytes);
7875

79-
std::shared_ptr<ResizableBuffer> buffer_;
76+
std::shared_ptr<arrow::ResizableBuffer> buffer_;
8077
bool is_open_;
8178
int64_t capacity_;
8279
int64_t position_;

Framework/Core/src/FairMQResizableBuffer.cxx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
#include <cassert>
1717
#include <utility>
1818

19+
using arrow::Status;
20+
1921
namespace arrow::io::internal
2022
{
2123
void CloseFromDestructor(FileInterface* file);
@@ -28,23 +30,23 @@ static constexpr int64_t kBufferMinimumSize = 256;
2830
FairMQOutputStream::FairMQOutputStream()
2931
: is_open_(false), capacity_(0), position_(0), mutable_data_(nullptr) {}
3032

31-
FairMQOutputStream::FairMQOutputStream(const std::shared_ptr<ResizableBuffer>& buffer)
33+
FairMQOutputStream::FairMQOutputStream(const std::shared_ptr<arrow::ResizableBuffer>& buffer)
3234
: buffer_(buffer),
3335
is_open_(true),
3436
capacity_(buffer->size()),
3537
position_(0),
3638
mutable_data_(buffer->mutable_data()) {}
3739

38-
Result<std::shared_ptr<FairMQOutputStream>> FairMQOutputStream::Create(
39-
int64_t initial_capacity, MemoryPool* pool)
40+
arrow::Result<std::shared_ptr<FairMQOutputStream>> FairMQOutputStream::Create(
41+
int64_t initial_capacity, arrow::MemoryPool* pool)
4042
{
4143
// ctor is private, so cannot use make_shared
4244
auto ptr = std::shared_ptr<FairMQOutputStream>(new FairMQOutputStream);
4345
RETURN_NOT_OK(ptr->Reset(initial_capacity, pool));
4446
return ptr;
4547
}
4648

47-
Status FairMQOutputStream::Reset(int64_t initial_capacity, MemoryPool* pool)
49+
Status FairMQOutputStream::Reset(int64_t initial_capacity, arrow::MemoryPool* pool)
4850
{
4951
ARROW_ASSIGN_OR_RAISE(buffer_, AllocateResizableBuffer(initial_capacity, pool));
5052
is_open_ = true;
@@ -67,15 +69,15 @@ Status FairMQOutputStream::Close()
6769

6870
bool FairMQOutputStream::closed() const { return !is_open_; }
6971

70-
Result<std::shared_ptr<Buffer>> FairMQOutputStream::Finish()
72+
arrow::Result<std::shared_ptr<arrow::Buffer>> FairMQOutputStream::Finish()
7173
{
7274
RETURN_NOT_OK(Close());
7375
buffer_->ZeroPadding();
7476
is_open_ = false;
7577
return std::move(buffer_);
7678
}
7779

78-
Result<int64_t> FairMQOutputStream::Tell() const { return position_; }
80+
arrow::Result<int64_t> FairMQOutputStream::Tell() const { return position_; }
7981

8082
Status FairMQOutputStream::Write(const void* data, int64_t nbytes)
8183
{

0 commit comments

Comments
 (0)