Action for checking all assigned rounds using a batch
420172
public function recalcAllFieldsAction()
    {
        $batch = $this->loader->getTracker()->recalcTrackFields(
                'trackRecalcAllFields'
                );
        $this->_helper->BatchRunner($batch, $this->_('Recalculating fields for all tracks.'), $this->accesslog);

        $this->addSnippet('Track\\RecalcFieldsInformation');
    }
808909
private void doWrite(final LogEntry logEntry) throws SQLException {
		if (checkConnection()) {
			if (batch) {
				batchCount += 1;
			}

			try {
				for (int i = 0; i < tokens.size(); ++i) {
					tokens.get(i).apply(logEntry, statement, i + 1);
				}
			} catch (SQLException ex) {
				resetConnection();
				throw ex;
			}

			try {
				if (batch) {
					statement.addBatch();
					if (batchCount >= MAX_BATCH_SIZE) {
						statement.executeBatch();
						batchCount = 0;
					}
				} else {
					statement.executeUpdate();
				}
			} catch (SQLException ex) {
				resetConnection();
				throw ex;
			}
		} else {
			lostCount += 1;
		}
	}
714081
def _submit_batch(self, url, batch):
        """"""
        # TODO: validate column_name
        batch_parts = batch.parts()

        guid = ""
        headers = {
            'User-Agent': 'kentik-python-api/0.1',
            'Content-Type': 'application/json',
            'X-CH-Auth-Email': self.api_email,
            'X-CH-Auth-API-Token': self.api_token
        }

        # submit each part
        last_part = dict()
        for batch_part in batch_parts:
            # submit
            resp = requests.post(url, headers=headers, data=batch_part.build_json(guid))

            # print the HTTP response to help debug
            print(resp.text)

            # break out at first sign of trouble
            resp.raise_for_status()
            last_part = resp.json()
            guid = last_part['guid']
            if guid is None or len(guid) == 0:
                raise RuntimeError('guid not found in batch response')

        return last_part
1352410
public void updateBatch(V batch) {

        if (intervalCheck.check()) {
            rolling();
        }
        synchronized (this) {
            unflushed = updater.updateBatch(batch, unflushed);
        }

    }
393633
private int executeBatch() {
		try {
			return Arrays.stream(agent().batch(context())).sum();
		} catch (Exception ex) {
			errorAction.accept(agent(), context(), ex);
		} finally {
			batchAction.accept(agent(), context());
		}
		return 0;
	}
243112
def complete_all_trajectories(self):
    """"""
    for index in range(self.batch_size):
      trajectory = self._trajectories[index]
      assert trajectory.is_active
      self._complete_trajectory(trajectory, index)
1302063
void onSealExclusive(Batch batch, long elapsedTimeMillis)
  {
    try {
      doOnSealExclusive(batch, elapsedTimeMillis);
    }
    catch (Throwable t) {
      try {
        if (!concurrentBatch.compareAndSet(batch, batch.batchNumber)) {
          log.error("Unexpected failure to set currentBatch to the failed Batch.batchNumber");
        }
        log.error(t, "Serious error during onSealExclusive(), set currentBatch to the failed Batch.batchNumber");
      }
      catch (Throwable t2) {
        t.addSuppressed(t2);
      }
      throw t;
    }
  }
433396
def _mp_run_check(tasks, results, options):
    

    try:
        for index, change in iter(tasks.get, None):
            # this is the part that takes up all of our time and
            # produces side-effects like writing out files for all of
            # the report formats.
            change.check()

            # rather than serializing the completed change (which
            # could be rather large now that it's been realized), we
            # send back only what we want, which is the squashed
            # overview, and throw away the used bits.
            squashed = squash(change, options=options)
            change.clear()

            results.put((index, squashed))

    except KeyboardInterrupt:
        # prevent a billion lines of backtrace from hitting the user
        # in the face
        return
