启动
@param join 是否同步阻断
@throws ServerException
5481
public void start(boolean join) throws ServerException {
		server = new Server(JettySetting.createQueuedThreadPool());
		
		// JVM退出时关闭Jetty
		server.setStopAtShutdown(true);
		
		//初始化Connector
		ServerConnector serverConnector = JettySetting.createServerConnectorAndAddToServer(server);

		//初始化Handler
		HandlerList handlers = new HandlerList();
		handlers.setHandlers(new Handler[] {
				JettySetting.createResourceHandler(),	//静态资源处理
				JettySetting.createWebAppContext(), 	//Servlet处理
				new DefaultHandler() 							//	默认处理
		});
		server.setHandler(handlers);
		
		try {
			server.start();
			log.info("Jetty Server for Hulu Listen on {}: {}", serverConnector.getHost(), serverConnector.getPort());
			if(join){
				server.join();
			}
		} catch (Exception e) {
			throw new ServerException(e);
		}
	}
237821
@Override
	protected void initServer(TServerTransport serverTransport) {
		ThriftServerConfiguration configuration = getServerConfiguration();
		// 使用多线程半同步半异步方式
		TThreadedSelectorServer.Args args = new TThreadedSelectorServer.Args((TNonblockingServerSocket) serverTransport)
				.transportFactory(configuration.getTransportFactory())
				.protocolFactory(configuration.getProtocolFactory());
		if (configuration.getExecutorService() != null)
			args.executorService(configuration.getExecutorService());
		server = new TThreadedSelectorServer(
				configuration.getServerArgsAspect().tThreadedSelectorServerArgsAspect(args).processor(getProcessor()));
		if (configuration.getServerEventHandler() != null)
			server.setServerEventHandler(configuration.getServerEventHandler());
	}
1372361
public void commit() throws SQLException {
		try {
			getConnection().commit();
		} catch (SQLException e) {
			throw e;
		} finally {
			try {
				getConnection().setAutoCommit(true); // 事务结束，恢复自动提交
			} catch (SQLException e) {
				log.error(e);
			}
		}
	}
1158722
private boolean validateJoinRequest(JoinRequest joinRequest, Address target) {
        if (clusterService.isMaster()) {
            try {
                node.getNodeExtension().validateJoinRequest(joinRequest);
            } catch (Exception e) {
                logger.warning(e.getMessage());
                nodeEngine.getOperationService().send(new BeforeJoinCheckFailureOp(e.getMessage()), target);
                return false;
            }
        }
        return true;
    }
490194
private void setJoin(List<T> models) {
        if (null == models || models.isEmpty() ||
                joinParams.size() == 0) {
            return;
        }
        models.stream().filter(Objects::nonNull).forEach(this::setJoin);
    }
566991
public static JoinPoint<Exception> fromSynchronizationPoints(Collection<? extends ISynchronizationPoint<?>> synchPoints) {
		JoinPoint<Exception> jp = new JoinPoint<>();
		for (ISynchronizationPoint<?> sp : synchPoints)
			jp.addToJoin(sp);
		jp.start();
		return jp;
	}
589328
public JettyBootstrap joinServer() throws JettyBootstrapException {
        try {
            if (isServerStarted()) {
                LOG.debug("Joining Server...");

                server.join();
            } else {
                LOG.warn("Can't join Server. Not started");
            }
        } catch (InterruptedException e) {
            throw new JettyBootstrapException(e);
        }

        return this;
    }
893792
function(executionStep) {
    // In order to use and index for implementing a join, the entire relation
    // must be fed to the JoinStep, otherwise the index can't be used.
    if (!(executionStep instanceof lf.proc.TableAccessFullStep)) {
      return null;
    }
    var candidateColumn = getColumnForTable(executionStep.table);
    return goog.isNull(candidateColumn.getIndex()) ? null : candidateColumn;
  }
1053131
private void matchJoinedFields(JoinInfo joinInfo, QueryBuilder<?, ?> joinedQueryBuilder) throws SQLException {
		for (FieldType fieldType : tableInfo.getFieldTypes()) {
			// if this is a foreign field and its foreign field is the same as the other's id
			FieldType foreignRefField = fieldType.getForeignRefField();
			if (fieldType.isForeign() && foreignRefField.equals(joinedQueryBuilder.tableInfo.getIdField())) {
				joinInfo.localField = fieldType;
				joinInfo.remoteField = foreignRefField;
				return;
			}
		}
		// if this other field is a foreign field and its foreign-id field is our id
		for (FieldType fieldType : joinedQueryBuilder.tableInfo.getFieldTypes()) {
			if (fieldType.isForeign() && fieldType.getForeignIdField().equals(idField)) {
				joinInfo.localField = idField;
				joinInfo.remoteField = fieldType;
				return;
			}
		}

		throw new SQLException("Could not find a foreign " + tableInfo.getDataClass() + " field in "
				+ joinedQueryBuilder.tableInfo.getDataClass() + " or vice versa");
	}
