HBASE-19649 Use singleton feature for ImmutableSegment

Signed-off-by: Chia-Ping Tsai <chia7712@gmail.com>
This commit is contained in:
BELUGA BEHR 2017-12-30 06:33:09 +08:00 committed by Chia-Ping Tsai
parent 9e141d12a4
commit 24b7fc92f0
1 changed files with 5 additions and 10 deletions

View File

@ -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<Segment> getAllSegments() {
List<Segment> res = new ArrayList<>(Arrays.asList(this));
return res;
return Collections.singletonList(this);
}
@Override