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