private void validateLogicalIdentifier(String identifierName, String identifierValue) {
    if (identifierValue == null || !identifierValue.matches("[A-Za-z0-9_-]+")) {
      throw new IllegalArgumentException(String.format("Identifier '%s' is '%s'. It must match the expression [A-Za-z0-9_-]+", identifierName, identifierValue));
    }
  }
Copies this StreamSpec, but applies a new partitionCount.

This method is not static s.t. subclasses can override it.

@param partitionCount  The partitionCount for the returned StreamSpec.
@return                A copy of this StreamSpec with the specified partitionCount.
samza-api/src/main/java/org/apache/samza/system/StreamSpec.java