return singletonIterator(obj);
@Override @SuppressWarnings("unchecked") public Iterator<N> getPreferredNodeIterator( CandidateNodeSet<N> candidateNodeSet) { // Now only handle the case that single node in the candidateNodeSet // TODO, Add support to multi-hosts inside candidateNodeSet which is passed // in. N singleNode = CandidateNodeSetUtils.getSingleNode(candidateNodeSet); if (null != singleNode) { return IteratorUtils.singletonIterator(singleNode); } return IteratorUtils.emptyIterator(); }
+ " configured. Valid sorting policy has to be configured in" + " yarn.scheduler.capacity.<queue>.multi-node-sorting.policy"); return IteratorUtils.singletonIterator( nodes.iterator().next()); "MultiNode policy '" + policyName + "' is configured, however " + "yarn.scheduler.capacity.multi-node-placement-enabled is false"); return IteratorUtils.singletonIterator( nodes.iterator().next());
@SuppressWarnings("unchecked") public Iterator<CayenneMapEntry> getDbPathIterator(ObjEntity entity) { if (dbAttributePath == null) { return IteratorUtils.EMPTY_ITERATOR; } if (entity == null) { return IteratorUtils.EMPTY_ITERATOR; } DbEntity dbEnt = entity.getDbEntity(); if (dbEnt == null) { return IteratorUtils.EMPTY_ITERATOR; } int lastPartStart = dbAttributePath.lastIndexOf('.'); if (lastPartStart < 0) { DbAttribute attribute = dbEnt.getAttribute(dbAttributePath); if (attribute == null) { return IteratorUtils.EMPTY_ITERATOR; } return IteratorUtils.singletonIterator(attribute); } return dbEnt.resolvePathComponents(dbAttributePath); }
return singletonIterator(obj);
@Override @SuppressWarnings("unchecked") public Iterator<N> getPreferredNodeIterator( CandidateNodeSet<N> candidateNodeSet) { // Now only handle the case that single node in the candidateNodeSet // TODO, Add support to multi-hosts inside candidateNodeSet which is passed // in. N singleNode = CandidateNodeSetUtils.getSingleNode(candidateNodeSet); if (singleNode != null) { return IteratorUtils.singletonIterator(singleNode); } // singleNode will be null if Multi-node placement lookup is enabled, and // hence could consider sorting policies. return multiNodeSortingManager.getMultiNodeSortIterator( candidateNodeSet.getAllNodes().values(), candidateNodeSet.getPartition(), multiNodeSortPolicyName); }
public Iterator getDbPathIterator() { if (dbAttributePath == null) { return IteratorUtils.EMPTY_ITERATOR; } ObjEntity ent = (ObjEntity) getEntity(); if (ent == null) { return IteratorUtils.EMPTY_ITERATOR; } DbEntity dbEnt = ent.getDbEntity(); if (dbEnt == null) { return IteratorUtils.EMPTY_ITERATOR; } int lastPartStart = dbAttributePath.lastIndexOf('.'); if (lastPartStart < 0) { Attribute attribute = dbEnt.getAttribute(dbAttributePath); if (attribute == null) { return IteratorUtils.EMPTY_ITERATOR; } return IteratorUtils.singletonIterator(attribute); } return dbEnt.resolvePathComponents(dbAttributePath); }
if (relPath.indexOf('/') < 0) { Resource res = new FileResource(resolver, providerRoot, providerFile, contentFileExtensions, contentFileCache, fileStatCache); return IteratorUtils.singletonIterator(res);
public Iterator getDbPathIterator() { if (dbAttributePath == null) { return IteratorUtils.EMPTY_ITERATOR; } ObjEntity ent = (ObjEntity) getEntity(); if (ent == null) { return IteratorUtils.EMPTY_ITERATOR; } DbEntity dbEnt = ent.getDbEntity(); if (dbEnt == null) { return IteratorUtils.EMPTY_ITERATOR; } int lastPartStart = dbAttributePath.lastIndexOf('.'); if (lastPartStart < 0) { Attribute attribute = dbEnt.getAttribute(dbAttributePath); if (attribute == null) { return IteratorUtils.EMPTY_ITERATOR; } return IteratorUtils.singletonIterator(attribute); } return dbEnt.resolvePathComponents(dbAttributePath); }
/** * From a given node, refresh resources extracted out of it depending on configuration * @param node * @throws RepositoryException */ void refreshResourceIterator(Node node) throws RepositoryException { if (properties){ PropertyIterator it = nameGlobs != null ? node.getProperties(nameGlobs) : node.getProperties(); currentResources = IteratorUtils.transformedIterator(it, o -> { try { return resolver.getResource(((Property) o).getPath()); } catch (RepositoryException e) { LOGGER.error("unable to read property", e); } return null; }); } else { currentResources = IteratorUtils.singletonIterator(resolver.getResource(node.getPath())); } }
.singletonIterator(Collections.EMPTY_MAP); for (int i = 0; i < batchSize; i++) { Map nextParameters = (Map) it.next();
.singletonIterator(Collections.EMPTY_MAP); for (int i = 0; i < batchSize; i++) { Map nextParameters = (Map) it.next();
@Override protected Iterator<Resource> computeOutput() throws Exception { Iterator<Resource> output = EMPTY_ITERATOR; init(); if (properties.get(PN_FILTERCOLLECTIONMODE, false)){ Resource filterResource = getInput(); if (filterResource != null || !checkExistence){ if (filters == null){ filters = new DefaultWorkspaceFilter(); } //we take as a filter either computed resource, either configured path, as if resource, //is null, check existence has been configured to be false String filter = filterResource != null ? filterResource.getPath() : getComputedPath(); filters.add(new PathFilterSet(filter)); jcrPackage.getDefinition().setFilter(filters, true); output = IteratorUtils.singletonIterator(getInput()); } } return output; }