1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab ft=cpp
5 * Ceph - scalable distributed file system
9 * See file COPYING for licensing information.
14 #include "include/common_fwd.h"
15 #include "common/Thread.h"
16 #include "rgw_frontend.h"
19 #include "arrow/status.h"
22 namespace rgw::flight
{
24 using FlightKey
= uint32_t;
25 extern const FlightKey null_flight_key
;
29 class FlightFrontend
: public RGWFrontend
{
31 static constexpr std::string_view server_thread_name
=
32 "Arrow Flight Server thread";
35 std::thread flight_thread
;
36 RGWFrontendConfig
* config
;
43 // port <= 0 means let server decide; typically 8077
44 FlightFrontend(RGWProcessEnv
& env
,
45 RGWFrontendConfig
* config
,
47 ~FlightFrontend() override
;
53 void pause_for_new_config() override
;
54 void unpause_with_new_config() override
;
55 }; // class FlightFrontend
57 class FlightGetObj_Filter
: public RGWGetObj_Filter
{
59 const RGWProcessEnv
& penv
;
62 uint64_t current_offset
;
63 uint64_t expected_size
;
65 std::string tenant_name
;
66 std::string bucket_name
;
67 rgw_obj_key object_key
;
68 std::string temp_file_name
;
69 std::ofstream temp_file
;
70 arrow::Status schema_status
;
71 rgw_user user_id
; // TODO: this should be removed when we do
72 // proper flight authentication
76 FlightGetObj_Filter(const req_state
* request
, RGWGetObj_Filter
* next
);
77 ~FlightGetObj_Filter();
79 int handle_data(bufferlist
& bl
, off_t bl_ofs
, off_t bl_len
) override
;
81 // this would allow the range to be modified if necessary;
82 int fixup_range(off_t
& ofs
, off_t
& end
) override
;
86 } // namespace rgw::flight