This is an automated email from the ASF dual-hosted git repository.
adoroszlai pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ozone.git
The following commit(s) were added to refs/heads/master by this push:
new 52ebd81156 HDDS-8113. Remove Hadoop 2.7 compatibility hack (#5776)
52ebd81156 is described below
commit 52ebd81156d62e741e69851a209718f238cb2a42
Author: Doroszlai, Attila <[email protected]>
AuthorDate: Sun Dec 24 19:02:30 2023 +0100
HDDS-8113. Remove Hadoop 2.7 compatibility hack (#5776)
---
.../org/apache/hadoop/fs/StreamCapabilities.java | 132 ---------------------
.../java/org/apache/hadoop/fs/package-info.java | 29 -----
2 files changed, 161 deletions(-)
diff --git
a/hadoop-ozone/ozonefs-hadoop2/src/main/java/org/apache/hadoop/fs/StreamCapabilities.java
b/hadoop-ozone/ozonefs-hadoop2/src/main/java/org/apache/hadoop/fs/StreamCapabilities.java
deleted file mode 100644
index 810cd39533..0000000000
---
a/hadoop-ozone/ozonefs-hadoop2/src/main/java/org/apache/hadoop/fs/StreamCapabilities.java
+++ /dev/null
@@ -1,132 +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
- *
- * http://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.hadoop.fs;
-
-import org.apache.hadoop.classification.InterfaceAudience;
-import org.apache.hadoop.classification.InterfaceStability;
-
-/**
- * Interface to query streams for supported capabilities.
- *
- * This is copied from Hadoop3 code to make Ozone compatible with Hadoop2.7
- * runtime dependency. Hadoop 2.7 does not support StreamCapabilities API.
- *
- * TODO: remove this interface once we drop Hadoop 2.7 support. (HDDS-8113)
- *
- * Capability strings must be in lower case.
- *
- * Constant strings are chosen over enums in order to allow other file systems
- * to define their own capabilities.
- */
[email protected]
[email protected]
-public interface StreamCapabilities {
- /**
- * Stream hflush capability implemented by {@link Syncable#hflush()}.
- *
- * Use the {@link #HSYNC} probe to check for the support of Syncable;
- * it's that presence of {@code hsync()} which matters.
- */
- @Deprecated
- String HFLUSH = "hflush";
-
- /**
- * Stream hsync capability implemented by {@link Syncable#hsync()}.
- */
- String HSYNC = "hsync";
-
- /**
- * Stream setReadahead capability implemented by
- * {@link CanSetReadahead#setReadahead(Long)}.
- */
- String READAHEAD = "in:readahead";
-
- /**
- * Stream setDropBehind capability implemented by
- * {@link CanSetDropBehind#setDropBehind(Boolean)}.
- */
- String DROPBEHIND = "dropbehind";
-
- /**
- * Stream unbuffer capability implemented by {@link CanUnbuffer#unbuffer()}.
- */
- String UNBUFFER = "in:unbuffer";
-
- /**
- * Stream read(ByteBuffer) capability implemented by
- * {@link ByteBufferReadable#read(java.nio.ByteBuffer)}.
- */
- String READBYTEBUFFER = "in:readbytebuffer";
-
- /**
- * Stream read(long, ByteBuffer) capability implemented by
- * ByteBufferPositionedReadable.
- */
- String PREADBYTEBUFFER = "in:preadbytebuffer";
-
- /**
- * IOStatisticsSource API.
- */
- String IOSTATISTICS = "iostatistics";
-
- /**
- * Support for vectored IO api.
- * See {@code PositionedReadable#readVectored(List, IntFunction)}.
- */
- String VECTOREDIO = "in:readvectored";
-
- /**
- * Stream abort() capability implemented by Abortable.
- */
- String ABORTABLE_STREAM = "fs.capability.outputstream.abortable";
-
- /**
- * Streams that support IOStatistics context and capture thread-level
- * IOStatistics.
- */
- String IOSTATISTICS_CONTEXT = "fs.capability.iocontext.supported";
-
- /**
- * Capabilities that a stream can support and be queried for.
- */
- @Deprecated
- enum StreamCapability {
- HFLUSH(StreamCapabilities.HFLUSH),
- HSYNC(StreamCapabilities.HSYNC);
-
- private final String capability;
-
- StreamCapability(String value) {
- this.capability = value;
- }
-
- public final String getValue() {
- return capability;
- }
- }
-
- /**
- * Query the stream for a specific capability.
- *
- * @param capability string to query the stream support for.
- * @return True if the stream supports capability.
- */
- boolean hasCapability(String capability);
-}
-
diff --git
a/hadoop-ozone/ozonefs-hadoop2/src/main/java/org/apache/hadoop/fs/package-info.java
b/hadoop-ozone/ozonefs-hadoop2/src/main/java/org/apache/hadoop/fs/package-info.java
deleted file mode 100644
index b29b1399da..0000000000
---
a/hadoop-ozone/ozonefs-hadoop2/src/main/java/org/apache/hadoop/fs/package-info.java
+++ /dev/null
@@ -1,29 +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
- *
- * http://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.
- *
- */
-
-/**
- * Utility classes copied from Hadoop3 to maintain Hadoop2 runtime
- * compatibility.
- */
[email protected]
[email protected]
-package org.apache.hadoop.fs;
-
-import org.apache.hadoop.hdds.annotation.InterfaceAudience;
-import org.apache.hadoop.hdds.annotation.InterfaceStability;
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]