Search in sources :

Example 36 with FileSystemConfiguration

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();
}
Also used : IgfsIpcEndpointConfiguration(org.apache.ignite.igfs.IgfsIpcEndpointConfiguration) IgniteThread(org.apache.ignite.thread.IgniteThread) FileSystemConfiguration(org.apache.ignite.configuration.FileSystemConfiguration)

Example 37 with FileSystemConfiguration

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;
}
Also used : DataStorageConfiguration(org.apache.ignite.configuration.DataStorageConfiguration) DataRegionConfiguration(org.apache.ignite.configuration.DataRegionConfiguration) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) IgfsIpcEndpointConfiguration(org.apache.ignite.igfs.IgfsIpcEndpointConfiguration) FileSystemConfiguration(org.apache.ignite.configuration.FileSystemConfiguration)

Example 38 with FileSystemConfiguration

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;
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) CacheConfiguration(org.apache.ignite.configuration.CacheConfiguration) FileSystemConfiguration(org.apache.ignite.configuration.FileSystemConfiguration) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Example 39 with FileSystemConfiguration

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);
}
Also used : IgfsGroupDataBlocksKeyMapper(org.apache.ignite.igfs.IgfsGroupDataBlocksKeyMapper) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) TcpDiscoveryVmIpFinder(org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder) Ignite(org.apache.ignite.Ignite) FileSystemConfiguration(org.apache.ignite.configuration.FileSystemConfiguration) CacheConfiguration(org.apache.ignite.configuration.CacheConfiguration) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Example 40 with FileSystemConfiguration

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());
}
Also used : IgfsPerBlockLruEvictionPolicy(org.apache.ignite.cache.eviction.igfs.IgfsPerBlockLruEvictionPolicy) IgfsMode(org.apache.ignite.igfs.IgfsMode) IgfsGroupDataBlocksKeyMapper(org.apache.ignite.igfs.IgfsGroupDataBlocksKeyMapper) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) HashMap(java.util.HashMap) TcpDiscoveryVmIpFinder(org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder) Ignite(org.apache.ignite.Ignite) FileSystemConfiguration(org.apache.ignite.configuration.FileSystemConfiguration) CacheConfiguration(org.apache.ignite.configuration.CacheConfiguration) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Aggregations

FileSystemConfiguration (org.apache.ignite.configuration.FileSystemConfiguration)60 IgniteConfiguration (org.apache.ignite.configuration.IgniteConfiguration)41 CacheConfiguration (org.apache.ignite.configuration.CacheConfiguration)31 TcpDiscoverySpi (org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)31 IgfsGroupDataBlocksKeyMapper (org.apache.ignite.igfs.IgfsGroupDataBlocksKeyMapper)25 TcpDiscoveryVmIpFinder (org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder)16 IgfsIpcEndpointConfiguration (org.apache.ignite.igfs.IgfsIpcEndpointConfiguration)12 HashMap (java.util.HashMap)6 Ignite (org.apache.ignite.Ignite)6 ArrayList (java.util.ArrayList)4 IgniteHadoopIgfsSecondaryFileSystem (org.apache.ignite.hadoop.fs.IgniteHadoopIgfsSecondaryFileSystem)4 IgfsMode (org.apache.ignite.igfs.IgfsMode)4 NearCacheConfiguration (org.apache.ignite.configuration.NearCacheConfiguration)3 AffinityKeyMapper (org.apache.ignite.cache.affinity.AffinityKeyMapper)2 DataRegionConfiguration (org.apache.ignite.configuration.DataRegionConfiguration)2 DataStorageConfiguration (org.apache.ignite.configuration.DataStorageConfiguration)2 IgniteEx (org.apache.ignite.internal.IgniteEx)2 TcpCommunicationSpi (org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi)2 IOException (java.io.IOException)1 HashSet (java.util.HashSet)1