View Javadoc

1   /**
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *     http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing, software
13   * distributed under the License is distributed on an "AS IS" BASIS,
14   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15   * See the License for the specific language governing permissions and
16   * limitations under the License.
17   */
18  
19  package org.apache.hadoop.hbase.backup;
20  
21  import java.util.List;
22  
23  import org.apache.hadoop.hbase.TableName;
24  import org.apache.hadoop.hbase.backup.BackupType;
25  import org.apache.hadoop.hbase.classification.InterfaceAudience;
26  import org.apache.hadoop.hbase.classification.InterfaceStability;
27  
28  /**
29   * POJO class for backup request
30   */
31  @InterfaceAudience.Public
32  @InterfaceStability.Evolving
33  public final class BackupRequest {
34    private BackupType type;
35    private List<TableName> tableList;
36    private String targetRootDir;
37    private int workers = -1;
38    private long bandwidth = -1L;
39  
40    public BackupRequest() {
41    }
42  
43    public BackupRequest setBackupType(BackupType type) {
44      this.type = type;
45      return this;
46    }
47    public BackupType getBackupType() {
48      return this.type;
49    }
50  
51    public BackupRequest setTableList(List<TableName> tableList) {
52      this.tableList = tableList;
53      return this;
54    }
55    public List<TableName> getTableList() {
56      return this.tableList;
57    }
58  
59    public BackupRequest setTargetRootDir(String targetRootDir) {
60      this.targetRootDir = targetRootDir;
61      return this;
62    }
63    public String getTargetRootDir() {
64      return this.targetRootDir;
65    }
66  
67    public BackupRequest setWorkers(int workers) {
68      this.workers = workers;
69      return this;
70    }
71    public int getWorkers() {
72      return this.workers;
73    }
74  
75    public BackupRequest setBandwidth(long bandwidth) {
76      this.bandwidth = bandwidth;
77      return this;
78    }
79    public long getBandwidth() {
80      return this.bandwidth;
81    }
82  }