当前位置: 首页>>代码示例>>Python>>正文


Python OptParser.add_option_group方法代码示例

本文整理汇总了Python中gppylib.gpparseopts.OptParser.add_option_group方法的典型用法代码示例。如果您正苦于以下问题:Python OptParser.add_option_group方法的具体用法?Python OptParser.add_option_group怎么用?Python OptParser.add_option_group使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在gppylib.gpparseopts.OptParser的用法示例。


在下文中一共展示了OptParser.add_option_group方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: create_parser

# 需要导入模块: from gppylib.gpparseopts import OptParser [as 别名]
# 或者: from gppylib.gpparseopts.OptParser import add_option_group [as 别名]
    def create_parser():
        parser = OptParser(option_class=OptChecker,
            description="Greenplum Package Manager",
            version='%prog version $Revision: #1 $')
        parser.setHelp([])

        addStandardLoggingAndHelpOptions(parser, includeNonInteractiveOption=True)

        parser.remove_option('-q')
        parser.remove_option('-l')
        
        add_to = OptionGroup(parser, 'General Options')
        parser.add_option_group(add_to)

        addMasterDirectoryOptionForSingleClusterProgram(add_to)

        # TODO: AK: Eventually, these options may need to be flexible enough to accept mutiple packages
        # in one invocation. If so, the structure of this parser may need to change.
        add_to.add_option('-i', '--install', help='install the given gppkg', metavar='<package>')
        add_to.add_option('-u', '--update', help='update the given gppkg', metavar='<package>')
        add_to.add_option('-r', '--remove', help='remove the given gppkg', metavar='<name>-<version>')
        add_to.add_option('-q', '--query', help='query the gppkg database or a particular gppkg', action='store_true')
        add_to.add_option('-b', '--build', help='build a gppkg', metavar='<directory>')
        add_to.add_option('-c', '--clean', help='clean the cluster of the given gppkg', action='store_true')
        add_to.add_option('--migrate', help='migrate gppkgs from a separate $GPHOME', metavar='<from_gphome> <to_gphome>', action='store_true', default=False)

        add_to = OptionGroup(parser, 'Query Options')
        parser.add_option_group(add_to)
        add_to.add_option('--info', action='store_true', help='print information about the gppkg including name, version, description')
        add_to.add_option('--list', action='store_true', help='print all the files present in the gppkg')
        add_to.add_option('--all', action='store_true', help='print all the gppkgs installed by gppkg')

        return parser
开发者ID:BALDELab,项目名称:incubator-hawq,代码行数:35,代码来源:gppkg.py

示例2: createParser

# 需要导入模块: from gppylib.gpparseopts import OptParser [as 别名]
# 或者: from gppylib.gpparseopts.OptParser import add_option_group [as 别名]
    def createParser():

        description = ("""
        Clean segment directories.
        """)

        help = ["""
          To be used internally only.
        """]

        parser = OptParser(option_class=OptChecker,
                    description=' '.join(description.split()),
                    version='%prog version $Revision: #1 $')
        parser.setHelp(help)

        addStandardLoggingAndHelpOptions(parser, True)

        addTo = OptionGroup(parser, "Clean Segment Options")
        parser.add_option_group(addTo)
        addTo.add_option('-p', None, dest="pickledArguments",
                         type='string', default=None, metavar="<pickledArguments>",
                       help="The arguments passed from the original script")

        parser.set_defaults()
        return parser
开发者ID:adam8157,项目名称:gpdb,代码行数:27,代码来源:gpcleansegmentdir.py

示例3: createParser

