Example #1
0
        
        connServer = self.cluster[0]
        
        utils.print_with_time("Inserting data")
        utils.populateTable(self.conn, self.table, records=10000, fieldName='val')
        
        utils.print_with_time("Starting workload")
        with workload_runner.SplitOrContinuousWorkload(opts, connServer, db_name=self.dbName, table_name=self.tableName) as workload:
            
            utils.print_with_time("Running workload before")
            workload.run_before()
            self.checkCluster()
            
            for currentShards in opts["sequence"]:
                
                utils.print_with_time("Sharding table to %d shards" % currentShards)
                self.table.reconfigure(shards=currentShards, replicas=opts["num-nodes"]).run(self.conn)
                self.table.wait(wait_for='all_replicas_ready').run(self.conn)
                self.checkCluster()
            
            utils.print_with_time("Running workload after")
            workload.run_after()
            self.checkCluster()
        
        utils.print_with_time("Workload complete")

# ===== main

if __name__ == '__main__':
    rdb_unittest.main()
Example #2
0
        utils.print_with_time("Starting workload")
        with workload_runner.SplitOrContinuousWorkload(
                opts, connServer, db_name=self.dbName,
                table_name=self.tableName) as workload:

            utils.print_with_time("Running workload before")
            workload.run_before()
            self.checkCluster()

            for currentShards in opts["sequence"]:

                utils.print_with_time("Sharding table to %d shards" %
                                      currentShards)
                self.table.reconfigure(shards=currentShards,
                                       replicas=opts["num-nodes"]).run(
                                           self.conn)
                self.table.wait(wait_for='all_replicas_ready').run(self.conn)
                self.checkCluster()

            utils.print_with_time("Running workload after")
            workload.run_after()
            self.checkCluster()

        utils.print_with_time("Workload complete")


# ===== main

if __name__ == '__main__':
    rdb_unittest.main()