  Repair locality is a desirable property for erasure codes in distributed
storage systems. Recently, different structures of local repair groups have
been proposed in the definitions of repair locality. In this paper, the concept
of regenerating set is introduced to characterize the local repair groups. A
definition of locality $r^{(\delta -1)}$ (i.e., locality $r$ with repair
tolerance $\delta -1$) under the most general structure of regenerating sets is
given. All previously studied locality turns out to be special cases of this
definition. Furthermore, three representative concepts of locality proposed
before are reinvestigated under the framework of regenerating sets, and their
respective upper bounds on the minimum distance are reproved in a uniform and
brief form. Additionally, a more precise distance bound is derived for the
square code which is a class of linear codes with locality $r^{(2)}$ and high
information rate, and an explicit code construction attaining the optimal
distance bound is obtained.
