Sparksee Exception searching edge - Invalid source.

13 views
Skip to first unread message

Ray Neiheiser

unread,
Sep 26, 2017, 4:02:11 PM9/26/17
to Sparksee
I'm getting the following exception running a query for edges in Sparksee:

java.lang.RuntimeException: [SPARKSEE: 9] Invalid source.
at com.sparsity.sparkseejavawrapJNI.sparksee_gdb_Graph_findEdge(Native Method)
at com.sparsity.sparksee.gdb.Graph.findEdge(Graph.java:247)
at main.java.com.bag.server.database.SparkseeDatabaseAccess.compareRelationship(SparkseeDatabaseAccess.java:304)
at main.java.com.bag.server.database.interfaces.IDatabaseAccess.equalHashRelationship(IDatabaseAccess.java:60)
at main.java.com.bag.server.database.interfaces.IDatabaseAccess.equalHash(IDatabaseAccess.java:41)
at main.java.com.bag.server.ConflictHandler.isCorrect(ConflictHandler.java:195)
at main.java.com.bag.server.ConflictHandler.checkForConflict(ConflictHandler.java:52)
at main.java.com.bag.server.GlobalClusterSlave.executeReadOnlyCommit(GlobalClusterSlave.java:314)
at main.java.com.bag.server.GlobalClusterSlave.handleReadOnlyCommit(GlobalClusterSlave.java:627)
at main.java.com.bag.server.GlobalClusterSlave.appExecuteUnordered(GlobalClusterSlave.java:603)
at bftsmart.tom.server.defaultservices.DefaultRecoverable.executeUnordered(DefaultRecoverable.java:417)
at bftsmart.tom.ServiceReplica.receiveReadonlyMessage(ServiceReplica.java:214)
at bftsmart.tom.core.DeliveryThread.deliverUnordered(DeliveryThread.java:289)
at bftsmart.tom.core.TOMLayer.requestReceived(TOMLayer.java:290)
at bftsmart.communication.client.netty.NettyClientServerCommunicationSystemServerSide.channelRead0(NettyClientServerCommunicationSystemServerSide.java:184)
at bftsmart.communication.client.netty.NettyClientServerCommunicationSystemServerSide.channelRead0(NettyClientServerCommunicationSystemServerSide.java:61)
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:292)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:278)
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:277)
at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:372)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:245)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:292)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:278)
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:962)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:131)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:528)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:485)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:399)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:371)
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:112)
at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:137)
at java.lang.Thread.run(Thread.java:748)


@Override
public boolean compareRelationship(final RelationshipStorage storage)
{
final Session sess = db.newSession();
final Graph graph = sess.getGraph();
final NodeStorage startNode = storage.getStartNode();
final NodeStorage endNode = storage.getEndNode();

final List<Long> objsStart = loadNodesAsIdList(graph, startNode);
final List<Long> objsEnd = loadNodesAsIdList(graph, endNode);

if (objsStart.isEmpty() || objsEnd.isEmpty())
{
sess.close();
return false;
}

final int relationshipTypeId = graph.findType(storage.getId());
try
{
long start = objsStart.get(0);
long end = objsEnd.get(0);

if (start <= 0 || end <= 0)
{
sess.close();
return false;
}

long oId = graph.findEdge(relationshipTypeId, start, end);
if (oId == 0)
return false;
return HashCreator.sha1FromRelationship(storage).equals(graph.getAttribute(oId, graph.findAttribute(Type.getGlobalType(), "hash")).getString());
}
catch (NoSuchAlgorithmException e)
{
Log.getLogger().warn("Couldn't execute SHA1 for node", e);
}
catch (RuntimeException e)
{
Log.getLogger().warn("Couldn't execute the query, return false", e);
}
finally
{
sess.close();
}
return false;
}

This happens on  long oId = graph.findEdge(relationshipTypeId, start, end);

which doesn't make any sense to me because it should definitely should be a valid source, its a valid edge ID in the end, no?

c3po.ac

unread,
Sep 27, 2017, 4:41:34 AM9/27/17
to Sparksee

Hi,


It looks like the "start" variable does not contain a valid node identifier. Sparksee edges need to go from a node to another node, and therefore, it will be considered invalid if it goes from another edge. So, both objects given to the FindEdge method must be valid node identifiers.


You should check how you get the start value and, if it's a valid object, then maybe it's an edge instead of a node.


You can verify it by getting the object type id (Graph.getObjectType), then getting the Type information (Graph.getType) and checking if the type (Type.getObjectType) is an Edge or a Node.


Best regards.



El dimarts, 26 setembre de 2017 22:02:11 UTC+2, Ray Neiheiser va escriure:
Reply all
Reply to author
Forward
0 new messages