Commit in hps-java/src/main/java/org/lcsim/hps/conditions on MAIN | |||
ConditionsRecordCollection.java | +2 | -1 | 1.1 -> 1.2 |
ConditionsRecordConverter.java | +3 | -4 | 1.1 -> 1.2 |
ConnectionManager.java | +5 | 1.1 -> 1.2 | |
ConnectionParameters.java | +2 | -3 | 1.6 -> 1.7 |
DatabaseConditionsConverter.java | +5 | 1.4 -> 1.5 | |
DatabaseConditionsReader.java | +10 | -13 | 1.7 -> 1.8 |
svt/ChannelConstantsCollection.java | +4 | 1.1 -> 1.2 | |
/SvtCalibrationConverter.java | +5 | -4 | 1.8 -> 1.9 |
/SvtConditions.java | +2 | -1 | 1.4 -> 1.5 |
/SvtConditionsLoader.java | +3 | 1.1 -> 1.2 | |
+41 | -26 |
diff -u -r1.1 -r1.2 --- ConditionsRecordCollection.java 24 Sep 2013 02:40:21 -0000 1.1 +++ ConditionsRecordCollection.java 24 Sep 2013 02:51:35 -0000 1.2 @@ -26,7 +26,8 @@
} /**
- * Find a ConditionsRecord by its name or key. This is the 'name' field from the conditions database table.
+ * Find a ConditionsRecord by its name or key in this collection. + * This is the 'name' field from the conditions database table.
* @param name The name of the conditions set, e.g. 'svt_calibrations' etc. * @return The collection of ConditionsRecords, which can be empty if none were found. */
diff -u -r1.1 -r1.2 --- ConditionsRecordConverter.java 24 Sep 2013 02:40:21 -0000 1.1 +++ ConditionsRecordConverter.java 24 Sep 2013 02:51:35 -0000 1.2 @@ -8,10 +8,9 @@
import org.lcsim.conditions.ConditionsManager; /**
- * Read from conditions database and create SVT calibration data. - * - * @author Omar Moreno <[log in to unmask]> - * @version $Id: ConditionsRecordConverter.java,v 1.1 2013/09/24 02:40:21 jeremy Exp $
+ * Read ConditionsRecord objects from the conditions database. + * @author Jeremy McCormick <[log in to unmask]> + * @version $Id: ConditionsRecordConverter.java,v 1.2 2013/09/24 02:51:35 jeremy Exp $
*/ public class ConditionsRecordConverter extends DatabaseConditionsConverter<ConditionsRecordCollection> {
diff -u -r1.1 -r1.2 --- ConnectionManager.java 19 Sep 2013 01:26:32 -0000 1.1 +++ ConnectionManager.java 24 Sep 2013 02:51:35 -0000 1.2 @@ -7,6 +7,11 @@
import java.sql.Connection; import java.util.Properties;
+/** + * @author Jeremy McCormick <[log in to unmask]> + */ +// TODO: add connection pool +// TODO: add basic query API
public class ConnectionManager { private static ConnectionParameters connectionParameters = new ConnectionParameters();
diff -u -r1.6 -r1.7 --- ConnectionParameters.java 20 Sep 2013 21:56:24 -0000 1.6 +++ ConnectionParameters.java 24 Sep 2013 02:51:35 -0000 1.7 @@ -9,9 +9,8 @@
* This class encapsulates the parameters for connecting to a database, * including hostname, port, user and password. It can also create and * return a Connection object based on these parameters.
- * - * @author jeremym - * @version $Id: ConnectionParameters.java,v 1.6 2013/09/20 21:56:24 jeremy Exp $
+ * @author Jeremy McCormick <[log in to unmask]> + * @version $Id: ConnectionParameters.java,v 1.7 2013/09/24 02:51:35 jeremy Exp $
*/ public final class ConnectionParameters {
diff -u -r1.4 -r1.5 --- DatabaseConditionsConverter.java 24 Sep 2013 02:40:21 -0000 1.4 +++ DatabaseConditionsConverter.java 24 Sep 2013 02:51:35 -0000 1.5 @@ -2,5 +2,10 @@
import org.lcsim.conditions.ConditionsConverter;
+/** + * This class is basically just a typedef right now but functionality may be added here + * that all converters can use. + * @author Jeremy McCormick <[log in to unmask]> + */
public abstract class DatabaseConditionsConverter<T> implements ConditionsConverter<T> { }
\ No newline at end of file
diff -u -r1.7 -r1.8 --- DatabaseConditionsReader.java 24 Sep 2013 02:40:21 -0000 1.7 +++ DatabaseConditionsReader.java 24 Sep 2013 02:51:35 -0000 1.8 @@ -3,9 +3,7 @@
import java.io.IOException; import java.io.InputStream; import java.sql.Connection;
-import java.sql.ResultSet;
import java.sql.SQLException;
-import java.sql.Statement;
import java.util.logging.ConsoleHandler; import java.util.logging.Formatter; import java.util.logging.Level;
@@ -31,10 +29,10 @@
* * Currently, this class should "know" directly about all the converters that are needed for loading * conditions data via the <code>registerConditionsConverters</code> method. The SVT is the only example
- * currently, but more will be added as they are created.
+ * currently of an actual HPS sub-system, but more will be added as they are created.
* * @author jeremym
- * @version $Id: DatabaseConditionsReader.java,v 1.7 2013/09/24 02:40:21 jeremy Exp $
+ * @version $Id: DatabaseConditionsReader.java,v 1.8 2013/09/24 02:51:35 jeremy Exp $
*/ public class DatabaseConditionsReader extends ConditionsReader {
@@ -105,9 +103,7 @@
* @param run The run number. */ public boolean update(ConditionsManager manager, String detectorName, int run) throws IOException {
- - System.out.println("update"); -
+
logger.info("update"); logger.info(" detectorName: " + detectorName); logger.info(" run: " + run);
@@ -123,11 +119,11 @@
// Check if conditions for this run are already loaded. if (run <= maxRun && run >= minRun) {
- logger.info("conditions already cached");
+ logger.info("Conditions already cached for this run.");
return false; }
- // Register the converters on the manager.
+ // Register the converters on the manager.
registerConditionsConverters(manager); // Open a connection to the database.
@@ -152,22 +148,23 @@
} /**
- * Close the base reader of the detector description.
+ * Close the base reader.
*/ public void close() throws IOException { reader.close(); } /**
- * Read properties from cache, which are table, field and id. - * @return An InputStream with the cached properties for <code>name</code>.
+ * Implementation of ConditionReader API method. + * @return An InputStream with the conditions for <code>type</code>.
*/ public InputStream open(String name, String type) throws IOException { return reader.open(name, type); } /**
- * This will cache the run numbers so that the actual data can be fetched later.
+ * This will cache the run number range. More could happen here but conditions + * data is generally loaded lazily (as needed).
* @param run The run number. * @throws SQLException * @throws IOException
diff -u -r1.1 -r1.2 --- ChannelConstantsCollection.java 23 Sep 2013 23:09:10 -0000 1.1 +++ ChannelConstantsCollection.java 24 Sep 2013 02:51:35 -0000 1.2 @@ -3,6 +3,10 @@
import java.util.LinkedHashMap; import java.util.Map;
+/** + * This is a set of ChannelConstant objects mapped to their IDs (from the database). + * @author Jeremy McCormick <[log in to unmask]> + */
public class ChannelConstantsCollection extends LinkedHashMap<Integer,ChannelConstants> { ChannelConstants getChannelConstants(Integer channelId) {
diff -u -r1.8 -r1.9 --- SvtCalibrationConverter.java 24 Sep 2013 02:40:21 -0000 1.8 +++ SvtCalibrationConverter.java 24 Sep 2013 02:51:35 -0000 1.9 @@ -13,7 +13,8 @@
/** * Read SVT calibration data from the conditions database. * @author Omar Moreno <[log in to unmask]>
- * @version $Id: SvtCalibrationConverter.java,v 1.8 2013/09/24 02:40:21 jeremy Exp $
+ * @author Jeremy McCormick <[log in to unmask]> + * @version $Id: SvtCalibrationConverter.java,v 1.9 2013/09/24 02:51:35 jeremy Exp $
*/ public class SvtCalibrationConverter extends DatabaseConditionsConverter<ChannelConstantsCollection> {
@@ -27,17 +28,17 @@
} /**
- * Get the SVT channel constants by named conditions set.
+ * Get the SVT channel constants for this run by named set.
* @param manager The current conditions manager. * @param name The name of the conditions set. * @return The channel constants data. */ public ChannelConstantsCollection getData(ConditionsManager manager, String name) {
- // Get the ConditionsRecord with the meta-data, which will use the current run number.
+ // Get the ConditionsRecord with the meta-data, which will use the current run number from the manager.
ConditionsRecord record = ConditionsRecord.find(manager, name);
- // Get the table name, field name, and field value defining the applicable conditions for this run.
+ // Get the table name, field name, and field value defining the applicable conditions.
String tableName = record.getTableName(); String fieldName = record.getFieldName(); int fieldValue = record.getFieldValue();
diff -u -r1.4 -r1.5 --- SvtConditions.java 23 Sep 2013 23:24:14 -0000 1.4 +++ SvtConditions.java 24 Sep 2013 02:51:35 -0000 1.5 @@ -8,7 +8,8 @@
/** * * @author Omar Moreno <[log in to unmask]>
- * @version $Id: SvtConditions.java,v 1.4 2013/09/23 23:24:14 jeremy Exp $
+ * @author Jeremy McCormick <[log in to unmask]> + * @version $Id: SvtConditions.java,v 1.5 2013/09/24 02:51:35 jeremy Exp $
*/ public class SvtConditions {
diff -u -r1.1 -r1.2 --- SvtConditionsLoader.java 23 Sep 2013 23:09:10 -0000 1.1 +++ SvtConditionsLoader.java 24 Sep 2013 02:51:35 -0000 1.2 @@ -8,6 +8,9 @@
import org.lcsim.hps.recon.tracking.SvtUtils; import org.lcsim.hps.util.Pair;
+/** + * @author Jeremy McCormick <[log in to unmask]> + */
public class SvtConditionsLoader { SvtConditions conditions = null;
Use REPLY-ALL to reply to list
To unsubscribe from the LCD-CVS list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=LCD-CVS&A=1