[xray] Implementing Gcs sharding (#2409)

Basically a re-implementation of #2281, with modifications of #2298 (A fix of #2334, for rebasing issues.).
[+] Implement sharding for gcs tables.
[+] Keep ClientTable and ErrorTable managed by the primary_shard. TaskTable is managed by the primary_shard for now, until a good hashing for tasks is implemented.
[+] Move AsyncGcsClient's initialization into Connect function.
[-] Move GetRedisShard and bool sharding from RedisContext's connect into AsyncGcsClient. This may make the interface cleaner.
This commit is contained in:
Yucong He
2018-08-31 15:54:30 -07:00
committed by Robert Nishihara
parent eda6ebb87d
commit 5b45f0bdff
19 changed files with 269 additions and 235 deletions
-5
View File
@@ -351,11 +351,6 @@ LocalSchedulerState *LocalSchedulerState_init(
state->db = db_connect(std::string(redis_primary_addr), redis_primary_port,
"local_scheduler", node_ip_address, db_connect_args);
db_attach(state->db, loop, false);
RAY_CHECK_OK(state->gcs_client.Connect(std::string(redis_primary_addr),
redis_primary_port, true));
RAY_CHECK_OK(state->gcs_client.context()->AttachToEventLoop(loop));
RAY_CHECK_OK(state->gcs_client.primary_context()->AttachToEventLoop(loop));
} else {
state->db = NULL;
}
@@ -60,8 +60,6 @@ struct LocalSchedulerState {
std::unordered_map<ActorID, ActorMapEntry> actor_mapping;
/** The handle to the database. */
DBHandle *db;
/** The handle to the GCS (modern version of the above). */
ray::gcs::AsyncGcsClient gcs_client;
/** The Plasma client. */
plasma::PlasmaClient *plasma_conn;
/** State for the scheduling algorithm. */