<commit_before>// HDF5Module.cc

// This file is part of bes, A C++ back-end server implementation framework
// for the OPeNDAP Data Access Protocol.

// Copyright (c) 2004,2005 University Corporation for Atmospheric Research
// Author: <NAME> <<EMAIL>>
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
// 
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
// Lesser General Public License for more details.
// 
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
//
// You can contact University Corporation for Atmospheric Research at
// 3080 Center Green Drive, Boulder, CO 80301
 
// (c) COPYRIGHT University Corporation for Atmostpheric Research 2004-2005
// Please read the full copyright statement in the file COPYRIGHT_UCAR.
//
// Authors:
//      pwest       <NAME> <<EMAIL>>

#include <iostream>

using std::endl ;

#include "HDF5Module.h"
#include "BESRequestHandlerList.h"
#include "HDF5RequestHandler.h"
#include "BESContainerStorageList.h"
#include "BESContainerStorageCatalog.h"
#include "BESCatalogDirectory.h"
#include "BESCatalogList.h"
#include "BESLog.h"

#define HDF5_CATALOG "catalog"

void
HDF5Module::initialize( const string &modname )
{
    if( BESLog::TheLog()->is_verbose() )
	(*BESLog::TheLog()) << "Initializing HDF5:" << endl ;

    if( BESLog::TheLog()->is_verbose() )
	(*BESLog::TheLog()) << "    adding " << modname << " request handler" 
		      << endl ;
    BESRequestHandlerList::TheList()->add_handler( modname, new HDF5RequestHandler( modname ) ) ;

    if( BESLog::TheLog()->is_verbose() )
	(*BESLog::TheLog()) << "    adding " << HDF5_CATALOG << " catalog" 
		      << endl ;
    BESCatalogList::TheCatalogList()->add_catalog( new BESCatalogDirectory( HDF5_CATALOG ) ) ;

    if( BESLog::TheLog()->is_verbose() )
	(*BESLog::TheLog()) << "Adding Catalog Container Storage" << endl;
    BESContainerStorageCatalog *csc = new BESContainerStorageCatalog( HDF5_CATALOG ) ;
    BESContainerStorageList::TheList()->add_persistence( csc ) ;
}

void
HDF5Module::terminate( const string &modname )
{
    if( BESLog::TheLog()->is_verbose() )
	(*BESLog::TheLog()) << "Removing HDF5 Handlers" << endl;
    BESRequestHandler *rh = BESRequestHandlerList::TheList()->remove_handler( modname ) ;
    if( rh ) delete rh ;

    if( BESLog::TheLog()->is_verbose() )
	(*BESLog::TheLog()) << "Removing catalog Container Storage" << endl;
    BESContainerStorageList::TheList()->del_persistence( HDF5_CATALOG ) ;
}<commit_msg>Using BESDebug rather then BESLog. Removing all things added in this module in the terminate method. M    HDF5Module.cc<commit_after>// HDF5Module.cc

// This file is part of bes, A C++ back-end server implementation framework
// for the OPeNDAP Data Access Protocol.

// Copyright (c) 2004,2005 University Corporation for Atmospheric Research
// Author: <NAME> <<EMAIL>>
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
// 
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
// Lesser General Public License for more details.
// 
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
//
// You can contact University Corporation for Atmospheric Research at
// 3080 Center Green Drive, Boulder, CO 80301
 
// (c) COPYRIGHT University Corporation for Atmostpheric Research 2004-2005
// Please read the full copyright statement in the file COPYRIGHT_UCAR.
//
// Authors:
//      pwest       <NAME> <<EMAIL>>

#include <iostream>

using std::endl ;

#include "HDF5Module.h"
#include "BESRequestHandlerList.h"
#include "HDF5RequestHandler.h"
#include "BESContainerStorageList.h"
#include "BESContainerStorageCatalog.h"
#include "BESCatalogDirectory.h"
#include "BESCatalogList.h"
#include "BESDebug.h"

#define HDF5_CATALOG "catalog"

void
HDF5Module::initialize( const string &modname )
{
    BESDEBUG( "Initializing HDF5 module " << modname << endl )

    BESDEBUG( "    adding " << modname << " request handler" << endl )
    BESRequestHandler *handler = new HDF5RequestHandler( modname ) ;
    BESRequestHandlerList::TheList()->add_handler( modname, handler ) ;

    BESDEBUG( "    adding " << HDF5_CATALOG << " catalog" << endl )
    BESCatalogList::TheCatalogList()->add_catalog( new BESCatalogDirectory( HDF5_CATALOG ) ) ;

    BESDEBUG( "    adding catalog container storage " << HDF5_CATALOG << endl )
    BESContainerStorageCatalog *csc = new BESContainerStorageCatalog( HDF5_CATALOG ) ;
    BESContainerStorageList::TheList()->add_persistence( csc ) ;

    BESDEBUG( "Done Initializing HDF5 " << modname << endl )
}

void
HDF5Module::terminate( const string &modname )
{
    BESDEBUG( "Cleaning HDF5 module " << modname << endl )

    BESDEBUG( "    removing " << modname << " request handler" << endl )
    BESRequestHandler *rh = BESRequestHandlerList::TheList()->remove_handler( modname ) ;
    if( rh ) delete rh ;

    BESDEBUG( "    removing catalog container storage " << HDF5_CATALOG << endl )
    BESContainerStorageList::TheList()->del_persistence( HDF5_CATALOG ) ;

    BESDEBUG( "    removing " << HDF5_CATALOG << " catalog" << endl )
    BESCatalogList::TheCatalogList()->del_catalog( HDF5_CATALOG ) ;

    BESDEBUG( "Done Cleaning HDF5 module " << modname << endl )
}
{'fraction_non_alphanumeric': 0.11498708010335917, 'fraction_numerical': 0.01857235142118863, 'mean_word_length': 4.092927631578948, 'pattern_counts': {'":': 0, '<': 97, '<?xml version=': 0, '>': 34, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6364415', 'n_tokens_mistral': 1955, 'n_tokens_neox': 1875, 'n_words': 615}