blob: 60f25d5d277942fb25989183b9d253c365722779 [file] [log] [blame]
<!DOCTYPE html>
<html lang="en">
<head>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="/css/bootstrap.min.css" rel="stylesheet">
<link href="/css/bootstrap-theme.min.css" rel="stylesheet">
<link href="/css/dataTables.bootstrap.css" rel="stylesheet">
<link href="/css/pirk.css" rel="stylesheet" type="text/css">
<link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
<title>For Developers</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="/js/bootstrap.min.js"></script>
<script src="/js/jquery.dataTables.min.js"></script>
<script src="/js/dataTables.bootstrap.js"></script>
<script>
// show location of canonical site if not currently on the canonical site
$(function() {
var host = window.location.host;
if (typeof host !== 'undefined' && host !== 'pirk.incubator.apache.org') {
$('#non-canonical').show();
}
});
// decorate menu with currently navigated page
$(function() {
$("#nav_developers").addClass("active");
});
$(function() {
// decorate section headers with anchors
return $("h2, h3, h4, h5, h6").each(function(i, el) {
var $el, icon, id;
$el = $(el);
id = $el.attr('id');
icon = '<i class="fa fa-link"></i>';
if (id) {
return $el.append($("<a />").addClass("header-link").attr("href", "#" + id).html(icon));
}
});
});
// configure Google Analytics
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-81114308-1', 'auto');
ga('send', 'pageview');
</script>
</head>
<body style="padding-top: 100px">
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar-items">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a href="/"><img id="nav-logo" alt="Apache Pirk" class="img-responsive" src="/images/pirkImage.png" width="150"/></a>
</div>
<div class="collapse navbar-collapse" id="navbar-items">
<ul class="nav navbar-nav">
<li class="nav-link"><a href="/downloads">Download</a></li>
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">Documentation<span class="caret"></span></a>
<ul class="dropdown-menu">
<li id="nav_users"><a href="/for_users">For Users</a></li>
<li id="nav_developers"><a href="/for_developers">For Developers</a></li>
<li id="nav_developers"><a href="/cloud_instructions">Cloud instructions</a></li>
<li id="nav_papers"><a href="/papers">Papers &amp Presentations</a></li>
<li class="nav_faq"><a href="/faq">FAQ</a></li>
<li class="divider"></li>
<li><a href="/javadocs">Javadocs</a></li>
</ul>
</li>
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">Community<span class="caret"></span></a>
<ul class="dropdown-menu">
<li id="nav_getinvolvedpirk"><a href="/get_involved_pirk">Get Involved</a></li>
<li id="nav_listspirk"><a href="/mailing_list_pirk">Mailing Lists</a></li>
<li id="nav_peoplepirk"><a href="/people_pirk">People</a></li>
</ul>
</li>
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">Development<span class="caret"></span></a>
<ul class="dropdown-menu">
<li id="nav_releasing"><a href="/how_to_contribute">How to Contribute</a></li>
<li id="nav_releasing"><a href="/releasing">Making Releases</a></li>
<li id="nav_nav_verify_release"><a href="/verifying_releases">Verifying Releases</a></li>
<li id="nav_update_website"><a href="/website_updates">Website Updates</a></li>
<hr>
<li><a href="https://issues.apache.org/jira/browse/PIRK ">Issue Tracker/JIRA <i class="fa fa-external-link"></i></a></li>
<li><a href="https://builds.apache.org/job/pirk/">Jenkins Builds <i class="fa fa-external-link"></i></a></li>
<li><a href="https://travis-ci.org/apache/incubator-pirk">Travis CI Builds <i class="fa fa-external-link"></i></a></li>
<li><a href="https://github.com/apache/incubator-pirk"> Pirk Github Mirror <i class="fa fa-external-link"></i></a></li>
</ul>
</li>
<li class="nav-link"><a href="/roadmap">Roadmap</a></li>
<ul class="nav navbar-nav navbar-right">
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">Apache Software Foundation<span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="https://www.apache.org">Apache Homepage <i class="fa fa-external-link"></i></a></li>
<li><a href="https://www.apache.org/licenses/LICENSE-2.0">License <i class="fa fa-external-link"></i></a></li>
<li><a href="https://www.apache.org/foundation/sponsorship">Sponsorship <i class="fa fa-external-link"></i></a></li>
<li><a href="https://www.apache.org/security">Security <i class="fa fa-external-link"></i></a></li>
<li><a href="https://www.apache.org/foundation/thanks">Thanks <i class="fa fa-external-link"></i></a></li>
<li><a href="https://www.apache.org/foundation/policies/conduct">Code of Conduct <i class="fa fa-external-link"></i></a></li>
</ul>
</li>
</ul>
</ul>
</div>
</div>
</nav>
<div class="container">
<div class="row">
<div class="col-md-12">
<div id="content">
<h1 class="title">For Developers</h1>
<ol>
<li><a href="#general-info">General Info</a></li>
<li><a href="#code-repo">Code Repo</a></li>
<li><a href="#coding-standards">Coding Standards</a>
<ul>
<li><a href="#apache-license-header">Apache License Header</a></li>
<li><a href="#author-tags">Author Tags</a></li>
<li><a href="#code-formatting">Code Formatting</a></li>
<li><a href="#ide-configuration-tips">IDE Configuration Tips</a>
<ul>
<li><a href="#eclipse">Eclipse</a></li>
<li><a href="#intellij">IntelliJ</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#javadocs">JavaDocs</a></li>
<li><a href="#building">Building</a></li>
<li><a href="#continuous-integration">Continuous Integration</a></li>
<li><a href="#testing">Testing</a></li>
<li><a href="#debugging">Debugging</a></li>
<li><a href="#paillier-benchmarking">Paillier Benchmarking</a></li>
<li><a href="#release-process">Release Process</a></li>
<li><a href="#how-to-contribute">How To Contribute</a></li>
</ol>
<h2 id="general-info">General Info</h2>
<p>Pirk is written in Java 8 and build and dependency management is accomplished via <a href="https://maven.apache.org/">Apache Maven</a>. Pirk uses <a href="https://git-scm.com/">Git</a> for change management.</p>
<h2 id="code-repo">Code Repo</h2>
<p>The Pirk code is available via the <a href="https://git-wip-us.apache.org/repos/asf?p=incubator-pirk.git">Pirk git repository</a> and is mirrored to <a href="https://github.com/apache/incubator-pirk">Github</a>.</p>
<p>To check out the code:</p>
<div class="highlighter-rouge"><pre class="highlight"><code>git clone http://git.apache.org/incubator-pirk.git/
</code></pre>
</div>
<p>Then checkout the ‘master’ branch (which should be the default):</p>
<div class="highlighter-rouge"><pre class="highlight"><code>git checkout master
</code></pre>
</div>
<h2 id="coding-standards">Coding Standards</h2>
<h3 id="apache-license-header">Apache License Header</h3>
<p>Always add the current ASF license header as described <a href="https://www.apache.org/legal/src-headers">here</a>. Please use the provided ‘eclipse-pirk-template.xml’ code template file to automatically add the ASF header to new code.</p>
<h3 id="author-tags">Author Tags</h3>
<p>Please do not use author tags; the code is developed and owned by the community.</p>
<h3 id="code-formatting">Code Formatting</h3>
<p>Pirk follows coding style practices found in the <a href="https://github.com/apache/incubator-pirk">eclipse-pirk-codestyle.xml</a> file; please ensure that all contributions are formatted accordingly.</p>
<h3 id="ide-configuration-tips">IDE Configuration Tips</h3>
<h4 id="eclipse">Eclipse</h4>
<ul>
<li>Import Formatter: Properties &gt; Java Code Style &gt; Formatter and import the <a href="https://github.com/apache/incubator-pirk">eclipse-pirk-codestyle.xml</a> file.</li>
<li>Import Template: Properties &gt; Java Code Style &gt; Code Templates and import the <a href="https://github.com/apache/incubator-pirk">eclipse-pirk-template.xml</a>. Make sure to check the “Automatically add comments” box. This template adds the ASF header and so on for new code.</li>
</ul>
<h4 id="intellij">IntelliJ</h4>
<ul>
<li>Formatter <a href="https://code.google.com/p/eclipse-code-formatter-intellij-plugin">plugin</a> that uses eclipse code style xml.</li>
</ul>
<h2 id="javadocs">JavaDocs</h2>
<p>Pirk Javadocs may be found <a href="/javadocs">here</a>.</p>
<h2 id="building">Building</h2>
<p>Pirk currently follows a simple Maven build with a single level pom.xml. As such, Pirk may be built via ‘mvn package’.</p>
<p>For convenience, the following POM files are included:</p>
<ul>
<li>pom.xml — Pirk pom file for Hadoop/YARN and Spark platforms</li>
<li>pom-with-benchmarks.xml — Pirk pom file for running Paillier benchmarking testing</li>
</ul>
<p>Pirk may be built with a specific pom file via ‘mvn package -f <specificpom.xml></specificpom.xml></p>
<h2 id="continuous-integration">Continuous Integration</h2>
<p>Pirk uses <a href="https://builds.apache.org/">Jenkins</a> for continuous integration. The build history is available <a href="https://builds.apache.org/job/pirk/">here</a>.</p>
<p>Pirk also uses <a href="https://travis-ci.org/">Travis CI</a> for continuous integration for Github Pull Requests; you can find the build history <a href="https://travis-ci.org/apache/incubator-pirk">here</a>.</p>
<h2 id="testing">Testing</h2>
<p>JUnit in-memory unit and functional testing is performed by building with ‘mvn package’ or running the tests with ‘mvn test’. Specific tests may be run using the Maven command ‘mvn -Dtest=<testname> test’.</testname></p>
<p>Distributed functional testing may be performed on a cluster with the desired distributed computing technology installed. Currently, distributed implementations include batch processing in Hadoop MapReduce and Spark with inputs from HDFS or Elasticsearch.</p>
<p>To run all of the distributed functional tests on a cluster, the following ‘hadoop jar’ command may be used:</p>
<div class="highlighter-rouge"><pre class="highlight"><code>hadoop jar &lt;pirkJar&gt; org.apache.pirk.test.distributed.DistributedTestDriver -j &lt;full path to pirkJar&gt;
</code></pre>
</div>
<p>Specific distributed test suites may be run via providing corresponding command line options. The available options are given by the following command:</p>
<div class="highlighter-rouge"><pre class="highlight"><code>hadoop jar &lt;pirkJar&gt; org.apache.pirk.test.distributed.DistributedTestDriver --help
</code></pre>
</div>
<p>The Pirk functional tests using Spark run via utilizing the <a href="https://spark.apache.org/docs/1.6.0/api/java/org/apache/spark/launcher/package-summary.html">SparkLauncher</a> via the ‘hadoop jar’ command (not by directly running with ’spark-submit’).
To run successfully, the ‘spark.home’ property must be set correctly in the ‘pirk.properties’ file; ’spark-home’ is the directory containing ’bin/spark-submit’.</p>
<h2 id="debugging">Debugging</h2>
<p>Pirk uses <a href="http://logging.apache.org/log4j/1.2/">log4j</a> for logging. The log4j.properties file may be edited to turn allow a ‘debug’ log level.</p>
<h2 id="paillier-benchmarking">Paillier Benchmarking</h2>
<p>Pirk includes a benchmarking package leveraging <a href="http://openjdk.java.net/projects/code-tools/jmh/">JMH</a>. Currently, <a href="/javadocs/org/apache/pirk/benchmark/PaillierBenchmark">Paillier benchmarking</a> is enabled in Pirk.</p>
<p>To build with benchmarks enabled, use:</p>
<div class="highlighter-rouge"><pre class="highlight"><code>mvn package -f pom-with-benchmarks.xml
</code></pre>
</div>
<p>To run the benchmarks, use:</p>
<div class="highlighter-rouge"><pre class="highlight"><code>java -jar target/benchmarks.jar
</code></pre>
</div>
<p>Optionally, you can reduce the number of times each benchmark is run (default is 10) using the -f flag. For example, to run each benchmark only twice, use: ’java -jar target/benchmarks.jar -f 2’</p>
<p>FYI - Right now this spits out a lot of logging errors as the logger fails to work while benchmarks are running. Ignore the many stack traces and wait for execution to complete to see statistics on the different benchmarks.</p>
<h2 id="release-process">Release Process</h2>
<p>Please see <a href="/making_releases">Making Releases</a> and <a href="/verifying_releases">Verifying Releases</a>.</p>
<h2 id="how-to-contribute">How to Contribute</h2>
<p>Please see the <a href="/how_to_contribute">How to Contribute</a> page.</p>
</div>
<footer>
<p><a href="https://www.apache.org"><img src="/images/feather-small.gif" alt="Apache Software Foundation" id="asf-logo" height="100" /></a></p>
<p>Copyright © 2016-2016 The Apache Software Foundation. Licensed under the <a href="https://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p>
</footer>
</div>
</div>
</div>
</body>
</html>