code: private int getCheckpointInputTaskCount(TopologyContext context) {
          int count = 0;
          for (GlobalStreamId inputStream : context.getThisSources().keySet()) {
              if (CheckpointSpout.CHECKPOINT_STREAM_ID.equals(inputStream.get_streamId())) {
                  count += context.getComponentTasks(inputStream.get_componentId()).size();
              }
          }
          return count;
      }
docs: returns the total number of input checkpoint streams across
  all input tasks to this component.