pxf
pxf copied to clipboard
Parse cluster.txt in C extension
trafficstars
PXF 7 will support multi-cluster feature and thus the C extension needs the functionality to know which PXF host and port to communicate with. This PR does the following:
- Create a new folder
extension-commonto store C source and test files shared by fdw and external-table extensions - Create
pxfconfigparsermodule underextension-commonfolder. It includes a header file, a source file and a test file. - Add
MakefileandREADME.mdtoextension-commonfolder for compiling the tests. - Add
pxf_deployment,pxf_cluster,pxf_service_groupandpxf_hoststructs toextension-common/pxfconfigparser.hheader file. Also add some macros in the file. - Add functions to
extension-common/pxfconfigparser.cfor parsingcluster.txtofdefaultcluster into apxf_deploymentstruct instance.- For now, there is only one PXF cluster:
default. - For now, the PXF_HOME is passed in as a parameter for parsing cluster.txt. We will use custom GUC instead of parameter in function later.
- For now, there is only one PXF cluster:
- Add cleanup function
deployment_cleanup()toextension-common/pxfconfigparser.cto free up the memory used bypxf_deployment. - Add unit tests for the parser
Other changes:
- Include the
extension-common/pxfconfigparser.oin the Makefile ofexternal-tableandfdw. - Identify some places where the parser may be used and add comments there. Also include the header file there.
- Add a fixture folder
extension-common/test/resourcesand some*.txtfiles for testing purpose.