@Override
    public int getAvailableSlots() {
        if (inputInitializerContext == null) {
            // for now, totalResource = taskResource for llap
            return 1;
        }
        int totalResource = inputInitializerContext.getTotalAvailableResource().getMemory();
        int taskResource = inputInitializerContext.getVertexTaskResource().getMemory();
        int availableSlots = totalResource / taskResource;;
        LOG.debug("totalResource: {}mb / taskResource: {}mb =  availableSlots: {}", totalResource, taskResource,
            availableSlots);
        return availableSlots;
    }
Default implementation of AvailableSlotsCalculator which relies on available capacity of the cluster
ql/src/java/org/apache/hadoop/hive/ql/exec/tez/TezAvailableSlotsCalculator.java