Example #1
0
def main():
    
    (optionsattr,args) = getOptionsParser().parse_args()
    
    
    from fsdfs.filesystem import Filesystem
    
    node = Filesystem({
        "host":"no-host",
        "secret":optionsattr.secret,
        "master":optionsattr.master
    })
    
    if args[0]=="globalstatus":
        
        ret = node.getGlobalStatus()

    elif args[0]=="search":
        
        ret = node.searchFile(args[1])
        
    elif args[0]=="nuke":
        
        ret = node.nodeRPC(node.config["master"],"NUKE",{"filepath":args[1]})

    if optionsattr.json:
        print json.dumps(ret, indent=4)
    else:
        print ret
Example #2
0
def main():

    (optionsattr, args) = getOptionsParser().parse_args()

    from fsdfs.filesystem import Filesystem

    node = Filesystem({
        "host": "no-host",
        "secret": optionsattr.secret,
        "master": optionsattr.master
    })

    if args[0] == "globalstatus":

        ret = node.getGlobalStatus()

    elif args[0] == "search":

        ret = node.searchFile(args[1])

    elif args[0] == "nuke":

        ret = node.nodeRPC(node.config["master"], "NUKE",
                           {"filepath": args[1]})

    if optionsattr.json:
        print json.dumps(ret, indent=4)
    else:
        print ret
Example #3
0
 def downloadFile(self, filepath,nodes):
     
     #sleep for 0 to 1.5 seconds
     #sleep(random.random()*1.5)
     
     return Filesystem.downloadFile(self,filepath,nodes)
Example #4
0
 def downloadFile(self, filepath, nodes):
     if self.blockDownloads:
         return None
     else:
         return Filesystem.downloadFile(self,filepath,nodes)
Example #5
0
    def downloadFile(self, filepath, nodes):

        #sleep for 0 to 1.5 seconds
        #sleep(random.random()*1.5)

        return Filesystem.downloadFile(self, filepath, nodes)
Example #6
0
 def __init__(self, config):
     DFSFilesystem.__init__(self, config)