Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sample deduplication connector #6847

Merged
merged 4 commits into from
Aug 31, 2022

Conversation

popa-raluca
Copy link
Contributor

Signed-off-by: Raluca Popa [email protected]

Add sample deduplication connector. Provides basic implementation for handling duplicate entities. The matching of the duplicates is made based on the qualified names of the entities.

Description

Related Issue(s)

Testing

Tested locally with GAF and DE OMAS

Release Notes & Documentation

Additional notes

@planetf1
Copy link
Member

Is this the first step?

I didn't see build/packaging related content?
Should we place sample connectors in base egeria or elsewhere? We've got a general strategy of only keeping the core code in base egeria, though if it's a non-scenario based, basic connector (like in memory repo) I think there's a case for having in base.

@popa-raluca
Copy link
Contributor Author

Is this the first step?

I didn't see build/packaging related content? Should we place sample connectors in base egeria or elsewhere? We've got a general strategy of only keeping the core code in base egeria, though if it's a non-scenario based, basic connector (like in memory repo) I think there's a case for having in base.

It's more a basic connector implementation for deduplication that we used in our tests so far. I don't think we're ready to have it scenario based yet, just wanted to have it somewhere in github. It is placed in governce-action-connectors along with the other basic connector implementations for governance. Maybe we can discuss about moving them to a more proper place at a later time?

@planetf1
Copy link
Member

planetf1 commented Aug 24, 2022

@popa-raluca Thanks for clarifying - makes sense, I agree with you. It does bring up a question of how we want to handle meantime, but that's a longer term question

Copy link
Contributor

@lpalashevski lpalashevski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved with minor remark about the name, since this is remediation action perhaps name describing exactly the action (?) i.e. "QualifiedNamePeerDuplicateGovernanceActionConnector"

I see that you explain the purpose in the javadoc, I think this is more explicit.

@popa-raluca popa-raluca merged commit ef4cbf5 into odpi:master Aug 31, 2022
SearchProperties searchProperties = getSearchProperties(qualifiedName);
List<OpenMetadataElement> elements = store.findMetadataElements(targetElement.getType().getTypeId(),
null, searchProperties, null, null, null,
null, false, true, new Date(), 0, 0);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JavaUtilDate: Date has a bad API that leads to bugs; prefer java.time.Instant or LocalDate.


ℹ️ Learn about @sonatype-lift commands

You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.

Command Usage
@sonatype-lift ignore Leave out the above finding from this PR
@sonatype-lift ignoreall Leave out all the existing findings from this PR
@sonatype-lift exclude <file|issue|path|tool> Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file

Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.


Was this a good recommendation?
[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

* @throws ConnectorCheckedException there is a problem within the governance action service.
*/
@Override
public void start() throws ConnectorCheckedException {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UnsynchronizedOverridesSynchronized: Unsynchronized method start overrides synchronized method in ConnectorBase


Suggested change
public void start() throws ConnectorCheckedException {
public synchronized void start() throws ConnectorCheckedException {

ℹ️ Learn about @sonatype-lift commands

You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.

Command Usage
@sonatype-lift ignore Leave out the above finding from this PR
@sonatype-lift ignoreall Leave out all the existing findings from this PR
@sonatype-lift exclude <file|issue|path|tool> Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file

Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.


Was this a good recommendation?
[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

PropertyCondition condition = new PropertyCondition();
PrimitiveTypePropertyValue primitivePropertyValue = new PrimitiveTypePropertyValue();

primitivePropertyValue.setPrimitiveTypeCategory(PrimitiveTypeCategory.OM_PRIMITIVE_TYPE_STRING);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💬 2 similar findings have been found in this PR


NULL_DEREFERENCE: object primitivePropertyValue.primitiveValue last assigned on line 98 could be null and is dereferenced by call to setPrimitiveTypeCategory(...) at line 100.


🔎 Expand here to view all instances of this finding
File Path Line Number
open-metadata-implementation/adapters/open-connectors/governance-action-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/governanceactions/remediation/QualifiedNamePeerDuplicateGovernanceActionConnector.java 60
open-metadata-implementation/adapters/open-connectors/governance-action-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/governanceactions/remediation/QualifiedNamePeerDuplicateGovernanceActionConnector.java 62

Visit the Lift Web Console to find more details in your report.


ℹ️ Learn about @sonatype-lift commands

You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.

Command Usage
@sonatype-lift ignore Leave out the above finding from this PR
@sonatype-lift ignoreall Leave out all the existing findings from this PR
@sonatype-lift exclude <file|issue|path|tool> Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file

Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.


Was this a good recommendation?
[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

SearchProperties searchProperties = getSearchProperties(qualifiedName);
List<OpenMetadataElement> elements = store.findMetadataElements(targetElement.getType().getTypeId(),
null, searchProperties, null, null, null,
null, false, true, new Date(), 0, 0);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JavaUtilDate: Date has a bad API that leads to bugs; prefer java.time.Instant or LocalDate.


ℹ️ Learn about @sonatype-lift commands

You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.

Command Usage
@sonatype-lift ignore Leave out the above finding from this PR
@sonatype-lift ignoreall Leave out all the existing findings from this PR
@sonatype-lift exclude <file|issue|path|tool> Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file

Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.


Was this a good recommendation?
[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

* @throws ConnectorCheckedException there is a problem within the governance action service.
*/
@Override
public void start() throws ConnectorCheckedException {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UnsynchronizedOverridesSynchronized: Unsynchronized method start overrides synchronized method in ConnectorBase


Suggested change
public void start() throws ConnectorCheckedException {
public synchronized void start() throws ConnectorCheckedException {

ℹ️ Learn about @sonatype-lift commands

You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.

Command Usage
@sonatype-lift ignore Leave out the above finding from this PR
@sonatype-lift ignoreall Leave out all the existing findings from this PR
@sonatype-lift exclude <file|issue|path|tool> Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file

Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.


Was this a good recommendation?
[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]


String qualifiedName = targetElement.getElementProperties().getPropertyValueMap().get(QUALIFIED_NAME_PROPERTY).valueAsString();
SearchProperties searchProperties = getSearchProperties(qualifiedName);
List<OpenMetadataElement> elements = store.findMetadataElements(targetElement.getType().getTypeId(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💬 2 similar findings have been found in this PR


NULL_DEREFERENCE: object returned by targetElement.getType() could be null and is dereferenced at line 62.


🔎 Expand here to view all instances of this finding
File Path Line Number
open-metadata-implementation/adapters/open-connectors/governance-action-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/governanceactions/remediation/QualifiedNamePeerDuplicateGovernanceActionConnector.java 60
open-metadata-implementation/adapters/open-connectors/governance-action-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/governanceactions/remediation/QualifiedNamePeerDuplicateGovernanceActionConnector.java 100

Visit the Lift Web Console to find more details in your report.


ℹ️ Learn about @sonatype-lift commands

You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.

Command Usage
@sonatype-lift ignore Leave out the above finding from this PR
@sonatype-lift ignoreall Leave out all the existing findings from this PR
@sonatype-lift exclude <file|issue|path|tool> Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file

Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.


Was this a good recommendation?
[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants