Search in sources :

Example 6 with ProtocolType

use of com.hazelcast.instance.ProtocolType in project hazelcast by hazelcast.

the class AdvancedNetworkStatsIntegrationTest method assertNonMemberNetworkStatsAreZeroFromEMs.

private void assertNonMemberNetworkStatsAreZeroFromEMs(HazelcastInstance instance) {
    for (ProtocolType protocolType : ProtocolType.values()) {
        if (protocolType != MEMBER) {
            assertEquals(0, getBytesReceivedFromEMs(instance, protocolType));
            assertEquals(0, getBytesSentFromEMs(instance, protocolType));
        }
    }
}
Also used : ProtocolType(com.hazelcast.instance.ProtocolType)

Example 7 with ProtocolType

use of com.hazelcast.instance.ProtocolType in project hazelcast by hazelcast.

the class AdvancedNetworkConfig method setEndpointConfigs.

public AdvancedNetworkConfig setEndpointConfigs(Map<EndpointQualifier, EndpointConfig> endpointConfigs) {
    // sanitize input
    for (Map.Entry<EndpointQualifier, EndpointConfig> entry : endpointConfigs.entrySet()) {
        entry.getValue().setProtocolType(entry.getKey().getType());
    }
    // validate
    for (ProtocolType protocolType : ProtocolType.values()) {
        int count = countEndpointConfigs(endpointConfigs, protocolType);
        if (count > protocolType.getServerSocketCardinality()) {
            throw new InvalidConfigurationException("Protocol type " + protocolType + " does not allow more than " + protocolType.getServerSocketCardinality() + " server sockets but " + count + " were defined");
        }
    }
    this.endpointConfigs.clear();
    this.endpointConfigs.putAll(endpointConfigs);
    return this;
}
Also used : ProtocolType(com.hazelcast.instance.ProtocolType) EndpointQualifier(com.hazelcast.instance.EndpointQualifier) Map(java.util.Map) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap)

Example 8 with ProtocolType

use of com.hazelcast.instance.ProtocolType in project hazelcast by hazelcast.

the class TcpServerControlTest method localAddresses_memberWan.

private static Map<ProtocolType, Collection<Address>> localAddresses_memberWan() {
    Map<ProtocolType, Collection<Address>> addresses = new HashMap<>();
    Collection<Address> memberAddresses = singletonList(new Address(INITIATOR_MEMBER_ADDRESS));
    Collection<Address> wanAddresses = singletonList(new Address(INITIATOR_WAN_ADDRESS));
    addresses.put(ProtocolType.MEMBER, memberAddresses);
    addresses.put(WAN, wanAddresses);
    return addresses;
}
Also used : Address(com.hazelcast.cluster.Address) InetSocketAddress(java.net.InetSocketAddress) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) HashMap(java.util.HashMap) ProtocolType(com.hazelcast.instance.ProtocolType) Collection(java.util.Collection)

Example 9 with ProtocolType

use of com.hazelcast.instance.ProtocolType in project hazelcast by hazelcast.

the class AdvancedNetworkStatsIntegrationTest method assertNonMemberNetworkStatsAreZeroFromMetrics.

private void assertNonMemberNetworkStatsAreZeroFromMetrics(HazelcastInstance instance) {
    for (ProtocolType protocolType : ProtocolType.values()) {
        if (protocolType != MEMBER) {
            assertEquals(0, getBytesReceivedFromMetrics(instance, protocolType));
            assertEquals(0, getBytesSentFromMetrics(instance, protocolType));
        }
    }
}
Also used : ProtocolType(com.hazelcast.instance.ProtocolType)

Example 10 with ProtocolType

use of com.hazelcast.instance.ProtocolType in project hazelcast by hazelcast.

the class AdvancedNetworkStatsIntegrationTest method assertAllNetworkStatsNotRegisteredAsMetrics.

private void assertAllNetworkStatsNotRegisteredAsMetrics(HazelcastInstance instance) {
    MetricsRegistry registry = getNode(instance).nodeEngine.getMetricsRegistry();
    for (ProtocolType protocolType : ProtocolType.values()) {
        assertNotContains(registry.getNames(), "tcp.bytesReceived." + protocolType.name());
        assertNotContains(registry.getNames(), "tcp.bytesSend." + protocolType.name());
    }
}
Also used : MetricsRegistry(com.hazelcast.internal.metrics.MetricsRegistry) ProtocolType(com.hazelcast.instance.ProtocolType)

Aggregations

ProtocolType (com.hazelcast.instance.ProtocolType)10 Address (com.hazelcast.cluster.Address)5 Collection (java.util.Collection)4 EndpointQualifier (com.hazelcast.instance.EndpointQualifier)3 EnumMap (java.util.EnumMap)3 ArrayList (java.util.ArrayList)2 Map (java.util.Map)2 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)2 EndpointConfig (com.hazelcast.config.EndpointConfig)1 InvalidConfigurationException (com.hazelcast.config.InvalidConfigurationException)1 ServerSocketEndpointConfig (com.hazelcast.config.ServerSocketEndpointConfig)1 WanBatchPublisherConfig (com.hazelcast.config.WanBatchPublisherConfig)1 WanReplicationConfig (com.hazelcast.config.WanReplicationConfig)1 JsonArray (com.hazelcast.internal.json.JsonArray)1 JsonObject (com.hazelcast.internal.json.JsonObject)1 JsonValue (com.hazelcast.internal.json.JsonValue)1 ClientEndPointDTO (com.hazelcast.internal.management.dto.ClientEndPointDTO)1 ClusterHotRestartStatusDTO (com.hazelcast.internal.management.dto.ClusterHotRestartStatusDTO)1 MetricsRegistry (com.hazelcast.internal.metrics.MetricsRegistry)1 SerializationUtil.readCollection (com.hazelcast.internal.serialization.impl.SerializationUtil.readCollection)1