public final class CassandraHost extends Object
| Modifier and Type | Field and Description |
|---|---|
static boolean |
DEFAULT_LIFO |
static int |
DEFAULT_MAX_ACTIVE |
static long |
DEFAULT_MAX_CONNECT_TIME
The default number of milliseconds (since creation time) we'll allow a connection
to stay open.
|
static long |
DEFAULT_MAX_EXHAUSTED_TIME_BEFORE_MARKING_AS_DOWN
The default max exhausted time before suspending.
|
static int |
DEFAULT_MAX_FRAME_SIZE
By default, match TFramedTransport's default max frame size (Integer.MAX_VALUE).
|
static long |
DEFAULT_MAX_LAST_SUCCESS_TIME
The default number of milliseconds (since last success) we'll allow a connection
to stay open.
|
static long |
DEFAULT_MAX_WAITTIME_WHEN_EXHAUSTED
The default max wait time when exhausted happens, default value is negative, which means
it'll block indefinitely.
|
static int |
DEFAULT_PORT
The default port number to which we will connect
|
static boolean |
DEFAULT_USE_FRAMED_THRIFT_TRANSPORT
By default, we will use TSocket transport on thrift (matches default Cassandra configs)
|
| Constructor and Description |
|---|
CassandraHost(String url) |
CassandraHost(String url2,
int port) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj)
Returns true if the ip and port are equal
|
int |
getCassandraThriftSocketTimeout() |
String |
getHost() |
String |
getIp() |
boolean |
getLifo() |
int |
getMaxActive() |
long |
getMaxConnectTimeMillis() |
long |
getMaxExhaustedTimeBeforeMarkingAsDown() |
int |
getMaxFrameSize() |
long |
getMaxLastSuccessTimeMillis() |
long |
getMaxWaitTimeWhenExhausted() |
String |
getName() |
int |
getPort() |
String |
getUrl() |
boolean |
getUseSocketKeepalive() |
boolean |
getUseThriftFramedTransport() |
int |
hashCode() |
boolean |
isPerformNameResolution()
Checks whether name resolution should occur.
|
static String |
parseHostFromUrl(String urlPort) |
static int |
parsePortFromUrl(String urlPort) |
void |
setCassandraThriftSocketTimeout(int cassandraThriftSocketTimeout) |
void |
setLifo(boolean lifo) |
void |
setMaxActive(int maxActive) |
void |
setMaxConnectTimeMillis(long maxConnectTimeMillis) |
void |
setMaxExhaustedTimeBeforeMarkingAsDown(long maxExhaustedTimeBeforeMarkingAsDown) |
void |
setMaxFrameSize(int maxFrameSize) |
void |
setMaxLastSuccessTimeMillis(long maxLastSuccessTimeMillis) |
void |
setMaxWaitTimeWhenExhausted(long maxWaitTimeWhenExhausted) |
void |
setUseSocketKeepalive(boolean useSocketKeepalive) |
void |
setUseThriftFramedTransport(boolean useThriftFramedTransport) |
String |
toString() |
public static final int DEFAULT_PORT
public static final int DEFAULT_MAX_ACTIVE
public static final boolean DEFAULT_USE_FRAMED_THRIFT_TRANSPORT
public static final int DEFAULT_MAX_FRAME_SIZE
public static final long DEFAULT_MAX_WAITTIME_WHEN_EXHAUSTED
public static final long DEFAULT_MAX_EXHAUSTED_TIME_BEFORE_MARKING_AS_DOWN
public static final boolean DEFAULT_LIFO
public static final long DEFAULT_MAX_CONNECT_TIME
public static final long DEFAULT_MAX_LAST_SUCCESS_TIME
public CassandraHost(String url)
public CassandraHost(String url2, int port)
public String getUrl()
public boolean isPerformNameResolution()
public String getName()
public String getHost()
public String getIp()
public int getPort()
public boolean equals(Object obj)
public int getMaxActive()
public void setMaxActive(int maxActive)
public long getMaxWaitTimeWhenExhausted()
public void setMaxWaitTimeWhenExhausted(long maxWaitTimeWhenExhausted)
public long getMaxExhaustedTimeBeforeMarkingAsDown()
public void setMaxExhaustedTimeBeforeMarkingAsDown(long maxExhaustedTimeBeforeMarkingAsDown)
public int getCassandraThriftSocketTimeout()
public void setCassandraThriftSocketTimeout(int cassandraThriftSocketTimeout)
public boolean getUseThriftFramedTransport()
public void setUseThriftFramedTransport(boolean useThriftFramedTransport)
public int getMaxFrameSize()
public void setMaxFrameSize(int maxFrameSize)
public static int parsePortFromUrl(String urlPort)
public boolean getLifo()
public void setLifo(boolean lifo)
public boolean getUseSocketKeepalive()
public void setUseSocketKeepalive(boolean useSocketKeepalive)
public long getMaxConnectTimeMillis()
public void setMaxConnectTimeMillis(long maxConnectTimeMillis)
public long getMaxLastSuccessTimeMillis()
public void setMaxLastSuccessTimeMillis(long maxLastSuccessTimeMillis)
Copyright © 2014. All Rights Reserved.