use of alluxio.hub.proto.AlluxioConfigurationSet in project alluxio by Alluxio.
the class ConfigurationEditorTest method testWrite.
@Test
public void testWrite() throws IOException {
String siteProps = "alluxio.test=true";
String envSh = "ALLUXIO_JAVA_OPTS=\"-XX:DebugNonSafepoints\"";
String log4j = "log4j.rootLogger=INFO, ${alluxio.logger.type}, ${alluxio.remote.logger.type}";
AlluxioConfigurationSet s = AlluxioConfigurationSet.newBuilder().setSiteProperties(siteProps).setAlluxioEnv(envSh).setLog4JProperties(log4j).build();
ConfigurationEditor editor = new ConfigurationEditor(mConfDir.toAbsolutePath().toString());
editor.writeConf(s);
assertEquals(s, editor.readConf());
}
use of alluxio.hub.proto.AlluxioConfigurationSet in project alluxio by Alluxio.
the class ConfigurationEditorTest method testRead.
@Test
public void testRead() throws IOException {
String siteProps = "alluxio.test=true";
String envSh = "ALLUXIO_JAVA_OPTS=\"-XX:DebugNonSafepoints\"";
String log4j = "log4j.rootLogger=INFO, ${alluxio.logger.type}, ${alluxio.remote.logger.type}";
Files.write(mSiteProps, siteProps.getBytes());
Files.write(mEnvSh, envSh.getBytes());
Files.write(mLog4j, log4j.getBytes());
ConfigurationEditor editor = new ConfigurationEditor(mConfDir.toAbsolutePath().toString());
AlluxioConfigurationSet s = editor.readConf();
assertTrue(s.getSiteProperties().contains(siteProps));
assertTrue(s.getAlluxioEnv().contains(envSh));
assertTrue(s.getLog4JProperties().contains(log4j));
}
use of alluxio.hub.proto.AlluxioConfigurationSet in project alluxio by Alluxio.
the class ManagerProcessContext method startGetConfigurationSetListener.
/**
* Starts a request stream observer for {@link HostedManagerServiceGrpc} GetConfigurationSet
* RPC calls.
*/
public void startGetConfigurationSetListener() {
HostedManagerServiceGrpc.HostedManagerServiceStub asyncStub = getHostedAsyncStub();
RequestStreamObserver requestObserver = new RequestStreamObserver<GetConfigurationSetRequest, GetConfigurationSetResponse>() {
@Override
public GetConfigurationSetResponse exec(GetConfigurationSetRequest req) {
AlluxioConfigurationSet confSet = configurationSetFor(req.getPayload().getNodeType());
return GetConfigurationSetResponse.newBuilder().setHubMetadata(mHubMetadata).setPayload(GetConfigurationSetResponse.Payload.newBuilder().setConfSet(confSet).build()).build();
}
@Override
public void restart() {
startGetConfigurationSetListener();
}
@Override
public void handleError(String message, Throwable t) {
handleStatusRuntimeException(message, t);
}
};
StreamObserver<GetConfigurationSetResponse> responseObserver = asyncStub.getConfigurationSet(requestObserver);
requestObserver.start(responseObserver, GetConfigurationSetResponse.newBuilder().setHubMetadata(mHubMetadata).build());
LOG.info("Started GetConfigurationSet async listener", asyncStub);
}
Aggregations