Skip to content

Commit

Permalink
Disable Annotation RPC
Browse files Browse the repository at this point in the history
  • Loading branch information
johann8384 committed Sep 21, 2016
1 parent 6cb553a commit dc19d8e
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/tools/CliOptions.java
Expand Up @@ -124,6 +124,8 @@ static void overloadConfig(final ArgP argp, final Config config) {
config.overrideConfig("tsd.core.enable_ui", "false");
} else if (entry.getKey().toLowerCase().equals("--disable-api")) {
config.overrideConfig("tsd.core.enable_api", "false");
} else if (entry.getKey().toLowerCase().equals("--disable-annotations")) {
config.overrideConfig("tsd.core.enable_annotations", "false");
} else if (entry.getKey().toLowerCase().equals("--table")) {
config.overrideConfig("tsd.storage.hbase.data_table", entry.getValue());
} else if (entry.getKey().toLowerCase().equals("--uidtable")) {
Expand Down
2 changes: 2 additions & 0 deletions src/tools/TSDMain.java
Expand Up @@ -97,6 +97,8 @@ public static void main(String[] args) throws IOException {
"Set tsd.core.enable_ui to false (default true)");
argp.addOption("--disable-api", "true|false",
"Set tsd.core.enable_api to false (default true)");
argp.addOption("--disable-annotations", "true|false",
"Set tsd.core.enable_annotations to false (default true)");
argp.addOption("--backlog", "NUM",
"Size of connection attempt queue (default: 3072 or kernel"
+ " somaxconn.");
Expand Down
11 changes: 8 additions & 3 deletions src/tsd/RpcManager.java
Expand Up @@ -254,6 +254,7 @@ private void initializeBuiltinRpcs(final String mode,

final Boolean enableApi = tsdb.getConfig().getString("tsd.core.enable_api").equals("true");
final Boolean enableUi = tsdb.getConfig().getString("tsd.core.enable_ui").equals("true");
final Boolean enableAnnotations = tsdb.getConfig().getString("tsd.core.enable_annotations").equals("true");
final Boolean enableDieDieDie = tsdb.getConfig().getString("tsd.no_diediedie").equals("false");

LOG.info("Mode: {}, HTTP UI Enabled: {}, HTTP API Enabled: {}", mode, enableUi, enableApi);
Expand All @@ -272,7 +273,9 @@ private void initializeBuiltinRpcs(final String mode,
final DropCachesRpc dropcaches = new DropCachesRpc();
final ListAggregators aggregators = new ListAggregators();
final SuggestRpc suggest_rpc = new SuggestRpc();
final AnnotationRpc annotation_rpc = new AnnotationRpc();
if (enableAnnotations) {
final AnnotationRpc annotation_rpc = new AnnotationRpc();
}
final Version version = new Version();

telnet.put("stats", stats);
Expand All @@ -296,8 +299,10 @@ private void initializeBuiltinRpcs(final String mode,

if (enableApi) {
http.put("api/aggregators", aggregators);
http.put("api/annotation", annotation_rpc);
http.put("api/annotations", annotation_rpc);
if (enableAnnotations) {
http.put("api/annotation", annotation_rpc);
http.put("api/annotations", annotation_rpc);
}
http.put("api/config", new ShowConfig());
http.put("api/dropcaches", dropcaches);
http.put("api/query", new QueryRpc());
Expand Down
1 change: 1 addition & 0 deletions src/utils/Config.java
Expand Up @@ -490,6 +490,7 @@ protected void setDefaults() {
default_map.put("tsd.core.connections.limit", "0");
default_map.put("tsd.core.enable_api", "true");
default_map.put("tsd.core.enable_ui", "true");
default_map.put("tsd.core.enable_annotations", "true");
default_map.put("tsd.core.meta.enable_realtime_ts", "false");
default_map.put("tsd.core.meta.enable_realtime_uid", "false");
default_map.put("tsd.core.meta.enable_tsuid_incrementing", "false");
Expand Down

0 comments on commit dc19d8e

Please sign in to comment.