类 RedisSocketReplicator
- java.lang.Object
-
- com.moilioncircle.redis.replicator.AbstractReplicatorListener
-
- com.moilioncircle.redis.replicator.AbstractReplicator
-
- com.moilioncircle.redis.replicator.RedisSocketReplicator
-
- 所有已实现的接口:
Replicator
,ReplicatorListener
,ReplicatorRegister
,Closeable
,AutoCloseable
public class RedisSocketReplicator extends AbstractReplicator
- 从以下版本开始:
- 2.1.0
- 作者:
- Leon Chen
-
-
嵌套类概要
嵌套类 修饰符和类型 类 说明 protected static class
RedisSocketReplicator.SyncMode
-
字段概要
字段 修饰符和类型 字段 说明 protected int
db
protected ScheduledExecutorService
executor
protected ScheduledFuture<?>
heartbeat
protected String
host
protected static org.slf4j.Logger
logger
protected RedisOutputStream
outputStream
protected int
port
protected ReplyParser
replyParser
protected Socket
socket
protected RedisSocketFactory
socketFactory
-
从类继承的字段 com.moilioncircle.redis.replicator.AbstractReplicator
commands, configuration, connected, inputStream, manual, modules, rdbVisitor
-
从类继承的字段 com.moilioncircle.redis.replicator.AbstractReplicatorListener
closeListeners, eventListeners, exceptionListeners, rawByteListeners, statusListeners
-
-
构造器概要
构造器 构造器 说明 RedisSocketReplicator(String host, int port, Configuration configuration)
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 protected void
auth(String user, String password)
protected void
connect()
protected void
doClose()
protected void
establishConnection()
String
getHost()
int
getPort()
protected void
heartbeat()
void
open()
PSYNCprotected void
parseDump(AbstractReplicator replicator)
protected <T> T
reply()
protected <T> T
reply(BulkReplyHandler handler)
protected void
send(byte[] command)
protected void
send(byte[] command, byte[]... args)
protected void
sendPing()
protected void
sendQuietly(byte[] command, byte[]... args)
protected void
sendSlaveCapa(String cmd)
protected void
sendSlaveIp()
protected void
sendSlavePort()
protected RedisSocketReplicator.SyncMode
trySync(String reply)
-
从类继承的方法 com.moilioncircle.redis.replicator.AbstractReplicator
addCommandParser, addModuleParser, builtInCommandParserRegister, close, compareAndSet, dress, getCommandParser, getConfiguration, getModuleParser, getRdbVisitor, getStatus, isClosed, removeCommandParser, removeModuleParser, setRdbVisitor, setStatus, submitEvent, submitEvent, verbose
-
从类继承的方法 com.moilioncircle.redis.replicator.AbstractReplicatorListener
addCloseListener, addEventListener, addExceptionListener, addRawByteListener, addStatusListener, doCloseListener, doEventListener, doExceptionListener, doStatusListener, removeCloseListener, removeEventListener, removeExceptionListener, removeRawByteListener, removeStatusListener
-
从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
从接口继承的方法 com.moilioncircle.redis.replicator.ReplicatorListener
addCloseListener, addEventListener, addExceptionListener, addRawByteListener, addStatusListener, removeCloseListener, removeEventListener, removeExceptionListener, removeRawByteListener, removeStatusListener
-
-
-
-
字段详细资料
-
logger
protected static final org.slf4j.Logger logger
-
port
protected final int port
-
host
protected final String host
-
db
protected int db
-
socket
protected Socket socket
-
replyParser
protected ReplyParser replyParser
-
heartbeat
protected ScheduledFuture<?> heartbeat
-
outputStream
protected RedisOutputStream outputStream
-
executor
protected ScheduledExecutorService executor
-
socketFactory
protected final RedisSocketFactory socketFactory
-
-
构造器详细资料
-
RedisSocketReplicator
public RedisSocketReplicator(String host, int port, Configuration configuration)
-
-
方法详细资料
-
getHost
public String getHost()
-
getPort
public int getPort()
-
open
public void open() throws IOException
PSYNC- 指定者:
open
在接口中Replicator
- 覆盖:
open
在类中AbstractReplicator
- 抛出:
IOException
- when read timeout or connect timeout
-
trySync
protected RedisSocketReplicator.SyncMode trySync(String reply) throws IOException
- 抛出:
IOException
-
parseDump
protected void parseDump(AbstractReplicator replicator) throws IOException
- 抛出:
IOException
-
establishConnection
protected void establishConnection() throws IOException
- 抛出:
IOException
-
auth
protected void auth(String user, String password) throws IOException
- 抛出:
IOException
-
sendPing
protected void sendPing() throws IOException
- 抛出:
IOException
-
sendSlavePort
protected void sendSlavePort() throws IOException
- 抛出:
IOException
-
sendSlaveIp
protected void sendSlaveIp() throws IOException
- 抛出:
IOException
-
sendSlaveCapa
protected void sendSlaveCapa(String cmd) throws IOException
- 抛出:
IOException
-
heartbeat
protected void heartbeat()
-
send
protected void send(byte[] command) throws IOException
- 抛出:
IOException
-
send
protected void send(byte[] command, byte[]... args) throws IOException
- 抛出:
IOException
-
sendQuietly
protected void sendQuietly(byte[] command, byte[]... args)
-
reply
protected <T> T reply() throws IOException
- 抛出:
IOException
-
reply
protected <T> T reply(BulkReplyHandler handler) throws IOException
- 抛出:
IOException
-
connect
protected void connect() throws IOException
- 抛出:
IOException
-
doClose
protected void doClose() throws IOException
- 覆盖:
doClose
在类中AbstractReplicator
- 抛出:
IOException
-
-