ackEntry = prepareAckEntry(client, prepareHostsData(client), lastRefTime); if (ackEntry != null) { cache.put(key, new org.javatuples.Pair<>(ackEntry.origin.getData(), ackEntry.data));
@Override public void addComparator(final Traversal.Admin<S, C> traversal, final Comparator<C> comparator) { this.comparators.add(new Pair<>(this.integrateChild(traversal), comparator)); }
@Override public void addComparator(final Traversal.Admin<S, C> traversal, final Comparator<C> comparator) { this.comparators.add(new Pair<>(this.integrateChild(traversal), comparator)); }
public ChainedComparator(final boolean traversers, final List<Pair<Traversal.Admin<S, C>, Comparator<C>>> comparators) { this.traversers = traversers; if (comparators.isEmpty()) this.comparators.add(new Pair<>(new IdentityTraversal(), (Comparator) Order.asc)); else this.comparators.addAll(comparators); this.isShuffle = (Comparator) (this.comparators.get(this.comparators.size() - 1).getValue1()) == Order.shuffle; if (!this.isShuffle) this.comparators.removeAll(this.comparators.stream().filter(pair -> (Comparator) pair.getValue1() == Order.shuffle).collect(Collectors.toList())); }
@Override public List<Pair<Traversal.Admin<S, C>, Comparator<C>>> getComparators() { return this.comparators.isEmpty() ? Collections.singletonList(new Pair<>(new IdentityTraversal(), (Comparator) Order.asc)) : Collections.unmodifiableList(this.comparators); }
@Override public List<Pair<Traversal.Admin<S, C>, Comparator<C>>> getComparators() { return this.comparators.isEmpty() ? Collections.singletonList(new Pair<>(new IdentityTraversal(), (Comparator) Order.asc)) : Collections.unmodifiableList(this.comparators); }
@Override public ChainedComparator<S, C> clone() { try { final ChainedComparator<S, C> clone = (ChainedComparator<S, C>) super.clone(); clone.comparators = new ArrayList<>(); for (final Pair<Traversal.Admin<S, C>, Comparator<C>> comparator : this.comparators) { clone.comparators.add(new Pair<>(comparator.getValue0().clone(), comparator.getValue1())); } return clone; } catch (final CloneNotSupportedException e) { throw new IllegalStateException(e.getMessage(), e); } } }
@Override public OrderGlobalStep<S, C> clone() { final OrderGlobalStep<S, C> clone = (OrderGlobalStep<S, C>) super.clone(); clone.comparators = new ArrayList<>(); for (final Pair<Traversal.Admin<S, C>, Comparator<C>> comparator : this.comparators) { clone.comparators.add(new Pair<>(comparator.getValue0().clone(), comparator.getValue1())); } return clone; }
@Override public OrderLocalStep<S, C> clone() { final OrderLocalStep<S, C> clone = (OrderLocalStep<S, C>) super.clone(); clone.comparators = new ArrayList<>(); for (final Pair<Traversal.Admin<S, C>, Comparator<C>> comparator : this.comparators) { clone.comparators.add(new Pair<>(comparator.getValue0().clone(), comparator.getValue1())); } clone.chainedComparator = null; return clone; }
@Override public Iterator iterator() { return IteratorUtils.map(this.getKeys(), k -> new Pair<>(k, this.getProperty(k))); } }
public Pair<A,C> removeFrom1() { return new Pair<A,C>( this.val0, this.val2); }
public <X> Pair<X,B> setAt0(final X value) { return new Pair<X,B>( value, this.val1); }
final Set<String> parentKeepLabels = new HashSet<>(PathUtil.getReferencedLabels(parent)); parentKeepLabels.addAll(PathUtil.getReferencedLabelsAfterStep(parent)); parentKeeperPairs.add(new Pair<>(parent, parentKeepLabels)); parent = parent.getTraversal().getParent().asStep();
vertex.property(VertexProperty.Cardinality.single, this.property, vertex.id()); vertex.property(VertexProperty.Cardinality.single, VOTE_STRENGTH, voteStrength); messenger.sendMessage(this.voteScope, new Pair<>((Serializable) vertex.id(), voteStrength)); memory.add(VOTE_TO_HALT, false); vertex.property(VertexProperty.Cardinality.single, this.property, vertex.id()); vertex.property(VertexProperty.Cardinality.single, VOTE_STRENGTH, voteStrength); messenger.sendMessage(this.voteScope, new Pair<>((Serializable) vertex.id(), voteStrength)); memory.add(VOTE_TO_HALT, false); } else { memory.add(VOTE_TO_HALT, vertex.value(this.property).equals(cluster)); vertex.property(VertexProperty.Cardinality.single, this.property, cluster); messenger.sendMessage(this.voteScope, new Pair<>(cluster, vertex.<Double>value(VOTE_STRENGTH)));
@Override public void registerProcessor(int requestCode, NettyRequestProcessor processor, ExecutorService executor) { ExecutorService executorThis = executor; if (null == executor) { executorThis = this.publicExecutor; } Pair<NettyRequestProcessor, ExecutorService> pair = new Pair<NettyRequestProcessor, ExecutorService>(processor, executorThis); this.processorTable.put(requestCode, pair); }
@Override public OrderLocalStep<S, C> clone() { final OrderLocalStep<S, C> clone = (OrderLocalStep<S, C>) super.clone(); clone.comparators = new ArrayList<>(); for (final Pair<Traversal.Admin<S, C>, Comparator<C>> comparator : this.comparators) { clone.comparators.add(new Pair<>(comparator.getValue0().clone(), comparator.getValue1())); } clone.chainedComparator = null; return clone; }
@Override public void fetchEnd(ExecuteContext ctx) { super.fetchEnd(ctx); Pair<Long, Integer> stopWatchIntegerPair = timing.get(ctx.query().toString()); long duration = System.nanoTime() - stopWatchIntegerPair.getValue0(); timing.put(ctx.query().toString(), new Pair<>(duration, ctx.result().size())); }
@Override public OrderGlobalStep<S, C> clone() { final OrderGlobalStep<S, C> clone = (OrderGlobalStep<S, C>) super.clone(); clone.comparators = new ArrayList<>(); for (final Pair<Traversal.Admin<S, C>, Comparator<C>> comparator : this.comparators) { clone.comparators.add(new Pair<>(comparator.getValue0().clone(), comparator.getValue1())); } return clone; }
private Pair <String, String> getClassCode(XMLAssertion a, OMElement stdElement2) throws Exception { OMElement cat = (OMElement) a.xPath.selectSingleNode(stdElement2); String nodeRepresentation = cat.getAttributeValue(new QName("nodeRepresentation")); OMElement slot = getChildElement(cat, "Slot", "name", "codingScheme"); OMElement valueList = getChildElement(slot, "ValueList"); OMElement value = getChildElement(valueList, "Value"); String codingScheme = value.getText().trim(); return new Pair <String, String>(nodeRepresentation, codingScheme); }
@Override public Iterator iterator() { return IteratorUtils.map(this.getKeys(), k -> new Pair<>(k, this.getProperty(k))); } }