def __feed_arthur(self):
with self.ARTHUR_FEED_LOCK:<EOL><INDENT>if (time.time() - self.ARTHUR_LAST_MEMORY_CHECK) > <NUM_LIT:5> * self.ARTHUR_LAST_MEMORY_CHECK_TIME:<EOL><INDENT>self.ARTHUR_LAST_MEMORY_CHECK = time.time()<EOL>logger.debug("<STR_LIT>")<EOL>try:<EOL><INDENT>memory_size = self.measure_memory(self.arthur_items) / (<NUM_LIT> * <NUM_LIT>)<EOL><DEDENT>except RuntimeError as ex:<EOL><INDENT>logger.warning("<STR_LIT>", ex)<EOL>memory_size = self.ARTHUR_LAST_MEMORY_SIZE<EOL><DEDENT>self.ARTHUR_LAST_MEMORY_CHECK_TIME = time.time() - self.ARTHUR_LAST_MEMORY_CHECK<EOL>logger.debug("<STR_LIT>",<EOL>memory_size, self.ARTHUR_LAST_MEMORY_CHECK_TIME)<EOL>self.ARTHUR_LAST_MEMORY_SIZE = memory_size<EOL><DEDENT>if self.ARTHUR_LAST_MEMORY_SIZE > self.ARTHUR_MAX_MEMORY_SIZE:<EOL><INDENT>logger.debug("<STR_LIT>")<EOL>return<EOL><DEDENT>logger.info("<STR_LIT>")<EOL>db_url = self.config.get_conf()['<STR_LIT>']['<STR_LIT>']<EOL>conn = redis.StrictRedis.from_url(db_url)<EOL>logger.debug("<STR_LIT>", db_url)<EOL>pipe = conn.pipeline()<EOL>pipe.lrange(Q_STORAGE_ITEMS, <NUM_LIT:0>, self.ARTHUR_REDIS_ITEMS - <NUM_LIT:1>)<EOL>pipe.ltrim(Q_STORAGE_ITEMS, self.ARTHUR_REDIS_ITEMS, -<NUM_LIT:1>)<EOL>items = pipe.execute()[<NUM_LIT:0>]<EOL>for item in items:<EOL><INDENT>arthur_item = pickle.loads(item)<EOL>if arthur_item['<STR_LIT>'] not in self.arthur_items:<EOL><INDENT>self.arthur_items[arthur_item['<STR_LIT>']] = []<EOL><DEDENT>self.arthur_items[arthur_item['<STR_LIT>']].append(arthur_item)<EOL><DEDENT>for tag in self.arthur_items:<EOL><INDENT>if self.arthur_items[tag]:<EOL><INDENT>logger.debug("<STR_LIT>", tag, len(self.arthur_items[tag]))<EOL><DEDENT><DEDENT><DEDENT>
Feed Ocean with backend data collected from arthur redis queue