-
Notifications
You must be signed in to change notification settings - Fork 10
v3.3 Custom Storage Driver
-
Please review the Storage Driver Inheritance Hierarchy
-
Implement the custom storage driver by coding the abstract methods (see details below).
-
Build the storage driver implementation jar file.
-
Put the storage driver implementation jar file into the Mongoose's directory among with other Mongoose jar files.
-
Modify the
config/defaults.json
file by adding the implementation info.To do this, find the section
storage->driver->impl
. This is a list of nodes. Each node reflects the particular storage driver implementation metainfo and contains the following required fields:- type: the identifier of the storage driver implementation
- file: the path to a jar file containing the storage driver implementation
- fqcn: storage driver implementation FQCN (fully qualified class name)
Append the node describing the custom storage driver implementation to the list.
Note:
When using in the distributed mode, the custom storage driver configuration and implementation jar file are required to be located on the storage driver server host.
-
Run Mongoose with an argument
--storage-driver-type=X
where X is the custom storage driver 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.
-
Reference implementations:
com.emc.mongoose.storage.driver.nio.fs.BasicFileStorageDriver
-
Extend the class
com.emc.mongoose.storage.driver.nio.base.NioStorageDriverBase
Methods to implement:
void invokeNio(O ioTask)
boolean createPath(String path)
List<I> list(ItemFactory<I> itemFactory, String path, String prefix, int idRadix, I lastPrevItem, int count)
void adjustIoBuffers(SizeInBytes avgDataItemSize, IoType ioType)
-
Implement interface
com.emc.mongoose.model.storage.StorageDriver
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.
-
Reference implementations:
N/A
-
Extend the class
com.emc.mongoose.storage.driver.net.base.NetStorageDriverBase
Methods to implement:
boolean createPath(String path)
List<I> list(ItemFactory<I> itemFactory, String path, String prefix, int idRadix, I lastPrevItem, int count)
ChannelFuture sendRequest(Channel channel, O ioTask)
-
Extend the class
com.emc.mongoose.storage.driver.net.base.ResponseHandlerBase
Methods to implement:
void handle(Channel channel, O ioTask, N msg)
-
Implement the interface:
com.emc.mongoose.storage.driver.net.base.NetStorageDriver
This abstract implementation inherits the Netty-Based one and adds the HTTP-related specific functionality.
-
Reference implementations:
com.emc.mongoose.storage.driver.net.http.atmos.AtmosStorageDriver
com.emc.mongoose.storage.driver.net.http.s3.S3StorageDriver
com.emc.mongoose.storage.driver.net.http.swift.SwiftStorageDriver
-
Extend the class
com.emc.mongoose.storage.driver.net.http.base.HttpStorageDriverBase
Methods to implement:
boolean createPath(String path)
List<I> list(ItemFactory<I> itemFactory, String path, String prefix, int idRadix, I lastPrevItem, int count)
HttpMethod getTokenHttpMethod(IoType ioType)
HttpMethod getPathHttpMethod(IoType ioType)
String getTokenUriPath(I item, String srcPath, String dstPath, IoType ioType)
String getPathUriPath(I item, String srcPath, String dstPath, IoType ioType)
void applyMetaDataHeaders(final HttpHeaders httpHeaders)
void applyAuthHeaders(HttpMethod httpMethod, String dstUriPath, HttpHeaders httpHeaders)
void applyCopyHeaders(HttpHeaders httpHeaders, String srcPath)
-
Extend class
com.emc.mongoose.storage.driver.net.http.base.HttpResponseHandlerBase
Methods to implement:
void handleResponseHeaders(O ioTask, HttpHeaders responseHeaders)
-
Implement the interface:
com.emc.mongoose.storage.driver.net.http.base.HttpStorageDriver
- Overview
- Deployment
- User Guide
- Troubleshooting
- Reference