blob: 3d2bc0e1827ac0c5e13d4c6d947332869cdd8d2d [file] [log] [blame]
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
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
See the License for the specific language governing permissions and
limitations under the License.
<title>Accumulo Locality Groups</title>
<link rel='stylesheet' type='text/css' href='documentation.css' media='screen'/>
<h1>Apache Accumulo Documentation : Locality Groups</h1>
<p>Accumulo supports locality groups similar to those described in the Big Table paper. Locality groups allow vertical partitioning of data by column family. This allows user to configure their tables such that scans over a subset of column families are much faster. The Accumulo locality group model has the following features.
<li>There is a default locality group that holds all column families not in a declared locality group.
<li>No requirement to declare locality groups or column families at table creation.
<li>Can change locality group configuration on the fly.
<P>When the locality group configuration for a table is changed it has no effect on existing data. All minor and major compactions that occur after the change will organize data into the new locality group structure. As data is written into a table, it will cause minor and major compactions to occur. Over time this will result in all data being organized according to the new locality groups. If all data must be reorganized into the new locality groups immediately, this can be accomplished by forcing a full major compaction of the table. Use the compact command in the shell to accomplish this.
<P>There are two ways to manipulate locality groups, via the shell or through
the Java API. From the shell use the getgroups and setgroups commands. Through
the API, <code>TableOperations</code> has the methods setLocalityGroups() and getLocalityGroups().
<P>To limit scans to a set of locality groups, use the fetchColumnFamily()
function on <code>Scanner</code> or <code>BatchScanner</code>. From the shell use scan with the -c option.