[GitHub] flink pull request: [FLINK-2093][gelly] Added difference Method

2015-06-25 Thread vasia
Github user vasia commented on the pull request:

https://github.com/apache/flink/pull/818#issuecomment-115215460
  
Thank you @shghatge! I'll merge this :)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] flink pull request: [FLINK-2093][gelly] Added difference Method

2015-06-25 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/flink/pull/818


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] flink pull request: [FLINK-2093][gelly] Added difference Method

2015-06-24 Thread shghatge
Github user shghatge commented on the pull request:

https://github.com/apache/flink/pull/818#issuecomment-114983698
  
Updated PR


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] flink pull request: [FLINK-2093][gelly] Added difference Method

2015-06-23 Thread vasia
Github user vasia commented on a diff in the pull request:

https://github.com/apache/flink/pull/818#discussion_r33026720
  
--- Diff: 
flink-staging/flink-gelly/src/main/java/org/apache/flink/graph/Graph.java ---
@@ -1234,6 +1248,17 @@ public void coGroup(IterableEdgeK, EV edge, 
IterableEdgeK, EV edgeToBeRe
}
 
/**
+* Performs Difference on the vertex and edge sets of the input graphs
+* removes common vertices and edges. If a source/target vertex is 
removed, its corresponding edge will also be removed
+* @param graph the graph to perform difference with
+* @return a new graph where the common vertices and edges have been 
removed
+*/
+   public GraphK,VV,EV difference(GraphK,VV,EV graph) throws 
java.lang.Exception{
--- End diff --

why the `throws` declaration?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] flink pull request: [FLINK-2093][gelly] Added difference Method

2015-06-23 Thread vasia
Github user vasia commented on the pull request:

https://github.com/apache/flink/pull/818#issuecomment-114430160
  
Hi @shghatge!
Thank you for the quick update. Apart from my minor comment, this looks 
good now :)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] flink pull request: [FLINK-2093][gelly] Added difference Method

2015-06-18 Thread shghatge
Github user shghatge commented on the pull request:

https://github.com/apache/flink/pull/818#issuecomment-113147138
  
Updated the PR by changing the removeVertices(DataSetVertexK, VV) 
method  access from Public to Private. It is only used as a helper function for 
the difference method.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] flink pull request: [FLINK-2093][gelly] Added difference Method

2015-06-18 Thread shghatge
Github user shghatge commented on the pull request:

https://github.com/apache/flink/pull/818#issuecomment-113150859
  
Updated the docs accordingly.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] flink pull request: [FLINK-2093][gelly] Added difference Method

2015-06-18 Thread andralungu
Github user andralungu commented on the pull request:

https://github.com/apache/flink/pull/818#issuecomment-113149078
  
Hi @shghatge ,

Don't forget to remove the definition for the public 
removeVertices(DataSet) from the documentation.  

Up for discussion: should we keep the name removeVertices for the private, 
helper method or should we call it something else, like 
removeVerticesAndEdges... Names are not my strongest point, but I guess you got 
the idea :) Personally, I am fine with the current name!  


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] flink pull request: [FLINK-2093][gelly] Added difference Method

2015-06-17 Thread vasia
Github user vasia commented on the pull request:

https://github.com/apache/flink/pull/818#issuecomment-112923172
  
Hi @shghatge!

For this issue, I think we should only add the `difference` method. If you 
want to avoid duplicating code, you can always define a private helper method.
If we decide that we need overloaded public methods for additions and 
removals, we should discuss this in a separate JIRA in my view.
Let me know if you have questions!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] flink pull request: [FLINK-2093][gelly] Added difference Method

2015-06-17 Thread vasia
Github user vasia commented on the pull request:

https://github.com/apache/flink/pull/818#issuecomment-112814353
  
Hey,

difference in not a fancy way of removing vertices, no :)
If you recall our previous conversation in #678, we decided to have 
add/remove methods for small mutations (i.e. can be stored in a List)  and 
union/difference for large mutations (for large data in the form of Graph).

The `collect()` method is not unsafe. It is simply not advised to be used 
for large datasets. If you think about it, it needs to retrieve the data (which 
might be distributed over several nodes) from to local JVM and trigger the 
program execution.

