Package org.gudy.azureus2.core3.disk

Examples of org.gudy.azureus2.core3.disk.DiskManagerReadRequest


    DownloadManager dm = (DownloadManager) ds;
    if (rowCore.getSubItemCount() == 0 && dm.getTorrent() != null
        && !dm.getTorrent().isSimpleTorrent() && rowCore.isVisible()
        && dm.getNumFileInfos() > 0) {
      DiskManagerFileInfoSet fileInfos = dm.getDiskManagerFileInfoSet();
      if (fileInfos != null) {
        DiskManagerFileInfo[] files = fileInfos.getFiles();
        boolean copied = false;
        int pos = 0;
        for (int i = 0; i < files.length; i++) {
          DiskManagerFileInfo fileInfo = files[i];
          if (fileInfo.isSkipped()
View Full Code Here


      // allocate max size needed (we'll shrink it later)
      final int[] pieceNumbers = new int[requested.size()];
      int pos = 0;

      for (int i = 0; i < requested.size(); i++) {
        DiskManagerReadRequest request = null;
        try {
          request = (DiskManagerReadRequest) requested.get(i);
        } catch (Exception e) {
          Debug.printStackTrace(e);
        }

        if (request != null && iLastNumber != request.getPieceNumber()) {
          iLastNumber = request.getPieceNumber();
          pieceNumbers[pos++] = iLastNumber;
        }
      }

      final int[] trimmed = new int[pos];
View Full Code Here

     
  }


  public DiskManagerReadRequest request(final int pieceNumber, final int pieceOffset, final int pieceLength) {
    final DiskManagerReadRequest request =manager.createDiskManagerRequest(pieceNumber, pieceOffset, pieceLength);
    if (current_peer_state != TRANSFERING) {
      manager.requestCanceled(request);
      return null;
   
   
View Full Code Here

          final long timeSinceGoodData =getTimeSinceGoodDataReceived();
          if (timeSinceGoodData ==-1 ||timeSinceGoodData >60 *1000)
            setSnubbed(true);
        }
        for (int i = requested.size() - 1; i >= 0; i--) {
          final DiskManagerReadRequest request =(DiskManagerReadRequest) requested.remove(i);
          manager.requestCanceled(request);
        }
      }finally{

        requested_mon.exit();
View Full Code Here

    // modification (only out-of-bounds can occur)

    try{
      for (int i =requested.size() -1; i >=0; i--)
      {
        final DiskManagerReadRequest request = (DiskManagerReadRequest) requested.get(i);

        if (request.isExpired()){

          if ( result == null ){

            result = new ArrayList();
          }
View Full Code Here

      requested_mon.enter();

      final int requestedSize =requested.size();
      for (int i =0; i <requestedSize; i++)
      {
        final DiskManagerReadRequest request =(DiskManagerReadRequest) requested.get(i);
        if (request != null)
          request.resetTime(now);
      }
    }finally{

      requested_mon.exit();
    }
View Full Code Here

      if ( fast_extension_enabled && really_choked_by_other_peer ){

        System.out.println( "Received allow-fast piece for " + pieceNumber + "/" + offset + "/" + length + " from " + getIp());
      }
    }
    final DiskManagerReadRequest request = manager.createDiskManagerRequest( pieceNumber, offset, length );
    boolean piece_error = true;

    if( hasBeenRequested( request ) ) {  //from active request
      removeRequest( request );
      final long now =SystemTime.getCurrentTime();
View Full Code Here

    int number = reject.getPieceNumber();
    int offset = reject.getPieceOffset();
    int length = reject.getLength();
    reject.destroy();
   
    final DiskManagerReadRequest request = manager.createDiskManagerRequest( number, offset, length );

    if ( hasBeenRequested( request )){
     
      removeRequest( request );
     
View Full Code Here

  request(
    int pieceNumber,
    int pieceOffset,
    int pieceLength )
  {
    DiskManagerReadRequest  request = manager.getDelegate().getDiskManager().createReadRequest( pieceNumber, pieceOffset, pieceLength );
   
    if ( foreign.addRequest( request )){
     
      return( request );
     
View Full Code Here

  public static DiskManager
  create(
    TOTorrent    torrent,
    DownloadManager manager)
  {
    DiskManagerImpl dm = new DiskManagerImpl( torrent, manager );
   
    if ( dm.getState() != DiskManager.FAULTY ){
     
      dm.start();
    }
   
    return dm;
  }
View Full Code Here

TOP

Related Classes of org.gudy.azureus2.core3.disk.DiskManagerReadRequest

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.