Пример #1
0
    def redistribute(self, duration=False, endtime=False):
        # Can flake with "[ERROR]:-End time occurs in the past"
        # if duration is set too low.
        if duration:
            flags = " --duration 00:00:02"
        elif endtime:
            newtime = datetime.now() + timedelta(seconds=2)
            flags = " --end \"%s\"" % newtime.strftime("%Y-%m-%d %H:%M:%S")
        else:
            flags = ""

        run_gpcommand(self.context, "gpexpand %s" % flags)
Пример #2
0
 def initialize_segments(self, additional_params=''):
     fns = filter(
         lambda fn: not fn.endswith(".ts"),
         glob.glob('%s/gpexpand_inputfile*' % self.working_directory))
     input_files = sorted(fns)
     return run_gpcommand(
         self.context,
         "gpexpand -i %s %s" % (input_files[-1], additional_params))
Пример #3
0
    def redistribute(self, duration, endtime):
        # Can flake with "[ERROR]:-End time occurs in the past"
        # if duration is set too low.
        if endtime:
            newtime = datetime.now() + timedelta(seconds=2)
            flags = " --end \"%s\"" % newtime.strftime("%Y-%m-%d %H:%M:%S")
        elif duration:
            flags = " --duration %s" % duration
        else:
            flags = ""

        rc, stderr, stdout = run_gpcommand(self.context, "gpexpand %s" % (flags))
        if rc == 0:
            rc = self.get_redistribute_status()
        return (rc, stderr, stdout)
Пример #4
0
    def redistribute(self, duration, endtime):
        # Can flake with "[ERROR]:-End time occurs in the past"
        # if duration is set too low.
        if endtime:
            newtime = datetime.now() + timedelta(seconds=2)
            flags = " --end \"%s\"" % newtime.strftime("%Y-%m-%d %H:%M:%S")
        elif duration:
            flags = " --duration %s" % duration
        else:
            flags = ""

        rc, stderr, stdout = run_gpcommand(self.context, "gpexpand %s" % (flags))
        if rc == 0:
            rc = self.get_redistribute_status()
        return (rc, stderr, stdout)
Пример #5
0
 def initialize_segments(self, additional_params=''):
     input_files = sorted(
         glob.glob('%s/gpexpand_inputfile*' % self.working_directory))
     return run_gpcommand(
         self.context,
         "gpexpand -i %s %s" % (input_files[-1], additional_params))
Пример #6
0
 def rollback(self):
     return run_gpcommand(self.context, "gpexpand -r")
Пример #7
0
 def rollback(self):
     return run_gpcommand(self.context,
                          "gpexpand -D %s -r" % (self.database))
Пример #8
0
 def initialize_segments(self):
     input_files = sorted(
         glob.glob('%s/gpexpand_inputfile*' % self.working_directory))
     run_gpcommand(
         self.context,
         "gpexpand -D %s -i %s" % (self.database, input_files[-1]))
Пример #9
0
 def rollback(self):
     return run_gpcommand(self.context, "gpexpand -r")
Пример #10
0
 def initialize_segments(self, additional_params=''):
     input_files = sorted(glob.glob('%s/gpexpand_inputfile*' % self.working_directory))
     return run_gpcommand(self.context, "gpexpand -i %s %s" % (input_files[-1], additional_params))