use of com.hazelcast.spi.impl.sequence.CallIdSequence in project hazelcast by hazelcast.
the class BackpressureRegulatorTest method newCallIdSequence_whenBackPressureDisabled.
@Test
public void newCallIdSequence_whenBackPressureDisabled() {
Config config = new Config();
config.setProperty(BACKPRESSURE_ENABLED.getName(), "false");
HazelcastProperties hazelcastProperties = new HazelcastProperties(config);
BackpressureRegulator backpressureRegulator = new BackpressureRegulator(hazelcastProperties, logger);
CallIdSequence callIdSequence = backpressureRegulator.newCallIdSequence(ConcurrencyDetection.createDisabled());
assertInstanceOf(CallIdSequenceWithoutBackpressure.class, callIdSequence);
}
use of com.hazelcast.spi.impl.sequence.CallIdSequence in project hazelcast by hazelcast.
the class ClientDelegatingFuture_SerializationExceptionTest method setup.
@Before
public void setup() {
serializationService = new DefaultSerializationServiceBuilder().build();
key = serializationService.toData("key");
value = invalidData;
logger = mock(ILogger.class);
request = MapGetCodec.encodeRequest("test", key, 1L);
response = MapGetCodec.encodeResponse(value);
callIdSequence = mock(CallIdSequence.class);
invocationFuture = new ClientInvocationFuture(mock(ClientInvocation.class), request, logger, callIdSequence);
invocationFuture.complete(response);
delegatingFuture = new ClientDelegatingFuture<>(invocationFuture, serializationService, MapGetCodec::decodeResponse, true);
}
use of com.hazelcast.spi.impl.sequence.CallIdSequence in project hazelcast by hazelcast.
the class ClientDelegatingFutureTest method setup.
@Before
public void setup() {
serializationService = new DefaultSerializationServiceBuilder().build();
key = serializationService.toData("key");
value = serializationService.toData(DESERIALIZED_VALUE);
logger = mock(ILogger.class);
request = MapGetCodec.encodeRequest("test", key, 1L);
response = MapGetCodec.encodeResponse(value);
callIdSequence = mock(CallIdSequence.class);
invocationFuture = new ClientInvocationFuture(mock(ClientInvocation.class), request, logger, callIdSequence);
delegatingFuture = new ClientDelegatingFuture<>(invocationFuture, serializationService, MapGetCodec::decodeResponse, true);
}
use of com.hazelcast.spi.impl.sequence.CallIdSequence in project hazelcast by hazelcast.
the class BackpressureRegulatorTest method newCallIdSequence_whenBackPressureEnabled.
// ========================== newCallIdSequence =================
@Test
public void newCallIdSequence_whenBackPressureEnabled() {
Config config = new Config();
config.setProperty(BACKPRESSURE_ENABLED.getName(), "true");
HazelcastProperties hazelcastProperties = new HazelcastProperties(config);
BackpressureRegulator backpressureRegulator = new BackpressureRegulator(hazelcastProperties, logger);
CallIdSequence callIdSequence = backpressureRegulator.newCallIdSequence(ConcurrencyDetection.createEnabled(100));
assertInstanceOf(CallIdSequenceWithBackpressure.class, callIdSequence);
assertEquals(backpressureRegulator.getMaxConcurrentInvocations(), callIdSequence.getMaxConcurrentInvocations());
}
use of com.hazelcast.spi.impl.sequence.CallIdSequence in project hazelcast by hazelcast.
the class BackpressureRegulatorTest method testWriteThroughDoesntEnableBackPressure.
@Test
public void testWriteThroughDoesntEnableBackPressure() {
Config config = new Config();
HazelcastProperties hazelcastProperties = new HazelcastProperties(config);
BackpressureRegulator regulator = new BackpressureRegulator(hazelcastProperties, logger);
CallIdSequence callIdSequence = regulator.newCallIdSequence(ConcurrencyDetection.createEnabled(1000));
assertEquals(Integer.MAX_VALUE, callIdSequence.getMaxConcurrentInvocations());
}
Aggregations