use of com.hazelcast.spi.properties.HazelcastProperties in project hazelcast by hazelcast.
the class ProxyManager method getRetryCountLimit.
private long getRetryCountLimit() {
HazelcastProperties hazelcastProperties = client.getProperties();
int waitTime = hazelcastProperties.getSeconds(INVOCATION_TIMEOUT_SECONDS);
long retryTimeoutInSeconds = waitTime > 0 ? waitTime : Integer.parseInt(INVOCATION_TIMEOUT_SECONDS.getDefaultValue());
return retryTimeoutInSeconds / ClientInvocation.RETRY_WAIT_TIME_IN_SECONDS;
}
use of com.hazelcast.spi.properties.HazelcastProperties in project hazelcast by hazelcast.
the class CacheEventHandler method createInvalidator.
private Invalidator createInvalidator() {
HazelcastProperties hazelcastProperties = nodeEngine.getProperties();
int batchSize = hazelcastProperties.getInteger(CACHE_INVALIDATION_MESSAGE_BATCH_SIZE);
int batchFrequencySeconds = hazelcastProperties.getInteger(CACHE_INVALIDATION_MESSAGE_BATCH_FREQUENCY_SECONDS);
boolean batchingEnabled = hazelcastProperties.getBoolean(CACHE_INVALIDATION_MESSAGE_BATCH_ENABLED) && batchSize > 1;
if (batchingEnabled) {
return new BatchInvalidator(SERVICE_NAME, batchSize, batchFrequencySeconds, TRUE_FILTER, nodeEngine);
} else {
return new NonStopInvalidator(SERVICE_NAME, TRUE_FILTER, nodeEngine);
}
}
use of com.hazelcast.spi.properties.HazelcastProperties in project hazelcast by hazelcast.
the class PartitionContainer method createRecordStore.
private RecordStore createRecordStore(String name) {
MapServiceContext serviceContext = mapService.getMapServiceContext();
MapContainer mapContainer = serviceContext.getMapContainer(name);
MapConfig mapConfig = mapContainer.getMapConfig();
NodeEngine nodeEngine = serviceContext.getNodeEngine();
IPartitionService ps = nodeEngine.getPartitionService();
OperationService opService = nodeEngine.getOperationService();
ExecutionService execService = nodeEngine.getExecutionService();
HazelcastProperties hazelcastProperties = nodeEngine.getProperties();
MapKeyLoader keyLoader = new MapKeyLoader(name, opService, ps, nodeEngine.getClusterService(), execService, mapContainer.toData());
keyLoader.setMaxBatch(hazelcastProperties.getInteger(GroupProperty.MAP_LOAD_CHUNK_SIZE));
keyLoader.setMaxSize(getMaxSizePerNode(mapConfig.getMaxSizeConfig()));
keyLoader.setHasBackup(mapConfig.getTotalBackupCount() > 0);
keyLoader.setMapOperationProvider(serviceContext.getMapOperationProvider(name));
RecordStore recordStore = serviceContext.createRecordStore(mapContainer, partitionId, keyLoader);
recordStore.init();
return recordStore;
}
use of com.hazelcast.spi.properties.HazelcastProperties in project hazelcast by hazelcast.
the class ClientExecutionServiceImplTest method setUp.
@BeforeClass
public static void setUp() {
String name = "ClientExecutionServiceImplTest";
ThreadGroup threadGroup = new ThreadGroup(name);
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
HazelcastProperties properties = new HazelcastProperties(new Config());
ClientLoggingService loggingService = new ClientLoggingService(name, "jdk", BuildInfoProvider.BUILD_INFO, name);
executionService = new ClientExecutionServiceImpl(name, threadGroup, classLoader, properties, 1, loggingService);
}
use of com.hazelcast.spi.properties.HazelcastProperties in project hazelcast by hazelcast.
the class QueryResultSizeLimiterTest method initMocksWithConfiguration.
private void initMocksWithConfiguration(int maxResultSizeLimit, int maxLocalPartitionLimitForPreCheck, int partitionCount) {
Config config = new Config();
config.setProperty(QUERY_RESULT_SIZE_LIMIT.getName(), valueOf(maxResultSizeLimit));
config.setProperty(QUERY_MAX_LOCAL_PARTITION_LIMIT_FOR_PRE_CHECK.getName(), valueOf(maxLocalPartitionLimitForPreCheck));
config.setProperty(PARTITION_COUNT.getName(), valueOf(partitionCount));
HazelcastProperties hazelcastProperties = new HazelcastProperties(config);
InternalPartitionService partitionService = mock(InternalPartitionService.class);
when(partitionService.getPartitionCount()).thenReturn(partitionCount);
NodeEngine nodeEngine = mock(NodeEngine.class);
when(nodeEngine.getProperties()).thenReturn(hazelcastProperties);
when(nodeEngine.getPartitionService()).thenReturn(partitionService);
RecordStore recordStore = mock(RecordStore.class);
when(recordStore.size()).then(new RecordStoreAnswer(localPartitions.values()));
MapServiceContext mapServiceContext = mock(MapServiceContext.class);
when(mapServiceContext.getNodeEngine()).thenReturn(nodeEngine);
when(mapServiceContext.getRecordStore(anyInt(), anyString())).thenReturn(recordStore);
when(mapServiceContext.getOwnedPartitions()).thenReturn(localPartitions.keySet());
limiter = new QueryResultSizeLimiter(mapServiceContext, Logger.getLogger(QueryResultSizeLimiterTest.class));
}
Aggregations