Return-Path: X-Original-To: apmail-hive-commits-archive@www.apache.org Delivered-To: apmail-hive-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3C62E1057B for ; Fri, 12 Dec 2014 20:01:06 +0000 (UTC) Received: (qmail 77614 invoked by uid 500); 12 Dec 2014 20:01:05 -0000 Delivered-To: apmail-hive-commits-archive@hive.apache.org Received: (qmail 77566 invoked by uid 500); 12 Dec 2014 20:01:05 -0000 Mailing-List: contact commits-help@hive.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hive-dev@hive.apache.org Delivered-To: mailing list commits@hive.apache.org Received: (qmail 77554 invoked by uid 99); 12 Dec 2014 20:01:05 -0000 Received: from eris.apache.org (HELO hades.apache.org) (140.211.11.105) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Dec 2014 20:01:05 +0000 Received: from hades.apache.org (localhost [127.0.0.1]) by hades.apache.org (ASF Mail Server at hades.apache.org) with ESMTP id 35485AC094A; Fri, 12 Dec 2014 20:01:04 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1645054 - in /hive/trunk/testutils/ptest2/src: main/java/org/apache/hive/ptest/execution/context/ test/java/org/apache/hive/ptest/execution/ Date: Fri, 12 Dec 2014 20:01:04 -0000 To: commits@hive.apache.org From: brock@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20141212200105.35485AC094A@hades.apache.org> Author: brock Date: Fri Dec 12 20:01:04 2014 New Revision: 1645054 URL: http://svn.apache.org/r1645054 Log: HIVE-6623 - Add "owner" tag to ptest2 created instances (Brock reviewed by Szehon) Modified: hive/trunk/testutils/ptest2/src/main/java/org/apache/hive/ptest/execution/context/CloudComputeService.java hive/trunk/testutils/ptest2/src/main/java/org/apache/hive/ptest/execution/context/CloudExecutionContextProvider.java hive/trunk/testutils/ptest2/src/test/java/org/apache/hive/ptest/execution/TestScripts.testAlternativeTestJVM.approved.txt hive/trunk/testutils/ptest2/src/test/java/org/apache/hive/ptest/execution/TestScripts.testBatch.approved.txt Modified: hive/trunk/testutils/ptest2/src/main/java/org/apache/hive/ptest/execution/context/CloudComputeService.java URL: http://svn.apache.org/viewvc/hive/trunk/testutils/ptest2/src/main/java/org/apache/hive/ptest/execution/context/CloudComputeService.java?rev=1645054&r1=1645053&r2=1645054&view=diff ============================================================================== --- hive/trunk/testutils/ptest2/src/main/java/org/apache/hive/ptest/execution/context/CloudComputeService.java (original) +++ hive/trunk/testutils/ptest2/src/main/java/org/apache/hive/ptest/execution/context/CloudComputeService.java Fri Dec 12 20:01:04 2014 @@ -20,6 +20,7 @@ package org.apache.hive.ptest.execution. import java.util.Collections; import java.util.Properties; +import java.util.Map; import java.util.Set; import org.jclouds.Constants; @@ -53,12 +54,13 @@ public class CloudComputeService { private final String mImageId; private final String mkeyPair; private final String mSecurityGroup; + private final Map mUserMetadata; /** * JClouds requests on-demand instances when null */ private final Float mMaxBid; public CloudComputeService(String apiKey, String accessKey, String instanceType, String groupName, - String imageId, String keyPair, String securityGroup, Float maxBid) { + String imageId, String keyPair, String securityGroup, Float maxBid, Map userMetadata) { mInstanceType = instanceType; mGroupName = groupName; mImageId = imageId; @@ -66,6 +68,7 @@ public class CloudComputeService { mSecurityGroup = securityGroup; mMaxBid = maxBid; mGroupTag = "group=" + mGroupName; + mUserMetadata = userMetadata; Properties overrides = new Properties(); overrides.put(ComputeServiceProperties.POLL_INITIAL_PERIOD, String.valueOf(60L * 1000L)); overrides.put(ComputeServiceProperties.POLL_MAX_PERIOD, String.valueOf(600L * 1000L)); @@ -84,7 +87,8 @@ public class CloudComputeService { .hardwareId(mInstanceType).imageId(mImageId).build(); template.getOptions().as(AWSEC2TemplateOptions.class).keyPair(mkeyPair) .securityGroupIds(mSecurityGroup).blockOnPort(22, 60) - .spotPrice(mMaxBid).tags(Collections.singletonList(mGroupTag)); + .spotPrice(mMaxBid).tags(Collections.singletonList(mGroupTag)) + .userMetadata(mUserMetadata); result.addAll(mComputeService.createNodesInGroup(mGroupName, count, template)); return result; } Modified: hive/trunk/testutils/ptest2/src/main/java/org/apache/hive/ptest/execution/context/CloudExecutionContextProvider.java URL: http://svn.apache.org/viewvc/hive/trunk/testutils/ptest2/src/main/java/org/apache/hive/ptest/execution/context/CloudExecutionContextProvider.java?rev=1645054&r1=1645053&r2=1645054&view=diff ============================================================================== --- hive/trunk/testutils/ptest2/src/main/java/org/apache/hive/ptest/execution/context/CloudExecutionContextProvider.java (original) +++ hive/trunk/testutils/ptest2/src/main/java/org/apache/hive/ptest/execution/context/CloudExecutionContextProvider.java Fri Dec 12 20:01:04 2014 @@ -69,6 +69,7 @@ public class CloudExecutionContextProvid public static final String USERNAME = "user"; public static final String INSTANCE_TYPE = "instanceType"; public static final String NUM_THREADS = "numThreads"; + public static final String USER_METADATA = "userMetadata"; private final RandomAccessFile mHostLog; private final String mPrivateKey; @@ -449,7 +450,7 @@ public class CloudExecutionContextProvid Integer numThreads = context.getInteger(NUM_THREADS, 3); String instanceType = context.getString(INSTANCE_TYPE, "c1.xlarge"); CloudComputeService cloudComputeService = new CloudComputeService(apiKey, accessKey, - instanceType, groupName, imageId, keyPair, securityGroup, maxBid); + instanceType, groupName, imageId, keyPair, securityGroup, maxBid, context.getSubProperties(USER_METADATA + ".")); CloudExecutionContextProvider service = new CloudExecutionContextProvider( dataDir, numHosts, cloudComputeService, new SSHCommandExecutor(LOG), workingDirectory, privateKey, user, localDirs, numThreads, 60, maxHostsPerCreateRequest); Modified: hive/trunk/testutils/ptest2/src/test/java/org/apache/hive/ptest/execution/TestScripts.testAlternativeTestJVM.approved.txt URL: http://svn.apache.org/viewvc/hive/trunk/testutils/ptest2/src/test/java/org/apache/hive/ptest/execution/TestScripts.testAlternativeTestJVM.approved.txt?rev=1645054&r1=1645053&r2=1645054&view=diff ============================================================================== --- hive/trunk/testutils/ptest2/src/test/java/org/apache/hive/ptest/execution/TestScripts.testAlternativeTestJVM.approved.txt (original) +++ hive/trunk/testutils/ptest2/src/test/java/org/apache/hive/ptest/execution/TestScripts.testAlternativeTestJVM.approved.txt Fri Dec 12 20:01:04 2014 @@ -85,7 +85,7 @@ fi echo $pid >> batch.pid wait $pid ret=$? -find ./ -type f -name hive.log | \ +find ./ -type f -name hive.log -o -name spark.log | \ xargs -I {} sh -c 'f=$(basename {}); test -f /some/log/dir/$f && f=$f-$(uuidgen); mv {} /some/log/dir/$f' find ./ -type f -name 'TEST-*.xml' | \ xargs -I {} sh -c 'f=TEST-batch-1-$(basename {}); test -f /some/log/dir/$f && f=$f-$(uuidgen); mv {} /some/log/dir/$f' Modified: hive/trunk/testutils/ptest2/src/test/java/org/apache/hive/ptest/execution/TestScripts.testBatch.approved.txt URL: http://svn.apache.org/viewvc/hive/trunk/testutils/ptest2/src/test/java/org/apache/hive/ptest/execution/TestScripts.testBatch.approved.txt?rev=1645054&r1=1645053&r2=1645054&view=diff ============================================================================== --- hive/trunk/testutils/ptest2/src/test/java/org/apache/hive/ptest/execution/TestScripts.testBatch.approved.txt (original) +++ hive/trunk/testutils/ptest2/src/test/java/org/apache/hive/ptest/execution/TestScripts.testBatch.approved.txt Fri Dec 12 20:01:04 2014 @@ -85,7 +85,7 @@ fi echo $pid >> batch.pid wait $pid ret=$? -find ./ -type f -name hive.log | \ +find ./ -type f -name hive.log -o -name spark.log | \ xargs -I {} sh -c 'f=$(basename {}); test -f /some/log/dir/$f && f=$f-$(uuidgen); mv {} /some/log/dir/$f' find ./ -type f -name 'TEST-*.xml' | \ xargs -I {} sh -c 'f=TEST-batch-1-$(basename {}); test -f /some/log/dir/$f && f=$f-$(uuidgen); mv {} /some/log/dir/$f'