Tabnine Logo
AccumuloRyaDAO
Code IndexAdd Tabnine to your IDE (free)

How to use
AccumuloRyaDAO
in
org.apache.rya.accumulo

Best Java code snippets using org.apache.rya.accumulo.AccumuloRyaDAO (Showing top 20 results out of 315)

origin: apache/incubator-rya

/**
 * Sets up a {@link AccumuloRyaDAO} with the specified connector and config.
 * @param connector the {@link Connector}.
 * @param accumuloRdfConfiguration the {@link AccumuloRdfConfiguration}.
 * @return the {@link AccumuloRyaDAO}.
 */
public static AccumuloRyaDAO setupDao(final Connector connector, final AccumuloRdfConfiguration accumuloRdfConfiguration) {
  final AccumuloRyaDAO accumuloRyaDao = new AccumuloRyaDAO();
  accumuloRyaDao.setConnector(connector);
  accumuloRyaDao.setConf(accumuloRdfConfiguration);
  try {
    accumuloRyaDao.init();
  } catch (final RyaDAOException e) {
    log.error("Error initializing DAO", e);
  }
  return accumuloRyaDao;
}
origin: org.apache.rya/rya.export.accumulo

/**
 * 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;
  }
}
origin: apache/incubator-rya

/**
 * Insert a statement into the child Accumulo instance via the child DAO.
 * @param rstmt RyaStatement to add to the child
 * @param context Map context, not used
 * @throws IOException if the DAO encounters an error adding the statement to Accumulo
 */
@Override
protected void copyStatement(final RyaStatement rstmt, final Context context) throws IOException {
  try {
    childDao.add(rstmt);
  }
  catch (final RyaDAOException e) {
    throw new IOException("Error inserting statement into child Rya DAO", e);
  }
}
origin: org.apache.rya/rya.export.accumulo

@Override
public void removeStatement(final RyaStatement statement) throws RemoveStatementException {
  try {
    accumuloRyaDao.delete(statement, accumuloRyaDao.getConf());
  } catch (final RyaDAOException e) {
    throw new RemoveStatementException("Unable to delete the Rya Statement", e);
  }
}
origin: apache/incubator-rya

public StatementMetadataExample(AccumuloRdfConfiguration conf) throws Exception {
  Connector aConn = ConfigUtils.getConnector(conf);
  dao = new AccumuloRyaDAO();
  dao.setConnector(aConn);
  dao.init();
  sail = RyaSailFactory.getInstance(conf);
  repository = new SailRepository(sail);
  conn = repository.getConnection();
}
origin: apache/incubator-rya

private RdfCloudTripleStoreConnection getRyaSailConnection() throws AccumuloException,
    AccumuloSecurityException, SailException {
  RdfCloudTripleStore store = new RdfCloudTripleStore();
  AccumuloRyaDAO crdfdao = new AccumuloRyaDAO();
  crdfdao.setConnector(accCon);
  AccumuloRdfConfiguration acc = new AccumuloRdfConfiguration(conf);
  crdfdao.setConf(acc);
  store.setRyaDAO(crdfdao);
  store.initialize();
  return (RdfCloudTripleStoreConnection) store.getConnection();
}
origin: apache/incubator-rya

final AccumuloRyaDAO dao = new AccumuloRyaDAO();
dao.setConnector(accumuloConn);
dao.setConf(makeConfig());
dao.init();
    makeRyaStatement(vf.createStatement(vf.createIRI("http://David"), vf.createIRI("http://worksAt"), vf.createIRI("http://Chipotle")), "V"));
dao.add(historicTriples.iterator());
dao.flush();
origin: apache/incubator-rya

dao.add(statement1);
dao.add(statement2);
dao.delete(Arrays.asList(statement1, statement2).iterator(), getConf());
origin: org.apache.rya/accumulo.rya

@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);
    }
  }
}
origin: org.apache.rya/rya.export.accumulo

@Override
public void addStatement(final RyaStatement statement) throws AddStatementException {
  try {
    accumuloRyaDao.add(statement);
    accumuloRyaDao.flush();
    //This is a hack since a statement re-added with the same timestamp won't reappear since its been marked for deletion.
    //RYA-197 is the ticket for fixing this hack.
    if(!containsStatement(statement)) {
      statement.setTimestamp(statement.getTimestamp() + 1L);
      accumuloRyaDao.add(statement);
    }
  } catch (final RyaDAOException | ContainsStatementException e) {
    throw new AddStatementException("Unable to add the Rya Statement", e);
  }
}
origin: apache/incubator-rya

