Skip to content

Commit

Permalink
Update list of global cfg can be modifiable at run-time
Browse files Browse the repository at this point in the history
  • Loading branch information
lvca committed Aug 6, 2015
1 parent 70d41ff commit 11a92d5
Showing 1 changed file with 46 additions and 42 deletions.
Expand Up @@ -55,7 +55,7 @@ public enum OGlobalConfiguration {
Boolean.class, Boolean.TRUE), Boolean.class, Boolean.TRUE),


ENVIRONMENT_ALLOW_JVM_SHUTDOWN("environment.allowJVMShutdown", "Allows to shutdown the JVM if needed/requested", Boolean.class, ENVIRONMENT_ALLOW_JVM_SHUTDOWN("environment.allowJVMShutdown", "Allows to shutdown the JVM if needed/requested", Boolean.class,
true), true, true),


// SCRIPT // SCRIPT
SCRIPT_POOL("script.pool.maxSize", "Maximum number of instances in the pool of script engines", Integer.class, 20), SCRIPT_POOL("script.pool.maxSize", "Maximum number of instances in the pool of script engines", Integer.class, 20),
Expand Down Expand Up @@ -185,7 +185,8 @@ public enum OGlobalConfiguration {
Boolean.class, true), Boolean.class, true),


// DATABASE // DATABASE
OBJECT_SAVE_ONLY_DIRTY("object.saveOnlyDirty", "Object Database only saves objects bound to dirty records", Boolean.class, false), OBJECT_SAVE_ONLY_DIRTY("object.saveOnlyDirty", "Object Database only saves objects bound to dirty records", Boolean.class, false,
true),


