use of org.apache.ignite.configuration.FileSystemConfiguration in project ignite by apache.
the class IgfsServerManager method start0.
/**
* {@inheritDoc}
*/
@Override
protected void start0() throws IgniteCheckedException {
FileSystemConfiguration igfsCfg = igfsCtx.configuration();
if (igfsCfg.isIpcEndpointEnabled()) {
IgfsIpcEndpointConfiguration ipcCfg = igfsCfg.getIpcEndpointConfiguration();
if (ipcCfg == null)
ipcCfg = new IgfsIpcEndpointConfiguration();
bind(ipcCfg, /*management*/
false);
}
if (igfsCfg.getManagementPort() >= 0) {
IgfsIpcEndpointConfiguration mgmtIpcCfg = new IgfsIpcEndpointConfiguration();
mgmtIpcCfg.setType(TCP);
mgmtIpcCfg.setPort(igfsCfg.getManagementPort());
bind(mgmtIpcCfg, /*management*/
true);
}
if (bindWorker != null)
new IgniteThread(bindWorker).start();
}
use of org.apache.ignite.configuration.FileSystemConfiguration in project ignite by apache.
the class JettyRestProcessorAbstractSelfTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
FileSystemConfiguration igfs = new FileSystemConfiguration();
igfs.setName("igfs");
igfs.setIpcEndpointConfiguration(new IgfsIpcEndpointConfiguration());
cfg.setFileSystemConfiguration(igfs);
DataStorageConfiguration dsCfg = new DataStorageConfiguration();
DataRegionConfiguration drCfg = new DataRegionConfiguration();
drCfg.setName("testDataRegion");
drCfg.setMaxSize(100 * 1024 * 1024);
dsCfg.setDefaultDataRegionConfiguration(drCfg);
cfg.setDataStorageConfiguration(dsCfg);
return cfg;
}
use of org.apache.ignite.configuration.FileSystemConfiguration in project ignite by apache.
the class IgfsBlockMessageSystemPoolStarvationSelfTest method config.
/**
* Create node configuration.
*
* @param name Node name.
* @param ipFinder IpFinder.
* @return Configuration.
* @throws Exception If failed.
*/
private IgniteConfiguration config(String name, TcpDiscoveryVmIpFinder ipFinder) throws Exception {
// Data cache configuration.
CacheConfiguration dataCcfg = new CacheConfiguration(DEFAULT_CACHE_NAME);
dataCcfg.setCacheMode(CacheMode.REPLICATED);
dataCcfg.setAtomicityMode(TRANSACTIONAL);
dataCcfg.setWriteSynchronizationMode(FULL_SYNC);
dataCcfg.setAffinityMapper(new DummyAffinityMapper(1));
dataCcfg.setMaxConcurrentAsyncOperations(1);
// Meta cache configuration.
CacheConfiguration metaCcfg = new CacheConfiguration(DEFAULT_CACHE_NAME);
metaCcfg.setCacheMode(CacheMode.REPLICATED);
metaCcfg.setAtomicityMode(TRANSACTIONAL);
metaCcfg.setWriteSynchronizationMode(FULL_SYNC);
// File system configuration.
FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
igfsCfg.setDefaultMode(IgfsMode.PRIMARY);
igfsCfg.setFragmentizerEnabled(false);
igfsCfg.setBlockSize(1024);
igfsCfg.setDataCacheConfiguration(dataCcfg);
igfsCfg.setMetaCacheConfiguration(metaCcfg);
igfsCfg.setName(IGFS_NAME);
// Ignite configuration.
IgniteConfiguration cfg = getConfiguration(name);
TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
discoSpi.setIpFinder(ipFinder);
cfg.setDiscoverySpi(discoSpi);
cfg.setFileSystemConfiguration(igfsCfg);
cfg.setLocalHost("127.0.0.1");
cfg.setConnectorConfiguration(null);
cfg.setStripedPoolSize(2);
cfg.setSystemThreadPoolSize(2);
cfg.setRebalanceThreadPoolSize(1);
cfg.setPublicThreadPoolSize(1);
return cfg;
}
use of org.apache.ignite.configuration.FileSystemConfiguration in project ignite by apache.
the class IgfsCachePerBlockLruEvictionPolicySelfTest method startSecondary.
/**
* Start a grid with the secondary file system.
*
* @throws Exception If failed.
*/
private void startSecondary() throws Exception {
FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
igfsCfg.setName(IGFS_SECONDARY);
igfsCfg.setBlockSize(512);
igfsCfg.setDefaultMode(PRIMARY);
igfsCfg.setIpcEndpointConfiguration(SECONDARY_REST_CFG);
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.setNearConfiguration(null);
metaCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
metaCacheCfg.setAtomicityMode(TRANSACTIONAL);
igfsCfg.setMetaCacheConfiguration(metaCacheCfg);
igfsCfg.setDataCacheConfiguration(dataCacheCfg);
IgniteConfiguration cfg = new IgniteConfiguration();
cfg.setIgniteInstanceName("grid-secondary");
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);
secondaryFs = (IgfsImpl) g.fileSystem(IGFS_SECONDARY);
}
use of org.apache.ignite.configuration.FileSystemConfiguration in project ignite by apache.
the class IgfsCachePerBlockLruEvictionPolicySelfTest method startPrimary.
/**
* Start a grid with the primary file system.
*
* @throws Exception If failed.
*/
private void startPrimary() throws Exception {
FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
igfsCfg.setName(IGFS_PRIMARY);
igfsCfg.setBlockSize(512);
igfsCfg.setDefaultMode(DUAL_SYNC);
igfsCfg.setPrefetchBlocks(1);
igfsCfg.setSequentialReadsBeforePrefetch(Integer.MAX_VALUE);
igfsCfg.setSecondaryFileSystem(secondaryFs.asSecondary());
Map<String, IgfsMode> pathModes = new HashMap<>();
pathModes.put(FILE.toString(), PRIMARY);
igfsCfg.setPathModes(pathModes);
CacheConfiguration dataCacheCfg = defaultCacheConfiguration();
dataCacheCfg.setCacheMode(PARTITIONED);
dataCacheCfg.setNearConfiguration(null);
dataCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
dataCacheCfg.setAtomicityMode(TRANSACTIONAL);
evictPlc = new IgfsPerBlockLruEvictionPolicy();
dataCacheCfg.setEvictionPolicy(evictPlc);
dataCacheCfg.setOnheapCacheEnabled(true);
dataCacheCfg.setAffinityMapper(new IgfsGroupDataBlocksKeyMapper(128));
dataCacheCfg.setBackups(0);
CacheConfiguration metaCacheCfg = defaultCacheConfiguration();
metaCacheCfg.setCacheMode(REPLICATED);
metaCacheCfg.setNearConfiguration(null);
metaCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
metaCacheCfg.setAtomicityMode(TRANSACTIONAL);
igfsCfg.setMetaCacheConfiguration(metaCacheCfg);
igfsCfg.setDataCacheConfiguration(dataCacheCfg);
IgniteConfiguration cfg = new IgniteConfiguration();
cfg.setIgniteInstanceName("grid-primary");
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);
igfsPrimary = (IgfsImpl) g.fileSystem(IGFS_PRIMARY);
dataCache = igfsPrimary.context().kernalContext().cache().internalCache(igfsPrimary.context().configuration().getDataCacheConfiguration().getName());
}
Aggregations