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')
        if check_type(cursor, GetCursorResult):
            raise InvalidParameterException(ErrorMessage.INVALID_TYPE % ('cursor', 'str'))
        if sub_id is not None:
            raise InvalidOperationException("Json protocol not support this method")

        url = Path.SHARD % (project_name, topic_name, shard_id)

        request_param = GetRecordsRequestParams(cursor, limit_num)

        content = self._rest_client.post(url, data=request_param.content(), headers=request_param.extra_headers(),
                                         compress_format=self._compress_format)

        result = GetRecordsResult.parse_content(content, record_schema=record_schema)

        return result