hdfs_configuration.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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 * kDfsClientSocketTimeoutKey = "dfs.client.socket-timeout";
  35. static constexpr const char * kIpcClientConnectMaxRetriesKey = "ipc.client.connect.max.retries";
  36. static constexpr const char * kIpcClientConnectRetryIntervalKey = "ipc.client.connect.retry.interval";
  37. private:
  38. friend class ConfigurationLoader;
  39. // Constructs a configuration with no search path and no resources loaded
  40. HdfsConfiguration();
  41. // Constructs a configuration with some static data
  42. HdfsConfiguration(ConfigMap &src_map);
  43. static std::vector<std::string> GetDefaultFilenames();
  44. };
  45. }
  46. #endif