[jira] [Commented] (FLINK-5104) Implement BipartiteGraph validator

2021-04-27 Thread Flink Jira Bot (Jira)


[ 
https://issues.apache.org/jira/browse/FLINK-5104?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17334299#comment-17334299
 ] 

Flink Jira Bot commented on FLINK-5104:
---

This issue was marked "stale-assigned" and has not received an update in 7 
days. It is now automatically unassigned. If you are still working on it, you 
can assign it to yourself again. Please also give an update about the status of 
the work.

> Implement BipartiteGraph validator
> --
>
> Key: FLINK-5104
> URL: https://issues.apache.org/jira/browse/FLINK-5104
> Project: Flink
>  Issue Type: Sub-task
>  Components: Library / Graph Processing (Gelly)
>Reporter: Ivan Mushketyk
>Assignee: Ivan Mushketyk
>Priority: Major
>  Labels: pull-request-available, stale-assigned
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> BipartiteGraph should have a validator similar to GraphValidator for Graph 
> class.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (FLINK-5104) Implement BipartiteGraph validator

2021-04-16 Thread Flink Jira Bot (Jira)


[ 
https://issues.apache.org/jira/browse/FLINK-5104?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17323690#comment-17323690
 ] 

Flink Jira Bot commented on FLINK-5104:
---

This issue is assigned but has not received an update in 7 days so it has been 
labeled "stale-assigned". If you are still working on the issue, please give an 
update and remove the label. If you are no longer working on the issue, please 
unassign so someone else may work on it. In 7 days the issue will be 
automatically unassigned.

> Implement BipartiteGraph validator
> --
>
> Key: FLINK-5104
> URL: https://issues.apache.org/jira/browse/FLINK-5104
> Project: Flink
>  Issue Type: Sub-task
>  Components: Library / Graph Processing (Gelly)
>Reporter: Ivan Mushketyk
>Assignee: Ivan Mushketyk
>Priority: Major
>  Labels: pull-request-available, stale-assigned
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> BipartiteGraph should have a validator similar to GraphValidator for Graph 
> class.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (FLINK-5104) Implement BipartiteGraph validator

2016-12-16 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-5104?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15755540#comment-15755540
 ] 

ASF GitHub Bot commented on FLINK-5104:
---

Github user mushketyk commented on the issue:

https://github.com/apache/flink/pull/2985
  
Rebased this PR on top of `master`.


> Implement BipartiteGraph validator
> --
>
> Key: FLINK-5104
> URL: https://issues.apache.org/jira/browse/FLINK-5104
> Project: Flink
>  Issue Type: Sub-task
>  Components: Gelly
>Reporter: Ivan Mushketyk
>Assignee: Ivan Mushketyk
>
> BipartiteGraph should have a validator similar to GraphValidator for Graph 
> class.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FLINK-5104) Implement BipartiteGraph validator

2016-12-15 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-5104?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15751646#comment-15751646
 ] 

ASF GitHub Bot commented on FLINK-5104:
---

Github user greghogan commented on the issue:

https://github.com/apache/flink/pull/2985
  
@mushketyk I had meant just with a simple comment noting that with an 
anti-join we could also remove the FlatJoinFunction.


> Implement BipartiteGraph validator
> --
>
> Key: FLINK-5104
> URL: https://issues.apache.org/jira/browse/FLINK-5104
> Project: Flink
>  Issue Type: Sub-task
>  Components: Gelly
>Reporter: Ivan Mushketyk
>Assignee: Ivan Mushketyk
>
> BipartiteGraph should have a validator similar to GraphValidator for Graph 
> class.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FLINK-5104) Implement BipartiteGraph validator

2016-12-14 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-5104?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15750656#comment-15750656
 ] 

ASF GitHub Bot commented on FLINK-5104:
---

Github user mushketyk commented on the issue:

https://github.com/apache/flink/pull/2985
  
@greghogan Thank you for the review.
Can you give me an example of how you document joins?


> Implement BipartiteGraph validator
> --
>
> Key: FLINK-5104
> URL: https://issues.apache.org/jira/browse/FLINK-5104
> Project: Flink
>  Issue Type: Sub-task
>  Components: Gelly
>Reporter: Ivan Mushketyk
>Assignee: Ivan Mushketyk
>
> BipartiteGraph should have a validator similar to GraphValidator for Graph 
> class.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FLINK-5104) Implement BipartiteGraph validator

2016-12-14 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-5104?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15749656#comment-15749656
 ] 

ASF GitHub Bot commented on FLINK-5104:
---

