This is an automated email from the ASF dual-hosted git repository.
krathbun pushed a commit to branch 2.1
in repository https://gitbox.apache.org/repos/asf/accumulo.git
The following commit(s) were added to refs/heads/2.1 by this push:
new 9041faec20 Deleted MapFileIterator: (#5594)
9041faec20 is described below
commit 9041faec20da681cc93b2f12d73054692bfdfa1f
Author: Kevin Rathbun <[email protected]>
AuthorDate: Thu Jun 5 09:37:29 2025 -0400
Deleted MapFileIterator: (#5594)
Only existed to throw an `UnsupportedOperationException` on creation or any
method calls, so old uses were misleading at a glance. Uses were replaced with
explicitly throwing the `UnsupportedOperationException` instead. Also, class
was not part of the public API.
---
.../accumulo/core/file/map/MapFileOperations.java | 18 +--
.../core/iteratorsImpl/system/MapFileIterator.java | 128 ---------------------
2 files changed, 3 insertions(+), 143 deletions(-)
diff --git
a/core/src/main/java/org/apache/accumulo/core/file/map/MapFileOperations.java
b/core/src/main/java/org/apache/accumulo/core/file/map/MapFileOperations.java
index 6f4c2e2e3f..c2da8c0066 100644
---
a/core/src/main/java/org/apache/accumulo/core/file/map/MapFileOperations.java
+++
b/core/src/main/java/org/apache/accumulo/core/file/map/MapFileOperations.java
@@ -20,7 +20,6 @@ package org.apache.accumulo.core.file.map;
import java.io.DataInputStream;
import java.io.IOException;
-import java.util.ArrayList;
import java.util.Collection;
import java.util.Map;
import java.util.concurrent.atomic.AtomicBoolean;
@@ -36,13 +35,13 @@ import org.apache.accumulo.core.file.FileSKVWriter;
import org.apache.accumulo.core.file.blockfile.impl.CacheProvider;
import org.apache.accumulo.core.iterators.IteratorEnvironment;
import org.apache.accumulo.core.iterators.SortedKeyValueIterator;
-import org.apache.accumulo.core.iteratorsImpl.system.MapFileIterator;
import org.apache.accumulo.core.iteratorsImpl.system.SequenceFileIterator;
import org.apache.accumulo.core.sample.impl.SamplerConfigurationImpl;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.MapFile;
public class MapFileOperations extends FileOperations {
+ private static final String MSG = "Map files are not supported";
public static class RangeIterator implements FileSKVIterator {
@@ -154,12 +153,7 @@ public class MapFileOperations extends FileOperations {
@Override
protected FileSKVIterator openReader(FileOptions options) throws IOException
{
- FileSKVIterator iter = new RangeIterator(new
MapFileIterator(options.getFileSystem(),
- options.getFilename(), options.getConfiguration()));
- if (options.isSeekToBeginning()) {
- iter.seek(new Range(new Key(), null), new ArrayList<>(), false);
- }
- return iter;
+ throw new UnsupportedOperationException(MSG);
}
@Override
@@ -181,12 +175,6 @@ public class MapFileOperations extends FileOperations {
@Override
protected FileSKVIterator openScanReader(FileOptions options) throws
IOException {
- MapFileIterator mfIter = new MapFileIterator(options.getFileSystem(),
options.getFilename(),
- options.getConfiguration());
-
- FileSKVIterator iter = new RangeIterator(mfIter);
- iter.seek(options.getRange(), options.getColumnFamilies(),
options.isRangeInclusive());
-
- return iter;
+ throw new UnsupportedOperationException(MSG);
}
}
diff --git
a/core/src/main/java/org/apache/accumulo/core/iteratorsImpl/system/MapFileIterator.java
b/core/src/main/java/org/apache/accumulo/core/iteratorsImpl/system/MapFileIterator.java
deleted file mode 100644
index 3f84a3a545..0000000000
---
a/core/src/main/java/org/apache/accumulo/core/iteratorsImpl/system/MapFileIterator.java
+++ /dev/null
@@ -1,128 +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.core.iteratorsImpl.system;
-
-import java.io.DataInputStream;
-import java.io.IOException;
-import java.util.Collection;
-import java.util.Map;
-import java.util.concurrent.atomic.AtomicBoolean;
-
-import org.apache.accumulo.core.data.ByteSequence;
-import org.apache.accumulo.core.data.Key;
-import org.apache.accumulo.core.data.Range;
-import org.apache.accumulo.core.data.Value;
-import org.apache.accumulo.core.dataImpl.KeyExtent;
-import org.apache.accumulo.core.file.FileSKVIterator;
-import org.apache.accumulo.core.file.blockfile.impl.CacheProvider;
-import org.apache.accumulo.core.iterators.IteratorEnvironment;
-import org.apache.accumulo.core.iterators.SortedKeyValueIterator;
-import org.apache.accumulo.core.sample.impl.SamplerConfigurationImpl;
-import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.fs.FileSystem;
-
-public class MapFileIterator implements FileSKVIterator {
-
- private static final String MSG = "Map files are not supported";
-
- public MapFileIterator(FileSystem fs, String dir, Configuration conf) {
- throw new UnsupportedOperationException(MSG);
- }
-
- @Override
- public void setInterruptFlag(AtomicBoolean flag) {
- throw new UnsupportedOperationException(MSG);
- }
-
- @Override
- public void init(SortedKeyValueIterator<Key,Value> source,
Map<String,String> options,
- IteratorEnvironment env) {
- throw new UnsupportedOperationException(MSG);
- }
-
- @Override
- public boolean hasTop() {
- throw new UnsupportedOperationException(MSG);
- }
-
- @Override
- public void next() {
- throw new UnsupportedOperationException(MSG);
- }
-
- @Override
- public void seek(Range range, Collection<ByteSequence> columnFamilies,
boolean inclusive) {
- throw new UnsupportedOperationException(MSG);
- }
-
- @Override
- public Key getTopKey() {
- throw new UnsupportedOperationException(MSG);
- }
-
- @Override
- public Value getTopValue() {
- throw new UnsupportedOperationException(MSG);
- }
-
- @Override
- public SortedKeyValueIterator<Key,Value> deepCopy(IteratorEnvironment env) {
- throw new UnsupportedOperationException(MSG);
- }
-
- @Override
- public Key getFirstKey() {
- throw new UnsupportedOperationException(MSG);
- }
-
- @Override
- public Key getLastKey() {
- throw new UnsupportedOperationException(MSG);
- }
-
- @Override
- public DataInputStream getMetaStore(String name) {
- throw new UnsupportedOperationException(MSG);
- }
-
- @Override
- public long estimateOverlappingEntries(KeyExtent extent) throws IOException {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public void closeDeepCopies() {
- throw new UnsupportedOperationException(MSG);
- }
-
- @Override
- public void close() {
- throw new UnsupportedOperationException(MSG);
- }
-
- @Override
- public FileSKVIterator getSample(SamplerConfigurationImpl sampleConfig) {
- throw new UnsupportedOperationException(MSG);
- }
-
- @Override
- public void setCacheProvider(CacheProvider cacheProvider) {
- throw new UnsupportedOperationException(MSG);
- }
-}