Search in sources :

Example 76 with TcpDiscoveryVmIpFinder

use of org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder in project ignite by apache.

the class HadoopAbstractSelfTest method beforeTest.

/**
 * {@inheritDoc}
 */
@Override
protected void beforeTest() throws Exception {
    super.beforeTest();
    // IP finder should be re-created before each test,
    // since predecessor grid shutdown does not guarantee finder's state cleanup.
    singleTestIpFinder = new TcpDiscoveryVmIpFinder(true);
}
Also used : TcpDiscoveryVmIpFinder(org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder)

Example 77 with TcpDiscoveryVmIpFinder

use of org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder in project ignite by apache.

the class HadoopIgfs20FileSystemAbstractSelfTest method startNodes.

/**
 * Starts the nodes for this test.
 *
 * @throws Exception If failed.
 */
private void startNodes() throws Exception {
    if (mode != PRIMARY) {
        // Start secondary IGFS.
        FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
        igfsCfg.setName("igfs_secondary");
        igfsCfg.setIpcEndpointConfiguration(secondaryIpcEndpointConfiguration());
        igfsCfg.setManagementPort(-1);
        igfsCfg.setBlockSize(512 * 1024);
        igfsCfg.setPrefetchBlocks(1);
        CacheConfiguration dataCacheCfg = defaultCacheConfiguration();
        dataCacheCfg.setName("partitioned");
        dataCacheCfg.setCacheMode(PARTITIONED);
        dataCacheCfg.setNearConfiguration(null);
        dataCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
        dataCacheCfg.setAffinityMapper(new IgfsGroupDataBlocksKeyMapper(GRP_SIZE));
        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("grid_secondary");
        TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
        discoSpi.setIpFinder(new TcpDiscoveryVmIpFinder(true));
        cfg.setDiscoverySpi(discoSpi);
        cfg.setCacheConfiguration(metaCacheCfg, dataCacheCfg);
        cfg.setFileSystemConfiguration(igfsCfg);
        cfg.setIncludeEventTypes(EVT_TASK_FAILED, EVT_TASK_FINISHED, EVT_JOB_MAPPED);
        cfg.setLocalHost(U.getLocalHost().getHostAddress());
        cfg.setCommunicationSpi(communicationSpi());
        G.start(cfg);
    }
    startGrids(4);
    awaitPartitionMapExchange();
}
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 78 with TcpDiscoveryVmIpFinder

use of org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder in project ignite by apache.

the class HadoopIgfsDualAbstractSelfTest method startGridWithIgfs.

/**
 * Start grid with IGFS.
 *
 * @param igniteInstanceName Ignite instance name.
 * @param igfsName IGFS name
 * @param mode IGFS mode.
 * @param secondaryFs Secondary file system (optional).
 * @param restCfg Rest configuration string (optional).
 * @return Started grid instance.
 * @throws Exception If failed.
 */
protected Ignite startGridWithIgfs(String igniteInstanceName, String igfsName, IgfsMode mode, @Nullable IgfsSecondaryFileSystem secondaryFs, @Nullable IgfsIpcEndpointConfiguration restCfg) throws Exception {
    FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
    igfsCfg.setName(igfsName);
    igfsCfg.setBlockSize(IGFS_BLOCK_SIZE);
    igfsCfg.setDefaultMode(mode);
    igfsCfg.setIpcEndpointConfiguration(restCfg);
    igfsCfg.setSecondaryFileSystem(secondaryFs);
    igfsCfg.setPrefetchBlocks(PREFETCH_BLOCKS);
    igfsCfg.setSequentialReadsBeforePrefetch(SEQ_READS_BEFORE_PREFETCH);
    CacheConfiguration dataCacheCfg = defaultCacheConfiguration();
    dataCacheCfg.setName("dataCache");
    dataCacheCfg.setCacheMode(PARTITIONED);
    dataCacheCfg.setNearConfiguration(null);
    dataCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
    dataCacheCfg.setAffinityMapper(new IgfsGroupDataBlocksKeyMapper(2));
    dataCacheCfg.setBackups(0);
    dataCacheCfg.setAtomicityMode(TRANSACTIONAL);
    CacheConfiguration metaCacheCfg = defaultCacheConfiguration();
    metaCacheCfg.setName("metaCache");
    metaCacheCfg.setCacheMode(REPLICATED);
    metaCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
    metaCacheCfg.setAtomicityMode(TRANSACTIONAL);
    igfsCfg.setDataCacheConfiguration(dataCacheCfg);
    igfsCfg.setMetaCacheConfiguration(metaCacheCfg);
    IgniteConfiguration cfg = new IgniteConfiguration();
    cfg.setIgniteInstanceName(igniteInstanceName);
    TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
    discoSpi.setIpFinder(new TcpDiscoveryVmIpFinder(true));
    cfg.setDiscoverySpi(discoSpi);
    cfg.setFileSystemConfiguration(igfsCfg);
    cfg.setLocalHost("127.0.0.1");
    cfg.setConnectorConfiguration(null);
    return G.start(cfg);
}
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 79 with TcpDiscoveryVmIpFinder

