use of org.apache.ignite.internal.tx.TxManager in project ignite-3 by apache.
the class ItTxDistributedTestSingleNode method after.
/**
* Shutdowns all cluster nodes after each test.
*
* @throws Exception If failed.
*/
@AfterEach
public void after() throws Exception {
cluster.parallelStream().map(c -> {
c.stop();
return null;
}).forEach(o -> {
});
if (client != null) {
client.stop();
}
IgniteUtils.shutdownAndAwaitTermination(executor, 10, TimeUnit.SECONDS);
for (Loza rs : raftServers.values()) {
Set<String> grps = rs.startedGroups();
for (String grp : grps) {
rs.stopRaftGroup(grp);
}
rs.stop();
}
for (TxManager txMgr : txManagers.values()) {
txMgr.stop();
}
for (RaftGroupService svc : accRaftClients.values()) {
svc.shutdown();
}
for (RaftGroupService svc : custRaftClients.values()) {
svc.shutdown();
}
}
use of org.apache.ignite.internal.tx.TxManager in project ignite-3 by apache.
the class ItTxDistributedTestSingleNode method txManager.
/**
* {@inheritDoc}
*/
@Override
protected TxManager txManager(Table t) {
Int2ObjectOpenHashMap<RaftGroupService> clients = null;
if (t == accounts) {
clients = accRaftClients;
} else if (t == customers) {
clients = custRaftClients;
} else {
fail("Unknown table " + t.name());
}
TxManager manager = txManagers.get(clients.get(0).clusterService().topologyService().getByAddress(clients.get(0).leader().address()));
assertNotNull(manager);
return manager;
}
Aggregations