Search in sources :

Example 16 with PerfLogger

use of org.apache.hadoop.hive.ql.log.PerfLogger in project hive by apache.

the class HookRunner method invokeGeneralHook.

private static void invokeGeneralHook(List<ExecuteWithHookContext> hooks, String prefix, HookContext hookContext) throws HiveException {
    if (hooks.isEmpty()) {
        return;
    }
    try {
        PerfLogger perfLogger = SessionState.getPerfLogger();
        for (ExecuteWithHookContext hook : hooks) {
            perfLogger.PerfLogBegin(CLASS_NAME, prefix + hook.getClass().getName());
            hook.run(hookContext);
            perfLogger.PerfLogEnd(CLASS_NAME, prefix + hook.getClass().getName());
        }
    } catch (HiveException e) {
        throw e;
    } catch (Exception e) {
        throw new HiveException("Error while invoking " + prefix + " hooks: " + HiveStringUtils.stringifyException(e), e);
    }
}
Also used : HiveException(org.apache.hadoop.hive.ql.metadata.HiveException) ExecuteWithHookContext(org.apache.hadoop.hive.ql.hooks.ExecuteWithHookContext) PerfLogger(org.apache.hadoop.hive.ql.log.PerfLogger) HiveException(org.apache.hadoop.hive.ql.metadata.HiveException)

Example 17 with PerfLogger

use of org.apache.hadoop.hive.ql.log.PerfLogger in project hive by apache.

the class Transform method endPerfLogging.

public void endPerfLogging() {
    PerfLogger perfLogger = SessionState.getPerfLogger();
    perfLogger.PerfLogEnd(this.getClass().getName(), PerfLogger.OPTIMIZER);
}
Also used : PerfLogger(org.apache.hadoop.hive.ql.log.PerfLogger)

Example 18 with PerfLogger

use of org.apache.hadoop.hive.ql.log.PerfLogger in project hive by apache.

the class Transform method endPerfLogging.

public void endPerfLogging(String additionalInfo) {
    PerfLogger perfLogger = SessionState.getPerfLogger();
    perfLogger.PerfLogEnd(this.getClass().getName(), PerfLogger.OPTIMIZER, additionalInfo);
}
Also used : PerfLogger(org.apache.hadoop.hive.ql.log.PerfLogger)

Example 19 with PerfLogger

use of org.apache.hadoop.hive.ql.log.PerfLogger in project hive by apache.

the class SerializationUtilities method serializePlan.

private static void serializePlan(Kryo kryo, Object plan, OutputStream out, boolean cloningPlan) {
    PerfLogger perfLogger = SessionState.getPerfLogger();
    perfLogger.PerfLogBegin(CLASS_NAME, PerfLogger.SERIALIZE_PLAN);
    LOG.info("Serializing " + plan.getClass().getSimpleName() + " using kryo");
    if (cloningPlan) {
        serializeObjectByKryo(kryo, plan, out);
    } else {
        serializeObjectByKryo(kryo, plan, out);
    }
    perfLogger.PerfLogEnd(CLASS_NAME, PerfLogger.SERIALIZE_PLAN);
}
Also used : PerfLogger(org.apache.hadoop.hive.ql.log.PerfLogger)

Example 20 with PerfLogger

use of org.apache.hadoop.hive.ql.log.PerfLogger in project hive by apache.

the class SerializationUtilities method deserializePlan.

private static <T> T deserializePlan(Kryo kryo, InputStream in, Class<T> planClass, boolean cloningPlan) {
    PerfLogger perfLogger = SessionState.getPerfLogger();
    perfLogger.PerfLogBegin(CLASS_NAME, PerfLogger.DESERIALIZE_PLAN);
    T plan;
    LOG.info("Deserializing " + planClass.getSimpleName() + " using kryo");
    if (cloningPlan) {
        plan = deserializeObjectByKryo(kryo, in, planClass);
    } else {
        plan = deserializeObjectByKryo(kryo, in, planClass);
    }
    perfLogger.PerfLogEnd(CLASS_NAME, PerfLogger.DESERIALIZE_PLAN);
    return plan;
}
Also used : PerfLogger(org.apache.hadoop.hive.ql.log.PerfLogger)

Aggregations

PerfLogger (org.apache.hadoop.hive.ql.log.PerfLogger)30 IOException (java.io.IOException)9 ArrayList (java.util.ArrayList)9 HiveException (org.apache.hadoop.hive.ql.metadata.HiveException)8 LockException (org.apache.hadoop.hive.ql.lockmgr.LockException)7 Path (org.apache.hadoop.fs.Path)6 AuthorizationException (org.apache.hadoop.hive.ql.metadata.AuthorizationException)6 LinkedHashMap (java.util.LinkedHashMap)4 CommandProcessorResponse (org.apache.hadoop.hive.ql.processors.CommandProcessorResponse)4 ImmutableMap (com.google.common.collect.ImmutableMap)3 HashMap (java.util.HashMap)3 LinkedList (java.util.LinkedList)3 List (java.util.List)3 Map (java.util.Map)3 FileSystem (org.apache.hadoop.fs.FileSystem)3 Metrics (org.apache.hadoop.hive.common.metrics.common.Metrics)3 HookContext (org.apache.hadoop.hive.ql.hooks.HookContext)3 HiveTxnManager (org.apache.hadoop.hive.ql.lockmgr.HiveTxnManager)3 ParseException (org.apache.hadoop.hive.ql.parse.ParseException)3 ByteArrayInputStream (java.io.ByteArrayInputStream)2