If you found that the only way to implement `difference` is to overload 
`removeVertices`, then we should also consider what this means in terms of the 
API. If we have a remove* method for DataSets, don't we also need a 
corresponding add*? You see how this goes back to #678 :)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] flink pull request: [FLINK-2093][gelly] Added difference Method

2015-06-17 Thread shghatge
Github user shghatge commented on the pull request:

https://github.com/apache/flink/pull/818#issuecomment-112827357
  
Hello @vasia 
Could you please elaborate on what should be the future course of action?
Should I put the content of removeVertices(DataSet) method in the 
Difference() method so as to not add a new public method? Or is it better to 
overload the add methods for DataSets  too?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] flink pull request: [FLINK-2093][gelly] Added difference Method

2015-06-15 Thread andralungu
Github user andralungu commented on a diff in the pull request:

https://github.com/apache/flink/pull/818#discussion_r32415140
  
--- Diff: 
flink-staging/flink-gelly/src/main/java/org/apache/flink/graph/Graph.java ---
@@ -1151,6 +1151,23 @@ public void coGroup(IterableVertexK, VV vertex, 
IterableVertexK, VV vert
}
}
 
+
+   public GraphK, VV, EV removeVertices(DataSetVertexK, VV 
verticesToBeRemoved){
--- End diff --

Yes, this is definitely the idea, but right now you are duplicating a lot 
of code. Can we find a smarter way (i.e. that requires as little code 
duplication as possible) :)?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] flink pull request: [FLINK-2093][gelly] Added difference Method

2015-06-15 Thread andralungu
Github user andralungu commented on a diff in the pull request:

https://github.com/apache/flink/pull/818#discussion_r32415176
  
--- Diff: 
flink-staging/flink-gelly/src/main/java/org/apache/flink/graph/Graph.java ---
@@ -1151,6 +1151,23 @@ public void coGroup(IterableVertexK, VV vertex, 
IterableVertexK, VV vert
}
}
 
+
--- End diff --

always add Javadoc to new methods.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] flink pull request: [FLINK-2093][gelly] Added difference Method

2015-06-15 Thread andralungu
Github user andralungu commented on a diff in the pull request:

https://github.com/apache/flink/pull/818#discussion_r32414981
  
--- Diff: docs/libs/gelly_guide.md ---
@@ -240,6 +240,7 @@ GraphLong, Double, Double networkWithWeights = 
network.joinWithEdgesOnSource(v
 img alt=Union Transformation width=50% src=fig/gelly-union.png/
 /p
 
+* strongDifference/strong: Gelly's `difference()` method performs a 
difference on the vertex and edge sets of the input graphs. The resultant graph 
is formed by removing the common vertices and edges from the graph.
--- End diff --

I think @vasia also wanted you to update the description for union ^^

Now, this still looks a bit unclear. It seems that there are two input 
graphs. You should make it obvious that the current graph gets differentiated 
with an input graph. That way, you won't leave room for comments.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] flink pull request: [FLINK-2093][gelly] Added difference Method

2015-06-15 Thread andralungu
Github user andralungu commented on the pull request:

https://github.com/apache/flink/pull/818#issuecomment-112099290
  
Hi @vasia ,

In essence the `difference` method is just a fancy way of removing 
vertices, right?
When you remove a vertex, you also remove the edge for which it was a 
source/target.

Since the add/remove vertices methods work just for lists and collect is 
unsafe, we mutually agreed to overload `removeVertices` to work for data 
sets. 
This way you would duplicate the least amount of code. Otherwise, you would 
take the exact code in the DataSet removeVertices and duplicate it in 
difference. That's not very practical IMO.

Also, it may occur that a user has a DataSet of elements to remove. An 
extra removeVertices won't really hurt then, would it? 

But if you have suggestions on how to improve this, we are more than eager 
to hear about them :)

-Andra


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] flink pull request: [FLINK-2093][gelly] Added difference Method

2015-06-13 Thread vasia
Github user vasia commented on a diff in the pull request:

https://github.com/apache/flink/pull/818#discussion_r32374715
  
--- Diff: 
flink-staging/flink-gelly/src/main/java/org/apache/flink/graph/Graph.java ---
@@ -1234,6 +1234,18 @@ public void coGroup(IterableEdgeK, EV edge, 
IterableEdgeK, EV edgeToBeRe
}
 
