hdfs_test.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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 LIBHDFS_HDFS_TEST_H
  19. #define LIBHDFS_HDFS_TEST_H
  20. struct hdfsFile_internal;
  21. /**
  22. * Some functions that are visible only for testing.
  23. *
  24. * This header is not meant to be exported or used outside of the libhdfs unit
  25. * tests.
  26. */
  27. #ifdef __cplusplus
  28. extern "C" {
  29. #endif
  30. /**
  31. * Determine if a file is using the "direct read" optimization.
  32. *
  33. * @param file The HDFS file
  34. * @return 1 if the file is using the direct read optimization,
  35. * 0 otherwise.
  36. */
  37. int hdfsFileUsesDirectRead(struct hdfsFile_internal *file);
  38. /**
  39. * Disable the direct read optimization for a file.
  40. *
  41. * This is mainly provided for unit testing purposes.
  42. *
  43. * @param file The HDFS file
  44. */
  45. void hdfsFileDisableDirectRead(struct hdfsFile_internal *file);
  46. /**
  47. * Disable domain socket security checks.
  48. *
  49. * @param 0 if domain socket security was disabled;
  50. * -1 if not.
  51. */
  52. int hdfsDisableDomainSocketSecurity(void);
  53. #ifdef __cplusplus
  54. }
  55. #endif
  56. #endif