/** * Tears down the {@link AccumuloRyaDAO}. * @throws Exception */ public void tearDownDao() throws Exception { if (dao != null) { log.info("Stopping " + driverName + " DAO"); try { dao.destroy(); } catch (final RyaDAOException e) { log.error("Error stopping " + driverName + " DAO", e); } dao = null; } }
/** * Tears down the {@link AccumuloRyaDAO}. * @throws Exception */ public void tearDownDao() throws Exception { if (dao != null) { log.info("Stopping " + driverName + " DAO"); try { dao.destroy(); } catch (final RyaDAOException e) { log.error("Error stopping " + driverName + " DAO", e); } dao = null; } }
/** * Tears down the {@link AccumuloRyaDAO}. * @throws Exception */ public void tearDownDao() throws Exception { if (dao != null) { log.info("Stopping " + driverName + " DAO"); try { dao.destroy(); } catch (final RyaDAOException e) { log.error("Error stopping " + driverName + " DAO", e); } dao = null; } }
@Override protected void cleanup(final Context context) throws IOException, InterruptedException { super.cleanup(context); log.info("Cleaning up mapper..."); try { if (childDao != null) { childDao.destroy(); } } catch (final RyaDAOException e) { log.error("Error destroying child DAO", e); } log.info("Cleaned up mapper"); } }
public void close() { try { System.out.println("Closing SailRepositoryConnection"); conn.close(); System.out.println("Shutting down SailRepository"); repository.shutDown(); System.out.println("Shutting down Sail."); sail.shutDown(); dao.destroy(); } catch (RyaDAOException | RepositoryException | SailException e) { System.out.println("Unable to cleanly shut down all resources."); e.printStackTrace(); System.exit(0); } }
@Override protected void cleanup(final Context context) throws IOException, InterruptedException { super.cleanup(context); log.info("Cleaning up mapper..."); if (childScanner != null) { childScanner.close(); } try { if (childDao != null) { childDao.destroy(); } } catch (final RyaDAOException e) { log.error("Error destroying child DAO", e); } log.info("Cleaned up mapper"); } }
public void destroy() throws Exception { logger.info("Shutting down Sparql Query Pig Engine"); pigServer.shutdown(); if (ryaDAO != null) { ryaDAO.destroy(); } if (inferenceEngine != null) { inferenceEngine.destroy(); } if (rdfEvalStatsDAO != null) { rdfEvalStatsDAO.destroy(); } }
ryaIndexer.destroy();
ryaIndexer.destroy();
@Override public void dropAndDestroy() throws RyaDAOException { for (final String tableName : getTables()) { try { if (tableName != null) { drop(tableName); } } catch (final AccumuloSecurityException e) { logger.error(e.getMessage()); throw new RyaDAOException(e); } catch (final AccumuloException e) { logger.error(e.getMessage()); throw new RyaDAOException(e); } catch (final TableNotFoundException e) { logger.warn(e.getMessage()); } } destroy(); for(final AccumuloIndexer indexer : this.secondaryIndexers) { try { indexer.dropAndDestroy(); } catch(final Exception e) { logger.error("Failed to drop and destroy indexer", e); } } }
@Override public void dropAndDestroy() throws RyaDAOException { for (final String tableName : getTables()) { try { if (tableName != null) { drop(tableName); } } catch (final AccumuloSecurityException e) { logger.error(e.getMessage()); throw new RyaDAOException(e); } catch (final AccumuloException e) { logger.error(e.getMessage()); throw new RyaDAOException(e); } catch (final TableNotFoundException e) { logger.warn(e.getMessage()); } } destroy(); for(final AccumuloIndexer indexer : this.secondaryIndexers) { try { indexer.dropAndDestroy(); } catch(final Exception e) { logger.error("Failed to drop and destroy indexer", e); } } }
@After public void teardownRya() { final MiniAccumuloCluster cluster = getMiniAccumuloCluster(); final String instanceName = cluster.getInstanceName(); final String zookeepers = cluster.getZooKeepers(); // Uninstall the instance of Rya. final RyaClient ryaClient = AccumuloRyaClientFactory.build( new AccumuloConnectionDetails(ACCUMULO_USER, ACCUMULO_PASSWORD.toCharArray(), instanceName, zookeepers), super.getAccumuloConnector()); try { ryaClient.getUninstall().uninstall(RYA_INSTANCE_NAME); // Shutdown the repo. if(ryaSailRepo != null) {ryaSailRepo.shutDown();} if(dao != null ) {dao.destroy();} } catch (final Exception e) { System.out.println("Encountered the following Exception when shutting down Rya: " + e.getMessage()); } }
@After public void teardownRya() { final MiniAccumuloCluster cluster = getMiniAccumuloCluster(); final String instanceName = cluster.getInstanceName(); final String zookeepers = cluster.getZooKeepers(); // Uninstall the instance of Rya. final RyaClient ryaClient = AccumuloRyaClientFactory.build( new AccumuloConnectionDetails(ACCUMULO_USER, ACCUMULO_PASSWORD.toCharArray(), instanceName, zookeepers), super.getAccumuloConnector()); try { ryaClient.getUninstall().uninstall(RYA_INSTANCE_NAME); // Shutdown the repo. if(ryaSailRepo != null) {ryaSailRepo.shutDown();} if(dao != null ) {dao.destroy();} } catch (final Exception e) { System.out.println("Encountered the following Exception when shutting down Rya: " + e.getMessage()); } }
ryaDAO.destroy(); } catch (RyaDAOException e) { logger.error("Exception closing ryadao", e);
static void setUpRya() throws AccumuloException, AccumuloSecurityException, RyaDAOException { MockInstance mock = new MockInstance(INSTANCE_NAME); Connector conn = mock.getConnector(USERNAME, new PasswordToken(USERP)); AccumuloRyaDAO dao = new AccumuloRyaDAO(); dao.setConnector(conn); AccumuloRdfConfiguration conf = new AccumuloRdfConfiguration(); conf.setTablePrefix(PREFIX); dao.setConf(conf); dao.init(); String ns = "http://example.com/"; dao.add(new RyaStatement(new RyaURI(ns+"s1"), new RyaURI(ns+"p1"), new RyaURI(ns+"o1"))); dao.add(new RyaStatement(new RyaURI(ns+"s1"), new RyaURI(ns+"p2"), new RyaURI(ns+"o2"))); dao.add(new RyaStatement(new RyaURI(ns+"s2"), new RyaURI(ns+"p1"), new RyaURI(ns+"o3"), new RyaURI(ns+"g1"))); dao.add(new RyaStatement(new RyaURI(ns+"s3"), new RyaURI(ns+"p3"), new RyaURI(ns+"o3"), new RyaURI(ns+"g2"))); dao.destroy(); }
static void setUpRya() throws AccumuloException, AccumuloSecurityException, RyaDAOException { MockInstance mock = new MockInstance(INSTANCE_NAME); Connector conn = mock.getConnector(USERNAME, new PasswordToken(USERP)); AccumuloRyaDAO dao = new AccumuloRyaDAO(); dao.setConnector(conn); AccumuloRdfConfiguration conf = new AccumuloRdfConfiguration(); conf.setTablePrefix(PREFIX); dao.setConf(conf); dao.init(); String ns = "http://example.com/"; dao.add(new RyaStatement(new RyaIRI(ns+"s1"), new RyaIRI(ns+"p1"), new RyaIRI(ns+"o1"))); dao.add(new RyaStatement(new RyaIRI(ns+"s1"), new RyaIRI(ns+"p2"), new RyaIRI(ns+"o2"))); dao.add(new RyaStatement(new RyaIRI(ns+"s2"), new RyaIRI(ns+"p1"), new RyaIRI(ns+"o3"), new RyaIRI(ns+"g1"))); dao.add(new RyaStatement(new RyaIRI(ns+"s3"), new RyaIRI(ns+"p3"), new RyaIRI(ns+"o3"), new RyaIRI(ns+"g2"))); dao.destroy(); }