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

    cfg.setCacheConfiguration(
        cacheConfiguration(META_CACHE_NAME), cacheConfiguration(DATA_CACHE_NAME));

    GridTcpDiscoverySpi discoSpi = new GridTcpDiscoverySpi();

    discoSpi.setIpFinder(IP_FINDER);

    cfg.setDiscoverySpi(discoSpi);

    GridGgfsConfiguration ggfsCfg = new GridGgfsConfiguration();

    ggfsCfg.setMetaCacheName(META_CACHE_NAME);
    ggfsCfg.setDataCacheName(DATA_CACHE_NAME);
    ggfsCfg.setName("ggfs");
    ggfsCfg.setBlockSize(CFG_BLOCK_SIZE);
    ggfsCfg.setFragmentizerEnabled(true);

    cfg.setGgfsConfiguration(ggfsCfg);

    return cfg;
  }
Beispiel #2
0
  /** @throws Exception If failed. */
  public void testRemoteIfDataBlockSizeDiffers() throws Exception {
    GridConfiguration g2Cfg = getConfiguration("g2");

    g1Cfg.setCacheConfiguration(
        concat(dataCaches(1024), metaCaches(), GridCacheConfiguration.class));
    g2Cfg.setCacheConfiguration(
        concat(dataCaches(1024), metaCaches(), GridCacheConfiguration.class));

    GridGgfsConfiguration g2GgfsCfg1 = new GridGgfsConfiguration(g1GgfsCfg1);

    g2GgfsCfg1.setBlockSize(g2GgfsCfg1.getBlockSize() + 100);

    g2Cfg.setGgfsConfiguration(g2GgfsCfg1, g1GgfsCfg2);

    G.start(g1Cfg);

    checkGridStartFails(
        g2Cfg, "Data block size should be same on all nodes in grid for GGFS", false);
  }