当前位置: 首页>>代码示例>>Python>>正文


Python MogamiLog.debug方法代码示例

本文整理汇总了Python中system.MogamiLog.debug方法的典型用法代码示例。如果您正苦于以下问题:Python MogamiLog.debug方法的具体用法?Python MogamiLog.debug怎么用?Python MogamiLog.debug使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在system.MogamiLog的用法示例。


在下文中一共展示了MogamiLog.debug方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: open

# 需要导入模块: from system import MogamiLog [as 别名]
# 或者: from system.MogamiLog import debug [as 别名]
    def open(self, path, flag, mode):
        """open handler.

        @param path file path
        @param flag flags for open(2)
        @param mode open mode (may be empty tuple): actual value is mode[0]
        """
        if self.meta_rep.access(path, os.F_OK) == True:
            # When the required file exist...
            try:
                MogamiLog.debug("!!find the file %s w/ %o" % (path, flag))
                affinity = self.c_channel.getpeername()
                (dest, data_path, fsize) = self.meta_rep.open(
                    path, flag, mode, affinity)

                # create data to send
                ans = 0
                created = False
            except Exception, e:
                MogamiLog.debug("!!find the file but error for %s (%s)" %
                                (path, e))
                try:
                    ans = e.errno
                except Exception, e:
                    ans = errno.ENOENT
                dest = None
                fd = None
                data_path = None
                fsize = None
                created = False
开发者ID:nukamu,项目名称:gxp4,代码行数:32,代码来源:meta.py

示例2: fgetattr

# 需要导入模块: from system import MogamiLog [as 别名]
# 或者: from system.MogamiLog import debug [as 别名]
 def fgetattr(self, fd):
     try:
         st = os.fstat(fd)
         senddata = [0, st]
     except os.error, e:
         MogamiLog.debug("OSError in fgetattr (%s)" % (e))
         senddata = [e.errno, 'null']
开发者ID:nukamu,项目名称:gxp4,代码行数:9,代码来源:meta.py

示例3: utime

# 需要导入模块: from system import MogamiLog [as 别名]
# 或者: from system.MogamiLog import debug [as 别名]
 def utime(self, path, times):
     MogamiLog.debug("path = %s, times = %s" % (path, str(times)))
     try:
         self.meta_rep.utime(path, times)
         ans = 0
     except os.error, e:
         ans = e.errno
开发者ID:nukamu,项目名称:gxp4,代码行数:9,代码来源:meta.py

示例4: __init__

# 需要导入模块: from system import MogamiLog [as 别名]
# 或者: from system.MogamiLog import debug [as 别名]
    def __init__(self, metaaddr, rootpath):
        """This is the function of MogamiMeta's init.

        @param metaaddr ip address or hostname of metadata server
        @param rootpath path of directory to store data into
        """
        # basic information
        self.metaaddr = metaaddr
        self.rootpath = os.path.abspath(rootpath)
        self.filedict = MogamiLocalFileDict()

        # check directory for data files
        assert os.access(self.rootpath, os.R_OK and os.W_OK and os.X_OK)

        # Initialization of Log.
        MogamiLog.init(MogamiLog.TYPE_DATA, conf.data_loglevel)
        MogamiLog.info("Start initialization...")
        MogamiLog.debug("rootpath = " + self.rootpath)

        # At first, connect to metadata server and send request to attend.
        self.m_channel = channel.MogamiChanneltoMeta()
        self.m_channel.connect(self.metaaddr)
        MogamiLog.debug("Success in creating connection to metadata server")
        self.m_channel.dataadd_req(self.rootpath)

        MogamiLog.info("Init complete!!")
开发者ID:nukamu,项目名称:gxp4,代码行数:28,代码来源:data.py

示例5: read

# 需要导入模块: from system import MogamiLog [as 别名]
# 或者: from system.MogamiLog import debug [as 别名]
        def read(self, length, offset):
            """read handler.

            @param length request size of read
            @param offset offset of read request
            @return data read from file (may return errno with error)
            """
            if conf.ap is True:
                start_t = time.time()

            MogamiLog.debug("**read offset=%d, length=%d" % (offset, length))

            ret_buf = self.mogami_file.read(length, offset)

            if conf.ap is True:
                end_t = time.time()
                self.access_pattern.insert_data(self.access_pattern.read, offset,
                                                len(ret_buf))
                
                self.took_time += end_t - start_t

            with self.ap_lock:
                self.read_size += len(ret_buf)

            return ret_buf
开发者ID:nukamu,项目名称:gxp4,代码行数:27,代码来源:fs.py

示例6: rmdir

# 需要导入模块: from system import MogamiLog [as 别名]
# 或者: from system.MogamiLog import debug [as 别名]
 def rmdir(self, path):
     MogamiLog.debug("path=%s" % (path))
     try:
         self.meta_rep.rmdir(path)
         ans = 0
     except os.error, e:
         ans = e.errno
开发者ID:nukamu,项目名称:gxp4,代码行数:9,代码来源:meta.py

