PageRenderTime 21ms CodeModel.GetById 12ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/tags/release-0.2.0-rc0/src/java/org/apache/hcatalog/mapreduce/JobInfo.java

#
Java | 87 lines | 30 code | 13 blank | 44 comment | 0 complexity | 5252e86e86d949323c1a67460efaf00e MD5 | raw file
 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 */
18package org.apache.hcatalog.mapreduce;
19
20import java.io.Serializable;
21import java.util.List;
22
23import org.apache.hcatalog.data.schema.HCatSchema;
24
25/** The class used to serialize and store the information read from the metadata server */
26public class JobInfo implements Serializable{
27
28    /** The serialization version */
29    private static final long serialVersionUID = 1L;
30
31    /** The db and table names. */
32    private final String dbName;
33    private final String tableName;
34
35    /** The table schema. */
36    private final HCatSchema tableSchema;
37
38    /** The list of partitions matching the filter. */
39    private final List<PartInfo> partitions;
40
41    /**
42     * Instantiates a new hcat job info.
43     * @param hcatTableInfo 
44     * @param tableSchema the table schema
45     * @param partitions the partitions
46     */
47    public JobInfo(HCatTableInfo hcatTableInfo, HCatSchema tableSchema,
48            List<PartInfo> partitions) {
49        this.tableName = hcatTableInfo.getTableName();
50        this.dbName = hcatTableInfo.getDatabaseName();
51        this.tableSchema = tableSchema;
52        this.partitions = partitions;
53    }
54
55    /**
56     * Gets the value of dbName
57     * @return the dbName
58     */
59    public String getDatabaseName() {
60        return tableName;
61    }
62
63    /**
64     * Gets the value of tableName
65     * @return the tableName
66     */
67    public String getTableName() {
68        return tableName;
69    }
70
71    /**
72     * Gets the value of tableSchema
73     * @return the tableSchema
74     */
75    public HCatSchema getTableSchema() {
76        return tableSchema;
77    }
78
79    /**
80     * Gets the value of partitions
81     * @return the partitions
82     */
83    public List<PartInfo> getPartitions() {
84        return partitions;
85    }
86
87}