// Restarts a batch of shards.
// 
// Parameters:
//  - Job
//  - ShardIds
480583
func (p *AuroraSchedulerManagerClient) RestartShards(ctx context.Context, job *JobKey, shardIds []int32) (r *Response, err error) {
  var _args139 AuroraSchedulerManagerRestartShardsArgs
  _args139.Job = job
  _args139.ShardIds = shardIds
  var _result140 AuroraSchedulerManagerRestartShardsResult
  if err = p.Client_().Call(ctx, "restartShards", &_args139, &_result140); err != nil {
    return
  }
  return _result140.GetSuccess(), nil
}
242101
func (c *Container) Restart(timeout time.Duration) error {
	dc, err := getDockerClient()
	if err != nil {
		return err
	}

	return dc.RestartContainer(c.ID, uint(timeout.Seconds()))

}
644431
func (m *murmur32) Reset() {
	m.hash = m.seed
	m.tail = 0
	m.count = 0
	m.size = 0
}
1253128
func (j *Job) Refresh() error {
	t := newTransaction()
	t.scanJobById(j.id, j)
	if err := t.exec(); err != nil {
		return err
	}
	return nil
}
452806
func shardItems(items []*Item, threshold int64) []*itemBundle {
	// For deterministic isolated hashes, sort the items by path.
	sort.Sort(itemByPath(items))

	var bundles []*itemBundle
	for len(items) > 0 {
		var bundle *itemBundle
		bundle, items = oneBundle(items, threshold)
		bundles = append(bundles, bundle)
	}
	return bundles
}
819999
func (s *releasesService) Restart(ctx context.Context, db *gorm.DB, app *App) error {
	return s.Scheduler.Restart(ctx, app.ID, nil)
}
1326331
func ShardIndex(member []byte, shardCount int) int {
	hash := fnv.New32()
	hash.Write(member)
	return int(hash.Sum32() % uint32(shardCount))
}
534358
func (ctl *Controller) requestJobStateUpdate(c context.Context, jobID JobID, shardID int64) error {
	return ctl.tq().AddTask(c, &tq.Task{
		Title: fmt.Sprintf("notify:job-%d-shard-%d", jobID, shardID),
		Payload: &tasks.RequestJobStateUpdate{
			JobId:   int64(jobID),
			ShardId: shardID,
		},
	})
}
757264
func Shard(str string, width int, depth int, restOnly bool) []string {
	var results []string

	for i := 0; i < depth; i++ {
		results = append(results, str[(width*i):(width*(i+1))])
	}

	if restOnly {
		results = append(results, str[(width*depth):])
	} else {
		results = append(results, str)
	}

	return results
}
308780
func (tsh *tarsumHash) Reset() {
	// comply with hash.Hash and reset to the state hash had before any writes
	tsh.Hash.Reset()
	tarsum.WriteV1Header(tsh.hdr, tsh.Hash)
}
584330
func (r *realisClient) RestartJob(key *aurora.JobKey) (*aurora.Response, error) {

	instanceIds, err1 := r.GetInstanceIds(key, aurora.ACTIVE_STATES)
	if err1 != nil {
		return nil, errors.Wrap(err1, "Could not retrieve relevant task instance IDs")
	}

	r.logger.DebugPrintf("RestartShards Thrift Payload: %+v %v\n", key, instanceIds)

	if len(instanceIds) > 0 {
		resp, retryErr := r.thriftCallWithRetries(func() (*aurora.Response, error) {
			return r.client.RestartShards(nil, key, instanceIds)
		})

		if retryErr != nil {
			return nil, errors.Wrap(retryErr, "Error sending Restart command to Aurora Scheduler")
		}

		return resp, nil
	} else {
		return nil, errors.New("No tasks in the Active state")
	}
}
244324
func (c *cluster) ShardNodes(index string, shard uint64) []*Node {
	c.mu.RLock()
	defer c.mu.RUnlock()
	return c.shardNodes(index, shard)
}
1335161
func Restart(targets []string, b backend.Backend) error {

	// act as if the user called "stop" and then "start"
	if err := Stop(targets, b); err != nil {
		return err
	}

	return Start(targets, b)
}
739346
func (h *BytesRefHash) Reinit() {
	if h.bytesStart == nil {
		h.bytesStart = h.bytesStartArray.Init()
	}
	if h.ids == nil {
		h.ids = make([]int, h.hashSize)
		h.bytesUsed.AddAndGet(NUM_BYTES_INT * int64(h.hashSize))
	}
}
1097898
func (s *schemaVersionSyncer) Restart(ctx context.Context) error {
	startTime := time.Now()
	var err error
	defer func() {
		metrics.DeploySyncerHistogram.WithLabelValues(metrics.SyncerRestart, metrics.RetLabel(err)).Observe(time.Since(startTime).Seconds())
	}()

	logPrefix := fmt.Sprintf("[%s] %s", ddlPrompt, s.selfSchemaVerPath)
	// NewSession's context will affect the exit of the session.
	session, err := owner.NewSession(ctx, logPrefix, s.etcdCli, owner.NewSessionRetryUnlimited, SyncerSessionTTL)
	if err != nil {
		return errors.Trace(err)
	}
	s.storeSession(session)

	childCtx, cancel := context.WithTimeout(ctx, keyOpDefaultTimeout)
	defer cancel()
	err = PutKVToEtcd(childCtx, s.etcdCli, putKeyRetryUnlimited, s.selfSchemaVerPath, InitialVersion,
		clientv3.WithLease(s.loadSession().Lease()))

	return errors.Trace(err)
}
1016982
func (dp *DaemonPen) Restart() {
	dp.Lock()
	defer dp.Unlock()
	if dp.daemons != nil {
		for _, d := range dp.daemons {
			d.Restart()
		}
	}
}
392522
func (ar *allocRunner) RestartTask(taskName string, taskEvent *structs.TaskEvent) error {
	tr, ok := ar.tasks[taskName]
	if !ok {
		return fmt.Errorf("Could not find task runner for task: %s", taskName)
	}

	return tr.Restart(context.TODO(), taskEvent, false)
}