Delete test directories after test We have files in target being archived. Remove them after the test finishes. Change-Id: I68ea84a78e82bffcc3d8e0868b2f492759f64f90 Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Bump versions to 9.0.2-SNAPSHOT This starts the next deveopment iteration. Change-Id: I5940bc14b5261316778f547b0111b62b3a983bdb Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Release controller
Change FileChannel prefix to Disk We use FileChannelJournalSegment{Reader,Writer} for StorageLevel.DISK, and Mapped* for StorageLevel.MAPPED. Fix this by a quick rename to DiskJournaSegment{Reader,Writer}, improving internal consistency and shortening class names. Change-Id: Ia6d7311ed93527ff77cde3f7b57bb34689f962cd Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Add PANTHEON.tech copyright headers These files have been significantly altered and hence deserve a contributor copyright with a fresh year. JIRA: CONTROLLER-2105 Change-Id: Ieceb00a54d204db5ba8bb92971a719f2b0815c59 Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Normalized copyright header Use a closed range and our standard 'and others' moniker. JIRA: CONTROLLER-2105 Change-Id: I868b02415666da378f395ff711d5092a334d0196 Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Futher improvements to ByteBuffer invocations MappedJournalSegmentWriter should take advantage of fluent APIs of ByteBuffer. JIRA: CONTROLLER-2097 Change-Id: If12fe247bd08db450e00ea9878ecfafb7f75596b Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Centralize entry header size We jave 'Integer.BYTES + Integer.BYTES' strewn all across the code, centralize this constant into a single place. JIRA: CONTROLLER-2098 Change-Id: If15f944db20b01767ca387f652ddf11fed64e2fa Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Make JournalSegmentWriter.getNextIndex() final We have duplicated code between the two implementations. Centralize it to the common superclass. JIRA: CONTROLLER-2098 Change-Id: I84b1a1d716c2ccbaaf2f75e3728bcbad0aa05ec6 Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Make JournalSegmentWriter.getLastIndex() final We have duplicated code between the two implementations. Centralize it to the common superclass. JIRA: CONTROLLER-2098 Change-Id: I805e882566d8f891c23a1f25143d453c94284cd1 Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Improve ByteBuffer invocations ByteBuffer has a fluent API, returning the same buffer from methods which do not return something else. Take advantage of this a chain invocations, resulting in denser byte code. JIRA: CONTROLLER-2097 Change-Id: Ic744e5e4f4d8c3fec5026f9d7edc58b7a5387c0e Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Improve FileChannelJournalSegmentWriter's buffer management Minor refactor of logic in FileChannelJournalSegmentWriter class. Removed unnecessary buffer clearing after each entry. New logic remove already proccesed entry from the buffer and if needed reads new data from FileChannel to it's capacity. JIRA: CONTROLLER-2097 Change-Id: I571d531437b068cd468bdc92b3ab6a4223450a45 Signed-off-by: Oleksandr Zharov <oleksandr.zharov@pantheon.tech>
Use correct JournalSegmentWriter for initial indexing JournalSegment should look at StorageLevel and pick the appropriate writer instead of always using FileChannelJournalSegment. JIRA: CONTROLLER-2099 Change-Id: I060618a2808a837214b5ae61f4860f329c1799f0 Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Remove LeaderLocationListenerRegistration This specialization is not used anywhere, remove it and adjust LeaderLocationListener. Change-Id: Ic6a738b2b34ecaca980fb222fb363ef391f24b1a Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Migrate users of deprecated methods Updated yangtools/mdsal are providing a few more convenient methods, use those instead of their deprecated equivalents. Change-Id: I6a971e349dc7d5aed00697c179dfa0c37afa8209 Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Bump upstreams Adopt: - odlparent-13.0.11 - yangtools-13.0.1 - mdsal-13.0.0 Change-Id: I33bbfb6a9016ae13cfaba8d95bf461f8167621eb Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
JournalReader is not an Iterator Iterator dictating a two method API, which is not quite appropriate, as the writer could be manipulated between hasNext() and next() methods -- and next() has to perform validation again. Introduce JournalReader.tryNext(), which returns a @Nullable Indexed -- either the next entry (as next()), or null (indicating !hasNext() case). JIRA: CONTROLLER-2106 Change-Id: Ie0338a9869ece8e6381ae719a29e97fd569b442f Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Catch JournalReader.next() violations in Mode.COMMITS JournalReader.next() is specified as an Iterator and should be throwing NSEs. This is not the case when we ask for only commits, as the corresponding check is done only in hasNext() and thus we would give out uncommitted entries. Fix this by adding an override to check for this condition. JIRA: CONTROLLER-2106 Change-Id: I1f391cc19b9674646786c93656b83519e0f1f47b Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Use try-with-resources in testCompactAndRecover Eclipse is flagging a warning here, make sure we silence it. Change-Id: I7bfa9d490e8b9b71bf04511bc42d6d101345b179 Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Cache reader's nextIndex during reset() JournalSegmentReader.getNextIndex() involves some computation, so do not call it twice when deciding how to reset SegmentedJournalReader. JIRA: CONTROLLER-2106 Change-Id: I7527d8f0c47d35b7a59c30558715204a85b24eae Signed-off-by: Robert Varga <robert.varga@pantheon.tech>