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 @@ -395,11 +395,8 @@ public void run() {
Map<KeyExtent,List<Range>> unscanned = new HashMap<>();
Map<KeyExtent,List<Range>> tsFailures = new HashMap<>();
try {
TimeoutTracker timeoutTracker = timeoutTrackers.get(tsLocation);
if (timeoutTracker == null) {
timeoutTracker = new TimeoutTracker(tsLocation, timedoutServers, retryTimeout);
timeoutTrackers.put(tsLocation, timeoutTracker);
}
TimeoutTracker timeoutTracker = timeoutTrackers.computeIfAbsent(tsLocation,
key -> new TimeoutTracker(key, timedoutServers, retryTimeout));
doLookup(context, tsLocation, tabletsRanges, tsFailures, unscanned, receiver, columns,
options, authorizations, timeoutTracker, busyTimeout);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -872,11 +872,8 @@ public void send(TabletServerMutations<Mutation> tsm)
Span span = TraceUtil.startSpan(this.getClass(), "sendMutations");
try (Scope scope = span.makeCurrent()) {

TimeoutTracker timeoutTracker = timeoutTrackers.get(location);
if (timeoutTracker == null) {
timeoutTracker = new TimeoutTracker(location, timeout);
timeoutTrackers.put(location, timeoutTracker);
}
TimeoutTracker timeoutTracker =
timeoutTrackers.computeIfAbsent(location, l -> new TimeoutTracker(l, timeout));

long st1 = System.currentTimeMillis();
try (SessionCloser sessionCloser = new SessionCloser(location)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class ConfigurationCopy extends AccumuloConfiguration {
* @param config configuration property key/value pairs to copy
*/
public ConfigurationCopy(Map<String,String> config) {
this(config.entrySet());
copy.putAll(config);
}

/**
Expand Down Expand Up @@ -74,11 +74,11 @@ public String get(Property property) {

@Override
public void getProperties(Map<String,String> props, Predicate<String> filter) {
for (Entry<String,String> entry : copy.entrySet()) {
if (filter.test(entry.getKey())) {
props.put(entry.getKey(), entry.getValue());
copy.forEach((key, value) -> {
if (filter.test(key)) {
props.put(key, value);
}
}
});
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,7 @@ public void report(boolean reportDeepCopies) {

if (reportDeepCopies) {
// recurse down the fat tree of deep copies forcing them to report
for (var deepCopy : deepCopies) {
deepCopy.report(true);
}
deepCopies.forEach(deepCopy -> deepCopy.report(true));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -265,11 +265,7 @@ private static void updateTotalEntries() {
public static List<CompactionInfo> getRunningCompactions() {
ArrayList<CompactionInfo> compactions = new ArrayList<>();

synchronized (runningCompactions) {
for (FileCompactor compactor : runningCompactions) {
compactions.add(new CompactionInfo(compactor));
}
}
runningCompactions.forEach(compactor -> compactions.add(new CompactionInfo(compactor)));

return compactions;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,12 @@ public boolean add(Pair<Long,T> obj) {
});
}

private static <T> List<T> snapshotSynchronizedList(List<T> list) {
synchronized (list) {
return new ArrayList<>(list);
}
}

private final List<Pair<Long,Double>> loadOverTime = newMaxList();
private final List<Pair<Long,Double>> ingestRateOverTime = newMaxList();
private final List<Pair<Long,Double>> ingestByteRateOverTime = newMaxList();
Expand Down Expand Up @@ -938,51 +944,51 @@ public long getStartTime() {
}

public List<Pair<Long,Double>> getLoadOverTime() {
return new ArrayList<>(loadOverTime);
return snapshotSynchronizedList(loadOverTime);
}

public List<Pair<Long,Double>> getIngestRateOverTime() {
return new ArrayList<>(ingestRateOverTime);
return snapshotSynchronizedList(ingestRateOverTime);
}

public List<Pair<Long,Double>> getIngestByteRateOverTime() {
return new ArrayList<>(ingestByteRateOverTime);
return snapshotSynchronizedList(ingestByteRateOverTime);
}

public List<Pair<Long,Integer>> getMinorCompactionsOverTime() {
return new ArrayList<>(minorCompactionsOverTime);
return snapshotSynchronizedList(minorCompactionsOverTime);
}

public List<Pair<Long,Integer>> getMajorCompactionsOverTime() {
return new ArrayList<>(majorCompactionsOverTime);
return snapshotSynchronizedList(majorCompactionsOverTime);
}

public List<Pair<Long,Double>> getLookupsOverTime() {
return new ArrayList<>(lookupsOverTime);
return snapshotSynchronizedList(lookupsOverTime);
}

public double getLookupRate() {
return lookupRateTracker.calculateRate();
}

public List<Pair<Long,Long>> getQueryRateOverTime() {
return new ArrayList<>(queryRateOverTime);
return snapshotSynchronizedList(queryRateOverTime);
}

public List<Pair<Long,Long>> getScanRateOverTime() {
return new ArrayList<>(scanRateOverTime);
return snapshotSynchronizedList(scanRateOverTime);
}

public List<Pair<Long,Double>> getQueryByteRateOverTime() {
return new ArrayList<>(queryByteRateOverTime);
return snapshotSynchronizedList(queryByteRateOverTime);
}

public List<Pair<Long,Double>> getIndexCacheHitRateOverTime() {
return new ArrayList<>(indexCacheHitRateOverTime);
return snapshotSynchronizedList(indexCacheHitRateOverTime);
}

public List<Pair<Long,Double>> getDataCacheHitRateOverTime() {
return new ArrayList<>(dataCacheHitRateOverTime);
return snapshotSynchronizedList(dataCacheHitRateOverTime);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public void run() {

}

private static List<WeakReference<DefaultFileSystemManager>> vfsInstances =
private static final List<WeakReference<DefaultFileSystemManager>> vfsInstances =
Collections.synchronizedList(new ArrayList<>());

public static final String DYNAMIC_CLASSPATH_PROPERTY_NAME = "general.dynamic.classpaths";
Expand Down Expand Up @@ -440,7 +440,7 @@ public static synchronized ContextManager getContextManager() throws IOException
}

public static void close() {
for (WeakReference<DefaultFileSystemManager> vfsInstance : vfsInstances) {
vfsInstances.forEach(vfsInstance -> {
DefaultFileSystemManager ref = vfsInstance.get();
if (ref != null) {
FileReplicator replicator;
Expand All @@ -454,7 +454,7 @@ public static void close() {
}
ref.close();
}
}
});
try {
FileUtils.deleteDirectory(computeTopCacheDir());
} catch (IOException e) {
Expand Down