-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.sh
executable file
·28 lines (20 loc) · 1.88 KB
/
setup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
cd dev
#echo "topics before: `docker-compose exec kafka-1 ./usr/bin/kafka-topics --list --zookeeper zookeeper-1`"
docker-compose exec kafka-1 ./usr/bin/kafka-topics --delete --topic movieIds-with-ratings --zookeeper zookeeper-1
docker-compose exec kafka-1 ./usr/bin/kafka-topics --delete --topic userIds-to-movieIds-ratings --zookeeper zookeeper-1
docker-compose exec kafka-1 ./usr/bin/kafka-topics --delete --topic eof --zookeeper zookeeper-1
for ((i=0; i<=$2; i++)); do
docker-compose exec kafka-1 ./usr/bin/kafka-topics --delete --topic user-features-"$i" --zookeeper zookeeper-1
docker-compose exec kafka-1 ./usr/bin/kafka-topics --delete --topic movie-features-"$i" --zookeeper zookeeper-1
done
docker-compose exec kafka-1 ./usr/bin/kafka-topics --create --topic movieIds-with-ratings --replication-factor 1 --partitions "$1" --zookeeper zookeeper-1
docker-compose exec kafka-1 ./usr/bin/kafka-topics --create --topic userIds-to-movieIds-ratings --replication-factor 1 --partitions "$1" --zookeeper zookeeper-1
docker-compose exec kafka-1 ./usr/bin/kafka-topics --create --topic eof --replication-factor 1 --partitions "$1" --zookeeper zookeeper-1
for ((i=0; i<$2; i++)); do
docker-compose exec kafka-1 ./usr/bin/kafka-topics --create --topic user-features-"$i" --replication-factor 1 --partitions "$1" --zookeeper zookeeper-1
docker-compose exec kafka-1 ./usr/bin/kafka-topics --create --topic movie-features-"$i" --replication-factor 1 --partitions "$1" --zookeeper zookeeper-1
done
docker-compose exec kafka-1 ./usr/bin/kafka-topics --create --topic user-features-"$2" --replication-factor 1 --partitions 1 --zookeeper zookeeper-1
docker-compose exec kafka-1 ./usr/bin/kafka-topics --create --topic movie-features-"$2" --replication-factor 1 --partitions 1 --zookeeper zookeeper-1
#echo "topics after: `docker-compose exec kafka-1 ./usr/bin/kafka-topics --list --zookeeper zookeeper-1`"
cd ..