/** * Diagnostics method to dump a registry robustly. * Any exception raised is swallowed. * * @param verbose verbose path dump * @return the registry tree */ protected String dumpRegistryRobustly(boolean verbose) { try { ZKPathDumper pathDumper = dumpPath(verbose); return pathDumper.toString(); } catch (Exception e) { // ignore LOG.debug("Ignoring exception: {}", e); } return ""; }
/** * Return a path dumper instance which can do a full dump * of the registry tree in its <code>toString()</code> * operation. * * @param verbose verbose flag - includes more details (such as ACLs) * @return a class to dump the registry */ public ZKPathDumper dumpPath(boolean verbose) { return new ZKPathDumper(curator, registryRoot, verbose); }
/** * Trigger the recursive registry dump. * @return a string view of the registry */ @Override public String toString() { StringBuilder builder = new StringBuilder(); builder.append("ZK tree for ").append(root).append('\n'); expand(builder, root, 1); return builder.toString(); }
/** * Diagnostics method to dump a registry robustly. * Any exception raised is swallowed * @param verbose verbose path dump * @return the registry tree */ protected String dumpRegistryRobustly(boolean verbose) { try { ZKPathDumper pathDumper = dumpPath(verbose); return pathDumper.toString(); } catch (Exception e) { // ignore LOG.debug("Ignoring exception: {}", e); } return ""; } }
/** * Trigger the recursive registry dump. * @return a string view of the registry */ @Override public String toString() { StringBuilder builder = new StringBuilder(); builder.append("ZK tree for ").append(root).append('\n'); expand(builder, root, 1); return builder.toString(); }
/** * Return a path dumper instance which can do a full dump * of the registry tree in its <code>toString()</code> * operation * @return a class to dump the registry * @param verbose verbose flag - includes more details (such as ACLs) */ public ZKPathDumper dumpPath(boolean verbose) { return new ZKPathDumper(curator, registryRoot, verbose); }
/** * test that ZK can write as itself * @throws Throwable */ @Test public void testZookeeperCanWriteUnderSystem() throws Throwable { RMRegistryOperationsService rmRegistryOperations = startRMRegistryOperations(); RegistryOperations operations = rmRegistryOperations; operations.mknode(PATH_SYSTEM_SERVICES + "hdfs", false); ZKPathDumper pathDumper = rmRegistryOperations.dumpPath(true); LOG.info(pathDumper.toString()); }
RegistrySecurity.WorldReadWriteACL); ZKPathDumper pathDumper = curator.dumpPath(true); LOG.info(pathDumper.toString()); } finally { logout(login);
RegistrySecurity.WorldReadWriteACL); ZKPathDumper pathDumper = curator.dumpPath(true); LOG.info(pathDumper.toString()); } finally { logout(login);
operations.mknode(base + "/subdir", false); ZKPathDumper pathDumper = registryAdmin.dumpPath(true); LOG.info(pathDumper.toString());
LOG.info(pathDumper.toString());