You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@atlas.apache.org by ma...@apache.org on 2017/11/05 20:32:01 UTC

[39/40] atlas git commit: ATLAS-2251: Remove TypeSystem and related implementation, to avoid unncessary duplicate of type details in cache

ATLAS-2251: Remove TypeSystem and related implementation, to avoid unncessary duplicate of type details in cache


Project: http://git-wip-us.apache.org/repos/asf/atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/0877e47c
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/0877e47c
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/0877e47c

Branch: refs/heads/ATLAS-2251
Commit: 0877e47cc4fdf79befb9075e6db0464d1601061d
Parents: 37be53b
Author: Madhan Neethiraj <ma...@apache.org>
Authored: Fri Nov 3 22:45:05 2017 -0700
Committer: Madhan Neethiraj <ma...@apache.org>
Committed: Sun Nov 5 11:55:26 2017 -0800

----------------------------------------------------------------------
 .../atlas/falcon/bridge/FalconBridge.java       |    4 +-
 .../apache/atlas/falcon/hook/FalconHook.java    |    2 +-
 .../apache/atlas/falcon/hook/FalconHookIT.java  |   20 +-
 .../atlas/hbase/bridge/HBaseAtlasHook.java      |    2 +-
 .../apache/atlas/hbase/HBaseAtlasHookIT.java    |    2 +-
 .../atlas/hive/bridge/ColumnLineageUtils.java   |    2 +-
 .../atlas/hive/bridge/HiveMetaStoreBridge.java  |   18 +-
 .../org/apache/atlas/hive/hook/HiveHook.java    |    2 +-
 .../java/org/apache/atlas/hive/HiveITBase.java  |    4 +-
 .../hive/bridge/HiveMetaStoreBridgeTest.java    |    2 +-
 .../hive/bridge/HiveMetastoreBridgeIT.java      |    8 +-
 .../org/apache/atlas/hive/hook/HiveHookIT.java  |   13 +-
 .../org/apache/atlas/sqoop/hook/SqoopHook.java  |    2 +-
 .../apache/atlas/storm/hook/StormAtlasHook.java |    2 +-
 .../atlas/storm/hook/StormAtlasHookIT.java      |    2 +-
 .../main/java/org/apache/atlas/AtlasClient.java |   54 +-
 .../java/org/apache/atlas/EntityAuditEvent.java |   19 +-
 .../src/main/java/org/apache/atlas/SerDe.java   |   80 -
 .../java/org/apache/atlas/AtlasClientTest.java  |    6 +-
 .../org/apache/atlas/repository/Constants.java  |    7 +
 .../atlas/repository/graphdb/AtlasGraph.java    |   12 +-
 .../graphdb/janus/AtlasJanusGraph.java          |    6 +-
 .../repository/graphdb/titan0/Titan0Graph.java  |    6 +-
 .../repository/graphdb/titan1/Titan1Graph.java  |    6 +-
 .../v1/instance/AtlasSystemAttributes.java      |  123 ++
 .../org/apache/atlas/model/v1/instance/Id.java  |  171 +++
 .../atlas/model/v1/instance/Referenceable.java  |  201 +++
 .../apache/atlas/model/v1/instance/Struct.java  |  141 ++
 .../model/v1/typedef/AttributeDefinition.java   |  159 ++
 .../model/v1/typedef/ClassTypeDefinition.java   |   51 +
 .../model/v1/typedef/EnumTypeDefinition.java    |  174 +++
 .../v1/typedef/HierarchicalTypeDefinition.java  |   96 ++
 .../atlas/model/v1/typedef/Multiplicity.java    |  113 ++
 .../model/v1/typedef/StructTypeDefinition.java  |  119 ++
 .../model/v1/typedef/TraitTypeDefinition.java   |   51 +
 .../apache/atlas/model/v1/typedef/TypesDef.java |   91 ++
 .../java/org/apache/atlas/type/AtlasType.java   |  114 +-
 .../atlas/typesystem/types/DataTypes.java       |   33 +
 .../atlas/typesystem/types/utils/TypesUtil.java |  112 ++
 .../java/org/apache/atlas/hook/AtlasHook.java   |    6 +-
 .../AbstractMessageDeserializer.java            |   21 +-
 .../notification/AbstractNotification.java      |   12 +-
 .../notification/entity/EntityNotification.java |    9 +-
 .../entity/EntityNotificationImpl.java          |   83 +-
 .../notification/hook/HookNotification.java     |    8 +-
 .../apache/atlas/kafka/KafkaConsumerTest.java   |   14 +-
 .../atlas/kafka/KafkaNotificationTest.java      |    3 +-
 .../entity/EntityMessageDeserializerTest.java   |    9 +-
 .../entity/EntityNotificationImplTest.java      |   50 +-
 .../hook/HookMessageDeserializerTest.java       |   11 +-
 .../notification/hook/HookNotificationTest.java |    8 +-
 .../apache/atlas/GraphTransactionAdvisor.java   |   63 -
 .../atlas/discovery/DataSetLineageService.java  |  233 ---
 .../atlas/discovery/DiscoveryService.java       |   59 -
 .../atlas/discovery/EntityDiscoveryService.java |    8 +-
 .../apache/atlas/discovery/SearchIndexer.java   |    4 +-
 .../graph/DefaultGraphPersistenceStrategy.java  |  292 ----
 .../graph/GraphBackedDiscoveryService.java      |  269 ----
 .../gremlin/Gremlin2ExpressionFactory.java      |  379 -----
 .../gremlin/Gremlin3ExpressionFactory.java      |  485 ------
 .../atlas/gremlin/GremlinExpressionFactory.java |  658 ---------
 .../atlas/gremlin/optimizer/AliasFinder.java    |  103 --
 .../gremlin/optimizer/CallHierarchyVisitor.java |   62 -
 .../optimizer/ExpandAndsOptimization.java       |  127 --
 .../optimizer/ExpandOrsOptimization.java        |  588 --------
 .../gremlin/optimizer/ExpressionFinder.java     |   69 -
 .../gremlin/optimizer/FunctionGenerator.java    |  326 -----
 .../gremlin/optimizer/GremlinOptimization.java  |   48 -
 .../optimizer/GremlinQueryOptimizer.java        |  262 ----
 .../gremlin/optimizer/HasForbiddenType.java     |   52 -
 .../apache/atlas/gremlin/optimizer/IsOr.java    |   48 -
 .../atlas/gremlin/optimizer/IsOrParent.java     |   60 -
 .../gremlin/optimizer/OptimizationContext.java  |  116 --
 .../atlas/gremlin/optimizer/OrderFinder.java    |   68 -
 .../gremlin/optimizer/PathExpressionFinder.java |   61 -
 .../atlas/gremlin/optimizer/RangeFinder.java    |   68 -
 .../optimizer/RepeatExpressionFinder.java       |   65 -
 .../gremlin/optimizer/SplitPointFinder.java     |  161 --
 .../gremlin/optimizer/UpdatedExpressions.java   |   45 -
 .../org/apache/atlas/query/Expressions.java     |   45 +
 .../org/apache/atlas/query/GremlinQuery.java    |   42 +
 .../apache/atlas/query/GremlinTranslator.java   |   34 +
 .../org/apache/atlas/query/QueryParams.java     |   50 +
 .../org/apache/atlas/query/QueryParser.java     |   36 +
 .../org/apache/atlas/query/QueryProcessor.java  |   28 +
 .../atlas/query/SelectExpressionHelper.java     |   30 +
 .../atlas/repository/DiscoverInstances.java     |   77 -
 .../apache/atlas/repository/IRepository.java    |   51 -
 .../atlas/repository/MetadataRepository.java    |  198 ---
 .../repository/RepositoryConfiguration.java     |   37 -
 .../repository/audit/EntityAuditListener.java   |  115 +-
 .../audit/InMemoryEntityAuditRepository.java    |   84 --
 .../audit/NoopEntityAuditRepository.java        |   63 -
 .../AtlasClassificationFormatConverter.java     |   18 +-
 .../converters/AtlasEntityFormatConverter.java  |   88 +-
 .../converters/AtlasEnumFormatConverter.java    |    6 +-
 .../converters/AtlasInstanceConverter.java      |  186 +--
 .../converters/AtlasObjectIdConverter.java      |   58 +-
 .../converters/AtlasStructFormatConverter.java  |  131 +-
 .../converters/TypeConverterUtil.java           |  259 ++--
 .../atlas/repository/graph/DeleteHandler.java   |  468 ------
 .../atlas/repository/graph/EntityProcessor.java |   82 --
 .../atlas/repository/graph/FullTextMapper.java  |  174 ---
 .../repository/graph/FullTextMapperV2.java      |    4 +-
 .../graph/GraphBackedMetadataRepository.java    |  505 -------
 .../graph/GraphBackedSearchIndexer.java         |  386 ++---
 .../atlas/repository/graph/GraphHelper.java     |  171 +--
 .../graph/GraphSchemaInitializer.java           |   50 -
 .../graph/GraphToTypedInstanceMapper.java       |  452 ------
 .../repository/graph/HardDeleteHandler.java     |   48 -
 .../repository/graph/SoftDeleteHandler.java     |   74 -
 .../graph/TypedInstanceToGraphMapper.java       |  941 ------------
 .../repository/graph/VertexLookupContext.java   |  166 ---
 .../repository/memory/AttributeStores.java      |  632 --------
 .../atlas/repository/memory/ClassStore.java     |   93 --
 .../memory/HierarchicalTypeStore.java           |  207 ---
 .../repository/memory/IAttributeStore.java      |   49 -
 .../atlas/repository/memory/MemRepository.java  |  299 ----
 .../memory/ReplaceIdWithInstance.java           |  132 --
 .../atlas/repository/memory/StructStore.java    |   87 --
 .../atlas/repository/memory/TraitStore.java     |   57 -
 .../graph/v1/AtlasEntityChangeNotifier.java     |   44 +-
 .../store/graph/v1/AtlasGraphUtilsV1.java       |    2 +-
 .../store/graph/v1/AtlasStructDefStoreV1.java   |   12 +-
 .../typestore/GraphBackedTypeStore.java         |  394 -----
 .../atlas/repository/typestore/ITypeStore.java  |   53 -
 .../repository/typestore/StorageException.java  |   35 -
 .../typestore/StoreBackedTypeCache.java         |  239 ---
 .../typestore/TypePersistenceVisitor.java       |  116 --
 .../repository/typestore/TypeVertexFinder.java  |  103 --
 .../repository/typestore/TypeVertexInfo.java    |   94 --
 .../atlas/repository/typestore/TypeVisitor.java |   96 --
 .../atlas/services/DefaultMetadataService.java  |  821 -----------
 .../atlas/util/AtlasGremlin2QueryProvider.java  |   14 +-
 .../util/AtlasRepositoryConfiguration.java      |   28 -
 .../apache/atlas/util/AttributeValueMap.java    |    4 +-
 .../atlas/util/CompiledQueryCacheKey.java       |   87 --
 .../org/apache/atlas/util/IndexedInstance.java  |    8 +-
 .../org/apache/atlas/util/NoopGremlinQuery.java |   39 -
 .../org/apache/atlas/util/TypeDefSorter.java    |   83 --
 .../org/apache/atlas/query/ClosureQuery.scala   |  327 -----
 .../org/apache/atlas/query/Expressions.scala    |  923 ------------
 .../query/GraphPersistenceStrategies.scala      |  367 -----
 .../apache/atlas/query/GremlinEvaluator.scala   |  186 ---
 .../org/apache/atlas/query/GremlinQuery.scala   |  806 ----------
 .../org/apache/atlas/query/QueryParser.scala    |  557 -------
 .../org/apache/atlas/query/QueryProcessor.scala |  143 --
 .../scala/org/apache/atlas/query/Resolver.scala |  182 ---
 .../org/apache/atlas/query/TypeUtils.scala      |  279 ----
 .../org/apache/atlas/BaseRepositoryTest.java    |  428 ------
 .../test/java/org/apache/atlas/DBSandboxer.java |   53 -
 .../atlas/RepositoryServiceLoadingTest.java     |   39 -
 .../test/java/org/apache/atlas/TestModules.java |   66 +-
 .../test/java/org/apache/atlas/TestUtils.java   |  778 ----------
 .../discovery/DataSetLineageServiceTest.java    |  497 -------
 .../discovery/EntityDiscoveryServiceTest.java   |  144 --
 .../GraphBackedDiscoveryServiceTest.java        | 1334 -----------------
 .../atlas/lineage/EntityLineageServiceTest.java |  356 -----
 .../apache/atlas/query/QueryProcessorTest.java  |  157 --
 .../org/apache/atlas/repository/BaseTest.java   |   30 -
 .../audit/AuditRepositoryTestBase.java          |  110 --
 .../audit/HBaseBasedAuditRepositoryHATest.java  |   96 --
 .../audit/HBaseBasedAuditRepositoryTest.java    |   72 -
 .../atlas/repository/audit/HBaseTestUtils.java  |   53 -
 .../audit/InMemoryAuditRepositoryTest.java      |   28 -
 .../AbstractGremlinQueryOptimizerTest.java      |  708 ---------
 ...hBackedMetadataRepositoryDeleteTestBase.java | 1205 ---------------
 .../GraphBackedMetadataRepositoryTest.java      |  915 ------------
 .../GraphBackedRepositoryHardDeleteTest.java    |  212 ---
 .../GraphBackedRepositorySoftDeleteTest.java    |  239 ---
 .../graph/GraphBackedSearchIndexerMockTest.java |   91 --
 .../graph/GraphBackedSearchIndexerTest.java     |  177 ---
 .../repository/graph/GraphHelperMockTest.java   |  121 --
 .../atlas/repository/graph/GraphHelperTest.java |  218 ---
 .../graph/GraphRepoMapperScaleTest.java         |  241 ---
 .../graph/Gremlin2QueryOptimizerTest.java       |  364 -----
 .../graph/Gremlin3QueryOptimizerTest.java       |  367 -----
 .../ReverseReferenceUpdateHardDeleteTest.java   |   46 -
 .../ReverseReferenceUpdateSoftDeleteTest.java   |   79 -
 .../graph/ReverseReferenceUpdateTestBase.java   |  275 ----
 .../atlas/repository/graph/TestIntSequence.java |   35 -
 .../impexp/AtlasImportRequestTest.java          |  145 --
 .../repository/impexp/ExportServiceTest.java    |  358 -----
 .../repository/impexp/ImportServiceTest.java    |  224 ---
 .../impexp/ImportServiceTestUtils.java          |  116 --
 .../impexp/ImportTransformerJSONTest.java       |   47 -
 .../impexp/ImportTransformerTest.java           |  131 --
 .../repository/impexp/ImportTransformsTest.java |  151 --
 .../impexp/TypeAttributeDifferenceTest.java     |  150 --
 .../atlas/repository/impexp/UniqueListTest.java |   69 -
 .../impexp/ZipFileResourceTestUtils.java        |  220 ---
 .../atlas/repository/impexp/ZipSinkTest.java    |  210 ---
 .../atlas/repository/impexp/ZipSourceTest.java  |  189 ---
 .../store/graph/AtlasTypeDefGraphStoreTest.java |  644 --------
 .../graph/v1/AtlasDeleteHandlerV1Test.java      | 1141 ---------------
 .../graph/v1/AtlasEntityDefStoreV1Test.java     |   72 -
 ...AtlasEntityStoreV1BulkImportPercentTest.java |  167 ---
 .../store/graph/v1/AtlasEntityStoreV1Test.java  | 1049 -------------
 .../v1/AtlasRelationshipDefStoreV1Test.java     |  330 -----
 .../AtlasRelationshipStoreHardDeleteV1Test.java |  112 --
 .../AtlasRelationshipStoreSoftDeleteV1Test.java |  116 --
 .../graph/v1/AtlasRelationshipStoreV1Test.java  |  623 --------
 .../store/graph/v1/HardDeleteHandlerV1Test.java |  177 ---
 .../InverseReferenceUpdateHardDeleteV1Test.java |   75 -
 .../InverseReferenceUpdateSoftDeleteV1Test.java |   78 -
 .../graph/v1/InverseReferenceUpdateV1Test.java  |  380 -----
 .../store/graph/v1/SoftDeleteHandlerV1Test.java |  215 ---
 .../typestore/GraphBackedTypeStoreTest.java     |  256 ----
 .../typestore/StoreBackedTypeCacheTest.java     |  169 ---
 .../userprofile/UserProfileServiceTest.java     |  280 ----
 .../service/DefaultMetadataServiceTest.java     | 1381 ------------------
 ...StoreBackedTypeCacheMetadataServiceTest.java |  143 --
 .../atlas/services/MetricsServiceTest.java      |  123 --
 .../atlas/util/CompiledQueryCacheKeyTest.java   |  104 --
 .../java/org/apache/atlas/utils/HiveModel.java  |  303 ----
 .../utils/ObjectUpdateSynchronizerTest.java     |  218 ---
 .../org/apache/atlas/query/ExpressionTest.scala |  172 ---
 .../org/apache/atlas/query/GremlinTest.scala    | 1068 --------------
 .../org/apache/atlas/query/GremlinTest2.scala   |  154 --
 .../apache/atlas/query/HiveTitanSample.scala    |  243 ---
 .../org/apache/atlas/query/LexerTest.scala      |   49 -
 .../apache/atlas/query/LineageQueryTest.scala   |  541 -------
 .../org/apache/atlas/query/ParserTest.scala     |  100 --
 .../apache/atlas/query/QueryTestsUtils.scala    |  206 ---
 .../java/org/apache/atlas/RequestContext.java   |  197 ---
 .../java/org/apache/atlas/RequestContextV1.java |   38 +-
 .../apache/atlas/discovery/LineageService.java  |   75 -
 .../atlas/listener/EntityChangeListener.java    |   16 +-
 .../atlas/listener/TypesChangeListener.java     |   10 +-
 .../apache/atlas/services/MetadataService.java  |  317 ----
 .../exception/EntityExistsException.java        |   32 -
 .../NullRequiredAttributeException.java         |   59 -
 .../org/apache/atlas/typesystem/IInstance.java  |   41 -
 .../typesystem/IReferenceableInstance.java      |   38 -
 .../org/apache/atlas/typesystem/IStruct.java    |   26 -
 .../apache/atlas/typesystem/ITypedInstance.java |   88 --
 .../typesystem/ITypedReferenceableInstance.java |   22 -
 .../apache/atlas/typesystem/ITypedStruct.java   |   22 -
 .../apache/atlas/typesystem/Referenceable.java  |  229 ---
 .../org/apache/atlas/typesystem/Struct.java     |  124 --
 .../persistence/AtlasSystemAttributes.java      |  115 --
 .../persistence/DownCastStructInstance.java     |   80 -
 .../apache/atlas/typesystem/persistence/Id.java |  307 ----
 .../atlas/typesystem/persistence/MapIds.java    |   70 -
 .../persistence/ReferenceableInstance.java      |  135 --
 .../typesystem/persistence/StructInstance.java  |  790 ----------
 .../typesystem/types/AbstractDataType.java      |  119 --
 .../typesystem/types/AttributeDefinition.java   |   81 -
 .../atlas/typesystem/types/AttributeInfo.java   |  134 --
 .../atlas/typesystem/types/ClassType.java       |  259 ----
 .../atlas/typesystem/types/DataTypes.java       |  655 ---------
 .../typesystem/types/DownCastFieldMapping.java  |   52 -
 .../apache/atlas/typesystem/types/EnumType.java |  121 --
 .../typesystem/types/EnumTypeDefinition.java    |   64 -
 .../atlas/typesystem/types/EnumValue.java       |   65 -
 .../atlas/typesystem/types/FieldMapping.java    |  162 --
 .../typesystem/types/HierarchicalType.java      |  545 -------
 .../types/HierarchicalTypeDefinition.java       |   74 -
 .../types/HierarchicalTypeDependencySorter.java |   75 -
 .../typesystem/types/IConstructableType.java    |   34 -
 .../atlas/typesystem/types/IDataType.java       |   61 -
 .../atlas/typesystem/types/Multiplicity.java    |   90 --
 .../typesystem/types/ObjectGraphTraversal.java  |  199 ---
 .../typesystem/types/ObjectGraphWalker.java     |  226 ---
 .../atlas/typesystem/types/StructType.java      |  280 ----
 .../typesystem/types/StructTypeDefinition.java  |   84 --
 .../atlas/typesystem/types/TraitType.java       |  104 --
 .../atlas/typesystem/types/TypeSystem.java      |  821 -----------
 .../typesystem/types/TypeUpdateException.java   |   39 -
 .../atlas/typesystem/types/TypeUtils.java       |  136 --
 .../typesystem/types/TypedStructHandler.java    |  115 --
 .../types/ValueConversionException.java         |   63 -
 .../types/cache/DefaultTypeCache.java           |  301 ----
 .../atlas/typesystem/types/cache/TypeCache.java |  153 --
 .../atlas/typesystem/types/utils/TypesUtil.java |  158 --
 .../org/apache/atlas/typesystem/TypesDef.scala  |   62 -
 .../typesystem/builders/InstanceBuilder.scala   |  217 ---
 .../typesystem/builders/TypesBuilder.scala      |  188 ---
 .../typesystem/json/InstanceSerialization.scala |  374 -----
 .../atlas/typesystem/json/Serialization.scala   |  348 -----
 .../typesystem/json/TypesSerialization.scala    |  270 ----
 .../apache/atlas/ApplicationPropertiesTest.java |   83 --
 .../typesystem/json/SerializationJavaTest.java  |  166 ---
 .../apache/atlas/typesystem/types/BaseTest.java |  190 ---
 .../atlas/typesystem/types/ClassTest.java       |  124 --
 .../apache/atlas/typesystem/types/EnumTest.java |  245 ----
 .../typesystem/types/FieldMappingTest.java      |  151 --
 .../HierarchicalTypeDependencySorterTest.java   |   81 -
 .../typesystem/types/HierarchicalTypeTest.java  |   92 --
 .../atlas/typesystem/types/StructTest.java      |  126 --
 .../atlas/typesystem/types/TraitTest.java       |  247 ----
 .../typesystem/types/TypeInheritanceTest.java   |  252 ----
 .../atlas/typesystem/types/TypeSystemTest.java  |  327 -----
 .../typesystem/types/TypeUpdateBaseTest.java    |   98 --
 .../atlas/typesystem/types/ValidationTest.java  |  102 --
 .../types/cache/DefaultTypeCacheTest.java       |  450 ------
 .../atlas/typesystem/builders/BuilderTest.scala |   81 -
 .../builders/InstanceBuilderTest.scala          |  105 --
 .../typesystem/builders/MultiplicityTest.scala  |  124 --
 .../typesystem/builders/TypesBuilderTest.scala  |   33 -
 .../json/InstanceSerializationTest.scala        |  164 ---
 .../typesystem/json/SerializationTest.scala     |  263 ----
 .../json/TypesSerializationTest.scala           |  342 -----
 .../org/apache/atlas/examples/QuickStart.java   |  110 +-
 .../NotificationEntityChangeListener.java       |   98 +-
 .../notification/NotificationHookConsumer.java  |   14 +-
 .../web/filters/AtlasAuthenticationFilter.java  |    4 +-
 .../apache/atlas/web/filters/AuditFilter.java   |    7 +-
 .../web/resources/DataSetLineageResource.java   |  201 ---
 .../atlas/web/resources/EntityResource.java     |  156 +-
 .../atlas/web/resources/LineageResource.java    |  218 ---
 .../resources/MetadataDiscoveryResource.java    |  409 ------
 .../atlas/web/resources/TypesResource.java      |    6 +-
 .../org/apache/atlas/web/util/LineageUtils.java |   19 +-
 .../org/apache/atlas/examples/QuickStartIT.java |    4 +-
 .../notification/EntityNotificationIT.java      |   36 +-
 .../NotificationEntityChangeListenerTest.java   |   35 +-
 .../NotificationHookConsumerIT.java             |    4 +-
 .../NotificationHookConsumerKafkaTest.java      |    2 +-
 .../NotificationHookConsumerTest.java           |    2 +-
 .../org/apache/atlas/util/RestUtilsTest.java    |  212 ---
 .../atlas/web/adapters/TestEntitiesREST.java    |    2 -
 .../atlas/web/adapters/TestEntityREST.java      |    2 -
 .../AtlasAuthenticationKerberosFilterTest.java  |    4 +-
 .../atlas/web/integration/BaseResourceIT.java   |  184 ++-
 .../DataSetLineageJerseyResourceIT.java         |   35 +-
 .../EntityDiscoveryJerseyResourceIT.java        |   27 +-
 .../web/integration/EntityJerseyResourceIT.java |  114 +-
 .../EntityLineageJerseyResourceIT.java          |    4 +-
 .../integration/EntityV2JerseyResourceIT.java   |   12 +-
 .../MetadataDiscoveryJerseyResourceIT.java      |   33 +-
 .../integration/TypedefsJerseyResourceIT.java   |    5 +-
 .../web/integration/TypesJerseyResourceIT.java  |  129 +-
 333 files changed, 3345 insertions(+), 54180 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/atlas/blob/0877e47c/addons/falcon-bridge/src/main/java/org/apache/atlas/falcon/bridge/FalconBridge.java
