Package org.sf.mustru.utils

Examples of org.sf.mustru.utils.DbTools


       throw new RuntimeException("Cannot run two instances of CrawlManager"); }

   //*-- instantiate a new crawl
   ctRef = new CrawlManager();
   if (Constants.getDbt() == null)
   { DbTools dbt = new DbTools();
     dbt.openEnv(Constants.getDBDIR(), false); Constants.setDbt(dbt);
   }
  return(ctRef);
}
View Full Code Here


    catch (IOException ie) { logger.error("IO Error: Could not read spell train file " + ie.getMessage()); }
    catch (ClassNotFoundException ce) { logger.error("Class error: " + ce.getMessage()); }
  }
 
  //*-- Create the databases, if necessary
  DbTools dbt = Constants.getDbt();
  boolean createFlag = true; boolean dupFlag = false
  if (freshCrawl)
  {
   //*-- initialize and create a new database for the list of extracted files and a secondary
   //*-- database for the file signature
   dbt.dropDB(Constants.EXT_FILES_DB);
   dbt.createDB(Constants.EXT_FILES_DB, createFlag, dupFlag);
   logger.info("Created py. database " + Constants.EXT_FILES_DB);
   dbt.dropSecDB(Constants.EXT_FILES_SECDB);
   SecKeyDoc skd = new SecKeyDoc( new IndexableDoc().getBdbBinding() );
   if (dbt.createSecDB(Constants.EXT_FILES_SECDB, false, skd))
    logger.info("Created sec. database " + Constants.EXT_FILES_SECDB);
   dbt.closeSecDB(); dbt.closeDB();

   //*-- create the messages database
   dbt.dropDB(Constants.EXT_MESSAGES_DB);
   dbt.createDB(Constants.EXT_MESSAGES_DB, createFlag, dupFlag);
   logger.info("Created py. database " + Constants.EXT_MESSAGES_DB);
   dbt.closeDB();

  }

  //*-- initialize the timer hash
  timers = Constants.getTIMERS();
View Full Code Here

//*-- create the database environment
private void createDbEnv()
{
  //*-- create the database environment in the Constants
  if (Constants.getDbt() != null) Constants.getDbt().closeEnv();
  DbTools dbt = new DbTools();
  if (Constants.getDBDIR().length() > 0) dbt.openEnv(Constants.getDBDIR(), false);
  Constants.setDbt(dbt);
}
View Full Code Here

  //*-- set the index and database directories
  CrawlConfig crawlConfig = new CrawlConfig(false);   //*-- initialize from the properties file
  Constants.setDBDIR( crawlConfig.getDbDir() ); Constants.setINDEXDIR( crawlConfig.getIndexDir() );

  //*-- Create the Berkeley DB environment for read only access
  dbt = new DbTools(); dbt.openEnv(Constants.getDBDIR(), true);
  Constants.setDbt(dbt);
 
  try { is = SearchTools.getSearcher(Constants.getINDEXDIR(), false); }
  catch (IOException ie) { logger.error("IO Error " + ie.getMessage() ); }

View Full Code Here

TOP

Related Classes of org.sf.mustru.utils.DbTools

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.