public class ThreadedClient extends Object
| Modifier and Type | Field and Description |
|---|---|
protected static String |
DEFAULT_ACTION_NAME |
protected static String |
DEFAULT_HOST |
protected static int |
DEFAULT_PORT |
protected HashMap<String,String> |
HATopicToTrueTopic |
protected HashMap<String,Boolean> |
hostEndian |
protected String |
listeningHost |
protected int |
listeningPort |
protected ConcurrentHashMap<String,List<IMessage>> |
messageCache |
protected Thread |
pThread |
protected com.xxdb.streaming.client.QueueManager |
queueManager |
protected ConcurrentHashMap<String,com.xxdb.streaming.client.AbstractClient.ReconnectItem> |
reconnectTable |
protected HashMap<String,String> |
tableNameToTrueTopic |
protected ConcurrentHashMap<String,com.xxdb.streaming.client.AbstractClient.Site[]> |
trueTopicToSites |
protected CopyOnWriteArraySet<String> |
waitReconnectTopic |
| Constructor and Description |
|---|
ThreadedClient() |
ThreadedClient(int subscribePort) |
ThreadedClient(String subscribeHost,
int subscribePort) |
| Modifier and Type | Method and Description |
|---|---|
void |
activeCloseConnection(com.xxdb.streaming.client.AbstractClient.Site site) |
void |
batchDispatch(List<IMessage> messags) |
void |
dispatch(IMessage msg) |
protected boolean |
doReconnect(com.xxdb.streaming.client.AbstractClient.Site site) |
List<String> |
getAllReconnectSites() |
Set<String> |
getAllReconnectTopic() |
List<String> |
getAllTopicsBySite(String site) |
int |
getNeedReconnect(String site) |
long |
getReconnectTimestamp(String site) |
com.xxdb.streaming.client.AbstractClient.Site |
getSiteByName(String site) |
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) |
void |
subscribe(String host,
int port,
String tableName,
MessageHandler handler) |
void |
subscribe(String host,
int port,
String tableName,
MessageHandler handler,
boolean reconnect) |
void |
subscribe(String host,
int port,
String tableName,
MessageHandler handler,
long offset) |
void |
subscribe(String host,
int port,
String tableName,
MessageHandler handler,
long offset,
boolean reconnect) |
void |
subscribe(String host,
int port,
String tableName,
String actionName,
MessageHandler handler) |
void |
subscribe(String host,
int port,
String tableName,
String actionName,
MessageHandler handler,
boolean reconnect) |
void |
subscribe(String host,
int port,
String tableName,
String actionName,
MessageHandler handler,
long offset) |
void |
subscribe(String host,
int port,
String tableName,
String actionName,
MessageHandler handler,
long offset,
boolean reconnect) |
void |
subscribe(String host,
int port,
String tableName,
String actionName,
MessageHandler handler,
long offset,
boolean reconnect,
Vector filter,
boolean allowExistTopic) |
void |
subscribe(String host,
int port,
String tableName,
String actionName,
MessageHandler handler,
long offset,
Vector filter) |
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,
boolean allowExistTopic) |
boolean |
tryReconnect(String topic) |
void |
unsubscribe(String host,
int port,
String tableName) |
void |
unsubscribe(String host,
int port,
String tableName,
String actionName) |
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 com.xxdb.streaming.client.QueueManager queueManager
protected ConcurrentHashMap<String,List<IMessage>> messageCache
protected Thread pThread
protected ConcurrentHashMap<String,com.xxdb.streaming.client.AbstractClient.Site[]> trueTopicToSites
protected CopyOnWriteArraySet<String> waitReconnectTopic
public ThreadedClient()
throws SocketException
SocketExceptionpublic ThreadedClient(int subscribePort)
throws SocketException
SocketExceptionpublic ThreadedClient(String subscribeHost, int subscribePort) throws SocketException
SocketExceptionprotected boolean doReconnect(com.xxdb.streaming.client.AbstractClient.Site site)
public void subscribe(String host, int port, String tableName, String actionName, MessageHandler handler, long offset, boolean reconnect, Vector filter, boolean allowExistTopic) throws IOException
IOExceptionpublic void subscribe(String host, int port, String tableName, String actionName, MessageHandler handler, long offset, boolean reconnect) throws IOException
IOExceptionpublic void subscribe(String host, int port, String tableName, String actionName, MessageHandler handler, long offset, Vector filter) throws IOException
IOExceptionpublic void subscribe(String host, int port, String tableName, String actionName, MessageHandler handler, long offset) throws IOException
IOExceptionpublic void subscribe(String host, int port, String tableName, String actionName, MessageHandler handler) throws IOException
IOExceptionpublic void subscribe(String host, int port, String tableName, String actionName, MessageHandler handler, boolean reconnect) throws IOException
IOExceptionpublic void subscribe(String host, int port, String tableName, MessageHandler handler) throws IOException
IOExceptionpublic void subscribe(String host, int port, String tableName, MessageHandler handler, boolean reconnect) throws IOException
IOExceptionpublic void subscribe(String host, int port, String tableName, MessageHandler handler, long offset) throws IOException
IOExceptionpublic void subscribe(String host, int port, String tableName, MessageHandler handler, long offset, boolean reconnect) throws IOException
IOExceptionpublic void unsubscribe(String host, int port, String tableName, String actionName) throws IOException
IOExceptionpublic void unsubscribe(String host, int port, String tableName) throws IOException
IOExceptionpublic void setNeedReconnect(String topic, int v)
public int getNeedReconnect(String site)
public long getReconnectTimestamp(String site)
public void setReconnectTimestamp(String site, long v)
public com.xxdb.streaming.client.AbstractClient.Site getSiteByName(String site)
public void setMsgId(String topic, long msgId)
public boolean tryReconnect(String topic)
public void activeCloseConnection(com.xxdb.streaming.client.AbstractClient.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, boolean allowExistTopic) 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
IOExceptionprotected void unsubscribeInternal(String host, int port, String tableName) throws IOException
IOExceptionCopyright © 2021 DolphinDB. All rights reserved.