Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 2BD8A200B6F for ; Wed, 24 Aug 2016 15:30:23 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 2A934160AA4; Wed, 24 Aug 2016 13:30:23 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 71D4C160AC1 for ; Wed, 24 Aug 2016 15:30:22 +0200 (CEST) Received: (qmail 99935 invoked by uid 500); 24 Aug 2016 13:30:21 -0000 Mailing-List: contact issues-help@flink.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flink.apache.org Delivered-To: mailing list issues@flink.apache.org Received: (qmail 99910 invoked by uid 99); 24 Aug 2016 13:30:21 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 24 Aug 2016 13:30:21 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 547342C0152 for ; Wed, 24 Aug 2016 13:30:21 +0000 (UTC) Date: Wed, 24 Aug 2016 13:30:21 +0000 (UTC) From: "Greg Hogan (JIRA)" To: issues@flink.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (FLINK-4440) Make API for edge/vertex creation less verbose MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Wed, 24 Aug 2016 13:30:23 -0000 [ https://issues.apache.org/jira/browse/FLINK-4440?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15434938#comment-15434938 ] Greg Hogan commented on FLINK-4440: ----------------------------------- The referenced code from {{Graph}} could also use the diamond operator (as noted by IntelliJ): {code} out.collect(new Vertex<>(edge.f0, NullValue.getInstance())); out.collect(new Vertex<>(edge.f1, NullValue.getInstance())); {code} There are four uses of {{NullValue.getInstance()}} in {{Graph}}. The tests (({{HITSData}}, {{TriangleCountData}}, and {{LabelPropagationData}}) could be made to loop over an array to create the vertex and edge sets (as in {{AsmTestBase}} so as to only reference {{NullValue.getInstance()}} once. There is a cost to having a separate {{create}} method for constructing these classes. The current form is more verbose but also very clear. I expect most users to read input from sources such as {{GraphCsvReader}} which hide the assignment of {{NullValue}}. [~vkalavri] worked to build the {{Graph}} API and it would be good to hear her opinion. > Make API for edge/vertex creation less verbose > ---------------------------------------------- > > Key: FLINK-4440 > URL: https://issues.apache.org/jira/browse/FLINK-4440 > Project: Flink > Issue Type: Improvement > Components: Gelly > Reporter: Ivan Mushketyk > Assignee: Ivan Mushketyk > Priority: Trivial > > It would be better if one could create vertex/edges like this: > {code:java} > Vertex v = Vertex.create(42); > Edge e = Edge.create(5, 6); > {code} > Instead of this: > {code:java} > Vertex v = new Vertex(42, NullValue.getInstance()); > Edge e = new Edge(5, 6, NullValue.getInstance()); > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)