pxf cluster CLIEnsure you are set up for PXF development by following the README.md at the root of this repository. This tool requires Go version 1.21 or higher. Follow the directions here to get the language set up.
Run the tests
make test
Build the CLI
make
This will put the binary pxf-cli into pxf/cli/build/. You can also install the binary into ${PXF_HOME}/bin/pxf-cli with:
make install
There is also end to end testing for the pxf-cli. These tests can be run using the GitHub Action CI or locally via the Docker environment defined in ci/.
Because it‘s hard to mock out a Greenplum cluster, it’s useful to debug on a real live cluster. We can do this using the delve project.
dlv command, see here for more details:go install github.com/go-delve/delve/cmd/dlv@latest
source command in the dlv REPL:config max-string-len 1000 break vendor/github.com/apache/cloudberry-go-libs/cluster/cluster.go:351 continue print commandList
dlv command to enter the interactive REPL:cd ~/workspace/pxf/cli GPHOME=/usr/local/greenplum-db dlv debug pxf-cli -- cluster restart
The help page for dlv is useful.