Search in sources :

Example 1 with IgfsBaseBlockKey

use of org.apache.ignite.internal.processors.igfs.IgfsBaseBlockKey in project ignite by apache.

the class IgfsGroupDataBlocksKeyMapper method affinityKey.

/** {@inheritDoc} */
@Override
public Object affinityKey(Object key) {
    if (key instanceof IgfsBaseBlockKey) {
        IgfsBaseBlockKey blockKey = (IgfsBaseBlockKey) key;
        IgniteUuid affKey = blockKey.affinityKey();
        if (affKey != null)
            return affKey;
        long grpId = blockKey.blockId() / grpSize;
        return blockKey.fileHash() + (int) (grpId ^ (grpId >>> 32));
    }
    return super.affinityKey(key);
}
Also used : IgniteUuid(org.apache.ignite.lang.IgniteUuid) IgfsBaseBlockKey(org.apache.ignite.internal.processors.igfs.IgfsBaseBlockKey)

Aggregations

IgfsBaseBlockKey (org.apache.ignite.internal.processors.igfs.IgfsBaseBlockKey)1 IgniteUuid (org.apache.ignite.lang.IgniteUuid)1