-
Notifications
You must be signed in to change notification settings - Fork 10
v3.6 Extensions
-
Introduction
-
Custom Storage Driver
2.1. Common Steps
2.2. NIO Storage Driver
2.3. Netty-Based Storage Driver
2.3.1. HTTP 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.nio.base.NioStorageDriverBase
com.emc.mongoose.storage.driver.net.base.NetStorageDriverBase
-
com.emc.mongoose.storage.driver.net.http.base.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.
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.
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