use of org.apache.ignite.igfs.IgfsGroupDataBlocksKeyMapper in project ignite by apache.
the class HadoopIgfs20FileSystemAbstractSelfTest method dataCacheConfiguration.
/**
* Gets cache configuration.
*
* @param igniteInstanceName Ignite instance name.
* @return Cache configuration.
*/
protected CacheConfiguration dataCacheConfiguration(String igniteInstanceName) {
CacheConfiguration cacheCfg = defaultCacheConfiguration();
cacheCfg.setCacheMode(PARTITIONED);
cacheCfg.setNearConfiguration(null);
cacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
cacheCfg.setAffinityMapper(new IgfsGroupDataBlocksKeyMapper(GRP_SIZE));
cacheCfg.setBackups(0);
cacheCfg.setAtomicityMode(TRANSACTIONAL);
return cacheCfg;
}
use of org.apache.ignite.igfs.IgfsGroupDataBlocksKeyMapper in project ignite by apache.
the class IgniteHadoopFileSystemLoggerStateSelfTest method startUp.
/**
* Startup the grid and instantiate the file system.
*
* @throws Exception If failed.
*/
private void startUp() throws Exception {
FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
igfsCfg.setName("igfs");
igfsCfg.setBlockSize(512 * 1024);
igfsCfg.setDefaultMode(PRIMARY);
IgfsIpcEndpointConfiguration endpointCfg = new IgfsIpcEndpointConfiguration();
endpointCfg.setType(IgfsIpcEndpointType.TCP);
endpointCfg.setPort(10500);
igfsCfg.setIpcEndpointConfiguration(endpointCfg);
CacheConfiguration dataCacheCfg = defaultCacheConfiguration();
dataCacheCfg.setName("partitioned");
dataCacheCfg.setCacheMode(PARTITIONED);
dataCacheCfg.setNearConfiguration(null);
dataCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
dataCacheCfg.setAffinityMapper(new IgfsGroupDataBlocksKeyMapper(128));
dataCacheCfg.setBackups(0);
dataCacheCfg.setAtomicityMode(TRANSACTIONAL);
CacheConfiguration metaCacheCfg = defaultCacheConfiguration();
metaCacheCfg.setName("replicated");
metaCacheCfg.setCacheMode(REPLICATED);
metaCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
metaCacheCfg.setAtomicityMode(TRANSACTIONAL);
igfsCfg.setDataCacheConfiguration(dataCacheCfg);
igfsCfg.setMetaCacheConfiguration(metaCacheCfg);
IgniteConfiguration cfg = new IgniteConfiguration();
cfg.setIgniteInstanceName("igfs-grid");
TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
discoSpi.setIpFinder(new TcpDiscoveryVmIpFinder(true));
cfg.setDiscoverySpi(discoSpi);
cfg.setFileSystemConfiguration(igfsCfg);
cfg.setLocalHost("127.0.0.1");
cfg.setConnectorConfiguration(null);
Ignite g = G.start(cfg);
igfs = (IgfsEx) g.fileSystem("igfs");
igfs.globalSampling(sampling);
fs = fileSystem();
}
use of org.apache.ignite.igfs.IgfsGroupDataBlocksKeyMapper in project ignite by apache.
the class IgfsMetaManagerSelfTest method cacheConfiguration.
/** {@inheritDoc} */
protected CacheConfiguration cacheConfiguration(@NotNull String cacheName) {
CacheConfiguration cacheCfg = defaultCacheConfiguration();
cacheCfg.setName(cacheName);
if (META_CACHE_NAME.equals(cacheName))
cacheCfg.setCacheMode(REPLICATED);
else {
cacheCfg.setCacheMode(PARTITIONED);
cacheCfg.setNearConfiguration(null);
cacheCfg.setBackups(0);
cacheCfg.setAffinityMapper(new IgfsGroupDataBlocksKeyMapper(128));
}
cacheCfg.setWriteSynchronizationMode(FULL_SYNC);
cacheCfg.setAtomicityMode(TRANSACTIONAL);
return cacheCfg;
}
use of org.apache.ignite.igfs.IgfsGroupDataBlocksKeyMapper in project ignite by apache.
the class IgfsModesSelfTest method startUp.
/**
* Perform initial startup.
*
* @throws Exception If failed.
*/
@SuppressWarnings("NullableProblems")
private void startUp() throws Exception {
startUpSecondary();
FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
igfsCfg.setName("igfs");
igfsCfg.setBlockSize(512 * 1024);
if (setNullMode)
igfsCfg.setDefaultMode(null);
else if (mode != null)
igfsCfg.setDefaultMode(mode);
igfsCfg.setPathModes(pathModes);
if (setSecondaryFs)
igfsCfg.setSecondaryFileSystem(igfsSecondary.asSecondary());
CacheConfiguration dataCacheCfg = defaultCacheConfiguration();
dataCacheCfg.setCacheMode(PARTITIONED);
dataCacheCfg.setNearConfiguration(null);
dataCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
dataCacheCfg.setAffinityMapper(new IgfsGroupDataBlocksKeyMapper(128));
dataCacheCfg.setBackups(0);
dataCacheCfg.setAtomicityMode(TRANSACTIONAL);
CacheConfiguration metaCacheCfg = defaultCacheConfiguration();
metaCacheCfg.setCacheMode(REPLICATED);
metaCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
metaCacheCfg.setAtomicityMode(TRANSACTIONAL);
igfsCfg.setMetaCacheConfiguration(metaCacheCfg);
igfsCfg.setDataCacheConfiguration(dataCacheCfg);
IgniteConfiguration cfg = new IgniteConfiguration();
cfg.setIgniteInstanceName("igfs-grid");
TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
discoSpi.setIpFinder(new TcpDiscoveryVmIpFinder(true));
cfg.setDiscoverySpi(discoSpi);
cfg.setFileSystemConfiguration(igfsCfg);
cfg.setLocalHost("127.0.0.1");
cfg.setConnectorConfiguration(null);
grid = (IgniteEx) G.start(cfg);
igfs = (IgfsImpl) grid.fileSystem("igfs");
}
use of org.apache.ignite.igfs.IgfsGroupDataBlocksKeyMapper in project ignite by apache.
the class IgfsOneClientNodeTest method cacheConfiguration.
/** {@inheritDoc} */
protected CacheConfiguration cacheConfiguration(@NotNull String cacheName) {
CacheConfiguration cacheCfg = defaultCacheConfiguration();
cacheCfg.setName(cacheName);
cacheCfg.setCacheMode(PARTITIONED);
cacheCfg.setBackups(0);
cacheCfg.setAffinityMapper(new IgfsGroupDataBlocksKeyMapper(128));
cacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
cacheCfg.setAtomicityMode(TRANSACTIONAL);
return cacheCfg;
}
Aggregations