本文整理汇总了Java中org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils.of方法的典型用法代码示例。如果您正苦于以下问题:Java IteratorUtils.of方法的具体用法?Java IteratorUtils.of怎么用?Java IteratorUtils.of使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils
的用法示例。
在下文中一共展示了IteratorUtils.of方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: constructInsertions
import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils; //导入方法依赖的package包/类
@Override
public Iterator<Put> constructInsertions() {
final String label = edge.label() != null ? edge.label() : Edge.DEFAULT_LABEL;
Put put = new Put(ValueUtils.serializeWithSalt(edge.id()));
put.addColumn(Constants.DEFAULT_FAMILY_BYTES, Constants.TO_BYTES,
ValueUtils.serialize(edge.inVertex().id()));
put.addColumn(Constants.DEFAULT_FAMILY_BYTES, Constants.FROM_BYTES,
ValueUtils.serialize(edge.outVertex().id()));
put.addColumn(Constants.DEFAULT_FAMILY_BYTES, Constants.LABEL_BYTES,
ValueUtils.serialize(label));
put.addColumn(Constants.DEFAULT_FAMILY_BYTES, Constants.CREATED_AT_BYTES,
ValueUtils.serialize(((HBaseEdge) edge).createdAt()));
put.addColumn(Constants.DEFAULT_FAMILY_BYTES, Constants.UPDATED_AT_BYTES,
ValueUtils.serialize(((HBaseEdge) edge).updatedAt()));
((HBaseEdge) edge).getProperties().entrySet()
.forEach(entry -> {
byte[] bytes = ValueUtils.serializePropertyValue(graph, ElementType.EDGE, label, entry.getKey(), entry.getValue());
put.addColumn(Constants.DEFAULT_FAMILY_BYTES, Bytes.toBytes(entry.getKey()), bytes);
});
return IteratorUtils.of(put);
}
示例2: standardAlgorithm
import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils; //导入方法依赖的package包/类
@Override
protected Iterator<Traverser.Admin<S>> standardAlgorithm() throws NoSuchElementException {
while (true) {
if (this.repeatTraversal.getEndStep().hasNext()) {
return this.repeatTraversal.getEndStep();
} else {
final Traverser.Admin<S> start = this.starts.next();
if (doUntil(start, true)) {
start.resetLoops();
return IteratorUtils.of(start);
}
this.repeatTraversal.addStart(start);
if (doEmit(start, true)) {
final Traverser.Admin<S> emitSplit = start.split();
emitSplit.resetLoops();
return IteratorUtils.of(emitSplit);
}
}
}
}
示例3: vertices
import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils; //导入方法依赖的package包/类
@Override
public Iterator<Vertex> vertices(Direction direction) {
switch (direction) {
case OUT:
return IteratorUtils.of(outVertex);
case IN:
return IteratorUtils.of(inVertex);
case BOTH:
return IteratorUtils.of(outVertex, inVertex);
default:
throw new IllegalArgumentException(String.format("Unknown direction %s.", direction));
}
}
示例4: vertices
import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils; //导入方法依赖的package包/类
@Override
public Iterator<Vertex> vertices(final Direction direction) {
if (removed) return Collections.emptyIterator();
switch (direction) {
case OUT:
return IteratorUtils.of(this.outVertex);
case IN:
return IteratorUtils.of(this.inVertex);
default:
return IteratorUtils.of(this.outVertex, this.inVertex);
}
}
示例5: properties
import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils; //导入方法依赖的package包/类
@Override
public <V> Iterator<Property<V>> properties(final String... propertyKeys) {
if (null == this.properties) return Collections.emptyIterator();
if (propertyKeys.length == 1) {
final Property<V> property = this.properties.get(propertyKeys[0]);
return null == property ? Collections.emptyIterator() : IteratorUtils.of(property);
} else
return (Iterator) this.properties.entrySet().stream().filter(entry -> ElementHelper.keyExists(entry.getKey(), propertyKeys)).map(entry -> entry.getValue()).collect(Collectors.toList()).iterator();
}
示例6: properties
import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils; //导入方法依赖的package包/类
@Override
public <U> Iterator<Property<U>> properties(final String... propertyKeys) {
if (null == this.properties) return Collections.emptyIterator();
if (propertyKeys.length == 1) {
final Property<U> property = this.properties.get(propertyKeys[0]);
return null == property ? Collections.emptyIterator() : IteratorUtils.of(property);
} else
return (Iterator) this.properties.entrySet().stream().filter(entry -> ElementHelper.keyExists(entry.getKey(), propertyKeys)).map(entry -> entry.getValue()).collect(Collectors.toList()).iterator();
}
示例7: properties
import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils; //导入方法依赖的package包/类
@Override
public <V> Iterator<VertexProperty<V>> properties(String... propertyKeys) {
if (propertyKeys.length == 0) { // return all properties
return (Iterator) specificKeys.stream().map(key -> property(key)).filter(vp -> vp.isPresent()).iterator();
} else if (propertyKeys.length == 1) { // treating as special case for performance
VertexProperty<V> ret = property(propertyKeys[0]);
if (ret.isPresent()) {
return IteratorUtils.of(ret);
} else {
return Collections.emptyIterator();
}
} else {
return Arrays.stream(propertyKeys).map(key -> (VertexProperty<V>) property(key)).filter(vp -> vp.isPresent()).iterator();
}
}
示例8: properties
import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils; //导入方法依赖的package包/类
@Override
public <V> Iterator<Property<V>> properties(String... propertyKeys) {
if (propertyKeys.length == 0) {
return (Iterator) specificKeys.stream().map(key -> property(key)).filter(vp -> vp.isPresent()).iterator();
} else if (propertyKeys.length == 1) { // treating as special case for performance
return IteratorUtils.of(property(propertyKeys[0]));
} else {
return Arrays.stream(propertyKeys).map(key -> (Property<V>) property(key)).filter(vp -> vp.isPresent()).iterator();
}
}
示例9: vertices
import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils; //导入方法依赖的package包/类
@Override
public Iterator<Vertex> vertices(final Direction direction) {
switch (direction) {
case OUT:
return IteratorUtils.of(this.outVertex);
case IN:
return IteratorUtils.of(this.inVertex);
default:
return IteratorUtils.of(this.outVertex, this.inVertex);
}
}
示例10: constructInsertions
import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils; //导入方法依赖的package包/类
@Override
public Iterator<Put> constructInsertions() {
Put put = new Put(graph.getLabelMetadataModel().serialize(label.key()));
put.addColumn(Constants.DEFAULT_FAMILY_BYTES, Constants.CREATED_AT_BYTES,
ValueUtils.serialize(label.createdAt()));
put.addColumn(Constants.DEFAULT_FAMILY_BYTES, Constants.UPDATED_AT_BYTES,
ValueUtils.serialize(label.updatedAt()));
put.addColumn(Constants.DEFAULT_FAMILY_BYTES, Bytes.toBytes(propertyKey),
ValueUtils.serialize(type.getCode()));
return IteratorUtils.of(put);
}
示例11: vertices
import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils; //导入方法依赖的package包/类
@Override
public Iterator<Vertex> vertices(final Direction direction) {
if (direction.equals(Direction.OUT))
return IteratorUtils.of(this.outVertex);
else if (direction.equals(Direction.IN))
return IteratorUtils.of(this.inVertex);
else
return IteratorUtils.of(this.outVertex, this.inVertex);
}
示例12: constructInsertions
import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils; //导入方法依赖的package包/类
@Override
public Iterator<Put> constructInsertions() {
Put put = new Put(graph.getIndexMetadataModel().serialize(index.key()));
put.addColumn(Constants.DEFAULT_FAMILY_BYTES, Constants.UNIQUE_BYTES,
ValueUtils.serialize(index.isUnique()));
put.addColumn(Constants.DEFAULT_FAMILY_BYTES, Constants.INDEX_STATE_BYTES,
ValueUtils.serialize(index.state().toString()));
put.addColumn(Constants.DEFAULT_FAMILY_BYTES, Constants.CREATED_AT_BYTES,
ValueUtils.serialize(index.createdAt()));
put.addColumn(Constants.DEFAULT_FAMILY_BYTES, Constants.UPDATED_AT_BYTES,
ValueUtils.serialize(index.updatedAt()));
return IteratorUtils.of(put);
}
示例13: constructMutations
import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils; //导入方法依赖的package包/类
@Override
public Iterator<Mutation> constructMutations() {
Put put = new Put(graph.getIndexMetadataModel().serialize(index.key()));
put.addColumn(Constants.DEFAULT_FAMILY_BYTES, Constants.INDEX_STATE_BYTES,
ValueUtils.serialize(index.state().toString()));
put.addColumn(Constants.DEFAULT_FAMILY_BYTES, Constants.UPDATED_AT_BYTES,
ValueUtils.serialize(index.updatedAt()));
return IteratorUtils.of(put);
}
示例14: constructMutations
import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils; //导入方法依赖的package包/类
@Override
public Iterator<Mutation> constructMutations() {
byte[] bytes = ValueUtils.serializePropertyValue(graph, ((HBaseElement) element).getElementType(), element.label(), key, value);
Put put = new Put(ValueUtils.serializeWithSalt(element.id()));
put.addColumn(Constants.DEFAULT_FAMILY_BYTES, Bytes.toBytes(key), bytes);
put.addColumn(Constants.DEFAULT_FAMILY_BYTES, Constants.UPDATED_AT_BYTES,
ValueUtils.serialize(((HBaseElement) element).updatedAt()));
return IteratorUtils.of(put);
}
示例15: constructMutations
import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils; //导入方法依赖的package包/类
@Override
public Iterator<Mutation> constructMutations() {
Increment incr = new Increment(ValueUtils.serializeWithSalt(element.id()));
incr.addColumn(Constants.DEFAULT_FAMILY_BYTES, Bytes.toBytes(key), value);
Put put = new Put(ValueUtils.serializeWithSalt(element.id()));
put.addColumn(Constants.DEFAULT_FAMILY_BYTES, Constants.UPDATED_AT_BYTES,
ValueUtils.serialize(((HBaseElement) element).updatedAt()));
return IteratorUtils.of(incr, put);
}