Package com.aelitis.azureus.core.peermanager.piecepicker

Examples of com.aelitis.azureus.core.peermanager.piecepicker.PiecePicker


     
      PEPeerManager pm = dm.getPeerManager();
     
      if ( pm != null ){
       
        PiecePicker picker = pm.getPiecePicker();
       
        PEPiece[] pieces = pm.getPieces();
       
        String  line = "";
       
        for (int i=0;i<pieces.length;i++){
         
          String str = picker.getPieceString( i );
         
          line += (line.length()==0?(i + " "):",") + str;
         
          PEPiece piece = pieces[i];
View Full Code Here


      return;
    Rectangle rect = pieceDistCanvas.getBounds();
    if (rect.height <= 0 || rect.width <= 0)
      return;
   
    PiecePicker picker = pem.getPiecePicker();
   
    final int seeds = pem.getNbSeeds() + (pem.isSeeding() ? 1 : 0);
    final int connected = pem.getNbPeers() + seeds + (pem.isSeeding() ? 0 : 1);
    final int upperBound = 1 + (1 << (int) Math.ceil(Math.log(connected + 0.0) / Math.log(2.0)));
    // System.out.println("conn:"+connected+" bound:"+upperBound);
    final int minAvail = (int) picker.getMinAvailability();
    final int maxAvail = picker.getMaxAvailability();
    final int nbPieces = picker.getNumberOfPieces();
    final int[] availabilties = picker.getAvailability();
    final DiskManagerPiece[] dmPieces = pem.getDiskManager().getPieces();
    final PEPiece[] pePieces = pem.getPieces();
    final int[] globalPiecesPerAvailability = new int[upperBound];
    final int[] datasourcePiecesPerAvailability = new int[upperBound];
   
View Full Code Here

  public String
  getString()
  {
    String  text  = "";
   
    PiecePicker pp = manager.getPiecePicker();

    text  += ( isRequestable()?"reqable,":"" );
    text  += "req=" + getNbRequests() + ",";
    text  += ( isRequested()?"reqstd,":"" );
    text  += ( isDownloaded()?"downed,":"" );
    text  += ( getReservedBy()!=null?"resrv,":"" );
    text  += "speed=" + getSpeed() + ",";
    text  += ( pp==null?("pri=" + getResumePriority()):pp.getPieceString(dmPiece.getPieceNumber()));
   
    if ( text.endsWith(",")){
      text = text.substring(0,text.length()-1);
    }
   
View Full Code Here

     
        // force overall download order to be from end of file to start (for BT peers)
     
      if ( peer_manager != null ){
       
        PiecePicker picker = PluginCoreUtils.unwrap( peer_manager ).getPiecePicker();
 
        if ( active ){
         
          piece_priorities = new long[peer_manager.getPieces().length];
         
          for ( int i=0;i<piece_priorities.length;i++){
           
            piece_priorities[i] = 10*1000 +  i;
          }
         
          picker.addPriorityProvider( this );
         
        }else{
         
          piece_priorities = null;
         
          picker.removePriorityProvider( this );
        }
      }
     
      if ( !active ){
       
View Full Code Here

        return( false );
      }     

      if ( tick_count % REACTIVATE_PROVIDER_PERIOD_TICKS == 0 ){
       
        PiecePicker piece_picker = current_piece_pickler;
       
        if ( piece_picker != null ){
       
          buffer_provider.checkActivation( piece_picker );
        }
View Full Code Here

     
      last_discard_bytes = discards;
     
      DiskManager  disk_manager = download_manager.getDiskManager();
     
      PiecePicker  picker = current_piece_pickler;

      if ( getStreamBytesPerSecondMin() > 0 && disk_manager != null && picker != null ){
       
        List  providers = picker.getRTAProviders();
       
        long  max_cp  = 0;
       
        PieceRTAProvider  best_provider = null;
       
View Full Code Here

TOP

Related Classes of com.aelitis.azureus.core.peermanager.piecepicker.PiecePicker

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.