public StreamResultFuture fetchAsync() { for (Map.Entry<String, Map.Entry<InetAddress, Collection<Range<Token>>>> entry : toFetch.entries()) { String keyspace = entry.getKey(); InetAddress source = entry.getValue().getKey(); InetAddress preferred = SystemKeyspace.getPreferredIP(source); Collection<Range<Token>> ranges = entry.getValue().getValue(); /* Send messages to respective folks to stream data over to me */ if (logger.isDebugEnabled()) logger.debug("{}ing from {} ranges {}", description, source, StringUtils.join(ranges, ", ")); streamPlan.requestRanges(source, preferred, keyspace, ranges); } return streamPlan.execute(); } }
OutboundTcpConnectionPool(InetAddress remoteEp) { id = remoteEp; resetEndpoint = SystemKeyspace.getPreferredIP(remoteEp); started = new CountDownLatch(1); cmdCon = new OutboundTcpConnection(this); ackCon = new OutboundTcpConnection(this); }
OutboundTcpConnectionPool(InetAddress remoteEp, BackPressureState backPressureState) { id = remoteEp; resetEndpoint = SystemKeyspace.getPreferredIP(remoteEp); started = new CountDownLatch(1); smallMessages = new OutboundTcpConnection(this, "Small"); largeMessages = new OutboundTcpConnection(this, "Large"); gossipMessages = new OutboundTcpConnection(this, "Gossip"); this.backPressureState = backPressureState; }
public StreamResultFuture fetchAsync() { for (Map.Entry<String, Map.Entry<InetAddress, Collection<Range<Token>>>> entry : toFetch.entries()) { String keyspace = entry.getKey(); InetAddress source = entry.getValue().getKey(); InetAddress preferred = SystemKeyspace.getPreferredIP(source); Collection<Range<Token>> ranges = entry.getValue().getValue(); // filter out already streamed ranges Set<Range<Token>> availableRanges = stateStore.getAvailableRanges(keyspace, StorageService.instance.getTokenMetadata().partitioner); if (ranges.removeAll(availableRanges)) { logger.info("Some ranges of {} are already available. Skipping streaming those ranges.", availableRanges); } if (logger.isTraceEnabled()) logger.trace("{}ing from {} ranges {}", description, source, StringUtils.join(ranges, ", ")); /* Send messages to respective folks to stream data over to me */ streamPlan.requestRanges(source, preferred, keyspace, ranges); } return streamPlan.execute(); } }
public StreamResultFuture fetchAsync() { for (Map.Entry<String, Map.Entry<InetAddress, Collection<Range<Token>>>> entry : toFetch.entries()) { String keyspace = entry.getKey(); InetAddress source = entry.getValue().getKey(); InetAddress preferred = SystemKeyspace.getPreferredIP(source); Collection<Range<Token>> ranges = entry.getValue().getValue(); // filter out already streamed ranges Set<Range<Token>> availableRanges = stateStore.getAvailableRanges(keyspace, StorageService.instance.getTokenMetadata().partitioner); if (ranges.removeAll(availableRanges)) { logger.info("Some ranges of {} are already available. Skipping streaming those ranges.", availableRanges); } if (logger.isTraceEnabled()) logger.trace("{}ing from {} ranges {}", description, source, StringUtils.join(ranges, ", ")); /* Send messages to respective folks to stream data over to me */ streamPlan.requestRanges(source, preferred, keyspace, ranges); } return streamPlan.execute(); } }
OutboundTcpConnectionPool(InetAddress remoteEp, BackPressureState backPressureState) { id = remoteEp; resetEndpoint = SystemKeyspace.getPreferredIP(remoteEp); started = new CountDownLatch(1); smallMessages = new OutboundTcpConnection(this, "Small"); largeMessages = new OutboundTcpConnection(this, "Large"); gossipMessages = new OutboundTcpConnection(this, "Gossip"); this.backPressureState = backPressureState; }
public StreamResultFuture fetchAsync() { for (Map.Entry<String, Map.Entry<InetAddress, Collection<Range<Token>>>> entry : toFetch.entries()) { String keyspace = entry.getKey(); InetAddress source = entry.getValue().getKey(); InetAddress preferred = SystemKeyspace.getPreferredIP(source); Collection<Range<Token>> ranges = entry.getValue().getValue(); // filter out already streamed ranges Set<Range<Token>> availableRanges = stateStore.getAvailableRanges(keyspace, StorageService.instance.getTokenMetadata().partitioner); if (ranges.removeAll(availableRanges)) { logger.info("Some ranges of {} are already available. Skipping streaming those ranges.", availableRanges); } if (logger.isTraceEnabled()) logger.trace("{}ing from {} ranges {}", description, source, StringUtils.join(ranges, ", ")); /* Send messages to respective folks to stream data over to me */ streamPlan.requestRanges(source, preferred, keyspace, ranges); } return streamPlan.execute(); } }
OutboundTcpConnectionPool(InetAddress remoteEp, BackPressureState backPressureState) { id = remoteEp; resetEndpoint = SystemKeyspace.getPreferredIP(remoteEp); started = new CountDownLatch(1); smallMessages = new OutboundTcpConnection(this, "Small"); largeMessages = new OutboundTcpConnection(this, "Large"); gossipMessages = new OutboundTcpConnection(this, "Gossip"); this.backPressureState = backPressureState; }
InetAddress preferred = SystemKeyspace.getPreferredIP(newEndpoint);
InetAddress preferred = SystemKeyspace.getPreferredIP(newEndpoint);
InetAddress preferred = SystemKeyspace.getPreferredIP(newEndpoint);
private void initiateStreaming() { long repairedAt = ActiveRepairService.UNREPAIRED_SSTABLE; InetAddress dest = request.dst; InetAddress preferred = SystemKeyspace.getPreferredIP(dest); if (desc.parentSessionId != null && ActiveRepairService.instance.getParentRepairSession(desc.parentSessionId) != null) repairedAt = ActiveRepairService.instance.getParentRepairSession(desc.parentSessionId).repairedAt; logger.info(String.format("[streaming task #%s] Performing streaming repair of %d ranges with %s", desc.sessionId, request.ranges.size(), request.dst)); StreamResultFuture op = new StreamPlan("Repair", repairedAt, 1) .flushBeforeTransfer(true) // request ranges from the remote node .requestRanges(dest, preferred, desc.keyspace, request.ranges, desc.columnFamily) // send ranges to the remote node .transferRanges(dest, preferred, desc.keyspace, request.ranges, desc.columnFamily) .execute(); op.addEventListener(this); }
public void run() { InetAddress dest = request.dst; InetAddress preferred = SystemKeyspace.getPreferredIP(dest); logger.info("[streaming task #{}] Performing streaming repair of {} ranges with {}", desc.sessionId, request.ranges.size(), request.dst); boolean isIncremental = false; if (desc.parentSessionId != null) { ActiveRepairService.ParentRepairSession prs = ActiveRepairService.instance.getParentRepairSession(desc.parentSessionId); isIncremental = prs.isIncremental; } new StreamPlan("Repair", repairedAt, 1, false, isIncremental, false).listeners(this) .flushBeforeTransfer(true) // request ranges from the remote node .requestRanges(dest, preferred, desc.keyspace, request.ranges, desc.columnFamily) // send ranges to the remote node .transferRanges(dest, preferred, desc.keyspace, request.ranges, desc.columnFamily) .execute(); }
public void run() { InetAddress dest = request.dst; InetAddress preferred = SystemKeyspace.getPreferredIP(dest); logger.info("[streaming task #{}] Performing streaming repair of {} ranges with {}", desc.sessionId, request.ranges.size(), request.dst); boolean isIncremental = false; if (desc.parentSessionId != null) { ActiveRepairService.ParentRepairSession prs = ActiveRepairService.instance.getParentRepairSession(desc.parentSessionId); isIncremental = prs.isIncremental; } new StreamPlan("Repair", repairedAt, 1, false, isIncremental, false).listeners(this) .flushBeforeTransfer(true) // request ranges from the remote node .requestRanges(dest, preferred, desc.keyspace, request.ranges, desc.columnFamily) // send ranges to the remote node .transferRanges(dest, preferred, desc.keyspace, request.ranges, desc.columnFamily) .execute(); }
/** * Starts sending/receiving our list of differences to/from the remote endpoint: creates a callback * that will be called out of band once the streams complete. */ protected void startSync(List<Range<Token>> differences) { InetAddress local = FBUtilities.getBroadcastAddress(); // We can take anyone of the node as source or destination, however if one is localhost, we put at source to avoid a forwarding InetAddress dst = r2.endpoint.equals(local) ? r1.endpoint : r2.endpoint; InetAddress preferred = SystemKeyspace.getPreferredIP(dst); String message = String.format("Performing streaming repair of %d ranges with %s", differences.size(), dst); logger.info("[repair #{}] {}", desc.sessionId, message); boolean isIncremental = false; if (desc.parentSessionId != null) { ActiveRepairService.ParentRepairSession prs = ActiveRepairService.instance.getParentRepairSession(desc.parentSessionId); isIncremental = prs.isIncremental; } Tracing.traceRepair(message); StreamPlan plan = new StreamPlan("Repair", repairedAt, 1, false, isIncremental, false).listeners(this) .flushBeforeTransfer(true) // request ranges from the remote node .requestRanges(dst, preferred, desc.keyspace, differences, desc.columnFamily); if (!pullRepair) { // send ranges to the remote node if we are not performing a pull repair plan.transferRanges(dst, preferred, desc.keyspace, differences, desc.columnFamily); } plan.execute(); }
public void run() { InetAddress dest = request.dst; InetAddress preferred = SystemKeyspace.getPreferredIP(dest); logger.info("[streaming task #{}] Performing streaming repair of {} ranges with {}", desc.sessionId, request.ranges.size(), request.dst); boolean isIncremental = false; if (desc.parentSessionId != null) { ActiveRepairService.ParentRepairSession prs = ActiveRepairService.instance.getParentRepairSession(desc.parentSessionId); isIncremental = prs.isIncremental; } new StreamPlan("Repair", repairedAt, 1, false, isIncremental, false).listeners(this) .flushBeforeTransfer(true) // request ranges from the remote node .requestRanges(dest, preferred, desc.keyspace, request.ranges, desc.columnFamily) // send ranges to the remote node .transferRanges(dest, preferred, desc.keyspace, request.ranges, desc.columnFamily) .execute(); }
/** * Starts sending/receiving our list of differences to/from the remote endpoint: creates a callback * that will be called out of band once the streams complete. */ protected void startSync(List<Range<Token>> differences) { InetAddress local = FBUtilities.getBroadcastAddress(); // We can take anyone of the node as source or destination, however if one is localhost, we put at source to avoid a forwarding InetAddress dst = r2.endpoint.equals(local) ? r1.endpoint : r2.endpoint; InetAddress preferred = SystemKeyspace.getPreferredIP(dst); String message = String.format("Performing streaming repair of %d ranges with %s", differences.size(), dst); logger.info("[repair #{}] {}", desc.sessionId, message); boolean isIncremental = false; if (desc.parentSessionId != null) { ActiveRepairService.ParentRepairSession prs = ActiveRepairService.instance.getParentRepairSession(desc.parentSessionId); isIncremental = prs.isIncremental; } Tracing.traceRepair(message); StreamPlan plan = new StreamPlan("Repair", repairedAt, 1, false, isIncremental, false).listeners(this) .flushBeforeTransfer(true) // request ranges from the remote node .requestRanges(dst, preferred, desc.keyspace, differences, desc.columnFamily); if (!pullRepair) { // send ranges to the remote node if we are not performing a pull repair plan.transferRanges(dst, preferred, desc.keyspace, differences, desc.columnFamily); } plan.execute(); }
InetAddress preferred = SystemKeyspace.getPreferredIP(source); Collection<Range<Token>> ranges = entry.getValue(); if (logger.isDebugEnabled())
/** * Starts sending/receiving our list of differences to/from the remote endpoint: creates a callback * that will be called out of band once the streams complete. */ protected void startSync(List<Range<Token>> differences) { InetAddress local = FBUtilities.getBroadcastAddress(); // We can take anyone of the node as source or destination, however if one is localhost, we put at source to avoid a forwarding InetAddress dst = r2.endpoint.equals(local) ? r1.endpoint : r2.endpoint; InetAddress preferred = SystemKeyspace.getPreferredIP(dst); String message = String.format("Performing streaming repair of %d ranges with %s", differences.size(), dst); logger.info("[repair #{}] {}", desc.sessionId, message); boolean isIncremental = false; if (desc.parentSessionId != null) { ActiveRepairService.ParentRepairSession prs = ActiveRepairService.instance.getParentRepairSession(desc.parentSessionId); isIncremental = prs.isIncremental; } Tracing.traceRepair(message); StreamPlan plan = new StreamPlan("Repair", repairedAt, 1, false, isIncremental, false).listeners(this) .flushBeforeTransfer(true) // request ranges from the remote node .requestRanges(dst, preferred, desc.keyspace, differences, desc.columnFamily); if (!pullRepair) { // send ranges to the remote node if we are not performing a pull repair plan.transferRanges(dst, preferred, desc.keyspace, differences, desc.columnFamily); } plan.execute(); }
InetAddress preferred = SystemKeyspace.getPreferredIP(hintsDestinationHost);