atlas-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Prasad S Madugundu (JIRA)" <j...@apache.org>
Subject [jira] [Created] (ATLAS-1035) In some scenarios, creation of 2 instances with references between them in one call fails
Date Wed, 20 Jul 2016 07:26:20 GMT
Prasad  S Madugundu created ATLAS-1035:
------------------------------------------

             Summary: In some scenarios, creation of 2 instances with references between them
in one call fails
                 Key: ATLAS-1035
                 URL: https://issues.apache.org/jira/browse/ATLAS-1035
             Project: Atlas
          Issue Type: Improvement
            Reporter: Prasad  S Madugundu


If I create 2 instances that have references between them in one call, it fails with the following
exception:

SEVERE: org.apache.atlas.typesystem.exception.EntityNotFoundException: Could not find vertex
for Class Reference (type: ConnectorDirectoryModel_OMRSConnectorDirectory, id: <unassigned>)

Caused by: org.apache.atlas.repository.RepositoryException: org.apache.atlas.typesystem.exception.EntityNotFoundException:
Could not find vertex for Class Reference (type: ConnectorDirectoryModel_OMRSConnectorDirectory,
id: <unassigned>)
	at org.apache.atlas.repository.graph.GraphBackedMetadataRepository.createEntities(GraphBackedMetadataRepository.java:137)
	at org.apache.atlas.GraphTransactionInterceptor.invoke(GraphTransactionInterceptor.java:42)
	at org.apache.atlas.services.DefaultMetadataService.createEntities(DefaultMetadataService.java:337)
	at org.apache.atlas.services.DefaultMetadataService.createEntities(DefaultMetadataService.java:333)
	at org.apache.atlas.web.resources.EntityResource.submit(EntityResource.java:125)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)
	at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:205)
	at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)
	at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:302)
	at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)
	at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
	at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)
	at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1542)
	at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1473)
	at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1419)
	at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1409)
	at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:409)
	at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:558)
	at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:733)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
	at com.google.inject.servlet.ServletDefinition.doServiceImpl(ServletDefinition.java:287)
	at com.google.inject.servlet.ServletDefinition.doService(ServletDefinition.java:277)
	at com.google.inject.servlet.ServletDefinition.service(ServletDefinition.java:182)
	at com.google.inject.servlet.ManagedServletPipeline.service(ManagedServletPipeline.java:91)
	at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:85)
	at org.apache.atlas.web.filters.AuditFilter.doFilter(AuditFilter.java:71)
	at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
	at com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:119)
	at com.google.inject.servlet.GuiceFilter$1.call(GuiceFilter.java:133)
	at com.google.inject.servlet.GuiceFilter$1.call(GuiceFilter.java:130)
	at com.google.inject.servlet.GuiceFilter$Context.call(GuiceFilter.java:203)
	at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:130)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
	at org.eclipse.jetty.server.Server.handle(Server.java:499)
	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:310)
	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)
	at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)
	at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.atlas.typesystem.exception.EntityNotFoundException: Could not find vertex
for Class Reference (type: ConnectorDirectoryModel_OMRSConnectorDirectory, id: <unassigned>)
	at org.apache.atlas.repository.graph.TypedInstanceToGraphMapper.addOrUpdateClassVertex(TypedInstanceToGraphMapper.java:583)
	at org.apache.atlas.repository.graph.TypedInstanceToGraphMapper.addOrUpdateReference(TypedInstanceToGraphMapper.java:513)
	at org.apache.atlas.repository.graph.TypedInstanceToGraphMapper.mapAttributeToVertex(TypedInstanceToGraphMapper.java:217)
	at org.apache.atlas.repository.graph.TypedInstanceToGraphMapper.mapInstanceToVertex(TypedInstanceToGraphMapper.java:186)
	at org.apache.atlas.repository.graph.TypedInstanceToGraphMapper.addOrUpdateAttributesAndTraits(TypedInstanceToGraphMapper.java:168)
	at org.apache.atlas.repository.graph.TypedInstanceToGraphMapper.addOrUpdateAttributesAndTraits(TypedInstanceToGraphMapper.java:144)
	at org.apache.atlas.repository.graph.TypedInstanceToGraphMapper.mapTypedInstanceToGraph(TypedInstanceToGraphMapper.java:102)
	at org.apache.atlas.repository.graph.GraphBackedMetadataRepository.createEntities(GraphBackedMetadataRepository.java:132)
	... 53 more

