#15600: Retention Application : Delete change_events, activity threads, versions based on admin retention policies (#18913)

* feat(retention-policy): initial setup of the Retention Policy app

* refactor: Update logic to make RetentionPolicyApp a ScheduledOrManual app

* refactor: Update retention policy JSON schema and logic to support event subscription, versions, and activity thread with individual retention periods

* refactor: Rename eventSubscriptionRetentionPeriod to changeEventRetentionPeriod

* fix: Implement activity thread retention policy cleanup

* chore: Remove activity thread and versions retention code; add banner and icon
This commit is contained in:
Siddhant 2025-01-21 18:12:35 +05:30 committed by GitHub
parent 9a69c18b59
commit 486230827d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
13 changed files with 323 additions and 70 deletions

View File

@ -0,0 +1,100 @@
package org.openmetadata.service.apps.bundles.dataRetention;
import java.time.Duration;
import java.time.Instant;
import java.util.function.Supplier;
import lombok.extern.slf4j.Slf4j;
import org.jdbi.v3.sqlobject.transaction.Transaction;
import org.openmetadata.common.utils.CommonUtil;
import org.openmetadata.schema.entity.app.App;
import org.openmetadata.schema.entity.applications.configuration.internal.DataRetentionConfiguration;
import org.openmetadata.service.apps.AbstractNativeApplication;
import org.openmetadata.service.jdbi3.CollectionDAO;
import org.openmetadata.service.search.SearchRepository;
import org.openmetadata.service.util.JsonUtils;
import org.quartz.JobExecutionContext;
@Slf4j
public class DataRetention extends AbstractNativeApplication {
private static final int BATCH_SIZE = 10_000;
private DataRetentionConfiguration dataRetentionConfiguration;
private final CollectionDAO.EventSubscriptionDAO eventSubscriptionDAO;
public DataRetention(CollectionDAO collectionDAO, SearchRepository searchRepository) {
super(collectionDAO, searchRepository);
this.eventSubscriptionDAO = collectionDAO.eventSubscriptionDAO();
}
@Override
public void init(App app) {
super.init(app);
this.dataRetentionConfiguration =
JsonUtils.convertValue(app.getAppConfiguration(), DataRetentionConfiguration.class);
if (CommonUtil.nullOrEmpty(this.dataRetentionConfiguration)) {
LOG.warn("No retention policy configuration provided. Cleanup tasks will not run.");
}
}
@Override
public void startApp(JobExecutionContext jobExecutionContext) {
executeCleanup(dataRetentionConfiguration);
}
public void executeCleanup(DataRetentionConfiguration config) {
if (CommonUtil.nullOrEmpty(config)) {
return;
}
cleanChangeEvents(config.getChangeEventRetentionPeriod());
}
@Transaction
private void cleanChangeEvents(int retentionPeriod) {
LOG.info(
"Initiating change events cleanup: Deleting records with a retention period of {} days.",
retentionPeriod);
long cutoffMillis = getRetentionCutoffMillis(retentionPeriod);
int totalDeletedSuccessfulEvents =
batchDelete(
() ->
eventSubscriptionDAO.deleteSuccessfulSentChangeEventsInBatches(
cutoffMillis, BATCH_SIZE));
int totalDeletedChangeEvents =
batchDelete(
() -> eventSubscriptionDAO.deleteChangeEventsInBatches(cutoffMillis, BATCH_SIZE));
int totalDeletedDlq =
batchDelete(
() -> eventSubscriptionDAO.deleteConsumersDlqInBatches(cutoffMillis, BATCH_SIZE));
LOG.info(
"Change events cleanup completed: {} successful_sent_change_events, {} change_events, and {} consumers_dlq records deleted (retention period: {} days).",
totalDeletedSuccessfulEvents,
totalDeletedChangeEvents,
totalDeletedDlq,
retentionPeriod);
}
private long getRetentionCutoffMillis(int retentionPeriodInDays) {
return Instant.now()
.minusMillis(Duration.ofDays(retentionPeriodInDays).toMillis())
.toEpochMilli();
}
/**
* Runs a batch delete operation in a loop until fewer than BATCH_SIZE records are deleted in a single iteration.
*/
private int batchDelete(Supplier<Integer> deleteFunction) {
var totalDeleted = 0;
while (true) {
var deletedCount = deleteFunction.get();
totalDeleted += deletedCount;
if (deletedCount < BATCH_SIZE) {
break;
}
}
return totalDeleted;
}
}

