use of com.hazelcast.spi.properties.HazelcastProperties in project hazelcast by hazelcast.
the class OperationExecutorImpl_AbstractTest method setup.
@Before
public void setup() throws Exception {
loggingService = new LoggingServiceImpl("foo", "jdk", new BuildInfo("1", "1", "1", 1, false, (byte) 1, "1"), true, null);
serializationService = new DefaultSerializationServiceBuilder().build();
config = smallInstanceConfig();
thisAddress = new Address("localhost", 5701);
Node node = Mockito.mock(Node.class);
when(node.getConfig()).thenReturn(config);
when(node.getProperties()).thenReturn(new HazelcastProperties(config));
when(node.getVersion()).thenReturn(new MemberVersion(0, 0, 0));
nodeExtension = new DefaultNodeExtension(node);
handlerFactory = new DummyOperationRunnerFactory();
responsePacketConsumer = new DummyResponsePacketConsumer();
}
use of com.hazelcast.spi.properties.HazelcastProperties in project hazelcast by hazelcast.
the class OperationExecutorImpl_AbstractTest method initExecutor.
protected OperationExecutorImpl initExecutor() {
props = new HazelcastProperties(config);
executor = new OperationExecutorImpl(props, loggingService, thisAddress, handlerFactory, nodeExtension, "hzName", Thread.currentThread().getContextClassLoader());
executor.start();
return executor;
}
use of com.hazelcast.spi.properties.HazelcastProperties in project hazelcast by hazelcast.
the class OperationExecutorImpl_ExecuteBatchTest method newPartitions.
private BitSet newPartitions() {
HazelcastProperties properties = new HazelcastProperties(config);
BitSet bitSet = new BitSet(properties.getInteger(PARTITION_COUNT));
for (int k = 0; k < bitSet.size(); k++) {
bitSet.set(k);
}
return bitSet;
}
use of com.hazelcast.spi.properties.HazelcastProperties in project hazelcast by hazelcast.
the class QueryResultSizeLimiterTest method initMocksWithConfiguration.
private void initMocksWithConfiguration(int maxResultSizeLimit, int maxLocalPartitionLimitForPreCheck) {
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(ClusterProperty.PARTITION_COUNT.getName(), valueOf(PARTITION_COUNT));
HazelcastProperties hazelcastProperties = new HazelcastProperties(config);
InternalPartitionService partitionService = mock(InternalPartitionService.class);
when(partitionService.getPartitionCount()).thenReturn(PARTITION_COUNT);
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.getOrInitCachedMemberPartitions()).thenReturn(new PartitionIdSet(PARTITION_COUNT, localPartitions.keySet()));
limiter = new QueryResultSizeLimiter(mapServiceContext, Logger.getLogger(QueryResultSizeLimiterTest.class));
}
use of com.hazelcast.spi.properties.HazelcastProperties in project hazelcast by hazelcast.
the class QueryBasicTest method testPredicatedEvaluatedSingleThreadedByDefault.
@Test
public void testPredicatedEvaluatedSingleThreadedByDefault() {
Config config = getConfig();
HazelcastProperties properties = new HazelcastProperties(config);
boolean parallelEvaluation = properties.getBoolean(ClusterProperty.QUERY_PREDICATE_PARALLEL_EVALUATION);
assertFalse(parallelEvaluation);
}
Aggregations