Remove ABIVersion.MAGNESIUM This ABI versions is quite inefficient in its serialization and has been deprecated in the previous release. This patch completes its removal. JIRA: CONTROLLER-2062 Change-Id: I03be0d6561c4db2893e6eb0fd95e3a35e655b76e Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Deprecate ABIVersion.MAGNESIUM This version is using inefficient Externalizable proxy and has been supersed by CHLORINE_SR2. Deprecate it for removal and old proxies as deprecated as well. JIRA: CONTROLLER-2061 Change-Id: I0959f88d759d2aad33e16e13e9fefe34cd51a740 Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Add new cds-access-api proxies Externalizable serialization format record class hierarchy, which leads to significant overheads. This patch introduces proxies which are are flat, i.e. have java.Object as their superclass, eliminating this overhead. The way we do this is we defined SerialForm interfaces which extend Externalizable and define the serialization protocol in terms of default methods. We then define a bunch of classes which are pure data holders implementing individual SerialForms. Also ensure messages properly implement cloneAsVersion() to propagate the target version, now that it matters for them. Finally audit use of java.io.Serial so that we do not import it -- it is just pure overhead vs. using @java.io.Serial directly. JIRA: CONTROLLER-2051 Change-Id: I01132665027687edc1c6d44dda8a6ab0cab6ad6a Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
More cds-access-api cleanup Fixup previous patch and sprinkle more @Serial annotations. Change-Id: I74414861197bb417dadc445ebc3fc2703a97ea4d Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Sprinkle @NonNull annotations We have a few return methods which could use @NonNull annotations, sprinkle them around. Change-Id: I48c0f8879127673eb122321dd6c92d4572098f68 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>
Fix CS warnings in cds-access-api and enable enforcement Fixed checkstyle warnings and enabled enforcement. Most of the warnings/changes were for: - variable name too short - correct ordering of @Nonnull annotations - line too long - suppressing CS RedundantModifier warning for ctors where public is needed for packaged-scoped classes that implement Externalizable - adding protected to ctors for packaged-scoped abstract classes that implement Externalizable to avoid CS RedundantModifier warning - local vars/params hiding a field - putting overloaded methods close to one another Change-Id: Ib85e15f21118f3484ccb8e945e8257ae3e3278bc Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
BUG-5280: separate request sequence and transmit sequence Clean up the confusion in sequence numbers. There are actually two sequences: - logical request sequence, which indicates the order of requests in which they should be applied to the target entity. It is assigned by logic emitting the request. - transmit sequence within a connection to the backend, as initiated by ConnectClientRequest. It is assigned by SequencedQueue as it is transmitting requests and reset when a new connection to the backend is made. This requires establishing the concept of a session, which is a single conversation between frontend and backend. It is severed whenever the frontend times out and re-established when the leader is found and it responds with ConnectClientSuccess. The sending of ConnectClientRequest is not done via the queue, as it is part of backend resolution process. Since this is not a performance-critical path, we use simple Patterns.ask() to send the request and get completion notification -- which we then translate to ShardBackendInfo. ConnectClientSuccess gives us backend-preferred version and backend-specified cap on the number of outstanding messages then it can handle concurrently. This maximum is used to limit the transmit path of SequencedQueue, so that it does not attempt to send more requests at any given time. Internal queue for unsent requests is kept unbounded for now, subject to a Semaphore-driven throttle in a follow-up patch. Change-Id: I61663073bf6632c1ed8c036dee37f1ac39cf7794 Signed-off-by: Robert Varga <rovarga@cisco.com>
BUG-5280: introduce request/response Envelope This is a follow-up patch to move sequence information from request/response structure and making it part of an Envelope, which is allocated by the SequencedQueue. Change-Id: I341118850d9c5835bab0b491f59b95264f31e5ef Signed-off-by: Robert Varga <rovarga@cisco.com>