}
void releaseSubSlot(SubSlot subslot, SharedSlot sharedSlot) {
AbstractID groupId = subslot.getGroupId();
synchronized (lock) {
if (!allSlots.contains(sharedSlot)) {
throw new IllegalArgumentException("Slot was not associated with this SlotSharingGroup before.");
}
int slotsRemaining = sharedSlot.releaseSlot(subslot);
if (slotsRemaining == 0) {
// this was the last sub slot. remove this from the availability list
// and trigger disposal
try {
allSlots.remove(sharedSlot);
Instance location = sharedSlot.getAllocatedSlot().getInstance();
if (groupId != null) {
for (Map.Entry<AbstractID, Map<Instance, List<SharedSlot>>> mapEntry : availableSlotsPerJid.entrySet()) {
AbstractID id = mapEntry.getKey();
// hack: we identify co location hint entries by the fact that they are keyed
// by an abstract id, rather than a job vertex id
if (id.getClass() == AbstractID.class || id.equals(groupId)) {
continue;
}
Map<Instance, List<SharedSlot>> map = mapEntry.getValue();
List<SharedSlot> list = map.get(location);