Folder Structure

Program User Info Service folder structure is designed to organize the different modules and files that constitute the program user info flink job. It follows a modular approach, facilitating easy management and development of the service.

The structure is as follows

.  
โ”‚
โ””โ”€โ”€ ml-jobs
    โ”œโ”€โ”€ pom.xml
    โ””โ”€โ”€ program-user-info
        โ”œโ”€โ”€ pom.xml
        โ””โ”€โ”€ src
         ย ย  โ”œโ”€โ”€ main
         ย ย  โ”‚ย ย  โ”œโ”€โ”€ resources
         ย ย  โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ program-user-info.conf
         ย ย  โ”‚ย ย  โ””โ”€โ”€ scala
         ย ย  โ”‚ย ย      โ””โ”€โ”€ org
         ย ย  โ”‚ย ย          โ””โ”€โ”€ sunbird
         ย ย  โ”‚ย ย              โ””โ”€โ”€ dp
         ย ย  โ”‚ย ย                  โ””โ”€โ”€ userinfo
         ย ย  โ”‚ย ย                      โ”œโ”€โ”€ domain
         ย ย  โ”‚ย ย                      โ”‚ย ย  โ””โ”€โ”€ Event.scala
         ย ย  โ”‚ย ย                      โ”œโ”€โ”€ functions
         ย ย  โ”‚ย ย                      โ”‚ย ย  โ””โ”€โ”€ ProgramUserInfoFunction.scala
         ย ย  โ”‚ย ย                      โ”œโ”€โ”€ task
         ย ย  โ”‚ย ย                      โ”‚ย ย  โ”œโ”€โ”€ ProgramUserInfoConfig.scala
         ย ย  โ”‚ย ย                      โ”‚ย ย  โ””โ”€โ”€ ProgramUserInfoStreamTask.scala
         ย ย  โ”‚ย ย                      โ””โ”€โ”€ util
         ย ย  โ”‚ย ย                          โ””โ”€โ”€ Commons.scala
         ย ย  โ””โ”€โ”€ test
         ย ย      โ”œโ”€โ”€ resources
         ย ย      โ”‚ย ย  โ”œโ”€โ”€ test.conf
          ย      โ”‚ย ย  โ””โ”€โ”€ test.cql
         ย ย      โ””โ”€โ”€ scala
         ย ย          โ””โ”€โ”€ org
         ย ย              โ””โ”€โ”€ sunbird
         ย ย                  โ””โ”€โ”€ dp
         ย ย                      โ”œโ”€โ”€ fixture
         ย ย                      โ”‚ย ย  โ””โ”€โ”€ EventFixture.scala
         ย ย                      โ””โ”€โ”€ spec
         ย ย                          โ””โ”€โ”€ ProgramUserInfoTaskTestSpec.scala
       
    

ml-jobs

This is the main directory that contains one Flink job called program-user-info.

program-user-info

This folder contains all the required directory for actual implementation of logics.

resources [main]

This folder contains application related configurations in a file called program-user-info.conf

domain

This directory contains a file called Even.scala which is used to declare methods to get specific keys out of JSON.

functions

This folder contains the file ProgramUserInfoFunction.scala which helps in processing and flattening the JSON into one-level key-value pairs. This file also contains the logic to store the flattened data into Cassandra database.

task

This folder contains a file called ProgramUserInfoStreamTask.scala which is an entry point for this service. and another file called ProgramUserInfoConfig.scala which holds the variable constants.

resources [test]

This folder contains test related configurations values in a file called test.conf. Also contains test.cql file which holds the Cassandra query to create keyspace for the testing purpose.

fixture

This directory contains a hard coded kafka events for the testing purpose.

spec

In the spec folder we have the main test case file called ProgramUserInfoTaskTestSpec.scala that is used to test our stream processing task.

Source code

Last updated