// DATABASE // DATABASE
DB_POOL_MIN("db.pool.min", "Default database pool minimum size", Integer.class, 1), DB_POOL_MIN("db.pool.min", "Default database pool minimum size", Integer.class, 1),
Expand All @@ -199,9 +200,9 @@ public enum OGlobalConfiguration {
DB_MVCC_THROWFAST( DB_MVCC_THROWFAST(
"db.mvcc.throwfast", "db.mvcc.throwfast",
"Use fast-thrown exceptions for MVCC OConcurrentModificationExceptions. No context information will be available, use where these exceptions are handled and the detail is not neccessary", "Use fast-thrown exceptions for MVCC OConcurrentModificationExceptions. No context information will be available, use where these exceptions are handled and the detail is not neccessary",
Boolean.class, false), Boolean.class, false, true),


DB_VALIDATION("db.validation", "Enables or disables validation of records", Boolean.class, true), DB_VALIDATION("db.validation", "Enables or disables validation of records", Boolean.class, true, true),


// SETTINGS OF NON-TRANSACTIONAL MODE // SETTINGS OF NON-TRANSACTIONAL MODE
NON_TX_RECORD_UPDATE_SYNCH("nonTX.recordUpdate.synch", NON_TX_RECORD_UPDATE_SYNCH("nonTX.recordUpdate.synch",
Expand Down Expand Up @@ -309,42 +310,45 @@ public enum OGlobalConfiguration {
"This property disable to using JNA installed in your system. And use JNA bundled with database.", boolean.class, true), "This property disable to using JNA installed in your system. And use JNA bundled with database.", boolean.class, true),


// NETWORK // NETWORK
NETWORK_MAX_CONCURRENT_SESSIONS("network.maxConcurrentSessions", "Maximum number of concurrent sessions", Integer.class, 1000), NETWORK_MAX_CONCURRENT_SESSIONS("network.maxConcurrentSessions", "Maximum number of concurrent sessions", Integer.class, 1000,
true),


NETWORK_SOCKET_BUFFER_SIZE("network.socketBufferSize", "TCP/IP Socket buffer size", Integer.class, 32768), NETWORK_SOCKET_BUFFER_SIZE("network.socketBufferSize", "TCP/IP Socket buffer size", Integer.class, 32768, true),


NETWORK_LOCK_TIMEOUT("network.lockTimeout", "Timeout in ms to acquire a lock against a channel", Integer.class, 15000), NETWORK_LOCK_TIMEOUT("network.lockTimeout", "Timeout in ms to acquire a lock against a channel", Integer.class, 15000, true),


NETWORK_SOCKET_TIMEOUT("network.socketTimeout", "TCP/IP Socket timeout in ms", Integer.class, 15000), NETWORK_SOCKET_TIMEOUT("network.socketTimeout", "TCP/IP Socket timeout in ms", Integer.class, 15000, true),


NETWORK_REQUEST_TIMEOUT("network.requestTimeout", "Request completion timeout in ms ", Integer.class, 3600000 /* one hour */), NETWORK_REQUEST_TIMEOUT("network.requestTimeout", "Request completion timeout in ms ", Integer.class, 3600000 /* one hour */,
true),


NETWORK_SOCKET_RETRY("network.retry", "Number of times the client retries its connection to the server on failure", NETWORK_SOCKET_RETRY("network.retry", "Number of times the client retries its connection to the server on failure",
Integer.class, 5), Integer.class, 5, true),


NETWORK_SOCKET_RETRY_DELAY("network.retryDelay", "Number of ms the client waits before reconnecting to the server on failure", NETWORK_SOCKET_RETRY_DELAY("network.retryDelay", "Number of ms the client waits before reconnecting to the server on failure",
Integer.class, 500), Integer.class, 500, true),


NETWORK_BINARY_DNS_LOADBALANCING_ENABLED("network.binary.loadBalancing.enabled", NETWORK_BINARY_DNS_LOADBALANCING_ENABLED("network.binary.loadBalancing.enabled",
"Asks for DNS TXT record to determine if load balancing is supported", Boolean.class, Boolean.FALSE), "Asks for DNS TXT record to determine if load balancing is supported", Boolean.class, Boolean.FALSE, true),


NETWORK_BINARY_DNS_LOADBALANCING_TIMEOUT("network.binary.loadBalancing.timeout", NETWORK_BINARY_DNS_LOADBALANCING_TIMEOUT("network.binary.loadBalancing.timeout",
"Maximum time (in ms) to wait for the answer from DNS about the TXT record for load balancing", Integer.class, 2000), "Maximum time (in ms) to wait for the answer from DNS about the TXT record for load balancing", Integer.class, 2000, true),


NETWORK_BINARY_MAX_CONTENT_LENGTH("network.binary.maxLength", "TCP/IP max content length in bytes of BINARY requests", NETWORK_BINARY_MAX_CONTENT_LENGTH("network.binary.maxLength", "TCP/IP max content length in bytes of BINARY requests",
Integer.class, 32736), Integer.class, 32736, true),


NETWORK_BINARY_READ_RESPONSE_MAX_TIMES("network.binary.readResponse.maxTimes", NETWORK_BINARY_READ_RESPONSE_MAX_TIMES("network.binary.readResponse.maxTimes",
"Maximum times to wait until response will be read. Otherwise response will be dropped from chanel", Integer.class, 20), "Maximum times to wait until response will be read. Otherwise response will be dropped from chanel", Integer.class, 20, true),


NETWORK_BINARY_DEBUG("network.binary.debug", "Debug mode: print all data incoming on the binary channel", Boolean.class, false), NETWORK_BINARY_DEBUG("network.binary.debug", "Debug mode: print all data incoming on the binary channel", Boolean.class, false,
true),


NETWORK_HTTP_MAX_CONTENT_LENGTH("network.http.maxLength", "TCP/IP max content length in bytes for HTTP requests", Integer.class, NETWORK_HTTP_MAX_CONTENT_LENGTH("network.http.maxLength", "TCP/IP max content length in bytes for HTTP requests", Integer.class,
1000000), 1000000, true),


NETWORK_HTTP_CONTENT_CHARSET("network.http.charset", "Http response charset", String.class, "utf-8"), NETWORK_HTTP_CONTENT_CHARSET("network.http.charset", "Http response charset", String.class, "utf-8", true),


NETWORK_HTTP_JSON_RESPONSE_ERROR("network.http.jsonResponseError", "Http response error in json", Boolean.class, true), NETWORK_HTTP_JSON_RESPONSE_ERROR("network.http.jsonResponseError", "Http response error in json", Boolean.class, true, true),


OAUTH2_SECRETKEY("oauth2.secretkey", "Http OAuth2 secret key", String.class, "utf-8"), NETWORK_HTTP_SESSION_EXPIRE_TIMEOUT( OAUTH2_SECRETKEY("oauth2.secretkey", "Http OAuth2 secret key", String.class, "utf-8"), NETWORK_HTTP_SESSION_EXPIRE_TIMEOUT(
"network.http.sessionExpireTimeout", "Timeout after which an http session is considered tp have expired (seconds)", "network.http.sessionExpireTimeout", "Timeout after which an http session is considered tp have expired (seconds)",
Expand Down Expand Up @@ -411,10 +415,10 @@ public void change(final Object iCurrentValue, final Object iNewValue) {
* Maximum time which client should wait a connection from the pool when all connection are used. * Maximum time which client should wait a connection from the pool when all connection are used.
*/ */
CLIENT_CONNECT_POOL_WAIT_TIMEOUT("client.connectionPool.waitTimeout", CLIENT_CONNECT_POOL_WAIT_TIMEOUT("client.connectionPool.waitTimeout",
"Maximum time which client should wait a connection from the pool when all connection are used", Integer.class, 5000,true), "Maximum time which client should wait a connection from the pool when all connection are used", Integer.class, 5000, true),


CLIENT_DB_RELEASE_WAIT_TIMEOUT("client.channel.dbReleaseWaitTimeout", CLIENT_DB_RELEASE_WAIT_TIMEOUT("client.channel.dbReleaseWaitTimeout",
"Delay in ms. after which data modification command will be resent if DB was frozen", Integer.class, 10000), "Delay in ms. after which data modification command will be resent if DB was frozen", Integer.class, 10000, true),


CLIENT_USE_SSL("client.ssl.enabled", "Use SSL for client connections", Boolean.class, false), CLIENT_USE_SSL("client.ssl.enabled", "Use SSL for client connections", Boolean.class, false),


Expand All @@ -440,29 +444,29 @@ public void change(final Object iCurrentValue, final Object iNewValue) {
Level.class, Level.FINE), Level.class, Level.FINE),


SERVER_LOG_DUMP_CLIENT_EXCEPTION_FULLSTACKTRACE("server.log.dumpClientExceptionFullStackTrace", SERVER_LOG_DUMP_CLIENT_EXCEPTION_FULLSTACKTRACE("server.log.dumpClientExceptionFullStackTrace",
"Dumps the full stack trace of the exception to sent to the client", Boolean.class, Boolean.FALSE), "Dumps the full stack trace of the exception to sent to the client", Boolean.class, Boolean.FALSE, true),


// DISTRIBUTED // DISTRIBUTED
DISTRIBUTED_CRUD_TASK_SYNCH_TIMEOUT("distributed.crudTaskTimeout", DISTRIBUTED_CRUD_TASK_SYNCH_TIMEOUT("distributed.crudTaskTimeout",
"Maximum timeout in milliseconds to wait for CRUD remote tasks", Long.class, 3000l), "Maximum timeout in milliseconds to wait for CRUD remote tasks", Long.class, 3000l, true),


DISTRIBUTED_COMMAND_TASK_SYNCH_TIMEOUT("distributed.commandTaskTimeout", DISTRIBUTED_COMMAND_TASK_SYNCH_TIMEOUT("distributed.commandTaskTimeout",
"Maximum timeout in milliseconds to wait for Command remote tasks", Long.class, 10000l), "Maximum timeout in milliseconds to wait for Command remote tasks", Long.class, 10000l, true),


DISTRIBUTED_COMMAND_LONG_TASK_SYNCH_TIMEOUT("distributed.commandLongTaskTimeout", DISTRIBUTED_COMMAND_LONG_TASK_SYNCH_TIMEOUT("distributed.commandLongTaskTimeout",
"Maximum timeout in milliseconds to wait for Long-running remote tasks", Long.class, 24 * 60 * 60 * 1000), "Maximum timeout in milliseconds to wait for Long-running remote tasks", Long.class, 24 * 60 * 60 * 1000, true),


DISTRIBUTED_DEPLOYDB_TASK_SYNCH_TIMEOUT("distributed.deployDbTaskTimeout", DISTRIBUTED_DEPLOYDB_TASK_SYNCH_TIMEOUT("distributed.deployDbTaskTimeout",
"Maximum timeout in milliseconds to wait for database deployment", Long.class, 1200000l), "Maximum timeout in milliseconds to wait for database deployment", Long.class, 1200000l, true),


DISTRIBUTED_DEPLOYCHUNK_TASK_SYNCH_TIMEOUT("distributed.deployChunkTaskTimeout", DISTRIBUTED_DEPLOYCHUNK_TASK_SYNCH_TIMEOUT("distributed.deployChunkTaskTimeout",
"Maximum timeout in milliseconds to wait for database chunk deployment", Long.class, 15000l), "Maximum timeout in milliseconds to wait for database chunk deployment", Long.class, 15000l, true),


DISTRIBUTED_DEPLOYDB_TASK_COMPRESSION("distributed.deployDbTaskCompression", DISTRIBUTED_DEPLOYDB_TASK_COMPRESSION("distributed.deployDbTaskCompression",
"Compression level between 0 and 9 to use in backup for database deployment", Integer.class, 7), "Compression level between 0 and 9 to use in backup for database deployment", Integer.class, 7, true),


DISTRIBUTED_QUEUE_TIMEOUT("distributed.queueTimeout", "Maximum timeout in milliseconds to wait for the response in replication", DISTRIBUTED_QUEUE_TIMEOUT("distributed.queueTimeout", "Maximum timeout in milliseconds to wait for the response in replication",
Long.class, 5000l), Long.class, 5000l, true),


DISTRIBUTED_ASYNCH_QUEUE_SIZE("distributed.asynchQueueSize", DISTRIBUTED_ASYNCH_QUEUE_SIZE("distributed.asynchQueueSize",
"Queue size to handle distributed asynchronous operations. 0 = dynamic allocation (up to 2^31-1 entries)", Integer.class, 0), "Queue size to handle distributed asynchronous operations. 0 = dynamic allocation (up to 2^31-1 entries)", Integer.class, 0),
Expand All @@ -480,21 +484,21 @@ public void change(final Object iCurrentValue, final Object iNewValue) {
DISTRIBUTED_CONCURRENT_TX_MAX_AUTORETRY( DISTRIBUTED_CONCURRENT_TX_MAX_AUTORETRY(
"distributed.concurrentTxMaxAutoRetry", "distributed.concurrentTxMaxAutoRetry",
"Maximum retries the transaction coordinator can execute a transaction automatically if records are locked. Minimum is 1 (no retry)", "Maximum retries the transaction coordinator can execute a transaction automatically if records are locked. Minimum is 1 (no retry)",
Integer.class, 10), Integer.class, 10, true),


/** /**
* @Since 2.1 * @Since 2.1
*/ */
@OApi(maturity = OApi.MATURITY.NEW) @OApi(maturity = OApi.MATURITY.NEW)
DISTRIBUTED_CONCURRENT_TX_AUTORETRY_DELAY("distributed.concurrentTxAutoRetryDelay", DISTRIBUTED_CONCURRENT_TX_AUTORETRY_DELAY("distributed.concurrentTxAutoRetryDelay",
"Delay in ms between attempts on executing a distributed transaction failed because of records locked. 0=no delay", "Delay in ms between attempts on executing a distributed transaction failed because of records locked. 0=no delay",
Integer.class, 100), Integer.class, 100, true),


DB_MAKE_FULL_CHECKPOINT_ON_INDEX_CHANGE("db.makeFullCheckpointOnIndexChange", DB_MAKE_FULL_CHECKPOINT_ON_INDEX_CHANGE("db.makeFullCheckpointOnIndexChange",
"When index metadata is changed full checkpoint is performed", Boolean.class, true), "When index metadata is changed full checkpoint is performed", Boolean.class, true, true),


DB_MAKE_FULL_CHECKPOINT_ON_SCHEMA_CHANGE("db.makeFullCheckpointOnSchemaChange", DB_MAKE_FULL_CHECKPOINT_ON_SCHEMA_CHANGE("db.makeFullCheckpointOnSchemaChange",
"When index schema is changed full checkpoint is performed", Boolean.class, true), "When index schema is changed full checkpoint is performed", Boolean.class, true, true),


DB_DOCUMENT_SERIALIZER("db.document.serializer", "The default record serializer used by the document database", String.class, DB_DOCUMENT_SERIALIZER("db.document.serializer", "The default record serializer used by the document database", String.class,
ORecordSerializerBinary.NAME), ORecordSerializerBinary.NAME),
Expand Down Expand Up @@ -595,7 +599,7 @@ public void change(final Object iCurrentValue, final Object iNewValue) {
private Object value = null; private Object value = null;
private String description; private String description;
private OConfigurationChangeCallback changeCallback = null; private OConfigurationChangeCallback changeCallback = null;
private Boolean canChange; private Boolean canChangeAtRuntime;


// AT STARTUP AUTO-CONFIG // AT STARTUP AUTO-CONFIG
static { static {
Expand All @@ -619,7 +623,7 @@ public void change(final Object iCurrentValue, final Object iNewValue) {
description = iDescription; description = iDescription;
defValue = iDefValue; defValue = iDefValue;
type = iType; type = iType;
canChange = iCanChange; canChangeAtRuntime = iCanChange;


} }


Expand Down Expand Up @@ -768,11 +772,11 @@ else if (type == String.class)
value = iValue; value = iValue;


if (changeCallback != null) { if (changeCallback != null) {
try { try {
changeCallback.change(oldValue, value); changeCallback.change(oldValue, value);
}catch (Exception e){ } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
} }
} }


Expand Down Expand Up @@ -804,8 +808,8 @@ public String getKey() {
return key; return key;
} }


public Boolean getCanChange() { public Boolean isChangeableAtRuntime() {
return canChange; return canChangeAtRuntime;
} }


public Object getDefValue() { public Object getDefValue() {
Expand Down

0 comments on commit 11a92d5

Please sign in to comment.