FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
Distributed-File-Storage/src/StartNodeExample.py at master · mssrinivas/Distributed-File-Storage · GitHub
mssrinivas
/
Distributed-File-Storage
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
2
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
Distributed-File-Storage
/
src
/
StartNodeExample.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
executable file
·
31 lines (28 loc) · 1.1 KB
Breadcrumbs
Distributed-File-Storage
/
src
/
StartNodeExample.py
Copy path
File metadata and controls
executable file
·
31 lines (28 loc) · 1.1 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
29
30
31
import
sys
sys
.
path
.
append
(
'./service'
)
sys
.
path
.
append
(
'./proto'
)
sys
.
path
.
append
(
'./'
)
from
StorageManager
import
StorageManagerServer
import
grpc
import
time
import
chunk_pb2
,
chunk_pb2_grpc
from
concurrent
import
futures
from
proto
import
fileService_pb2
,
fileService_pb2_grpc
from
ReplicationService
import
ReplicationService
if
__name__
==
'__main__'
:
print
(
"Starting Storage Manager."
)
server_grpc
=
grpc
.
server
(
futures
.
ThreadPoolExecutor
(
max_workers
=
10
))
total_memory_node_bytes
=
1
*
1024
*
1024
*
1024
# start with 1 GB
CHUNK_SIZE_
=
1024
total_page_memory_size_bytes
=
CHUNK_SIZE_
chunk_pb2_grpc
.
add_FileServerServicer_to_server
(
StorageManagerServer
(
total_memory_node_bytes
,
total_page_memory_size_bytes
),
server_grpc
, )
#fileService_pb2_grpc.add_FileserviceServicer_to_server(ReplicationService(), server_grpc)
port
=
5555
server_grpc
.
add_insecure_port
(
f'[::]:
{
port
}
'
)
server_grpc
.
start
()
print
(
"Storage Manager is READY."
)
try
:
while
True
:
time
.
sleep
(
60
*
60
*
24
)
# should infinity
except
KeyboardInterrupt
:
server_grpc
.
stop
(
0
)
Back
|
FazBrowse Home
|
New Git URL