code: def set_finished(self):
          
  
          component_name = self.get_component_name()
  
          self.log(
              logging.INFO,
              "Component [%s] is being marked as finished.", 
              component_name)
  
          existing_state = self.__get_state(component_name)
  
          assert existing_state == fss.constants.PCS_RUNNING, \
                 "Can not change to 'finished' state from unsupported " \
                 "state: (" + str(existing_state) + ")"
  
          self.__set_data('count', self.__push_count)
          self.__set_state(fss.constants.PCS_FINISHED)
docs: This stores the number of items that have been pushed, and 
          transitions the current component to the FINISHED state (which precedes 
          the STOPPED state). The FINISHED state isn't really necessary unless 
          methods/hooks are overridden to depend on it, but the count must be 
          stored at one point so that thenext components knows how many items to 
          expect. This is done by default after the loop breaks, but can be 
          manually called sooner, if desired.