当前位置: 首页>>代码示例>>Java>>正文


Java ArrayListMultimap.keySet方法代码示例

本文整理汇总了Java中com.google.common.collect.ArrayListMultimap.keySet方法的典型用法代码示例。如果您正苦于以下问题:Java ArrayListMultimap.keySet方法的具体用法?Java ArrayListMultimap.keySet怎么用?Java ArrayListMultimap.keySet使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.common.collect.ArrayListMultimap的用法示例。


在下文中一共展示了ArrayListMultimap.keySet方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: ldFile

import com.google.common.collect.ArrayListMultimap; //导入方法依赖的package包/类
private static Map<Long, List<String>> ldFile(TomtomFolder folder) {
    File file = new File(folder.getFile("ld.dbf"));
    if (!file.exists()) {
        return newHashMap();
    }
    ArrayListMultimap<Long, LaneDirection> directions = ArrayListMultimap.create();
    log.info("Reading LD {}", file);
    try (DbfReader reader = new DbfReader(file)) {
        DbfRow row;
        while ((row = reader.nextRow()) != null) {
            directions.put(row.getLong("ID"), LaneDirection.parse(row.getInt("DIRECTION"), row.getString("VALIDITY")));
        }
    }
    Map<Long, List<String>> tags = newHashMap();
    for (Long id : directions.keySet()) {
        tags.put(id, asText(directions.get(id)));
    }
    log.info("Loaded {} lane directions", directions.size());
    return tags;
}
 
开发者ID:Mappy,项目名称:fpm,代码行数:21,代码来源:LdDbf.java

示例2: mapSorteerAttributen

import com.google.common.collect.ArrayListMultimap; //导入方法依赖的package包/类
private void mapSorteerAttributen() {
    final Map<Integer, GroepElement> objectSorteerGroepTemp = Maps.newHashMap();
    final ArrayListMultimap<GroepElement, AttribuutElement> sorteerElementenVoorGroep = ArrayListMultimap.create();
    for (final AttribuutElement attribuutElement : idAttribuutMap.values()) {
        if (attribuutElement.getElement().getElementWaarde().getSorteervolgorde() != null) {
            objectSorteerGroepTemp.put(attribuutElement.getObjectType(), idGroepMap.get(attribuutElement.getGroepId()));
            sorteerElementenVoorGroep.put(idGroepMap.get(attribuutElement.getGroepId()), attribuutElement);
        }
    }
    objectSorteerGroepMap = ImmutableMap.copyOf(objectSorteerGroepTemp);
    final Map<GroepElement, List<AttribuutElement>> gesorteerdeElementenVoorGroepTemp = new HashMap<>();

    for (GroepElement groepElement : sorteerElementenVoorGroep.keySet()) {
        final List<AttribuutElement> sorteerAttributen = sorteerElementenVoorGroep.get(groepElement);
        sorteerAttributen.sort(
                Comparator.comparing(o -> o.getElement().getElementWaarde().getSorteervolgorde()));
        gesorteerdeElementenVoorGroepTemp.put(groepElement, sorteerAttributen);
    }
    sorteerAttributenVoorGroep = ImmutableMap.copyOf(gesorteerdeElementenVoorGroepTemp);
}
 
开发者ID:MinBZK,项目名称:OperatieBRP,代码行数:21,代码来源:ElementHelper.java

示例3: RoundRobinOperator

