/** * Starts both master and a worker using the configurations in test conf respectively. */ public void start() throws Exception { // Disable HDFS client caching to avoid file system close() affecting other clients System.setProperty("fs.hdfs.impl.disable.cache", "true"); resetClientPools(); setupTest(); startMasters(); startWorkers(); startProxy(); // Reset contexts so that they pick up the updated configuration. reset(); }
@Override public void stop() throws Exception { super.stop(); // clear HDFS client caching System.clearProperty("fs.hdfs.impl.disable.cache"); }
/** * Restarts the master(s). */ public void restartMasters() throws Exception { stopMasters(); startMasters(); }
/** * Creates a default {@link Configuration} for testing. */ public void initConfiguration() throws IOException { setAlluxioWorkDirectory(); setHostname(); for (Entry<PropertyKey, String> entry : ConfigurationTestUtils .testConfigurationDefaults(mHostname, mWorkDirectory).entrySet()) { Configuration.set(entry.getKey(), entry.getValue()); } Configuration.set(PropertyKey.TEST_MODE, true); Configuration.set(PropertyKey.MASTER_RPC_PORT, 0); Configuration.set(PropertyKey.MASTER_WEB_PORT, 0); Configuration.set(PropertyKey.PROXY_WEB_PORT, 0); Configuration.set(PropertyKey.WORKER_RPC_PORT, 0); Configuration.set(PropertyKey.WORKER_DATA_PORT, 0); Configuration.set(PropertyKey.WORKER_WEB_PORT, 0); }
@Override public void stopFS() throws Exception { super.stopFS(); LOG.info("Stopping testing zookeeper: {}", mCuratorServer.getConnectString()); mCuratorServer.close(); }
@Override public void startWorkers() throws Exception { ServerConfiguration.set(PropertyKey.WORKER_BLOCK_THREADS_MAX, "100"); super.startWorkers(); }
/** * Stops the masters, formats them, and then restarts them. This is useful if a fresh state is * desired, for example when restoring from a backup. */ public void formatAndRestartMasters() throws Exception { stopMasters(); Format.format(Format.Mode.MASTER, ServerConfiguration.global()); startMasters(); }
@Override public void stopFS() throws Exception { super.stopFS(); LOG.info("Stopping testing zookeeper: {}", mCuratorServer.getConnectString()); mCuratorServer.close(); }
@Override public void startWorkers() throws Exception { Configuration.set(PropertyKey.WORKER_BLOCK_THREADS_MAX, "100"); super.startWorkers(); }
/** * Starts both master and a worker using the configurations in test conf respectively. */ public void start() throws Exception { // Disable HDFS client caching to avoid file system close() affecting other clients System.setProperty("fs.hdfs.impl.disable.cache", "true"); resetClientPools(); setupTest(); startMasters(); // Reset the file system context to make sure the correct master RPC port is used. FileSystemContext.get().reset(Configuration.global()); startWorkers(); startProxy(); // Reset contexts so that they pick up the updated configuration. reset(); }
/** * Restarts the master(s). */ public void restartMasters() throws Exception { stopMasters(); startMasters(); }
@Override public void stop() throws Exception { super.stop(); // clear HDFS client caching System.clearProperty("fs.hdfs.impl.disable.cache"); }
/** * Stops the masters, formats them, and then restarts them. This is useful if a fresh state is * desired, for example when restoring from a backup. */ public void formatAndRestartMasters() throws Exception { stopMasters(); Format.format(Format.Mode.MASTER); startMasters(); }