Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Copyright (c) 2008-2016, Hazelcast, Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hazelcast.internal.diagnostics;
import com.hazelcast.core.HazelcastInstance;
import com.hazelcast.core.LifecycleEvent;
import com.hazelcast.core.LifecycleListener;
import com.hazelcast.core.Member;
import com.hazelcast.core.MembershipAdapter;
import com.hazelcast.core.MembershipEvent;
import com.hazelcast.core.MigrationEvent;
import com.hazelcast.core.MigrationListener;
import com.hazelcast.logging.ILogger;
import com.hazelcast.nio.Address;
import com.hazelcast.nio.Connection;
import com.hazelcast.nio.ConnectionListenable;
import com.hazelcast.nio.ConnectionListener;
import com.hazelcast.spi.impl.NodeEngineImpl;
import com.hazelcast.spi.properties.HazelcastProperties;
import com.hazelcast.spi.properties.HazelcastProperty;
import java.util.Queue;
import java.util.Set;
import java.util.concurrent.ConcurrentLinkedQueue;
import static java.util.concurrent.TimeUnit.SECONDS;
/**
* The {@link SystemLogPlugin} is responsible for:
*
*
Showing lifecycle changes like shutting down, merging etc.
*
Show connection creation and connection closing. Also the causes of closes are included.
*
Showing membership changes.
*
Optionally showing partition migration
*
*
* This plugin is very useful to get an idea what is happening inside a cluster; especially when there are connection related
* problems.
*
* This cluster has a low overhead and is meant to run in production.
*/
public class SystemLogPlugin extends DiagnosticsPlugin {
/**
* If this plugin is enabled.
*/
public static final HazelcastProperty ENABLED
= new HazelcastProperty(Diagnostics.PREFIX + ".systemlog.enabled", "true");
/**
* If logging partition migration is enabled. Because there can be so many partitions, logging the partition migration
* can be very noisy.
*/
public static final HazelcastProperty LOG_PARTITIONS
= new HazelcastProperty(Diagnostics.PREFIX + ".systemlog.partitions", "false");
/**
* Currently the Diagnostic is scheduler based, so each task gets to run as often at is has been configured. This works
* fine for most plugins, but if there are outside events triggering the need to write, this scheduler based model is
* not the right fit. In the future the Diagnostics need to be improved.
*/
private static final long PERIOD_MILLIS = SECONDS.toMillis(1);
private final Queue