Package com.robothy.s3.rest
Class LocalS3.Builder
java.lang.Object
com.robothy.s3.rest.LocalS3.Builder
- Enclosing class:
- LocalS3
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Build a LocalS3 instance.Set the LocalS3 data directory.initialDataCacheEnabled(boolean enabled) This option only available when running LocalS3 inIN_MEMORYmode with initial data.mode(LocalS3Mode mode) Set LocalS3 service running mode.nettyChildEventGroupThreadNum(int nettyChildEventGroupThreadNum) Set netty child event group thread number.nettyParentEventGroupThreadNum(int nettyParentEventGroupThreadNum) Set netty parent event group thread number.port(int port) Set the port that local-s3 service listen to.s3ExecutorThreadNum(int s3ExecutorThreadNum) Set local-s3 executor thread number.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
port
Set the port that local-s3 service listen to. Default port is 8080. Set the value to-1if you want to assign a random port.- Parameters:
port- customized port.- Returns:
- builder.
-
dataPath
Set the LocalS3 data directory. The default value isnull, while data is stored in Java Heap.If the path is specified and the
modeisPERSISTENCE, then the LocalS3 service load data from and store data in this directory.If the data directory is set and LocalS3 runs in
IN_MEMORYmode, then data from that path will be loaded as initial data. All changes are only available in the memory, i.e. won't write back to the specified path. Besides, LocalS3 will cache accessed data from this path; which could reduce disk I/O when start LocalS3 inIN_MEMORYmode with the same initial data for multi-times.- Parameters:
dataPath- data path.- Returns:
- builder.
-
mode
Set LocalS3 service running mode. Default value isPERSISTENCE.- Parameters:
mode- LocalS3 service running mode.- Returns:
- builder.
-
initialDataCacheEnabled
This option only available when running LocalS3 inIN_MEMORYmode with initial data. If initial data cache is enabled, LocalS3 caches the accessed initial data in memory. This could reduce dist I/O when running tests with initial data in the same path.The default value is
true.- Parameters:
enabled- is the initial data cache enabled.- Returns:
- if the initial data cache enabled.
-
nettyParentEventGroupThreadNum
Set netty parent event group thread number. Default values is 1.- Parameters:
nettyParentEventGroupThreadNum- netty parent event group thread number.- Returns:
- builder.
-
nettyChildEventGroupThreadNum
Set netty child event group thread number. Default value is 2.- Parameters:
nettyChildEventGroupThreadNum- netty child event group thread number.- Returns:
- builder.
-
s3ExecutorThreadNum
Set local-s3 executor thread number. Default value is 4.- Parameters:
s3ExecutorThreadNum- local-s3 executor thread number.- Returns:
- builder.
-
build
Build a LocalS3 instance.- Returns:
- created LocalS3 instance.
-