1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.hadoop.hbase.regionserver;
20
21 import org.apache.hadoop.hbase.classification.InterfaceAudience;
22 import org.apache.hadoop.hbase.HColumnDescriptor;
23 import org.apache.hadoop.hbase.KeepDeletedCells;
24 import org.apache.hadoop.hbase.KeyValue.KVComparator;
25 import org.apache.hadoop.hbase.util.Bytes;
26 import org.apache.hadoop.hbase.util.ClassSize;
27 import org.apache.hadoop.conf.Configuration;
28 import org.apache.hadoop.hbase.HConstants;
29
30
31
32
33
34
35 @InterfaceAudience.Private
36 public class ScanInfo {
37 private byte[] family;
38 private int minVersions;
39 private int maxVersions;
40 private long ttl;
41 private KeepDeletedCells keepDeletedCells;
42 private long timeToPurgeDeletes;
43 private KVComparator comparator;
44 private long tableMaxRowSize;
45 private boolean usePread;
46 private long cellsPerTimeoutCheck;
47 private boolean parallelSeekEnabled;
48 private final Configuration conf;
49
50 public static final long FIXED_OVERHEAD = ClassSize.align(ClassSize.OBJECT
51 + (2 * ClassSize.REFERENCE) + (2 * Bytes.SIZEOF_INT)
52 + (4 * Bytes.SIZEOF_LONG) + (3 * Bytes.SIZEOF_BOOLEAN));
53
54
55
56
57
58
59
60
61
62 public ScanInfo(final Configuration conf, final HColumnDescriptor family, final long ttl,
63 final long timeToPurgeDeletes, final KVComparator comparator) {
64 this(conf, family.getName(), family.getMinVersions(), family.getMaxVersions(), ttl, family
65 .getKeepDeletedCells(), timeToPurgeDeletes, comparator);
66 }
67
68
69
70
71
72
73
74
75
76
77
78
79 public ScanInfo(final Configuration conf, final byte[] family, final int minVersions,
80 final int maxVersions, final long ttl, final KeepDeletedCells keepDeletedCells,
81 final long timeToPurgeDeletes, final KVComparator comparator) {
82 this.family = family;
83 this.minVersions = minVersions;
84 this.maxVersions = maxVersions;
85 this.ttl = ttl;
86 this.keepDeletedCells = keepDeletedCells;
87 this.timeToPurgeDeletes = timeToPurgeDeletes;
88 this.comparator = comparator;
89 this.tableMaxRowSize =
90 conf.getLong(HConstants.TABLE_MAX_ROWSIZE_KEY, HConstants.TABLE_MAX_ROWSIZE_DEFAULT);
91 this.usePread = conf.getBoolean("hbase.storescanner.use.pread", false);
92 long perHeartbeat =
93 conf.getLong(StoreScanner.HBASE_CELLS_SCANNED_PER_HEARTBEAT_CHECK,
94 StoreScanner.DEFAULT_HBASE_CELLS_SCANNED_PER_HEARTBEAT_CHECK);
95 this.cellsPerTimeoutCheck = perHeartbeat > 0?
96 perHeartbeat: StoreScanner.DEFAULT_HBASE_CELLS_SCANNED_PER_HEARTBEAT_CHECK;
97 this.parallelSeekEnabled =
98 conf.getBoolean(StoreScanner.STORESCANNER_PARALLEL_SEEK_ENABLE, false);
99 this.conf = conf;
100 }
101
102 public Configuration getConfiguration() {
103 return this.conf;
104 }
105
106 long getTableMaxRowSize() {
107 return this.tableMaxRowSize;
108 }
109
110 boolean isUsePread() {
111 return this.usePread;
112 }
113
114 long getCellsPerTimeoutCheck() {
115 return this.cellsPerTimeoutCheck;
116 }
117
118 boolean isParallelSeekEnabled() {
119 return this.parallelSeekEnabled;
120 }
121
122 public byte[] getFamily() {
123 return family;
124 }
125
126 public int getMinVersions() {
127 return minVersions;
128 }
129
130 public int getMaxVersions() {
131 return maxVersions;
132 }
133
134 public long getTtl() {
135 return ttl;
136 }
137
138 public KeepDeletedCells getKeepDeletedCells() {
139 return keepDeletedCells;
140 }
141
142 public long getTimeToPurgeDeletes() {
143 return timeToPurgeDeletes;
144 }
145
146 public KVComparator getComparator() {
147 return comparator;
148 }
149 }