PageRenderTime 43ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/tags/release-0.0.0-rc0/src/java/org/apache/hcatalog/mapreduce/PartInfo.java

#
Java | 110 lines | 37 code | 18 blank | 55 comment | 0 complexity | 0f440eb3831e0289a7b6a0768e23ddeb 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.Map;
  21. import java.util.Properties;
  22. import org.apache.hcatalog.data.schema.HCatSchema;
  23. /** The Class used to serialize the partition information read from the metadata server that maps to a partition */
  24. public class PartInfo implements Serializable {
  25. /** The serialization version */
  26. private static final long serialVersionUID = 1L;
  27. /** The partition schema. */
  28. private final HCatSchema partitionSchema;
  29. /** The information about which input storage driver to use */
  30. private final String inputStorageDriverClass;
  31. /** Howl-specific properties set at the partition */
  32. private final Properties howlProperties;
  33. /** The data location. */
  34. private final String location;
  35. /** The map of partition key names and their values. */
  36. private Map<String,String> partitionValues;
  37. /**
  38. * Instantiates a new howl partition info.
  39. * @param partitionSchema the partition schema
  40. * @param inputStorageDriverClass the input storage driver class name
  41. * @param location the location
  42. * @param howlProperties howl-specific properties at the partition
  43. */
  44. public PartInfo(HCatSchema partitionSchema, String inputStorageDriverClass, String location, Properties howlProperties){
  45. this.partitionSchema = partitionSchema;
  46. this.inputStorageDriverClass = inputStorageDriverClass;
  47. this.location = location;
  48. this.howlProperties = howlProperties;
  49. }
  50. /**
  51. * Gets the value of partitionSchema.
  52. * @return the partitionSchema
  53. */
  54. public HCatSchema getPartitionSchema() {
  55. return partitionSchema;
  56. }
  57. /**
  58. * Gets the value of input storage driver class name.
  59. * @return the input storage driver class name
  60. */
  61. public String getInputStorageDriverClass() {
  62. return inputStorageDriverClass;
  63. }
  64. /**
  65. * Gets the value of howlProperties.
  66. * @return the howlProperties
  67. */
  68. public Properties getInputStorageDriverProperties() {
  69. return howlProperties;
  70. }
  71. /**
  72. * Gets the value of location.
  73. * @return the location
  74. */
  75. public String getLocation() {
  76. return location;
  77. }
  78. /**
  79. * Sets the partition values.
  80. * @param partitionValues the new partition values
  81. */
  82. public void setPartitionValues(Map<String,String> partitionValues) {
  83. this.partitionValues = partitionValues;
  84. }
  85. /**
  86. * Gets the partition values.
  87. * @return the partition values
  88. */
  89. public Map<String,String> getPartitionValues() {
  90. return partitionValues;
  91. }
  92. }