public final class ConfigManager
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
dumpConfigurations()
Prints out this configuration.
|
int |
getBatchSize()
Returns the default batchSize for workers.
|
Connector |
getConnector(Connector.ConnectorType type)
Returns the models server socket connector.
|
java.lang.String |
getCorsAllowedHeaders()
Returns the CORS allowed headers setting.
|
java.lang.String |
getCorsAllowedMethods()
Returns the CORS allowed method setting.
|
java.lang.String |
getCorsAllowedOrigin()
Returns the CORS allowed origin setting.
|
int |
getDefaultWorkers()
Returns the default number of workers for a new registered model.
|
static ConfigManager |
getInstance()
Returns the singleton
ConfigManager instance. |
int |
getIoRatio()
Returns the native IO ratio.
|
int |
getJobQueueSize()
Returns the default job queue size.
|
java.lang.String |
getLoadModels()
Returns the model urls that to be loaded at startup.
|
int |
getMaxBatchDelay()
Returns the default maxBatchDelay for the working queue.
|
int |
getMaxIdleTime()
Returns the default max idle time for workers.
|
int |
getMaxRequestSize()
Returns the maximum allowed request size in bytes.
|
static java.lang.String |
getModelServerHome()
Returns the model server home directory.
|
java.nio.file.Path |
getModelStore()
Returns the model store location.
|
java.lang.String |
getModelUrlPattern()
Returns the allowed model url pattern regex.
|
int |
getNettyClientThreads()
Returns the configured netty client threads.
|
int |
getNettyThreads()
Returns the configured netty threads.
|
int |
getNumberOfGpu()
Returns the number of GPUs to be used.
|
java.nio.file.Path |
getPluginFolder()
return the folder where the model search for plugins.
|
java.lang.String |
getProperty(java.lang.String key,
java.lang.String def)
Returns the value with the specified key in this configuration.
|
io.netty.handler.ssl.SslContext |
getSslContext()
Returns a
SSLContext instance. |
static void |
init(Arguments args)
Initialize the global
ConfigManager instance. |
boolean |
isDebug()
Returns if debug is enabled.
|
boolean |
useNativeIo()
Returns if use netty native IO.
|
public static void init(Arguments args)
ConfigManager instance.args - the command line argumentspublic static ConfigManager getInstance()
ConfigManager instance.ConfigManager instancepublic boolean isDebug()
true if debug is enabledpublic Connector getConnector(Connector.ConnectorType type)
type - the type of connectorConnectorpublic int getNettyThreads()
public int getNettyClientThreads()
public int getJobQueueSize()
public int getMaxIdleTime()
public int getBatchSize()
public int getMaxBatchDelay()
public int getNumberOfGpu()
public int getDefaultWorkers()
public static java.lang.String getModelServerHome()
public java.nio.file.Path getModelStore()
public java.lang.String getModelUrlPattern()
public java.lang.String getLoadModels()
public java.lang.String getCorsAllowedOrigin()
public java.lang.String getCorsAllowedMethods()
public java.lang.String getCorsAllowedHeaders()
public java.nio.file.Path getPluginFolder()
public io.netty.handler.ssl.SslContext getSslContext()
throws java.io.IOException,
java.security.GeneralSecurityException
SSLContext instance.SSLContext instancejava.io.IOException - if failed to read certificate filejava.security.GeneralSecurityException - if failed to initialize SSLContextpublic java.lang.String getProperty(java.lang.String key,
java.lang.String def)
key - the keydef - a default valuepublic java.lang.String dumpConfigurations()
public boolean useNativeIo()
true if use netty native IOpublic int getIoRatio()
public int getMaxRequestSize()