----------------------------------------------------------------------
diff --git a/addons/falcon-bridge/src/main/java/org/apache/atlas/falcon/bridge/FalconBridge.java b/addons/falcon-bridge/src/main/java/org/apache/atlas/falcon/bridge/FalconBridge.java
index ff74559..cd61c9b 100644
--- a/addons/falcon-bridge/src/main/java/org/apache/atlas/falcon/bridge/FalconBridge.java
+++ b/addons/falcon-bridge/src/main/java/org/apache/atlas/falcon/bridge/FalconBridge.java
@@ -24,7 +24,7 @@ import org.apache.atlas.falcon.Util.EventUtil;
 import org.apache.atlas.falcon.model.FalconDataTypes;
 import org.apache.atlas.hive.bridge.HiveMetaStoreBridge;
 import org.apache.atlas.hive.model.HiveDataTypes;
-import org.apache.atlas.typesystem.Referenceable;
+import org.apache.atlas.model.v1.instance.Referenceable;
 import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.falcon.FalconException;
@@ -204,8 +204,6 @@ public class FalconBridge {
      * 
      * @param process process entity
      * @param falconStore config store
-     * @param user falcon user
-     * @param timestamp timestamp of entity
      * @return process instance reference
      *
      * @throws FalconException if retrieving from the configuration store fail

http://git-wip-us.apache.org/repos/asf/atlas/blob/0877e47c/addons/falcon-bridge/src/main/java/org/apache/atlas/falcon/hook/FalconHook.java
----------------------------------------------------------------------
diff --git a/addons/falcon-bridge/src/main/java/org/apache/atlas/falcon/hook/FalconHook.java b/addons/falcon-bridge/src/main/java/org/apache/atlas/falcon/hook/FalconHook.java
index 188b754..54335e0 100644
--- a/addons/falcon-bridge/src/main/java/org/apache/atlas/falcon/hook/FalconHook.java
+++ b/addons/falcon-bridge/src/main/java/org/apache/atlas/falcon/hook/FalconHook.java
@@ -25,8 +25,8 @@ import org.apache.atlas.falcon.event.FalconEvent;
 import org.apache.atlas.falcon.publisher.FalconEventPublisher;
 import org.apache.atlas.hook.AtlasHook;
 import org.apache.atlas.kafka.NotificationProvider;
+import org.apache.atlas.model.v1.instance.Referenceable;
 import org.apache.atlas.notification.hook.HookNotification;
-import org.apache.atlas.typesystem.Referenceable;
 import org.apache.falcon.FalconException;
 import org.apache.falcon.entity.store.ConfigurationStore;
 import org.apache.falcon.entity.v0.feed.Feed;

http://git-wip-us.apache.org/repos/asf/atlas/blob/0877e47c/addons/falcon-bridge/src/test/java/org/apache/atlas/falcon/hook/FalconHookIT.java
----------------------------------------------------------------------
diff --git a/addons/falcon-bridge/src/test/java/org/apache/atlas/falcon/hook/FalconHookIT.java b/addons/falcon-bridge/src/test/java/org/apache/atlas/falcon/hook/FalconHookIT.java
index 7212921..baa2ad2 100644
--- a/addons/falcon-bridge/src/test/java/org/apache/atlas/falcon/hook/FalconHookIT.java
+++ b/addons/falcon-bridge/src/test/java/org/apache/atlas/falcon/hook/FalconHookIT.java
@@ -26,9 +26,9 @@ import org.apache.atlas.falcon.bridge.FalconBridge;
 import org.apache.atlas.falcon.model.FalconDataTypes;
 import org.apache.atlas.hive.bridge.HiveMetaStoreBridge;
 import org.apache.atlas.hive.model.HiveDataTypes;
-import org.apache.atlas.typesystem.Referenceable;
-import org.apache.atlas.typesystem.persistence.Id;
-import org.apache.atlas.typesystem.types.TypeUtils;
+import org.apache.atlas.model.v1.instance.Id;
+import org.apache.atlas.model.v1.instance.Referenceable;
+import org.apache.atlas.typesystem.types.utils.TypesUtil;
 import org.apache.atlas.utils.AuthenticationUtil;
 import org.apache.atlas.utils.ParamChecker;
 import org.apache.commons.configuration.Configuration;
@@ -162,7 +162,7 @@ public class FalconHookIT {
                 AtlasClient.REFERENCEABLE_ATTRIBUTE_NAME, cluster.getName());
     }
 
