You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 18 Current »

Contains how-to information referenced from other chapters in this guide.



Source Download




You can obtain the Trafodion source code using one of these methods:

Git Fork

If you intend to make changes to the Trafodion source tree, then install the source tree from GitHub.

Install Git Tools

If you haven’t done so already, install the Git Tools:

 

Download Trafodion Source Tree

You download the Trafodion source tree once the git tools have been installed.

Fork Trafodion Repository

You create a private fork of Trafodion on https://github.com/apache/trafodion. Use the fork button top-right on the page to create your fork, which will be named <your-github-id>_fork.

The following examples use trafdeveloper to represent <your-github-id>.

 

Clone Trafodion Repository

Use the git shell to perform this task.


Clone Trafodion Repository
# Move to the directory where you want to install the Trafodion source code.
cd mysource

# Clone the Trafodion source code
git clone git://git.apache.org/trafodion.git
 
# Change to the Trafodion source-tree directory
cd trafodion

# Register your fork as a remote branch
git remote add trafdeveloper_fork git@github.com:trafdeveloper/trafodion
Create Task Branch

You create a task branch to make changes to the Trafodion source tree. Typically, we name the branches after the Jira we are working on. In this example, the Jira is: TRAFODION-1507.

Create Task Branch
# Ensure that you have the latest changes
git fetch --all

# Checkout source
git checkout -b TRAFODION-1507 origin/master

tar/zip Download

Typically, you download the Trafodion source tree as a tar/zip file if you don’t intend the change the source code. For example, when you want to build the Trafodion binaries only.

 

tar file


Download Locationhttps://dist.apache.org/repos/dist/release/trafodion/

  1. Open the trafodion folder.

    PGP Key

    The source tar file has been signed with one of the pgp keys, which is included in the download location’s KEYS file.

  2. Open the folder containing the version you want to download. For example: apache-trafodion-1.3.0-incubating

  3. Download the -src file that fits your security needs. For example: apache-trafodion-1.3.0-incubating-src.tar.gz

  4. Unpack the tar file:

    mkdir <target-directory>
    tar -xzf <tar file> -C <target-directory>
    # Change direcotry name to match GitHub download name; makes this guide simpler to write.
    mv <target-directory>/apache-trafodion-<version>-incubating <target-directory>/trafodion

    Example

    $ mkdir ~/mysource
    $ tar -xzf apache-trafodion-1.3.0-incubating-src.tar.gz -C ~/mysource
    $ ls mysource
    apache-trafodion-1.3.0-incubating
    $ ls mysource/apache-trafodion-1.3.0-incubating
    core  DISCLAIMER.txt  env.sh   licenses     Makefile    pom.xml         README.txt  win-odbc64
    dcs   docs            install  LICENSE.txt  NOTICE.txt  RAT_README.txt  tests       wms
    $ # Change directory name to match GitHub download name; makes this guide simpler to write.
    $ mv mysource/apache-trafodion-1.3.0-incubating mysource/trafodion
    $ ls mysource
    trafodion


zip File

Click on Download ZIP at https://github.com/apache/trafodion. The zip file will be named trafodion-master.zip.

  1. If necessary, FTP the zip file to your Linux development environment using WinSCP or a similar tool.
  2. Unzip to the target directory.

    Unzip Trafodion Source
    unzip -q trafodion-master.zip -d mysource

    Example

     

    Unzip Example
    $ unzip -q trafodion-master.zip -d mysource
    $ ls mysource
    trafodion-master
    $ ls mysource/trafodion-master
    core  DISCLAIMER.txt  env.sh   licenses     Makefile    pom.xml         README.txt  win-odbc64
    dcs   docs            install  LICENSE.txt  NOTICE.txt  RAT_README.txt  tests       wms
    $ # Change directory name to match GitHub download name; makes this guide simpler to write.
    $ mv mysource/trafodion-master mysource/trafodion
    $ ls mysource
    trafodion
 

Git Cheat Sheet

Download Git Tools

Refer to Git Tools Download.

Set-Up Git Environment

Refer to GitHub Documentation

Setup ssh Keys

Refer to ssh Keys.

Fork Trafodion Source Tree

Example
trafdeveloper_fork

Clone Repository

Do the following:

# Move to the directory where you want to install the Trafodion source code.
cd mysource

# Clone the Trafodion source code
git clone git://git.apache.org/trafodion.git

# Change to the source-tree directory
cd trafodion
 
# Register your fork as a remote branch
git remote add <your-github-id>_fork git@github.com:<your-github-id>/trafodion
Example: Clone Repository
# Move to the directory where you want to install the Trafodion source code.
cd mysource

# Clone the Trafodion source code
git clone git://git.apache.org/trafodion.git

# Register your fork as a remote branch
cd trafodion
git remote add trafdeveloper_fork git@github.com:trafdeveloper/trafodion

Create Task Branch

Do the following:

# Ensure that you have the latest changes
git fetch --all

# Checkout source
git checkout -b TRAFODION-<jira-number> origin/master
Example: Create Task Branch
# Ensure that you have the latest changes
git fetch --all

# Checkout source
git checkout -b TRAFODION-1507 origin/master

Merge Changes

Merge changes from the master branch using the following commands:

Merge Changes
git fetch origin ; git merge origin/master

 

Commit Changes

Do the following:

# Commit changes
git commit -a

# Dry-run check against main branch
git push -n <your-github-id>_fork HEAD

# Push changes to your private fork
git push <your-github-id>_fork TRAFODION-1507
Example: Commit Changes
# Commit changes
git commit -a

# Dry-run check against main branch
git push -n trafdeveloper_fork HEAD

# Push changes to your private fork
git push trafdeveloper_fork TRAFODION-1507

Create Pull Request

Use the GitHub web interface to generate pull requests.

Checkout Code

Do the following:

git checkout TRAFODION-<jira-number>
Example: Checkout Code
git checkout TRAFODION-1507

 

Force Core Dump on Specific SQL Error

You can force Trafodion to abort and core dump on a specific error. Use this method:

  • If you want to catch errors in processes other than sqlci, edit the $MY_SQROOT/etc/ms.env file and add the following line

    ABORT_ON_ERROR=<error-number>

    There is only one error number that will take effect, so if you have two lines of ABORT_ON_ERROR, the last one wins.

  • If you want to catch errors on all nodes of the cluster, copy the edited file to all nodes of the cluster:

    pdsh $MY_NODES $MY_SQROOT/etc/ms.env $MY_SQROOT/etc

 

  • If you want to catch errors in the sqlci program, export this environment variable, then run sqlci:

    export ABORT_ON_ERROR=<error-number>
    sqlci

 

This will help you to debug when a query run into a SQL error, and it is hard to figure out which code path it runs into. Note that the changes in ms.env will affect all processes on that node and therefore could disrupt operation of your cluster.

 

 

 

  • No labels