Merge pull request #6378 from sfc-gh-sgwydir/mako-overwrite
Add "overwrite" operation to mako
This commit is contained in:
commit
cb8c5168df
|
@ -829,6 +829,10 @@ retryTxn:
|
|||
}
|
||||
docommit = 1;
|
||||
break;
|
||||
case OP_OVERWRITE:
|
||||
rc = run_op_insert(transaction, keystr, valstr);
|
||||
docommit = 1;
|
||||
break;
|
||||
case OP_CLEAR:
|
||||
rc = run_op_clear(transaction, keystr);
|
||||
docommit = 1;
|
||||
|
@ -1212,6 +1216,9 @@ void get_stats_file_name(char filename[], int worker_id, int thread_id, int op)
|
|||
case OP_INSERTRANGE:
|
||||
strcat(filename, "INSERTRANGE");
|
||||
break;
|
||||
case OP_OVERWRITE:
|
||||
strcat(filename, "OVERWRITE");
|
||||
break;
|
||||
case OP_CLEAR:
|
||||
strcat(filename, "CLEAR");
|
||||
break;
|
||||
|
@ -1502,7 +1509,7 @@ int worker_process_main(mako_args_t* args, int worker_id, mako_shmhdr_t* shm, pi
|
|||
|
||||
/*** let's party! ***/
|
||||
|
||||
/* set up cluster and datbase for workder threads */
|
||||
/* set up cluster and datbase for worker threads */
|
||||
|
||||
#if FDB_API_VERSION < 610
|
||||
/* cluster */
|
||||
|
@ -1704,6 +1711,9 @@ int parse_transaction(mako_args_t* args, char* optarg) {
|
|||
} else if (strncmp(ptr, "i", 1) == 0) {
|
||||
op = OP_INSERT;
|
||||
ptr++;
|
||||
} else if (strncmp(ptr, "o", 1) == 0) {
|
||||
op = OP_OVERWRITE;
|
||||
ptr++;
|
||||
} else if (strncmp(ptr, "cr", 2) == 0) {
|
||||
op = OP_CLEARRANGE;
|
||||
rangeop = 1;
|
||||
|
@ -2107,6 +2117,8 @@ char* get_ops_name(int ops_code) {
|
|||
return "INSERT";
|
||||
case OP_INSERTRANGE:
|
||||
return "INSERTRANGE";
|
||||
case OP_OVERWRITE:
|
||||
return "OVERWRITE";
|
||||
case OP_CLEAR:
|
||||
return "CLEAR";
|
||||
case OP_SETCLEAR:
|
||||
|
|
|
@ -45,6 +45,7 @@ enum Operations {
|
|||
OP_UPDATE,
|
||||
OP_INSERT,
|
||||
OP_INSERTRANGE,
|
||||
OP_OVERWRITE,
|
||||
OP_CLEAR,
|
||||
OP_SETCLEAR,
|
||||
OP_CLEARRANGE,
|
||||
|
|
|
@ -138,6 +138,7 @@ Operation Types
|
|||
- ``u`` – Update (= GET followed by SET)
|
||||
- ``i`` – Insert (= SET with a new key)
|
||||
- ``ir`` – Insert Range (Sequential)
|
||||
- ``o`` – Overwrite (Blind write to existing keys)
|
||||
- ``c`` – CLEAR
|
||||
- ``sc`` – SET & CLEAR
|
||||
- ``cr`` – CLEAR RANGE
|
||||
|
|
Loading…
Reference in New Issue