本文整理汇总了Python中libs.system.DRDFSLog.debug方法的典型用法代码示例。如果您正苦于以下问题:Python DRDFSLog.debug方法的具体用法?Python DRDFSLog.debug怎么用?Python DRDFSLog.debug使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类libs.system.DRDFSLog
的用法示例。
在下文中一共展示了DRDFSLog.debug方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from libs.system import DRDFSLog [as 别名]
# 或者: from libs.system.DRDFSLog import debug [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!!")
示例2: __init__
# 需要导入模块: from libs.system import DRDFSLog [as 别名]
# 或者: from libs.system.DRDFSLog import debug [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()
示例3: release
# 需要导入模块: from libs.system import DRDFSLog [as 别名]
# 或者: from libs.system.DRDFSLog import debug [as 别名]
def release(self, fd, dest, fsize, filename, created):
"""release handler.
@param fd file discripter
@param writelen size of data to be written
"""
os.lseek(fd, 0, os.SEEK_SET)
DRDFSLog.debug("fd = " + str(fd))
if created == False:
self.repl_info.ReplInfoWhenClose(filename, dest,
self.access_info)
else:
try:
buf = os.read(fd, conf.bufsize)
except os.error, e:
print "OSError in release (%s)" %(e)
l = buf.rsplit(',')
size = string.atol(l[2])
try:
buf = l[0] + ',' + l[1] + ',' + str(fsize) + ',\n'
DRDFSLog.debug("write to meta file %s" % buf)
os.ftruncate(fd, len(buf))
os.lseek(fd, 0, os.SEEK_SET)
os.write(fd, buf)
os.fsync(fd)
except os.error, e:
print "OSError in release (%s)" %(e)
示例4: mkdir
# 需要导入模块: from libs.system import DRDFSLog [as 别名]
# 或者: from libs.system.DRDFSLog import debug [as 别名]
def mkdir(self, path, mode):
DRDFSLog.debug('path=%s mode=%o' % (path, mode))
try:
os.mkdir(path, mode)
senddata = 0
except os.error, e:
senddata = e.errno
示例5: rename
# 需要导入模块: from libs.system import DRDFSLog [as 别名]
# 或者: from libs.system.DRDFSLog import debug [as 别名]
def rename(self, oldpath, newpath):
DRDFSLog.debug(oldpath + ' -> ' + newpath)
try:
os.rename(oldpath, newpath)
senddata = 0
except os.error, e:
senddata = e.errno
示例6: chmod
# 需要导入模块: from libs.system import DRDFSLog [as 别名]
# 或者: from libs.system.DRDFSLog import debug [as 别名]
def chmod(self, path, mode):
DRDFSLog.debug('path=%s w/ mode %o' % (path, mode))
try:
os.chmod(path, mode)
senddata = 0
except os.error, e:
senddata = e.errno
示例7: chown
# 需要导入模块: from libs.system import DRDFSLog [as 别名]
# 或者: from libs.system.DRDFSLog import debug [as 别名]
def chown(self, path, uid, gid):
DRDFSLog.debug("path=%s uid=%d gid=%d" % (path, uid, gid))
try:
os.chown(path, uid, gid)
senddata = 0
except os.error, e:
senddata = e.errno
示例8: utime
# 需要导入模块: from libs.system import DRDFSLog [as 别名]
# 或者: from libs.system.DRDFSLog import debug [as 别名]
def utime(self, path, times):
DRDFSLog.debug("path = %s, times = %s" % (path, times))
try:
os.utime(path, times)
senddata = 0
except os.error, e:
senddata = e.errno
示例9: rmdir
# 需要导入模块: from libs.system import DRDFSLog [as 别名]
# 或者: from libs.system.DRDFSLog import debug [as 别名]
def rmdir(self, path):
DRDFSLog.debug('path=%s' % (path))
try:
os.rmdir(path)
senddata = 0
except os.error, e:
senddata = e.errno
示例10: readdir
# 需要导入模块: from libs.system import DRDFSLog [as 别名]
# 或者: from libs.system.DRDFSLog import debug [as 别名]
def readdir(self, path):
DRDFSLog.debug('path=%s' % (path))
try:
l = os.listdir(path)
senddata = [0, l]
except os.error, e:
senddata = [e.errno, "null"]
print 'error!'
示例11: access
# 需要导入模块: from libs.system import DRDFSLog [as 别名]
# 或者: from libs.system.DRDFSLog import debug [as 别名]
def access(self, path, mode):
DRDFSLog.debug("** access **" + path + str(mode))
senddata = ["access", path, mode]
ans = m_channel.send_recv_flow(senddata)
if ans != True:
return -errno.EACCES
return 0
示例12: run
# 需要导入模块: from libs.system import DRDFSLog [as 别名]
# 或者: from libs.system.DRDFSLog import debug [as 别名]
def run(self,):
while True:
daemons_alive = threading.enumerate()
for d in self.daemons:
if d not in daemons_alive:
d.join()
DRDFSLog.debug("** join thread **")
self.daemons.remove(d)
time.sleep(3)
示例13: access
# 需要导入模块: from libs.system import DRDFSLog [as 别名]
# 或者: from libs.system.DRDFSLog import debug [as 别名]
def access(self, path, mode):
DRDFSLog.debug('path=%s' % (path))
try:
if os.access(path, mode) == True:
senddata = True
else:
senddata = False
except os.error, e:
senddata = False
示例14: getattr
# 需要导入模块: from libs.system import DRDFSLog [as 别名]
# 或者: from libs.system.DRDFSLog import debug [as 别名]
def getattr(self, path):
DRDFSLog.debug('path = ' + path)
try:
st = os.lstat(path)
except os.error, e:
DRDFSLog.debug("stat error!")
senddata = [e.errno, "null"]
self.c_channel.send_header(senddata)
return
示例15: fsinit
# 需要导入模块: from libs.system import DRDFSLog [as 别名]
# 或者: from libs.system.DRDFSLog import debug [as 别名]
def fsinit(self):
"""Called before fs.main() called.
"""
DRDFSLog.info("** DRDFS FS init **")
DRDFSLog.debug("Success in creating connection to metadata server")
DRDFSLog.debug("Init complete!!")
collector_thread = self.thread_collector(daemons)
collector_thread.start()
threads_count = 0