protected final BuildInfo getMemberBuildInfo() { return node.getBuildInfo(); }
protected final BuildInfo getMemberBuildInfo() { return node.getBuildInfo(); }
private String serializationVersionMessage() { return "Configured Hazelcast Serialization version: " + node.getBuildInfo().getSerializationVersion(); }
private String versionAndAddressMessage(@Nonnull String addToName) { JetBuildInfo jetBuildInfo = node.getBuildInfo().getJetBuildInfo(); String build = jetBuildInfo.getBuild(); String revision = jetBuildInfo.getRevision(); if (!revision.isEmpty()) { build += " - " + revision; } return "Hazelcast Jet" + addToName + ' ' + jetBuildInfo.getVersion() + " (" + build + ") starting at " + node.getThisAddress(); }
@ManagedAnnotation("build") @ManagedDescription("The Hazelcast build") public String getBuild() { return managedObject.node.getBuildInfo().getBuild(); }
@ManagedAnnotation("version") @ManagedDescription("The Hazelcast version") public String getVersion() { return managedObject.node.getBuildInfo().getVersion(); }
@ManagedAnnotation("build") @ManagedDescription("The Hazelcast build") public String getBuild() { return managedObject.node.getBuildInfo().getBuild(); }
@ManagedAnnotation("version") @ManagedDescription("The Hazelcast version") public String getVersion() { return managedObject.node.getBuildInfo().getVersion(); }
@Override public void writeResponse(ManagementCenterService mcs, JsonObject root) throws Exception { Runtime runtime = Runtime.getRuntime(); RuntimeMXBean runtimeMxBean = ManagementFactory.getRuntimeMXBean(); IPartitionService partitionService = mcs.getHazelcastInstance().node.getPartitionService(); JsonObject properties = new JsonObject(); properties.add("hazelcast.cl_version", mcs.getHazelcastInstance().node.getBuildInfo().getVersion()); properties.add("date.cl_startTime", Long.toString(runtimeMxBean.getStartTime())); properties.add("seconds.cl_upTime", Long.toString(runtimeMxBean.getUptime())); properties.add("memory.cl_freeMemory", Long.toString(runtime.freeMemory())); properties.add("memory.cl_totalMemory", Long.toString(runtime.totalMemory())); properties.add("memory.cl_maxMemory", Long.toString(runtime.maxMemory())); properties.add("return.hasOngoingMigration", Boolean.toString(partitionService.hasOnGoingMigration())); properties.add("data.cl_migrationTasksCount", Long.toString(partitionService.getMigrationQueueSize())); root.add("result", properties); }
@Override public void writeResponse(ManagementCenterService mcs, JsonObject root) throws Exception { Runtime runtime = Runtime.getRuntime(); RuntimeMXBean runtimeMxBean = ManagementFactory.getRuntimeMXBean(); IPartitionService partitionService = mcs.getHazelcastInstance().node.getPartitionService(); JsonObject properties = new JsonObject(); properties.add("hazelcast.cl_version", mcs.getHazelcastInstance().node.getBuildInfo().getVersion()); properties.add("date.cl_startTime", Long.toString(runtimeMxBean.getStartTime())); properties.add("seconds.cl_upTime", Long.toString(runtimeMxBean.getUptime())); properties.add("memory.cl_freeMemory", Long.toString(runtime.freeMemory())); properties.add("memory.cl_totalMemory", Long.toString(runtime.totalMemory())); properties.add("memory.cl_maxMemory", Long.toString(runtime.maxMemory())); properties.add("return.hasOngoingMigration", Boolean.toString(partitionService.hasOnGoingMigration())); properties.add("data.cl_migrationTasksCount", Long.toString(partitionService.getMigrationQueueSize())); root.add("result", properties); }
@Override public void printNodeInfo() { BuildInfo buildInfo = node.getBuildInfo(); String build = buildInfo.getBuild(); String revision = buildInfo.getRevision(); if (!revision.isEmpty()) { build += " - " + revision; } systemLogger.info("Hazelcast " + buildInfo.getVersion() + " (" + build + ") starting at " + node.getThisAddress()); systemLogger.info("Copyright (c) 2008-2019, Hazelcast, Inc. All Rights Reserved."); systemLogger.fine("Configured Hazelcast Serialization version: " + buildInfo.getSerializationVersion()); }
@Override public void printNodeInfo() { BuildInfo buildInfo = node.getBuildInfo(); String build = buildInfo.getBuild(); String revision = buildInfo.getRevision(); if (!revision.isEmpty()) { build += " - " + revision; } systemLogger.info("Hazelcast " + buildInfo.getVersion() + " (" + build + ") starting at " + node.getThisAddress()); systemLogger.info("Copyright (c) 2008-2018, Hazelcast, Inc. All Rights Reserved."); systemLogger.fine("Configured Hazelcast Serialization version: " + buildInfo.getSerializationVersion()); }
private void handleListNodes(HttpPostCommand command) throws UnsupportedEncodingException { String res; try { Node node = textCommandService.getNode(); ClusterService clusterService = node.getClusterService(); if (!checkCredentials(command)) { res = response(ResponseType.FORBIDDEN); } else { final String responseTxt = clusterService.getMembers().toString() + "\n" + node.getBuildInfo().getVersion() + "\n" + System.getProperty("java.version"); res = response(ResponseType.SUCCESS, "response", responseTxt); sendResponse(command, res); return; } } catch (Throwable throwable) { logger.warning("Error occurred while listing nodes", throwable); res = exceptionResponse(throwable); } sendResponse(command, res); }
private void handleListNodes(HttpPostCommand command) throws UnsupportedEncodingException { String res; try { Node node = textCommandService.getNode(); ClusterService clusterService = node.getClusterService(); if (!checkCredentials(command)) { res = response(ResponseType.FORBIDDEN); } else { final String responseTxt = clusterService.getMembers().toString() + "\n" + node.getBuildInfo().getVersion() + "\n" + System.getProperty("java.version"); res = response(ResponseType.SUCCESS, "response", responseTxt); sendResponse(command, res); return; } } catch (Throwable throwable) { logger.warning("Error occurred while listing nodes", throwable); res = exceptionResponse(throwable); } sendResponse(command, res); }
/** * Send a {@link WhoisMasterOp} to designated address. * * @param toAddress the address to which the operation will be sent. * @return {@code true} if the operation was sent, otherwise {@code false}. */ public boolean sendMasterQuestion(Address toAddress) { checkNotNull(toAddress, "No endpoint is specified!"); BuildInfo buildInfo = node.getBuildInfo(); final Address thisAddress = node.getThisAddress(); JoinMessage joinMessage = new JoinMessage(Packet.VERSION, buildInfo.getBuildNumber(), node.getVersion(), thisAddress, clusterService.getThisUuid(), node.isLiteMember(), node.createConfigCheck()); return nodeEngine.getOperationService().send(new WhoisMasterOp(joinMessage), toAddress); }
/** * Send a {@link WhoisMasterOp} to designated address. * * @param toAddress the address to which the operation will be sent. * @return {@code true} if the operation was sent, otherwise {@code false}. */ public boolean sendMasterQuestion(Address toAddress) { checkNotNull(toAddress, "No endpoint is specified!"); BuildInfo buildInfo = node.getBuildInfo(); final Address thisAddress = node.getThisAddress(); JoinMessage joinMessage = new JoinMessage(Packet.VERSION, buildInfo.getBuildNumber(), node.getVersion(), thisAddress, clusterService.getThisUuid(), node.isLiteMember(), node.createConfigCheck()); return nodeEngine.getOperationService().send(new WhoisMasterOp(joinMessage), toAddress); }
public PhoneHomeParameterCreator createParameters(Node hazelcastNode) { ClusterServiceImpl clusterService = hazelcastNode.getClusterService(); int clusterSize = clusterService.getMembers().size(); Long clusterUpTime = clusterService.getClusterClock().getClusterUpTime(); RuntimeMXBean runtimeMxBean = ManagementFactory.getRuntimeMXBean(); JetBuildInfo jetBuildInfo = hazelcastNode.getBuildInfo().getJetBuildInfo(); PhoneHomeParameterCreator parameterCreator = new PhoneHomeParameterCreator() .addParam("version", buildInfo.getVersion()) .addParam("m", hazelcastNode.getThisUuid()) .addParam("p", getDownloadId()) .addParam("c", clusterService.getClusterId()) .addParam("crsz", convertToLetter(clusterSize)) .addParam("cssz", convertToLetter(hazelcastNode.clientEngine.getClientEndpointCount())) .addParam("cuptm", Long.toString(clusterUpTime)) .addParam("nuptm", Long.toString(runtimeMxBean.getUptime())) .addParam("jvmn", runtimeMxBean.getVmName()) .addParam("jvmv", System.getProperty("java.version")) .addParam("jetv", jetBuildInfo == null ? "" : jetBuildInfo.getVersion()); addClientInfo(hazelcastNode, parameterCreator); addOSInfo(parameterCreator); boolean isManagementCenterConfigEnabled = hazelcastNode.config.getManagementCenterConfig().isEnabled(); if (isManagementCenterConfigEnabled) { addManCenterInfo(hazelcastNode, clusterSize, parameterCreator); } else { parameterCreator.addParam("mclicense", "MC_NOT_CONFIGURED"); parameterCreator.addParam("mcver", "MC_NOT_CONFIGURED"); } return parameterCreator; }
public PhoneHomeParameterCreator createParameters(Node hazelcastNode) { ClusterServiceImpl clusterService = hazelcastNode.getClusterService(); int clusterSize = clusterService.getMembers().size(); Long clusterUpTime = clusterService.getClusterClock().getClusterUpTime(); RuntimeMXBean runtimeMxBean = ManagementFactory.getRuntimeMXBean(); JetBuildInfo jetBuildInfo = hazelcastNode.getBuildInfo().getJetBuildInfo(); PhoneHomeParameterCreator parameterCreator = new PhoneHomeParameterCreator() .addParam("version", buildInfo.getVersion()) .addParam("m", hazelcastNode.getThisUuid()) .addParam("p", getDownloadId()) .addParam("c", clusterService.getClusterId()) .addParam("crsz", convertToLetter(clusterSize)) .addParam("cssz", convertToLetter(hazelcastNode.clientEngine.getClientEndpointCount())) .addParam("cuptm", Long.toString(clusterUpTime)) .addParam("nuptm", Long.toString(runtimeMxBean.getUptime())) .addParam("jvmn", runtimeMxBean.getVmName()) .addParam("jvmv", System.getProperty("java.version")) .addParam("jetv", jetBuildInfo == null ? "" : jetBuildInfo.getVersion()); addClientInfo(hazelcastNode, parameterCreator); addOSInfo(parameterCreator); boolean isManagementCenterConfigEnabled = hazelcastNode.config.getManagementCenterConfig().isEnabled(); if (isManagementCenterConfigEnabled) { addManCenterInfo(hazelcastNode, clusterSize, parameterCreator); } else { parameterCreator.addParam("mclicense", "MC_NOT_CONFIGURED"); parameterCreator.addParam("mcver", "MC_NOT_CONFIGURED"); } return parameterCreator; }
private void handleActiveAndJoined(JoinMessage joinMessage) { if (!(joinMessage instanceof JoinRequest)) { logDroppedMessage(joinMessage); return; } ClusterServiceImpl clusterService = node.getClusterService(); Address masterAddress = clusterService.getMasterAddress(); if (clusterService.isMaster()) { JoinMessage response = new JoinMessage(Packet.VERSION, node.getBuildInfo().getBuildNumber(), node.getVersion(), node.getThisAddress(), node.getThisUuid(), node.isLiteMember(), node.createConfigCheck()); node.multicastService.send(response); } else if (joinMessage.getAddress().equals(masterAddress)) { MemberImpl master = node.getClusterService().getMember(masterAddress); if (master != null && !master.getUuid().equals(joinMessage.getUuid())) { String message = "New join request has been received from current master. Suspecting " + masterAddress; logger.warning(message); // I just make a local suspicion. Probably other nodes will eventually suspect as well. clusterService.suspectMember(master, message, false); } } }
private void handleActiveAndJoined(JoinMessage joinMessage) { if (!(joinMessage instanceof JoinRequest)) { logDroppedMessage(joinMessage); return; } ClusterServiceImpl clusterService = node.getClusterService(); Address masterAddress = clusterService.getMasterAddress(); if (clusterService.isMaster()) { JoinMessage response = new JoinMessage(Packet.VERSION, node.getBuildInfo().getBuildNumber(), node.getVersion(), node.getThisAddress(), node.getThisUuid(), node.isLiteMember(), node.createConfigCheck()); node.multicastService.send(response); } else if (joinMessage.getAddress().equals(masterAddress)) { MemberImpl master = node.getClusterService().getMember(masterAddress); if (master != null && !master.getUuid().equals(joinMessage.getUuid())) { String message = "New join request has been received from current master. Suspecting " + masterAddress; logger.warning(message); // I just make a local suspicion. Probably other nodes will eventually suspect as well. clusterService.suspectMember(master, message, false); } } }