Actual work of starting the replication process.
558864
protected void beginReplicating() {
        Log.v(TAG, "submit startReplicating()");
        executor.submit(new Runnable() {
            @Override
            public void run() {
                if (isRunning()) {
                    Log.v(TAG, "start startReplicating()");
                    initPendingSequences();
                    initDownloadsToInsert();
                    startChangeTracker();
                }
                // start replicator ...
            }
        });
    }
1342331
protected void initializeStateMachine() {

        stateMachine = new StateMachine<ReplicationState, ReplicationTrigger>(ReplicationState.INITIAL);

        // hierarchy
        stateMachine.configure(ReplicationState.IDLE).substateOf(ReplicationState.RUNNING);
        stateMachine.configure(ReplicationState.OFFLINE).substateOf(ReplicationState.RUNNING);

        // permitted transitions
        stateMachine.configure(ReplicationState.INITIAL).permit(
                ReplicationTrigger.START,
                ReplicationState.RUNNING
        );
        stateMachine.configure(ReplicationState.IDLE).permit(
                ReplicationTrigger.RESUME,
                ReplicationState.RUNNING
        );
        stateMachine.configure(ReplicationState.RUNNING).permit(
                ReplicationTrigger.WAITING_FOR_CHANGES,
                ReplicationState.IDLE
        );
        stateMachine.configure(ReplicationState.RUNNING).permit(
                ReplicationTrigger.STOP_IMMEDIATE,
                ReplicationState.STOPPED
        );
        stateMachine.configure(ReplicationState.RUNNING).permit(
                ReplicationTrigger.STOP_GRACEFUL,
                ReplicationState.STOPPING
        );
        stateMachine.configure(ReplicationState.RUNNING).permit(
                ReplicationTrigger.GO_OFFLINE,
                ReplicationState.OFFLINE
        );
        stateMachine.configure(ReplicationState.OFFLINE).permit(
                ReplicationTrigger.GO_ONLINE,
                ReplicationState.RUNNING
        );
        stateMachine.configure(ReplicationState.STOPPING).permit(
                ReplicationTrigger.STOP_IMMEDIATE,
                ReplicationState.STOPPED
        );

        // ignored transitions
        stateMachine.configure(ReplicationState.INITIAL).ignore(ReplicationTrigger.RESUME);
        stateMachine.configure(ReplicationState.INITIAL).ignore(ReplicationTrigger.GO_ONLINE);
        stateMachine.configure(ReplicationState.INITIAL).ignore(ReplicationTrigger.GO_OFFLINE);
        stateMachine.configure(ReplicationState.RUNNING).ignore(ReplicationTrigger.START);
        stateMachine.configure(ReplicationState.RUNNING).ignore(ReplicationTrigger.RESUME);
        stateMachine.configure(ReplicationState.RUNNING).ignore(ReplicationTrigger.GO_ONLINE);
        stateMachine.configure(ReplicationState.IDLE).ignore(ReplicationTrigger.START);
        stateMachine.configure(ReplicationState.IDLE).ignore(ReplicationTrigger.GO_ONLINE);
        stateMachine.configure(ReplicationState.OFFLINE).ignore(ReplicationTrigger.START);
        stateMachine.configure(ReplicationState.OFFLINE).ignore(ReplicationTrigger.RESUME);
        stateMachine.configure(ReplicationState.OFFLINE).ignore(ReplicationTrigger.WAITING_FOR_CHANGES);
        stateMachine.configure(ReplicationState.OFFLINE).ignore(ReplicationTrigger.GO_OFFLINE);
        stateMachine.configure(ReplicationState.STOPPING).ignore(ReplicationTrigger.START);
        stateMachine.configure(ReplicationState.STOPPING).ignore(ReplicationTrigger.RESUME);
        stateMachine.configure(ReplicationState.STOPPING).ignore(ReplicationTrigger.WAITING_FOR_CHANGES);
        stateMachine.configure(ReplicationState.STOPPING).ignore(ReplicationTrigger.GO_ONLINE);
        stateMachine.configure(ReplicationState.STOPPING).ignore(ReplicationTrigger.GO_OFFLINE);
        stateMachine.configure(ReplicationState.STOPPING).ignore(ReplicationTrigger.STOP_GRACEFUL);
        stateMachine.configure(ReplicationState.STOPPED).ignore(ReplicationTrigger.START);
        stateMachine.configure(ReplicationState.STOPPED).ignore(ReplicationTrigger.RESUME);
        stateMachine.configure(ReplicationState.STOPPED).ignore(ReplicationTrigger.WAITING_FOR_CHANGES);
        stateMachine.configure(ReplicationState.STOPPED).ignore(ReplicationTrigger.GO_ONLINE);
        stateMachine.configure(ReplicationState.STOPPED).ignore(ReplicationTrigger.GO_OFFLINE);
        stateMachine.configure(ReplicationState.STOPPED).ignore(ReplicationTrigger.STOP_GRACEFUL);
        stateMachine.configure(ReplicationState.STOPPED).ignore(ReplicationTrigger.STOP_IMMEDIATE);

        // actions
        stateMachine.configure(ReplicationState.RUNNING).onEntry(new Action1<Transition<ReplicationState, ReplicationTrigger>>() {
            @Override
            public void doIt(Transition<ReplicationState, ReplicationTrigger> transition) {
                Log.v(Log.TAG_SYNC,
                        "%s [onEntry()] " + transition.getSource() + " => " + transition.getDestination(),
                        ReplicationInternal.this.toString());
                start();
                notifyChangeListenersStateTransition(transition);
            }
        });

        stateMachine.configure(ReplicationState.RUNNING).onExit(new Action1<Transition<ReplicationState, ReplicationTrigger>>() {
            @Override
            public void doIt(Transition<ReplicationState, ReplicationTrigger> transition) {
                Log.v(Log.TAG_SYNC,
                        "%s [onExit()] " + transition.getSource() + " => " + transition.getDestination(),
                        ReplicationInternal.this.toString());
            }
        });

        stateMachine.configure(ReplicationState.IDLE).onEntry(new Action1<Transition<ReplicationState, ReplicationTrigger>>() {
            @Override
            public void doIt(Transition<ReplicationState, ReplicationTrigger> transition) {
                Log.v(Log.TAG_SYNC,
                        "%s [onEntry()] " + transition.getSource() + " => " + transition.getDestination(),
                        ReplicationInternal.this.toString());
                retryReplicationIfError();
                if (transition.getSource() == transition.getDestination()) {
                    // ignore IDLE to IDLE
                    return;
                }
                notifyChangeListenersStateTransition(transition);

                // #352
                // iOS version: stop replicator immediately when call setError() with permanent error.
                // But, for Core Java, some of codes wait IDLE state. So this is reason to wait till
                // state becomes IDLE.
                if (Utils.isPermanentError(ReplicationInternal.this.error) && isContinuous()) {
                    Log.d(Log.TAG_SYNC, "IDLE: triggerStopGraceful() " + ReplicationInternal.this.error.toString());
                    triggerStopGraceful();
                }
            }
        });

        stateMachine.configure(ReplicationState.IDLE).onExit(new Action1<Transition<ReplicationState, ReplicationTrigger>>() {
            @Override
            public void doIt(Transition<ReplicationState, ReplicationTrigger> transition) {
                Log.v(Log.TAG_SYNC,
                        "%s [onExit()] " + transition.getSource() + " => " + transition.getDestination(),
                        ReplicationInternal.this.toString());
                if (transition.getSource() == transition.getDestination()) {
                    // ignore IDLE to IDLE
                    return;
                }
                notifyChangeListenersStateTransition(transition);
            }
        });

        stateMachine.configure(ReplicationState.OFFLINE).onEntry(new Action1<Transition<ReplicationState, ReplicationTrigger>>() {
            @Override
            public void doIt(Transition<ReplicationState, ReplicationTrigger> transition) {
                Log.v(Log.TAG_SYNC,
                        "%s [onEntry()] " + transition.getSource() + " => " + transition.getDestination(),
                        ReplicationInternal.this.toString());
                goOffline();
                notifyChangeListenersStateTransition(transition);
            }
        });

        stateMachine.configure(ReplicationState.OFFLINE).onExit(new Action1<Transition<ReplicationState, ReplicationTrigger>>() {
            @Override
            public void doIt(Transition<ReplicationState, ReplicationTrigger> transition) {
                Log.v(Log.TAG_SYNC,
                        "%s [onExit()] " + transition.getSource() + " => " + transition.getDestination(),
                        ReplicationInternal.this.toString());
                goOnline();
                notifyChangeListenersStateTransition(transition);
            }
        });

        stateMachine.configure(ReplicationState.STOPPING).onEntry(new Action1<Transition<ReplicationState, ReplicationTrigger>>() {
            @Override
            public void doIt(Transition<ReplicationState, ReplicationTrigger> transition) {
                Log.v(Log.TAG_SYNC,
                        "%s [onEntry()] " + transition.getSource() + " => " + transition.getDestination(),
                        ReplicationInternal.this.toString());
                // NOTE: Based on StateMachine configuration, this should not happen.
                //       However, from Unit Test result, this could be happen.
                //       We should revisit StateMachine configuration and also its Thread-safe-ability
                if (transition.getSource() == transition.getDestination()) {
                    // ignore STOPPING to STOPPING
                    return;
                }
                stop();
                notifyChangeListenersStateTransition(transition);
            }
        });

        stateMachine.configure(ReplicationState.STOPPED).onEntry(new Action1<Transition<ReplicationState, ReplicationTrigger>>() {
            @Override
            public void doIt(Transition<ReplicationState, ReplicationTrigger> transition) {
                Log.v(Log.TAG_SYNC,
                        "%s [onEntry()] " + transition.getSource() + " => " + transition.getDestination(),
                        ReplicationInternal.this.toString());

                // NOTE: Based on StateMachine configuration, this should not happen.
                //       However, from Unit Test result, this could be happen.
                //       We should revisit StateMachine configuration and also its Thread-safe-ability
                if (transition.getSource() == transition.getDestination()) {
                    // ignore STOPPED to STOPPED
                    return;
                }

                saveLastSequence(); // move from databaseClosing() method as databaseClosing() is not called

                // stop network reachablity check
                stopNetworkReachabilityManager();

                // close any active resources associated with this replicator
                close();

                clearDbRef();

                notifyChangeListenersStateTransition(transition);

                // ask executor to shutdown. this does not force to shutdown.
                // https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ExecutorService.html#shutdown()
                synchronized (executor) {
                    if (!executor.isShutdown()) {
                        executor.shutdown();
                    }
                }
            }
        });
    }
