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


Python MogamiLog.init方法代码示例

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


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

示例1: __init__

# 需要导入模块: from libs.System import MogamiLog [as 别名]
# 或者: from libs.System.MogamiLog import init [as 别名]
    def __init__(self, metaaddr, rootpath, mogami_dir):
        """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
        @param mogami_dir path of mogami's root directory
        """
        # basic information of metadata server
        self.metaaddr = metaaddr
        self.rootpath = os.path.abspath(rootpath)
        self.mogami_dir = mogami_dir

        # 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("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.debug("Init complete!!")
开发者ID:limitusus,项目名称:mogami,代码行数:29,代码来源:data.py

示例2: __init__

# 需要导入模块: from libs.System import MogamiLog [as 别名]
# 或者: from libs.System.MogamiLog import init [as 别名]
    def __init__(self, rootpath, mogami_dir):
        """This is the function of MogamiMeta's init.
        In this function,
        """
        MogamiLog.init("meta", conf.meta_loglevel)

        self.sysinfo = MogamiSystemInfo(rootpath, mogami_dir)

        """Check directory for data files.
        """
        if os.access(rootpath, os.R_OK and os.W_OK and os.X_OK) == False:
            sys.exit("%s is not permitted to use. " % (rootpath, ))

        MogamiLog.info("** Mogami metadata server init **")
        MogamiLog.debug("rootpath = " + rootpath)
开发者ID:nukamu,项目名称:mogami,代码行数:17,代码来源:meta.py

示例3: release

# 需要导入模块: from libs.System import MogamiLog [as 别名]
# 或者: from libs.System.MogamiLog import init [as 别名]
            ans = self.mogami_file.fsync(isfsyncfile)
            return ans

        def release(self, flags):
            MogamiLog.debug("** release **")

            fsize = self.mogami_file.release(flags)

            ans = m_channel.release_req(self.metafd, fsize)
            # delete file size cache
            if self.path in file_size_dict:
                del file_size_dict[self.path]
            return 0

    def main(self, *a, **kw):
        """This is the main method of MogamiFS.
        """
        self.file_class = self.MogamiFile
        return Fuse.main(self, *a, **kw)


if __name__ == "__main__":
    MogamiLog.init("fs", conf.fs_loglevel)
    fs = MogamiFS(sys.argv[1],
                  version="%prog " + fuse.__version__,
                  usage=System.usagestr(), )
    fs.flags = 0
    fs.multithreaded = conf.multithreaded
    fs.main()
    fs.finalize()
开发者ID:limitusus,项目名称:mogami,代码行数:32,代码来源:fs.py


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