common.thrift 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. /*
  2. * Licensed to Cloudera, Inc. under one
  3. * or more contributor license agreements. See the NOTICE file
  4. * distributed with this work for additional information
  5. * regarding copyright ownership. Cloudera, Inc. 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. /*
  19. * Common declarations for Hadoop Thrift interfaces
  20. */
  21. /*
  22. * Namespaces for generated code. The idea is to keep code generated by
  23. * Thrift under a 'hadoop.api' namespace, so that a higher-level set of
  24. * functions and classes may be defined under 'hadoop'.
  25. */
  26. namespace cpp hadoop.api
  27. namespace csharp Hadoop.API
  28. namespace java org.apache.hadoop.thriftfs.api
  29. namespace perl Hadoop.API
  30. namespace php hadoop_api
  31. namespace py hadoop.api.common
  32. namespace rb Hadoop.API
  33. /** Generic I/O error */
  34. exception IOException {
  35. /** Error message. */
  36. 1: string msg,
  37. /** Textual representation of the call stack. */
  38. 2: string stack
  39. /** The Java class of the Exception (may be a subclass) */
  40. 3: string clazz
  41. }
  42. /**
  43. * Information about the compilation version of this server
  44. */
  45. struct VersionInfo {
  46. 1: string version
  47. 2: string revision
  48. 4: string compileDate
  49. 5: string compilingUser
  50. 6: string url
  51. 7: string buildVersion
  52. }
  53. /** A single stack frame in a stack dump */
  54. struct StackTraceElement {
  55. 1: string className
  56. 2: string fileName
  57. 3: i32 lineNumber
  58. 4: string methodName
  59. 5: bool isNativeMethod
  60. 6: string stringRepresentation
  61. }
  62. /** Info about a thread with its corresponding stack trace */
  63. struct ThreadStackTrace {
  64. 1: string threadName
  65. 2: string threadStringRepresentation
  66. 3: bool isDaemon
  67. 4: list<StackTraceElement> stackTrace;
  68. }
  69. /**
  70. * Memory available via java.lang.Runtime
  71. */
  72. struct RuntimeInfo {
  73. 1:i64 totalMemory
  74. 2:i64 freeMemory
  75. 3:i64 maxMemory
  76. }
  77. /**
  78. * Context options for every request.
  79. */
  80. struct RequestContext {
  81. /**
  82. * This map turns into a Configuration object in the server and
  83. * is currently used to construct a UserGroupInformation to
  84. * authenticate this request.
  85. */
  86. 1:map<string, string> confOptions
  87. }
  88. struct MetricsRecord {
  89. 2: map<string, string> tags
  90. 3: map<string, i64> metrics
  91. }
  92. struct MetricsContext {
  93. 1: string name
  94. 2: bool isMonitoring
  95. 3: i32 period
  96. 4: map<string, list<MetricsRecord>> records
  97. }
  98. struct ThriftDelegationToken {
  99. 1: binary delegationTokenBytes
  100. }
  101. service HadoopServiceBase {
  102. /** Return the version information for this server */
  103. VersionInfo getVersionInfo(10:RequestContext ctx);
  104. RuntimeInfo getRuntimeInfo(10:RequestContext ctx);
  105. list<ThreadStackTrace> getThreadDump(10:RequestContext ctx);
  106. list<MetricsContext> getAllMetrics(10:RequestContext ctx)
  107. throws (1:IOException err);
  108. MetricsContext getMetricsContext(10:RequestContext ctx, 1:string contextName)
  109. throws (1:IOException err);
  110. }