Example:
I have the types as follows (Catalog has reference called connectorDirectory to ConnectoryDirectory
class):
{
    "typeName": "CatalogModel_OMRSCatalog",
    "definition": {
        "classTypes": [
            {
                "hierarchicalMetaTypeName": "org.apache.atlas.typesystem.types.ClassType",
                "typeName": "CatalogModel_OMRSCatalog",
                "typeDescription": "",
                "attributeDefinitions": [
                    {
                        "name": "connectorDirectory",
                        "dataTypeName": "ConnectorDirectoryModel_OMRSConnectorDirectory",
                        "multiplicity": "required",
                        "isComposite": false,
                        "isUnique": false,
                        "isIndexable": false,
                        "reverseAttributeName": null
                    }
                ]
            }
        ]
    },
}

If I create ConnectorDirectory first and then create Catalog, it works (note that while creating
Catalog, the ConnectorDirectory has ID):
[
    {
        "jsonClass": "org.apache.atlas.typesystem.json.InstanceSerialization$_Reference",
        "id": {
            "jsonClass": "org.apache.atlas.typesystem.json.InstanceSerialization$_Id",
            "id": "-1468998004536470000",
            "version": 0,
            "typeName": "ConnectorDirectory"
        },
        "typeName": "ConnectorDirectory",
        "values": {
            "name": "DefaultConnectorDirectory",
        },
    }
]

[

    {
        "jsonClass": "org.apache.atlas.typesystem.json.InstanceSerialization$_Reference",
        "id": {
            "jsonClass": "org.apache.atlas.typesystem.json.InstanceSerialization$_Id",
            "id": "-1468998006314995000",
            "version": 0,
            "typeName": "Catalog"
        },
        "typeName": "Catalog",
        "values": {
            "connectorDirectory": {
                "jsonClass": "org.apache.atlas.typesystem.json.InstanceSerialization$_Reference",
                "id": {
                    "jsonClass": "org.apache.atlas.typesystem.json.InstanceSerialization$_Id",
                    "id": "6b7f8949-f5ad-453b-bc57-e8929cc9dd2c",
                    "version": 0,
                    "typeName": "ConnectorDirectory"
                },
                "typeName": "ConnectorDirectory",
                "values": {
                    "name": "DefaultConnectorDirectory",
                },
            },
            "name": "DefaultCatalog",
        },
    }
]

But, If I create both Catalog and ConnectorDirectory in one call, it fails (in this case the
connectorDirectory does not have ID):
[
    {
        "jsonClass": "org.apache.atlas.typesystem.json.InstanceSerialization$_Reference",
        "id": {
            "jsonClass": "org.apache.atlas.typesystem.json.InstanceSerialization$_Id",
            "id": "-1468998163729034000",
            "version": 0,
            "typeName": "Catalog"
        },
        "typeName": "Catalog",
        "values": {
            "connectorDirectory": {
                "jsonClass": "org.apache.atlas.typesystem.json.InstanceSerialization$_Reference",
                "id": {
                    "jsonClass": "org.apache.atlas.typesystem.json.InstanceSerialization$_Id",
                    "id": "-1468998163731032000",
                    "version": 0,
                    "typeName": "ConnectorDirectory"
                },
                "typeName": "ConnectorDirectory",
                "values": {
                    "name": "DefaultConnectorDirectory",
                },
            },
            "name": "DefaultCatalog",
        },
    }
]





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

Mime
View raw message