controller.git
12 months agoBump versions to 7.0.7-SNAPSHOT 55/105555/1
Robert Varga [Thu, 20 Apr 2023 20:20:31 +0000 (22:20 +0200)]
Bump versions to 7.0.7-SNAPSHOT

This starts the next development iteration.

Change-Id: Ibca884f3a6c97f0cd834862fa7cb1d75c417a8f4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
12 months agoBump upstreams 53/105553/1
Robert Varga [Thu, 20 Apr 2023 16:58:31 +0000 (18:58 +0200)]
Bump upstreams

Adopt:
- odlparent-12.0.5
- yangtools-10.0.6
- mdsal-11.0.9

Change-Id: I92c925a816de28efeec221dddb95aa97955ab619
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
12 months agoBump versions to 7.0.6-SNAPSHOT 21/105521/1
Robert Varga [Wed, 19 Apr 2023 21:14:32 +0000 (23:14 +0200)]
Bump versions to 7.0.6-SNAPSHOT

This starts the next development iteration.

Change-Id: If4d99ef7b344ab97dabe3c641c1b551dfb3c6646
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
12 months agoBump upstreams 76/105476/6
Robert Varga [Mon, 17 Apr 2023 12:24:43 +0000 (14:24 +0200)]
Bump upstreams

Adopt:
- odlparent-12.0.4
- yangtools-10.0.5
- mdsal-11.0.8

Change-Id: I6a99e63080fff51681681ef80089de63af163be4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
12 months agoMigrate users of Optional.get() 83/105483/4
Robert Varga [Tue, 18 Apr 2023 09:07:52 +0000 (11:07 +0200)]
Migrate users of Optional.get()

We have an incoming enforcement patch, prepare to adopt it.

Change-Id: If73abd4ceaea71a216a4bc3a3968b400b508ec38
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
12 months agoUse ArgumentMatchers.anyCollection() 02/105202/5
Robert Varga [Tue, 4 Apr 2023 06:58:49 +0000 (08:58 +0200)]
Use ArgumentMatchers.anyCollection()

Instead of using any(Collection.class) use better anyCollection()
method.

Change-Id: Icff803dd6379dc15dfca1d2ab1bf89319f583e22
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
12 months agoEliminate unneeded else branch 03/105203/3
Robert Varga [Tue, 4 Apr 2023 07:07:34 +0000 (09:07 +0200)]
Eliminate unneeded else branch

Eclipse is right to point out we can just ditch the else branch.

Change-Id: I816dd9a34b6fd8e1272ad1b8b93c2c5b3120ed4b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
12 months agoHonor shard-batched-modification-count 85/105185/6
Robert Varga [Mon, 3 Apr 2023 18:14:47 +0000 (20:14 +0200)]
Honor shard-batched-modification-count

RemoteProxyTransaction should honor not use a hard-coded limit, but
rather pick it up from DatastoreContext configuration.

JIRA: CONTROLLER-2075
Change-Id: I5cf6491f76c05582b2c59e918d8af9521c01d98f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
12 months agoAnnotate AbstractRaftRPC with java.io.Serial 75/105175/3
Robert Varga [Mon, 3 Apr 2023 14:25:33 +0000 (16:25 +0200)]
Annotate AbstractRaftRPC with java.io.Serial

We have constructs which are related to serialization, annotate them.

Change-Id: I8e5d95adaaa25eee35dc2bba349925eb982af207
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
12 months agoAnnotatate CT.readResolve() 68/105168/5
Robert Varga [Mon, 3 Apr 2023 14:06:12 +0000 (16:06 +0200)]
Annotatate CT.readResolve()

This method is used in serialization, annotate it.

Change-Id: I48a3ea80e58b38ff0304903c2cbc383bd43d504e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
12 months agoRemove explicit Serializable 69/105169/6
Robert Varga [Mon, 3 Apr 2023 14:09:52 +0000 (16:09 +0200)]
Remove explicit Serializable

All Payloads are serializable, hence AbstractIdentifiablePayload is as
well.

Change-Id: I4153cad6f800746162d5e2cebb7f80f655d6ec32
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
12 months agoModernize sal-akka-raft tests 48/105148/10
Robert Varga [Mon, 3 Apr 2023 07:48:57 +0000 (09:48 +0200)]
Modernize sal-akka-raft tests

Use List.of(), Map.of() and Set.copyOf(), as well as properly-imported
assertions.

Change-Id: If7777b0e395394f54e20d1a92b7d33fccb373601
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
12 months agoRemove legacy raft message Proxy constructors 74/105174/6
Robert Varga [Mon, 3 Apr 2023 14:22:19 +0000 (16:22 +0200)]
Remove legacy raft message Proxy constructors

These constructors are not invoked anywhere, remove them. This also
means the writeExternal() method cannot legally be invoked.

Change-Id: I6c72ac334b07218d4bfb0cb1cda37771db2c0aff
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
12 months agoRemove FollowerIdentifier.Proxy constructor 73/105173/6
Robert Varga [Mon, 3 Apr 2023 14:22:01 +0000 (16:22 +0200)]
Remove FollowerIdentifier.Proxy constructor

