Apache Ignite Documentation

GridGain Developer Hub - Apache Ignitetm

Welcome to the Apache Ignite developer hub run by GridGain. Here you'll find comprehensive guides and documentation to help you start working with Apache Ignite as quickly as possible, as well as support if you get stuck.

 

GridGain also provides Community Edition which is a distribution of Apache Ignite made available by GridGain. It is the fastest and easiest way to get started with Apache Ignite. The Community Edition is generally more stable than the Apache Ignite release available from the Apache Ignite website and may contain extra bug fixes and features that have not made it yet into the release on the Apache website.

 

Let's jump right in!

 

Documentation     Ask a Question     Download

 

Javadoc     Scaladoc     Examples

IGFS - Ignite File System

Distribute files and directories in-memory.

Ignite File System (IGFS) is an in-memory file system allowing work with files and directories over existing cache infrastructure.
IGFS can either work as purely in-memory file system, or delegate to another file system (e.g. various Hadoop file system implementations) acting as a caching layer.
In addition IGFS provides API to execute map-reduce tasks over file system data.

IgniteFileSystem

IgniteFileSystem interface is a gateway into Ignite file system implementation. It provides methods for regular file system operations such as create, delete, mkdirs, etc., as well as methods for map-reduce tasks execution.

Ignite ignite = Ignition.ignite();

// Obtain instance of IGFS named "myFileSystem".
IgniteFileSystem fs = ignite.fileSystem("myFileSystem");

IGFS can be configured either through Spring XML file or programmatically.

<bean class="org.apache.ignite.configuration.IgniteConfiguration">
  ...
  <property name="fileSystemConfiguration">
    <list>
      <bean class="org.apache.ignite.configuration.FileSystemConfiguration">
        <!-- Distinguished file system name. -->
        <property name="name" value="myFileSystem" />
        <!-- Name of the cache where file system structure will be stored. Should be configured separately. -->
        <property name="metaCacheName" value="myMetaCache" />
        <!-- Name of the cache where file data will be stored. Should be configured separately. -->
        <property name="dataCacheName" value="myDataCache" />       
        </bean>
    </list>    
  </property>
</bean>
IgniteConfiguration cfg = new IgniteConfiguration();
...
FileSystemConfiguration fileSystemCfg = new FileSystemConfiguration();
fileSystemCfg.setName("myFileSystem");
fileSystemCfg.setMetaCacheName("myMetaCache");
fileSystemCfg.setDataCacheName("myDataCache");
...
cfg.setFileSystemConfiguration(fileSystemCfg);

Work with files and directories

IgniteFileSystem fs = ignite.fileSystem("myFileSystem");

// Create directory.
IgfsPath dir = new IgfsPath("/myDir");

fs.mkdirs(dir);

// Create file and write some data to it.
IgfsPath file = new IgfsPath(dir, "myFile");

try (OutputStream out = fs.create(file, true)) {
    out.write(...);  
}

// Read from file.
try (InputStream in = fs.open(file)) {
    in.read(...);
}

// Delete directory.
fs.delete(dir, true);

Updated less than a minute ago

IGFS - Ignite File System


Distribute files and directories in-memory.

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.