-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
STORM-150: Replace jar distribution strategy with bittorrent #71
Closed
Closed
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
567f72a
add ttorrent BitTorrent client dependency to storm core
ptgoetz abe3414
Add bittorrent tracker and client code for use by nimbus and supervisor
ptgoetz dcb609a
change nimbus and supervisor to use bittorrent for jar file distribut…
ptgoetz f70022d
add bittorrent configuration defaults
ptgoetz 539cf33
revert some changes that got lost by a stash apply
ptgoetz 4a76e4c
add configuration values for bittorrent rate limits and seeding
ptgoetz 17f1acc
implement configurable bitorrent rate limits and seeding for nimbus/s…
ptgoetz 3b56e94
modify nimbus/supervisor to exchange all topology code (.jar, .ser) v…
ptgoetz bf5de3f
fix local mode supervisor
ptgoetz dec77b7
only start bittorrent tracker in distributed mode.
ptgoetz efd84a6
only start Nimbus bittorrent tracker in distributed mode.
ptgoetz 2209da9
address issues identified in #629 review.
ptgoetz 3b8059c
synchronize rebalanceRates() method and correct indentation.
ptgoetz 24ae037
Rename BaseTracker and SupervisorTracker to BasePeer and SupervisorPeer
ptgoetz 755bebf
organize imports
ptgoetz f784ef3
Rename BaseTracker, SupervisorTracker --> BasePeer, SupervisorPeer
ptgoetz ff79d6f
exclude log4j dependencies from ttorrent dependency
ptgoetz 6b85db9
Merge branch 'master' into bittorrent
ptgoetz 4df45cb
update dependencies and clojure code
ptgoetz cc56dac
fix for multilang resources being extracted to the wrong location
ptgoetz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package backtype.storm.torrent; | ||
|
||
import java.util.HashMap; | ||
|
||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
import com.turn.ttorrent.client.Client; | ||
|
||
public abstract class BasePeer { | ||
private static final Logger LOG = LoggerFactory.getLogger(BasePeer.class); | ||
|
||
protected HashMap<String, Client> clients = new HashMap<String, Client>(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is not very clear here what the key is to the clients. Could we either have a comment that this is topology ID, or a clearer name. |
||
protected Double maxDownload; | ||
protected Double maxUpload; | ||
|
||
protected synchronized void rebalanceRates(){ | ||
int clientCount = this.clients.size(); | ||
if(clientCount > 0){ | ||
double maxDl = this.maxDownload <= 0.0 ? this.maxDownload : this.maxDownload / clientCount; | ||
double maxUl = this.maxUpload <= 0.0 ? this.maxUpload : this.maxUpload / clientCount; | ||
LOG.info("Rebalancing bandwidth allocation based on {} topology torrents.", clientCount); | ||
LOG.info("Per-torrent allocation [D/U]: {}/{} kB/sec.", format(maxDl), format(maxUl)); | ||
for(Client client : this.clients.values()) { | ||
client.setMaxDownloadRate(maxDl); | ||
client.setMaxUploadRate(maxUl); | ||
} | ||
} | ||
} | ||
|
||
protected static String format(double val){ | ||
return val <= 0.0 ? "UNLIMITED" : String.format("%.2f", val); | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs the Apache Header.