Search in sources :

Example 26 with SimpleImmutableEntry

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));
                    }
                }
            }
        }
    }
}
Also used : SimpleImmutableEntry(java.util.AbstractMap.SimpleImmutableEntry) JournalEntry(org.apache.jackrabbit.oak.segment.file.JournalEntry) Entry(java.util.Map.Entry) List(java.util.List) Lists.newArrayList(com.google.common.collect.Lists.newArrayList) UUID(java.util.UUID) ArrayDeque(java.util.ArrayDeque)

Example 27 with SimpleImmutableEntry

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);
}
Also used : SimpleImmutableEntry(java.util.AbstractMap.SimpleImmutableEntry) SortKey(javax.swing.RowSorter.SortKey) Test(org.junit.Test)

Example 28 with SimpleImmutableEntry

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);
}
Also used : SimpleImmutableEntry(java.util.AbstractMap.SimpleImmutableEntry) SortKey(javax.swing.RowSorter.SortKey) Test(org.junit.Test)

Example 29 with SimpleImmutableEntry

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);
}
Also used : SimpleImmutableEntry(java.util.AbstractMap.SimpleImmutableEntry) SortKey(javax.swing.RowSorter.SortKey) Test(org.junit.Test)

Aggregations

SimpleImmutableEntry (java.util.AbstractMap.SimpleImmutableEntry)29 Test (org.junit.Test)19 FakeProcess (com.facebook.buck.util.FakeProcess)9 FakeProcessExecutor (com.facebook.buck.util.FakeProcessExecutor)9 ImmutableList (com.google.common.collect.ImmutableList)9 SortKey (javax.swing.RowSorter.SortKey)9 HashMap (java.util.HashMap)5 NonNull (android.support.annotation.NonNull)4 WorkerThread (android.support.annotation.WorkerThread)4 StorIOException (com.pushtorefresh.storio.StorIOException)4 Entry (java.util.Map.Entry)4 GeneratorState (com.github.anba.es6draft.compiler.CodeVisitor.GeneratorState)2 LabelState (com.github.anba.es6draft.compiler.CodeVisitor.LabelState)2 Completion (com.github.anba.es6draft.compiler.StatementGenerator.Completion)2 MethodCode (com.github.anba.es6draft.compiler.assembler.Code.MethodCode)2 ContentResolverTypeMapping (com.pushtorefresh.storio.contentresolver.ContentResolverTypeMapping)2 StorIOContentResolver (com.pushtorefresh.storio.contentresolver.StorIOContentResolver)2 SQLiteTypeMapping (com.pushtorefresh.storio.sqlite.SQLiteTypeMapping)2 StorIOSQLite (com.pushtorefresh.storio.sqlite.StorIOSQLite)2 ArrayList (java.util.ArrayList)2