  Linear erasure codes with local repairability are desirable for distributed
data storage systems. An [n, k, d] code having all-symbol (r,
\delta})-locality, denoted as (r, {\delta})a, is considered optimal if it also
meets the minimum Hamming distance bound. The existing results on the existence
and the construction of optimal (r, {\delta})a codes are limited to only the
special case of {\delta} = 2, and to only two small regions within this special
case, namely, m = 0 or m >= (v+{\delta}-1) > ({\delta}-1), where m = n mod
(r+{\delta}-1) and v = k mod r. This paper investigates the existence
conditions and presents deterministic constructive algorithms for optimal (r,
{\delta})a codes with general r and {\delta}. First, a structure theorem is
derived for general optimal (r, {\delta})a codes which helps illuminate some of
their structure properties. Next, the entire problem space with arbitrary n, k,
r and {\delta} is divided into eight different cases (regions) with regard to
the specific relations of these parameters. For two cases, it is rigorously
proved that no optimal (r, {\delta})a could exist. For four other cases the
optimal (r, {\delta})a codes are shown to exist, deterministic constructions
are proposed and the lower bound on the required field size for these
algorithms to work is provided. Our new constructive algorithms not only cover
more cases, but for the same cases where previous algorithms exist, the new
constructions require a considerably smaller field, which translates to
potentially lower computational complexity. Our findings substantially enriches
the knowledge on (r, {\delta})a codes, leaving only two cases in which the
existence of optimal codes are yet to be determined.
