<commit_before>/*
 * The Alluxio Open Foundation licenses this work under the Apache License, version 2.0
 * (the "License"). You may not use this work except in compliance with the License, which is
 * available at www.apache.org/licenses/LICENSE-2.0
 *
 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
 * either express or implied, as more fully set forth in the License.
 *
 * See the NOTICE file distributed with this work for information regarding copyright ownership.
 */

package alluxio.exception;

import com.google.common.base.Preconditions;

import java.text.MessageFormat;

import javax.annotation.concurrent.ThreadSafe;

/**
 * Exception messages used across Alluxio.
 *
 * Note: To minimize merge conflicts, please sort alphabetically in this section.
 */
@ThreadSafe
public enum ExceptionMessage {
  // general
  INVALID_PREFIX("Parent path {0} is not a prefix of child {1}"),
  NOT_SUPPORTED("This method is not supported"),
  PATH_DOES_NOT_EXIST("Path {0} does not exist"),
  PATH_MUST_BE_FILE("Path {0} must be a file"),
  PATH_MUST_BE_DIRECTORY("Path {0} must be a directory"),
  PATH_INVALID("Path {0} is invalid"),

  // general block
  CANNOT_REQUEST_SPACE("Not enough space left on worker {0} to store blockId {1,number,#}."),
  NO_LOCAL_WORKER("Local address {0} requested but there is no local worker"),
  NO_WORKER_AVAILABLE_ON_ADDRESS("No Alluxio worker available for address {0}"),
  NO_WORKER_AVAILABLE("No available Alluxio worker found"),

  // block lock manager
  LOCK_ID_FOR_DIFFERENT_BLOCK("lockId {0,number,#} is for blockId {1,number,#}, not {2,number,#}"),
  LOCK_ID_FOR_DIFFERENT_SESSION(
      "lockId {0,number,#} is owned by sessionId {1,number,#} not {2,number,#}"),
  LOCK_RECORD_NOT_FOUND_FOR_BLOCK_AND_SESSION(
      "no lock is found for blockId {0,number,#} for sessionId {1,number,#}"),
  LOCK_RECORD_NOT_FOUND_FOR_LOCK_ID("lockId {0,number,#} has no lock record"),

  // block metadata manager and view
  BLOCK_META_NOT_FOUND("BlockMeta not found for blockId {0,number,#}"),
  GET_DIR_FROM_NON_SPECIFIC_LOCATION("Cannot get path from non-specific dir {0}"),
  TEMP_BLOCK_META_NOT_FOUND("TempBlockMeta not found for blockId {0,number,#}"),
  TIER_ALIAS_NOT_FOUND("Tier with alias {0} not found"),
  TIER_VIEW_ALIAS_NOT_FOUND("Tier view with alias {0} not found"),

  // instream/outstream
  FAILED_CACHE("Failed to cache: {0}"),
  FAILED_CREATE("Failed to create {0}"),
  FAILED_SEEK("Failed to seek to {0}"),
  FAILED_SKIP("Failed to skip {0}"),
  INSTREAM_CANNOT_SKIP("The underlying BlockInStream could not skip {0}"),
  READ_CLOSED_STREAM("Cannot read from a closed stream"),
  SEEK_NEGATIVE("Seek position is negative: {0,number,#}"),
  SEEK_PAST_EOF("Seek position is past EOF: {0,number,#}, fileSize: {1,number,#}"),

