in datahub/implement.py [0:0]
def wait_shards_ready(self, project_name, topic_name, timeout=30):
if check_empty(project_name):
raise InvalidParameterException(ErrorMessage.PARAMETER_EMPTY % 'project_name')
if check_empty(topic_name):
raise InvalidParameterException(ErrorMessage.PARAMETER_EMPTY % 'topic_name')
if check_negative(timeout):
raise InvalidParameterException(ErrorMessage.PARAMETER_NEGATIVE % 'timeout')
current_time = time.time()
end_time = current_time + timeout
while current_time <= end_time:
if self.__is_shard_load_completed(project_name, topic_name):
return
time.sleep(1)
current_time = time.time()
raise DatahubException(ErrorMessage.WAIT_SHARD_TIMEOUT)