URL:
https://<knowledgegraphserviceadmin-url>/replicas/trimChangeLog
Methods:
POST
Version Introduced:
12.1

Description

The trimChangeLog operation allows administrative clients to remove change log entries made to a knowledge graph service that fall outside of a specified window of time. Changes made within the specified window are not removed. The trimChangeLog operation is available for knowledge graph services that have Sync feature enabled.

A knowledge graph service can be configured to keep track of changes. Over time, as edits are applied and the change log grows, the size of the underlying dataset will increase. When running trimChangeLog, change log entries that are older than a specific date are removed thus reducing the size of the underlying dataset.

Prior to performing this operation, ensure knowledge graph services are synced or that older replicas have been removed, including replicas that were not synced prior to the moment in which change log entries will be removed. Additionally, the changeLogStatistics parameter can be used to gather log statistics to aid owners and admins in determining any appropriate actions prior to trimming.

Request parameters

ParameterDetails

trimMode

(Required)

The trim mode for trimming the change log to a specific moment in time. When this parameter is set to trimBefore, all change log entries made prior to trimBeforeDate (exclusive) will be removed. trimPreserveReplicas will trim the change log while preserving all replicas ability to synchronize. changeLogStatistics will not trim any change logs, instead provide statistics to demonstrate the change log rows and replicas that would be impacted by a trimBefore moment in time.

values: trimBefore | trimPreserveReplicas | changeLogStatistics

trimBeforeDate

(Required)

The date to trim the change log to. All change log entries made prior to this date (exclusive) will be removed.

Syntax

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
  {
      "trimChangeLogRequest": {
          "trimBefore": {
              "trimBeforeDate": <int64> // milliseconds since epoch
          }
      }
  }

trimPreserveReplicas

(Optional)

This option will trim the change log to the earliest possible date that preserves all available replicas on the knowledge graph service.

Syntax

Use dark colors for code blocksCopy
1
2
3
4
5
  {
      "trimChangeLogRequest": {
        "trimPreserveReplicas": {}
      }
  }

forceTrim

(Optional)

If true this option will trim the change log for replicas with lastSyncDate before the trimBeforeDate. This will fail /synchronize operations against stale replicas, as their resource no longer exists, and force stale replica owners to recreate their replicas. Optional when trimMode is set to trimBefore. The default is false.

Values: true | false

unregisterStaleReplicas

(Optional)

If true this option unregisters replicas whose lastSyncDate is prior to the specified trimBeforeDate. Optional when trimMode is set to trimBefore and forceTrim is true. The default is false.

candidateTrimBeforeDate

(Optional)

The date used to provide statistics demonstrating the change log rows and replicas that would be impacted by trimBefore. Optional when trimMode is set to changeLogStatistics

Syntax

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
    {
      "trimChangeLogRequest": {
        "changeLogStatistics": {
          "candidateTrimBeforeDate": <int64>, // milliseconds since epoch
        }
      }
    }

async

(Optional)

If true, the request is processed as an asynchronous job, and a URL is returned that a client can visit to check the status of the job. The default is false.

Values: true | false

f

The response format. The default format is html.

Values: html | pbf

Example usage

The following is a sample request URL for a knowledge graph service named FieldService:

Use dark colors for code blocksCopy
1
https://organization.example.com/<context>/rest/admin/services/Hosted/FieldService/KnowledgeGraphServer/replicas/trimChangeLog

Requests and responses

This operation can be performed by sending a PBF-formatted request and receiving a PBF-formatted response. The status of the operation can be queried using a PBF-formatted request. Details of the request and response parameters are provided in the appropriate .proto files.

PBF Request

Create a PBF-formatted request to perform this operation based on the TrimChangeLogRequest.proto file.

PBF Response

When executing this operation asynchronously, create a PBF-formatted response to query the status of the operation based on the AsyncStatusResponse.proto file.

Create a PBF-formatted response to query the status of the operation based on the TrimChangeLogResponse.proto file.

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.