Answer: Extended metaphor
A metaphor is a literary device that compares two unlike things. An extended metaphor follows the same mechanism, but extends the comparison throughout a whole poem or a whole narrative. In this case, the author is using the man hitting a narrator on the head with an umbrella as a metaphor. However, it is an extended metaphor because it is maintained throughout the whole story.