Example #1
0
 def perform_update(self, timestamp, granularity):
     """
     create e random string and write it
     """
     gen_string = data_gen.generate_str(granularity)
     update_dict = {'_id': timestamp, 'value': gen_string}
     return self.session.update({'_id': update_dict['_id']}, update_dict)
Example #2
0
    def perform_write(self, granularity):
        """
        Writes a randomly generated  string to mongo
        """

        gen_string = data_gen.generate_str(granularity)
        timestamp = "%.6f" % time.time()
        return self.session.set(timestamp, gen_string)
Example #3
0
    def perform_update(self, timestamp, granularity):
        """
        create e random string and write it
        """
        gen_string = data_gen.generate_str(granularity)

        timestamp = time.time()
        return self.cf.insert(timestamp, {"column": gen_string})
Example #4
0
 def perform_update(self, timestamp, granularity):
     """
     update
     """
     gen_string = data_gen.generate_str(granularity)
     insert_dict = {'timestamp:col1': timestamp, 'value:col2': gen_string}
     self.session.put(timestamp, insert_dict)
     return
Example #5
0
 def perform_update(self, timestamp, granularity):
     """
     perform update for a single object
     """
     gen_string = data_gen.generate_str(granularity)
     current_doc = self.get_element_by_timestamp(timestamp)
     current_doc['value'] = gen_string
     self.session.save_doc(current_doc)
     return
Example #6
0
 def perform_update(self, timestamp, granularity):
     """
     update
     """
     current_element = self.get_element_by_timestamp(timestamp)
     gen_string = data_gen.generate_str(granularity)
     current_element.data = gen_string
     current_element.store()
     return
Example #7
0
    def perform_write(self, granularity):
        """
        Writes a randomly generated  string to mongo
        """

        gen_string = data_gen.generate_str(granularity)

        timestamp = time.time()
        inserted_id = self.session.new("%.6f" % timestamp, data=gen_string).store().key
        return inserted_id
Example #8
0
    def perform_write(self, granularity):
        """
        Writes a randomly generated  string to mongo
        """

        gen_string = data_gen.generate_str(granularity)

        timestamp = time.time()
        insert_dict = {'_id': timestamp, 'value': gen_string}
        try:
            inserted_id = self.session.insert_one(insert_dict).inserted_id
        except Exception as e:
            print e
            inserted_id = False
        return inserted_id
Example #9
0
    def perform_write(self, granularity):
        """
        Writes a randomly generated  string to mongo
        """

        gen_string = data_gen.generate_str(granularity)

        timestamp = time.time()
        insert_dict = {'_id': "%.6f" % timestamp, 'value': gen_string}
        try:
            self.session.save_doc(insert_dict)
            inserted_id = insert_dict['_id']
        except Exception as e:
            inserted_id = False
            print e
        return inserted_id
Example #10
0
    def perform_write(self, granularity):
        """
        Writes a randomly generated  string to mongo
        """

        gen_string = data_gen.generate_str(granularity)

        timestamp = "%.6f" % time.time()
        insert_dict = {'timestamp:col1': timestamp, 'value:col2': gen_string}
        try:
            self.session.put(timestamp, insert_dict)
            inserted_id = True
        except Exception as e:
            print e
            inserted_id = False
        return inserted_id
Example #11
0
 def perform_update(self, timestamp, granularity):
     """
     create e random string and write it
     """
     gen_string = data_gen.generate_str(granularity)
     return self.session.set(timestamp, gen_string)