Beispiel #1
0
 public Map<String, TransferSpeed> getTransferSpeeds() {
   Map<String, TransferSpeed> result = new HashMap<String, TransferSpeed>();
   for (String sid : streamMgr.getLiveStreamIds()) {
     int upload = flowRateMgr.getBroadcastingFlowRate(sid);
     int download = flowRateMgr.getListeningFlowRate(sid);
     if (upload > 0 || download > 0) result.put(sid, new TransferSpeed(sid, download, upload));
   }
   return result;
 }
Beispiel #2
0
 /** @syncpriority 200 */
 public void stop() throws MinaException {
   log.fatal("Mina instance stopping");
   ccm.prepareForShutdown();
   scm.closeAllStreamConns();
   streamMgr.stop();
   sourceMgr.stop();
   streamAdvertiser.cancel();
   ccm.stop();
   netMgr.stop();
   badNodes.clear();
   started = false;
   log.fatal("Mina instance stopped");
 }
Beispiel #3
0
 public void setAllStreamVelocitiesExcept(String streamId, StreamVelocity sv) {
   String[] receivingSids = streamMgr.getReceivingStreamIds();
   // After the velocity is changed, we might want to inc/dec our bid to our sources
   Set<String> rebidNodeIds = new HashSet<String>();
   for (String sid : receivingSids) {
     if (!sid.equals(streamId)) {
       bidStrategy.setStreamVelocity(sid, sv);
       for (LCPair lcp : scm.getListenConns(sid)) {
         rebidNodeIds.add(lcp.getCC().getNodeId());
       }
     }
   }
   for (String nodeId : rebidNodeIds) {
     buyMgr.possiblyRebid(nodeId);
   }
 }
Beispiel #4
0
 /**
  * The stream priority dictates the importance of streams relative to each other (higher is more
  * important)
  */
 public void setStreamPriority(String streamId, int priority) {
   streamMgr.setPriority(streamId, priority);
 }
Beispiel #5
0
 public void clearStreamPriorities() {
   streamMgr.clearStreamPriorities();
 }
Beispiel #6
0
 public Set<Node> getKnownSources(String sid) {
   return streamMgr.getKnownSources(sid);
 }
Beispiel #7
0
 public void removeFoundSourceListener(String sid, FoundSourceListener listener) {
   streamMgr.removeFoundSourceListener(sid, listener);
 }
Beispiel #8
0
 public void addFoundSourceListener(String sid, FoundSourceListener listener) {
   streamMgr.addFoundSourceListener(sid, listener);
 }
Beispiel #9
0
 public int numSources(String sid) {
   return streamMgr.numSources(sid);
 }
Beispiel #10
0
 public Set<String> getSources(String sid) {
   return streamMgr.getSourceNodeIds(sid);
 }
Beispiel #11
0
 public void stopReception(String sid) {
   streamMgr.stopReception(sid);
 }
Beispiel #12
0
 public void startReception(String sid, StreamVelocity sv) {
   bidStrategy.setStreamVelocity(sid, sv);
   streamMgr.startReception(sid);
 }
Beispiel #13
0
 public void stopBroadcast(String sid) {
   streamMgr.stopBroadcast(sid);
 }
Beispiel #14
0
 @Override
 public void startBroadcasts(Collection<String> sids) {
   streamMgr.startBroadcasts(sids);
 }