Download as:
Rating : ⭐⭐⭐⭐⭐
Price: $10.99
Language:EN
Pages: 7

Tasks and sink the word counting application question

Page 1 of 7

1 The Exercise

The word-counting application in Figure 1 consists of a source (FileSource), a sink (ResultSink), two tasks (WordCounter and Decompressor), and two streams (FileStream and
WordFrequencyStream) which should function as follows:

FileSource iterates through all the files in a directory specified by the user and pushes the path of every file it finds (encapsulated in a File message) in the directory to the FileStream stream.

files it receives from FileStream. For every zip file it processes, it extracts it into a directory, and then it pushes the path of every uncompressed file in it to the FileStream stream.

ResultSink collects all word frequencies from the WordFrequencyStream stream, aggregates them, and periodically saves them into a CSV (Comma Separated Values) file.

• No sources, tasks, streams or sinks must be disconnected from the rest of the model

• Sources, tasks and sinks can only communicate through streams (e.g. a task cannot be connected to another task directly)

Use Emfatic/Ecore to define a metamodel for the domain-specific language described in Section 1. Include a class diagram of the metamodel in your report, discuss the metamodel, state any assumptions you have made, and explain any alternative design decisions that you have considered and discounted. [15 marks] (max 2 pages)

2.2 Concrete Syntax and Editor

Use the Epsilon Generation Language to implement a model-to-text transformation that consumes a model that conforms to your DSL, and generates a Java implementation of the modelled application. The generated Java code must make use of a messaging middleware such as Apache ActiveMQ (recommended) or RabbitMQ to support asynchronous
communication between sources, tasks and sinks, and must be able to execute within the Eclipse integrated development environment. The model-to-text transformation must
automatically generate all the code of the application except for the behaviour of source, tasks and sinks; this behaviour must be implemented manually on top of the generated code. Discuss

Page 4 of 7

Using the Epsilon Transformation Language, implement a model-to-model transformation that consumes an application model that conforms to your DSL and produces a new application model, that also conforms to your DSL, and which also includes logging tasks. For each task in the source model, the transformation should produce an additional logging task and an additional logging stream in the target model, as shown in Figure 2 (logging tasks and streams are shown as nodes with a grey background). When logging tasks receive a job, they should post a logging message to the LoggerSinkStream stream and forward a copy of the job to the task they log.

The transformation must also produce a new sink (LoggerSink in Figure 2) that receives messages from the LoggerSinkStream stream, and counts the number of times each task was executed. The transformation must not modify its source model. [20 marks] (max 2 pages)

You must submit a single zip file containing your report in PDF and your implementation files. You must not identify yourself. For example, you must not name files with your IT services (or any other) username!

When expanded, your zip file should contain folders and files matching the structure and naming conventions described below. You must replace “Y1234” with your own examination candidate number:

• src-gen (a directory containing the Java code generated by your model-to-text transformation for the word counting application in Question 2.5)

• src (a directory containing the hand-crafted Java code that implements the behaviour of the source, tasks and sink of the word counting application in Question 2.5, and any other hand-crafted Java code the word counting application may need to run)

Copyright © 2009-2023 UrgentHomework.com, All right reserved.