You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by el...@apache.org on 2014/03/20 16:25:25 UTC

[08/20] git commit: ACCUMULO-2437 Add javadoc for addSplits that documents the workaround using Text's byte[] constructor.

ACCUMULO-2437 Add javadoc for addSplits that documents the workaround using Text's byte[] constructor.


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/205f0dca
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/205f0dca
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/205f0dca

Branch: refs/heads/ACCUMULO-2061
Commit: 205f0dca8cc86d2c8ecab710719cfb7682920ed1
Parents: 082adbf
Author: Sean Busbey <bu...@cloudera.com>
Authored: Tue Mar 18 03:16:27 2014 -0500
Committer: Sean Busbey <bu...@cloudera.com>
Committed: Tue Mar 18 03:23:55 2014 -0500

----------------------------------------------------------------------
 .../core/client/admin/TableOperations.java         | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/205f0dca/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperations.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperations.java b/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperations.java
index c47d6a5..2521c96 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperations.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperations.java
@@ -135,6 +135,23 @@ public interface TableOperations {
   public void exportTable(String tableName, String exportDir) throws TableNotFoundException, AccumuloException, AccumuloSecurityException;
 
   /**
+   * Ensures that tablets are split along a set of keys.
+   * <p>
+   * Note that while the documentation for Text specifies that its bytestream should be UTF-8, the encoding is not enforced by operations that work with byte arrays.
+   * <p>
+   * For example, you can create 256 evenly-sliced splits via the following code sample even though the given byte sequences are not valid UTF-8.
+   * <pre>
+   * {@code
+   *  TableOperations tableOps = connector.tableOperations();
+   *  TreeSet<Text> splits = new TreeSet<Text>();
+   *  for (int i = 0; i < 256; i++) {
+   *    byte[] bytes = { (byte) i };
+   *    splits.add(new Text(bytes));
+   *  }
+   *  tableOps.addSplits(TABLE_NAME, splits);
+   * }
+   * </pre>
+   *
    * @param tableName
    *          the name of the table
    * @param partitionKeys