/** * Add a new received tree and return the number of remaining tree to * be received for the job to be complete. * * Callers may assume exactly one addTree call will result in zero remaining endpoints. * * @param endpoint address of the endpoint that sent response * @param tree sent Merkle tree or null if validation failed on endpoint * @return the number of responses waiting to receive */ public synchronized int addTree(InetAddress endpoint, MerkleTree tree) { // Wait for all request to have been performed (see #3400) try { requestsSent.await(); } catch (InterruptedException e) { throw new AssertionError("Interrupted while waiting for requests to be sent"); } if (tree == null) failed = true; else trees.add(new TreeResponse(endpoint, tree)); return treeRequests.completed(endpoint); }
/** * Receive MerkleTrees from replica node. * * @param trees MerkleTrees that is sent from replica. Null if validation failed on replica node. */ public void treesReceived(MerkleTrees trees) { if (trees == null) { setException(new RepairException(desc, "Validation failed in " + endpoint)); } else { set(new TreeResponse(endpoint, trees)); } } }
/** * Receive MerkleTrees from replica node. * * @param trees MerkleTrees that is sent from replica. Null if validation failed on replica node. */ public void treesReceived(MerkleTrees trees) { if (trees == null) { setException(new RepairException(desc, "Validation failed in " + endpoint)); } else { set(new TreeResponse(endpoint, trees)); } } }
/** * Receive MerkleTrees from replica node. * * @param trees MerkleTrees that is sent from replica. Null if validation failed on replica node. */ public void treesReceived(MerkleTrees trees) { if (trees == null) { setException(new RepairException(desc, "Validation failed in " + endpoint)); } else { set(new TreeResponse(endpoint, trees)); } } }