-    private TypeUtils.Pair<String, Feed> getHDFSFeed(String feedResource, String clusterName) throws Exception {
+    private TypesUtil.Pair<String, Feed> getHDFSFeed(String feedResource, String clusterName) throws Exception {
         Feed feed = loadEntity(EntityType.FEED, feedResource, "feed" + random());
         org.apache.falcon.entity.v0.feed.Cluster feedCluster = feed.getClusters().getClusters().get(0);
         feedCluster.setName(clusterName);
@@ -174,9 +174,9 @@ public class FalconHookIT {
                 AtlasClient.REFERENCEABLE_ATTRIBUTE_NAME,
                 FalconBridge.getFeedQualifiedName(feed.getName(), clusterName));
         Referenceable processEntity = atlasClient.getEntity(processId);
-        assertEquals(((List<Id>)processEntity.get("outputs")).get(0).getId()._getId(), feedId);
+        assertEquals(((List<Id>)processEntity.get("outputs")).get(0).getId(), feedId);
 
-        String inputId = ((List<Id>) processEntity.get("inputs")).get(0).getId()._getId();
+        String inputId = ((List<Id>) processEntity.get("inputs")).get(0).getId();
         Referenceable pathEntity = atlasClient.getEntity(inputId);
         assertEquals(pathEntity.getTypeName(), HiveMetaStoreBridge.HDFS_PATH);
 
@@ -185,7 +185,7 @@ public class FalconHookIT {
         assertEquals(pathEntity.get(AtlasClient.REFERENCEABLE_ATTRIBUTE_NAME),
                 FalconBridge.normalize(dataLocation.getPath()));
 
-        return TypeUtils.Pair.of(feedId, feed);
+        return TypesUtil.Pair.of(feedId, feed);
     }
 
     private Feed getTableFeed(String feedResource, String clusterName) throws Exception {
@@ -236,9 +236,9 @@ public class FalconHookIT {
                 AtlasClient.REFERENCEABLE_ATTRIBUTE_NAME,
                 FalconBridge.getFeedQualifiedName(feedName, clusterName));
         Referenceable processEntity = atlasClient.getEntity(processId);
-        assertEquals(((List<Id>)processEntity.get("outputs")).get(0).getId()._getId(), feedId);
+        assertEquals(((List<Id>)processEntity.get("outputs")).get(0).getId(), feedId);
 
-        String inputId = ((List<Id>) processEntity.get("inputs")).get(0).getId()._getId();
+        String inputId = ((List<Id>) processEntity.get("inputs")).get(0).getId();
         Referenceable tableEntity = atlasClient.getEntity(inputId);
         assertEquals(tableEntity.getTypeName(), HiveDataTypes.HIVE_TABLE.getName());
         assertEquals(tableEntity.get(AtlasClient.REFERENCEABLE_ATTRIBUTE_NAME),
@@ -280,7 +280,7 @@ public class FalconHookIT {
         Cluster cluster = loadEntity(EntityType.CLUSTER, CLUSTER_RESOURCE, "cluster" + random());
         STORE.publish(EntityType.CLUSTER, cluster);
 
-        TypeUtils.Pair<String, Feed> result = getHDFSFeed(FEED_HDFS_RESOURCE, cluster.getName());
+        TypesUtil.Pair<String, Feed> result = getHDFSFeed(FEED_HDFS_RESOURCE, cluster.getName());
         Feed infeed = result.right;
         String infeedId = result.left;
 

http://git-wip-us.apache.org/repos/asf/atlas/blob/0877e47c/addons/hbase-bridge/src/main/java/org/apache/atlas/hbase/bridge/HBaseAtlasHook.java
----------------------------------------------------------------------
diff --git a/addons/hbase-bridge/src/main/java/org/apache/atlas/hbase/bridge/HBaseAtlasHook.java b/addons/hbase-bridge/src/main/java/org/apache/atlas/hbase/bridge/HBaseAtlasHook.java
index 8c7481a..a16e6ae 100644
--- a/addons/hbase-bridge/src/main/java/org/apache/atlas/hbase/bridge/HBaseAtlasHook.java
+++ b/addons/hbase-bridge/src/main/java/org/apache/atlas/hbase/bridge/HBaseAtlasHook.java
@@ -23,8 +23,8 @@ import org.apache.atlas.AtlasConstants;
 import org.apache.atlas.hbase.model.HBaseOperationContext;
 import org.apache.atlas.hbase.model.HBaseDataTypes;
 import org.apache.atlas.hook.AtlasHook;
+import org.apache.atlas.model.v1.instance.Referenceable;
 import org.apache.atlas.notification.hook.HookNotification;
-import org.apache.atlas.typesystem.Referenceable;
 import org.apache.commons.configuration.Configuration;
 import org.apache.hadoop.hbase.HTableDescriptor;
 import org.apache.hadoop.hbase.HColumnDescriptor;

http://git-wip-us.apache.org/repos/asf/atlas/blob/0877e47c/addons/hbase-bridge/src/test/java/org/apache/atlas/hbase/HBaseAtlasHookIT.java
----------------------------------------------------------------------
diff --git a/addons/hbase-bridge/src/test/java/org/apache/atlas/hbase/HBaseAtlasHookIT.java b/addons/hbase-bridge/src/test/java/org/apache/atlas/hbase/HBaseAtlasHookIT.java
index 032cb51..abdf502 100644
--- a/addons/hbase-bridge/src/test/java/org/apache/atlas/hbase/HBaseAtlasHookIT.java
+++ b/addons/hbase-bridge/src/test/java/org/apache/atlas/hbase/HBaseAtlasHookIT.java
@@ -22,7 +22,7 @@ import org.apache.atlas.ApplicationProperties;
 import org.apache.atlas.AtlasClient;
 import org.apache.atlas.hbase.bridge.HBaseAtlasHook;
 import org.apache.atlas.hbase.model.HBaseDataTypes;
-import org.apache.atlas.typesystem.Referenceable;
+import org.apache.atlas.model.v1.instance.Referenceable;
 import org.apache.atlas.utils.AuthenticationUtil;
 import org.apache.atlas.utils.ParamChecker;
 import org.apache.hadoop.conf.Configuration;

http://git-wip-us.apache.org/repos/asf/atlas/blob/0877e47c/addons/hive-bridge/src/main/java/org/apache/atlas/hive/bridge/ColumnLineageUtils.java
----------------------------------------------------------------------
diff --git a/addons/hive-bridge/src/main/java/org/apache/atlas/hive/bridge/ColumnLineageUtils.java b/addons/hive-bridge/src/main/java/org/apache/atlas/hive/bridge/ColumnLineageUtils.java
index 663fcdc..0aab7b8 100644
--- a/addons/hive-bridge/src/main/java/org/apache/atlas/hive/bridge/ColumnLineageUtils.java
+++ b/addons/hive-bridge/src/main/java/org/apache/atlas/hive/bridge/ColumnLineageUtils.java
@@ -20,7 +20,7 @@ package org.apache.atlas.hive.bridge;
 
 import org.apache.atlas.AtlasClient;
 import org.apache.atlas.hive.model.HiveDataTypes;
-import org.apache.atlas.typesystem.Referenceable;
+import org.apache.atlas.model.v1.instance.Referenceable;
 import org.apache.hadoop.hive.ql.hooks.LineageInfo;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;

http://git-wip-us.apache.org/repos/asf/atlas/blob/0877e47c/addons/hive-bridge/src/main/java/org/apache/atlas/hive/bridge/HiveMetaStoreBridge.java
----------------------------------------------------------------------
diff --git a/addons/hive-bridge/src/main/java/org/apache/atlas/hive/bridge/HiveMetaStoreBridge.java b/addons/hive-bridge/src/main/java/org/apache/atlas/hive/bridge/HiveMetaStoreBridge.java
index d2d2fb5..8d34492 100755
--- a/addons/hive-bridge/src/main/java/org/apache/atlas/hive/bridge/HiveMetaStoreBridge.java
+++ b/addons/hive-bridge/src/main/java/org/apache/atlas/hive/bridge/HiveMetaStoreBridge.java
@@ -27,10 +27,10 @@ import org.apache.atlas.AtlasServiceException;
 import org.apache.atlas.hive.hook.HiveHook;
 import org.apache.atlas.hive.model.HiveDataTypes;
 import org.apache.atlas.hook.AtlasHookException;
-import org.apache.atlas.typesystem.Referenceable;
-import org.apache.atlas.typesystem.Struct;
-import org.apache.atlas.typesystem.json.InstanceSerialization;
-import org.apache.atlas.typesystem.persistence.Id;
+import org.apache.atlas.model.v1.instance.Id;
+import org.apache.atlas.model.v1.instance.Referenceable;
+import org.apache.atlas.model.v1.instance.Struct;
+import org.apache.atlas.type.AtlasType;
 import org.apache.atlas.utils.AuthenticationUtil;
 import org.apache.commons.cli.BasicParser;
 import org.apache.commons.cli.CommandLine;
@@ -170,7 +170,7 @@ public class HiveMetaStoreBridge {
                 dbRef = createDBInstance(db);
                 dbRef = registerInstance(dbRef);
             } else {
-                LOG.info("Database {} is already registered with id {}. Updating it.", databaseName, dbRef.getId().id);
+                LOG.info("Database {} is already registered with id {}. Updating it.", databaseName, dbRef.getId().getId());
                 dbRef = createOrUpdateDBInstance(db, dbRef);
                 updateInstance(dbRef);
             }
@@ -208,7 +208,7 @@ public class HiveMetaStoreBridge {
         String typeName = referenceable.getTypeName();
         LOG.debug("creating instance of type {}", typeName);
 
-        String entityJSON = InstanceSerialization.toJson(referenceable, true);
+        String entityJSON = AtlasType.toV1Json(referenceable);
         LOG.debug("Submitting new entity {} = {}", referenceable.getTypeName(), entityJSON);
         List<String> guids = getAtlasClient().createEntity(entityJSON);
         LOG.debug("created instance for type {}, guid: {}", typeName, guids);
@@ -506,7 +506,7 @@ public class HiveMetaStoreBridge {
                 tableReference = registerInstance(tableReference);
             } else {
                 LOG.info("Table {}.{} is already registered with id {}. Updating entity.", dbName, tableName,
-                        tableReference.getId().id);
+                        tableReference.getId().getId());
                 tableReference = createOrUpdateTableInstance(dbReference, tableReference, table);
                 updateInstance(tableReference);
             }
@@ -520,10 +520,10 @@ public class HiveMetaStoreBridge {
         String typeName = referenceable.getTypeName();
         LOG.debug("updating instance of type {}", typeName);
 
-        String entityJSON = InstanceSerialization.toJson(referenceable, true);
+        String entityJSON = AtlasType.toV1Json(referenceable);
         LOG.debug("Updating entity {} = {}", referenceable.getTypeName(), entityJSON);
 
-        atlasClient.updateEntity(referenceable.getId().id, referenceable);
+        atlasClient.updateEntity(referenceable.getId().getId(), referenceable);
     }
 
     public Referenceable fillStorageDesc(StorageDescriptor storageDesc, String tableQualifiedName,

http://git-wip-us.apache.org/repos/asf/atlas/blob/0877e47c/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/HiveHook.java
----------------------------------------------------------------------
diff --git a/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/HiveHook.java b/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/HiveHook.java
index 0e8284d..18e7950 100755
--- a/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/HiveHook.java
+++ b/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/HiveHook.java
@@ -28,8 +28,8 @@ import org.apache.atlas.hive.bridge.HiveMetaStoreBridge;
 import org.apache.atlas.hive.model.HiveDataTypes;
 import org.apache.atlas.hook.AtlasHook;
 import org.apache.atlas.hook.AtlasHookException;
+import org.apache.atlas.model.v1.instance.Referenceable;
 import org.apache.atlas.notification.hook.HookNotification;
-import org.apache.atlas.typesystem.Referenceable;
 import org.apache.commons.lang.StringUtils;
 import org.apache.commons.lang3.tuple.Pair;
 import org.apache.hadoop.fs.Path;

http://git-wip-us.apache.org/repos/asf/atlas/blob/0877e47c/addons/hive-bridge/src/test/java/org/apache/atlas/hive/HiveITBase.java
----------------------------------------------------------------------
diff --git a/addons/hive-bridge/src/test/java/org/apache/atlas/hive/HiveITBase.java b/addons/hive-bridge/src/test/java/org/apache/atlas/hive/HiveITBase.java
index 0d163ee..608b6a0 100644
--- a/addons/hive-bridge/src/test/java/org/apache/atlas/hive/HiveITBase.java
+++ b/addons/hive-bridge/src/test/java/org/apache/atlas/hive/HiveITBase.java
@@ -23,8 +23,8 @@ import org.apache.atlas.AtlasClient;
 import org.apache.atlas.hive.bridge.HiveMetaStoreBridge;
 import org.apache.atlas.hive.hook.HiveHookIT;
 import org.apache.atlas.hive.model.HiveDataTypes;
-import org.apache.atlas.typesystem.Referenceable;
-import org.apache.atlas.typesystem.persistence.Id;
+import org.apache.atlas.model.v1.instance.Referenceable;
+import org.apache.atlas.model.v1.instance.Id;
 import org.apache.atlas.utils.AuthenticationUtil;
 import org.apache.atlas.utils.ParamChecker;
 import org.apache.commons.configuration.Configuration;

http://git-wip-us.apache.org/repos/asf/atlas/blob/0877e47c/addons/hive-bridge/src/test/java/org/apache/atlas/hive/bridge/HiveMetaStoreBridgeTest.java
----------------------------------------------------------------------
diff --git a/addons/hive-bridge/src/test/java/org/apache/atlas/hive/bridge/HiveMetaStoreBridgeTest.java b/addons/hive-bridge/src/test/java/org/apache/atlas/hive/bridge/HiveMetaStoreBridgeTest.java
index 0256cf3..aed2644 100644
--- a/addons/hive-bridge/src/test/java/org/apache/atlas/hive/bridge/HiveMetaStoreBridgeTest.java
+++ b/addons/hive-bridge/src/test/java/org/apache/atlas/hive/bridge/HiveMetaStoreBridgeTest.java
@@ -21,7 +21,7 @@ package org.apache.atlas.hive.bridge;
 import org.apache.atlas.AtlasClient;
 import org.apache.atlas.AtlasServiceException;
 import org.apache.atlas.hive.model.HiveDataTypes;
-import org.apache.atlas.typesystem.Referenceable;
+import org.apache.atlas.model.v1.instance.Referenceable;
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.hive.metastore.TableType;
 import org.apache.hadoop.hive.metastore.api.Database;

http://git-wip-us.apache.org/repos/asf/atlas/blob/0877e47c/addons/hive-bridge/src/test/java/org/apache/atlas/hive/bridge/HiveMetastoreBridgeIT.java
----------------------------------------------------------------------
diff --git a/addons/hive-bridge/src/test/java/org/apache/atlas/hive/bridge/HiveMetastoreBridgeIT.java b/addons/hive-bridge/src/test/java/org/apache/atlas/hive/bridge/HiveMetastoreBridgeIT.java
index d09db1b..83c195e 100644
--- a/addons/hive-bridge/src/test/java/org/apache/atlas/hive/bridge/HiveMetastoreBridgeIT.java
+++ b/addons/hive-bridge/src/test/java/org/apache/atlas/hive/bridge/HiveMetastoreBridgeIT.java
@@ -21,8 +21,8 @@ package org.apache.atlas.hive.bridge;
 import org.apache.atlas.AtlasClient;
 import org.apache.atlas.hive.HiveITBase;
 import org.apache.atlas.hive.model.HiveDataTypes;
-import org.apache.atlas.typesystem.Referenceable;
-import org.apache.atlas.typesystem.persistence.Id;
+import org.apache.atlas.model.v1.instance.Referenceable;
+import org.apache.atlas.model.v1.instance.Id;
 import org.testng.annotations.Test;
 
 import java.util.List;
@@ -50,7 +50,7 @@ public class HiveMetastoreBridgeIT extends HiveITBase {
 
         List<Id> outputs = (List<Id>) processReference.get(OUTPUTS);
         assertEquals(outputs.size(), 1);
-        assertEquals(outputs.get(0).getId()._getId(), tableId);
+        assertEquals(outputs.get(0).getId(), tableId);
 
         int tableCount = atlasClient.listEntities(HiveDataTypes.HIVE_TABLE.getName()).size();
 
@@ -84,6 +84,6 @@ public class HiveMetastoreBridgeIT extends HiveITBase {
                 getTableProcessQualifiedName(DEFAULT_DB, tableName), null);
         List<Id> outputs = (List<Id>) atlasClient.getEntity(processId).get(OUTPUTS);
         assertEquals(outputs.size(), 1);
-        assertEquals(outputs.get(0).getId()._getId(), tableId);
+        assertEquals(outputs.get(0).getId(), tableId);
     }
 }

http://git-wip-us.apache.org/repos/asf/atlas/blob/0877e47c/addons/hive-bridge/src/test/java/org/apache/atlas/hive/hook/HiveHookIT.java
----------------------------------------------------------------------
diff --git a/addons/hive-bridge/src/test/java/org/apache/atlas/hive/hook/HiveHookIT.java b/addons/hive-bridge/src/test/java/org/apache/atlas/hive/hook/HiveHookIT.java
index f7404ae..0e4a61b 100755
--- a/addons/hive-bridge/src/test/java/org/apache/atlas/hive/hook/HiveHookIT.java
+++ b/addons/hive-bridge/src/test/java/org/apache/atlas/hive/hook/HiveHookIT.java
@@ -26,11 +26,10 @@ import org.apache.atlas.AtlasServiceException;
 import org.apache.atlas.hive.HiveITBase;
 import org.apache.atlas.hive.bridge.HiveMetaStoreBridge;
 import org.apache.atlas.hive.model.HiveDataTypes;
-import org.apache.atlas.typesystem.Referenceable;
-import org.apache.atlas.typesystem.Struct;
-import org.apache.atlas.typesystem.persistence.Id;
-import org.apache.atlas.typesystem.types.TypeSystem;
-import org.apache.commons.lang.RandomStringUtils;
+import org.apache.atlas.model.typedef.AtlasBaseTypeDef;
+import org.apache.atlas.model.v1.instance.Id;
+import org.apache.atlas.model.v1.instance.Struct;
+import org.apache.atlas.model.v1.instance.Referenceable;
 import org.apache.commons.lang.StringUtils;
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.hive.metastore.TableType;
@@ -182,7 +181,7 @@ public class HiveHookIT extends HiveITBase {
     private void verifyTimestamps(Referenceable ref, String property, long expectedTime) throws ParseException {
         //Verify timestamps.
         String createTimeStr = (String) ref.get(property);
-        Date createDate = TypeSystem.getInstance().getDateFormat().parse(createTimeStr);
+        Date createDate = AtlasBaseTypeDef.DATE_FORMATTER.parse(createTimeStr);
         Assert.assertNotNull(createTimeStr);
 
         if (expectedTime > 0) {
@@ -1262,7 +1261,7 @@ public class HiveHookIT extends HiveITBase {
         String guid2 = assertColumnIsRegistered(HiveMetaStoreBridge.getColumnQualifiedName(tbqn, "id_new"));
         assertEquals(guid2, guid);
 
-        assertTrue(atlasClient.getEntity(guid2).getTraits().contains(trait));
+        assertTrue(atlasClient.getEntity(guid2).getTraitNames().contains(trait));
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/atlas/blob/0877e47c/addons/sqoop-bridge/src/main/java/org/apache/atlas/sqoop/hook/SqoopHook.java
----------------------------------------------------------------------
diff --git a/addons/sqoop-bridge/src/main/java/org/apache/atlas/sqoop/hook/SqoopHook.java b/addons/sqoop-bridge/src/main/java/org/apache/atlas/sqoop/hook/SqoopHook.java
index 50e20fa..79c0177 100644
--- a/addons/sqoop-bridge/src/main/java/org/apache/atlas/sqoop/hook/SqoopHook.java
+++ b/addons/sqoop-bridge/src/main/java/org/apache/atlas/sqoop/hook/SqoopHook.java
@@ -26,9 +26,9 @@ import org.apache.atlas.hive.bridge.HiveMetaStoreBridge;
 import org.apache.atlas.hive.model.HiveDataTypes;
 import org.apache.atlas.hook.AtlasHook;
 import org.apache.atlas.hook.AtlasHookException;
+import org.apache.atlas.model.v1.instance.Referenceable;
 import org.apache.atlas.notification.hook.HookNotification;
 import org.apache.atlas.sqoop.model.SqoopDataTypes;
-import org.apache.atlas.typesystem.Referenceable;
 import org.apache.commons.configuration.Configuration;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.sqoop.SqoopJobDataPublisher;

http://git-wip-us.apache.org/repos/asf/atlas/blob/0877e47c/addons/storm-bridge/src/main/java/org/apache/atlas/storm/hook/StormAtlasHook.java
----------------------------------------------------------------------
diff --git a/addons/storm-bridge/src/main/java/org/apache/atlas/storm/hook/StormAtlasHook.java b/addons/storm-bridge/src/main/java/org/apache/atlas/storm/hook/StormAtlasHook.java
index c3df8fc..4114323 100644
--- a/addons/storm-bridge/src/main/java/org/apache/atlas/storm/hook/StormAtlasHook.java
+++ b/addons/storm-bridge/src/main/java/org/apache/atlas/storm/hook/StormAtlasHook.java
@@ -18,6 +18,7 @@
 
 package org.apache.atlas.storm.hook;
 
+import org.apache.atlas.model.v1.instance.Referenceable;
 import org.apache.storm.ISubmitterHook;
 import org.apache.storm.generated.Bolt;
 import org.apache.storm.generated.SpoutSpec;
@@ -29,7 +30,6 @@ import org.apache.atlas.AtlasConstants;
 import org.apache.atlas.hive.bridge.HiveMetaStoreBridge;
 import org.apache.atlas.hook.AtlasHook;
 import org.apache.atlas.storm.model.StormDataTypes;
-import org.apache.atlas.typesystem.Referenceable;
 import org.apache.commons.lang.StringUtils;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.Path;

http://git-wip-us.apache.org/repos/asf/atlas/blob/0877e47c/addons/storm-bridge/src/test/java/org/apache/atlas/storm/hook/StormAtlasHookIT.java
----------------------------------------------------------------------
diff --git a/addons/storm-bridge/src/test/java/org/apache/atlas/storm/hook/StormAtlasHookIT.java b/addons/storm-bridge/src/test/java/org/apache/atlas/storm/hook/StormAtlasHookIT.java
index e0800b8..3ff3052 100644
--- a/addons/storm-bridge/src/test/java/org/apache/atlas/storm/hook/StormAtlasHookIT.java
+++ b/addons/storm-bridge/src/test/java/org/apache/atlas/storm/hook/StormAtlasHookIT.java
@@ -21,8 +21,8 @@ package org.apache.atlas.storm.hook;
 import org.apache.atlas.ApplicationProperties;
 import org.apache.atlas.AtlasClient;
 import org.apache.atlas.hive.bridge.HiveMetaStoreBridge;
+import org.apache.atlas.model.v1.instance.Referenceable;
 import org.apache.atlas.storm.model.StormDataTypes;
-import org.apache.atlas.typesystem.Referenceable;
 import org.apache.atlas.utils.AuthenticationUtil;
 import org.apache.commons.configuration.Configuration;
 import org.apache.storm.ILocalCluster;

http://git-wip-us.apache.org/repos/asf/atlas/blob/0877e47c/client/client-v1/src/main/java/org/apache/atlas/AtlasClient.java
----------------------------------------------------------------------
diff --git a/client/client-v1/src/main/java/org/apache/atlas/AtlasClient.java b/client/client-v1/src/main/java/org/apache/atlas/AtlasClient.java
index 8bbc89b..c3f8602 100644
--- a/client/client-v1/src/main/java/org/apache/atlas/AtlasClient.java
+++ b/client/client-v1/src/main/java/org/apache/atlas/AtlasClient.java
@@ -19,19 +19,16 @@
 package org.apache.atlas;
 
 import com.google.common.annotations.VisibleForTesting;
-import com.google.common.collect.ImmutableSet;
 import com.sun.jersey.api.client.WebResource;
 import org.apache.atlas.model.legacy.EntityResult;
-import org.apache.atlas.typesystem.Referenceable;
-import org.apache.atlas.typesystem.Struct;
-import org.apache.atlas.typesystem.TypesDef;
-import org.apache.atlas.typesystem.json.InstanceSerialization;
-import org.apache.atlas.typesystem.json.TypesSerialization;
-import org.apache.atlas.typesystem.types.AttributeDefinition;
-import org.apache.atlas.typesystem.types.DataTypes;
-import org.apache.atlas.typesystem.types.HierarchicalTypeDefinition;
-import org.apache.atlas.typesystem.types.TraitType;
+import org.apache.atlas.model.v1.instance.Referenceable;
+import org.apache.atlas.model.v1.instance.Struct;
+import org.apache.atlas.model.v1.typedef.AttributeDefinition;
+import org.apache.atlas.model.v1.typedef.TraitTypeDefinition;
+import org.apache.atlas.model.v1.typedef.TypesDef;
 import org.apache.atlas.typesystem.types.utils.TypesUtil;
+import org.apache.atlas.type.AtlasType;
+import org.apache.atlas.typesystem.types.DataTypes;
 import org.apache.commons.configuration.Configuration;
 import org.apache.commons.lang.StringUtils;
 import org.apache.hadoop.security.UserGroupInformation;
@@ -45,10 +42,7 @@ import javax.ws.rs.HttpMethod;
 import javax.ws.rs.core.Cookie;
 import javax.ws.rs.core.MultivaluedMap;
 import javax.ws.rs.core.Response;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.List;
+import java.util.*;
 
 /**
  * Client for metadata.
@@ -276,7 +270,7 @@ public class AtlasClient extends AtlasBaseClient {
      * @throws AtlasServiceException
      */
     public List<String> createType(TypesDef typeDef) throws AtlasServiceException {
-        return createType(TypesSerialization.toJson(typeDef));
+        return createType(AtlasType.toV1Json(typeDef));
     }
 
     /**
@@ -287,11 +281,11 @@ public class AtlasClient extends AtlasBaseClient {
      * @return the list of types created
      * @throws AtlasServiceException
      */
-    public List<String> createTraitType(String traitName, ImmutableSet<String> superTraits, AttributeDefinition... attributeDefinitions) throws AtlasServiceException {
-        HierarchicalTypeDefinition<TraitType> piiTrait =
-                TypesUtil.createTraitTypeDef(traitName, superTraits, attributeDefinitions);
+    public List<String> createTraitType(String traitName, Set<String> superTraits, AttributeDefinition... attributeDefinitions) throws AtlasServiceException {
+        TraitTypeDefinition piiTrait =
+                TypesUtil.createTraitTypeDef(traitName, null, superTraits, Arrays.asList(attributeDefinitions));
 
-        String traitDefinitionAsJSON = TypesSerialization.toJson(piiTrait, true);
+        String traitDefinitionAsJSON = AtlasType.toV1Json(piiTrait);
         LOG.debug("Creating trait type {} {}", traitName, traitDefinitionAsJSON);
         return createType(traitDefinitionAsJSON);
     }
@@ -332,7 +326,7 @@ public class AtlasClient extends AtlasBaseClient {
      * @throws AtlasServiceException
      */
     public List<String> updateType(TypesDef typeDef) throws AtlasServiceException {
-        return updateType(TypesSerialization.toJson(typeDef));
+        return updateType(AtlasType.toV1Json(typeDef));
     }
 
     /**
@@ -396,7 +390,7 @@ public class AtlasClient extends AtlasBaseClient {
         try {
             JSONObject response = callAPIWithBodyAndParams(API_V1.GET_TYPE, null, typeName);
             String     typeJson = response.getString(DEFINITION);
-            return TypesSerialization.fromJson(typeJson);
+            return AtlasType.fromV1Json(typeJson, TypesDef.class);
         } catch (JSONException e) {
             throw new AtlasServiceException(e);
         }
@@ -442,7 +436,7 @@ public class AtlasClient extends AtlasBaseClient {
     private JSONArray getEntitiesArray(Collection<Referenceable> entities) {
         JSONArray entityArray = new JSONArray(entities.size());
         for (Referenceable entity : entities) {
-            entityArray.put(InstanceSerialization.toJson(entity, true));
+            entityArray.put(AtlasType.toV1Json(entity));
         }
         return entityArray;
     }
@@ -500,7 +494,7 @@ public class AtlasClient extends AtlasBaseClient {
      * @param entity entity definition
      */
     public EntityResult updateEntity(String guid, Referenceable entity) throws AtlasServiceException {
-        String entityJson = InstanceSerialization.toJson(entity, true);
+        String entityJson = AtlasType.toV1Json(entity);
         LOG.debug("Updating entity id {} with {}", guid, entityJson);
         JSONObject response = callAPIWithBodyAndParams(API_V1.UPDATE_ENTITY_PARTIAL, entityJson, guid);
         return extractEntityResult(response);
@@ -513,7 +507,7 @@ public class AtlasClient extends AtlasBaseClient {
      * @param traitDefinition trait definition
      */
     public void addTrait(String guid, Struct traitDefinition) throws AtlasServiceException {
-        String traitJson = InstanceSerialization.toJson(traitDefinition, true);
+        String traitJson = AtlasType.toV1Json(traitDefinition);
         LOG.debug("Adding trait to entity with id {} {}", guid, traitJson);
         callAPIWithBodyAndParams(API_V1.ADD_TRAITS, traitJson, guid, URI_TRAITS);
     }
@@ -540,7 +534,7 @@ public class AtlasClient extends AtlasBaseClient {
                                      final String uniqueAttributeValue,
                                      Referenceable entity) throws AtlasServiceException {
         final API api        = API_V1.UPDATE_ENTITY_PARTIAL;
-        String    entityJson = InstanceSerialization.toJson(entity, true);
+        String    entityJson = AtlasType.toV1Json(entity);
         LOG.debug("Updating entity type: {}, attributeName: {}, attributeValue: {}, entity: {}", entityType,
                   uniqueAttributeName, uniqueAttributeValue, entityJson);
         JSONObject response = callAPIWithRetries(api, entityJson, new ResourceCreator() {
@@ -623,7 +617,7 @@ public class AtlasClient extends AtlasBaseClient {
         JSONObject jsonResponse = callAPIWithBodyAndParams(API_V1.GET_ENTITY, null, guid);
         try {
             String entityInstanceDefinition = jsonResponse.getString(AtlasClient.DEFINITION);
-            return InstanceSerialization.fromJsonReferenceable(entityInstanceDefinition, true);
+            return AtlasType.fromV1Json(entityInstanceDefinition, Referenceable.class);
         } catch (JSONException e) {
             throw new AtlasServiceException(API_V1.GET_ENTITY, e);
         }
@@ -660,7 +654,7 @@ public class AtlasClient extends AtlasBaseClient {
         });
         try {
             String entityInstanceDefinition = jsonResponse.getString(AtlasClient.DEFINITION);
-            return InstanceSerialization.fromJsonReferenceable(entityInstanceDefinition, true);
+            return AtlasType.fromV1Json(entityInstanceDefinition, Referenceable.class);
         } catch (JSONException e) {
             throw new AtlasServiceException(api, e);
         }
@@ -706,7 +700,7 @@ public class AtlasClient extends AtlasBaseClient {
         List<JSONObject>  traitDefList    = extractResults(jsonResponse, AtlasClient.RESULTS, new ExtractOperation<JSONObject, JSONObject>());
         ArrayList<Struct> traitStructList = new ArrayList<>();
         for (JSONObject traitDef : traitDefList) {
-            Struct traitStruct = InstanceSerialization.fromJsonStruct(traitDef.toString(), true);
+            Struct traitStruct = AtlasType.fromV1Json(traitDef.toString(), Struct.class);
             traitStructList.add(traitStruct);
         }
         return traitStructList;
@@ -723,7 +717,7 @@ public class AtlasClient extends AtlasBaseClient {
         JSONObject jsonResponse = callAPIWithBodyAndParams(API_V1.GET_TRAIT_DEFINITION, null, guid, TRAIT_DEFINITIONS, traitName);
 
         try {
-            return InstanceSerialization.fromJsonStruct(jsonResponse.getString(AtlasClient.RESULTS), false);
+            return AtlasType.fromV1Json(jsonResponse.getString(AtlasClient.RESULTS), Struct.class);
         } catch (JSONException e) {
             throw new AtlasServiceException(API_V1.GET_TRAIT_DEFINITION, e);
         }
@@ -782,7 +776,7 @@ public class AtlasClient extends AtlasBaseClient {
         return extractResults(jsonResponse, AtlasClient.EVENTS, new ExtractOperation<EntityAuditEvent, JSONObject>() {
             @Override
             EntityAuditEvent extractElement(JSONObject element) throws JSONException {
-                return SerDe.GSON.fromJson(element.toString(), EntityAuditEvent.class);
+                return AtlasType.fromV1Json(element.toString(), EntityAuditEvent.class);
             }
         });
 

http://git-wip-us.apache.org/repos/asf/atlas/blob/0877e47c/client/client-v1/src/main/java/org/apache/atlas/EntityAuditEvent.java
----------------------------------------------------------------------
diff --git a/client/client-v1/src/main/java/org/apache/atlas/EntityAuditEvent.java b/client/client-v1/src/main/java/org/apache/atlas/EntityAuditEvent.java
index 904674d..05b9282 100644
--- a/client/client-v1/src/main/java/org/apache/atlas/EntityAuditEvent.java
+++ b/client/client-v1/src/main/java/org/apache/atlas/EntityAuditEvent.java
@@ -18,8 +18,9 @@
 
 package org.apache.atlas;
 
-import org.apache.atlas.typesystem.IReferenceableInstance;
-import org.apache.atlas.typesystem.json.InstanceSerialization;
+
+import org.apache.atlas.model.v1.instance.Referenceable;
+import org.apache.atlas.type.AtlasType;
 
 import java.util.Objects;
 
@@ -38,13 +39,13 @@ public class EntityAuditEvent {
     private EntityAuditAction action;
     private String details;
     private String eventKey;
-    private IReferenceableInstance entityDefinition;
+    private Referenceable entityDefinition;
 
     public EntityAuditEvent() {
     }
 
     public EntityAuditEvent(String entityId, Long ts, String user, EntityAuditAction action, String details,
-                            IReferenceableInstance entityDefinition) throws AtlasException {
+                            Referenceable entityDefinition) throws AtlasException {
         this.entityId = entityId;
         this.timestamp = ts;
         this.user = user;
@@ -74,11 +75,11 @@ public class EntityAuditEvent {
 
     @Override
     public String toString() {
-        return SerDe.GSON.toJson(this);
+        return AtlasType.toV1Json(this);
     }
 
     public static EntityAuditEvent fromString(String eventString) {
-        return SerDe.GSON.fromJson(eventString, EntityAuditEvent.class);
+        return AtlasType.fromV1Json(eventString, EntityAuditEvent.class);
     }
 
     public String getEntityId() {
@@ -129,18 +130,18 @@ public class EntityAuditEvent {
         this.eventKey = eventKey;
     }
 
-    public IReferenceableInstance getEntityDefinition() {
+    public Referenceable getEntityDefinition() {
         return entityDefinition;
     }
 
     public String getEntityDefinitionString() {
         if (entityDefinition != null) {
-            return InstanceSerialization.toJson(entityDefinition, true);
+            return AtlasType.toV1Json(entityDefinition);
         }
         return null;
     }
 
     public void setEntityDefinition(String entityDefinition) {
-        this.entityDefinition = InstanceSerialization.fromJsonReferenceable(entityDefinition, true);
+        this.entityDefinition = AtlasType.fromV1Json(entityDefinition, Referenceable.class);
     }
 }

http://git-wip-us.apache.org/repos/asf/atlas/blob/0877e47c/client/client-v1/src/main/java/org/apache/atlas/SerDe.java
----------------------------------------------------------------------
diff --git a/client/client-v1/src/main/java/org/apache/atlas/SerDe.java b/client/client-v1/src/main/java/org/apache/atlas/SerDe.java
deleted file mode 100644
index cdc3509..0000000
--- a/client/client-v1/src/main/java/org/apache/atlas/SerDe.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * <p/>
- * http://www.apache.org/licenses/LICENSE-2.0
- * <p/>
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.atlas;
-
-import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
-import com.google.gson.JsonDeserializationContext;
-import com.google.gson.JsonDeserializer;
-import com.google.gson.JsonElement;
-import com.google.gson.JsonParser;
-import com.google.gson.JsonSerializationContext;
-import com.google.gson.JsonSerializer;
-import org.apache.atlas.typesystem.IReferenceableInstance;
-import org.apache.atlas.typesystem.IStruct;
-import org.apache.atlas.typesystem.Referenceable;
-import org.apache.atlas.typesystem.Struct;
-import org.apache.atlas.typesystem.json.InstanceSerialization;
-
-import java.lang.reflect.Type;
-
-@Deprecated
-public class SerDe {
-    public static final Gson GSON = new GsonBuilder().
-             registerTypeAdapter(IStruct.class, new StructDeserializer()).
-             registerTypeAdapter(IReferenceableInstance.class, new ReferenceableSerializerDeserializer()).
-             registerTypeAdapter(Referenceable.class, new ReferenceableSerializerDeserializer()).
-             create();
-
-    /**
-     * Serde for Struct used by AbstractNotificationConsumer.GSON.
-     */
-    public static final class StructDeserializer implements JsonDeserializer<IStruct>, JsonSerializer<IStruct> {
-        @Override
-        public IStruct deserialize(final JsonElement json, final Type type,
-                                   final JsonDeserializationContext context) {
-            return context.deserialize(json, Struct.class);
-        }
-
-        @Override
-        public JsonElement serialize(IStruct src, Type typeOfSrc, JsonSerializationContext context) {
-            String instanceJson = InstanceSerialization.toJson(src, true);
-            return new JsonParser().parse(instanceJson).getAsJsonObject();
-        }
-    }
-
-    /**
-     * Serde for Referenceable used by AbstractNotificationConsumer.GSON.
-     */
-    public static final class ReferenceableSerializerDeserializer implements JsonDeserializer<IStruct>,
-            JsonSerializer<IReferenceableInstance> {
-        @Override
-        public IReferenceableInstance deserialize(final JsonElement json, final Type type,
-                                                  final JsonDeserializationContext context) {
-
-            return InstanceSerialization.fromJsonReferenceable(json.toString(), true);
-        }
-
-        @Override
-        public JsonElement serialize(IReferenceableInstance src, Type typeOfSrc, JsonSerializationContext context) {
-            String instanceJson = InstanceSerialization.toJson(src, true);
-            return new JsonParser().parse(instanceJson).getAsJsonObject();
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/atlas/blob/0877e47c/client/client-v1/src/test/java/org/apache/atlas/AtlasClientTest.java
----------------------------------------------------------------------
diff --git a/client/client-v1/src/test/java/org/apache/atlas/AtlasClientTest.java b/client/client-v1/src/test/java/org/apache/atlas/AtlasClientTest.java
index c387be1..99d1328 100644
--- a/client/client-v1/src/test/java/org/apache/atlas/AtlasClientTest.java
+++ b/client/client-v1/src/test/java/org/apache/atlas/AtlasClientTest.java
@@ -22,8 +22,8 @@ import com.sun.jersey.api.client.ClientHandlerException;
 import com.sun.jersey.api.client.ClientResponse;
 import com.sun.jersey.api.client.WebResource;
 import org.apache.atlas.model.legacy.EntityResult;
-import org.apache.atlas.typesystem.Referenceable;
-import org.apache.atlas.typesystem.json.InstanceSerialization;
+import org.apache.atlas.model.v1.instance.Referenceable;
+import org.apache.atlas.type.AtlasType;
 import org.apache.commons.configuration.Configuration;
 import org.apache.hadoop.security.UserGroupInformation;
 import org.codehaus.jettison.json.JSONObject;
@@ -99,7 +99,7 @@ public class AtlasClientTest {
         JSONObject jsonResponse = new JSONObject(new EntityResult(Arrays.asList("id"), null, null).toString());
         when(response.getEntity(String.class)).thenReturn(jsonResponse.toString());
         when(response.getLength()).thenReturn(jsonResponse.length());
-        String entityJson = InstanceSerialization.toJson(new Referenceable("type"), true);
+        String entityJson = AtlasType.toV1Json(new Referenceable("type"));
         when(builder.method(anyString(), Matchers.<Class>any(), anyString())).thenReturn(response);
 
         List<String> ids = atlasClient.createEntity(entityJson);

http://git-wip-us.apache.org/repos/asf/atlas/blob/0877e47c/common/src/main/java/org/apache/atlas/repository/Constants.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/atlas/repository/Constants.java b/common/src/main/java/org/apache/atlas/repository/Constants.java
index 5475514..8eda22d 100644
--- a/common/src/main/java/org/apache/atlas/repository/Constants.java
+++ b/common/src/main/java/org/apache/atlas/repository/Constants.java
@@ -104,6 +104,13 @@ public final class Constants {
     public static final String MAX_FULLTEXT_QUERY_STR_LENGTH  = "atlas.graph.fulltext-max-query-str-length";
     public static final String MAX_DSL_QUERY_STR_LENGTH  = "atlas.graph.dsl-max-query-str-length";
 
+    public static final String ATTRIBUTE_NAME_GUID     = "guid";
+    public static final String ATTRIBUTE_NAME_TYPENAME = "typeName";
+    public static final String ATTRIBUTE_NAME_SUPERTYPENAMES = "superTypeNames";
+    public static final String ATTRIBUTE_NAME_STATE    = "state";
+    public static final String ATTRIBUTE_NAME_VERSION  = "version";
+    public static final String TEMP_STRUCT_NAME_PREFIX = "__tempQueryResultStruct";
+
     private Constants() {
     }
 

http://git-wip-us.apache.org/repos/asf/atlas/blob/0877e47c/graphdb/api/src/main/java/org/apache/atlas/repository/graphdb/AtlasGraph.java
----------------------------------------------------------------------
diff --git a/graphdb/api/src/main/java/org/apache/atlas/repository/graphdb/AtlasGraph.java b/graphdb/api/src/main/java/org/apache/atlas/repository/graphdb/AtlasGraph.java
index dded76f..31d2085 100644
--- a/graphdb/api/src/main/java/org/apache/atlas/repository/graphdb/AtlasGraph.java
+++ b/graphdb/api/src/main/java/org/apache/atlas/repository/graphdb/AtlasGraph.java
@@ -27,7 +27,7 @@ import javax.script.ScriptException;
 
 import org.apache.atlas.exception.AtlasBaseException;
 import org.apache.atlas.groovy.GroovyExpression;
-import org.apache.atlas.typesystem.types.IDataType;
+import org.apache.atlas.type.AtlasType;
 
 /**
  * Represents a graph.
@@ -110,7 +110,6 @@ public interface AtlasGraph<V, E> {
      * Gets the names of the indexes on edges
      * type.
      *
-     * @param type
      * @return
      */
     Set<String> getEdgeIndexKeys();
@@ -120,7 +119,6 @@ public interface AtlasGraph<V, E> {
      * Gets the names of the indexes on vertices.
      * type.
      *
-     * @param type
      * @return
      */
     Set<String> getVertexIndexKeys();
@@ -218,11 +216,11 @@ public interface AtlasGraph<V, E> {
      * convert property values from the value that is stored in the graph
      * to the value/type that the user expects to get back.
      *
-     * @param expr - gremlin expr that represents the persistent property value
+     * @param valueExpr - gremlin expr that represents the persistent property value
      * @param type
      * @return
      */
-    GroovyExpression generatePersisentToLogicalConversionExpression(GroovyExpression valueExpr, IDataType<?> type);
+    GroovyExpression generatePersisentToLogicalConversionExpression(GroovyExpression valueExpr, AtlasType type);
 
     /**
      * Indicates whether or not stored values with the specified type need to be converted
@@ -234,7 +232,7 @@ public interface AtlasGraph<V, E> {
      * gremlin expression with the converted value.  In addition, this cause the gremlin
      * 'filter' step to be used to compare the values instead of a 'has' step.
      */
-    boolean isPropertyValueConversionNeeded(IDataType<?> type);
+    boolean isPropertyValueConversionNeeded(AtlasType type);
 
     /**
      * Gets the version of Gremlin that this graph uses.
@@ -286,7 +284,7 @@ public interface AtlasGraph<V, E> {
     /**
      * Executes a Gremlin script, returns an object with the result.
      *
-     * @param gremlinQuery
+     * @param query
      * @param isPath whether this is a path query
      *
      * @return the result from executing the script

http://git-wip-us.apache.org/repos/asf/atlas/blob/0877e47c/graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/AtlasJanusGraph.java
----------------------------------------------------------------------
diff --git a/graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/AtlasJanusGraph.java b/graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/AtlasJanusGraph.java
index bc63a69..7c96806 100644
--- a/graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/AtlasJanusGraph.java
+++ b/graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/AtlasJanusGraph.java
@@ -21,6 +21,7 @@ import com.google.common.base.Function;
 import com.google.common.collect.Iterables;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
+import org.apache.atlas.type.AtlasType;
 import org.janusgraph.core.Cardinality;
 import org.janusgraph.core.PropertyKey;
 import org.janusgraph.core.SchemaViolationException;
@@ -42,7 +43,6 @@ import org.apache.atlas.repository.graphdb.AtlasVertex;
 import org.apache.atlas.repository.graphdb.GremlinVersion;
 import org.apache.atlas.repository.graphdb.janus.query.AtlasJanusGraphQuery;
 import org.apache.atlas.repository.graphdb.utils.IteratorToIterableAdapter;
-import org.apache.atlas.typesystem.types.IDataType;
 import org.apache.tinkerpop.gremlin.groovy.CompilerCustomizerProvider;
 import org.apache.tinkerpop.gremlin.groovy.DefaultImportCustomizerProvider;
 import org.apache.tinkerpop.gremlin.groovy.jsr223.GremlinGroovyScriptEngine;
@@ -359,13 +359,13 @@ public class AtlasJanusGraph implements AtlasGraph<AtlasJanusVertex, AtlasJanusE
     }
 
     @Override
-    public GroovyExpression generatePersisentToLogicalConversionExpression(GroovyExpression expr, IDataType<?> type) {
+    public GroovyExpression generatePersisentToLogicalConversionExpression(GroovyExpression expr, AtlasType type) {
         //nothing special needed, value is stored in required type
         return expr;
     }
 
     @Override
-    public boolean isPropertyValueConversionNeeded(IDataType<?> type) {
+    public boolean isPropertyValueConversionNeeded(AtlasType type) {
         return false;
     }
 

http://git-wip-us.apache.org/repos/asf/atlas/blob/0877e47c/graphdb/titan0/src/main/java/org/apache/atlas/repository/graphdb/titan0/Titan0Graph.java
----------------------------------------------------------------------
diff --git a/graphdb/titan0/src/main/java/org/apache/atlas/repository/graphdb/titan0/Titan0Graph.java b/graphdb/titan0/src/main/java/org/apache/atlas/repository/graphdb/titan0/Titan0Graph.java
index 2408287..4409009 100644
--- a/graphdb/titan0/src/main/java/org/apache/atlas/repository/graphdb/titan0/Titan0Graph.java
+++ b/graphdb/titan0/src/main/java/org/apache/atlas/repository/graphdb/titan0/Titan0Graph.java
@@ -45,7 +45,7 @@ import org.apache.atlas.repository.graphdb.AtlasVertex;
 import org.apache.atlas.repository.graphdb.GremlinVersion;
 import org.apache.atlas.repository.graphdb.titan0.query.Titan0GraphQuery;
 import org.apache.atlas.repository.graphdb.utils.IteratorToIterableAdapter;
-import org.apache.atlas.typesystem.types.IDataType;
+import org.apache.atlas.type.AtlasType;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -348,14 +348,14 @@ public class Titan0Graph implements AtlasGraph<Titan0Vertex, Titan0Edge> {
     }
 
     @Override
-    public GroovyExpression generatePersisentToLogicalConversionExpression(GroovyExpression expr, IDataType<?> type) {
+    public GroovyExpression generatePersisentToLogicalConversionExpression(GroovyExpression expr, AtlasType type) {
 
         //nothing special needed, value is stored in required type
         return expr;
     }
 
     @Override
-    public boolean isPropertyValueConversionNeeded(IDataType<?> type) {
+    public boolean isPropertyValueConversionNeeded(AtlasType type) {
 
         return false;
     }

http://git-wip-us.apache.org/repos/asf/atlas/blob/0877e47c/graphdb/titan1/src/main/java/org/apache/atlas/repository/graphdb/titan1/Titan1Graph.java
----------------------------------------------------------------------
diff --git a/graphdb/titan1/src/main/java/org/apache/atlas/repository/graphdb/titan1/Titan1Graph.java b/graphdb/titan1/src/main/java/org/apache/atlas/repository/graphdb/titan1/Titan1Graph.java
index ffb6b37..d94289d 100644
--- a/graphdb/titan1/src/main/java/org/apache/atlas/repository/graphdb/titan1/Titan1Graph.java
+++ b/graphdb/titan1/src/main/java/org/apache/atlas/repository/graphdb/titan1/Titan1Graph.java
@@ -42,7 +42,7 @@ import org.apache.atlas.repository.graphdb.AtlasVertex;
 import org.apache.atlas.repository.graphdb.GremlinVersion;
 import org.apache.atlas.repository.graphdb.titan1.query.Titan1GraphQuery;
 import org.apache.atlas.repository.graphdb.utils.IteratorToIterableAdapter;
-import org.apache.atlas.typesystem.types.IDataType;
+import org.apache.atlas.type.AtlasType;
 import org.apache.tinkerpop.gremlin.groovy.CompilerCustomizerProvider;
 import org.apache.tinkerpop.gremlin.groovy.DefaultImportCustomizerProvider;
 import org.apache.tinkerpop.gremlin.groovy.jsr223.GremlinGroovyScriptEngine;
@@ -359,13 +359,13 @@ public class Titan1Graph implements AtlasGraph<Titan1Vertex, Titan1Edge> {
     }
 
     @Override
-    public GroovyExpression generatePersisentToLogicalConversionExpression(GroovyExpression expr, IDataType<?> type) {
+    public GroovyExpression generatePersisentToLogicalConversionExpression(GroovyExpression expr, AtlasType type) {
         //nothing special needed, value is stored in required type
         return expr;
     }
 
     @Override
-    public boolean isPropertyValueConversionNeeded(IDataType<?> type) {
+    public boolean isPropertyValueConversionNeeded(AtlasType type) {
         return false;
     }
 

http://git-wip-us.apache.org/repos/asf/atlas/blob/0877e47c/intg/src/main/java/org/apache/atlas/model/v1/instance/AtlasSystemAttributes.java
----------------------------------------------------------------------
diff --git a/intg/src/main/java/org/apache/atlas/model/v1/instance/AtlasSystemAttributes.java b/intg/src/main/java/org/apache/atlas/model/v1/instance/AtlasSystemAttributes.java
new file mode 100644
index 0000000..43a2fe1
--- /dev/null
+++ b/intg/src/main/java/org/apache/atlas/model/v1/instance/AtlasSystemAttributes.java
@@ -0,0 +1,123 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.atlas.model.v1.instance;
+
+import org.codehaus.jackson.annotate.JsonAutoDetect;
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+import org.codehaus.jackson.map.annotate.JsonSerialize;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlRootElement;
+import java.io.Serializable;
+import java.util.Date;
+import java.util.Objects;
+
+import static org.codehaus.jackson.annotate.JsonAutoDetect.Visibility.NONE;
+import static org.codehaus.jackson.annotate.JsonAutoDetect.Visibility.PUBLIC_ONLY;
+
+
+@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE)
+@JsonSerialize(include=JsonSerialize.Inclusion.NON_NULL)
+@JsonIgnoreProperties(ignoreUnknown=true)
+@XmlRootElement
+@XmlAccessorType(XmlAccessType.PROPERTY)
+public class AtlasSystemAttributes implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    private String createdBy;
+    private String modifiedBy;
+    private Date   createdTime;
+    private Date   modifiedTime;
+
+
+    public AtlasSystemAttributes() {
+    }
+
+    public AtlasSystemAttributes(AtlasSystemAttributes that) {
+        if (that != null) {
+            this.createdBy    = that.createdBy;
+            this.modifiedBy   = that.modifiedBy;
+            this.createdTime  = that.createdTime;
+            this.modifiedTime = that.modifiedTime;
+        }
+    }
+
+    public AtlasSystemAttributes(String createdBy, String modifiedBy, Date createdTime, Date modifiedTime){
+        this.createdBy    = createdBy;
+        this.modifiedBy   = modifiedBy;
+        this.createdTime  = createdTime;
+        this.modifiedTime = modifiedTime;
+    }
+
+    public String getCreatedBy(){
+        return createdBy;
+    }
+
+    public void setCreatedBy(String createdBy) {
+        this.createdBy = createdBy;
+    }
+
+    public String getModifiedBy(){
+        return modifiedBy;
+    }
+
+    public void setModifiedBy(String modifiedBy) {
+        this.modifiedBy = modifiedBy;
+    }
+
+    public Date getCreatedTime(){
+        return createdTime;
+    }
+
+    public void setCreatedTime(Date createdTime) {
+        this.createdTime = createdTime;
+    }
+
+    public Date getModifiedTime(){
+        return modifiedTime;
+    }
+
+    public void setModifiedTime(Date modifiedTime) {
+        this.modifiedTime = modifiedTime;
+    }
+
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) {
+            return true;
+        }
+        if (o == null || getClass() != o.getClass()) {
+            return false;
+        }
+
+        AtlasSystemAttributes obj = (AtlasSystemAttributes) o;
+
+        return Objects.equals(createdBy, obj.createdBy) &&
+               Objects.equals(modifiedBy, obj.modifiedBy) &&
+               Objects.equals(createdTime, obj.createdTime) &&
+               Objects.equals(modifiedTime, obj.modifiedTime);
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(createdBy, modifiedBy, createdTime, modifiedTime);
+    }
+}

http://git-wip-us.apache.org/repos/asf/atlas/blob/0877e47c/intg/src/main/java/org/apache/atlas/model/v1/instance/Id.java
----------------------------------------------------------------------
diff --git a/intg/src/main/java/org/apache/atlas/model/v1/instance/Id.java b/intg/src/main/java/org/apache/atlas/model/v1/instance/Id.java
new file mode 100644
index 0000000..5ff4c3d
--- /dev/null
+++ b/intg/src/main/java/org/apache/atlas/model/v1/instance/Id.java
@@ -0,0 +1,171 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.atlas.model.v1.instance;
+
+
+import org.codehaus.jackson.annotate.JsonAutoDetect;
+import org.codehaus.jackson.annotate.JsonIgnore;
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+import org.codehaus.jackson.map.annotate.JsonSerialize;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlRootElement;
+import java.io.Serializable;
+import java.util.Objects;
+import java.util.concurrent.atomic.AtomicLong;
+
+import static org.codehaus.jackson.annotate.JsonAutoDetect.Visibility.NONE;
+import static org.codehaus.jackson.annotate.JsonAutoDetect.Visibility.PUBLIC_ONLY;
+
+
+@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE)
+@JsonSerialize(include=JsonSerialize.Inclusion.NON_NULL)
+@JsonIgnoreProperties(ignoreUnknown=true)
+@XmlRootElement
+@XmlAccessorType(XmlAccessType.PROPERTY)
+public class Id implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    @JsonIgnore
+    private static AtomicLong s_nextId = new AtomicLong(System.nanoTime());
+
+    public enum EntityState { ACTIVE, DELETED }
+
+    private String      id;
+    private String      typeName;
+    private int         version;
+    private EntityState state;
+
+
+    public Id() {
+    }
+
+    public Id(Id that) {
+        if (that != null) {
+            this.id       = that.id;
+            this.typeName = that.typeName;
+            this.version  = that.version;
+            this.state    = that.state;
+        }
+    }
+
+    public Id(String typeName) {
+        this("" + nextNegativeLong(), 0, typeName);
+    }
+
+    public Id(String id, int version, String typeName) {
+        this(id, version, typeName, null);
+    }
+
+    public Id(long id, int version, String typeName) {
+        this(id, version, typeName, null);
+    }
+
+    public Id(long id, int version, String typeName, String state) {
+        this("" + id, version, typeName, state);
+    }
+
+    public Id(String id, int version, String typeName, String state) {
+        this.id       = id;
+        this.typeName = typeName;
+        this.version  = version;
+        this.state    = state == null ? EntityState.ACTIVE : EntityState.valueOf(state.toUpperCase());
+    }
+
+    // for serialization backward compatibility
+    public String getJsonClass() {
+        return "org.apache.atlas.typesystem.json.InstanceSerialization$_Id";
+    }
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getTypeName() {
+        return typeName;
+    }
+
+    public void setTypeName(String typeName) {
+        this.typeName = typeName;
+    }
+
+    public int getVersion() {
+        return version;
+    }
+
+    public void setVersion(int version) {
+        this.version = version;
+    }
+
+    public EntityState getState() {
+        return state;
+    }
+
+    public void setState(EntityState state) {
+        this.state = state;
+    }
+
+    @JsonIgnore
+    public String _getId() {
+        return id;
+    }
+
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) {
+            return true;
+        }
+
+        if (o == null || getClass() != o.getClass()) {
+            return false;
+        }
+
+        Id obj = (Id) o;
+
+        return version == obj.version &&
+               Objects.equals(id, obj.id) &&
+               Objects.equals(typeName, obj.typeName) &&
+                Objects.equals(state, obj.state);
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(id, typeName, version, state);
+    }
+
+
+
+    private static long nextNegativeLong() {
+        long ret = s_nextId.getAndDecrement();
+
+        if (ret > 0) {
+            ret *= -1;
+        } else if (ret == 0) {
+            ret = Long.MIN_VALUE;
+        }
+
+        return ret;
+    }
+}