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