import com.google.common.collect.ArrayListMultimap; //导入方法依赖的package包/类
public RoundRobinOperator(TunnelProvider tunnelProvider, OperatorContext context, RoundRobinSender config) throws OutOfMemoryException {
  super(config);
  this.config = config;
  this.allocator = context.getAllocator();
  this.handle = context.getFragmentHandle();
  this.stats = context.getStats();

  List<MinorFragmentEndpoint> destinations = config.getDestinations();
  final ArrayListMultimap<NodeEndpoint, Integer> dests = ArrayListMultimap.create();
  for(MinorFragmentEndpoint destination : destinations) {
    dests.put(destination.getEndpoint(), destination.getId());
  }

  this.tunnels = new ArrayList<>();
  this.minorFragments = new ArrayList<>();
  for(final NodeEndpoint ep : dests.keySet()){
    List<Integer> minorsList= dests.get(ep);
    minorFragments.add(minorsList);
    tunnels.add(tunnelProvider.getExecTunnel(ep));
  }

  int destCount = dests.keySet().size();
  this.currentTunnelsIndex = ThreadLocalRandom.current().nextInt(destCount);
  this.currentMinorFragmentsIndex = ThreadLocalRandom.current().nextInt(minorFragments.get(currentTunnelsIndex).size());
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:26,代码来源:RoundRobinOperator.java

示例4: BroadcastSenderRootExec

import com.google.common.collect.ArrayListMultimap; //导入方法依赖的package包/类
public BroadcastSenderRootExec(FragmentContext context,
                               RecordBatch incoming,
                               BroadcastSender config) throws OutOfMemoryException {
  super(context, context.newOperatorContext(config, null, false), config);
  this.ok = true;
  this.incoming = incoming;
  this.config = config;
  this.handle = context.getHandle();
  List<MinorFragmentEndpoint> destinations = config.getDestinations();
  ArrayListMultimap<DrillbitEndpoint, Integer> dests = ArrayListMultimap.create();

  for(MinorFragmentEndpoint destination : destinations) {
    dests.put(destination.getEndpoint(), destination.getId());
  }

  int destCount = dests.keySet().size();
  int i = 0;

  this.tunnels = new AccountingDataTunnel[destCount];
  this.receivingMinorFragments = new int[destCount][];
  for(final DrillbitEndpoint ep : dests.keySet()){
    List<Integer> minorsList= dests.get(ep);
    int[] minorsArray = new int[minorsList.size()];
    int x = 0;
    for(Integer m : minorsList){
      minorsArray[x++] = m;
    }
    receivingMinorFragments[i] = minorsArray;
    tunnels[i] = context.getDataTunnel(ep);
    i++;
  }
}
 
开发者ID:skhalifa,项目名称:QDrill,代码行数:33,代码来源:BroadcastSenderRootExec.java

示例5: unRegister

import com.google.common.collect.ArrayListMultimap; //导入方法依赖的package包/类
private void unRegister(ArrayListMultimap<URL, URL> registryUrls) {

        for (URL serviceUrl : registryUrls.keySet()) {
            for (URL url : registryUrls.get(serviceUrl)) {
                try {
                    RegistryFactory registryFactory = ExtensionLoader.getExtensionLoader(RegistryFactory.class).getExtension(url.getProtocol());
                    Registry registry = registryFactory.getRegistry(url);
                    registry.unregister(serviceUrl);
                } catch (Exception e) {
                    logger.warn(String.format("unregister url false:%s", url), e);
                }
            }
        }
    }
 
开发者ID:TFdream,项目名称:mango,代码行数:15,代码来源:DefaultConfigHandler.java

示例6: BroadcastOperator

import com.google.common.collect.ArrayListMultimap; //导入方法依赖的package包/类
public BroadcastOperator(TunnelProvider tunnelProvider, OperatorContext context, BroadcastSender config) throws OutOfMemoryException {
  super(config);
  this.config = config;
  this.context = context;
  this.handle = context.getFragmentHandle();
  this.stats = context.getStats();

  final List<MinorFragmentEndpoint> destinations = config.getDestinations();
  final ArrayListMultimap<NodeEndpoint, Integer> dests = ArrayListMultimap.create();

  for(MinorFragmentEndpoint destination : destinations) {
    dests.put(destination.getEndpoint(), destination.getId());
  }

  int destCount = dests.keySet().size();
  int i = 0;

  this.tunnels = new AccountingExecTunnel[destCount];
  this.receivingMinorFragments = new int[destCount][];
  for(final NodeEndpoint ep : dests.keySet()){
    List<Integer> minorsList= dests.get(ep);
    int[] minorsArray = new int[minorsList.size()];
    int x = 0;
    for(Integer m : minorsList){
      minorsArray[x++] = m;
    }
    receivingMinorFragments[i] = minorsArray;
    tunnels[i] = tunnelProvider.getExecTunnel(ep);
    i++;
  }
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:32,代码来源:BroadcastOperator.java


注:本文中的com.google.common.collect.ArrayListMultimap.keySet方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。