Github user mushketyk commented on the issue:

https://github.com/apache/flink/pull/2985
  
Sorry for the failing build. I've removed the unused imports so it should 
be fine now.


> Implement BipartiteGraph validator
> --
>
> Key: FLINK-5104
> URL: https://issues.apache.org/jira/browse/FLINK-5104
> Project: Flink
>  Issue Type: Sub-task
>  Components: Gelly
>Reporter: Ivan Mushketyk
>Assignee: Ivan Mushketyk
>
> BipartiteGraph should have a validator similar to GraphValidator for Graph 
> class.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FLINK-5104) Implement BipartiteGraph validator

2016-12-14 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-5104?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15749452#comment-15749452
 ] 

ASF GitHub Bot commented on FLINK-5104:
---

Github user greghogan commented on the issue:

https://github.com/apache/flink/pull/2985
  
@mushketyk the build is failing due to unused imports (IntelliJ can be 
configured to automatically remove these).

There are so many ways to implement the validator. Projections would reduce 
the data to be transmitted and sorted. I like to document when we are 
performing a different kind of join (here, an anti-join) for the day when these 
are available in Flink. I don't know how counting in the `FlatJoinFunction` 
followed by two `DiscardingOutputFormat` compares with the current 
implementation of a union and count (which is a dummy `OutputFormat`).

We'll need to rebase this PR once FLINK-5311 has been committed.


> Implement BipartiteGraph validator
> --
>
> Key: FLINK-5104
> URL: https://issues.apache.org/jira/browse/FLINK-5104
> Project: Flink
>  Issue Type: Sub-task
>  Components: Gelly
>Reporter: Ivan Mushketyk
>Assignee: Ivan Mushketyk
>
> BipartiteGraph should have a validator similar to GraphValidator for Graph 
> class.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FLINK-5104) Implement BipartiteGraph validator

2016-12-13 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-5104?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15746410#comment-15746410
 ] 

ASF GitHub Bot commented on FLINK-5104:
---

Github user mushketyk commented on the issue:

https://github.com/apache/flink/pull/2985
  
Hi @greghogan ,

Thank you for your feedback. I've updated the PR accordingly. The only 
thing that I did differently is that I've replaced projections and two 
`count()` executions with joins and one `count()` call. What do you think about 
this?


> Implement BipartiteGraph validator
> --
>
> Key: FLINK-5104
> URL: https://issues.apache.org/jira/browse/FLINK-5104
> Project: Flink
>  Issue Type: Sub-task
>  Components: Gelly
>Reporter: Ivan Mushketyk
>Assignee: Ivan Mushketyk
>
> BipartiteGraph should have a validator similar to GraphValidator for Graph 
> class.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FLINK-5104) Implement BipartiteGraph validator

2016-12-13 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-5104?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15746405#comment-15746405
 ] 

ASF GitHub Bot commented on FLINK-5104:
---

Github user mushketyk commented on a diff in the pull request:

https://github.com/apache/flink/pull/2985#discussion_r92276412
  
--- Diff: 
flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/validation/InvalidBipartiteVertexIdsValidator.java
 ---
@@ -0,0 +1,85 @@
+/*
+ * 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.flink.graph.validation;
+
+import org.apache.flink.api.common.functions.CoGroupFunction;
+import org.apache.flink.api.common.functions.MapFunction;
+import org.apache.flink.api.java.DataSet;
+import org.apache.flink.api.java.tuple.Tuple1;
+import org.apache.flink.graph.Vertex;
+import org.apache.flink.graph.bipartite.BipartiteEdge;
+import org.apache.flink.graph.bipartite.BipartiteGraph;
+import org.apache.flink.util.Collector;
+import static 
org.apache.flink.api.java.functions.FunctionAnnotation.ForwardedFields;
+
+/**
+ * Checks that the edge set input contains valid vertex Ids, i.e. that they
+ * also exist in top and bottom vertex sets.
+ */
+public class InvalidBipartiteVertexIdsValidator 
extends BipartiteGraphValidator {
+
+   @Override
+   public boolean validate(BipartiteGraph 
bipartiteGraph) throws Exception {
+   DataSet edgesTopIds = 
bipartiteGraph.getEdges().map(new GetTopIdsMap());
+   DataSet edgesBottomIds = 
bipartiteGraph.getEdges().map(new GetBottomIdsMap());
+
+   DataSet invalidTopIds = 
invalidIds(bipartiteGraph.getTopVertices(), edgesTopIds);
+   DataSet invalidBottomIds = 
invalidIds(bipartiteGraph.getBottomVertices(), edgesBottomIds);
+
+   return invalidTopIds.count() == 0 && invalidBottomIds.count() 
== 0;
--- End diff --

Since these two datasets have different types I couldn't figure out how to 
use accumulators and `RichOutputFormat`  to run `collect()` only once, but I've 
replaced it with two outer joins and one `count()` call.
Is it a feasible approach?


> Implement BipartiteGraph validator
> --
>
> Key: FLINK-5104
> URL: https://issues.apache.org/jira/browse/FLINK-5104
> Project: Flink
>  Issue Type: Sub-task
>  Components: Gelly
>Reporter: Ivan Mushketyk
>Assignee: Ivan Mushketyk
>
> BipartiteGraph should have a validator similar to GraphValidator for Graph 
> class.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FLINK-5104) Implement BipartiteGraph validator

2016-12-12 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-5104?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15742663#comment-15742663
 ] 

