-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(structured-properties): soft delete
- Loading branch information
1 parent
709c596
commit 5fba678
Showing
138 changed files
with
4,548 additions
and
2,656 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...t/plugins/validation/AspectRetriever.java → ...edin/metadata/aspect/AspectRetriever.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
entity-registry/src/main/java/com/linkedin/metadata/aspect/CachingAspectRetriever.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package com.linkedin.metadata.aspect; | ||
|
||
/** Responses can be cached based on application.yaml caching configuration for the EntityClient */ | ||
public interface CachingAspectRetriever extends AspectRetriever {} |
77 changes: 77 additions & 0 deletions
77
entity-registry/src/main/java/com/linkedin/metadata/aspect/ReadItem.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
package com.linkedin.metadata.aspect; | ||
|
||
import com.linkedin.common.urn.Urn; | ||
import com.linkedin.data.DataMap; | ||
import com.linkedin.data.template.RecordTemplate; | ||
import com.linkedin.metadata.models.AspectSpec; | ||
import com.linkedin.metadata.models.EntitySpec; | ||
import com.linkedin.mxe.SystemMetadata; | ||
import java.lang.reflect.InvocationTargetException; | ||
import javax.annotation.Nonnull; | ||
import javax.annotation.Nullable; | ||
|
||
public interface ReadItem { | ||
/** | ||
* The urn associated with the aspect | ||
* | ||
* @return | ||
*/ | ||
@Nonnull | ||
Urn getUrn(); | ||
|
||
/** | ||
* Aspect's name | ||
* | ||
* @return the name | ||
*/ | ||
@Nonnull | ||
default String getAspectName() { | ||
return getAspectSpec().getName(); | ||
} | ||
|
||
@Nullable | ||
RecordTemplate getRecordTemplate(); | ||
|
||
default <T> T getAspect(Class<T> clazz) { | ||
return getAspect(clazz, getRecordTemplate()); | ||
} | ||
|
||
static <T> T getAspect(Class<T> clazz, @Nullable RecordTemplate recordTemplate) { | ||
if (recordTemplate != null) { | ||
try { | ||
return clazz.getConstructor(DataMap.class).newInstance(recordTemplate.data()); | ||
} catch (InstantiationException | ||
| IllegalAccessException | ||
| InvocationTargetException | ||
| NoSuchMethodException e) { | ||
throw new RuntimeException(e); | ||
} | ||
} else { | ||
return null; | ||
} | ||
} | ||
|
||
/** | ||
* System information | ||
* | ||
* @return the system metadata | ||
*/ | ||
@Nullable | ||
SystemMetadata getSystemMetadata(); | ||
|
||
/** | ||
* The entity's schema | ||
* | ||
* @return entity specification | ||
*/ | ||
@Nonnull | ||
EntitySpec getEntitySpec(); | ||
|
||
/** | ||
* The aspect's schema | ||
* | ||
* @return aspect's specification | ||
*/ | ||
@Nonnull | ||
AspectSpec getAspectSpec(); | ||
} |
25 changes: 25 additions & 0 deletions
25
entity-registry/src/main/java/com/linkedin/metadata/aspect/SystemAspect.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package com.linkedin.metadata.aspect; | ||
|
||
import com.linkedin.common.AuditStamp; | ||
import com.linkedin.common.urn.UrnUtils; | ||
import java.sql.Timestamp; | ||
import javax.annotation.Nonnull; | ||
|
||
/** | ||
* An aspect along with system metadata and creation timestamp. Represents an aspect as stored in | ||
* primary storage. | ||
*/ | ||
public interface SystemAspect extends ReadItem { | ||
long getVersion(); | ||
|
||
Timestamp getCreatedOn(); | ||
|
||
String getCreatedBy(); | ||
|
||
@Nonnull | ||
default AuditStamp getAuditStamp() { | ||
return new AuditStamp() | ||
.setActor(UrnUtils.getUrn(getCreatedBy())) | ||
.setTime(getCreatedOn().getTime()); | ||
} | ||
} |
Oops, something went wrong.