XComp commented on a change in pull request #13313:
URL: https://github.com/apache/flink/pull/13313#discussion_r489595830



##########
File path: 
flink-mesos/src/main/java/org/apache/flink/mesos/runtime/clusterframework/MesosResourceManagerDriver.java
##########
@@ -739,172 +591,123 @@ static ResourceID extractResourceID(Protos.TaskID 
taskId) {
                }
        }
 
-       /**
-        * Creates the Fenzo optimizer (builder).
-        * The builder is an indirection to facilitate unit testing of the 
Launch Coordinator.
-        */
-       private static TaskSchedulerBuilder createOptimizer() {
-               return new TaskSchedulerBuilder() {
-                       TaskScheduler.Builder builder = new 
TaskScheduler.Builder();
-
-                       @Override
-                       public TaskSchedulerBuilder 
withLeaseRejectAction(Action1<VirtualMachineLease> action) {
-                               builder.withLeaseRejectAction(action);
-                               return this;
-                       }
-
-                       @Override
-                       public TaskSchedulerBuilder 
withRejectAllExpiredOffers() {
-                               builder.withRejectAllExpiredOffers();
-                               return this;
-                       }
+       private static String extractTerminatedDiagnostics(ResourceID id, 
Protos.TaskStatus status) {
+               return String.format("Worker %s terminated with status: %s, 
reason: %s, message: %s.",
+                               id, status.getState(), status.getReason(), 
status.getMessage());
+       }
 
-                       @Override
-                       public TaskSchedulerBuilder 
withLeaseOfferExpirySecs(long leaseOfferExpirySecs) {
-                               
builder.withLeaseOfferExpirySecs(leaseOfferExpirySecs);
-                               return this;
-                       }
+       private static TaskSchedulerBuilder createOptimizer() {
+               return new TaskSchedulerBuilderImpl();
+       }
 
-                       @Override
-                       public TaskScheduler build() {
-                               return builder.build();
-                       }
-               };
+       @VisibleForTesting
+       void assertStateCleared() {
+               assert(workersInNew.isEmpty());
+               assert(requestResourceFutures.isEmpty());

Review comment:
       Exactly. I came across this code segment when going through 
`MesosResourceManagerDriverTest::testClearStateAfterRevokeLeadership`.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to