falcon-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rag...@apache.org
Subject falcon git commit: FALCON-1246 Remove wrong parameter from update signature, delete related tests conributed by Paul Isaychuk
Date Wed, 03 Jun 2015 23:48:27 GMT
Repository: falcon
Updated Branches:
  refs/heads/master c6c92134e -> 42f175a12


FALCON-1246 Remove wrong parameter from update signature, delete related tests conributed
by Paul Isaychuk


Project: http://git-wip-us.apache.org/repos/asf/falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/falcon/commit/42f175a1
Tree: http://git-wip-us.apache.org/repos/asf/falcon/tree/42f175a1
Diff: http://git-wip-us.apache.org/repos/asf/falcon/diff/42f175a1

Branch: refs/heads/master
Commit: 42f175a1239cfdcbdbaab08afaad2b247f7268a8
Parents: c6c9213
Author: Raghav Kumar Gautam <raghav@apache.org>
Authored: Wed Jun 3 16:47:18 2015 -0700
Committer: Raghav Kumar Gautam <raghav@apache.org>
Committed: Wed Jun 3 16:47:18 2015 -0700

----------------------------------------------------------------------
 falcon-regression/CHANGES.txt                   |  2 +
 .../helpers/entity/AbstractEntityHelper.java    | 12 ----
 .../helpers/entity/ClusterEntityHelper.java     |  6 --
 .../falcon/regression/AuthorizationTest.java    | 10 +---
 .../regression/FeedInstanceListingTest.java     |  7 +--
 .../regression/prism/EntityDryRunTest.java      |  2 +-
 .../prism/UpdateAtSpecificTimeTest.java         | 62 ++++----------------
 7 files changed, 18 insertions(+), 83 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/falcon/blob/42f175a1/falcon-regression/CHANGES.txt
----------------------------------------------------------------------
diff --git a/falcon-regression/CHANGES.txt b/falcon-regression/CHANGES.txt
index e55800a..21ba9a5 100644
--- a/falcon-regression/CHANGES.txt
+++ b/falcon-regression/CHANGES.txt
@@ -337,6 +337,8 @@ Trunk (Unreleased)
    FALCON-681 delete duplicate feed retention test from falcon regression (SamarthG)
 
   BUG FIXES
+   FALCON-1246 Remove wrong parameter from update signature, delete related tests (Paul Isaychuk)
+
    FALCON-1221 RescheduleProcessInFinalStatesTest.checkNotFoundDefinition() needs to be case
flexible
    (Raghav Kumar Gautam)
 

http://git-wip-us.apache.org/repos/asf/falcon/blob/42f175a1/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/helpers/entity/AbstractEntityHelper.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/helpers/entity/AbstractEntityHelper.java
b/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/helpers/entity/AbstractEntityHelper.java
index 4dce3f3..f242286 100644
--- a/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/helpers/entity/AbstractEntityHelper.java
+++ b/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/helpers/entity/AbstractEntityHelper.java
@@ -460,18 +460,6 @@ public abstract class AbstractEntityHelper {
         return Util.sendRequest(url + colo, "post", newEntity, user);
     }
 
