Fix backward compatibility check

Avoid flagging methods as deleted if it is marked
synchronized. Also mark a few more interfaces as internal.
This commit is contained in:
Aravinda Kidambi Srinivasan 2024-11-12 10:23:55 -08:00
parent 6acb51d66e
commit c53665fc0b
5 changed files with 17 additions and 5 deletions

View file

@ -58,14 +58,18 @@ is_non_public_class() {
return $?
}
# Ignore methods that change from abstract to non-abstract (and vice versa) if the class is an interface.
ignore_abstract_changes_in_interfaces() {
# Ignore methods that change from abstract to non-abstract (and vice-versa) if the class is an interface.\
# Ignore methods that change from synchronized to non-synchronized (and vice-versa)
ignore_non_breaking_changes() {
local current_class="$1"
local class_definition=$(javap -classpath "$LATEST_JAR" "$current_class" | head -2 | tail -1)
if [[ $class_definition == *"interface"* ]]
then
LATEST_METHODS=${LATEST_METHODS// abstract / }
CURRENT_METHODS=${CURRENT_METHODS// abstract / }
LATEST_METHODS=${LATEST_METHODS//abstract /}
CURRENT_METHODS=${CURRENT_METHODS//abstract /}
else
LATEST_METHODS=${LATEST_METHODS//synchronized /}
CURRENT_METHODS=${CURRENT_METHODS//synchronized /}
fi
}
@ -103,7 +107,7 @@ find_removed_methods() {
LATEST_METHODS=$(javap -classpath "$LATEST_JAR" "$class")
ignore_abstract_changes_in_interfaces "$class"
ignore_non_breaking_changes "$class"
local removed_methods=$(diff <(echo "$LATEST_METHODS") <(echo "$CURRENT_METHODS") | grep '^<')

View file

@ -17,8 +17,10 @@ package software.amazon.kinesis.coordinator.assignment;
import java.util.List;
import software.amazon.kinesis.annotations.KinesisClientInternalApi;
import software.amazon.kinesis.leases.Lease;
@KinesisClientInternalApi
public interface LeaseAssignmentDecider {
/**

View file

@ -14,11 +14,13 @@
*/
package software.amazon.kinesis.coordinator.migration;
import software.amazon.kinesis.annotations.KinesisClientInternalApi;
import software.amazon.kinesis.leases.exceptions.DependencyException;
/**
* Interface of a state implementation for the MigrationStateMachine
*/
@KinesisClientInternalApi
public interface MigrationClientVersionState {
/**

View file

@ -14,6 +14,7 @@
*/
package software.amazon.kinesis.coordinator.migration;
import software.amazon.kinesis.annotations.KinesisClientInternalApi;
import software.amazon.kinesis.leases.exceptions.DependencyException;
import software.amazon.kinesis.leases.exceptions.InvalidStateException;
@ -28,6 +29,7 @@ import software.amazon.kinesis.leases.exceptions.InvalidStateException;
* 3. Instant roll-forwards - Once any issue has been mitigated, rollfowards are supported instantly
* with KCL Migration tool.
*/
@KinesisClientInternalApi
public interface MigrationStateMachine {
/**
* Initialize the state machine by identifying the initial state when the KCL worker comes up for the first time.

View file

@ -17,10 +17,12 @@ package software.amazon.kinesis.leases;
import java.util.List;
import software.amazon.kinesis.annotations.KinesisClientInternalApi;
import software.amazon.kinesis.leases.exceptions.DependencyException;
import software.amazon.kinesis.leases.exceptions.InvalidStateException;
import software.amazon.kinesis.leases.exceptions.ProvisionedThroughputException;
@KinesisClientInternalApi
public interface LeaseDiscoverer {
/**
* Identifies the leases that are assigned to the current worker but are not being tracked and processed by the