This is an automated email from the ASF dual-hosted git repository. edimitrova pushed a commit to branch trunk in repository https://gitbox.apache.org/repos/asf/cassandra.git
The following commit(s) were added to refs/heads/trunk by this push: new b41e2f5b80 Fix eclipse problems b41e2f5b80 is described below commit b41e2f5b80187ac0923d3822a279b1608fb9c1d2 Author: Benjamin Lerer <b.le...@gmail.com> AuthorDate: Fri May 26 18:06:53 2023 +0200 Fix eclipse problems patch by Bejamin Lerer; reviewed by Ekaterina Dimitrova for CASSANDRA-18329 --- .../sstable/indexsummary/IndexSummaryManager.java | 11 +++-- .../org/apache/cassandra/io/util/PathUtils.java | 51 +++++++++++++++++----- 2 files changed, 48 insertions(+), 14 deletions(-) diff --git a/src/java/org/apache/cassandra/io/sstable/indexsummary/IndexSummaryManager.java b/src/java/org/apache/cassandra/io/sstable/indexsummary/IndexSummaryManager.java index 82dc3b8cc2..6fbdad3ef3 100644 --- a/src/java/org/apache/cassandra/io/sstable/indexsummary/IndexSummaryManager.java +++ b/src/java/org/apache/cassandra/io/sstable/indexsummary/IndexSummaryManager.java @@ -73,7 +73,7 @@ public class IndexSummaryManager<T extends SSTableReader & IndexSummarySupport<T private final Supplier<List<T>> indexSummariesProvider; - private static <T extends SSTableReader & IndexSummarySupport> List<T> getAllSupportedReaders() { + private static <T extends SSTableReader & IndexSummarySupport<T>> List<T> getAllSupportedReaders() { List<T> readers = new ArrayList<>(); for (Keyspace keyspace : Keyspace.all()) for (ColumnFamilyStore cfs : keyspace.getColumnFamilyStores()) @@ -85,10 +85,15 @@ public class IndexSummaryManager<T extends SSTableReader & IndexSummarySupport<T static { - instance = new IndexSummaryManager<>(IndexSummaryManager::getAllSupportedReaders); + instance = newInstance(); MBeanWrapper.instance.registerMBean(instance, MBEAN_NAME); } + private static <T extends SSTableReader & IndexSummarySupport<T>> IndexSummaryManager<T> newInstance() + { + return new IndexSummaryManager<>(IndexSummaryManager::getAllSupportedReaders); + } + private IndexSummaryManager(Supplier<List<T>> indexSummariesProvider) { this.indexSummariesProvider = indexSummariesProvider; @@ -281,7 +286,7 @@ public class IndexSummaryManager<T extends SSTableReader & IndexSummarySupport<T @VisibleForTesting public static <T extends SSTableReader & IndexSummarySupport> List<T> redistributeSummaries(IndexSummaryRedistribution redistribution) throws IOException { - return CompactionManager.instance.runAsActiveCompaction(redistribution, redistribution::redistributeSummaries); + return (List<T>) CompactionManager.instance.runAsActiveCompaction(redistribution, redistribution::redistributeSummaries); } @VisibleForTesting diff --git a/src/java/org/apache/cassandra/io/util/PathUtils.java b/src/java/org/apache/cassandra/io/util/PathUtils.java index 027742f48f..88e2d43b25 100644 --- a/src/java/org/apache/cassandra/io/util/PathUtils.java +++ b/src/java/org/apache/cassandra/io/util/PathUtils.java @@ -17,13 +17,36 @@ */ package org.apache.cassandra.io.util; -import java.io.*; +import java.io.BufferedReader; +import java.io.FileNotFoundException; +import java.io.IOError; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.UncheckedIOException; import java.nio.channels.FileChannel; -import java.nio.file.*; -import java.nio.file.attribute.*; -import java.util.*; +import java.nio.file.AtomicMoveNotSupportedException; +import java.nio.file.FileAlreadyExistsException; +import java.nio.file.FileStore; +import java.nio.file.Files; +import java.nio.file.NoSuchFileException; +import java.nio.file.Path; +import java.nio.file.StandardCopyOption; +import java.nio.file.StandardOpenOption; +import java.nio.file.attribute.FileAttribute; +import java.nio.file.attribute.FileTime; +import java.nio.file.attribute.PosixFileAttributeView; +import java.nio.file.attribute.PosixFileAttributes; +import java.nio.file.attribute.PosixFilePermission; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.EnumSet; +import java.util.HashSet; +import java.util.List; +import java.util.Set; import java.util.concurrent.TimeUnit; -import java.util.function.*; +import java.util.function.Consumer; +import java.util.function.Function; +import java.util.function.IntFunction; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -32,22 +55,28 @@ import javax.annotation.Nullable; import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Preconditions; import com.google.common.util.concurrent.RateLimiter; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import net.openhft.chronicle.core.util.ThrowingFunction; import org.apache.cassandra.config.CassandraRelevantProperties; import org.apache.cassandra.io.FSError; import org.apache.cassandra.io.FSReadError; import org.apache.cassandra.io.FSWriteError; import org.apache.cassandra.service.StorageService; import org.apache.cassandra.utils.NoSpamLogger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; -import static java.nio.file.StandardOpenOption.*; +import static java.nio.file.StandardOpenOption.APPEND; +import static java.nio.file.StandardOpenOption.CREATE; +import static java.nio.file.StandardOpenOption.READ; +import static java.nio.file.StandardOpenOption.TRUNCATE_EXISTING; +import static java.nio.file.StandardOpenOption.WRITE; import static java.util.Collections.unmodifiableSet; + import static org.apache.cassandra.config.CassandraRelevantProperties.USE_NIX_RECURSIVE_DELETE; import static org.apache.cassandra.utils.Throwables.merge; +import net.openhft.chronicle.core.util.ThrowingFunction; + /** * Vernacular: tryX means return false or 0L on any failure; XIfNotY means propagate any exceptions besides those caused by Y * @@ -368,7 +397,7 @@ public final class PathUtils */ public static void deleteRecursive(Path path) { - if (USE_NIX_RECURSIVE_DELETE.getBoolean() && path.getFileSystem() == FileSystems.getDefault()) + if (USE_NIX_RECURSIVE_DELETE.getBoolean() && path.getFileSystem() == java.nio.file.FileSystems.getDefault()) { deleteRecursiveUsingNixCommand(path, false); return; @@ -388,7 +417,7 @@ public final class PathUtils */ public static void deleteRecursive(Path path, RateLimiter rateLimiter) { - if (USE_NIX_RECURSIVE_DELETE.getBoolean() && path.getFileSystem() == FileSystems.getDefault()) + if (USE_NIX_RECURSIVE_DELETE.getBoolean() && path.getFileSystem() == java.nio.file.FileSystems.getDefault()) { deleteRecursiveUsingNixCommand(path, false); return; --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org