code: func newring(n int) (*ring, error) {
  	if n <= 0 || n > partitions {
  		return nil, fmt.Errorf("invalid number of paritions: %d", n)
  	}
  
  	r := ring{
  		partitions: make([]*partition, n), // maximum number of partitions.
  	}
  
  	// The trick here is to map N partitions to all points on the continuum,
  	// such that the first eight bits of a given hash will map directly to one
  	// of the N partitions.
  	for i := 0; i < len(r.partitions); i++ {
  		r.partitions[i] = &partition{
  			store: make(map[string]*entry),
  		}
  	}
  	return &r, nil
  }
docs: // newring returns a new ring initialised with n partitions. n must always be a
  // power of 2, and for performance reasons should be larger than the number of
  // cores on the host. The supported set of values for n is:
  //
  //     {1, 2, 4, 8, 16, 32, 64, 128, 256}.
  //