Title: Apache Accumulo Source Code & Developers Guide Skiph1fortitle: true Nav: nav_source Notice: 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.
Quick Links
Accumulo source Master build on Jenkins Accumulo JIRA
## Source Code ### Apache Accumulo Apache Accumulo™ source code is maintained using [Git][git] version control ([browse][cgit]|[checkout][anongit]). It builds with [Apache Maven][maven]. Instructions for configuring git are [here](https://git-wip-us.apache.org/). ### Contrib Projects Accumulo has a number of [contrib projects](contrib.html) that maintain their own code repositories and release schedules. ### Website Accumulo's web site is maintained with [Apache Subversion][subversion] [here][sitesvn] using Apache's [Content Management System][cms]. Committers may edit the site by following [these instructions][cmsusage]. Non-committers should follow [this FAQ entry][cmsanon]. ## Developer's Guide ### Building #### Installing Thrift If you activate the 'thrift' Maven profile, the build of some modules will attempt to run the Apache Thrift command line to regenerate stubs. If you activate this profile and don't have Apache Thrift installed and in your path, you will see a warning and your build will fail. For Accumulo 1.5.0 and greater, install Thrift 0.9 and make sure that the 'thrift' command is in your path. Watch out for THRIFT-1367; you may need to configure Thrift with --without-ruby. Most developers do not need to install or modify the Thrift definitions as a part of developing against Apache Accumulo. #### Checking out from Git To check out the code: git clone http://git-wip-us.apache.org/repos/asf/accumulo.git #### Running a Build Accumulo uses [Apache Maven][maven] to handle source building, testing, and packaging. To build Accumulo you will need to use Maven version 3.0.4 or later. To build the code: mvn package -P assemble This will create a file accumulo-*-SNAPSHOT-dist.tar.gz in the assemble/target directory. For older branches, "mvn package && mvn assembly:single" may be required instead, and the tar will be built in the target directory. If you regularly switch between major development branches, you may receive errors about improperly licensed files from the [RAT plugin][1]. This is caused by modules that exist in one branch and not the other leaving Maven build files that the RAT plugin no longer understands how to ignore. The easiest fix is to ensure all of your current changes are stored in git and then cleaning your workspace. $> git add path/to/file/that/has/changed $> git add path/to/other/file $> git clean -df Note that this git clean command will delete any files unknown to git in a way that is irreversible. You should check that no important files will be included by first looking at the "untracked files" section in a ```git status``` command. $> git status # On branch master nothing to commit (working directory clean) $> mvn package { maven output elided } $> git checkout 1.6.1-SNAPSHOT Switched to branch '1.6.1-SNAPSHOT' $> git status # On branch 1.6.1-SNAPSHOT # Untracked files: # (use "git add ..." to include in what will be committed) # # mapreduce/ # shell/ nothing added to commit but untracked files present (use "git add" to track) $> git clean -df Removing mapreduce/ Removing shell/ $> git status # On branch 1.6.1-SNAPSHOT nothing to commit (working directory clean) ### Continuous Integration Accumulo uses [Jenkins][jenkins] for automatic builds. [Master][masterbuild] [1.6 Branch][16build] [1.5 Branch (Hadoop 2)][15buildh2] [1.5 Branch (Hadoop 1)][15build] ### Issue Tracking Accumulo [tracks issues][jiraloc] with [JIRA][jira]. Every commit should reference a JIRA ticket of the form ACCUMULO-#. ### Merging Practices Changes should be merged from earlier branches of Accumulo to later branches. Ask the [dev list][devlist] for instructions. ### Public API Refer to the README in the release you are using to see what packages are in the public API. Changes to non-private members of those classes are subject to additional scrutiny to minimize compatibility problems across Accumulo versions. ### Coding Practices
License HeaderAlways add the current ASF license header as described in ASF Source Header.
Trailing WhitespacesRemove all trailing whitespaces. Eclipse users can use Source→Cleanup option to accomplish this.
IndentationUse 2 space indents and never use tabs!
Line WrappingUse 160-column line width for Java code and Javadoc.
Control Structure New LinesUse a new line with single statement if/else blocks.
Author TagsDo not use Author Tags. The code is developed and owned by the community.
### Code Review Accumulo has [guidelines for using Review Board][rb] to support code reviews. ### IDE Configuration Tips #### Eclipse * Download Eclipse [formatting and style guides for Accumulo][styles]. * Import Formatter: Preferences > Java > Code Style > Formatter and import the Eclipse-Accumulo-Codestyle.xml downloaded in the previous step. * Import Template: Preferences > Java > Code Style > Code Templates and import the Eclipse-Accumulo-Template.xml. Make sure to check the "Automatically add comments" box. This template adds the ASF header and so on for new code. #### IntelliJ * Formatter [plugin](https://code.google.com/p/eclipse-code-formatter-intellij-plugin/) that uses eclipse code style xml. ### Release Guide Accumulo's release guide can be found [here][release]. [subversion]: http://subversion.apache.org/ [sitesvn]: https://svn.apache.org/repos/asf/accumulo/site/ [maven]: http://maven.apache.org/ [srcheaders]: http://www.apache.org/legal/src-headers.html [styles]: https://git-wip-us.apache.org/repos/asf?p=accumulo.git;a=tree;f=contrib;hb=HEAD [jenkins]: http://jenkins-ci.org/ [masterbuild]: https://builds.apache.org/job/Accumulo-Master/ [16build]: https://builds.apache.org/job/Accumulo-1.6/ [15buildh2]: https://builds.apache.org/job/Accumulo-1.5-Hadoop-2/ [15build]: https://builds.apache.org/job/Accumulo-1.5/ [jiraloc]: https://issues.apache.org/jira/browse/accumulo [jira]: http://www.atlassian.com/software/jira/overview [devlist]: mailto:dev@accumulo.apache.org [release]: governance/releasing.html [cms]: http://www.apache.org/dev/cms.html [cmsusage]: http://www.apache.org/dev/cms.html#usage [cmsanon]: http://www.apache.org/dev/cmsref.html#non-committer [git]: http://git-scm.com/ [cgit]: https://git-wip-us.apache.org/repos/asf?p=accumulo.git;a=summary [anongit]: http://git-wip-us.apache.org/repos/asf/accumulo.git [rb]: rb.html [1]: http://creadur.apache.org/rat/apache-rat-plugin/