renamed sharding to set-shards

This commit is contained in:
Rodolphe Marques 2016-05-09 17:31:02 +02:00
parent 9f959fc6ed
commit f09dacdd11
2 changed files with 4 additions and 4 deletions

View File

@ -204,7 +204,7 @@ def run_load(args):
workers.start() workers.start()
def run_sharding(args): def run_set_shards(args):
b = bigchaindb.Bigchain() b = bigchaindb.Bigchain()
r.table('bigchain').reconfigure(shards=args.num_shards, replicas=1).run(b.conn) r.table('bigchain').reconfigure(shards=args.num_shards, replicas=1).run(b.conn)
r.table('backlog').reconfigure(shards=args.num_shards, replicas=1).run(b.conn) r.table('backlog').reconfigure(shards=args.num_shards, replicas=1).run(b.conn)
@ -251,7 +251,7 @@ def main():
help='Start BigchainDB') help='Start BigchainDB')
# parser for configuring the number of shards # parser for configuring the number of shards
sharding_parser = subparsers.add_parser('sharding', sharding_parser = subparsers.add_parser('set-shards',
help='Configure number of shards') help='Configure number of shards')
sharding_parser.add_argument('num_shards', metavar='num_shards', type=int, default=1, sharding_parser.add_argument('num_shards', metavar='num_shards', type=int, default=1,

View File

@ -229,11 +229,11 @@ def test_start_rethinkdb_exits_when_cannot_start(mock_popen):
def test_configure_sharding(b): def test_configure_sharding(b):
import rethinkdb as r import rethinkdb as r
from bigchaindb.commands.bigchain import run_sharding from bigchaindb.commands.bigchain import run_set_shards
# change number of shards # change number of shards
args = Namespace(num_shards=3) args = Namespace(num_shards=3)
run_sharding(args) run_set_shards(args)
# retrieve table configuration # retrieve table configuration
table_config = list(r.db('rethinkdb') table_config = list(r.db('rethinkdb')