HiRISE

HiRISE.HiCat.HiVolume
Class Index_Builder

java.lang.Object
  extended by HiRISE.HiCat.HiVolume.Index_Builder

public class Index_Builder
extends Object

This class is responsible for building the PDS index table files for all HiRISE product types. The class writes out the various *.TAB files found in the INDEX subdirectory inside the HiRISE PDS Volume. In addition the class also updates the labels for each table file, updating the number of records listed in the label.

Author:
Rodney Heyd UA/HiRISE, Steven Wheelwright UA/HiRISE, Ashley Ramsey UA/HiRISE

Field Summary
static String DEBUG_CONSTRUCTORS_PROPERTY
           
static String DEBUG_LABEL_PROPERTY
           
static String DEBUG_MAIN_PROPERTY
           
static String DEBUG_QUERY_PROPERTY
           
static String DEBUG_WRITE_PROPERTY
           
static String ID
           
 
Constructor Summary
Index_Builder(Configuration configuration)
           
Index_Builder(Configuration configuration, Database database)
          Instantiates the Index_Builder class from a configuration and a database.
Index_Builder(Configuration configuration, Database database, int recordsPerQuery)
          Alternate constructor that allows the setting of the number of records to return per query.
 
Method Summary
static void main(String[] args)
          Index_Builder should only be run from HiVolume.
 void Write_DTM_Index(Date date)
          Writes a PDS Index file for DTMs.
 void Write_EDR_Index(Date date)
          Writes a PDS Index file for EDRs.
 void Write_EDR_Index(String filename, String date)
           
 void Write_EDR_Index(Vector<Product> products, String filename, boolean append)
           
 void Write_RDR_Index(Date date)
          Writes a PDS Index file for RDRs.
 void Write_RDR_Index(String filename, String date)
           
 void Write_RDR_Index(Vector<Product> products, String filename, boolean append)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ID

public static final String ID
See Also:
Constant Field Values

DEBUG_CONSTRUCTORS_PROPERTY

public static final String DEBUG_CONSTRUCTORS_PROPERTY
See Also:
Constant Field Values

DEBUG_WRITE_PROPERTY

public static final String DEBUG_WRITE_PROPERTY
See Also:
Constant Field Values

DEBUG_MAIN_PROPERTY

public static final String DEBUG_MAIN_PROPERTY
See Also:
Constant Field Values

DEBUG_LABEL_PROPERTY

public static final String DEBUG_LABEL_PROPERTY
See Also:
Constant Field Values

DEBUG_QUERY_PROPERTY

public static final String DEBUG_QUERY_PROPERTY
See Also:
Constant Field Values
Constructor Detail

Index_Builder

public Index_Builder(Configuration configuration)
              throws Database_Exception,
                     Configuration_Exception
Throws:
Database_Exception
Configuration_Exception

Index_Builder

public Index_Builder(Configuration configuration,
                     Database database)
              throws Database_Exception,
                     Configuration_Exception
Instantiates the Index_Builder class from a configuration and a database. If the database connection in the Database object is currently closed, this will force the connection open. See the default configuration file, HiVolume.conf for required parameters.

Parameters:
configuration -
database -
Throws:
Database_Exception
Configuration_Exception

Index_Builder

public Index_Builder(Configuration configuration,
                     Database database,
                     int recordsPerQuery)
              throws Database_Exception,
                     Configuration_Exception
Alternate constructor that allows the setting of the number of records to return per query. Increasing this number to higher values will decrease the number of ranged queries that have to be run to retrieve all the product data for the indexes at the expense of requiring more ram. Assuming ram isn't an issue, recordsPerQuery should be set as large as possible.

Parameters:
configuration -
database -
recordsPerQuery -
Throws:
Database_Exception
Configuration_Exception
Method Detail

Write_EDR_Index

public void Write_EDR_Index(Date date)
                     throws IOException,
                            SQLException
Writes a PDS Index file for EDRs. It writes two files: the first includes only the products released on or after date. The other is a cumulative index and includes all products ever released. After writing the index files, it also updates the appropriate label files. The index filenames and label filenames are read from the configuation file.

Parameters:
date - The date of the PDS release.
Throws:
IOException
SQLException

Write_RDR_Index

public void Write_RDR_Index(Date date)
                     throws IOException,
                            SQLException
Writes a PDS Index file for RDRs. It writes two files: the first includes only the products released on or after date. The other is a cumulative index and includes all products ever released. After writing the index files, it also updates the appropriate label files. The index filenames and label filenames are read from the configuation file.

Parameters:
date - The date for the PDS release.
Throws:
IOException
SQLException

Write_DTM_Index

public void Write_DTM_Index(Date date)
                     throws IOException,
                            SQLException
Writes a PDS Index file for DTMs. It writes two files: the first includes only the products released on or after date. The other is a cumulative index and includes all products ever released. After writing the index files, it also updates the appropriate label files. The index filenames and label filenames are read from the configuration file.

Parameters:
date - The date for the SQL query.
Throws:
IOException
SQLException

main

public static void main(String[] args)
Index_Builder should only be run from HiVolume. This main method is only for testing purposes. It reads a configuration file at HiVolume_Test.conf and then creates index files and updates label files for a PDS release at 2009-Sept-01.

Parameters:
args -

Write_RDR_Index

public void Write_RDR_Index(Vector<Product> products,
                            String filename,
                            boolean append)
                     throws SQLException,
                            IOException
Throws:
SQLException
IOException

Write_EDR_Index

public void Write_EDR_Index(Vector<Product> products,
                            String filename,
                            boolean append)
                     throws SQLException,
                            IOException
Throws:
SQLException
IOException

Write_EDR_Index

public void Write_EDR_Index(String filename,
                            String date)
                     throws IOException,
                            SQLException
Throws:
IOException
SQLException

Write_RDR_Index

public void Write_RDR_Index(String filename,
                            String date)
                     throws IOException,
                            SQLException
Throws:
IOException
SQLException

HiRISE

Copyright (C) Arizona Board of Regents on behalf of the Planetary Image Research Laboratory, Lunar and Planetary Laboratory at the University of Arizona