Java Code Examples for org.apache.hadoop.hive.ql.hooks.ExecuteWithHookContext

The following examples show how to use org.apache.hadoop.hive.ql.hooks.ExecuteWithHookContext. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: atlas   Source File: HiveHook.java    License: Apache License 2.0 6 votes vote down vote up
private void initialize() {
    if (LOG.isDebugEnabled()) {
        LOG.debug("==> HiveHook.initialize()");
    }

    try {
        atlasPluginClassLoader = AtlasPluginClassLoader.getInstance(ATLAS_PLUGIN_TYPE, this.getClass());

        @SuppressWarnings("unchecked")
        Class<ExecuteWithHookContext> cls = (Class<ExecuteWithHookContext>) Class
                .forName(ATLAS_HIVE_HOOK_IMPL_CLASSNAME, true, atlasPluginClassLoader);

        activatePluginClassLoader();

        hiveHookImpl = cls.newInstance();
    } catch (Exception excp) {
        LOG.error("Error instantiating Atlas hook implementation", excp);
    } finally {
        deactivatePluginClassLoader();
    }

    if (LOG.isDebugEnabled()) {
        LOG.debug("<== HiveHook.initialize()");
    }
}
 
Example 2
Source Project: incubator-atlas   Source File: HiveHook.java    License: Apache License 2.0 6 votes vote down vote up
private void initialize() {
    if (LOG.isDebugEnabled()) {
        LOG.debug("==> HiveHook.initialize()");
    }

    try {
        atlasPluginClassLoader = AtlasPluginClassLoader.getInstance(ATLAS_PLUGIN_TYPE, this.getClass());

        @SuppressWarnings("unchecked")
        Class<ExecuteWithHookContext> cls = (Class<ExecuteWithHookContext>) Class
                .forName(ATLAS_HIVE_HOOK_IMPL_CLASSNAME, true, atlasPluginClassLoader);

        activatePluginClassLoader();

        hiveHookImpl = cls.newInstance();
    } catch (Exception excp) {
        LOG.error("Error instantiating Atlas hook implementation", excp);
    } finally {
        deactivatePluginClassLoader();
    }

    if (LOG.isDebugEnabled()) {
        LOG.debug("<== HiveHook.initialize()");
    }
}