84173
void executeHandlers(EventBatch<AuditEvent> batch) {
        String formattedEvent = "";
        for (AuditEvent auditEvent : batch) {
            formattedEvent = formattedEvent + configContext.getLayout().format(auditEvent) + '\n';
        }
        for (final Handler handler : configContext.getHandlers()) {
            handler.setEventBatch(batch);
            handler.setQuery(formattedEvent);
            try {
                //handler.handle();
                handler.handle(batch);
                handler.handle(formattedEvent);
            } catch (HandlerException e) {
                Log.warn("Failed to submit audit event.", e);
            }
        }
    }
23557
def find_in_batches_with_progress(options = {})
      Progress.start(name.tableize, count(options)) do
        find_in_batches do |batch|
          Progress.step batch.length do
            yield batch
          end
        end
      end
    end
1312918
def write_batch(self, batch):
        
        for item in batch:
            self.write_buffer.buffer(item)
            key = self.write_buffer.get_key_from_item(item)
            if self.write_buffer.should_write_buffer(key):
                self._write_current_buffer_for_group_key(key)
            self.increment_written_items()
            self._check_items_limit()
1285222
public function checkAction()
    {
        $surveyId = $this->getSurveyId();
        $where    = $this->db->quoteInto('gto_id_survey = ?', $surveyId);

        $batch = $this->loader->getTracker()->recalculateTokens('surveyCheck' . $surveyId, $this->currentUser->getUserId(), $where);

        $title = sprintf($this->_('Checking for the %s survey for answers .'),
                $this->db->fetchOne("SELECT gsu_survey_name FROM gems__surveys WHERE gsu_id_survey = ?", $surveyId));
        $this->_helper->BatchRunner($batch, $title, $this->accesslog);

        $this->addSnippet('Survey\\CheckAnswersInformation',
                'itemDescription', $this->_('This task checks all tokens using this survey for answers.')
                );
    }
160923
def submit_tag_batch(self, batch):
        """"""
        url = '%s/api/v5/batch/tags' % self.base_url
        self._submit_batch(url, batch)
956505
private void transitionToFinalBatchStatus() {
        StopLock stopLock = getStopLock(); // Store in local variable to facilitate Ctrl+Shift+G search in Eclipse
        synchronized (stopLock) {

            BatchStatus currentBatchStatus = runtimeWorkUnitExecution.getBatchStatus();
            if (currentBatchStatus.equals(BatchStatus.STARTED)) {
                updateJobBatchStatus(BatchStatus.COMPLETED);
            } else if (currentBatchStatus.equals(BatchStatus.STOPPING)) {
                updateJobBatchStatus(BatchStatus.STOPPED);
            } else if (currentBatchStatus.equals(BatchStatus.FAILED)) {
                updateJobBatchStatus(BatchStatus.FAILED); // Should have already been done but maybe better for possible code refactoring to have it here.
            } else {
                throw new IllegalStateException("Step batch status should not be in a " + currentBatchStatus.name() + " state");
            }
        }
    }
534349
function seqActions(actions, seed, onCompleted) {
  var index = 0;

  function invokeNext(v) {
    var action = actions[index];
    action(v, function (res) {
      index = index + 1;
      if (index < actions.length) {
        invokeNext(res);
      } else {
        onCompleted(res);
      }
    });
  }

  invokeNext(seed);
}
1024007
def save_batch(server_context, assay_id, batch):
    # type: (ServerContext, int, Batch) -> Union[Batch, None]
    
    result = save_batches(server_context, assay_id, [batch])

    if result is not None:
        return result[0]
    return None
367580
def batch(
        self,
        owner,
        action=None,
        attribute_write_type=None,
        halt_on_error=False,
        playbook_triggers_enabled=None,
    ):
        """"""
        from .tcex_ti_batch import TcExBatch

        return TcExBatch(
            self, owner, action, attribute_write_type, halt_on_error, playbook_triggers_enabled
        )