ASF GitHub Bot commented on FLINK-5104:
---

Github user greghogan commented on a diff in the pull request:

https://github.com/apache/flink/pull/2985#discussion_r92004487
  
--- Diff: 
flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/validation/InvalidBipartiteVertexIdsValidator.java
 ---
@@ -0,0 +1,85 @@
+/*
+ * 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.flink.graph.validation;
+
+import org.apache.flink.api.common.functions.CoGroupFunction;
+import org.apache.flink.api.common.functions.MapFunction;
+import org.apache.flink.api.java.DataSet;
+import org.apache.flink.api.java.tuple.Tuple1;
+import org.apache.flink.graph.Vertex;
+import org.apache.flink.graph.bipartite.BipartiteEdge;
+import org.apache.flink.graph.bipartite.BipartiteGraph;
+import org.apache.flink.util.Collector;
+import static 
org.apache.flink.api.java.functions.FunctionAnnotation.ForwardedFields;
+
+/**
+ * Checks that the edge set input contains valid vertex Ids, i.e. that they
+ * also exist in top and bottom vertex sets.
+ */
+public class InvalidBipartiteVertexIdsValidator 
extends BipartiteGraphValidator {
+
+   @Override
+   public boolean validate(BipartiteGraph 
bipartiteGraph) throws Exception {
+   DataSet edgesTopIds = 
bipartiteGraph.getEdges().map(new GetTopIdsMap());
--- End diff --

Can `GetTopIdsMap` be replaced with `.project(0)`?


> Implement BipartiteGraph validator
> --
>
> Key: FLINK-5104
> URL: https://issues.apache.org/jira/browse/FLINK-5104
> Project: Flink
>  Issue Type: Sub-task
>  Components: Gelly
>Reporter: Ivan Mushketyk
>Assignee: Ivan Mushketyk
>
> BipartiteGraph should have a validator similar to GraphValidator for Graph 
> class.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FLINK-5104) Implement BipartiteGraph validator

2016-12-12 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-5104?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15742661#comment-15742661
 ] 

ASF GitHub Bot commented on FLINK-5104:
---

Github user greghogan commented on a diff in the pull request:

https://github.com/apache/flink/pull/2985#discussion_r91994405
  
--- Diff: 
flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/validation/BipartiteGraphValidator.java
 ---
