Remove ask-based protocol client Remove the use-tell-based-protocol knob, effectively making it always true. This means DistributedDataStore cannot be instantiated, which leads to its removal. That in turn makes all of DatastoreContext, OperationLimiter and similar classes superfluous, so we remove those as well. A few classes are used to drive the shard backend in integration tests, and hence those are moved to test sources. JIRA: CONTROLLER-2054 Change-Id: Ie20b1c898576d3c89b70b34121310e58faddbf8e Signed-off-by: bentom-binoy <bentom.binoy@infosys.com> Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Remove ask-based datastore integration tests Eliminate DistributedDataStore as an argument. JIRA: CONTROLLER-2054 Change-Id: If44dd72706c028f5d3901a759549fec27257d5d3 Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Obsolete ask-based protocol Mark the switch to use ask-based protocol obsolete and deprecate all classes implementing it. JIRA: CONTROLLER-2053 Change-Id: Ib0f5d6a946090addde255423d51746a52e785b2a 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>
Convert CDS implementation to use msdal APIs The LegacyDOMDataBrokerAdapter is the proxy for the controller API. Change-Id: I697e2979bef4dcffe544717af1380aa7d7b89d50 Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
Bug 7521: Move DatastoreSnapshotList et al to persisted package The serialized format of DatastoreSnapshotList et al will be changing so new classes were added to the persisted package in preparation. The current classes are deprecated and will readResolve to the new classes. Change-Id: Ib6aa600a71f52253b93ab0e4a82f6f56baafbfd9 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>
BUG-5280: add SimpleDataStoreClientBehavior Module-based sharding has a more complex run-time strategy than the CDT sharding, which instantiates a client-per-shard. Create a dedicated behavior and resolver to take advantage of this simplification. Change-Id: I289e0c8d914f1ab9a9d8992b4f3a7bd4451af3f9 Signed-off-by: Robert Varga <rovarga@cisco.com>
Fix FindBugs warnings in sal-distributed-datastore and enable enforcement Several warnings were suppressed via annotation with justification provided. Other warnings that were fixed: - remove redundant implements in several classes - "The referenced methods have names that differ only by capitalization" warnings. This is checked across all classes for consistency. The main offender was getTransactionID vs. getTransactionId. I changed all methods to getTransactionId and associated fields to transactionId. - unsynchronized access to a field where access is synchronized elsewhere (in DataTreeChangeListenerProxy and DatastoreContextIntrospector). - catching Exception instead of catching more specific exception types that are thrown from the try block. - unconfirmed casts - verify via Preconditions check to avoid warning - unnecessarily calling toString() on a String instance - synchronizing an AtomicInteger instance (in ThreePhaseCommitCohortProxy) - not an issue in this case but changed to synchronize a separate Object in lieu of supressing the warning. - unsynchronized to SimpleDateFormat which isn't thread-safe (in ShardStats). - potential null-pointer access of 'shard' in ShardStats - changed to pass 'shard' to the ctor in lieu of setter. - calling String#getBytes w/o specifying encoding (in DataTreeModificationOutput). - privileged access to create ClassLoader in ActorSystemProviderImpl although not likely a SecurityManager would ever be present. Change-Id: I0a87208f3f200fbe4f78e950c21419fbab154d94 Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
Fix warnings/javadocs in sal-distributed-datastore First off, I apologize for the size of this patch. There's a ton of classes in this project and I didn't even get to all of them (will follow-up). While a lot of files were touched, the changes were mostly small. Fixed a lot of checkstyle warnings and cleaned up javadocs. 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) - variable name too short - indentation - missing period after first sentence in javadoc - missing first sentence in javadoc - missing <p/> in javadoc Change-Id: Id56d874a8fbcbbc9285279a71c0a5aba393653a9 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: add BackendInfo/BackendInfoResolver Client actor needs to be able to resolve a particular backend so it can implement retry logic with request adaptation. Add the baseline class and an implementation for current sharding. Change-Id: Ic7b679b1cadaff130b3a266606fe48cad5c20614 Signed-off-by: Robert Varga <rovarga@cisco.com>
BUG-5280: switch transactionIdentifier This eliminates datastore-internal TransactionIdentifier in favor of the concept one, which is structured. Since the structured identifier also includes LocalHistoryIdentifier, this eliminates also ChainedTransactionIdentifier. Change-Id: Iabfa2ddd7aadd1e4913115f342e520ffaa8b84f0 Signed-off-by: Robert Varga <rovarga@cisco.com>
BUG-5280: introduce DistributedDataStoreClientActor This patch introduces a common ClientActor, which keeps track of frontend generations. Also introduce bind for DistributedDataStore, which uses this common infrastructure. Interface between the DistributedDataStore and the actor world is captured as DistributedDataStoreClient. Change-Id: I42c3281ca790fb5615a593740424ac494469e6a7 Signed-off-by: Robert Varga <rovarga@cisco.com>
Eliminate unneeded String.format() Logger already supports formatting strings, no need to pre-format them. Change-Id: Iea96443126bad0ca483ec0cc775d081384028497 Signed-off-by: Robert Varga <rovarga@cisco.com>
Bug 1435: CDS: Added support for custom commit cohort. Implemented support for user provided commit cohorts, which implements DOMDataTreeCommitCohort interface contract. Messages are only in-JVM so cohort needs to be colocated with replica. Change-Id: I04e592c0232383e70fa8944b966b1aa341730a98 Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
Modify config Module impls to co-exist with blueprint Modified various config system Module implementation classes which have corresponding instances created and advertised via blueprint to obtain the instance in createInstance from the OSGi registry. The instance may not be available yet so it will wait. I added a WaitingServiceTracker class to encapsulate this logic using a ServiceTracker. For those modules that don't advertise services, createInstance simply returns a noop AutoCloseable since the components are created via blueprint. I also added the new disable-osgi-service-registration flag to the corresponding service yang identities to prevent the CSS from duplicating the service registrations. This patch also adds the blueprint bundle to the mdsal features and "turns on" blueprint. Change-Id: I60099c82a2a248fc233ad930c4808d6ab19ea881 Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
Split out AbstractBuilder and rename it This is a DTO-like class, not really a Builder with .build() method. Split it out of its enclosing class and rename it to AbstractShardManagerCreator. Change-Id: I891fc685c2d9776384294a708336b32eb34011b5 Signed-off-by: Robert Varga <rovarga@cisco.com>
Move ShardManager into its own package ShardManager contains quite a few classes, which are not used by the rest of the data store. Some of them are in their own files, some of them are hosted in ShardManager.java. This first step allows us to isolate related functionality without leaking it to the rest of the package, separating internal an external interfaces. Change-Id: I955296d739d962d912eadf0507c317b0a8e71deb Signed-off-by: Robert Varga <rovarga@cisco.com>
Bug 4823: Offload generation of DCNs from Shard Generation of data change notifications can be expensive with large lists which can block the Shard actor for many seconds. This processing was offloaded to other actors to free up the Shard, one for DCLs and the other for DTCLs. I separated the 2 types of listeners b/c DCN generation is much more expensive than DTCs so at least DTCLs aren't held up by DCLs. Change-Id: I1bfb5d572c793f8eb703ebf0a7fd9bf628747168 Signed-off-by: Tom Pantelis <tpanteli@brocade.com>