This is an automated email from the ASF dual-hosted git repository.
dlmarion pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/accumulo.git
The following commit(s) were added to refs/heads/main by this push:
new 39ab610c38 Merged FileTypePrefix into FilePrefix (#5478)
39ab610c38 is described below
commit 39ab610c381e0f32ddd5d32048ef523fd0270ceb
Author: Dave Marion <[email protected]>
AuthorDate: Wed Apr 16 12:58:13 2025 -0400
Merged FileTypePrefix into FilePrefix (#5478)
Closes #5476
---
.../org/apache/accumulo/core/file/FilePrefix.java | 75 ++++++++++++--
.../apache/accumulo/core/file/FilePrefixTest.java | 67 +++++++++++-
.../accumulo/server/compaction/FileCompactor.java | 15 ++-
.../apache/accumulo/server/fs/FileTypePrefix.java | 114 ---------------------
.../accumulo/server/fs/FileTypePrefixTest.java | 95 -----------------
.../tableOps/tableImport/MapImportFileNames.java | 4 +-
6 files changed, 139 insertions(+), 231 deletions(-)
diff --git a/core/src/main/java/org/apache/accumulo/core/file/FilePrefix.java
b/core/src/main/java/org/apache/accumulo/core/file/FilePrefix.java
index 92522f7a58..5ca7a5fc52 100644
--- a/core/src/main/java/org/apache/accumulo/core/file/FilePrefix.java
+++ b/core/src/main/java/org/apache/accumulo/core/file/FilePrefix.java
@@ -18,25 +18,86 @@
*/
package org.apache.accumulo.core.file;
-import java.util.stream.Stream;
+import java.util.EnumSet;
+import java.util.HashSet;
+import java.util.Objects;
+import java.util.Set;
+
+import com.google.common.base.Preconditions;
public enum FilePrefix {
- BULK_IMPORT("I"), MINOR_COMPACTION("F"), MAJOR_COMPACTION("C"),
MAJOR_COMPACTION_ALL_FILES("A");
+ ALL("*", false),
+ MINOR_COMPACTION("F", true),
+ BULK_IMPORT("I", true),
+ MAJOR_COMPACTION("C", true),
+ MAJOR_COMPACTION_ALL_FILES("A", true),
+ MERGING_MINOR_COMPACTION("M", false);
final String prefix;
+ final boolean canCreateFiles;
- FilePrefix(String prefix) {
+ FilePrefix(String prefix, boolean canCreateFiles) {
this.prefix = prefix;
+ this.canCreateFiles = canCreateFiles;
+ }
+
+ public String toPrefix() {
+ return this.prefix;
+ }
+
+ public String createFileName(String fileName) {
+ Objects.requireNonNull(fileName, "filename must be supplied");
+ Preconditions.checkArgument(!fileName.isBlank(), "Empty filename
supplied");
+ if (!canCreateFiles) {
+ throw new IllegalStateException("Unable to create filename with prefix:
" + prefix);
+ }
+ return prefix + fileName;
}
public static FilePrefix fromPrefix(String prefix) {
- return Stream.of(FilePrefix.values()).filter(p ->
p.prefix.equals(prefix)).findAny()
- .orElseThrow(() -> new IllegalArgumentException("Unknown prefix type:
" + prefix));
+ Objects.requireNonNull(prefix, "prefix must be supplied");
+ Preconditions.checkArgument(!prefix.isBlank(), "Empty prefix supplied");
+ Preconditions.checkArgument(prefix.length() == 1, "Invalid prefix
supplied: " + prefix);
+ for (FilePrefix fp : values()) {
+ if (fp == ALL) {
+ continue;
+ }
+ if (fp.prefix.equals(prefix)) {
+ return fp;
+ }
+ }
+ throw new IllegalArgumentException("Unknown prefix type: " + prefix);
}
- public String toPrefix() {
- return this.prefix;
+ public static FilePrefix fromFileName(String fileName) {
+ Objects.requireNonNull(fileName, "file name must be supplied");
+ Preconditions.checkArgument(!fileName.isBlank(), "Empty filename
supplied");
+ String firstChar = fileName.substring(0, 1);
+ if (!firstChar.equals(firstChar.toUpperCase())) {
+ throw new IllegalArgumentException(
+ "Expected first character of file name to be upper case, name: " +
fileName);
+ }
+ return fromPrefix(firstChar);
+ }
+
+ public static EnumSet<FilePrefix> typesFromList(String list) {
+ final EnumSet<FilePrefix> result;
+ if (!list.isBlank()) {
+ if (list.contains("*")) {
+ result = EnumSet.of(FilePrefix.ALL);
+ } else {
+ Set<FilePrefix> set = new HashSet<>();
+ String[] prefixes = list.trim().split(",");
+ for (String p : prefixes) {
+ set.add(FilePrefix.fromPrefix(p.trim().toUpperCase()));
+ }
+ result = EnumSet.copyOf(set);
+ }
+ } else {
+ result = EnumSet.noneOf(FilePrefix.class);
+ }
+ return result;
}
}
diff --git
a/core/src/test/java/org/apache/accumulo/core/file/FilePrefixTest.java
b/core/src/test/java/org/apache/accumulo/core/file/FilePrefixTest.java
index 7b84fa99cc..54fbecbd4b 100644
--- a/core/src/test/java/org/apache/accumulo/core/file/FilePrefixTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/file/FilePrefixTest.java
@@ -18,22 +18,79 @@
*/
package org.apache.accumulo.core.file;
+import static org.apache.accumulo.core.file.FilePrefix.ALL;
+import static org.apache.accumulo.core.file.FilePrefix.BULK_IMPORT;
+import static org.apache.accumulo.core.file.FilePrefix.MAJOR_COMPACTION;
+import static
org.apache.accumulo.core.file.FilePrefix.MAJOR_COMPACTION_ALL_FILES;
+import static
org.apache.accumulo.core.file.FilePrefix.MERGING_MINOR_COMPACTION;
+import static org.apache.accumulo.core.file.FilePrefix.MINOR_COMPACTION;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;
+import java.util.EnumSet;
+
import org.junit.jupiter.api.Test;
public class FilePrefixTest {
@Test
- public void testPrefixes() {
- assertEquals(FilePrefix.BULK_IMPORT, FilePrefix.fromPrefix("I"));
- assertEquals(FilePrefix.MINOR_COMPACTION, FilePrefix.fromPrefix("F"));
- assertEquals(FilePrefix.MAJOR_COMPACTION, FilePrefix.fromPrefix("C"));
- assertEquals(FilePrefix.MAJOR_COMPACTION_ALL_FILES,
FilePrefix.fromPrefix("A"));
+ public void testFromPrefix() {
+ assertThrows(NullPointerException.class, () ->
FilePrefix.fromPrefix(null));
+ assertThrows(IllegalArgumentException.class, () ->
FilePrefix.fromPrefix(""));
+ assertThrows(IllegalArgumentException.class, () ->
FilePrefix.fromPrefix("AB"));
+ assertThrows(IllegalArgumentException.class, () ->
FilePrefix.fromPrefix("c"));
+ assertEquals(MAJOR_COMPACTION, FilePrefix.fromPrefix("C"));
+ assertThrows(IllegalArgumentException.class, () ->
FilePrefix.fromPrefix("a"));
+ assertEquals(MAJOR_COMPACTION_ALL_FILES, FilePrefix.fromPrefix("A"));
+ assertThrows(IllegalArgumentException.class, () ->
FilePrefix.fromPrefix("f"));
+ assertEquals(MINOR_COMPACTION, FilePrefix.fromPrefix("F"));
+ assertThrows(IllegalArgumentException.class, () ->
FilePrefix.fromPrefix("i"));
+ assertEquals(BULK_IMPORT, FilePrefix.fromPrefix("I"));
+ assertThrows(IllegalArgumentException.class, () ->
FilePrefix.fromPrefix("m"));
+ assertEquals(MERGING_MINOR_COMPACTION, FilePrefix.fromPrefix("M"));
assertThrows(IllegalArgumentException.class, () -> {
FilePrefix.fromPrefix("B");
});
}
+ @Test
+ public void testCreateFileName() {
+ assertThrows(NullPointerException.class, () ->
MINOR_COMPACTION.createFileName(null));
+ assertThrows(IllegalArgumentException.class, () ->
MINOR_COMPACTION.createFileName(""));
+ assertThrows(IllegalStateException.class, () ->
ALL.createFileName("file.rf"));
+ assertThrows(IllegalStateException.class,
+ () -> MERGING_MINOR_COMPACTION.createFileName("file.rf"));
+ assertEquals("Afile.rf",
MAJOR_COMPACTION_ALL_FILES.createFileName("file.rf"));
+ assertEquals("Cfile.rf", MAJOR_COMPACTION.createFileName("file.rf"));
+ assertEquals("Ffile.rf", MINOR_COMPACTION.createFileName("file.rf"));
+ assertEquals("Ifile.rf", BULK_IMPORT.createFileName("file.rf"));
+ }
+
+ @Test
+ public void fromFileName() {
+ assertThrows(NullPointerException.class, () ->
FilePrefix.fromFileName(null));
+ assertThrows(IllegalArgumentException.class, () ->
FilePrefix.fromFileName(""));
+ assertThrows(IllegalArgumentException.class, () ->
FilePrefix.fromFileName("*file.rf"));
+ assertThrows(IllegalArgumentException.class, () ->
FilePrefix.fromFileName("cfile.rf"));
+ assertEquals(MAJOR_COMPACTION, FilePrefix.fromFileName("Cfile.rf"));
+ assertThrows(IllegalArgumentException.class, () ->
FilePrefix.fromFileName("afile.rf"));
+ assertEquals(MAJOR_COMPACTION_ALL_FILES,
FilePrefix.fromFileName("Afile.rf"));
+ assertThrows(IllegalArgumentException.class, () ->
FilePrefix.fromFileName("ffile.rf"));
+ assertEquals(MINOR_COMPACTION, FilePrefix.fromFileName("Ffile.rf"));
+ assertThrows(IllegalArgumentException.class, () ->
FilePrefix.fromFileName("ifile.rf"));
+ assertEquals(BULK_IMPORT, FilePrefix.fromFileName("Ifile.rf"));
+ assertThrows(IllegalArgumentException.class, () ->
FilePrefix.fromFileName("mfile.rf"));
+ assertEquals(MERGING_MINOR_COMPACTION,
FilePrefix.fromFileName("Mfile.rf"));
+
+ }
+
+ @Test
+ public void testFromList() {
+ assertEquals(EnumSet.noneOf(FilePrefix.class),
FilePrefix.typesFromList(""));
+ assertEquals(EnumSet.of(ALL), FilePrefix.typesFromList("*"));
+ assertEquals(EnumSet.of(ALL), FilePrefix.typesFromList("*, A"));
+ assertEquals(EnumSet.of(MAJOR_COMPACTION, MAJOR_COMPACTION_ALL_FILES),
+ FilePrefix.typesFromList("C, A"));
+ }
+
}
diff --git
a/server/base/src/main/java/org/apache/accumulo/server/compaction/FileCompactor.java
b/server/base/src/main/java/org/apache/accumulo/server/compaction/FileCompactor.java
index 54960779de..381b234ad7 100644
---
a/server/base/src/main/java/org/apache/accumulo/server/compaction/FileCompactor.java
+++
b/server/base/src/main/java/org/apache/accumulo/server/compaction/FileCompactor.java
@@ -51,6 +51,7 @@ import org.apache.accumulo.core.dataImpl.KeyExtent;
import org.apache.accumulo.core.file.FileOperations;
import org.apache.accumulo.core.file.FileOperations.ReaderBuilder;
import org.apache.accumulo.core.file.FileOperations.WriterBuilder;
+import org.apache.accumulo.core.file.FilePrefix;
import org.apache.accumulo.core.file.FileSKVIterator;
import org.apache.accumulo.core.file.FileSKVWriter;
import org.apache.accumulo.core.iterators.IteratorUtil;
@@ -74,7 +75,6 @@ import org.apache.accumulo.core.util.LocalityGroupUtil;
import
org.apache.accumulo.core.util.LocalityGroupUtil.LocalityGroupConfigurationError;
import org.apache.accumulo.core.util.Timer;
import org.apache.accumulo.server.ServerContext;
-import org.apache.accumulo.server.fs.FileTypePrefix;
import org.apache.accumulo.server.fs.VolumeManager;
import org.apache.accumulo.server.iterators.SystemIteratorEnvironment;
import org.apache.accumulo.server.mem.LowMemoryDetector.DetectionScope;
@@ -349,8 +349,8 @@ public class FileCompactor implements
Callable<CompactionStats> {
// has not.
String dropCachePrefixProperty =
acuTableConf.get(Property.TABLE_COMPACTION_INPUT_DROP_CACHE_BEHIND);
- final EnumSet<FileTypePrefix> dropCacheFilePrefixes =
- FileTypePrefix.typesFromList(dropCachePrefixProperty);
+ final EnumSet<FilePrefix> dropCacheFilePrefixes =
+ FilePrefix.typesFromList(dropCachePrefixProperty);
final boolean isMinC = env.getIteratorScope() ==
IteratorUtil.IteratorScope.minc;
@@ -470,7 +470,7 @@ public class FileCompactor implements
Callable<CompactionStats> {
}
private List<SortedKeyValueIterator<Key,Value>> openMapDataFiles(
- ArrayList<FileSKVIterator> readers, EnumSet<FileTypePrefix>
dropCacheFilePrefixes)
+ ArrayList<FileSKVIterator> readers, EnumSet<FilePrefix>
dropCacheFilePrefixes)
throws IOException {
List<SortedKeyValueIterator<Key,Value>> iters = new
ArrayList<>(filesToCompact.size());
@@ -483,10 +483,10 @@ public class FileCompactor implements
Callable<CompactionStats> {
FileSKVIterator reader;
boolean dropCacheBehindCompactionInputFile = false;
- if (dropCacheFilePrefixes.contains(FileTypePrefix.ALL)) {
+ if (dropCacheFilePrefixes.contains(FilePrefix.ALL)) {
dropCacheBehindCompactionInputFile = true;
} else {
- FileTypePrefix type =
FileTypePrefix.fromFileName(dataFile.getFileName());
+ FilePrefix type = FilePrefix.fromFileName(dataFile.getFileName());
if (dropCacheFilePrefixes.contains(type)) {
dropCacheBehindCompactionInputFile = true;
}
@@ -535,8 +535,7 @@ public class FileCompactor implements
Callable<CompactionStats> {
private void compactLocalityGroup(String lgName, Set<ByteSequence>
columnFamilies,
boolean inclusive, FileSKVWriter mfw, CompactionStats majCStats,
- EnumSet<FileTypePrefix> dropCacheFilePrefixes)
- throws IOException, CompactionCanceledException {
+ EnumSet<FilePrefix> dropCacheFilePrefixes) throws IOException,
CompactionCanceledException {
ArrayList<FileSKVIterator> readers = new
ArrayList<>(filesToCompact.size());
Span compactSpan = TraceUtil.startSpan(this.getClass(), "compact");
try (Scope span = compactSpan.makeCurrent()) {
diff --git
a/server/base/src/main/java/org/apache/accumulo/server/fs/FileTypePrefix.java
b/server/base/src/main/java/org/apache/accumulo/server/fs/FileTypePrefix.java
deleted file mode 100644
index 1d81796367..0000000000
---
a/server/base/src/main/java/org/apache/accumulo/server/fs/FileTypePrefix.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.accumulo.server.fs;
-
-import java.util.EnumSet;
-import java.util.HashSet;
-import java.util.Objects;
-import java.util.Set;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.google.common.base.Preconditions;
-
-public enum FileTypePrefix {
-
- ALL("*"),
- FLUSH("F"),
- BULK_IMPORT("I"),
- COMPACTION("C"),
- FULL_COMPACTION("A"),
- MERGING_MINOR_COMPACTION("M"),
- UNKNOWN("?");
-
- private static final Logger LOG =
LoggerFactory.getLogger(FileTypePrefix.class);
-
- private final String filePrefix;
-
- private FileTypePrefix(String prefix) {
- this.filePrefix = prefix;
- }
-
- public String getPrefix() {
- return filePrefix;
- }
-
- public String createFileName(String fileName) {
- Objects.requireNonNull(fileName, "filename must be supplied");
- Preconditions.checkArgument(!fileName.isBlank(), "Empty filename
supplied");
- if (this == ALL || this == MERGING_MINOR_COMPACTION || this == UNKNOWN) {
- throw new IllegalStateException(
- "Unable to create filename with ALL, MERGING_MINOR_COMPACTION, or
UNKNOWN prefix");
- }
- return filePrefix + fileName;
- }
-
- public static FileTypePrefix fromPrefix(String prefix) {
- Objects.requireNonNull(prefix, "prefix must be supplied");
- Preconditions.checkArgument(!prefix.isBlank(), "Empty prefix supplied");
- Preconditions.checkArgument(prefix.length() == 1, "Invalid prefix
supplied: " + prefix);
- switch (prefix.toUpperCase()) {
- case "A":
- return FULL_COMPACTION;
- case "C":
- return COMPACTION;
- case "F":
- return FLUSH;
- case "I":
- return BULK_IMPORT;
- case "M":
- return MERGING_MINOR_COMPACTION;
- default:
- LOG.warn("Encountered unknown file prefix for file: {}", prefix);
- return UNKNOWN;
- }
- }
-
- public static FileTypePrefix fromFileName(String fileName) {
- Objects.requireNonNull(fileName, "file name must be supplied");
- Preconditions.checkArgument(!fileName.isBlank(), "Empty filename
supplied");
- String firstChar = fileName.substring(0, 1);
- if (!firstChar.equals(firstChar.toUpperCase())) {
- throw new IllegalArgumentException(
- "Expected first character of file name to be upper case, name: " +
fileName);
- }
- return fromPrefix(firstChar);
- }
-
- public static EnumSet<FileTypePrefix> typesFromList(String list) {
- final EnumSet<FileTypePrefix> dropCacheFilePrefixes;
- if (!list.isBlank()) {
- if (list.contains("*")) {
- dropCacheFilePrefixes = EnumSet.of(FileTypePrefix.ALL);
- } else {
- Set<FileTypePrefix> set = new HashSet<>();
- String[] prefixes = list.trim().split(",");
- for (String p : prefixes) {
- set.add(FileTypePrefix.fromPrefix(p.trim().toUpperCase()));
- }
- dropCacheFilePrefixes = EnumSet.copyOf(set);
- }
- } else {
- dropCacheFilePrefixes = EnumSet.noneOf(FileTypePrefix.class);
- }
- return dropCacheFilePrefixes;
- }
-
-}
diff --git
a/server/base/src/test/java/org/apache/accumulo/server/fs/FileTypePrefixTest.java
b/server/base/src/test/java/org/apache/accumulo/server/fs/FileTypePrefixTest.java
deleted file mode 100644
index 7085e63777..0000000000
---
a/server/base/src/test/java/org/apache/accumulo/server/fs/FileTypePrefixTest.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.accumulo.server.fs;
-
-import static org.apache.accumulo.server.fs.FileTypePrefix.ALL;
-import static org.apache.accumulo.server.fs.FileTypePrefix.BULK_IMPORT;
-import static org.apache.accumulo.server.fs.FileTypePrefix.COMPACTION;
-import static org.apache.accumulo.server.fs.FileTypePrefix.FLUSH;
-import static org.apache.accumulo.server.fs.FileTypePrefix.FULL_COMPACTION;
-import static
org.apache.accumulo.server.fs.FileTypePrefix.MERGING_MINOR_COMPACTION;
-import static org.apache.accumulo.server.fs.FileTypePrefix.UNKNOWN;
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertThrows;
-
-import java.util.EnumSet;
-
-import org.junit.jupiter.api.Test;
-
-public class FileTypePrefixTest {
-
- @Test
- public void testCreateFileName() {
- assertThrows(NullPointerException.class, () -> FLUSH.createFileName(null));
- assertThrows(IllegalArgumentException.class, () ->
FLUSH.createFileName(""));
- assertThrows(IllegalStateException.class, () ->
ALL.createFileName("file.rf"));
- assertThrows(IllegalStateException.class, () ->
UNKNOWN.createFileName("file.rf"));
- assertThrows(IllegalStateException.class,
- () -> MERGING_MINOR_COMPACTION.createFileName("file.rf"));
- assertEquals("Afile.rf", FULL_COMPACTION.createFileName("file.rf"));
- assertEquals("Cfile.rf", COMPACTION.createFileName("file.rf"));
- assertEquals("Ffile.rf", FLUSH.createFileName("file.rf"));
- assertEquals("Ifile.rf", BULK_IMPORT.createFileName("file.rf"));
- }
-
- @Test
- public void testFromPrefix() {
- assertThrows(NullPointerException.class, () ->
FileTypePrefix.fromPrefix(null));
- assertThrows(IllegalArgumentException.class, () ->
FileTypePrefix.fromPrefix(""));
- assertThrows(IllegalArgumentException.class, () ->
FileTypePrefix.fromPrefix("AB"));
- assertEquals(UNKNOWN, FileTypePrefix.fromPrefix("*"));
- assertEquals(COMPACTION, FileTypePrefix.fromPrefix("c"));
- assertEquals(COMPACTION, FileTypePrefix.fromPrefix("C"));
- assertEquals(FULL_COMPACTION, FileTypePrefix.fromPrefix("a"));
- assertEquals(FULL_COMPACTION, FileTypePrefix.fromPrefix("A"));
- assertEquals(FLUSH, FileTypePrefix.fromPrefix("f"));
- assertEquals(FLUSH, FileTypePrefix.fromPrefix("F"));
- assertEquals(BULK_IMPORT, FileTypePrefix.fromPrefix("i"));
- assertEquals(BULK_IMPORT, FileTypePrefix.fromPrefix("I"));
- assertEquals(MERGING_MINOR_COMPACTION, FileTypePrefix.fromPrefix("m"));
- assertEquals(MERGING_MINOR_COMPACTION, FileTypePrefix.fromPrefix("M"));
- }
-
- @Test
- public void fromFileName() {
- assertThrows(NullPointerException.class, () ->
FileTypePrefix.fromFileName(null));
- assertThrows(IllegalArgumentException.class, () ->
FileTypePrefix.fromFileName(""));
- assertEquals(UNKNOWN, FileTypePrefix.fromFileName("*file.rf"));
- assertThrows(IllegalArgumentException.class, () ->
FileTypePrefix.fromFileName("cfile.rf"));
- assertEquals(COMPACTION, FileTypePrefix.fromFileName("Cfile.rf"));
- assertThrows(IllegalArgumentException.class, () ->
FileTypePrefix.fromFileName("afile.rf"));
- assertEquals(FULL_COMPACTION, FileTypePrefix.fromFileName("Afile.rf"));
- assertThrows(IllegalArgumentException.class, () ->
FileTypePrefix.fromFileName("ffile.rf"));
- assertEquals(FLUSH, FileTypePrefix.fromFileName("Ffile.rf"));
- assertThrows(IllegalArgumentException.class, () ->
FileTypePrefix.fromFileName("ifile.rf"));
- assertEquals(BULK_IMPORT, FileTypePrefix.fromFileName("Ifile.rf"));
- assertThrows(IllegalArgumentException.class, () ->
FileTypePrefix.fromFileName("mfile.rf"));
- assertEquals(MERGING_MINOR_COMPACTION,
FileTypePrefix.fromFileName("Mfile.rf"));
-
- }
-
- @Test
- public void testFromList() {
- assertEquals(EnumSet.noneOf(FileTypePrefix.class),
FileTypePrefix.typesFromList(""));
- assertEquals(EnumSet.of(ALL), FileTypePrefix.typesFromList("*"));
- assertEquals(EnumSet.of(ALL), FileTypePrefix.typesFromList("*, A"));
- assertEquals(EnumSet.of(COMPACTION, FULL_COMPACTION),
FileTypePrefix.typesFromList("C, A"));
- }
-
-}
diff --git
a/server/manager/src/main/java/org/apache/accumulo/manager/tableOps/tableImport/MapImportFileNames.java
b/server/manager/src/main/java/org/apache/accumulo/manager/tableOps/tableImport/MapImportFileNames.java
index 73a81e4db2..0daddd5b20 100644
---
a/server/manager/src/main/java/org/apache/accumulo/manager/tableOps/tableImport/MapImportFileNames.java
+++
b/server/manager/src/main/java/org/apache/accumulo/manager/tableOps/tableImport/MapImportFileNames.java
@@ -31,9 +31,9 @@ import
org.apache.accumulo.core.clientImpl.thrift.TableOperationExceptionType;
import org.apache.accumulo.core.fate.FateId;
import org.apache.accumulo.core.fate.Repo;
import org.apache.accumulo.core.file.FileOperations;
+import org.apache.accumulo.core.file.FilePrefix;
import org.apache.accumulo.manager.Manager;
import org.apache.accumulo.manager.tableOps.ManagerRepo;
-import org.apache.accumulo.server.fs.FileTypePrefix;
import org.apache.accumulo.server.fs.VolumeManager;
import org.apache.accumulo.server.tablets.UniqueNameAllocator;
import org.apache.hadoop.fs.FileStatus;
@@ -89,7 +89,7 @@ class MapImportFileNames extends ManagerRepo {
}
String newName =
- FileTypePrefix.BULK_IMPORT.createFileName(namer.getNextName() +
"." + extension);
+ FilePrefix.BULK_IMPORT.createFileName(namer.getNextName() + "."
+ extension);
mappingsWriter.append(fileName);
mappingsWriter.append(':');