public SyncComplete(RepairJobDesc desc, InetAddress endpoint1, InetAddress endpoint2, boolean success) { super(Type.SYNC_COMPLETE, desc); this.nodes = new NodePair(endpoint1, endpoint2); this.success = success; }
@Override public boolean equals(Object o) { if (!(o instanceof SyncComplete)) return false; SyncComplete other = (SyncComplete)o; return messageType == other.messageType && desc.equals(other.desc) && success == other.success && nodes.equals(other.nodes); }
public SyncComplete(RepairJobDesc desc, InetAddress endpoint1, InetAddress endpoint2, boolean success) { super(Type.SYNC_COMPLETE, desc); this.nodes = new NodePair(endpoint1, endpoint2); this.success = success; }
@Override public boolean equals(Object o) { if (!(o instanceof SyncComplete)) return false; SyncComplete other = (SyncComplete)o; return messageType == other.messageType && desc.equals(other.desc) && success == other.success && nodes.equals(other.nodes); }
public SyncComplete(RepairJobDesc desc, InetAddress endpoint1, InetAddress endpoint2, boolean success) { super(Type.SYNC_COMPLETE, desc); this.nodes = new NodePair(endpoint1, endpoint2); this.success = success; }
@Override public boolean equals(Object o) { if (!(o instanceof SyncComplete)) return false; SyncComplete other = (SyncComplete)o; return messageType == other.messageType && desc.equals(other.desc) && success == other.success && nodes.equals(other.nodes); }
public SyncComplete(RepairJobDesc desc, InetAddress endpoint1, InetAddress endpoint2, boolean success) { super(Type.SYNC_COMPLETE, desc); this.nodes = new NodePair(endpoint1, endpoint2); this.success = success; }
public NodePair deserialize(DataInputPlus in, int version) throws IOException { InetAddress ep1 = CompactEndpointSerializationHelper.deserialize(in); InetAddress ep2 = CompactEndpointSerializationHelper.deserialize(in); return new NodePair(ep1, ep2); }
public NodePair deserialize(DataInputPlus in, int version) throws IOException { InetAddress ep1 = CompactEndpointSerializationHelper.deserialize(in); InetAddress ep2 = CompactEndpointSerializationHelper.deserialize(in); return new NodePair(ep1, ep2); }
public NodePair deserialize(DataInputPlus in, int version) throws IOException { InetAddress ep1 = CompactEndpointSerializationHelper.deserialize(in); InetAddress ep2 = CompactEndpointSerializationHelper.deserialize(in); return new NodePair(ep1, ep2); }
public NodePair deserialize(DataInput in, int version) throws IOException { InetAddress ep1 = CompactEndpointSerializationHelper.deserialize(in); InetAddress ep2 = CompactEndpointSerializationHelper.deserialize(in); return new NodePair(ep1, ep2); }
/** * Compares trees, and triggers repairs for any ranges that mismatch. */ public void run() { // compare trees, and collect differences List<Range<Token>> differences = MerkleTrees.difference(r1.trees, r2.trees); stat = new SyncStat(new NodePair(r1.endpoint, r2.endpoint), differences.size()); // choose a repair method based on the significance of the difference String format = String.format("[repair #%s] Endpoints %s and %s %%s for %s", desc.sessionId, r1.endpoint, r2.endpoint, desc.columnFamily); if (differences.isEmpty()) { logger.info(String.format(format, "are consistent")); Tracing.traceRepair("Endpoint {} is consistent with {} for {}", r1.endpoint, r2.endpoint, desc.columnFamily); set(stat); return; } // non-0 difference: perform streaming repair logger.info(String.format(format, "have " + differences.size() + " range(s) out of sync")); Tracing.traceRepair("Endpoint {} has {} range(s) out of sync with {} for {}", r1.endpoint, differences.size(), r2.endpoint, desc.columnFamily); startSync(differences); }
/** * Compares trees, and triggers repairs for any ranges that mismatch. */ public void run() { // compare trees, and collect differences List<Range<Token>> differences = MerkleTrees.difference(r1.trees, r2.trees); stat = new SyncStat(new NodePair(r1.endpoint, r2.endpoint), differences.size()); // choose a repair method based on the significance of the difference String format = String.format("[repair #%s] Endpoints %s and %s %%s for %s", desc.sessionId, r1.endpoint, r2.endpoint, desc.columnFamily); if (differences.isEmpty()) { logger.info(String.format(format, "are consistent")); Tracing.traceRepair("Endpoint {} is consistent with {} for {}", r1.endpoint, r2.endpoint, desc.columnFamily); set(stat); return; } // non-0 difference: perform streaming repair logger.info(String.format(format, "have " + differences.size() + " range(s) out of sync")); Tracing.traceRepair("Endpoint {} has {} range(s) out of sync with {} for {}", r1.endpoint, differences.size(), r2.endpoint, desc.columnFamily); startSync(differences); }
/** * Compares trees, and triggers repairs for any ranges that mismatch. */ public void run() { // compare trees, and collect differences List<Range<Token>> differences = MerkleTrees.difference(r1.trees, r2.trees); stat = new SyncStat(new NodePair(r1.endpoint, r2.endpoint), differences.size()); // choose a repair method based on the significance of the difference String format = String.format("[repair #%s] Endpoints %s and %s %%s for %s", desc.sessionId, r1.endpoint, r2.endpoint, desc.columnFamily); if (differences.isEmpty()) { logger.info(String.format(format, "are consistent")); Tracing.traceRepair("Endpoint {} is consistent with {} for {}", r1.endpoint, r2.endpoint, desc.columnFamily); set(stat); return; } // non-0 difference: perform streaming repair logger.info(String.format(format, "have " + differences.size() + " range(s) out of sync")); Tracing.traceRepair("Endpoint {} has {} range(s) out of sync with {} for {}", r1.endpoint, differences.size(), r2.endpoint, desc.columnFamily); startSync(differences); }
public ListenableFuture<List<SyncStat>> apply(List<TreeResponse> trees) { InetAddress local = FBUtilities.getLocalAddress(); List<SyncTask> syncTasks = new ArrayList<>(); // We need to difference all trees one against another for (int i = 0; i < trees.size() - 1; ++i) { TreeResponse r1 = trees.get(i); for (int j = i + 1; j < trees.size(); ++j) { TreeResponse r2 = trees.get(j); SyncTask task; if (r1.endpoint.equals(local) || r2.endpoint.equals(local)) { task = new LocalSyncTask(desc, r1, r2, repairedAt, session.pullRepair); } else { task = new RemoteSyncTask(desc, r1, r2); // RemoteSyncTask expects SyncComplete message sent back. // Register task to RepairSession to receive response. session.waitForSync(Pair.create(desc, new NodePair(r1.endpoint, r2.endpoint)), (RemoteSyncTask) task); } syncTasks.add(task); taskExecutor.submit(task); } } return Futures.allAsList(syncTasks); } }, taskExecutor);
public ListenableFuture<List<SyncStat>> apply(List<TreeResponse> trees) { InetAddress local = FBUtilities.getLocalAddress(); List<SyncTask> syncTasks = new ArrayList<>(); // We need to difference all trees one against another for (int i = 0; i < trees.size() - 1; ++i) { TreeResponse r1 = trees.get(i); for (int j = i + 1; j < trees.size(); ++j) { TreeResponse r2 = trees.get(j); SyncTask task; if (r1.endpoint.equals(local) || r2.endpoint.equals(local)) { task = new LocalSyncTask(desc, r1, r2, repairedAt, session.pullRepair); } else { task = new RemoteSyncTask(desc, r1, r2); // RemoteSyncTask expects SyncComplete message sent back. // Register task to RepairSession to receive response. session.waitForSync(Pair.create(desc, new NodePair(r1.endpoint, r2.endpoint)), (RemoteSyncTask) task); } syncTasks.add(task); taskExecutor.submit(task); } } return Futures.allAsList(syncTasks); } }, taskExecutor);
public ListenableFuture<List<SyncStat>> apply(List<TreeResponse> trees) { InetAddress local = FBUtilities.getLocalAddress(); List<SyncTask> syncTasks = new ArrayList<>(); // We need to difference all trees one against another for (int i = 0; i < trees.size() - 1; ++i) { TreeResponse r1 = trees.get(i); for (int j = i + 1; j < trees.size(); ++j) { TreeResponse r2 = trees.get(j); SyncTask task; if (r1.endpoint.equals(local) || r2.endpoint.equals(local)) { task = new LocalSyncTask(desc, r1, r2, repairedAt, session.pullRepair); } else { task = new RemoteSyncTask(desc, r1, r2); // RemoteSyncTask expects SyncComplete message sent back. // Register task to RepairSession to receive response. session.waitForSync(Pair.create(desc, new NodePair(r1.endpoint, r2.endpoint)), (RemoteSyncTask) task); } syncTasks.add(task); taskExecutor.submit(task); } } return Futures.allAsList(syncTasks); } }, taskExecutor);