giraph-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nitay Joffe (JIRA)" <>
Subject [jira] [Commented] (GIRAPH-504) Create ComputeContext
Date Wed, 06 Feb 2013 04:13:16 GMT


Nitay Joffe commented on GIRAPH-504:

Overall looks good and I'm definitely for the general idea. Not sure if removing access to
WorkerContext is right, seems to me like it is useful to have access to a storage of per-worker
cross-thread data in the compute.

Why do you add ComputeContext to GraphState. Honestly I'm not clear anymore on what actually
belongs in GraphState. I mean is it at compute level, at worker level, at whole-graph level?
Seems unclear.

Why not make ComputeContext an interface with a setWorkerContext method (note you can probably
leave out getWorkerContext). The DefaultComputeContext can have the WorkerContext instance
and users can base their work off of that. Unless you have good reason I think as rule of
thumb it is better design to use interfaces everywhere (with abstract helper classes like
DefaultWorkerContext if desired) rather than abstract classes. The abstract class approach
tends to create huge trees (e.g. Vertex) that become cumbersome and are harder to understand
the modularity of later on, whereas interfaces are usually easier to break down into modules
and refactor cleanly.
> Create ComputeContext
> ---------------------
>                 Key: GIRAPH-504
>                 URL:
>             Project: Giraph
>          Issue Type: New Feature
>            Reporter: Maja Kabiljo
>            Assignee: Maja Kabiljo
>         Attachments: GIRAPH-504.diff
> Right now we have WorkerContext which is accessible from vertex.compute, but it's not
thread safe - usually if we want to use it with multithreaded computation we have to use synchronization.
Instead we can create a ComputeContext, which is going to have one instance per compute thread.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message