org.springframework.data.hadoop.hive
Interface HiveClientCallback<T>
public interface HiveClientCallback<T>
Callback interface for Hive code. To be used with HiveTemplate
execute method, assumably often as anonymous classes within a method implementation.
- Author:
- Costin Leau
doInHive
T doInHive(org.apache.hadoop.hive.service.HiveClient hiveClient)
throws java.lang.Exception
- Gets called by
HiveTemplate.execute(HiveClientCallback)
with an active HiveClient
. Does not need to care about activating or closing the HiveClient
, or handling exceptions.
Due to the big number of exceptions thrown by HiveClient
(in particular ThriftHiveMetastore.Client
) which do not share any common base class, the callback signature uses a generic declaration.
For user specific error, consider runtime exceptions which are not translated.
- Parameters:
hiveClient
- active hive client
- Returns:
- action result
- Throws:
java.lang.Exception
- if thrown by HiveClient