public static String readAll(MiniAccumuloClusterImpl c, Class<?> klass, Process p) throws Exception { for (LogWriter writer : c.getLogWriters()) writer.flush(); return readAll(new FileInputStream( c.getConfig().getLogDir() + "/" + klass.getSimpleName() + "_" + p.hashCode() + ".out")); }
@Override public Entry<Integer,String> execWithStdout(Class<?> clz, String[] args) throws IOException { Process p = cluster.exec(clz, args); int exitCode; try { exitCode = p.waitFor(); } catch (InterruptedException e) { log.warn("Interrupted waiting for process to exit", e); Thread.currentThread().interrupt(); throw new IOException(e); } for (LogWriter writer : cluster.getLogWriters()) { writer.flush(); } return Maps.immutableEntry(exitCode, readAll(new FileInputStream(cluster.getConfig().getLogDir() + "/" + clz.getSimpleName() + "_" + p.hashCode() + ".out"))); }
builder.environment().put("ACCUMULO_LOG_DIR", config.getLogDir().getAbsolutePath()); builder.environment().put("ACCUMULO_CLIENT_CONF_PATH", config.getClientConfFile().getAbsolutePath()); new File(config.getLogDir(), clazz.getSimpleName() + "_" + process.hashCode() + ".err")); logWriters.add(lw); lw.start(); lw = new LogWriter(process.getInputStream(), new File(config.getLogDir(), clazz.getSimpleName() + "_" + process.hashCode() + ".out")); logWriters.add(lw); lw.start();
private static void printInfo(MiniAccumuloCluster accumulo, int shutdownPort) { System.out.println("Mini Accumulo Cluster\n"); System.out.println(String.format(FORMAT_STRING, "Directory:", accumulo.getConfig().getDir().getAbsoluteFile())); System.out.println(String.format(FORMAT_STRING, "Logs:", accumulo.getConfig().getImpl().getLogDir().getAbsoluteFile())); System.out.println( String.format(FORMAT_STRING, "Instance Name:", accumulo.getConfig().getInstanceName())); System.out.println( String.format(FORMAT_STRING, "Root Password:", accumulo.getConfig().getRootPassword())); System.out.println(String.format(FORMAT_STRING, "ZooKeeper:", accumulo.getZooKeepers())); for (Pair<ServerType,Integer> pair : accumulo.getDebugPorts()) { System.out.println(String.format(FORMAT_STRING, pair.getFirst().prettyPrint() + " JDWP Host:", "localhost:" + pair.getSecond())); } System.out.println(String.format(FORMAT_STRING, "Shutdown Port:", shutdownPort)); System.out.println(); System.out.println(" To connect with shell, use the following command : "); System.out.println(" accumulo shell -zh " + accumulo.getZooKeepers() + " -zi " + accumulo.getConfig().getInstanceName() + " -u root "); System.out.println("\n\nSuccessfully started on " + new Date()); } }
File[] files = getCluster().getConfig().getLogDir().listFiles(); assertNotNull(files); for (File file : files) {
+ ret + ". Check the logs in " + config.getLogDir() + " for errors.");
Map<String,String> env = builder.environment(); env.put("ACCUMULO_HOME", cluster.getConfig().getDir().getAbsolutePath()); env.put("ACCUMULO_LOG_DIR", cluster.getConfig().getLogDir().getAbsolutePath()); String trickFilename = cluster.getConfig().getLogDir().getAbsolutePath() + "/TRICK_FILE"; env.put("TRICK_FILE", trickFilename); String libPath = System.getProperty("user.dir") + "/target/fake_disk_failure.so";
throw new ZooKeeperBindException("Zookeeper did not start within " + (config.getZooKeeperStartupTime() / 1000) + " seconds. Check the logs in " + config.getLogDir() + " for errors. Last exception: " + e); if (ret != 0) { throw new RuntimeException("Initialize process returned " + ret + ". Check the logs in " + config.getLogDir() + " for errors."); + ". Check the logs in " + config.getLogDir() + " for errors.");
mkdirs(config.getLogDir()); mkdirs(config.getLibDir()); mkdirs(config.getLibExtDir());