authorjapps / wordcount-k8

Realtime Word Count Using Kubernetes, Kafka and EFK stack
1 stars 1 forks source link

[Java]Create a functions to count the words from a String #1

Open authorjapps opened 4 years ago

authorjapps commented 4 years ago

AC1:

Count the total number of words given a sentence

e.g.

input: `A brown fox`

output: 
Total: 3

AC2:

Count the total number of words given a sentence by their occurnce. e.g.

input: `A brown fox jumped over a dog`

output:
A : 2 
brown: 1 
fox : 1
jumped : 1 
over : 1
dog : 1
rpayal commented 4 years ago

Implemented consumer. Input : Kafka replicates the topic across the cluster. With replication, you can achieve fault tolerance. Also, with data mirroring, you can have data available across data centers. Consider your performance requirements and use only as many brokers as you need to achieve that level of performance, while leveraging technologies that replicate data to other hosts in the cluster in order to maximize availability, performance, and protection.

Output; {"consumerResult":{cluster=2, other=1, brokers=1, data=4, use=1, achieve=2, available=1, protection=1, availability=1, your=1, while=1, replicates=1, maximize=1, that=2, can=2, across=2, and=2, of=1, only=1, centers=1, have=1, leveraging=1, consider=1, mirroring=1, tolerance=1, you=3, order=1, replication=1, replicate=1, requirements=1, in=2, level=1, need=1, hosts=1, fault=1, also=1, many=1, technologies=1, the=3, with=2, as=2, performance=3, kafka=1, topic=1, to=3}}