private void printVariables() { logger.info("Starting Test with "); logger.info("Thread Count: " + threadCount); logger.info("Entry Count: " + entryCount); logger.info("Value Size: " + valueSize); logger.info("Get Percentage: " + getPercentage); logger.info("Put Percentage: " + putPercentage); logger.info("Remove Percentage: " + (100 - (putPercentage + getPercentage))); logger.info("Load: " + load); } }
@Override public void blacklist(Address address, boolean permanent) { logger.info(address + " is added to the blacklist."); blacklistedAddresses.putIfAbsent(address, permanent); }
void printAndReset() { long getsNow = gets.getAndSet(0); long putsNow = puts.getAndSet(0); long removesNow = removes.getAndSet(0); long total = getsNow + putsNow + removesNow; logger.info("total= " + total + ", gets:" + getsNow + ", puts:" + putsNow + ", removes:" + removesNow); logger.info("Operations per Second: " + total / STATS_SECONDS); } }
private void logMigrationStatistics(int migrationCount, int lostCount) { if (lostCount > 0) { logger.warning("Assigning new owners for " + lostCount + " LOST partitions!"); } if (migrationCount > 0) { logger.info("Re-partitioning cluster data... Migration queue size: " + migrationCount); } else { logger.info("Partition balance is ok, no need to re-partition cluster data... "); } }
private void echoFailFast() { logger.info("Checking that ICMP failure-detector is permitted. Attempting to create a raw-socket using JNI."); if (!ICMPHelper.isRawSocketPermitted()) { throw new IllegalStateException("ICMP failure-detector can't be used in this environment. " + "Check Hazelcast Documentation Chapter on the Ping Failure Detector for supported platforms " + "and how to enable this capability for your operating system"); } logger.info("ICMP failure-detector is supported, enabling."); }
private static InputStream defaultFromClasspath(String defaultXmlName) throws IOException { LOGGER.info("Loading " + defaultXmlName + " from classpath."); InputStream in = Config.class.getClassLoader().getResourceAsStream(defaultXmlName); if (in == null) { throw new IOException("Could not load " + defaultXmlName + " + from classpath"); } return in; }
private void printAssignments(Map<Address, List<IndexedInputSplit>> assigned) { logger.info("Member-to-split assignment: " + assigned.entrySet().stream().flatMap(e -> concat( Stream.of(e.getKey() + ":"), Optional.of(e.getValue()).orElse(emptyList()).stream().map(Object::toString)) ).collect(joining("\n"))); }
@Override public void shutdown() { logger.info("Destroying node NodeExtension."); if (phoneHome != null) { phoneHome.shutdown(); } }
private void loadSystemPropertyClassPathResource(String configSystemProperty) { //it is a explicit configured classpath resource. String resource = configSystemProperty.substring("classpath:".length()); LOGGER.info("Using classpath resource at " + resource); if (resource.isEmpty()) { throw new HazelcastException("classpath resource can't be empty"); } in = Config.class.getClassLoader().getResourceAsStream(resource); if (in == null) { throw new HazelcastException("Could not load classpath resource: " + resource); } }
protected void loadDefaultConfigurationFromClasspath(String defaultConfigFile) { LOGGER.info("Loading '" + defaultConfigFile + "' from classpath."); configurationUrl = Config.class.getClassLoader().getResource(defaultConfigFile); if (configurationUrl == null) { throw new HazelcastException("Could not find '" + defaultConfigFile + "' in the classpath!" + "This may be due to a wrong-packaged or corrupted jar file."); } in = Config.class.getClassLoader().getResourceAsStream(defaultConfigFile); if (in == null) { throw new HazelcastException("Could not load '" + defaultConfigFile + "' from classpath"); } }
@Override public void stop() { if (instanceLoader != null) { log.info("Shutting down " + getClass().getSimpleName()); instanceLoader.unloadInstance(); instance = null; instanceLoader = null; } cleanupService.stop(); }
public void start() { if (!enabled) { logger.info(format("Diagnostics disabled. To enable add -D%s=true to the JVM arguments.", ENABLED.getName())); return; } this.diagnosticsLogFile = new DiagnosticsLogFile(this); this.scheduler = new ScheduledThreadPoolExecutor(1, new DiagnosticSchedulerThreadFactory()); logger.info("Diagnostics started"); }
private void synchronizeIndexes() { logger.info("Running MapIndexSynchronizer"); List<MapIndexInfo> mapIndexInfos = getIndexesToSynchronize(); if (!mapIndexInfos.isEmpty()) { executeIndexSync(mapIndexInfos); } }
private void log(String prefix, @Nonnull T object) { if (shouldLogFn.test(object)) { logger.info(prefix + ": " + toStringFn.apply(object) + (object instanceof JetEvent ? " (eventTime=" + toLocalTime(((JetEvent) object).timestamp()) + ")" : "")); } }
@Override public void start() { logger.info("Starting " + partitionThreads.length + " partition threads and " + genericThreads.length + " generic threads (" + priorityThreadCount + " dedicated for priority tasks)"); startAll(partitionThreads); startAll(genericThreads); }
@Override public void run() throws Exception { ClusterServiceImpl service = getService(); ClusterStateManager clusterStateManager = service.getClusterStateManager(); getLogger().info("Rolling back cluster state! Initiator: " + initiator); response = clusterStateManager.rollbackClusterState(txnId); }
@Override public void run() throws Exception { Address suspectedAddress = getCallerAddress(); getLogger().info("Received suspicion request from: " + suspectedAddress); final ClusterServiceImpl clusterService = getService(); clusterService.handleExplicitSuspicion(membersViewMetadata, suspectedAddress); }
private Member getMemberOrNull(EventData eventData) { Member member = clusterService.getMember(eventData.getCaller()); if (member == null) { if (logger.isInfoEnabled()) { logger.info("Dropping event " + eventData + " from unknown address:" + eventData.getCaller()); } } return member; }
private void memberRemoved(Member member) { members.remove(member); logger.info(membersString()); final Connection connection = connectionManager.getActiveConnection(member.getAddress()); if (connection != null) { connection.close(null, newTargetDisconnectedExceptionCausedByMemberLeftEvent(connection)); } MembershipEvent event = new MembershipEvent(client.getCluster(), member, MembershipEvent.MEMBER_REMOVED, unmodifiableSet(members)); clusterService.handleMembershipEvent(event); }
void updateQuorumSize(int newQuorumSize) { // This method can be called in parallel if multiple members are added. We don't synchronize here, // but the worst that can happen is that we write the JobRecord out unnecessarily. if (jobExecutionRecord.getQuorumSize() < newQuorumSize) { jobExecutionRecord.setLargerQuorumSize(newQuorumSize); writeJobExecutionRecord(false); logger.info("Current quorum size: " + jobExecutionRecord.getQuorumSize() + " of job " + idToString(jobRecord.getJobId()) + " is updated to: " + newQuorumSize); } }