use of org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder in project ignite by apache.

the class IgniteHadoopFileSystemAbstractSelfTest method startNodes.

/**
 * Starts the nodes for this test.
 *
 * @throws Exception If failed.
 */
protected void startNodes() throws Exception {
    if (mode != PRIMARY) {
        // Start secondary IGFS.
        FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
        igfsCfg.setName("igfs_secondary");
        igfsCfg.setIpcEndpointConfiguration(SECONDARY_ENDPOINT_CFG);
        igfsCfg.setBlockSize(512 * 1024);
        igfsCfg.setPrefetchBlocks(1);
        CacheConfiguration dataCacheCfg = defaultCacheConfiguration();
        dataCacheCfg.setName("partitioned");
        dataCacheCfg.setCacheMode(PARTITIONED);
        dataCacheCfg.setNearConfiguration(null);
        dataCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
        dataCacheCfg.setAffinityMapper(new IgfsGroupDataBlocksKeyMapper(GRP_SIZE));
        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("grid_secondary");
        TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
        discoSpi.setLocalPort(47510);
        TcpDiscoveryVmIpFinder finder = new TcpDiscoveryVmIpFinder(true);
        discoSpi.setIpFinder(finder);
        cfg.setDiscoverySpi(discoSpi);
        cfg.setFileSystemConfiguration(igfsCfg);
        cfg.setIncludeEventTypes(EVT_TASK_FAILED, EVT_TASK_FINISHED, EVT_JOB_MAPPED);
        G.start(cfg);
    }
    for (int i = 1; i < GRID_COUNT; ++i) startGrid(i);
    startGrid(0);
}
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 80 with TcpDiscoveryVmIpFinder

use of org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder in project ignite by apache.

the class GridCacheLocalTxTimeoutSelfTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration() throws Exception {
    IgniteConfiguration c = super.getConfiguration();
    c.getTransactionConfiguration().setTxSerializableEnabled(true);
    c.getTransactionConfiguration().setDefaultTxTimeout(50);
    TcpDiscoverySpi disco = new TcpDiscoverySpi();
    disco.setIpFinder(new TcpDiscoveryVmIpFinder(true));
    c.setDiscoverySpi(disco);
    CacheConfiguration cc = defaultCacheConfiguration();
    cc.setCacheMode(LOCAL);
    c.setCacheConfiguration(cc);
    c.setNetworkTimeout(1000);
    return c;
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) TcpDiscoveryVmIpFinder(org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder) CacheConfiguration(org.apache.ignite.configuration.CacheConfiguration) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Aggregations

TcpDiscoveryVmIpFinder (org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder)97 IgniteConfiguration (org.apache.ignite.configuration.IgniteConfiguration)81 TcpDiscoverySpi (org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)80 CacheConfiguration (org.apache.ignite.configuration.CacheConfiguration)38 FileSystemConfiguration (org.apache.ignite.configuration.FileSystemConfiguration)16 Ignite (org.apache.ignite.Ignite)14 IgfsGroupDataBlocksKeyMapper (org.apache.ignite.igfs.IgfsGroupDataBlocksKeyMapper)12 ConnectorConfiguration (org.apache.ignite.configuration.ConnectorConfiguration)8 BinaryMarshaller (org.apache.ignite.internal.binary.BinaryMarshaller)6 TcpDiscoveryNode (org.apache.ignite.spi.discovery.tcp.internal.TcpDiscoveryNode)6 ArrayList (java.util.ArrayList)5 IgfsIpcEndpointConfiguration (org.apache.ignite.igfs.IgfsIpcEndpointConfiguration)5 HashMap (java.util.HashMap)4 IgniteCheckedException (org.apache.ignite.IgniteCheckedException)4 IgniteException (org.apache.ignite.IgniteException)4 TcpDiscoveryIpFinder (org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder)4 InetSocketAddress (java.net.InetSocketAddress)3 UUID (java.util.UUID)3 TcpCommunicationSpi (org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi)3 File (java.io.File)2