001    /*
002     * CopySelector.java
003     *
004     * Created on March 13, 2003, 10:50 AM
005     *
006     * This file is part of the STAR Scheduler.
007     * Copyright (c) 2002-2006 STAR Collaboration - Brookhaven National Laboratory
008     *
009     * STAR Scheduler is free software; you can redistribute it and/or modify
010     * it under the terms of the GNU General Public License as published by
011     * the Free Software Foundation; either version 2 of the License, or
012     * (at your option) any later version.
013     *
014     * STAR Scheduler is distributed in the hope that it will be useful,
015     * but WITHOUT ANY WARRANTY; without even the implied warranty of
016     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
017     * GNU General Public License for more details.
018     *
019     * You should have received a copy of the GNU General Public License
020     * along with STAR Scheduler; if not, write to the Free Software
021     * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
022     */
023    package gov.bnl.star.offline.scheduler.policy.copyselector;
024    
025    import gov.bnl.star.offline.scheduler.CatalogQuery;
026    import gov.bnl.star.offline.scheduler.catalog.QueryResult;
027    import gov.bnl.star.offline.scheduler.policy.FileAssignment;
028    
029    
030    /** Process the result of a query and selected the actual copies to run the
031     * job on. This is part of the SelectorAssignmentStrategy, which is a non
032     * optimal but reasonable strategy. Refer the strategy documentation for more
033     * information
034     *
035     * @author  Gabriele Carcassi
036     */
037    public interface CopySelector {
038        /** Selects the physical copies from the query result according to the
039         * parameters of the query, and puts them in the assignment. The selector
040         * has to guarantee not to remove files from the received assignment, but
041         * only add them.
042         * @param list the result of the query
043         * @param query the query that generated the result
044         * @param assignment the assignment where to add the copies
045         * @return the number of files added to the assignment
046         */
047        int selectCopy(QueryResult list, CatalogQuery query,
048            FileAssignment assignment);
049    }