You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@falcon.apache.org by pa...@apache.org on 2016/03/01 09:26:02 UTC
[16/51] [partial] falcon git commit: FALCON-1830 Removed code source
directories and updated pom
http://git-wip-us.apache.org/repos/asf/falcon/blob/8e49379d/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/helpers/LineageHelper.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/helpers/LineageHelper.java b/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/helpers/LineageHelper.java
deleted file mode 100644
index 7726c9e..0000000
--- a/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/helpers/LineageHelper.java
+++ /dev/null
@@ -1,328 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.
- */
-
-package org.apache.falcon.regression.core.helpers;
-
-import com.google.gson.GsonBuilder;
-import org.apache.commons.io.IOUtils;
-import org.apache.commons.lang.StringUtils;
-import org.apache.falcon.regression.core.response.lineage.Direction;
-import org.apache.falcon.regression.core.response.lineage.EdgeResult;
-import org.apache.falcon.regression.core.response.lineage.EdgesResult;
-import org.apache.falcon.regression.core.response.lineage.Vertex;
-import org.apache.falcon.regression.core.response.lineage.VertexIdsResult;
-import org.apache.falcon.regression.core.response.lineage.VertexResult;
-import org.apache.falcon.regression.core.response.lineage.VerticesResult;
-import org.apache.falcon.regression.core.util.AssertUtil;
-import org.apache.falcon.regression.core.util.GraphAssert;
-import org.apache.falcon.regression.core.util.Util;
-import org.apache.falcon.request.BaseRequest;
-import org.apache.hadoop.security.authentication.client.AuthenticationException;
-import org.apache.http.HttpResponse;
-import org.apache.log4j.Logger;
-import org.testng.Assert;
-
-import java.io.IOException;
-import java.net.URISyntaxException;
-import java.util.EnumSet;
-import java.util.Map;
-import java.util.TreeMap;
-
-/**
- * Class with helper functions to test lineage feature.
- */
-public class LineageHelper {
- private static final Logger LOGGER = Logger.getLogger(LineageHelper.class);
- private final String hostname;
-
- /**
- * Lineage related REST endpoints.
- */
- public enum URL {
- SERIALIZE("/api/metadata/lineage/serialize"),
- VERTICES("/api/metadata/lineage/vertices"),
- VERTICES_ALL("/api/metadata/lineage/vertices/all"),
- VERTICES_PROPERTIES("/api/metadata/lineage/vertices/properties"),
- EDGES("/api/metadata/lineage/edges"),
- EDGES_ALL("/api/metadata/lineage/edges/all");
-
- private final String url;
-
- URL(String url) {
- this.url = url;
- }
-
- public String getValue() {
- return this.url;
- }
- }
-
- /**
- * Create a LineageHelper to use with a specified hostname.
- * @param hostname hostname
- */
- public LineageHelper(String hostname) {
- this.hostname = hostname.trim().replaceAll("/$", "");
- }
-
- /**
- * Create a LineageHelper to use with a specified prismHelper.
- * @param prismHelper prismHelper
- */
- public LineageHelper(ColoHelper prismHelper) {
- this(prismHelper.getClusterHelper().getHostname());
- }
-
- /**
- * Extract response string from the response object.
- * @param response the response object
- * @return the response string
- * @throws IOException
- */
- public String getResponseString(HttpResponse response) throws IOException {
- return IOUtils.toString(response.getEntity().getContent(), "UTF-8");
- }
-
- /**
- * Run a get request on the specified url.
- * @param url url
- * @return response of the request
- * @throws URISyntaxException
- * @throws IOException
- * @throws AuthenticationException
- */
- public HttpResponse runGetRequest(String url)
- throws URISyntaxException, IOException, AuthenticationException, InterruptedException {
- final BaseRequest request = new BaseRequest(url, "get", null);
- return request.run();
- }
-
- /**
- * Successfully run a get request on the specified url.
- * @param url url
- * @return string response of the request
- * @throws URISyntaxException
- * @throws IOException
- * @throws AuthenticationException
- */
- public String runGetRequestSuccessfully(String url)
- throws URISyntaxException, IOException, AuthenticationException, InterruptedException {
- HttpResponse response = runGetRequest(url);
- String responseString = getResponseString(response);
- LOGGER.info(Util.prettyPrintXmlOrJson(responseString));
- Assert.assertEquals(response.getStatusLine().getStatusCode(), 200,
- "The get request was expected to be successfully");
- return responseString;
- }
-
- /**
- * Create a full url for the given lineage endpoint, urlPath and parameter.
- * @param url lineage endpoint
- * @param urlPath url path to be added to lineage endpoint
- * @param paramPairs parameters to be passed
- * @return url string
- */
- public String getUrl(final URL url, final String urlPath, final Map<String,
- String> paramPairs) {
- Assert.assertNotNull(hostname, "Hostname can't be null.");
- String hostAndPath = hostname + url.getValue();
- if (urlPath != null) {
- hostAndPath += "/" + urlPath;
- }
- if (paramPairs != null && paramPairs.size() > 0) {
- String[] params = new String[paramPairs.size()];
- int i = 0;
- for (Map.Entry<String, String> entry : paramPairs.entrySet()) {
- params[i++] = entry.getKey() + '=' + entry.getValue();
- }
- return hostAndPath + "/?" + StringUtils.join(params, "&");
- }
- return hostAndPath;
- }
-
- /**
- * Create a full url for the given lineage endpoint, urlPath and parameter.
- * @param url lineage endpoint
- * @param urlPath url path to be added to lineage endpoint
- * @return url string
- */
- public String getUrl(final URL url, final String urlPath) {
- return getUrl(url, urlPath, null);
- }
-
- /**
- * Create a full url for the given lineage endpoint and parameter.
- * @param url lineage endpoint
- * @param paramPairs parameters to be passed
- * @return url string
- */
- public String getUrl(final URL url, final Map<String, String> paramPairs) {
- return getUrl(url, null, paramPairs);
- }
-
- /**
- * Create a full url for the given lineage endpoint and parameter.
- * @param url lineage endpoint
- * @return url string
- */
- public String getUrl(final URL url) {
- return getUrl(url, null, null);
- }
-
- /**
- * Create url path from parts.
- * @param pathParts parts of the path
- * @return url path
- */
- public String getUrlPath(String... pathParts) {
- return StringUtils.join(pathParts, "/");
- }
-
- /**
- * Create url path from parts.
- * @param oneInt part of the path
- * @param pathParts parts of the path
- * @return url path
- */
- public String getUrlPath(int oneInt, String... pathParts) {
- return oneInt + "/" + getUrlPath(pathParts);
- }
-
- /**
- * Get result of the supplied type for the given url.
- * @param url url
- * @return result of the REST request
- */
- public <T> T getResultOfType(String url, Class<T> clazz) {
- String responseString = null;
- try {
- responseString = runGetRequestSuccessfully(url);
- } catch (URISyntaxException | InterruptedException | AuthenticationException | IOException e) {
- AssertUtil.fail(e);
- }
- return new GsonBuilder().create().fromJson(responseString, clazz);
- }
-
- /**
- * Get vertices result for the url.
- * @param url url
- * @return result of the REST request
- */
- public VerticesResult getVerticesResult(String url) {
- return getResultOfType(url, VerticesResult.class);
- }
-
- /**
- * Get vertex result for the url.
- * @param url url
- * @return result of the REST request
- */
- private VertexResult getVertexResult(String url) {
- return getResultOfType(url, VertexResult.class);
- }
-
- /**
- * Get vertex id result for the url.
- * @param url url
- * @return result of the REST request
- */
- private VertexIdsResult getVertexIdsResult(String url) {
- return getResultOfType(url, VertexIdsResult.class);
- }
-
- /**
- * Get all the vertices.
- * @return all the vertices
- */
- public VerticesResult getAllVertices() {
- return getVerticesResult(getUrl(URL.VERTICES_ALL));
- }
-
- public VerticesResult getVertices(Vertex.FilterKey key, String value) {
- Map<String, String> params = new TreeMap<>();
- params.put("key", key.toString());
- params.put("value", value);
- return getVerticesResult(getUrl(URL.VERTICES, params));
- }
-
- public VertexResult getVertexById(int vertexId) {
- return getVertexResult(getUrl(URL.VERTICES, getUrlPath(vertexId)));
- }
-
- public VertexResult getVertexProperties(int vertexId) {
- return getVertexResult(getUrl(URL.VERTICES_PROPERTIES, getUrlPath(vertexId)));
- }
-
- public VerticesResult getVerticesByType(Vertex.VERTEX_TYPE vertexType) {
- return getVertices(Vertex.FilterKey.type, vertexType.getValue());
- }
-
- public VerticesResult getVerticesByName(String name) {
- return getVertices(Vertex.FilterKey.name, name);
- }
-
- public VerticesResult getVerticesByDirection(int vertexId, Direction direction) {
- Assert.assertTrue((EnumSet.of(Direction.bothCount, Direction.inCount, Direction.outCount,
- Direction.bothVertices, Direction.inComingVertices,
- Direction.outgoingVertices).contains(direction)),
- "Vertices requested.");
- return getVerticesResult(getUrl(URL.VERTICES, getUrlPath(vertexId, direction.getValue())));
- }
-
- public VertexIdsResult getVertexIdsByDirection(int vertexId, Direction direction) {
- Assert.assertTrue((EnumSet.of(Direction.bothVerticesIds, Direction.incomingVerticesIds,
- Direction.outgoingVerticesIds).contains(direction)),
- "Vertex Ids requested.");
- return getVertexIdsResult(getUrl(URL.VERTICES, getUrlPath(vertexId, direction.getValue())));
- }
-
- public Vertex getVertex(String vertexName) {
- final VerticesResult clusterResult = getVerticesByName(vertexName);
- GraphAssert.assertVertexSanity(clusterResult);
- Assert.assertEquals(clusterResult.getTotalSize(), 1,
- "Expected one node for vertex name:" + vertexName);
- return clusterResult.getResults().get(0);
- }
-
- /**
- * Get edges result for the url.
- * @param url url
- * @return result of the REST request
- */
- private EdgesResult getEdgesResult(String url) {
- return getResultOfType(url, EdgesResult.class);
- }
-
- private EdgeResult getEdgeResult(String url) {
- return getResultOfType(url, EdgeResult.class);
- }
-
- public EdgesResult getEdgesByDirection(int vertexId, Direction direction) {
- Assert.assertTrue((EnumSet.of(Direction.bothEdges, Direction.inComingEdges,
- Direction.outGoingEdges).contains(direction)), "Vertices requested.");
- return getEdgesResult(getUrl(URL.VERTICES, getUrlPath(vertexId, direction.getValue())));
- }
-
- public EdgesResult getAllEdges() {
- return getEdgesResult(getUrl(URL.EDGES_ALL));
- }
-
- public EdgeResult getEdgeById(String edgeId) {
- return getEdgeResult(getUrl(URL.EDGES, getUrlPath(edgeId)));
- }
-}
http://git-wip-us.apache.org/repos/asf/falcon/blob/8e49379d/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
deleted file mode 100644
index e1a9288..0000000
--- a/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/helpers/entity/AbstractEntityHelper.java
+++ /dev/null
@@ -1,733 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.
- */
-
-package org.apache.falcon.regression.core.helpers.entity;
-
-import com.jcraft.jsch.JSchException;
-import org.apache.commons.exec.CommandLine;
-import org.apache.commons.lang.StringUtils;
-import org.apache.commons.lang.exception.ExceptionUtils;
-import org.apache.falcon.regression.core.helpers.FalconClientBuilder;
-import org.apache.falcon.regression.core.response.ServiceResponse;
-import org.apache.falcon.regression.core.supportClasses.ExecResult;
-import org.apache.falcon.regression.core.util.Config;
-import org.apache.falcon.regression.core.util.ExecUtil;
-import org.apache.falcon.regression.core.util.FileUtil;
-import org.apache.falcon.regression.core.util.HCatUtil;
-import org.apache.falcon.regression.core.util.HiveUtil;
-import org.apache.falcon.regression.core.util.InstanceUtil;
-import org.apache.falcon.regression.core.util.OozieUtil;
-import org.apache.falcon.regression.core.util.Util;
-import org.apache.falcon.regression.core.util.Util.URLS;
-import org.apache.falcon.resource.FeedInstanceResult;
-import org.apache.falcon.resource.InstanceDependencyResult;
-import org.apache.falcon.resource.InstancesResult;
-import org.apache.falcon.resource.InstancesSummaryResult;
-import org.apache.falcon.resource.TriageResult;
-import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.fs.FileSystem;
-import org.apache.hadoop.security.authentication.client.AuthenticationException;
-import org.apache.hive.hcatalog.api.HCatClient;
-import org.apache.hive.hcatalog.common.HCatException;
-import org.apache.log4j.Logger;
-import org.apache.oozie.client.OozieClient;
-import org.testng.Assert;
-
-import java.io.IOException;
-import java.net.URISyntaxException;
-import java.sql.Connection;
-import java.sql.SQLException;
-import java.util.List;
-
-/** Abstract class for helper classes. */
-public abstract class AbstractEntityHelper {
-
- private static final Logger LOGGER = Logger.getLogger(AbstractEntityHelper.class);
-
- //basic properties
- private String qaHost;
- private String hostname = "";
- private String username = "";
- private String password = "";
- private String hadoopLocation = "";
- private String hadoopURL = "";
- private String clusterReadonly = "";
- private String clusterWrite = "";
- private String oozieURL = "";
- private String activeMQ = "";
- private String storeLocation = "";
- private String colo;
- private String allColo;
- private String coloName;
- //hive jdbc
- private String hiveJdbcUrl = "";
- private String hiveJdbcUser = "";
- private String hiveJdbcPassword = "";
- private Connection hiveJdbcConnection;
- //clients
- private OozieClient oozieClient;
- private String hcatEndpoint = "";
- private HCatClient hCatClient;
- private FileSystem hadoopFS;
- //other properties
- private String namenodePrincipal;
- private String hiveMetaStorePrincipal;
- private String identityFile;
- private String serviceUser;
- private String serviceStartCmd;
- private String serviceStopCmd;
- private String serviceStatusMsg;
- private String serviceStatusCmd;
-
- public AbstractEntityHelper(String prefix) {
- if ((null == prefix) || prefix.isEmpty()) {
- prefix = "";
- } else {
- prefix += ".";
- }
- this.qaHost = Config.getProperty(prefix + "qa_host");
- this.hostname = Config.getProperty(prefix + "hostname");
- this.username = Config.getProperty(prefix + "username", System.getProperty("user.name"));
- this.password = Config.getProperty(prefix + "password", "");
- this.hadoopLocation = Config.getProperty(prefix + "hadoop_location");
- this.hadoopURL = Config.getProperty(prefix + "hadoop_url");
- this.hcatEndpoint = Config.getProperty(prefix + "hcat_endpoint");
- this.clusterReadonly = Config.getProperty(prefix + "cluster_readonly");
- this.clusterWrite = Config.getProperty(prefix + "cluster_write");
- this.oozieURL = Config.getProperty(prefix + "oozie_url");
- this.activeMQ = Config.getProperty(prefix + "activemq_url");
- this.storeLocation = Config.getProperty(prefix + "storeLocation");
- this.allColo = "?colo=" + Config.getProperty(prefix + "colo", "*");
- this.colo = (!Config.getProperty(prefix + "colo", "").isEmpty()) ? "?colo=" + Config
- .getProperty(prefix + "colo") : "";
- this.coloName = this.colo.contains("=") ? this.colo.split("=")[1] : "";
- this.serviceStartCmd =
- Config.getProperty(prefix + "service_start_cmd", "/etc/init.d/tomcat6 start");
- this.serviceStopCmd = Config.getProperty(prefix + "service_stop_cmd",
- "/etc/init.d/tomcat6 stop");
- this.serviceUser = Config.getProperty(prefix + "service_user", null);
- this.serviceStatusMsg = Config.getProperty(prefix + "service_status_msg",
- "Tomcat servlet engine is running with pid");
- this.serviceStatusCmd =
- Config.getProperty(prefix + "service_status_cmd", "/etc/init.d/tomcat6 status");
- this.identityFile = Config.getProperty(prefix + "identityFile",
- System.getProperty("user.home") + "/.ssh/id_rsa");
- this.hadoopFS = null;
- this.oozieClient = null;
- this.namenodePrincipal = Config.getProperty(prefix + "namenode.kerberos.principal", "none");
- this.hiveMetaStorePrincipal = Config.getProperty(
- prefix + "hive.metastore.kerberos.principal", "none");
- this.hiveJdbcUrl = Config.getProperty(prefix + "hive.jdbc.url", "none");
- this.hiveJdbcUser =
- Config.getProperty(prefix + "hive.jdbc.user", System.getProperty("user.name"));
- this.hiveJdbcPassword = Config.getProperty(prefix + "hive.jdbc.password", "");
- }
-
- public String getActiveMQ() {
- return activeMQ;
- }
-
- public String getHadoopLocation() {
- return hadoopLocation;
- }
-
- public String getHadoopURL() {
- return hadoopURL;
- }
-
- public String getClusterReadonly() {
- return clusterReadonly;
- }
-
- public String getClusterWrite() {
- return clusterWrite;
- }
-
- public String getHostname() {
- return hostname;
- }
-
- public String getPassword() {
- return password;
- }
-
- public String getStoreLocation() {
- return storeLocation;
- }
-
- public String getUsername() {
- return username;
- }
-
- public String getHCatEndpoint() {
- return hcatEndpoint;
- }
-
- public String getQaHost() {
- return qaHost;
- }
-
- public String getIdentityFile() {
- return identityFile;
- }
-
- public String getServiceUser() {
- return serviceUser;
- }
-
- public String getServiceStopCmd() {
- return serviceStopCmd;
- }
-
- public String getServiceStartCmd() {
- return serviceStartCmd;
- }
-
- public String getColo() {
- return colo;
- }
-
- public String getColoName() {
- return coloName;
- }
-
- public abstract String getEntityType();
-
- public abstract String getEntityName(String entity);
-
- public String getNamenodePrincipal() {
- return namenodePrincipal;
- }
-
- public String getHiveMetaStorePrincipal() {
- return hiveMetaStorePrincipal;
- }
-
- public HCatClient getHCatClient() {
- if (null == this.hCatClient) {
- try {
- this.hCatClient = HCatUtil.getHCatClient(hcatEndpoint, hiveMetaStorePrincipal);
- } catch (HCatException e) {
- Assert.fail("Unable to create hCatClient because of exception:\n"
- + ExceptionUtils.getStackTrace(e));
- }
- }
- return this.hCatClient;
- }
-
- public Connection getHiveJdbcConnection() {
- if (null == hiveJdbcConnection) {
- try {
- hiveJdbcConnection =
- HiveUtil.getHiveJdbcConnection(hiveJdbcUrl, hiveJdbcUser, hiveJdbcPassword, hiveMetaStorePrincipal);
- } catch (ClassNotFoundException | SQLException | InterruptedException | IOException e) {
- Assert.fail("Unable to create hive jdbc connection because of exception:\n"
- + ExceptionUtils.getStackTrace(e));
- }
- }
- return hiveJdbcConnection;
- }
-
- public OozieClient getOozieClient() {
- if (null == this.oozieClient) {
- this.oozieClient = OozieUtil.getClient(this.oozieURL);
- }
- return this.oozieClient;
- }
-
- public FileSystem getHadoopFS() throws IOException {
- if (null == this.hadoopFS) {
- Configuration conf = new Configuration();
- conf.setBoolean("fs.hdfs.impl.disable.cache", true);
- conf.set("fs.default.name", "hdfs://" + this.hadoopURL);
- this.hadoopFS = FileSystem.get(conf);
- }
- return this.hadoopFS;
- }
-
- private String createUrl(String... parts) {
- return StringUtils.join(parts, "/");
- }
-
- public ServiceResponse listEntities(String entityType, String params, String user)
- throws IOException, URISyntaxException, AuthenticationException, InterruptedException {
- if (StringUtils.isEmpty(entityType)) {
- entityType = getEntityType();
- }
- LOGGER.info("fetching " + entityType + " list");
- String url = createUrl(this.hostname + URLS.LIST_URL.getValue(), entityType + colo);
- if (StringUtils.isNotEmpty(params)){
- url += colo.isEmpty() ? "?" + params : "&" + params;
- }
- return Util.sendRequest(createUrl(url), "get", null, user);
- }
-
- public ServiceResponse listAllEntities()
- throws AuthenticationException, IOException, URISyntaxException, InterruptedException {
- return listAllEntities(null, null);
- }
-
- public ServiceResponse listAllEntities(String params, String user)
- throws AuthenticationException, IOException, URISyntaxException, InterruptedException {
- return listEntities(null, (params == null ? "" : params + '&')
- + "numResults=" + Integer.MAX_VALUE, user);
- }
-
- public ServiceResponse submitEntity(String data)
- throws IOException, URISyntaxException, AuthenticationException, InterruptedException {
- return submitEntity(data, null);
- }
-
- public ServiceResponse validateEntity(String data)
- throws IOException, URISyntaxException, AuthenticationException, InterruptedException {
- return validateEntity(data, null);
- }
-
- public ServiceResponse submitEntity(String data, String user)
- throws IOException, URISyntaxException, AuthenticationException, InterruptedException {
- LOGGER.info("Submitting " + getEntityType() + ": \n" + Util.prettyPrintXml(data));
- return Util.sendRequest(createUrl(this.hostname + URLS.SUBMIT_URL.getValue(), getEntityType() + colo), "post",
- data, user);
- }
-
- public ServiceResponse validateEntity(String data, String user)
- throws IOException, URISyntaxException, AuthenticationException, InterruptedException {
- LOGGER.info("Validating " + getEntityType() + ": \n" + Util.prettyPrintXml(data));
- return Util.sendRequest(createUrl(this.hostname + URLS.VALIDATE_URL.getValue(), getEntityType() + colo), "post",
- data, user);
- }
-
- public ServiceResponse schedule(String processData)
- throws IOException, URISyntaxException, AuthenticationException, InterruptedException {
- return schedule(processData, null, "");
- }
-
- public ServiceResponse schedule(String data, String user, String params)
- throws IOException, URISyntaxException, AuthenticationException, InterruptedException {
-
- String url = createUrl(this.hostname + URLS.SCHEDULE_URL.getValue(), getEntityType(),
- getEntityName(data) + colo);
- if (StringUtils.isNotBlank(params)) {
- url += (colo.isEmpty() ? "?" : "&") + params;
- }
- LOGGER.info("url is : " + url);
- return Util.sendRequest(createUrl(url), "post", data, user);
- }
-
- public ServiceResponse submitAndSchedule(String data)
- throws IOException, URISyntaxException, AuthenticationException, InterruptedException {
- return submitAndSchedule(data, null, "");
- }
-
- public ServiceResponse submitAndSchedule(String data, String user, String params)
- throws IOException, URISyntaxException, AuthenticationException, InterruptedException {
- LOGGER.info("Submitting " + getEntityType() + ": \n" + Util.prettyPrintXml(data));
-
- String url = createUrl(this.hostname + URLS.SUBMIT_AND_SCHEDULE_URL.getValue(), getEntityType() + colo);
- if (StringUtils.isNotBlank(params)) {
- url += (colo.isEmpty() ? "?" : "&") + params;
- }
- return Util.sendRequest(createUrl(url), "post", data, user);
- }
-
- public ServiceResponse deleteByName(String entityName, String user)
- throws AuthenticationException, IOException, URISyntaxException, InterruptedException {
- return Util.sendRequest(
- createUrl(this.hostname + URLS.DELETE_URL.getValue(), getEntityType(), entityName + colo), "delete",
- user);
- }
-
- public ServiceResponse delete(String data)
- throws IOException, URISyntaxException, AuthenticationException, InterruptedException {
- return delete(data, null);
- }
-
- public ServiceResponse delete(String data, String user)
- throws IOException, URISyntaxException, AuthenticationException, InterruptedException {
- return Util.sendRequest(
- createUrl(this.hostname + URLS.DELETE_URL.getValue(), getEntityType(), getEntityName(data) + colo),
- "delete", user);
- }
-
- public ServiceResponse suspend(String data)
- throws IOException, URISyntaxException, AuthenticationException, InterruptedException {
- return suspend(data, null);
- }
-
- public ServiceResponse suspend(String data, String user)
- throws IOException, URISyntaxException, AuthenticationException, InterruptedException {
- return Util.sendRequest(createUrl(this.hostname + URLS.SUSPEND_URL.getValue(),
- getEntityType(), getEntityName(data) + colo), "post", user);
- }
-
- public ServiceResponse resume(String data)
- throws IOException, URISyntaxException, AuthenticationException, InterruptedException {
- return resume(data, null);
- }
-
- public ServiceResponse resume(String data, String user)
- throws IOException, URISyntaxException, AuthenticationException, InterruptedException {
- return Util.sendRequest(createUrl(this.hostname + URLS.RESUME_URL.getValue(),
- getEntityType(), getEntityName(data) + colo), "post", user);
- }
-
- public ServiceResponse getStatus(String data)
- throws IOException, URISyntaxException, AuthenticationException, InterruptedException {
- return getStatus(data, null);
- }
-
- public ServiceResponse getStatus(String data, String user)
- throws IOException, URISyntaxException, AuthenticationException, InterruptedException {
- return Util.sendRequest(createUrl(this.hostname + URLS.STATUS_URL.getValue(),
- getEntityType(), getEntityName(data) + colo), "get", user);
- }
-
- public ServiceResponse getEntityDefinition(String data)
- throws IOException, URISyntaxException, AuthenticationException, InterruptedException {
- return getEntityDefinition(data, null);
- }
-
- public ServiceResponse getEntityDefinition(String data, String user)
- throws IOException, URISyntaxException, AuthenticationException, InterruptedException {
- return Util.sendRequest(createUrl(this.hostname + URLS.GET_ENTITY_DEFINITION.getValue(),
- getEntityType(), getEntityName(data) + colo), "get", user);
- }
-
- public ServiceResponse getEntityDependencies(String data, String user)
- throws IOException, URISyntaxException, AuthenticationException, InterruptedException {
- return Util.sendRequest(
- createUrl(this.hostname + URLS.DEPENDENCIES.getValue(), getEntityType(), getEntityName(data) + colo),
- "get", user);
- }
-
- public InstancesResult getRunningInstance(String name)
- throws IOException, URISyntaxException, AuthenticationException, InterruptedException {
- return getRunningInstance(name, null);
- }
-
- public InstancesResult getRunningInstance(String name, String user)
- throws IOException, URISyntaxException, AuthenticationException, InterruptedException {
- String url = createUrl(this.hostname + URLS.INSTANCE_RUNNING.getValue(), getEntityType(),
- name + allColo);
- return (InstancesResult) InstanceUtil.sendRequestProcessInstance(url, user);
- }
-
- public InstancesResult getProcessInstanceStatus(String entityName, String params)
- throws IOException, URISyntaxException, AuthenticationException, InterruptedException {
- return getProcessInstanceStatus(entityName, params, null);
- }
-
- public InstancesResult getProcessInstanceStatus(
- String entityName, String params, String user)
- throws IOException, URISyntaxException, AuthenticationException, InterruptedException {
- String url = createUrl(this.hostname + URLS.INSTANCE_STATUS.getValue(), getEntityType(),
- entityName, "");
- return (InstancesResult) InstanceUtil
- .createAndSendRequestProcessInstance(url, params, allColo, user);
- }
-
- public InstancesResult getProcessInstanceLogs(String entityName, String params)
- throws IOException, URISyntaxException, AuthenticationException, InterruptedException {
- return getProcessInstanceLogs(entityName, params, null);
- }
-
- public InstancesResult getProcessInstanceLogs(String entityName, String params,
- String user)
- throws IOException, URISyntaxException, AuthenticationException, InterruptedException {
- String url = createUrl(this.hostname + URLS.INSTANCE_LOGS.getValue(), getEntityType(),
- entityName);
- if (StringUtils.isNotEmpty(params)) {
- url += "?";
- }
- return (InstancesResult) InstanceUtil
- .createAndSendRequestProcessInstance(url, params, allColo, user);
- }
-
- public InstancesResult getProcessInstanceSuspend(
- String readEntityName, String params)
- throws IOException, URISyntaxException, AuthenticationException, InterruptedException {
- return getProcessInstanceSuspend(readEntityName, params, null);
- }
-
- public InstancesResult getProcessInstanceSuspend(
- String entityName, String params, String user)
- throws IOException, URISyntaxException, AuthenticationException, InterruptedException {
- String url = createUrl(this.hostname + URLS.INSTANCE_SUSPEND.getValue(), getEntityType(),
- entityName, "");
- return (InstancesResult) InstanceUtil
- .createAndSendRequestProcessInstance(url, params, allColo, user);
- }
-
- public ServiceResponse update(String oldEntity, String newEntity)
- throws IOException, URISyntaxException, AuthenticationException, InterruptedException {
- return update(oldEntity, newEntity, null);
- }
-
- public ServiceResponse update(String oldEntity, String newEntity, 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 = createUrl(this.hostname + URLS.UPDATE.getValue(), getEntityType(),
- getEntityName(oldEntity));
- return Util.sendRequest(url + colo, "post", newEntity, user);
- }
-
- public InstancesResult getProcessInstanceKill(String readEntityName, String params)
- throws IOException, URISyntaxException, AuthenticationException, InterruptedException {
- return getProcessInstanceKill(readEntityName, params, null);
- }
-
- public InstancesResult getProcessInstanceKill(String entityName, String params,
- String user)
- throws IOException, URISyntaxException, AuthenticationException, InterruptedException {
- String url = createUrl(this.hostname + URLS.INSTANCE_KILL.getValue(), getEntityType(),
- entityName, "");
- return (InstancesResult) InstanceUtil
- .createAndSendRequestProcessInstance(url, params, allColo, user);
- }
-
- public InstancesResult getProcessInstanceRerun(String entityName, String params)
- throws IOException, URISyntaxException, AuthenticationException, InterruptedException {
- return getProcessInstanceRerun(entityName, params, null);
- }
-
- public InstancesResult getProcessInstanceRerun(String entityName, String params,
- String user)
- throws IOException, URISyntaxException, AuthenticationException, InterruptedException {
- String url = createUrl(this.hostname + URLS.INSTANCE_RERUN.getValue(), getEntityType(),
- entityName, "");
- return (InstancesResult) InstanceUtil
- .createAndSendRequestProcessInstance(url, params, allColo, user);
- }
-
- public InstancesResult getProcessInstanceResume(String entityName, String params)
- throws IOException, URISyntaxException, AuthenticationException, InterruptedException {
- return getProcessInstanceResume(entityName, params, null);
- }
-
- public InstancesResult getProcessInstanceResume(String entityName, String params,
- String user)
- throws IOException, URISyntaxException, AuthenticationException, InterruptedException {
- String url = createUrl(this.hostname + URLS.INSTANCE_RESUME.getValue(), getEntityType(),
- entityName, "");
- return (InstancesResult) InstanceUtil
- .createAndSendRequestProcessInstance(url, params, allColo, user);
- }
-
- public FeedInstanceResult getFeedInstanceListing(String entityName, String params)
- throws IOException, URISyntaxException, AuthenticationException, InterruptedException {
- return getFeedInstanceListing(entityName, params, null);
- }
-
- public FeedInstanceResult getFeedInstanceListing(String entityName, String params,
- String user)
- throws IOException, URISyntaxException, AuthenticationException, InterruptedException {
- String url = createUrl(this.hostname + URLS.INSTANCE_LISTING.getValue(), getEntityType(),
- entityName, "");
- return (FeedInstanceResult) InstanceUtil
- .createAndSendRequestProcessInstance(url, params, allColo, user);
- }
-
- public InstancesSummaryResult getInstanceSummary(String entityName, String params)
- throws IOException, URISyntaxException, AuthenticationException, InterruptedException {
- String url = createUrl(this.hostname + URLS.INSTANCE_SUMMARY.getValue(), getEntityType(),
- entityName, "");
- return (InstancesSummaryResult) InstanceUtil
- .createAndSendRequestProcessInstance(url, params, allColo, null);
- }
-
- public List<String> getArchiveInfo() throws IOException, JSchException {
- return Util.getStoreInfo(this, "/archive/" + getEntityType().toUpperCase());
- }
-
- public List<String> getStoreInfo() throws IOException, JSchException {
- return Util.getStoreInfo(this, "/" + getEntityType().toUpperCase());
- }
-
- public InstancesResult getInstanceParams(String entityName, String params)
- throws AuthenticationException, IOException, URISyntaxException, InterruptedException {
- String url = createUrl(this.hostname + URLS.INSTANCE_PARAMS.getValue(), getEntityType(),
- entityName, "");
- return (InstancesResult) InstanceUtil
- .createAndSendRequestProcessInstance(url, params, allColo, null);
- }
-
- /**
- * Retrieves instance triage.
- */
- public TriageResult getInstanceTriage(String entityName, String params)
- throws AuthenticationException, IOException, URISyntaxException, InterruptedException {
- String url = createUrl(this.hostname + URLS.INSTANCE_TRIAGE.getValue(), getEntityType(), entityName);
- return (TriageResult) InstanceUtil.createAndSendRequestProcessInstance(url, params, allColo, null);
- }
-
- /**
- * Lists all entities which are tagged by a given pipeline.
- * @param pipeline filter
- * @return service response
- * @throws AuthenticationException
- * @throws IOException
- * @throws URISyntaxException
- */
- public ServiceResponse getListByPipeline(String pipeline)
- throws AuthenticationException, IOException, URISyntaxException, InterruptedException {
- String url = createUrl(this.hostname + URLS.LIST_URL.getValue() + "/" + getEntityType());
- url += "?filterBy=PIPELINES:" + pipeline;
- return Util.sendRequest(url, "get", null, null);
- }
-
- /**
- * Submit an entity through falcon client.
- * @param entityStr string of the entity to be submitted
- * @throws IOException
- */
- public ExecResult clientSubmit(final String entityStr) throws IOException {
- LOGGER.info("Submitting " + getEntityType() + " through falcon client: \n"
- + Util.prettyPrintXml(entityStr));
- final String fileName = FileUtil.writeEntityToFile(entityStr);
- final CommandLine commandLine = FalconClientBuilder.getBuilder()
- .getSubmitCommand(getEntityType(), fileName).build();
- return ExecUtil.executeCommand(commandLine);
- }
-
- /**
- * Get CLI metrics for recipe based process or feed replication.
- * @param entityName
- * @return
- */
- public ExecResult getCLIMetrics(String entityName) {
- LOGGER.info("Getting CLI metrics for " + getEntityType()+ " " + entityName);
- final CommandLine commandLine = FalconClientBuilder.getBuilder()
- .getMetricsCommand(getEntityType(), entityName).build();
- return ExecUtil.executeCommand(commandLine);
- }
-
- /**
- * Delete an entity through falcon client.
- * @param entityStr string of the entity to be submitted
- * @throws IOException
- */
- public ExecResult clientDelete(final String entityStr, String user) throws IOException {
- final String entityName = getEntityName(entityStr);
- LOGGER.info("Deleting " + getEntityType() + ": " + entityName);
- final CommandLine commandLine = FalconClientBuilder.getBuilder(user)
- .getDeleteCommand(getEntityType(), entityName).build();
- return ExecUtil.executeCommand(commandLine);
- }
-
- /**
- * Retrieves entities summary.
- * @param clusterName compulsory parameter for request
- * @param params list of optional parameters
- * @return entity summary along with its instances.
- */
- public ServiceResponse getEntitySummary(String clusterName, String params)
- throws AuthenticationException, IOException, URISyntaxException, InterruptedException {
- String url = createUrl(this.hostname + URLS.ENTITY_SUMMARY.getValue(),
- getEntityType()) +"?cluster=" + clusterName;
- if (StringUtils.isNotEmpty(params)) {
- url += "&" + params;
- }
- return Util.sendRequest(url, "get", null, null);
- }
-
- /**
- * Get list of all instances of a given entity.
- * @param entityName entity name
- * @param params list of optional parameters
- * @param user user name
- * @return response
- */
- public InstancesResult listInstances(String entityName, String params, String user)
- throws AuthenticationException, IOException, URISyntaxException, InterruptedException {
- String url = createUrl(this.hostname + URLS.INSTANCE_LIST.getValue(), getEntityType(),
- entityName + colo);
- if (StringUtils.isNotEmpty(params)) {
- url += colo.isEmpty() ? "?" + params : "&" + params;
- }
- return (InstancesResult) InstanceUtil.sendRequestProcessInstance(url, user);
- }
-
- /**
- * Get list of all dependencies of a given entity.
- * @param entityName entity name
- * @return response
- * @throws URISyntaxException
- * @throws AuthenticationException
- * @throws InterruptedException
- * @throws IOException
- */
- public ServiceResponse getDependencies(String entityName)
- throws URISyntaxException, AuthenticationException, InterruptedException, IOException {
- String url = createUrl(this.hostname + URLS.DEPENDENCIES.getValue(), getEntityType(), entityName + colo);
- return Util.sendRequest(url, "get", null, null);
- }
-
- public ServiceResponse touchEntity(String data)
- throws IOException, URISyntaxException, AuthenticationException, InterruptedException {
- return touchEntity(Util.readEntityName(data), data, null);
- }
-
- public ServiceResponse touchEntity(String entityName, String data, String user)
- throws AuthenticationException, IOException, URISyntaxException, InterruptedException {
- String url = createUrl(this.hostname + URLS.TOUCH_URL.getValue(), getEntityType(),
- entityName + colo);
- return Util.sendRequest(url, "post", data, user);
- }
-
- /**
- * Retrieves entities lineage.
- * @param params list of optional parameters
- * @return entity lineage for the given pipeline.
- */
- public ServiceResponse getEntityLineage(String params)
- throws URISyntaxException, AuthenticationException, InterruptedException, IOException {
- String url = createUrl(this.hostname + URLS.ENTITY_LINEAGE.getValue(), colo);
- if (StringUtils.isNotEmpty(params)){
- url += colo.isEmpty() ? "?" + params : "&" + params;
- }
- return Util.sendJSONRequest(createUrl(url), "get", null, null);
- }
-
- /**
- * Retrieves instance dependencies.
- */
- public InstanceDependencyResult getInstanceDependencies(
- String entityName, String params, String user)
- throws IOException, URISyntaxException, AuthenticationException, InterruptedException {
- String url = createUrl(this.hostname + URLS.INSTANCE_DEPENDENCIES.getValue(), getEntityType(), entityName, "");
- return (InstanceDependencyResult) InstanceUtil
- .createAndSendRequestProcessInstance(url, params, allColo, user);
- }
-
- /**
- * Retrieves sla alerts.
- * @param params list of optional parameters
- * @return instances with sla missed.
- */
- public ServiceResponse getSlaAlert(String params)
- throws URISyntaxException, AuthenticationException, InterruptedException, IOException {
- String url = createUrl(this.hostname + URLS.SLA.getValue(),
- getEntityType());
- if (StringUtils.isNotEmpty(params)) {
- url += params;
- }
- return Util.sendJSONRequest(createUrl(url), "get", null, null);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/falcon/blob/8e49379d/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
deleted file mode 100644
index acc01fa..0000000
--- a/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/helpers/entity/ClusterEntityHelper.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.
- */
-
-package org.apache.falcon.regression.core.helpers.entity;
-
-import org.apache.falcon.regression.core.response.ServiceResponse;
-import org.apache.falcon.regression.core.util.Util;
-import org.apache.falcon.resource.InstancesResult;
-import org.apache.falcon.resource.InstancesSummaryResult;
-
-import java.io.IOException;
-import java.net.URISyntaxException;
-
-/** Helper class to work with cluster endpoints of a colo. */
-public class ClusterEntityHelper extends AbstractEntityHelper {
-
-
- private static final String INVALID_ERR = "Not Valid for Cluster Entity";
-
- public ClusterEntityHelper(String prefix) {
- super(prefix);
- }
-
- public String getEntityType() {
- return "cluster";
- }
-
- public String getEntityName(String entity) {
- return Util.readEntityName(entity);
- }
-
- public ServiceResponse getStatus(String data, String user) {
- throw new UnsupportedOperationException(INVALID_ERR);
- }
-
- public ServiceResponse resume(String data, String user) {
- throw new UnsupportedOperationException(INVALID_ERR);
- }
-
- public ServiceResponse schedule(String data, String user) {
- throw new UnsupportedOperationException(INVALID_ERR);
- }
-
- public ServiceResponse submitAndSchedule(String data, String user) {
- throw new UnsupportedOperationException(INVALID_ERR);
- }
-
- public ServiceResponse suspend(String data, String user) {
- throw new UnsupportedOperationException(INVALID_ERR);
- }
-
- @Override
- public InstancesResult getRunningInstance(String name, String user) {
- throw new UnsupportedOperationException(INVALID_ERR);
- }
-
- @Override
- public InstancesResult getProcessInstanceStatus(
- String readEntityName, String params, String user) {
- throw new UnsupportedOperationException(INVALID_ERR);
- }
-
-
- public InstancesResult getProcessInstanceSuspend(
- String readEntityName, String params, String user) {
- throw new UnsupportedOperationException(INVALID_ERR);
- }
-
- @Override
- public ServiceResponse update(String oldEntity, String newEntity, String user) {
- throw new UnsupportedOperationException(INVALID_ERR);
- }
-
- @Override
- public InstancesResult getProcessInstanceKill(String readEntityName,
- String string, String user) {
- throw new UnsupportedOperationException(INVALID_ERR);
- }
-
- @Override
- public InstancesResult getProcessInstanceRerun(
- String readEntityName, String string, String user) {
- throw new UnsupportedOperationException(INVALID_ERR);
- }
-
- @Override
- public InstancesResult getProcessInstanceResume(
- String readEntityName, String string, String user) {
- throw new UnsupportedOperationException(INVALID_ERR);
- }
-
- @Override
- public InstancesSummaryResult getInstanceSummary(String readEntityName,
- String string
- ) throws
- IOException, URISyntaxException {
- throw new UnsupportedOperationException(INVALID_ERR);
- }
-
- @Override
- public ServiceResponse getListByPipeline(String pipeline){
- throw new UnsupportedOperationException(INVALID_ERR);
- }
-}
http://git-wip-us.apache.org/repos/asf/falcon/blob/8e49379d/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/helpers/entity/EntityHelperFactory.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/helpers/entity/EntityHelperFactory.java b/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/helpers/entity/EntityHelperFactory.java
deleted file mode 100644
index 7b62656..0000000
--- a/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/helpers/entity/EntityHelperFactory.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.
- */
-
-package org.apache.falcon.regression.core.helpers.entity;
-
-import org.apache.falcon.entity.v0.EntityType;
-
-/** Factory class to create helper objects. */
-public final class EntityHelperFactory {
- private EntityHelperFactory() {
- }
-
- public static AbstractEntityHelper getEntityHelper(EntityType type, String prefix) {
- switch (type) {
- case FEED:
- return new FeedEntityHelper(prefix);
- case CLUSTER:
- return new ClusterEntityHelper(prefix);
- case PROCESS:
- return new ProcessEntityHelper(prefix);
- default:
- return null;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/falcon/blob/8e49379d/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/helpers/entity/FeedEntityHelper.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/helpers/entity/FeedEntityHelper.java b/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/helpers/entity/FeedEntityHelper.java
deleted file mode 100644
index 437f997..0000000
--- a/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/helpers/entity/FeedEntityHelper.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.
- */
-
-package org.apache.falcon.regression.core.helpers.entity;
-
-import org.apache.falcon.regression.core.response.ServiceResponse;
-import org.apache.falcon.regression.core.util.Util;
-
-/** Helper class to work with feed endpoints of a colo. */
-public class FeedEntityHelper extends AbstractEntityHelper {
-
- public FeedEntityHelper(String prefix) {
- super(prefix);
- }
-
- public String getEntityType() {
- return "feed";
- }
-
- public String getEntityName(String entity) {
- return Util.readEntityName(entity);
- }
-
- @Override
- public ServiceResponse getListByPipeline(String pipeline){
- throw new UnsupportedOperationException("Not valid for Feed Entity.");
- }
-}
-
http://git-wip-us.apache.org/repos/asf/falcon/blob/8e49379d/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/helpers/entity/ProcessEntityHelper.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/helpers/entity/ProcessEntityHelper.java b/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/helpers/entity/ProcessEntityHelper.java
deleted file mode 100644
index 76ad638..0000000
--- a/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/helpers/entity/ProcessEntityHelper.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.
- */
-
-package org.apache.falcon.regression.core.helpers.entity;
-
-import org.apache.falcon.regression.Entities.ProcessMerlin;
-
-/** Helper class to work with process endpoints of a colo. */
-public class ProcessEntityHelper extends AbstractEntityHelper {
-
- public ProcessEntityHelper(String prefix) {
- super(prefix);
- }
-
- public String getEntityType() {
- return "process";
- }
-
- public String getEntityName(String entity) {
- return new ProcessMerlin(entity).getName();
- }
-
-}
-
-
http://git-wip-us.apache.org/repos/asf/falcon/blob/8e49379d/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/response/ServiceResponse.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/response/ServiceResponse.java b/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/response/ServiceResponse.java
deleted file mode 100644
index f66d426..0000000
--- a/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/response/ServiceResponse.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.
- */
-
-package org.apache.falcon.regression.core.response;
-
-import com.google.gson.GsonBuilder;
-import org.apache.commons.io.IOUtils;
-import org.apache.commons.lang.exception.ExceptionUtils;
-import org.apache.falcon.regression.core.util.Util;
-import org.apache.falcon.resource.EntityList;
-import org.apache.falcon.resource.EntitySummaryResult;
-import org.apache.falcon.resource.LineageGraphResult;
-import org.apache.falcon.resource.SchedulableEntityInstanceResult;
-import org.apache.http.HttpResponse;
-import org.apache.log4j.Logger;
-
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.JAXBException;
-import javax.xml.bind.Unmarshaller;
-import java.io.IOException;
-import java.io.StringReader;
-
-/** Class to represent falcon's response to a rest request. */
-public class ServiceResponse {
- private static final Logger LOGGER = Logger.getLogger(ServiceResponse.class);
-
- private String message;
- private int code;
- private HttpResponse response;
-
- public int getCode() {
- return code;
- }
-
- public void setCode(int code) {
- this.code = code;
- }
-
- public String getMessage() {
- return message;
- }
-
- public void setMessage(String message) {
- this.message = message;
- }
-
- public HttpResponse getResponse() {
- return response;
- }
-
- public void setResponse(HttpResponse response) {
- this.response = response;
- }
-
- public ServiceResponse(String message, int code) {
- this.message = message;
- this.code = code;
- }
-
- public ServiceResponse(HttpResponse response) throws IOException {
- this.message = IOUtils.toString(response.getEntity().getContent());
- this.code = response.getStatusLine().getStatusCode();
- this.response = response;
-
- LOGGER.info("The web service response is:\n" + Util.prettyPrintXmlOrJson(message));
- }
-
- public ServiceResponse() {
- }
-
- /**
- * Retrieves EntitiesResult from a message if possible.
- * @return EntitiesResult
- */
- public EntityList getEntityList(){
- try {
- JAXBContext jc = JAXBContext.newInstance(EntityList.class);
- Unmarshaller u = jc.createUnmarshaller();
- return (EntityList) u.unmarshal(new StringReader(message));
- } catch (JAXBException e) {
- LOGGER.info("getEntityList() failed:\n" + ExceptionUtils.getStackTrace(e));
- return null;
- }
- }
-
- /**
- * Retrieves EntitySummaryResult from a message if possible.
- * @return EntitiesResult
- */
- public EntitySummaryResult getEntitySummaryResult() {
- try {
- JAXBContext jc = JAXBContext.newInstance(EntitySummaryResult.class);
- Unmarshaller u = jc.createUnmarshaller();
- return (EntitySummaryResult) u.unmarshal(new StringReader(message));
- } catch (JAXBException e) {
- LOGGER.info("getEntitySummaryResult() failed:\n" + ExceptionUtils.getStackTrace(e));
- return null;
- }
- }
-
- /**
- * Retrieves LineageGraphResult from a message if possible.
- * @return LineageGraphResult
- */
- public LineageGraphResult getLineageGraphResult() {
- LineageGraphResult lineageGraphResult = new GsonBuilder().create().fromJson(message, LineageGraphResult.class);
- return lineageGraphResult;
- }
-
- /**
- * Retrieves SchedulableEntityInstanceResult from a message if possible.
- * @return SchedulableEntityInstanceResult
- */
- public SchedulableEntityInstanceResult getSlaResult() {
- SchedulableEntityInstanceResult schedulableEntityInstanceResult = new GsonBuilder().create().fromJson(message,
- SchedulableEntityInstanceResult.class);
- return schedulableEntityInstanceResult;
- }
-}
http://git-wip-us.apache.org/repos/asf/falcon/blob/8e49379d/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/response/lineage/Direction.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/response/lineage/Direction.java b/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/response/lineage/Direction.java
deleted file mode 100644
index 56e3d7c..0000000
--- a/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/response/lineage/Direction.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.
- */
-
-package org.apache.falcon.regression.core.response.lineage;
-
-/** Enum for all the direction values associated with edges. */
-public enum Direction {
- outGoingEdges("outE"),
- inComingEdges("inE"),
- bothEdges("bothE"),
- outgoingVertices("out"),
- inComingVertices("in"),
- bothVertices("both"),
- outCount("outCount"),
- inCount("inCount"),
- bothCount("bothCount"),
- outgoingVerticesIds("outIds"),
- incomingVerticesIds("inIds"),
- bothVerticesIds("bothIds");
-
- private final String value;
-
- Direction(String value) {
- this.value = value;
- }
-
- public String getValue() {
- return value;
- }
-}
http://git-wip-us.apache.org/repos/asf/falcon/blob/8e49379d/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/response/lineage/Edge.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/response/lineage/Edge.java b/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/response/lineage/Edge.java
deleted file mode 100644
index f1c408e..0000000
--- a/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/response/lineage/Edge.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.
- */
-
-package org.apache.falcon.regression.core.response.lineage;
-
-import com.google.gson.annotations.SerializedName;
-
-/** Class for representing an edge. */
-public class Edge extends GraphEntity {
-
- /** Class for representing different labels of edge. */
- public static enum LabelType {
- @SerializedName("stored-in")STORED_IN,
- @SerializedName("runs-on")RUNS_ON,
- @SerializedName("input")INPUT,
- @SerializedName("output")OUTPUT,
-
- @SerializedName("instance-of")INSTANCE_ENTITY_EDGE,
-
- @SerializedName("collocated")CLUSTER_COLO,
- @SerializedName("owned-by")OWNED_BY,
- @SerializedName("grouped-as")GROUPS,
-
- @SerializedName("pipeline")PIPELINES,
-
- // replication labels
- @SerializedName("replicated-to")FEED_CLUSTER_REPLICATED_EDGE,
-
- // eviction labels
- @SerializedName("evicted-from")FEED_CLUSTER_EVICTED_EDGE,
-
- //custom labels for test tags
- @SerializedName("test")TEST,
- @SerializedName("testname")TESTNAME,
- @SerializedName("first")FIRST,
- @SerializedName("second")SECOND,
- @SerializedName("third")THIRD,
- @SerializedName("fourth")FOURTH,
- @SerializedName("fifth")FIFTH,
- @SerializedName("sixth")SIXTH,
- @SerializedName("seventh")SEVENTH,
- @SerializedName("eighth")EIGHTH,
- @SerializedName("ninth")NINTH,
- @SerializedName("tenth")TENTH,
- @SerializedName("value")VALUE,
- @SerializedName("_falcon_mirroring_type")MIRRORING_TYPE,
- @SerializedName("specific")SPECIFIC,
- @SerializedName("myTag1")MY_TAG
- }
- @SerializedName("_id")
- private String id;
-
- @SerializedName("_outV")
- private int outV;
-
- @SerializedName("_inV")
- private int inV;
-
- @SerializedName("_label")
- private LabelType label;
-
- public String getId() {
- return id;
- }
-
- public int getOutV() {
- return outV;
- }
-
- public int getInV() {
- return inV;
- }
-
- public LabelType getLabel() {
- return label;
- }
-
- @Override
- public String toString() {
- return "Edge{"
- + "id='" + id + '\''
- + ", outV=" + outV
- + ", inV=" + inV
- + ", label=" + label
- + '}';
- }
-
-}
http://git-wip-us.apache.org/repos/asf/falcon/blob/8e49379d/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/response/lineage/EdgeResult.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/response/lineage/EdgeResult.java b/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/response/lineage/EdgeResult.java
deleted file mode 100644
index 9a062e0..0000000
--- a/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/response/lineage/EdgeResult.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.
- */
-
-package org.apache.falcon.regression.core.response.lineage;
-
-/** Class for Lineage API result having an edge. */
-public class EdgeResult {
- private Edge results;
-
- public Edge getResults() {
- return results;
- }
-
- @Override
- public String toString() {
- return "EdgeResult{" + "results=" + results + '}';
- }
-
-}
http://git-wip-us.apache.org/repos/asf/falcon/blob/8e49379d/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/response/lineage/EdgesResult.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/response/lineage/EdgesResult.java b/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/response/lineage/EdgesResult.java
deleted file mode 100644
index 5fdbd89..0000000
--- a/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/response/lineage/EdgesResult.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.
- */
-
-package org.apache.falcon.regression.core.response.lineage;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/** Class for Lineage API result having edges. */
-public class EdgesResult extends GraphResult {
- private List<Edge> results;
-
- public List<Edge> getResults() {
- return results;
- }
-
- @Override
- public String toString() {
- return String.format("EdgesResult{totalSize=%d, results=%s}", totalSize, results);
- }
-
- public List<Edge> filterByType(Edge.LabelType edgeLabel) {
- return filterEdgesByType(results, edgeLabel);
- }
-
- public List<Edge> filterEdgesByType(List<Edge> edges, Edge.LabelType edgeLabel) {
- final List<Edge> result = new ArrayList<>();
- for (Edge edge : edges) {
- if (edge.getLabel() == edgeLabel) {
- result.add(edge);
- }
- }
- return result;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/falcon/blob/8e49379d/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/response/lineage/GraphEntity.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/response/lineage/GraphEntity.java b/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/response/lineage/GraphEntity.java
deleted file mode 100644
index 87ca65b..0000000
--- a/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/response/lineage/GraphEntity.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.
- */
-
-package org.apache.falcon.regression.core.response.lineage;
-
-import com.google.gson.annotations.SerializedName;
-
-/** Abstract class for graph entities. */
-public abstract class GraphEntity {
- @SerializedName("_type")
- protected NODE_TYPE nodeType;
-
- public NODE_TYPE getNodeType() {
- return nodeType;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/falcon/blob/8e49379d/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/response/lineage/GraphResult.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/response/lineage/GraphResult.java b/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/response/lineage/GraphResult.java
deleted file mode 100644
index aba5c4c..0000000
--- a/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/response/lineage/GraphResult.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.
- */
-
-package org.apache.falcon.regression.core.response.lineage;
-
-import java.util.List;
-
-/** Abstract class for representing a result of lineage api call.*/
-public abstract class GraphResult {
- protected int totalSize;
-
- public int getTotalSize() {
- return totalSize;
- }
-
- public abstract List<?> getResults();
-}
http://git-wip-us.apache.org/repos/asf/falcon/blob/8e49379d/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/response/lineage/NODE_TYPE.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/response/lineage/NODE_TYPE.java b/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/response/lineage/NODE_TYPE.java
deleted file mode 100644
index da2132e..0000000
--- a/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/response/lineage/NODE_TYPE.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.
- */
-
-package org.apache.falcon.regression.core.response.lineage;
-
-import com.google.gson.annotations.SerializedName;
-
-/** Enum for all the allowed node types. */
-public enum NODE_TYPE {
- @SerializedName("vertex")VERTEX,
- @SerializedName("edge")EDGE,
-}
http://git-wip-us.apache.org/repos/asf/falcon/blob/8e49379d/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/response/lineage/Vertex.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/response/lineage/Vertex.java b/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/response/lineage/Vertex.java
deleted file mode 100644
index c947dac..0000000
--- a/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/response/lineage/Vertex.java
+++ /dev/null
@@ -1,172 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.
- */
-
-package org.apache.falcon.regression.core.response.lineage;
-
-import com.google.gson.annotations.SerializedName;
-
-/** Class for representing a vertex. */
-public class Vertex extends GraphEntity {
-
- /** Enum for all the allowed filter keys. */
- public static enum FilterKey {
- name, type, timestamp, version,
- userWorkflowEngine, userWorkflowName, userWorkflowVersion,
- workflowId, runId, status, workflowEngineUrl, subflowId,
- }
-
- /** Enum for all the allowed vertex types. */
- public static enum VERTEX_TYPE {
- @SerializedName("cluster-entity")CLUSTER_ENTITY("cluster-entity"),
- @SerializedName("feed-entity")FEED_ENTITY("feed-entity"),
- @SerializedName("process-entity")PROCESS_ENTITY("process-entity"),
-
- @SerializedName("feed-instance")FEED_INSTANCE("feed-instance"),
- @SerializedName("process-instance")PROCESS_INSTANCE("process-instance"),
-
- @SerializedName("user")USER("user"),
- @SerializedName("data-center")COLO("data-center"),
- @SerializedName("classification")TAGS("classification"),
- @SerializedName("group")GROUPS("group"),
- @SerializedName("pipelines")PIPELINES("pipelines");
-
- private final String value;
- VERTEX_TYPE(String value) {
- this.value = value;
- }
-
- public String getValue() {
- return value;
- }
- }
-
- @SerializedName("_id")
- private int id;
- private String name;
-
- private VERTEX_TYPE type;
- private String timestamp;
- private String version;
-
- private String userWorkflowEngine;
- private String userWorkflowName;
- private String userWorkflowVersion;
-
- private String workflowId;
- private String runId;
- private String status;
- private String workflowEngineUrl;
- private String subflowId;
-
- public int getId() {
- return id;
- }
-
- public String getTimestamp() {
- return timestamp;
- }
-
- public VERTEX_TYPE getType() {
- return type;
- }
-
- public String getName() {
- return name;
- }
-
- public String getNominalTime() {
- return name.split("/")[1];
- }
-
- @Override
- public String toString() {
- return "Vertex{"
- + "id=" + id
- + ", nodeType=" + nodeType
- + ", name='" + name + '\''
- + ", type=" + type
- + ", timestamp='" + timestamp + '\''
- + ", version='" + version + '\''
- + ", userWorkflowEngine='" + userWorkflowEngine + '\''
- + ", userWorkflowName='" + userWorkflowName + '\''
- + ", userWorkflowVersion='" + userWorkflowVersion + '\''
- + ", workflowId='" + workflowId + '\''
- + ", runId='" + runId + '\''
- + ", status='" + status + '\''
- + ", workflowEngineUrl='" + workflowEngineUrl + '\''
- + ", subflowId='" + subflowId + '\''
- + '}';
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (!(o instanceof Vertex)) {
- return false;
- }
-
- Vertex vertex = (Vertex) o;
-
- if (id != vertex.id || !name.equals(vertex.name)
- || (runId != null ? !runId.equals(vertex.runId) : vertex.runId != null)
- || (status != null ? !status.equals(vertex.status) : vertex.status != null)
- || (subflowId != null ? !subflowId.equals(vertex.subflowId)
- : vertex.subflowId != null)
- || !timestamp.equals(vertex.timestamp)
- || type != vertex.type
- || (userWorkflowEngine != null
- ? !userWorkflowEngine.equals(vertex.userWorkflowEngine)
- : vertex.userWorkflowEngine != null)
- || (userWorkflowName != null ? !userWorkflowName.equals(vertex.userWorkflowName)
- : vertex.userWorkflowName != null)
- || (userWorkflowVersion != null
- ? !userWorkflowVersion.equals(vertex.userWorkflowVersion)
- : vertex.userWorkflowVersion != null)
- || (version != null ? !version.equals(vertex.version) : vertex.version != null)
- || (workflowEngineUrl != null
- ? !workflowEngineUrl.equals(vertex.workflowEngineUrl)
- : vertex.workflowEngineUrl != null)
- || (workflowId != null ? !workflowId.equals(vertex.workflowId)
- : vertex.workflowId != null)) {
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- int result = id;
- result = 31 * result + name.hashCode();
- result = 31 * result + type.hashCode();
- result = 31 * result + timestamp.hashCode();
- result = 31 * result + (version != null ? version.hashCode() : 0);
- result = 31 * result + (userWorkflowEngine != null ? userWorkflowEngine.hashCode() : 0);
- result = 31 * result + (userWorkflowName != null ? userWorkflowName.hashCode() : 0);
- result = 31 * result + (userWorkflowVersion != null ? userWorkflowVersion.hashCode() : 0);
- result = 31 * result + (workflowId != null ? workflowId.hashCode() : 0);
- result = 31 * result + (runId != null ? runId.hashCode() : 0);
- result = 31 * result + (status != null ? status.hashCode() : 0);
- result = 31 * result + (workflowEngineUrl != null ? workflowEngineUrl.hashCode() : 0);
- result = 31 * result + (subflowId != null ? subflowId.hashCode() : 0);
- return result;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/falcon/blob/8e49379d/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/response/lineage/VertexIdsResult.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/response/lineage/VertexIdsResult.java b/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/response/lineage/VertexIdsResult.java
deleted file mode 100644
index 4279bdd..0000000
--- a/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/response/lineage/VertexIdsResult.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.
- */
-
-package org.apache.falcon.regression.core.response.lineage;
-
-import java.util.List;
-
-/** Class for Lineage API result having vertex ids. */
-public class VertexIdsResult extends GraphResult {
- private List<Integer> results;
-
- public List<Integer> getResults() {
- return results;
- }
-
- @Override
- public String toString() {
- return String.format("VertexIdsResult{totalSize=%d, results=%s}", totalSize, results);
- }
-}
http://git-wip-us.apache.org/repos/asf/falcon/blob/8e49379d/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/response/lineage/VertexResult.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/response/lineage/VertexResult.java b/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/response/lineage/VertexResult.java
deleted file mode 100644
index 6d419bc..0000000
--- a/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/response/lineage/VertexResult.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.
- */
-
-package org.apache.falcon.regression.core.response.lineage;
-
-/** Class for Lineage API result having one vertex. */
-public class VertexResult {
- private Vertex results;
-
- public Vertex getResults() {
- return results;
- }
-}