Example #1
0
File: data.py Project: nukamu/gxp4
    def __init__(self, metaaddr, rootpath):
        """This is the function of MogamiMeta's init.

        @param metaaddr ip address or hostname of metadata server
        @param rootpath path of directory to store data into
        """
        # basic information
        self.metaaddr = metaaddr
        self.rootpath = os.path.abspath(rootpath)
        self.filedict = MogamiLocalFileDict()

        # check directory for data files
        assert os.access(self.rootpath, os.R_OK and os.W_OK and os.X_OK)

        # Initialization of Log.
        MogamiLog.init(MogamiLog.TYPE_DATA, conf.data_loglevel)
        MogamiLog.info("Start initialization...")
        MogamiLog.debug("rootpath = " + self.rootpath)

        # At first, connect to metadata server and send request to attend.
        self.m_channel = channel.MogamiChanneltoMeta()
        self.m_channel.connect(self.metaaddr)
        MogamiLog.debug("Success in creating connection to metadata server")
        self.m_channel.dataadd_req(self.rootpath)

        MogamiLog.info("Init complete!!")
Example #2
0
File: fs.py Project: nukamu/gxp4
def main(meta_addr, args, config=None):
    sys.argv = args
    if 'big_writes' not in args:
        args.extend(['-o', 'big_writes'])
    if 'large_read' not in args:
        args.extend(['-o', 'large_read'])
    MogamiLog.init(MogamiLog.TYPE_FS, conf.fs_loglevel)

    fs = MogamiFS(meta_addr, 
                  version="%prog " + fuse.__version__,
                  usage=fuse.Fuse.fusage)
    fs.flags = 0
    fs.multithreaded = conf.multithreaded
    fs.main()
    fs.finalize()
Example #3
0
File: meta.py Project: nukamu/gxp4
    def __init__(self, rootpath):
        """This is the function of MogamiMeta's init.
        """
        MogamiLog.init(MogamiLog.TYPE_META, conf.meta_loglevel)

        self.sysinfo = MogamiSystemInfo(rootpath)

        # create a object to retrieve metadata information (meta repository)
        if conf.meta_type == 'fs':
            self.meta_rep = metadata.MogamiMetaFS(rootpath)
        elif conf.meta_type == 'db':
            self.meta_rep = None
        else:
            sys.exit("meta_type should be 'fs' or 'db' in config file")

        MogamiLog.info("** Mogami metadata server init was completed **")
        MogamiLog.debug("rootpath = " + rootpath)