示例#1
0
def main(argv):
    # setup command line interface
    parser = quilt_core.main_helper('qsub',
        """
        Quilt Submit will allow submission of a query.  It will communicate
        with the query master, receive estimated time/space metrics of the
        query, get user confirmation (if no -y), then deliver the query, to
        the master for processing, print the query id, and then exit.
        A user may select a pattern and then substitute the VARIABLES
        defined in the pattern with the submitted values""",
        argv)

    parser.add_argument('pattern',
        help="name of the pattern to create the query from")
    parser.add_argument('-e', '--notification-email', nargs='?',
        help="comma separated list of emails to supply with notifications")
    parser.add_argument('-y', '--confirm-query', action='store_true',
        default=False, help="whether to automatically confirm the query")
    parser.add_argument('-v', '--variable', nargs=2, action='append',
        help="Arguments used to provide values to the variables in a pattern")

    # parse command line
    args = parser.parse_args(argv)

    # create the object and begin its life
    client = QuiltSubmit(args)

    # start the client
    quilt_core.query_master_client_main_helper({
        client.localname: client})
示例#2
0
def main(argv):
    # setup command line interface
    parser = quilt_core.main_helper('qstat', """Display information
        about the quilt system, including registered source managers""",
        argv)

    args = parser.parse_args(argv)

    # create the object and begin its life
    client = QuiltStatus(args)

    # start the client
    quilt_core.query_master_client_main_helper({
        client.localname: client})
示例#3
0
    def run(self):
        cfg = quilt_core.QuiltConfig()
        smspecs = cfg.GetSourceManagerSpecs()


        objs = {}
        # iterate through source manager configurations
        for smname, smspec in smspecs.items():
            logging.debug(smname + " specified from configuration")
            # create each source manager object
            sm = SourceManager(self.args, smname, smspec)
            objs[sm.localname] = sm


        # start the client with all the source managers
        quilt_core.query_master_client_main_helper(objs)
示例#4
0
def main(argv):
    # setup command line interface
    parser = quilt_core.main_helper('qque', """Quilt Queue will display
        information about queries in the queue.  If id is specified, only 
        that query's information will be displayed, if that id is not present
        nothing is displayed""",
        argv)

    parser.add_argument('query_id', nargs='?',
        help="a query ID for a query in the quilt queue")

    args = parser.parse_args(argv)

    # create the object and begin its life
    client = QuiltQueue(args)

    # start the client
    quilt_core.query_master_client_main_helper({
        client.localname: client})
示例#5
0
def main(argv):
    # setup command line interface
    parser = quilt_core.main_helper('qdef', """
        Define a pattern to the query master.  A pattern is the template for a
        query.  The specified name of the pattern may be modified so as to
        become unique.  The official name of the pattern will be displayed.
        quilt_define will not return until pattern is defined or an error has
        occurred.  It will output the finalized (unique) name for the pattern
        """,
        argv)

    parser.add_argument('code', nargs='?',
        help="the code for the pattern")

    parser.add_argument('-n', '--name', nargs=1,
        help="suggested name of the pattern")

    parser.add_argument('-v', '--variable', nargs='+', action='append',
        help="""VARIABLE [DESCRIPTION [DEFAULT]]]  The variables that are
            part of the pattern, and an optional text description of the 
            purpose of the variable, and the optional default value of the
            variable""")

    parser.add_argument('-m', '--mapping', nargs='+', action='append',
        help="""VARIABLE SOURCE SOURCE_PATTERN SOURCE_VARIABLE
            [SOURCE_PATTERN_INSTANCE] Provide mapping from a pattern variable 
            to a source variable.  Pattern variables are described with the 
            -v, --variable command.  Source variables are described in the 
            data source manger's configuration files.  Source pattern
            instance is optional, but required if pattern is using the same 
            source pattern multiple times so the source variables can be 
            disambiguated""")

    args = parser.parse_args(argv)

    # create the object and begin its life
    client = QuiltDefine(args)

    # start the client
    quilt_core.query_master_client_main_helper({
        client.localname: client})
示例#6
0
def main(argv):
    # setup command line interface
    parser = quilt_core.main_helper('qhist', """
        Quilt history will display information about completed queries.  If ID
        is provided, the Query's information will describe the variables used 
        it its definition, the state of the query, and any results that are
        available.  If there are no completed queries with the specified ID 
        present, An error occurs.""",
        argv)

    parser.add_argument('query_id', nargs='?',
        help="a query ID for a query in the history")

    args = parser.parse_args(argv)

    # create the object and begin its life
    client = QuiltHistory(args)

    # start the client
    quilt_core.query_master_client_main_helper({
        client.localname: client})
示例#7
0
def main(argv):
    # setup command line interface
    parser = quilt_core.main_helper('qury',
                                    """
        Quilt Query will run a query.  It will communicate
        with the query master, receive the specifications for the
        query, the issue source queries to sources.

        Quilt Query should not be called directly by a user
        """,
                                    argv)

    parser.add_argument('query_id', nargs=1,
                        help="The specification of which query to process")

    # parse command line
    args = parser.parse_args(argv)

    # create the object and begin its life
    client = QuiltQuery(args)

    # start the client
    quilt_core.query_master_client_main_helper({
        client.localname: client})