falcon-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From venkat...@apache.org
Subject [3/3] git commit: FALCON-849 Metadata Rest API throws "500 : Unauthorized Resource" error. Contributed by Balu Vellanki
Date Mon, 03 Nov 2014 19:23:40 GMT
FALCON-849 Metadata Rest API throws "500 : Unauthorized Resource" error. Contributed by Balu Vellanki


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

Branch: refs/heads/master
Commit: 82cea4fb9a5f0b26d215bdb25860a4ba8905a196
Parents: a497754
Author: Venkatesh Seetharam <venkatesh@apache.org>
Authored: Mon Nov 3 11:24:11 2014 -0800
Committer: Venkatesh Seetharam <venkatesh@apache.org>
Committed: Mon Nov 3 11:24:11 2014 -0800

----------------------------------------------------------------------
 .../java/org/apache/falcon/cli/FalconCLI.java   | 106 -------------------
 .../apache/falcon/cli/FalconMetadataCLI.java    |  98 +++++++++++++++--
 .../org/apache/falcon/client/FalconClient.java  |  54 ++++------
 .../security/DefaultAuthorizationProvider.java  |  10 +-
 .../DefaultAuthorizationProviderTest.java       |   2 +-
 docs/src/site/twiki/FalconCLI.twiki             |  65 ++++++------
 .../site/twiki/restapi/AdjacentVertices.twiki   |   6 +-
 docs/src/site/twiki/restapi/AllEdges.twiki      |   4 +-
 docs/src/site/twiki/restapi/AllVertices.twiki   |   4 +-
 docs/src/site/twiki/restapi/Edge.twiki          |   4 +-
 docs/src/site/twiki/restapi/Graph.twiki         |   4 +-
 docs/src/site/twiki/restapi/MetadataList.twiki  |   4 +-
 .../site/twiki/restapi/MetadataRelations.twiki  |   4 +-
 docs/src/site/twiki/restapi/ResourceList.twiki  |  34 +++---
 docs/src/site/twiki/restapi/Vertex.twiki        |   4 +-
 .../site/twiki/restapi/VertexProperties.twiki   |   4 +-
 docs/src/site/twiki/restapi/Vertices.twiki      |   4 +-
 .../metadata/LineageMetadataResource.java       |  18 ++--
 .../metadata/MetadataDiscoveryResource.java     |   6 +-
 .../security/FalconAuthorizationFilter.java     |  25 +----
 .../security/FalconAuthorizationFilterTest.java |   6 +-
 .../org/apache/falcon/cli/FalconCLISmokeIT.java |   2 +-
 .../resource/MetadataResourceJerseyIT.java      |  10 +-
 23 files changed, 215 insertions(+), 263 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/82cea4fb/client/src/main/java/org/apache/falcon/cli/FalconCLI.java
