change sudo make -> make
This commit is contained in:
@@ -150,7 +150,7 @@ int redis_flushDB(redisContext *ctx, int db_index, struct log_handle *logger)
|
||||
for (int i = 0; i < append_cmd_cnt; i++) {
|
||||
ret = maat_cmd_wrap_redis_get_reply(ctx, &data_reply);
|
||||
if (ret == REDIS_OK) {
|
||||
if (0 == mr_transaction_success(data_reply)) {
|
||||
if (data_reply->type == REDIS_REPLY_NIL) {
|
||||
redis_transaction_success = 0;
|
||||
}
|
||||
freeReplyObject(data_reply);
|
||||
@@ -167,6 +167,19 @@ int redis_flushDB(redisContext *ctx, int db_index, struct log_handle *logger)
|
||||
return redis_transaction_success;
|
||||
}
|
||||
|
||||
static int connect_redis_for_write(struct source_redis_ctx *mr_ctx,
|
||||
struct log_handle *logger)
|
||||
{
|
||||
assert(mr_ctx->write_ctx == NULL);
|
||||
mr_ctx->write_ctx = maat_cmd_connect_redis(mr_ctx->redis_ip, mr_ctx->redis_port,
|
||||
mr_ctx->redis_db, logger);
|
||||
if (NULL == mr_ctx->write_ctx) {
|
||||
return -1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
redisContext *get_redis_ctx_for_write(struct maat *maat_instance)
|
||||
{
|
||||
if (NULL == maat_instance->mr_ctx.write_ctx) {
|
||||
@@ -216,19 +229,6 @@ void maat_cmd_clear_rule_cache(struct serial_rule *s_rule)
|
||||
memset(s_rule, 0, sizeof(struct serial_rule));
|
||||
}
|
||||
|
||||
int connect_redis_for_write(struct source_redis_ctx *mr_ctx,
|
||||
struct log_handle *logger)
|
||||
{
|
||||
assert(mr_ctx->write_ctx == NULL);
|
||||
mr_ctx->write_ctx = maat_cmd_connect_redis(mr_ctx->redis_ip, mr_ctx->redis_port,
|
||||
mr_ctx->redis_db, logger);
|
||||
if (NULL == mr_ctx->write_ctx) {
|
||||
return -1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
void maat_cmd_set_serial_rule(struct serial_rule *rule, enum maat_operation op,
|
||||
long long rule_id, const char *table_name,
|
||||
const char *line, long long timeout)
|
||||
|
||||
@@ -1097,15 +1097,6 @@ void exec_serial_rule(redisContext *c, const char *transaction_list,
|
||||
}
|
||||
}
|
||||
|
||||
int mr_transaction_success(redisReply *data_reply)
|
||||
{
|
||||
if (data_reply->type == REDIS_REPLY_NIL) {
|
||||
return 0;
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
int mr_operation_success(redisReply *actual_reply, struct expected_reply *expected)
|
||||
{
|
||||
if (expected->possible_replies[0].type != actual_reply->type) {
|
||||
@@ -1179,7 +1170,7 @@ int maat_cmd_write_rule(redisContext *c, struct serial_rule *s_rule,
|
||||
|
||||
transaction_reply = exec_serial_rule_end(c, transaction_list, server_time, renew_allowed,
|
||||
expected_reply, &multi_cmd_cnt);
|
||||
if (1 == mr_transaction_success(transaction_reply)) {
|
||||
if (transaction_reply->type != REDIS_REPLY_NIL) {
|
||||
assert(transaction_reply->elements == multi_cmd_cnt);
|
||||
for (i = 0; i < multi_cmd_cnt; i++) {
|
||||
p = transaction_reply->element[i];
|
||||
|
||||
Reference in New Issue
Block a user