Beispiel #1
0
Datei: fs.py Projekt: nukamu/gxp4
        def release(self, flags):
            if conf.ap is True:
                start_t = time.time()
            MogamiLog.debug("** release **")
            MogamiLog.critical("** file log ** file:%s\tcmd:%s\tlocal:%s\tread:%s\twrite:%s" % (
                self.path, self.cmd, str(self.local), str(self.read_size), str(self.write_size)))

            fsize = self.mogami_file.release(flags)
            ans = m_channel.release_req(self.path, fsize)
            # delete file size cache
            if self.path in file_size_dict:
                del file_size_dict[self.path]

            if conf.ap is True:
                # prepare data to tell access pattern
                myname = m_channel.getmyname()
                (read_data, write_data) = self.access_pattern.mk_form_data()
                pid = self.access_pattern.pid
                cmd_args = self.access_pattern.cmd_args
                path = self.access_pattern.path

                # get pids of parents
                parents_list = self.access_pattern.parents_list

                end_t = time.time()
                self.took_time += end_t - start_t
                
                # put file access history to repository
                if cmd_args != None:
                    file_access_rep.put_ap((cmd_args, pid, path, myname,
                                            self.took_time, self.created,
                                            read_data, write_data),
                                           pid, parents_list)
            return 0