Homework for distribution system courses.
python version == 3.6.13
build up(with conda):
-
create a new conda environment.
$conda create -n your_env_name
-
activate new env
$conda activate your_env_name
-
install the requirements:
$conda install pip (if pip is not installed before)
$pip install -r requirements.txt
-
launch the servers.
4.1 launch curator server:
$ cd ./curator/
$ python curator.py
4.2 lauch region server:
$ cd ./region_server
$ python region_server.py
4.3 lauch client:
$ cd ./client
$ python client_master.py
build up(without conda):
-
install the requirements:
$ pip install -r requirements.txt
-
launch the servers.
(To test the system effficiently, please launch at least one region server. If the test is done locally, please change the port in the ./region_server/config.py)
create table people (
ID char(20),
name char(20),
age int,
height float,
primary key (ID)
);
insert into people values (3150659278, 'dong', 20, 177.5);
insert into people values (
3191115278,
'han',
22,
187.5
);
insert into people values (
3191118888,
'chen',
19,
187.5
);
insert into people values (
3179615278,
'wei',
18,
187.5
);
select * from people; # 无条件查找
select * from people # 有条件查找
where age > 20;
delete from people where age > 20; # 条件删除
delete from people; # 无条件删除
create index sid on people (ID);
drop index sid;
drop table people;
exit;