int ping = 11; 限流 客户端验证与服务端是连接的
int ping = 11;
ZooKeeper Programmer's Guide https://zookeeper.apache.org/doc/r3.1.2/zookeeperProgrammers.html
The session is kept alive by requests sent by the client. If the session is idle for a period of time that would timeout the session, the client will send a PING request to keep the session alive. This PING request not only allows the ZooKeeper server to know that the client is still active, but it also allows the client to verify that its connection to the ZooKeeper server is still active. The timing of the PING is conservative enough to ensure reasonable time to detect a dead connection and reconnect to a new server.
https://github.com/apache/zookeeper/blob/master/zookeeper-server/src/main/java/org/apache/zookeeper/server/Request.java#L124
| public boolean isThrottlable() { | |
| return this.type != OpCode.ping | |
| && this.type != OpCode.closeSession | |
| && this.type != OpCode.createSession; | |
| } | |
zookeeper/ZooDefs.java at master · apache/zookeeper https://github.com/apache/zookeeper/blob/master/zookeeper-server/src/main/java/org/apache/zookeeper/ZooDefs.java
| public interface OpCode { | |
| int notification = 0; | |
| int create = 1; | |
| int delete = 2; | |
| int exists = 3; | |
| int getData = 4; | |
| int setData = 5; | |
| int getACL = 6; | |
| int setACL = 7; | |
| int getChildren = 8; | |
| int sync = 9; | |
| int ping = 11; | |
| int getChildren2 = 12; | |
| int check = 13; | |
| int multi = 14; | |
| int create2 = 15; | |
| int reconfig = 16; | |
| int checkWatches = 17; | |
| int removeWatches = 18; | |
| int createContainer = 19; | |
| int deleteContainer = 20; | |
| int createTTL = 21; | |
| int multiRead = 22; | |
| int auth = 100; | |
| int setWatches = 101; | |
| int sasl = 102; | |
| int getEphemerals = 103; | |
| int getAllChildrenNumber = 104; | |
| int setWatches2 = 105; | |
| int addWatch = 106; | |
| int createSession = -10; | |
| int closeSession = -11; | |
| int error = -1; | |
| } |
int ping = 11; 限流 客户端验证与服务端是连接的的更多相关文章
- 6-1 建立客户端与zk服务端的连接
6-1 建立客户端与zk服务端的连接 zookeeper原生java api使用 会话连接与恢复; 节点的增删改查; watch与acl的相关操作; 导入jar包;
- java版gRPC实战之六:客户端动态获取服务端地址
欢迎访问我的GitHub https://github.com/zq2599/blog_demos 内容:所有原创文章分类汇总及配套源码,涉及Java.Docker.Kubernetes.DevOPS ...
- jQuery结合Ajax实现简单的前端验证和服务端查询
上篇文章写了简单的前端验证由传统的JavaScript转向流畅的jQuery滑动验证,现在拓展一下,使用Ajax实现用户体验比较好的异步查询,同样还是从建立一个简单的表单开始 <form nam ...
- C#使用Thrift简介,C#客户端和Java服务端相互交互
C#使用Thrift简介,C#客户端和Java服务端相互交互 本文主要介绍两部分内容: C#中使用Thrift简介 用Java创建一个服务端,用C#创建一个客户端通过thrift与其交互. 用纯C#实 ...
- TCP学习之二:客户端与服务端的连接
主要参考张子阳大神的博客:http://www.cnblogs.com/JimmyZhang/category/101698.html TcpClient是对Socket的封装 一个TcpClient ...
- Android客户端与PHP服务端交互(一)---框架概述
背景 作为一个普通上班族,总是想做一些自认为有意义的事情,于是乎准备成立一个工作室,尽管目前正在筹备阶段,但是之前有些朋友提出一些需求的时候,我发现自己的能力还是有限,直到最近和一些技术牛朋友聊起这事 ...
- 利用python多线程实现多个客户端与单个服务端的远程ssh
本次实验设计两个方面的代码,第一个是客户端,代码如下: import os from socket import * c = socket(AF_INET,SOCK_STREAM) c.connect ...
- android客户端app和服务端交互token的作用
Android客户端和服务端如何使用Token和Session niceheart关注1人评论34644人阅读2014-09-16 16:38:44 对于初学者来说,对Token和Session的 ...
- 客户端 new socket时候 就像服务端发起连接了
客户端 new socket时候 就像服务端发起连接了
随机推荐
- 认识ollydbg
四个区域:汇编区:虚拟地址,机器码,汇编指令,注释: 寄存器区:寄存器,数据: 数据区, 栈. 这是上面按钮的作用 热键: Ctrl+F2 - 重启程序. Alt+F2 - 关闭被调试程序. F3 - ...
- Redis基础篇(三)持久化:AOF日志
Redis是内存数据库,但是一旦服务器宕机,内存中的数据将会全部丢失. 最简单的恢复方式是从后端数据库恢复,但这种方式有两个问题: 频繁访问数据库,会给数据库带来巨大的压力: 从数据库中读取相比从Re ...
- Java发送企业微信应用消息
1.发送消息与被动回复消息 (1)流程不同:发送消息是第三方服务器主动通知微信服务器向用户发消息.而被动回复消息是 用户发送消息之后,微信服务器将消息传递给 第三方服务器,第三方服务器接收到消息后,再 ...
- ubuntu安装nfs服务
安装: sudo apt-get install nfs-kernel-server 修改配置文件 /etc/exports 增加以下内容: /NFS *(rw,sync,no_root_squash ...
- el-input限制只能输入数字(开发小记)
输入框中限制通常有三种处理方法 第一种:设置type属性(不推荐) 设置type属性为number,text等等,此方法输入框的后面会有不必要样式出现 <el-input type=" ...
- 每日一个linux命令3
Linux 中用pwd命令来查看"当前工作目录"的完整路径. 简单的说,每当你在终端进行操作时,你都会有一个当前工作目录,在不太确定当前位置时,就会使用pwd来判定当前目录在文件系 ...
- HIve中 datediff,date_add和date_sub的用法
1.日期比较函数:datediff语法:datediff(string enddate,string startdate) 返回值:int 说明:返回结束日期减去开始日期的天数. 例如: hive&g ...
- hive之Json解析(普通Json和Json数组)
一.数据准备 现准备原始json数据(test.json)如下: {"movie":"1193","rate":"5", ...
- wdCP V3.2
wdCP是什么?关于wdCP更多的介绍,可看http://www.wdlinux.cn/wdcp/安装前先去体验下,看演示站吧http://www.wdlinux.cn/bbs/thread-5285 ...
- 风炫安全Web安全学习第十六节课 高权限sql注入getshell
风炫安全Web安全学习第十六节课 高权限sql注入getshell sql高权限getshell 前提条件: 需要知道目标网站绝对路径 目录具有写的权限 需要当前数据库用户开启了secure_file ...