Skip to content

Latest commit

 

History

History
64 lines (53 loc) · 3.33 KB

File metadata and controls

64 lines (53 loc) · 3.33 KB

Relation Cache Updater

'relation-cache-updater' job is used to perform one time compute and cache information such as leafNodes, optionalNodes, unitsMap and ancestorsMap of a collection to Redis when the collection is published. This data is utilised by other jobs and services.

Key Data format Sample
<collectionId>:leafnodes List<String> collectionId:leafnodes: [“resource1”,”resource2”]
<collectionId>:optionalnodes List<String> collectionId:optionalnodes: [“resource1”,”resource2”]
<rootCollectionId>:<resourceId>:ancestors List<String> collectionId:resource1:ancestors: [“courseunit1”, “democourse”]

Configuration variables:

VariableDefault ValuePurpose
kafka.input.topic{{env}}.lms.user.account.mergeKafka topic from which messages/events are read to be processed.
kafka.groupId{{env}}-relation-cache-updater-groupKafka input topic group Id
lms-cassandra.keyspace{{env}}_hierarchy_storeCassandra keyspace name
lms-cassandra.tablecontent_hierarchyCassandra table used to read collection hierarchy.
redis.database.index10Redis index to which computed data like leafnodes and optionalnodes is stored
dp-redis.hostIP should be same as lp-redis hostdp-redis (data-pipeline redis) IP should be kept same as lp-redis (learning-platform) redis in order to be able to read pulished collection information
dp-redis.portport should be same as lp-redis portdp-redis port
dp-redis.database.index5Redis index to which computed data 'units map' is stored

Sample event:

{
  "eid": "BE_JOB_REQUEST",
  "ets": 1649170015935,
  "mid": "LP.1649170015935.2a7382ff-8bc9-4ff5-8620-2d467cf8990a",
  "actor": {
    "id": "Post Publish Processor",
    "type": "System"
  },
  "context": {
    "pdata": {
      "ver": "1.0",
      "id": "org.sunbird.platform"
    },
    "channel": "01272777697873100812",
    "env": "sunbirdstaging"
  },
  "object": {
    "ver": "1649169952265",
    "id": "do_21350999965318348811690"
  },
  "edata": {
    "action": "post-publish-process",
    "iteration": 1,
    "identifier": "do_21350999965318348811690",
    "channel": "01272777697873100812",
    "mimeType": "application/vnd.ekstep.content-collection",
    "contentType": "Course",
    "pkgVersion": 1,
    "status": "Live",
    "name": "CourseMTimmothy",
    "trackable": {
      "enabled": "Yes",
      "autoBatch": "No"
    }
  }
}

Source code:

{% embed url="https://github.com/Sunbird-Lern/data-pipeline/tree/release-5.3.0/lms-jobs/relation-cache-updater" %}