Commit 73cae7f0 authored by lenboo's avatar lenboo
Browse files

merge from dev-1.3.0

parents 714ae33e 620ecffa
Loading
Loading
Loading
Loading
+70 −0
Original line number Diff line number Diff line
@@ -3,3 +3,73 @@ Copyright 2019-2020 The Apache Software Foundation

This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).

mybatis-3
iBATIS
   This product includes software developed by
   The Apache Software Foundation (http://www.apache.org/).

   Copyright 2010 The Apache Software Foundation

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.

OGNL
//--------------------------------------------------------------------------
//  Copyright (c) 2004, Drew Davidson and Luke Blanshard
//  All rights reserved.
//
//  Redistribution and use in source and binary forms, with or without
//  modification, are permitted provided that the following conditions are
//  met:
//
//  Redistributions of source code must retain the above copyright notice,
//  this list of conditions and the following disclaimer.
//  Redistributions in binary form must reproduce the above copyright
//  notice, this list of conditions and the following disclaimer in the
//  documentation and/or other materials provided with the distribution.
//  Neither the name of the Drew Davidson nor the names of its contributors
//  may be used to endorse or promote products derived from this software
//  without specific prior written permission.
//
//  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
//  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
//  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
//  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
//  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
//  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
//  OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
//  AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
//  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
//  THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
//  DAMAGE.
//--------------------------------------------------------------------------

Refactored SqlBuilder class (SQL, AbstractSQL)

   This product includes software developed by
   Adam Gent (https://gist.github.com/3650165)

   Copyright 2010 Adam Gent

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
 No newline at end of file
+1 −1
Original line number Diff line number Diff line
@@ -1019,7 +1019,7 @@ public class ResourcesService extends BaseService {

        String tenantCode = tenant.getTenantCode();

        String hdfsFileName = HadoopUtils.getHdfsFileName(resource.getType(), tenantCode, resource.getAlias());
        String hdfsFileName = HadoopUtils.getHdfsFileName(resource.getType(), tenantCode, resource.getFullName());

        String localFileName = FileUtils.getDownloadFilename(resource.getAlias());
        logger.info("resource hdfs path is {} ", hdfsFileName);
+10 −10
Original line number Diff line number Diff line
@@ -185,7 +185,7 @@ public class HadoopUtils implements Closeable {
     * @param applicationId application id
     * @return url of application
     */
    public String getApplicationUrl(String applicationId) {
    public String getApplicationUrl(String applicationId) throws Exception {
        /**
         * if rmHaIds contains xx, it signs not use resourcemanager
         * otherwise:
@@ -193,21 +193,21 @@ public class HadoopUtils implements Closeable {
         *  if rmHaIds not empty: resourcemanager HA enabled
         */
        String appUrl = "";
        //not use resourcemanager
        if (rmHaIds.contains(Constants.YARN_RESOURCEMANAGER_HA_XX)) {

            yarnEnabled = false;
            logger.warn("should not step here");
        } else if (!StringUtils.isEmpty(rmHaIds)) {
        if (StringUtils.isEmpty(rmHaIds)){
            //single resourcemanager enabled
            appUrl = appAddress;
            yarnEnabled = true;
        } else {
            //resourcemanager HA enabled
            appUrl = getAppAddress(appAddress, rmHaIds);
            yarnEnabled = true;
            logger.info("application url : {}", appUrl);
        } else {
            //single resourcemanager enabled
            yarnEnabled = true;
        }

        if(StringUtils.isBlank(appUrl)){
            throw new Exception("application url is blank");
        }
        return String.format(appUrl, applicationId);
    }

@@ -407,7 +407,7 @@ public class HadoopUtils implements Closeable {
     * @param applicationId application id
     * @return the return may be null or there may be other parse exceptions
     */
    public ExecutionStatus getApplicationStatus(String applicationId) {
    public ExecutionStatus getApplicationStatus(String applicationId) throws Exception{
        if (StringUtils.isEmpty(applicationId)) {
            return null;
        }
+1 −1
Original line number Diff line number Diff line
@@ -54,7 +54,7 @@ fs.s3a.access.key=A3DXS30FO22544RE
# if resource.storage.type=S3,s3 secret key
fs.s3a.secret.key=OloCLq3n+8+sdPHUhJ21XrSxTC+JK

# if not use hadoop resourcemanager, please keep default value; if resourcemanager HA enable, please type the HA ips ; if resourcemanager is single, make this value empty
# if resourcemanager HA enable, please type the HA ips ; if resourcemanager is single, make this value empty
yarn.resourcemanager.ha.rm.ids=192.168.xx.xx,192.168.xx.xx

# if resourcemanager HA enable or not use resourcemanager, please keep the default value; If resourcemanager is single, you only need to replace ds1 to actual resourcemanager hostname.
+2 −2
Original line number Diff line number Diff line
@@ -142,7 +142,7 @@ public class HadoopUtilsTest {
    @Test
    public void isYarnEnabled() {
        boolean result = hadoopUtils.isYarnEnabled();
        Assert.assertEquals(false, result);
        Assert.assertEquals(true, result);
    }

    @Test
@@ -185,7 +185,7 @@ public class HadoopUtilsTest {
    }

    @Test
    public void getApplicationUrl(){
    public void getApplicationUrl() throws Exception {
        String application_1516778421218_0042 = hadoopUtils.getApplicationUrl("application_1529051418016_0167");
        logger.info(application_1516778421218_0042);
    }
Loading