Package java.util

Examples of java.util.UUID.timestamp()


     */
    public void test_ConstructurJJ() {
        UUID uuid = new UUID(0xf81d4fae7dec11d0L, 0xa76500a0c91e6bf6L);
        assertEquals(2, uuid.variant());
        assertEquals(1, uuid.version());
        assertEquals(0x1d07decf81d4faeL, uuid.timestamp());
        assertEquals(130742845922168750L, uuid.timestamp());
        assertEquals(0x2765, uuid.clockSequence());
        assertEquals(0xA0C91E6BF6L, uuid.node());
    }

View Full Code Here


    public void test_ConstructurJJ() {
        UUID uuid = new UUID(0xf81d4fae7dec11d0L, 0xa76500a0c91e6bf6L);
        assertEquals(2, uuid.variant());
        assertEquals(1, uuid.version());
        assertEquals(0x1d07decf81d4faeL, uuid.timestamp());
        assertEquals(130742845922168750L, uuid.timestamp());
        assertEquals(0x2765, uuid.clockSequence());
        assertEquals(0xA0C91E6BF6L, uuid.node());
    }

    /**
 
View Full Code Here

    /**
     * @see UUID#timestamp()
     */
    public void test_timestamp() {
        UUID uuid = new UUID(0x0000000000001000L, 0x8000000000000000L);
        assertEquals(0x0, uuid.timestamp());

        uuid = new UUID(0x7777777755551333L, 0x8000000000000000L);
        assertEquals(0x333555577777777L, uuid.timestamp());

        uuid = new UUID(0x0000000000000000L, 0x8000000000000000L);
View Full Code Here

    public void test_timestamp() {
        UUID uuid = new UUID(0x0000000000001000L, 0x8000000000000000L);
        assertEquals(0x0, uuid.timestamp());

        uuid = new UUID(0x7777777755551333L, 0x8000000000000000L);
        assertEquals(0x333555577777777L, uuid.timestamp());

        uuid = new UUID(0x0000000000000000L, 0x8000000000000000L);
        try {
            uuid.timestamp();
            fail("No UnsupportedOperationException");
View Full Code Here

        uuid = new UUID(0x7777777755551333L, 0x8000000000000000L);
        assertEquals(0x333555577777777L, uuid.timestamp());

        uuid = new UUID(0x0000000000000000L, 0x8000000000000000L);
        try {
            uuid.timestamp();
            fail("No UnsupportedOperationException");
        } catch (UnsupportedOperationException e) {}

        uuid = new UUID(0x0000000000002000L, 0x8000000000000000L);
        try {
View Full Code Here

            fail("No UnsupportedOperationException");
        } catch (UnsupportedOperationException e) {}

        uuid = new UUID(0x0000000000002000L, 0x8000000000000000L);
        try {
            uuid.timestamp();
            fail("No UnsupportedOperationException");
        } catch (UnsupportedOperationException e) {}
    }

    /**
 
View Full Code Here

    public static void rectify(UUID theirVersion, InetAddress endpoint)
    {
        UUID myVersion = DatabaseDescriptor.getDefsVersion();
        if (theirVersion.timestamp() == myVersion.timestamp())
            return;
        else if (theirVersion.timestamp() > myVersion.timestamp())
        {
            logger.debug("My data definitions are old. Asking for updates since {}", myVersion.toString());
            announce(myVersion, Collections.singleton(endpoint));
        }
        else
View Full Code Here

    @Test
    public void verifyOrdering1() throws UnknownHostException
    {
        UUID one = UUIDGen.makeType1UUIDFromHost(InetAddress.getByName("127.0.0.1"));
        UUID two = UUIDGen.makeType1UUIDFromHost(InetAddress.getByName("127.0.0.2"));
        assert one.timestamp() < two.timestamp();
    }


    @Test
    public void testDecomposeAndRaw() throws UnknownHostException
View Full Code Here

   
    /** will either push or pull an updating depending on who is behind. */
    public static void rectify(UUID theirVersion, InetAddress endpoint)
    {
        UUID myVersion = DatabaseDescriptor.getDefsVersion();
        if (theirVersion.timestamp() == myVersion.timestamp())
            return;
        else if (theirVersion.timestamp() > myVersion.timestamp())
        {
            logger.debug("My data definitions are old. Asking for updates since {}", myVersion.toString());
            announce(myVersion, Collections.singleton(endpoint));
View Full Code Here

            // check versions at every step along the way to make sure migrations are not applied out of order.
            Collection<Column> cols = MigrationManager.makeColumns(message);
            for (Column col : cols)
            {
                final UUID version = UUIDGen.makeType1UUID(col.name());
                if (version.timestamp() > DatabaseDescriptor.getDefsVersion().timestamp())
                {
                    final Migration m = Migration.deserialize(col.value());
                    assert m.getVersion().equals(version);
                    StageManager.getStage(Stage.MIGRATION).submit(new WrappedRunnable()
                    {
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.