use of com.hazelcast.spi.properties.HazelcastProperties in project hazelcast by hazelcast.
the class MapDataStores method newWriteBehindQueue.
private static WriteBehindQueue newWriteBehindQueue(MapServiceContext mapServiceContext, boolean writeCoalescing) {
HazelcastProperties hazelcastProperties = mapServiceContext.getNodeEngine().getProperties();
final int capacity = hazelcastProperties.getInteger(GroupProperty.MAP_WRITE_BEHIND_QUEUE_CAPACITY);
final AtomicInteger counter = mapServiceContext.getWriteBehindQueueItemCounter();
return (writeCoalescing ? createDefaultWriteBehindQueue() : createBoundedWriteBehindQueue(capacity, counter));
}
use of com.hazelcast.spi.properties.HazelcastProperties in project hazelcast by hazelcast.
the class ClientConnectionManagerImpl method initIOThreads.
protected void initIOThreads(HazelcastClientInstanceImpl client) {
HazelcastProperties properties = client.getProperties();
boolean directBuffer = properties.getBoolean(SOCKET_CLIENT_BUFFER_DIRECT);
SSLConfig sslConfig = client.getClientConfig().getNetworkConfig().getSSLConfig();
boolean sslEnabled = sslConfig != null && sslConfig.isEnabled();
int configuredInputThreads = properties.getInteger(ClientProperty.IO_INPUT_THREAD_COUNT);
int configuredOutputThreads = properties.getInteger(ClientProperty.IO_OUTPUT_THREAD_COUNT);
int inputThreads;
if (configuredInputThreads == -1) {
inputThreads = sslEnabled ? DEFAULT_SSL_THREAD_COUNT : 1;
} else {
inputThreads = configuredInputThreads;
}
int outputThreads;
if (configuredOutputThreads == -1) {
outputThreads = sslEnabled ? DEFAULT_SSL_THREAD_COUNT : 1;
} else {
outputThreads = configuredOutputThreads;
}
ioThreadingModel = new NonBlockingIOThreadingModel(client.getLoggingService(), client.getMetricsRegistry(), new HazelcastThreadGroup(client.getName(), logger, client.getClientConfig().getClassLoader()), outOfMemoryHandler, inputThreads, outputThreads, properties.getInteger(ClientProperty.IO_BALANCER_INTERVAL_SECONDS), new ClientSocketWriterInitializer(getBufferSize(), directBuffer), new ClientSocketReaderInitializer(getBufferSize(), directBuffer));
}
use of com.hazelcast.spi.properties.HazelcastProperties in project hazelcast by hazelcast.
the class DefaultAddressPickerTest method setup.
@Before
public void setup() throws UnknownHostException {
properties = new HazelcastProperties(config);
InetAddress publicAddress = null;
try {
loopback = InetAddress.getByName("127.0.0.1");
publicAddress = InetAddress.getByName(PUBLIC_HOST);
} catch (UnknownHostException e) {
e.printStackTrace();
}
assumeNotNull(loopback, publicAddress);
localAddressValue = System.getProperty(HAZELCAST_LOCAL_ADDRESS_PROP);
System.clearProperty(HAZELCAST_LOCAL_ADDRESS_PROP);
}
use of com.hazelcast.spi.properties.HazelcastProperties in project hazelcast by hazelcast.
the class AsyncInboundResponseHandlerTest method setup.
@Before
public void setup() {
ILogger logger = Logger.getLogger(getClass());
HazelcastThreadGroup threadGroup = new HazelcastThreadGroup("test", logger, getClass().getClassLoader());
responsePacketHandler = mock(PacketHandler.class);
asyncHandler = new AsyncInboundResponseHandler(threadGroup, logger, responsePacketHandler, new HazelcastProperties(new Config()));
asyncHandler.start();
serializationService = new DefaultSerializationServiceBuilder().build();
}
use of com.hazelcast.spi.properties.HazelcastProperties in project hazelcast by hazelcast.
the class MembershipManager method init.
/**
* Initializes the {@link MembershipManager}.
* It will schedule the member list publication to the {@link ClusterProperty#MEMBER_LIST_PUBLISH_INTERVAL_SECONDS} interval.
*/
void init() {
ExecutionService executionService = nodeEngine.getExecutionService();
HazelcastProperties hazelcastProperties = node.getProperties();
executionService.register(MASTERSHIP_CLAIM_EXECUTOR_NAME, 1, Integer.MAX_VALUE, ExecutorType.CACHED);
long memberListPublishInterval = hazelcastProperties.getSeconds(ClusterProperty.MEMBER_LIST_PUBLISH_INTERVAL_SECONDS);
memberListPublishInterval = (memberListPublishInterval > 0 ? memberListPublishInterval : 1);
executionService.scheduleWithRepetition(CLUSTER_EXECUTOR_NAME, this::publishMemberList, memberListPublishInterval, memberListPublishInterval, SECONDS);
}
Aggregations