def __get_records()

in datahub/implement.py [0:0]


    def __get_records(self, project_name, topic_name, sub_id, shard_id, cursor, limit_num, record_schema=None):
        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_empty(shard_id):
            raise InvalidParameterException(ErrorMessage.PARAMETER_EMPTY % 'shard_id')
        if check_empty(cursor):
            raise InvalidParameterException(ErrorMessage.PARAMETER_EMPTY % 'cursor')

        url = Path.SHARD % (project_name, topic_name, shard_id)
        request_param = GetBatchRecordsRequestParams(cursor, limit_num)

        content = self._rest_client.post(url, data=request_param.content(), headers=request_param.extra_headers(sub_id),
                                         compress_format=self._compress_format)
        result = GetBatchRecordsResult.parse_content(content, record_schema=record_schema, project_name=project_name,
                                                     topic_name=topic_name, init_schema=record_schema,
                                                     schema_register=self._schema_register if record_schema else None)
        return result