returns the total number of input checkpoint streams across
all input tasks to this component.
779199
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;
    }
63272
public int getProducerCount() {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "getProducerCount");
        int producerCount = producers.size();
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "getProducerCount", producerCount);
        return producerCount;
    }
1031158
def _GetStatus(self):
    
    if self._parser_mediator:
      number_of_produced_events = (
          self._parser_mediator.number_of_produced_events)
      number_of_produced_sources = (
          self._parser_mediator.number_of_produced_event_sources)
      number_of_produced_warnings = (
          self._parser_mediator.number_of_produced_warnings)
    else:
      number_of_produced_events = None
      number_of_produced_sources = None
      number_of_produced_warnings = None

    if self._extraction_worker and self._parser_mediator:
      last_activity_timestamp = max(
          self._extraction_worker.last_activity_timestamp,
          self._parser_mediator.last_activity_timestamp)
      processing_status = self._extraction_worker.processing_status
    else:
      last_activity_timestamp = 0.0
      processing_status = self._status

    task_identifier = getattr(self._task, 'identifier', '')

    if self._process_information:
      used_memory = self._process_information.GetUsedMemory() or 0
    else:
      used_memory = 0

    if self._memory_profiler:
      self._memory_profiler.Sample('main', used_memory)

    # XML RPC does not support integer values > 2 GiB so we format them
    # as a string.
    used_memory = '{0:d}'.format(used_memory)

    status = {
        'display_name': self._current_display_name,
        'identifier': self._name,
        'last_activity_timestamp': last_activity_timestamp,
        'number_of_consumed_event_tags': None,
        'number_of_consumed_events': self._number_of_consumed_events,
        'number_of_consumed_sources': self._number_of_consumed_sources,
        'number_of_consumed_warnings': None,
        'number_of_produced_event_tags': None,
        'number_of_produced_events': number_of_produced_events,
        'number_of_produced_sources': number_of_produced_sources,
        'number_of_produced_warnings': number_of_produced_warnings,
        'processing_status': processing_status,
        'task_identifier': task_identifier,
        'used_memory': used_memory}

    return status
821251
public int getErrorCount() {
    int count = 0;
    for (AggregatedTestResultEvent t : getTests()) {
      if (t.getStatus() == TestStatus.ERROR)
        count++;
    }
    
    for (FailureMirror m : getFailures()) {
      if (m.isErrorViolation())
        count++;
    }
    return count;
  }
759241
public int getFailureCount() {
    int count = 0;
    for (AggregatedTestResultEvent t : getTests()) {
      if (t.getStatus() == TestStatus.FAILURE)
        count++;
    }
    for (FailureMirror m : getFailures()) {
      if (m.isAssertionViolation())
        count++;
    }
    return count;
  }
791873
long refreshAndGetTotal() {
		long total = 0;

		for (InputChannel channel : inputGate.getInputChannels().values()) {
			if (channel instanceof RemoteInputChannel) {
				RemoteInputChannel rc = (RemoteInputChannel) channel;

				total += rc.unsynchronizedGetNumberOfQueuedBuffers();
			}
		}

		return total;
	}
915459
public int getNumOccupiedMemorySegments() {
		// either the number of memory segments, or one for spilling
		final int numPartitionBuffers = this.partitionBuffers != null ?
			this.partitionBuffers.length : this.buildSideWriteBuffer.getNumOccupiedMemorySegments();
		return numPartitionBuffers + numOverflowSegments;
	}
600815
@Exported
    public int getTotalExecutors() {
        int r=0;
        for (Computer c : get_all()) {
            if(c.isOnline())
                r += c.countExecutors();
        }
        return r;
    }
93129
public long countAllMessagesOnStream()
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "countAllMessagesOnStream");

    long count=0;
    _targetStream.setCursor(0);
    // Get the first TickRange
    TickRange tr = _targetStream.getNext();
    while (tr.endstamp < RangeList.INFINITY)
    {
      if (tr.type == TickRange.Value)
      {
        count++;
      }
      if (tr.type == TickRange.Requested)
      {
        // If we are an restarted IME (gathering) then we may have to restore msgs from the
        // DME which were previously Value msgs in this stream. We need to count any re-requests
        // in our count as they contribute to the total.
        if (((AIRequestedTick)tr.value).getRestoringAOValue() != null)
          count++;
      }
      tr = _targetStream.getNext();
    } // end while

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "countAllMessagesOnStream", Long.valueOf(count));
    return count;
  }
772690
public int getStatementCount() {
        int ret = 0;
        for (final StatementGroup sg : statementGroups) {
            ret += sg.getAllStatements().size();
        }
        return ret;
    }
195443
@Weight(value = Weight.Unit.VARIABLE, comment = "Depends on the current call stack depth")
  public static void checkPoints() {
    final long time = System.currentTimeMillis();
    final int stackDepth = ThreadUtils.stackDepth();

    final List<TimeData> list = REGISTRY.get();
    final Iterator<TimeData> iterator = list.iterator();

    while (iterator.hasNext()) {
      final TimeData timeWatchItem = iterator.next();

      if (timeWatchItem.isTimePoint() && timeWatchItem.getDetectedStackDepth() >= stackDepth) {
        final long detectedDelay = time - timeWatchItem.getCreationTimeInMilliseconds();
        try {
          timeWatchItem.getAlertListener().onTimeAlert(detectedDelay, timeWatchItem);
        } catch (Exception ex) {
          final UnexpectedProcessingError error = new UnexpectedProcessingError("Error during time point processing", ex);
          MetaErrorListeners.fireError(error.getMessage(), error);
        } finally {
          iterator.remove();
        }
      }
    }
  }
415883
public static void writeToCheckpoint(OutputStream output, List<? extends Checkpointed> components)
      throws IOException, InterruptedException {
    OutputChunked chunked = new OutputChunked(
        new CheckpointOutputStream(output, CheckpointType.COMPOUND), 64 * Constants.KB);
    for (Checkpointed component : components) {
      chunked.writeString(component.getCheckpointName().toString());
      component.writeToCheckpoint(chunked);
      chunked.endChunks();
    }
    chunked.flush();
  }
726459
def traceCount(self):
        
        nsegs = sum([len(track) for track in self._segments])
        if nsegs == 0:
            return 0
        ntraces = 1
        for irow in range(self._autoParams.nrows()):
            ntraces = ntraces*self._autoParams.numSteps(irow)
        return ntraces
1295166
public Map<String, Long> getDataSourceCounts()
  {
    return dataSources.entrySet().stream()
                      .collect(Collectors.toMap(Entry::getKey, entry -> entry.getValue().getNumSegments()));
  }
1074281
def count(self):
        
        self.log.info("Running 'count'")
        retvals = {}

        # Numbers of 'tasks'
        num_tasks = self._count_tasks()
        retvals['num_tasks'] = num_tasks

        # Numbers of 'files'
        num_files = self._count_repo_files()
        retvals['num_files'] = num_files

        return retvals
640179
def GetNumberOfEventSources(self):
    
    number_of_event_sources = self._CountStoredAttributeContainers(
        self._CONTAINER_TYPE_EVENT_SOURCE)

    number_of_event_sources += self._GetNumberOfSerializedAttributeContainers(
        self._CONTAINER_TYPE_EVENT_SOURCE)
    return number_of_event_sources
1000824
def spent_outputs(self):
        
        return (
            input_.fulfills.to_dict()
            for input_ in self.inputs if input_.fulfills
        )