YARN-7919. Refactor timelineservice-hbase module into submodules. Contributed by...
[hadoop.git] / hadoop-yarn-project / hadoop-yarn / hadoop-yarn-server / hadoop-yarn-server-timelineservice-hbase / hadoop-yarn-server-timelineservice-hbase-common / src / main / java / org / apache / hadoop / yarn / server / timelineservice / storage / application / ApplicationColumnFamily.java
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
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
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.
17 */
18 package org.apache.hadoop.yarn.server.timelineservice.storage.application;
19
20 import org.apache.hadoop.hbase.util.Bytes;
21 import org.apache.hadoop.yarn.server.timelineservice.storage.common.ColumnFamily;
22 import org.apache.hadoop.yarn.server.timelineservice.storage.common.Separator;
23
24 /**
25 * Represents the application table column families.
26 */
27 public enum ApplicationColumnFamily implements ColumnFamily<ApplicationTable> {
28
29 /**
30 * Info column family houses known columns, specifically ones included in
31 * columnfamily filters.
32 */
33 INFO("i"),
34
35 /**
36 * Configurations are in a separate column family for two reasons: a) the size
37 * of the config values can be very large and b) we expect that config values
38 * are often separately accessed from other metrics and info columns.
39 */
40 CONFIGS("c"),
41
42 /**
43 * Metrics have a separate column family, because they have a separate TTL.
44 */
45 METRICS("m");
46
47 /**
48 * Byte representation of this column family.
49 */
50 private final byte[] bytes;
51
52 /**
53 * @param value create a column family with this name. Must be lower case and
54 * without spaces.
55 */
56 private ApplicationColumnFamily(String value) {
57 // column families should be lower case and not contain any spaces.
58 this.bytes = Bytes.toBytes(Separator.SPACE.encode(value));
59 }
60
61 public byte[] getBytes() {
62 return Bytes.copy(bytes);
63 }
64
65 }