MCPcopy Create free account
hub / github.com/OpenTSDB/opentsdb / initialize

Method initialize

test/search/DummySearchPlugin.java:25–40  ·  view source on GitHub ↗
(TSDB tsdb)

Source from the content-addressed store, hash-verified

23public final class DummySearchPlugin extends SearchPlugin {
24
25 @Override
26 public void initialize(TSDB tsdb) {
27 if (tsdb == null) {
28 throw new IllegalArgumentException("The TSDB object was null");
29 }
30 // some dummy configs to check to throw exceptions
31 if (!tsdb.getConfig().hasProperty("tsd.search.DummySearchPlugin.hosts")) {
32 throw new IllegalArgumentException("Missing hosts config");
33 }
34 if (tsdb.getConfig().getString("tsd.search.DummySearchPlugin.hosts")
35 .isEmpty()) {
36 throw new IllegalArgumentException("Empty Hosts config");
37 }
38 // throw an NFE for fun
39 tsdb.getConfig().getInt("tsd.search.DummySearchPlugin.port");
40 }
41
42 @Override
43 public Deferred<Object> shutdown() {

Callers

nothing calls this directly

Calls 5

isEmptyMethod · 0.80
hasPropertyMethod · 0.45
getConfigMethod · 0.45
getStringMethod · 0.45
getIntMethod · 0.45

Tested by

no test coverage detected