Пример #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 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);
   }
 }
Пример #3
0
 public MinaInstance(
     MinaConfig config, Application application, ScheduledThreadPoolExecutor executor) {
   // Make sure we know about exceptions
   log = getLogger(getClass());
   this.config = config;
   this.executor = executor;
   if (config.getNodeId() != null) myNodeId = config.getNodeId();
   else myNodeId = generateNodeId();
   log.fatal("Mina running on udp port " + config.getListenUdpPort() + ", node id: " + myNodeId);
   messageMgr = new MessageMgr(this);
   ccm = new CCMgr(this);
   netMgr = new NetworkMgr(this);
   try {
     bidStrategy = (BidStrategy) Class.forName(config.getBidStrategyClass()).newInstance();
     bidStrategy.setMinaInstance(this);
   } catch (Exception e) {
     throw new SeekInnerCalmException(e);
   }
   scm = new StreamConnsMgr(this);
   streamMgr = new StreamMgr(this);
   prm = new PageRequestMgr(this);
   flowRateMgr = new FlowRateMgr(this);
   if (config.isSupernode()) supernodeMgr = new SupernodeMgr(this);
   if (config.isAgoric()) {
     sellMgr = new SellMgr(this);
     buyMgr = new BuyMgr(this);
     escrowMgr = new EscrowMgr(this);
   }
   if (config.getRunEscrowProvider()) {
     escrowProvider = new EscrowProvider(this);
   }
   badNodes = new BadNodeList(this);
   eventMgr = new EventMgr(this);
   sourceMgr = new SourceMgr(this);
   streamAdvertiser = new StreamAdvertiser(this);
   implementingApplication = application;
 }
Пример #4
0
 public void startReception(String sid, StreamVelocity sv) {
   bidStrategy.setStreamVelocity(sid, sv);
   streamMgr.startReception(sid);
 }