-
Notifications
You must be signed in to change notification settings - Fork 10
v4.0 Extensions
-
Introduction
-
Custom Storage Driver
2.1. Common Steps
2.2. Cooperative Storage Driver
2.2.1. NIO Storage Driver
2.2.2. Netty-Based Storage Driver
2.2.2.1. HTTP Storage Driver
2.3. Preempttive Storage Driver
- Custom Scenario Engine
Mongoose is designed to be extensible to support a wide variety of storages and scripting languages. The Java extensions mechanism is used, which is described at Extensible Java Applications Tutorial
Mongoose iterates the content of the ext
directory on the start and
tries to load all found files and directories into the runtime for the
further usage.
Note:
In distributed mode a custom storage driver implementation jar file
should be located on the Mongoose storage driver hosts (in the ext
subdirectory of Mongoose directories).
-
Please review the Storage Driver Inheritance Hierarchy
-
Implement the custom storage driver by coding the required methods.
Mongoose includes the following abstract storage driver classes:
com.emc.mongoose.storage.driver.base.StorageDriverBase
com.emc.mongoose.storage.driver.cooperative.CooperativeStorageDriverBase
com.emc.mongoose.storage.driver.preemptive.PreemptiveStorageDriverBase
com.emc.mongoose.storage.driver.nio.NioStorageDriverBase
com.emc.mongoose.storage.driver.net.NetStorageDriverBase
-
com.emc.mongoose.storage.driver.net.http.HttpStorageDriverBase
These are designed for the extension.
Also there are some ready-to-use implementations provided with Mongoose itself which may be extended also.
-
Implement the
com.emc.mongoose.storage.driver.base.StorageDriverFactory
interface where methodgetName
should return a constant storage driver implementation identifier (for example "atmos" or "hdfs"). The second method (create
) is intended to create the storage driver instance. -
Put into the resources directory the file with relative path
META-INF/services/com.emc.mongoose.storage.driver.base.StorageDriverFactory
and then put the fully qualified class name of the customStorageDriverFactory
implementation (from the step #3) to that file. -
Build the storage driver implementation jar file.
-
Put the storage driver implementation jar file into the Mongoose's
ext
subdirectory. -
Run Mongoose with an argument
--storage-driver-type=X
where X is the custom storage driver implementation identifier.
Cooperative storage drivers uses the coroutines functionality to drive the I/O in the most efficient way. Also it supports composite I/O tasks.
This abstract implementation uses few I/O threads to execute a lot if
I/O tasks in parallel. Actual I/O work should be executed in the method
invokeNio(ioTask)
in the reentrant and non-blocking manner.
This abstract implementation is intended to work with distributed storage with multiple endpoint nodes accessible via the network. Provides high-performance connection pool, simple endpoint node balancing, SSL/TLS functionality.
This abstract implementation inherits the Netty-Based one and adds the HTTP-related specific functionality.
Some storage APIs don't support non-blocking I/O calls. The storage driver should provide the OS thread entirely for each connection/open file to drive the I/O. This way is not very efficient while high concurrency level is used either large data blocks are transferred.
To use a custom scripting language for the Mongoose's scenarios a
JSR-223
compliant scenario engine implementation should be put into the ext
directory.
For details read the Scenarios documentation.
- Overview
- Deployment
- User Guide
- Troubleshooting
- Reference