Ejemplo n.º 1
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 >> sys.stderr, str(e)
         exit(1)
Ejemplo n.º 2
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 >> sys.stderr, 'Missing thrift and/or storage and/or binary protocol interfaces or jmx port'
            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 >> sys.stderr, 'Cannot set a binary address different from the thrift one'
            exit(1)


        self.jmx_port = options.jmx_port
        self.remote_debug_port = options.remote_debug_port
        self.initial_token = options.initial_token
Ejemplo n.º 3
0
 def validate(self, parser, options, args):
     Cmd.validate(self, parser, options, args, load_cluster=True)
     if len(args) == 0:
         print >> sys.stderr, 'Missing log level'
         parser.print_help()
         exit(1)
     self.level = args[0]
Ejemplo n.º 4
0
 def validate(self, parser, options, args):
     Cmd.validate(self, parser, options, args, node_name=True, load_cluster=True)
     self.level = args[1]
     known_level = [ 'TRACE', 'DEBUG', 'INFO', 'ERROR' ]
     if self.level not in known_level:
         print >> sys.stderr, "Unknown log level %s (use one of %s)" % (self.level, " ".join(known_level))
         exit(1)
Ejemplo n.º 5
0
 def validate(self, parser, options, args):
     Cmd.validate(self, parser, options, args, node_name=True, 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 >> sys.stderr, str(e)
         exit(1)
     except KeyError as e:
         print >> sys.stderr, str(e)
         exit(1)
Ejemplo n.º 6
0
    def validate(self, parser, options, args):
        Cmd.validate(self, parser, options, args, node_name=True, load_cluster=True)
        if len(args) == 1:
            print >> sys.stderr, 'Missing log level'
            parser.print_help()
        self.level = args[1]

        try:
            self.class_name = options.class_name
        except common.ArgumentError as e:
            print >> sys.stderr, str(e)
            exit(1)
Ejemplo n.º 7
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 >> sys.stderr, "%s does not appear to be a valid cluster" \
                 " (use ccm cluster list to view valid cluster)" \
                 % self.other_cluster
             exit(1)
     else:
         # Setup to remove the current cluster:
         Cmd.validate(self, parser, options, args, load_cluster=True)
Ejemplo n.º 8
0
 def validate(self, parser, options, args):
     Cmd.validate(self, parser, options, args, node_name=True, load_cluster=True)
     self.keyspace = options.keyspace
     self.column_families = None
     if len(args) > 0:
         self.datafile = args[0]
         if not self.keyspace:
             print >> sys.stderr, "You need a keyspace specified (option -k) if you specify a file"
             exit(1)
     elif options.cfs:
         self.datafile = None
         if not self.keyspace:
             print >> sys.stderr, "You need a keyspace specified (option -k) if you specify column families"
             exit(1)
         self.column_families = options.cfs.split(',')
Ejemplo n.º 9
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 >> sys.stderr, "You need a keyspace (option -k) if you specify column families"
                    exit(1)
                    self.column_families = options.cfs.split(',')
Ejemplo n.º 10
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):
            print >> sys.stderr, 'Missing thrift and/or storage interfaces or jmx port'
            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

        self.thrift = common.parse_interface(options.thrift_itf, 9160)
        self.storage = common.parse_interface(options.storage_itf, 7000)
        self.jmx_port = options.jmx_port
        self.initial_token = options.initial_token
Ejemplo n.º 11
0
 def validate(self, parser, options, args):
     Cmd.validate(self, parser, options, args)
Ejemplo n.º 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 >> sys.stderr, "%s does not appear to be a valid cluster (use ccm cluster list to view valid cluster)" % self.name
         exit(1)
Ejemplo n.º 13
0
 def validate(self, parser, options, args):
     Cmd.validate(self, parser, options, args, load_cluster=True)
     self.nodes = parse_populate_count(options.nodes)
Ejemplo n.º 14
0
 def validate(self, parser, options, args):
     Cmd.validate(self, parser, options, args)
Ejemplo n.º 15
0
 def validate(self, parser, options, args):
     Cmd.validate(self, parser, options, args, load_cluster=True)
     self.scrub_options = parser.get_ignored() + args
Ejemplo n.º 16
0
 def validate(self, parser, options, args):
     Cmd.validate(self, parser, options, args, node_name=True, load_cluster=True)
     if len(args) == 1:
         print >> sys.stderr, 'Missing log level'
         parser.print_help()
     self.level = args[1]
Ejemplo n.º 17
0
 def validate(self, parser, options, args):
     Cmd.validate(self, parser, options, args, load_cluster=True)
     self.stress_options = parser.get_ignored() + args
Ejemplo n.º 18
0
 def validate(self, parser, options, args):
     Cmd.validate(self, parser, options, args, load_cluster=True)
Ejemplo n.º 19
0
 def validate(self, parser, options, args):
     Cmd.validate(self, parser, options, args, load_cluster=True)
Ejemplo n.º 20
0
 def validate(self, parser, options, args):
     Cmd.validate(self, parser, options, args, node_name=True, load_cluster=True)
     self.stress_options = parser.get_ignored() + args[1:]
Ejemplo n.º 21
0
 def validate(self, parser, options, args):
     Cmd.validate(self, parser, options, args, load_cluster=True)
     if len(args) == 0:
         print >> sys.stderr, 'Missing log level'
         parser.print_help()
     self.level = args[0]
Ejemplo n.º 22
0
 def validate(self, parser, options, args):
     Cmd.validate(self, parser, options, args, node_name=True, load_cluster=True)
     self.shuffle_cmd =  args[1]
Ejemplo n.º 23
0
 def validate(self, parser, options, args):
     Cmd.validate(self, parser, options, args, cluster_name=True)
     self.nodes = parse_populate_count(options.nodes)
Ejemplo n.º 24
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 >> sys.stderr, "%s does not appear to be a valid cluster (use ccm cluster list to view valid cluster)" % self.name
         exit(1)