Specialize tests to ClientBackedDataStore We have only one subclass of AbstractDataStore, use that instead of AbstractDataStore. Change-Id: Ia6552b1c050fb99e3084c2d8f5c36ea052e991be Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Switch MemberNode to ClientBackedDatastore DistributedDataStore is on its way out, switch to using the sole AbstractDataStore implementation. JIRA: CONTROLLER-2054 Change-Id: I5a8ee344c56a7a768c373ffa4bc489ef249529ff Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Bump akka to 2.6.12 Release notes: https://akka.io/blog/news/2019/11/06/akka-2.6.0-released https://akka.io/blog/news/2019/12/06/akka-2.6.1-released https://akka.io/blog/news/2020/01/27/akka-2.6.2-released https://akka.io/blog/news/2020/01/28/akka-2.6.3-released https://akka.io/blog/news/2020/03/13/akka-2.6.4-released https://akka.io/blog/news/2020/04/30/akka-2.6.5-released https://akka.io/blog/news/2020/06/08/akka-2.6.6-released-split-brain-resolver https://akka.io/blog/news/2020/07/10/akka-2.6.7-released https://akka.io/blog/news/2020/07/16/akka-2.6.8-released https://akka.io/blog/news/2020/09/09/akka-2.6.9-released https://akka.io/blog/news/2020/10/09/akka-2.6.10-released https://akka.io/blog/news/2021/01/15/akka-2.6.11-released https://akka.io/blog/news/2021/01/28/akka-2.6.12-released JIRA: CONTROLLER-1962 Change-Id: Ibbfc11a8ca27a8c09337bf49de910c38a9239886 Signed-off-by: tadei.bilan <tadei.bilan@pantheon.tech> Signed-off-by: Robert Varga <robert.varga@pantheon.tech> Signed-off-by: Oleksii Mozghovyi <oleksii.mozghovyi@pantheon.tech>
Bump odlparent/yangtools/mdsal Update upstream references to: - odlparent-7.0.1 - yangtools-5.0.0-SNAPSHOT - mdsal-6.0.0-SNAPSHOT Also adjust the codebase to match changes in yangtools/mdsal and scala-2.13. Change-Id: Ib082e955b5106fa002522dfe3d7a21fe990006d8 Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Fix modernization issues This fixes issues pointed out by Modernizer, which mostly boil down to using Objects.requireNonNull() and direct java.util collections. Change-Id: Id32530a6722cd101f96c23f6a745f91b2f09e2f9 Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Migrate ActorUtils to java.util.Optional This migrates ActorUtils to Java 8 Optional, updating its users. Change-Id: I0ec900d16bf44b2ab8ae48d8a72f2b63fa633312 Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Rename ActorContext to ActorUtils ActorContext is overloaded name even within Akka, without us adding to it. Furthermore Akka's AbstractActor defines ActorContext as its nested class, which thoroughly breaks resolution priorities. Rename ActorContext to ActorUtils, reducing confusion around class uses. Change-Id: I140239a8f74ee7deecf9ee848df0cfbbb72f3c4d Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Reduce use of scala.concurrent.duration.Duration In most of the places we really are talking about a FiniteDuration, hence use that class directly where it is an internal detail. Aside from providing clarity, this also reduces potential confusion with java.time.Duration. Change-Id: I57d84c5ca058cfc6fa56ce57ebb0c8d4d3864a3a Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
BUG-5280: switch tests to ClientBackedDataStore Enable integration tests to run on the new frontend code with parametrized JUNIT. Not working tests for new code are ignored. For old code all tests run and pass. Change-Id: Ib5656ecd2333a56d5c466e633fbdd477accc4095 Signed-off-by: Robert Varga <rovarga@cisco.com> Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
Use Akka artery for remote transport This transport is introduced in 2.4.11 and is supposed to be faster than the TCP transport. Enabled it globally so we can evaluate it. Change-Id: I25234f82ac056700e8b56abaeb452c53ec5b9dbd Signed-off-by: Robert Varga <rovarga@cisco.com> Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
BUG-5280: split DistributedDataStore Split the DistributedDataStore into two components into an abstract base class and concretization running with TransactionProxies. Add another concretization, which uses DataStoreClient to instantiate requests. Change-Id: I454eec76d54c2fd4e4ea1e5cd16d12398eec81f0 Signed-off-by: Robert Varga <rovarga@cisco.com>
Fix unit test CS warnings in sal-distributed-datastore Fixed checkstyle warnings in unit tests. Most of the warnings/changes were for: - white space before if/for/while/catch - white space before beginning brace - line too long - illegal catching of Exception (suppressed) - illegal throwing of Throwable (changed to Exception) - variable name too short - indentation, mostly due to nested code inside anonymous JavaTestKit instances - separator wrapping: '.', '+', '&&' should be on a new line - local vars/params hiding a field - putting overloaded methods close to one another - remove unused vars - convert functional interfaces to lambdas (eclipse save action) - adding final for locals declared too far from first usage Also 3 classes are no longer used so I removed them rather than fix warnings. Change-Id: Ie1507e36c67a2b58f7efb62378212976b962f9fe Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
Mechanical code cleanup (sal-distributed-datastore) * Remove unnecessary type specifiers (use Java 7 <>) * Remove unnecessary "extends Object" declarations * Remove unnecessary semi-colons * Merge identical catch blocks * Remove redundant modifiers: - enum constructors are private by default - interface properties are public static final by default - interface methods are public abstract by default - interfaces are abstract by default - inner interfaces are static by default - inner classes in interfaces are public static by default Change-Id: I3eb023d9f5b34ce83e69c746efd1ff464bfd6789 Signed-off-by: Stephen Kitt <skitt@redhat.com>
BUG-5280: make sure all DistributedDataStore instances are shut down Fix up instantiation sites to eventually close the data store instance they have created. Change-Id: Ib71531c0263197209db6ec7de4f6c92d60db3d1d Signed-off-by: Robert Varga <rovarga@cisco.com>
BUG-5626: Eliminate ShardIdentifier.Builder This builder is completely useless, migrate it to static factory methods, which provide equivalent functionality. Change-Id: Ib2b5a1b14cb133bd819b3e163c217a05ed892787 Signed-off-by: Robert Varga <rovarga@cisco.com>
BUG-5280: use MemberName instead of String Codebase uses Strings to identify various entities throughout the code. Since we have introduced MemberName as an Identifier, use that instead of a plain string to improve type safety and clarity throughout users. Change-Id: Iace25ef2c7cda0ea94449d1543d4ca73b80fb591 Signed-off-by: Robert Varga <rovarga@cisco.com>
Fix static methods and convert to lambdas This fixes warnings about static methods and as an auto-save action, converts functional interface implementations to lambdas. Change-Id: Id4486516282685fb85f9cfc6e512096662475d53 Signed-off-by: Robert Varga <rovarga@cisco.com>
Fix intermittent failures in DistributedDataStoreRemotingIntegrationTest testTransactionRetryWithInitialAskTimeoutExOnCreateTx has failed a couple times on jenkins. After leader shutdown it times out trying to elect a new leader. This is b/c the time outs set are small for the test and it sometimes runs quick enough before member-3 has actually joined the cluster. So I added calls to wait for members to join the cluster before running the test. Change-Id: I4dabaffd3ace9082d46b27d78608df6d2f29734c Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
Bug 4992: Removed old leader's candidates on leader change Modified onLeaderChanged to call removeCandidateFromEntities same as onPeerDown. Change-Id: I9b56e64254485fa0de4fdc1b7f4f6ddf100338af Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
Remove deprecated getDataStoreType methods getDataStoreName methods were recently added to DatastoreContext and ActorContext to replace the getDataStoreType methods. The latter were marked as deprecated but we can remove them since they aren't public APIs outside of the context of sal-distributed-datastore. The remaining callers were migrated to the getDataStoreName methods. Change-Id: I7dab731d96b3b8c249a59824de4d78ea72500e05 Signed-off-by: Tom Pantelis <tpanteli@brocade.com>