@Test public void testGetNamespace() throws Exception { dao.addNamespace("ns", litdupsNS); assertEquals(litdupsNS, dao.getNamespace("ns")); dao.removeNamespace("ns"); assertNull(dao.getNamespace("ns")); }
@Override public String getNamespace(final String pfx) throws RyaDAOException { try { final Scanner scanner = connector.createScanner(tableLayoutStrategy.getNs(), ALL_AUTHORIZATIONS); scanner.fetchColumn(INFO_NAMESPACE_TXT, EMPTY_TEXT); scanner.setRange(new Range(new Text(pfx))); final Iterator<Map.Entry<Key, Value>> iterator = scanner .iterator(); if (iterator.hasNext()) { return new String(iterator.next().getValue().get(), StandardCharsets.UTF_8); } } catch (final Exception e) { throw new RyaDAOException(e); } return null; }
AccumuloRyaDAO implements RyaDAO<AccumuloRdfConfiguration>, RyaNamespaceManager<AccumuloRdfConfiguration> { @Override public String getNamespace(final String pfx) throws RyaDAOException { try { final Scanner scanner = connector.createScanner(tableLayoutStrategy.getNs(), ALL_AUTHORIZATIONS); scanner.fetchColumn(INFO_NAMESPACE_TXT, EMPTY_TEXT); scanner.setRange(new Range(new Text(pfx))); final Iterator<Map.Entry<Key, Value>> iterator = scanner .iterator(); if (iterator.hasNext()) { return new String(iterator.next().getValue().get(), StandardCharsets.UTF_8); } } catch (final Exception e) { throw new RyaDAOException(e); } return null; } }
AccumuloRyaDAO implements RyaDAO<AccumuloRdfConfiguration>, RyaNamespaceManager<AccumuloRdfConfiguration> { @Override public String getNamespace(final String pfx) throws RyaDAOException { try { final Scanner scanner = connector.createScanner(tableLayoutStrategy.getNs(), ALL_AUTHORIZATIONS); scanner.fetchColumn(INFO_NAMESPACE_TXT, EMPTY_TEXT); scanner.setRange(new Range(new Text(pfx))); final Iterator<Map.Entry<Key, Value>> iterator = scanner .iterator(); if (iterator.hasNext()) { return new String(iterator.next().getValue().get(), StandardCharsets.UTF_8); } } catch (final Exception e) { throw new RyaDAOException(e); } return null; }  }
AccumuloRyaDAO implements RyaDAO<AccumuloRdfConfiguration>, RyaNamespaceManager<AccumuloRdfConfiguration> { @Override public String getNamespace(final String pfx) throws RyaDAOException { try { final Scanner scanner = connector.createScanner(tableLayoutStrategy.getNs(), ALL_AUTHORIZATIONS); scanner.fetchColumn(INFO_NAMESPACE_TXT, EMPTY_TEXT); scanner.setRange(new Range(new Text(pfx))); final Iterator<Map.Entry<Key, Value>> iterator = scanner .iterator(); if (iterator.hasNext()) { return new String(iterator.next().getValue().get(), StandardCharsets.UTF_8); } } catch (final Exception e) { throw new RyaDAOException(e); } return null; }  @Override boolean isInitialized(); @Override void init(); @Override String getVersion(); @Override void add(final RyaStatement statement); @Override void add(final Iterator<RyaStatement> iter); @Override void delete(final RyaStatement stmt, final AccumuloRdfConfiguration aconf); @Override void delete(final Iterator<RyaStatement> statements, final AccumuloRdfConfiguration conf); @Override void dropGraph(final AccumuloRdfConfiguration conf, final RyaIRI... graphs); @Override void destroy(); @Override void addNamespace(final String pfx, final String namespace); @Override String getNamespace(final String pfx); @Override void removeNamespace(final String pfx); @SuppressWarnings({ "unchecked", "rawtypes" }) @Override CloseableIteration<Namespace, RyaDAOException> iterateNamespace(); @Override RyaNamespaceManager<AccumuloRdfConfiguration> getNamespaceManager(); @Override void purge(final RdfCloudTripleStoreConfiguration configuration); @Override void dropAndDestroy(); synchronized Connector getConnector(); synchronized void setConnector(final Connector connector); BatchWriterConfig getBatchWriterConfig(); void setBatchWriterConfig(final BatchWriterConfig batchWriterConfig); @Override synchronized AccumuloRdfConfiguration getConf(); @Override synchronized void setConf(final AccumuloRdfConfiguration conf); RyaTableMutationsFactory getRyaTableMutationsFactory(); void setRyaTableMutationsFactory(final RyaTableMutationsFactory ryaTableMutationsFactory); @Override AccumuloRyaQueryEngine getQueryEngine(); void setQueryEngine(final AccumuloRyaQueryEngine queryEngine); @Override void flush(); }
AccumuloRyaDAO implements RyaDAO<AccumuloRdfConfiguration>, RyaNamespaceManager<AccumuloRdfConfiguration> { @Override public String getNamespace(final String pfx) throws RyaDAOException { try { final Scanner scanner = connector.createScanner(tableLayoutStrategy.getNs(), ALL_AUTHORIZATIONS); scanner.fetchColumn(INFO_NAMESPACE_TXT, EMPTY_TEXT); scanner.setRange(new Range(new Text(pfx))); final Iterator<Map.Entry<Key, Value>> iterator = scanner .iterator(); if (iterator.hasNext()) { return new String(iterator.next().getValue().get(), StandardCharsets.UTF_8); } } catch (final Exception e) { throw new RyaDAOException(e); } return null; }  @Override boolean isInitialized(); @Override void init(); @Override String getVersion(); @Override void add(final RyaStatement statement); @Override void add(final Iterator<RyaStatement> iter); @Override void delete(final RyaStatement stmt, final AccumuloRdfConfiguration aconf); @Override void delete(final Iterator<RyaStatement> statements, final AccumuloRdfConfiguration conf); @Override void dropGraph(final AccumuloRdfConfiguration conf, final RyaIRI... graphs); @Override void destroy(); @Override void addNamespace(final String pfx, final String namespace); @Override String getNamespace(final String pfx); @Override void removeNamespace(final String pfx); @SuppressWarnings({ "unchecked", "rawtypes" }) @Override CloseableIteration<Namespace, RyaDAOException> iterateNamespace(); @Override RyaNamespaceManager<AccumuloRdfConfiguration> getNamespaceManager(); @Override void purge(final RdfCloudTripleStoreConfiguration configuration); @Override void dropAndDestroy(); synchronized Connector getConnector(); synchronized void setConnector(final Connector connector); BatchWriterConfig getBatchWriterConfig(); void setBatchWriterConfig(final BatchWriterConfig batchWriterConfig); @Override synchronized AccumuloRdfConfiguration getConf(); @Override synchronized void setConf(final AccumuloRdfConfiguration conf); RyaTableMutationsFactory getRyaTableMutationsFactory(); void setRyaTableMutationsFactory(final RyaTableMutationsFactory ryaTableMutationsFactory); @Override AccumuloRyaQueryEngine getQueryEngine(); void setQueryEngine(final AccumuloRyaQueryEngine queryEngine); @Override void flush();  }