/** {@inheritDoc} */
  @Override
  protected IgniteConfiguration getConfiguration() throws Exception {
    IgniteConfiguration cfg = super.getConfiguration();

    cfg.setPeerClassLoadingEnabled(false);

    TcpDiscoverySpi disco = new TcpDiscoverySpi();

    disco.setIpFinder(ipFinder);

    cfg.setDiscoverySpi(disco);

    return cfg;
  }
  /** {@inheritDoc} */
  @Override
  protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(gridName);

    BinaryConfiguration binCfg = new BinaryConfiguration();

    binCfg.setTypeConfigurations(
        Arrays.asList(
            new BinaryTypeConfiguration() {
              {
                setTypeName(Key.class.getName());

                setIdentityResolver(BinaryArrayIdentityResolver.instance());
              }
            },
            new BinaryTypeConfiguration() {
              {
                setTypeName(Key2.class.getName());

                setIdentityResolver(BinaryArrayIdentityResolver.instance());
              }
            },
            new BinaryTypeConfiguration() {
              {
                setTypeName(Key3.class.getName());

                setIdentityResolver(new BinaryFieldIdentityResolver().setFieldNames("key"));
              }
            },
            new BinaryTypeConfiguration() {
              {
                setTypeName(Key4.class.getName());

                setIdentityResolver(new Key4Id());
              }
            }));

    cfg.setBinaryConfiguration(binCfg);

    cfg.setPeerClassLoadingEnabled(false);

    TcpDiscoverySpi disco = new TcpDiscoverySpi();

    disco.setIpFinder(ipFinder);

    cfg.setDiscoverySpi(disco);

    return cfg;
  }
  /** {@inheritDoc} */
  @Override
  protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(gridName);

    cfg.setPeerClassLoadingEnabled(false);

    cfg.setDeploymentMode(depMode);

    if (initGar) {
      UriDeploymentSpi depSpi = new UriDeploymentSpi();

      depSpi.setUriList(Collections.singletonList(garFile));

      cfg.setDeploymentSpi(depSpi);
    }

    ((TcpDiscoverySpi) cfg.getDiscoverySpi()).setHeartbeatFrequency(500);

    return cfg;
  }
  /** {@inheritDoc} */
  @Override
  protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
    IgniteConfiguration c = super.getConfiguration(gridName);

    CacheConfiguration atomicCacheCfg = cacheConfiguration0();

    atomicCacheCfg.setName(CACHE_ATOMIC);
    atomicCacheCfg.setAtomicityMode(ATOMIC);
    atomicCacheCfg.setAtomicWriteOrderMode(PRIMARY);

    CacheConfiguration atomicOffheapCacheCfg = offheapCacheConfiguration0();

    atomicOffheapCacheCfg.setName(CACHE_ATOMIC_OFFHEAP);
    atomicOffheapCacheCfg.setAtomicityMode(ATOMIC);
    atomicOffheapCacheCfg.setAtomicWriteOrderMode(PRIMARY);

    CacheConfiguration atomicOffheapTieredCacheCfg = offheapTieredCacheConfiguration();

    atomicOffheapTieredCacheCfg.setName(CACHE_ATOMIC_OFFHEAP_TIERED);
    atomicOffheapTieredCacheCfg.setAtomicityMode(ATOMIC);
    atomicOffheapTieredCacheCfg.setAtomicWriteOrderMode(PRIMARY);

    c.setCacheConfiguration(
        cacheConfiguration(),
        offheapCacheConfiguration(),
        offheapTieredCacheConfiguration(),
        atomicCacheCfg,
        atomicOffheapCacheCfg,
        atomicOffheapTieredCacheCfg);

    c.setSwapSpaceSpi(new FileSwapSpaceSpi());

    c.setPeerClassLoadingEnabled(peerClassLoading());

    return c;
  }
  /** {@inheritDoc} */
  @Override
  protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(gridName);

    TcpDiscoverySpi spi = new TcpDiscoverySpi();

    spi.setIpFinder(IP_FINDER);

    cfg.setDiscoverySpi(spi);

    cfg.setIncludeProperties();

    cfg.setIncludeEventTypes(EVT_TASK_FAILED, EVT_TASK_FINISHED, EVT_JOB_MAPPED);

    cfg.setConnectorConfiguration(null);

    cfg.setPeerClassLoadingEnabled(true);

    if (useCache) {
      CacheConfiguration cc = defaultCacheConfiguration();

      cc.setCacheMode(PARTITIONED);

      cc.setNearConfiguration(null);
      cc.setWriteSynchronizationMode(FULL_SYNC);
      cc.setStartSize(ENTRY_CNT / GRID_CNT);
      cc.setSwapEnabled(false);

      cc.setBackups(1);

      cfg.setCacheSanityCheckEnabled(false);
      cfg.setCacheConfiguration(cc);
    } else cfg.setCacheConfiguration();

    return cfg;
  }