1
0

native_mini_dfs.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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_NATIVE_MINI_DFS_H
  19. #define LIBHDFS_NATIVE_MINI_DFS_H
  20. #include <jni.h> /* for jboolean */
  21. struct NativeMiniDfsCluster;
  22. /**
  23. * Represents a configuration to use for creating a Native MiniDFSCluster
  24. */
  25. struct NativeMiniDfsConf {
  26. /**
  27. * Nonzero if the cluster should be formatted prior to startup
  28. */
  29. jboolean doFormat;
  30. };
  31. /**
  32. * Create a NativeMiniDfsBuilder
  33. *
  34. * @param conf (inout) The cluster configuration
  35. *
  36. * @return a NativeMiniDfsBuilder, or a NULL pointer on error.
  37. */
  38. struct NativeMiniDfsCluster* nmdCreate(struct NativeMiniDfsConf *conf);
  39. /**
  40. * Wait until a MiniDFSCluster comes out of safe mode.
  41. *
  42. * @param cl The cluster
  43. *
  44. * @return 0 on success; a non-zero error code if the cluster fails to
  45. * come out of safe mode.
  46. */
  47. int nmdWaitClusterUp(struct NativeMiniDfsCluster *cl);
  48. /**
  49. * Shut down a NativeMiniDFS cluster
  50. *
  51. * @param cl The cluster
  52. *
  53. * @return 0 on success; a non-zero error code if an exception is
  54. * thrown.
  55. */
  56. int nmdShutdown(struct NativeMiniDfsCluster *cl);
  57. /**
  58. * Destroy a Native MiniDFSCluster
  59. *
  60. * @param cl The cluster to destroy
  61. */
  62. void nmdFree(struct NativeMiniDfsCluster* cl);
  63. /**
  64. * Get the port that's in use by the given (non-HA) nativeMiniDfs
  65. *
  66. * @param cl The initialized NativeMiniDfsCluster
  67. *
  68. * @return the port, or a negative error code
  69. */
  70. int nmdGetNameNodePort(const struct NativeMiniDfsCluster *cl);
  71. #endif