/** * @return zookeeper connection string */ public String getZooKeepers() { return impl.getZooKeepers(); }
proxyProperties.setProperty("maxFrameSize", "16M"); proxyProperties.setProperty("instance", mac.getInstanceName()); proxyProperties.setProperty("zookeepers", mac.getZooKeepers()); proxyProperties.setProperty("thriftServerType", "sasl"); proxyProperties.setProperty("kerberosPrincipal", proxyPrincipal);
@Test public void testSystemCredentials() throws Exception { assertEquals(0, exec(SystemCredentialsIT.class, "good", getCluster().getZooKeepers()).waitFor()); assertEquals(FAIL_CODE, exec(SystemCredentialsIT.class, "bad", getCluster().getZooKeepers()).waitFor()); assertEquals(BAD_PASSWD_FAIL_CODE, exec(SystemCredentialsIT.class, "bad_password", getCluster().getZooKeepers()).waitFor()); }
@Test public void shutdownDuringDelete() throws Exception { assertEquals(0, cluster.exec(TestIngest.class, "-i", cluster.getInstanceName(), "-z", cluster.getZooKeepers(), "-u", "root", "-p", ROOT_PASSWORD, "--createTable").waitFor()); Process deleter = cluster.exec(TestRandomDeletes.class, "-i", cluster.getInstanceName(), "-z", cluster.getZooKeepers(), "-u", "root", "-p", ROOT_PASSWORD); sleepUninterruptibly(100, TimeUnit.MILLISECONDS); assertEquals(0, cluster.exec(Admin.class, "stopAll").waitFor()); deleter.destroy(); }
@Test public void shutdownDuringQuery() throws Exception { assertEquals(0, cluster.exec(TestIngest.class, "-i", cluster.getInstanceName(), "-z", cluster.getZooKeepers(), "-u", "root", "-p", ROOT_PASSWORD, "--createTable").waitFor()); Process verify = cluster.exec(VerifyIngest.class, "-i", cluster.getInstanceName(), "-z", cluster.getZooKeepers(), "-u", "root", "-p", ROOT_PASSWORD); sleepUninterruptibly(100, TimeUnit.MILLISECONDS); assertEquals(0, cluster.exec(Admin.class, "stopAll").waitFor()); verify.destroy(); }
@Test public void shutdownDuringIngest() throws Exception { Process ingest = cluster.exec(TestIngest.class, "-i", cluster.getInstanceName(), "-z", cluster.getZooKeepers(), "-u", "root", "-p", ROOT_PASSWORD, "--createTable"); sleepUninterruptibly(100, TimeUnit.MILLISECONDS); assertEquals(0, cluster.exec(Admin.class, "stopAll").waitFor()); ingest.destroy(); }
static void runAdminStopTest(Connector c, MiniAccumuloClusterImpl cluster) throws InterruptedException, IOException { assertEquals(0, cluster.exec(TestIngest.class, "-i", cluster.getInstanceName(), "-z", cluster.getZooKeepers(), "-u", "root", "-p", ROOT_PASSWORD, "--createTable").waitFor()); List<String> tabletServers = c.instanceOperations().getTabletServers(); assertEquals(2, tabletServers.size()); String doomed = tabletServers.get(0); log.info("Stopping " + doomed); assertEquals(0, cluster.exec(Admin.class, "stop", doomed).waitFor()); tabletServers = c.instanceOperations().getTabletServers(); assertEquals(1, tabletServers.size()); assertFalse(tabletServers.get(0).equals(doomed)); }
Instance instance = conn.getInstance(); ZooReaderWriter zk = new ZooReaderWriter(cluster.getZooKeepers(), 30000, OUR_SECRET); String path = ZooUtil.getRoot(instance) + Constants.ZGC_LOCK; for (int i = 0; i < 5; i++) {
@Override public ClientConfiguration getClientConfig() { return ClientConfiguration.fromMap(config.getSiteConfig()).withInstance(this.getInstanceName()) .withZkHosts(this.getZooKeepers()); }
private void killMacGc() throws ProcessNotFoundException, InterruptedException, KeeperException { // kill gc started by MAC getCluster().killProcess(ServerType.GARBAGE_COLLECTOR, getCluster().getProcesses().get(ServerType.GARBAGE_COLLECTOR).iterator().next()); // delete lock in zookeeper if there, this will allow next GC to start quickly String path = ZooUtil.getRoot(new ZooKeeperInstance(getCluster().getClientConfig())) + Constants.ZGC_LOCK; ZooReaderWriter zk = new ZooReaderWriter(cluster.getZooKeepers(), 30000, OUR_SECRET); try { ZooLock.deleteLock(zk, path); } catch (IllegalStateException e) { } assertNull(getCluster().getProcesses().get(ServerType.GARBAGE_COLLECTOR)); }
@Test public void testMR() throws Exception { Connector c = getConnector(); String instanceName = getCluster().getInstanceName(); String table1 = instanceName + "_t1"; String table2 = instanceName + "_t2"; c.tableOperations().create(table1); c.tableOperations().create(table2); BatchWriter bw = c.createBatchWriter(table1, new BatchWriterConfig()); for (int i = 0; i < 100; i++) { Mutation m = new Mutation(new Text(String.format("%09x", i + 1))); m.put(new Text(), new Text(), new Value(String.format("%09x", i).getBytes())); bw.addMutation(m); } bw.close(); MRTester.main(new String[] {"root", ROOT_PASSWORD, table1, table2, instanceName, getCluster().getZooKeepers()}); assertNull(e1); Scanner scanner = c.createScanner(table2, new Authorizations()); Iterator<Entry<Key,Value>> iter = scanner.iterator(); assertTrue(iter.hasNext()); Entry<Key,Value> entry = iter.next(); assertEquals(Integer.parseInt(new String(entry.getValue().get())), 100); assertFalse(iter.hasNext()); }
ZooReader zreader = new ZooReader(cluster.getZooKeepers(), 30000); String zpath = ZooUtil.getRoot(new ZooKeeperInstance(cluster.getClientConfig())) + RootTable.ZROOT_TABLET_PATH;
ZooReader zreader = new ZooReader(cluster.getZooKeepers(), 30000); String zpath = ZooUtil.getRoot(new ZooKeeperInstance(cluster.getClientConfig())) + RootTable.ZROOT_TABLET_PATH;
int rows = 100 * 1000; ingest = cluster.exec(TestIngest.class, "-u", "root", "-i", cluster.getInstanceName(), "-z", cluster.getZooKeepers(), "-p", ROOT_PASSWORD, "--rows", rows + ""); sleepUninterruptibly(500, TimeUnit.MILLISECONDS);
assertEquals(1, cluster.exec(RandomizeVolumes.class, "-z", cluster.getZooKeepers(), "-i", c.getInstance().getInstanceName(), "-t", tableName).waitFor());
ReplicaSystemFactory.getPeerConfigurationValue(AccumuloReplicaSystem.class, AccumuloReplicaSystem.buildConfiguration(peerCluster.getInstanceName(), peerCluster.getZooKeepers())));
String secret = getCluster().getSiteConfiguration().get(Property.INSTANCE_SECRET); IZooReaderWriter writer = new ZooReaderWriterFactory() .getZooReaderWriter(cluster.getZooKeepers(), 30 * 1000, secret); String root = "/accumulo/" + getConnector().getInstance().getInstanceID(); List<String> children = Collections.emptyList();
getCluster().getConfig().getSiteConfig().get(Property.INSTANCE_ZK_TIMEOUT.getKey())); IZooReaderWriter zrw = new ZooReaderWriterFactory().getZooReaderWriter( getCluster().getZooKeepers(), (int) zkTimeout, defaultConfig.get(Property.INSTANCE_SECRET)); final String zInstanceRoot = Constants.ZROOT + "/" + conn.getInstance().getInstanceID(); while (!AccumuloStatus.isAccumuloOffline(zrw, zInstanceRoot)) {
ReplicaSystemFactory.getPeerConfigurationValue(AccumuloReplicaSystem.class, AccumuloReplicaSystem.buildConfiguration(peerCluster.getInstanceName(), peerCluster.getZooKeepers())));
ReplicaSystemFactory.getPeerConfigurationValue(AccumuloReplicaSystem.class, AccumuloReplicaSystem.buildConfiguration(peerCluster.getInstanceName(), peerCluster.getZooKeepers())));