redis翻译_redislua脚本(三)

2015-07-24 07:47:25 · 作者: · 浏览: 18
PT KILL命令去终止只读模式的脚本。因为没有数据的写操作所以没有违反脚本的原子性。
If the script already called write commands the only allowed command becomesSHUTDOWN NOSAVE that stops the server without saving the current data set on disk (basically the server is aborted).
如果脚本已经调用了写命令,现在唯一允许的命令是 SHUTDOWN NOSAVE,将导致服务器没有保存当前set的数据到硬盘上(主要是Redis 服务器终止了)

?

eva lSHA in the context of pipelining 在通道中使用eva lSHA

Care should be taken when executing eva lSHA in the context of a pipelined request, since even in a pipeline the order of execution of commands must be guaranteed. Ifeva lSHA will return a NOSCRIPT error the command can not be reissued later otherwise the order of execution is violated.

在管道里使用eva lSHA要小心,因为即使在管道也必须保证命令的执行顺序。如果eva lSHA返回NOSCRIPT的错误,之后就不会再被执行,否则就违反了执行顺序。

The client library implementation should take one of the following approaches:

客户端应该采取下面当中的一种方法处理:

Always use plain eva l when in the context of a pipeline.

在管道环境中总是使用eva l。

Accumulate all the commands to send into the pipeline, then check for eva lcommands and use the SCRIPT EXISTS command to check if all the scripts are already defined. If not, add SCRIPT LOAD commands on top of the pipeline as required, and use eva lSHA for all the eva l calls.

积累所有的命令到管道里,然后使用eva l命令运行检测,并且使用SCRIPT EXISTS去检测是否所有的脚本已经明确定义。如果没有,在管道请求头添加SCRIPT LOAD 命令,并且使用eva lSHA 代替所有的VAAL调用。