def validate(self, parser, options, args):
     Cmd.validate(self, parser, options, args, load_cluster=True)
     if self.options.deprecate:
         print_("WARN: --wait-other-notice is deprecated. Please see the help text.")
     if self.options.no_wait and (self.options.wait_for_binary_proto or self.options.deprecate):
         print_("ERROR: --no-wait was specified alongside one or more wait options. This is invalid.")
         exit(1)
Example #2
0
 def validate(self, parser, options, args):
     Cmd.validate(self, parser, options, args, load_cluster=True)
     if len(args) == 0:
         print_('Missing log level', file=sys.stderr)
         parser.print_help()
         exit(1)
     self.level = args[0]
    def validate(self, parser, options, args):
        Cmd.validate(self, parser, options, args, cluster_name=True)
        if options.ipprefix and options.ipformat:
            parser.print_help()
            parser.error("%s and %s may not be used together" % (parser.get_option('-i'), parser.get_option('-I')))
        self.nodes = parse_populate_count(options.nodes)
        if self.options.vnodes and self.nodes is None:
            print_("Can't set --vnodes if not populating cluster in this command.")
            parser.print_help()
            exit(1)
        if not options.version:
            try:
                common.validate_install_dir(options.install_dir)
            except ArgumentError:
                parser.print_help()
                parser.error("%s is not a valid cassandra directory. You must define a cassandra dir or version." % options.install_dir)

            if common.get_dse_version(options.install_dir) is not None:
                common.assert_jdk_valid_for_cassandra_version(common.get_dse_cassandra_version(options.install_dir))
            else:
                common.assert_jdk_valid_for_cassandra_version(common.get_version_from_build(options.install_dir))

        if common.is_win() and os.path.exists('c:\windows\system32\java.exe'):
            print_("""WARN: c:\windows\system32\java.exe exists.
                This may cause registry issues, and jre7 to be used, despite jdk8 being installed.
                """)
Example #4
0
 def validate(self, parser, options, args):
     Cmd.validate(self, parser, options, args, node_name=True, load_cluster=True)
     self.workload = args[1]
     workloads = ["cassandra", "solr", "hadoop", "spark", "cfs"]
     if not self.workload in workloads:
         print_(self.workload, " is not a valid workload")
         exit(1)
Example #5
0
    def validate(self, parser, options, args):
        Cmd.validate(self, parser, options, args, node_name=True, load_cluster=True, load_node=False)

        if options.itfs is None and (options.thrift_itf is None or options.storage_itf is None or options.binary_itf is None):
            print_('Missing thrift and/or storage and/or binary protocol interfaces or jmx port', file=sys.stderr)
            parser.print_help()
            exit(1)

        if options.thrift_itf is None:
            options.thrift_itf = options.itfs
        if options.storage_itf is None:
            options.storage_itf = options.itfs
        if options.binary_itf is None:
            options.binary_itf = options.itfs

        self.thrift = common.parse_interface(options.thrift_itf, 9160)
        self.storage = common.parse_interface(options.storage_itf, 7000)
        self.binary = common.parse_interface(options.binary_itf, 9042)

        if self.binary[0] != self.thrift[0]:
            print_('Cannot set a binary address different from the thrift one', file=sys.stderr)
            exit(1)


        self.jmx_port = options.jmx_port
        self.remote_debug_port = options.remote_debug_port
        self.initial_token = options.initial_token
