@Override public List<RSGroupInfo> listRSGroups() { return Lists.newLinkedList(rsGroupMap.values()); }
public MemoryBoundedLogMessageBuffer(long maxSizeBytes) { Preconditions.checkArgument( maxSizeBytes > 0); this.maxSizeBytes = maxSizeBytes; this.messages = Lists.newLinkedList(); }
protected static RSGroupInfoManager getMockedGroupInfoManager() throws IOException { RSGroupInfoManager gm = Mockito.mock(RSGroupInfoManager.class); Mockito.when(gm.getRSGroup(Mockito.any())).thenAnswer(new Answer<RSGroupInfo>() { @Override public RSGroupInfo answer(InvocationOnMock invocation) throws Throwable { return groupMap.get(invocation.getArgument(0)); } }); Mockito.when(gm.listRSGroups()).thenReturn( Lists.newLinkedList(groupMap.values())); Mockito.when(gm.isOnline()).thenReturn(true); Mockito.when(gm.getRSGroupOfTable(Mockito.any())) .thenAnswer(new Answer<String>() { @Override public String answer(InvocationOnMock invocation) throws Throwable { return tableMap.get(invocation.getArgument(0)); } }); return gm; }
tmpRegionSet = getSplits(connection, tableName, splitAlgo); LinkedList<Pair<byte[], byte[]>> outstanding = Lists.newLinkedList(); int splitCount = 0; final int origCount = tmpRegionSet.size(); ServerName rsLocation = regionLocator.getRegionLocation(dr.getSecond()).getServerName(); if (!daughterRegions.containsKey(rsLocation)) { LinkedList<Pair<byte[], byte[]>> entry = Lists.newLinkedList(); daughterRegions.put(rsLocation, entry); LinkedList<Pair<byte[], byte[]>> entry = Lists.newLinkedList(); daughterRegions.put(newRs, entry); LinkedList<Pair<byte[], byte[]>> finished = Lists.newLinkedList(); LinkedList<Pair<byte[], byte[]>> local_finished = Lists.newLinkedList(); if (conf.getBoolean("split.verify", true)) {
SplitAlgorithm splitAlgo) throws IOException, InterruptedException { LinkedList<Pair<byte[], byte[]>> finished = Lists.newLinkedList(); LinkedList<Pair<byte[], byte[]>> logicalSplitting = Lists.newLinkedList(); LinkedList<Pair<byte[], byte[]>> physicalSplitting = Lists.newLinkedList(); LinkedList<HRegionInfo> check = Lists.newLinkedList(); check.add(regionLocator.getRegionLocation(start).getRegionInfo()); check.add(regionLocator.getRegionLocation(split).getRegionInfo());
LinkedList<Pair<byte[], byte[]>> ret = Lists.newLinkedList(); for (Pair<String, String> r : daughterRegions) { ret.add(Pair.newPair(splitAlgo.strToRow(r.getFirst()), splitAlgo
final List<AllocRecord> allocsByThisThread = Lists.newLinkedList(); allocations.add(allocsByThisThread);
@Override public List<RSGroupInfo> listRSGroups() { return Lists.newLinkedList(rsGroupMap.values()); }
@Override public List<RSGroupInfo> listRSGroups() { return Lists.newLinkedList(rsGroupMap.values()); }
/** * Parses a serialized trie representation of a map of reversed public suffixes into an immutable * map of public suffixes. */ static ImmutableMap<String, PublicSuffixType> parseTrie(CharSequence encoded) { ImmutableMap.Builder<String, PublicSuffixType> builder = ImmutableMap.builder(); int encodedLen = encoded.length(); int idx = 0; while (idx < encodedLen) { idx += doParseTrieToBuilder( Lists.<CharSequence>newLinkedList(), encoded.subSequence(idx, encodedLen), builder); } return builder.build(); }
/** * Creates a <i>mutable</i> {@code LinkedList} instance containing the given * elements; a very thin shortcut for creating an empty list then calling * {@link Iterables#addAll}. * * <p><b>Note:</b> if mutability is not required and the elements are * non-null, use {@link ImmutableList#copyOf(Iterable)} instead. (Or, change * {@code elements} to be a {@link FluentIterable} and call * {@code elements.toList()}.) * * <p><b>Performance note:</b> {@link ArrayList} and {@link * java.util.ArrayDeque} consistently outperform {@code LinkedList} except in * certain rare and specific situations. Unless you have spent a lot of time * benchmarking your specific needs, use one of those instead. * * <p><b>Note for Java 7 and later:</b> if {@code elements} is a {@link * Collection}, you don't need this method. Use the {@code LinkedList} * {@linkplain LinkedList#LinkedList(Collection) constructor} directly, taking * advantage of the new <a href="http://goo.gl/iz2Wi">"diamond" syntax</a>. */ @GwtCompatible(serializable = true) public static <E> LinkedList<E> newLinkedList(Iterable<? extends E> elements) { LinkedList<E> list = newLinkedList(); Iterables.addAll(list, elements); return list; }
private static RSGroupInfoManager getMockedGroupInfoManager() throws IOException { RSGroupInfoManager gm = Mockito.mock(RSGroupInfoManager.class); Mockito.when(gm.getRSGroup(groups[0])).thenReturn( groupMap.get(groups[0])); Mockito.when(gm.getRSGroup(groups[1])).thenReturn( groupMap.get(groups[1])); Mockito.when(gm.getRSGroup(groups[2])).thenReturn( groupMap.get(groups[2])); Mockito.when(gm.getRSGroup(groups[3])).thenReturn( groupMap.get(groups[3])); Mockito.when(gm.listRSGroups()).thenReturn( Lists.newLinkedList(groupMap.values())); Mockito.when(gm.isOnline()).thenReturn(true); Mockito.when(gm.getRSGroupOfTable(Mockito.any())) .thenAnswer(new Answer<String>() { @Override public String answer(InvocationOnMock invocation) throws Throwable { return tableMap.get(invocation.getArgument(0)); } }); return gm; }
final List<AllocRecord> allocsByThisThread = Lists.newLinkedList(); allocations.add(allocsByThisThread);