Codota Logo
CeQueueMapper.updateIf
Code IndexAdd Codota to your IDE (free)

How to use
updateIf
method
in
org.sonar.db.ce.CeQueueMapper

Best Java code snippets using org.sonar.db.ce.CeQueueMapper.updateIf (Showing top 3 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
ArrayList a =
  • Codota Iconnew ArrayList<String>()
  • Codota Iconnew ArrayList()
  • Codota Iconnew ArrayList<Object>()
  • Smart code suggestions by Codota
}
origin: SonarSource/sonarqube

private Optional<CeQueueDto> tryToPeek(DbSession session, String eligibleTaskUuid, String workerUuid) {
 long now = system2.now();
 int touchedRows = mapper(session).updateIf(eligibleTaskUuid,
  new UpdateIf.NewProperties(IN_PROGRESS, workerUuid, now, now),
  new UpdateIf.OldProperties(PENDING));
 if (touchedRows != 1) {
  return Optional.empty();
 }
 CeQueueDto result = mapper(session).selectByUuid(eligibleTaskUuid);
 session.commit();
 return Optional.ofNullable(result);
}
origin: SonarSource/sonarqube

public static void makeInProgress(DbSession dbSession, String workerUuid, long now, CeQueueDto... ceQueueDtos) {
 Stream.of(ceQueueDtos).forEach(ceQueueDto -> {
  CeQueueMapper mapper = dbSession.getMapper(CeQueueMapper.class);
  int touchedRows = mapper.updateIf(ceQueueDto.getUuid(),
   new UpdateIf.NewProperties(IN_PROGRESS, workerUuid, now, now),
   new UpdateIf.OldProperties(PENDING));
  assertThat(touchedRows).isEqualTo(1);
 });
}
origin: SonarSource/sonarqube

 public static void reset(DbSession dbSession, long now, CeQueueDto... ceQueueDtos) {
  Stream.of(ceQueueDtos).forEach(ceQueueDto -> {
   checkArgument(ceQueueDto.getStatus() == IN_PROGRESS);
   checkArgument(ceQueueDto.getWorkerUuid() != null);

   CeQueueMapper mapper = dbSession.getMapper(CeQueueMapper.class);
   int touchedRows = mapper.updateIf(ceQueueDto.getUuid(),
    new UpdateIf.NewProperties(PENDING, ceQueueDto.getUuid(), now, now),
    new UpdateIf.OldProperties(IN_PROGRESS));
   assertThat(touchedRows).isEqualTo(1);
  });
 }
}
org.sonar.db.ceCeQueueMapperupdateIf

Popular methods of CeQueueMapper

  • countByQuery
  • deleteByUuid
  • insert
  • selectAllInAscOrder
  • selectByQueryInDescOrder
  • selectByUuid
  • selectEligibleForPeek
  • countByStatusAndComponentUuid
  • countByStatusAndMainComponentUuid
  • countByStatusAndMainComponentUuids
  • resetAllInProgressTasks
    Reset all IN_PROGRESS TASKS
  • resetAllToPendingStatus
  • resetAllInProgressTasks,
  • resetAllToPendingStatus,
  • resetTasksWithUnknownWorkerUUIDs,
  • resetToPendingForWorker,
  • selectByComponentUuid,
  • selectByMainComponentUuid,
  • selectInProgressStartedBefore,
  • selectPending,
  • selectWornout

Popular in Java

  • Making http requests using okhttp
  • getApplicationContext (Context)
  • startActivity (Activity)
  • orElseThrow (Optional)
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • TimerTask (java.util)
    A task that can be scheduled for one-time or repeated execution by a Timer.
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement.A servlet is a small Java program that runs within
  • JFileChooser (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now