(topic_name, rng=1)
return abs(h % rng)
To distribute load, all the topics are not in the same stream. Each topic named is hashed
    to obtain an id which is in turn the name of the stream.
    This uses the djb2 algorithm, as described here
    https://mapr.com/docs/60/AdministratorGuide/spyglass-on-streams.html
To distribute load, all the topics are not in the same stream. Each topic named is hashed
    to obtain an id which is in turn the name of the stream.
    This uses the djb2 algorithm, as described here
    https://mapr.com/docs/60/AdministratorGuide/spyglass-on-streams.html
To distribute load all the topics are not in the same stream . Each topic named is hashed to obtain an id which is in turn the name of the stream . This uses the djb2 algorithm as described here https : // mapr . com / docs / 60 / AdministratorGuide / spyglass - on - streams . html
def get_stream_id_for_topic(topic_name, rng=1):
    """To distribute load, all the topics are not in the same stream. Each topic named is hashed
    to obtain an id which is in turn the name of the stream.
    This uses the djb2 algorithm, as described here
    https://mapr.com/docs/60/AdministratorGuide/spyglass-on-streams.html"""
    if rng == 1:
        return 0

    h = 5381
    for c in topic_name:
        h = ((h << 5) + h) + ord(c)
    return abs(h % rng)
def get_stream_id_for_topic ( topic_name , rng = 1 ) : if rng == 1 : return 0 h = 5381 for c in topic_name : h = ( ( h << 5 ) + h ) + ord ( c ) return abs ( h % rng )