| | |
| | | public void put(UpdateMsg update, ServerHandler sourceHandler) |
| | | throws IOException |
| | | { |
| | | CSN csn = update.getCSN(); |
| | | int serverId = csn.getServerId(); |
| | | |
| | | sourceHandler.updateServerState(update); |
| | | sourceHandler.incrementInCount(); |
| | | setGenerationIdIfUnset(sourceHandler.getGenerationId()); |
| | |
| | | } |
| | | } |
| | | |
| | | if (!publishUpdateMsg(update, serverId)) |
| | | if (!publishUpdateMsg(update)) |
| | | { |
| | | return; |
| | | } |
| | |
| | | // The following timer will time out and send an timeout ack to the |
| | | // requester if the acks are not received in time. The timer will also |
| | | // remove the object from this map. |
| | | CSN csn = update.getCSN(); |
| | | waitingAcks.put(csn, preparedAssuredInfo.expectedAcksInfo); |
| | | |
| | | // Arm timer for this assured update message (wait for acks until it |
| | |
| | | } |
| | | } |
| | | |
| | | private boolean publishUpdateMsg(UpdateMsg updateMsg, int serverId) |
| | | private boolean publishUpdateMsg(UpdateMsg updateMsg) |
| | | { |
| | | try |
| | | { |
| | | if (this.domainDB.publishUpdateMsg(baseDN, serverId, updateMsg)) |
| | | if (this.domainDB.publishUpdateMsg(baseDN, updateMsg)) |
| | | { |
| | | /* |
| | | * JNR: Matt and I had a hard time figuring out where to put this |
| | |
| | | * |
| | | * @param baseDN |
| | | * the replication domain baseDN |
| | | * @param serverId |
| | | * the serverId on which to act |
| | | * @param updateMsg |
| | | * the update message to publish to the replicaDB |
| | | * @return true if a db had to be created to publish this message |
| | | * @throws ChangelogException |
| | | * If a database problem happened |
| | | */ |
| | | boolean publishUpdateMsg(DN baseDN, int serverId, UpdateMsg updateMsg) |
| | | boolean publishUpdateMsg(DN baseDN, UpdateMsg updateMsg) |
| | | throws ChangelogException; |
| | | |
| | | } |
| | |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean publishUpdateMsg(DN baseDN, int serverId, |
| | | UpdateMsg updateMsg) throws ChangelogException |
| | | public boolean publishUpdateMsg(DN baseDN, UpdateMsg updateMsg) |
| | | throws ChangelogException |
| | | { |
| | | final Pair<JEReplicaDB, Boolean> pair = |
| | | getOrCreateReplicaDB(baseDN, serverId, replicationServer); |
| | | final Pair<JEReplicaDB, Boolean> pair = getOrCreateReplicaDB(baseDN, |
| | | updateMsg.getCSN().getServerId(), replicationServer); |
| | | final JEReplicaDB replicaDB = pair.getFirst(); |
| | | final boolean wasCreated = pair.getSecond(); |
| | | |