HBASE-26412 Handle sink failure in RegionReplicationSink (#3815)
[hbase.git] / hbase-server / src / main / java / org / apache / hadoop / hbase / regionserver / CSLMImmutableSegment.java
blob52ff44ae59098bdd21d78a0723e9ef7f3e107ec1
1 /**
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License. You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
19 package org.apache.hadoop.hbase.regionserver;
21 import org.apache.yetus.audience.InterfaceAudience;
22 import org.apache.hadoop.hbase.util.ClassSize;
24 /**
25 * CSLMImmutableSegment is an abstract class that extends the API supported by a {@link Segment},
26 * and {@link ImmutableSegment}. This immutable segment is working with CellSet with
27 * ConcurrentSkipListMap (CSLM) delegatee.
29 @InterfaceAudience.Private
30 public class CSLMImmutableSegment extends ImmutableSegment {
31 public static final long DEEP_OVERHEAD_CSLM =
32 ImmutableSegment.DEEP_OVERHEAD + ClassSize.CONCURRENT_SKIPLISTMAP;
34 /**------------------------------------------------------------------------
35 * Copy C-tor to be used when new CSLMImmutableSegment is being built from a Mutable one.
36 * This C-tor should be used when active MutableSegment is pushed into the compaction
37 * pipeline and becomes an ImmutableSegment.
39 protected CSLMImmutableSegment(Segment segment, MemStoreSizing memstoreSizing) {
40 super(segment);
41 // update the segment metadata heap size
42 long indexOverhead = -MutableSegment.DEEP_OVERHEAD + DEEP_OVERHEAD_CSLM;
43 incMemStoreSize(0, indexOverhead, 0, 0); // CSLM is always on-heap
44 if (memstoreSizing != null) {
45 memstoreSizing.incMemStoreSize(0, indexOverhead, 0, 0);
49 @Override
50 protected long indexEntrySize() {
51 return ClassSize.CONCURRENT_SKIPLISTMAP_ENTRY;
54 @Override protected boolean canBeFlattened() {
55 return true;