/** * @return location of client conf file containing connection parameters for connecting to this * minicluster * * @since 1.6.0 */ public File getClientConfFile() { return new File(getConfDir(), "client.conf"); }
private void setCoreSite(MiniAccumuloClusterImpl cluster) throws Exception { File csFile = new File(cluster.getConfig().getConfDir(), "core-site.xml"); if (csFile.exists()) throw new RuntimeException(csFile + " already exist"); Configuration coreSite = new Configuration(false); coreSite.set("fs.file.impl", RawLocalFileSystem.class.getName()); OutputStream out = new BufferedOutputStream( new FileOutputStream(new File(cluster.getConfig().getConfDir(), "core-site.xml"))); coreSite.writeXml(out); out.close(); }
@Override public void beforeClusterStart(MiniAccumuloConfigImpl cfg) throws Exception { cfg.setNumTservers(1); File confDir = cfg.getConfDir(); try { FileUtils.copyInputStreamToFile( MonitorLoggingIT.class.getResourceAsStream("/conf/generic_logger.xml"), new File(confDir, "generic_logger.xml")); FileUtils.copyInputStreamToFile( MonitorLoggingIT.class.getResourceAsStream("/conf/monitor_logger.xml"), new File(confDir, "monitor_logger.xml")); } catch (Exception e) { log.error("Failed to copy Log4J XML files to conf dir", e); } }
@Override public void beforeClusterStart(MiniAccumuloConfigImpl cfg) throws Exception { File f = new File(cfg.getConfDir(), "auditLog.xml"); if (f.delete()) { log.debug("Deleted " + f); } cfg.setNumTservers(1); }
File proxyPropertiesFile = new File(cfg.getConfDir(), "proxy.properties"); if (proxyPropertiesFile.exists()) { assertTrue("Failed to delete proxy.properties file", proxyPropertiesFile.delete());
Process _exec(Class<?> clazz, ServerType serverType, Map<String,String> configOverrides, String... args) throws IOException { List<String> jvmOpts = new ArrayList<>(); jvmOpts.add("-Xmx" + config.getMemory(serverType)); if (configOverrides != null && !configOverrides.isEmpty()) { File siteFile = File.createTempFile("accumulo-site", ".xml", config.getConfDir()); Map<String,String> confMap = new HashMap<>(); confMap.putAll(config.getSiteConfig()); confMap.putAll(configOverrides); writeConfig(siteFile, confMap.entrySet()); jvmOpts.add("-Dorg.apache.accumulo.config.file=" + siteFile.getName()); } if (config.isJDWPEnabled()) { Integer port = PortUtils.getRandomFreePort(); jvmOpts.addAll(buildRemoteDebugParams(port)); debugPorts.add(new Pair<>(serverType, port)); } return _exec(clazz, jvmOpts, args); }
classpathBuilder.append(config.getConfDir().getAbsolutePath());
if (env != null) builder.environment().put("ZOOKEEPER_HOME", env); builder.environment().put("ACCUMULO_CONF_DIR", config.getConfDir().getAbsolutePath());
File keystoreFile = new File(getConfDir(), "credential-provider.jks"); String keystoreUri = "jceks://file" + keystoreFile.getAbsolutePath(); Configuration conf = CredentialProviderFactoryShim.getConfiguration(keystoreUri);
private void createMiniAccumulo() throws Exception { // createTestDir will give us a empty directory, we don't need to clean it up ourselves File baseDir = createTestDir(this.getClass().getName() + "_" + this.testName.getMethodName()); MiniAccumuloConfigImpl cfg = new MiniAccumuloConfigImpl(baseDir, ROOT_PASSWORD); String nativePathInDevTree = NativeMapIT.nativeMapLocation().getAbsolutePath(); String nativePathInMapReduce = new File(System.getProperty("user.dir")).toString(); cfg.setNativeLibPaths(nativePathInDevTree, nativePathInMapReduce); cfg.setProperty(Property.GC_FILE_ARCHIVE, Boolean.TRUE.toString()); Configuration coreSite = new Configuration(false); configure(cfg, coreSite); cfg.setProperty(Property.TSERV_NATIVEMAP_ENABLED, Boolean.TRUE.toString()); configureForEnvironment(cfg, getClass(), getSslDir(baseDir)); cluster = new MiniAccumuloClusterImpl(cfg); if (coreSite.size() > 0) { File csFile = new File(cluster.getConfig().getConfDir(), "core-site.xml"); if (csFile.exists()) { coreSite.addResource(new Path(csFile.getAbsolutePath())); } File tmp = new File(csFile.getAbsolutePath() + ".tmp"); OutputStream out = new BufferedOutputStream(new FileOutputStream(tmp)); coreSite.writeXml(out); out.close(); assertTrue(tmp.renameTo(csFile)); } beforeClusterStart(cfg); }
File csFile = new File(miniCluster.getConfig().getConfDir(), "core-site.xml"); if (csFile.exists()) throw new RuntimeException(csFile + " already exist"); new FileOutputStream(new File(miniCluster.getConfig().getConfDir(), "core-site.xml"))); coreSite.writeXml(out); out.close();
new Path(cluster.getConfig().getConfDir().toURI().toString(), "accumulo-site.xml")); v1.toString() + "," + v2.toString() + "," + v3.toString()); BufferedOutputStream fos = new BufferedOutputStream( new FileOutputStream(new File(cluster.getConfig().getConfDir(), "accumulo-site.xml"))); conf.writeXml(fos); fos.close();
new Path(cluster.getConfig().getConfDir().toURI().toString(), "accumulo-site.xml")); new FileOutputStream(new File(cluster.getConfig().getConfDir(), "accumulo-site.xml"))); conf.writeXml(fos); fos.close();
new Path(cluster.getConfig().getConfDir().toURI().toString(), "accumulo-site.xml")); new FileOutputStream(new File(cluster.getConfig().getConfDir(), "accumulo-site.xml"))); conf.writeXml(fos); fos.close();
new Path(cluster.getConfig().getConfDir().toURI().toString(), "accumulo-site.xml")); new FileOutputStream(new File(cluster.getConfig().getConfDir(), "accumulo-site.xml"))); conf.writeXml(fos); fos.close();
mkdirs(config.getConfDir()); mkdirs(config.getLogDir()); mkdirs(config.getLibDir()); InetSocketAddress dfsAddress = miniDFS.getNameNode().getNameNodeAddress(); dfsUri = "hdfs://" + dfsAddress.getHostName() + ":" + dfsAddress.getPort(); File coreFile = new File(config.getConfDir(), "core-site.xml"); writeConfig(coreFile, Collections.singletonMap("fs.default.name", dfsUri).entrySet()); File hdfsFile = new File(config.getConfDir(), "hdfs-site.xml"); writeConfig(hdfsFile, conf); File siteFile = new File(config.getConfDir(), "accumulo-site.xml"); writeConfig(siteFile, config.getSiteConfig().entrySet()); zooCfgFile = new File(config.getConfDir(), "zoo.cfg"); FileWriter fileWriter = new FileWriter(zooCfgFile); FileUtils.copyInputStreamToFile(auditStream, new File(config.getConfDir(), "auditLog.xml"));
String clientConfPath = new File(SharedMiniClusterBase.getCluster().getConfig().getConfDir(), "client.conf").getAbsolutePath(); props.put("clientConfigurationFile", clientConfPath);
new File(getCluster().getConfig().getConfDir(), "accumulo-site.xml"), hadoopConfDir); .println("conf " + new File(getCluster().getConfig().getConfDir(), "accumulo-site.xml"));
new Path(cluster.getConfig().getConfDir().toURI().toString(), "accumulo-site.xml")); conf.set(Property.INSTANCE_VOLUMES.getKey(), v1.toString() + "," + v2.toString()); BufferedOutputStream fos = new BufferedOutputStream( new FileOutputStream(new File(cluster.getConfig().getConfDir(), "accumulo-site.xml"))); conf.writeXml(fos); fos.close();
new File(getCluster().getConfig().getConfDir(), "accumulo-site.xml"), hadoopConfDir);