flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FLINK-3771) Methods for translating Graphs
Date Fri, 29 Apr 2016 14:11:12 GMT

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

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

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

    https://github.com/apache/flink/pull/1900#discussion_r61583101
  
    --- Diff: flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/asm/translate/LongValueAddOffset.java
---
    @@ -0,0 +1,50 @@
    +/*
    + * 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.asm.translate;
    +
    +import org.apache.flink.api.common.functions.MapFunction;
    +import org.apache.flink.types.LongValue;
    +
    +/**
    + * Translate {@link LongValue} by adding a constant offset value.
    + */
    +public class LongValueAddOffset
    +implements MapFunction<LongValue, LongValue> {
    +
    +	private final long offset;
    +
    +	private LongValue output = new LongValue();
    +
    +	/**
    +	 * Translate {@link LongValue} by adding a constant offset value.
    +	 *
    +	 * @param offset value to be added to each element
    +	 */
    +	public LongValueAddOffset(long offset) {
    +		this.offset = offset;
    +	}
    +
    +	@Override
    +	public LongValue map(LongValue value)
    +			throws Exception {
    +		output.setValue(offset + value.getValue());
    +
    --- End diff --
    
    Fixed in next push.


> Methods for translating Graphs
> ------------------------------
>
>                 Key: FLINK-3771
>                 URL: https://issues.apache.org/jira/browse/FLINK-3771
>             Project: Flink
>          Issue Type: New Feature
>          Components: Gelly
>    Affects Versions: 1.1.0
>            Reporter: Greg Hogan
>            Assignee: Greg Hogan
>             Fix For: 1.1.0
>
>
> Provide methods for translation of the type or value of graph labels, vertex values,
and edge values.
> Sample use cases:
> * shifting graph labels in order to union generated graphs or graphs read from multiple
sources
> * downsizing labels or values since algorithms prefer to generate wide types which may
be expensive for further computation
> * changing label type for testing or benchmarking alternative code paths



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

Mime
View raw message