1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package org.apache.hadoop.hbase.client;
21
22 import org.apache.hadoop.hbase.classification.InterfaceAudience;
23 import org.apache.hadoop.hbase.classification.InterfaceStability;
24 import org.apache.hadoop.hbase.HColumnDescriptor;
25 import org.apache.hadoop.hbase.HTableDescriptor;
26
27
28
29
30 @InterfaceAudience.Public
31 @InterfaceStability.Evolving
32 public class UnmodifyableHTableDescriptor extends HTableDescriptor {
33
34 public UnmodifyableHTableDescriptor() {
35 super();
36 }
37
38
39
40
41
42 UnmodifyableHTableDescriptor(final HTableDescriptor desc) {
43 super(desc.getTableName(), getUnmodifyableFamilies(desc), desc.getValues());
44 }
45
46
47
48
49
50
51 private static HColumnDescriptor[] getUnmodifyableFamilies(
52 final HTableDescriptor desc) {
53 HColumnDescriptor [] f = new HColumnDescriptor[desc.getFamilies().size()];
54 int i = 0;
55 for (HColumnDescriptor c: desc.getFamilies()) {
56 f[i++] = c;
57 }
58 return f;
59 }
60
61
62
63
64
65 @Override
66 public HTableDescriptor addFamily(final HColumnDescriptor family) {
67 throw new UnsupportedOperationException("HTableDescriptor is read-only");
68 }
69
70 @Override
71 public HTableDescriptor modifyFamily(HColumnDescriptor family) {
72 throw new UnsupportedOperationException("HTableDescriptor is read-only");
73 }
74
75
76
77
78
79
80 @Override
81 public HColumnDescriptor removeFamily(final byte [] column) {
82 throw new UnsupportedOperationException("HTableDescriptor is read-only");
83 }
84
85
86
87
88 @Override
89 public HTableDescriptor setReadOnly(boolean readOnly) {
90 throw new UnsupportedOperationException("HTableDescriptor is read-only");
91 }
92
93
94
95
96 @Override
97 public HTableDescriptor setValue(byte[] key, byte[] value) {
98 throw new UnsupportedOperationException("HTableDescriptor is read-only");
99 }
100
101
102
103
104 @Override
105 public HTableDescriptor setValue(String key, String value) {
106 throw new UnsupportedOperationException("HTableDescriptor is read-only");
107 }
108
109
110
111
112 @Override
113 public HTableDescriptor setMaxFileSize(long maxFileSize) {
114 throw new UnsupportedOperationException("HTableDescriptor is read-only");
115 }
116
117
118
119
120 @Override
121 public HTableDescriptor setMemStoreFlushSize(long memstoreFlushSize) {
122 throw new UnsupportedOperationException("HTableDescriptor is read-only");
123 }
124
125
126
127
128
129
130
131
132 }