use of alluxio.conf.InstancedConfiguration in project alluxio by Alluxio.
the class MountInfo method toDisplayMountPointInfo.
/**
* @return the {@link MountPointInfo} for the mount point. Some information is formatted
* for display purpose.
*/
public MountPointInfo toDisplayMountPointInfo() {
MountPointInfo info = toMountPointInfo();
UnderFileSystemConfiguration conf = UnderFileSystemConfiguration.defaults(new InstancedConfiguration(new AlluxioProperties())).createMountSpecificConf(info.getProperties());
Map<String, String> displayConf = conf.toUserPropertyMap(ConfigurationValueOptions.defaults().useDisplayValue(true));
info.setProperties(displayConf);
return info;
}
use of alluxio.conf.InstancedConfiguration in project alluxio by Alluxio.
the class ManagerProcessMonitorTest method testProcessMonitorSuccess.
@Test
public void testProcessMonitorSuccess() throws Exception {
InstancedConfiguration conf = getTestConfig();
try (ManagerProcess proc = new ManagerProcess(conf)) {
CountingRetry cntRetry = new CountingRetry(5);
CommonUtils.waitFor("rpc server is serving", proc::isServing, WaitForOptions.defaults().setTimeoutMs(10000));
assertNotEquals(0, proc.getRpcPort());
ManagerProcessMonitor.pingService(new InetSocketAddress("127.0.0.1", proc.getRpcPort()), cntRetry, 2000);
} catch (Exception e) {
fail("Should not have thrown an exception: " + e);
}
}
use of alluxio.conf.InstancedConfiguration in project alluxio by Alluxio.
the class ManagerRpcServerTest method testGetAddress.
@Test
public void testGetAddress() throws Exception {
InstancedConfiguration conf = getTestConfig();
conf.set(PropertyKey.HUB_MANAGER_RPC_BIND_HOST, "127.6.5.4");
ServerConfiguration.set(PropertyKey.HUB_MANAGER_RPC_PORT, 0);
InetSocketAddress addr = ManagerRpcServer.getBindAddress(conf);
assertEquals("127.6.5.4", addr.getHostString());
assertEquals(0, addr.getPort());
}
use of alluxio.conf.InstancedConfiguration in project alluxio by Alluxio.
the class ProcessLauncherTest method testCreateProcwithMock.
void testCreateProcwithMock(Process mockedProcess) throws Exception {
InstancedConfiguration conf = getTestConfig();
conf.set(PropertyKey.HOME, "/path/to/non/existent/directory");
try (MockedStatic<Files> files = Mockito.mockStatic(Files.class)) {
files.when(() -> Files.exists(ArgumentMatchers.any())).thenReturn(true);
ProcessLauncher l = new ProcessLauncher(getTestConfig());
try (MockedStatic<Runtime> runtimeMock = Mockito.mockStatic(Runtime.class)) {
Runtime mockedRuntime = mock(Runtime.class);
runtimeMock.when(Runtime::getRuntime).thenReturn(mockedRuntime);
for (AlluxioNodeType t : AlluxioNodeType.values()) {
doReturn(mockedProcess).when(mockedRuntime).exec(ArgumentMatchers.any(String.class));
l.start(t);
verify(mockedRuntime).exec(ArgumentMatchers.contains("alluxio-start.sh " + t.toString().toLowerCase()));
}
}
}
}
use of alluxio.conf.InstancedConfiguration in project alluxio by Alluxio.
the class AlluxioProxyMonitor method main.
/**
* Starts the Alluxio proxy monitor.
*
* @param args command line arguments, should be empty
*/
public static void main(String[] args) {
if (args.length != 0) {
LOG.info("java -cp {} {}", RuntimeConstants.ALLUXIO_JAR, AlluxioProxyMonitor.class.getCanonicalName());
LOG.warn("ignoring arguments");
}
HealthCheckClient client = new ProxyHealthCheckClient(NetworkAddressUtils.getBindAddress(NetworkAddressUtils.ServiceType.PROXY_WEB, new InstancedConfiguration(ConfigurationUtils.defaults())), () -> new ExponentialBackoffRetry(50, 100, 2));
if (!client.isServing()) {
System.exit(1);
}
System.exit(0);
}
Aggregations