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

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

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

/**
 * Get a Repository from the configuration variables
 */
static RyaSailRepository getRepository(Configuration conf)
    throws AccumuloException, AccumuloSecurityException {
  boolean mock = conf.getBoolean(MRUtils.AC_MOCK_PROP, false);
  String instance = conf.get(MRUtils.AC_INSTANCE_PROP, "instance");
  String username = conf.get(MRUtils.AC_USERNAME_PROP, "root");
  String password = conf.get(MRUtils.AC_PWD_PROP, "root");
  Instance accumulo;
  if (mock) {
    accumulo = new MockInstance(instance);
  }
  else {
    String zookeepers = conf.get(MRUtils.AC_ZK_PROP, "zoo");
    accumulo = new ZooKeeperInstance(instance, zookeepers);
  }
  Connector connector = accumulo.getConnector(username, new PasswordToken(password));
  AccumuloRdfConfiguration aconf = new AccumuloRdfConfiguration(conf);
  aconf.setTablePrefix(conf.get(MRUtils.TABLE_PREFIX_PROPERTY,
    RdfCloudTripleStoreConstants.TBL_PRFX_DEF));
  AccumuloRyaDAO dao = new AccumuloRyaDAO();
  dao.setConnector(connector);
  dao.setConf(aconf);
  RdfCloudTripleStore store = new RdfCloudTripleStore();
  store.setRyaDAO(dao);
  return new RyaSailRepository(store);
}
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;
}
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 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;
}
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

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: 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: 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();
}
org.apache.rya.accumuloAccumuloRyaDAOsetConnector

Popular methods of AccumuloRyaDAO

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

Popular in Java

  • Updating database using SQL prepared statement
  • notifyDataSetChanged (ArrayAdapter)
  • putExtra (Intent)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • Menu (java.awt)
  • URLConnection (java.net)
    A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • Collectors (java.util.stream)
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • 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