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:31 UTC
[45/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/client/src/main/java/org/apache/falcon/resource/EntityList.java
----------------------------------------------------------------------
diff --git a/client/src/main/java/org/apache/falcon/resource/EntityList.java b/client/src/main/java/org/apache/falcon/resource/EntityList.java
deleted file mode 100644
index b91bdbe..0000000
--- a/client/src/main/java/org/apache/falcon/resource/EntityList.java
+++ /dev/null
@@ -1,213 +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.resource;
-
-import org.apache.commons.lang3.StringUtils;
-import org.apache.falcon.entity.v0.Entity;
-import org.apache.falcon.entity.v0.EntityType;
-import org.apache.falcon.entity.v0.process.Input;
-import org.apache.falcon.entity.v0.process.Output;
-import org.apache.falcon.entity.v0.process.Process;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlElementWrapper;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Entity list used for marshalling / unmarshalling with REST calls.
- */
-@XmlRootElement(name = "entities")
-@XmlAccessorType(XmlAccessType.FIELD)
-@edu.umd.cs.findbugs.annotations.SuppressWarnings({"EI_EXPOSE_REP", "EI_EXPOSE_REP2"})
-public class EntityList {
- public static final String INPUT_TAG = "Input";
- public static final String OUTPUT_TAG = "Output";
-
- public int getTotalResults() {
- return totalResults;
- }
-
- @XmlElement
- private int totalResults;
-
- @XmlElement(name = "entity")
- private final EntityElement[] elements;
-
- /**
- * List of fields returned by RestAPI.
- */
- public static enum EntityFieldList {
- TYPE, NAME, STATUS, TAGS, PIPELINES, CLUSTERS
- }
-
- /**
- * Filter by these Fields is supported by RestAPI.
- */
- public static enum EntityFilterByFields {
- TYPE, NAME, STATUS, PIPELINES, CLUSTER, TAGS
- }
-
- /**
- * Element within an entity.
- */
- public static class EntityElement {
- //SUSPEND CHECKSTYLE CHECK VisibilityModifierCheck
- @XmlElement
- public String type;
- @XmlElement
- public String name;
- @XmlElement
- public String status;
- @XmlElementWrapper(name = "tags")
- public List<String> tag;
- @XmlElementWrapper(name = "pipelines")
- public List<String> pipeline;
- @XmlElementWrapper(name = "clusters")
- public List<String> cluster;
-
- //RESUME CHECKSTYLE CHECK VisibilityModifierCheck
-
- @Override
- public String toString() {
- String outString = "(" + type + ") " + name;
- if (StringUtils.isNotEmpty(status)) {
- outString += "(" + status + ")";
- }
-
- if (tag != null && !tag.isEmpty()) {
- outString += " - " + tag.toString();
- }
-
- if (pipeline != null && !pipeline.isEmpty()) {
- outString += " - " + pipeline.toString();
- }
-
- if (cluster != null && !cluster.isEmpty()) {
- outString += " - " + cluster.toString();
- }
-
- outString += "\n";
- return outString;
- }
- }
-
- //For JAXB
- public EntityList() {
- this.elements = null;
- this.totalResults = 0;
- }
-
- public EntityList(EntityElement[] elements, int totalResults) {
- this.totalResults = totalResults;
- this.elements = elements;
- }
-
- public EntityList(Entity[] elements, int totalResults) {
- this.totalResults = totalResults;
- int len = elements.length;
- EntityElement[] items = new EntityElement[len];
- for (int i = 0; i < len; i++) {
- items[i] = createEntityElement(elements[i]);
- }
- this.elements = items;
- }
-
- private EntityElement createEntityElement(Entity e) {
- EntityElement element = new EntityElement();
- element.type = e.getEntityType().name().toLowerCase();
- element.name = e.getName();
- element.status = null;
- element.tag = new ArrayList<String>();
- element.pipeline = new ArrayList<String>();
- element.cluster = new ArrayList<String>();
- return element;
- }
-
- public EntityList(Entity[] dependentEntities, Entity entity) {
- int len = dependentEntities.length;
- this.totalResults = len;
- EntityElement[] items = new EntityElement[len];
- for (int i = 0; i < len; i++) {
- Entity e = dependentEntities[i];
- EntityElement o = new EntityElement();
- o.type = e.getEntityType().name().toLowerCase();
- o.name = e.getName();
- o.status = null;
- o.tag = getEntityTag(e, entity);
- items[i] = o;
- }
- this.elements = items;
- }
-
- public EntityElement[] getElements() {
- return elements;
- }
-
- @Override
- public String toString() {
- StringBuilder buffer = new StringBuilder();
- buffer.append(totalResults + "\n");
- for (EntityElement element : elements) {
- buffer.append(element.toString());
- }
- return buffer.toString();
- }
-
- private List<String> getEntityTag(Entity dependentEntity, Entity entity) {
- List<String> tagList = new ArrayList<String>();
-
- if (entity.getEntityType().equals(EntityType.CLUSTER)) {
- return tagList;
- }
-
- Process process = null;
- String entityNameToMatch = null;
- if (dependentEntity.getEntityType().equals(EntityType.PROCESS)) {
- process = (Process) dependentEntity;
- entityNameToMatch = entity.getName();
- } else if (dependentEntity.getEntityType().equals(EntityType.FEED)
- && entity.getEntityType().equals(EntityType.PROCESS)) {
- process = (Process) entity;
- entityNameToMatch = dependentEntity.getName();
- }
-
- if (process != null) {
- if (process.getInputs() != null) {
- for (Input i : process.getInputs().getInputs()) {
- if (i.getFeed().equals(entityNameToMatch)) {
- tagList.add(INPUT_TAG);
- }
- }
- }
- if (process.getOutputs() != null) {
- for (Output o : process.getOutputs().getOutputs()) {
- if (o.getFeed().equals(entityNameToMatch)) {
- tagList.add(OUTPUT_TAG);
- }
- }
- }
- }
-
- return tagList;
- }
-}
http://git-wip-us.apache.org/repos/asf/falcon/blob/8e49379d/client/src/main/java/org/apache/falcon/resource/EntitySummaryResult.java
----------------------------------------------------------------------
diff --git a/client/src/main/java/org/apache/falcon/resource/EntitySummaryResult.java b/client/src/main/java/org/apache/falcon/resource/EntitySummaryResult.java
deleted file mode 100644
index 3ebfe26..0000000
--- a/client/src/main/java/org/apache/falcon/resource/EntitySummaryResult.java
+++ /dev/null
@@ -1,220 +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.resource;
-
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-import java.util.Arrays;
-import java.util.Date;
-
-/**
- * Pojo for JAXB marshalling / unmarshalling.
- */
-//SUSPEND CHECKSTYLE CHECK VisibilityModifierCheck
-@XmlRootElement
-@edu.umd.cs.findbugs.annotations.SuppressWarnings({"EI_EXPOSE_REP", "EI_EXPOSE_REP2"})
-public class EntitySummaryResult extends APIResult {
-
- /**
- * Workflow status as being set in result object.
- */
- public static enum WorkflowStatus {
- WAITING, RUNNING, SUSPENDED, KILLED, FAILED, SUCCEEDED, ERROR, READY
- }
-
- @XmlElement
- private EntitySummary[] entitySummaries;
-
- //For JAXB
- public EntitySummaryResult() {
- super();
- }
-
- public EntitySummaryResult(String message, EntitySummary[] entitySummaries) {
- this(Status.SUCCEEDED, message, entitySummaries);
- }
-
- public EntitySummaryResult(Status status, String message, EntitySummary[] entitySummaries) {
- super(status, message);
- this.entitySummaries = entitySummaries;
- }
-
- public EntitySummaryResult(Status status, String message) {
- super(status, message);
- }
-
- public EntitySummary[] getEntitySummaries() {
- return this.entitySummaries;
- }
-
- public void setEntitySummaries(EntitySummary[] entitySummaries) {
- this.entitySummaries = entitySummaries;
- }
-
- /**
- * A single entity object inside entity summary result.
- */
- @XmlRootElement(name = "entitySummary")
- public static class EntitySummary {
-
- @XmlElement
- public String type;
- @XmlElement
- public String name;
- @XmlElement
- public String status;
- @XmlElement
- public String[] tags;
- @XmlElement
- public String[] pipelines;
- @XmlElement
- public Instance[] instances;
-
- public EntitySummary() {
- }
-
- public EntitySummary(String entityName, String entityType) {
- this.name = entityName;
- this.type = entityType;
- }
-
- public EntitySummary(String name, String type, String status,
- String[] tags, String[] pipelines,
- Instance[] instances) {
- this.name = name;
- this.type = type;
- this.status = status;
- this.pipelines = pipelines;
- this.tags = tags;
- this.instances = instances;
- }
-
- public String getName() {
- return this.name;
- }
-
- public String getType() {
- return this.type;
- }
-
- public String getStatus() {
- return this.status;
- }
-
- public String[] getTags() {
- return this.tags;
- }
-
- public String[] getPipelines() {
- return this.pipelines;
- }
-
- public Instance[] getInstances() {
- return this.instances;
- }
-
- @Override
- public String toString() {
- return "{Entity: " + (this.name == null ? "" : this.name)
- + ", Type: " + (this.type == null ? "" : this.type)
- + ", Status: " + (this.status == null ? "" : this.status)
- + ", Tags: " + (this.tags == null ? "[]" : Arrays.toString(this.tags))
- + ", Pipelines: " + (this.pipelines == null ? "[]" : Arrays.toString(this.pipelines))
- + ", InstanceSummary: " + (this.instances == null ? "[]" : Arrays.toString(this.instances))
- +"}";
- }
- }
-
- /**
- * A single instance object inside instance result.
- */
- @XmlRootElement(name = "instances")
- public static class Instance {
- @XmlElement
- public String instance;
-
- @XmlElement
- public WorkflowStatus status;
-
- @XmlElement
- public String logFile;
-
- @XmlElement
- public String cluster;
-
- @XmlElement
- public String sourceCluster;
-
- @XmlElement
- public Date startTime;
-
- @XmlElement
- public Date endTime;
-
- public Instance() {
- }
-
- public Instance(String cluster, String instance, WorkflowStatus status) {
- this.cluster = cluster;
- this.instance = instance;
- this.status = status;
- }
-
- public String getInstance() {
- return instance;
- }
-
- public WorkflowStatus getStatus() {
- return status;
- }
-
- public String getLogFile() {
- return logFile;
- }
-
- public String getCluster() {
- return cluster;
- }
-
- public String getSourceCluster() {
- return sourceCluster;
- }
-
- public Date getStartTime() {
- return startTime;
- }
-
- public Date getEndTime() {
- return endTime;
- }
-
- @Override
- public String toString() {
- return "{instance: " + (this.instance == null ? "" : this.instance)
- + ", status: " + (this.status == null ? "" : this.status)
- + (this.logFile == null ? "" : ", log: " + this.logFile)
- + (this.sourceCluster == null ? "" : ", source-cluster: " + this.sourceCluster)
- + (this.cluster == null ? "" : ", cluster: " + this.cluster)
- + (this.startTime == null ? "" : ", startTime: " + this.startTime)
- + (this.endTime == null ? "" : ", endTime: " + this.endTime)
- + "}";
- }
- }
-}
-//RESUME CHECKSTYLE CHECK VisibilityModifierCheck
http://git-wip-us.apache.org/repos/asf/falcon/blob/8e49379d/client/src/main/java/org/apache/falcon/resource/FeedInstanceResult.java
----------------------------------------------------------------------
diff --git a/client/src/main/java/org/apache/falcon/resource/FeedInstanceResult.java b/client/src/main/java/org/apache/falcon/resource/FeedInstanceResult.java
deleted file mode 100644
index 75f0b9a..0000000
--- a/client/src/main/java/org/apache/falcon/resource/FeedInstanceResult.java
+++ /dev/null
@@ -1,155 +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.resource;
-
-import org.apache.commons.io.FileUtils;
-
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-
-/**
- * Pojo for JAXB marshalling / unmarshalling.
- */
-//SUSPEND CHECKSTYLE CHECK VisibilityModifierCheck
-@XmlRootElement
-@edu.umd.cs.findbugs.annotations.SuppressWarnings({"EI_EXPOSE_REP", "EI_EXPOSE_REP2"})
-public class FeedInstanceResult extends APIResult {
-
- @XmlElement
- private Instance[] instances;
-
- private FeedInstanceResult() { // for jaxb
- super();
- }
-
- public FeedInstanceResult(String message, Instance[] instances) {
- this(Status.SUCCEEDED, message, instances);
- }
-
- public FeedInstanceResult(Status status, String message,
- Instance[] inInstances) {
- super(status, message);
- this.instances = inInstances;
- }
-
- public FeedInstanceResult(Status status, String message) {
- super(status, message);
- }
-
- public Instance[] getInstances() {
- return instances;
- }
-
- public void setInstances(Instance[] instances) {
- this.instances = instances;
- }
-
- @Override
- public Object[] getCollection() {
- return getInstances();
- }
-
- @Override
- public void setCollection(Object[] items) {
- if (items == null) {
- setInstances(new Instance[0]);
- } else {
- Instance[] newInstances = new Instance[items.length];
- for (int index = 0; index < items.length; index++) {
- newInstances[index] = (Instance)items[index];
- }
- setInstances(newInstances);
- }
- }
-
- /**
- * A single instance object inside instance result.
- */
- @XmlRootElement(name = "instance")
- public static class Instance {
- @XmlElement
- public String cluster;
-
- @XmlElement
- public String instance;
-
- @XmlElement
- public String status;
-
- @XmlElement
- public String uri;
-
- @XmlElement
- public long creationTime;
-
- @XmlElement
- public long size;
-
- @XmlElement
- public String sizeH;
-
- public Instance() {
- }
-
- public Instance(String cluster, String instance, String status) {
- this.cluster = cluster;
- this.instance = instance;
- this.status = status;
- }
-
- public String getInstance() {
- return instance;
- }
-
- public String getStatus() {
- return status;
- }
-
- public String getUri() {
- return uri;
- }
-
- public String getCluster() {
- return cluster;
- }
-
- public long getCreationTime() {
- return creationTime;
- }
-
- public Long getSize() {
- return size;
- }
-
- public String getSizeH(){
- return FileUtils.byteCountToDisplaySize(size);
- }
-
- @Override
- public String toString() {
- return "{instance:"
- + this.instance
- + ", status:"
- + this.status
- + (this.uri == null ? "" : ", uri: " + this.uri)
- + (this.cluster == null ? "" : ", cluster:" + this.cluster) + "}";
- }
- }
-}
-//RESUME CHECKSTYLE CHECK VisibilityModifierCheck
http://git-wip-us.apache.org/repos/asf/falcon/blob/8e49379d/client/src/main/java/org/apache/falcon/resource/FeedLookupResult.java
----------------------------------------------------------------------
diff --git a/client/src/main/java/org/apache/falcon/resource/FeedLookupResult.java b/client/src/main/java/org/apache/falcon/resource/FeedLookupResult.java
deleted file mode 100644
index f8d58ae..0000000
--- a/client/src/main/java/org/apache/falcon/resource/FeedLookupResult.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.resource;
-
-import org.apache.commons.lang3.StringUtils;
-import org.apache.falcon.entity.v0.feed.LocationType;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-
-/**
- * Entity list used for marshalling / unmarshalling with REST calls.
- */
-@XmlRootElement(name = "feeds")
-@XmlAccessorType(XmlAccessType.FIELD)
-@edu.umd.cs.findbugs.annotations.SuppressWarnings({"EI_EXPOSE_REP", "EI_EXPOSE_REP2"})
-public class FeedLookupResult extends APIResult {
-
- @XmlElement(name = "elements")
- private FeedProperties[] elements;
-
- //For JAXB
- private FeedLookupResult() {
- super();
- }
-
- public FeedLookupResult(Status status, String message) {
- super(status, message);
- }
-
- public FeedProperties[] getElements() {
- return elements;
- }
-
- public void setElements(FeedProperties[] elements) {
- this.elements = elements;
- }
-
-
- @Override
- public Object[] getCollection() {
- return getElements();
- }
-
- @Override
- public void setCollection(Object[] items) {
- if (items == null) {
- setElements(new FeedProperties[0]);
- } else {
- FeedProperties[] newInstances = new FeedProperties[items.length];
- for (int index = 0; index < items.length; index++) {
- newInstances[index] = (FeedProperties)items[index];
- }
- setElements(newInstances);
- }
- }
-
- @Override
- public String toString() {
- StringBuilder buffer = new StringBuilder();
- if (elements != null) {
- for (FeedProperties element : elements) {
- buffer.append(element.toString());
- buffer.append("\n");
- }
- }
- return buffer.toString();
- }
-
- /**
- * A single instance in the result.
- */
- @XmlRootElement(name = "feed")
- @XmlAccessorType(XmlAccessType.FIELD)
- public static class FeedProperties {
- @XmlElement
- private String feedName;
-
- @XmlElement
- private LocationType locationType;
-
- @XmlElement
- private String clusterName;
-
- public FeedProperties(String feedName, LocationType locationType, String clusterName){
- this.clusterName = clusterName;
- this.locationType = locationType;
- this.feedName = feedName;
- }
-
- //for JAXB
- private FeedProperties(){}
-
- public void setFeedName(String feedName) {
- this.feedName = feedName;
- }
-
- public void setLocationType(LocationType locationType) {
- this.locationType = locationType;
- }
-
- public void setClusterName(String clusterName) {
- this.clusterName = clusterName;
- }
-
- public String getFeedName() {
- return this.feedName;
- }
-
- public LocationType getLocationType() {
- return this.locationType;
- }
-
- public String getClusterName() {
- return this.clusterName;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
- FeedProperties that = (FeedProperties) o;
- if (!StringUtils.equals(clusterName, that.clusterName)) {
- return false;
- }
- if (locationType != that.locationType) {
- return false;
- }
- if (!StringUtils.equals(feedName, that.feedName)) {
- return false;
- }
- return true;
- }
-
- @Override
- public int hashCode() {
- int result = feedName.hashCode();
- result = 31 * result + (locationType != null ? locationType.hashCode() : 0);
- result = 31 * result + (clusterName != null ? clusterName.hashCode() : 0);
- return result;
- }
-
- @Override
- public String toString() {
- return feedName + " (CLUSTER:" + clusterName + ") (LocationType:" + locationType.name() + ")";
- }
-
- }
-
-}
http://git-wip-us.apache.org/repos/asf/falcon/blob/8e49379d/client/src/main/java/org/apache/falcon/resource/InstanceDependencyResult.java
----------------------------------------------------------------------
diff --git a/client/src/main/java/org/apache/falcon/resource/InstanceDependencyResult.java b/client/src/main/java/org/apache/falcon/resource/InstanceDependencyResult.java
deleted file mode 100644
index 0751f12..0000000
--- a/client/src/main/java/org/apache/falcon/resource/InstanceDependencyResult.java
+++ /dev/null
@@ -1,86 +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.resource;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-
-/**
- * Entity list used for marshalling / unmarshalling with REST calls.
- */
-@XmlRootElement(name = "dependents")
-@XmlAccessorType(XmlAccessType.FIELD)
-@edu.umd.cs.findbugs.annotations.SuppressWarnings({"EI_EXPOSE_REP", "EI_EXPOSE_REP2"})
-public class InstanceDependencyResult extends APIResult {
-
- @XmlElement(name = "dependencies")
- private SchedulableEntityInstance[] dependencies;
-
- //For JAXB
- private InstanceDependencyResult() {
- super();
- }
-
- public InstanceDependencyResult(Status status, String message) {
- super(status, message);
- }
-
- public SchedulableEntityInstance[] getDependencies() {
- return dependencies;
- }
-
- public void setDependencies(SchedulableEntityInstance[] dependencies) {
- this.dependencies = dependencies;
- }
-
-
- @Override
- public Object[] getCollection() {
- return getDependencies();
- }
-
- @Override
- public void setCollection(Object[] items) {
- if (items == null) {
- setDependencies(new SchedulableEntityInstance[0]);
- } else {
- SchedulableEntityInstance[] newInstances = new SchedulableEntityInstance[items.length];
- for (int index = 0; index < items.length; index++) {
- newInstances[index] = (SchedulableEntityInstance)items[index];
- }
- setDependencies(newInstances);
- }
- }
-
- @Override
- public String toString() {
- StringBuilder buffer = new StringBuilder();
- if (dependencies != null) {
- for (SchedulableEntityInstance element : dependencies) {
- buffer.append(element.toString());
- buffer.append("\n");
- }
- }
- return buffer.toString();
- }
-
-
-}
http://git-wip-us.apache.org/repos/asf/falcon/blob/8e49379d/client/src/main/java/org/apache/falcon/resource/InstancesResult.java
----------------------------------------------------------------------
diff --git a/client/src/main/java/org/apache/falcon/resource/InstancesResult.java b/client/src/main/java/org/apache/falcon/resource/InstancesResult.java
deleted file mode 100644
index e12c083..0000000
--- a/client/src/main/java/org/apache/falcon/resource/InstancesResult.java
+++ /dev/null
@@ -1,260 +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.resource;
-
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-import java.util.Date;
-
-/**
- * Pojo for JAXB marshalling / unmarshalling.
- */
-//SUSPEND CHECKSTYLE CHECK VisibilityModifierCheck
-@XmlRootElement
-@edu.umd.cs.findbugs.annotations.SuppressWarnings({"EI_EXPOSE_REP", "EI_EXPOSE_REP2"})
-public class InstancesResult extends APIResult {
-
- /**
- * Workflow status as being set in result object.
- */
- public static enum WorkflowStatus {
- WAITING, RUNNING, SUSPENDED, KILLED, FAILED, SUCCEEDED, ERROR, SKIPPED, UNDEFINED, READY
- }
-
- /**
- * RestAPI supports filterBy these fields of instance.
- */
- public static enum InstanceFilterFields {
- STATUS, CLUSTER, SOURCECLUSTER, STARTEDAFTER
- }
-
- @XmlElement
- private Instance[] instances;
-
- private InstancesResult() { // for jaxb
- super();
- }
-
- public InstancesResult(Status status, String message) {
- super(status, message);
- }
-
-
- public Instance[] getInstances() {
- return instances;
- }
-
- public void setInstances(Instance[] instances) {
- this.instances = instances;
- }
-
- @Override
- public Object[] getCollection() {
- return getInstances();
- }
-
- @Override
- public void setCollection(Object[] items) {
- if (items == null) {
- setInstances(new Instance[0]);
- } else {
- Instance[] newInstances = new Instance[items.length];
- for (int index = 0; index < items.length; index++) {
- newInstances[index] = (Instance)items[index];
- }
- setInstances(newInstances);
- }
- }
-
- /**
- * A single instance object inside instance result.
- */
- @XmlRootElement(name = "instance")
- public static class Instance {
- @XmlElement
- public String instance;
-
- @XmlElement
- public WorkflowStatus status;
-
- @XmlElement
- public String logFile;
-
- @XmlElement
- public String cluster;
-
- @XmlElement
- public String sourceCluster;
-
- @XmlElement
- public Date startTime;
-
- @XmlElement
- public Date endTime;
-
- @XmlElement
- public int runId;
-
- @XmlElement
- public String details;
-
- @XmlElement
- public InstanceAction[] actions;
-
- @XmlElement(name="wfParams")
- public KeyValuePair[] wfParams;
-
- public Instance() {
- }
-
- public Instance(String cluster, String instance, WorkflowStatus status) {
- this.cluster = cluster;
- this.instance = instance;
- this.status = status;
- }
-
- public String getInstance() {
- return instance;
- }
-
- public WorkflowStatus getStatus() {
- return status;
- }
-
- public String getLogFile() {
- return logFile;
- }
-
- public String getCluster() {
- return cluster;
- }
-
- public String getSourceCluster() {
- return sourceCluster;
- }
-
- public Date getStartTime() {
- return startTime;
- }
-
- public Date getEndTime() {
- return endTime;
- }
-
- public int getRunId() {
- return runId;
- }
-
- public InstanceAction[] getActions() {
- return actions;
- }
-
- public String getDetails() {
- return details;
- }
-
- public KeyValuePair[] getWfParams() { return wfParams; }
-
- @Override
- public String toString() {
- return "{instance:"
- + this.instance
- + ", status:"
- + this.status
- + (this.logFile == null ? "" : ", log:" + this.logFile)
- + (this.sourceCluster == null ? "" : ", source-cluster:"
- + this.sourceCluster)
- + (this.cluster == null ? "" : ", cluster:"
- + this.cluster) + "}";
- }
- }
-
- /**
- * Instance action inside an instance object.
- */
- @XmlRootElement(name = "actions")
- public static class InstanceAction {
- @XmlElement
- public String action;
- @XmlElement
- public String status;
- @XmlElement
- public String logFile;
-
- public InstanceAction() {
- }
-
- public InstanceAction(String action, String status, String logFile) {
- this.action = action;
- this.status = status;
- this.logFile = logFile;
- }
-
- public String getAction() {
- return action;
- }
-
- public String getStatus() {
- return status;
- }
-
- public String getLogFile() {
- return logFile;
- }
-
- @Override
- public String toString() {
- return "{action:" + this.action + ", status:" + this.status
- + (this.logFile == null ? "" : ", log:" + this.logFile)
- + "}";
- }
- }
-
- /**
- * POJO for key value parameters.
- */
- @XmlRootElement(name = "params")
- public static class KeyValuePair {
- @XmlElement
- public String key;
- @XmlElement
- public String value;
-
- public KeyValuePair(String key, String value) {
- this.key = key;
- this.value = value;
- }
-
- public KeyValuePair() { }
-
- public String getKey() {
- return key;
- }
-
- public String getValue() {
- return value;
- }
-
- @Override
- public String toString() {
- return "{key:" + this.key + ", value:" + this.value + "}";
- }
- }
-}
-//RESUME CHECKSTYLE CHECK VisibilityModifierCheck
http://git-wip-us.apache.org/repos/asf/falcon/blob/8e49379d/client/src/main/java/org/apache/falcon/resource/InstancesSummaryResult.java
----------------------------------------------------------------------
diff --git a/client/src/main/java/org/apache/falcon/resource/InstancesSummaryResult.java b/client/src/main/java/org/apache/falcon/resource/InstancesSummaryResult.java
deleted file mode 100644
index aa0db99..0000000
--- a/client/src/main/java/org/apache/falcon/resource/InstancesSummaryResult.java
+++ /dev/null
@@ -1,114 +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.resource;
-
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlElementWrapper;
-import javax.xml.bind.annotation.XmlRootElement;
-import java.util.Map;
-
-/**
- * Pojo for JAXB marshalling / unmarshalling.
- */
-
-//SUSPEND CHECKSTYLE CHECK VisibilityModifierCheck
-@XmlRootElement
-@edu.umd.cs.findbugs.annotations.SuppressWarnings({"EI_EXPOSE_REP", "EI_EXPOSE_REP2"})
-public class InstancesSummaryResult extends APIResult {
-
- /**
- * RestAPI supports filterBy these fields of instanceSummary.
- */
- public static enum InstanceSummaryFilterFields {
- STATUS, CLUSTER
- }
-
- @XmlElement
- private InstanceSummary[] instancesSummary;
-
- private InstancesSummaryResult() { // for jaxb
- super();
- }
-
- public InstancesSummaryResult(Status status, String message) {
- super(status, message);
- }
-
- public InstanceSummary[] getInstancesSummary() {
- return instancesSummary;
- }
-
- public void setInstancesSummary(InstanceSummary[] instancesSummary) {
- this.instancesSummary = instancesSummary;
- }
-
- @Override
- public Object[] getCollection() {
- return getInstancesSummary();
- }
-
- @Override
- public void setCollection(Object[] items) {
- if (items == null) {
- setInstancesSummary(new InstanceSummary[0]);
- } else {
- InstanceSummary[] newInstances = new InstanceSummary[items.length];
- for (int index = 0; index < items.length; index++) {
- newInstances[index] = (InstanceSummary)items[index];
- }
- setInstancesSummary(newInstances);
- }
- }
-
- /**
- * A single instance object inside instance result.
- */
- @XmlRootElement(name = "instance-summary")
- public static class InstanceSummary {
-
- @XmlElement
- public String cluster;
- @XmlElementWrapper(name="map")
- public Map<String, Long> summaryMap;
-
- public InstanceSummary() {
- }
-
- public InstanceSummary(String cluster, Map<String, Long> summaryMap) {
- this.cluster = cluster;
- this.summaryMap = summaryMap;
- }
-
- public Map<String, Long> getSummaryMap() {
- return summaryMap;
- }
-
- public String getCluster() {
- return cluster;
- }
-
- @Override
- public String toString() {
- return "cluster: " + (this.cluster == null ? "" : this.cluster)
- + "summaryMap: " + summaryMap.toString();
- }
- }
-
-}
-//RESUME CHECKSTYLE CHECK VisibilityModifierCheck
http://git-wip-us.apache.org/repos/asf/falcon/blob/8e49379d/client/src/main/java/org/apache/falcon/resource/LineageGraphResult.java
----------------------------------------------------------------------
diff --git a/client/src/main/java/org/apache/falcon/resource/LineageGraphResult.java b/client/src/main/java/org/apache/falcon/resource/LineageGraphResult.java
deleted file mode 100644
index 0e10e38..0000000
--- a/client/src/main/java/org/apache/falcon/resource/LineageGraphResult.java
+++ /dev/null
@@ -1,191 +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.resource;
-
-import org.apache.commons.lang3.StringUtils;
-
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.JAXBException;
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-
-/**
- * LineageGraphResult is the output returned by all the apis returning a DAG.
- */
-@XmlRootElement(name = "result")
-@XmlAccessorType (XmlAccessType.FIELD)
-@edu.umd.cs.findbugs.annotations.SuppressWarnings({"EI_EXPOSE_REP", "EI_EXPOSE_REP2"})
-public class LineageGraphResult {
-
- private String[] vertices;
-
- @XmlElement(name="edges")
- private Edge[] edges;
-
- private static final JAXBContext JAXB_CONTEXT;
-
- static {
- try {
- JAXB_CONTEXT = JAXBContext.newInstance(LineageGraphResult.class);
- } catch (JAXBException e) {
- throw new RuntimeException(e);
- }
- }
-
- public LineageGraphResult() {
- // default constructor for JAXB
- }
-
- /**
- * A class to represent an edge in a DAG.
- */
- @XmlRootElement(name = "edge")
- @XmlAccessorType(XmlAccessType.FIELD)
- public static class Edge {
- @XmlElement
- private String from;
- @XmlElement
- private String to;
- @XmlElement
- private String label;
-
- public Edge() {
-
- }
-
- public Edge(String from, String to, String label) {
- this.from = from;
- this.to = to;
- this.label = label;
- }
-
- public String getFrom() {
- return from;
- }
-
- public void setFrom(String from) {
- this.from = from;
- }
-
- public String getTo() {
- return to;
- }
-
- public void setTo(String to) {
- this.to = to;
- }
-
- public String getLabel() {
- return label;
- }
-
- public void setLabel(String label) {
- this.label = label;
- }
-
- public String getDotNotation() {
- StringBuilder result = new StringBuilder();
- if (StringUtils.isNotBlank(this.from) && StringUtils.isNotBlank(this.to)
- && StringUtils.isNotBlank(this.label)) {
- result.append("\"" + this.from +"\"");
- result.append(" -> ");
- result.append("\"" + this.to + "\"");
- result.append(" [ label = \"" + this.label + "\" ] \n");
- }
- return result.toString();
- }
-
- @Override
- public String toString() {
- return getDotNotation();
- }
-
- @Override
- public boolean equals(Object o) {
- if (o == this) {
- return true;
- }
-
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
-
- Edge that = (Edge) o;
- if (StringUtils.equals(that.getLabel(), label) && StringUtils.equals(that.getFrom(), from)
- && StringUtils.equals(that.getTo(), to)) {
- return true;
- }
- return false;
- }
-
- @Override
- public int hashCode() {
- int result = from != null ? from.hashCode() : 0;
- result = 31 * result + (to != null ? to.hashCode() : 0);
- result = 31 * result + (label != null ? label.hashCode() : 0);
- return result;
- }
-
- }
-
-
- public String getDotNotation() {
- StringBuilder result = new StringBuilder();
- result.append("digraph g{ \n");
- if (this.vertices != null) {
- for (String v : this.vertices) {
- result.append("\"" + v + "\"");
- result.append("\n");
- }
- }
-
- if (this.edges != null) {
- for (Edge e : this.edges) {
- result.append(e.getDotNotation());
- }
- }
- result.append("}\n");
- return result.toString();
- }
-
- public String[] getVertices() {
- return vertices;
- }
-
- public void setVertices(String[] vertices) {
- this.vertices = vertices;
- }
-
- public Edge[] getEdges() {
- return edges;
- }
-
- public void setEdges(Edge[] edges) {
- this.edges = edges;
- }
-
-
- @Override
- public String toString() {
- return getDotNotation();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/falcon/blob/8e49379d/client/src/main/java/org/apache/falcon/resource/SchedulableEntityInstance.java
----------------------------------------------------------------------
diff --git a/client/src/main/java/org/apache/falcon/resource/SchedulableEntityInstance.java b/client/src/main/java/org/apache/falcon/resource/SchedulableEntityInstance.java
deleted file mode 100644
index 0968734..0000000
--- a/client/src/main/java/org/apache/falcon/resource/SchedulableEntityInstance.java
+++ /dev/null
@@ -1,175 +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.resource;
-
-import org.apache.commons.lang3.StringUtils;
-import org.apache.falcon.entity.v0.EntityType;
-import org.apache.falcon.entity.v0.SchemaHelper;
-
-import java.util.Date;
-
-/**
- * Instance of a Schedulable Entity (Feed/Process).
- */
-public class SchedulableEntityInstance implements Comparable<SchedulableEntityInstance> {
-
- public static final String INPUT = "Input";
- public static final String OUTPUT = "Output";
-
- private String entityName;
-
- private String cluster;
-
- private Date instanceTime;
-
- private EntityType entityType;
-
- private String tags;
-
- //for JAXB
- private SchedulableEntityInstance() {
-
- }
-
- public SchedulableEntityInstance(String entityName, String cluster, Date instanceTime, EntityType type) {
- this.entityName = entityName;
- this.cluster = cluster;
- this.entityType = type;
- if (instanceTime != null) {
- this.instanceTime = new Date(instanceTime.getTime());
- }
- }
-
- public String getTags() {
- return tags;
- }
-
- public void setTags(String tags) {
- this.tags = tags;
- }
-
- public String getEntityName() {
- return entityName;
- }
-
- public void setEntityName(String entityName) {
- this.entityName = entityName;
- }
-
- public String getCluster() {
- return cluster;
- }
-
- public void setCluster(String cluster) {
- this.cluster = cluster;
- }
-
- public EntityType getEntityType() {
- return entityType;
- }
-
- public void setEntityType(EntityType entityType) {
- this.entityType = entityType;
- }
-
- public Date getInstanceTime() {
- return new Date(instanceTime.getTime());
- }
-
- public void setInstanceTime(Date instanceTime) {
- this.instanceTime = new Date(instanceTime.getTime());
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append("name: " + entityName
- + ", type: " + entityType
- + ", cluster: " + cluster
- + ", instanceTime: " + SchemaHelper.formatDateUTC(instanceTime));
- sb.append(", tags: " + ((tags != null) ? tags : ""));
- return sb.toString();
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
-
- SchedulableEntityInstance that = (SchedulableEntityInstance) o;
-
- if (instanceTime == null ? that.instanceTime != null : !instanceTime.equals(that.instanceTime)) {
- return false;
- }
-
- if (!entityType.equals(that.entityType)) {
- return false;
- }
-
- if (!StringUtils.equals(entityName, that.entityName)) {
- return false;
- }
-
- if (!StringUtils.equals(cluster, that.cluster)) {
- return false;
- }
-
- if (!StringUtils.equals(tags, that.tags)) {
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- int result = instanceTime.hashCode();
- result = 31 * result + entityName.hashCode();
- result = 31 * result + entityType.hashCode();
- result = 31 * result + cluster.hashCode();
- if (tags != null) {
- result = 31 * result + tags.hashCode();
- }
- return result;
- }
-
- @Override
- public int compareTo(SchedulableEntityInstance o) {
- int result = this.cluster.compareTo(o.cluster);
- if (result != 0) {
- return result;
- }
-
- result = this.entityType.compareTo(o.entityType);
- if (result != 0) {
- return result;
- }
-
- result = this.entityName.compareToIgnoreCase(o.entityName);
- if (result != 0) {
- return result;
- }
-
- return this.instanceTime.compareTo(o.instanceTime);
- }
-}
http://git-wip-us.apache.org/repos/asf/falcon/blob/8e49379d/client/src/main/java/org/apache/falcon/resource/SchedulableEntityInstanceResult.java
----------------------------------------------------------------------
diff --git a/client/src/main/java/org/apache/falcon/resource/SchedulableEntityInstanceResult.java b/client/src/main/java/org/apache/falcon/resource/SchedulableEntityInstanceResult.java
deleted file mode 100644
index 752c48d..0000000
--- a/client/src/main/java/org/apache/falcon/resource/SchedulableEntityInstanceResult.java
+++ /dev/null
@@ -1,86 +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.resource;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-import java.util.Arrays;
-
-/**
- * Instances list used for marshalling / unmarshalling with REST calls.
- */
-@XmlRootElement(name = "instances")
-@XmlAccessorType(XmlAccessType.FIELD)
-@edu.umd.cs.findbugs.annotations.SuppressWarnings({"EI_EXPOSE_REP", "EI_EXPOSE_REP2"})
-public class SchedulableEntityInstanceResult extends APIResult {
-
- @XmlElement(name = "instances")
- private SchedulableEntityInstance[] instances;
-
- //For JAXB
- private SchedulableEntityInstanceResult() {
- super();
- }
-
- public SchedulableEntityInstanceResult(Status status, String message) {
- super(status, message);
- }
-
- public SchedulableEntityInstance[] getInstances() {
- return instances;
- }
-
- public void setInstances(SchedulableEntityInstance[] instances) {
- this.instances = instances;
- }
-
-
- @Override
- public Object[] getCollection() {
- return getInstances();
- }
-
- @Override
- public void setCollection(Object[] items) {
- if (items == null) {
- setInstances(new SchedulableEntityInstance[0]);
- } else {
- SchedulableEntityInstance[] newInstances = new SchedulableEntityInstance[items.length];
- for (int index = 0; index < items.length; index++) {
- newInstances[index] = (SchedulableEntityInstance)items[index];
- }
- setInstances(newInstances);
- }
- }
-
- @Override
- public String toString() {
- StringBuilder buffer = new StringBuilder();
- if (instances != null) {
- Arrays.sort(instances);
- for (SchedulableEntityInstance element : instances) {
- buffer.append(element.toString());
- buffer.append("\n");
- }
- }
- return buffer.toString();
- }
-}
http://git-wip-us.apache.org/repos/asf/falcon/blob/8e49379d/client/src/main/java/org/apache/falcon/resource/TriageResult.java
----------------------------------------------------------------------
diff --git a/client/src/main/java/org/apache/falcon/resource/TriageResult.java b/client/src/main/java/org/apache/falcon/resource/TriageResult.java
deleted file mode 100644
index 131e2e1..0000000
--- a/client/src/main/java/org/apache/falcon/resource/TriageResult.java
+++ /dev/null
@@ -1,87 +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.resource;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-
-/**
- * Resut for instance triage.
- */
-@XmlRootElement(name = "triage")
-@XmlAccessorType(XmlAccessType.FIELD)
-@edu.umd.cs.findbugs.annotations.SuppressWarnings({"EI_EXPOSE_REP", "EI_EXPOSE_REP2"})
-public class TriageResult extends APIResult {
-
- @XmlElement(name = "triageGraphs")
- private LineageGraphResult[] triageGraphs;
-
- //For JAXB
- private TriageResult() {
- super();
- }
-
- public TriageResult(Status status, String message) {
- super(status, message);
- }
-
-
-
- public LineageGraphResult[] getTriageGraphs() {
- return triageGraphs;
- }
-
- public void setTriageGraphs(LineageGraphResult[] triageGraphs) {
- this.triageGraphs = triageGraphs;
- }
-
-
- @Override
- public Object[] getCollection() {
- return getTriageGraphs();
- }
-
-
- @Override
- public void setCollection(Object[] items) {
- if (items == null) {
- setTriageGraphs(new LineageGraphResult[0]);
- } else {
- LineageGraphResult[] graphs = new LineageGraphResult[items.length];
- for (int index = 0; index < items.length; index++) {
- graphs[index] = (LineageGraphResult)items[index];
- }
- setTriageGraphs(graphs);
- }
- }
-
- @Override
- public String toString() {
- StringBuilder buffer = new StringBuilder();
- if (triageGraphs != null) {
- for (LineageGraphResult graph : triageGraphs) {
- buffer.append(graph.getDotNotation());
- buffer.append("\n\n");
- }
- }
- return buffer.toString();
- }
-}
http://git-wip-us.apache.org/repos/asf/falcon/blob/8e49379d/client/src/main/resources/cluster-0.1.xsd
----------------------------------------------------------------------
diff --git a/client/src/main/resources/cluster-0.1.xsd b/client/src/main/resources/cluster-0.1.xsd
deleted file mode 100644
index 34e3689..0000000
--- a/client/src/main/resources/cluster-0.1.xsd
+++ /dev/null
@@ -1,211 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- 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.
- -->
-<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" attributeFormDefault="unqualified" elementFormDefault="qualified"
- targetNamespace="uri:falcon:cluster:0.1" xmlns="uri:falcon:cluster:0.1"
- xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" jaxb:version="2.1">
- <xs:annotation>
- <xs:documentation>
- 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.
- </xs:documentation>
- <xs:appinfo>
- <jaxb:schemaBindings>
- <jaxb:package name="org.apache.falcon.entity.v0.cluster"/>
- </jaxb:schemaBindings>
- </xs:appinfo>
- </xs:annotation>
- <xs:element name="cluster" type="cluster">
- </xs:element>
- <xs:complexType name="cluster">
- <xs:annotation>
- <xs:documentation>The cluster contains the definition of different
- interfaces which are used by Falcon like readonly, write, workflow and messaging.
- A cluster is referenced by feeds and processes which are on-boarded
- to Falcon by its name.
- name: the name of cluster, which must be unique.
- colo: the name of the colo to which this cluster belongs to.
- </xs:documentation>
- </xs:annotation>
- <xs:sequence>
- <xs:element type="KEY_VALUE_PAIR" name="tags" minOccurs="0">
- <xs:annotation>
- <xs:documentation>
- tags: a process specifies an optional list of comma separated tags,
- Key Value Pairs, separated by comma,
- which is used for classification of processes.
- Example: consumer=consumer@xyz.com, owner=producer@xyz.com, department=forecasting
- </xs:documentation>
- </xs:annotation>
- </xs:element>
- <xs:element type="interfaces" name="interfaces"/>
- <xs:element type="locations" name="locations"/>
- <xs:element type="ACL" name="ACL" minOccurs="0" maxOccurs="1"/>
- <xs:element type="properties" name="properties" minOccurs="0"/>
- </xs:sequence>
- <xs:attribute type="IDENTIFIER" name="name" use="required"/>
- <xs:attribute type="xs:string" name="description"/>
- <xs:attribute type="xs:string" name="colo" use="required"/>
- </xs:complexType>
- <xs:complexType name="locations">
- <xs:annotation>
- <xs:documentation>A list of locations on cluster.
- </xs:documentation>
- </xs:annotation>
- <xs:sequence>
- <xs:element type="location" name="location" maxOccurs="unbounded" minOccurs="1"/>
- </xs:sequence>
- </xs:complexType>
- <xs:complexType name="property">
- <xs:annotation>
- <xs:documentation>
- A key-value pair, which are propagated to the
- workflow engine.
- Ideally the Mapred's job queue name (queueName) and
- JMS impl class nameof messaging engine (brokerImplClass)
- should be defined here.
- </xs:documentation>
- </xs:annotation>
- <xs:attribute type="xs:string" name="name" use="required"/>
- <xs:attribute type="xs:string" name="value" use="required"/>
- </xs:complexType>
- <xs:complexType name="interface">
- <xs:annotation>
- <xs:documentation>
- An interface specifies the interface type, Falcon uses it to schedule
- entities in workflow engine, to save and read data from hadoop and to
- publish messages to messaging engine.
- endpoint: is the url for each interface; examples: for write it is the
- url of hdfs (fs.defaultFS) and
- for workflow it is url of workflow engine like oozie.
- version: The current runtime version of each interface.
- </xs:documentation>
- </xs:annotation>
- <xs:attribute type="interfacetype" name="type" use="required"/>
- <xs:attribute type="xs:string" name="endpoint" use="required"/>
- <xs:attribute type="xs:string" name="version" use="required"/>
- </xs:complexType>
- <xs:complexType name="properties">
- <xs:annotation>
- <xs:documentation>
- A list of property elements.
- </xs:documentation>
- </xs:annotation>
- <xs:sequence>
- <xs:element type="property" name="property" maxOccurs="unbounded" minOccurs="0"/>
- </xs:sequence>
- </xs:complexType>
- <xs:complexType name="location">
- <xs:annotation>
- <xs:documentation>
- Location has the name and the path.
- name: is the type of locations which can be
- staging, temp and working only.
- staging is a mandatory type.
- path: the hdfs path for each location.
- Falcon would use the location to do intermediate
- processing of entities in hdfs and hence Falcon
- should have read/write/execute permission on these
- locations.
- </xs:documentation>
- </xs:annotation>
- <xs:attribute type="cluster-location-type" name="name" use="required"/>
- <xs:attribute type="xs:string" name="path" use="required"/>
- </xs:complexType>
- <xs:complexType name="interfaces">
- <xs:annotation>
- <xs:documentation>
- A list of interfaces.
- </xs:documentation>
- </xs:annotation>
- <xs:sequence>
- <xs:element type="interface" name="interface" maxOccurs="unbounded" minOccurs="3"/>
- </xs:sequence>
- </xs:complexType>
- <xs:simpleType name="interfacetype">
- <xs:annotation>
- <xs:documentation>
- An interface has 6 different interface types: readonly, write,
- execute, workflow, messaging, registry.
- readonly specifies the hadoop's hftp address, it's endpoint is the value of
- dfs.http.address.ex: hftp://corp.namenode:50070/
- write specifies the interface to write to hdfs, it's endpoint is the value
- of fs.defaultFS ex: hdfs://corp.namenode:8020
- execute specifies the interface for job tracker, it's endpoint is the value
- of mapreduce.jobtracker.address. ex:corp.jt:8021
- workflow specifies the interface for workflow engine, example of it's
- endpoint is value for OOZIE_URL.ex: http://corp.oozie:11000/oozie
- messaging specifies the interface for sending feed availability messages, it's
- endpoint is broker url with tcp address.ex: tcp://corp.messaging:61616?daemon=true
- registry specifies the interface for Hcatalog.
- </xs:documentation>
- </xs:annotation>
- <xs:restriction base="xs:string">
- <xs:enumeration value="readonly"/>
- <xs:enumeration value="write"/>
- <xs:enumeration value="execute"/>
- <xs:enumeration value="workflow"/>
- <xs:enumeration value="messaging"/>
- <xs:enumeration value="registry"/>
- </xs:restriction>
- </xs:simpleType>
- <xs:simpleType name="IDENTIFIER">
- <xs:restriction base="xs:string">
- <xs:pattern value="(([a-zA-Z]([\-a-zA-Z0-9])*){1,39})"/>
- </xs:restriction>
- </xs:simpleType>
- <xs:simpleType name="KEY_VALUE_PAIR">
- <xs:restriction base="xs:string">
- <xs:pattern value="([\w_]+=[^,]+)?([,]?[ ]*[\w_]+=[^,]+)*"/>
- </xs:restriction>
- </xs:simpleType>
- <xs:complexType name="ACL">
- <xs:annotation>
- <xs:documentation>
- Access control list for this cluster.
- owner is the Owner of this entity.
- group is the one which has access to read - not used at this time.
- permission is not enforced at this time
- </xs:documentation>
- </xs:annotation>
- <xs:attribute type="xs:string" name="owner"/>
- <xs:attribute type="xs:string" name="group"/>
- <xs:attribute type="xs:string" name="permission" default="*"/>
- </xs:complexType>
- <xs:simpleType name="cluster-location-type">
- <xs:restriction base="xs:string">
- <xs:enumeration value="staging"/>
- <xs:enumeration value="working"/>
- <xs:enumeration value="temp"/>
- </xs:restriction>
- </xs:simpleType>
-</xs:schema>
http://git-wip-us.apache.org/repos/asf/falcon/blob/8e49379d/client/src/main/resources/datasource-0.1.xsd
----------------------------------------------------------------------
diff --git a/client/src/main/resources/datasource-0.1.xsd b/client/src/main/resources/datasource-0.1.xsd
deleted file mode 100644
index 1202ba1..0000000
--- a/client/src/main/resources/datasource-0.1.xsd
+++ /dev/null
@@ -1,276 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- 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.
- -->
-
-<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" attributeFormDefault="unqualified" elementFormDefault="qualified"
- targetNamespace="uri:falcon:datasource:0.1" xmlns="uri:falcon:datasource:0.1"
- xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" jaxb:version="2.1">
- <xs:annotation>
- <xs:documentation>
- 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.
- </xs:documentation>
- <xs:appinfo>
- <jaxb:schemaBindings>
- <jaxb:package name="org.apache.falcon.entity.v0.datasource"/>
- </jaxb:schemaBindings>
- </xs:appinfo>
- </xs:annotation>
- <xs:element name="datasource" type="datasource">
- </xs:element>
- <xs:complexType name="datasource">
- <xs:annotation>
- <xs:documentation>The datasource contains various information required
- to connect to a data source like a MySQL datasource or Kafka cluster.
- A datasource is referenced by feeds that represent an object like
- Table (or Topic) in the MySQL database (or Kafka Cluster).
- name: the name of datasource, which must be unique.
- colo: the name of the colo to which this datasource belongs to.
- </xs:documentation>
- </xs:annotation>
- <xs:sequence>
- <xs:element type="KEY_VALUE_PAIR" name="tags" minOccurs="0" maxOccurs="1">
- <xs:annotation>
- <xs:documentation>
- tags: a process specifies an optional list of comma separated tags,
- Key Value Pairs, separated by comma,
- which is used for classification of datasource entity.
- Example: consumer=consumer@xyz.com, owner=producer@xyz.com, department=forecasting
- </xs:documentation>
- </xs:annotation>
- </xs:element>
- <xs:element type="interfaces" name="interfaces"/>
- <xs:element type="driver" name="driver" minOccurs="1" maxOccurs="1" />
- <xs:element type="properties" name="properties" minOccurs="0"/>
- <xs:element type="ACL" name="ACL" minOccurs="0" maxOccurs="1"/>
- </xs:sequence>
- <xs:attribute type="IDENTIFIER" name="name" use="required"/>
- <xs:attribute type="xs:string" name="colo" use="required"/>
- <xs:attribute type="xs:string" name="description"/>
- <xs:attribute type="datasource-type" name="type" use="required">
- <xs:annotation>
- <xs:documentation>
- datasource type could be Relational Databases (MySQL, Oracle etc.), Messgaing systems like
- Kafka, etc.
- </xs:documentation>
- </xs:annotation>
- </xs:attribute>
- </xs:complexType>
- <xs:complexType name="property">
- <xs:annotation>
- <xs:documentation>
- A key-value pair to pass in any datasource specific properties.
- </xs:documentation>
- </xs:annotation>
- <xs:attribute type="xs:string" name="name" use="required"/>
- <xs:attribute type="xs:string" name="value" use="required"/>
- </xs:complexType>
- <xs:complexType name="interface">
- <xs:annotation>
- <xs:documentation>
- An interface specifies the interface type (read or write), and an
- endpoint url. Falcon uses these endpoints to import or export
- data from datasources.
- </xs:documentation>
- </xs:annotation>
- <xs:sequence>
- <xs:element type="driver" name="driver" minOccurs="0" maxOccurs="1" />
- <xs:element type="credential" name="credential" minOccurs="0" maxOccurs="1"/>
- <xs:element type="properties" name="properties" minOccurs="0"/>
- </xs:sequence>
- <xs:attribute type="interfacetype" name="type" use="required"/>
- <xs:attribute type="xs:string" name="endpoint" use="required"/>
- </xs:complexType>
- <xs:complexType name="properties">
- <xs:annotation>
- <xs:documentation>
- A list of property elements.
- </xs:documentation>
- </xs:annotation>
- <xs:sequence>
- <xs:element type="property" name="property" maxOccurs="unbounded" minOccurs="0"/>
- </xs:sequence>
- </xs:complexType>
- <xs:complexType name="interfaces">
- <xs:annotation>
- <xs:documentation>
- A list of interfaces.
- </xs:documentation>
- </xs:annotation>
- <xs:sequence>
- <xs:element type="interface" name="interface" maxOccurs="2" minOccurs="1"/>
- <xs:element type="credential" name="credential" minOccurs="0" maxOccurs="1"/>
- </xs:sequence>
- </xs:complexType>
- <xs:simpleType name="interfacetype">
- <xs:annotation>
- <xs:documentation>
- An interface for datasource has 2 different interface types: readonly, write.
- The readonly endpoint specifies the url/mechanism to use for data IMPORT operation
- from a datasource while write endpoint specifies the url/mechanism to use for data
- EXPORT operatrion.
- </xs:documentation>
- </xs:annotation>
- <xs:restriction base="xs:string">
- <xs:enumeration value="readonly"/>
- <xs:enumeration value="write"/>
- </xs:restriction>
- </xs:simpleType>
- <xs:simpleType name="IDENTIFIER">
- <xs:restriction base="xs:string">
- <xs:pattern value="(([a-zA-Z]([\-a-zA-Z0-9])*){1,39})"/>
- </xs:restriction>
- </xs:simpleType>
- <xs:simpleType name="KEY_VALUE_PAIR">
- <xs:restriction base="xs:string">
- <xs:pattern value="([\w_]+=[^,]+)?([,]?[ ]*[\w_]+=[^,]+)*"/>
- </xs:restriction>
- </xs:simpleType>
- <xs:complexType name="credential">
- <xs:sequence minOccurs="1" maxOccurs="1" >
- <xs:element name="userName" minOccurs="1" maxOccurs="1" type="xs:string">
- <xs:annotation>
- <xs:documentation>
- The User for the datasource.
- </xs:documentation>
- </xs:annotation>
- </xs:element>
-
- <xs:choice minOccurs="1" maxOccurs="1">
- <xs:element name="passwordFile" type="xs:string">
- <xs:annotation>
- <xs:documentation>
- The FQ path to a file on HDFS containing the datasource
- server password with 400 permissions. Only the user
- submitting the job has read access to this file which
- will be securely passed to the mappers.
- </xs:documentation>
- </xs:annotation>
- </xs:element>
- <xs:element name="passwordText" type="xs:string">
- <xs:annotation>
- <xs:documentation>
- Plain text password.
- </xs:documentation>
- </xs:annotation>
- </xs:element>
- <xs:element name="passwordAlias" type="passwordAliasType">
- <xs:annotation>
- <xs:documentation>
- Password alias using hadoop credential store.
- </xs:documentation>
- </xs:annotation>
- </xs:element>
- </xs:choice>
- </xs:sequence>
- <xs:attribute name="type" type="credentialtype" use="required"/>
- </xs:complexType>
- <xs:complexType name="passwordAliasType">
- <xs:sequence minOccurs="1" maxOccurs="1">
- <xs:element name="alias" type="xs:string">
- <xs:annotation>
- <xs:documentation> Provide password alias. </xs:documentation>
- </xs:annotation>
- </xs:element>
- <xs:element name="providerPath" type="xs:string">
- <xs:annotation>
- <xs:documentation>jceks provider HDFS file path </xs:documentation>
- </xs:annotation>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- <xs:simpleType name="credentialtype">
- <xs:annotation>
- <xs:documentation>
- user-password credentials are supported today which can be extended.
- </xs:documentation>
- </xs:annotation>
- <xs:restriction base="xs:string">
- <xs:enumeration value="password-file" />
- <xs:enumeration value="password-text" />
- <xs:enumeration value="password-alias" />
- </xs:restriction>
- </xs:simpleType>
-
- <xs:simpleType name="datasource-type">
- <xs:annotation>
- <xs:documentation>
- The datasource type can be MySQL, ORACLE, Teradata etc.
- </xs:documentation>
- </xs:annotation>
- <xs:restriction base="xs:string">
- <xs:enumeration value="mysql"/>
- <xs:enumeration value="oracle"/>
- <xs:enumeration value="hsql"/>
- </xs:restriction>
- </xs:simpleType>
-
- <xs:complexType name="driver">
- <xs:annotation>
- <xs:documentation>
- Driver information.
- </xs:documentation>
- </xs:annotation>
- <xs:sequence minOccurs="1" maxOccurs="1">
- <xs:element type="xs:string" name="clazz" minOccurs="1" maxOccurs="1">
- <xs:annotation>
- <xs:documentation>
- Fully qualified class name for the datasource driver used
- for validating the datasource connection in Falcon.
- </xs:documentation>
- </xs:annotation>
- </xs:element>
- <xs:element type="xs:string" name="jar" minOccurs="1" maxOccurs="unbounded">
- <xs:annotation>
- <xs:documentation>
- Path to the connector jar files on HDFS thats shipped with the workflow.
- You'd need to put the connector jar files in oozie sharelib and since this
- is using all the latest features in sqoop 1.x, requires 1.5 snapshot.
- </xs:documentation>
- </xs:annotation>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- <xs:complexType name="ACL">
- <xs:annotation>
- <xs:documentation>
- Access control list for this cluster.
- owner is the Owner of this entity.
- group is the one which has access to read - not used at this time.
- permission is not enforced at this time
- </xs:documentation>
- </xs:annotation>
- <xs:attribute type="xs:string" name="owner"/>
- <xs:attribute type="xs:string" name="group"/>
- <xs:attribute type="xs:string" name="permission" default="*"/>
- </xs:complexType>
-</xs:schema>