# 需要导入模块: from gppylib.gpparseopts import OptParser [as 别名]
# 或者: from gppylib.gpparseopts.OptParser import add_option_group [as 别名]
    def createParser():

        description = ("Add mirrors to a system")
        help = [""]

        parser = OptParser(option_class=OptChecker,
                           description=' '.join(description.split()),
                           version='%prog version $Revision$')
        parser.setHelp(help)

        addStandardLoggingAndHelpOptions(parser, True)

        addTo = OptionGroup(parser, "Connection Options")
        parser.add_option_group(addTo)
        addMasterDirectoryOptionForSingleClusterProgram(addTo)

        addTo = OptionGroup(parser, "Mirroring Options")
        parser.add_option_group(addTo)
        addTo.add_option("-i", None, type="string",
                         dest="mirrorConfigFile",
                         metavar="<configFile>",
                         help="Mirroring configuration file")

        addTo.add_option("-o", None,
                         dest="outputSampleConfigFile",
                         metavar="<configFile>", type="string",
                         help="Sample configuration file name to output; "
                         "this file can be passed to a subsequent call using -i option")
        
        addTo.add_option("-m", None, type="string",
                         dest="mirrorDataDirConfigFile",
                         metavar="<dataDirConfigFile>",
                         help="Mirroring data directory configuration file")

        addTo.add_option('-s', default=False, action='store_true',
                         dest="spreadMirroring" ,
                         help="use spread mirroring for placing mirrors on hosts")

        addTo.add_option("-p", None, type="int", default=1000,
                         dest="mirrorOffset",
                         metavar="<mirrorOffset>",
                         help="Mirror port offset.  The mirror port offset will be used multiple times "
                         "to derive three sets of ports [default: %default]")

        addTo.add_option("-B", None, type="int", default=16,
                         dest="parallelDegree",
                         metavar="<parallelDegree>",
                         help="Max # of workers to use for building recovery segments.  [default: %default]")

        parser.set_defaults()
        return parser
开发者ID:BALDELab,项目名称:incubator-hawq,代码行数:53,代码来源:clsAddMirrors.py

示例4: createParser

# 需要导入模块: from gppylib.gpparseopts import OptParser [as 别名]
# 或者: from gppylib.gpparseopts.OptParser import add_option_group [as 别名]
    def createParser():

        description = ("Recover a failed segment")
        help = [""]

        parser = OptParser(option_class=OptChecker,
                           description=' '.join(description.split()),
                           version='%prog version $Revision$')
        parser.setHelp(help)

        loggingGroup = addStandardLoggingAndHelpOptions(parser, True)
        loggingGroup.add_option("-s", None, default=None, action='store_false',
                                dest='showProgressInplace',
                                help='Show pg_basebackup progress sequentially instead of inplace')
        loggingGroup.add_option("--no-progress",
                                dest="showProgress", default=True, action="store_false",
                                help="Suppress pg_basebackup progress output")

        addTo = OptionGroup(parser, "Connection Options")
        parser.add_option_group(addTo)
        addMasterDirectoryOptionForSingleClusterProgram(addTo)

        addTo = OptionGroup(parser, "Recovery Source Options")
        parser.add_option_group(addTo)
        addTo.add_option("-i", None, type="string",
                         dest="recoveryConfigFile",
                         metavar="<configFile>",
                         help="Recovery configuration file")
        addTo.add_option("-o", None,
                         dest="outputSampleConfigFile",
                         metavar="<configFile>", type="string",
                         help="Sample configuration file name to output; "
                              "this file can be passed to a subsequent call using -i option")

        addTo = OptionGroup(parser, "Recovery Destination Options")
        parser.add_option_group(addTo)
        addTo.add_option("-p", None, type="string",
                         dest="newRecoverHosts",
                         metavar="<targetHosts>",
                         help="Spare new hosts to which to recover segments")

        addTo = OptionGroup(parser, "Recovery Options")
        parser.add_option_group(addTo)
        addTo.add_option('-F', None, default=False, action='store_true',
                         dest="forceFullResynchronization",
                         metavar="<forceFullResynchronization>",
                         help="Force full segment resynchronization")
        addTo.add_option("-B", None, type="int", default=16,
                         dest="parallelDegree",
                         metavar="<parallelDegree>",
                         help="Max # of workers to use for building recovery segments.  [default: %default]")
        addTo.add_option("-r", None, default=False, action='store_true',
                         dest='rebalanceSegments', help='Rebalance synchronized segments.')

        parser.set_defaults()
        return parser
开发者ID:adam8157,项目名称:gpdb,代码行数:58,代码来源:clsRecoverSegment.py

示例5: createParser

