use of org.apache.ratis.conf.RaftProperties in project incubator-ratis by apache.
the class WatchRequestTests method setup.
@Before
public void setup() {
final RaftProperties p = getProperties();
p.setClass(MiniRaftCluster.STATEMACHINE_CLASS_KEY, SimpleStateMachine4Testing.class, StateMachine.class);
}
use of org.apache.ratis.conf.RaftProperties in project incubator-ratis by apache.
the class RaftAsyncTests method testAsyncConfiguration.
@Test
public void testAsyncConfiguration() throws IOException {
LOG.info("Running testAsyncConfiguration");
final RaftProperties properties = new RaftProperties();
RaftClientConfigKeys.Async.Experimental.setSendDummyRequest(properties, false);
RaftClient.Builder clientBuilder = RaftClient.newBuilder().setRaftGroup(RaftGroup.emptyGroup()).setProperties(properties);
int maxOutstandingRequests = RaftClientConfigKeys.Async.OUTSTANDING_REQUESTS_MAX_DEFAULT;
try (RaftClient client = clientBuilder.build()) {
RaftClientTestUtil.assertAsyncRequestSemaphore(client, maxOutstandingRequests, 0);
}
maxOutstandingRequests = 5;
RaftClientConfigKeys.Async.setOutstandingRequestsMax(properties, maxOutstandingRequests);
try (RaftClient client = clientBuilder.build()) {
RaftClientTestUtil.assertAsyncRequestSemaphore(client, maxOutstandingRequests, 0);
}
}
use of org.apache.ratis.conf.RaftProperties in project incubator-ratis by apache.
the class MessageStreamApiTests method testStreamAsync.
@Test
public void testStreamAsync() throws Exception {
final RaftProperties p = getProperties();
RaftClientConfigKeys.MessageStream.setSubmessageSize(p, SUBMESSAGE_SIZE);
p.setClass(MiniRaftCluster.STATEMACHINE_CLASS_KEY, SimpleStateMachine4Testing.class, StateMachine.class);
runWithNewCluster(NUM_SERVERS, this::runTestStreamAsync);
RaftClientConfigKeys.MessageStream.setSubmessageSize(p);
}
use of org.apache.ratis.conf.RaftProperties in project incubator-ratis by apache.
the class MessageStreamApiTests method testStream.
@Test
public void testStream() throws Exception {
final RaftProperties p = getProperties();
p.setClass(MiniRaftCluster.STATEMACHINE_CLASS_KEY, SimpleStateMachine4Testing.class, StateMachine.class);
runWithNewCluster(NUM_SERVERS, this::runTestStream);
}
Aggregations