本文整理汇总了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()
示例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!!")
示例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()