1017918
def start(self):
        """"""

        # Determine whether we are collocated with master.
        self.is_collocated = bool(socket.gethostname() == self.config.slaveinput['cov_master_host'] and
                                  self.topdir == self.config.slaveinput['cov_master_topdir'])

        # If we are not collocated then rewrite master paths to slave paths.
        if not self.is_collocated:
            master_topdir = self.config.slaveinput['cov_master_topdir']
            slave_topdir = self.topdir
            self.cov_source = [source.replace(master_topdir, slave_topdir) for source in self.cov_source]
            self.cov_data_file = self.cov_data_file.replace(master_topdir, slave_topdir)
            self.cov_config = self.cov_config.replace(master_topdir, slave_topdir)

        # Our slave node id makes us unique from all other slaves so
        # adjust the data file that we contribute to and the master
        # will combine our data with other slaves later.
        self.cov_data_file += '.%s' % self.nodeid

        # Erase any previous data and start coverage.
        self.cov = coverage.coverage(source=self.cov_source,
                                     data_file=self.cov_data_file,
                                     config_file=self.cov_config)
        self.cov.erase()
        self.cov.start()
        self.set_env()
349451
function(callback) { // # 1

          var startReplicas = Math.pow(Number(self.conf.balancing['REPLICA_BASE_NUMBER']), Number(self.conf.balancing['MAX_LEVEL']));

          var address = '';
          if (self.conf.zookeeper) {
            if (typeof self.conf.zookeeper === 'string' || self.conf.zookeeper instanceof String) {
              address = self.conf.zookeeper;
            } else {
              if (self.conf.zookeeper.address) address = self.conf.zookeeper.address;
            }
          }

          self.nodeManager = new NodeManager(
            address,
            false,
            function(err, message) {
              if (!err) {
                console.info(' (init) ZOOKEEPER is connected');
                self.nodeManager.addServerNode(self.conf, startReplicas, function(err, path, replicas) {

                  //if (!err) console.info('        ZOOKEEPER /' + self.conf.host + ':' + self.conf.port);

                  var serverName = path.substring(path.lastIndexOf('/') + 1, path.length);
                  self.serverNodePath = path;

                  self.serverName = serverName.split('^')[0];

                  if (replicas) {
                    self.replicas = replicas;
                  } else {
                    self.replicas = startReplicas;
                  }

                  // init balacing config
                  self.nodeManager.getConfigInfo('balancing', function(data) {
                    if (data) {

                      self.conf.balancing = data;
                      var configReplica = Math.pow(Number(self.conf.balancing['REPLICA_BASE_NUMBER']), Number(self.conf.balancing['MAX_LEVEL']));

                      if (self.replicas != configReplica) {
                        self._changeReplicas(configReplica);
                      }
                    }
                  });

                  callback(err);
                });
              } else {
                callback(err, message);
              }
            }
          );
        }
