Exemple #1
0
    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!!")        
Exemple #2
0
    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!!")
Exemple #3
0
    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()
Exemple #4
0
    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
        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()
Exemple #5
0
            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()
Exemple #6
0
            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()