Remove prelert_ prefix from programs to fit what Elasticsearch expects (elastic/elasticsearch#332)

Elasticsearch will now attempt to spawn a controller daemon called simply
`controller` when it starts up, but ours was called `prelert_controller`.
For consistency it makes sense to remove the prefix from all our programs.

Original commit: elastic/x-pack-elasticsearch@d06714b231
This commit is contained in:
David Roberts 2016-11-24 22:21:17 +00:00 committed by GitHub
parent a627e6621c
commit d1bf5d83ad
4 changed files with 10 additions and 11 deletions

View File

@ -37,19 +37,19 @@ public class ProcessCtrl {
/**
* Autodetect API native program name - always loaded from the same directory as the controller process
*/
public static final String AUTODETECT = "prelert_autodetect";
public static final String AUTODETECT = "autodetect";
static final String AUTODETECT_PATH = "./" + AUTODETECT;
/**
* The normalisation native program name - always loaded from the same directory as the controller process
*/
public static final String NORMALIZE = "prelert_normalize";
public static final String NORMALIZE = "normalize";
static final String NORMALIZE_PATH = "./" + NORMALIZE;
/**
* Process controller native program name
*/
public static final String CONTROLLER = "prelert_controller";
public static final String CONTROLLER = "controller";
/**
* Name of the config setting containing the path to the logs directory
@ -73,7 +73,7 @@ public class ProcessCtrl {
static final String LICENSE_VALIDATION_ARG = "--licenseValidation=";
/*
* Arguments used by both prelert_autodetect and prelert_normalize
* Arguments used by both autodetect and normalize
*/
static final String BUCKET_SPAN_ARG = "--bucketspan=";
public static final String DELETE_STATE_FILES_ARG = "--deleteStateFiles";
@ -85,7 +85,7 @@ public class ProcessCtrl {
static final String PER_PARTITION_NORMALIZATION = "--perPartitionNormalization";
/*
* Arguments used by prelert_autodetect
* Arguments used by autodetect
*/
static final String BATCH_SPAN_ARG = "--batchspan=";
static final String LATENCY_ARG = "--latency=";

View File

@ -69,9 +69,9 @@ public class ProcessPipes {
boolean wantRestorePipe, boolean wantPersistPipe) {
this.namedPipeHelper = namedPipeHelper;
// The way the pipe names are formed MUST match what is done in the prelert_controller main()
// The way the pipe names are formed MUST match what is done in the controller main()
// function, as it does not get any command line arguments when started as a daemon. If
// you change the code here then you MUST also change the C++ code in prelert_controller's
// you change the code here then you MUST also change the C++ code in controller's
// main() function.
StringBuilder prefixBuilder = new StringBuilder();
prefixBuilder.append(namedPipeHelper.getDefaultPipeDirectoryPrefix(env)).append(Objects.requireNonNull(processName)).append('_');

View File

@ -35,8 +35,7 @@ public class FieldConfigWriter {
private static final String LIST_PREFIX = "list.";
// Note: for the Engine API summarycountfield is currently passed as a
// command line option to prelert_autodetect rather than in the field
// config file
// command line option to autodetect rather than in the field config file
private static final char NEW_LINE = '\n';

View File

@ -24,10 +24,10 @@ public class CppLogMessageHandlerTests extends ESTestCase {
+ "\"method\":\"core::CLogger::reconfigureFromProps\",\"file\":\"CLogger.cc\",\"line\":452}\n"
+ "{\"logger\":\"controller\",\"timestamp\":1478261151445,\"level\":\"DEBUG\",\"pid\":10211,\"thread\":\"0x7fff7d2a8000\","
+ "\"message\":\"Logger is logging to named pipe "
+ "/var/folders/k5/5sqcdlps5sg3cvlp783gcz740000h0/T/prelert_controller_log_784\",\"class\":\"prelert\","
+ "/var/folders/k5/5sqcdlps5sg3cvlp783gcz740000h0/T/controller_log_784\",\"class\":\"prelert\","
+ "\"method\":\"core::CLogger::reconfigureLogToNamedPipe\",\"file\":\"CLogger.cc\",\"line\":333}\n"
+ "{\"logger\":\"controller\",\"timestamp\":1478261151445,\"level\":\"INFO\",\"pid\":10211,\"thread\":\"0x7fff7d2a8000\","
+ "\"message\":\"prelert_controller (64 bit): Version based on 6.5.0 (Build DEVELOPMENT BUILD by dave) "
+ "\"message\":\"controller (64 bit): Version based on 6.5.0 (Build DEVELOPMENT BUILD by dave) "
+ "Copyright (c) Prelert Ltd 2006-2016\",\"method\":\"main\",\"file\":\"Main.cc\",\"line\":123}\n"
+ "{\"logger\":\"controller\",\"timestamp\":1478261169065,\"level\":\"ERROR\",\"pid\":10211,\"thread\":\"0x7fff7d2a8000\","
+ "\"message\":\"Did not understand verb 'a'\",\"class\":\"prelert\","