You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@giraph.apache.org by Cristian Vidal Silva <vi...@msu.edu> on 2015/06/01 14:14:07 UTC

How To Define and Link New Input and Output Formats

Hey everyone.

Currently, I need to read vertices in the format [Id, Val1, Val2, 
[[taget1, weight1], [target2, weight2]..]], and I want out  simply 
simply , for each vertex, the sum of its values... For example, 
tiny_graph.txt is:

[0,1,2,[[1,1],[3,3]]]
[1,3,4,[[0,1],[2,2],[3,1]]]
[2,5,5,[[1,2],[4,4]]]
[3,6,7,[[0,3],[1,1],[4,4]]]
[4,8,9,[[3,4],[2,4]]]

So, the output would be like:
0,3
1,7
2,10
3,13
4,17

What must I do to achieve this goal? What classes Do I have to define? 
How Do I link these classes?

I hope to get replies to get this goal to advance on my research.

-- 
Cristian Vidal Silva
Computer Engineer
Master in Computer Science, University of Concepcion - Chile
Master of Science in Computer Science, Michigan State University, MI - USA
Ph.D(c) in Software Engineering and Technology, University of Seville - 
Spain

Chilean Fulbright Scholar

-- 
Cristian Vidal Silva
Computer Engineer
Master in Computer Science, University of Concepcion - Chile
Master of Science in Computer Science, Michigan State University, MI - USA
Ph.D(c) in Software Engineering and Technology, University of Seville - Spain

Chilean Fulbright Scholar


Re: How To Define and Link New Input and Output Formats

