Changeset 7297 for TI01-discovery-Ingest


Ignore:
Timestamp:
06/08/10 16:39:23 (9 years ago)
Author:
sdonegan
Message:

updated tables and sql functions for ingester interaction with DPWS db

Location:
TI01-discovery-Ingest/trunk/v4.3.0/ingestAutomation-upgrade/ingestLoggingDatabase
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • TI01-discovery-Ingest/trunk/v4.3.0/ingestAutomation-upgrade/ingestLoggingDatabase/IngestLoggingTable.sql

    r7252 r7297  
    88CREATE TABLE ingest_search_logging ( 
    99    local_ingest_id SERIAL primary key, -- id assigned by postgres 
    10         alt_ingest_id text, -- id supplied by calling function 
    11         provider_id text, -- unique provider id 
     10        id text, -- process id supplied by calling function      
    1211        ingest_date timestamp, -- time of ingest 
    1312        total_files_processed int, -- total number of files handled 
  • TI01-discovery-Ingest/trunk/v4.3.0/ingestAutomation-upgrade/ingestLoggingDatabase/create_database.sh

    r7252 r7297  
    2626psql -f ingestLoggingProcedures.sql $dbOptions 
    2727psql -f IngestLoggingTable.sql $dbOptions 
     28psql -f IngestProblemFileTable.sql $dbOptions 
    2829#psql -f HarvestLog.sql $dbOptions 
    2930#psql -f HarvestType.sql $dbOptions 
  • TI01-discovery-Ingest/trunk/v4.3.0/ingestAutomation-upgrade/ingestLoggingDatabase/ingestLoggingProcedures.sql

    r7252 r7297  
    55 *  
    66 */ 
    7 DROP FUNCTION add_ingest_stats(ingest_id_in text, provider_id_in text,ingest_date_in timestamp,total_files_processed_in int,total_files_processed_successfully_in int, total_files_processed_unsuccessfully_in int,records_created_in int,records_updated_in int,records_deleted_in int,number_problem_files_in int) CASCADE; 
    8 CREATE FUNCTION add_ingest_stats(ingest_id_in text, provider_id_in text,ingest_date_in timestamp,total_files_processed_in int,total_files_processed_successfully_in int, total_files_processed_unsuccessfully_in int,records_created_in int,records_updated_in int,records_deleted_in int,number_problem_files_in int) RETURNS VOID AS  
     7DROP FUNCTION add_ingest_stats(ingest_id_in text, ingest_date_in timestamp,total_files_processed_in int,total_files_processed_successfully_in int, total_files_processed_unsuccessfully_in int,records_created_in int,records_updated_in int,records_deleted_in int,number_problem_files_in int) CASCADE; 
     8CREATE FUNCTION add_ingest_stats(ingest_id_in text,ingest_date_in timestamp,total_files_processed_in int,total_files_processed_successfully_in int, total_files_processed_unsuccessfully_in int,records_created_in int,records_updated_in int,records_deleted_in int,number_problem_files_in int) RETURNS VOID AS  
    99$$ 
    1010    BEGIN 
    1111     
    12         INSERT INTO ingest_search_logging (local_ingest_id, alt_ingest_id, provider_id, ingest_date, total_files_processed, total_files_processed_successfully, total_files_processed_unsuccessfully, records_created, records_updated, records_deleted, number_problem_files) VALUES (DEFAULT, ingest_id_in, provider_id_in,ingest_date_in,total_files_processed_in ,total_files_processed_successfully_in, total_files_processed_unsuccessfully_in ,records_created_in ,records_updated_in ,records_deleted_in ,number_problem_files_in); 
     12        INSERT INTO ingest_search_logging (local_ingest_id, id, ingest_date, total_files_processed, total_files_processed_successfully, total_files_processed_unsuccessfully, records_created, records_updated, records_deleted, number_problem_files) VALUES (DEFAULT, ingest_id_in,ingest_date_in,total_files_processed_in ,total_files_processed_successfully_in, total_files_processed_unsuccessfully_in ,records_created_in ,records_updated_in ,records_deleted_in ,number_problem_files_in); 
    1313         
    1414     END; 
     15$$ LANGUAGE 'plpgsql'; 
     16 
     17DROP FUNCTION add_problem_file(ingest_id_in text, problem_filename_in text, problem_file_message_in text) CASCADE; 
     18CREATE FUNCTION add_problem_file(ingest_id_in text, problem_filename_in text, problem_file_message_in text) RETURNS VOID AS 
     19$$ 
     20    BEGIN 
     21     
     22        INSERT INTO ingest_logging_problem_files(problem_file_id,id,problem_file_name,problem_file_message) VALUES (DEFAULT, ingest_id_in, problem_filename_in, problem_file_message_in); 
     23     
     24    END; 
     25$$ LANGUAGE 'plpgsql'; 
     26 
     27 
     28DROP FUNCTION update_ingest_status(ingest_id_in int4, status_level_in text) CASCADE; 
     29CREATE FUNCTION update_ingest_status(ingest_id_in int4, status_level_in text) RETURNS VOID AS 
     30$$ 
     31    BEGIN 
     32 
     33        UPDATE hi_process set status = status_level_in where id = ingest_id_in; 
     34 
     35    END; 
     36$$ LANGUAGE 'plpgsql'; 
     37 
     38DROP FUNCTION get_metadata_dir(ingest_id_in int4) CASCADE; 
     39CREATE FUNCTION get_metadata_dir(ingest_id_in int4) RETURNS varchar AS 
     40$$ 
     41    DECLARE 
     42        dir varchar; 
     43         
     44    BEGIN 
     45 
     46        SELECT harvest_dir INTO dir from hi_process where id = ingest_id_in; 
     47         
     48        RETURN dir; 
     49 
     50    END; 
     51$$ LANGUAGE 'plpgsql'; 
     52 
     53DROP FUNCTION get_provider_id(ingest_id_in int4) CASCADE; 
     54CREATE FUNCTION get_provider_id(ingest_id_in int4) RETURNS int4 AS 
     55$$ 
     56    DECLARE 
     57        provID int4; 
     58         
     59    BEGIN 
     60 
     61        SELECT provider_id INTO provID from harvest_log where req_id = ingest_id_in; 
     62         
     63        RETURN provID; 
     64 
     65    END; 
     66$$ LANGUAGE 'plpgsql'; 
     67 
     68DROP FUNCTION get_provider_name(prov_id_in int4) CASCADE; 
     69CREATE FUNCTION get_provider_name(prov_id_in int4) RETURNS varchar AS 
     70$$ 
     71    DECLARE 
     72        provName varchar; 
     73         
     74    BEGIN 
     75 
     76        SELECT name INTO provName from provider_common where id = prov_id_in; 
     77         
     78        RETURN provName; 
     79 
     80    END; 
    1581$$ LANGUAGE 'plpgsql'; 
    1682 
     
    2389 
    2490 
     91 
Note: See TracChangeset for help on using the changeset viewer.