pelican/server/src/ChunkerManager.cpp
/**
 * @details
 * Adds the allocated chunker to the map of known chunkers.
 *
 * @param[in] chunker  Pointer to the allocated chunker.
 */
@details
Adds the allocated chunker to the map of known chunkers.

@param[in] chunker  Pointer to the allocated chunker.
@details Adds the allocated chunker to the map of known chunkers . @param [ in ] chunker Pointer to the allocated chunker .
void ChunkerManager::_addChunker(AbstractChunker* chunker)
{
    if (chunker)
    {
        QPair<QString, quint16> pair(chunker->host(), chunker->port());
        if (!chunker->host().isEmpty())
        {
            if (_chunkerPortMap.contains(pair)) {
                QString err = "ChunkerManager::_addChunker(): ";
                err += "Cannot map multiple chunkers to the same host/ port. ";
                err += "(host %1, port %2 already assigned)";
                err = err.arg(chunker->host());
                err = err.arg(chunker->port());
                throw err;
            }
            _chunkerPortMap[pair] = chunker;
        }
        _chunkers.insert(chunker);
    }
}
void ChunkerManager :: _addChunker ( AbstractChunker * chunker ) { if ( chunker ) { QPair < QString , quint16 > pair ( chunker -> host ( ) , chunker -> port ( ) ) ; if ( ! chunker -> host ( ) . isEmpty ( ) ) { if ( _chunkerPortMap . contains ( pair ) ) { QString err = " " ; err += " " ; err += " " ; err = err . arg ( chunker -> host ( ) ) ; err = err . arg ( chunker -> port ( ) ) ; throw err ; } _chunkerPortMap [ pair ] = chunker ; } _chunkers . insert ( chunker ) ; } }
@details
 Adds the allocated chunker to the map of known chunkers.
@details Adds the allocated chunker to the map of known chunkers .
// Check to see any chunkers are already assigned to the same host // and port.