You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by tr...@apache.org on 2021/07/14 14:55:28 UTC
[flink] 28/33: [FLINK-22477] Remove
SlotPool.failAllocation(AllocationID, Exception)
This is an automated email from the ASF dual-hosted git repository.
trohrmann pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git
commit 91fa631f263c2c0215f63047d968e5828242d8a7
Author: Till Rohrmann <tr...@apache.org>
AuthorDate: Tue Jul 13 17:49:13 2021 +0200
[FLINK-22477] Remove SlotPool.failAllocation(AllocationID, Exception)
This commit removes the SlotPool.failAllocation(AllocationID, Exception) method that has
only been used by the removed SlotPoolImpl.
---
.../runtime/jobmaster/slotpool/DeclarativeSlotPoolBridge.java | 7 -------
.../org/apache/flink/runtime/jobmaster/slotpool/SlotPool.java | 9 ---------
.../java/org/apache/flink/runtime/jobmaster/JobMasterTest.java | 6 ------
.../runtime/jobmaster/slotpool/SlotPoolBatchSlotRequestTest.java | 5 ++---
4 files changed, 2 insertions(+), 25 deletions(-)
diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/jobmaster/slotpool/DeclarativeSlotPoolBridge.java b/flink-runtime/src/main/java/org/apache/flink/runtime/jobmaster/slotpool/DeclarativeSlotPoolBridge.java
index de1f4ca..1d281bb 100644
--- a/flink-runtime/src/main/java/org/apache/flink/runtime/jobmaster/slotpool/DeclarativeSlotPoolBridge.java
+++ b/flink-runtime/src/main/java/org/apache/flink/runtime/jobmaster/slotpool/DeclarativeSlotPoolBridge.java
@@ -22,7 +22,6 @@ import org.apache.flink.annotation.VisibleForTesting;
import org.apache.flink.api.common.JobID;
import org.apache.flink.api.common.time.Time;
import org.apache.flink.runtime.clusterframework.types.AllocationID;
-import org.apache.flink.runtime.clusterframework.types.ResourceID;
import org.apache.flink.runtime.clusterframework.types.ResourceProfile;
import org.apache.flink.runtime.concurrent.ComponentMainThreadExecutor;
import org.apache.flink.runtime.jobmanager.scheduler.NoResourceAvailableException;
@@ -299,12 +298,6 @@ public class DeclarativeSlotPoolBridge extends DeclarativeSlotPoolService implem
}
@Override
- public Optional<ResourceID> failAllocation(AllocationID allocationID, Exception cause) {
- throw new UnsupportedOperationException(
- "Please call failAllocation(ResourceID, AllocationID, Exception)");
- }
-
- @Override
protected void onFailAllocation(ResourceCounter previouslyFulfilledRequirements) {
getDeclarativeSlotPool().decreaseResourceRequirementsBy(previouslyFulfilledRequirements);
}
diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/jobmaster/slotpool/SlotPool.java b/flink-runtime/src/main/java/org/apache/flink/runtime/jobmaster/slotpool/SlotPool.java
index 6f263e4..11eb46e 100644
--- a/flink-runtime/src/main/java/org/apache/flink/runtime/jobmaster/slotpool/SlotPool.java
+++ b/flink-runtime/src/main/java/org/apache/flink/runtime/jobmaster/slotpool/SlotPool.java
@@ -111,15 +111,6 @@ public interface SlotPool extends AllocatedSlotActions, AutoCloseable {
TaskManagerGateway taskManagerGateway,
Collection<SlotOffer> offers);
- /**
- * Fails the slot with the given allocation id.
- *
- * @param allocationID identifying the slot which is being failed
- * @param cause of the failure
- * @return An optional task executor id if this task executor has no more slots registered
- */
- Optional<ResourceID> failAllocation(AllocationID allocationID, Exception cause);
-
// ------------------------------------------------------------------------
// allocating and disposing slots
// ------------------------------------------------------------------------
diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/jobmaster/JobMasterTest.java b/flink-runtime/src/test/java/org/apache/flink/runtime/jobmaster/JobMasterTest.java
index f274e2f..195692b 100644
--- a/flink-runtime/src/test/java/org/apache/flink/runtime/jobmaster/JobMasterTest.java
+++ b/flink-runtime/src/test/java/org/apache/flink/runtime/jobmaster/JobMasterTest.java
@@ -494,12 +494,6 @@ public class JobMasterTest extends TestLogger {
"TestingSlotPool does not support this operation.");
}
- @Override
- public Optional<ResourceID> failAllocation(AllocationID allocationID, Exception cause) {
- throw new UnsupportedOperationException(
- "TestingSlotPool does not support this operation.");
- }
-
@Nonnull
@Override
public Collection<SlotInfoWithUtilization> getAvailableSlotsInformation() {
diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/jobmaster/slotpool/SlotPoolBatchSlotRequestTest.java b/flink-runtime/src/test/java/org/apache/flink/runtime/jobmaster/slotpool/SlotPoolBatchSlotRequestTest.java
index 0f1b7e4..011f255 100644
--- a/flink-runtime/src/test/java/org/apache/flink/runtime/jobmaster/slotpool/SlotPoolBatchSlotRequestTest.java
+++ b/flink-runtime/src/test/java/org/apache/flink/runtime/jobmaster/slotpool/SlotPoolBatchSlotRequestTest.java
@@ -20,7 +20,6 @@ package org.apache.flink.runtime.jobmaster.slotpool;
import org.apache.flink.api.common.time.Time;
import org.apache.flink.core.testutils.FlinkMatchers;
-import org.apache.flink.runtime.clusterframework.types.AllocationID;
import org.apache.flink.runtime.clusterframework.types.ResourceID;
import org.apache.flink.runtime.clusterframework.types.ResourceProfile;
import org.apache.flink.runtime.concurrent.ComponentMainThreadExecutor;
@@ -136,8 +135,8 @@ public class SlotPoolBatchSlotRequestTest extends TestLogger {
}
/**
- * Tests that a batch slot request does react to {@link SlotPool#failAllocation(AllocationID,
- * Exception)} signals whose exception is {@link UnfulfillableSlotRequestException}.
+ * Tests that a batch slot request does react to {@link
+ * SlotPoolService#notifyNotEnoughResourcesAvailable}.
*/
@Test
public void testPendingBatchSlotRequestFailsIfAllocationFailsUnfulfillably() throws Exception {