pwyckoff | 99b000b | 2008-04-03 19:30:55 +0000 | [diff] [blame] | 1 | /** |
| 2 | * fb303.thrift |
| 3 | * |
| 4 | * Copyright (c) 2006- Facebook |
| 5 | * Distributed under the Thrift Software License |
| 6 | * |
| 7 | * See accompanying file LICENSE or visit the Thrift site at: |
| 8 | * http://developers.facebook.com/thrift/ |
| 9 | * |
| 10 | * |
| 11 | * Definition of common Facebook data types and status reporting mechanisms |
| 12 | * common to all Facebook services. In some cases, these methods are |
| 13 | * provided in the base implementation, and in other cases they simply define |
| 14 | * methods that inheriting applications should implement (i.e. status report) |
| 15 | * |
pwyckoff | 99b000b | 2008-04-03 19:30:55 +0000 | [diff] [blame] | 16 | */ |
| 17 | |
pwyckoff | 99b000b | 2008-04-03 19:30:55 +0000 | [diff] [blame] | 18 | namespace java com.facebook.fb303 |
| 19 | namespace cpp facebook.fb303 |
| 20 | |
| 21 | /** |
| 22 | * Common status reporting mechanism across all services |
| 23 | */ |
| 24 | enum fb_status { |
| 25 | DEAD = 0, |
| 26 | STARTING = 1, |
| 27 | ALIVE = 2, |
| 28 | STOPPING = 3, |
| 29 | STOPPED = 4, |
| 30 | WARNING = 5, |
| 31 | } |
| 32 | |
| 33 | /** |
| 34 | * Standard base service |
| 35 | */ |
| 36 | service FacebookService { |
| 37 | |
| 38 | /** |
| 39 | * Returns a descriptive name of the service |
| 40 | */ |
| 41 | string getName(), |
| 42 | |
| 43 | /** |
| 44 | * Returns the version of the service |
| 45 | */ |
| 46 | string getVersion(), |
| 47 | |
| 48 | /** |
| 49 | * Gets the status of this service |
| 50 | */ |
| 51 | fb_status getStatus(), |
| 52 | |
| 53 | /** |
| 54 | * User friendly description of status, such as why the service is in |
| 55 | * the dead or warning state, or what is being started or stopped. |
| 56 | */ |
| 57 | string getStatusDetails(), |
| 58 | |
| 59 | /** |
| 60 | * Gets the counters for this service |
| 61 | */ |
| 62 | map<string, i64> getCounters(), |
| 63 | |
| 64 | /** |
| 65 | * Gets the value of a single counter |
| 66 | */ |
| 67 | i64 getCounter(1: string key), |
| 68 | |
| 69 | /** |
| 70 | * Sets an option |
| 71 | */ |
| 72 | void setOption(1: string key, 2: string value), |
| 73 | |
| 74 | /** |
| 75 | * Gets an option |
| 76 | */ |
| 77 | string getOption(1: string key), |
| 78 | |
| 79 | /** |
| 80 | * Gets all options |
| 81 | */ |
| 82 | map<string, string> getOptions(), |
| 83 | |
| 84 | /** |
| 85 | * Returns a CPU profile over the given time interval (client and server |
| 86 | * must agree on the profile format). |
| 87 | */ |
| 88 | string getCpuProfile(1: i32 profileDurationInSec), |
| 89 | |
| 90 | /** |
| 91 | * Returns the unix time that the server has been running since |
| 92 | */ |
| 93 | i64 aliveSince(), |
| 94 | |
| 95 | /** |
pwyckoff | 99b000b | 2008-04-03 19:30:55 +0000 | [diff] [blame] | 96 | * Tell the server to reload its configuration, reopen log files, etc |
| 97 | */ |
David Reiss | cecbed8 | 2009-03-24 20:02:22 +0000 | [diff] [blame] | 98 | oneway void reinitialize(), |
pwyckoff | 99b000b | 2008-04-03 19:30:55 +0000 | [diff] [blame] | 99 | |
| 100 | /** |
| 101 | * Suggest a shutdown to the server |
| 102 | */ |
David Reiss | cecbed8 | 2009-03-24 20:02:22 +0000 | [diff] [blame] | 103 | oneway void shutdown(), |
pwyckoff | 99b000b | 2008-04-03 19:30:55 +0000 | [diff] [blame] | 104 | |
| 105 | } |