PageRenderTime 46ms CodeModel.GetById 19ms 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
Possible License(s): Apache-2.0, BSD-3-Clause, JSON, CPL-1.0
  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.hcatalog.mapreduce;
  19. import java.io.Serializable;
  20. import java.util.List;
  21. import org.apache.hcatalog.data.schema.HCatSchema;
  22. /** The class used to serialize and store the information read from the metadata server */
  23. public class JobInfo implements Serializable{
  24. /** The serialization version */
  25. private static final long serialVersionUID = 1L;
  26. /** The db and table names. */
  27. private final String dbName;
  28. private final String tableName;
  29. /** The table schema. */
  30. private final HCatSchema tableSchema;
  31. /** The list of partitions matching the filter. */
  32. private final List<PartInfo> partitions;
  33. /**
  34. * Instantiates a new hcat job info.
  35. * @param hcatTableInfo
  36. * @param tableSchema the table schema
  37. * @param partitions the partitions
  38. */
  39. public JobInfo(HCatTableInfo hcatTableInfo, HCatSchema tableSchema,
  40. List<PartInfo> partitions) {
  41. this.tableName = hcatTableInfo.getTableName();
  42. this.dbName = hcatTableInfo.getDatabaseName();
  43. this.tableSchema = tableSchema;
  44. this.partitions = partitions;
  45. }
  46. /**
  47. * Gets the value of dbName
  48. * @return the dbName
  49. */
  50. public String getDatabaseName() {
  51. return tableName;
  52. }
  53. /**
  54. * Gets the value of tableName
  55. * @return the tableName
  56. */
  57. public String getTableName() {
  58. return tableName;
  59. }
  60. /**
  61. * Gets the value of tableSchema
  62. * @return the tableSchema
  63. */
  64. public HCatSchema getTableSchema() {
  65. return tableSchema;
  66. }
  67. /**
  68. * Gets the value of partitions
  69. * @return the partitions
  70. */
  71. public List<PartInfo> getPartitions() {
  72. return partitions;
  73. }
  74. }