Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,10 @@ public class MiniAccumuloClusterImpl implements AccumuloCluster {
private final AtomicReference<MiniDFSCluster> miniDFS = new AtomicReference<>();
private final List<Process> cleanup = new ArrayList<>();
private final MiniAccumuloClusterControl clusterControl;
private final Set<String> defaultJvmOpts =
Set.of("-XX:+PerfDisableSharedMem", "-XX:+AlwaysPreTouch");
private final Map<String,String> defaultSystemProps =
Map.of("apple.awt.UIElement", "true", "java.net.preferIPv4Stack", "true");

private boolean initialized = false;
private ExecutorService executor;
Expand Down Expand Up @@ -348,8 +352,13 @@ private ProcessInfo _exec(Class<?> clazz, List<String> extraJvmOpts, String... a
String javaBin = javaHome + File.separator + "bin" + File.separator + "java";

var basicArgs = Stream.of(javaBin, "-Dproc=" + clazz.getSimpleName());
var jvmOptions = Stream.concat(config.getJvmOptions().stream(), extraJvmOpts.stream());
var systemProps = config.getSystemProperties().entrySet().stream()

var jvmOptions =
Stream.concat(Stream.concat(defaultJvmOpts.stream(), config.getJvmOptions().stream()),
extraJvmOpts.stream());
var systemProps = Stream
.concat(defaultSystemProps.entrySet().stream(),
config.getSystemProperties().entrySet().stream())
.map(e -> String.format("-D%s=%s", e.getKey(), e.getValue()));

var classArgs = Stream.of(Main.class.getName(), clazz.getName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public class MiniAccumuloConfigImpl {
MONITOR, Monitor.class, ZOOKEEPER, ZooKeeperServerMain.class, TABLET_SERVER,
TabletServer.class, SCAN_SERVER, ScanServer.class, COMPACTOR, Compactor.class));
private boolean jdwpEnabled = false;
private final Map<String,String> systemProperties = new HashMap<>();
private Map<String,String> systemProperties = new HashMap<>();
private final Set<String> jvmOptions = new HashSet<>();

private String instanceName = "miniInstance";
Expand Down Expand Up @@ -134,11 +134,6 @@ public class MiniAccumuloConfigImpl {
public MiniAccumuloConfigImpl(File dir, String rootPassword) {
this.dir = dir;
this.rootPassword = rootPassword;
// Set default options
this.jvmOptions.add("-XX:+PerfDisableSharedMem");
this.jvmOptions.add("-XX:+AlwaysPreTouch");
this.systemProperties.put("-Dapple.awt.UIElement", "true");
this.systemProperties.put("-Djava.net.preferIPv4Stack", "true");
}

/**
Expand Down Expand Up @@ -677,7 +672,7 @@ public File getClientPropsFile() {
* @since 1.6.0
*/
public void setSystemProperties(Map<String,String> systemProperties) {
this.systemProperties.putAll(systemProperties);
this.systemProperties = new HashMap<>(systemProperties);
}

/**
Expand All @@ -690,36 +685,13 @@ public Map<String,String> getSystemProperties() {
}

/**
* Add a JVM option to the spawned JVM processes. The default set of JVM options contains
* '-XX:+PerfDisableSharedMem' and '-XX:+AlwaysPreTouch'
*
* @param option JVM option
* @since 2.1.5
*/
public void addJvmOption(String option) {
this.jvmOptions.add(option);
}

/**
* Remove an option from the set of JVM options. Only options that match the {@code option}
* exactly will be removed.
*
* @param option JVM option
* @return true if removed, false if not removed
* @since 2.1.5
*/
public boolean removeJvmOption(String option) {
return this.jvmOptions.remove(option);
}

/**
* Get the set of JVM options
* Get the set of JVM options. Changes to this set will affect the Configuration
*
* @return set of options
* @since 2.1.5
*/
public Set<String> getJvmOptions() {
return new HashSet<>(jvmOptions);
return jvmOptions;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ private static List<String> getJvmArgs() {

@Override
protected void configure(MiniAccumuloConfigImpl cfg, Configuration hadoopCoreSite) {
getJvmArgs().forEach(cfg::addJvmOption);
cfg.getJvmOptions().addAll(getJvmArgs());
// sized such that full table scans will not fit in the cache
cfg.setProperty(Property.TSERV_DATACACHE_SIZE.getKey(), "8M");
cfg.setProperty(Property.TSERV_SCAN_EXECUTORS_PREFIX.getKey() + "pool1.threads", "8");
Expand Down