  // netty
  BLOCK_WRITE_ERROR(
      "Error writing blockId: {0,number,#}, sessionId: {1,number,#}, address: {2}, message: {3}"),
  NO_RPC_HANDLER("No handler implementation for rpc message type: {0}"),
  UNEXPECTED_RPC_RESPONSE("Unexpected response message type: {0} (expected: {1})"),<commit_msg>[ALLUXIO-2576] Fix misleading error msg<commit_after>/*
 * The Alluxio Open Foundation licenses this work under the Apache License, version 2.0
 * (the "License"). You may not use this work except in compliance with the License, which is
 * available at www.apache.org/licenses/LICENSE-2.0
 *
 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
 * either express or implied, as more fully set forth in the License.
 *
 * See the NOTICE file distributed with this work for information regarding copyright ownership.
 */

package alluxio.exception;

import com.google.common.base.Preconditions;

import java.text.MessageFormat;

import javax.annotation.concurrent.ThreadSafe;

/**
 * Exception messages used across Alluxio.
 *
 * Note: To minimize merge conflicts, please sort alphabetically in this section.
 */
@ThreadSafe
public enum ExceptionMessage {
  // general
  INVALID_PREFIX("Parent path {0} is not a prefix of child {1}"),
  NOT_SUPPORTED("This method is not supported"),
  PATH_DOES_NOT_EXIST("Path {0} does not exist"),
  PATH_MUST_BE_FILE("Path {0} must be a file"),
  PATH_MUST_BE_DIRECTORY("Path {0} must be a directory"),
  PATH_INVALID("Path {0} is invalid"),

  // general block
  CANNOT_REQUEST_SPACE("Not enough space left on worker {0} to store blockId {1,number,#}."),
  NO_LOCAL_WORKER("Local address {0} requested but there is no local worker"),
  NO_WORKER_AVAILABLE_ON_ADDRESS("No Alluxio worker available for address {0}"),
  NO_WORKER_AVAILABLE("there is no worker with enough space for a new block of size ${blocksize}"),

  // block lock manager
  LOCK_ID_FOR_DIFFERENT_BLOCK("lockId {0,number,#} is for blockId {1,number,#}, not {2,number,#}"),
  LOCK_ID_FOR_DIFFERENT_SESSION(
      "lockId {0,number,#} is owned by sessionId {1,number,#} not {2,number,#}"),
  LOCK_RECORD_NOT_FOUND_FOR_BLOCK_AND_SESSION(
      "no lock is found for blockId {0,number,#} for sessionId {1,number,#}"),
  LOCK_RECORD_NOT_FOUND_FOR_LOCK_ID("lockId {0,number,#} has no lock record"),

  // block metadata manager and view
  BLOCK_META_NOT_FOUND("BlockMeta not found for blockId {0,number,#}"),
  GET_DIR_FROM_NON_SPECIFIC_LOCATION("Cannot get path from non-specific dir {0}"),
  TEMP_BLOCK_META_NOT_FOUND("TempBlockMeta not found for blockId {0,number,#}"),
  TIER_ALIAS_NOT_FOUND("Tier with alias {0} not found"),
  TIER_VIEW_ALIAS_NOT_FOUND("Tier view with alias {0} not found"),

  // instream/outstream
  FAILED_CACHE("Failed to cache: {0}"),
  FAILED_CREATE("Failed to create {0}"),
  FAILED_SEEK("Failed to seek to {0}"),
  FAILED_SKIP("Failed to skip {0}"),
  INSTREAM_CANNOT_SKIP("The underlying BlockInStream could not skip {0}"),
  READ_CLOSED_STREAM("Cannot read from a closed stream"),
  SEEK_NEGATIVE("Seek position is negative: {0,number,#}"),
  SEEK_PAST_EOF("Seek position is past EOF: {0,number,#}, fileSize: {1,number,#}"),

  // netty
  BLOCK_WRITE_ERROR(
      "Error writing blockId: {0,number,#}, sessionId: {1,number,#}, address: {2}, message: {3}"),
  NO_RPC_HANDLER("No handler implementation for rpc message type: {0}"),
  UNEXPECTED_RPC_RESPONSE("Unexpected response message type: {0} (expected: {1})"),
{'fraction_non_alphanumeric': 0.12008871989860583, 'fraction_numerical': 0.014258555133079848, 'mean_word_length': 5.294117647058823, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3402424', 'n_tokens_mistral': 2115, 'n_tokens_neox': 2034, 'n_words': 652}