PTC API (Draft) // (start, host, pid) may not be the best as keys for query, // since the user would not know the exact start time and pid. // how to solve out of memory problem when the result has // too many records? public boolean saveInvocation( InvocationRecord ivr ) throws SQLException; public InvocationRecord loadInvocation( java.util.Date start, InetAddress host, int pid ) throws SQLException; /** * The following are shortcuts to some common requests */ public int getExitcode( java.util.Date start, InetAddress host, int pid ) throws SQLException; public double getDuration( java.util.Date start, InetAddress host, int pid ) throws SQLException; public String getExecutable( java.util.Date start, InetAddress host, int pid ) throws SQLException; public String getArguments( java.util.Date start, InetAddress host, int pid ) throws SQLException; //Get more than one records /* * Get all the records within a period */ public java.util.List getRecordsInBetween( java.util.Date from, java.util.Date to ) throws SQLException; /* * Get all the records within a period on a site */ public java.util.List getRecordsInBetween( java.util.Date from, java.util.Date to, String siteName ) throws SQLException; /* * Get all the records within a period on a host */ public java.util.List getRecordsInBetween( java.util.Date from, java.util.Date to, String siteName, InetAddress host ) throws SQLException; /* * Get all the records within a period for a TR */ public java.util.List getRecordsInBetweenForTR( java.util.Date from, java.util.Date to, String trName ) throws SQLException; /* * Get all the records within a period on a site for a TR */ public java.util.List getRecordsInBetweenForTR( java.util.Date from, java.util.Date to, String siteName, String trName ) throws SQLException; /* * Get all the records within a period on a host for a TR */ public java.util.List getRecordsInBetweenForTR( java.util.Date from, java.util.Date to, InetAddress host, String trName ) throws SQLException; /* * Get all the records within a period for a DV */ public java.util.List getRecordsInBetweenForDV( java.util.Date from, java.util.Date to, String dvName ) throws SQLException; /* * Get all the records within a period on a site for a DV */ public java.util.List getRecordsInBetweenForDV( java.util.Date from, java.util.Date to, String siteName, String dvName ) throws SQLException; /* * Get all the records within a period on a host for a DV */ public java.util.List getRecordsInBetweenForDV( java.util.Date from, java.util.Date to, InetAddress host, String dvName ) throws SQLException; /* * Get a list of sites where a DV was executed */ public java.util.List getGridSitesForDV( String dvName ) throws SQLException; /* * Get a list of hosts where a DV was executed */ public java.util.List getHostsForDV( String dvName ) throws SQLException; // get records by exit code or job status /* * Get a list of records with a specific exit code */ public java.util.List getRecordsWithExitCode( java.util.Date from, java.util.Date to, int exitCode ) throws SQLException; /* * Get a list of records with a specific status */ public java.util.List getRecordsWithStatus( java.util.Date from, java.util.Date to, JobStatus js) throws SQLException; /* * Get a list of records with a specific exit code on a site */ public java.util.List getRecordsWithExitCode( java.util.Date from, java.util.Date to, int exitCode, String siteName ) throws SQLException; /* * Get a list of records with a specific status on a site */ public java.util.List getRecordsWithStatus( java.util.Date from, java.util.Date to, JobStatus js, String siteName) throws SQLException; // some statistical methods /* * Get the average running time for a DV on a site * (may need to add the job status as an argument) */ public double getAverageDurationOnSite( String dvName, String siteName ) throws SQLException; /* * Get the average running time for a DV on a host */ public double getAverageDurationOnHost( String dvName, InetAddress host ) throws SQLException; /* * Get the longest running time for a DV on a site */ public double getMaximumDurationOnSite( String dvName, String siteName ) throws SQLException; /* * Get the longest running time for a DV on a host */ public double getMaximumDurationOnHost( String dvName, InetAddress host ) throws SQLException; /* * Get the shortest running time for a DV on a site */ public double getMinimumDurationOnSite( String dvName, String siteName ) throws SQLException; /* * Get the shortest running time for a DV on a host */ public double getMinimumDurationOnHost( String dvName, InetAddress host ) throws SQLException; //not yet able to answer these questions ( can't distinguish files from parameters) Which files were processed by the job Which files were produced by the job The size of the processed and produced files Who ran the jobs (no job submitter info)