public static Pair < Long , String > calculateDrTableSignatureAndCrc ( Database catalog ) { SortedSet < Table > tables = Sets . newTreeSet ( ) ; tables . addAll ( getSnapshotableTables ( catalog , true ) . getFirst ( ) ) ; tables . addAll ( getSnapshotableTables ( catalog , false ) . getFirst ( ) ) ; final PureJavaCrc32 crc = new PureJavaCrc32 ( ) ; final StringBuilder sb = new StringBuilder ( ) ; String delimiter = "" ; for ( Table t : tables ) { if ( t . getIsdred ( ) ) { crc . update ( t . getSignature ( ) . getBytes ( Charsets . UTF_8 ) ) ; sb . append ( delimiter ) . append ( t . getSignature ( ) ) ; delimiter = SIGNATURE_DELIMITER ; } } return Pair . of ( crc . getValue ( ) , sb . toString ( ) ) ; }
Deterministically serializes all DR table signatures into a string and calculates the CRC checksum .