This constructor is not used anywhere, remove it. This also means
writeExternal() cannot legally be invoked.

Change-Id: Ia19dd40104d0bc5c12bc9d3ecb124254d33e0133
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
12 months agoRemove CommitTransactionPayload.Proxy constructor 67/105167/4
Robert Varga [Mon, 3 Apr 2023 13:58:47 +0000 (15:58 +0200)]
Remove CommitTransactionPayload.Proxy constructor

This constructor is not used anywhere, remove it. This also means
writeExternal() cannot legally be called.

Change-Id: Icc6dc83bafb1af96ed5ef17963ad4121250d6342
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
12 months agoCentralize DataTree operations 98/105198/2
Robert Varga [Mon, 3 Apr 2023 19:10:24 +0000 (21:10 +0200)]
Centralize DataTree operations

Centralize taking the snapshot and creating a modifications to the
extent possible.

Change-Id: Ifd2632f583230046686c97cd1b07fefd06266451
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
12 months agoUse instanceof patterns in RemoteProxyTransaction 84/105184/3
Robert Varga [Mon, 3 Apr 2023 18:09:07 +0000 (20:09 +0200)]
Use instanceof patterns in RemoteProxyTransaction

Remove explicit casts with instanceof patterns, which are safer. Also
use Optional.orElseThrow().

Change-Id: If52285168a2ec6791ca86ba095f0e944fae8d3f7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
12 months agoSimplify onGetOnDemandRaftStats() 54/105154/6
Robert Varga [Mon, 3 Apr 2023 11:15:28 +0000 (13:15 +0200)]
Simplify onGetOnDemandRaftStats()

Use an ImmutableList constructed from a stream of peers, improving
density a bit.

Change-Id: I845aba32c331c6516d3ea7a8b0b5de4e9cd69754
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
12 months agoImprove ChangeServersVotingStatusState 53/105153/6
Robert Varga [Mon, 3 Apr 2023 11:08:28 +0000 (13:08 +0200)]
Improve ChangeServersVotingStatusState

We are using multiple lookups and gets and a mutable List. Improve
interactions to improve pre-sizing and use an ImmutableList, without
performing multiple intermediate lookups.

Change-Id: Ibf121c1296e093e99592921d52242e929d3b9a2a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
12 months agoRemove SimpleReplicatedLogEntry.Proxy constructor 65/105165/3
Robert Varga [Mon, 3 Apr 2023 13:44:25 +0000 (15:44 +0200)]
Remove SimpleReplicatedLogEntry.Proxy constructor

We are not using this proxy in the write path, remove its constructor.

Change-Id: Ifeefcd8cfc787306d16cbd13daf5e4537e80da91
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
12 months agoUse instanceof pattern in FrontendReadWriteTransaction 80/105180/2
Robert Varga [Mon, 3 Apr 2023 15:17:03 +0000 (17:17 +0200)]
Use instanceof pattern in FrontendReadWriteTransaction

Improve cast safety by combining the check and cast into a instanceof
pattern,

Change-Id: I987f78de9df8ca1f3ccbb98fd807938bb0743855
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
12 months agoFix StandaloneFrontendHistory accounting 59/104959/6
Šimon Ukuš [Fri, 17 Mar 2023 08:58:40 +0000 (09:58 +0100)]
Fix StandaloneFrontendHistory accounting

testTransactionForwardedToLeaderAfterRetry() is exposing a scheduling
difference between the two implementations -- with tell-based protocol
we are holding off sending modifications until there is a significant
event needing them to be flushed to the backend.

Fixing this up exposes a bug in StandaloneFrontendHistory transaction
accounting, as circles back to ShardDataTree, where its transactions
are accounted for again -- fix that mistake by allocating transactions
directly in StandaloneFrontendHistory.

JIRA: CONTROLLER-2017
Change-Id: Ied00910f55bd3c63f99ae187396c1a193e5ece20
Signed-off-by: Šimon Ukuš <simon.ukus@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
12 months agoAccess historyId only once 82/105182/3
Robert Varga [Mon, 3 Apr 2023 15:26:04 +0000 (17:26 +0200)]
Access historyId only once

This is a simple improvement, improving access a bit.

Change-Id: I42dbd91a0a8d5ce75cd99b36d786d446eac69501
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
12 months agoUse instanceof pattern in AbstractFrontendHistory 79/105179/1
Robert Varga [Mon, 3 Apr 2023 15:07:21 +0000 (17:07 +0200)]
Use instanceof pattern in AbstractFrontendHistory

Reduce the number of casts by using instanceof patterns.

Change-Id: I0ce1ca0229b1e55a5b4745584b679a7872953297
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
12 months agoFix DistributedDataStoreRemotingIntegrationTest typos 78/105178/1
Robert Varga [Mon, 3 Apr 2023 14:59:40 +0000 (16:59 +0200)]
Fix DistributedDataStoreRemotingIntegrationTest typos

We have a few typos in comments, fix them up.

Change-Id: I574849a397f6dea62e928026609c8a191451d701
Signed-off-by: Šimon Ukuš <simon.ukus@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
12 months agoAdd java.io.Serial to EmptyState 64/105164/2
Robert Varga [Mon, 3 Apr 2023 13:43:58 +0000 (15:43 +0200)]
Add java.io.Serial to EmptyState

