Back to home page

OSCL-LXR

 
 

    


0001 /**
0002  * Licensed to the Apache Software Foundation (ASF) under one
0003  * or more contributor license agreements.  See the NOTICE file
0004  * distributed with this work for additional information
0005  * regarding copyright ownership.  The ASF licenses this file
0006  * to you under the Apache License, Version 2.0 (the
0007  * "License"); you may not use this file except in compliance
0008  * with the License.  You may obtain a copy of the License at
0009  *
0010  *     http://www.apache.org/licenses/LICENSE-2.0
0011  *
0012  * Unless required by applicable law or agreed to in writing, software
0013  * distributed under the License is distributed on an "AS IS" BASIS,
0014  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
0015  * See the License for the specific language governing permissions and
0016  * limitations under the License.
0017  */
0018 
0019 package org.apache.hive.service.cli.session;
0020 
0021 import java.util.List;
0022 import java.util.Map;
0023 
0024 import org.apache.hadoop.hive.metastore.IMetaStoreClient;
0025 import org.apache.hive.service.auth.HiveAuthFactory;
0026 import org.apache.hive.service.cli.*;
0027 
0028 public interface HiveSession extends HiveSessionBase {
0029 
0030   void open(Map<String, String> sessionConfMap) throws Exception;
0031 
0032   IMetaStoreClient getMetaStoreClient() throws HiveSQLException;
0033 
0034   /**
0035    * getInfo operation handler
0036    * @param getInfoType
0037    * @return
0038    * @throws HiveSQLException
0039    */
0040   GetInfoValue getInfo(GetInfoType getInfoType) throws HiveSQLException;
0041 
0042   /**
0043    * execute operation handler
0044    * @param statement
0045    * @param confOverlay
0046    * @return
0047    * @throws HiveSQLException
0048    */
0049   OperationHandle executeStatement(String statement,
0050       Map<String, String> confOverlay) throws HiveSQLException;
0051 
0052   /**
0053    * execute operation handler
0054    * @param statement
0055    * @param confOverlay
0056    * @return
0057    * @throws HiveSQLException
0058    */
0059   OperationHandle executeStatementAsync(String statement,
0060       Map<String, String> confOverlay) throws HiveSQLException;
0061 
0062   /**
0063    * getTypeInfo operation handler
0064    * @return
0065    * @throws HiveSQLException
0066    */
0067   OperationHandle getTypeInfo() throws HiveSQLException;
0068 
0069   /**
0070    * getCatalogs operation handler
0071    * @return
0072    * @throws HiveSQLException
0073    */
0074   OperationHandle getCatalogs() throws HiveSQLException;
0075 
0076   /**
0077    * getSchemas operation handler
0078    * @param catalogName
0079    * @param schemaName
0080    * @return
0081    * @throws HiveSQLException
0082    */
0083   OperationHandle getSchemas(String catalogName, String schemaName)
0084       throws HiveSQLException;
0085 
0086   /**
0087    * getTables operation handler
0088    * @param catalogName
0089    * @param schemaName
0090    * @param tableName
0091    * @param tableTypes
0092    * @return
0093    * @throws HiveSQLException
0094    */
0095   OperationHandle getTables(String catalogName, String schemaName,
0096       String tableName, List<String> tableTypes) throws HiveSQLException;
0097 
0098   /**
0099    * getTableTypes operation handler
0100    * @return
0101    * @throws HiveSQLException
0102    */
0103   OperationHandle getTableTypes() throws HiveSQLException ;
0104 
0105   /**
0106    * getColumns operation handler
0107    * @param catalogName
0108    * @param schemaName
0109    * @param tableName
0110    * @param columnName
0111    * @return
0112    * @throws HiveSQLException
0113    */
0114   OperationHandle getColumns(String catalogName, String schemaName,
0115       String tableName, String columnName)  throws HiveSQLException;
0116 
0117   /**
0118    * getFunctions operation handler
0119    * @param catalogName
0120    * @param schemaName
0121    * @param functionName
0122    * @return
0123    * @throws HiveSQLException
0124    */
0125   OperationHandle getFunctions(String catalogName, String schemaName,
0126       String functionName) throws HiveSQLException;
0127 
0128   /**
0129    * close the session
0130    * @throws HiveSQLException
0131    */
0132   void close() throws HiveSQLException;
0133 
0134   void cancelOperation(OperationHandle opHandle) throws HiveSQLException;
0135 
0136   void closeOperation(OperationHandle opHandle) throws HiveSQLException;
0137 
0138   TableSchema getResultSetMetadata(OperationHandle opHandle)
0139       throws HiveSQLException;
0140 
0141   RowSet fetchResults(OperationHandle opHandle, FetchOrientation orientation,
0142       long maxRows, FetchType fetchType) throws HiveSQLException;
0143 
0144   String getDelegationToken(HiveAuthFactory authFactory, String owner,
0145       String renewer) throws HiveSQLException;
0146 
0147   void cancelDelegationToken(HiveAuthFactory authFactory, String tokenStr)
0148       throws HiveSQLException;
0149 
0150   void renewDelegationToken(HiveAuthFactory authFactory, String tokenStr)
0151       throws HiveSQLException;
0152 
0153   void closeExpiredOperations();
0154 
0155   long getNoOperationTime();
0156 }