View Javadoc

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