Annotate members related to serialization.

Change-Id: I46b486244cd4f34dbae47c459c353411eccdf675
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
12 months agoMark Payloads with java.io.Serial 63/105163/2
Robert Varga [Mon, 3 Apr 2023 13:37:19 +0000 (15:37 +0200)]
Mark Payloads with java.io.Serial

We have a number of fields/methods which should be marked with @Serial,
add another pass on them.

Change-Id: Ie08d6e718980e4e3acb148226760ad75ef82566e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
12 months agoImprove ServerConfigurationPayload.equals() 62/105162/2
Robert Varga [Mon, 3 Apr 2023 13:31:47 +0000 (15:31 +0200)]
Improve ServerConfigurationPayload.equals()

Use pattern matching on instanceof to reduce verbosity while retaining
semantics.

Change-Id: I2600f35ae6c71c9e235609246f775fdc9f8eb6b2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
12 months agoMark readResolve() with @Serial 61/105161/2
Robert Varga [Mon, 3 Apr 2023 13:31:18 +0000 (15:31 +0200)]
Mark readResolve() with @Serial

This method is related to serialization, mark it as such.

Change-Id: I65fc80e73a7a6775e8f535f85ba8c5af7ab6677b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
12 months agoImprove Follower's Snapshot 52/105152/4
Robert Varga [Mon, 3 Apr 2023 10:57:54 +0000 (12:57 +0200)]
Improve Follower's Snapshot

Use List.of() to communicate empty lists.

Change-Id: I5cebcde9e92b11a82be0bddf3645eeb8bc909895
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
12 months agoImprove Candidate.votingPeers 51/105151/4
Robert Varga [Mon, 3 Apr 2023 10:55:44 +0000 (12:55 +0200)]
Improve Candidate.votingPeers

Use ImmutableList to ensure the list is never modified. This also
improves overhead/performance slightly.

Change-Id: Iad491da0e446da0a07e96067846c2c57c0dcfb9a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
12 months agoUse ImmutableList in raft persisted/messages 50/105150/4
Robert Varga [Mon, 3 Apr 2023 10:50:12 +0000 (12:50 +0200)]
Use ImmutableList in raft persisted/messages

We are using temporary ArrayList, where we could be using
ImmutableList.builder(). Fix these up, improving immutability
guarantees.

Change-Id: I14412ad6614463fe0f1fc5abdd72e147e189c5cc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
12 months agoClean up sal-clustering-commons 60/105160/1
Robert Varga [Mon, 3 Apr 2023 12:08:53 +0000 (14:08 +0200)]
Clean up sal-clustering-commons

Clean up argument finality and whitespace in for(:) constructs.

Change-Id: If22f693e6c499aafc8fe0a606b2abb40a9f67cfc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
12 months agoClean up RpcErrorsException 59/105159/1
Robert Varga [Mon, 3 Apr 2023 12:03:34 +0000 (14:03 +0200)]
Clean up RpcErrorsException

Fix whitespace and use local variable type inference to improve sizing.

Change-Id: I344305a59e3b0078d942636c339d1686c006e4a3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoMove atomix-storage to a top-level directory 35/105035/3
Robert Varga [Mon, 27 Mar 2023 11:25:57 +0000 (13:25 +0200)]
Move atomix-storage to a top-level directory

The directory structure no longer makes sense here, move the single
component to a top-level directory.

JIRA: CONTROLLER-2072
Change-Id: Ib011d88908547059e21a11820b0531c6edb5a680
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoRename Namespace to KryoJournalSerdes 45/104745/9
Robert Varga [Thu, 2 Mar 2023 20:05:53 +0000 (21:05 +0100)]
Rename Namespace to KryoJournalSerdes

Reduce naming confusion -- Namespace really is a Kryo-based
implementation of JournalSerdes. KryoJournalSerdesBuilder is separated
out so that Kryo interfaces are not leaked outside of the package.

JIRA: CONTROLLER-2072
Change-Id: I75e7a6f30d6319c4284acd76ec098224380e3b70
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoAdd RegisteredType 44/104744/10
Robert Varga [Thu, 2 Mar 2023 20:01:09 +0000 (21:01 +0100)]
Add RegisteredType

Reduce verbosity by introducing a private DTO to hold the combination of
a Serializer and its associated classes.

JIRA: CONTROLLER-2072
Change-Id: I9cdf32d6107740d5a07cfdb884bd4641c242450e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoRemove Namespace.RegistrationBlock 43/104743/9
Robert Varga [Thu, 2 Mar 2023 19:51:44 +0000 (20:51 +0100)]
Remove Namespace.RegistrationBlock

We always create a single block. Remove the unused complexity here and
move Builder class to the bottom so as not to clutter things.

JIRA: CONTROLLER-2072
Change-Id: Ia7d31aa717aeeb17f6d2419d05818f88b0c27c4b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoRemove Namespace.FLOATING_ID 42/104742/8
Robert Varga [Thu, 2 Mar 2023 19:36:10 +0000 (20:36 +0100)]
Remove Namespace.FLOATING_ID

