Skip to content

Commit

Permalink
Add interface to enable Redis pipeline and flush Producer(State)Table (
Browse files Browse the repository at this point in the history
…#139)

* Add option: redis pipeline

* (comment)
  • Loading branch information
qiluo-msft authored Jan 4, 2017
1 parent 06d7b11 commit 5c4d9d9
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
18 changes: 18 additions & 0 deletions lib/inc/sairedis.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,24 @@ typedef enum _sai_redis_switch_attr_t
*/
SAI_REDIS_SWITCH_ATTR_USE_TEMP_VIEW,

/**
* @brief Enable redis pipeline
*
* @type bool
* @flags CREATE_AND_SET
* @default false
*/
SAI_REDIS_SWITCH_ATTR_USE_PIPELINE,

/**
* @brief Will flush redis pipeline
*
* @type bool
* @flags CREATE_AND_SET
* @default false
*/
SAI_REDIS_SWITCH_ATTR_FLUSH,

} sai_redis_switch_attr_t;

#endif // __SAIREDIS__
8 changes: 8 additions & 0 deletions lib/src/sai_redis_switch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,14 @@ sai_status_t redis_set_switch_attribute(
g_useTempView = attr->value.booldata;
return SAI_STATUS_SUCCESS;

case SAI_REDIS_SWITCH_ATTR_USE_PIPELINE:
g_asicState->setBuffered(attr->value.booldata);
return SAI_STATUS_SUCCESS;

case SAI_REDIS_SWITCH_ATTR_FLUSH:
g_asicState->flush();
return SAI_STATUS_SUCCESS;

default:
break;
}
Expand Down

0 comments on commit 5c4d9d9

Please sign in to comment.