/**
+* Performs Difference on the vertex and edge sets of the input graphs
+* removes common vertices and edges. If a source/target vertex is 
removed, its corresponding edge will also be removed
+* @param graph the graph to perform difference with
+* @return a new graph where the common vertices and edges have been 
removed
+*/
+   public GraphK,VV,EV difference(GraphK,VV,EV graph) throws 
java.lang.Exception{
+   DataSetVertexK,VV removeVerticesData = graph.getVertices();
+   final ListVertexK,VV removeVerticesList = 
removeVerticesData.collect();
--- End diff --

I don't think we should use `collect()` here.. Keep in mind that (1) 
`collect()` will trigger program execution and (2) should not be used to 
collect large DataSets and input graph might have lots of vertices.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] flink pull request: [FLINK-2093][gelly] Added difference Method

2015-06-13 Thread vasia
Github user vasia commented on a diff in the pull request:

https://github.com/apache/flink/pull/818#discussion_r32374703
  
--- Diff: docs/libs/gelly_guide.md ---
@@ -240,6 +240,7 @@ GraphLong, Double, Double networkWithWeights = 
network.joinWithEdgesOnSource(v
 img alt=Union Transformation width=50% src=fig/gelly-union.png/
 /p
 
+* strongDifference/strong: Gelly's `difference()` method performs a 
difference on the vertex and edge sets of the input graphs. The resultant graph 
is formed by removing the vertices and edges from the graph that are common 
with the second graph.
--- End diff --

we can rephrase this a bit.. there is one input graph and no second 
graph... I guess you copied from the union description above (which should also 
be changed).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] flink pull request: [FLINK-2093][gelly] Added difference Method

2015-06-10 Thread shghatge
GitHub user shghatge opened a pull request:

https://github.com/apache/flink/pull/818

[FLINK-2093][gelly] Added difference Method

Tasks given on 5th June:
Add a difference function to the Graph.java
Modify the docs 'gelly-guide.md'
Add the test case for difference() method to GraphMutationsITCase.java

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/shghatge/flink difference_new

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/flink/pull/818.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #818


commit e8a5250b4588326b606b2f29d2f2c2f6e4554925
Author: Shivani shgha...@gmail.com
Date:   2015-06-10T11:22:37Z

[FLINK-2093][gelly] Added difference Method




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] flink pull request: [FLINK-2093][gelly] Added difference Method

2015-06-10 Thread andralungu
Github user andralungu commented on the pull request:

https://github.com/apache/flink/pull/818#issuecomment-110739263
  
Hi @shghatge, 

Apart from the minor cosmetic suggestions I made, everything looks well. 

@vasia, could you double check this? After Shivani simplifies the 
difference method a bit, I would call this good to merge. 

Thanks!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] flink pull request: [FLINK-2093][gelly] Added difference method

2015-06-09 Thread shghatge
Github user shghatge commented on the pull request:

https://github.com/apache/flink/pull/807#issuecomment-110380728
  
Hi @fhueske I am sorry for closing the pull request. Now onwards I will 
follow the approach you suggested.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] flink pull request: [FLINK-2093][gelly] Added difference method

2015-06-09 Thread fhueske
Github user fhueske commented on the pull request:

https://github.com/apache/flink/pull/807#issuecomment-110438710
  
@shghatge no worries. It's not a big deal :-)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] flink pull request: [FLINK-2093][gelly] Added difference method

2015-06-08 Thread fhueske
Github user fhueske commented on the pull request:

https://github.com/apache/flink/pull/807#issuecomment-110143059
  
Hi @shghatge, you don't need to close a PR in order to update it.
You can simply update (push or push --force into) the branch from which you 
created the PR and Github will automatically update the PR. This helps to have 
all comments about your implementation in one place.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] flink pull request: [FLINK-2093][gelly] Added difference method

2015-06-08 Thread shghatge
Github user shghatge commented on the pull request:

https://github.com/apache/flink/pull/807#issuecomment-110078878
  
Then it was just removing vertices! Talk about swatting a Fly with a 
Sledgehammer! I will do all the changes you suggested. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] flink pull request: [FLINK-2093][gelly] Added difference method

2015-06-08 Thread shghatge
Github user shghatge closed the pull request at:

https://github.com/apache/flink/pull/807


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] flink pull request: [FLINK-2093][gelly] Added difference method

2015-06-08 Thread shghatge
GitHub user shghatge opened a pull request:

