CS4830 Lab6-count the number of lines Solved

35.00 $

Category:

Description

Rate this product

 

Q1. In this assignment, you will count the number of lines in a file uploaded to the GCS bucket in real-time by using Google Cloud Functions and Pub/Sub.

  1. Download the file from here: ​https://filesamples.com/samples/document/txt/sample1.txt
  2. Write a Google cloud Function which gets triggered whenever a file is added to a bucket and publishes the file name to a topic in Pub/Sub.
  3. Write a python file, which acts as a subscriber to this topic and prints out the number of lines in the file in real-time.

(Documentation for pub/sub available at: ​https://pypi.org/project/google-cloud-pubsub/​ )

 

Test the steps (b) and (c) using the file downloaded in step (a). Ensure that you add screenshots and share the code for all steps.

 

Q2. There are two kinds of subscribers – pull and push subscribers. What are the differences between the two and when would you prefer one over the other?

 

 

  • Lab-6-jgw10t.zip