accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bus...@apache.org
Subject [2/6] git commit: ACCUMULO-2437 Add javadoc for addSplits that documents the workaround using Text's byte[] constructor.
Date Tue, 18 Mar 2014 17:48:32 GMT
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/1.6.0-SNAPSHOT
Commit: 205f0dca8cc86d2c8ecab710719cfb7682920ed1
Parents: 082adbf
Author: Sean Busbey <busbey@cloudera.com>
Authored: Tue Mar 18 03:16:27 2014 -0500
Committer: Sean Busbey <busbey@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


Mime
View raw message