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