We do not allow for dynamically-allocated IDs. Remove the constant and
the corresponding special-case.

JIRA: CONTROLLER-2072
Change-Id: I7de4ec77bd6934cd89c78de406cf9e0c73fa2cd4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoDo not leak Kryo from atomix.storage 40/104740/8
Robert Varga [Thu, 2 Mar 2023 18:57:03 +0000 (19:57 +0100)]
Do not leak Kryo from atomix.storage

Rather than dealing with Kryo serializers, introduce separate interfaces
to deal with input/output and serialization logic.

This allows us to be in explicit control as to what interface do we
support towards segmented journal persistence. It further means Kryo is
now a pure implementation thing and can be removed without changing the
APIs.

JIRA: CONTROLLER-2072
Change-Id: Ib4550f5f29d33d792f37110b5a14756654a5b87e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoUpgrade reflectasm to 1.11.9 39/105039/3
Robert Varga [Mon, 27 Mar 2023 11:58:44 +0000 (13:58 +0200)]
Upgrade reflectasm to 1.11.9

https://github.com/EsotericSoftware/reflectasm/issues/68, removing the
need to override ASM version.

Change-Id: I489f75a63f9649518493291fe0f36362d4011242
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoFixup atomix references 36/105036/1
Robert Varga [Mon, 27 Mar 2023 11:28:27 +0000 (13:28 +0200)]
Fixup atomix references

We do not want to reference atomix from its original upstream. Fix that
up.

JIRA: CONTROLLER-2071
Change-Id: Ifdbb766135ecf86b1c848cfc1e53487c9b52e4c5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoIntroduce atomix.storage.journal.JournalSerdes 39/104739/5
Robert Varga [Thu, 2 Mar 2023 17:38:30 +0000 (18:38 +0100)]
Introduce atomix.storage.journal.JournalSerdes

The interfaces are tightly coupled with namespace implementation, which
in turn is tightly coupled to Kryo.

As a first step to disconnect these three, introduce JournalSerdes,
which acts as the public API implemented by Namespace. This allows us to
hide atomix.utils.serializer package at least from OSGi.

Change-Id: I9668ba2eb3e0a58d7ed27ee09ec1bb3cee069eb4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoDump DTCL changes on trace 31/105031/2
Robert Varga [Mon, 27 Mar 2023 09:34:52 +0000 (11:34 +0200)]
Dump DTCL changes on trace

Reduce memory usage by not dumping all changes at once, but rather each
of them separately and only when trace is enabled.

Change-Id: I954dd4576d2625a862b254532379974c19bc1c60
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoFix warnings in StorageException 41/104741/3
Robert Varga [Thu, 2 Mar 2023 19:09:29 +0000 (20:09 +0100)]
Fix warnings in StorageException

Exceptions are serializable and therefore should define
serialVersionUID. Fix this omission.

Change-Id: I24daa7ca923d6df71beaf7325b57fc306564f366
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoDelete websocket-change-event-notification-subscription-tutorial 74/104474/6
Yaroslav Lastivka [Wed, 22 Feb 2023 09:55:12 +0000 (11:55 +0200)]
Delete websocket-change-event-notification-subscription-tutorial

Websocket-change-event-notification-subscription-tutorial was
moved to Netconf user-guide

JIRA: NETCONF-962
Change-Id: Ie93e3f3eced3b3bae1658bfb957ba52e0288d0e7
Signed-off-by: Yaroslav Lastivka <yaroslav.lastivka@pantheon.tech>
13 months agoFixup javadoc 46/104746/1
Robert Varga [Thu, 2 Mar 2023 20:12:51 +0000 (21:12 +0100)]
Fixup javadoc

MAX_BUFFER_SIZE was removed, do not reference it.

JIRA: CONTROLLER-2072
Change-Id: I95892c5bf85621f75791d51177af5aa21ec23329
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoRemove Namespace.populate() 38/104738/1
Robert Varga [Thu, 2 Mar 2023 17:01:56 +0000 (18:01 +0100)]
Remove Namespace.populate()

populate() is implementation specific and used only internally.
Integrate it into the constructor.

JIRA: CONTROLLER-2072
Change-Id: I6a78a506d2a7936f84dac332928848af832a21aa
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoPosition is a simple record 37/104737/3
Robert Varga [Thu, 2 Mar 2023 16:40:44 +0000 (17:40 +0100)]
Position is a simple record

This is a pure DTO, reduce verbosity by turning it into a plain record.

Change-Id: Ife6286343f1bc3f88c9586c6a011ef08b182ac1d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoRemove DelegatingJournal{,Reader,Writer} 36/104736/1
Robert Varga [Thu, 2 Mar 2023 16:36:43 +0000 (17:36 +0100)]
Remove DelegatingJournal{,Reader,Writer}

These classes are not used anywhere, remove them to improve code
navigability.

JIRA: CONTROLLER-2071
Change-Id: I45c3f9953c6794ed55053ac1193d14d83b844ad0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoRemove Namespace.size() 35/104735/1
Robert Varga [Thu, 2 Mar 2023 16:32:20 +0000 (17:32 +0100)]
Remove Namespace.size()

