edu.isi.pegasus.planner.transfer.refiner

## Class BalancedCluster.PoolTransfer

- java.lang.Object
- - edu.isi.pegasus.planner.transfer.refiner.BalancedCluster.PoolTransfer

Enclosing class:
  BalancedCluster

    protected class BalancedCluster.PoolTransfer
    extends java.lang.Object

A container to store the transfers that need to be done per staging site The transfers are stored over a collection of Transfer Containers with each transfer container responsible for one transfer job.

### Field Summary

Fields
`private int` `mCapacity` The maximum number of transfer jobs that are allowed for this particular pool.
`private boolean` `mLocalTransfer` boolean indicating whether the transfer job needs to run on local site
`private int` `mNext` The index of the job to which the next transfer for the pool would be scheduled.
`private java.lang.String` `mPool` The staging site for which these transfers are grouped.
`private java.util.List` `mTXContainers` The list of `TransferContainer` that correspond to each transfer job.

### Constructor Summary

Constructors
Constructor and Description
`PoolTransfer()` The default constructor.
`PoolTransfer(java.lang.String pool, boolean localTransfer, int number)` Convenience constructor.

### Method Summary

All Methods Instance Methods Concrete Methods
`BalancedCluster.TransferContainer` `addTransfer(java.util.Collection<FileTransfer> files, int level, int type)` Adds a a collection of `FileTransfer` objects to the appropriate TransferContainer.
`BalancedCluster.TransferContainer` `addTransfer(FileTransfer file, int level, int type)` Adds a single `FileTransfer` objects to the appropriate TransferContainer.
`java.lang.String` `getPoolName()` Return the pool for which the transfers are grouped
`private java.lang.String` `getRegJobName(int counter, int level)` Generates the name of the transfer job, that is unique for the given workflow.
`java.util.Iterator` `getTransferContainerIterator()` Returns the iterator to the list of transfer containers.
`private java.lang.String` `getTXJobName(int counter, int type, int level)` Generates the name of the transfer job, that is unique for the given workflow.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### mCapacity

    private int mCapacity

The maximum number of transfer jobs that are allowed for this particular pool.

#### mNext

    private int mNext

The index of the job to which the next transfer for the pool would be scheduled.

#### mPool

    private java.lang.String mPool

The staging site for which these transfers are grouped.

#### mTXContainers

    private java.util.List mTXContainers

The list of `TransferContainer` that correspond to each transfer job.

#### mLocalTransfer

    private boolean mLocalTransfer

boolean indicating whether the transfer job needs to run on local site

### Constructor Detail

#### PoolTransfer

    public PoolTransfer()

The default constructor.

#### PoolTransfer

    public PoolTransfer(java.lang.String pool,
                        boolean localTransfer,
                        int number)

Convenience constructor.

Parameters:
  `pool` - the pool name for which transfers are being grouped.
  `localTransfer` - whether the transfers need to be run on local site
  `number` - the number of transfer jobs that are going to be created for the pool.

### Method Detail

#### addTransfer

    public BalancedCluster.TransferContainer addTransfer(java.util.Collection<FileTransfer> files,
                                                         int level,
                                                         int type)

Adds a a collection of `FileTransfer` objects to the appropriate TransferContainer. The collection is added to a single TransferContainer, and the pointer is then updated to the next container.

Parameters:
  `files` - the collection `FileTransfer` to be added.
  `level` - the level of the workflow
  `type` - the type of transfer job
Returns:
  the Transfer Container to which the job file transfers were added.

#### addTransfer

    public BalancedCluster.TransferContainer addTransfer(FileTransfer file,
                                                         int level,
                                                         int type)

Adds a single `FileTransfer` objects to the appropriate TransferContainer. The collection is added to a single TransferContainer, and the pointer is then updated to the next container.

Parameters:
  `file` -
  `level` - the level of the workflow
  `type` - the type of transfer job
Returns:
  the Transfer Container to which the job file transfers were added.

#### getTransferContainerIterator

    public java.util.Iterator getTransferContainerIterator()

Returns the iterator to the list of transfer containers.

Returns:
  the iterator.

#### getRegJobName

    private java.lang.String getRegJobName(int counter,
                                           int level)

Generates the name of the transfer job, that is unique for the given workflow.

Parameters:
  `counter` - the index for the registration job.
  `level` - the level of the workflow.
Returns:
  the name of the transfer job.

#### getPoolName

    public java.lang.String getPoolName()

Return the pool for which the transfers are grouped

Returns:
  name of pool.

#### getTXJobName

    private java.lang.String getTXJobName(int counter,
                                          int type,
                                          int level)

Generates the name of the transfer job, that is unique for the given workflow.

Parameters:
  `counter` - the index for the transfer job.
  `type` - the type of transfer job.
  `level` - the level of the workflow.
Returns:
  the name of the transfer job.