# 需要导入模块: from gppylib.gpparseopts import OptParser [as 别名]
# 或者: from gppylib.gpparseopts.OptParser import add_option_group [as 别名]
    def createParser():
        """
        Constructs and returns an option parser.

        Called by simple_main()
        """
        parser = OptParser(option_class=OptChecker, version="%prog version $Revision: $")
        parser.setHelp(__help__)

        addStandardLoggingAndHelpOptions(parser, False)

        opts = OptionGroup(parser, "Required Options")
        opts.add_option("-d", "--directory", type="string")
        opts.add_option("-i", "--dbid", type="int")
        parser.add_option_group(opts)

        parser.set_defaults()
        return parser
开发者ID:ginobiliwang,项目名称:gpdb,代码行数:20,代码来源:gpsetdbid.py

示例6: create_parser

# 需要导入模块: from gppylib.gpparseopts import OptParser [as 别名]
# 或者: from gppylib.gpparseopts.OptParser import add_option_group [as 别名]
    def create_parser():
        """Create the command line parser object for gpkill"""

        help = []
        parser = OptParser(option_class=OptChecker,
                    description='Check or Terminate a Greenplum Database process.',
                    version='%prog version $Revision: #1 $')
        parser.setHelp(help)

        addStandardLoggingAndHelpOptions(parser, True)

        parser.remove_option('-l')
        parser.remove_option('-a')
 
        addTo = OptionGroup(parser, 'Check Options') 
        parser.add_option_group(addTo)
        addTo.add_option('--check', metavar='pid', help='Only returns status 0 if pid may be killed without gpkill, status 1 otherwise.', action='store_true')
        
        return parser
开发者ID:PivotalBigData,项目名称:gpdb,代码行数:21,代码来源:kill.py

示例7: create_parser

# 需要导入模块: from gppylib.gpparseopts import OptParser [as 别名]
# 或者: from gppylib.gpparseopts.OptParser import add_option_group [as 别名]
    def create_parser():
        parser = OptParser(
            option_class=OptChecker, description="Greenplum Package Manager", version="%prog version $Revision: #1 $"
        )
        parser.setHelp([])

        addStandardLoggingAndHelpOptions(parser, includeNonInteractiveOption=True)

        parser.remove_option("-q")
        parser.remove_option("-l")

        add_to = OptionGroup(parser, "General Options")
        parser.add_option_group(add_to)

        addMasterDirectoryOptionForSingleClusterProgram(add_to)

        # TODO: AK: Eventually, these options may need to be flexible enough to accept mutiple packages
        # in one invocation. If so, the structure of this parser may need to change.
        add_to.add_option("-i", "--install", help="install the given gppkg", metavar="<package>")
        add_to.add_option("-u", "--update", help="update the given gppkg", metavar="<package>")
        add_to.add_option("-r", "--remove", help="remove the given gppkg", metavar="<name>-<version>")
        add_to.add_option("-q", "--query", help="query the gppkg database or a particular gppkg", action="store_true")
        add_to.add_option("-b", "--build", help="build a gppkg", metavar="<directory>")
        add_to.add_option("-c", "--clean", help="clean the cluster of the given gppkg", action="store_true")
        add_to.add_option(
            "--migrate",
            help="migrate gppkgs from a separate $GPHOME",
            metavar="<from_gphome> <to_gphome>",
            action="store_true",
            default=False,
        )

        add_to = OptionGroup(parser, "Query Options")
        parser.add_option_group(add_to)
        add_to.add_option(
            "--info", action="store_true", help="print information about the gppkg including name, version, description"
        )
        add_to.add_option("--list", action="store_true", help="print all the files present in the gppkg")
        add_to.add_option("--all", action="store_true", help="print all the gppkgs installed by gppkg")

        return parser
开发者ID:shubh8689,项目名称:gpdb,代码行数:43,代码来源:gppkg.py

示例8: create_parser

