#NEWLINE# @ classmethod #NEWLINE# def create( cls , mr_spec , shard_number , shard_attempt , _writer_state = None ) : #NEWLINE# #INDENT# 'Inherit docs.' #NEWLINE# mapper_spec = mr_spec . mapper #NEWLINE# params = output_writers . _get_params ( mapper_spec ) #NEWLINE# bucket_name = params . get ( cls . BUCKET_NAME_PARAM ) #NEWLINE# shards = mapper_spec . shard_count #NEWLINE# filehandles = [ ] #NEWLINE# filename = ( ( ( ( ( mr_spec . name + '/' ) + mr_spec . mapreduce_id ) + '/shard-' ) + str ( shard_attempt ) ) + '-bucket-' ) #NEWLINE# for i in range ( shards ) : #NEWLINE# #INDENT# full_filename = ( '/%s/%s%d' % ( bucket_name , filename , i ) ) #NEWLINE# filehandles . append ( cloudstorage . open ( full_filename , mode = 'w' ) ) #NEWLINE# #UNINDENT# return cls ( filehandles )