@Override public void retryLogic() { testConfig.setProperty(DNodeProperties.PORT, testConfig.getInt(DNodeProperties.PORT) + 1); } };
@Override public void retryLogic() { testConfig.setProperty(QNodeProperties.PORT, testConfig.getInt(QNodeProperties.PORT) + 1); } };
/** * Gets only the default values and adds some desirable properties for testing, */ public static SploutConfiguration getTestConfig() { SploutConfiguration properties = new SploutConfiguration(); PropertiesConfiguration config = load("", SPLOUT_PROPERTIES + ".default", true); properties.addConfiguration(config); // Activate replica balancing for tests properties.setProperty(QNodeProperties.REPLICA_BALANCE_ENABLE, true); // Disable wait for testing speedup. properties.setProperty(HazelcastProperties.DISABLE_WAIT_WHEN_JOINING, true); // Disable warming up - set it to only one second // that's enough since Hazelcast joining is by far slower properties.setProperty(QNodeProperties.WARMING_TIME, 1); // Disable HZ state storage properties.clearProperty(HazelcastProperties.HZ_PERSISTENCE_FOLDER); // We maintain compatibility with legacy tests by using JSON serialization between QNode and DNode properties.setProperty(QNodeProperties.DISABLE_BINARY_PROTOCOL, true); // We don't want the tests to mess around with more ports, in general properties.setProperty(DNodeProperties.STREAMING_API_DISABLE, true); return properties; }
testConfig.setProperty(DNodeProperties.DATA_FOLDER, dataFolder); if (deleteDataFolder) { File file = new File(dataFolder); testConfig.setProperty(FetcherProperties.TEMP_DIR, "fetcher-" + dataFolder); File fetcherTmp = new File("fetcher-" + dataFolder); if (fetcherTmp.exists()) {
public void runForever(int nDNodes) throws Exception { SploutConfiguration config = SploutConfiguration.getTestConfig(); for (int i = 0; i < nDNodes; i++) { config = SploutConfiguration.getTestConfig(); // we need to change some props for avoiding conflicts, ports, etc config.setProperty(DNodeProperties.PORT, config.getInt(DNodeProperties.PORT) + i); config.setProperty(DNodeProperties.DATA_FOLDER, config.getString(DNodeProperties.DATA_FOLDER) + "-" + i); config.setProperty(FetcherProperties.TEMP_DIR, config.getString(FetcherProperties.TEMP_DIR) + "-" + i); DNode dnode = new DNode(config, new DNodeHandler()); dnode.init(); } }
public void runForever(int nDNodes) throws Exception { SploutConfiguration config = SploutConfiguration.get(); for (int i = 0; i < nDNodes; i++) { config = SploutConfiguration.get(); // we need to change some props for avoiding conflicts, ports, etc config.setProperty(DNodeProperties.PORT, config.getInt(DNodeProperties.PORT) + i); config.setProperty(DNodeProperties.DATA_FOLDER, config.getString(DNodeProperties.DATA_FOLDER) + "-" + i); config.setProperty(FetcherProperties.TEMP_DIR, config.getString(FetcherProperties.TEMP_DIR) + "-" + i); DNode dnode = new DNode(config, new DNodeHandler()); dnode.init(); } QNode qnode = new QNode(); qnode.start(config, new QNodeHandler()); }
} catch (BindException e) { if (config.getBoolean(HttpFileExchangerProperties.HTTP_PORT_AUTO_INCREMENT)) { config.setProperty(HttpFileExchangerProperties.HTTP_PORT, httpPort + 1); } else { throw e;
throw e; config.setProperty(DNodeProperties.PORT, thriftPort + 1); retries++; throw e; config.setProperty(DNodeProperties.STREAMING_PORT, tcpPort + 1); retries++;
throw e; config.setProperty(QNodeProperties.PORT, config.getInt(QNodeProperties.PORT) + 1); retries++;