Skip to content

Commit

Permalink
added orquestrator.py
Browse files Browse the repository at this point in the history
git-svn-id: http://sands.sce.ntu.edu.sg/svn/lluis/trunk@10 6fa9df1f-5871-4ed8-8e73-65a2acd6172f
  • Loading branch information
lluis committed Jan 11, 2012
1 parent c99abb7 commit 1ddaaf1
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions experiment_nettraff/orquestrator.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import random
import gevent
from clusterdfs.networking import Client, NetworkHeader

def repair_block(repairing_node, repairing_from, block_size):
c = Client(*repairing_node)
header = {'nodes':repairing_from, 'length':block_size}
c.send(header)
print c.recv()

num_nodes = 51
node_names = ['thinclient-%02d'%i for i in xrange(num_nodes)]
data_nodes = [(n,8888) for n in node_names]
bulk_nodes = [(n,9999) for n in node_names]
#storage_per_node = 1*1000*1000*1000*1000 #(1TB)
storage_per_node = 1*1000*1000*1000 #(1GB)
block_size = 100*1000*1000 #(100MB)
n = 8 # using a (8,3) RS code
k = 3
redundancy = float(n)/k
blocks_per_node = storage_per_node/block_size
num_blocks = blocks_per_node*num_nodes

for block_id in xrange(blocks_per_node):
repairing_node = random.choice(bulk_nodes)
repairing_from = random.sample(data_nodes, k)
print repairing_node, repairing_from
#gevent.spawn(repair_block, repairing_node, repairing_from, block_size)

0 comments on commit 1ddaaf1

Please sign in to comment.