Uses a CRC algorithm to detect differences between sets of rows in the specified MapR-DB tables. Then, for each set of rows that are not identical, it uses the DiffTables utility to compare the rows. Finally, it generates one or more directory of sequence files that you can use to either make a MapR-DB table identical to its master or merge the rows from two MapR-DB tables.
Sequence files are binary flat files. To convert the sequence file into a more readable format, use the FormatResults utility.
When you run this utility on a cluster configured to use the yarn MapReduce mode, the cluster must also use zero configuration failover for the ResourceManager.
When you run the utility between tables on different clusters, both clusters must be configured to use the same MapReduce mode. For more information, see Managing the MapReduce Mode.
This utility requires less network bandwidth than DiffTables because it only performs a detailed table comparison on the sets of rows where the CRC algorithm detected a difference. Therefore, consider using this utility when the tables you compare are very similar and you are concerned about the data transfer rate.
By default, the utility considers both the source table and the destination table to be a master table. Therefore, it generates two directories with sequence files. These sequence files contain the puts required to update each table so that it can contain a superset of the rows defined in both tables at the time at which the utility was run.
When you specify a master table, the DiffTables utility generates one of the following output directories:
opsForDst. A directory containing sequence files that correspond to each put and delete required to make the destination table identical to the source table.
opsForSrc. A directory containing sequence files that correspond to each put and delete required to make the source table identical to the
A user with write permissions on a table can run the
hbase org.apache.hadoop.hbase.mapreduce.Import command to implement the puts and deletes specified in the sequence files.
The user that runs the DiffTablesWithCrc utility must have the ACE permission for column reads (readperm) on each table.
-src <source table path>
-dst <destination table path>
-outdir <output directory>
[-master src|dst ] The master table to use for the diff.
[-first_exit] Exit when first difference is found.
[-cf <comma separated list of column families>]
[-starttime <start diff at timestamp>]
[-endtime <end diff at timestamp>]
[-maxVersions <max number of versions to copy>]
[-cmpmeta <true|false> (default: true)]
The path to the source table.
The path to the destination table.
The table that is considered to be the master table. The values are
By default, the utility compares all the table cells in the specified tables. Set this parameter if you want to exit after the first difference is identified between the tables.
|outdir||The path to a directory for the sequence files. The utility will create the specified directory. If the specified directory already exists, the command will fail.|
|cf||By default, the utility compares all columns from the master table. If you do not want to compare all columns in the table, you can specify specific columns to include in the comparison. Provide a comma-separated list of column families or columns from a certain column family (column family:qualifier). For example, use the following syntax to include the column family purchases and the column stars in the reviews column family: |
|starttime||By default, the utility compares all table values regardless of their associated timestamp. You can specify a timestamp to indicate the table cell version at which to start the comparison. The timestamp is a long integer value that is either user-defined or system-defined (epoch in milliseconds). Values with timestamps lower than the specified timestamp will not be included in the comparison.|
|endtime||By default, the utility compares all table values regardless of their associated timestamp. You can specify a timestamp to indicate the table cell version at which to end the comparison. The timestamp is a long integer value that is either user-defined or system-defined (epoch in milliseconds). Values with timestamps greater than or equal to the specified timestamp will not be included in the comparison.|
|maxVersions||By default, the utility compares all versions from the master table. If you do not want to diff all versions, use this parameter to specify the number of recent versions to include in the comparison.|
|cmpmeta||A Boolean value that specifies whether or not to compare table metadata such as column families and ACEs. The default is to compare metadata (|