use of org.apache.ignite.configuration.FileSystemConfiguration in project ignite by apache.
the class IgfsSecondaryFileSystemInjectionSelfTest method getConfiguration.
/** {@inheritDoc} */
@Override
protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(gridName);
FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
igfsCfg.setName(IGFS_NAME);
igfsCfg.setDefaultMode(IgfsMode.DUAL_SYNC);
igfsCfg.setSecondaryFileSystem(secondary);
CacheConfiguration dataCacheCfg = defaultCacheConfiguration();
dataCacheCfg.setCacheMode(PARTITIONED);
dataCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
dataCacheCfg.setAtomicityMode(TRANSACTIONAL);
CacheConfiguration metaCacheCfg = defaultCacheConfiguration();
metaCacheCfg.setCacheMode(REPLICATED);
metaCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
metaCacheCfg.setAtomicityMode(TRANSACTIONAL);
igfsCfg.setDataCacheConfiguration(dataCacheCfg);
igfsCfg.setMetaCacheConfiguration(metaCacheCfg);
cfg.setFileSystemConfiguration(igfsCfg);
return cfg;
}
use of org.apache.ignite.configuration.FileSystemConfiguration in project ignite by apache.
the class IgfsServerManagerIpcEndpointRegistrationAbstractSelfTest method igfsConfiguration.
/**
* Creates test-purposed IgfsConfiguration.
*
* @param endPntType End point type.
* @param endPntPort End point port.
* @param endPntHost End point host.
* @param dataCacheName Data cache name.
* @param metaCacheName Meta cache name.
* @return test-purposed IgfsConfiguration.
* @throws IgniteCheckedException If failed.
*/
protected FileSystemConfiguration igfsConfiguration(@Nullable IgfsIpcEndpointType endPntType, @Nullable Integer endPntPort, @Nullable String endPntHost, String dataCacheName, String metaCacheName) throws IgniteCheckedException {
IgfsIpcEndpointConfiguration endPntCfg = null;
if (endPntType != null) {
endPntCfg = new IgfsIpcEndpointConfiguration();
endPntCfg.setType(endPntType);
if (endPntPort != null)
endPntCfg.setPort(endPntPort);
if (endPntHost != null)
endPntCfg.setHost(endPntHost);
}
FileSystemConfiguration igfsConfiguration = new FileSystemConfiguration();
igfsConfiguration.setName("igfs" + UUID.randomUUID());
igfsConfiguration.setManagementPort(mgmtPort.getAndIncrement());
CacheConfiguration dataCacheCfg = defaultCacheConfiguration();
dataCacheCfg.setCacheMode(CacheMode.PARTITIONED);
dataCacheCfg.setAffinityMapper(new IgfsGroupDataBlocksKeyMapper(128));
dataCacheCfg.setBackups(0);
dataCacheCfg.setAtomicityMode(TRANSACTIONAL);
CacheConfiguration metaCacheCfg = defaultCacheConfiguration();
metaCacheCfg.setCacheMode(CacheMode.REPLICATED);
metaCacheCfg.setAtomicityMode(TRANSACTIONAL);
igfsConfiguration.setMetaCacheConfiguration(metaCacheCfg);
igfsConfiguration.setDataCacheConfiguration(dataCacheCfg);
if (endPntCfg != null)
igfsConfiguration.setIpcEndpointConfiguration(endPntCfg);
return igfsConfiguration;
}
use of org.apache.ignite.configuration.FileSystemConfiguration in project ignite by apache.
the class IgfsProcessorValidationSelfTest method testLocalIfAffinityMapperIsWrongClass.
/**
* @throws Exception If failed.
*/
public void testLocalIfAffinityMapperIsWrongClass() throws Exception {
for (FileSystemConfiguration igfsCfg : g1Cfg.getFileSystemConfiguration()) {
igfsCfg.setDataCacheConfiguration(dataCache(1024));
igfsCfg.setMetaCacheConfiguration(metaCache());
igfsCfg.getMetaCacheConfiguration().setAffinityMapper(new GridCacheDefaultAffinityKeyMapper());
igfsCfg.getDataCacheConfiguration().setAffinityMapper(new GridCacheDefaultAffinityKeyMapper());
}
checkGridStartFails(g1Cfg, "Invalid IGFS data cache configuration (key affinity mapper class should be", true);
}
use of org.apache.ignite.configuration.FileSystemConfiguration in project ignite by apache.
the class IgfsProcessorValidationSelfTest method testRemoteIfDataBlockSizeDiffers.
/**
* @throws Exception If failed.
*/
public void testRemoteIfDataBlockSizeDiffers() throws Exception {
IgniteConfiguration g2Cfg = getConfiguration("g2");
FileSystemConfiguration g2IgfsCfg1 = new FileSystemConfiguration(g1IgfsCfg1);
g2IgfsCfg1.setBlockSize(g2IgfsCfg1.getBlockSize() + 100);
g2Cfg.setFileSystemConfiguration(g2IgfsCfg1, g1IgfsCfg2);
G.start(g1Cfg);
checkGridStartFails(g2Cfg, "Data block size should be the same on all nodes in grid for IGFS", false);
}
use of org.apache.ignite.configuration.FileSystemConfiguration in project ignite by apache.
the class IgniteHadoopFileSystemClientBasedAbstractSelfTest method igfsConfiguration.
/** {@inheritDoc} */
@Override
protected FileSystemConfiguration igfsConfiguration(String gridName) throws IgniteCheckedException {
FileSystemConfiguration cfg = super.igfsConfiguration(gridName);
cfg.setIpcEndpointEnabled(false);
return cfg;
}
Aggregations