gov.bnl.star.offline.scheduler.dataset.datasetManipulators
Class DropDuplicatesFromSortedList

java.lang.Object
  extended by gov.bnl.star.offline.scheduler.dataset.datasetManipulators.DropDuplicatesFromSortedList
All Implemented Interfaces:
DatasetManipulator

public class DropDuplicatesFromSortedList
extends java.lang.Object
implements DatasetManipulator

A dataset manipulator used to drop entries with matching regular expression capture groups from a list sorted be that capture groups. Note that it will not work if the list is not sorted by the capture group.

Author:
lbhajdu

Constructor Summary
DropDuplicatesFromSortedList(java.lang.String regXCaptureGroup)
          Creates a new instance of DropDuplicatesFromSortedList Note any Entry that has a blank value for the capure group will not be dropped.
 
Method Summary
 void addPreferredCopyRegx(java.lang.String pref, java.lang.String regx)
          This function is used to select one entry when two or more entrys are found matching the regx Example of useage: //pic NFS files farst the local files then HPSS files addPreferredCopyRegx("B", ".*::local::.*::.*::.*::.*::.*"); addPreferredCopyRegx("A", ".*::NFS::.*::.*::.*::.*::.*"); addPreferredCopyRegx("C", ".*::HPSS::.*::.*::.*::.*::.*");
 void modify(Dataset dataset, Request request)
          Used to pass the dataset to the dataset manipulator
 boolean requirementsSatisfied()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DropDuplicatesFromSortedList

public DropDuplicatesFromSortedList(java.lang.String regXCaptureGroup)
Creates a new instance of DropDuplicatesFromSortedList Note any Entry that has a blank value for the capure group will not be dropped.

Parameters:
regXCaptureGroup - A regular expression capture group. If mroe then one entry matches the capture group, only one one copy will be kept, all other will be dropted.
Method Detail

modify

public void modify(Dataset dataset,
                   Request request)
Used to pass the dataset to the dataset manipulator

Specified by:
modify in interface DatasetManipulator
Parameters:
dataset - The dataset to be modifyed
request - The request object of the current request for with will use the dataset

addPreferredCopyRegx

public void addPreferredCopyRegx(java.lang.String pref,
                                 java.lang.String regx)
This function is used to select one entry when two or more entrys are found matching the regx Example of useage: //pic NFS files farst the local files then HPSS files addPreferredCopyRegx("B", ".*::local::.*::.*::.*::.*::.*"); addPreferredCopyRegx("A", ".*::NFS::.*::.*::.*::.*::.*"); addPreferredCopyRegx("C", ".*::HPSS::.*::.*::.*::.*::.*");

Parameters:
pref - A string that will be alphabetically sorted to determine the preference. .A. has a higher rank then .Z..
regx - A regular expression the string must match in order to be assigned this ranking.

requirementsSatisfied

public boolean requirementsSatisfied()
Specified by:
requirementsSatisfied in interface DatasetManipulator


Copyright © 2002-2004 STAR collaboration - Brookhaven National Laboratory. All Rights Reserved.