Examples of incrementVersion()


Examples of org.springframework.batch.core.JobExecution.incrementVersion()

  @Transactional @Test
  public void testUpdateInvalidJobExecution() {

    // id is invalid
    JobExecution execution = new JobExecution(jobInstance, (long) 29432, jobParameters, null);
    execution.incrementVersion();
    try {
      jobExecutionDao.updateJobExecution(execution);
      fail("Expected NoSuchBatchDomainObjectException");
    }
    catch (NoSuchObjectException ex) {
View Full Code Here

Examples of org.springframework.batch.core.JobExecution.incrementVersion()

    dao.saveJobExecution(exec1);

    JobExecution exec2 = new JobExecution(jobInstance, jobParameters);
    exec2.setId(exec1.getId());

    exec2.incrementVersion();
    assertEquals((Integer) 0, exec1.getVersion());
    assertEquals(exec1.getVersion(), exec2.getVersion());

    dao.updateJobExecution(exec1);
    assertEquals((Integer) 1, exec1.getVersion());
View Full Code Here

Examples of org.springframework.batch.core.JobInstance.incrementVersion()

  public JobInstance createJobInstance(String jobName, JobParameters jobParameters) {

    Assert.state(getJobInstance(jobName, jobParameters) == null, "JobInstance must not already exist");

    JobInstance jobInstance = new JobInstance(currentId.getAndIncrement(), jobName);
    jobInstance.incrementVersion();
    jobInstances.put(jobName + "|" + jobKeyGenerator.generateKey(jobParameters), jobInstance);

    return jobInstance;
  }
View Full Code Here

Examples of org.springframework.batch.core.JobInstance.incrementVersion()

        "JobInstance must not already exist");

    Long jobId = jobIncrementer.nextLongValue();

    JobInstance jobInstance = new JobInstance(jobId, jobName);
    jobInstance.incrementVersion();

    Object[] parameters = new Object[] { jobId, jobName,
        jobKeyGenerator.generateKey(jobParameters), jobInstance.getVersion() };
    getJdbcTemplate().update(
        getQuery(CREATE_JOB_INSTANCE),
View Full Code Here

Examples of org.springframework.batch.core.JobInstance.incrementVersion()

    @Override
    public JobInstance mapRow(ResultSet rs, int rowNum) throws SQLException {
      JobInstance jobInstance = new JobInstance(rs.getLong(1), rs.getString(2));
      // should always be at version=0 because they never get updated
      jobInstance.incrementVersion();
      return jobInstance;
    }
  }

  @Override
View Full Code Here

Examples of org.springframework.batch.core.StepExecution.incrementVersion()

    dao.saveStepExecution(exec1);

    StepExecution exec2 = new StepExecution(step.getName(), jobExecution);
    exec2.setId(exec1.getId());

    exec2.incrementVersion();
    assertEquals(new Integer(0), exec1.getVersion());
    assertEquals(exec1.getVersion(), exec2.getVersion());

    dao.updateStepExecution(exec1);
    assertEquals(new Integer(1), exec1.getVersion());
View Full Code Here

Examples of voldemort.versioning.VectorClock.incrementVersion()

    public void testPutVersioned() {
        client.put("k", Versioned.value("v"));
        Versioned<String> v = client.get("k");
        assertEquals("GET should return the version set by PUT.", "v", v.getValue());
        VectorClock expected = new VectorClock();
        expected.incrementVersion(nodeId, time.getMilliseconds());
        assertEquals("The version should be incremented after a put.", expected, v.getVersion());
        try {
            client.put("k", Versioned.value("v"));
            fail("Put of obsolete version should throw exception.");
        } catch(ObsoleteVersionException e) {
View Full Code Here

Examples of voldemort.versioning.VectorClock.incrementVersion()

        Map<ConsistencyCheck.Value, Set<ConsistencyCheck.ClusterNode>> versionNodeSetMap = new HashMap<ConsistencyCheck.Value, Set<ConsistencyCheck.ClusterNode>>();
        int replicationFactor = 4;

        // Version is vector clock
        VectorClock vc1 = new VectorClock();
        vc1.incrementVersion(1, 100000001);
        vc1.incrementVersion(2, 100000003);

        VectorClock vc2 = new VectorClock();
        vc2.incrementVersion(1, 100000001);
        vc2.incrementVersion(3, 100000002);
View Full Code Here

Examples of voldemort.versioning.VectorClock.incrementVersion()

        int replicationFactor = 4;

        // Version is vector clock
        VectorClock vc1 = new VectorClock();
        vc1.incrementVersion(1, 100000001);
        vc1.incrementVersion(2, 100000003);

        VectorClock vc2 = new VectorClock();
        vc2.incrementVersion(1, 100000001);
        vc2.incrementVersion(3, 100000002);
        VectorClock vc3 = new VectorClock();
View Full Code Here

Examples of voldemort.versioning.VectorClock.incrementVersion()

        VectorClock vc1 = new VectorClock();
        vc1.incrementVersion(1, 100000001);
        vc1.incrementVersion(2, 100000003);

        VectorClock vc2 = new VectorClock();
        vc2.incrementVersion(1, 100000001);
        vc2.incrementVersion(3, 100000002);
        VectorClock vc3 = new VectorClock();
        vc3.incrementVersion(1, 100000001);
        vc3.incrementVersion(4, 100000001);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.