public abstract class AbstractClient extends Object
| Modifier and Type | Class and Description |
|---|---|
class |
AbstractClient.HAStreamTableInfo |
| Constructor and Description |
|---|
AbstractClient() |
AbstractClient(int subscribePort) |
AbstractClient(String subscribeHost,
int subscribePort) |
| Modifier and Type | Method and Description |
|---|---|
void |
activeCloseConnection(Site site) |
void |
batchDispatch(List<IMessage> messags) |
void |
close() |
void |
dispatch(IMessage msg) |
protected abstract boolean |
doReconnect(Site site) |
List<String> |
getAllReconnectSites() |
Set<String> |
getAllReconnectTopic() |
List<String> |
getAllTopicsBySite(String site) |
Site |
getCurrentSiteByName(String site) |
int |
getNeedReconnect(String site) |
boolean |
getNewLeader(String s,
Object[] hostPort) |
long |
getReconnectTimestamp(String site) |
Site |
getSiteByName(String site) |
Map<String,StreamDeserializer> |
getSubInfos() |
ConcurrentHashMap<String,Site[]> |
getTopicToSites() |
boolean |
isClose() |
boolean |
isClosed(String topic) |
boolean |
isRemoteLittleEndian(String host) |
void |
setMsgId(String topic,
long msgId) |
void |
setNeedReconnect(String topic,
int v) |
void |
setReconnectTimestamp(String site,
long v) |
protected BlockingQueue<List<IMessage>> |
subscribeInternal(String host,
int port,
String tableName,
long offset) |
protected BlockingQueue<List<IMessage>> |
subscribeInternal(String host,
int port,
String tableName,
String actionName,
long offset) |
protected BlockingQueue<List<IMessage>> |
subscribeInternal(String host,
int port,
String tableName,
String actionName,
long offset,
boolean reconnect) |
protected BlockingQueue<List<IMessage>> |
subscribeInternal(String host,
int port,
String tableName,
String actionName,
MessageHandler handler,
long offset,
boolean reconnect,
Vector filter,
StreamDeserializer deserializer,
boolean allowExistTopic) |
protected BlockingQueue<List<IMessage>> |
subscribeInternal(String host,
int port,
String tableName,
String actionName,
MessageHandler handler,
long offset,
boolean reconnect,
Vector filter,
StreamDeserializer deserializer,
boolean allowExistTopic,
String userName,
String passWord,
boolean msgAsTable) |
protected BlockingQueue<List<IMessage>> |
subscribeInternal(String host,
int port,
String tableName,
String actionName,
MessageHandler handler,
long offset,
boolean reconnect,
Vector filter,
StreamDeserializer deserializer,
boolean allowExistTopic,
String userName,
String passWord,
boolean msgAsTable,
boolean createSubInfo) |
protected BlockingQueue<List<IMessage>> |
subscribeInternal(String host,
int port,
String tableName,
String actionName,
MessageHandler handler,
long offset,
boolean reconnect,
Vector filter,
StreamDeserializer deserializer,
boolean allowExistTopic,
String userName,
String passWord,
boolean msgAsTable,
List<String> backupSites,
int resubscribeInterval,
boolean subOnce) |
protected BlockingQueue<List<IMessage>> |
subscribeInternal(String host,
int port,
String tableName,
String actionName,
MessageHandler handler,
long offset,
boolean reconnect,
Vector filter,
StreamDeserializer deserializer,
boolean allowExistTopic,
String userName,
String passWord,
boolean msgAsTable,
List<String> backupSites,
int resubscribeInterval,
boolean subOnce,
boolean createSubInfo) |
protected Map<String,Object> |
subscribeStreamingSqlLogInfoInternal(String host,
int port,
String tableName,
String actionName,
MessageHandler handler,
long offset,
boolean reconnect,
Vector filter,
StreamDeserializer deserializer,
boolean allowExistTopic,
String userName,
String passWord,
boolean createSubInfo,
boolean streamingSQL,
boolean msgAsTable) |
boolean |
tryReconnect(String topic) |
protected void |
unsubscribeInternal(String host,
int port,
String tableName) |
protected void |
unsubscribeInternal(String host,
int port,
String tableName,
String actionName) |
protected static final int DEFAULT_PORT
protected static final String DEFAULT_HOST
protected static final String DEFAULT_ACTION_NAME
protected ConcurrentHashMap<String,com.xxdb.streaming.client.AbstractClient.ReconnectItem> reconnectTable
protected int listeningPort
protected String listeningHost
protected QueueManager queueManager
protected ConcurrentHashMap<String,List<IMessage>> messageCache
protected Thread pThread
protected ConcurrentHashMap<String,Site[]> trueTopicToSites
protected CopyOnWriteArraySet<String> waitReconnectTopic
protected Map<String,StreamDeserializer> subInfos_
protected boolean isClose_
protected LinkedBlockingQueue<DBConnection> connList
protected static boolean ifUseBackupSite
protected String lastBackupSiteTopic
protected static Integer resubscribeInterval
protected static boolean subOnce
protected BlockingQueue<List<IMessage>> lastQueue
protected String lastSuccessSubscribeTopic
protected List<AbstractClient.HAStreamTableInfo> haStreamTableInfo
public AbstractClient()
throws SocketException
SocketExceptionpublic AbstractClient(int subscribePort)
throws SocketException
SocketExceptionpublic AbstractClient(String subscribeHost, int subscribePort) throws SocketException
SocketExceptionpublic void setNeedReconnect(String topic, int v)
public int getNeedReconnect(String site)
public long getReconnectTimestamp(String site)
public void setReconnectTimestamp(String site, long v)
public Map<String,StreamDeserializer> getSubInfos()
protected abstract boolean doReconnect(Site site)
public void setMsgId(String topic, long msgId)
public boolean tryReconnect(String topic)
public void activeCloseConnection(Site site)
public void dispatch(IMessage msg)
public boolean isRemoteLittleEndian(String host)
public boolean isClosed(String topic)
protected BlockingQueue<List<IMessage>> subscribeInternal(String host, int port, String tableName, String actionName, MessageHandler handler, long offset, boolean reconnect, Vector filter, StreamDeserializer deserializer, boolean allowExistTopic) throws IOException, RuntimeException
IOExceptionRuntimeExceptionprotected BlockingQueue<List<IMessage>> subscribeInternal(String host, int port, String tableName, String actionName, MessageHandler handler, long offset, boolean reconnect, Vector filter, StreamDeserializer deserializer, boolean allowExistTopic, String userName, String passWord, boolean msgAsTable) throws IOException, RuntimeException
IOExceptionRuntimeExceptionprotected BlockingQueue<List<IMessage>> subscribeInternal(String host, int port, String tableName, String actionName, MessageHandler handler, long offset, boolean reconnect, Vector filter, StreamDeserializer deserializer, boolean allowExistTopic, String userName, String passWord, boolean msgAsTable, boolean createSubInfo) throws IOException, RuntimeException
IOExceptionRuntimeExceptionprotected BlockingQueue<List<IMessage>> subscribeInternal(String host, int port, String tableName, String actionName, MessageHandler handler, long offset, boolean reconnect, Vector filter, StreamDeserializer deserializer, boolean allowExistTopic, String userName, String passWord, boolean msgAsTable, List<String> backupSites, int resubscribeInterval, boolean subOnce, boolean createSubInfo) throws IOException, RuntimeException
IOExceptionRuntimeExceptionprotected Map<String,Object> subscribeStreamingSqlLogInfoInternal(String host, int port, String tableName, String actionName, MessageHandler handler, long offset, boolean reconnect, Vector filter, StreamDeserializer deserializer, boolean allowExistTopic, String userName, String passWord, boolean createSubInfo, boolean streamingSQL, boolean msgAsTable) throws IOException, RuntimeException
IOExceptionRuntimeExceptionprotected BlockingQueue<List<IMessage>> subscribeInternal(String host, int port, String tableName, String actionName, MessageHandler handler, long offset, boolean reconnect, Vector filter, StreamDeserializer deserializer, boolean allowExistTopic, String userName, String passWord, boolean msgAsTable, List<String> backupSites, int resubscribeInterval, boolean subOnce) throws IOException, RuntimeException
IOExceptionRuntimeExceptionprotected BlockingQueue<List<IMessage>> subscribeInternal(String host, int port, String tableName, String actionName, long offset, boolean reconnect) throws IOException, RuntimeException
IOExceptionRuntimeExceptionprotected BlockingQueue<List<IMessage>> subscribeInternal(String host, int port, String tableName, long offset) throws IOException, RuntimeException
IOExceptionRuntimeExceptionprotected BlockingQueue<List<IMessage>> subscribeInternal(String host, int port, String tableName, String actionName, long offset) throws IOException, RuntimeException
IOExceptionRuntimeExceptionprotected void unsubscribeInternal(String host, int port, String tableName, String actionName) throws IOException
IOExceptionpublic void close()
public boolean isClose()
protected void unsubscribeInternal(String host, int port, String tableName) throws IOException
IOExceptionpublic ConcurrentHashMap<String,Site[]> getTopicToSites()
Copyright © 2026 DolphinDB. All rights reserved.