You need to escape your single quotes and forward slashes in your
sed
statement. .. That and you're not COMPLETING the
sed
statement .. You need to close your second argument with a slash ->
/
(Or whatever delimiter you choose)
sed -i 's/lock allpages/LOCATION \'hdfs:\/\/LOCATION\/DIRECTORY\/TBL;\'/g'