1 /** 2 * Licensed to the Apache Software Foundation (ASF) under one or more 3 * contributor license agreements. See the NOTICE file distributed with this 4 * work for additional information regarding copyright ownership. The ASF 5 * licenses this file to you under the Apache License, Version 2.0 (the 6 * "License"); you may not use this file except in compliance with the License. 7 * You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 * License for the specific language governing permissions and limitations under 15 * the License. 16 */ 17 package org.apache.hadoop.hdfs.server.namenode.startupprogress; 18 19 import org.apache.hadoop.classification.InterfaceAudience; 20 21 /** 22 * Indicates a particular phase of the namenode startup sequence. The phases 23 * are listed here in their execution order. 24 */ 25 @InterfaceAudience.Private 26 public enum Phase { 27 /** 28 * The namenode is loading the fsimage file into memory. 29 */ 30 LOADING_FSIMAGE("LoadingFsImage", "Loading fsimage"), 31 32 /** 33 * The namenode is loading the edits file and applying its operations to the 34 * in-memory metadata. 35 */ 36 LOADING_EDITS("LoadingEdits", "Loading edits"), 37 38 /** 39 * The namenode is saving a new checkpoint. 40 */ 41 SAVING_CHECKPOINT("SavingCheckpoint", "Saving checkpoint"), 42 43 /** 44 * The namenode has entered safemode, awaiting block reports from data nodes. 45 */ 46 SAFEMODE("SafeMode", "Safe mode"); 47 48 private final String name, description; 49 50 /** 51 * Returns phase description. 52 * 53 * @return String description 54 */ getDescription()55 public String getDescription() { 56 return description; 57 } 58 59 /** 60 * Returns phase name. 61 * 62 * @return String phase name 63 */ getName()64 public String getName() { 65 return name; 66 } 67 68 /** 69 * Private constructor of enum. 70 * 71 * @param name String phase name 72 * @param description String phase description 73 */ Phase(String name, String description)74 private Phase(String name, String description) { 75 this.name = name; 76 this.description = description; 77 } 78 } 79