Add TabletBalancer to SPI package (#1891)

Add TabletBalancer to SPI package

This change deprecates existing balancers and introduces copies of each
under the SPI package. The main balancer interface, TabletBalancer, has
been converted from an abstract class to an interface and its method
signatures use only public API types and some other data types in SPI
sub-packages. The new types used expose the same functionality as the
previous types, and the implementations generally simply wrap the old
thrift objects and delegate, but will allow for easier evolution of the
API in the future.

* Deprecated TabletId.getTableId(), which created a new Text object
  every time, in favor of new TabletId.getTable() which returns a
  TableId. All existing usages of the getTableId() method would
  immediately call toString() on the returned Text object, or construct
  a TableId from the Text object. Therefore, the new method avoids
  object creation and usages read cleaner in many cases.
* Add static factory method on KeyExtent to create from a TabletId and
  return the wrapped KeyExtent if the TabletId is a TabletIdImpl and
  otherwise constructs with the property values retrieved from the
  TabletId.
* Add functionality to PluginEnvironment.Configuration to expose the
  derived property calculation (AccumuloConfiguration.Deriver) as a
  Supplier.
* Deprecated abstract TabletBalancer class now implements the new SPI
  TabletBalancer interface and provides implementations of the SPI
  methods on that interface that convert between the new and old types
  and delegate to the old balance/getAssignments methods.
* Deprecated all balancers in org.apache.accumulo.server.master.balancer
  except for ChaoticLoadBalancer, which was moved to accumulo-test since
  its purpose is only for testing.
* Introduce types in org.apache.accumulo.core.spi.balancer.data for
  wrapping thrift types needed by the balancers.
* Add a BalancerEnvironment to the SPI to support balancer-specific
  system operations (table online status check, listing online tablets,
  etc) in an API-stable manner.
* Convert TabletBalancer from abstract class to interface with init,
  getAssignments, and balance methods. The methods take parameters
  objects which will make it easier in the future if the balancer API
  needs to evolve.
* Implement existing balancers (DefaultLoadBalancer, TableLoadBalancer,
  GroupBalancer, RegexGroupBalancer, HostRegexTableLoadBalancer) in the
  SPI package by copying existing code and converting usages of thrift
  types to new stable types, and adjusting method signatures such that
  the new TabletBalancer API is implemented. The existing class
  DefaultLoadBalancer was renamed to SimpleLoadBalancer.
* Changed default balancer and table load balancer properties to use the
  new SPI-packaged versions.
* Update Master to construct the new TabletBalancer class, consolidate
  all access to the balancer internally (getAssignments moved from 
  )

fixes #1880
62 files changed
tree: 0141740608d215932fbb6fb2e5b835c159e9801d
  1. .github/
  2. assemble/
  3. contrib/
  4. core/
  5. hadoop-mapreduce/
  6. iterator-test-harness/
  7. minicluster/
  8. server/
  9. shell/
  10. src/
  11. start/
  12. test/
  13. .asf.yaml
  14. .gitignore
  15. CONTRIBUTING.md
  16. DEPENDENCIES
  17. LICENSE
  18. NOTICE
  19. pom.xml
  20. README.md
  21. TESTING.md
README.md

Apache Accumulo


Build Status Maven Central Javadoc Apache License

Apache Accumulo is a sorted, distributed key/value store that provides robust, scalable data storage and retrieval. With Apache Accumulo, users can store and manage large data sets across a cluster. Accumulo uses Apache Hadoop's HDFS to store its data and Apache Zookeeper for consensus. Check out the Accumulo project website for news and general information.

Getting Started

More resources can be found on the project website.

Building

Accumulo uses Maven to compile, test, and package its source. The following command will build the binary tar.gz from source. Add -DskipTests to build without waiting for the tests to run.

mvn package

This command produces assemble/target/accumulo-<version>-bin.tar.gz

Export Control


This distribution includes cryptographic software. The country in which you currently reside may have restrictions on the import, possession, use, and/or re-export to another country, of encryption software. BEFORE using any encryption software, please check your country's laws, regulations and policies concerning the import, possession, or use, and re-export of encryption software, to see if this is permitted. See https://www.wassenaar.org/ for more information.

The U.S. Government Department of Commerce, Bureau of Industry and Security (BIS), has classified this software as Export Commodity Control Number (ECCN) 5D002.C.1, which includes information security software using or performing cryptographic functions with asymmetric algorithms. The form and manner of this Apache Software Foundation distribution makes it eligible for export under the License Exception ENC Technology Software Unrestricted (TSU) exception (see the BIS Export Administration Regulations, Section 740.13) for both object code and source code.

The following provides more details on the included cryptographic software:

Apache Accumulo uses the built-in java cryptography libraries in its RFile encryption implementation. See oracle's export-regulations doc for more details for on Java‘s cryptography features. Apache Accumulo also uses the bouncycastle library for some cryptographic technology as well. See the BouncyCastle site for more details on bouncycastle’s cryptography features.