Example #6
0
    def validate(self, parser, options, args):
        Cmd.validate(self, parser, options, args, node_name=True, load_cluster=True, load_node=False)

        if options.itfs is None and (
            options.thrift_itf is None or options.storage_itf is None or options.binary_itf is None
        ):
            print_("Missing thrift and/or storage and/or binary protocol interfaces or jmx port", file=sys.stderr)
            parser.print_help()
            exit(1)

        used_jmx_ports = [node.jmx_port for node in self.cluster.nodelist()]
        if options.jmx_port in used_jmx_ports:
            print_("This JMX port is already in use. Choose another.", file=sys.stderr)
            parser.print_help()
            exit(1)

        if options.thrift_itf is None:
            options.thrift_itf = options.itfs
        if options.storage_itf is None:
            options.storage_itf = options.itfs
        if options.binary_itf is None:
            options.binary_itf = options.itfs

        self.thrift = common.parse_interface(options.thrift_itf, 9160)
        self.storage = common.parse_interface(options.storage_itf, 7000)
        self.binary = common.parse_interface(options.binary_itf, 9042)

        if self.binary[0] != self.thrift[0]:
            print_("Cannot set a binary address different from the thrift one", file=sys.stderr)
            exit(1)

        self.jmx_port = options.jmx_port
        self.remote_debug_port = options.remote_debug_port
        self.initial_token = options.initial_token
Example #7
0
 def validate(self, parser, options, args):
     Cmd.validate(self, parser, options, args, load_cluster=True)
     try:
         self.setting = common.parse_settings(args)
     except common.ArgumentError as e:
         print_(str(e), file=sys.stderr)
         exit(1)
Example #8
0
 def validate(self, parser, options, args):
     Cmd.validate(self, parser, options, args, node_name=True, load_cluster=True)
     self.workload = args[1]
     workloads = ['cassandra','solr','hadoop','spark','cfs']
     if not self.workload in workloads:
         print_(self.workload, ' is not a valid workload')
         exit(1)
Example #9
0
 def validate(self, parser, options, args):
     Cmd.validate(self, parser, options, args, load_cluster=True)
     self.workloads = args[0].split(",")
     valid_workloads = ["cassandra", "solr", "hadoop", "spark", "dsefs", "cfs", "graph"]
     for workload in self.workloads:
         if workload not in valid_workloads:
             print_(workload, " is not a valid workload")
             exit(1)
Example #10
0
 def validate(self, parser, options, args):
     Cmd.validate(self, parser, options, args, node_name=True, load_cluster=True)
     args = args[1:]
     try:
         self.setting = common.parse_settings(args, literal_yaml=self.options.literal_yaml)
     except common.ArgumentError as e:
         print_(str(e), file=sys.stderr)
         exit(1)
Example #11
0
 def validate(self, parser, options, args):
     Cmd.validate(self, parser, options, args, node_name=True, load_cluster=True)
     self.workloads = args[1].split(',')
     valid_workloads = ['cassandra', 'solr', 'hadoop', 'spark', 'dsefs', 'cfs', 'graph']
     for workload in self.workloads:
         if workload not in valid_workloads:
             print_(workload, ' is not a valid workload')
             exit(1)
Example #12
0
 def validate(self, parser, options, args):
     Cmd.validate(self, parser, options, args, cluster_name=True)
     if not os.path.exists(os.path.join(self.path, self.name, "cluster.conf")):
         print_(
             "%s does not appear to be a valid cluster (use ccm list to view valid clusters)" % self.name,
             file=sys.stderr,
         )
         exit(1)
Example #13
0
 def validate(self, parser, options, args):
     Cmd.validate(self, parser, options, args, node_name=True, load_cluster=True)
     self.keyspace = options.keyspace
     if self.keyspace is None:
         print_("You must specify a keyspace.")
         parser.print_help()
         exit(1)
     self.outfile = args[-1] if len(args) >= 2 else None
     self.column_families = options.cfs.split(',') if options.cfs else None
Example #14
0
 def validate(self, parser, options, args):
     Cmd.validate(self, parser, options, args, cluster_name=True)
     if options.ipprefix and options.ipformat:
         parser.print_help()
         parser.error("%s and %s may not be used together" % (parser.get_option('-i'), parser.get_option('-I')))
     self.nodes = parse_populate_count(options.nodes)
     if self.options.vnodes and self.nodes is None:
         print_("Can't set --vnodes if not populating cluster in this command.")
         parser.print_help()
         exit(1)