示例7: flush

# 需要导入模块: from system import MogamiLog [as 别名]
# 或者: from system.MogamiLog import debug [as 别名]
    def flush(self, fd, listlen, datalen):
        MogamiLog.debug("fd=%d, listlen=%d, datalen=%d" %
                        (fd, listlen, datalen))

        (write_list, buf) = self.c_channel.flush_recv_data(listlen, datalen)
        if len(write_list) != 0:
            write_len = 0
            for wd in write_list:
                try:
                    ans = 0
                    os.lseek(fd, wd[0], os.SEEK_SET)
                    ret = os.write(fd, buf[write_len:write_len + wd[1]])
                    write_len += ret
                    if ret != wd[1]:
                        MogamiLog.error("write length error !!")
                        break
                    MogamiLog.debug("write from offset %d (result %d)" %
                                    (wd[0], ret))
                except OSError, e:
                    ans = e.errno
                    break
                #except Exception, e:
                #    ans = -1
                #    break

            self.c_channel.flush_answer(ans, write_len)
开发者ID:nukamu,项目名称:gxp4,代码行数:28,代码来源:data.py

示例8: mkdir

# 需要导入模块: from system import MogamiLog [as 别名]
# 或者: from system.MogamiLog import debug [as 别名]
 def mkdir(self, path, mode):
     MogamiLog.debug("path = %s mode = %o" % (path, mode))
     try:
         self.meta_rep.mkdir(path, mode)
         ans = 0
     except os.error, e:
         ans = e.errno
开发者ID:nukamu,项目名称:gxp4,代码行数:9,代码来源:meta.py

示例9: send_delete_request

# 需要导入模块: from system import MogamiLog [as 别名]
# 或者: from system.MogamiLog import debug [as 别名]
 def send_delete_request(self, ip, files):
     MogamiLog.debug("file delete request was sent (%s -> %s)" %
                     (ip, str(files)))
     c_channel = channel.MogamiChanneltoData(ip)
     ans = c_channel.delfile_req(files)
     c_channel.close_req()
     c_channel.finalize()
开发者ID:nukamu,项目名称:gxp4,代码行数:9,代码来源:meta.py

示例10: rename

# 需要导入模块: from system import MogamiLog [as 别名]
# 或者: from system.MogamiLog import debug [as 别名]
 def rename(self, oldpath, newpath):
     MogamiLog.debug(oldpath + ' -> ' + newpath)
     try:
         self.meta_rep.rename(oldpath, newpath)
         ans = 0
     except os.error, e:
         ans = e.errno
开发者ID:nukamu,项目名称:gxp4,代码行数:9,代码来源:meta.py

示例11: release

# 需要导入模块: from system import MogamiLog [as 别名]
# 或者: from system.MogamiLog import debug [as 别名]
        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
开发者ID:nukamu,项目名称:gxp4,代码行数:36,代码来源:fs.py

示例12: chmod

# 需要导入模块: from system import MogamiLog [as 别名]
# 或者: from system.MogamiLog import debug [as 别名]
 def chmod(self, path, mode):
     MogamiLog.debug("path = %s w/ mode %s" % (path, oct(mode)))
     try:
         self.meta_rep.chmod(path, mode)
         ans = 0
     except os.error, e:
         ans = e.errno
开发者ID:nukamu,项目名称:gxp4,代码行数:9,代码来源:meta.py

示例13: chown

# 需要导入模块: from system import MogamiLog [as 别名]
# 或者: from system.MogamiLog import debug [as 别名]
 def chown(self, path, uid, gid):
     MogamiLog.debug("path=%s uid=%d gid=%d" % (path, uid, gid))
     try:
         self.meta_rep.chown(path, uid, gid)
         ans = 0
     except os.error, e:
         ans = e.errno
开发者ID:nukamu,项目名称:gxp4,代码行数:9,代码来源:meta.py

示例14: symlink

# 需要导入模块: from system import MogamiLog [as 别名]
# 或者: from system.MogamiLog import debug [as 别名]
 def symlink(self, frompath, topath):
     MogamiLog.debug("frompath = %s, topath = %s" % (frompath, topath))
     try:
         self.meta_rep.symlink(frompath, topath)
         ans = 0
     except os.error, e:
         ans = e.errno
开发者ID:nukamu,项目名称:gxp4,代码行数:9,代码来源:meta.py

示例15: __init__

# 需要导入模块: from system import MogamiLog [as 别名]
# 或者: from system.MogamiLog import debug [as 别名]
 def __init__(self, sysinfo, meta_rep):
     MogamiLog.debug("== start daemon on metadata server ==")
     daemons.MogamiDaemons.__init__(self)
     self.meta_rep = meta_rep
     self.delfile_q = sysinfo.delfile_q
     self.repfile_q = sysinfo.repfile_q
     self.sock_list =[]
     self.sock_dict = {}
开发者ID:nukamu,项目名称:gxp4,代码行数:10,代码来源:meta.py


注:本文中的system.MogamiLog.debug方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。