public abstract class BigpipeSessionSupport extends Object
| 限定符和类型 | 类和说明 |
|---|---|
static class |
BigpipeSessionSupport.PIPE_TYPE |
| 限定符和类型 | 字段和说明 |
|---|---|
protected LifeController |
lifeController
session的生命周期信息
|
protected PipeRuntime |
pipeRuntime
pipelet运行时信息
|
protected Receiver |
reciever
从tcp channel接收数据的接收器
|
| 构造器和说明 |
|---|
BigpipeSessionSupport() |
| 限定符和类型 | 方法和说明 |
|---|---|
protected void |
buildConnect(boolean init,
SocketConf conf)
构建可用的tcp channel
|
protected abstract void |
continueConfig(BigPipeConf conf)
继续应用配置信息,允许子类从
BigPipeConf获取私有配置信息并应用 |
protected String |
getPipeletOrQueueName()
生成pipeliet的完全名称.
|
int |
getType() |
protected abstract void |
handleFastFailed(boolean needBlocking)
发送或者订阅失败时,快速失败处理
|
void |
init(BigPipeConf conf)
初始化bigpipe的配置信息以及开启发布或订阅线程
|
protected abstract InetAddress |
lookupAddr(NameService ns,
String pipeletOrQueueName)
从zk中根据pipeletName获取实例地址
|
protected abstract SessionSocketStream |
openStream(InetAddress addr,
SocketConf conf)
打开网络流
|
protected abstract void |
safeCloseTcpConnect()
安全的关闭连接
|
void |
setType(int type) |
abstract void |
start(BigPipeConf conf)
开启发布或者订阅线程
|
protected abstract void |
waitingForConnect(int cnt)
连接bigpipe失败时线程sleep
|
protected final PipeRuntime pipeRuntime
protected final LifeController lifeController
protected Receiver reciever
public int getType()
public void setType(int type)
public void init(BigPipeConf conf)
conf - BigPipeConf 对象,描述bigpipe的配置信息public abstract void start(BigPipeConf conf)
conf - BigPipeConf 对象,配置信息protected abstract void continueConfig(BigPipeConf conf)
BigPipeConf获取私有配置信息并应用conf - BigPipeConf 配置信息protected abstract InetAddress lookupAddr(NameService ns, String pipeletOrQueueName) throws NameResolveException, org.apache.zookeeper.KeeperException, QueueLocateException
ns - NameService对象pipeletOrQueueName - pipelet Name or queue NameInetAddressNameResolveException - 根据名字解析TopicAddress QueueAddress异常org.apache.zookeeper.KeeperException - zk异常QueueLocateExceptionprotected abstract void safeCloseTcpConnect()
protected abstract void waitingForConnect(int cnt)
cnt - sleep时间,msprotected abstract SessionSocketStream openStream(InetAddress addr, SocketConf conf) throws IOException
addr - InetAddress地址conf - SocketConf网络相关配置SessionSocketStream 流IOException - 网络io异常protected abstract void handleFastFailed(boolean needBlocking)
needBlocking - 是否堵塞其他客户端操作,比如不能够再发布消息protected final void buildConnect(boolean init,
SocketConf conf)
init - 第一次构建connect,一般是spring的init方法中调用conf - socket配置信息protected String getPipeletOrQueueName()
Copyright © 2017. All rights reserved.