JayjeetAtGithub commented on a change in pull request #10913:
URL: https://github.com/apache/arrow/pull/10913#discussion_r693377153



##########
File path: cpp/src/skyhook/protocol/rados_protocol.h
##########
@@ -0,0 +1,165 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+#pragma once
+
+#include <rados/librados.hpp>
+
+#include "arrow/status.h"
+
+#include "skyhook/client/file_skyhook.h"
+
+namespace skyhook {
+namespace rados {
+
+/// Wrap Arrow Status with a custom return code.
+class RadosStatus {
+ public:
+  RadosStatus(arrow::Status s, int code) : s_(s), code_(code) {}
+  arrow::Status status() { return s_; }
+  int code() { return code_; }
+
+ private:
+  arrow::Status s_;
+  int code_;
+};
+
+class IoCtxInterface {
+ public:
+  IoCtxInterface() {}
+
+  /// \brief Write data to an object.
+  ///
+  /// \param[in] oid the ID of the object to write.
+  /// \param[in] bl a bufferlist containing the data to write to the object.
+  virtual RadosStatus write_full(const std::string& oid, ceph::bufferlist& bl) 
= 0;
+
+  /// \brief Read a RADOS object.
+  ///
+  /// \param[in] oid the object ID which to read.
+  /// \param[in] bl a bufferlist to hold the contents of the read object.
+  /// \param[in] len the length of data to read from an object.
+  /// \param[in] offset the offset of the object to read from.
+  virtual RadosStatus read(const std::string& oid, ceph::bufferlist& bl, 
size_t len,
+                           uint64_t offset) = 0;
+
+  /// \brief Executes a CLS function.
+  ///
+  /// \param[in] oid the object ID on which to execute the CLS function.
+  /// \param[in] cls the name of the CLS.
+  /// \param[in] method the name of the CLS function.
+  /// \param[in] in a bufferlist to send data to the CLS function.
+  /// \param[in] out a bufferlist to recieve data from the CLS function.
+  virtual RadosStatus exec(const std::string& oid, const char* cls, const 
char* method,
+                           ceph::bufferlist& in, ceph::bufferlist& out) = 0;
+
+  virtual std::vector<std::string> list() = 0;

Review comment:
       it is a list of object ids

##########
File path: cpp/src/skyhook/protocol/rados_protocol.h
##########
@@ -0,0 +1,165 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+#pragma once
+
+#include <rados/librados.hpp>
+
+#include "arrow/status.h"
+
+#include "skyhook/client/file_skyhook.h"
+
+namespace skyhook {
+namespace rados {
+
+/// Wrap Arrow Status with a custom return code.
+class RadosStatus {
+ public:
+  RadosStatus(arrow::Status s, int code) : s_(s), code_(code) {}
+  arrow::Status status() { return s_; }
+  int code() { return code_; }
+
+ private:
+  arrow::Status s_;
+  int code_;
+};
+
+class IoCtxInterface {
+ public:
+  IoCtxInterface() {}
+
+  /// \brief Write data to an object.
+  ///
+  /// \param[in] oid the ID of the object to write.
+  /// \param[in] bl a bufferlist containing the data to write to the object.
+  virtual RadosStatus write_full(const std::string& oid, ceph::bufferlist& bl) 
= 0;
+
+  /// \brief Read a RADOS object.
+  ///
+  /// \param[in] oid the object ID which to read.
+  /// \param[in] bl a bufferlist to hold the contents of the read object.
+  /// \param[in] len the length of data to read from an object.
+  /// \param[in] offset the offset of the object to read from.
+  virtual RadosStatus read(const std::string& oid, ceph::bufferlist& bl, 
size_t len,
+                           uint64_t offset) = 0;
+
+  /// \brief Executes a CLS function.
+  ///
+  /// \param[in] oid the object ID on which to execute the CLS function.
+  /// \param[in] cls the name of the CLS.
+  /// \param[in] method the name of the CLS function.
+  /// \param[in] in a bufferlist to send data to the CLS function.
+  /// \param[in] out a bufferlist to recieve data from the CLS function.
+  virtual RadosStatus exec(const std::string& oid, const char* cls, const 
char* method,
+                           ceph::bufferlist& in, ceph::bufferlist& out) = 0;
+
+  virtual std::vector<std::string> list() = 0;

Review comment:
       I think I can remove this though
   




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to