@Override public JsonElement serialize(SetMultimap<String, V> src, Type typeOfSrc, JsonSerializationContext context) { JsonObject result = new JsonObject(); List<String> keys = Lists.newArrayList(src.keys()); Collections.sort(keys); for (String key : keys) { Collection<V> values = src.get(key); if (values.size() > 1) { JsonArray array = new JsonArray(); for (V value : values) { array.add(context.serialize(value)); } result.add(key, array); } else if (values.size() == 1) { result.add(key, context.serialize(values.iterator().next())); } else { result.add(key, context.serialize("")); } } return result; } }
@Override protected Multiset<String> create(String[] elements) { PopulatableMapAsMultimap<String, Integer> multimap = PopulatableMapAsMultimap.create(); populateMultimapForKeys(multimap, elements); return multimap.build().keys(); } })
List<Node> candidateNodes = selectExactNodes(nodeMap, split.getAddresses(), includeCoordinator); if (candidateNodes.isEmpty()) { log.debug("No nodes available to schedule %s. Available nodes %s", split, nodeMap.getNodesByHost().keys()); throw new PrestoException(NO_NODES_AVAILABLE, "No nodes available to run query");
log.debug("No nodes available to schedule %s. Available nodes %s", split, nodeMap.getNodesByHost().keys()); throw new PrestoException(NO_NODES_AVAILABLE, "No nodes available to run query");
@Override public Multiset<C> keys() { return categoryValueMultiMap.keys(); }
/** * {@inheritDoc} */ @Override public Class<? extends EntityModel> getEntityClass(String entityName) { for (Class<? extends EntityModel> entityClass : semanticEntityInfo.keys()) { Set<SemanticEntityInfo> entityInfoList = semanticEntityInfo.get(entityClass); for (SemanticEntityInfo entityInfo : entityInfoList) { if (entityInfo.getEntityName().equals(entityName)) { return entityClass; } } } return null; }
/** * Looks for all previously loaded bundles, and if any new Supported Languages have been added, load them. */ public void loadMissingBundles() { //noinspection unchecked Set<Locale> supportedLanguages = manager.getSupportedLanguages(); for (Locale locale : supportedLanguages) { for(SetMultimap<String, Locale> localeData: this.loadedBundles.values()) { for (String bundleName : new HashSet<>(localeData.keys())) { addMessageBundle(bundleName, locale); } } } }
List<Node> candidateNodes = selectExactNodes(nodeMap, split.getAddresses(), includeCoordinator); if (candidateNodes.isEmpty()) { log.debug("No nodes available to schedule %s. Available nodes %s", split, nodeMap.getNodesByHost().keys()); throw new PrestoException(NO_NODES_AVAILABLE, "No nodes available to run query");
List<Node> candidateNodes = selectExactNodes(nodeMap, split.getAddresses(), includeCoordinator); if (candidateNodes.isEmpty()) { log.debug("No nodes available to schedule %s. Available nodes %s", split, nodeMap.getNodesByHost().keys()); throw new PrestoException(NO_NODES_AVAILABLE, "No nodes available to run query");
List<Node> candidateNodes = selectExactNodes(nodeMap, split.getAddresses(), includeCoordinator); if (candidateNodes.isEmpty()) { log.debug("No nodes available to schedule %s. Available nodes %s", split, nodeMap.getNodesByHost().keys()); throw new PrestoException(NO_NODES_AVAILABLE, "No nodes available to run query");
log.debug("No nodes available to schedule %s. Available nodes %s", split, nodeMap.getNodesByHost().keys()); throw new PrestoException(NO_NODES_AVAILABLE, "No nodes available to run query");
log.debug("No nodes available to schedule %s. Available nodes %s", split, nodeMap.getNodesByHost().keys()); throw new PrestoException(NO_NODES_AVAILABLE, "No nodes available to run query");
log.debug("No nodes available to schedule %s. Available nodes %s", split, nodeMap.getNodesByHost().keys()); throw new PrestoException(NO_NODES_AVAILABLE, "No nodes available to run query");
.keys()) { for (HashCode hc : subscription.getIntermediatePeerReferences() .get(peerURL)) {