You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by "dlmarion (via GitHub)" <gi...@apache.org> on 2023/06/16 16:27:34 UTC
[GitHub] [accumulo] dlmarion commented on a diff in pull request #3484: Start Compactors when starting MiniAccumuloCluster
dlmarion commented on code in PR #3484:
URL: https://github.com/apache/accumulo/pull/3484#discussion_r1232477156
##########
minicluster/src/main/java/org/apache/accumulo/miniclusterImpl/MiniAccumuloClusterImpl.java:
##########
@@ -614,8 +623,50 @@ public synchronized void start() throws IOException, InterruptedException {
executor = Executors.newSingleThreadExecutor();
}
+ Set<String> queues = getCompactionQueueNames();
+ if (queues.isEmpty()) {
+ throw new IllegalStateException("No Compactor queues configured.");
+ }
+
+ for (String name : queues) {
+ control.startCompactors(Compactor.class, getConfig().getNumCompactors(), name);
+ }
+
verifyUp();
+ printProcessSummary();
+
+ }
+
+ private void printProcessSummary() {
+ log.info("Process Summary:");
+ getProcesses().forEach((k, v) -> log.info("{}: {}", k,
+ v.stream().map((pr) -> pr.getProcess().pid()).collect(Collectors.toList())));
+ }
+
+ private Set<String> getCompactionQueueNames() {
+
+ Set<String> queueNames = new HashSet<>();
+ AccumuloConfiguration aconf = new ConfigurationCopy(config.getSiteConfig());
+ CompactionServicesConfig csc = new CompactionServicesConfig(aconf);
+ ServiceEnvironment senv = new ServiceEnvironmentImpl(getServerContext());
+
+ for (var entry : csc.getPlanners().entrySet()) {
+ String serviceId = entry.getKey();
+
+ var initParams = new CompactionPlannerInitParams(CompactionServiceId.of(serviceId),
+ csc.getOptions().get(serviceId), senv);
+
+ ExecutorConfig[] execConfigs =
+ new Gson().fromJson(initParams.getOptions().get("executors"), ExecutorConfig[].class);
+
+ for (ExecutorConfig ec : execConfigs) {
+ if (ec.getQueue() != null) {
+ queueNames.add(ec.getQueue());
+ }
+ }
Review Comment:
Implemented in 9133ce0
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org