----------------------------------------------------------------------
diff --git a/client/src/main/java/org/apache/falcon/cli/FalconCLI.java b/client/src/main/java/org/apache/falcon/cli/FalconCLI.java
index 89fed4f..01f3480 100644
--- a/client/src/main/java/org/apache/falcon/cli/FalconCLI.java
+++ b/client/src/main/java/org/apache/falcon/cli/FalconCLI.java
@@ -110,19 +110,6 @@ public class FalconCLI {
     public static final String PARARMS_OPT = "params";
     public static final String LISTING_OPT = "listing";
 
-    // Graph Commands
-    public static final String GRAPH_CMD = "graph";
-    public static final String VERTEX_CMD = "vertex";
-    public static final String VERTICES_CMD = "vertices";
-    public static final String VERTEX_EDGES_CMD = "edges";
-
-    // Graph Command Options
-    public static final String EDGE_CMD = "edge";
-    public static final String ID_OPT = "id";
-    public static final String KEY_OPT = "key";
-    public static final String VALUE_OPT = "value";
-    public static final String DIRECTION_OPT = "direction";
-
     // Recipe Command
     public static final String RECIPE_CMD = "recipe";
     public static final String RECIPE_NAME = "name";
@@ -175,7 +162,6 @@ public class FalconCLI {
         parser.addCommand(INSTANCE_CMD, "",
                 "Process instances operations like running, status, kill, suspend, resume, rerun, logs",
                 instanceOptions(), false);
-        parser.addCommand(GRAPH_CMD, "", "graph operations", createGraphOptions(), true);
         parser.addCommand(METADATA_CMD, "", "Metadata operations like list, relations",
                 metadataCLI.createMetadataOptions(), true);
         parser.addCommand(RECIPE_CMD, "", "recipe operations", createRecipeOptions(), true);
@@ -196,8 +182,6 @@ public class FalconCLI {
                     entityCommand(commandLine, client);
                 } else if (command.getName().equals(INSTANCE_CMD)) {
                     instanceCommand(commandLine, client);
-                } else if (command.getName().equals(GRAPH_CMD)) {
-                    graphCommand(commandLine, client);
                 } else if (command.getName().equals(METADATA_CMD)) {
                     metadataCLI.metadataCommand(commandLine, client);
                 } else if (command.getName().equals(RECIPE_CMD)) {
@@ -790,38 +774,6 @@ public class FalconCLI {
         return instanceOptions;
     }
 
-    private Options createGraphOptions() {
-        Options graphOptions = new Options();
-        Option url = new Option(URL_OPTION, true, "Falcon URL");
-        graphOptions.addOption(url);
-
-        Option vertex = new Option(VERTEX_CMD, false, "show the vertices");
-        Option vertices = new Option(VERTICES_CMD, false, "show the vertices");
-        Option vertexEdges = new Option(VERTEX_EDGES_CMD, false, "show the edges for a given vertex");
-        Option edges = new Option(EDGE_CMD, false, "show the edges");
-
-        OptionGroup group = new OptionGroup();
-        group.addOption(vertex);
-        group.addOption(vertices);
-        group.addOption(vertexEdges);
-        group.addOption(edges);
-        graphOptions.addOptionGroup(group);
-
-        Option id = new Option(ID_OPT, true, "vertex or edge id");
-        graphOptions.addOption(id);
-
-        Option key = new Option(KEY_OPT, true, "key property");
-        graphOptions.addOption(key);
-
-        Option value = new Option(VALUE_OPT, true, "value property");
-        graphOptions.addOption(value);
-
-        Option direction = new Option(DIRECTION_OPT, true, "edge direction property");
-        graphOptions.addOption(direction);
-
-        return graphOptions;
-    }
-
     private Options createRecipeOptions() {
         Options recipeOptions = new Options();
         Option url = new Option(URL_OPTION, true, "Falcon URL");
@@ -836,64 +788,6 @@ public class FalconCLI {
         return recipeOptions;
     }
 
-    private void graphCommand(CommandLine commandLine,
-                              FalconClient client) throws FalconCLIException {
-        Set<String> optionsList = new HashSet<String>();
-        for (Option option : commandLine.getOptions()) {
-            optionsList.add(option.getOpt());
-        }
-
-        String result;
-        String id = commandLine.getOptionValue(ID_OPT);
-        String key = commandLine.getOptionValue(KEY_OPT);
-        String value = commandLine.getOptionValue(VALUE_OPT);
-        String direction = commandLine.getOptionValue(DIRECTION_OPT);
-
-        if (optionsList.contains(VERTEX_CMD)) {
-            validateId(id);
-            result = client.getVertex(id);
-        } else if (optionsList.contains(VERTICES_CMD)) {
-            validateVerticesCommand(key, value);
-            result = client.getVertices(key, value);
-        } else if (optionsList.contains(VERTEX_EDGES_CMD)) {
-            validateVertexEdgesCommand(id, direction);
-            result = client.getVertexEdges(id, direction);
-        } else if (optionsList.contains(EDGE_CMD)) {
-            validateId(id);
-            result = client.getEdge(id);
-        } else {
-            throw new FalconCLIException("Invalid command");
-        }
-
-        OUT.get().println(result);
-    }
-
-    private void validateId(String id) throws FalconCLIException {
-        if (id == null || id.length() == 0) {
-            throw new FalconCLIException("Missing argument: id");
-        }
-    }
-
-    private void validateVerticesCommand(String key, String value) throws FalconCLIException {
-        if (key == null || key.length() == 0) {
-            throw new FalconCLIException("Missing argument: key");
-        }
-
-        if (value == null || value.length() == 0) {
-            throw new FalconCLIException("Missing argument: value");
-        }
-    }
-
-    private void validateVertexEdgesCommand(String id, String direction) throws FalconCLIException {
-        if (id == null || id.length() == 0) {
-            throw new FalconCLIException("Missing argument: id");
-        }
-
-        if (direction == null || direction.length() == 0) {
-            throw new FalconCLIException("Missing argument: direction");
-        }
-    }
-
     protected String getFalconEndpoint(CommandLine commandLine) throws FalconCLIException, IOException {
         String url = commandLine.getOptionValue(URL_OPTION);
         if (url == null) {

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/82cea4fb/client/src/main/java/org/apache/falcon/cli/FalconMetadataCLI.java
----------------------------------------------------------------------
diff --git a/client/src/main/java/org/apache/falcon/cli/FalconMetadataCLI.java b/client/src/main/java/org/apache/falcon/cli/FalconMetadataCLI.java
index b0342f0..63af415 100644
--- a/client/src/main/java/org/apache/falcon/cli/FalconMetadataCLI.java
+++ b/client/src/main/java/org/apache/falcon/cli/FalconMetadataCLI.java
@@ -39,6 +39,8 @@ public class FalconMetadataCLI {
 
     public static final AtomicReference<PrintStream> OUT = new AtomicReference<PrintStream>(System.out);
 
+    // Discovery Commands
+    public static final String DISCOVERY_OPT = "discovery";
     public static final String LIST_OPT = "list";
     public static final String RELATIONS_OPT = "relations";
 
@@ -47,6 +49,19 @@ public class FalconMetadataCLI {
     public static final String CLUSTER_OPT = "cluster";
     public static final String NAME_OPT = "name";
 
+    // Lineage Commands
+    public static final String LINEAGE_OPT = "lineage";
+    public static final String VERTEX_CMD = "vertex";
+    public static final String VERTICES_CMD = "vertices";
+    public static final String VERTEX_EDGES_CMD = "edges";
+
+    public static final String EDGE_CMD = "edge";
+    public static final String ID_OPT = "id";
+    public static final String KEY_OPT = "key";
+    public static final String VALUE_OPT = "value";
+    public static final String DIRECTION_OPT = "direction";
+
+
     public FalconMetadataCLI() {}
 
     public void metadataCommand(CommandLine commandLine, FalconClient client) throws FalconCLIException {
@@ -55,18 +70,36 @@ public class FalconMetadataCLI {
             optionsList.add(option.getOpt());
         }
 
-        String result = null;
+        String result;
         String dimensionType = commandLine.getOptionValue(TYPE_OPT);
         String cluster = commandLine.getOptionValue(CLUSTER_OPT);
         String dimensionName = commandLine.getOptionValue(NAME_OPT);
-
-        validateDimensionType(dimensionType.toUpperCase());
+        String id = commandLine.getOptionValue(ID_OPT);
+        String key = commandLine.getOptionValue(KEY_OPT);
+        String value = commandLine.getOptionValue(VALUE_OPT);
+        String direction = commandLine.getOptionValue(DIRECTION_OPT);
 
         if (optionsList.contains(LIST_OPT)) {
+            validateDimensionType(dimensionType.toUpperCase());
             result = client.getDimensionList(dimensionType, cluster);
         } else if (optionsList.contains(RELATIONS_OPT)) {
+            validateDimensionType(dimensionType.toUpperCase());
             validateDimensionName(dimensionName, RELATIONS_OPT);
             result = client.getDimensionRelations(dimensionType, dimensionName);
+        } else if (optionsList.contains(VERTEX_CMD)) {
+            validateId(id);
+            result = client.getVertex(id);
+        } else if (optionsList.contains(VERTICES_CMD)) {
+            validateVerticesCommand(key, value);
+            result = client.getVertices(key, value);
+        } else if (optionsList.contains(VERTEX_EDGES_CMD)) {
+            validateVertexEdgesCommand(id, direction);
+            result = client.getVertexEdges(id, direction);
+        } else if (optionsList.contains(EDGE_CMD)) {
+            validateId(id);
+            result = client.getEdge(id);
+        } else {
+            throw new FalconCLIException("Invalid metadata command");
         }
 
         OUT.get().println(result);
@@ -90,26 +123,79 @@ public class FalconMetadataCLI {
         }
     }
 
+    private void validateId(String id) throws FalconCLIException {
+        if (id == null || id.length() == 0) {
+            throw new FalconCLIException("Missing argument: id");
+        }
+    }
+
+    private void validateVerticesCommand(String key, String value) throws FalconCLIException {
+        if (key == null || key.length() == 0) {
+            throw new FalconCLIException("Missing argument: key");
+        }
+
+        if (value == null || value.length() == 0) {
+            throw new FalconCLIException("Missing argument: value");
+        }
+    }
+
+    private void validateVertexEdgesCommand(String id, String direction) throws FalconCLIException {
+        if (id == null || id.length() == 0) {
+            throw new FalconCLIException("Missing argument: id");
+        }
+
+        if (direction == null || direction.length() == 0) {
+            throw new FalconCLIException("Missing argument: direction");
+        }
+    }
+
     public Options createMetadataOptions() {
         Options metadataOptions = new Options();
 
         OptionGroup group = new OptionGroup();
+        Option discovery = new Option(DISCOVERY_OPT, false, "Discover falcon metadata relations");
+        Option lineage = new Option(LINEAGE_OPT, false, "Get falcon metadata lineage information");
+        group.addOption(discovery);
+        group.addOption(lineage);
+        metadataOptions.addOptionGroup(group);
+
+        // Add discovery options
+
         Option list = new Option(LIST_OPT, false, "List all dimensions");
         Option relations = new Option(RELATIONS_OPT, false, "List all relations for a dimension");
-        group.addOption(list);
-        group.addOption(relations);
+        metadataOptions.addOption(list);
+        metadataOptions.addOption(relations);
 
         Option url = new Option(URL_OPTION, true, "Falcon URL");
         Option type = new Option(TYPE_OPT, true, "Dimension type");
         Option name = new Option(NAME_OPT, true, "Dimension name");
         Option cluster = new Option(CLUSTER_OPT, true, "Cluster name");
 
-        metadataOptions.addOptionGroup(group);
+        // Add lineage options
+
         metadataOptions.addOption(url);
         metadataOptions.addOption(type);
         metadataOptions.addOption(cluster);
         metadataOptions.addOption(name);
 
+        Option vertex = new Option(VERTEX_CMD, false, "show the vertices");
+        Option vertices = new Option(VERTICES_CMD, false, "show the vertices");
+        Option vertexEdges = new Option(VERTEX_EDGES_CMD, false, "show the edges for a given vertex");
+        Option edges = new Option(EDGE_CMD, false, "show the edges");
+        Option id = new Option(ID_OPT, true, "vertex or edge id");
+        Option key = new Option(KEY_OPT, true, "key property");
+        Option value = new Option(VALUE_OPT, true, "value property");
+        Option direction = new Option(DIRECTION_OPT, true, "edge direction property");
+
+        metadataOptions.addOption(vertex);
+        metadataOptions.addOption(vertices);
+        metadataOptions.addOption(vertexEdges);
+        metadataOptions.addOption(edges);
+        metadataOptions.addOption(id);
+        metadataOptions.addOption(key);
+        metadataOptions.addOption(value);
+        metadataOptions.addOption(direction);
+
         return metadataOptions;
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/82cea4fb/client/src/main/java/org/apache/falcon/client/FalconClient.java
----------------------------------------------------------------------
diff --git a/client/src/main/java/org/apache/falcon/client/FalconClient.java b/client/src/main/java/org/apache/falcon/client/FalconClient.java
index 576ca09..4872140 100644
--- a/client/src/main/java/org/apache/falcon/client/FalconClient.java
+++ b/client/src/main/java/org/apache/falcon/client/FalconClient.java
@@ -205,12 +205,14 @@ public class FalconClient {
     }
 
     /**
-     * Methods allowed on Metadata Resources.
+     * Methods allowed on Metadata Discovery Resources.
      */
     protected static enum MetadataOperations {
 
-        LIST("api/metadata/", HttpMethod.GET, MediaType.APPLICATION_JSON),
-        RELATIONS("api/metadata/", HttpMethod.GET, MediaType.APPLICATION_JSON);
+        LIST("api/metadata/discovery/", HttpMethod.GET, MediaType.APPLICATION_JSON),
+        RELATIONS("api/metadata/discovery/", HttpMethod.GET, MediaType.APPLICATION_JSON),
+        VERTICES("api/metadata/lineage/vertices", HttpMethod.GET, MediaType.APPLICATION_JSON),
+        EDGES("api/metadata/lineage/edges", HttpMethod.GET, MediaType.APPLICATION_JSON);
 
         private String path;
         private String method;
@@ -513,11 +515,11 @@ public class FalconClient {
     }
 
     public String getDimensionList(String dimensionType, String cluster) throws FalconCLIException {
-        return sendMetadataRequest(MetadataOperations.LIST, dimensionType, null, cluster);
+        return sendMetadataDiscoveryRequest(MetadataOperations.LIST, dimensionType, null, cluster);
     }
 
     public String getDimensionRelations(String dimensionType, String dimensionName) throws FalconCLIException {
-        return sendMetadataRequest(MetadataOperations.RELATIONS, dimensionType, dimensionName, null);
+        return sendMetadataDiscoveryRequest(MetadataOperations.RELATIONS, dimensionType, dimensionName, null);
     }
 
     /**
@@ -803,10 +805,10 @@ public class FalconClient {
         return parseStringResult(clientResponse);
     }
 
-    private String sendMetadataRequest(final MetadataOperations operation,
-                                       final String dimensionType,
-                                       final String dimensionName,
-                                       final String cluster) throws FalconCLIException {
+    private String sendMetadataDiscoveryRequest(final MetadataOperations operation,
+                                                final String dimensionType,
+                                                final String dimensionName,
+                                                final String cluster) throws FalconCLIException {
         WebResource resource;
         switch (operation) {
         case LIST:
@@ -1055,36 +1057,20 @@ public class FalconClient {
         return sb.toString();
     }
 
-    protected static enum GraphOperations {
-
-        VERTICES("api/graphs/lineage/vertices", HttpMethod.GET, MediaType.APPLICATION_JSON),
-        EDGES("api/graphs/lineage/edges", HttpMethod.GET, MediaType.APPLICATION_JSON);
-
-        private String path;
-        private String method;
-        private String mimeType;
-
-        GraphOperations(String path, String method, String mimeType) {
-            this.path = path;
-            this.method = method;
-            this.mimeType = mimeType;
-        }
-    }
-
     public String getVertex(String id) throws FalconCLIException {
-        return sendGraphRequest(GraphOperations.VERTICES, id);
+        return sendMetadataLineageRequest(MetadataOperations.VERTICES, id);
     }
 
     public String getVertices(String key, String value) throws FalconCLIException {
-        return sendGraphRequest(GraphOperations.VERTICES, key, value);
+        return sendMetadataLineageRequest(MetadataOperations.VERTICES, key, value);
     }
 
     public String getVertexEdges(String id, String direction) throws FalconCLIException {
-        return sendGraphRequestForEdges(GraphOperations.VERTICES, id, direction);
+        return sendMetadataLineageRequestForEdges(MetadataOperations.VERTICES, id, direction);
     }
 
     public String getEdge(String id) throws FalconCLIException {
-        return sendGraphRequest(GraphOperations.EDGES, id);
+        return sendMetadataLineageRequest(MetadataOperations.EDGES, id);
     }
 
     public String submitRecipe(String recipeName,
@@ -1140,7 +1126,7 @@ public class FalconClient {
         }
     }
 
-    private String sendGraphRequest(GraphOperations job, String id) throws FalconCLIException {
+    private String sendMetadataLineageRequest(MetadataOperations job, String id) throws FalconCLIException {
         ClientResponse clientResponse = service.path(job.path)
                 .path(id)
                 .header("Cookie", AUTH_COOKIE_EQ + authenticationToken)
@@ -1150,8 +1136,8 @@ public class FalconClient {
         return parseStringResult(clientResponse);
     }
 
-    private String sendGraphRequest(GraphOperations job, String key,
-                                    String value) throws FalconCLIException {
+    private String sendMetadataLineageRequest(MetadataOperations job, String key,
+                                              String value) throws FalconCLIException {
         ClientResponse clientResponse = service.path(job.path)
                 .queryParam("key", key)
                 .queryParam("value", value)
@@ -1162,8 +1148,8 @@ public class FalconClient {
         return parseStringResult(clientResponse);
     }
 
-    private String sendGraphRequestForEdges(GraphOperations job, String id,
-                                            String direction) throws FalconCLIException {
+    private String sendMetadataLineageRequestForEdges(MetadataOperations job, String id,
+                                                      String direction) throws FalconCLIException {
         ClientResponse clientResponse = service.path(job.path)
                 .path(id)
                 .path(direction)

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/82cea4fb/common/src/main/java/org/apache/falcon/security/DefaultAuthorizationProvider.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/falcon/security/DefaultAuthorizationProvider.java b/common/src/main/java/org/apache/falcon/security/DefaultAuthorizationProvider.java
index a5af2c1..50e4e78 100644
--- a/common/src/main/java/org/apache/falcon/security/DefaultAuthorizationProvider.java
+++ b/common/src/main/java/org/apache/falcon/security/DefaultAuthorizationProvider.java
@@ -56,7 +56,7 @@ public class DefaultAuthorizationProvider implements AuthorizationProvider {
     private static final Logger LOG = LoggerFactory.getLogger(DefaultAuthorizationProvider.class);
 
     private static final Set<String> RESOURCES = new HashSet<String>(
-            Arrays.asList(new String[]{"admin", "entities", "instance", "lineage", }));
+            Arrays.asList(new String[]{"admin", "entities", "instance", "metadata", }));
 
     /**
      * Constant for the configuration property that indicates the prefix.
@@ -135,8 +135,8 @@ public class DefaultAuthorizationProvider implements AuthorizationProvider {
             }
         } else if ("entities".equals(resource) || "instance".equals(resource)) {
             authorizeEntityResource(proxyUgi, entityName, entityType, action);
-        } else if ("lineage".equals(resource)) {
-            authorizeLineageResource(proxyUgi.getShortUserName(), action);
+        } else if ("metadata".equals(resource)) {
+            authorizeMetadataResource(proxyUgi.getShortUserName(), action);
         }
     }
 
@@ -298,8 +298,8 @@ public class DefaultAuthorizationProvider implements AuthorizationProvider {
         }
     }
 
-    protected void authorizeLineageResource(String authenticatedUser, String action) {
+    protected void authorizeMetadataResource(String authenticatedUser, String action) {
         LOG.debug("User {} authorized for action {} ", authenticatedUser, action);
-        // todo - do nothing for now, read-only for all
+        // todo - read-only for all metadata but needs to be implemented
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/82cea4fb/common/src/test/java/org/apache/falcon/security/DefaultAuthorizationProviderTest.java
----------------------------------------------------------------------
diff --git a/common/src/test/java/org/apache/falcon/security/DefaultAuthorizationProviderTest.java b/common/src/test/java/org/apache/falcon/security/DefaultAuthorizationProviderTest.java
index 65effad..0a40359 100644
--- a/common/src/test/java/org/apache/falcon/security/DefaultAuthorizationProviderTest.java
+++ b/common/src/test/java/org/apache/falcon/security/DefaultAuthorizationProviderTest.java
@@ -396,6 +396,6 @@ public class DefaultAuthorizationProviderTest {
                 "admin", realUser, new String[]{"admin", });
 
         DefaultAuthorizationProvider provider = new DefaultAuthorizationProvider();
-        provider.authorizeResource("lineage", "vertices", null, null, proxyUgi);
+        provider.authorizeResource("metadata", "lineage", null, null, proxyUgi);
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/82cea4fb/docs/src/site/twiki/FalconCLI.twiki
----------------------------------------------------------------------
diff --git a/docs/src/site/twiki/FalconCLI.twiki b/docs/src/site/twiki/FalconCLI.twiki
index 01e6f1b..e5b2585 100644
--- a/docs/src/site/twiki/FalconCLI.twiki
+++ b/docs/src/site/twiki/FalconCLI.twiki
@@ -253,70 +253,50 @@ Usage:
 $FALCON_HOME/bin/falcon instance -type <<feed/process>> -name <<name>> -params -start "yyyy-MM-dd'T'HH:mm'Z'"
 
 
----++ Graphs Options
+---++ Metadata Lineage Options
 
 ---+++ Vertex
 
 Get the vertex with the specified id.
 
 Usage:
-$FALCON_HOME/bin/falcon graph -vertex -id <<id>>
+$FALCON_HOME/bin/falcon metadata -vertex -id <<id>>
 
 Example:
-$FALCON_HOME/bin/falcon graph -vertex -id 4
+$FALCON_HOME/bin/falcon metadata -vertex -id 4
 
 ---+++ Vertices
 
 Get all vertices for a key index given the specified value.
 
 Usage:
-$FALCON_HOME/bin/falcon graph -vertices -key <<key>> -value <<value>>
+$FALCON_HOME/bin/falcon metadata -vertices -key <<key>> -value <<value>>
 
 Example:
-$FALCON_HOME/bin/falcon graph -vertices -key type -value feed-instance
+$FALCON_HOME/bin/falcon metadata -vertices -key type -value feed-instance
 
 ---+++ Vertex Edges
 
 Get the adjacent vertices or edges of the vertex with the specified direction.
 
 Usage:
-$FALCON_HOME/bin/falcon graph -edges -id <<vertex-id>> -direction <<direction>>
+$FALCON_HOME/bin/falcon metadata -edges -id <<vertex-id>> -direction <<direction>>
 
 Example:
-$FALCON_HOME/bin/falcon graph -edges -id 4 -direction both
-$FALCON_HOME/bin/falcon graph -edges -id 4 -direction inE
+$FALCON_HOME/bin/falcon metadata -edges -id 4 -direction both
+$FALCON_HOME/bin/falcon metadata -edges -id 4 -direction inE
 
 ---+++ Edge
 
 Get the edge with the specified id.
 
 Usage:
-$FALCON_HOME/bin/falcon graph -edge -id <<id>>
+$FALCON_HOME/bin/falcon metadata -edge -id <<id>>
 
 Example:
-$FALCON_HOME/bin/falcon graph -edge -id Q9n-Q-5g
+$FALCON_HOME/bin/falcon metadata -edge -id Q9n-Q-5g
 
-
----++Admin Options
-
----+++Help
-
-Usage:
-$FALCON_HOME/bin/falcon admin -help
-
----+++Version
-
-Version returns the current version of Falcon installed.
-Usage:
-$FALCON_HOME/bin/falcon admin -version
-
----+++Status
-
-Status returns the current state of Falcon (running or stopped).
-Usage:
-$FALCON_HOME/bin/falcon admin -status
-
----++ Metadata Options
+---++ Metadata Discovery Options
 
 ---+++ List
 
@@ -334,11 +314,32 @@ $FALCON_HOME/bin/falcon metadata -list -type tags
 
 List all dimensions related to specified Dimension identified by dimension-type and dimension-name.
 Usage:
-$FALCON_HOME/bin/falcon metadata  -relations -type [cluster_entity|feed_entity|process_entity|user|colo|tags|groups|pipelines] -name <<Dimension Name>>
+$FALCON_HOME/bin/falcon metadata -relations -type [cluster_entity|feed_entity|process_entity|user|colo|tags|groups|pipelines] -name <<Dimension Name>>
 
 Example:
 $FALCON_HOME/bin/falcon metadata -relations -type process_entity -name sample-process
 
+
+---++Admin Options
+
+---+++Help
+
+Usage:
+$FALCON_HOME/bin/falcon admin -help
+
+---+++Version
+
+Version returns the current version of Falcon installed.
+Usage:
+$FALCON_HOME/bin/falcon admin -version
+
+---+++Status
+
+Status returns the current state of Falcon (running or stopped).
+Usage:
+$FALCON_HOME/bin/falcon admin -status
+
+
 ---++ Recipe Options
 
 ---+++ Submit Recipe

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/82cea4fb/docs/src/site/twiki/restapi/AdjacentVertices.twiki
----------------------------------------------------------------------
diff --git a/docs/src/site/twiki/restapi/AdjacentVertices.twiki b/docs/src/site/twiki/restapi/AdjacentVertices.twiki
index 1310665..44b4d70 100644
--- a/docs/src/site/twiki/restapi/AdjacentVertices.twiki
+++ b/docs/src/site/twiki/restapi/AdjacentVertices.twiki
@@ -1,4 +1,4 @@
----++  GET api/graphs/lineage/vertices/:id/:direction
+---++  GET api/metadata/lineage/vertices/:id/:direction
    * <a href="#Description">Description</a>
    * <a href="#Parameters">Parameters</a>
    * <a href="#Results">Results</a>
@@ -31,7 +31,7 @@ Adjacent vertices of the vertex for the specified direction.
 ---++ Examples
 ---+++ Rest Call
 <verbatim>
-GET http://localhost:15000/api/graphs/lineage/vertices/4/out
+GET http://localhost:15000/api/metadata/lineage/vertices/4/out
 </verbatim>
 ---+++ Result
 <verbatim>
@@ -51,7 +51,7 @@ GET http://localhost:15000/api/graphs/lineage/vertices/4/out
 
 ---+++ Rest Call
 <verbatim>
-GET http://localhost:15000/api/graphs/lineage/vertices/4/bothE
+GET http://localhost:15000/api/metadata/lineage/vertices/4/bothE
 </verbatim>
 ---+++ Result
 <verbatim>

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/82cea4fb/docs/src/site/twiki/restapi/AllEdges.twiki
----------------------------------------------------------------------
diff --git a/docs/src/site/twiki/restapi/AllEdges.twiki b/docs/src/site/twiki/restapi/AllEdges.twiki
index d51da06..2fb662e 100644
--- a/docs/src/site/twiki/restapi/AllEdges.twiki
+++ b/docs/src/site/twiki/restapi/AllEdges.twiki
@@ -1,4 +1,4 @@
----++  GET pi/graphs/lineage//edges/all
+---++  GET pi/metadata/lineage//edges/all
    * <a href="#Description">Description</a>
    * <a href="#Parameters">Parameters</a>
    * <a href="#Results">Results</a>
@@ -16,7 +16,7 @@ All edges in lineage graph.
 ---++ Examples
 ---+++ Rest Call
 <verbatim>
-GET http://localhost:15000/api/graphs/lineage/edges/all
+GET http://localhost:15000/api/metadata/lineage/edges/all
 </verbatim>
 ---+++ Result
 <verbatim>

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/82cea4fb/docs/src/site/twiki/restapi/AllVertices.twiki
----------------------------------------------------------------------
diff --git a/docs/src/site/twiki/restapi/AllVertices.twiki b/docs/src/site/twiki/restapi/AllVertices.twiki
index 9a64415..4b29afe 100644
--- a/docs/src/site/twiki/restapi/AllVertices.twiki
+++ b/docs/src/site/twiki/restapi/AllVertices.twiki
@@ -1,4 +1,4 @@
----++  GET api/graphs/lineage/vertices/all
+---++  GET api/metadata/lineage/vertices/all
    * <a href="#Description">Description</a>
    * <a href="#Parameters">Parameters</a>
    * <a href="#Results">Results</a>
@@ -16,7 +16,7 @@ All vertices in lineage graph.
 ---++ Examples
 ---+++ Rest Call
 <verbatim>
-GET http://localhost:15000/api/graphs/lineage/vertices/all
+GET http://localhost:15000/api/metadata/lineage/vertices/all
 </verbatim>
 ---+++ Result
 <verbatim>

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/82cea4fb/docs/src/site/twiki/restapi/Edge.twiki
----------------------------------------------------------------------
diff --git a/docs/src/site/twiki/restapi/Edge.twiki b/docs/src/site/twiki/restapi/Edge.twiki
index 4fa0874..be4f20e 100644
--- a/docs/src/site/twiki/restapi/Edge.twiki
+++ b/docs/src/site/twiki/restapi/Edge.twiki
@@ -1,4 +1,4 @@
----++  GET api/graphs/lineage/edges/:id
+---++  GET api/metadata/lineage/edges/:id
    * <a href="#Description">Description</a>
    * <a href="#Parameters">Parameters</a>
    * <a href="#Results">Results</a>
@@ -16,7 +16,7 @@ Edge with the specified id.
 ---++ Examples
 ---+++ Rest Call
 <verbatim>
-GET http://localhost:15000/api/graphs/lineage/edges/Q6t-c-5g
+GET http://localhost:15000/api/metadata/lineage/edges/Q6t-c-5g
 </verbatim>
 ---+++ Result
 <verbatim>

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/82cea4fb/docs/src/site/twiki/restapi/Graph.twiki
----------------------------------------------------------------------
diff --git a/docs/src/site/twiki/restapi/Graph.twiki b/docs/src/site/twiki/restapi/Graph.twiki
index 4850b10..6cf6faa 100644
--- a/docs/src/site/twiki/restapi/Graph.twiki
+++ b/docs/src/site/twiki/restapi/Graph.twiki
@@ -1,4 +1,4 @@
----++  GET api/graphs/lineage/serialize
+---++  GET api/metadata/lineage/serialize
    * <a href="#Description">Description</a>
    * <a href="#Parameters">Parameters</a>
    * <a href="#Results">Results</a>
@@ -16,7 +16,7 @@ Serialize graph to a file configured using *.falcon.graph.serialize.path in Cust
 ---++ Examples
 ---+++ Rest Call
 <verbatim>
-GET http://localhost:15000/api/graphs/lineage/serialize
+GET http://localhost:15000/api/metadata/lineage/serialize
 </verbatim>
 ---+++ Result
 None.

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/82cea4fb/docs/src/site/twiki/restapi/MetadataList.twiki
----------------------------------------------------------------------
diff --git a/docs/src/site/twiki/restapi/MetadataList.twiki b/docs/src/site/twiki/restapi/MetadataList.twiki
index b6da203..baf7d45 100644
--- a/docs/src/site/twiki/restapi/MetadataList.twiki
+++ b/docs/src/site/twiki/restapi/MetadataList.twiki
@@ -1,4 +1,4 @@
----++  GET api/metadata/:type/list
+---++  GET api/metadata/discovery/:type/list
    * <a href="#Description">Description</a>
    * <a href="#Parameters">Parameters</a>
    * <a href="#Results">Results</a>
@@ -18,7 +18,7 @@ List of dimensions that match requested type [and cluster].
 ---++ Examples
 ---+++ Rest Call
 <verbatim>
-GET http://localhost:15000/api/metadata/process_entity/list?cluster=primary-cluster
+GET http://localhost:15000/api/metadata/discovery/process_entity/list?cluster=primary-cluster
 </verbatim>
 ---+++ Result
 <verbatim>

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/82cea4fb/docs/src/site/twiki/restapi/MetadataRelations.twiki
----------------------------------------------------------------------
diff --git a/docs/src/site/twiki/restapi/MetadataRelations.twiki b/docs/src/site/twiki/restapi/MetadataRelations.twiki
index 015a57b..11eb4e0 100644
--- a/docs/src/site/twiki/restapi/MetadataRelations.twiki
+++ b/docs/src/site/twiki/restapi/MetadataRelations.twiki
@@ -1,4 +1,4 @@
----++  GET api/metadata/:dimension-type/:dimension-name/relations
+---++  GET api/metadata/discovery/:dimension-type/:dimension-name/relations
    * <a href="#Description">Description</a>
    * <a href="#Parameters">Parameters</a>
    * <a href="#Results">Results</a>
@@ -17,7 +17,7 @@ Get all relations of a specific dimension.
 ---++ Examples
 ---+++ Rest Call
 <verbatim>
-GET http://localhost:15000/api/metadata/process_entity/sample-process/relations
+GET http://localhost:15000/api/metadata/discovery/process_entity/sample-process/relations
 </verbatim>
 ---+++ Result
 <verbatim>

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/82cea4fb/docs/src/site/twiki/restapi/ResourceList.twiki
----------------------------------------------------------------------
diff --git a/docs/src/site/twiki/restapi/ResourceList.twiki b/docs/src/site/twiki/restapi/ResourceList.twiki
index d6a73f2..a87818b 100644
--- a/docs/src/site/twiki/restapi/ResourceList.twiki
+++ b/docs/src/site/twiki/restapi/ResourceList.twiki
@@ -66,20 +66,20 @@ See also: [[../Security.twiki][Security in Falcon]]
 | GET         | [[InstanceLogs][api/instance/logs/:entity-type/:entity-name]]               | Get logs of a given instance |
 | GET         | [[InstanceSummary][api/instance/summary/:entity-type/:entity-name]]         | Return summary of instances for an entity |
 
----++ REST Call on Lineage Graph
-
-| *Call Type* | *Resource*                                                                           | *Description*                                                                 |
-| GET         | [[Graph][api/graphs/lineage/serialize]]                                              | dump the graph                                                                |
-| GET         | [[AllVertices][api/graphs/lineage/vertices/all]]                                     | get all vertices                                                              |
-| GET         | [[Vertices][api/graphs/lineage/vertices?key=:key&value=:value]]                      | get all vertices for a key index                                              |
-| GET         | [[Vertex][api/graphs/lineage/vertices/:id]]                                          | get the vertex with the specified id                                          |
-| GET         | [[VertexProperties][api/graphs/lineage/vertices/properties/:id?relationships=:true]] | get the properties of the vertex with the specified id                        |
-| GET         | [[AdjacentVertices][api/graphs/lineage/vertices/:id/:direction]]                     | get the adjacent vertices or edges of the vertex with the specified direction |
-| GET         | [[AllEdges][api/graphs/lineage//edges/all]]                                          | get all edges                                                                 |
-| GET         | [[Edge][api/graphs/lineage/edges/:id]]                                               | get the edge with the specified id                                            |
-
----++ REST Call on Metadata Resource
-
-| *Call Type* | *Resource*                                                                           | *Description*                                                                 |
-| GET         | [[MetadataList][api/metadata/:dimension-type/list]]                                  | list of dimensions  |
-| GET         | [MetadataRelations][api/metadata/:dimension-type/:dimension-name/relations]]         | Return all relations of a dimension |
+---++ REST Call on Metadata Lineage Resource
+
+| *Call Type* | *Resource*                                                                             | *Description*                                                                 |
+| GET         | [[Graph][api/metadata/lineage/serialize]]                                              | dump the graph                                                                |
+| GET         | [[AllVertices][api/metadata/lineage/vertices/all]]                                     | get all vertices                                                              |
+| GET         | [[Vertices][api/metadata/lineage/vertices?key=:key&value=:value]]                      | get all vertices for a key index                                              |
+| GET         | [[Vertex][api/metadata/lineage/vertices/:id]]                                          | get the vertex with the specified id                                          |
+| GET         | [[VertexProperties][api/metadata/lineage/vertices/properties/:id?relationships=:true]] | get the properties of the vertex with the specified id                        |
+| GET         | [[AdjacentVertices][api/metadata/lineage/vertices/:id/:direction]]                     | get the adjacent vertices or edges of the vertex with the specified direction |
+| GET         | [[AllEdges][api/metadata/lineage/edges/all]]                                           | get all edges                                                                 |
+| GET         | [[Edge][api/metadata/lineage/edges/:id]]                                               | get the edge with the specified id                                            |
+
+---++ REST Call on Metadata Discovery Resource
+
+| *Call Type* | *Resource*                                                                                     | *Description*                                                                 |
+| GET         | [[MetadataList][api/metadata/discovery/:dimension-type/list]]                                  | list of dimensions  |
+| GET         | [MetadataRelations][api/metadata/discovery/:dimension-type/:dimension-name/relations]]         | Return all relations of a dimension |

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/82cea4fb/docs/src/site/twiki/restapi/Vertex.twiki
----------------------------------------------------------------------
diff --git a/docs/src/site/twiki/restapi/Vertex.twiki b/docs/src/site/twiki/restapi/Vertex.twiki
index 1102bee..ac2cebf 100644
--- a/docs/src/site/twiki/restapi/Vertex.twiki
+++ b/docs/src/site/twiki/restapi/Vertex.twiki
@@ -1,4 +1,4 @@
----++  GET api/graphs/lineage/vertices/:id
+---++  GET api/metadata/lineage/vertices/:id
    * <a href="#Description">Description</a>
    * <a href="#Parameters">Parameters</a>
    * <a href="#Results">Results</a>
@@ -16,7 +16,7 @@ Vertex with the specified id.
 ---++ Examples
 ---+++ Rest Call
 <verbatim>
-GET http://localhost:15000/api/graphs/lineage/vertices/4
+GET http://localhost:15000/api/metadata/lineage/vertices/4
 </verbatim>
 ---+++ Result
 <verbatim>

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/82cea4fb/docs/src/site/twiki/restapi/VertexProperties.twiki
----------------------------------------------------------------------
diff --git a/docs/src/site/twiki/restapi/VertexProperties.twiki b/docs/src/site/twiki/restapi/VertexProperties.twiki
index 68247ef..1d146cc 100644
--- a/docs/src/site/twiki/restapi/VertexProperties.twiki
+++ b/docs/src/site/twiki/restapi/VertexProperties.twiki
@@ -1,4 +1,4 @@
----++  GET api/graphs/lineage/vertices/properties/:id?relationships=:true
+---++  GET api/metadata/lineage/vertices/properties/:id?relationships=:true
    * <a href="#Description">Description</a>
    * <a href="#Parameters">Parameters</a>
    * <a href="#Results">Results</a>
@@ -17,7 +17,7 @@ Gets the properties of the vertex with specified id.
 ---++ Examples
 ---+++ Rest Call
 <verbatim>
-GET http://localhost:15000/api/graphs/lineage/vertices/properties/40004?relationships=true
+GET http://localhost:15000/api/metadata/lineage/vertices/properties/40004?relationships=true
 </verbatim>
 ---+++ Result
 <verbatim>

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/82cea4fb/docs/src/site/twiki/restapi/Vertices.twiki
----------------------------------------------------------------------
diff --git a/docs/src/site/twiki/restapi/Vertices.twiki b/docs/src/site/twiki/restapi/Vertices.twiki
index 8406b2c..3ece037 100644
--- a/docs/src/site/twiki/restapi/Vertices.twiki
+++ b/docs/src/site/twiki/restapi/Vertices.twiki
@@ -1,4 +1,4 @@
----++  GET api/graphs/lineage/vertices?key=:key&value=:value
+---++  GET api/metadata/lineage/vertices?key=:key&value=:value
    * <a href="#Description">Description</a>
    * <a href="#Parameters">Parameters</a>
    * <a href="#Results">Results</a>
@@ -17,7 +17,7 @@ All vertices matching given property key and a value.
 ---++ Examples
 ---+++ Rest Call
 <verbatim>
-GET http://localhost:15000/api/graphs/lineage/vertices?key=name&value=sampleIngestProcess
+GET http://localhost:15000/api/metadata/lineage/vertices?key=name&value=sampleIngestProcess
 </verbatim>
 ---+++ Result
 <verbatim>

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/82cea4fb/prism/src/main/java/org/apache/falcon/resource/metadata/LineageMetadataResource.java
----------------------------------------------------------------------
diff --git a/prism/src/main/java/org/apache/falcon/resource/metadata/LineageMetadataResource.java b/prism/src/main/java/org/apache/falcon/resource/metadata/LineageMetadataResource.java
index ed50ce0..2404be4 100644
--- a/prism/src/main/java/org/apache/falcon/resource/metadata/LineageMetadataResource.java
+++ b/prism/src/main/java/org/apache/falcon/resource/metadata/LineageMetadataResource.java
@@ -55,7 +55,7 @@ import java.util.Map;
  * Implements most of the GET operations of Rexster API with out the indexes.
  * https://github.com/tinkerpop/rexster/wiki/Basic-REST-API
  */
-@Path("graphs/lineage")
+@Path("metadata/lineage")
 public class LineageMetadataResource extends AbstractMetadataResource {
 
     private static final Logger LOG = LoggerFactory.getLogger(LineageMetadataResource.class);
@@ -63,7 +63,7 @@ public class LineageMetadataResource extends AbstractMetadataResource {
     /**
      * Dump the graph.
      *
-     * GET http://host/graphs/lineage/serialize
+     * GET http://host/metadata/lineage/serialize
      * graph.getVertices();
      */
     @GET
@@ -84,7 +84,7 @@ public class LineageMetadataResource extends AbstractMetadataResource {
     /**
      * Get all vertices.
      *
-     * GET http://host/graphs/lineage/vertices/all
+     * GET http://host/metadata/lineage/vertices/all
      * graph.getVertices();
      */
     @GET
@@ -103,7 +103,7 @@ public class LineageMetadataResource extends AbstractMetadataResource {
     /**
      * Get a single vertex with a unique id.
      *
-     * GET http://host/graphs/lineage/vertices/id
+     * GET http://host/metadata/lineage/vertices/id
      * graph.getVertex(id);
      */
     @GET
@@ -140,7 +140,7 @@ public class LineageMetadataResource extends AbstractMetadataResource {
      * Get properties for a single vertex with a unique id.
      * This is NOT a rexster API.
      * <p/>
-     * GET http://host/graphs/lineage/vertices/properties/id
+     * GET http://host/metadata/lineage/vertices/properties/id
      */
     @GET
     @Path("/vertices/properties/{id}")
@@ -238,7 +238,7 @@ public class LineageMetadataResource extends AbstractMetadataResource {
     /**
      * Get a list of vertices matching a property key and a value.
      * <p/>
-     * GET http://host/graphs/lineage/vertices?key=<key>&value=<value>
+     * GET http://host/metadata/lineage/vertices?key=<key>&value=<value>
      * graph.getVertices(key, value);
      */
     @GET
@@ -260,7 +260,7 @@ public class LineageMetadataResource extends AbstractMetadataResource {
     /**
      * Get a list of adjacent edges with a direction.
      *
-     * GET http://host/graphs/lineage/vertices/id/direction
+     * GET http://host/metadata/lineage/vertices/id/direction
      * graph.getVertex(id).get{Direction}Edges();
      * direction: {(?!outE)(?!bothE)(?!inE)(?!out)(?!both)(?!in)(?!query).+}
      */
@@ -329,7 +329,7 @@ public class LineageMetadataResource extends AbstractMetadataResource {
     /**
      * Get all edges.
      *
-     * GET http://host/graphs/lineage/edges/all
+     * GET http://host/metadata/lineage/edges/all
      * graph.getEdges();
      */
     @GET
@@ -349,7 +349,7 @@ public class LineageMetadataResource extends AbstractMetadataResource {
     /**
      * Get a single edge with a unique id.
      *
-     * GET http://host/graphs/lineage/edges/id
+     * GET http://host/metadata/lineage/edges/id
      * graph.getEdge(id);
      */
     @GET

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/82cea4fb/prism/src/main/java/org/apache/falcon/resource/metadata/MetadataDiscoveryResource.java
----------------------------------------------------------------------
diff --git a/prism/src/main/java/org/apache/falcon/resource/metadata/MetadataDiscoveryResource.java b/prism/src/main/java/org/apache/falcon/resource/metadata/MetadataDiscoveryResource.java
index 1983371..d709eb0 100644
--- a/prism/src/main/java/org/apache/falcon/resource/metadata/MetadataDiscoveryResource.java
+++ b/prism/src/main/java/org/apache/falcon/resource/metadata/MetadataDiscoveryResource.java
@@ -46,13 +46,13 @@ import java.util.Iterator;
 /**
  * Jersey Resource for metadata operations.
  */
-@Path("metadata")
+@Path("metadata/discovery")
 public class MetadataDiscoveryResource extends AbstractMetadataResource {
 
     /**
      * Get list of dimensions for the given dimension-type.
      * <p/>
-     * GET http://host/metadata/dimension-type/list
+     * GET http://host/metadata/discovery/dimension-type/list
      */
     @GET
     @Path("/{type}/list")
@@ -89,7 +89,7 @@ public class MetadataDiscoveryResource extends AbstractMetadataResource {
     /**
      * Get relations of a dimension identified by type and name.
      *
-     * GET http://host/metadata/dimension-type/dimension-name/relations
+     * GET http://host/metadata/discovery/dimension-type/dimension-name/relations
      */
     @GET
     @Path("/{type}/{name}/relations")

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/82cea4fb/prism/src/main/java/org/apache/falcon/security/FalconAuthorizationFilter.java
----------------------------------------------------------------------
diff --git a/prism/src/main/java/org/apache/falcon/security/FalconAuthorizationFilter.java b/prism/src/main/java/org/apache/falcon/security/FalconAuthorizationFilter.java
index 16cc0ac..2af4b9a 100644
--- a/prism/src/main/java/org/apache/falcon/security/FalconAuthorizationFilter.java
+++ b/prism/src/main/java/org/apache/falcon/security/FalconAuthorizationFilter.java
@@ -33,7 +33,6 @@ import javax.servlet.ServletResponse;
 import javax.servlet.http.HttpServletRequest;
 import javax.ws.rs.core.Response;
 import java.io.IOException;
-import java.util.ArrayList;
 
 /**
  * This enforces authorization as part of the filter before processing the request.
@@ -94,27 +93,13 @@ public class FalconAuthorizationFilter implements Filter {
     private static RequestParts getUserRequest(HttpServletRequest httpRequest) {
         String pathInfo = httpRequest.getPathInfo();
         final String[] pathSplits = pathInfo.substring(1).split("/");
-        final String resource = pathSplits[0];
-
-        ArrayList<String> splits = new ArrayList<String>();
-        if (resource.equals("graphs")) {
-            splits.add(pathSplits[1]);  // resource
-            splits.add(pathSplits[2]);  // action
-        } else {
-            splits.add(pathSplits[0]);  // resource
-            splits.add(pathSplits[1]);  // action
-            if (pathSplits.length > 2) {  // entity type
-                splits.add(pathSplits[2]);
-            }
-            if (pathSplits.length > 3) {  // entity name
-                splits.add(pathSplits[3]);
-            }
-        }
 
-        final String entityType = splits.size() > 2 ? splits.get(2) : null;
-        final String entityName = splits.size() > 3 ? splits.get(3) : null;
+        final String resource = pathSplits[0];
+        final String action = pathSplits[1];
+        final String entityType = pathSplits.length > 2 ? pathSplits[2] : null;
+        final String entityName = pathSplits.length > 3 ? pathSplits[3] : null;
 
-        return new RequestParts(splits.get(0), splits.get(1), entityName, entityType);
+        return new RequestParts(resource, action, entityName, entityType);
     }
 
     private static class RequestParts {

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/82cea4fb/prism/src/test/java/org/apache/falcon/security/FalconAuthorizationFilterTest.java
----------------------------------------------------------------------
diff --git a/prism/src/test/java/org/apache/falcon/security/FalconAuthorizationFilterTest.java b/prism/src/test/java/org/apache/falcon/security/FalconAuthorizationFilterTest.java
index 6e4885a..385b005 100644
--- a/prism/src/test/java/org/apache/falcon/security/FalconAuthorizationFilterTest.java
+++ b/prism/src/test/java/org/apache/falcon/security/FalconAuthorizationFilterTest.java
@@ -86,9 +86,9 @@ public class FalconAuthorizationFilterTest {
             {"/entities/list/feed"},
             {"/entities/list/process"},
             {"/entities/list/cluster"},
-            {"/graphs/lineage/vertices/all"},
-            {"/graphs/lineage/vertices/_1"},
-            {"/graphs/lineage/vertices/properties/_1"},
+            {"/metadata/lineage/vertices/all"},
+            {"/metadata/lineage/vertices/_1"},
+            {"/metadata/lineage/vertices/properties/_1"},
         };
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/82cea4fb/webapp/src/test/java/org/apache/falcon/cli/FalconCLISmokeIT.java
----------------------------------------------------------------------
diff --git a/webapp/src/test/java/org/apache/falcon/cli/FalconCLISmokeIT.java b/webapp/src/test/java/org/apache/falcon/cli/FalconCLISmokeIT.java
index cb0dd2d..8d54c38 100644
--- a/webapp/src/test/java/org/apache/falcon/cli/FalconCLISmokeIT.java
+++ b/webapp/src/test/java/org/apache/falcon/cli/FalconCLISmokeIT.java
@@ -58,7 +58,7 @@ public class FalconCLISmokeIT {
         // this is necessary for lineage
         Assert.assertEquals(0, executeWithURL("entity -submit -type cluster -file " + filePath));
         // verify
-        Assert.assertEquals(0, executeWithURL("graph -vertices -key name -value " + context.getClusterName()));
+        Assert.assertEquals(0, executeWithURL("metadata -vertices -key name -value " + context.getClusterName()));
 
         filePath = TestContext.overlayParametersOverTemplate(TestContext.FEED_TEMPLATE1, overlay);
         Assert.assertEquals(0,

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/82cea4fb/webapp/src/test/java/org/apache/falcon/resource/MetadataResourceJerseyIT.java
----------------------------------------------------------------------
diff --git a/webapp/src/test/java/org/apache/falcon/resource/MetadataResourceJerseyIT.java b/webapp/src/test/java/org/apache/falcon/resource/MetadataResourceJerseyIT.java
index 5249888..eb1dda8 100644
--- a/webapp/src/test/java/org/apache/falcon/resource/MetadataResourceJerseyIT.java
+++ b/webapp/src/test/java/org/apache/falcon/resource/MetadataResourceJerseyIT.java
@@ -64,7 +64,7 @@ public class MetadataResourceJerseyIT {
     public void testMetadataDiscoveryResourceList() throws Exception {
 
         ClientResponse response = context.service
-                .path("api/metadata/cluster_entity/list")
+                .path("api/metadata/discovery/cluster_entity/list")
                 .header("Cookie", context.getAuthenticationToken())
                 .accept(MediaType.APPLICATION_JSON)
                 .get(ClientResponse.class);
@@ -74,7 +74,7 @@ public class MetadataResourceJerseyIT {
         Assert.assertTrue(dimensions.contains(context.clusterName));
 
         response = context.service
-                .path("api/metadata/process_entity/list")
+                .path("api/metadata/discovery/process_entity/list")
                 .queryParam("cluster", context.clusterName)
                 .header("Cookie", context.getAuthenticationToken())
                 .accept(MediaType.APPLICATION_JSON)
@@ -85,7 +85,7 @@ public class MetadataResourceJerseyIT {
         Assert.assertTrue(dimensions.contains(context.processName));
 
         response = context.service
-                .path("api/metadata/process_entity/list")
+                .path("api/metadata/discovery/process_entity/list")
                 .queryParam("cluster", "random")
                 .header("Cookie", context.getAuthenticationToken())
                 .accept(MediaType.APPLICATION_JSON)
@@ -98,7 +98,7 @@ public class MetadataResourceJerseyIT {
     @Test
     public void testMetadataDiscoveryResourceRelations() throws Exception {
         ClientResponse response = context.service
-                .path("api/metadata/process_entity/" + context.processName + "/relations")
+                .path("api/metadata/discovery/process_entity/" + context.processName + "/relations")
                 .header("Cookie", context.getAuthenticationToken())
                 .accept(MediaType.APPLICATION_JSON)
                 .get(ClientResponse.class);
@@ -107,7 +107,7 @@ public class MetadataResourceJerseyIT {
         Assert.assertEquals(results.get("name"), context.processName);
 
         response = context.service
-                .path("api/metadata/colo/" + DeploymentUtil.getCurrentColo() + "/relations")
+                .path("api/metadata/discovery/colo/" + DeploymentUtil.getCurrentColo() + "/relations")
                 .header("Cookie", context.getAuthenticationToken())
                 .accept(MediaType.APPLICATION_JSON)
                 .get(ClientResponse.class);


Mime
View raw message