https://github.com/apache/flink/pull/807

[FLINK-2093][gelly] Added difference method

Tasks given on 5th June:
Add a difference function to the Graph.java
Modify the docs 'gelly-guide.md'
Add the test case for difference() method to GraphMutationsITCase.java

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/shghatge/flink difference

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/flink/pull/807.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #807


commit 61afe247fb75fcfd22e0bdbed53a7dbbefdf65cb
Author: Shivani shgha...@gmail.com
Date:   2015-06-08T14:58:22Z

[FLINK-2093][gelly] Added difference method




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] flink pull request: [FLINK-2093][gelly] Added difference method

2015-06-08 Thread andralungu
Github user andralungu commented on the pull request:

https://github.com/apache/flink/pull/807#issuecomment-110070080
  
Hi @shghatge ,

This very nice for a first PR and I am happy to see that you followed my 
guidelines :)
I left a set of comments in-line.

Apart from those:
- the difference method can be simplified. You don't need to filterOnEdges. 
Have a closer look at removeVertices. Imagine what happens if you remove a 
vertex, the edge will also have to be removed. You cannot leave an edge with 
just the source or the target vertex trailing.
- I think you forgot to add the corner case test for an input graph which 
does not have common vertices with the first one. I know you wrote it :) 
-  Finally, if you have a look at the Travis build here, it failed because 
you are indenting with spaces instead of tabs. You should play a bit with your 
IntelliJ settings. No worries! This is a rookie mistake, we all did it at 
first. To check everything is okay, just do a cd flink-staging/flink-gelly and 
then mvn verify. After it says build success, we're good to go. 
Rebase and update the PR.

If you have questions, I'll be more than happy to answer them!  Nice job!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] flink pull request: [FLINK-2093][gelly] Added difference method

2015-06-08 Thread andralungu
Github user andralungu commented on a diff in the pull request:

https://github.com/apache/flink/pull/807#discussion_r31930812
  
--- Diff: 
flink-staging/flink-gelly/src/main/java/org/apache/flink/graph/Graph.java ---
@@ -1233,6 +1233,34 @@ public void coGroup(IterableEdgeK, EV edge, 
IterableEdgeK, EV edgeToBeRe
return new GraphK, VV, EV(unionedVertices, unionedEdges, 
this.context);
}
 
+/**
+ * Performs Difference on the vertices and edges sets of the 
inputgraphs
+ * removes both vertices and edges with the vertex as a source/target
+ * @param graph the graph to perform differennce with
+ * @return a new graph
--- End diff --

a new graph where the common vertices and edges have been removed


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] flink pull request: [FLINK-2093][gelly] Added difference method

2015-06-08 Thread andralungu
Github user andralungu commented on a diff in the pull request:

https://github.com/apache/flink/pull/807#discussion_r31932002
  
--- Diff: 
flink-staging/flink-gelly/src/test/java/org/apache/flink/graph/test/operations/GraphOperationsITCase.java
 ---
@@ -266,6 +266,47 @@ public void testUnion() throws Exception {
6,1,61\n;
}
 
+@Test
+public void testDifference() throws Exception {
+   /*
+* Test difference()
+*/
+final ExecutionEnvironment env = 
ExecutionEnvironment.getExecutionEnvironment();
+
+GraphLong, Long, Long graph = 
Graph.fromDataSet(TestGraphUtils.getLongLongVertexData(env),
+TestGraphUtils.getLongLongEdgeData(env), env);
+
+ListVertexLong, Long vertices = new ArrayListVertexLong, 
Long();
+ListEdgeLong, Long edges = new ArrayListEdgeLong, Long();
--- End diff --

I would put these in TestGraphUtils, one remove is fine, but three can make 
the code  a bit difficult to read :)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] flink pull request: [FLINK-2093][gelly] Added difference method

2015-06-08 Thread andralungu
Github user andralungu commented on a diff in the pull request:

https://github.com/apache/flink/pull/807#discussion_r31932048
  
--- Diff: 
flink-staging/flink-gelly/src/test/java/org/apache/flink/graph/test/operations/GraphOperationsITCase.java
 ---
@@ -266,6 +266,47 @@ public void testUnion() throws Exception {
6,1,61\n;
}
 