Example #15
0
 def validate(self, parser, options, args):
     Cmd.validate(self, parser, options, args, load_cluster=True)
     try:
         self.setting = common.parse_settings(args, literal_yaml=self.options.literal_yaml)
         if self.options.cl_batch and self.options.cl_periodic:
             print_("Can't set commitlog to be both batch and periodic.{}".format(os.linesep))
             parser.print_help()
             exit(1)
     except common.ArgumentError as e:
         print_(str(e), file=sys.stderr)
         exit(1)
Example #16
0
    def validate(self, parser, options, args):
        Cmd.validate(self, parser, options, args, load_cluster=True)
        if options.ipprefix and options.ipformat:
            parser.print_help()
            parser.error("%s and %s may not be used together" % (parser.get_option("-i"), parser.get_option("-I")))

        self.nodes = parse_populate_count(options.nodes)
        if self.nodes is None:
            parser.print_help()
            parser.error("Not a valid number of nodes. Did you use -n?")
            exit(1)
Example #17
0
    def validate(self, parser, options, args):
        Cmd.validate(self, parser, options, args, node_name=True, load_cluster=True)
        if len(args) == 1:
            print_('Missing log level', file=sys.stderr)
            parser.print_help()
        self.level = args[1]

        try:
            self.class_name = options.class_name
        except common.ArgumentError as e:
            print_(str(e), file=sys.stderr)
            exit(1)
Example #18
0
 def validate(self, parser, options, args):
     Cmd.validate(self, parser, options, args, load_cluster=True)
     try:
         self.log4jpath = options.log4jpath
         if self.log4jpath is None:
             raise KeyError("[Errno] -p or --path <path of new log4j congiguration file> is not provided") 
     except common.ArgumentError as e:
         print_(str(e), file=sys.stderr)
         exit(1)
     except KeyError as e:
         print_(str(e), file=sys.stderr)
         exit(1)
Example #19
0
    def validate(self, parser, options, args):
        Cmd.validate(self, parser, options, args, load_cluster=True)
        try:
            self.setting = common.parse_settings(args)
        except common.ArgumentError as e:
            print_(str(e), file=sys.stderr)
            exit(1)

        if self.options.yaml_file is not None:
            if not os.path.exists(self.options.yaml_file):
                print_("%s does not appear to be a valid file" % self.options.yaml_file)
                exit(1)
Example #20
0
 def validate(self, parser, options, args):
     self.other_cluster = None
     if len(args) > 0:
         # Setup to remove the specified cluster:
         Cmd.validate(self, parser, options, args)
         self.other_cluster = args[0]
         if not os.path.exists(os.path.join(
                 self.path, self.other_cluster, 'cluster.conf')):
             print_("%s does not appear to be a valid cluster" \
                 " (use ccm cluster list to view valid cluster)" \
                 % self.other_cluster, file=sys.stderr)
             exit(1)
     else:
         # Setup to remove the current cluster:
         Cmd.validate(self, parser, options, args, load_cluster=True)
Example #21
0
    def validate(self, parser, options, args):
        Cmd.validate(self, parser, options, args, node_name=True, load_cluster=True)
        self.keyspace = options.keyspace
        self.size = options.size
        self.column_families = None
        self.datafile = None

        if len(args) > 1:
            self.datafile = args[1]
        else:
            if options.cfs is not None:
                if self.keyspace is None:
                    print_("You need a keyspace (option -k) if you specify column families", file=sys.stderr)
                    exit(1)
                    self.column_families = options.cfs.split(',')