949352
private void start() {
        setStatus(STARTING);
        jobListener.beforeJobStart(parameters);
        recordTracker = new RecordTracker();
        metrics.setStartTime(System.currentTimeMillis());
        LOGGER.info("Batch size: {}", parameters.getBatchSize());
        LOGGER.info("Error threshold: {}", formatErrorThreshold(parameters.getErrorThreshold()));
        LOGGER.info("Jmx monitoring: {}", parameters.isJmxMonitoring());
        registerJobMonitor();
    }
1036050
def start(self):
             
        self.parse_opt()
        self.parse_cfg()

        # if -b, -B or -p option is set, only show information, don't
        # start the experiments
        if self.options.browse or self.options.browse_big or self.options.progress:
            self.browse()
            raise SystemExit
        
        # read main configuration file
        paramlist = []
        for exp in self.cfgparser.sections():
            if not self.options.experiments or exp in self.options.experiments:
                params = self.items_to_params(self.cfgparser.items(exp))
                params['name'] = exp
                paramlist.append(params)
                
        self.do_experiment(paramlist)
265813
private function ensureProcessIsStarted(): void
    {
        if (is_resource($this->process) === false) {
            $this->startProcess();

            $this->handleStartupErrors();
        }
    }
99303
@Validate
    public void start() {
        if (directory.isDirectory()) {
            buildFileIndex();
        }
        if (tracker != null) {
            tracker.open();
        }
        if (deployer != null) {
            deployer.start();
        }
    }
