| /* |
| * Licensed to the Apache Software Foundation (ASF) under one |
| * or more contributor license agreements. See the NOTICE file |
| * distributed with this work for additional information |
| * regarding copyright ownership. The ASF licenses this file |
| * to you under the Apache License, Version 2.0 (the |
| * "License"); you may not use this file except in compliance |
| * with the License. You may obtain a copy of the License at |
| * |
| * http://www.apache.org/licenses/LICENSE-2.0 |
| * |
| * Unless required by applicable law or agreed to in writing, software |
| * distributed under the License is distributed on an "AS IS" BASIS, |
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| * See the License for the specific language governing permissions and |
| * limitations under the License. |
| */ |
| package org.apache.hadoop.hdfs.server.namenode; |
| |
| import java.io.IOException; |
| |
| import org.apache.hadoop.classification.InterfaceAudience; |
| import org.apache.hadoop.conf.Configuration; |
| |
| /** |
| * |
| * NameNodeResourceChecker provides a method - |
| * <code>hasAvailableDiskSpace</code> - which will return true if and only if |
| * the NameNode has disk space available on all required volumes, and any volume |
| * which is configured to be redundant. Volumes containing file system edits dirs |
| * are added by default, and arbitrary extra volumes may be configured as well. |
| */ |
| @InterfaceAudience.Private |
| public class NameNodeResourceChecker { |
| public static final Object SOLR_HACK_FOR_CLASS_VERIFICATION = new Object(); |
| |
| /** |
| * Create a NameNodeResourceChecker, which will check the edits dirs and any |
| * additional dirs to check set in <code>conf</code>. |
| */ |
| public NameNodeResourceChecker(Configuration conf) throws IOException { |
| } |
| |
| |
| /** |
| * Return true if disk space is available on at least one of the configured |
| * redundant volumes, and all of the configured required volumes. |
| * |
| * @return True if the configured amount of disk space is available on at |
| * least one redundant volume and all of the required volumes, false |
| * otherwise. |
| */ |
| public boolean hasAvailableDiskSpace() { |
| return true; |
| } |
| } |