MCPcopy Index your code
hub / github.com/OpenTSDB/opentsdb / PutDataPointRpc

Class PutDataPointRpc

src/tsd/PutDataPointRpc.java:73–891  ·  view source on GitHub ↗

This class handles the parsing and writing of data points over any of the implemented RPCs. Each put method should track the deferred of the tsdb.addPoint() method so that we know whether or not the write was actually successful. Note that if HBase is backed up, then the arguments will hang

Source from the content-addressed store, hash-verified

71 * data points such as Rollups or Pre-Aggregates
72 */
73class PutDataPointRpc implements TelnetRpc, HttpRpc {
74 protected static final Logger LOG = LoggerFactory.getLogger(PutDataPointRpc.class);
75 protected static final ArrayList<Boolean> EMPTY_DEFERREDS =
76 new ArrayList<Boolean>(0);
77 protected static final AtomicLong telnet_requests = new AtomicLong();
78 protected static final AtomicLong telnet_requests_unauthorized = new AtomicLong();
79 protected static final AtomicLong telnet_requests_forbidden = new AtomicLong();
80 protected static final AtomicLong http_requests = new AtomicLong();
81 protected static final AtomicLong http_requests_unauthorized = new AtomicLong();
82 protected static final AtomicLong http_requests_forbidden = new AtomicLong();
83 protected static final AtomicLong raw_dps = new AtomicLong();
84 protected static final AtomicLong raw_histograms = new AtomicLong();
85 protected static final AtomicLong rollup_dps = new AtomicLong();
86 protected static final AtomicLong raw_stored = new AtomicLong();
87 protected static final AtomicLong raw_histograms_stored = new AtomicLong();
88 protected static final AtomicLong rollup_stored = new AtomicLong();
89 protected static final AtomicLong hbase_errors = new AtomicLong();
90 protected static final AtomicLong unknown_errors = new AtomicLong();
91 protected static final AtomicLong invalid_values = new AtomicLong();
92 protected static final AtomicLong illegal_arguments = new AtomicLong();
93 protected static final AtomicLong unknown_metrics = new AtomicLong();
94 protected static final AtomicLong inflight_exceeded = new AtomicLong();
95 protected static final AtomicLong writes_blocked = new AtomicLong();
96 protected static final AtomicLong writes_timedout = new AtomicLong();
97 protected static final AtomicLong requests_timedout = new AtomicLong();
98
99 /** Whether or not to send error messages back over telnet */
100 private final boolean send_telnet_errors;
101
102 /** The type of data point we're writing.
103 * @since 2.4 */
104 public enum DataPointType {
105 PUT("put"),
106 ROLLUP("rollup"),
107 HISTOGRAM("histogram");
108
109 private final String name;
110 DataPointType(final String name) {
111 this.name = name;
112 }
113
114 @Override
115 public String toString() {
116 return name;
117 }
118 }
119
120 /**
121 * Default Ctor
122 * @param config The TSDB config to pull from
123 */
124 public PutDataPointRpc(final Config config) {
125 send_telnet_errors = config.getBoolean("tsd.rpc.telnet.return_errors");
126 }
127
128 @Override
129 public Deferred<Object> execute(final TSDB tsdb, final Channel chan,
130 final String[] cmd) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…