From d57ff5e2afe4d20f5c7144196d4d78a7a14cfdc8 Mon Sep 17 00:00:00 2001 From: "Siyuan (Ryans) Zhuang" Date: Tue, 14 Jul 2020 00:57:42 -0700 Subject: [PATCH] Remove legacy C++ code (#9459) --- BUILD.bazel | 25 -- ...org_apache_arrow_plasma_PlasmaClientJNI.cc | 245 ------------------ .../org_apache_arrow_plasma_PlasmaClientJNI.h | 132 ---------- src/ray/raylet/mock_gcs_client.cc | 133 ---------- src/ray/raylet/mock_gcs_client.h | 102 -------- 5 files changed, 637 deletions(-) delete mode 100644 src/ray/object_manager/plasma/lib/java/org_apache_arrow_plasma_PlasmaClientJNI.cc delete mode 100644 src/ray/object_manager/plasma/lib/java/org_apache_arrow_plasma_PlasmaClientJNI.h delete mode 100644 src/ray/raylet/mock_gcs_client.cc delete mode 100644 src/ray/raylet/mock_gcs_client.h diff --git a/BUILD.bazel b/BUILD.bazel index dc93384f1..0373f61cc 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -320,21 +320,6 @@ cc_library( ], ) -cc_binary( - name = "libplasma_java.so", - srcs = [ - "src/ray/object_manager/plasma/lib/java/org_apache_arrow_plasma_PlasmaClientJNI.cc", - "src/ray/object_manager/plasma/lib/java/org_apache_arrow_plasma_PlasmaClientJNI.h", - ":jni.h", - ":jni_md.h", - ], - copts = PLASMA_COPTS, - includes = ["src/ray/object_manager/plasma/lib/java"], - linkshared = 1, - linkstatic = 1, - deps = [":plasma_client"], -) - copy_file( name = "copy_jni_h", src = "@bazel_tools//tools/jdk:jni_header", @@ -351,14 +336,6 @@ copy_file( out = "jni_md.h", ) -genrule( - name = "plasma-jni-darwin-compat", - srcs = [":libplasma_java.so"], - outs = ["libplasma_java.dylib"], - cmd = "cp $< $@", - output_to_bindir = 1, -) - cc_library( name = "ae", srcs = [ @@ -618,8 +595,6 @@ cc_library( "src/ray/raylet/*.cc", ], exclude = [ - "src/ray/raylet/mock_gcs_client.cc", - "src/ray/raylet/monitor*.cc", "src/ray/raylet/*_test.cc", "src/ray/raylet/main.cc", ], diff --git a/src/ray/object_manager/plasma/lib/java/org_apache_arrow_plasma_PlasmaClientJNI.cc b/src/ray/object_manager/plasma/lib/java/org_apache_arrow_plasma_PlasmaClientJNI.cc deleted file mode 100644 index d2ddd8ed7..000000000 --- a/src/ray/object_manager/plasma/lib/java/org_apache_arrow_plasma_PlasmaClientJNI.cc +++ /dev/null @@ -1,245 +0,0 @@ -// 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. - -#include "org_apache_arrow_plasma_PlasmaClientJNI.h" - -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include "ray/common/status.h" -#include "ray/object_manager/plasma/client.h" - -using ray::ObjectID; -using ray::Status; - -constexpr jsize OBJECT_ID_SIZE = sizeof(ObjectID) / sizeof(jbyte); - -inline void jbyteArray_to_object_id(JNIEnv* env, jbyteArray a, ObjectID* oid) { - env->GetByteArrayRegion(a, 0, OBJECT_ID_SIZE, reinterpret_cast(oid)); -} - -inline void object_id_to_jbyteArray(JNIEnv* env, jbyteArray a, ObjectID* oid) { - env->SetByteArrayRegion(a, 0, OBJECT_ID_SIZE, reinterpret_cast(oid)); -} - -inline void throw_exception_if_not_OK(JNIEnv* env, const Status& status) { - if (!status.ok()) { - jclass Exception = - env->FindClass("org/apache/arrow/plasma/exceptions/PlasmaClientException"); - env->ThrowNew(Exception, status.message().c_str()); - } -} - -class JByteArrayGetter { - private: - JNIEnv* _env; - jbyteArray _a; - jbyte* bp; - - public: - JByteArrayGetter(JNIEnv* env, jbyteArray a, jbyte** out) { - _env = env; - _a = a; - - bp = _env->GetByteArrayElements(_a, nullptr); - *out = bp; - } - - ~JByteArrayGetter() { _env->ReleaseByteArrayElements(_a, bp, 0); } -}; - -JNIEXPORT jlong JNICALL Java_org_apache_arrow_plasma_PlasmaClientJNI_connect( - JNIEnv* env, jclass cls, jstring store_socket_name, jstring manager_socket_name, - jint release_delay) { - const char* s_name = env->GetStringUTFChars(store_socket_name, nullptr); - const char* m_name = env->GetStringUTFChars(manager_socket_name, nullptr); - - plasma::PlasmaClient* client = new plasma::PlasmaClient(); - throw_exception_if_not_OK(env, client->Connect(s_name, m_name, release_delay)); - - env->ReleaseStringUTFChars(store_socket_name, s_name); - env->ReleaseStringUTFChars(manager_socket_name, m_name); - return reinterpret_cast(client); -} - -JNIEXPORT void JNICALL Java_org_apache_arrow_plasma_PlasmaClientJNI_disconnect( - JNIEnv* env, jclass cls, jlong conn) { - plasma::PlasmaClient* client = reinterpret_cast(conn); - - throw_exception_if_not_OK(env, client->Disconnect()); - delete client; - return; -} - -JNIEXPORT jobject JNICALL Java_org_apache_arrow_plasma_PlasmaClientJNI_create( - JNIEnv* env, jclass cls, jlong conn, jbyteArray object_id, jint size, - jbyteArray metadata) { - plasma::PlasmaClient* client = reinterpret_cast(conn); - ObjectID oid; - jbyteArray_to_object_id(env, object_id, &oid); - - // prepare metadata buffer - uint8_t* md = nullptr; - jsize md_size = 0; - std::unique_ptr md_getter; - if (metadata != nullptr) { - md_size = env->GetArrayLength(metadata); - } - if (md_size > 0) { - md_getter.reset(new JByteArrayGetter(env, metadata, reinterpret_cast(&md))); - } - - std::shared_ptr data; - Status s = client->Create(oid, size, md, md_size, &data); - if (s.IsObjectExists()) { - jclass exceptionClass = - env->FindClass("org/apache/arrow/plasma/exceptions/DuplicateObjectException"); - env->ThrowNew(exceptionClass, oid.Hex().c_str()); - return nullptr; - } - if (s.IsObjectStoreFull()) { - jclass exceptionClass = - env->FindClass("org/apache/arrow/plasma/exceptions/PlasmaOutOfMemoryException"); - env->ThrowNew(exceptionClass, ""); - return nullptr; - } - throw_exception_if_not_OK(env, s); - - return env->NewDirectByteBuffer(data->mutable_data(), size); -} - -JNIEXPORT jbyteArray JNICALL Java_org_apache_arrow_plasma_PlasmaClientJNI_hash( - JNIEnv* env, jclass cls, jlong conn, jbyteArray object_id) { - plasma::PlasmaClient* client = reinterpret_cast(conn); - ObjectID oid; - jbyteArray_to_object_id(env, object_id, &oid); - - unsigned char digest[plasma::kDigestSize]; - bool success = client->Hash(oid, digest).ok(); - - if (success) { - jbyteArray ret = env->NewByteArray(plasma::kDigestSize); - env->SetByteArrayRegion(ret, 0, plasma::kDigestSize, - reinterpret_cast(digest)); - return ret; - } else { - return nullptr; - } -} - -JNIEXPORT void JNICALL Java_org_apache_arrow_plasma_PlasmaClientJNI_seal( - JNIEnv* env, jclass cls, jlong conn, jbyteArray object_id) { - plasma::PlasmaClient* client = reinterpret_cast(conn); - ObjectID oid; - jbyteArray_to_object_id(env, object_id, &oid); - - throw_exception_if_not_OK(env, client->Seal(oid)); -} - -JNIEXPORT void JNICALL Java_org_apache_arrow_plasma_PlasmaClientJNI_release( - JNIEnv* env, jclass cls, jlong conn, jbyteArray object_id) { - plasma::PlasmaClient* client = reinterpret_cast(conn); - ObjectID oid; - jbyteArray_to_object_id(env, object_id, &oid); - - throw_exception_if_not_OK(env, client->Release(oid)); -} - -JNIEXPORT void JNICALL Java_org_apache_arrow_plasma_PlasmaClientJNI_delete( - JNIEnv* env, jclass cls, jlong conn, jbyteArray object_id) { - plasma::PlasmaClient* client = reinterpret_cast(conn); - ObjectID oid; - jbyteArray_to_object_id(env, object_id, &oid); - - throw_exception_if_not_OK(env, client->Delete(oid)); -} - -JNIEXPORT jobjectArray JNICALL Java_org_apache_arrow_plasma_PlasmaClientJNI_get( - JNIEnv* env, jclass cls, jlong conn, jobjectArray object_ids, jint timeout_ms) { - plasma::PlasmaClient* client = reinterpret_cast(conn); - - jsize num_oids = env->GetArrayLength(object_ids); - std::vector oids(num_oids); - std::vector obufs(num_oids); - for (int i = 0; i < num_oids; ++i) { - jbyteArray_to_object_id( - env, reinterpret_cast(env->GetObjectArrayElement(object_ids, i)), - &oids[i]); - } - // TODO: may be blocked. consider to add the thread support - throw_exception_if_not_OK(env, - client->Get(oids.data(), num_oids, timeout_ms, obufs.data())); - - jclass clsByteBuffer = env->FindClass("java/nio/ByteBuffer"); - jclass clsByteBufferArray = env->FindClass("[Ljava/nio/ByteBuffer;"); - - jobjectArray ret = env->NewObjectArray(num_oids, clsByteBufferArray, nullptr); - jobjectArray o = nullptr; - jobject dataBuf, metadataBuf; - for (int i = 0; i < num_oids; ++i) { - o = env->NewObjectArray(2, clsByteBuffer, nullptr); - if (obufs[i].data && obufs[i].data->size() != -1) { - dataBuf = env->NewDirectByteBuffer(const_cast(obufs[i].data->data()), - obufs[i].data->size()); - if (obufs[i].metadata && obufs[i].metadata->size() > 0) { - metadataBuf = env->NewDirectByteBuffer( - const_cast(obufs[i].metadata->data()), obufs[i].metadata->size()); - } else { - metadataBuf = nullptr; - } - } else { - dataBuf = nullptr; - metadataBuf = nullptr; - } - - env->SetObjectArrayElement(o, 0, dataBuf); - env->SetObjectArrayElement(o, 1, metadataBuf); - env->SetObjectArrayElement(ret, i, o); - } - return ret; -} - -JNIEXPORT jboolean JNICALL Java_org_apache_arrow_plasma_PlasmaClientJNI_contains( - JNIEnv* env, jclass cls, jlong conn, jbyteArray object_id) { - plasma::PlasmaClient* client = reinterpret_cast(conn); - ObjectID oid; - jbyteArray_to_object_id(env, object_id, &oid); - - bool has_object; - throw_exception_if_not_OK(env, client->Contains(oid, &has_object)); - - return has_object; -} - -JNIEXPORT jlong JNICALL Java_org_apache_arrow_plasma_PlasmaClientJNI_evict( - JNIEnv* env, jclass cls, jlong conn, jlong num_bytes) { - plasma::PlasmaClient* client = reinterpret_cast(conn); - - int64_t evicted_bytes; - throw_exception_if_not_OK( - env, client->Evict(static_cast(num_bytes), evicted_bytes)); - - return static_cast(evicted_bytes); -} diff --git a/src/ray/object_manager/plasma/lib/java/org_apache_arrow_plasma_PlasmaClientJNI.h b/src/ray/object_manager/plasma/lib/java/org_apache_arrow_plasma_PlasmaClientJNI.h deleted file mode 100644 index 8729c71e4..000000000 --- a/src/ray/object_manager/plasma/lib/java/org_apache_arrow_plasma_PlasmaClientJNI.h +++ /dev/null @@ -1,132 +0,0 @@ -// 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. - -/* DO NOT EDIT THIS FILE - it is machine generated */ -#include "jni.h" -/* Header for class org_apache_arrow_plasma_PlasmaClientJNI */ - -#ifndef _Included_org_apache_arrow_plasma_PlasmaClientJNI -#define _Included_org_apache_arrow_plasma_PlasmaClientJNI -#ifdef __cplusplus -extern "C" { -#endif -/* - * Class: org_apache_arrow_plasma_PlasmaClientJNI - * Method: connect - * Signature: (Ljava/lang/String;Ljava/lang/String;I)J - */ -JNIEXPORT jlong JNICALL Java_org_apache_arrow_plasma_PlasmaClientJNI_connect( - JNIEnv*, jclass, jstring, jstring, jint); - -/* - * Class: org_apache_arrow_plasma_PlasmaClientJNI - * Method: disconnect - * Signature: (J)V - */ -JNIEXPORT void JNICALL Java_org_apache_arrow_plasma_PlasmaClientJNI_disconnect(JNIEnv*, - jclass, - jlong); - -/* - * Class: org_apache_arrow_plasma_PlasmaClientJNI - * Method: create - * Signature: (J[BI[B)Ljava/nio/ByteBuffer; - */ -JNIEXPORT jobject JNICALL Java_org_apache_arrow_plasma_PlasmaClientJNI_create( - JNIEnv*, jclass, jlong, jbyteArray, jint, jbyteArray); - -/* - * Class: org_apache_arrow_plasma_PlasmaClientJNI - * Method: hash - * Signature: (J[B)[B - */ -JNIEXPORT jbyteArray JNICALL -Java_org_apache_arrow_plasma_PlasmaClientJNI_hash(JNIEnv*, jclass, jlong, jbyteArray); - -/* - * Class: org_apache_arrow_plasma_PlasmaClientJNI - * Method: seal - * Signature: (J[B)V - */ -JNIEXPORT void JNICALL Java_org_apache_arrow_plasma_PlasmaClientJNI_seal(JNIEnv*, jclass, - jlong, - jbyteArray); - -/* - * Class: org_apache_arrow_plasma_PlasmaClientJNI - * Method: release - * Signature: (J[B)V - */ -JNIEXPORT void JNICALL Java_org_apache_arrow_plasma_PlasmaClientJNI_release(JNIEnv*, - jclass, jlong, - jbyteArray); - -/* - * Class: org_apache_arrow_plasma_PlasmaClientJNI - * Method: delete - * Signature: (J[B)V - */ -JNIEXPORT void JNICALL Java_org_apache_arrow_plasma_PlasmaClientJNI_delete(JNIEnv*, - jclass, jlong, - jbyteArray); - -/* - * Class: org_apache_arrow_plasma_PlasmaClientJNI - * Method: get - * Signature: (J[[BI)[[Ljava/nio/ByteBuffer; - */ -JNIEXPORT jobjectArray JNICALL Java_org_apache_arrow_plasma_PlasmaClientJNI_get( - JNIEnv*, jclass, jlong, jobjectArray, jint); - -/* - * Class: org_apache_arrow_plasma_PlasmaClientJNI - * Method: contains - * Signature: (J[B)Z - */ -JNIEXPORT jboolean JNICALL -Java_org_apache_arrow_plasma_PlasmaClientJNI_contains(JNIEnv*, jclass, jlong, jbyteArray); - -/* - * Class: org_apache_arrow_plasma_PlasmaClientJNI - * Method: fetch - * Signature: (J[[B)V - */ -JNIEXPORT void JNICALL Java_org_apache_arrow_plasma_PlasmaClientJNI_fetch(JNIEnv*, jclass, - jlong, - jobjectArray); - -/* - * Class: org_apache_arrow_plasma_PlasmaClientJNI - * Method: wait - * Signature: (J[[BII)[[B - */ -JNIEXPORT jobjectArray JNICALL Java_org_apache_arrow_plasma_PlasmaClientJNI_wait( - JNIEnv*, jclass, jlong, jobjectArray, jint, jint); - -/* - * Class: org_apache_arrow_plasma_PlasmaClientJNI - * Method: evict - * Signature: (JJ)J - */ -JNIEXPORT jlong JNICALL Java_org_apache_arrow_plasma_PlasmaClientJNI_evict(JNIEnv*, - jclass, jlong, - jlong); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/src/ray/raylet/mock_gcs_client.cc b/src/ray/raylet/mock_gcs_client.cc deleted file mode 100644 index 7298373cf..000000000 --- a/src/ray/raylet/mock_gcs_client.cc +++ /dev/null @@ -1,133 +0,0 @@ -// Copyright 2017 The Ray Authors. -// -// Licensed 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. - -#include -#include - -#include "ray/raylet/mock_gcs_client.h" - -namespace ray { - -ray::Status ObjectTable::GetObjectClientIDs(const ray::ObjectID &object_id, - const ClientIDsCallback &success, - const FailCallback &fail) { - RAY_LOG(DEBUG) << "GetObjectClientIDs " << object_id; - if (client_lookup.count(object_id) > 0) { - if (!client_lookup[object_id].empty()) { - std::vector v; - for (auto client_id : client_lookup[object_id]) { - v.push_back(client_id); - } - success(std::move(v)); - return Status::OK(); - } else { - fail(Status::KeyError("ObjectID has no clients.")); - return Status::OK(); - } - } else { - fail(Status::KeyError("ObjectID doesn't exist.")); - return Status::OK(); - } -} - -ray::Status ObjectTable::Add(const ObjectID &object_id, const ClientID &client_id, - const DoneCallback &done_callback) { - if (client_lookup.count(object_id) == 0) { - RAY_LOG(DEBUG) << "Add ObjectID set " << object_id; - client_lookup[object_id] = std::unordered_set(); - } else if (client_lookup[object_id].count(client_id) != 0) { - return ray::Status::KeyError("ClientID already exists."); - } - RAY_LOG(DEBUG) << "Insert ClientID " << client_id; - client_lookup[object_id].insert(client_id); - done_callback(); - return ray::Status::OK(); -} - -ray::Status ObjectTable::Remove(const ObjectID &object_id, const ClientID &client_id, - const DoneCallback &done_callback) { - if (client_lookup.count(object_id) == 0) { - return ray::Status::KeyError("ObjectID doesn't exist."); - } else if (client_lookup[object_id].count(client_id) == 0) { - return ray::Status::KeyError("ClientID doesn't exist."); - } - client_lookup[object_id].erase(client_id); - done_callback(); - return ray::Status::OK(); -} - -ray::Status ClientTable::GetClientIds(ClientIDsCallback callback) { - std::vector keys; - keys.reserve(info_lookup.size()); - for (auto kv : info_lookup) { - keys.push_back(kv.first); - } - callback(keys); - return Status::OK(); -} - -void ClientTable::GetClientInformationSet(const std::vector &client_ids, - ManyInfoCallback callback, - FailCallback failcb) { - std::vector info_vec; - for (const auto &client_id : client_ids) { - if (info_lookup.count(client_id) != 0) { - info_vec.push_back(info_lookup.at(client_id)); - } - } - if (info_vec.empty()) { - failcb(Status::KeyError("ClientID not found.")); - } else { - callback(info_vec); - } -} - -void ClientTable::GetClientInformation(const ClientID &client_id, - SingleInfoCallback callback, FailCallback failcb) { - if (info_lookup.count(client_id) == 0) { - failcb(ray::Status::KeyError("CleintID not found.")); - } else { - callback(info_lookup.at(client_id)); - } -} - -ray::Status ClientTable::Add(const ClientID &client_id, const std::string &ip, - uint16_t port, DoneCallback done_callback) { - if (info_lookup.count(client_id) != 0) { - return ray::Status::KeyError("ClientID already exists."); - } - info_lookup.emplace(client_id, ClientInformation(client_id, ip, port)); - done_callback(); - return ray::Status::OK(); -} - -ray::Status ClientTable::Remove(const ClientID &client_id, DoneCallback done_callback) { - if (info_lookup.count(client_id) == 0) { - return ray::Status::KeyError("ClientID doesn't exist."); - } - info_lookup.erase(client_id); - done_callback(); - return ray::Status::OK(); -} - -ClientID GcsClient::Register(const std::string &ip, uint16_t port) { - ClientID client_id = ClientID::FromRandom(); - // TODO: handle client registration failure. - ray::Status status = client_table().Add(client_id, ip, port, []() {}); - return client_id; -} - -ClientTable &GcsClient::client_table() { return *client_table_; } - -} // namespace ray diff --git a/src/ray/raylet/mock_gcs_client.h b/src/ray/raylet/mock_gcs_client.h deleted file mode 100644 index 2f4ea41e3..000000000 --- a/src/ray/raylet/mock_gcs_client.h +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright 2017 The Ray Authors. -// -// Licensed 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 -#include -#include -#include -#include -#include - -#include -#include -#include - -#include "ray/common/id.h" -#include "ray/common/status.h" - -namespace ray { - -class ObjectTable { - public: - using DoneCallback = std::function; - using ClientIDsCallback = std::function &)>; - using FailCallback = std::function; - ray::Status Add(const ObjectID &object_id, const ClientID &client_id, - const DoneCallback &done); - ray::Status Remove(const ObjectID &object_id, const ClientID &client_id, - const DoneCallback &done); - ray::Status GetObjectClientIDs(const ObjectID &object_id, const ClientIDsCallback &, - const FailCallback &); - - private: - std::vector empty_set_; - std::unordered_map> client_lookup; -}; - -class ClientInformation { - public: - ClientInformation(const ClientID &client_id, const std::string &ip_address, - uint16_t port) - : client_id_(client_id), ip_address_(ip_address), port_(port) {} - const ClientID &GetClientId() const { return client_id_; } - const std::string &GetIp() const { return ip_address_; } - const uint16_t &GetPort() const { return port_; } - - private: - ClientID client_id_; - std::string ip_address_; - uint16_t port_; -}; - -class ClientTable { - public: - typedef std::unordered_map info_type; - - using ClientIDsCallback = std::function)>; - using SingleInfoCallback = std::function; - using ManyInfoCallback = std::function info_vec)>; - using DoneCallback = std::function; - using FailCallback = std::function; - - ray::Status GetClientIds(ClientIDsCallback cb); - void GetClientInformationSet(const std::vector &client_ids, - ManyInfoCallback cb, FailCallback failcb); - void GetClientInformation(const ClientID &client_id, SingleInfoCallback callback, - FailCallback failcb); - ray::Status Add(const ClientID &client_id, const std::string &ip, uint16_t port, - DoneCallback cb); - ray::Status Remove(const ClientID &client_id, DoneCallback done); - - private: - info_type info_lookup; -}; - -class GcsClient { - public: - GcsClient() { - this->object_table_.reset(new ObjectTable()); - this->client_table_.reset(new ClientTable()); - } - // Register the ip and port of the connecting client. - ClientID Register(const std::string &ip, uint16_t port); - ClientTable &client_table(); - - private: - std::unique_ptr object_table_; - std::unique_ptr client_table_; -}; -} // namespace ray