Package org.apache.jackrabbit.oak.plugins.segment

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


                        "Segment " + segmentId + " not found");
            }
        }

        byte[] data = (byte[]) segment.get("data");
        return new Segment(this, segmentId, ByteBuffer.wrap(data));
    }
View Full Code Here


        SegmentReference previous = references.put(
                segmentId, new SegmentReference(segmentId, rw, position));
        checkState(previous == null);

        segments.put(segmentId, new Segment(
                this, segmentId, ro, referencedSegmentIds, strings, templates));
    }
View Full Code Here

                checkState(reference != null);
                referencedIds.add(reference.getSegmentId());
            }

            ro.limit(ro.position() + length);
            return new Segment(FileStore.this, id, ro.slice(), referencedIds,
                    Collections.<String, RecordId>emptyMap(),
                    Collections.<Template, RecordId>emptyMap());
        }
View Full Code Here

            Collection<UUID> referencedSegmentIds,
            Map<String, RecordId> strings, Map<Template, RecordId> templates) {
        byte[] d = new byte[length];
        System.arraycopy(data, offset, d, 0, length);

        cache.addSegment(new Segment(
                this, segmentId, ByteBuffer.wrap(d), referencedSegmentIds,
                Collections.<String, RecordId>emptyMap(),
                Collections.<Template, RecordId>emptyMap()));

        insertSegment(segmentId, d, referencedSegmentIds);
View Full Code Here

        List<?> list = (List<?>) segment.get("uuids");
        List<UUID> uuids = Lists.newArrayListWithCapacity(list.size());
        for (Object object : list) {
            uuids.add(UUID.fromString(object.toString()));
        }
        return new Segment(
                this, segmentId, ByteBuffer.wrap(data), uuids,
                Collections.<String, RecordId>emptyMap(),
                Collections.<Template, RecordId>emptyMap());
    }
View Full Code Here

        return journal;
    }

    @Override
    public Segment readSegment(UUID id) {
        Segment segment = segments.get(id);
        if (segment != null) {
            return segment;
        } else {
            throw new IllegalArgumentException("Segment not found: " + id);
        }
View Full Code Here

            UUID segmentId, byte[] data, int offset, int length,
            Collection<UUID> referencedSegmentIds,
            Map<String, RecordId> strings, Map<Template, RecordId> templates) {
        byte[] buffer = new byte[length];
        System.arraycopy(data, offset, buffer, 0, length);
        Segment segment = new Segment(
                this, segmentId, ByteBuffer.wrap(buffer),
                referencedSegmentIds, strings, templates);
        if (segments.putIfAbsent(segment.getSegmentId(), segment) != null) {
            throw new IllegalStateException(
                    "Segment override: " + segment.getSegmentId());
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.oak.plugins.segment.Segment

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.