Package org.apache.jackrabbit.oak.plugins.document

Examples of org.apache.jackrabbit.oak.plugins.document.Revision


    }

    @Ignore("Performance test")
    @Test
    public void performance_revisionToString() {
        Revision r = new Revision(System.currentTimeMillis(), 0, 0);
        // warm up
        for (int i = 0; i < 1 * 1000 * 1000; i++) {
            r.toString();
        }
        long time = System.currentTimeMillis();
        for (int i = 0; i < 30 * 1000 * 1000; i++) {
            r.toString();
        }
        time = System.currentTimeMillis() - time;
        System.out.println(time);
    }
View Full Code Here


            o.writeBoolean(r.isBranch());
        }

        @Override
        public Revision read(Kryo kryo, Input i, Class<Revision> revisionClass) {
            return new Revision(
                    i.readLong(true), //timestamp
                    i.readInt(true)//counter
                    i.readInt(true)//clusterId
                    i.readBoolean() //branch
            );
View Full Code Here

                    case INCREMENT: {
                        inserts[i].put(k.toString(), op.value);
                        break;
                    }
                    case SET_MAP_ENTRY: {
                        Revision r = k.getRevision();
                        if (r == null) {
                            throw new IllegalStateException(
                                    "SET_MAP_ENTRY must not have null revision");
                        }
                        DBObject value = new RevisionEntry(r, op.value);
View Full Code Here

public class SerializerTest {
    private DocumentStore store = new MemoryDocumentStore();

    @Test
    public void revisionSerialization() {
        Revision r = new Revision(System.currentTimeMillis(), 1, 5);
        assertEquals(r, deserialize(r));

        r = new Revision(System.currentTimeMillis(), 1, 5, true);
        assertEquals(r, deserialize(r));
    }
View Full Code Here

    }

    private static Map<Revision,Object> createRevisionMap(){
        Map<Revision,Object> map = new TreeMap<Revision, Object>(StableRevisionComparator.REVERSE);
        for(int i = 0; i < 10; i++){
            map.put(new Revision(System.currentTimeMillis() + i, 0, 2),"foo"+i);
        }
        return map;
    }
View Full Code Here

                    case INCREMENT: {
                        inserts[i].put(k.toString(), op.value);
                        break;
                    }
                    case SET_MAP_ENTRY: {
                        Revision r = k.getRevision();
                        if (r == null) {
                            throw new IllegalStateException(
                                    "SET_MAP_ENTRY must not have null revision");
                        }
                        DBObject value = new RevisionEntry(r, op.value);
View Full Code Here

                    case INCREMENT: {
                        inserts[i].put(k.toString(), op.value);
                        break;
                    }
                    case SET_MAP_ENTRY: {
                        Revision r = k.getRevision();
                        if (r == null) {
                            throw new IllegalStateException(
                                    "SET_MAP_ENTRY must not have null revision");
                        }
                        DBObject value = new RevisionEntry(r, op.value);
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.oak.plugins.document.Revision

Copyright © 2018 www.massapicom. 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.