1095299
private static String joinAndGetValueForInsert(List<Field> fields, String sep, String fieldPrefix,
			List<Object> values, Object obj, boolean isWithNullValue) {
		if(values == null || obj == null) {
			throw new InvalidParameterException("joinAndGetValueForInsert require values and obj");
		}
		
        fieldPrefix = fieldPrefix == null ? "" : fieldPrefix.trim();

    	StringBuilder sb = new StringBuilder();
    	for(Field field : fields) {
    		Column column = field.getAnnotation(Column.class);
    		if(!(column.computed().trim().isEmpty())) {
    			continue; // insert不加入computed字段
    		}

			Object value = DOInfoReader.getValue(field, obj);
			if(value != null && column.isJSON()) {
				value = JSON.toJson(value);
			}
			if(isWithNullValue) {
				values.add(value);
			} else {
				if(value == null) {
					continue; // 不加入该column
				} else {
					values.add(value);
				}
			}
    		
        	sb.append(fieldPrefix).append(getColumnName(column)).append(sep);
    	}
    	int len = sb.length();
    	return len == 0 ? "" : sb.toString().substring(0, len - 1);
	}
1066201
public M joins(Object... join) {
		this.delegate = Optional.of(join(join));
		return THIS();
	}
721683
@Override
    public Node visitJoinRelation(SqlBaseParser.JoinRelationContext context)
    {
        Relation left = (Relation) visit(context.left);
        Relation right;

        if (context.CROSS() != null) {
            right = (Relation) visit(context.right);
            return new Join(getLocation(context), Join.Type.CROSS, left, right, Optional.empty());
        }

        JoinCriteria criteria;
        if (context.NATURAL() != null) {
            right = (Relation) visit(context.right);
            criteria = new NaturalJoin();
        }
        else {
            right = (Relation) visit(context.rightRelation);
            if (context.joinCriteria().ON() != null) {
                criteria = new JoinOn((Expression) visit(context.joinCriteria().booleanExpression()));
            }
            else if (context.joinCriteria().USING() != null) {
                criteria = new JoinUsing(visit(context.joinCriteria().identifier(), Identifier.class));
            }
            else {
                throw new IllegalArgumentException("Unsupported join criteria");
            }
        }

        Join.Type joinType;
        if (context.joinType().LEFT() != null) {
            joinType = Join.Type.LEFT;
        }
        else if (context.joinType().RIGHT() != null) {
            joinType = Join.Type.RIGHT;
        }
        else if (context.joinType().FULL() != null) {
            joinType = Join.Type.FULL;
        }
        else {
            joinType = Join.Type.INNER;
        }

        return new Join(getLocation(context), joinType, left, right, Optional.of(criteria));
    }
17314
public static void post(final Event event) {
        if (!isEnable()) {
            return;
        }
        CopyOnWriteArraySet<Subscriber> subscribers = SUBSCRIBER_MAP.get(event.getClass());
        if (CommonUtils.isNotEmpty(subscribers)) {
            for (final Subscriber subscriber : subscribers) {
                if (subscriber.isSync()) {
                    handleEvent(subscriber, event);
                } else { // 异步
                    final RpcInternalContext context = RpcInternalContext.peekContext();
                    final ThreadPoolExecutor asyncThreadPool = AsyncRuntime.getAsyncThreadPool();
                    try {
                        asyncThreadPool.execute(
                            new Runnable() {
                                @Override
                                public void run() {
                                    try {
                                        RpcInternalContext.setContext(context);
                                        handleEvent(subscriber, event);
                                    } catch (Exception e) {
                                        RpcInternalContext.removeContext();
                                    }
                                }
                            });
                    } catch (RejectedExecutionException e) {
                        LOGGER
                            .warn("This queue is full when post event to async execute, queue size is " +
                                asyncThreadPool.getQueue().size() +
                                ", please optimize this async thread pool of eventbus.");
                    }
                }
            }
        }
    }
940723
public final void mRIGHT_JOIN() throws RecognitionException {
		try {
			int _type = RIGHT_JOIN;
			int _channel = DEFAULT_TOKEN_CHANNEL;
			// druidG.g:655:13: ( ( 'RIGHT_JOIN' | 'right_join' ) )
			// druidG.g:655:15: ( 'RIGHT_JOIN' | 'right_join' )
			{
			// druidG.g:655:15: ( 'RIGHT_JOIN' | 'right_join' )
			int alt36=2;
			int LA36_0 = input.LA(1);
			if ( (LA36_0=='R') ) {
				alt36=1;
			}
			else if ( (LA36_0=='r') ) {
				alt36=2;
			}

			else {
				NoViableAltException nvae =
					new NoViableAltException("", 36, 0, input);
				throw nvae;
			}

			switch (alt36) {
				case 1 :
					// druidG.g:655:16: 'RIGHT_JOIN'
					{
					match("RIGHT_JOIN"); 

					}
					break;
				case 2 :
					// druidG.g:655:31: 'right_join'
					{
					match("right_join"); 

					}
					break;

			}

			}

			state.type = _type;
			state.channel = _channel;
		}
		finally {
			// do for sure before leaving
		}
	}
1182127
public static void throwException(SQLException exception, MariaDbConnection connection,
      MariaDbStatement statement) throws SQLException {
    throw getException(exception, connection, statement, false);
  }
1349472
@Override
    public void reportException(JMSException e) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "reportException", e);
        if (elRef.get() != null) {
            asyncExceptionTask.handleException(e);
        }
        else {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                SibTr.debug(this, tc, "No exception listener is currently set for this connection.");
        }
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "reportException");
    }
1219993
public void join() {
    try {
      if (this.dnProtocolServer != null) {
        this.dnProtocolServer.join();
      }
      if (this.server != null) {
        this.server.join();
      }
    } catch (InterruptedException ie) {
    }
  }