This method is not used anywhere, remove it.

JIRA: CONTROLLER-2072
Change-Id: Ia1d4e2fb4b1b3421a3a67521a7afec0687f2855a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoRemove Namespace.friendlyName() 34/104734/1
Robert Varga [Thu, 2 Mar 2023 16:30:51 +0000 (17:30 +0100)]
Remove Namespace.friendlyName()

This is a useless private method remove it.

JIRA: CONTROLLER-2072
Change-Id: Iadfb538b57222e60b09e7b05fd26b5810878b9c4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoRemove Namespace.Builder.setRegistrationRequired() 33/104733/1
Robert Varga [Thu, 2 Mar 2023 16:18:05 +0000 (17:18 +0100)]
Remove Namespace.Builder.setRegistrationRequired()

We want users to always register serializers, remove the option to not
do so.

JIRA: CONTROLLER-2072
Change-Id: I8aeb47045353b058556498bc4e6b64307646d924
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoRemove Namespace.DEFAULT 32/104732/1
Robert Varga [Thu, 2 Mar 2023 16:11:10 +0000 (17:11 +0100)]
Remove Namespace.DEFAULT

We want users to explicitly set up their namespaces, hence remove the
default namespace.

JIRA: CONTROLLER-2072
Change-Id: Id97bc5d5696dd8f12a34bf8d3378344da3396b49
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoRemove Namespace.MAX_BUFFER_SIZE 31/104731/1
Robert Varga [Thu, 2 Mar 2023 16:09:45 +0000 (17:09 +0100)]
Remove Namespace.MAX_BUFFER_SIZE

This constant is not used anywhere, remove it.

JIRA: CONTROLLER-2072
Change-Id: If33308ba3aa7bc6eb8ee4f95702eccfc3fcb4604
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoRemove Namespace.Builder.setCompatible() 30/104730/1
Robert Varga [Thu, 2 Mar 2023 16:06:10 +0000 (17:06 +0100)]
Remove Namespace.Builder.setCompatible()

We want users to explicitly take a hold of their serialization format,
hence we do not want to create forward/backward compatible streams. They
are prohibitively costly in our use case anyway.

JIRA: CONTROLLER-2072
Change-Id: Ie533bf52f2b7123f162e9275b39952cd2193679a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoRemove Namespace.Builder.nextId() 29/104729/1
Robert Varga [Thu, 2 Mar 2023 16:00:59 +0000 (17:00 +0100)]
Remove Namespace.Builder.nextId()

The facility to assign ids is not used by us, remove it, as it seems to
be a leak from Kryo.

JIRA: CONTROLLER-2072
Change-Id: I5069e3c0dfa395a56c98498d566b615651bda820
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoDitch dependency on commons-lang3 27/104727/2
Robert Varga [Thu, 2 Mar 2023 14:33:27 +0000 (15:33 +0100)]
Ditch dependency on commons-lang3

We are using only Pair, and we do not allow null values, hence we can
just switch to using Map.entry() and ditch this dependency.

JIRA: CONTROLLER-2072
Change-Id: Ida8ba2a28489cd011757e48074c58ad8cb260a34
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoDo not fall back to default Kryo serializers 26/104726/2
Robert Varga [Thu, 2 Mar 2023 14:16:40 +0000 (15:16 +0100)]
Do not fall back to default Kryo serializers

Prevent the use of default serializers, so that users have to supply
them. This is the only way we want to be using this facility.

JIRA: CONTROLLER-2072
Change-Id: I69ace2f966e7f1eeeeaff5385ee3389bdaa8d25a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoDo not allow recursive Namespace registration 25/104725/1
Robert Varga [Thu, 2 Mar 2023 13:51:05 +0000 (14:51 +0100)]
Do not allow recursive Namespace registration

We are not combining namespaces, there is no need for this method.

JIRA: CONTROLLER-2072
Change-Id: I332a04db841763f307add1168b999f685de7e422
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoDo not export atomix.storage.journal.index 24/104724/1
Robert Varga [Thu, 2 Mar 2023 13:29:27 +0000 (14:29 +0100)]
Do not export atomix.storage.journal.index

This package is an internal implementation thing, do not expose it to
outside world.

JIRA: CONTROLLER-2071
Change-Id: Ib670b8ba330e85ed8198c58e4617cd838bcba459
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoRemove atomix.utils.serializer.serializers 23/104723/1
Robert Varga [Thu, 2 Mar 2023 13:20:00 +0000 (14:20 +0100)]
Remove atomix.utils.serializer.serializers

This entire package is only used by Namespace, which in turn is unused.
Remove it to reduce clutter.

JIRA: CONTROLLER-2072
Change-Id: I162e4c6d783d49cb4a209706e193e6d8dc0a0638
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoRemove atomix.utils.Serializer(Builder) 22/104722/1
Robert Varga [Thu, 2 Mar 2023 13:15:54 +0000 (14:15 +0100)]
Remove atomix.utils.Serializer(Builder)

These classes are completely unused and cause confusion with Kryo
interfaces. Remove them to improve clarity.

