private long getVersionBasedOnSchema(String version, Dataset.VersionSchema versionSchema) {
    switch (versionSchema) {
      case TIMESTAMP:
      case MONOTONIC:
        long versionToLong;
        try {
          versionToLong = Long.parseLong(version);
        } catch (Exception e) {
          throw new IllegalArgumentException("The version is not numeric, version: " + version);
        }
        return versionToLong;
      case SEMANTIC:
        //Given a version number MAJOR.MINOR.PATCH, increment the:
        //1.MAJOR version when you make incompatible API changes
        //2.MINOR version when you add functionality in a backwards compatible manner
        //3.PATCH version when you make backwards compatible bug fixes
        //The MAJOR,MINOR and PATCH version are non-negative value.
        return sanityCheckAndConvertSemanticVersion(version);
      case SEMANTIC_LONG:
        return sanityCheckAndConvertSemanticLongVersion(version);
      default:
        throw new IllegalArgumentException("Unsupported version schema: " + versionSchema);
    }
  }
Convert string version to long value.
@param version The string version.
@param versionSchema The {@link com.github.ambry.account.Dataset.VersionSchema} of the dataset.
@return the long value of version.
ambry-account/src/main/java/com/github/ambry/account/mysql/DatasetDao.java