Examples of RecordId


Examples of org.apache.jackrabbit.oak.plugins.segment.RecordId

                heads.add(RecordId.fromString(tracker, line.substring(0, space)));
            }
            line = journalFile.readLine();
        }

        RecordId id = null;
        while (id == null && !heads.isEmpty()) {
            RecordId last = heads.removeLast();
            SegmentId segmentId = last.getSegmentId();
            if (containsSegment(
                    segmentId.getMostSignificantBits(),
                    segmentId.getLeastSignificantBits())) {
                id = last;
            } else {
View Full Code Here

Examples of org.apache.jackrabbit.oak.plugins.segment.RecordId

        return dataFiles;
    }

    public void flush() throws IOException {
        synchronized (persistedHead) {
            RecordId before = persistedHead.get();
            RecordId after = head.get();
            boolean cleanup = cleanupNeeded.getAndSet(false);
            if (cleanup || !after.equals(before)) {
                // needs to happen outside the synchronization block below to
                // avoid a deadlock with another thread flushing the writer
                tracker.getWriter().flush();

                // needs to happen outside the synchronization block below to
View Full Code Here

Examples of org.apache.jackrabbit.oak.plugins.segment.RecordId

        return new SegmentNodeState(head.get());
    }

    @Override
    public boolean setHead(SegmentNodeState base, SegmentNodeState head) {
        RecordId id = this.head.get();
        return id.equals(base.getRecordId())
                && this.head.compareAndSet(id, head.getRecordId());
    }
View Full Code Here

Examples of org.apache.jackrabbit.oak.plugins.segment.RecordId

                            SegmentId id = store.getTracker().getSegmentId(
                                    uuid.getMostSignificantBits(),
                                    uuid.getLeastSignificantBits());
                            System.out.println(id.getSegment());
                        } else {
                            RecordId id = store.getHead().getRecordId();
                            if (matcher.group(2) != null) {
                                id = RecordId.fromString(
                                        store.getTracker(), matcher.group(2));
                            }
                            String path = "/";
View Full Code Here

Examples of org.apache.jackrabbit.oak.plugins.segment.RecordId

                heads.add(line.substring(0, space));
            }
            line = journalFile.readLine();
        }

        RecordId id = null;
        while (id == null && !heads.isEmpty()) {
            RecordId last = RecordId.fromString(tracker, heads.removeLast());
            SegmentId segmentId = last.getSegmentId();
            if (containsSegment(
                    segmentId.getMostSignificantBits(),
                    segmentId.getLeastSignificantBits())) {
                id = last;
            } else {
View Full Code Here

Examples of org.apache.jackrabbit.oak.plugins.segment.RecordId

        return estimate;
    }

    public void flush() throws IOException {
        synchronized (persistedHead) {
            RecordId before = persistedHead.get();
            RecordId after = head.get();
            boolean cleanup = cleanupNeeded.getAndSet(false);
            if (cleanup || !after.equals(before)) {
                // needs to happen outside the synchronization block below to
                // avoid a deadlock with another thread flushing the writer
                tracker.getWriter().flush();

                // needs to happen outside the synchronization block below to
                // prevent the flush from stopping concurrent reads and writes
                writer.flush();

                synchronized (this) {
                    log.debug("TarMK journal update {} -> {}", before, after);
                    journalFile.writeBytes(after.toString10() + " root\n");
                    journalFile.getChannel().force(false);
                    persistedHead.set(after);

                    if (cleanup) {
                        cleanup();
View Full Code Here

Examples of org.apache.jackrabbit.oak.plugins.segment.RecordId

        return new SegmentNodeState(head.get());
    }

    @Override
    public boolean setHead(SegmentNodeState base, SegmentNodeState head) {
        RecordId id = this.head.get();
        return id.equals(base.getRecordId())
                && this.head.compareAndSet(id, head.getRecordId());
    }
View Full Code Here

Examples of org.apache.jackrabbit.oak.plugins.segment.RecordId

        }

        journalFile = new RandomAccessFile(
                new File(directory, JOURNAL_FILE_NAME), "rw");

        RecordId id = null;
        String line = journalFile.readLine();
        while (line != null) {
            int space = line.indexOf(' ');
            if (space != -1) {
                id = RecordId.fromString(line.substring(0, space));
View Full Code Here

Examples of org.apache.jackrabbit.oak.plugins.segment.RecordId

        flushThread.start();
    }

    public void flush() throws IOException {
        synchronized (persistedHead) {
            RecordId before = persistedHead.get();
            RecordId after = head.get();
            if (!after.equals(before)) {
                // needs to happen outside the synchronization block below to
                // avoid a deadlock with another thread flushing the writer
                getWriter().flush();

                synchronized (this) {
View Full Code Here

Examples of org.apache.jackrabbit.oak.plugins.segment.RecordId

            public RecordId getHead() {
                return head.get();
            }
            @Override
            public boolean setHead(RecordId before, RecordId after) {
                RecordId id = head.get();
                return id.equals(before) && head.compareAndSet(id, after);
            }
            @Override
            public void merge() {
                throw new UnsupportedOperationException();
            }
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.