Skip to content

v3.6 Extensions

Andrey Kurilov edited this page Nov 8, 2017 · 1 revision

Contents

  1. Introduction
  2. Custom Storage Driver
    2.1. Common Steps
    2.2. NIO Storage Driver
    2.3. Netty-Based Storage Driver
    2.3.1. HTTP Storage Driver
  3. Custom Scenario Engine

1. Introduction

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.

2. Custom Storage Driver

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).

2.1. Common Steps

  1. Please review the Storage Driver Inheritance Hierarchy

  2. 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.

  3. Implement the com.emc.mongoose.storage.driver.base.StorageDriverFactory interface where method getName 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.

  4. 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 custom StorageDriverFactory implementation (from the step #3) to that file.

  5. Build the storage driver implementation jar file.

  6. Put the storage driver implementation jar file into the Mongoose's ext subdirectory.

  7. Run Mongoose with an argument --storage-driver-type=X where X is the custom storage driver implementation identifier.

2.2. NIO Storage Driver

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.

2.3. Netty-Based Storage Driver

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.

2.3.1. HTTP Storage Driver

This abstract implementation inherits the Netty-Based one and adds the HTTP-related specific functionality.

3. Custom Scenario Engine

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.

Clone this wiki locally