@@ -0,0 +1,42 @@
+/*
+ * 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.flink.graph.validation;
--- End diff --

Move to `org.apache.flink.graph.bipartite.validation`?


> Implement BipartiteGraph validator
> --
>
> Key: FLINK-5104
> URL: https://issues.apache.org/jira/browse/FLINK-5104
> Project: Flink
>  Issue Type: Sub-task
>  Components: Gelly
>Reporter: Ivan Mushketyk
>Assignee: Ivan Mushketyk
>
> BipartiteGraph should have a validator similar to GraphValidator for Graph 
> class.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FLINK-5104) Implement BipartiteGraph validator

2016-12-12 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-5104?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15742662#comment-15742662
 ] 

ASF GitHub Bot commented on FLINK-5104:
---

Github user greghogan commented on a diff in the pull request:

https://github.com/apache/flink/pull/2985#discussion_r91997234
  
--- Diff: 
flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/validation/InvalidBipartiteVertexIdsValidator.java
 ---
@@ -0,0 +1,85 @@
+/*
+ * 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.flink.graph.validation;
+
+import org.apache.flink.api.common.functions.CoGroupFunction;
+import org.apache.flink.api.common.functions.MapFunction;
+import org.apache.flink.api.java.DataSet;
+import org.apache.flink.api.java.tuple.Tuple1;
+import org.apache.flink.graph.Vertex;
+import org.apache.flink.graph.bipartite.BipartiteEdge;
+import org.apache.flink.graph.bipartite.BipartiteGraph;
+import org.apache.flink.util.Collector;
+import static 
org.apache.flink.api.java.functions.FunctionAnnotation.ForwardedFields;
+
+/**
+ * Checks that the edge set input contains valid vertex Ids, i.e. that they
+ * also exist in top and bottom vertex sets.
+ */
+public class InvalidBipartiteVertexIdsValidator 
extends BipartiteGraphValidator {
+
+   @Override
+   public boolean validate(BipartiteGraph 
bipartiteGraph) throws Exception {
+   DataSet edgesTopIds = 
bipartiteGraph.getEdges().map(new GetTopIdsMap());
+   DataSet edgesBottomIds = 
bipartiteGraph.getEdges().map(new GetBottomIdsMap());
+
+   DataSet invalidTopIds = 
invalidIds(bipartiteGraph.getTopVertices(), edgesTopIds);
+   DataSet invalidBottomIds = 
invalidIds(bipartiteGraph.getBottomVertices(), edgesBottomIds);
+
+   return invalidTopIds.count() == 0 && invalidBottomIds.count() 
== 0;
+   }
+
+   private  DataSet invalidIds(DataSet> topVertices, 
DataSet edgesIds) {
+   return topVertices.coGroup(edgesIds)
+   .where(0)
+   .equalTo(0)
+   .with(new CoGroupFunction, Tuple1, K>() {
+   @Override
+   public void coGroup(Iterable> 
vertices, Iterable edgeIds, Collector out) throws Exception {
+   if (!vertices.iterator().hasNext()) {
+   
out.collect(edgeIds.iterator().next().f0);
+   }
+   }
+   });
+   }
+
+   @ForwardedFields("f0")
+   private class GetTopIdsMap implements 
MapFunction, Tuple1> {
--- End diff --

Inner Flink functions should be `static` to prevent serialization of the 
outer class.


> Implement BipartiteGraph validator
> --
>
> Key: FLINK-5104
> URL: https://issues.apache.org/jira/browse/FLINK-5104
> Project: Flink
>  Issue Type: Sub-task
>  Components: Gelly
>Reporter: Ivan Mushketyk
>Assignee: Ivan Mushketyk
>
> BipartiteGraph should have a validator similar to GraphValidator for Graph 
> class.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FLINK-5104) Implement BipartiteGraph validator

2016-12-12 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-5104?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15742664#comment-15742664
 ] 

ASF GitHub Bot commented on FLINK-5104:
---

Github user greghogan commented on a diff in the pull request:

https://github.com/apache/flink/pull/2985#discussion_r91996140
  
--- Diff: 
flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/validation/InvalidBipartiteVertexIdsValidator.java
 ---
@@ -0,0 +1,85 @@
+/*
+ * 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.flink.graph.validation;
+
+import org.apache.flink.api.common.functions.CoGroupFunction;
+import org.apache.flink.api.common.functions.MapFunction;
+import org.apache.flink.api.java.DataSet;
+import org.apache.flink.api.java.tuple.Tuple1;
+import org.apache.flink.graph.Vertex;
+import org.apache.flink.graph.bipartite.BipartiteEdge;
+import org.apache.flink.graph.bipartite.BipartiteGraph;
+import org.apache.flink.util.Collector;
+import static 
org.apache.flink.api.java.functions.FunctionAnnotation.ForwardedFields;
+
+/**
+ * Checks that the edge set input contains valid vertex Ids, i.e. that they
+ * also exist in top and bottom vertex sets.
+ */
+public class InvalidBipartiteVertexIdsValidator 
extends BipartiteGraphValidator {
+
+   @Override
+   public boolean validate(BipartiteGraph 
bipartiteGraph) throws Exception {
+   DataSet edgesTopIds = 
bipartiteGraph.getEdges().map(new GetTopIdsMap());
+   DataSet edgesBottomIds = 
bipartiteGraph.getEdges().map(new GetBottomIdsMap());
+
+   DataSet invalidTopIds = 
invalidIds(bipartiteGraph.getTopVertices(), edgesTopIds);
+   DataSet invalidBottomIds = 
invalidIds(bipartiteGraph.getBottomVertices(), edgesBottomIds);
+
+   return invalidTopIds.count() == 0 && invalidBottomIds.count() 
== 0;
--- End diff --

`count()` executes the program so shouldn't be called twice. Could use an 
accumulator in `RichOutputFormat` instead.


> Implement BipartiteGraph validator
> --
>
> Key: FLINK-5104
> URL: https://issues.apache.org/jira/browse/FLINK-5104
> Project: Flink
>  Issue Type: Sub-task
>  Components: Gelly
>Reporter: Ivan Mushketyk
>Assignee: Ivan Mushketyk
>
> BipartiteGraph should have a validator similar to GraphValidator for Graph 
> class.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FLINK-5104) Implement BipartiteGraph validator

2016-12-11 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-5104?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15739414#comment-15739414
 ] 

