From 409523b110d3b2e871d8406b62014dec4ce56b77 Mon Sep 17 00:00:00 2001 From: Sayed Anisul Hoque Date: Tue, 16 Apr 2019 18:24:58 +0200 Subject: [PATCH] HBASE-22248 Removed deprecated CollectionUtils --- .../hadoop/hbase/util/CollectionUtils.java | 33 ------------------- .../metrics/impl/MetricRegistryImpl.java | 12 +++---- 2 files changed, 6 insertions(+), 39 deletions(-) delete mode 100644 hbase-common/src/main/java/org/apache/hadoop/hbase/util/CollectionUtils.java diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/CollectionUtils.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/CollectionUtils.java deleted file mode 100644 index 4ba3940126d..00000000000 --- a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/CollectionUtils.java +++ /dev/null @@ -1,33 +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.hbase.util; - -import org.apache.yetus.audience.InterfaceAudience; - -/** - * Utility methods for dealing with Collections, including treating null collections as empty. - * @deprecated Since 2.0.6/2.1.3/2.2.0 - */ -@InterfaceAudience.Private -//HBASE-20215: Marking as deprecated. Although audience is private, there might be references to -//this class on some client classpath. -@Deprecated -public class CollectionUtils extends ConcurrentMapUtils { - -} diff --git a/hbase-metrics/src/main/java/org/apache/hadoop/hbase/metrics/impl/MetricRegistryImpl.java b/hbase-metrics/src/main/java/org/apache/hadoop/hbase/metrics/impl/MetricRegistryImpl.java index 03c669fee0e..05e096304cf 100644 --- a/hbase-metrics/src/main/java/org/apache/hadoop/hbase/metrics/impl/MetricRegistryImpl.java +++ b/hbase-metrics/src/main/java/org/apache/hadoop/hbase/metrics/impl/MetricRegistryImpl.java @@ -31,7 +31,7 @@ import org.apache.hadoop.hbase.metrics.MetricRegistry; import org.apache.hadoop.hbase.metrics.MetricRegistryInfo; import org.apache.hadoop.hbase.metrics.MetricSet; import org.apache.hadoop.hbase.metrics.Timer; -import org.apache.hadoop.hbase.util.CollectionUtils; +import org.apache.hadoop.hbase.util.ConcurrentMapUtils; import org.apache.yetus.audience.InterfaceAudience; /** @@ -51,7 +51,7 @@ public class MetricRegistryImpl implements MetricRegistry { @Override public Timer timer(String name) { - return (Timer) CollectionUtils.computeIfAbsent(metrics, name, this::createTimer); + return (Timer) ConcurrentMapUtils.computeIfAbsent(metrics, name, this::createTimer); } protected Timer createTimer() { @@ -60,7 +60,7 @@ public class MetricRegistryImpl implements MetricRegistry { @Override public Histogram histogram(String name) { - return (Histogram) CollectionUtils.computeIfAbsent(metrics, name, this::createHistogram); + return (Histogram) ConcurrentMapUtils.computeIfAbsent(metrics, name, this::createHistogram); } protected Histogram createHistogram() { @@ -69,7 +69,7 @@ public class MetricRegistryImpl implements MetricRegistry { @Override public Meter meter(String name) { - return (Meter) CollectionUtils.computeIfAbsent(metrics, name, this::createMeter); + return (Meter) ConcurrentMapUtils.computeIfAbsent(metrics, name, this::createMeter); } protected Meter createMeter() { @@ -78,7 +78,7 @@ public class MetricRegistryImpl implements MetricRegistry { @Override public Counter counter(String name) { - return (Counter) CollectionUtils.computeIfAbsent(metrics, name, this::createCounter); + return (Counter) ConcurrentMapUtils.computeIfAbsent(metrics, name, this::createCounter); } protected Counter createCounter() { @@ -92,7 +92,7 @@ public class MetricRegistryImpl implements MetricRegistry { @Override public Metric register(String name, Metric metric) { - return CollectionUtils.computeIfAbsent(metrics, name, () -> metric); + return ConcurrentMapUtils.computeIfAbsent(metrics, name, () -> metric); } @Override