View File

@ -1,41 +0,0 @@
package org.openmetadata.service.events.scheduled;
import java.util.List;
import lombok.extern.slf4j.Slf4j;
import org.jdbi.v3.sqlobject.transaction.Transaction;
import org.openmetadata.service.Entity;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
@Slf4j
public class EventSubscriptionCleanupJob implements Job {
private static final int TARGET_COUNT = 50;
private static final int THRESHOLD = 100;
@Override
public void execute(JobExecutionContext context) throws JobExecutionException {
performCleanup();
}
@Transaction
public static void performCleanup() {
List<String> subscriptionsToClean =
Entity.getCollectionDAO().eventSubscriptionDAO().findSubscriptionsAboveThreshold(THRESHOLD);
for (String subscriptionId : subscriptionsToClean) {
long recordCount =
Entity.getCollectionDAO().eventSubscriptionDAO().getSuccessfulRecordCount(subscriptionId);
long excessRecords = recordCount - TARGET_COUNT;
if (excessRecords > 0) {
Entity.getCollectionDAO()
.eventSubscriptionDAO()
.deleteOldRecords(subscriptionId, excessRecords);
}
}
LOG.debug(
"Performed cleanup for subscriptions, retaining {} records per subscription.",
TARGET_COUNT);
}
}

View File