Example #22
0
 def validate(self, parser, options, args):
     Cmd.validate(self, parser, options, args, cluster_name=True)
     if options.ipprefix and options.ipformat:
         parser.print_help()
         parser.error("%s and %s may not be used together" % (parser.get_option('-i'), parser.get_option('-I')))
     self.nodes = parse_populate_count(options.nodes)
     if self.options.vnodes and self.nodes is None:
         print_("Can't set --vnodes if not populating cluster in this command.")
         parser.print_help()
         exit(1)
     if not options.version:
         try:
             common.validate_install_dir(options.install_dir)
         except ArgumentError:
             parser.print_help()
             parser.error("%s is not a valid cassandra directory. You must define a cassandra dir or version." % options.install_dir)
Example #23
0
    def validate(self, parser, options, args):
        Cmd.validate(self, parser, options, args, node_name=True, load_cluster=True)
        self.keyspace = options.keyspace
        self.tables = None
        self.datafiles = None
        if options.tables is not None:
            if self.keyspace is None:
                print_("You need a keyspace (option -k) if you specify tables", file=sys.stderr)
                exit(1)
            self.tables = options.tables.split(',')

        if len(args) > 1:
            if self.tables is None:
                print_("You need a tables (option -t) if you specify datafiles", file=sys.stderr)
                exit(1)
            self.datafiles = args[1:]
Example #24
0
 def validate(self, parser, options, args):
     Cmd.validate(self, parser, options, args)
Example #25
0
 def validate(self, parser, options, args):
     Cmd.validate(self, parser, options, args, node_name=True, load_cluster=True)
     self.shuffle_cmd = args[1]
Example #26
0
 def validate(self, parser, options, args):
     Cmd.validate(self, parser, options, args, node_name=True, load_cluster=True)
     self.byteman_options = args[1:] + parser.get_ignored()
Example #27
0
 def validate(self, parser, options, args):
     Cmd.validate(self, parser, options, args, load_cluster=True)
     self.nodes = parse_populate_count(options.nodes)
Example #28
0
 def validate(self, parser, options, args):
     Cmd.validate(self, parser, options, args, node_name=True, load_cluster=True)
     self.spark_options = args[1:] + parser.get_ignored()
Example #29
0
 def validate(self, parser, options, args):
     Cmd.validate(self, parser, options, args, load_cluster=True)
     self.verify_options = parser.get_ignored() + args
Example #30
0
 def validate(self, parser, options, args):
     Cmd.validate(self, parser, options, args, node_name=True, load_cluster=True)
     self.shuffle_cmd = args[1]
Example #31
0
 def validate(self, parser, options, args):
     Cmd.validate(self, parser, options, args)
Example #32
0
 def validate(self, parser, options, args):
     Cmd.validate(self, parser, options, args, load_cluster=True)
Example #33
0
 def validate(self, parser, options, args):
     Cmd.validate(self, parser, options, args, load_cluster=True)
Example #34
0
 def validate(self, parser, options, args):
     Cmd.validate(self, parser, options, args, node_name=True, load_cluster=True)
     self.scrub_options = parser.get_ignored() + args[1:]
Example #35
0
 def validate(self, parser, options, args):
     Cmd.validate(self, parser, options, args, load_cluster=True)
     self.stress_options = args + parser.get_ignored()
Example #36
0
 def validate(self, parser, options, args):
     Cmd.validate(self, parser, options, args, load_cluster=True)
     self.scrub_options = parser.get_ignored() + args
Example #37
0
 def validate(self, parser, options, args):
     Cmd.validate(self, parser, options, args, load_cluster=True)
     self.stress_options = args + parser.get_ignored()
Example #38
0
 def validate(self, parser, options, args):
     Cmd.validate(self, parser, options, args, cluster_name=True)
     self.nodes = parse_populate_count(options.nodes)
Example #39
0
 def validate(self, parser, options, args):
     Cmd.validate(self, parser, options, args, cluster_name=True)
     if not os.path.exists(os.path.join(self.path, self.name, 'cluster.conf')):
         print_("%s does not appear to be a valid cluster (use ccm list to view valid clusters)" % self.name, file=sys.stderr)
         sys.exit(1)