Пример #1
0
 /** The streamvelocity dictates how fast we want this stream (slower = cheaper) */
 public void setStreamVelocity(String sid, StreamVelocity sv) {
   bidStrategy.setStreamVelocity(sid, sv);
   // After the velocity is changed, we might want to inc/dec our bid to our sources
   for (LCPair lcp : scm.getListenConns(sid)) {
     buyMgr.possiblyRebid(lcp.getCC().getNodeId());
   }
 }
Пример #2
0
 public List<String> getConnectedSources(String sid) {
   LCPair[] arrr = scm.getListenConns(sid);
   List<String> result = new ArrayList<String>();
   for (LCPair lcp : arrr) {
     result.add(lcp.getCC().getNodeId());
   }
   return result;
 }
Пример #3
0
 /** @syncpriority 90 */
 public void abort() {
   log.fatal("Mina instance ABORTING!");
   ccm.prepareForShutdown();
   scm.abort();
   ccm.abort();
   netMgr.stop();
   started = false;
   log.fatal("Mina instance stopped");
 }
Пример #4
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");
 }
Пример #5
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);
   }
 }