1 /**
2 * Copyright 2010 The Apache Software Foundation
3 *
4 * Licensed to the Apache Software Foundation (ASF) under one
5 * or more contributor license agreements. See the NOTICE file
6 * distributed with this work for additional information
7 * regarding copyright ownership. The ASF licenses this file
8 * to you under the Apache License, Version 2.0 (the
9 * "License"); you may not use this file except in compliance
10 * with the License. You may obtain a copy of the License at
11 *
12 * http://www.apache.org/licenses/LICENSE-2.0
13 *
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 */
20
21 package org.apache.hadoop.hbase.client;
22
23 import org.apache.hadoop.hbase.HColumnDescriptor;
24 import org.apache.hadoop.hbase.io.hfile.Compression;
25
26 /**
27 * Immutable HColumnDescriptor
28 */
29 public class UnmodifyableHColumnDescriptor extends HColumnDescriptor {
30
31 /**
32 * @param desc wrapped
33 */
34 public UnmodifyableHColumnDescriptor (final HColumnDescriptor desc) {
35 super(desc);
36 }
37
38 /**
39 * @see org.apache.hadoop.hbase.HColumnDescriptor#setValue(byte[], byte[])
40 */
41 @Override
42 public void setValue(byte[] key, byte[] value) {
43 throw new UnsupportedOperationException("HColumnDescriptor is read-only");
44 }
45
46 /**
47 * @see org.apache.hadoop.hbase.HColumnDescriptor#setValue(java.lang.String, java.lang.String)
48 */
49 @Override
50 public void setValue(String key, String value) {
51 throw new UnsupportedOperationException("HColumnDescriptor is read-only");
52 }
53
54 /**
55 * @see org.apache.hadoop.hbase.HColumnDescriptor#setMaxVersions(int)
56 */
57 @Override
58 public void setMaxVersions(int maxVersions) {
59 throw new UnsupportedOperationException("HColumnDescriptor is read-only");
60 }
61
62 /**
63 * @see org.apache.hadoop.hbase.HColumnDescriptor#setInMemory(boolean)
64 */
65 @Override
66 public void setInMemory(boolean inMemory) {
67 throw new UnsupportedOperationException("HColumnDescriptor is read-only");
68 }
69
70 /**
71 * @see org.apache.hadoop.hbase.HColumnDescriptor#setBlockCacheEnabled(boolean)
72 */
73 @Override
74 public void setBlockCacheEnabled(boolean blockCacheEnabled) {
75 throw new UnsupportedOperationException("HColumnDescriptor is read-only");
76 }
77
78 /**
79 * @see org.apache.hadoop.hbase.HColumnDescriptor#setTimeToLive(int)
80 */
81 @Override
82 public void setTimeToLive(int timeToLive) {
83 throw new UnsupportedOperationException("HColumnDescriptor is read-only");
84 }
85
86 /**
87 * @see org.apache.hadoop.hbase.HColumnDescriptor#setCompressionType(org.apache.hadoop.hbase.io.hfile.Compression.Algorithm)
88 */
89 @Override
90 public void setCompressionType(Compression.Algorithm type) {
91 throw new UnsupportedOperationException("HColumnDescriptor is read-only");
92 }
93 }