public class DefaultCoreEnvironment extends Object implements CoreEnvironment
Modifier and Type | Class and Description |
---|---|
static class |
DefaultCoreEnvironment.Builder |
Modifier and Type | Field and Description |
---|---|
static long |
AUTORELEASE_AFTER |
static int |
BOOTSTRAP_CARRIER_DIRECT_PORT |
static boolean |
BOOTSTRAP_CARRIER_ENABLED |
static int |
BOOTSTRAP_CARRIER_SSL_PORT |
static int |
BOOTSTRAP_HTTP_DIRECT_PORT |
static boolean |
BOOTSTRAP_HTTP_ENABLED |
static int |
BOOTSTRAP_HTTP_SSL_PORT |
static boolean |
BUFFER_POOLING_ENABLED |
static int |
COMPUTATION_POOL_SIZE |
static boolean |
DCP_ENABLED |
static int |
IO_POOL_SIZE |
static long |
KEEPALIVEINTERVAL |
static int |
KEYVALUE_ENDPOINTS |
static long |
MAX_REQUEST_LIFETIME |
static Delay |
OBSERVE_INTERVAL_DELAY |
static String |
PACKAGE_NAME_AND_VERSION |
static boolean |
QUERY_ENABLED |
static int |
QUERY_ENDPOINTS |
static int |
QUERY_PORT |
static Delay |
RECONNECT_DELAY |
static int |
REQUEST_BUFFER_SIZE |
static int |
RESPONSE_BUFFER_SIZE |
static Delay |
RETRY_DELAY |
static RetryStrategy |
RETRY_STRATEGY |
static boolean |
SSL_ENABLED |
static String |
SSL_KEYSTORE_FILE |
static String |
SSL_KEYSTORE_PASSWORD |
static String |
USER_AGENT |
static int |
VIEW_ENDPOINTS |
Modifier | Constructor and Description |
---|---|
protected |
DefaultCoreEnvironment(DefaultCoreEnvironment.Builder builder) |
Modifier and Type | Method and Description |
---|---|
long |
autoreleaseAfter()
The time in milliseconds after which a non-subscribed observable is going to be automatically released.
|
protected boolean |
booleanPropertyOr(String path,
boolean def) |
int |
bootstrapCarrierDirectPort()
The port to use when bootstrapping through carrier publication without SSL.
|
boolean |
bootstrapCarrierEnabled() |
int |
bootstrapCarrierSslPort()
The port to use when bootstrapping through carrier publication with SSL.
|
int |
bootstrapHttpDirectPort()
The port to use when bootstrapping through HTTP without SSL.
|
boolean |
bootstrapHttpEnabled() |
int |
bootstrapHttpSslPort()
The port to use when bootstrapping through HTTP with SSL.
|
boolean |
bufferPoolingEnabled()
Returns if buffer pooling is enabled for greater GC efficiency.
|
static DefaultCoreEnvironment.Builder |
builder() |
int |
computationPoolSize() |
static DefaultCoreEnvironment |
create() |
boolean |
dcpEnabled()
Identifies if DCP should be enabled.
|
protected StringBuilder |
dumpParameters(StringBuilder sb)
Dumps the environment parameters known to this implementation into a
StringBuilder , which is returned for method chaining. |
EventBus |
eventBus()
Returns the event bus where events are broadcasted on and can be published to.
|
protected int |
intPropertyOr(String path,
int def) |
EventLoopGroup |
ioPool()
Returns the IO pool for the underlying IO framework.
|
int |
ioPoolSize()
Returns the configured IO pool size.
|
long |
keepAliveInterval()
The time in milliseconds after which some service will issue a form of keep-alive request.
|
int |
kvEndpoints()
The number of key/value service endpoints.
|
protected static long |
longPropertyOr(String path,
long def) |
long |
maxRequestLifetime()
Returns the maximum time in milliseconds a request is allowed to life.
|
Delay |
observeIntervalDelay()
|
String |
packageNameAndVersion()
Returns name and the version of the package.
|
boolean |
queryEnabled() |
int |
queryEndpoints()
The number of query service endpoints.
|
int |
queryPort() |
Delay |
reconnectDelay()
Returns the
Delay for node reconnects. |
int |
requestBufferSize()
Returns the size of the request ringbuffer.
|
int |
responseBufferSize()
Returns the size of the response ringbuffer.
|
Delay |
retryDelay()
Returns the
Delay for request retries. |
RetryStrategy |
retryStrategy()
The retry strategy on how to dispatch requests in the failure case.
|
Scheduler |
scheduler()
Returns the scheduler which should be used for all core actions that need to happen asynchronously.
|
Observable<Boolean> |
shutdown()
Shutdown the
CoreEnvironment . |
boolean |
sslEnabled()
Identifies if SSL should be enabled.
|
String |
sslKeystoreFile() |
String |
sslKeystorePassword() |
protected String |
stringPropertyOr(String path,
String def) |
String |
toString() |
String |
userAgent()
Library identification string, which can be used as User-Agent header in HTTP requests.
|
int |
viewEndpoints()
The number of view service endpoints.
|
public static final boolean DCP_ENABLED
public static final boolean SSL_ENABLED
public static final String SSL_KEYSTORE_FILE
public static final String SSL_KEYSTORE_PASSWORD
public static final boolean QUERY_ENABLED
public static final int QUERY_PORT
public static final boolean BOOTSTRAP_HTTP_ENABLED
public static final boolean BOOTSTRAP_CARRIER_ENABLED
public static final int BOOTSTRAP_HTTP_DIRECT_PORT
public static final int BOOTSTRAP_HTTP_SSL_PORT
public static final int BOOTSTRAP_CARRIER_DIRECT_PORT
public static final int BOOTSTRAP_CARRIER_SSL_PORT
public static final int REQUEST_BUFFER_SIZE
public static final int RESPONSE_BUFFER_SIZE
public static final int IO_POOL_SIZE
public static final int COMPUTATION_POOL_SIZE
public static final int KEYVALUE_ENDPOINTS
public static final int VIEW_ENDPOINTS
public static final int QUERY_ENDPOINTS
public static final Delay OBSERVE_INTERVAL_DELAY
public static final Delay RECONNECT_DELAY
public static final Delay RETRY_DELAY
public static final RetryStrategy RETRY_STRATEGY
public static final long MAX_REQUEST_LIFETIME
public static final long KEEPALIVEINTERVAL
public static final long AUTORELEASE_AFTER
public static final boolean BUFFER_POOLING_ENABLED
public static String PACKAGE_NAME_AND_VERSION
public static String USER_AGENT
protected DefaultCoreEnvironment(DefaultCoreEnvironment.Builder builder)
public static DefaultCoreEnvironment create()
public static DefaultCoreEnvironment.Builder builder()
protected boolean booleanPropertyOr(String path, boolean def)
protected int intPropertyOr(String path, int def)
protected static long longPropertyOr(String path, long def)
public EventLoopGroup ioPool()
CoreEnvironment
Returns the IO pool for the underlying IO framework.
ioPool
in interface CoreEnvironment
public Observable<Boolean> shutdown()
CoreEnvironment
Shutdown the CoreEnvironment
.
shutdown
in interface CoreEnvironment
public Scheduler scheduler()
CoreEnvironment
Returns the scheduler which should be used for all core actions that need to happen asynchronously.
scheduler
in interface CoreEnvironment
public boolean sslEnabled()
CoreEnvironment
Identifies if SSL should be enabled.
sslEnabled
in interface CoreEnvironment
public boolean dcpEnabled()
CoreEnvironment
Identifies if DCP should be enabled.
dcpEnabled
in interface CoreEnvironment
public String sslKeystoreFile()
sslKeystoreFile
in interface CoreEnvironment
public String sslKeystorePassword()
sslKeystorePassword
in interface CoreEnvironment
public boolean queryEnabled()
queryEnabled
in interface CoreEnvironment
public int queryPort()
queryPort
in interface CoreEnvironment
public boolean bootstrapHttpEnabled()
bootstrapHttpEnabled
in interface CoreEnvironment
public boolean bootstrapCarrierEnabled()
bootstrapCarrierEnabled
in interface CoreEnvironment
public int bootstrapHttpDirectPort()
CoreEnvironment
The port to use when bootstrapping through HTTP without SSL.
bootstrapHttpDirectPort
in interface CoreEnvironment
public int bootstrapHttpSslPort()
CoreEnvironment
The port to use when bootstrapping through HTTP with SSL.
bootstrapHttpSslPort
in interface CoreEnvironment
public int bootstrapCarrierDirectPort()
CoreEnvironment
The port to use when bootstrapping through carrier publication without SSL.
bootstrapCarrierDirectPort
in interface CoreEnvironment
public int bootstrapCarrierSslPort()
CoreEnvironment
The port to use when bootstrapping through carrier publication with SSL.
bootstrapCarrierSslPort
in interface CoreEnvironment
public int ioPoolSize()
CoreEnvironment
Returns the configured IO pool size.
ioPoolSize
in interface CoreEnvironment
public int computationPoolSize()
computationPoolSize
in interface CoreEnvironment
public int requestBufferSize()
CoreEnvironment
Returns the size of the request ringbuffer.
requestBufferSize
in interface CoreEnvironment
public int responseBufferSize()
CoreEnvironment
Returns the size of the response ringbuffer.
responseBufferSize
in interface CoreEnvironment
public int kvEndpoints()
CoreEnvironment
The number of key/value service endpoints.
kvEndpoints
in interface CoreEnvironment
public int viewEndpoints()
CoreEnvironment
The number of view service endpoints.
viewEndpoints
in interface CoreEnvironment
public int queryEndpoints()
CoreEnvironment
The number of query service endpoints.
queryEndpoints
in interface CoreEnvironment
public String userAgent()
CoreEnvironment
Library identification string, which can be used as User-Agent header in HTTP requests.
userAgent
in interface CoreEnvironment
public String packageNameAndVersion()
CoreEnvironment
Returns name and the version of the package. This method used to by @{link userAgent()}.
packageNameAndVersion
in interface CoreEnvironment
public Delay observeIntervalDelay()
CoreEnvironment
observeIntervalDelay
in interface CoreEnvironment
public Delay reconnectDelay()
CoreEnvironment
Returns the Delay
for node reconnects.
reconnectDelay
in interface CoreEnvironment
public Delay retryDelay()
CoreEnvironment
Returns the Delay
for request retries.
retryDelay
in interface CoreEnvironment
public RetryStrategy retryStrategy()
CoreEnvironment
The retry strategy on how to dispatch requests in the failure case.
retryStrategy
in interface CoreEnvironment
public long maxRequestLifetime()
CoreEnvironment
Returns the maximum time in milliseconds a request is allowed to life.
If the best effort retry strategy is used, the request will still be cancelled after this period to make sure that requests are not sticking around forever. Make sure it is longer than any timeout you potentially have configured.
maxRequestLifetime
in interface CoreEnvironment
public long keepAliveInterval()
CoreEnvironment
The time in milliseconds after which some service will issue a form of keep-alive request.
keepAliveInterval
in interface CoreEnvironment
public EventBus eventBus()
CoreEnvironment
Returns the event bus where events are broadcasted on and can be published to.
eventBus
in interface CoreEnvironment
public long autoreleaseAfter()
CoreEnvironment
The time in milliseconds after which a non-subscribed observable is going to be automatically released.
This prevents accidentally leaking buffers when requested but not consumed by the user.
autoreleaseAfter
in interface CoreEnvironment
public boolean bufferPoolingEnabled()
CoreEnvironment
Returns if buffer pooling is enabled for greater GC efficiency.
In general this is always set to true and should only be set to false if there are leaks reported that are not fixable by correcting user level code.
bufferPoolingEnabled
in interface CoreEnvironment
protected StringBuilder dumpParameters(StringBuilder sb)
Dumps the environment parameters known to this implementation into a StringBuilder
, which is returned for method chaining.
sb
- the StringBuilder in which to dump parameters.Copyright © 2014 Couchbase, Inc.