PageRenderTime 49ms CodeModel.GetById 18ms app.highlight 23ms RepoModel.GetById 1ms app.codeStats 1ms

/tags/release-0.0.0-rc0/hive/external/metastore/src/model/org/apache/hadoop/hive/metastore/model/MTable.java

#
Java | 240 lines | 107 code | 30 blank | 103 comment | 0 complexity | 998dad1c46bbe347501bfa045b050e9f 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 */
 18
 19package org.apache.hadoop.hive.metastore.model;
 20
 21import java.util.List;
 22import java.util.Map;
 23
 24public class MTable {
 25  
 26  private String tableName;
 27  private MDatabase database;
 28  private MStorageDescriptor sd;
 29  private String owner;
 30  private int createTime;
 31  private int lastAccessTime;
 32  private int retention;
 33  private List<MFieldSchema> partitionKeys;
 34  private Map<String, String> parameters;
 35  private String viewOriginalText;
 36  private String viewExpandedText;
 37  private String tableType;
 38
 39  public MTable() {}
 40
 41  /**
 42   * @param tableName
 43   * @param database
 44   * @param sd
 45   * @param owner
 46   * @param createTime
 47   * @param lastAccessTime
 48   * @param retention
 49   * @param partitionKeys
 50   * @param parameters
 51   * @param viewOriginalText
 52   * @param viewExpandedText
 53   * @param tableType
 54   */
 55  public MTable(String tableName, MDatabase database, MStorageDescriptor sd, String owner,
 56      int createTime, int lastAccessTime, int retention, List<MFieldSchema> partitionKeys,
 57      Map<String, String> parameters,
 58      String viewOriginalText, String viewExpandedText, String tableType) {
 59    this.tableName = tableName;
 60    this.database = database;
 61    this.sd = sd;
 62    this.owner = owner;
 63    this.createTime = createTime;
 64    this.setLastAccessTime(lastAccessTime);
 65    this.retention = retention;
 66    this.partitionKeys = partitionKeys;
 67    this.parameters = parameters;
 68    this.viewOriginalText = viewOriginalText;
 69    this.viewExpandedText = viewExpandedText;
 70    this.tableType = tableType;
 71  }
 72
 73  /**
 74   * @return the tableName
 75   */
 76  public String getTableName() {
 77    return tableName;
 78  }
 79
 80  /**
 81   * @param tableName the tableName to set
 82   */
 83  public void setTableName(String tableName) {
 84    this.tableName = tableName;
 85  }
 86
 87  /**
 88   * @return the sd
 89   */
 90  public MStorageDescriptor getSd() {
 91    return sd;
 92  }
 93
 94  /**
 95   * @param sd the sd to set
 96   */
 97  public void setSd(MStorageDescriptor sd) {
 98    this.sd = sd;
 99  }
100
101  /**
102   * @return the partKeys
103   */
104  public List<MFieldSchema> getPartitionKeys() {
105    return partitionKeys;
106  }
107
108  /**
109   * @param partKeys the partKeys to set
110   */
111  public void setPartitionKeys(List<MFieldSchema> partKeys) {
112    this.partitionKeys = partKeys;
113  }
114
115  /**
116   * @return the parameters
117   */
118  public Map<String, String> getParameters() {
119    return parameters;
120  }
121
122  /**
123   * @param parameters the parameters to set
124   */
125  public void setParameters(Map<String, String> parameters) {
126    this.parameters = parameters;
127  }
128
129  /**
130   * @return the original view text, or null if this table is not a view
131   */
132  public String getViewOriginalText() {
133    return viewOriginalText;
134  }
135
136  /**
137   * @param viewOriginalText the original view text to set
138   */
139  public void setViewOriginalText(String viewOriginalText) {
140    this.viewOriginalText = viewOriginalText;
141  }
142
143  /**
144   * @return the expanded view text, or null if this table is not a view
145   */
146  public String getViewExpandedText() {
147    return viewExpandedText;
148  }
149
150  /**
151   * @param viewExpandedText the expanded view text to set
152   */
153  public void setViewExpandedText(String viewExpandedText) {
154    this.viewExpandedText = viewExpandedText;
155  }
156
157  /**
158   * @return the owner
159   */
160  public String getOwner() {
161    return owner;
162  }
163
164  /**
165   * @param owner the owner to set
166   */
167  public void setOwner(String owner) {
168    this.owner = owner;
169  }
170
171  /**
172   * @return the createTime
173   */
174  public int getCreateTime() {
175    return createTime;
176  }
177
178  /**
179   * @param createTime the createTime to set
180   */
181  public void setCreateTime(int createTime) {
182    this.createTime = createTime;
183  }
184
185  /**
186   * @return the database
187   */
188  public MDatabase getDatabase() {
189    return database;
190  }
191
192  /**
193   * @param database the database to set
194   */
195  public void setDatabase(MDatabase database) {
196    this.database = database;
197  }
198
199  /**
200   * @return the retention
201   */
202  public int getRetention() {
203    return retention;
204  }
205
206  /**
207   * @param retention the retention to set
208   */
209  public void setRetention(int retention) {
210    this.retention = retention;
211  }
212
213  /**
214   * @param lastAccessTime the lastAccessTime to set
215   */
216  public void setLastAccessTime(int lastAccessTime) {
217    this.lastAccessTime = lastAccessTime;
218  }
219
220  /**
221   * @return the lastAccessTime
222   */
223  public int getLastAccessTime() {
224    return lastAccessTime;
225  }
226
227  /**
228   * @param tableType the tableType to set
229   */
230  public void setTableType(String tableType) {
231    this.tableType = tableType;
232  }
233
234  /**
235   * @return the tableType
236   */
237  public String getTableType() {
238    return tableType;
239  }
240}