/** * @return the externally resolvable address of the master */ public InetSocketAddress getAddress() { return mMasterProcess.getRpcAddress(); }
/** * Gets the actual port that the RPC service is listening on. * * @return the RPC local port */ public int getRpcLocalPort() { return mMasterProcess.getRpcAddress().getPort(); }
/** * @summary get the master rpc address * @return the response object * @deprecated since version 1.4 and will be removed in version 2.0 * @see #getInfo(Boolean) */ @GET @Path(GET_RPC_ADDRESS) @ReturnType("java.lang.String") @Deprecated public Response getRpcAddress() { return RestUtils .call(() -> mMasterProcess.getRpcAddress().toString(), ServerConfiguration.global()); }
@Test public void getRpcAddress() { when(mMasterProcess.getRpcAddress()).thenReturn(new InetSocketAddress("localhost", 8080)); Response response = mHandler.getRpcAddress(); try { assertNotNull("Response must be not null!", response); assertNotNull("Response must have a entry!", response.getEntity()); assertEquals("Entry must be a String!", String.class, response.getEntity().getClass()); String entry = (String) response.getEntity(); assertEquals("\"localhost/127.0.0.1:8080\"", entry); } finally { response.close(); } }
AuthenticatedClientUser.set(LoginUser.get(ServerConfiguration.global()).getName()); response.setMasterNodeAddress(mMasterProcess.getRpcAddress().toString()).setFatalError("") .setShowPermissions(ServerConfiguration .getBoolean(PropertyKey.SECURITY_AUTHORIZATION_PERMISSION_ENABLED));
.setMasterNodeAddress(mMasterProcess.getRpcAddress().toString()).setUptime(CommonUtils .convertMsToClockTime(System.currentTimeMillis() - mMetaMaster.getStartTimeMs())) .setStartTime(CommonUtils.convertMsToDate(mMetaMaster.getStartTimeMs(),
/** * @summary get the Alluxio master information * @param rawConfiguration if it's true, raw configuration values are returned, * otherwise, they are looked up; if it's not provided in URL queries, then * it is null, which means false. * @return the response object */ @GET @Path(GET_INFO) @ReturnType("alluxio.wire.AlluxioMasterInfo") public Response getInfo(@QueryParam(QUERY_RAW_CONFIGURATION) final Boolean rawConfiguration) { // TODO(jiri): Add a mechanism for retrieving only a subset of the fields. return RestUtils.call(() -> { boolean rawConfig = false; if (rawConfiguration != null) { rawConfig = rawConfiguration; } return new AlluxioMasterInfo().setCapacity(getCapacityInternal()) .setConfiguration(getConfigurationInternal(rawConfig)) .setLostWorkers(mBlockMaster.getLostWorkersInfoList()).setMetrics(getMetricsInternal()) .setMountPoints(getMountPointsInternal()) .setRpcAddress(mMasterProcess.getRpcAddress().toString()) .setStartTimeMs(mMasterProcess.getStartTimeMs()) .setStartupConsistencyCheck(getStartupConsistencyCheckInternal()) .setTierCapacity(getTierCapacityInternal()).setUfsCapacity(getUfsCapacityInternal()) .setUptimeMs(mMasterProcess.getUptimeMs()).setVersion(RuntimeConstants.VERSION) .setWorkers(mBlockMaster.getWorkerInfoList()); }, ServerConfiguration.global()); }
.setMasterNodeAddress(mMasterProcess.getRpcAddress().toString()).setInvalidPathError(""); List<FileInfo> filesInfo; String path = requestPath;