Skip to content

Commit

Permalink
Merge pull request #8455 from mandy-chessell/oak2024
Browse files Browse the repository at this point in the history
Add lineage metadata to CocoComboArchive.omarchive
  • Loading branch information
mandy-chessell authored Oct 21, 2024
2 parents bb617bc + 867c28a commit 65800a6
Show file tree
Hide file tree
Showing 14 changed files with 537 additions and 31 deletions.
2 changes: 1 addition & 1 deletion EgeriaContentPacksGUIDMap.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion content-packs/CocoBusinessSystemsArchive.omarchive

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion content-packs/CocoClinicalTrialsTemplatesArchive.omarchive

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion content-packs/CocoComboArchive.omarchive

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion content-packs/CocoGovernanceProgramArchive.omarchive

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion content-packs/CocoOrganizationArchive.omarchive

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion content-packs/CocoSustainabilityArchive.omarchive

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion content-packs/CocoTypesArchive.omarchive

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -3652,6 +3652,41 @@ public void addDataContentForDataSet(String dataContentGUID,
}




/**
* Create a lineage relationship between the two elements
*
* @param sourceGUID unique identifier of the element at end 1
* @param destinationGUID unique identifier of the element at end 2
* @param relationshipType type name of lineage relationship
* @param description description of the relationship
*/
public void addLineageRelationship(String sourceGUID,
String destinationGUID,
String relationshipType,
String description)
{
final String methodName = "addLineageRelationship";

EntityDetail end1Entity = archiveBuilder.getEntity(sourceGUID);
EntityDetail end2Entity = archiveBuilder.getEntity(destinationGUID);

EntityProxy end1 = archiveHelper.getEntityProxy(end1Entity);
EntityProxy end2 = archiveHelper.getEntityProxy(end2Entity);

InstanceProperties properties = archiveHelper.addStringPropertyToInstance(archiveRootName, null, OpenMetadataProperty.DESCRIPTION.name, description, methodName);

archiveBuilder.addRelationship(archiveHelper.getRelationship(relationshipType,
idToGUIDMap.getGUID(sourceGUID + "_to_" + destinationGUID + "_" + relationshipType + "_" + description + "_relationship"),
properties,
InstanceStatus.ACTIVE,
end1,
end2));
}



/**
* Create a DataStoreEncoding classification containing the supplied properties.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@


import org.odpi.openmetadata.archiveutilities.openconnectors.core.CorePackArchiveWriter;
import org.odpi.openmetadata.frameworks.openmetadata.controls.PlaceholderProperty;
import org.odpi.openmetadata.frameworks.openmetadata.types.OpenMetadataProperty;
import org.odpi.openmetadata.frameworks.openmetadata.types.OpenMetadataType;
import org.odpi.openmetadata.repositoryservices.connectors.stores.archivestore.properties.OpenMetadataArchive;
Expand Down Expand Up @@ -57,6 +58,7 @@ public void getArchiveContent()
{
addHosts();
addSystems();
addSystemLineage();
}


Expand Down Expand Up @@ -100,7 +102,7 @@ private void addSystems()
extendedProperties.put(OpenMetadataProperty.DEPLOYED_IMPLEMENTATION_TYPE.name, systemDefinition.getSystemType().getPreferredValue());
extendedProperties.put(OpenMetadataProperty.USER_ID.name, systemDefinition.getUserId());


archiveHelper.setGUID(systemDefinition.getQualifiedName(), systemDefinition.getSystemGUID());
String serverGUID = archiveHelper.addAsset(OpenMetadataType.SOFTWARE_SERVER.typeName,
systemDefinition.getQualifiedName(),
systemDefinition.getSystemId(),
Expand All @@ -109,7 +111,7 @@ private void addSystems()
systemDefinition.getZones(),
null,
extendedProperties);

assert(serverGUID.equals(systemDefinition.getSystemGUID()));


if (systemDefinition.getSystemType().getServerPurpose() != null)
Expand Down Expand Up @@ -170,5 +172,24 @@ private void addSystems()
}
}
}



/**
* The systems define the hosts.
*/
private void addSystemLineage()
{
for (SystemLevelLineage systemLevelLineage : SystemLevelLineage.values())
{
archiveHelper.addLineageRelationship(systemLevelLineage.getSourceSystem().getSystemGUID(),
systemLevelLineage.getDestinationSystem().getSystemGUID(),
systemLevelLineage.getRelationshipName(),
systemLevelLineage.getRelationshipDescription());


}
}

}

Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,20 @@
*/
public enum HostDefinition
{
/**
* ams03 - Amsterdam data centre standard machine 02.
*/
COCO_MFG_PLANNING_AMS_HOST("ams03",
"Amsterdam data centre standard machine 03.",
HostTypeDefinition.BARE_METAL,
FacilityDefinition.AMSTERDAM_DC,
"https://ams03.coco.com",
"Ubuntu",
"23.04",
null,
new String[]{"machines"},
0),

/**
* ams45 - Amsterdam data centre standard machine 45.
*/
Expand Down Expand Up @@ -97,6 +111,20 @@ public enum HostDefinition
new String[]{"machines"},
0),

/**
* ams04 - Amsterdam data centre standard machine 04.
*/
COCO_SUS_AMS_HOST("ams04",
"Amsterdam data centre standard machine 04.",
HostTypeDefinition.BARE_METAL,
FacilityDefinition.AMSTERDAM_DC,
"https://ams04.coco.com",
"Ubuntu",
"23.04",
null,
new String[]{"machines"},
500),

/**
* ams02 - Amsterdam data centre standard machine 02.
*/
Expand Down
Loading

0 comments on commit 65800a6

Please sign in to comment.