Package krati.retention.clock

Examples of krati.retention.clock.Clock.compareTo()


        Position pos = _retention.getPosition();
        assertEquals((long)cnt, pos.getOffset());
        assertEquals(cnt, _retention.getOffset());
       
        assertTrue(minClock.compareTo(_retention.getMinClock()) == Occurred.EQUICONCURRENTLY);
        assertTrue(maxClock.compareTo(_retention.getMaxClock()) == Occurred.EQUICONCURRENTLY);
       
        Position sincePosition = _retention.getPosition(idleClock0);
        assertEquals(getId(), sincePosition.getId());
        assertEquals(0, sincePosition.getOffset());
       
View Full Code Here


            assertTrue(_clock.getLWMScn(source) < _clock.getHWMScn(source));
            assertTrue(clock.before(_clock.current()));
            clock = _clock.current();
        }
       
        assertTrue(clock.compareTo(_clock.current()) == Occurred.EQUICONCURRENTLY);
       
        // Sync water marks
        _clock.syncWaterMarks();
       
        // Check lwmScn = hwmScn
View Full Code Here

        assertTrue(c1.before(c2));
        assertTrue(c2.after(c1));
       
        long[] scnValues = (long[])c1.values().clone();
        Clock c = new Clock(scnValues);
        assertTrue(c.compareTo(c1) == Occurred.EQUICONCURRENTLY);
        assertTrue(c1.compareTo(c) == Occurred.EQUICONCURRENTLY);
       
        scnValues[0] = scnValues[0] + 1;
        c = new Clock(scnValues);
        assertTrue(c.after(c1));
View Full Code Here

        assertTrue(c1.before(c));
       
        scnValues[1] = c.values()[1] - 1;
        c = new Clock(scnValues);
       
        assertEquals(Occurred.CONCURRENTLY, c.compareTo(c1));
       
        long[] scnValuesNew = new long[2];
        scnValuesNew[0] = scnValuesNew[0];
        scnValuesNew[1] = scnValuesNew[1];
        c = new Clock(scnValuesNew);
View Full Code Here

        scnValuesNew[0] = scnValuesNew[0];
        scnValuesNew[1] = scnValuesNew[1];
        c = new Clock(scnValuesNew);
       
        try {
            c.compareTo(c1);
            assertTrue(false);
        } catch(IncomparableClocksException e) {
            assertTrue(true);
        }
    }
View Full Code Here

        batch = new SimpleEventBatch<String>(origin, clock, capacity);
       
        assertEquals(EventBatch.VERSION, batch.getVersion());
        assertEquals(0, batch.getSize());
        assertEquals(origin, batch.getOrigin());
        assertEquals(Occurred.EQUICONCURRENTLY, clock.compareTo(batch.getMinClock()));
        assertEquals(Occurred.EQUICONCURRENTLY, clock.compareTo(batch.getMaxClock()));
       
        // Add the first event
        clock = _randClockFactory.next();
        batch.put(new SimpleEvent<String>("Event." + clock, clock));
View Full Code Here

       
        assertEquals(EventBatch.VERSION, batch.getVersion());
        assertEquals(0, batch.getSize());
        assertEquals(origin, batch.getOrigin());
        assertEquals(Occurred.EQUICONCURRENTLY, clock.compareTo(batch.getMinClock()));
        assertEquals(Occurred.EQUICONCURRENTLY, clock.compareTo(batch.getMaxClock()));
       
        // Add the first event
        clock = _randClockFactory.next();
        batch.put(new SimpleEvent<String>("Event." + clock, clock));
       
View Full Code Here

       
        // Add the first event
        clock = _randClockFactory.next();
        batch.put(new SimpleEvent<String>("Event." + clock, clock));
       
        assertTrue(clock.compareTo(batch.getMinClock()) == Occurred.EQUICONCURRENTLY);
        assertTrue(clock.compareTo(batch.getMaxClock()) == Occurred.EQUICONCURRENTLY);
        assertEquals(1, batch.getSize());
       
        // Add the second event
        clock = _randClockFactory.next();
View Full Code Here

        // Add the first event
        clock = _randClockFactory.next();
        batch.put(new SimpleEvent<String>("Event." + clock, clock));
       
        assertTrue(clock.compareTo(batch.getMinClock()) == Occurred.EQUICONCURRENTLY);
        assertTrue(clock.compareTo(batch.getMaxClock()) == Occurred.EQUICONCURRENTLY);
        assertEquals(1, batch.getSize());
       
        // Add the second event
        clock = _randClockFactory.next();
        batch.put(new SimpleEvent<String>("Event." + clock, clock));
View Full Code Here

        // Add the second event
        clock = _randClockFactory.next();
        batch.put(new SimpleEvent<String>("Event." + clock, clock));
       
        assertTrue(clock.after(batch.getMinClock()));
        assertTrue(clock.compareTo(batch.getMaxClock()) == Occurred.EQUICONCURRENTLY);
        assertEquals(2, batch.getSize());
       
        do {
            clock = _randClockFactory.next();
        } while(batch.put(new SimpleEvent<String>("Event." + clock, clock)));
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.