public static SystemStream getSystemStreamFromNameOrId(Config config, String stream) {
    String[] parts = stream.split("\\.");
    if (parts.length == 0 || parts.length > 2) {
      throw new SamzaException(
          String.format("Invalid stream %s. Expected to be of the format streamId or systemName.streamName", stream));
    }
    if (parts.length == 1) {
      return new StreamConfig(config).streamIdToSystemStream(stream);
    } else {
      return new SystemStream(parts[0], parts[1]);
    }
  }
Gets the {@link SystemStream} corresponding to the provided stream, which may be
a streamId, or stream name of the format systemName.streamName.

@param config the config for the job
@param stream the stream name or id to get the {@link SystemStream} for.
@return the {@link SystemStream} for the stream
samza-core/src/main/java/org/apache/samza/util/StreamUtil.java