+@Test
+public void testDifference() throws Exception {
+   /*
+* Test difference()
+*/
+final ExecutionEnvironment env = 
ExecutionEnvironment.getExecutionEnvironment();
+
+GraphLong, Long, Long graph = 
Graph.fromDataSet(TestGraphUtils.getLongLongVertexData(env),
+TestGraphUtils.getLongLongEdgeData(env), env);
+
+ListVertexLong, Long vertices = new ArrayListVertexLong, 
Long();
+ListEdgeLong, Long edges = new ArrayListEdgeLong, Long();
+
+vertices.remove(1);
+vertices.remove(3);
+vertices.remove(4);
+
+vertices.add(new VertexLong,Long(6L,6L));
+
+edges.remove(0);
+edges.remove(2);
+edges.remove(3);
+edges.remove(4);
+edges.remove(5);
+edges.remove(6);
--- End diff --

same for the edges


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] flink pull request: [FLINK-2093][gelly] Added difference method

2015-06-08 Thread andralungu
Github user andralungu commented on a diff in the pull request:

https://github.com/apache/flink/pull/807#discussion_r31930244
  
--- Diff: docs/libs/gelly_guide.md ---
@@ -236,6 +236,8 @@ GraphLong, Double, Double networkWithWeights = 
network.joinWithEdgesOnSource(v
 
 * strongUnion/strong: Gelly's `union()` method performs a union on the 
vertex and edges sets of the input graphs. Duplicate vertices are removed from 
the resulting `Graph`, while if duplicate edges exists, these will be 
maintained.
 
+* strongDifference/strong: Gelly's `difference()` method performs a 
difference on the vertex and edges sets of the input graphs. Common vertices 
are removed from the resulting `Graph`, along with the edges which which have 
these vertices as source/target.
--- End diff --

you have written which twice, along with the edges which which :) 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] flink pull request: [FLINK-2093][gelly] Added difference method

2015-06-08 Thread andralungu
Github user andralungu commented on a diff in the pull request:

https://github.com/apache/flink/pull/807#discussion_r31930744
  
--- Diff: 
flink-staging/flink-gelly/src/main/java/org/apache/flink/graph/Graph.java ---
@@ -1233,6 +1233,34 @@ public void coGroup(IterableEdgeK, EV edge, 
IterableEdgeK, EV edgeToBeRe
return new GraphK, VV, EV(unionedVertices, unionedEdges, 
this.context);
}
 
+/**
+ * Performs Difference on the vertices and edges sets of the 
inputgraphs
--- End diff --

on the vertex and edge sets of the input graphs 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] flink pull request: [FLINK-2093][gelly] Added difference method

2015-06-08 Thread andralungu
Github user andralungu commented on a diff in the pull request:

https://github.com/apache/flink/pull/807#discussion_r31932709
  
--- Diff: 
flink-staging/flink-gelly/src/test/java/org/apache/flink/graph/test/operations/GraphOperationsITCase.java
 ---
@@ -266,6 +266,47 @@ public void testUnion() throws Exception {
6,1,61\n;
}
 
+@Test
+public void testDifference() throws Exception {
+   /*
+* Test difference()
+*/
+final ExecutionEnvironment env = 
ExecutionEnvironment.getExecutionEnvironment();
+
+GraphLong, Long, Long graph = 
Graph.fromDataSet(TestGraphUtils.getLongLongVertexData(env),
+TestGraphUtils.getLongLongEdgeData(env), env);
+
+ListVertexLong, Long vertices = new ArrayListVertexLong, 
Long();
+ListEdgeLong, Long edges = new ArrayListEdgeLong, Long();
+
+vertices.remove(1);
+vertices.remove(3);
+vertices.remove(4);
+
+vertices.add(new VertexLong,Long(6L,6L));
+
+edges.remove(0);
+edges.remove(2);
+edges.remove(3);
+edges.remove(4);
+edges.remove(5);
+edges.remove(6);
+
+edges.add(new EdgeLong, Long(6L,1L,61L));
+edges.add(new EdgeLong, Long(6L,3L,63L));
+
+graph = graph.difference(Graph.fromCollection(vertices, edges, 
env));
+
+graph.getEdges().writeAsCsv(resultPath);
+graph.getVertices().writeAsCsv(resultPath);
--- End diff --

The graph.getVertices() should actually be in a different test; that way 
you could change the expected result and see that the vertices you get are 
actually the ones you expected.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---