Debugging elastic search code with IntelliJ - elasticsearch

I am trying to debug the Elasticsearch source code with IntelliJ. I built the source with IntelliJ and the current Program argument is start. I tried passing the parameters necessary to create an index in the program argument section but it doesn't seem to work. Where do I need to pass the parameters to create indices or perform other operations?

To being testing/debugging requests, you will need to start the server by adding the start command as a Program argument. Once the server has started, open up a terminal and provide curl commands. You can place break points in the code to view the workflows involved.

Related

use of multiple custom scripts in metadata parameter of the LaunchInstanceDetails method in oci.core.model

I understand that the LaunchInstanceDetails method in oci.core.model has a parameter -> metadata , wherein one of the metadata key-names that can be used to provide information to Cloud-Init is -> “user_data” , which can be used to run custom scripts by Could-Init when provided in a base64-encoded format.
In my Python code to create a Windows VM,while launching the instance, I have a requirement to run 2 custom scripts:
Script to login to Windows machine via RDP – this is absolute(needs to be executed every time a new Windows VM is created without fail) – Currently , we have included this in the metadata parameter while launching the instance, as below:
instance_metadata['user_data'] = oci.util.file_content_as_launch_instance_user_data(path_init)
Bootstrap script to Install Chef during the initialization tasks - this is conditional ( this needs to run only if the user wishes to Install Chef and we internally handle it by means of a flag in the code) – Yet to be implemented as we need to identify if more than one custom script (conditional in this case) can be included.
Can someone help me understand if and how we can achieve to include multiple scripts(keeping in mind the conditional clause) in a single metadata variable or can we have multiple metadata or some other parameter in this service that could be utilised to run the Chef Installation script
I'd suggest combining these into a single script and using the conditional in a if statement to install Chef as required.

JMeter - Execute specific components only on GUI and not CLI

I add several components for debugging as Debug Sampler, View Results Tree and JSR223 Sampler that are useful in GUI mode, but I want it to be ignored when running load test,
Is there such option of executing Sampler/Listener only in GUI mode and not in command line/"load" mode?
I am not sure that this is the exact answer you are looking for but still let me try. We know that JMeter script is nothing but xml in disguise and structure look like this.
So for every Jmeter component, there is enable property which needs to be true so that it will get executed as part of JMeter Test plan. Now if we can change this some properties which can be passed as parameter then we can make them disable at the run time.
Change in jmx will be reflected like this...
If you run this script in Non GUI mode with additional property passed as parameter, we essentially achieve what we want.
jmeter -n -t .\ExcludeJMeterComponent.jmx -l result.CSV -e -o "Output" -DenabledDebugComponents=false
Issue with this approach is, if you load this script again in JMeter, these values, manually edited jmx going to go away/get override with your next save but if you are using any version control system to keep track of your jmx script [which you must be doing] it will be very easy to add this changes in the script again in no time.
I will post this with more details once my blog is set up.
Found a workaround, to send in CLI JMeter property as -JignoreFirstSampler
Add If Controller as a parent of samplers to exclude checking if property is defined
${__isPropDefined(ignoreFirstSampler)}
The __isPropDefined function returns true if property exists or false if not.

System Testing a Mongoose Server

I'm curious as to the best/correct way to setup System level black-box tests for a Mongoose C++ based Web Application project I've been working on. This needs to run in an automatic way within a jenkins script.
The idea is to run something like:
1. Start the server
2. Submit HTTP Get requests with predefined query parameters
3. Check that the result is as expected.
4. Run (2), (3) with different combinations
5. Close the server
One possible way to do this is to whip up a python script which runs the executable generate by make, runs the tests and then kills the spawned process.
Is there a better/more structured way of doing this(and accompanying tools/libraries) either using Python or C++?

How to run spark-jobs outside the bin folder of spark-2.1.1-bin-hadoop2.7

I have an existing spark-job, the functionality of this spark-job is to connect kafka-server get the data and then storing the data into cassandra tables, now this spark-job is running on server inside spark-2.1.1-bin-hadoop2.7/bin but whenever I am trying to run this spark-job from other location, Its not running, this spark-job contains some JavaRDD related code.
Is there any chance, I can run this spark-job from outside also by adding any dependency in pom or something else?
whenever I am trying to run this spark-job from other location, Its not running
spark-job is a custom launcher script for a Spark application, perhaps with some additional command-line options and packages. Open it, review the content and fix the issue.
If it's too hard to figure out what spark-job does and there's no one nearby to help you out, it's likely time to throw it away and replace with the good ol' spark-submit.
Why don't you use it in the first place?!
Read up on spark-submit in Submitting Applications.

Restart Go's net/http server on file-change like Django

I'm trying out Martini, which adds some nice functionality upon Go's basic net/http package.
I was wondering tho. How can I, like Django does too, let the server restart itself on source-file changes? I know how to monitor a file, but I'm not sure how to retrigger the Server within the same process.
I'm guessing to trigger http.ListenAndServe again, but I have a feeling it doesn't go well with instance already running.
Do I need to spawn a subprocess/daemon to get this working?
Maybe you need gin ?
Made by the creator of Martini.
You may give it a try
Fresh is a command line tool that builds and (re)starts your web application everytime you save a Go or template file.
You'll need to use an external tool that can watch a directory/files and run a command. I'd recommend reflex which is written in Go itself:
(modifying the example in the README):
# Rerun make whenever a .go file changes
reflex -r '\.go$' ./mymartiniapp

Resources