PageRenderTime 16ms CodeModel.GetById 12ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/tags/release-0.1-rc2/hive/external/ql/src/java/org/apache/hadoop/hive/ql/metadata/HiveStorageHandler.java

#
Java | 82 lines | 17 code | 8 blank | 57 comment | 0 complexity | ed00c12de5d68c414b01352244d5c487 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.ql.metadata;
20
21import java.util.Map;
22
23import org.apache.hadoop.conf.Configurable;
24import org.apache.hadoop.hive.metastore.HiveMetaHook;
25import org.apache.hadoop.hive.ql.plan.TableDesc;
26import org.apache.hadoop.hive.serde2.SerDe;
27import org.apache.hadoop.mapred.InputFormat;
28import org.apache.hadoop.mapred.OutputFormat;
29
30/**
31 * HiveStorageHandler defines a pluggable interface for adding
32 * new storage handlers to Hive.  A storage handler consists of
33 * a bundle of the following:
34 *
35 *<ul>
36 *<li>input format
37 *<li>output format
38 *<li>serde
39 *<li>metadata hooks for keeping an external catalog in sync
40 * with Hive's metastore
41 *<li>rules for setting up the configuration properties on
42 * map/reduce jobs which access tables stored by this handler
43 *</ul>
44 *
45 * Storage handler classes are plugged in using the STORED BY 'classname'
46 * clause in CREATE TABLE.
47 */
48public interface HiveStorageHandler extends Configurable {
49  /**
50   * @return Class providing an implementation of {@link InputFormat}
51   */
52  public Class<? extends InputFormat> getInputFormatClass();
53
54  /**
55   * @return Class providing an implementation of {@link OutputFormat}
56   */
57  public Class<? extends OutputFormat> getOutputFormatClass();
58
59  /**
60   * @return Class providing an implementation of {@link SerDe}
61   */
62  public Class<? extends SerDe> getSerDeClass();
63
64  /**
65   * @return metadata hook implementation, or null if this
66   * storage handler does not need any metadata notifications
67   */
68  public HiveMetaHook getMetaHook();
69
70  /**
71   * Configures properties for a job based on the definition of the
72   * source or target table it accesses.
73   *
74   * @param tableDesc descriptor for the table being accessed
75   *
76   * @param jobProperties receives properties copied or transformed
77   * from the table properties
78   */
79  public void configureTableJobProperties(
80    TableDesc tableDesc,
81    Map<String, String> jobProperties);
82}