src/java/org/apache/cassandra/db/RowMutation.java
/**
     * Returns mutation representing a Hints to be sent to <code>address</code>
     * as soon as it becomes available.
     * The format is the following:
     *
     * HintsColumnFamily: {        // cf
     *   <dest token>: {           // key
     *     <uuid>: {               // super-column
     *       table: <table>        // columns
     *       key: <key>
     *       mutation: <mutation>
     *       version: <version>
     *     }
     *   }
     * }
     *
     */
Returns mutation representing a Hints to be sent to address
as soon as it becomes available.
The format is the following.


Returns mutation representing a Hints to be sent to address as soon as it becomes available . The format is the following .
public static RowMutation hintFor(RowMutation mutation, ByteBuffer token) throws IOException
    {
        RowMutation rm = new RowMutation(Table.SYSTEM_TABLE, token);
        ByteBuffer hintId = ByteBuffer.wrap(UUIDGen.getTimeUUIDBytes());
        int ttl = Integer.MAX_VALUE;
        for (ColumnFamily cf : mutation.getColumnFamilies())
            ttl = Math.min(ttl, cf.metadata().getGcGraceSeconds());
        QueryPath path = new QueryPath(HintedHandOffManager.HINTS_CF, hintId, ByteBufferUtil.bytes("mutation"));
        rm.add(path, ByteBuffer.wrap(mutation.getSerializedBuffer(MessagingService.version_)), System.currentTimeMillis(), System.currentTimeMillis(), ttl, null);
        path = new QueryPath(HintedHandOffManager.HINTS_CF, hintId, ByteBufferUtil.bytes("version"));
        rm.add(path, ByteBufferUtil.bytes(MessagingService.version_), System.currentTimeMillis(), System.currentTimeMillis(), ttl, null);
        path = new QueryPath(HintedHandOffManager.HINTS_CF, hintId, ByteBufferUtil.bytes("table"));
        rm.add(path, ByteBufferUtil.bytes(mutation.getTable()), System.currentTimeMillis(), System.currentTimeMillis(), ttl, null);
        path = new QueryPath(HintedHandOffManager.HINTS_CF, hintId, ByteBufferUtil.bytes("key"));
        rm.add(path, mutation.key(), System.currentTimeMillis(), System.currentTimeMillis(), ttl, null);
        return rm;
    }
public static RowMutation hintFor ( RowMutation mutation , ByteBuffer token ) throws IOException { RowMutation rm = new RowMutation ( Table . SYSTEM_TABLE , token ) ; ByteBuffer hintId = ByteBuffer . wrap ( UUIDGen . getTimeUUIDBytes ( ) ) ; int ttl = Integer . MAX_VALUE ; for ( ColumnFamily cf : mutation . getColumnFamilies ( ) ) ttl = Math . min ( ttl , cf . metadata ( ) . getGcGraceSeconds ( ) ) ; QueryPath path = new QueryPath ( HintedHandOffManager . HINTS_CF , hintId , ByteBufferUtil . bytes ( "mutation" ) ) ; rm . add ( path , ByteBuffer . wrap ( mutation . getSerializedBuffer ( MessagingService . version_ ) ) , System . currentTimeMillis ( ) , System . currentTimeMillis ( ) , ttl , null ) ; path = new QueryPath ( HintedHandOffManager . HINTS_CF , hintId , ByteBufferUtil . bytes ( "version" ) ) ; rm . add ( path , ByteBufferUtil . bytes ( MessagingService . version_ ) , System . currentTimeMillis ( ) , System . currentTimeMillis ( ) , ttl , null ) ; path = new QueryPath ( HintedHandOffManager . HINTS_CF , hintId , ByteBufferUtil . bytes ( "table" ) ) ; rm . add ( path , ByteBufferUtil . bytes ( mutation . getTable ( ) ) , System . currentTimeMillis ( ) , System . currentTimeMillis ( ) , ttl , null ) ; path = new QueryPath ( HintedHandOffManager . HINTS_CF , hintId , ByteBufferUtil . bytes ( "key" ) ) ; rm . add ( path , mutation . key ( ) , System . currentTimeMillis ( ) , System . currentTimeMillis ( ) , ttl , null ) ; return rm ; }
Returns mutation representing a Hints to be sent to <code>address</code>
 as soon as it becomes available.
Returns mutation representing a Hints to be sent to <code > address< / code > as soon as it becomes available .
// determine the TTL for the RowMutation // this is set at the smallest GCGraceSeconds for any of the CFs in the RM // this ensures that deletes aren't "undone" by delivery of an old hint // serialized RowMutation // serialization version // table // key