An 18-year-old who pleaded guilty to killing 19-year-old Keyamonie Davis was sentenced to 21 years in state prison, according to court records.