Skip to content

Commit 91600dd

Browse files
committed
Merge remote-tracking branch 'upstream/2.1' into 3.1
2 parents d14afc4 + 79d972f commit 91600dd

File tree

2 files changed

+67
-1
lines changed

2 files changed

+67
-1
lines changed

core/src/main/java/org/apache/accumulo/core/fate/Fate.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ public Fate(T environment, TStore<T> store, Function<Repo<T>,String> toLogStrFun
243243
// resize the pool if the property changed
244244
ThreadPools.resizePool(pool, conf, Property.MANAGER_FATE_THREADPOOL_SIZE);
245245
// If the pool grew, then ensure that there is a TransactionRunner for each thread
246-
int needed = conf.getCount(Property.MANAGER_FATE_THREADPOOL_SIZE) - pool.getQueue().size();
246+
int needed = conf.getCount(Property.MANAGER_FATE_THREADPOOL_SIZE) - pool.getActiveCount();
247247
if (needed > 0) {
248248
for (int i = 0; i < needed; i++) {
249249
try {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* https://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
package org.apache.accumulo.server.conf;
20+
21+
import java.io.File;
22+
import java.io.IOException;
23+
24+
import org.apache.accumulo.core.conf.SiteConfiguration;
25+
import org.apache.accumulo.server.ServerDirs;
26+
import org.apache.accumulo.server.fs.VolumeManagerImpl;
27+
import org.apache.accumulo.start.spi.KeywordExecutable;
28+
import org.apache.hadoop.conf.Configuration;
29+
30+
import com.google.auto.service.AutoService;
31+
import com.google.common.base.Preconditions;
32+
33+
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
34+
35+
@AutoService(KeywordExecutable.class)
36+
public class CheckAccumuloProperties implements KeywordExecutable {
37+
38+
@SuppressFBWarnings(value = "PATH_TRAVERSAL_IN", justification = "intentional user-provided path")
39+
public static void main(String[] args) throws IOException {
40+
Preconditions.checkArgument(args.length == 1,
41+
"Expected 1 argument (the properties file path), got " + args.length);
42+
var hadoopConfig = new Configuration();
43+
var siteConfig = SiteConfiguration.fromFile(new File(args[0])).build();
44+
45+
VolumeManagerImpl.get(siteConfig, hadoopConfig);
46+
new ServerDirs(siteConfig, hadoopConfig);
47+
}
48+
49+
@Override
50+
public String keyword() {
51+
return "check-accumulo-properties";
52+
}
53+
54+
@Override
55+
public String description() {
56+
return "Checks the provided Accumulo configuration file for errors. "
57+
+ "This only checks the contents of the file and not any running Accumulo system, "
58+
+ "so it can be used prior to init, but only performs a subset of the checks done by "
59+
+ (new CheckServerConfig().keyword());
60+
}
61+
62+
@Override
63+
public void execute(String[] args) throws Exception {
64+
main(args);
65+
}
66+
}

0 commit comments

Comments
 (0)