HBASE-18503 Change ***Util and Master to use TableDescriptor and ColumnFamilyDescriptor
[hbase.git] / hbase-server / src / main / java / org / apache / hadoop / hbase / TableDescriptors.java
blob58b28e4985718cd7d7f1d99cc34b21eeedaf42a6
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
10 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 package org.apache.hadoop.hbase;
20 import java.io.IOException;
21 import java.util.Map;
23 import org.apache.hadoop.hbase.classification.InterfaceAudience;
24 import org.apache.hadoop.hbase.client.TableDescriptor;
26 /**
27 * Get, remove and modify table descriptors.
28 * Used by servers to host descriptors.
30 @InterfaceAudience.Private
31 public interface TableDescriptors {
32 /**
33 * @param tableName
34 * @return TableDescriptor for tablename
35 * @throws IOException
37 TableDescriptor get(final TableName tableName)
38 throws IOException;
40 /**
41 * Get Map of all NamespaceDescriptors for a given namespace.
42 * @return Map of all descriptors.
43 * @throws IOException
45 Map<String, TableDescriptor> getByNamespace(String name)
46 throws IOException;
48 /**
49 * Get Map of all TableDescriptors. Populates the descriptor cache as a
50 * side effect.
51 * @return Map of all descriptors.
52 * @throws IOException
54 Map<String, TableDescriptor> getAll()
55 throws IOException;
57 /**
58 * Get Map of all TableDescriptors. Populates the descriptor cache as a
59 * side effect.
60 * @return Map of all descriptors.
61 * @throws IOException
63 Map<String, TableDescriptor> getAllDescriptors()
64 throws IOException;
66 /**
67 * Add or update descriptor
68 * @param htd Descriptor to set into TableDescriptors
69 * @throws IOException
71 void add(final TableDescriptor htd)
72 throws IOException;
74 /**
75 * @param tablename
76 * @return Instance of table descriptor or null if none found.
77 * @throws IOException
79 TableDescriptor remove(final TableName tablename)
80 throws IOException;
82 /**
83 * Enables the tabledescriptor cache
85 void setCacheOn() throws IOException;
87 /**
88 * Disables the tabledescriptor cache
90 void setCacheOff() throws IOException;