Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@

package org.apache.cassandra.service.accord;

import java.util.AbstractCollection;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.NavigableMap;
Expand All @@ -46,6 +48,8 @@
import accord.local.cfk.CommandsForKey;
import accord.primitives.AbstractKeys;
import accord.primitives.AbstractRanges;
import accord.primitives.AbstractUnseekableKeys;
import accord.primitives.Participants;
import accord.primitives.Ranges;
import accord.primitives.Routable;
import accord.primitives.Routables;
Expand Down Expand Up @@ -119,13 +123,13 @@ public PreLoadContext canExecute(PreLoadContext context)
return context;

List<RoutingKey> unavailable = null;
Unseekables<?> keys = context.keys();
AbstractUnseekableKeys keys = (AbstractUnseekableKeys) context.keys();
if (keys.size() == 0)
return context;

for (int i = 0 ; i < keys.size() ; ++i)
{
RoutingKey key = (RoutingKey) keys.get(i);
RoutingKey key = keys.get(i);
if (keyHistory == TIMESTAMPS)
{
if (null != timestampsForKeyInternal(key))
Expand Down Expand Up @@ -161,7 +165,8 @@ public PreLoadContext canExecute(PreLoadContext context)
if (unavailable.size() == keys.size())
return null;

return PreLoadContext.contextFor(context.primaryTxnId(), context.additionalTxnId(), keys.without(RoutingKeys.ofSortedUnique(unavailable)), keyHistory);
Participants<RoutingKey> available = keys.without(RoutingKeys.ofSortedUnique(unavailable));
return PreLoadContext.contextFor(context.primaryTxnId(), context.additionalTxnId(), available, keyHistory);
}
}

Expand Down