@Override public void init() throws DBException { colFam = new Text(getProperties().getProperty("accumulo.columnFamily")); colFamBytes = colFam.toString().getBytes(UTF_8); inst = new ZooKeeperInstance( getProperties().getProperty("accumulo.instanceName"), getProperties().getProperty("accumulo.zooKeepers")); try { String principal = getProperties().getProperty("accumulo.username"); AuthenticationToken token = new PasswordToken(getProperties().getProperty("accumulo.password")); connector = inst.getConnector(principal, token); } catch (AccumuloException | AccumuloSecurityException e) { throw new DBException(e); } if (!(getProperties().getProperty("accumulo.pcFlag", "none").equals("none"))) { System.err.println("Sorry, the ZK based producer/consumer implementation has been removed. " + "Please see YCSB issue #416 for work on adding a general solution to coordinated work."); } }
@Override public void init() throws DBException { colFam = new Text(getProperties().getProperty("accumulo.columnFamily")); colFamBytes = colFam.toString().getBytes(UTF_8); inst = new ZooKeeperInstance(new ClientConfiguration() .withInstance(getProperties().getProperty("accumulo.instanceName")) .withZkHosts(getProperties().getProperty("accumulo.zooKeepers"))); try { String principal = getProperties().getProperty("accumulo.username"); AuthenticationToken token = new PasswordToken(getProperties().getProperty("accumulo.password")); connector = inst.getConnector(principal, token); } catch (AccumuloException | AccumuloSecurityException e) { throw new DBException(e); } if (!(getProperties().getProperty("accumulo.pcFlag", "none").equals("none"))) { System.err.println("Sorry, the ZK based producer/consumer implementation has been removed. " + "Please see YCSB issue #416 for work on adding a general solution to coordinated work."); } }
@Override public void init() throws DBException { colFam = new Text(getProperties().getProperty("accumulo.columnFamily")); colFamBytes = colFam.toString().getBytes(UTF_8); inst = new ZooKeeperInstance(new ClientConfiguration() .withInstance(getProperties().getProperty("accumulo.instanceName")) .withZkHosts(getProperties().getProperty("accumulo.zooKeepers"))); try { String principal = getProperties().getProperty("accumulo.username"); AuthenticationToken token = new PasswordToken(getProperties().getProperty("accumulo.password")); connector = inst.getConnector(principal, token); } catch (AccumuloException | AccumuloSecurityException e) { throw new DBException(e); } if (!(getProperties().getProperty("accumulo.pcFlag", "none").equals("none"))) { System.err.println("Sorry, the ZK based producer/consumer implementation has been removed. " + "Please see YCSB issue #416 for work on adding a general solution to coordinated work."); } }
@Override @Deprecated public Connector getConnector(String user, CharSequence pass) throws AccumuloException, AccumuloSecurityException { return getConnector(user, TextUtil.getBytes(new Text(pass.toString()))); }
@Override @Deprecated public Connector getConnector(String principal, byte[] pass) throws AccumuloException, AccumuloSecurityException { return getConnector(principal, new PasswordToken(pass)); }
@Override @Deprecated public Connector getConnector(String user, ByteBuffer pass) throws AccumuloException, AccumuloSecurityException { return getConnector(user, ByteBufferUtil.toBytes(pass)); }
public QueryUtil(String instanceName, String zooKeepers, String user, String password, String tableName, Authorizations auths) throws AccumuloException, AccumuloSecurityException { ZooKeeperInstance instance = new ZooKeeperInstance(instanceName, zooKeepers); conn = instance.getConnector(user, password.getBytes()); this.tableName = tableName; this.auths = auths; }
private static BatchWriter setupBatchWriter(String instance, String zooKeepers, String table, String user, String pass) throws Exception { ZooKeeperInstance zinstance = new ZooKeeperInstance(instance, zooKeepers); Connector conn = zinstance.getConnector(user, pass.getBytes()); return conn.createBatchWriter(table, 50000000, 300000l, 4); }
public FileDataQuery(String instanceName, String zooKeepers, String user, String password, String tableName, Authorizations auths) throws AccumuloException, AccumuloSecurityException, TableNotFoundException { ZooKeeperInstance instance = new ZooKeeperInstance(instanceName, zooKeepers); conn = instance.getConnector(user, password.getBytes()); lastRefs = new ArrayList<Entry<Key,Value>>(); cis = new ChunkInputStream(); scanner = conn.createScanner(tableName, auths); }
@SuppressWarnings("unused") // used in D4M public TriangleIngestor(final String instanceName, final String zookeepers, final String username, final String password) throws AccumuloSecurityException, AccumuloException { this(new ZooKeeperInstance(instanceName, zookeepers).getConnector(username, new PasswordToken(password))); } public TriangleIngestor(final Connector connector) {
public static Connector warehouseConnection(Configuration c) throws AccumuloException, AccumuloSecurityException { final String whZk = c.get(MetricsConfig.WAREHOUSE_ZOOKEEPERS), whInst = c.get(MetricsConfig.WAREHOUSE_INSTANCE), whUser = c .get(MetricsConfig.WAREHOUSE_USERNAME), whPass = c.get(MetricsConfig.WAREHOUSE_PASSWORD); return new ZooKeeperInstance(ClientConfiguration.loadDefault().withInstance(whInst).withZkHosts(whZk)).getConnector(whUser, new PasswordToken(whPass)); } }
public static Connector metricsConnection(Configuration c) throws AccumuloException, AccumuloSecurityException { final String mtxZk = c.get(MetricsConfig.ZOOKEEPERS), mtxInst = c.get(MetricsConfig.INSTANCE), mtxUser = c.get(MetricsConfig.USER), mtxPass = c .get(MetricsConfig.PASS); return new ZooKeeperInstance(ClientConfiguration.loadDefault().withInstance(mtxInst).withZkHosts(mtxZk)).getConnector(mtxUser, new PasswordToken( mtxPass)); }
@Override public Void run() throws Exception { ZooKeeperInstance inst = new ZooKeeperInstance(mac.getClientConfig()); try { inst.getConnector(userWithoutCredentials3, new KerberosToken(userWithoutCredentials3)); Assert.fail("Should not be able to create a Connector as this user cannot be proxied"); } catch (org.apache.accumulo.core.client.AccumuloSecurityException e) { // Expected, this user cannot be proxied } return null; } });
@Override public Void run() throws Exception { ZooKeeperInstance inst = new ZooKeeperInstance(mac.getClientConfig()); Connector conn = inst.getConnector(userWithoutCredentials1, new KerberosToken(userWithoutCredentials1)); Scanner s = conn.createScanner(tableName, Authorizations.EMPTY); assertFalse(s.iterator().hasNext()); return null; } });
public Connector createConnector() throws AccumuloSecurityException, AccumuloException { LOGGER.info("Connecting to accumulo instance [{}] zookeeper servers [{}]", this.getAccumuloInstanceName(), this.getZookeeperServers()); ZooKeeperInstance instance = new ZooKeeperInstance(this.getAccumuloInstanceName(), this.getZookeeperServers()); return instance.getConnector(this.getAccumuloUsername(), this.getAuthenticationToken()); }
public Connector createConnector() throws AccumuloSecurityException, AccumuloException { LOGGER.info("Connecting to accumulo instance [{}] zookeeper servers [{}]", this.getAccumuloInstanceName(), this.getZookeeperServers()); ZooKeeperInstance instance = new ZooKeeperInstance(this.getAccumuloInstanceName(), this.getZookeeperServers()); return instance.getConnector(this.getAccumuloUsername(), this.getAuthenticationToken()); }
public Connector createConnector() { try { LOGGER.info("Connecting to accumulo instance [%s] zookeeper servers [%s]", this.getAccumuloInstanceName(), this.getZookeeperServers()); ZooKeeperInstance instance = new ZooKeeperInstance(getClientConfiguration()); return instance.getConnector(this.getAccumuloUsername(), this.getAuthenticationToken()); } catch (Exception ex) { throw new VertexiumException( String.format("Could not connect to Accumulo instance [%s] zookeeper servers [%s]", this.getAccumuloInstanceName(), this.getZookeeperServers()), ex ); } }
private static Connector getConnector(FluoConfiguration fluoConfig) throws Exception { ZooKeeperInstance zki = new ZooKeeperInstance( new ClientConfiguration().withInstance(fluoConfig.getAccumuloInstance()) .withZkHosts(fluoConfig.getAccumuloZookeepers())); Connector conn = zki.getConnector(fluoConfig.getAccumuloUser(), new PasswordToken(fluoConfig.getAccumuloPassword())); return conn; }
private static Connector getConnector(FluoConfiguration fluoConfig) throws Exception { ZooKeeperInstance zki = new ZooKeeperInstance(new ClientConfiguration().withInstance( fluoConfig.getAccumuloInstance()).withZkHosts(fluoConfig.getAccumuloZookeepers())); Connector conn = zki.getConnector(fluoConfig.getAccumuloUser(), new PasswordToken(fluoConfig.getAccumuloPassword())); return conn; }
public OsmProvider(final OSMIngestCommandArgs args, final AccumuloRequiredOptions store) throws AccumuloSecurityException, AccumuloException, TableNotFoundException { conn = new ZooKeeperInstance(store.getInstance(), store.getZookeeper()).getConnector( store.getUser(), new PasswordToken(store.getPassword())); bs = conn.createBatchScanner( args.getQualifiedTableName(), new Authorizations(args.getVisibilityOptions().getVisibility()), 1); }