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 6c44169771 HDDS-7863. Remove OzoneStreamCapabilities (#4247)
6c44169771 is described below
commit 6c4416977148597c86b83d68f13d47707621df3e
Author: Doroszlai, Attila <[email protected]>
AuthorDate: Sat Feb 4 20:09:17 2023 +0100
HDDS-7863. Remove OzoneStreamCapabilities (#4247)
---
.../hadoop/fs/ozone/CapableOzoneFSInputStream.java | 4 +-
.../hadoop/fs/ozone/OzoneStreamCapabilities.java | 47 ----------------------
.../hadoop/fs/ozone/TestOzoneFSInputStream.java | 3 +-
3 files changed, 4 insertions(+), 50 deletions(-)
diff --git
a/hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/CapableOzoneFSInputStream.java
b/hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/CapableOzoneFSInputStream.java
index 2e8a469050..290546e4a1 100644
---
a/hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/CapableOzoneFSInputStream.java
+++
b/hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/CapableOzoneFSInputStream.java
@@ -33,8 +33,8 @@ final class CapableOzoneFSInputStream extends
OzoneFSInputStream
@Override
public boolean hasCapability(String capability) {
switch (StringUtils.toLowerCase(capability)) {
- case OzoneStreamCapabilities.READBYTEBUFFER:
- case OzoneStreamCapabilities.UNBUFFER:
+ case StreamCapabilities.READBYTEBUFFER:
+ case StreamCapabilities.UNBUFFER:
return true;
default:
return false;
diff --git
a/hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/OzoneStreamCapabilities.java
b/hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/OzoneStreamCapabilities.java
deleted file mode 100644
index 5dd69a4500..0000000000
---
a/hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/OzoneStreamCapabilities.java
+++ /dev/null
@@ -1,47 +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
- * <p>
- * http://www.apache.org/licenses/LICENSE-2.0
- * <p>
- * 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.ozone;
-
-import org.apache.hadoop.fs.CanUnbuffer;
-
-import java.nio.ByteBuffer;
-
-/**
- * Utility class to query streams for supported capabilities of Ozone.
- * Capability strings must be in lower case.
- */
-final class OzoneStreamCapabilities {
-
- private OzoneStreamCapabilities() {
- }
-
- /**
- * Stream read(ByteBuffer) capability implemented by
- * {@link OzoneFSInputStream#read(ByteBuffer)}.
- *
- * TODO: If Hadoop dependency is upgraded, this string can be removed.
- */
- static final String READBYTEBUFFER = "in:readbytebuffer";
-
- /**
- * Stream unbuffer capability implemented by {@link CanUnbuffer#unbuffer()}.
- *
- * TODO: If Hadoop dependency is upgraded, this string can be removed.
- */
- static final String UNBUFFER = "in:unbuffer";
-}
diff --git
a/hadoop-ozone/ozonefs-common/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneFSInputStream.java
b/hadoop-ozone/ozonefs-common/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneFSInputStream.java
index fec292ab8d..90d3948d57 100644
---
a/hadoop-ozone/ozonefs-common/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneFSInputStream.java
+++
b/hadoop-ozone/ozonefs-common/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneFSInputStream.java
@@ -20,6 +20,7 @@ package org.apache.hadoop.fs.ozone;
import com.google.common.collect.ImmutableList;
import org.apache.commons.lang3.RandomUtils;
import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.StreamCapabilities;
import org.junit.Test;
import java.io.ByteArrayInputStream;
@@ -123,7 +124,7 @@ public class TestOzoneFSInputStream {
new FileSystem.Statistics("test"));
assertTrue(capableOzoneFSInputStream.
- hasCapability(OzoneStreamCapabilities.READBYTEBUFFER));
+ hasCapability(StreamCapabilities.READBYTEBUFFER));
} finally {
if (capableOzoneFSInputStream != null) {
capableOzoneFSInputStream.close();
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]