@ -63,7 +63,6 @@ public class EventSubscriptionScheduler {
public static final String ALERT_TRIGGER_GROUP = "OMAlertJobGroup";
private static EventSubscriptionScheduler instance;
private static volatile boolean initialized = false;
public static volatile boolean cleanupJobInitialised = false;
private final Scheduler alertsScheduler = new StdSchedulerFactory().getScheduler();
@ -134,7 +133,6 @@ public class EventSubscriptionScheduler {
// Schedule the Job
alertsScheduler.scheduleJob(jobDetail, trigger);
instance.scheduleCleanupJob();
LOG.info(
"Event Subscription started as {} : status {} for all Destinations",
@ -196,33 +194,6 @@ public class EventSubscriptionScheduler {
LOG.info("Alert publisher deleted for {}", deletedEntity.getName());
}
public void scheduleCleanupJob() {
if (!cleanupJobInitialised) {
try {
JobDetail cleanupJob =
JobBuilder.newJob(EventSubscriptionCleanupJob.class)
.withIdentity("CleanupJob", ALERT_JOB_GROUP)
.build();
Trigger cleanupTrigger =
TriggerBuilder.newTrigger()
.withIdentity("CleanupTrigger", ALERT_TRIGGER_GROUP)
.withSchedule(
SimpleScheduleBuilder.simpleSchedule()
.withIntervalInSeconds(10)
.repeatForever())
.startNow()
.build();
alertsScheduler.scheduleJob(cleanupJob, cleanupTrigger);
cleanupJobInitialised = true;
LOG.info("Scheduled periodic cleanup job to run every 10 seconds.");
} catch (SchedulerException e) {
LOG.error("Failed to schedule cleanup job", e);
}
}
}
@Transaction
public void deleteSuccessfulAndFailedEventsRecordByAlert(UUID id) {
Entity.getCollectionDAO()

View File

@ -1397,6 +1397,11 @@ public interface CollectionDAO {
@Define("condition") String condition,
@Define("sortingOrder") String sortingOrder);
@SqlQuery(
"SELECT id FROM thread_entity WHERE type = 'Conversation' AND createdAt < :cutoffMillis LIMIT :batchSize")
List<UUID> fetchConversationThreadIdsOlderThan(
@Bind("cutoffMillis") long cutoffMillis, @Bind("batchSize") int batchSize);
@ConnectionAwareSqlQuery(
value =
"SELECT count(id) FROM thread_entity <condition> "
@ -2258,6 +2263,52 @@ public interface CollectionDAO {
void deleteOldRecords(
@Bind("eventSubscriptionId") String eventSubscriptionId, @Bind("limit") long limit);
@ConnectionAwareSqlUpdate(
value =
"DELETE FROM successful_sent_change_events "
+ "WHERE timestamp < :cutoff ORDER BY timestamp LIMIT :limit",
connectionType = MYSQL)
@ConnectionAwareSqlUpdate(
value =
"DELETE FROM successful_sent_change_events "
+ "WHERE ctid IN ( "
+ " SELECT ctid FROM successful_sent_change_events "
+ " WHERE timestamp < :cutoff ORDER BY timestamp LIMIT :limit "
+ ")",
connectionType = POSTGRES)
int deleteSuccessfulSentChangeEventsInBatches(
@Bind("cutoff") long cutoff, @Bind("limit") int limit);
@ConnectionAwareSqlUpdate(
value =
"DELETE FROM change_event "
+ "WHERE eventTime < :cutoff ORDER BY eventTime LIMIT :limit",
connectionType = MYSQL)
@ConnectionAwareSqlUpdate(
value =
"DELETE FROM change_event "
+ "WHERE ctid IN ( "
+ " SELECT ctid FROM change_event "
+ " WHERE eventTime < :cutoff ORDER BY eventTime LIMIT :limit "
+ ")",
connectionType = POSTGRES)
int deleteChangeEventsInBatches(@Bind("cutoff") long cutoff, @Bind("limit") int limit);
@ConnectionAwareSqlUpdate(
value =
"DELETE FROM consumers_dlq "
+ "WHERE timestamp < :cutoff ORDER BY timestamp LIMIT :limit",
connectionType = MYSQL)
@ConnectionAwareSqlUpdate(
value =
"DELETE FROM consumers_dlq "
+ "WHERE ctid IN ( "
+ " SELECT ctid FROM consumers_dlq "
+ " WHERE timestamp < :cutoff ORDER BY timestamp LIMIT :limit "
+ ")",
connectionType = POSTGRES)
int deleteConsumersDlqInBatches(@Bind("cutoff") long cutoff, @Bind("limit") int limit);
@SqlQuery(
"SELECT json FROM successful_sent_change_events WHERE event_subscription_id = :eventSubscriptionId ORDER BY timestamp DESC LIMIT :limit OFFSET :paginationOffset")
List<String> getSuccessfulChangeEventBySubscriptionId(

View File

@ -0,0 +1,11 @@
{
"name": "DataRetentionApplication",
"displayName": "Data Retention",
"appConfiguration": {
"changeEventRetentionPeriod": 7
},
"appSchedule": {
"scheduleTimeline": "Custom",
"cronExpression": "0 0 * * 0"
}
}

View File

@ -0,0 +1,18 @@
{
"name": "DataRetentionApplication",
"displayName": "Data Retention",
"description": "The Data Retention App automates the cleanup of OpenMetadata's internal database to maintain performance and efficiency. Based on customizable retention periods and admin-defined retention policies, this application helps manage rapidly growing tables and prevents data bloat by removing outdated records.\n\n**Efficient Record Management:** The Retention Policy App automates the cleanup and deletion of records for selected entities based on specified retention durations. It simplifies compliance with data retention policies and ensures efficient database management.",
"appType": "internal",
"appScreenshots": ["DataRetentionApplication.png"],
"developer": "Collate Inc.",
"developerUrl": "https://www.getcollate.io",
"privacyPolicyUrl": "https://www.getcollate.io",
"supportEmail": "support@getcollate.io",
"scheduleType": "ScheduledOrManual",
"permission": "All",
"className": "org.openmetadata.service.apps.bundles.dataRetention.DataRetention",
"runtime": {
"enabled": "true"
},
"appConfiguration": {}
}

View File

@ -24,6 +24,9 @@
},
{
"$ref": "external/slackAppTokenConfiguration.json"
},
{
"$ref": "internal/dataRetentionConfiguration.json"
}
]
},

View File

@ -0,0 +1,19 @@
{
"$id": "https://open-metadata.org/schema/entity/applications/configuration/dataRetentionConfiguration.json",
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Retention Configuration",
"description": "Configure retention policies for each entity.",
"properties": {
"changeEventRetentionPeriod": {
"title": "Change Event Retention Period (days)",
"description": "Enter the retention period for change event records in days (e.g., 7 for one week, 30 for one month).",
"type": "integer",
"default": 7,
"minimum": 1
}
},
"required": [
"changeEventRetentionPeriod"
],
"additionalProperties": false
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 737 KiB

View File

@ -0,0 +1,56 @@
<svg width="55" height="55" viewBox="0 0 55 55" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_13630_67575)">
<path d="M26.45 45.8333H5.49856C3.47355 45.8333 1.83203 44.1916 1.83203 42.1667V38.5H29.9719L26.45 45.8333Z" fill="#D3DCFB"/>
<path d="M49.5022 16.5V31.9041V42.1665H5.49856C3.47355 42.1665 1.83203 40.5249 1.83203 38.4999V16.5L27.5005 7.33325L49.5022 16.5Z" fill="#EBF5FC"/>
<path d="M8.30726 23.8334H6.35938C5.88479 23.8334 5.5 23.4486 5.5 22.974V21.0261C5.5 20.5515 5.88479 20.1667 6.35938 20.1667H8.30726C8.78185 20.1667 9.16663 20.5515 9.16663 21.0261V22.974C9.16663 23.4486 8.78185 23.8334 8.30726 23.8334Z" fill="#3C58A0"/>
<path d="M15.6403 23.8334H13.6924C13.2178 23.8334 12.833 23.4486 12.833 22.974V21.0261C12.833 20.5515 13.2178 20.1667 13.6924 20.1667H15.6403C16.1149 20.1667 16.4996 20.5515 16.4996 21.0261V22.974C16.4996 23.4486 16.1149 23.8334 15.6403 23.8334Z" fill="#3C58A0"/>
<path d="M22.9742 23.8334H21.0264C20.5518 23.8334 20.167 23.4486 20.167 22.974V21.0261C20.167 20.5515 20.5518 20.1667 21.0264 20.1667H22.9742C23.4488 20.1667 23.8336 20.5515 23.8336 21.0261V22.974C23.8336 23.4486 23.4489 23.8334 22.9742 23.8334Z" fill="#FF4155"/>
<path d="M30.3073 23.8334H28.3594C27.8848 23.8334 27.5 23.4486 27.5 22.974V21.0261C27.5 20.5515 27.8848 20.1667 28.3594 20.1667H30.3073C30.7818 20.1667 31.1666 20.5515 31.1666 21.0261V22.974C31.1666 23.4486 30.7818 23.8334 30.3073 23.8334Z" fill="#FF4155"/>
<path d="M37.6393 23.8334H35.6914C35.2168 23.8334 34.832 23.4486 34.832 22.974V21.0261C34.832 20.5515 35.2168 20.1667 35.6914 20.1667H37.6393C38.1139 20.1667 38.4987 20.5515 38.4987 21.0261V22.974C38.4987 23.4486 38.114 23.8334 37.6393 23.8334Z" fill="#FF4155"/>
<path d="M44.9723 23.8334H43.0244C42.5498 23.8334 42.165 23.4486 42.165 22.974V21.0261C42.165 20.5515 42.5498 20.1667 43.0244 20.1667H44.9723C45.4469 20.1667 45.8317 20.5515 45.8317 21.0261V22.974C45.8317 23.4486 45.4469 23.8334 44.9723 23.8334Z" fill="#FF4155"/>
<path d="M8.30726 31.1666H6.35938C5.88479 31.1666 5.5 30.7818 5.5 30.3073V28.3594C5.5 27.8848 5.88479 27.5 6.35938 27.5H8.30726C8.78185 27.5 9.16663 27.8848 9.16663 28.3594V30.3073C9.16663 30.782 8.78185 31.1666 8.30726 31.1666Z" fill="#FF4155"/>
<path d="M15.6403 31.1666H13.6924C13.2178 31.1666 12.833 30.7818 12.833 30.3073V28.3594C12.833 27.8848 13.2178 27.5 13.6924 27.5H15.6403C16.1149 27.5 16.4996 27.8848 16.4996 28.3594V30.3073C16.4996 30.782 16.1149 31.1666 15.6403 31.1666Z" fill="#FF4155"/>
<path d="M22.9742 31.1666H21.0264C20.5518 31.1666 20.167 30.7818 20.167 30.3073V28.3594C20.167 27.8848 20.5518 27.5 21.0264 27.5H22.9742C23.4488 27.5 23.8336 27.8848 23.8336 28.3594V30.3073C23.8336 30.782 23.4489 31.1666 22.9742 31.1666Z" fill="#3C58A0"/>
<path d="M31.1666 31.1666V28.4166C31.1666 27.9104 30.7563 27.5 30.25 27.5H28.4166C27.9104 27.5 27.5 27.9104 27.5 28.4166V30.25C27.5 30.7563 27.9105 31.1666 28.4166 31.1666H31.1666Z" fill="#3C58A0"/>
<path d="M8.30726 38.5H6.35938C5.88479 38.5 5.5 38.1152 5.5 37.6406V35.6927C5.5 35.2182 5.88479 34.8334 6.35938 34.8334H8.30726C8.78185 34.8334 9.16663 35.2182 9.16663 35.6927V37.6406C9.16663 38.1152 8.78185 38.5 8.30726 38.5Z" fill="#3C58A0"/>
<path d="M15.6403 38.5H13.6924C13.2178 38.5 12.833 38.1152 12.833 37.6406V35.6927C12.833 35.2182 13.2178 34.8334 13.6924 34.8334H15.6403C16.1149 34.8334 16.4996 35.2182 16.4996 35.6927V37.6406C16.4996 38.1152 16.1149 38.5 15.6403 38.5Z" fill="#3C58A0"/>
<path d="M22.9742 38.5H21.0264C20.5518 38.5 20.167 38.1152 20.167 37.6406V35.6927C20.167 35.2182 20.5518 34.8334 21.0264 34.8334H22.9742C23.4488 34.8334 23.8336 35.2182 23.8336 35.6927V37.6406C23.8336 38.1152 23.4489 38.5 22.9742 38.5Z" fill="#3C58A0"/>
<path d="M44.9472 20.1666H43.0512C42.9365 20.1666 42.8272 20.1892 42.7266 20.2288C43.0547 20.3584 43.2872 20.6776 43.2872 21.0519V22.9479C43.2872 23.3221 43.0546 23.6414 42.7266 23.771C42.8272 23.8107 42.9365 23.8333 43.0512 23.8333H44.9472C45.4362 23.8333 45.8326 23.4369 45.8326 22.948V21.052C45.8325 20.563 45.4361 20.1666 44.9472 20.1666Z" fill="#E80054"/>
<path d="M37.6132 20.1666H35.7172C35.6025 20.1666 35.4932 20.1892 35.3926 20.2288C35.7208 20.3584 35.9532 20.6776 35.9532 21.0519V22.9479C35.9532 23.3221 35.7206 23.6414 35.3926 23.771C35.4932 23.8107 35.6025 23.8333 35.7172 23.8333H37.6132C38.1022 23.8333 38.4985 23.4369 38.4985 22.948V21.052C38.4985 20.563 38.1022 20.1666 37.6132 20.1666Z" fill="#E80054"/>
<path d="M30.2812 20.1666H28.3852C28.2704 20.1666 28.1612 20.1892 28.0605 20.2288C28.3887 20.3584 28.6213 20.6776 28.6213 21.0519V22.9479C28.6213 23.3221 28.3887 23.6414 28.0605 23.771C28.1612 23.8107 28.2704 23.8333 28.3852 23.8333H30.2812C30.7702 23.8333 31.1665 23.4369 31.1665 22.948V21.052C31.1664 20.563 30.77 20.1666 30.2812 20.1666Z" fill="#E80054"/>
<path d="M22.9482 20.1666H21.0522C20.9374 20.1666 20.8282 20.1892 20.7275 20.2288C21.0557 20.3584 21.2883 20.6776 21.2883 21.0519V22.9479C21.2883 23.3221 21.0557 23.6414 20.7275 23.771C20.8282 23.8107 20.9374 23.8333 21.0522 23.8333H22.9482C23.4371 23.8333 23.8335 23.4369 23.8335 22.948V21.052C23.8334 20.563 23.4371 20.1666 22.9482 20.1666Z" fill="#E80054"/>
<path d="M15.6142 20.1666H13.7182C13.6035 20.1666 13.4942 20.1892 13.3936 20.2288C13.7217 20.3584 13.9542 20.6776 13.9542 21.0519V22.9479C13.9542 23.3221 13.7216 23.6414 13.3936 23.771C13.4942 23.8107 13.6035 23.8333 13.7182 23.8333H15.6142C16.1032 23.8333 16.4996 23.4369 16.4996 22.948V21.052C16.4996 20.563 16.1032 20.1666 15.6142 20.1666Z" fill="#2A428C"/>
<path d="M8.28117 20.1666H6.38518C6.27045 20.1666 6.1612 20.1892 6.06055 20.2288C6.38872 20.3584 6.62129 20.6776 6.62129 21.0519V22.9479C6.62129 23.3221 6.38872 23.6414 6.06055 23.771C6.1612 23.8107 6.27045 23.8333 6.38518 23.8333H8.28117C8.77016 23.8333 9.16654 23.4369 9.16654 22.948V21.052C9.16644 20.563 8.77005 20.1666 8.28117 20.1666Z" fill="#2A428C"/>
<path d="M8.28117 27.5H6.38518C6.27045 27.5 6.1612 27.5226 6.06055 27.5622C6.38872 27.6917 6.62129 28.011 6.62129 28.3853V30.2814C6.62129 30.6556 6.38872 30.9749 6.06055 31.1044C6.1612 31.1442 6.27045 31.1667 6.38518 31.1667H8.28117C8.77016 31.1667 9.16654 30.7704 9.16654 30.2815V28.3854C9.16644 27.8964 8.77005 27.5 8.28117 27.5Z" fill="#E80054"/>
<path d="M8.28117 34.8334H6.38518C6.27045 34.8334 6.1612 34.8559 6.06055 34.8956C6.38872 35.0251 6.62129 35.3444 6.62129 35.7186V37.6147C6.62129 37.989 6.38872 38.3083 6.06055 38.4378C6.1612 38.4776 6.27045 38.5001 6.38518 38.5001H8.28117C8.77016 38.5001 9.16654 38.1037 9.16654 37.6148V35.7187C9.16644 35.2297 8.77005 34.8334 8.28117 34.8334Z" fill="#2A428C"/>
<path d="M15.6142 27.5H13.7182C13.6035 27.5 13.4942 27.5226 13.3936 27.5622C13.7217 27.6917 13.9542 28.011 13.9542 28.3853V30.2814C13.9542 30.6556 13.7216 30.9749 13.3936 31.1044C13.4942 31.1442 13.6035 31.1667 13.7182 31.1667H15.6142C16.1032 31.1667 16.4996 30.7704 16.4996 30.2815V28.3854C16.4996 27.8964 16.1032 27.5 15.6142 27.5Z" fill="#E80054"/>
<path d="M15.6142 34.8334H13.7182C13.6035 34.8334 13.4942 34.8559 13.3936 34.8956C13.7217 35.0251 13.9542 35.3444 13.9542 35.7186V37.6147C13.9542 37.989 13.7216 38.3083 13.3936 38.4378C13.4942 38.4776 13.6035 38.5001 13.7182 38.5001H15.6142C16.1032 38.5001 16.4996 38.1037 16.4996 37.6148V35.7187C16.4996 35.2297 16.1032 34.8334 15.6142 34.8334Z" fill="#2A428C"/>
<path d="M22.9482 27.5H21.0522C20.9374 27.5 20.8282 27.5226 20.7275 27.5622C21.0557 27.6917 21.2883 28.011 21.2883 28.3853V30.2814C21.2883 30.6556 21.0557 30.9749 20.7275 31.1044C20.8282 31.1442 20.9374 31.1667 21.0522 31.1667H22.9482C23.4371 31.1667 23.8335 30.7704 23.8335 30.2815V28.3854C23.8334 27.8964 23.4371 27.5 22.9482 27.5Z" fill="#2A428C"/>
<path d="M31.1665 31.1666V28.3853C31.1665 27.8963 30.7702 27.5 30.2812 27.5H28.3852C28.2704 27.5 28.1612 27.5226 28.0605 27.5622C28.3887 27.6917 28.6213 28.011 28.6213 28.3853V30.2814C28.6213 30.6556 28.3887 30.9749 28.0605 31.1044C28.1612 31.1442 28.2704 31.1667 28.3852 31.1667H31.1665V31.1666Z" fill="#2A428C"/>
<path d="M22.9482 34.8334H21.0522C20.9374 34.8334 20.8282 34.8559 20.7275 34.8956C21.0557 35.0251 21.2883 35.3444 21.2883 35.7186V37.6147C21.2883 37.989 21.0557 38.3083 20.7275 38.4378C20.8282 38.4776 20.9374 38.5001 21.0522 38.5001H22.9482C23.4371 38.5001 23.8335 38.1037 23.8335 37.6148V35.7187C23.8334 35.2297 23.4371 34.8334 22.9482 34.8334Z" fill="#2A428C"/>
<path d="M46.9551 15.4388V31.9041V42.1666H49.5022V31.9041V16.5L46.9551 15.4388Z" fill="#D3DCFB"/>
<path d="M49.5022 16.5V7.33327C49.5022 5.30826 47.8606 3.66675 45.8357 3.66675H5.49856C3.47355 3.66675 1.83203 5.30826 1.83203 7.33327V16.5H49.5022Z" fill="#3C58A0"/>
<path d="M13.3855 8.1633H10.9989C10.5404 8.1633 10.1689 7.79173 10.1689 7.33336C10.1689 6.87499 10.5405 6.50342 10.9989 6.50342H13.3855C13.844 6.50342 14.2154 6.87499 14.2154 7.33336C14.2154 7.79173 13.8438 8.1633 13.3855 8.1633Z" fill="#2A428C"/>
<path d="M19.2488 8.1633H16.8622C16.4037 8.1633 16.0322 7.79173 16.0322 7.33336C16.0322 6.87499 16.4038 6.50342 16.8622 6.50342H19.2488C19.7072 6.50342 20.0787 6.87499 20.0787 7.33336C20.0787 7.79173 19.7072 8.1633 19.2488 8.1633Z" fill="#2A428C"/>
<path d="M34.4696 8.1633H32.0829C31.6244 8.1633 31.2529 7.79173 31.2529 7.33336C31.2529 6.87499 31.6245 6.50342 32.0829 6.50342H34.4696C34.928 6.50342 35.2995 6.87499 35.2995 7.33336C35.2995 7.79173 34.928 8.1633 34.4696 8.1633Z" fill="#2A428C"/>
<path d="M40.3338 8.1633H37.9471C37.4887 8.1633 37.1172 7.79173 37.1172 7.33336C37.1172 6.87499 37.4888 6.50342 37.9471 6.50342H40.3338C40.7923 6.50342 41.1638 6.87499 41.1638 7.33336C41.1638 7.79173 40.7922 8.1633 40.3338 8.1633Z" fill="#2A428C"/>
<path d="M17.4153 6.875C17.4153 8.14064 16.3893 9.16663 15.1237 9.16663C13.858 9.16663 12.832 8.14064 12.832 6.875V2.29163C12.8319 1.02599 13.8579 0 15.1236 0C16.3892 0 17.4152 1.02599 17.4152 2.29163V6.875H17.4153Z" fill="#EBF5FC"/>
<path d="M38.5004 6.875C38.5004 8.14064 37.4744 9.16663 36.2087 9.16663C34.9431 9.16663 33.917 8.14064 33.917 6.875V2.29163C33.917 1.02599 34.943 0 36.2086 0C37.4743 0 38.5003 1.02599 38.5003 2.29163V6.875H38.5004Z" fill="#EBF5FC"/>
<path d="M36.208 0C35.7375 0 35.3005 0.142227 34.9365 0.38543C35.5515 0.796426 35.9568 1.49649 35.9568 2.29174V6.875C35.9568 7.67014 35.5515 8.37031 34.9365 8.78131C35.3004 9.0244 35.7375 9.16674 36.208 9.16674C37.4736 9.16674 38.4996 8.14075 38.4996 6.87511V2.29163C38.4997 1.02599 37.4737 0 36.208 0Z" fill="#D3DCFB"/>
<path d="M15.124 0C14.6535 0 14.2165 0.142227 13.8525 0.38543C14.4675 0.796426 14.8728 1.49649 14.8728 2.29174V6.875C14.8728 7.67014 14.4675 8.37031 13.8525 8.78131C14.2164 9.0244 14.6535 9.16674 15.124 9.16674C16.3896 9.16674 17.4156 8.14075 17.4156 6.87511V2.29163C17.4157 1.02599 16.3897 0 15.124 0Z" fill="#D3DCFB"/>
<path d="M45.8363 3.66663H43.29C45.315 3.66663 46.9566 5.30814 46.9566 7.33315V16.5H49.5027V7.33326C49.5028 5.30825 47.8612 3.66663 45.8363 3.66663Z" fill="#2A428C"/>
<path d="M1.83203 12.0033H49.5023V13.6633H1.83203V12.0033Z" fill="#2A428C"/>
<path d="M39.417 55C47.0109 55 53.167 48.8439 53.167 41.25C53.167 33.6561 47.0109 27.5 39.417 27.5C31.8231 27.5 25.667 33.6561 25.667 41.25C25.667 48.8439 31.8231 55 39.417 55Z" fill="#4FABF7"/>
<path d="M39.4174 51.3334C44.9862 51.3334 49.5007 46.8189 49.5007 41.25C49.5007 35.6811 44.9862 31.1666 39.4174 31.1666C33.8485 31.1666 29.334 35.6811 29.334 41.25C29.334 46.8189 33.8485 51.3334 39.4174 51.3334Z" fill="#EBF5FC"/>
<path d="M39.4169 40.2465C38.9584 40.2465 38.5869 39.875 38.5869 39.4166V34.8332C38.5869 34.3749 38.9585 34.0033 39.4169 34.0033C39.8753 34.0033 40.2468 34.3749 40.2468 34.8332V39.4166C40.2468 39.875 39.8752 40.2465 39.4169 40.2465Z" fill="#3C58A0"/>
<path d="M44.0009 42.0799H41.2508C40.7924 42.0799 40.4209 41.7084 40.4209 41.25C40.4209 40.7916 40.7925 40.42 41.2508 40.42H44.0009C44.4594 40.42 44.8309 40.7916 44.8309 41.25C44.8309 41.7084 44.4593 42.0799 44.0009 42.0799Z" fill="#3C58A0"/>
<path d="M39.4173 27.5C38.9881 27.5 38.5638 27.5207 38.1446 27.5592C45.1418 28.2015 50.6219 34.0853 50.6219 41.25C50.6219 48.4147 45.1417 54.2985 38.1445 54.9408C38.5637 54.9793 38.988 55 39.4172 55C47.011 55 53.1672 48.8439 53.1672 41.25C53.1672 33.6561 47.0111 27.5 39.4173 27.5Z" fill="#1886EA"/>
<path d="M39.4173 31.1666C38.9865 31.1666 38.5621 31.1938 38.1455 31.2462C43.114 31.8715 46.9571 36.1119 46.9571 41.25C46.9571 46.3881 43.114 50.6285 38.1455 51.2538C38.5621 51.3062 38.9865 51.3334 39.4173 51.3334C44.9861 51.3334 49.5006 46.8189 49.5006 41.25C49.5006 35.6811 44.9861 31.1666 39.4173 31.1666Z" fill="#D3DCFB"/>
<path d="M39.4174 43.0834C40.4299 43.0834 41.2507 42.2625 41.2507 41.25C41.2507 40.2375 40.4299 39.4166 39.4174 39.4166C38.4048 39.4166 37.584 40.2375 37.584 41.25C37.584 42.2625 38.4048 43.0834 39.4174 43.0834Z" fill="#FFDD40"/>
</g>
<defs>
<clipPath id="clip0_13630_67575">
<rect width="55" height="55" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 13 KiB

View File

@ -0,0 +1,19 @@
/*
* Copyright 2024 Collate.
* Licensed 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.
*/
export interface DataRetentionConfigurationClass {
/**
* Enter the retention period for change event records in days (e.g., 7 for one week, 30 for
* one month).
*/
changeEventRetentionPeriod: number;
}

View File

@ -0,0 +1,28 @@
/*
* Copyright 2024 Collate.
* Licensed 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.
*/
export interface RetentionPolicyConfigurationClass {
/**
* Enter the retention period for Activity Threads records in days (e.g., 30 for one month,
* 60 for two months).
*/
activityThreadsRetentionPeriod: number;
/**
* Enter the retention period for change event records in days (e.g., 7 for one week, 30 for
* one month).
*/
changeEventRetentionPeriod: number;
/**
* Enter the number of versions to retain.
*/
versionsRetentionPeriod: number;
}

View File

@ -0,0 +1,18 @@
{
"$id": "https://open-metadata.org/schema/entity/applications/configuration/dataRetentionConfiguration.json",
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Retention Configuration",
"type": "object",
"description": "Configure retention policies for each entity.",
"properties": {
"changeEventRetentionPeriod": {
"title": "Change Event Retention Period (days)",
"description": "Enter the retention period for change event records in days (e.g., 7 for one week, 30 for one month).",
"type": "integer",
"default": 7,
"minimum": 1
}
},
"required": ["changeEventRetentionPeriod"],
"additionalProperties": false
}