'Set the host state. This can only be called when a host state lock is in place'

def _setHostStateValue(self, hostKey, stateType, state):

    if (hostKey not in self.hostState):
        self.hostState[hostKey] = {}
    if (stateType == 'logs'):
        if (('logs' not in self.hostState[hostKey]) or (self.hostState[hostKey][stateType] is None)):
            self.hostState[hostKey][stateType] = []
        self.hostState[hostKey][stateType].append(bson.binary.Binary(zlib.compress(bson.BSON.encode(state, check_keys=False), 9)))
    elif (stateType == 'munin'):
        self.hostState[hostKey][stateType] = state
    else:
        self.hostState[hostKey][stateType] = bson.binary.Binary(zlib.compress(bson.BSON.encode(state, check_keys=False), 9))
    self.hostStateLastUpdate[hostKey] = time.time()
