PageRenderTime 46ms CodeModel.GetById 32ms app.highlight 8ms RepoModel.GetById 2ms app.codeStats 0ms

/tags/release-0.0.0-rc0/hive/external/ql/src/java/org/apache/hadoop/hive/ql/security/authorization/HiveAuthorizationProviderBase.java

#
Java | 61 lines | 32 code | 12 blank | 17 comment | 0 complexity | 54d39838b6bd169b5ade2e44e11dc3a2 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.security.authorization;
20
21import org.apache.hadoop.conf.Configuration;
22import org.apache.hadoop.hive.conf.HiveConf;
23import org.apache.hadoop.hive.ql.metadata.Hive;
24import org.apache.hadoop.hive.ql.metadata.HiveException;
25import org.apache.hadoop.hive.ql.security.HiveAuthenticationProvider;
26
27public abstract class HiveAuthorizationProviderBase implements
28    HiveAuthorizationProvider {
29  
30  protected HiveAuthenticationProvider authenticator;
31
32  protected Hive hive_db;
33  
34  private Configuration conf;
35
36  public void setConf(Configuration conf) {
37    this.conf = conf;
38    try {
39      init(conf);
40    } catch (HiveException e) {
41      throw new RuntimeException(e);
42    }
43  }
44
45  public void init(Configuration conf) throws HiveException {
46    hive_db = Hive.get(new HiveConf(conf, HiveAuthorizationProvider.class));
47  }
48  
49  public Configuration getConf() {
50    return this.conf;
51  }
52
53  public HiveAuthenticationProvider getAuthenticator() {
54    return authenticator;
55  }
56
57  public void setAuthenticator(HiveAuthenticationProvider authenticator) {
58    this.authenticator = authenticator;
59  }
60
61}