JIRA: CONTROLLER-2072
Change-Id: Ib4be23d08c1264a9d833d42958311bc24a2fee25
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoFix a few warnings 21/104721/1
Robert Varga [Thu, 2 Mar 2023 13:07:10 +0000 (14:07 +0100)]
Fix a few warnings

Eclipse complains about unaccessed field, which we need for
serialization -- fix that by exposing the class to the entire package.

Also use local variable type inference to remove nullness warning.

Change-Id: Ib37d8e6b5d535c68eb578a67ac980e5de370c94f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoAdd correct license to atomix-storage artifact 19/104719/1
Robert Varga [Thu, 2 Mar 2023 12:15:46 +0000 (13:15 +0100)]
Add correct license to atomix-storage artifact

Override default license packaging with Apache license.

JIRA: CONTROLLER-2071
Change-Id: I41f22660985aa59e1b7050f0205111e5b06393d2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoAdd an explicit LICENSE file 18/104718/1
Robert Varga [Thu, 2 Mar 2023 12:07:36 +0000 (13:07 +0100)]
Add an explicit LICENSE file

atomix-storage is licensed under Apache License, make sure we include
that in the directory.

JIRA: CONTROLLER-2071
Change-Id: I80349d8fbefdb1c0a9ffb1c091e2367a106e5d9d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoRemove SegmentedJournal.Builder.withCacheSize() 17/104717/1
Robert Varga [Thu, 2 Mar 2023 11:53:49 +0000 (12:53 +0100)]
Remove SegmentedJournal.Builder.withCacheSize()

This method is used only in tests and has been deprecated. Remove it.

JIRA: CONTROLLER-2071
Change-Id: I4428b24b7fd4309d8a393ef3f91975abbb48f677
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoUse ConcurrentHashMap.newKeySet() 16/104716/1
Robert Varga [Thu, 2 Mar 2023 11:43:34 +0000 (12:43 +0100)]
Use ConcurrentHashMap.newKeySet()

Java 8 renders the Guava utility superfluous, as we can get a concurrent
Set from ConcurrentHashMap.

JIRA: CONTROLLER-2071
Change-Id: Icde0fb358a736b50eb0c334794de09afcaf1c094
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoUse ConcurrentNavigableMap 15/104715/1
Robert Varga [Thu, 2 Mar 2023 11:40:36 +0000 (12:40 +0100)]
Use ConcurrentNavigableMap

Make sure we mark the map as concurrent, as that is the implementation
we use and it seems we rely on it being concurrent.

JIRA: CONTROLLER-2071
Change-Id: I1deb9e42978fbc6373085e8280822f61541f1066
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoSynchronize SegmentedJournal.open() 14/104714/1
Robert Varga [Thu, 2 Mar 2023 11:37:29 +0000 (12:37 +0100)]
Synchronize SegmentedJournal.open()

SpotBugs is pointing out a problem with synchronization to
currentSegment. This is a false positive, as we only call this method
from the constructor, but slap a synchronized keyword on it anyway.

JIRA: CONTROLLER-2071
Change-Id: Iaf3a13c4122a3321b615eb5629327494165c0bed
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoFix a SpotBugs warning 13/104713/1
Robert Varga [Thu, 2 Mar 2023 11:28:10 +0000 (12:28 +0100)]
Fix a SpotBugs warning

The implementation of queue in KryoIOPool is always
ConcurrentLinkedQueue, which never returns false. Fix the declaration
to make that clear to SpotBugs.

JIRA: CONTROLLER-2071
Change-Id: I0c0dee29224e128413bec9cda903610dbf137feb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoMake SegmentedJournal.Builder final 11/104711/1
Robert Varga [Thu, 2 Mar 2023 11:24:07 +0000 (12:24 +0100)]
Make SegmentedJournal.Builder final

As the SegmentedJournal is final, so should be the builder be. Also hide
its fields, which are used only internally. This allows us to fix a
static analysis warning, as cacheSize() is not used anywhere.

JIRA: CONTROLLER-2071
Change-Id: I2a4d922f3d410db7558969a69d2b64c00811c51f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoMark classes as final 08/104708/2
Robert Varga [Thu, 2 Mar 2023 11:16:13 +0000 (12:16 +0100)]
Mark classes as final

Static analysis is pointing out callouts from constructor to overridable
methods. Mark classes as final to make sure nothing untowards happens.

JIRA: CONTROLLER-2071
Change-Id: I9ed90a8919f3fd72374cb5564b8e241e954bce6e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoFix placeholder mismatch 07/104707/2
Robert Varga [Thu, 2 Mar 2023 11:10:31 +0000 (12:10 +0100)]
Fix placeholder mismatch

There is a bug pointed out by static analysis, as we do not have a
placeholder the passed argument.

JIRA: CONTROLLER-2071
Change-Id: I6892ff8e3046b2476495c9fc0b351f692b396d83
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoEnable spotbugs in atomix-storage 10/104710/1
Robert Varga [Thu, 2 Mar 2023 11:19:10 +0000 (12:19 +0100)]
Enable spotbugs in atomix-storage

