mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-09-20 12:45:35 +00:00
ensure in-order delivery of messages from replica to master;
always pass operations to be sent to master into the queue so they cannot be delivered to the master earlier than other queued operations after connectivity has been restored Change-Id: I7b1409dc4663659039058ce2c0511a26009114b4
This commit is contained in:
+6
-6
@@ -29,7 +29,7 @@ import com.sap.sse.replication.OperationWithResultWithIdWrapper;
|
||||
import com.sap.sse.replication.OperationsToMasterSender;
|
||||
import com.sap.sse.replication.ReplicationMasterDescriptor;
|
||||
import com.sap.sse.replication.ReplicationService;
|
||||
import com.sap.sse.replication.UnsentOperationsToMasterSender;
|
||||
import com.sap.sse.replication.OperationsToMasterSendingQueue;
|
||||
|
||||
/**
|
||||
* Implements {@link ServiceTrackerCustomizer} so that all {@link FileStorageServices} announced in the registry can
|
||||
@@ -61,10 +61,10 @@ public class FileStorageManagementServiceImpl implements ReplicableFileStorageMa
|
||||
/**
|
||||
* This field is expected to be set by the {@link ReplicationService} once it has "adopted" this replicable.
|
||||
* The {@link ReplicationService} "injects" this service so it can be used here as a delegate for the
|
||||
* {@link UnsentOperationsToMasterSender#retrySendingLater(OperationWithResult, OperationsToMasterSender)}
|
||||
* {@link OperationsToMasterSendingQueue#scheduleForSending(OperationWithResult, OperationsToMasterSender)}
|
||||
* method.
|
||||
*/
|
||||
private UnsentOperationsToMasterSender unsentOperationForMasterQueue;
|
||||
private OperationsToMasterSendingQueue unsentOperationForMasterQueue;
|
||||
|
||||
public FileStorageManagementServiceImpl(TypeBasedServiceFinder<FileStorageService> serviceFinder,
|
||||
FileStorageServicePropertyStore propertyStore) {
|
||||
@@ -248,15 +248,15 @@ public class FileStorageManagementServiceImpl implements ReplicableFileStorageMa
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setUnsentOperationToMasterSender(UnsentOperationsToMasterSender service) {
|
||||
public void setUnsentOperationToMasterSender(OperationsToMasterSendingQueue service) {
|
||||
this.unsentOperationForMasterQueue = service;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S, O extends OperationWithResult<S, ?>, T> void retrySendingLater(
|
||||
public <S, O extends OperationWithResult<S, ?>, T> void scheduleForSending(
|
||||
OperationWithResult<S, T> operationWithResult, OperationsToMasterSender<S, O> sender) {
|
||||
if (unsentOperationForMasterQueue != null) {
|
||||
unsentOperationForMasterQueue.retrySendingLater(operationWithResult, sender);
|
||||
unsentOperationForMasterQueue.scheduleForSending(operationWithResult, sender);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user