ASF GitHub Bot commented on FLINK-5104:
---

Github user mushketyk commented on the issue:

https://github.com/apache/flink/pull/2985
  
I noticed that `Graph` has the following implementation of the `validate` 
method:

```java
public Boolean validate(GraphValidator validator) throws 
Exception {
return validator.validate(this);
}
```

What is the reason for returning `Boolean` instead of `boolean` here 
(GraphValidator returns `boolean`)?
Shouldn't we change the return value to `boolean`?


> Implement BipartiteGraph validator
> --
>
> Key: FLINK-5104
> URL: https://issues.apache.org/jira/browse/FLINK-5104
> Project: Flink
>  Issue Type: Sub-task
>  Components: Gelly
>Reporter: Ivan Mushketyk
>Assignee: Ivan Mushketyk
>
> BipartiteGraph should have a validator similar to GraphValidator for Graph 
> class.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FLINK-5104) Implement BipartiteGraph validator

2016-12-10 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-5104?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15738258#comment-15738258
 ] 

ASF GitHub Bot commented on FLINK-5104:
---

GitHub user mushketyk opened a pull request:

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

[FLINK-5104] Bipartite graph validation

Thanks for contributing to Apache Flink. Before you open your pull request, 
please take the following check list into consideration.
If your changes take all of the items into account, feel free to open your 
pull request. For more information and/or questions please refer to the [How To 
Contribute guide](http://flink.apache.org/how-to-contribute.html).
In addition to going through the list, please provide a meaningful 
description of your changes.

- [x] General
  - The pull request references the related JIRA issue ("[FLINK-XXX] Jira 
title text")
  - The pull request addresses only one issue
  - Each commit in the PR has a meaningful commit message (including the 
JIRA id)

- [x] Documentation
  - Documentation has been added for new functionality
  - Old documentation affected by the pull request has been updated
  - JavaDoc for public methods has been added

- [x] Tests & Build
  - Functionality added by the pull request is covered by tests
  - `mvn clean verify` has been executed successfully locally or a Travis 
build has passed


This PR duplicates some the user documentation for the graph added in 
https://github.com/apache/flink/pull/2984 but I think this won't be an issue 
when documentation PR is pushed to the `master`.


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

$ git pull https://github.com/mushketyk/flink bipartite-graph-validation

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

https://github.com/apache/flink/pull/2985.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 #2985


commit 9c49eed7960ec1a7a853b32b742bd36615ba5fc0
Author: Ivan Mushketyk 
Date:   2016-12-10T17:41:30Z

[FLINK-5311] Add user documentation for bipartite graph

commit 77e62ea23b4118069dcf468578cc03fc6e3acbff
Author: Ivan Mushketyk 
Date:   2016-11-20T12:40:25Z

[FLINK-5104] Implement BipartiteGraph validator




> Implement BipartiteGraph validator
> --
>
> Key: FLINK-5104
> URL: https://issues.apache.org/jira/browse/FLINK-5104
> Project: Flink
>  Issue Type: Sub-task
>  Components: Gelly
>Reporter: Ivan Mushketyk
>Assignee: Ivan Mushketyk
>
> BipartiteGraph should have a validator similar to GraphValidator for Graph 
> class.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FLINK-5104) Implement BipartiteGraph validator

2016-11-20 Thread Ivan Mushketyk (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-5104?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15681090#comment-15681090
 ] 

Ivan Mushketyk commented on FLINK-5104:
---

Implemented here: 
https://github.com/mushketyk/flink/tree/bipartite-graph-validation

> Implement BipartiteGraph validator
> --
>
> Key: FLINK-5104
> URL: https://issues.apache.org/jira/browse/FLINK-5104
> Project: Flink
>  Issue Type: Sub-task
>  Components: Gelly
>Reporter: Ivan Mushketyk
>Assignee: Ivan Mushketyk
>
> BipartiteGraph should have a validator similar to GraphValidator for Graph 
> class.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)