當前位置: 首頁>>代碼示例>>Python>>正文


Python DRDFSLog.init方法代碼示例

本文整理匯總了Python中libs.system.DRDFSLog.init方法的典型用法代碼示例。如果您正苦於以下問題:Python DRDFSLog.init方法的具體用法?Python DRDFSLog.init怎麽用?Python DRDFSLog.init使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在libs.system.DRDFSLog的用法示例。


在下文中一共展示了DRDFSLog.init方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: from libs.system import DRDFSLog [as 別名]
# 或者: from libs.system.DRDFSLog import init [as 別名]
    def __init__(self, rootpath, dddfs_dir):
        self.rootpath = os.path.abspath(rootpath)
        self.dddfs_dir = dddfs_dir
        
        """Check directory for meta data files.
        """
        if os.access(self.rootpath,
                     os.R_OK and os.W_OK and os.X_OK) == False:
            sys.exit("%s is not permitted to use. " % (self.rootpath, ))

        DRDFSLog.init("meta", DRDFSLog.DEBUG)
        DRDFSLog.info("** DRDFS metadata server init **")
        DRDFSLog.debug("rootpath = " + self.rootpath)

        # for replication
        if conf.replication == True:
            self.repl_info = ReplicationManager.ReplicationManager()
        self.cluster_info = cluster.DDDFSNodesInfo(
            os.path.join(self.dddfs_dir, 'conf', conf.cluster_conf_file))

        self.access_info = chooseDataNode.FileAccessInfo()

        self.delfiles_q = Queue.Queue()
        self.datalist = []
        self.repq = Queue.Queue()
開發者ID:laysakura,項目名稱:dddfs,代碼行數:27,代碼來源:meta.py

示例2: __init__

# 需要導入模塊: from libs.system import DRDFSLog [as 別名]
# 或者: from libs.system.DRDFSLog import init [as 別名]
    def __init__(self, metaaddr, rootpath, dddfs_dir):
        """initialize DDDFS's data server daemon
        """
        self.metaaddr = metaaddr
        self.rootpath = os.path.abspath(rootpath)
        self.dddfs_dir = dddfs_dir

        """Check directory for data files.
        """
        assert os.access(self.rootpath, os.R_OK and os.W_OK and os.X_OK)
        
        """Initialize Log
        """
        DRDFSLog.init("data", DRDFSLog.DEBUG)

        """At first, connect to metadata server and send request to attend.
        """
        mchannel = channel.DRDFSChannel()
        mchannel.connect(self.metaaddr, conf.metaport)

        DRDFSLog.debug("Success in creating connection to metadata server")
        senddata = ['dataadd', self.rootpath]
        
        ans = mchannel.send_recv_flow(senddata)
        if ans == -1:
            e = system.DDDFSSystemError()
            raise e
        mchannel.brk_channel()

        DRDFSLog.debug("Init complete!!")        
開發者ID:laysakura,項目名稱:dddfs,代碼行數:32,代碼來源:data.py

示例3: fgetattr

# 需要導入模塊: from libs.system import DRDFSLog [as 別名]
# 或者: from libs.system.DRDFSLog import init [as 別名]
            else:
                self._fflush()

            senddata = ["release", self.datafd]
            ans = self.d_channel.send_recv_flow(senddata)
            self.bldata = None
            self.timedic = None

            senddata = ["release", self.metafd, self.dist, ans, self.path, self.created]

            ans = m_channel.send_recv_flow(senddata)
            return 0

    #        def fgetattr(self):
    #            return 0

    #        def ftruncate(self, len):
    #            return 0

    def main(self, *a, **kw):
        self.file_class = self.DRDFSFile
        return Fuse.main(self, *a, **kw)


if __name__ == "__main__":
    DRDFSLog.init("fs", DRDFSLog.DEBUG)
    fs = DRDFS(sys.argv[1], version="%prog " + fuse.__version__, usage=system.usagestr())
    fs.multithreaded = conf.multithreaded
    fs.main()
    fs.finalize()
開發者ID:nukamu,項目名稱:dddfs,代碼行數:32,代碼來源:fs.py


注:本文中的libs.system.DRDFSLog.init方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。