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  package org.apache.hadoop.hbase.master;
19  
20  import com.google.protobuf.Service;
21  import org.apache.hadoop.conf.Configuration;
22  import org.apache.hadoop.hbase.*;
23  import org.apache.hadoop.hbase.client.ClusterConnection;
24  import org.apache.hadoop.hbase.executor.ExecutorService;
25  import org.apache.hadoop.hbase.master.procedure.MasterProcedureEnv;
26  import org.apache.hadoop.hbase.master.snapshot.SnapshotManager;
27  import org.apache.hadoop.hbase.procedure2.ProcedureExecutor;
28  import org.apache.hadoop.hbase.quotas.MasterQuotaManager;
29  import org.apache.hadoop.hbase.security.User;
30  import org.apache.hadoop.hbase.zookeeper.MetaTableLocator;
31  import org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher;
32  
33  import java.io.IOException;
34  import java.util.List;
35  
36  public class MockNoopMasterServices implements MasterServices, Server {
37    @Override
38    public SnapshotManager getSnapshotManager() {
39      return null;
40    }
41  
42    @Override
43    public AssignmentManager getAssignmentManager() {
44      return null;
45    }
46  
47    @Override
48    public MasterFileSystem getMasterFileSystem() {
49      return null;
50    }
51  
52    @Override
53    public ServerManager getServerManager() {
54      return null;
55    }
56  
57    @Override
58    public ExecutorService getExecutorService() {
59      return null;
60    }
61  
62    @Override
63    public TableLockManager getTableLockManager() {
64      return null;
65    }
66  
67    @Override
68    public MasterCoprocessorHost getMasterCoprocessorHost() {
69      return null;
70    }
71  
72    @Override
73    public TableNamespaceManager getTableNamespaceManager() {
74      return null;
75    }
76  
77    @Override
78    public MasterQuotaManager getMasterQuotaManager() {
79      return null;
80    }
81  
82    @Override
83    public ProcedureExecutor<MasterProcedureEnv> getMasterProcedureExecutor() {
84      return null;
85    }
86  
87    @Override
88    public void checkTableModifiable(TableName tableName) throws IOException, TableNotFoundException, TableNotDisabledException {
89  
90    }
91  
92    @Override
93    public long createTable(HTableDescriptor desc, byte[][] splitKeys, long nonceGroup, long nonce) throws IOException {
94      return 0;
95    }
96  
97    @Override
98    public long createSystemTable(HTableDescriptor hTableDescriptor) throws IOException {
99      return 0;
100   }
101 
102   @Override
103   public long deleteTable(TableName tableName, long nonceGroup, long nonce) throws IOException {
104     return 0;
105   }
106 
107   @Override
108   public void truncateTable(TableName tableName, boolean preserveSplits, long nonceGroup, long nonce) throws IOException {
109 
110   }
111 
112   @Override
113   public void modifyTable(TableName tableName, HTableDescriptor descriptor, long nonceGroup, long nonce) throws IOException {
114 
115   }
116 
117   @Override
118   public long enableTable(TableName tableName, long nonceGroup, long nonce) throws IOException {
119     return 0;
120   }
121 
122   @Override
123   public long disableTable(TableName tableName, long nonceGroup, long nonce) throws IOException {
124     return 0;
125   }
126 
127   @Override
128   public void addColumn(TableName tableName, HColumnDescriptor column, long nonceGroup, long nonce) throws IOException {
129 
130   }
131 
132   @Override
133   public void modifyColumn(TableName tableName, HColumnDescriptor descriptor, long nonceGroup, long nonce) throws IOException {
134 
135   }
136 
137   @Override
138   public void deleteColumn(TableName tableName, byte[] columnName, long nonceGroup, long nonce) throws IOException {
139 
140   }
141 
142   @Override
143   public TableDescriptors getTableDescriptors() {
144     return null;
145   }
146 
147   @Override
148   public boolean isServerCrashProcessingEnabled() {
149     return false;
150   }
151 
152   @Override
153   public boolean registerService(Service instance) {
154     return false;
155   }
156 
157   @Override
158   public void dispatchMergingRegions(HRegionInfo region_a, HRegionInfo region_b, boolean forcible, User user) throws IOException {
159 
160   }
161 
162   @Override
163   public boolean isInitialized() {
164     return false;
165   }
166 
167   @Override
168   public void createNamespace(NamespaceDescriptor descriptor, long nonceGroup, long nonce) throws IOException {
169 
170   }
171 
172   @Override
173   public void createNamespaceSync(
174       final NamespaceDescriptor descriptor,
175       final long nonceGroup,
176       final long nonce,
177       final boolean executeCoprocessor) throws IOException {
178 
179   }
180 
181   @Override
182   public void modifyNamespace(NamespaceDescriptor descriptor, long nonceGroup, long nonce) throws IOException {
183 
184   }
185 
186   @Override
187   public void deleteNamespace(String name, long nonceGroup, long nonce) throws IOException {
188 
189   }
190 
191   @Override
192   public boolean abortProcedure(long procId, boolean mayInterruptIfRunning) throws IOException {
193     return false;
194   }
195 
196   @Override
197   public List<ProcedureInfo> listProcedures() throws IOException {
198     return null;
199   }
200 
201   @Override
202   public NamespaceDescriptor getNamespaceDescriptor(String name) throws IOException {
203     return null;
204   }
205 
206   @Override
207   public List<NamespaceDescriptor> listNamespaceDescriptors() throws IOException {
208     return null;
209   }
210 
211   @Override
212   public List<HTableDescriptor> listTableDescriptorsByNamespace(String name) throws IOException {
213     return null;
214   }
215 
216   @Override
217   public List<TableName> listTableNamesByNamespace(String name) throws IOException {
218     return null;
219   }
220 
221   @Override
222   public long getLastMajorCompactionTimestamp(TableName table) throws IOException {
223     return 0;
224   }
225 
226   @Override
227   public long getLastMajorCompactionTimestampForRegion(byte[] regionName) throws IOException {
228     return 0;
229   }
230 
231   @Override
232   public Configuration getConfiguration() {
233     return null;
234   }
235 
236   @Override
237   public ZooKeeperWatcher getZooKeeper() {
238     return null;
239   }
240 
241   @Override
242   public ClusterConnection getConnection() {
243     return null;
244   }
245 
246   @Override
247   public MetaTableLocator getMetaTableLocator() {
248     return null;
249   }
250 
251   @Override
252   public ServerName getServerName() {
253     return null;
254   }
255 
256   @Override
257   public CoordinatedStateManager getCoordinatedStateManager() {
258     return null;
259   }
260 
261   @Override
262   public ChoreService getChoreService() {
263     return null;
264   }
265 
266   @Override
267   public void abort(String why, Throwable e) {
268 
269   }
270 
271   @Override
272   public boolean isAborted() {
273     return false;
274   }
275 
276   @Override
277   public void stop(String why) {
278 
279   }
280 
281   @Override
282   public boolean isStopped() {
283     return false;
284   }
285 }