Enable static analysis in non-enforcing mode, so issues are pointed out
and can be fixed.

JIRA: CONTROLLER-2071
Change-Id: I891b05f830ba3a6a0e602e7a3467bdcda8f43a4d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoDeprecate MemoryJournalTest 09/104709/2
Robert Varga [Thu, 2 Mar 2023 11:17:35 +0000 (12:17 +0100)]
Deprecate MemoryJournalTest

The StorageLevel this test is using is deprecated, mark the test
deprecated as well.

JIRA: CONTROLLER-2071
Change-Id: I2ce7d207a3a1981acb412858a819eb2e58fe5a2f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoDo not use static import for LoggerFactory.getLogger() 06/104706/1
Robert Varga [Thu, 2 Mar 2023 11:07:05 +0000 (12:07 +0100)]
Do not use static import for LoggerFactory.getLogger()

This is an outlier, the rest of our codebase is using a direct call,
importing LoggerFactory instead.

JIRA: CONTROLLER-2071
Change-Id: I32f7f7440c749760a803865b8f87f5d66ff1cf13
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoEnable modernizer in atomix-storage 05/104705/1
Robert Varga [Thu, 2 Mar 2023 11:05:49 +0000 (12:05 +0100)]
Enable modernizer in atomix-storage

There are only a few checkNotNull() violations, migrate them and enable
modernizer.

JIRA: CONTROLLER-2071
Change-Id: I8182ca3963e69a9029aa2ba458b76d16c4674d8a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoEliminate io.atomix.storage package 04/104704/1
Robert Varga [Thu, 2 Mar 2023 10:57:45 +0000 (11:57 +0100)]
Eliminate io.atomix.storage package

This package hosts only two classes, move them to storage.journal and
tighten Export-Package instruction.

JIRA: CONTROLLER-2071
Change-Id: Ifdd0c7a8dff5fb310d4a44d2e0c3dd71033689ab
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoMove Kryo shading to atomix-storage 03/104703/1
Robert Varga [Thu, 2 Mar 2023 10:39:08 +0000 (11:39 +0100)]
Move Kryo shading to atomix-storage

sal-akka-segmented-journal should not need to deal with Kryo, make sure
we contain the hacks at the source of the problem.

JIRA: CONTROLLER-2071
Change-Id: I0e82b532889babeacd47aade33268886620811d8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoFold atomix-utils into atomix-storage 02/104702/1
Robert Varga [Thu, 2 Mar 2023 10:20:22 +0000 (11:20 +0100)]
Fold atomix-utils into atomix-storage

There is very little value in keeping these two artifacts separate,
combine them to form a single unit.

JIRA: CONTROLLER-2071
Change-Id: I480ce9d050f32d5d843cc5ada90dcf422ee7f7ee
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoEliminate atomix.utils.memory 01/104701/1
Robert Varga [Thu, 2 Mar 2023 10:14:59 +0000 (11:14 +0100)]
Eliminate atomix.utils.memory

There is only one user of BufferCleaner, move this class an eliminate
the now empty package.

JIRA: CONTROLLER-2071
Change-Id: I4ab2e49ad2671fb2cf917223605b0c7e6309c69f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoRemove most of atomix.utils.memory 00/104700/1
Robert Varga [Thu, 2 Mar 2023 10:07:02 +0000 (11:07 +0100)]
Remove most of atomix.utils.memory

We do not need the Memory interface, remove it.

JIRA: CONTROLLER-2071
Change-Id: I0bd43f2a01e58a23fc6c2a4d2a9b93af2ba8b41a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoRemove atomix.storage.buffer 99/104699/1
Robert Varga [Thu, 2 Mar 2023 10:00:10 +0000 (11:00 +0100)]
Remove atomix.storage.buffer

This package is not used anywhere, remove it. This also removes the need
for atomix.utils.concurrent, which we remove as well.

JIRA: CONTROLLER-2071
Change-Id: I0664f6b12e47b04c2c0531c095b3d6e857081f61
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoRemove atomix.storage.statistics 98/104698/1
Robert Varga [Thu, 2 Mar 2023 09:56:14 +0000 (10:56 +0100)]
Remove atomix.storage.statistics

We are not using this package anywhere, remove it.

JIRA: CONTROLLER-2071
Change-Id: I2bda6ae3cec1a1a649151b0d1280725429cb3049
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoUse forked atomix-{storage,utils} 97/104697/1
Robert Varga [Thu, 2 Mar 2023 09:50:33 +0000 (10:50 +0100)]
Use forked atomix-{storage,utils}

Now that we have sufficiently trimmed down imported code, switch to
using it rather than depending on external source.

JIRA: CONTROLLER-2071
Change-Id: Ic73f6cddac8c16bb5bff16626bde5021f5b7b8de
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoRemove AtomixIOException 95/104695/1
Robert Varga [Thu, 2 Mar 2023 08:57:23 +0000 (09:57 +0100)]
Remove AtomixIOException

There is only a single user, which is using a plain RuntimeException
in other places to wrap IOException. Just remove AtomixIOException, as
it has no value.