-    public ServiceResponse update(String oldEntity, String newEntity, String updateTime,
-                                  String user)
-        throws IOException, URISyntaxException, AuthenticationException, InterruptedException
{
-        LOGGER.info("Updating " + getEntityType() + ": \n" + Util.prettyPrintXml(oldEntity));
-        LOGGER.info("To " + getEntityType() + ": \n" + Util.prettyPrintXml(newEntity));
-        String url = this.hostname + URLS.UPDATE.getValue() + "/" + getEntityType() + "/"
-            + Util.readEntityName(oldEntity);
-        String urlPart = colo == null || colo.isEmpty() ? "?" : colo + "&";
-        return Util.sendRequest(url + urlPart + "effective=" + updateTime, "post",
-            newEntity, user);
-    }
-
     public InstancesResult getProcessInstanceKill(String readEntityName, String params)
         throws IOException, URISyntaxException, AuthenticationException, InterruptedException
{
         return getProcessInstanceKill(readEntityName, params, null);

http://git-wip-us.apache.org/repos/asf/falcon/blob/42f175a1/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/helpers/entity/ClusterEntityHelper.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/helpers/entity/ClusterEntityHelper.java
b/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/helpers/entity/ClusterEntityHelper.java
index 4ea6728..acc01fa 100644
--- a/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/helpers/entity/ClusterEntityHelper.java
+++ b/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/helpers/entity/ClusterEntityHelper.java
@@ -87,12 +87,6 @@ public class ClusterEntityHelper extends AbstractEntityHelper {
     }
 
     @Override
-    public ServiceResponse update(String oldEntity, String newEntity, String updateTime,
-                                  String user) throws IOException {
-        throw new UnsupportedOperationException(INVALID_ERR);
-    }
-
-    @Override
     public InstancesResult getProcessInstanceKill(String readEntityName,
                                                          String string, String user) {
         throw new UnsupportedOperationException(INVALID_ERR);

http://git-wip-us.apache.org/repos/asf/falcon/blob/42f175a1/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/AuthorizationTest.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/AuthorizationTest.java
b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/AuthorizationTest.java
index 24af21f..e09033f 100644
--- a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/AuthorizationTest.java
+++ b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/AuthorizationTest.java
@@ -500,7 +500,6 @@ public class AuthorizationTest extends BaseTestClass {
         newFeed.setFeedPathValue(baseTestDir + "/randomPath" + MINUTE_DATE_PATTERN);
         //try to update feed by U2
         final ServiceResponse serviceResponse = prism.getFeedHelper().update(feed.toString(),
newFeed.toString(),
-            TimeUtil.getTimeWrtSystemTime(0),
             MerlinConstants.USER2_NAME);
         AssertUtil.assertFailedWithStatus(serviceResponse, HttpStatus.SC_BAD_REQUEST,
             "Feed submitted by first user should not be updated by second user");
@@ -520,7 +519,6 @@ public class AuthorizationTest extends BaseTestClass {
         newFeed.setFeedPathValue(baseTestDir + "/randomPath" + MINUTE_DATE_PATTERN);
         //try to update feed by U2
         final ServiceResponse serviceResponse = prism.getFeedHelper().update(feed.toString(),
newFeed.toString(),
-            TimeUtil.getTimeWrtSystemTime(0),
             MerlinConstants.USER2_NAME);
         AssertUtil.assertFailedWithStatus(serviceResponse, HttpStatus.SC_BAD_REQUEST,
             "Feed scheduled by first user should not be updated by second user");
@@ -544,7 +542,6 @@ public class AuthorizationTest extends BaseTestClass {
         //try to update process by U2
         final ServiceResponse serviceResponse = prism.getProcessHelper().update(bundles[0]
                 .getProcessData(), bundles[0].getProcessData(),
-            TimeUtil.getTimeWrtSystemTime(0),
             MerlinConstants.USER2_NAME);
         AssertUtil.assertFailedWithStatus(serviceResponse, HttpStatus.SC_BAD_REQUEST,
             "Process submitted by first user should not be updated by second user");
@@ -564,7 +561,6 @@ public class AuthorizationTest extends BaseTestClass {
         //try to update process by U2
         final ServiceResponse serviceResponse = prism.getProcessHelper().update(bundles[0]
                 .getProcessData(), bundles[0].getProcessData(),
-            TimeUtil.getTimeWrtSystemTime(0),
             MerlinConstants.USER2_NAME);
         AssertUtil.assertFailedWithStatus(serviceResponse, HttpStatus.SC_BAD_REQUEST,
             "Process scheduled by first user should not be updated by second user");
@@ -604,7 +600,7 @@ public class AuthorizationTest extends BaseTestClass {
 
         //update feed by U1
         serviceResponse = prism.getFeedHelper().update(feed.toString(), newFeed.toString(),
-            TimeUtil.getTimeWrtSystemTime(0), MerlinConstants.CURRENT_USER_NAME);
+            MerlinConstants.CURRENT_USER_NAME);
         AssertUtil.assertSucceeded(serviceResponse);
 
         //new feed bundle should be created by U1
@@ -654,7 +650,7 @@ public class AuthorizationTest extends BaseTestClass {
 
         //update feed by U2
         serviceResponse = prism.getFeedHelper().update(feed.toString(), newFeed.toString(),
-            TimeUtil.getTimeWrtSystemTime(0), MerlinConstants.USER2_NAME);
+            MerlinConstants.USER2_NAME);
         AssertUtil.assertSucceeded(serviceResponse);
 
         //new feed bundle should be created by U2
@@ -742,7 +738,7 @@ public class AuthorizationTest extends BaseTestClass {
         ProcessMerlin processObj = bundles[0].getProcessObject();
         processObj.setProperty("randomProp", "randomVal");
         serviceResponse = prism.getProcessHelper().update(bundles[0].getProcessData(), processObj.toString(),
-                TimeUtil.getTimeWrtSystemTime(0), MerlinConstants.USER2_NAME);
+            MerlinConstants.USER2_NAME);
         AssertUtil.assertSucceeded(serviceResponse);
 
         //new feed bundle should not be created

http://git-wip-us.apache.org/repos/asf/falcon/blob/42f175a1/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/FeedInstanceListingTest.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/FeedInstanceListingTest.java
b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/FeedInstanceListingTest.java
index 813300d..ecb5798 100644
--- a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/FeedInstanceListingTest.java
+++ b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/FeedInstanceListingTest.java
@@ -29,7 +29,6 @@ import org.apache.falcon.regression.core.util.InstanceUtil;
 import org.apache.falcon.regression.core.util.Util;
 import org.apache.falcon.regression.core.util.OozieUtil;
 import org.apache.falcon.regression.core.util.OSUtil;
-import org.apache.falcon.regression.core.util.TimeUtil;
 import org.apache.falcon.regression.core.util.AssertUtil;
 import org.apache.falcon.regression.testHelper.BaseTestClass;
 import org.apache.falcon.resource.FeedInstanceResult;
@@ -162,8 +161,7 @@ public class FeedInstanceListingTest extends BaseTestClass{
         validateResponse(r, 5, 0, 0, 0, 5);
         String inputFeed = bundles[0].getInputFeedFromBundle();
         bundles[0].setInputFeedAvailabilityFlag("_SUCCESS");
-        ServiceResponse serviceResponse = prism.getFeedHelper().update(inputFeed, bundles[0].getInputFeedFromBundle(),
-                TimeUtil.getTimeWrtSystemTime(0), null);
+        ServiceResponse serviceResponse = prism.getFeedHelper().update(inputFeed, bundles[0].getInputFeedFromBundle());
         AssertUtil.assertSucceeded(serviceResponse);
         //Since we have not created availability flag on HDFS, the feed instance status should
be partial
         r = prism.getFeedHelper()
@@ -194,8 +192,7 @@ public class FeedInstanceListingTest extends BaseTestClass{
         validateResponse(r, 5, 0, 0, 0, 5);
         String inputFeed = bundles[0].getInputFeedFromBundle();
         bundles[0].setInputFeedDataPath(baseTestDir + "/inputNew" + MINUTE_DATE_PATTERN);
-        ServiceResponse serviceResponse = prism.getFeedHelper().update(inputFeed, bundles[0].getInputFeedFromBundle(),
-                TimeUtil.getTimeWrtSystemTime(0), null);
+        ServiceResponse serviceResponse = prism.getFeedHelper().update(inputFeed, bundles[0].getInputFeedFromBundle());
         AssertUtil.assertSucceeded(serviceResponse);
         //Since we have not created directories for new path, the feed instance status should
be missing
         r = prism.getFeedHelper()

http://git-wip-us.apache.org/repos/asf/falcon/blob/42f175a1/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/EntityDryRunTest.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/EntityDryRunTest.java
b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/EntityDryRunTest.java
index 32d5e24..529df25 100644
--- a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/EntityDryRunTest.java
+++ b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/EntityDryRunTest.java
@@ -102,7 +102,7 @@ public class EntityDryRunTest extends BaseTestClass {
         bundles[0].submitAndScheduleProcess();
         bundles[0].setProcessProperty("EntityDryRunTestProp", "${coord:someEL(1)");
         ServiceResponse response = prism.getProcessHelper().update(bundles[0].getProcessData(),
-            bundles[0].getProcessData(), TimeUtil.getTimeWrtSystemTime(5), null);
+            bundles[0].getProcessData());
         validate(response,
             "The new entity (process) " + bundles[0].getProcessName() + " can't be scheduled");
         Assert.assertEquals(

http://git-wip-us.apache.org/repos/asf/falcon/blob/42f175a1/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/UpdateAtSpecificTimeTest.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/UpdateAtSpecificTimeTest.java
b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/UpdateAtSpecificTimeTest.java
index 9ff8016..189ef2f 100644
--- a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/UpdateAtSpecificTimeTest.java
+++ b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/prism/UpdateAtSpecificTimeTest.java
@@ -104,40 +104,6 @@ public class UpdateAtSpecificTimeTest extends BaseTestClass {
     }
 
     @Test(groups = {"singleCluster", "0.3.1", "embedded"}, timeOut = 1200000, enabled = true)
-    public void invalidCharProcess()
-        throws JAXBException, IOException, URISyntaxException,
-        AuthenticationException, OozieClientException, InterruptedException {
-        processBundle.setProcessValidity(TimeUtil.getTimeWrtSystemTime(0),
-            TimeUtil.getTimeWrtSystemTime(20));
-        processBundle.submitFeedsScheduleProcess(prism);
-        InstanceUtil.waitTillInstancesAreCreated(cluster1OC, processBundle.getProcessData(),
0);
-        String oldProcess =
-            processBundle.getProcessData();
-        processBundle.setProcessValidity(TimeUtil.getTimeWrtSystemTime(5),
-            TimeUtil.getTimeWrtSystemTime(100));
-        ServiceResponse r = prism.getProcessHelper().update(oldProcess,
-            processBundle.getProcessData(), "abc", null);
-        Assert.assertTrue(r.getMessage()
-            .contains("java.lang.IllegalArgumentException: abc is not a valid UTC string"));
-    }
-
-    @Test(groups = {"singleCluster", "0.3.1", "embedded"}, timeOut = 1200000, enabled = true)
-    public void invalidCharFeed()
-        throws JAXBException, IOException, URISyntaxException, AuthenticationException,
-        OozieClientException, InterruptedException {
-
-        String feed = submitAndScheduleFeed(processBundle);
-        InstanceUtil.waitTillInstancesAreCreated(cluster1OC, feed, 0);
-
-        //update frequency
-        FeedMerlin updatedFeed = new FeedMerlin(feed);
-        updatedFeed.setFrequency(new Frequency("21", Frequency.TimeUnit.minutes));
-        ServiceResponse r = prism.getFeedHelper().update(feed, updatedFeed.toString(), "abc",
null);
-        Assert.assertTrue(r.getMessage()
-            .contains("java.lang.IllegalArgumentException: abc is not a valid UTC string"));
-    }
-
-    @Test(groups = {"singleCluster", "0.3.1", "embedded"}, timeOut = 1200000, enabled = true)
     public void updateTimeInPastProcess()
         throws JAXBException, IOException, URISyntaxException,
         OozieClientException, AuthenticationException, InterruptedException {
@@ -157,8 +123,7 @@ public class UpdateAtSpecificTimeTest extends BaseTestClass {
 
         // update process by adding property
         processBundle.setProcessProperty("someProp", "someValue");
-        ServiceResponse r = prism.getProcessHelper().update(oldProcess,
-            processBundle.getProcessData(), TimeUtil.getTimeWrtSystemTime(-10000), null);
+        ServiceResponse r = prism.getProcessHelper().update(oldProcess, processBundle.getProcessData());
         AssertUtil.assertSucceeded(r);
 
         //check new coord created with current time
@@ -188,8 +153,7 @@ public class UpdateAtSpecificTimeTest extends BaseTestClass {
         //update frequency
         FeedMerlin updatedFeed = new FeedMerlin(feed);
         updatedFeed.setFrequency(new Frequency("7", Frequency.TimeUnit.minutes));
-        r = prism.getFeedHelper().update(feed, updatedFeed.toString(),
-            TimeUtil.getTimeWrtSystemTime(-10000), null);
+        r = prism.getFeedHelper().update(feed, updatedFeed.toString());
         AssertUtil.assertSucceeded(r);
         InstanceUtil.waitTillInstancesAreCreated(cluster1OC, feed, 1);
 
@@ -250,8 +214,7 @@ public class UpdateAtSpecificTimeTest extends BaseTestClass {
 
             //send update request
             String updateTime = TimeUtil.getTimeWrtSystemTime(5);
-            ServiceResponse r = prism.getProcessHelper()
-                .update(oldProcess, processBundle.getProcessData(), updateTime);
+            ServiceResponse r = prism.getProcessHelper().update(oldProcess, processBundle.getProcessData());
             AssertUtil.assertPartial(r);
             InstanceUtil.waitTillInstancesAreCreated(cluster1OC, processBundle.getProcessData(),
1);
 
@@ -274,8 +237,7 @@ public class UpdateAtSpecificTimeTest extends BaseTestClass {
                 Util.readEntityName(oldProcess), EntityType.PROCESS);
 
             //send second update request
-            r = prism.getProcessHelper().update(oldProcess, processBundle.getProcessData(),
-                updateTime, null);
+            r = prism.getProcessHelper().update(oldProcess, processBundle.getProcessData());
             AssertUtil.assertSucceeded(r);
             String defCluster2 = Util.getEntityDefinition(cluster2,
                 processBundle.getProcessData(), true);
@@ -331,8 +293,7 @@ public class UpdateAtSpecificTimeTest extends BaseTestClass {
                 oldBundleCluster1, EntityType.FEED);
 
             //send update command with +5 mins in future
-            String updateTime = TimeUtil.getTimeWrtSystemTime(5);
-            r = prism.getFeedHelper().update(feed, updatedFeed.toString(), updateTime, null);
+            r = prism.getFeedHelper().update(feed, updatedFeed.toString());
             AssertUtil.assertPartial(r);
 
             //verify new bundle creation on cluster1 and new definition on cluster3
@@ -348,7 +309,7 @@ public class UpdateAtSpecificTimeTest extends BaseTestClass {
                 Util.readEntityName(feed), EntityType.FEED);
 
             //send update again
-            r = prism.getFeedHelper().update(feed, updatedFeed.toString(), updateTime, null);
+            r = prism.getFeedHelper().update(feed, updatedFeed.toString());
             AssertUtil.assertSucceeded(r);
 
             //verify new bundle creation on cluster2 and no new bundle on cluster1
@@ -396,8 +357,7 @@ public class UpdateAtSpecificTimeTest extends BaseTestClass {
         LOGGER.info("Original Feed : " + Util.prettyPrintXml(oldProcess));
         LOGGER.info("Updated Feed :" + Util.prettyPrintXml(processBundle.getProcessData()));
         LOGGER.info("Update Time : " + updateTime);
-        ServiceResponse r = prism.getProcessHelper().update(oldProcess,
-            processBundle.getProcessData(), updateTime, null);
+        ServiceResponse r = prism.getProcessHelper().update(oldProcess, processBundle.getProcessData());
         AssertUtil.assertSucceeded(r);
 
         //verify new bundle creation with instances matching
@@ -442,7 +402,7 @@ public class UpdateAtSpecificTimeTest extends BaseTestClass {
         LOGGER.info("Original Feed : " + Util.prettyPrintXml(feed));
         LOGGER.info("Updated Feed :" + Util.prettyPrintXml(updatedFeed.toString()));
         LOGGER.info("Update Time : " + updateTime);
-        r = prism.getFeedHelper().update(feed, updatedFeed.toString(), updateTime, null);
+        r = prism.getFeedHelper().update(feed, updatedFeed.toString());
         AssertUtil.assertSucceeded(r);
         InstanceUtil.waitTillInstancesAreCreated(cluster1OC, feed, 1);
 
@@ -469,9 +429,7 @@ public class UpdateAtSpecificTimeTest extends BaseTestClass {
         List<String> oldNominalTimes = OozieUtil.getActionsNominalTime(cluster1OC,
oldBundleID,
             EntityType.PROCESS);
         processBundle.setProcessValidity(TimeUtil.addMinsToTime(startTime, -4), endTime);
-        String updateTime = TimeUtil.getTimeWrtSystemTime(2);
-        ServiceResponse r = prism.getProcessHelper().update(oldProcess,
-            processBundle.getProcessData(), updateTime, null);
+        ServiceResponse r = prism.getProcessHelper().update(oldProcess, processBundle.getProcessData());
         AssertUtil.assertSucceeded(r);
         TimeUtil.sleepSeconds(10);
 
@@ -523,7 +481,7 @@ public class UpdateAtSpecificTimeTest extends BaseTestClass {
         String updateTime = TimeUtil.addMinsToTime(endTimeCluster1, 3);
         processBundle.setProcessProperty("someProp", "someVal");
         ServiceResponse r = prism.getProcessHelper().update(processBundle.getProcessData(),
-            processBundle.getProcessData(), updateTime, null);
+            processBundle.getProcessData());
         AssertUtil.assertSucceeded(r);
 
         //check for new bundle to be created


Mime
View raw message