# 需要导入模块: from gppylib.gpparseopts import OptParser [as 别名]
# 或者: from gppylib.gpparseopts.OptParser import add_option_group [as 别名]
def create_parser():
    parser = OptParser(option_class=OptChecker, 
                       version='%prog version $Revision: #1 $',
                       description='Persistent tables backp and restore')

    addStandardLoggingAndHelpOptions(parser, includeNonInteractiveOption=True)

    addTo = OptionGroup(parser, 'Connection opts')
    parser.add_option_group(addTo)
    addMasterDirectoryOptionForSingleClusterProgram(addTo)

    addTo = OptionGroup(parser, 'Persistent tables backup and restore options')
    addTo.add_option('--backup', metavar="<pickled dbid info>", type="string",
                     help="A list of dbid info where backups need to be done in pickled format")
    addTo.add_option('--restore', metavar="<pickled dbid info>", type="string",
                     help="A list of dbid info where restore needs to be done in pickled format")
    addTo.add_option('--validate-backups', metavar="<pickled dbid info>", type="string",
                     help="A list of dbid info where validation needs to be done in pickled format")
    addTo.add_option('--validate-backup-dir', metavar="<pickled dbid info>", type="string",
                     help="A list of dbid info where validation needs to be done in pickled format")
    addTo.add_option('--timestamp', metavar="<timestamp of backup>", type="string",
                     help="A timestamp for the backup that needs to be validated") 
    addTo.add_option('--batch-size', metavar="<batch size for the worker pool>", type="int",
                      help="Batch size for parallelism in worker pool")
    addTo.add_option('--backup-dir', metavar="<backup directory>", type="string",
                      help="Backup directory for persistent tables and transaction logs")
    addTo.add_option('--perdbpt', metavar="<per database pt filename>", type="string",  
                      help="Filenames for per database persistent files")
    addTo.add_option('--globalpt', metavar="<global pt filenames>", type="string",
                      help="Filenames for global persistent files")
    addTo.add_option('--validate-source-file-only', action='store_true', default=False,
                      help="validate that required source files existed for backup and restore")

    parser.setHelp([
    """
    This tool is used to backup persistent table files.
    """
    ])

    return parser
开发者ID:PengJi,项目名称:gpdb-comments,代码行数:42,代码来源:gppersistent_backup.py

示例9: createParser

