@Override public void waveletCommitted(WaveletName waveletName, HashedVersion version, ImmutableSet<String> domainsToNotify) { for (WaveBus.Subscriber s : subscribers) { try { s.waveletCommitted(waveletName, version); } catch (RuntimeException e) { LOG.severe("Runtime exception in commit to wave bus subscriber " + s, e); } } Set<String> remoteDomainsToNotify = Sets.difference(domainsToNotify, localDomains); if (!remoteDomainsToNotify.isEmpty()) { ProtocolHashedVersion serializedVersion = CoreWaveletOperationSerializer.serialize(version); for (String domain : remoteDomainsToNotify) { try { federationHosts.get(domain).waveletCommitUpdate( waveletName, serializedVersion, federationCallback("commit notice")); } catch (ExecutionException ex) { throw new RuntimeException(ex); } } } }
@Override public void waveletUpdate(ReadableWaveletData wavelet, ImmutableList<WaveletDeltaRecord> deltas, ImmutableSet<String> domainsToNotify) { DeltaSequence sequence = DeltaSequence.of(transformedDeltasOf(deltas)); for (WaveBus.Subscriber s : subscribers) { try { s.waveletUpdate(wavelet, sequence); } catch (RuntimeException e) { LOG.severe("Runtime exception in update to wave bus subscriber " + s, e); } } Set<String> remoteDomainsToNotify = Sets.difference(domainsToNotify, localDomains); if (!remoteDomainsToNotify.isEmpty()) { ImmutableList<ByteString> serializedAppliedDeltas = serializedAppliedDeltasOf(deltas); for (String domain : remoteDomainsToNotify) { try { federationHosts.get(domain).waveletDeltaUpdate(WaveletDataUtil.waveletNameOf(wavelet), serializedAppliedDeltas, federationCallback("delta update")); } catch (ExecutionException ex) { throw new RuntimeException(ex); } } } }