Commit 5a42cc7d authored by Marco De Marco's avatar Marco De Marco
Browse files

First ingestion test works

parent 1d1369db
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
#================================================================================
EXEC_NAME=fitsImporter-srv
INST_NAME=test
DEBUG_LEV=-v7
DEBUG_LEV=-v1
#================================================================================
INC_DIR=/usr/local/omniORB-4.1.7/include \
	   /usr/local/zeromq-3.2.3/include/zmq \
+20 −3
Original line number Diff line number Diff line
@@ -66,6 +66,12 @@ void DMDBVerifier::testInstrumentMapping(Instrument::SP instrument_sp)
    
    Destination::SP destination_sp = instrument_sp->getDestination();
  
#ifdef VERBOSE_DEBUG
    INFO_STREAM << destination_sp->getHost() << ":" << destination_sp->getPort() << " "
        << destination_sp->getSchema() << "." << destination_sp->getTable() << endl;
    INFO_STREAM << "-------------------------------------------------" << endl;
#endif    
    
    Mapping::SPVector mapping_spvector = destination_sp->getMappingSPVector();
    
	ConnectionManager::SessionSP session_sp = 
@@ -97,7 +103,7 @@ void DMDBVerifier::testInstrumentMapping(Instrument::SP instrument_sp)
    {
        std::stringstream error_stream;
        error_stream << "DMDBVerifier::testInstrumentMapping() "
            << destination_sp->getHost() << ":" << destination_sp->getPort()
            << destination_sp->getHost() << ":" << destination_sp->getPort() << " "
            << destination_sp->getSchema() << "." << destination_sp->getTable()
            << " " << ex.what();
        throw std::runtime_error(error_stream.str());
@@ -123,7 +129,7 @@ void DMDBVerifier::testColumnDefinition(ColumnTupleVector& columnTuple_vector,
        throw std::runtime_error(error_stream.str());
    }
    
    if(it->get<1>())
    if(!it->get<1>())
    {
        std::stringstream error_stream;
        error_stream << "\"" << columnName << "\" empty column type "
@@ -131,6 +137,12 @@ void DMDBVerifier::testColumnDefinition(ColumnTupleVector& columnTuple_vector,
        throw std::runtime_error(error_stream.str());
    }

#ifdef VERBOSE_DEBUG
    INFO_STREAM << "Column name: " << it->get<0>().get() 
        << " column type: " << it->get<1>().get() << endl;
    INFO_STREAM << "-------------------------------------------------" << endl;
#endif    
    
    if(it->get<1>().get().find(columnType) == std::string::npos)
    {
        std::stringstream error_stream;
@@ -138,13 +150,18 @@ void DMDBVerifier::testColumnDefinition(ColumnTupleVector& columnTuple_vector,
            << columnType << "\" type differs form information schema";
        throw std::runtime_error(error_stream.str());
    }
    
#ifdef VERBOSE_DEBUG
    INFO_STREAM << "Column name: " << columnName << " column type: " 
        << columnType << " OK" << endl;
    INFO_STREAM << "-------------------------------------------------" << endl;
#endif    
}

//==============================================================================
//      DMDBVerifier::isEqual()
//==============================================================================
bool DMDBVerifier::isEqual(ColumnTuple columnTuple, std::string columnName)
    throw(std::runtime_error)
{
    DEBUG_STREAM << "DMDBVerifier::isEqual()" << endl;
    
+1 −2
Original line number Diff line number Diff line
@@ -66,8 +66,7 @@ protected:
    virtual void testColumnDefinition(ColumnTupleVector&, 
        std::string, std::string) throw(std::runtime_error);
    
    virtual bool isEqual(ColumnTuple, std::string) 
        throw(std::runtime_error);
    virtual bool isEqual(ColumnTuple, std::string);
    
//------------------------------------------------------------------------------
//	[Protected] Class variables
+19 −0
Original line number Diff line number Diff line
#include <EventThread.h>
#include <FitsImporter.h>
#include <DMDBVerifier.h>
#include <WorkerThread.h>

#include <cassert>
@@ -70,6 +71,8 @@ void EventThread::start() throw(std::runtime_error)

    initConnectionManager();

    verifyDMDBMapping();
    
    initThreadGroup();
}

@@ -187,6 +190,22 @@ void EventThread::initConnectionManager() throw(std::runtime_error)
		 m_configuration_sp, m_instrumentList_spvector);
}

//==============================================================================
//	EventThread::verifyDMDBMapping()
//==============================================================================
void EventThread::verifyDMDBMapping() throw(std::runtime_error)
{
    DEBUG_STREAM << "EventThread::verifyDMDBMapping()" << endl;
    
    DMDBVerifier::SP dMDBVerifier_sp = 
        DMDBVerifier::create(m_fitsImporter_p, m_connectionManager_sp);
    
    dMDBVerifier_sp->testInstrumentListMapping(m_instrumentList_spvector);
    
    if(m_defaultInstrument_sp)
        dMDBVerifier_sp->testInstrumentMapping(m_defaultInstrument_sp);
}

//==============================================================================
//	EventThread::initThreadGroup()
//==============================================================================
+2 −0
Original line number Diff line number Diff line
@@ -69,6 +69,8 @@ protected:

	virtual void initConnectionManager() throw(std::runtime_error);
    
    virtual void verifyDMDBMapping() throw(std::runtime_error);
		
	virtual void initThreadGroup() throw(std::runtime_error);
		    
    virtual void eventLoop();
+1 −1

File changed.

Contains only whitespace changes.

Loading