001/**
002 * Licensed to the Apache Software Foundation (ASF) under one
003 * or more contributor license agreements.  See the NOTICE file
004 * distributed with this work for additional information
005 * regarding copyright ownership.  The ASF licenses this file
006 * to you under the Apache License, Version 2.0 (the
007 * "License"); you may not use this file except in compliance
008 * with the License.  You may obtain a copy of the License at
009 *
010 *     http://www.apache.org/licenses/LICENSE-2.0
011 *
012 * Unless required by applicable law or agreed to in writing, software
013 * distributed under the License is distributed on an "AS IS" BASIS,
014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015 * See the License for the specific language governing permissions and
016 * limitations under the License.
017 */
018package org.apache.hadoop.hbase.master.region;
019
020import org.apache.hadoop.hbase.Server;
021import org.apache.hadoop.hbase.client.TableDescriptor;
022import org.apache.yetus.audience.InterfaceAudience;
023
024/**
025 * The parameters for constructing {@link MasterRegion}.
026 */
027@InterfaceAudience.Private
028public class MasterRegionParams {
029
030  private Server server;
031
032  private String regionDirName;
033
034  private TableDescriptor tableDescriptor;
035
036  private Long flushSize;
037
038  private Long flushPerChanges;
039
040  private Long flushIntervalMs;
041
042  private Integer compactMin;
043
044  private Integer maxWals;
045
046  private Boolean useHsync;
047
048  private Integer ringBufferSlotCount;
049
050  private Long rollPeriodMs;
051
052  private String archivedWalSuffix;
053
054  private String archivedHFileSuffix;
055
056  private Boolean useMetaCellComparator;
057
058  public MasterRegionParams server(Server server) {
059    this.server = server;
060    return this;
061  }
062
063  public MasterRegionParams regionDirName(String regionDirName) {
064    this.regionDirName = regionDirName;
065    return this;
066  }
067
068  public MasterRegionParams tableDescriptor(TableDescriptor tableDescriptor) {
069    this.tableDescriptor = tableDescriptor;
070    return this;
071  }
072
073  public MasterRegionParams flushSize(long flushSize) {
074    this.flushSize = flushSize;
075    return this;
076  }
077
078  public MasterRegionParams flushPerChanges(long flushPerChanges) {
079    this.flushPerChanges = flushPerChanges;
080    return this;
081  }
082
083  public MasterRegionParams flushIntervalMs(long flushIntervalMs) {
084    this.flushIntervalMs = flushIntervalMs;
085    return this;
086  }
087
088  public MasterRegionParams compactMin(int compactMin) {
089    this.compactMin = compactMin;
090    return this;
091  }
092
093  public MasterRegionParams maxWals(int maxWals) {
094    this.maxWals = maxWals;
095    return this;
096  }
097
098  public MasterRegionParams useHsync(boolean useHsync) {
099    this.useHsync = useHsync;
100    return this;
101  }
102
103  public MasterRegionParams ringBufferSlotCount(int ringBufferSlotCount) {
104    this.ringBufferSlotCount = ringBufferSlotCount;
105    return this;
106  }
107
108  public MasterRegionParams rollPeriodMs(long rollPeriodMs) {
109    this.rollPeriodMs = rollPeriodMs;
110    return this;
111  }
112
113  public MasterRegionParams archivedWalSuffix(String archivedWalSuffix) {
114    this.archivedWalSuffix = archivedWalSuffix;
115    return this;
116  }
117
118  public MasterRegionParams archivedHFileSuffix(String archivedHFileSuffix) {
119    this.archivedHFileSuffix = archivedHFileSuffix;
120    return this;
121  }
122
123  public MasterRegionParams useMetaCellComparator(boolean useMetaCellComparator) {
124    this.useMetaCellComparator = useMetaCellComparator;
125    return this;
126  }
127
128  public Server server() {
129    return server;
130  }
131
132  public String regionDirName() {
133    return regionDirName;
134  }
135
136  public TableDescriptor tableDescriptor() {
137    return tableDescriptor;
138  }
139
140  public long flushSize() {
141    return flushSize;
142  }
143
144  public long flushPerChanges() {
145    return flushPerChanges;
146  }
147
148  public long flushIntervalMs() {
149    return flushIntervalMs;
150  }
151
152  public int compactMin() {
153    return compactMin;
154  }
155
156  public int maxWals() {
157    return maxWals;
158  }
159
160  public Boolean useHsync() {
161    return useHsync;
162  }
163
164  public int ringBufferSlotCount() {
165    return ringBufferSlotCount;
166  }
167
168  public long rollPeriodMs() {
169    return rollPeriodMs;
170  }
171
172  public String archivedWalSuffix() {
173    return archivedWalSuffix;
174  }
175
176  public String archivedHFileSuffix() {
177    return archivedHFileSuffix;
178  }
179
180  public Boolean useMetaCellComparator() {
181    return useMetaCellComparator;
182  }
183}