package io.cattle.platform.allocator.eventing.impl;

import io.cattle.platform.allocator.eventing.AllocatorService;
import io.cattle.platform.allocator.service.Allocator;
import io.cattle.platform.core.model.Instance;
import io.cattle.platform.core.model.Volume;

import javax.inject.Inject;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class AllocatorServiceImpl implements AllocatorService {

    private static final Logger log = LoggerFactory.getLogger(AllocatorServiceImpl.class);

    @Inject
    Allocator allocator;

    @Override
    public void instanceAllocate(Instance instance) {
        log.info("Allocating instance [{}]", instance.getId());
        allocator.allocate(instance);
        log.info("Allocator [{}] handled request for instance [{}]", allocator, instance.getId());
    }

    @Override
    public void instanceDeallocate(Instance instance) {
        log.info("Deallocating instance [{}]", instance.getId());
        allocator.deallocate(instance);
        log.info("Deallocator [{}] handled request for instance [{}]", allocator, instance.getId());
    }

    @Override
    public void ensureResourcesReservedForStart(Instance instance) {
        log.info("Ensuring resources reserved for instance.start [{}]", instance.getId());
        allocator.ensureResourcesReserved(instance);
        log.info("Ensured resources released for instance.start [{}]", instance.getId());
    }

    @Override
    public void ensureResourcesReleasedForStop(Instance instance) {
        log.info("Ensuring resources released for stop for instance [{}]", instance.getId());
        allocator.ensureResourcesReleased(instance);
        log.info("Ensured resources released for stop for instance [{}]", instance.getId());
    }

    @Override
    public void volumeDeallocate(Volume volume) {
        log.info("Deallocating volume [{}]", volume.getId());
        allocator.deallocate(volume);
        log.info("Deallocator [{}] handled request for volume [{}]", allocator, volume.getId());
    }
}

@@ -1194,560 +1194,192 @@
     
-log.info(%22Ensuring resources reserved for instance.start %5B%7B%7D%5D%22, instance.getId());%0A        allocator.ensureResourcesReserved(instance);%0A        log.info(%22Ensured resources released for instance.start %5B%7B%7D%5D%22, instance.getId());%0A    %7D%0A%0A    @Override%0A    public void ensureResourcesReleasedForStop(Instance instance) %7B%0A        log.info(%22Ensuring resources released for stop for instance %5B%7B%7D%5D%22, instance.getId());%0A        allocator.ensureResourcesReleased(instance);%0A        log.info(%22Ensured resources released for stop for instance %5B%7B%7D%5D%22, instance.getId()
+allocator.ensureResourcesReserved(instance);%0A    %7D%0A%0A    @Override%0A    public void ensureResourcesReleasedForStop(Instance instance) %7B%0A        allocator.ensureResourcesReleased(instance
 );%0A 

Remove overly verbose logs