Search in sources :

Example 6 with IgniteHadoopIgfsSecondaryFileSystem

use of org.apache.ignite.hadoop.fs.IgniteHadoopIgfsSecondaryFileSystem in project ignite by apache.

the class HadoopSecondaryFileSystemConfigurationTest method fsConfiguration.

/**
     * Gets IGFS configuration.
     *
     * @param igniteInstanceName Ignite instance name.
     * @return IGFS configuration.
     */
protected FileSystemConfiguration fsConfiguration(String igniteInstanceName) throws IgniteCheckedException {
    FileSystemConfiguration cfg = new FileSystemConfiguration();
    cfg.setName("igfs");
    cfg.setPrefetchBlocks(1);
    cfg.setDefaultMode(mode);
    if (mode != PRIMARY)
        cfg.setSecondaryFileSystem(new IgniteHadoopIgfsSecondaryFileSystem(secondaryFsUriStr, secondaryConfFullPath));
    cfg.setIpcEndpointConfiguration(primaryIpcEndpointConfiguration(igniteInstanceName));
    cfg.setManagementPort(-1);
    // Together with group blocks mapper will yield 64M per node groups.
    cfg.setBlockSize(512 * 1024);
    cfg.setDataCacheConfiguration(dataCacheConfiguration());
    cfg.setMetaCacheConfiguration(metaCacheConfiguration());
    return cfg;
}
Also used : IgniteHadoopIgfsSecondaryFileSystem(org.apache.ignite.hadoop.fs.IgniteHadoopIgfsSecondaryFileSystem) FileSystemConfiguration(org.apache.ignite.configuration.FileSystemConfiguration)

Example 7 with IgniteHadoopIgfsSecondaryFileSystem

use of org.apache.ignite.hadoop.fs.IgniteHadoopIgfsSecondaryFileSystem in project ignite by apache.

the class HadoopFIleSystemFactorySelfTest method startPrimary.

/**
     * Start primary IGFS.
     *
     * @return IGFS.
     * @throws Exception If failed.
     */
private static IgfsEx startPrimary() throws Exception {
    // Prepare configuration.
    Configuration conf = baseConfiguration();
    conf.set("fs.defaultFS", "igfs://secondary@127.0.0.1:11500/");
    writeConfigurationToFile(conf);
    // Get file system instance to be used.
    CachingHadoopFileSystemFactory delegate = new CachingHadoopFileSystemFactory();
    delegate.setUri("igfs://secondary@127.0.0.1:11500/");
    delegate.setConfigPaths(SECONDARY_CFG_PATH);
    // Configure factory.
    TestFactory factory = new TestFactory(delegate);
    // Configure file system.
    IgniteHadoopIgfsSecondaryFileSystem secondaryFs = new IgniteHadoopIgfsSecondaryFileSystem();
    secondaryFs.setFileSystemFactory(factory);
    // Start.
    return start("primary", 10500, IgfsMode.DUAL_ASYNC, secondaryFs);
}
Also used : IgfsIpcEndpointConfiguration(org.apache.ignite.igfs.IgfsIpcEndpointConfiguration) Configuration(org.apache.hadoop.conf.Configuration) FileSystemConfiguration(org.apache.ignite.configuration.FileSystemConfiguration) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) CacheConfiguration(org.apache.ignite.configuration.CacheConfiguration) CachingHadoopFileSystemFactory(org.apache.ignite.hadoop.fs.CachingHadoopFileSystemFactory) IgniteHadoopIgfsSecondaryFileSystem(org.apache.ignite.hadoop.fs.IgniteHadoopIgfsSecondaryFileSystem)

Aggregations

IgniteHadoopIgfsSecondaryFileSystem (org.apache.ignite.hadoop.fs.IgniteHadoopIgfsSecondaryFileSystem)7 FileSystemConfiguration (org.apache.ignite.configuration.FileSystemConfiguration)5 CachingHadoopFileSystemFactory (org.apache.ignite.hadoop.fs.CachingHadoopFileSystemFactory)3 Configuration (org.apache.hadoop.conf.Configuration)1 Ignite (org.apache.ignite.Ignite)1 CacheConfiguration (org.apache.ignite.configuration.CacheConfiguration)1 IgniteConfiguration (org.apache.ignite.configuration.IgniteConfiguration)1 ChainedUserNameMapper (org.apache.ignite.hadoop.util.ChainedUserNameMapper)1 KerberosUserNameMapper (org.apache.ignite.hadoop.util.KerberosUserNameMapper)1 IgfsIpcEndpointConfiguration (org.apache.ignite.igfs.IgfsIpcEndpointConfiguration)1 IgfsSecondaryFileSystem (org.apache.ignite.igfs.secondary.IgfsSecondaryFileSystem)1