use of java.util.AbstractMap.SimpleImmutableEntry in project jackrabbit-oak by apache.
the class SegmentTarExplorerBackend method getGcRoots.
@Override
public void getGcRoots(UUID uuidIn, Map<UUID, Set<Entry<UUID, String>>> links) throws IOException {
Deque<UUID> todos = new ArrayDeque<UUID>();
todos.add(uuidIn);
Set<UUID> visited = newHashSet();
while (!todos.isEmpty()) {
UUID uuid = todos.remove();
if (!visited.add(uuid)) {
continue;
}
for (String f : getTarFiles()) {
Map<UUID, List<UUID>> graph = store.getTarGraph(f);
for (Entry<UUID, List<UUID>> g : graph.entrySet()) {
if (g.getValue() != null && g.getValue().contains(uuid)) {
UUID uuidP = g.getKey();
if (!todos.contains(uuidP)) {
todos.add(uuidP);
Set<Entry<UUID, String>> deps = links.get(uuid);
if (deps == null) {
deps = newHashSet();
links.put(uuid, deps);
}
deps.add(new SimpleImmutableEntry<UUID, String>(uuidP, f));
}
}
}
}
}
}
use of java.util.AbstractMap.SimpleImmutableEntry in project jmeter by apache.
the class ObjectTableSorterTest method fixLastRowWithAscendingValue.
@Test
public void fixLastRowWithAscendingValue() {
sorter.fixLastRow().setSortKey(new SortKey(1, SortOrder.ASCENDING));
List<SimpleImmutableEntry<String, Integer>> expected = asList(b2(), a3(), d4(), c1());
assertRowOrderAndIndexes(expected);
}
use of java.util.AbstractMap.SimpleImmutableEntry in project jmeter by apache.
the class ObjectTableSorterTest method sortKeyAscending.
@Test
public void sortKeyAscending() {
sorter.setSortKey(new SortKey(0, SortOrder.ASCENDING));
List<SimpleImmutableEntry<String, Integer>> expected = asList(a3(), b2(), c1(), d4());
assertRowOrderAndIndexes(expected);
}
use of java.util.AbstractMap.SimpleImmutableEntry in project jmeter by apache.
the class ObjectTableSorterTest method fixLastRowWithDescendingKey.
@Test
public void fixLastRowWithDescendingKey() {
sorter.fixLastRow().setSortKey(new SortKey(0, SortOrder.DESCENDING));
List<SimpleImmutableEntry<String, Integer>> expected = asList(d4(), b2(), a3(), c1());
assertRowOrderAndIndexes(expected);
}
Aggregations