From 24b7fc92f0f77ea44831d6c9e090406df4be2dc5 Mon Sep 17 00:00:00 2001 From: BELUGA BEHR Date: Sat, 30 Dec 2017 06:33:09 +0800 Subject: [PATCH] HBASE-19649 Use singleton feature for ImmutableSegment Signed-off-by: Chia-Ping Tsai --- .../hbase/regionserver/ImmutableSegment.java | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/ImmutableSegment.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/ImmutableSegment.java index 02a05c89d05..c899eab5bae 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/ImmutableSegment.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/ImmutableSegment.java @@ -18,15 +18,11 @@ */ package org.apache.hadoop.hbase.regionserver; - -import org.apache.yetus.audience.InterfaceAudience; -import org.apache.hadoop.hbase.util.ClassSize; -import org.apache.hadoop.hbase.CellComparator; -import org.apache.hadoop.hbase.io.TimeRange; - -import java.util.ArrayList; -import java.util.Arrays; +import java.util.Collections; import java.util.List; +import org.apache.hadoop.hbase.CellComparator; +import org.apache.hadoop.hbase.util.ClassSize; +import org.apache.yetus.audience.InterfaceAudience; /** * ImmutableSegment is an abstract class that extends the API supported by a {@link Segment}, @@ -75,8 +71,7 @@ public abstract class ImmutableSegment extends Segment { } public List getAllSegments() { - List res = new ArrayList<>(Arrays.asList(this)); - return res; + return Collections.singletonList(this); } @Override