Examples of ZooKeeperInstance


Examples of io.fathom.auto.zookeeper.ZookeeperInstance

            @Override
            public void run() {
                ConfigPath configRoot = configStore.getConfigRoot();
                ConfigPath zkRoot = configRoot.child("zookeeper");

                ZookeeperInstance zk = new ZookeeperInstance(zkRoot);
                try {
                    zk.run();
                } catch (Exception e) {
                    log.error("Error during ZK run; forcing exit", e);
                    System.exit(1);
                }
            }
View Full Code Here

Examples of org.apache.accumulo.core.client.ZooKeeperInstance

        try {
            config = LumifyTestClusterConfigurationLoader.getConfigurationProperties();
            if (LumifyTestClusterConfigurationLoader.isTestServer()) {
                FormatLumify.deleteElasticSearchIndex(config);

                ZooKeeperInstance zooKeeperInstance = new ZooKeeperInstance(config.getProperty("bigtable.accumulo.instanceName"), config.getProperty("bigtable.accumulo.zookeeperServerNames"));
                Connector connector = zooKeeperInstance.getConnector(config.getProperty("bigtable.accumulo.username"), new PasswordToken(config.getProperty("bigtable.accumulo.password")));
                ModelSession modelSession = new AccumuloSession(connector, true);
                ModelUserContext modelUserContext = modelSession.createModelUserContext(LumifyVisibility.SUPER_USER_VISIBILITY_STRING);
                SystemUser user = new SystemUser(modelUserContext);
                ModelUtil.deleteTables(modelSession, user);
                ModelUtil.initializeTables(modelSession, user);
View Full Code Here

Examples of org.apache.accumulo.core.client.ZooKeeperInstance

   
    String useMock = props.getProperty("useMockInstance");
    if (useMock != null && Boolean.parseBoolean(useMock))
      instance = new MockInstance();
    else
      instance = new ZooKeeperInstance(props.getProperty("instance"), props.getProperty("zookeepers"));
   
    scannerCache = CacheBuilder.newBuilder().expireAfterAccess(10, TimeUnit.MINUTES).maximumSize(1000).removalListener(new CloseScanner()).build();
   
    writerCache = CacheBuilder.newBuilder().expireAfterAccess(10, TimeUnit.MINUTES).maximumSize(1000).removalListener(new CloseWriter()).build();
  }
View Full Code Here

Examples of org.apache.accumulo.core.client.ZooKeeperInstance

 
      try {
        if (mock == null || !mock.equals("true")) {
          String instance = DataStoreFactory.findProperty(properties, this, INSTANCE_NAME_PROPERTY, null);
          String zookeepers = DataStoreFactory.findProperty(properties, this, ZOOKEEPERS_NAME_PROPERTY, null);
          conn = new ZooKeeperInstance(instance, zookeepers).getConnector(user, password);
          authInfo = new AuthInfo(user, ByteBuffer.wrap(password.getBytes()), conn.getInstance().getInstanceID());
        } else {
          conn = new MockInstance().getConnector(user, password);
        }
 
View Full Code Here

Examples of org.apache.accumulo.core.client.ZooKeeperInstance

  @Test
  public void multipleStopsIsAllowed() throws Exception {
    MiniAccumuloCluster accumulo = new MiniAccumuloCluster(folder.getRoot(), "superSecret");
    accumulo.start();
   
    Connector conn = new ZooKeeperInstance(accumulo.getInstanceName(), accumulo.getZooKeepers()).getConnector("root", new PasswordToken("superSecret"));
    conn.tableOperations().create("foo");

    accumulo.stop();
    accumulo.stop();
  }
View Full Code Here

Examples of org.apache.accumulo.core.client.ZooKeeperInstance

 
  public Instance getInstance() {
    if (instance == null) {
      String instance = props.getProperty("INSTANCE");
      String zookeepers = props.getProperty("ZOOKEEPERS");
      this.instance = new ZooKeeperInstance(instance, zookeepers);
    }
    return instance;
  }
View Full Code Here

Examples of org.apache.accumulo.core.client.ZooKeeperInstance

   
  }
 
  @Test(timeout = 30000)
  public void test() throws Exception {
    Connector conn = new ZooKeeperInstance(accumulo.getInstanceName(), accumulo.getZooKeepers()).getConnector("root", new PasswordToken("superSecret"));
   
    conn.tableOperations().create("table1");
   
    conn.securityOperations().createLocalUser("user1", new PasswordToken("pass1"));
    conn.securityOperations().changeUserAuthorizations("user1", new Authorizations("A", "B"));
    conn.securityOperations().grantTablePermission("user1", "table1", TablePermission.WRITE);
    conn.securityOperations().grantTablePermission("user1", "table1", TablePermission.READ);
   
    IteratorSetting is = new IteratorSetting(10, SummingCombiner.class);
    SummingCombiner.setEncodingType(is, LongCombiner.Type.STRING);
    SummingCombiner.setColumns(is, Collections.singletonList(new IteratorSetting.Column("META", "COUNT")));
   
    conn.tableOperations().attachIterator("table1", is);
   
    Connector uconn = new ZooKeeperInstance(accumulo.getInstanceName(), accumulo.getZooKeepers()).getConnector("user1", new PasswordToken("pass1"));
   
    BatchWriter bw = uconn.createBatchWriter("table1", new BatchWriterConfig());
   
    UUID uuid = UUID.randomUUID();
   
View Full Code Here

Examples of org.apache.accumulo.core.client.ZooKeeperInstance

  }
 
  @Test(timeout = 60000)
  public void testPerTableClasspath() throws Exception {
   
    Connector conn = new ZooKeeperInstance(accumulo.getInstanceName(), accumulo.getZooKeepers()).getConnector("root", new PasswordToken("superSecret"));
   
    conn.tableOperations().create("table2");
   
    File jarFile = File.createTempFile("iterator", ".jar");
    FileUtils.copyURLToFile(this.getClass().getResource("/FooFilter.jar"), jarFile);
View Full Code Here

Examples of org.apache.accumulo.core.client.ZooKeeperInstance

  }
 
  // This test seems to be a little too unstable for a unit test
  @Ignore
  public void test() throws Exception {
    ZooKeeperInstance inst = new ZooKeeperInstance(accumulo.getInstanceName(), accumulo.getZooKeepers());
    Connector c = inst.getConnector("root", new PasswordToken(passwd));
   
    final String table = "foobar";
    c.tableOperations().create(table);
   
    BatchWriter bw = null;
View Full Code Here

Examples of org.apache.accumulo.core.client.ZooKeeperInstance

      @SuppressWarnings("deprecation")
      AccumuloConfiguration deprecatedSiteConfiguration = AccumuloConfiguration.getSiteConfiguration();
      instance = getDefaultInstance(deprecatedSiteConfiguration);
    } else if (cl.hasOption(zooKeeperInstance.getOpt())) {
      String[] zkOpts = cl.getOptionValues(zooKeeperInstance.getOpt());
      instance = new ZooKeeperInstance(zkOpts[0], zkOpts[1]);
    } else {
      @SuppressWarnings("deprecation")
      AccumuloConfiguration deprecatedSiteConfiguration = AccumuloConfiguration.getSiteConfiguration();
      instance = getDefaultInstance(deprecatedSiteConfiguration);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.