gov.bnl.star.offline.scheduler.dataset
Class EntryParser

java.lang.Object
  extended by gov.bnl.star.offline.scheduler.dataset.EntryParser

public class EntryParser
extends java.lang.Object

This class is used to define how a line in the dataset file is to be parsed to extract the relevant bits of data. It defines the format of the entries in the dataset. How to extract each of the attributes is defined by generic JAVA regular expression capture groups.

Author:
Levente B. Hajdu

Constructor Summary
EntryParser()
          Creates a new instance of EntryParser
 
Method Summary
 void addFILE_NAME(java.lang.String regX)
          Configures the parser to parse out the host name of the file.
 void addHOST(java.lang.String regX)
          Configures the parser to parse out the host name of the entry (node name or IP).
 void addLFN(java.lang.String regX)
          Configures the parser to parse out the LFN.
 void addNUMBER_OF_EVENTS(java.lang.String regX)
          Configures the parser to parse out the host name of the number of events (If given).
 void addPATH(java.lang.String regX)
          Configures the parser to parse out the path to the entry.
 void addSITE(java.lang.String regX)
          Configures the parser to parse out the site of the entry.
 void addSTORAGE_SERVISE(java.lang.String regX)
          Configures the parser to parse out the storage servise (examples: HPSS, NFS, Locla disk).
 java.util.List entryListToPhysicalFileList(java.util.List entrys)
           
 PhysicalFile entryToPhysicalFile(java.lang.String entry)
          converts an entry string to a PhysicalFile string
 java.lang.String getFILE_NAME(java.lang.String entry)
          Parses the entry string
 java.lang.String getHOST(java.lang.String entry)
          Parses the entry string
 java.lang.String getLFN(java.lang.String entry)
          Parses the entry string
 java.lang.String getNUMBER_OF_EVENTS(java.lang.String entry)
          Parses the entry string
 java.lang.String getPATH(java.lang.String entry)
          Parses the entry string
 java.util.Hashtable getRegx()
           
 java.util.Hashtable getReplacment()
           
 java.lang.String getSITE(java.lang.String entry)
          Parses the entry string
 java.lang.String getSTORAGE_SERVISE(java.lang.String entry)
          Parses the entry string
 void setRegx(java.util.Hashtable regx)
           
 void setReplacment(java.util.Hashtable replacment)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EntryParser

public EntryParser()
Creates a new instance of EntryParser

Method Detail

addLFN

public void addLFN(java.lang.String regX)
Configures the parser to parse out the LFN.

Parameters:
regX - : A regular expression having a capture group for the logical file name.

addSTORAGE_SERVISE

public void addSTORAGE_SERVISE(java.lang.String regX)
Configures the parser to parse out the storage servise (examples: HPSS, NFS, Locla disk).

Parameters:
regX - : A regular expression having a capture group for the storage servise.

addSITE

public void addSITE(java.lang.String regX)
Configures the parser to parse out the site of the entry.

Parameters:
regX - : A regular expression having a capture group for the site of the entry.

addHOST

public void addHOST(java.lang.String regX)
Configures the parser to parse out the host name of the entry (node name or IP).

Parameters:
regX - : A regular expression having a capture group for the host of the entry.

addPATH

public void addPATH(java.lang.String regX)
Configures the parser to parse out the path to the entry.

Parameters:
regX - : A regular expression having a capture group for the path of the entry.

addFILE_NAME

public void addFILE_NAME(java.lang.String regX)
Configures the parser to parse out the host name of the file.

Parameters:
regX - : A regular expression having a capture group for the file name

addNUMBER_OF_EVENTS

public void addNUMBER_OF_EVENTS(java.lang.String regX)
Configures the parser to parse out the host name of the number of events (If given).

Parameters:
regX - : A regular expression having a capture group for the number of events in the file

getLFN

public java.lang.String getLFN(java.lang.String entry)
Parses the entry string

Returns:
LFN

getSTORAGE_SERVISE

public java.lang.String getSTORAGE_SERVISE(java.lang.String entry)
Parses the entry string

Returns:
storage servise

getSITE

public java.lang.String getSITE(java.lang.String entry)
Parses the entry string

Returns:
site of entry

getHOST

public java.lang.String getHOST(java.lang.String entry)
Parses the entry string

Returns:
hostname of the node on which the entry resides

getPATH

public java.lang.String getPATH(java.lang.String entry)
Parses the entry string

Returns:
path of the file (can be a local path or physical file path)

getFILE_NAME

public java.lang.String getFILE_NAME(java.lang.String entry)
Parses the entry string

Returns:
file name (can be logical flie name or physical file naem)

getNUMBER_OF_EVENTS

public java.lang.String getNUMBER_OF_EVENTS(java.lang.String entry)
Parses the entry string

Returns:
number of events

getRegx

public java.util.Hashtable getRegx()

setRegx

public void setRegx(java.util.Hashtable regx)

getReplacment

public java.util.Hashtable getReplacment()

setReplacment

public void setReplacment(java.util.Hashtable replacment)

entryToPhysicalFile

public PhysicalFile entryToPhysicalFile(java.lang.String entry)
converts an entry string to a PhysicalFile string


entryListToPhysicalFileList

public java.util.List entryListToPhysicalFileList(java.util.List entrys)


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