use of alluxio.master.LocalAlluxioCluster in project zeppelin by apache.
the class AlluxioInterpreterTest method before.
@Before
public final void before() throws Exception {
mLocalAlluxioCluster = new LocalAlluxioCluster(SIZE_BYTES, 1000);
mLocalAlluxioCluster.start();
fs = mLocalAlluxioCluster.getClient();
final Properties props = new Properties();
props.put(AlluxioInterpreter.ALLUXIO_MASTER_HOSTNAME, mLocalAlluxioCluster.getMasterHostname());
props.put(AlluxioInterpreter.ALLUXIO_MASTER_PORT, mLocalAlluxioCluster.getMasterPort() + "");
alluxioInterpreter = new AlluxioInterpreter(props);
alluxioInterpreter.open();
}
use of alluxio.master.LocalAlluxioCluster in project alluxio by Alluxio.
the class LocalAlluxioClusterResource method apply.
@Override
public Statement apply(final Statement statement, Description description) {
mLocalAlluxioCluster = new LocalAlluxioCluster(mNumWorkers);
try {
boolean startCluster = mStartCluster;
Annotation configAnnotation = description.getAnnotation(Config.class);
if (configAnnotation != null) {
Config config = (Config) configAnnotation;
// Override the configuration parameters with any configuration params
for (int i = 0; i < config.confParams().length; i += 2) {
mConfiguration.put(PropertyKey.fromString(config.confParams()[i]), config.confParams()[i + 1]);
}
// Override startCluster
startCluster = config.startCluster();
}
if (startCluster) {
start();
}
} catch (Exception e) {
throw new RuntimeException(e);
}
return new Statement() {
@Override
public void evaluate() throws Throwable {
try {
statement.evaluate();
} finally {
mLocalAlluxioCluster.stop();
}
}
};
}
Aggregations