Man sentenced to 8 years in heroin case