Posted by Laxmidhar <LA...@bigtappanalytics.com>.
On Friday 05 June 2015 07:07 AM, Unmesh Joshi wrote:
> You can have/extend your own VertexInputFormat class and parse according to
> the format of input file.
> It seems to me that you are using predefined input class which parses and
> stores data differently.
> On Jun 4, 2015 10:02 AM, "Cristian Vidal Silva" <vi...@msu.edu> wrote:
>
>> Mmmmm.... I can get vertexId and its 1st value, System.out.println("Vertex
>> Id: " + vertex.getId() + " - Value " + vertex.getValue()), but how can I
>> get the vertex 2nd value?
>>
>> Assist me please...
>>
>>
>> El 02/06/2015 a las 8:59, Laxmidhar escribió:
>>
>>> On Monday 01 June 2015 04:45 PM, Cristian Vidal Silva wrote:
>>>
>>>> Hey everyone.
>>>>
>>>> Currently, I need to read vertices in the format [Id, Val1, Val2,
>>>> [[taget1, weight1], [target2, weight2]..]], and I want out  simply
>>>> simply , for each vertex, the sum of its values... For example,
>>>> tiny_graph.txt is:
>>>>
>>>> [0,1,2,[[1,1],[3,3]]]
>>>> [1,3,4,[[0,1],[2,2],[3,1]]]
>>>> [2,5,5,[[1,2],[4,4]]]
>>>> [3,6,7,[[0,3],[1,1],[4,4]]]
>>>> [4,8,9,[[3,4],[2,4]]]
>>>>
>>>> So, the output would be like:
>>>> 0,3
>>>> 1,7
>>>> 2,10
>>>> 3,13
>>>> 4,17
>>>>
>>>> What must I do to achieve this goal? What classes Do I have to define?
>>>> How Do I link these classes?
>>>>
>>>> I hope to get replies to get this goal to advance on my research.
>>>>
>>>>  Hi Silva,
>>> No need of defining anything for that you need to change your logic in
>>> compute() method of your class.And take the 1st argument as your source
>>> id of your each line then add the value of its.
>>>
>>>
>>> Thanks
>>> Laxmidhar
>>>
>> --
>> Cristian Vidal Silva
>> Computer Engineer
>> Master in Computer Science, University of Concepcion - Chile
>> Master of Science in Computer Science, Michigan State University, MI - USA
>> Ph.D(c) in Software Engineering and Technology, University of Seville -
>> Spain
>>
>> Chilean Fulbright Scholar
>>
>>
Hi silva,
   You have to pass the Vertex as iterator and try to put it in a loop
for getting the value.I have not  tried but think it will help you.

Thanks
Laxmidhar

Re: How To Define and Link New Input and Output Formats

Posted by Unmesh Joshi <un...@gmail.com>.
You can have/extend your own VertexInputFormat class and parse according to
the format of input file.
It seems to me that you are using predefined input class which parses and
stores data differently.
On Jun 4, 2015 10:02 AM, "Cristian Vidal Silva" <vi...@msu.edu> wrote:

> Mmmmm.... I can get vertexId and its 1st value, System.out.println("Vertex
> Id: " + vertex.getId() + " - Value " + vertex.getValue()), but how can I
> get the vertex 2nd value?
>
> Assist me please...
>
>
> El 02/06/2015 a las 8:59, Laxmidhar escribió:
>
>> On Monday 01 June 2015 04:45 PM, Cristian Vidal Silva wrote:
>>
>>> Hey everyone.
>>>
>>> Currently, I need to read vertices in the format [Id, Val1, Val2,
>>> [[taget1, weight1], [target2, weight2]..]], and I want out  simply
>>> simply , for each vertex, the sum of its values... For example,
>>> tiny_graph.txt is:
>>>
>>> [0,1,2,[[1,1],[3,3]]]
>>> [1,3,4,[[0,1],[2,2],[3,1]]]
>>> [2,5,5,[[1,2],[4,4]]]
>>> [3,6,7,[[0,3],[1,1],[4,4]]]
>>> [4,8,9,[[3,4],[2,4]]]
>>>
>>> So, the output would be like:
>>> 0,3
>>> 1,7
>>> 2,10
>>> 3,13
>>> 4,17
>>>
>>> What must I do to achieve this goal? What classes Do I have to define?
>>> How Do I link these classes?
>>>
>>> I hope to get replies to get this goal to advance on my research.
>>>
>>>  Hi Silva,
>>
>> No need of defining anything for that you need to change your logic in
>> compute() method of your class.And take the 1st argument as your source
>> id of your each line then add the value of its.
>>
>>
>> Thanks
>> Laxmidhar
>>
>
> --
> Cristian Vidal Silva
> Computer Engineer
> Master in Computer Science, University of Concepcion - Chile
> Master of Science in Computer Science, Michigan State University, MI - USA
> Ph.D(c) in Software Engineering and Technology, University of Seville -
> Spain
>
> Chilean Fulbright Scholar
>
>

Re: How To Define and Link New Input and Output Formats

Posted by Cristian Vidal Silva <vi...@msu.edu>.
Mmmmm.... I can get vertexId and its 1st value, 
System.out.println("Vertex Id: " + vertex.getId() + " - Value " + 
vertex.getValue()), but how can I get the vertex 2nd value?

Assist me please...


El 02/06/2015 a las 8:59, Laxmidhar escribió:
> On Monday 01 June 2015 04:45 PM, Cristian Vidal Silva wrote:
>> Hey everyone.
>>
>> Currently, I need to read vertices in the format [Id, Val1, Val2,
>> [[taget1, weight1], [target2, weight2]..]], and I want out  simply
>> simply , for each vertex, the sum of its values... For example,
>> tiny_graph.txt is:
>>
>> [0,1,2,[[1,1],[3,3]]]
>> [1,3,4,[[0,1],[2,2],[3,1]]]
>> [2,5,5,[[1,2],[4,4]]]
>> [3,6,7,[[0,3],[1,1],[4,4]]]
>> [4,8,9,[[3,4],[2,4]]]
>>
>> So, the output would be like:
>> 0,3
>> 1,7
>> 2,10
>> 3,13
>> 4,17
>>
>> What must I do to achieve this goal? What classes Do I have to define?
>> How Do I link these classes?
>>
>> I hope to get replies to get this goal to advance on my research.
>>
> Hi Silva,
>
> No need of defining anything for that you need to change your logic in
> compute() method of your class.And take the 1st argument as your source
> id of your each line then add the value of its.
>
>
> Thanks
> Laxmidhar

-- 
Cristian Vidal Silva
Computer Engineer
Master in Computer Science, University of Concepcion - Chile
Master of Science in Computer Science, Michigan State University, MI - USA
Ph.D(c) in Software Engineering and Technology, University of Seville - Spain

Chilean Fulbright Scholar


Re: How To Define and Link New Input and Output Formats

Posted by Laxmidhar <LA...@bigtappanalytics.com>.
On Monday 01 June 2015 04:45 PM, Cristian Vidal Silva wrote:
> Hey everyone.
>
> Currently, I need to read vertices in the format [Id, Val1, Val2, 
> [[taget1, weight1], [target2, weight2]..]], and I want out  simply 
> simply , for each vertex, the sum of its values... For example, 
> tiny_graph.txt is:
>
> [0,1,2,[[1,1],[3,3]]]
> [1,3,4,[[0,1],[2,2],[3,1]]]
> [2,5,5,[[1,2],[4,4]]]
> [3,6,7,[[0,3],[1,1],[4,4]]]
> [4,8,9,[[3,4],[2,4]]]
>
> So, the output would be like:
> 0,3
> 1,7
> 2,10
> 3,13
> 4,17
>
> What must I do to achieve this goal? What classes Do I have to define? 
> How Do I link these classes?
>
> I hope to get replies to get this goal to advance on my research.
>
Hi Silva,

No need of defining anything for that you need to change your logic in
compute() method of your class.And take the 1st argument as your source
id of your each line then add the value of its.


Thanks
Laxmidhar