finished hadoop code for pretrain