类 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 classRedisSocketReplicator.SyncMode
-
字段概要
字段 修饰符和类型 字段 说明 protected intdbprotected ScheduledExecutorServiceexecutorprotected ScheduledFuture<?>heartbeatprotected Stringhostprotected static org.slf4j.Loggerloggerprotected RedisOutputStreamoutputStreamprotected intportprotected ReplyParserreplyParserprotected Socketsocketprotected RedisSocketFactorysocketFactory-
从类继承的字段 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 voidauth(String user, String password)protected voidconnect()protected voiddoClose()protected voidestablishConnection()StringgetHost()intgetPort()protected voidheartbeat()voidopen()PSYNCprotected voidparseDump(AbstractReplicator replicator)protected <T> Treply()protected <T> Treply(BulkReplyHandler handler)protected voidsend(byte[] command)protected voidsend(byte[] command, byte[]... args)protected voidsendPing()protected voidsendQuietly(byte[] command, byte[]... args)protected voidsendSlaveCapa(String cmd)protected voidsendSlaveIp()protected voidsendSlavePort()protected RedisSocketReplicator.SyncModetrySync(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 IOExceptionPSYNC- 指定者:
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
-
-