Skip to content
This repository has been archived by the owner on Jun 7, 2021. It is now read-only.

[TRAFODION-2873] Removed usage of system new from LobGlobals and other classes #1405

Merged
merged 5 commits into from Jan 19, 2018

Conversation

sandhyasun
Copy link
Contributor

ExpOBInterfaceInit will take a parent heap and derive a lobHeap from it. ExLobGlobals will get created from this heap and store this heap pointer for use by other classes.
ExpLOBinterfaceCleanup destroys the LOB globals and will utilize the heap pointer stored within it.
In cli/Cli.cpp , Removed the initialization/destruction of LOB glabals from the ::createLOB interface and moved it out before the interface is called to be consistent with other LOB API usage.

… derived from a heap. Moved xLObHdfsRequest also to be derived from a heap
@Traf-Jenkins
Copy link

Check Test Started: https://jenkins.esgyn.com/job/Check-PR-master/2372/

Copy link
Contributor

@selvaganesang selvaganesang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rest of the changes look good

@@ -589,7 +589,7 @@ class ExLobGlobals
{
public :

ExLobGlobals();
ExLobGlobals(NAHeap *lobHeap=NULL);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is better to avoid the default value for this parameter.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes this was only done to be able to compile the call in ExpLobProcess.cpp. Currently this code is unused and is kept around in case we need to offload any processing to another process. This code, invokes LobGlobals and there is no heap available. So I had to make it default just for this unused code. WIll put a comment that it shoudl always pass a heap. In anycase a caller cannot initialize the LobGlobals without passing in a caller's heap - i.e the only way to initialize is by calling ExpLOBinterfaceInit or ExpLOBoper::initLobGlobal. Both require a heap to get passed in.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To @selvaganesang's point, perhaps we should leave this without a default, and then code NULL explicitly in ExpLobProcess.cpp?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure that's another way. Will do that.

@Traf-Jenkins
Copy link

Copy link
Contributor

@DaveBirdsall DaveBirdsall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 Looks good to me.

Int32 rc= ExpLOBoper::initLOBglobal(exLobGlob,currContext.exHeap(),&currContext,hdfsServer,hdfsPort);
if (rc)
{
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't hurt anything, but I'm curious: Why two sets of braces? Looks like one would do?

Int32 rc= ExpLOBoper::initLOBglobal(exLobGlob,currContext.exHeap(),&currContext,hdfsServer,hdfsPort);
if (rc)
{
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment here

Int32 rc= ExpLOBoper::initLOBglobal(exLobGlob,currContext.exHeap(),&currContext,hdfsServer,hdfsPort);
if (rc)
{
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And here

@Traf-Jenkins
Copy link

New Check Test Started: https://jenkins.esgyn.com/job/Check-PR-master/2373/

Copy link
Contributor

@DaveBirdsall DaveBirdsall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 Looks great! Thanks.

@Traf-Jenkins
Copy link

@@ -575,7 +575,7 @@ Lng32 main(Lng32 argc, char *argv[])
// setup log4cxx
QRLogger::initLog4cxx(QRLogger::QRL_LOB);
// initialize lob globals
lobGlobals = new ExLobGlobals();
lobGlobals = new ExLobGlobals(NULL);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for avoiding the default value for the param. But, I think sending heap as NULL might make this program to fail. Have you tested this program? If you have tested this program already, then this PR is ready to be merged.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ExpLOBprocess.cpp is dormant code for now. If we enable it and create a LOB process to offload some operations like GC etc, we will need to create and setup globals , send messages form the master process to it etc . For now I just had to ensure it compiled.

@asfgit asfgit merged commit 4904711 into apache:master Jan 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
5 participants