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));
}
}
}
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;
}
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;
}
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));
}
}
}
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());
}
}
Aggregations