private void flush(final Context context) throws IOException, InterruptedException {
  try {
    childDao.flush();
  } catch (final RyaDAOException e) {
    throw new IOException("Error writing to in-memory table", e);
      final Scanner scanner = childDao.getConnector().createScanner(table, childAuths);
      for (final Map.Entry<Key, Value> row : scanner) {
        compositeKey.setKey(row.getKey());
origin: org.apache.rya/accumulo.rya

@Override
public void delete(final RyaStatement stmt, final AccumuloRdfConfiguration aconf) throws RyaDAOException {
  this.delete(Iterators.singletonIterator(stmt), aconf);
}
origin: org.apache.rya/rya.indexing

private RdfCloudTripleStoreConnection getRyaSailConnection() throws AccumuloException,
    AccumuloSecurityException, SailException {
  RdfCloudTripleStore store = new RdfCloudTripleStore();
  AccumuloRyaDAO crdfdao = new AccumuloRyaDAO();
  crdfdao.setConnector(accCon);
  AccumuloRdfConfiguration acc = new AccumuloRdfConfiguration(conf);
  crdfdao.setConf(acc);
  store.setRyaDAO(crdfdao);
  store.initialize();
  return (RdfCloudTripleStoreConnection) store.getConnection();
}
origin: apache/incubator-rya

dao.add(statement1);
dao.add(statement2);
dao.add(statement3);
dao.delete(Arrays.asList(statement1, statement2, statement3).iterator(), getConf());
origin: apache/incubator-rya

@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);
    }
  }
}
origin: apache/incubator-rya

@Override
public void addStatement(final RyaStatement statement) throws AddStatementException {
  try {
    accumuloRyaDao.add(statement);
    accumuloRyaDao.flush();
    //This is a hack since a statement re-added with the same timestamp won't reappear since its been marked for deletion.
    //RYA-197 is the ticket for fixing this hack.
    if(!containsStatement(statement)) {
      statement.setTimestamp(statement.getTimestamp() + 1L);
      accumuloRyaDao.add(statement);
    }
  } catch (final RyaDAOException | ContainsStatementException e) {
    throw new AddStatementException("Unable to add the Rya Statement", e);
  }
}
origin: apache/incubator-rya

@Override
public void removeStatement(final RyaStatement statement) throws RemoveStatementException {
  try {
    accumuloRyaDao.delete(statement, accumuloRyaDao.getConf());
  } catch (final RyaDAOException e) {
    throw new RemoveStatementException("Unable to delete the Rya Statement", e);
  }
}
origin: apache/incubator-rya

@Override
public void delete(final RyaStatement stmt, final AccumuloRdfConfiguration aconf) throws RyaDAOException {
  this.delete(Iterators.singletonIterator(stmt), aconf);
}
origin: org.apache.rya/rya.export.accumulo

  /**
   * Sets up a {@link AccumuloRyaDAO} with the specified connector and config.
   * @param connector the {@link Connector}.
   * @param accumuloRdfConfiguration the {@link AccumuloRdfConfiguration}.
   * @return the {@link AccumuloRyaDAO}.
   */
  public static AccumuloRyaDAO setupDao(final Connector connector, final AccumuloRdfConfiguration accumuloRdfConfiguration) {
    final AccumuloRyaDAO accumuloRyaDao = new AccumuloRyaDAO();
    accumuloRyaDao.setConnector(connector);
    accumuloRyaDao.setConf(accumuloRdfConfiguration);

    try {
      accumuloRyaDao.init();
    } catch (final RyaDAOException e) {
      log.error("Error initializing DAO", e);
    }

    return accumuloRyaDao;
  }
}
origin: org.apache.rya/rya.pcj.fluo.client

private static RyaSailRepository makeRyaRepository(final PcjAdminClientProperties clientProps, final Connector accumulo) throws RepositoryException {
  checkNotNull(clientProps);
  checkNotNull(accumulo);
  // Setup Rya configuration values.
  final AccumuloRdfConfiguration ryaConf = new AccumuloRdfConfiguration();
  ryaConf.setTablePrefix( clientProps.getRyaTablePrefix() );
  // Connect to the Rya repo.
  final AccumuloRyaDAO accumuloRyaDao = new AccumuloRyaDAO();
  accumuloRyaDao.setConnector(accumulo);
  accumuloRyaDao.setConf(ryaConf);
  final RdfCloudTripleStore ryaStore = new RdfCloudTripleStore();
  ryaStore.setRyaDAO(accumuloRyaDao);
  final RyaSailRepository ryaRepo = new RyaSailRepository(ryaStore);
  ryaRepo.initialize();
  return ryaRepo;
}
org.apache.rya.accumuloAccumuloRyaDAO

Most used methods

  • <init>
  • setConnector
  • setConf
  • destroy
  • init
  • add
  • delete
  • flush
  • getConnector
  • getConf
  • getQueryEngine
  • checkVersion
  • getQueryEngine,
  • checkVersion,
  • commit,
  • compact,
  • createBatchDeleter,
  • deleteSingleRyaStatement,
  • drop,
  • flushIndexers,
  • getTables,
  • getVersion

Popular in Java

  • Start an intent from android
  • getSupportFragmentManager (FragmentActivity)
  • getSystemService (Context)
  • getResourceAsStream (ClassLoader)
  • String (java.lang)
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • DataSource (javax.sql)
    An interface for the creation of Connection objects which represent a connection to a database. This
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now