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

Marko A. Rodriguez commented on TINKERPOP3-691:
-----------------------------------------------

I believe you are talking about these two sets of Exceptions:

{code}
       public static UnsupportedOperationException 
adjacentVertexLabelsCanNotBeRead() {
            return new UnsupportedOperationException("The label of an adjacent 
vertex can not be read");
        }

        public static UnsupportedOperationException 
adjacentVertexPropertiesCanNotBeReadOrUpdated() {
            return new UnsupportedOperationException("The properties of an 
adjacent vertex can not be read or updated");
        }

        public static UnsupportedOperationException 
adjacentVertexEdgesAndVerticesCanNotBeReadOrUpdated() {
            return new UnsupportedOperationException("The edges and vertices of 
an adjacent vertex can not be read or updated");
        }
{code}

AND

{code}
        public static UnsupportedOperationException 
incidentAndAdjacentElementsCanNotBeAccessedInMapReduce() {
            return new UnsupportedOperationException("The computer is in 
MapReduce mode and a vertex's incident and adjacent elements can not be 
accessed");
        }

        public static UnsupportedOperationException 
vertexPropertiesCanNotBeUpdatedInMapReduce() {
            return new UnsupportedOperationException("The computer is in 
MapReduce mode and a vertex's properties can not be updated");
        }
{code}

................

The first set is with respects to adjacent vertices. Thus, these should only be 
thrown during `VertexProgram` execution. The second two are with respect to the 
current starVertex (not adjacents). In MapReduce, you can't access edges or 
update properties.

TinkerPop provides `ComputerGraph` as a helper to implement the behaviors. 
`Giraph`, `Spark`, and `TinkerGraph` all use this thin wrapper as the graph is 
always the same data structure, but its important that MapReduce behavior is 
different from VertexProgram behavior.

{code}
vertexProgram.execute(ComputerGraph.vertexProgram(vertex, this.vertexProgram), 
messenger, memory)
mapReduce.map(ComputerGraph.mapReduce(vertex), mapEmitter)
{code}



> TP3 is too prescriptive in exception
> ------------------------------------
>
>                 Key: TINKERPOP3-691
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP3-691
>             Project: TinkerPop 3
>          Issue Type: Improvement
>            Reporter: Matthias Broecheler
>            Priority: Minor
>
> In its current state, TP3 is extremely prescriptive about the exact type of 
> exception that should be thrown in certain situations. Sometimes these 
> exceptions are symptoms of the same behavior (i.e. accessing properties you 
> shouldn't) but are different based on the access path (i.e. there are 
> separate exceptions for MapReduce and VertexProgram when such access happens).
> This makes it cumbersome for vendors to implement TP3 because you have to 
> know in core datastructures where they are being used even though the 
> datastructure can be reused between components.
> An example of that is PreloadedVertex in Titan where we have to store in what 
> context such a vertex is used.



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

Reply via email to