Skip to content

Platformatory/flink-queryable-state-store

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Queryable State Store in Apache Flink

Source code for a demo on querying the state store in Apache Flink for a talk at the Bengaluru Streams meetup. The recoding of the talk can be found on YouTube.

Setup

  1. Build the Flink job JAR
cd flink-job
mvn clean package
  1. Bring up the environment
docker-compose up -d broker flink-jobmanager flink-taskmanager
  1. Start the producer
docker-compose up -d producer
  1. Submit job to jobmanager
docker-compose up -d submit
  1. Start query client application
docker-compose logs submit
# Copy job ID from the line `Job has been submitted with JobID cece02e443b75ce6dcbe46d2a4f5a742`
# Here cece02e443b75ce6dcbe46d2a4f5a742 is the JobID, replace it with your own
# Replace the job ID in the client parameters
sed -i 's/flinkJobID/cece02e443b75ce6dcbe46d2a4f5a742/g' docker-compose.yml

docker-compose up -d query-client
  1. Query the state store
curl localhost:8080/query/household_1
# {"key":"household_1", "average_voltage":241.12, "minimum_voltage":0.00, "maximum_voltage":249.48}
curl localhost:8080/query/household_2
# {"key":"household_2", "average_voltage":391.97, "minimum_voltage":0.00, "maximum_voltage":448.97}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published