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

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

Best Java code snippets using org.apache.rya.accumulo.AccumuloRyaDAO.init (Showing top 18 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: 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

  /**
   * 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.mapreduce

private static AccumuloRyaDAO getRyaIndexer(final Configuration conf) throws IOException {
  try {
    if (!conf.getBoolean(ENABLE_CORE, true)) {
      return null;
    }
    final AccumuloRyaDAO ryaIndexer = new AccumuloRyaDAO();
    final Connector conn = ConfigUtils.getConnector(conf);
    ryaIndexer.setConnector(conn);
    final AccumuloRdfConfiguration ryaConf = new AccumuloRdfConfiguration();
    final String tablePrefix = conf.get(OUTPUT_PREFIX_PROPERTY, null);
    if (tablePrefix != null) {
      ryaConf.setTablePrefix(tablePrefix);
    }
    ryaConf.setDisplayQueryPlan(false);
    ryaIndexer.setConf(ryaConf);
    ryaIndexer.init();
    return ryaIndexer;
  } catch (final AccumuloException e) {
    logger.error("Cannot create RyaIndexer", e);
    throw new IOException(e);
  } catch (final AccumuloSecurityException e) {
    logger.error("Cannot create RyaIndexer", e);
    throw new IOException(e);
  } catch (final RyaDAOException e) {
    logger.error("Cannot create RyaIndexer", e);
    throw new IOException(e);
  }
}
origin: apache/incubator-rya

private static AccumuloRyaDAO getRyaIndexer(final Configuration conf) throws IOException {
  try {
    if (!conf.getBoolean(ENABLE_CORE, true)) {
      return null;
    }
    final AccumuloRyaDAO ryaIndexer = new AccumuloRyaDAO();
    final Connector conn = ConfigUtils.getConnector(conf);
    ryaIndexer.setConnector(conn);
    final AccumuloRdfConfiguration ryaConf = new AccumuloRdfConfiguration();
    final String tablePrefix = conf.get(OUTPUT_PREFIX_PROPERTY, null);
    if (tablePrefix != null) {
      ryaConf.setTablePrefix(tablePrefix);
    }
    ryaConf.setDisplayQueryPlan(false);
    ryaIndexer.setConf(ryaConf);
    ryaIndexer.init();
    return ryaIndexer;
  } catch (final AccumuloException e) {
    logger.error("Cannot create RyaIndexer", e);
    throw new IOException(e);
  } catch (final AccumuloSecurityException e) {
    logger.error("Cannot create RyaIndexer", e);
    throw new IOException(e);
  } catch (final RyaDAOException e) {
    logger.error("Cannot create RyaIndexer", e);
    throw new IOException(e);
  }
}
origin: apache/incubator-rya

/**
 * Sets up the {@link AccumuloRyaDAO}.
 * @throws Exception
 */
public void setUpDao() throws Exception {
  // Setup dao
  log.info("Creating " + driverName + " DAO");
  dao = new AccumuloRyaDAO();
  dao.setConnector(connector);
  dao.setConf(config);
  // Flush the tables before initializing the DAO
  for (final String tableName : tableList) {
    connector.tableOperations().flush(tableName, null, null, false);
  }
  dao.init();
}
origin: org.apache.rya/rya.export.accumulo

/**
 * Sets up the {@link AccumuloRyaDAO}.
 * @throws Exception
 */
public void setUpDao() throws Exception {
  // Setup dao
  log.info("Creating " + driverName + " DAO");
  dao = new AccumuloRyaDAO();
  dao.setConnector(connector);
  dao.setConf(config);
  // Flush the tables before initializing the DAO
  for (final String tableName : tableList) {
    connector.tableOperations().flush(tableName, null, null, false);
  }
  dao.init();
}
origin: apache/incubator-rya

/**
 * Sets up the {@link AccumuloRyaDAO}.
 * @throws Exception
 */
public void setUpDao() throws Exception {
  // Setup dao
  log.info("Creating " + driverName + " DAO");
  dao = new AccumuloRyaDAO();
  dao.setConnector(connector);
  dao.setConf(config);
  // Flush the tables before initializing the DAO
  for (final String tableName : tableList) {
    connector.tableOperations().flush(tableName, null, null, false);
  }
  dao.init();
}
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: org.apache.rya/rya.indexing

/**
 * Creates AccumuloRyaDAO without updating the AccumuloRdfConfiguration.  This method does not force
 * the user's configuration to be consistent with the Rya Instance configuration.  As a result, new index
 * tables might be created when using this method.  This method does not require the {@link AccumuloRyaInstanceDetailsRepository}
 * to exist.  This is for internal use, backwards compatibility and testing purposes only.  It is recommended that
 * {@link RyaSailFactory#getAccumuloDAOWithUpdatedConfig(AccumuloRdfConfiguration)} be used for new installations of Rya.
 *
 * @param config - user configuration
 * @return - AccumuloRyaDAO with Indexers configured according to user's specification
 * @throws AccumuloException
 * @throws AccumuloSecurityException
 * @throws RyaDAOException
 */
public static AccumuloRyaDAO getAccumuloDAO(final AccumuloRdfConfiguration config) throws AccumuloException, AccumuloSecurityException, RyaDAOException {
  final Connector connector = ConfigUtils.getConnector(config);
  final AccumuloRyaDAO dao = new AccumuloRyaDAO();
  dao.setConnector(connector);
  ConfigUtils.setIndexers(config);
  dao.setConf(config);
  dao.init();
  return dao;
}
origin: apache/incubator-rya

/**
 * Creates AccumuloRyaDAO without updating the AccumuloRdfConfiguration.  This method does not force
 * the user's configuration to be consistent with the Rya Instance configuration.  As a result, new index
 * tables might be created when using this method.  This method does not require the {@link AccumuloRyaInstanceDetailsRepository}
 * to exist.  This is for internal use, backwards compatibility and testing purposes only.  It is recommended that
 * {@link RyaSailFactory#getAccumuloDAOWithUpdatedConfig(AccumuloRdfConfiguration)} be used for new installations of Rya.
 *
 * @param config - user configuration
 * @return - AccumuloRyaDAO with Indexers configured according to user's specification
 * @throws AccumuloException
 * @throws AccumuloSecurityException
 * @throws RyaDAOException
 */
public static AccumuloRyaDAO getAccumuloDAO(final AccumuloRdfConfiguration config) throws AccumuloException, AccumuloSecurityException, RyaDAOException {
  final Connector connector = ConfigUtils.getConnector(config);
  final AccumuloRyaDAO dao = new AccumuloRyaDAO();
  dao.setConnector(connector);
  ConfigUtils.setIndexers(config);
  dao.setConf(config);
  dao.init();
  return dao;
}
origin: apache/incubator-rya

  throw new IOException(e);
ryaDAO.init();
inferenceEngine.setConf(rdfConf);
inferenceEngine.setRyaDAO(ryaDAO);
origin: apache/incubator-rya

ryaDAO.setConf(conf);
ryaDAO.setConnector(connector);
ryaDAO.init();
origin: org.apache.rya/rya.indexing

@Override
public Sail getSail(final SailImplConfig config) throws SailConfigException {
  try {
    final RdfCloudTripleStore store = new RdfCloudTripleStore();
    final RyaAccumuloSailConfig cbconfig = (RyaAccumuloSailConfig) config;
    final String instanceName = cbconfig.getInstance();
    final String zooKeepers = cbconfig.getZookeepers();
    Instance i;
    if (cbconfig.isMock()) {
      i = new MockInstance(instanceName);
    } else {
      i = new ZooKeeperInstance(instanceName, zooKeepers);
    }
    final String user = cbconfig.getUser();
    final String pass = cbconfig.getPassword();
    final Connector connector = i.getConnector(user, new PasswordToken(pass));
    final AccumuloRyaDAO crdfdao = new AccumuloRyaDAO();
    crdfdao.setConnector(connector);
    final AccumuloRdfConfiguration conf = cbconfig.toRdfConfiguation();
    ConfigUtils.setIndexers(conf);
    conf.setDisplayQueryPlan(true);
    crdfdao.setConf(conf);
    crdfdao.init();
    store.setRyaDAO(crdfdao);
    return store;
  } catch (RyaDAOException | AccumuloException | AccumuloSecurityException e) {
    throw new SailConfigException(e);
  }
}
origin: apache/incubator-rya

@Override
public Sail getSail(final SailImplConfig config) throws SailConfigException {
  try {
    final RdfCloudTripleStore store = new RdfCloudTripleStore();
    final RyaAccumuloSailConfig cbconfig = (RyaAccumuloSailConfig) config;
    final String instanceName = cbconfig.getInstance();
    final String zooKeepers = cbconfig.getZookeepers();
    Instance i;
    if (cbconfig.isMock()) {
      i = new MockInstance(instanceName);
    } else {
      i = new ZooKeeperInstance(instanceName, zooKeepers);
    }
    final String user = cbconfig.getUser();
    final String pass = cbconfig.getPassword();
    final Connector connector = i.getConnector(user, new PasswordToken(pass));
    final AccumuloRyaDAO crdfdao = new AccumuloRyaDAO();
    crdfdao.setConnector(connector);
    final AccumuloRdfConfiguration conf = cbconfig.toRdfConfiguation();
    ConfigUtils.setIndexers(conf);
    conf.setDisplayQueryPlan(true);
    crdfdao.setConf(conf);
    crdfdao.init();
    store.setRyaDAO(crdfdao);
    return store;
  } catch (RyaDAOException | AccumuloException | AccumuloSecurityException e) {
    throw new SailConfigException(e);
  }
}
origin: org.apache.rya/rya.mapreduce

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

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

dao.setConnector(accumuloConn);
dao.setConf(makeConfig());
dao.init();
org.apache.rya.accumuloAccumuloRyaDAOinit

Popular methods of AccumuloRyaDAO

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

Popular in Java

  • Making http requests using okhttp
  • notifyDataSetChanged (ArrayAdapter)
  • getSupportFragmentManager (FragmentActivity)
  • getApplicationContext (Context)
  • String (java.lang)
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • Socket (java.net)
    Provides a client-side TCP socket.
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • CodeWhisperer alternatives
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