Search in sources :

Example 41 with FileSystemConfiguration

use of org.apache.ignite.configuration.FileSystemConfiguration in project ignite by apache.

the class IgfsMetaManagerSelfTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
    TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
    discoSpi.setIpFinder(IP_FINDER);
    cfg.setDiscoverySpi(discoSpi);
    FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
    igfsCfg.setMetaCacheConfiguration(cacheConfiguration(META_CACHE_NAME));
    igfsCfg.setDataCacheConfiguration(cacheConfiguration(DATA_CACHE_NAME));
    igfsCfg.setName("igfs");
    cfg.setFileSystemConfiguration(igfsCfg);
    return cfg;
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) FileSystemConfiguration(org.apache.ignite.configuration.FileSystemConfiguration) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Example 42 with FileSystemConfiguration

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

Example 43 with FileSystemConfiguration

use of org.apache.ignite.configuration.FileSystemConfiguration in project ignite by apache.

the class IgfsOneClientNodeTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
    cfg.setCacheConfiguration(cacheConfiguration(CACHE_NAME));
    cfg.setClientMode(true);
    cfg.setDiscoverySpi(new TcpDiscoverySpi().setForceServerMode(true).setIpFinder(new TcpDiscoveryVmIpFinder(true)));
    FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
    igfsCfg.setName("igfs");
    igfsCfg.setMetaCacheConfiguration(cacheConfiguration(DEFAULT_CACHE_NAME));
    igfsCfg.setDataCacheConfiguration(cacheConfiguration(DEFAULT_CACHE_NAME));
    cfg.setFileSystemConfiguration(igfsCfg);
    return cfg;
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) TcpDiscoveryVmIpFinder(org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder) FileSystemConfiguration(org.apache.ignite.configuration.FileSystemConfiguration) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Example 44 with FileSystemConfiguration

use of org.apache.ignite.configuration.FileSystemConfiguration in project ignite by apache.

the class IgniteHadoopFileSystemClientSelfTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
    TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
    discoSpi.setIpFinder(new TcpDiscoveryVmIpFinder(true));
    cfg.setDiscoverySpi(discoSpi);
    FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
    igfsCfg.setDataCacheConfiguration(dataCacheConfiguration());
    igfsCfg.setMetaCacheConfiguration(metaCacheConfiguration());
    igfsCfg.setName("igfs");
    igfsCfg.setBlockSize(512 * 1024);
    IgfsIpcEndpointConfiguration endpointCfg = new IgfsIpcEndpointConfiguration();
    endpointCfg.setType(IgfsIpcEndpointType.TCP);
    endpointCfg.setPort(DFLT_IPC_PORT);
    igfsCfg.setIpcEndpointConfiguration(endpointCfg);
    cfg.setFileSystemConfiguration(igfsCfg);
    return cfg;
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) TcpDiscoveryVmIpFinder(org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder) IgfsIpcEndpointConfiguration(org.apache.ignite.igfs.IgfsIpcEndpointConfiguration) FileSystemConfiguration(org.apache.ignite.configuration.FileSystemConfiguration) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Example 45 with FileSystemConfiguration

use of org.apache.ignite.configuration.FileSystemConfiguration in project ignite by apache.

the class IgniteHadoopFileSystemHandshakeSelfTest method gridConfiguration.

/**
 * Create Grid configuration.
 *
 * @param dfltIgniteInstanceName Default Ignite instance name.
 * @return Grid configuration.
 * @throws Exception If failed.
 */
private IgniteConfiguration gridConfiguration(boolean dfltIgniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(dfltIgniteInstanceName ? null : IGNITE_INSTANCE_NAME);
    cfg.setLocalHost("127.0.0.1");
    cfg.setConnectorConfiguration(null);
    TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
    discoSpi.setIpFinder(IP_FINDER);
    cfg.setDiscoverySpi(discoSpi);
    TcpCommunicationSpi commSpi = new TcpCommunicationSpi();
    commSpi.setSharedMemoryPort(-1);
    cfg.setCommunicationSpi(commSpi);
    CacheConfiguration metaCacheCfg = defaultCacheConfiguration();
    metaCacheCfg.setCacheMode(REPLICATED);
    metaCacheCfg.setWriteSynchronizationMode(FULL_SYNC);
    metaCacheCfg.setAtomicityMode(TRANSACTIONAL);
    CacheConfiguration dataCacheCfg = defaultCacheConfiguration();
    dataCacheCfg.setCacheMode(PARTITIONED);
    dataCacheCfg.setNearConfiguration(null);
    dataCacheCfg.setWriteSynchronizationMode(FULL_SYNC);
    dataCacheCfg.setAffinityMapper(new IgfsGroupDataBlocksKeyMapper(128));
    dataCacheCfg.setBackups(0);
    dataCacheCfg.setAtomicityMode(TRANSACTIONAL);
    FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
    igfsCfg.setName(IGFS_NAME);
    igfsCfg.setPrefetchBlocks(1);
    igfsCfg.setDefaultMode(PRIMARY);
    igfsCfg.setDataCacheConfiguration(dataCacheCfg);
    igfsCfg.setMetaCacheConfiguration(metaCacheCfg);
    IgfsIpcEndpointConfiguration endpointCfg = new IgfsIpcEndpointConfiguration();
    endpointCfg.setType(IgfsIpcEndpointType.TCP);
    endpointCfg.setPort(DFLT_IPC_PORT);
    igfsCfg.setIpcEndpointConfiguration(endpointCfg);
    igfsCfg.setManagementPort(-1);
    igfsCfg.setBlockSize(512 * 1024);
    cfg.setFileSystemConfiguration(igfsCfg);
    return cfg;
}
Also used : IgfsGroupDataBlocksKeyMapper(org.apache.ignite.igfs.IgfsGroupDataBlocksKeyMapper) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) IgfsIpcEndpointConfiguration(org.apache.ignite.igfs.IgfsIpcEndpointConfiguration) TcpCommunicationSpi(org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi) CacheConfiguration(org.apache.ignite.configuration.CacheConfiguration) FileSystemConfiguration(org.apache.ignite.configuration.FileSystemConfiguration) 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