hdfs_configuration.h 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /**
  2. * Licensed to the Apache Software Foundation (ASF) under one
  3. * or more contributor license agreements. See the NOTICE file
  4. * distributed with this work for additional information
  5. * regarding copyright ownership. The ASF licenses this file
  6. * to you under the Apache License, Version 2.0 (the
  7. * "License"); you may not use this file except in compliance
  8. * with the License. You may obtain a copy of the License at
  9. *
  10. * http://www.apache.org/licenses/LICENSE-2.0
  11. *
  12. * Unless required by applicable law or agreed to in writing, software
  13. * distributed under the License is distributed on an "AS IS" BASIS,
  14. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. * See the License for the specific language governing permissions and
  16. * limitations under the License.
  17. */
  18. #ifndef COMMON_HDFS_CONFIGURATION_H_
  19. #define COMMON_HDFS_CONFIGURATION_H_
  20. #include "common/configuration.h"
  21. #include "hdfspp/options.h"
  22. #include <string>
  23. #include <map>
  24. #include <vector>
  25. #include <set>
  26. #include <istream>
  27. #include <stdint.h>
  28. namespace hdfs {
  29. class HdfsConfiguration : public Configuration {
  30. public:
  31. // Interprets the resources to build an Options object
  32. Options GetOptions();
  33. // Keys to look for in the configuration file
  34. static constexpr const char * kFsDefaultFsKey = "fs.defaultFS";
  35. static constexpr const char * kDfsClientSocketTimeoutKey = "dfs.client.socket-timeout";
  36. static constexpr const char * kIpcClientConnectTimeoutKey = "ipc.client.connect.timeout";
  37. static constexpr const char * kIpcClientConnectMaxRetriesKey = "ipc.client.connect.max.retries";
  38. static constexpr const char * kIpcClientConnectRetryIntervalKey = "ipc.client.connect.retry.interval";
  39. static constexpr const char * kHadoopSecurityAuthenticationKey = "hadoop.security.authentication";
  40. static constexpr const char * kHadoopSecurityAuthentication_simple = "simple";
  41. static constexpr const char * kHadoopSecurityAuthentication_kerberos = "kerberos";
  42. static constexpr const char * kDfsBlockSizeKey = "dfs.blocksize";
  43. static constexpr const char * kDfsClientFailoverMaxAttempts = "dfs.client.failover.max.attempts";
  44. static constexpr const char * kDfsClientFailoverConnectionRetriesOnTimeouts = "dfs.client.failover.connection.retries.on.timeouts";
  45. private:
  46. friend class ConfigurationLoader;
  47. // Constructs a configuration with no search path and no resources loaded
  48. HdfsConfiguration();
  49. // Constructs a configuration with some static data
  50. HdfsConfiguration(ConfigMap &src_map);
  51. HdfsConfiguration(const ConfigMap &src_map);
  52. static std::vector<std::string> GetDefaultFilenames();
  53. std::vector<NamenodeInfo> LookupNameService(const std::string &nameservice);
  54. };
  55. }
  56. #endif