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;
}
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);
}
Aggregations