JIRA: CONTROLLER-2071
Change-Id: Ia7b682c5875e27011b2bdcca4b9712cb9a3c5b5f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoRemove atomix.utils.Builder 94/104694/2
Robert Varga [Thu, 2 Mar 2023 08:37:53 +0000 (09:37 +0100)]
Remove atomix.utils.Builder

There are only two classes implementing this interface and nothing else
relies on it. Remove it.

JIRA: CONTROLLER-2071
Change-Id: I7bec6addac3a9ee67fe7b7647beb0071744aec9f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoRemove atomix.utils.misc 92/104692/1
Robert Varga [Thu, 2 Mar 2023 08:27:01 +0000 (09:27 +0100)]
Remove atomix.utils.misc

The only remnant here is ArraySizeHashPrinter, which is only used in
TestEntry.toString(). Replace its use and ditch the entire package.

JIRA: CONTROLLER-2071
Change-Id: Id4c70fe2d33bbc11c65ab7df6fa2a004affd1c63
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoRemove Indexed.cast() 91/104691/1
Robert Varga [Thu, 2 Mar 2023 08:19:16 +0000 (09:19 +0100)]
Remove Indexed.cast()

This method is not used anywhere and elicits a warnings, remove it.

JIRA: CONTROLLER-2071
Change-Id: I2b7040d3699a3e9a57b82ecdf02508c3df43c491
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoFix raw type warnings 90/104690/2
Robert Varga [Thu, 2 Mar 2023 08:11:39 +0000 (09:11 +0100)]
Fix raw type warnings

We are using a number of generics, make sure to add parameters as
appropriate. Also removes unnecessary raw casts in test code.

JIRA: CONTROLLER-2071
Change-Id: I44a9c6059c0d1de34aba6f483aa871b995c076a9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoRemove superfluous @SuppressWarnings 89/104689/2
Robert Varga [Thu, 2 Mar 2023 08:04:23 +0000 (09:04 +0100)]
Remove superfluous @SuppressWarnings

There are on unchecked conversions convered by these suppressions,
remove them

JIRA: CONTROLLER-2071
Change-Id: I323edfb6657ae09308aebe452c834e2494a2f117
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoRemove AtomixRuntimeException 88/104688/3
Robert Varga [Thu, 2 Mar 2023 08:02:02 +0000 (09:02 +0100)]
Remove AtomixRuntimeException

This class is not really useful, inline its only benefit into its sole
user, AtomixIOException.

JIRA: CONTROLLER-2071
Change-Id: Ie574efd1acedc93a6b973c37370bdb6c95bd304d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoRemove atomix.utils.config 87/104687/3
Robert Varga [Thu, 2 Mar 2023 07:53:37 +0000 (08:53 +0100)]
Remove atomix.utils.config

This package is used only by Namespace(Type)Config, remove it along with
its sole user (which in turn is unused).

JIRA: CONTROLLER-2071
Change-Id: I0ff06853ff25bdb7c477d168fa0b75b5044c011d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoRemove utils.config.Configured 86/104686/1
Robert Varga [Thu, 2 Mar 2023 01:15:59 +0000 (02:15 +0100)]
Remove utils.config.Configured

This interface is not implmmented, remove it.

Change-Id: I64cf1069708aa2d766b58afe64c03bfa0282e33e
JIRA: CONTROLLER-2071
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoRemove io.atomix.utils.Named(Config) 85/104685/2
Robert Varga [Thu, 2 Mar 2023 01:12:41 +0000 (02:12 +0100)]
Remove io.atomix.utils.Named(Config)

These interfaces are not implemented anywhere, remove them.

JIRA: CONTROLLER-2071
Change-Id: I076d124b2ae7c34e43c685512ff849f07763497a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoRemove most of io.atomix.utils.concurrent 84/104684/1
Robert Varga [Thu, 2 Mar 2023 01:00:14 +0000 (02:00 +0100)]
Remove most of io.atomix.utils.concurrent

Most of the stuff in the concurrent package is not used, remove it.

JIRA: CONTROLLER-2071
Change-Id: Ife0ea74b9327075dac9dfb605364bf2a9301362f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoRemove most of atomix.utils.* 83/104683/1
Robert Varga [Thu, 2 Mar 2023 00:54:33 +0000 (01:54 +0100)]
Remove most of atomix.utils.*

Most of the defined interfaces are not used anywhere, remove them.

JIRA: CONTROLLER-2071
Change-Id: Iffa3fc760be89752868249f7e8eb189e231f8006
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoRemove atomix.utils.Generics 82/104682/1
Robert Varga [Thu, 2 Mar 2023 00:51:15 +0000 (01:51 +0100)]
Remove atomix.utils.Generics

This class is not used anywhere, remove it.

JIRA: CONTROLLER-2071
Change-Id: I592727427e4604953f59fddb87f92c398c13c001
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoRemove {Atomix,Ordered}Future 81/104681/1
Robert Varga [Thu, 2 Mar 2023 00:27:48 +0000 (01:27 +0100)]
Remove {Atomix,Ordered}Future

These classes are unused, remove them

JIRA: CONTROLLER-2071
Change-Id: I14a2b31a035739debe6168dd5b5f2d060acd61a3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>