protected final void doCopyTableTestWithMob(Configuration conf, boolean bulkload)
    throws Exception {
    TableName tableName1 = TableName.valueOf(name.getMethodName() + "1");
    TableName tableName2 = TableName.valueOf(name.getMethodName() + "2");
    byte[] family = Bytes.toBytes("mob");
    byte[] column = Bytes.toBytes("c1");

    ColumnFamilyDescriptorBuilder cfd = ColumnFamilyDescriptorBuilder.newBuilder(family);

    cfd.setMobEnabled(true);
    cfd.setMobThreshold(5);
    TableDescriptor desc1 =
      TableDescriptorBuilder.newBuilder(tableName1).setColumnFamily(cfd.build()).build();
    TableDescriptor desc2 =
      TableDescriptorBuilder.newBuilder(tableName2).setColumnFamily(cfd.build()).build();

    try (Table t1 = createSourceTable(desc1); Table t2 = createTargetTable(desc2)) {
      // put rows into the first table
      for (int i = 0; i < 10; i++) {
        Put p = new Put(Bytes.toBytes("row" + i));
        p.addColumn(family, column, column);
        t1.put(p);
      }

      String[] peerClusterOptions = getPeerClusterOptions();
      if (bulkload) {
        assertTrue(runCopy(conf,
          ArrayUtils.addAll(peerClusterOptions, "--new.name=" + tableName2.getNameAsString(),
            "--bulkload", tableName1.getNameAsString())));
      } else {
        assertTrue(runCopy(conf, ArrayUtils.addAll(peerClusterOptions,
          "--new.name=" + tableName2.getNameAsString(), tableName1.getNameAsString())));
      }

      // verify the data was copied into table 2
      for (int i = 0; i < 10; i++) {
        Get g = new Get(Bytes.toBytes("row" + i));
        Result r = t2.get(g);
        assertEquals(1, r.size());
        assertTrue(CellUtil.matchingQualifier(r.rawCells()[0], column));
        assertEquals("compare row values between two tables",
          t1.getDescriptor().getValue("row" + i), t2.getDescriptor().getValue("row" + i));
      }

      assertEquals("compare count of mob rows after table copy", MobTestUtil.countMobRows(t1),
        MobTestUtil.countMobRows(t2));
      assertEquals("compare count of mob row values between two tables",
        t1.getDescriptor().getValues().size(), t2.getDescriptor().getValues().size());
      assertTrue("The mob row count is 0 but should be > 0", MobTestUtil.countMobRows(t2) > 0);
    } finally {
      dropSourceTable(tableName1);
      dropTargetTable(tableName2);
    }
  }
Base class for testing CopyTable MR tool.
hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/CopyTableTestBase.java