2016-11-18 19:57:51 -08:00
|
|
|
#include "db_client_table.h"
|
|
|
|
#include "redis.h"
|
|
|
|
|
2017-03-02 19:51:20 -08:00
|
|
|
void db_client_table_remove(DBHandle *db_handle,
|
|
|
|
DBClientID db_client_id,
|
|
|
|
RetryInfo *retry,
|
|
|
|
db_client_table_done_callback done_callback,
|
|
|
|
void *user_context) {
|
|
|
|
init_table_callback(db_handle, db_client_id, __func__, NULL, retry,
|
|
|
|
(table_done_callback) done_callback,
|
|
|
|
redis_db_client_table_remove, user_context);
|
|
|
|
}
|
|
|
|
|
2016-11-18 19:57:51 -08:00
|
|
|
void db_client_table_subscribe(
|
2017-02-26 00:32:43 -08:00
|
|
|
DBHandle *db_handle,
|
2016-11-18 19:57:51 -08:00
|
|
|
db_client_table_subscribe_callback subscribe_callback,
|
|
|
|
void *subscribe_context,
|
2017-02-26 00:32:43 -08:00
|
|
|
RetryInfo *retry,
|
2016-11-18 19:57:51 -08:00
|
|
|
db_client_table_done_callback done_callback,
|
|
|
|
void *user_context) {
|
2017-02-26 00:32:43 -08:00
|
|
|
DBClientTableSubscribeData *sub_data =
|
2017-03-01 01:17:24 -08:00
|
|
|
(DBClientTableSubscribeData *) malloc(sizeof(DBClientTableSubscribeData));
|
2016-11-18 19:57:51 -08:00
|
|
|
sub_data->subscribe_callback = subscribe_callback;
|
|
|
|
sub_data->subscribe_context = subscribe_context;
|
|
|
|
|
|
|
|
init_table_callback(db_handle, NIL_ID, __func__, sub_data, retry,
|
2017-03-01 01:17:24 -08:00
|
|
|
(table_done_callback) done_callback,
|
|
|
|
redis_db_client_table_subscribe, user_context);
|
2016-11-18 19:57:51 -08:00
|
|
|
}
|
2017-03-17 17:03:58 -07:00
|
|
|
|
|
|
|
void plasma_manager_send_heartbeat(DBHandle *db_handle) {
|
|
|
|
RetryInfo heartbeat_retry;
|
|
|
|
heartbeat_retry.num_retries = 0;
|
|
|
|
heartbeat_retry.timeout = HEARTBEAT_TIMEOUT_MILLISECONDS;
|
|
|
|
heartbeat_retry.fail_callback = NULL;
|
|
|
|
|
|
|
|
init_table_callback(db_handle, NIL_ID, __func__, NULL,
|
|
|
|
(RetryInfo *) &heartbeat_retry, NULL,
|
|
|
|
redis_plasma_manager_send_heartbeat, NULL);
|
|
|
|
}
|