• Driver


    aa

    @Override
    public CommandProcessorResponse run(String command)
    throws CommandNeedRetryException {
    return run(command, false);
    }

    然后调用下面方法 

    最核心

        CommandProcessorResponse cpr = runInternal(command, alreadyCompiled);
      public CommandProcessorResponse run(String command, boolean alreadyCompiled)
            throws CommandNeedRetryException {
        CommandProcessorResponse cpr = runInternal(command, alreadyCompiled);
    
        if(cpr.getResponseCode() == 0) {
          return cpr;
        }
        SessionState ss = SessionState.get();
        if(ss == null) {
          return cpr;
        }
        MetaDataFormatter mdf = MetaDataFormatUtils.getFormatter(ss.getConf());
        if(!(mdf instanceof JsonMetaDataFormatter)) {
          return cpr;
        }

    调用

    compileInternal这句到达核心位置
      private CommandProcessorResponse runInternal(String command, boolean alreadyCompiled)
    
        int ret;
          if (!alreadyCompiled) {
            // compile internal will automatically reset the perf logger
            ret = compileInternal(command, true);
            // then we continue to use this perf logger
            perfLogger = SessionState.getPerfLogger();
            if (ret != 0) {
              return createProcessorResponse(ret);

    到达 

    compile
      private int compileInternal(String command, boolean deferClose) {
        int ret;
    
        Metrics metrics = MetricsFactory.getInstance();
        if (metrics != null) {
          metrics.incrementCounter(MetricsConstant.WAITING_COMPILE_OPS, 1);
        }
    
        final ReentrantLock compileLock = tryAcquireCompileLock(isParallelEnabled,
          command);
        if (compileLock == null) {
          return ErrorMsg.COMPILE_LOCK_TIMED_OUT.getErrorCode();
        }
    
        try {
          if (metrics != null) {
            metrics.decrementCounter(MetricsConstant.WAITING_COMPILE_OPS, 1);
          }
          ret = compile(command, true, deferClose);
        } finally {
          compileLock.unlock();
        }
    
        if (ret != 0) {
          try {
            releaseLocksAndCommitOrRollback(false, null);
          } catch (LockException e) {
            LOG.warn("Exception in releasing locks. "
                + org.apache.hadoop.util.StringUtils.stringifyException(e));
          }
        }

    dd\

    ParseDriver创建解析器 解析命令
    并且ASTNode 在parse 做了词法分析 和语法分析。
       perfLogger.PerfLogBegin(CLASS_NAME, PerfLogger.PARSE);
          ParseDriver pd = new ParseDriver();
          ASTNode tree = pd.parse(command, ctx);
          tree = ParseUtils.findRootNonNullToken(tree);
          perfLogger.PerfLogEnd(CLASS_NAME, PerfLogger.PARSE);
  • 相关阅读:
    Android应用程序组件Content Provider简要介绍和学习计划
    本人其它博客
    Android应用程序组件Content Provider的启动过程源代码分析
    Android应用程序组件Content Provider应用实例
    Team Foundation Server 2010 Performance Tuning – Lessons learned
    Katapult:KDE 桌面辅佐序次
    Informix IDS 11系统打点(918考试)认证指南,第2局部系统活动监督(3)
    Amarok 1.4.6
    Informix IDS 11琐细管理(918测验)认证指南,第1部分IDS安设和设置(1)
    KTorrent 2.2 公布
  • 原文地址:https://www.cnblogs.com/itxuexiwang/p/6292585.html
Copyright © 2020-2023  润新知