top of page
Search
  • delvja01

Week 5

Updated: Jun 24, 2022

Day 1 & 2

I started this week working on adding more function implementations in order to progress the data pipeline from the ecl code a little further. Unfortunately, everything I tried wound up being a dead end. It could be that I am making simple C++ errors, but it is hard to tell without being able to debug my code and step through it. I really wanted to get the debugger working so that I can see why I am getting segmentation faults or why there is an error on line 10500 of hthor.cpp. I am at least starting to get a better grasp on the trace of the code and I'm slowly getting more familiar with it.

The thing that feels good is I know I can do it because I already got documents to be inserted now I just have to figure out how to get input from the ecl code and insert those documents instead of the ones that I hardcoded for testing. Going through Couchbase there is a lot of information that gets stored in a class called Query. I wanted to be able to store information similar to how couchbase does it so I created a similar class MongoDBQuery that hold the database and collection for the specific query and the actual embedded script that needs to get parsed. Setting this up seemed simple enough, but I think it still needs more configuration because every time I try to use a MongoDBQuery object I get a segmentation error. It is hard to debug without being able to step through my code and see why that is happening, so I am not sure how to fix it at this point other than going back to the basics and trying to get it set up correctly.

I am also trying to focus on the gdb debugger because I want to get that working properly. For some reason it isn't finding the breakpoints when I set them so it never pauses on execution. The only other places I have been able to get it to stop are random spots in the eclagent files and there isn't any information about my plugin at that level so it hasn't been very helpful so far.


Day 3 - 5

A lot has happened this week and while it was very slow up until this point I feel like I am finally accellerating a little. Dan wasn't kidding when he said the learning curve for this was steep. It took a long time but the debugger is finally working and I can step through the plugin code now. It feels so much better being able to see what is actually going on and having access to just so much more information about the program really will make this process so much easier. The problem that was stopping me from seeing into the plugin code was an issue with hthor and a recent update they made to it. It called some extra process called /bin/dash and that prevent me from being able to debug it. Switching to roxie was the simple solution and it sucks that it was so simple but also so hard to see and kept me a little behind.

Fortunately, once the debugger was working I was able to make a lot of progress very quickly. I created a class called MongoDBQuery to hold all the information related to the query for each function context. Currently it has fields for the database name, collection name, full embeded script, and the paired parameters from the function definition. It was a bit of a hassle to get the memory allocation working, but at least now I had the debugger and could get a little more information. That helped a lot and I was able to fix everything I came across and now the MongoDBQuery class is pretty useful. Currently, what I understand is that the EmbedFunctionContext class get used to call the EmbedFunctionContext function then it calls loadCompiledScript then bindParams based on the type that is passed. So far I have all of those steps set up and now I am focusing on sending something legit to the database and returning something using the get functions. I can take input from the emebedded script and insert it into a documents, but I still need to get the formatting down for how people will insert a document of multiple types. There are many different ways that someone can insert or create a document and I will need to take all of those into account when taking inputs from the ECL code.

At least now I know what variables and functions to focus and on the whole thing doesn't feel so overwhelming or intimidating. I really am starting to gain some familiarity with the system and it is taking me less and less time to find bugs and fix them before I am moving on to the next step of execution.

25 views0 comments

Recent Posts

See All

Week 10

After getting a parser for bson documents working it is time to start setting up the function calls to build these documents and pipelines. There are a lot of functions that I want the plugin to be ab

Week 9

This week my focus is on a parser that will build MongoDB documents and support everything MongoDB supports. I think the builder that is best for this is the stream builder. In there documentation the

Week 8

Today I was still having a few issues getting the RowStream class to return a result from the MongoDB query. The problem that I was having was that I needed to keep track of the results from the query

Post: Blog2_Post
bottom of page