001 /* 002 * Copyright (c) 2011, Cloudera, Inc. All Rights Reserved. 003 * 004 * Cloudera, Inc. licenses this file to you under the Apache License, 005 * Version 2.0 (the "License"). You may not use this file except in 006 * compliance with the License. You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 011 * CONDITIONS OF ANY KIND, either express or implied. See the License for 012 * the specific language governing permissions and limitations under the 013 * License. 014 */ 015 package com.cloudera.lib.service; 016 017 import com.cloudera.lib.lang.XException; 018 019 public class HadoopException extends XException { 020 021 public enum ERROR implements XException.ERROR { 022 H01("Service property [{0}] not defined"), 023 H02("Kerberos initialization failed, {0}"), 024 H03("FileSystemExecutor error, {0}"), 025 H04("JobClientExecutor error, {0}"), 026 H05("[{0}] validation failed, {1}"), 027 H06("Property [{0}] not defined in configuration object"), 028 H07("[{0}] not healthy, {1}"), 029 H08(""), 030 H09("Invalid Hadoop security mode [{0}]"); 031 032 private String template; 033 034 ERROR(String template) { 035 this.template = template; 036 } 037 038 @Override 039 public String getTemplate() { 040 return template; 041 } 042 } 043 044 public HadoopException(ERROR error, Object... params) { 045 super(error, params); 046 } 047 048 }