Removing Pyarrow dependency (#7146)

This commit is contained in:
ijrsvt
2020-02-17 18:00:13 -08:00
committed by GitHub
parent 3bd82d0bcd
commit 2116fd3bca
18 changed files with 119 additions and 373 deletions
+9 -1
View File
@@ -97,7 +97,6 @@ CoreWorker::CoreWorker(const WorkerType worker_type, const Language language,
RayLog::InstallFailureSignalHandler();
}
RAY_LOG(INFO) << "Initializing worker " << worker_context_.GetWorkerID();
// Initialize gcs client.
gcs_client_ = std::make_shared<gcs::RedisGcsClient>(gcs_options);
RAY_CHECK_OK(gcs_client_->Connect(io_service_));
@@ -235,6 +234,7 @@ CoreWorker::CoreWorker(const WorkerType worker_type, const Language language,
if (direct_task_receiver_ != nullptr) {
direct_task_receiver_->Init(client_factory, rpc_address_);
}
plasma_notifier_.reset(new ObjectStoreNotificationManager(io_service_, store_socket));
}
CoreWorker::~CoreWorker() {
@@ -1239,6 +1239,14 @@ void CoreWorker::GetAsync(const ObjectID &object_id, SetResultCallback success_c
});
}
void CoreWorker::SubscribeToAsyncPlasma(PlasmaSubscriptionCallback subscribe_callback) {
plasma_notifier_->SubscribeObjAdded(
[subscribe_callback](const object_manager::protocol::ObjectInfoT &info) {
subscribe_callback(ObjectID::FromPlasmaIdBinary(info.object_id), info.data_size,
info.metadata_size);
});
}
void CoreWorker::SetActorId(const ActorID &actor_id) {
absl::MutexLock lock(&mutex_);
RAY_CHECK(actor_id_.IsNil());
+13
View File
@@ -18,6 +18,7 @@
#include "ray/core_worker/transport/raylet_transport.h"
#include "ray/gcs/redis_gcs_client.h"
#include "ray/gcs/subscription_executor.h"
#include "ray/object_manager/object_store_notification_manager.h"
#include "ray/raylet/raylet_client.h"
#include "ray/rpc/node_manager/node_manager_client.h"
#include "ray/rpc/worker/core_worker_client.h"
@@ -499,6 +500,15 @@ class CoreWorker : public rpc::CoreWorkerServiceHandler {
void GetAsync(const ObjectID &object_id, SetResultCallback success_callback,
SetResultCallback fallback_callback, void *python_future);
/// Connect to plasma store for async futures
using PlasmaSubscriptionCallback = std::function<void(ray::ObjectID, int64_t, int64_t)>;
/// Subscribe to plasma store
///
/// \param[in] subscribe_callback The callback when an item is added to plasma.
/// \return void
void SubscribeToAsyncPlasma(PlasmaSubscriptionCallback subscribe_callback);
private:
/// Run the io_service_ event loop. This should be called in a background thread.
void RunIOService();
@@ -744,6 +754,9 @@ class CoreWorker : public rpc::CoreWorkerServiceHandler {
// Queue of tasks to resubmit when the specified time passes.
std::deque<std::pair<int64_t, TaskSpecification>> to_resubmit_ GUARDED_BY(mutex_);
// Plasma notification manager
std::unique_ptr<ObjectStoreNotificationManager> plasma_notifier_;
friend class CoreWorkerTest;
};