Repository: apache/fluo
Issue: MutableBytesFactory & MutableBytes are not being found by Accumulo Tserver

Accumulo is not finding the classes because its classpath only includes the fluo-api & fluo-accumulo jars and not fluo-core.  The classes should be moved to fluo-accumulo as the Accumulo classpath should avoid including fluo-core.

``` java
Caused by: java.lang.IllegalStateException: java.lang.ClassNotFoundException: io.fluo.core.data.MutableBytesFactory
        at io.fluo.api.data.Bytes.<clinit>(Bytes.java:53)
        ... 23 more
Caused by: java.lang.ClassNotFoundException: io.fluo.core.data.MutableBytesFactory
        at org.apache.commons.vfs2.impl.VFSClassLoader.findClass(VFSClassLoader.java:175)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:190)
        at io.fluo.api.data.Bytes.<clinit>(Bytes.java:51)
```

This bug is preventing Fluo from running as production instance.


Changed files:
modules/mapreduce/src/main/java/io/fluo/mapreduce/MutationBuilder.java, modules/core/src/main/java/io/fluo/core/util/ByteUtil.java, modules/core/src/main/java/io/fluo/core/data/MutableBytesFactory.java, modules/core/src/test/java/io/fluo/core/data/MutableBytesTest.java, modules/core/src/main/java/io/fluo/core/data/MutableBytes.java, modules/api/src/main/java/io/fluo/api/data/Bytes.java

diff --git a/modules/core/src/main/java/io/fluo/core/data/MutableBytes.java b/modules/accumulo/src/main/java/io/fluo/accumulo/data/MutableBytes.java
similarity index 99%
rename from modules/core/src/main/java/io/fluo/core/data/MutableBytes.java
rename to modules/accumulo/src/main/java/io/fluo/accumulo/data/MutableBytes.java
index 787e00e3..0de45e21 100644
--- a/modules/core/src/main/java/io/fluo/core/data/MutableBytes.java
+++ b/modules/accumulo/src/main/java/io/fluo/accumulo/data/MutableBytes.java
@@ -13,7 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package io.fluo.core.data;
+package io.fluo.accumulo.data;
 
 import java.io.Serializable;
 import java.nio.ByteBuffer;
diff --git a/modules/core/src/main/java/io/fluo/core/data/MutableBytesFactory.java b/modules/accumulo/src/main/java/io/fluo/accumulo/data/MutableBytesFactory.java
similarity index 92%
rename from modules/core/src/main/java/io/fluo/core/data/MutableBytesFactory.java
rename to modules/accumulo/src/main/java/io/fluo/accumulo/data/MutableBytesFactory.java
index 160dd559..ee793e71 100644
--- a/modules/core/src/main/java/io/fluo/core/data/MutableBytesFactory.java
+++ b/modules/accumulo/src/main/java/io/fluo/accumulo/data/MutableBytesFactory.java
@@ -13,12 +13,12 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package io.fluo.core.data;
+package io.fluo.accumulo.data;
 
 import io.fluo.api.data.Bytes;
 
 /**
- * 
+ * An implementation of BytesFactory
  */
 public class MutableBytesFactory implements Bytes.BytesFactory {
   
diff --git a/modules/api/src/main/java/io/fluo/api/data/Bytes.java b/modules/api/src/main/java/io/fluo/api/data/Bytes.java
index 51f2f704..dc9b2f94 100644
--- a/modules/api/src/main/java/io/fluo/api/data/Bytes.java
+++ b/modules/api/src/main/java/io/fluo/api/data/Bytes.java
@@ -38,7 +38,7 @@ import org.apache.hadoop.io.WritableUtils;
  */
 public abstract class Bytes implements Comparable<Bytes> {
   
-  private static final String BYTES_FACTORY_CLASS = "io.fluo.core.data.MutableBytesFactory";
+  private static final String BYTES_FACTORY_CLASS = "io.fluo.accumulo.data.MutableBytesFactory";
 
   public interface BytesFactory {
     Bytes get(byte[] data);
diff --git a/modules/core/src/main/java/io/fluo/core/util/ByteUtil.java b/modules/core/src/main/java/io/fluo/core/util/ByteUtil.java
index 7a91523a..ac3f8c15 100644
--- a/modules/core/src/main/java/io/fluo/core/util/ByteUtil.java
+++ b/modules/core/src/main/java/io/fluo/core/util/ByteUtil.java
@@ -15,8 +15,8 @@
  */
 package io.fluo.core.util;
 
+import io.fluo.accumulo.data.MutableBytes;
 import io.fluo.api.data.Bytes;
-import io.fluo.core.data.MutableBytes;
 import org.apache.accumulo.core.data.ArrayByteSequence;
 import org.apache.accumulo.core.data.ByteSequence;
 import org.apache.hadoop.io.Text;
diff --git a/modules/core/src/test/java/io/fluo/core/data/MutableBytesTest.java b/modules/core/src/test/java/io/fluo/core/data/MutableBytesTest.java
index 7609bdcc..8504b826 100644
--- a/modules/core/src/test/java/io/fluo/core/data/MutableBytesTest.java
+++ b/modules/core/src/test/java/io/fluo/core/data/MutableBytesTest.java
@@ -15,6 +15,7 @@
  */
 package io.fluo.core.data;
 
+import io.fluo.accumulo.data.MutableBytes;
 import io.fluo.api.data.Bytes;
 import org.junit.Assert;
 import org.junit.Test;
diff --git a/modules/mapreduce/src/main/java/io/fluo/mapreduce/MutationBuilder.java b/modules/mapreduce/src/main/java/io/fluo/mapreduce/MutationBuilder.java
index 34f0ebcf..a8168695 100644
--- a/modules/mapreduce/src/main/java/io/fluo/mapreduce/MutationBuilder.java
+++ b/modules/mapreduce/src/main/java/io/fluo/mapreduce/MutationBuilder.java
@@ -17,11 +17,11 @@ package io.fluo.mapreduce;
 
 import java.nio.charset.StandardCharsets;
 
+import io.fluo.accumulo.data.MutableBytes;
 import io.fluo.accumulo.util.ColumnConstants;
 import io.fluo.accumulo.values.WriteValue;
 import io.fluo.api.data.Bytes;
 import io.fluo.api.data.Column;
-import io.fluo.core.data.MutableBytes;
 import io.fluo.core.util.ByteUtil;
 import io.fluo.core.util.Flutation;
 import org.apache.accumulo.core.client.mapreduce.AccumuloOutputFormat;