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)
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)
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)