# 需要导入模块: from gppylib.gpparseopts import OptParser [as 别名]
# 或者: from gppylib.gpparseopts.OptParser import add_option_group [as 别名]
    def createParser():
        description = ("""
        This utility is NOT SUPPORTED and is for internal-use only.

        Used to inject faults into the file replication code.
        """)

        help = ["""

        Return codes:
          0 - Fault injected
          non-zero: Error or invalid options
        """]

        parser = OptParser(option_class=OptChecker,
                    description='  '.join(description.split()),
                    version='%prog version $Revision$')
        parser.setHelp(help)

        addStandardLoggingAndHelpOptions(parser, False)

        # these options are used to determine the target segments
        addTo = OptionGroup(parser, 'Target Segment Options: ')
        parser.add_option_group(addTo)
        addTo.add_option('-r', '--role', dest="targetRole", type='string', metavar="<role>",
                         help="Role of segments to target: primary, mirror, or primary_mirror")
        addTo.add_option("-s", "--seg_dbid", dest="targetDbId", type="string", metavar="<dbid>",
                         help="The segment  dbid on which fault should be set and triggered.")
        addTo.add_option("-H", "--host", dest="targetHost", type="string", metavar="<host>",
                         help="The hostname on which fault should be set and triggered; pass ALL to target all hosts")

        addTo = OptionGroup(parser, 'Master Connection Options')
        parser.add_option_group(addTo)

        addMasterDirectoryOptionForSingleClusterProgram(addTo)
        addTo.add_option("-p", "--master_port", dest="masterPort",  type="int", default=None,
                         metavar="<masterPort>",
                         help="DEPRECATED, use MASTER_DATA_DIRECTORY environment variable or -d option.  " \
                         "The port number of the master database on localhost, " \
                         "used to fetch the segment configuration.")

        addTo = OptionGroup(parser, 'Client Polling Options: ')
        parser.add_option_group(addTo)
        addTo.add_option('-m', '--mode', dest="syncMode", type='string', default="async",
                         metavar="<syncMode>",
                         help="Synchronization mode : sync (client waits for fault to occur)" \
                         " or async (client only sets fault request on server)")

        # these options are used to build the message for the segments
        addTo = OptionGroup(parser, 'Fault Options: ')
        parser.add_option_group(addTo)
        # NB: This list needs to be kept in sync with:
        # - FaultInjectorTypeEnumToString
        # - FaultInjectorType_e
        addTo.add_option('-y','--type', dest="type", type='string', metavar="<type>",
                         help="fault type: sleep (insert sleep), fault (report fault to postmaster and fts prober), " \
			      "fatal (inject FATAL error), panic (inject PANIC error), error (inject ERROR), " \
			      "infinite_loop, data_curruption (corrupt data in memory and persistent media), " \
			      "suspend (suspend execution), resume (resume execution that was suspended), " \
			      "skip (inject skip i.e. skip checkpoint), " \
			      "memory_full (all memory is consumed when injected), " \
			      "reset (remove fault injection), status (report fault injection status), " \
			      "segv (inject a SEGV), " \
			      "interrupt (inject an Interrupt), " \
			      "finish_pending (set QueryFinishPending to true), " \
			      "checkpoint_and_panic (inject a panic following checkpoint) ")
        addTo.add_option("-z", "--sleep_time_s", dest="sleepTimeSeconds", type="int", default="10" ,
                            metavar="<sleepTime>",
                            help="For 'sleep' faults, the amount of time for the sleep.  Defaults to %default." \
				 "Min Max Range is [0, 7200 sec] ")
        addTo.add_option('-f','--fault_name', dest="faultName", type='string', metavar="<name>",
                         help="fault name: " \
			      "postmaster (inject fault when new connection is accepted in postmaster), " \
			      "pg_control (inject fault when global/pg_control file is written), " \
			      "pg_xlog (inject fault when files in pg_xlog directory are written), " \
			      "start_prepare (inject fault during start prepare transaction), " \
			      "filerep_consumer (inject fault before data are processed, i.e. if mirror " \
			      "then before file operation is issued to file system, if primary " \
			      "then before mirror file operation is acknowledged to backend processes), " \
			      "filerep_consumer_verificaton (inject fault before ack verification data are processed on primary), " \
			      "filerep_change_tracking_compacting (inject fault when compacting change tracking log files), " \
			      "filerep_sender (inject fault before data are sent to network), " \
			      "filerep_receiver (inject fault after data are received from network), " \
			      "filerep_flush (inject fault before fsync is issued to file system), " \
			      "filerep_resync (inject fault while in resync when first relation is ready to be resynchronized), " \
			      "filerep_resync_in_progress (inject fault while resync is in progress), " \
			      "filerep_resync_worker (inject fault after write to mirror), " \
			      "filerep_resync_worker_read (inject fault before read required for resync), " \
			      "filerep_transition_to_resync (inject fault during transition to InResync before mirror re-create), " \
			      "filerep_transition_to_resync_mark_recreate (inject fault during transition to InResync before marking re-created), " \
			      "filerep_transition_to_resync_mark_completed (inject fault during transition to InResync before marking completed), " \
			      "filerep_transition_to_sync_begin (inject fault before transition to InSync begin), " \
			      "filerep_transition_to_sync (inject fault during transition to InSync), " \
			      "filerep_transition_to_sync_before_checkpoint (inject fault during transition to InSync before checkpoint is created), " \
			      "filerep_transition_to_sync_mark_completed (inject fault during transition to InSync before marking completed), " \
			      "filerep_transition_to_change_tracking (inject fault during transition to InChangeTracking), " \
                              "fileRep_is_operation_completed (inject fault in FileRep Is Operation completed function just for ResyncWorker Threads), "\
                              "filerep_immediate_shutdown_request (inject fault just before sending the shutdown SIGQUIT to child processes), "\
			      "checkpoint (inject fault before checkpoint is taken), " \
			      "change_tracking_compacting_report (report if compacting is in progress), " \
#.........这里部分代码省略.........
开发者ID:50wu,项目名称:gpdb,代码行数:103,代码来源:clsInjectFault.py

示例10: createParser

# 需要导入模块: from gppylib.gpparseopts import OptParser [as 别名]
# 或者: from gppylib.gpparseopts.OptParser import add_option_group [as 别名]
    def createParser():
        description = ("""
        This utility is NOT SUPPORTED and is for internal-use only.

        Used to inject faults into the file replication code.
        """)

        help = ["""

        Return codes:
          0 - Fault injected
          non-zero: Error or invalid options
        """]

        parser = OptParser(option_class=OptChecker,
                    description='  '.join(description.split()),
                    version='%prog version $Revision$')
        parser.setHelp(help)

        addStandardLoggingAndHelpOptions(parser, False)

        # these options are used to determine the target segments
        addTo = OptionGroup(parser, 'Target Segment Options: ')
        parser.add_option_group(addTo)
        addTo.add_option('-r', '--role', dest="targetRole", type='string', metavar="<role>",
                         help="Role of segments to target: master, standby, primary")
        addTo.add_option("-s", "--registration_order", dest="targetRegistrationOrder", type="string", metavar="<registration_order>",
                         help="The segment registration_order on which fault should be set and triggered.")
        addTo.add_option("-H", "--host", dest="targetHost", type="string", metavar="<host>",
                         help="The hostname on which fault should be set and triggered; pass ALL to target all hosts")

        addTo = OptionGroup(parser, 'Master Connection Options')
        parser.add_option_group(addTo)

        addMasterDirectoryOptionForSingleClusterProgram(addTo)
        addTo.add_option("-p", "--master_port", dest="masterPort", type="int", default=None,
                         metavar="<masterPort>",
                         help="DEPRECATED, use MASTER_DATA_DIRECTORY environment variable or -d option.  " \
                         "The port number of the master database on localhost, " \
                         "used to fetch the segment configuration.")

        addTo = OptionGroup(parser, 'Client Polling Options: ')
        parser.add_option_group(addTo)
        addTo.add_option('-m', '--mode', dest="syncMode", type='string', default="async",
                         metavar="<syncMode>",
                         help="Synchronization mode : sync (client waits for fault to occur)" \
                         " or async (client only sets fault request on server)")

        # these options are used to build the message for the segments
        addTo = OptionGroup(parser, 'Fault Options: ')
        parser.add_option_group(addTo)
        addTo.add_option('-y', '--type', dest="type", type='string', metavar="<type>",
                         help="fault type: sleep (insert sleep), fault (report fault to postmaster and fts prober), " \
                  "fatal (inject FATAL error), panic (inject PANIC error), error (inject ERROR), " \
                  "infinite_loop, data_curruption (corrupt data in memory and persistent media), " \
                  "suspend (suspend execution), resume (resume execution that was suspended), " \
                  "skip (inject skip i.e. skip checkpoint), " \
                  "memory_full (all memory is consumed when injected), " \
                  "reset (remove fault injection), status (report fault injection status), " \
                  "panic_suppress (inject suppressed PANIC in critical section), " \
                  "segv (inject a SEGV), " \
                  "interrupt (inject an Interrupt) ")
        addTo.add_option("-z", "--sleep_time_s", dest="sleepTimeSeconds", type="int", default="10" ,
                            metavar="<sleepTime>",
                            help="For 'sleep' faults, the amount of time for the sleep.  Defaults to %default." \
                 "Min Max Range is [0, 7200 sec] ")
        addTo.add_option('-f', '--fault_name', dest="faultName", type='string', metavar="<name>",
                         help="fault name: " \
                  "postmaster (inject fault when new connection is accepted in postmaster), " \
                  "pg_control (inject fault when global/pg_control file is written), " \
                  "pg_xlog (inject fault when files in pg_xlog directory are written), " \
                  "start_prepare (inject fault during start prepare transaction), " \
                  "filerep_consumer (inject fault before data are processed, i.e. if mirror " \
                  "then before file operation is issued to file system, if primary " \
                  "then before mirror file operation is acknowledged to backend processes), " \
                  "filerep_consumer_verificaton (inject fault before ack verification data are processed on primary), " \
                  "filerep_change_tracking_compacting (inject fault when compacting change tracking log files), " \
                  "filerep_sender (inject fault before data are sent to network), " \
                  "filerep_receiver (inject fault after data are received from network), " \
                  "filerep_flush (inject fault before fsync is issued to file system), " \
                  "filerep_resync (inject fault while in resync when first relation is ready to be resynchronized), " \
                  "filerep_resync_in_progress (inject fault while resync is in progress), " \
                  "filerep_resync_worker (inject fault after write to mirror), " \
                  "filerep_resync_worker_read (inject fault before read required for resync), " \
                  "filerep_transition_to_resync (inject fault during transition to InResync before mirror re-create), " \
                  "filerep_transition_to_resync_mark_recreate (inject fault during transition to InResync before marking re-created), " \
                  "filerep_transition_to_resync_mark_completed (inject fault during transition to InResync before marking completed), " \
                  "filerep_transition_to_sync_begin (inject fault before transition to InSync begin), " \
                  "filerep_transition_to_sync (inject fault during transition to InSync), " \
                  "filerep_transition_to_sync_before_checkpoint (inject fault during transition to InSync before checkpoint is created), " \
                  "filerep_transition_to_sync_mark_completed (inject fault during transition to InSync before marking completed), " \
                  "filerep_transition_to_change_tracking (inject fault during transition to InChangeTracking), " \
                  "checkpoint (inject fault before checkpoint is taken), " \
                  "change_tracking_compacting_report (report if compacting is in progress), " \
                  "change_tracking_disable (inject fault before fsync to Change Tracking log files), " \
                  "transaction_abort_after_distributed_prepared (abort prepared transaction), " \
                  "transaction_commit_pass1_from_create_pending_to_created, " \
                  "transaction_commit_pass1_from_drop_in_memory_to_drop_pending, " \
                  "transaction_commit_pass1_from_aborting_create_needed_to_aborting_create, " \
                  "transaction_abort_pass1_from_create_pending_to_aborting_create, " \
#.........这里部分代码省略.........
开发者ID:bioxuxuan,项目名称:incubator-hawq,代码行数:103,代码来源:clsInjectFault.py

示例11: createParser

# 需要导入模块: from gppylib.gpparseopts import OptParser [as 别名]
# 或者: from gppylib.gpparseopts.OptParser import add_option_group [as 别名]
    def createParser():
        """
        Creates the command line options parser object for gpverify.
        """
        
        description = ("Initiates primary/mirror verification.")
        help = []

        parser = OptParser(option_class=OptChecker,
                    description=' '.join(description.split()),
                    version='%prog version $Revision: #1 $')
        parser.setHelp(help)

        addStandardLoggingAndHelpOptions(parser, True)
        
        addTo = OptionGroup(parser, "Request Type")
        parser.add_option_group(addTo)
        addTo.add_option('--full', dest='full', action='store_true',
                         help='Perform a full verification pass.  Use --token option to ' \
                         'give the verification pass an identifier.')
        addTo.add_option('--file', dest='verify_file', metavar='<file>',
                         help='Based on file type, perform either a physical or logical verification of <file>.  ' \
                         'Use --token option to give the verification request an identifier.')
        addTo.add_option('--directorytree', dest='verify_dir',
                         metavar='<verify_dir>',
                         help='Perform a full verification pass on the specified directory.  ' \
                         'Use --token option to assign the verification pass an identifier.' )

        addTo = OptionGroup(parser, "Request Options")
        parser.add_option_group(addTo)
        addTo.add_option('--token', dest='token', metavar='<token>',
                         help='A token to use for the request.  ' \
                         'This identifier will be used in the logs and can be used to identify ' \
                         'a verification pass to the --abort, --suspend, --resume and --results ' \
                         'options.')

        addTo.add_option('-c', '--content', dest='content',
                         metavar='<content_id>', 
                         help='Send verification request only to the primary segment with the given <content_id>.')
        addTo.add_option('--abort', dest='abort', action='store_true',
                         help='Abort a verification request that is in progress.  ' \
                         'Can use --token option to abort a specific verification request.')
        addTo.add_option('--suspend', dest='suspend', action='store_true',
                         help='Suspend a verification request that is in progress.' \
                         'Can use --token option to suspend a specific verification request.')
        addTo.add_option('--resume', dest='resume', action='store_true',
                         help='Resume a suspended verification request.  Can use the ' \
                         '--token option to resume a specific verification request.')
        addTo.add_option('--fileignore', dest='ignore_file', metavar='<ignore_file>', 
                         help='Ignore any filenames matching <ignore_file>.  Multiple ' \
                         'files can be specified using a comma separated list.')
        addTo.add_option('--dirignore', dest='ignore_dir', metavar='<ignore_dir>', 
                         help='Ignore any directories matching <ignore_dir>.  Multiple ' \
                         'directories can be specified using a comma separated list.')

        addTo = OptionGroup(parser, "Reporting Options")
        parser.add_option_group(addTo)
        addTo.add_option('--results', dest='results', action='store_true',
                         help='Display verification results.  Can use' \
                         'the --token option to view results of a specific verification request.')
        addTo.add_option('--resultslevel', dest='results_level', action='store',
                         metavar='<detail_level>', type=int,
                         help='Level of detail to show for results. Valid levels are from 1 to 10.')
        addTo.add_option('--clean', dest='clean', action='store_true',
                         help='Clean up verification artifacts and the gp_verification_history table.')
        
        addTo = OptionGroup(parser, "Misc. Options")
        parser.add_option_group(addTo)
        addTo.add_option('-B', '--parallel', action='store', default=64,
                         type=int, help='Number of worker threads used to send verification requests.')
        
       
        parser.set_defaults()
        return parser
开发者ID:PivotalBigData,项目名称:incubator-hawq,代码行数:76,代码来源:verify.py

示例12: createParser

# 需要导入模块: from gppylib.gpparseopts import OptParser [as 别名]
# 或者: from gppylib.gpparseopts.OptParser import add_option_group [as 别名]
    def createParser():
        """
        Creates the command line options parser object for gpverify.
        """

        description = "Initiates primary/mirror verification."
        help = []

        parser = OptParser(
            option_class=OptChecker, description=" ".join(description.split()), version="%prog version $Revision: #1 $"
        )
        parser.setHelp(help)

        addStandardLoggingAndHelpOptions(parser, True)

        addTo = OptionGroup(parser, "Request Type")
        parser.add_option_group(addTo)
        addTo.add_option(
            "--full",
            dest="full",
            action="store_true",
            help="Perform a full verification pass.  Use --token option to "
            "give the verification pass an identifier.",
        )
        addTo.add_option(
            "--file",
            dest="verify_file",
            metavar="<file>",
            help="Based on file type, perform either a physical or logical verification of <file>.  "
            "Use --token option to give the verification request an identifier.",
        )
        addTo.add_option(
            "--directorytree",
            dest="verify_dir",
            metavar="<verify_dir>",
            help="Perform a full verification pass on the specified directory.  "
            "Use --token option to assign the verification pass an identifier.",
        )

        addTo = OptionGroup(parser, "Request Options")
        parser.add_option_group(addTo)
        addTo.add_option(
            "--token",
            dest="token",
            metavar="<token>",
            help="A token to use for the request.  "
            "This identifier will be used in the logs and can be used to identify "
            "a verification pass to the --abort, --suspend, --resume and --results "
            "options.",
        )

        addTo.add_option(
            "-c",
            "--content",
            dest="content",
            metavar="<content_id>",
            help="Send verification request only to the primary segment with the given <content_id>.",
        )
        addTo.add_option(
            "--abort",
            dest="abort",
            action="store_true",
            help="Abort a verification request that is in progress.  "
            "Can use --token option to abort a specific verification request.",
        )
        addTo.add_option(
            "--suspend",
            dest="suspend",
            action="store_true",
            help="Suspend a verification request that is in progress."
            "Can use --token option to suspend a specific verification request.",
        )
        addTo.add_option(
            "--resume",
            dest="resume",
            action="store_true",
            help="Resume a suspended verification request.  Can use the "
            "--token option to resume a specific verification request.",
        )
        addTo.add_option(
            "--fileignore",
            dest="ignore_file",
            metavar="<ignore_file>",
            help="Ignore any filenames matching <ignore_file>.  Multiple "
            "files can be specified using a comma separated list.",
        )
        addTo.add_option(
            "--dirignore",
            dest="ignore_dir",
            metavar="<ignore_dir>",
            help="Ignore any directories matching <ignore_dir>.  Multiple "
            "directories can be specified using a comma separated list.",
        )

        addTo = OptionGroup(parser, "Reporting Options")
        parser.add_option_group(addTo)
        addTo.add_option(
            "--results",
            dest="results",
            action="store_true",
#.........这里部分代码省略.........
开发者ID:xinzweb,项目名称:incubator-hawq,代码行数:103,代码来源:verify.py


注:本文中的gppylib.gpparseopts.OptParser.add_option_group方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。