Esempio n. 1
0
    def record_job_start(self, job_id_string, command_data):
        data = {}
        data['pipeline_id'] = self.id
        data['id'] = job_id_string
        data['command'] = command_data
        data['start_time'] = datetime.datetime.now().isoformat()
        data['end_time'] = None
        data['pid'] = os.getpid()

        self.persistence_mgr.register_keygen_function(const.RECTYPE_JOB,
                                                      self.generate_job_key)
        job_record = cbx.CouchbaseRecordBuilder(
            const.RECTYPE_JOB).add_fields(data).build()
        return self.persistence_mgr.insert_record(job_record)
Esempio n. 2
0
 def _send(self, src_message_header, message_data):
     builder = cbx.CouchbaseRecordBuilder(self._record_type)
     builder.from_json(message_data)
     cb_record = builder.build()
     key = self._couchbase_mgr.insert_record(cb_record)
     log.info('new record key: %s' % key)
Esempio n. 3
0
 def insert_record(self, record_type_name, record_dict):
     cb_record = cbx.CouchbaseRecordBuilder(record_type_name).add_fields(
         record_dict).build()
     return self.data_manager.insert_record(cb_record)