119311
def create(self):
        
        steps = [
            (self.create_role, (), {}),
            (self.create_vpc, (), {}),
            (self.create_cluster, (), {}),
            (self.create_node_group, (), {}),
            (self.create_spot_nodes, (), {}),
            (self.create_utilities, (), {}),
        ]
        # Execute creation.
        for step in tqdm.tqdm(steps, ncols=70):
            method, args, kwargs = step
            method(*args, **kwargs)
219370
def work(self):
        
        self.work_init()

        self.work_loop(max_jobs=self.max_jobs, max_time=self.max_time)

        self.work_stop()
211466
@Validate
    public void start() {
        module = new SimpleModule(MonitorExtension.class.getName());
        module.addSerializer(MonitorExtension.class, new JsonSerializer<MonitorExtension>() {
            @Override
            public void serialize(MonitorExtension monitorExtension, JsonGenerator jsonGenerator,
                                  SerializerProvider serializerProvider) throws IOException {
                jsonGenerator.writeStartObject();
                jsonGenerator.writeStringField("label", monitorExtension.label());
                jsonGenerator.writeStringField("url", monitorExtension.url());
                jsonGenerator.writeStringField("category", monitorExtension.category());
                jsonGenerator.writeEndObject();
            }
        });
        repository.register(module);
    }
1145059
public function proccess()
    {
        foreach ($this->runningJobs as $jobData) {
            $this->isRunning($jobData->job);
        }

        foreach ($this->pendingJobs as $job) {
            $this->start($job);
        }
    }
1278891
private void startPerformanceSnapshot() {
        // Create new snapshot
        mPerfSnapshot = new Bundle();

        // Add initial binder counts
        Bundle binderCounts = getBinderCounts();
        for (String key : binderCounts.keySet()) {
            mPerfSnapshot.putLong("pre_" + key, binderCounts.getLong(key));
        }

        // Force a GC and zero out the performance counters. Do this
        // before reading initial CPU/wall-clock times so we don't include
        // the cost of this setup in our final metrics.
        startAllocCounting();

        // Record CPU time up to this point, and start timing. Note: this
        // must happen at the end of this method, otherwise the timing will
        // include noise.
        mSnapshotExecTime = SystemClock.uptimeMillis();
        mSnapshotCpuTime = Process.getElapsedCpuTime();
    }
1170382
@Override
  public void start() throws Exception {
    mJournalSystem.start();
    mJournalSystem.gainPrimacy();
    startMaster(true);
    startServing();
  }
262633
protected function start()
    {
        $this->client->executeCommand(
            $this->client->createCommand('MONITOR')
        );
        $this->valid = true;
    }
806786
public function onStart()
    {
        $this->setProcessName('master process');
        $this->createPidFile();

        $this->container->make('events')->dispatch('swoole.start', func_get_args());
    }
1032261
public function process()
    {
        // Run the UpdatePackageInfo task
        $updateTask = Injector::inst()->create(UpdatePackageInfoTask::class);
        $updateTask->run(null);

        // mark job as completed
        $this->isComplete = true;
    }