private static String[] deflateLabels(AccumuloNameSubstitutionStrategy nameSubstitutionStrategy, String[] labels) { if (labels == null) { return null; } String[] results = new String[labels.length]; for (int i = 0; i < labels.length; i++) { String label = labels[i]; results[i] = nameSubstitutionStrategy.deflate(label); } return results; }
public static AccumuloNameSubstitutionStrategy create(NameSubstitutionStrategy nameSubstitutionStrategy) { if (nameSubstitutionStrategy instanceof AccumuloNameSubstitutionStrategy) { return (AccumuloNameSubstitutionStrategy) nameSubstitutionStrategy; } return new AccumuloNameSubstitutionStrategy(nameSubstitutionStrategy); } }
@Override public String get(Text text) throws Throwable { return inflate(text.toString()); } })
this.connector = connector; this.vertexiumSerializer = config.createSerializer(this); this.nameSubstitutionStrategy = AccumuloNameSubstitutionStrategy.create(config.createSubstitutionStrategy(this)); this.streamingPropertyValueStorageStrategy = config.createStreamingPropertyValueStorageStrategy(this); this.elementMutationBuilder = new ElementMutationBuilder(streamingPropertyValueStorageStrategy, vertexiumSerializer) {
this.connector = connector; this.vertexiumSerializer = config.createSerializer(this); this.nameSubstitutionStrategy = AccumuloNameSubstitutionStrategy.create(config.createSubstitutionStrategy(this)); this.streamingPropertyValueStorageStrategy = config.createStreamingPropertyValueStorageStrategy(this); this.elementMutationBuilder = new ElementMutationBuilder(streamingPropertyValueStorageStrategy, vertexiumSerializer) {
private static String[] deflateLabels(AccumuloNameSubstitutionStrategy nameSubstitutionStrategy, String[] labels) { if (labels == null) { return null; } String[] results = new String[labels.length]; for (int i = 0; i < labels.length; i++) { String label = labels[i]; results[i] = nameSubstitutionStrategy.deflate(label); } return results; }
private static Property makePropertyFromIteratorProperty(AccumuloGraph graph, org.vertexium.accumulo.iterator.model.Property property) { Set<Visibility> hiddenVisibilities = null; if (property.hiddenVisibilities != null) { hiddenVisibilities = Sets.newHashSet(Iterables.transform(property.hiddenVisibilities, new Function<Text, Visibility>() { @Nullable @Override public Visibility apply(Text visibilityText) { return AccumuloGraph.accumuloVisibilityToVisibility(AccumuloGraph.visibilityToAccumuloVisibility(visibilityText.toString())); } })); } Visibility visibility = AccumuloGraph.accumuloVisibilityToVisibility(AccumuloGraph.visibilityToAccumuloVisibility(property.visibility)); return new LazyMutableProperty( graph, graph.getVertexiumSerializer(), graph.getNameSubstitutionStrategy().inflate(property.key), graph.getNameSubstitutionStrategy().inflate(property.name), property.value, null, hiddenVisibilities, visibility, property.timestamp, FetchHints.ALL_INCLUDING_HIDDEN ); } }
public static AccumuloNameSubstitutionStrategy create(NameSubstitutionStrategy nameSubstitutionStrategy) { if (nameSubstitutionStrategy instanceof AccumuloNameSubstitutionStrategy) { return (AccumuloNameSubstitutionStrategy) nameSubstitutionStrategy; } return new AccumuloNameSubstitutionStrategy(nameSubstitutionStrategy); } }
private ImmutableSet<String> deflate(ImmutableSet<String> strings) { if (strings == null) { return null; } return ImmutableSet.copyOf( strings.stream() .map(s -> getNameSubstitutionStrategy().deflate(s)) .collect(Collectors.toSet()) ); }
private static Property makePropertyFromIteratorProperty(AccumuloGraph graph, org.vertexium.accumulo.iterator.model.Property property) { Set<Visibility> hiddenVisibilities = null; if (property.hiddenVisibilities != null) { hiddenVisibilities = Sets.newHashSet(Iterables.transform(property.hiddenVisibilities, new Function<ByteSequence, Visibility>() { @Nullable @Override public Visibility apply(ByteSequence visibilityText) { return AccumuloGraph.accumuloVisibilityToVisibility(AccumuloGraph.visibilityToAccumuloVisibility(ByteSequenceUtils.toString(visibilityText))); } })); } Visibility visibility = AccumuloGraph.accumuloVisibilityToVisibility( AccumuloGraph.visibilityToAccumuloVisibility(property.visibility) ); return new LazyMutableProperty( graph, graph.getVertexiumSerializer(), graph.getNameSubstitutionStrategy().inflate(property.key), graph.getNameSubstitutionStrategy().inflate(property.name), property.value, null, hiddenVisibilities, visibility, property.timestamp, FetchHints.ALL_INCLUDING_HIDDEN ); } }
private ImmutableSet<String> deflate(ImmutableSet<String> strings) { if (strings == null) { return null; } return ImmutableSet.copyOf( strings.stream() .map(s -> getNameSubstitutionStrategy().deflate(s)) .collect(Collectors.toSet()) ); }
throw new IOException("Unexpected prop id: " + propId); String propertyKey = graph.getNameSubstitutionStrategy().inflate(decodeString(in)); String propertyName = graph.getNameSubstitutionStrategy().inflate(decodeString(in)); Visibility propertyVisibility = new Visibility(decodeString(in)); long propertyTimestamp = in.readLong();
private ImmutableSet<ByteSequence> deflateByteSequences(ImmutableSet<String> strings) { if (strings == null) { return null; } return ImmutableSet.copyOf( strings.stream() .map(s -> new ArrayByteSequence(getNameSubstitutionStrategy().deflate(s))) .collect(Collectors.toSet()) ); }
throw new IOException("Unexpected prop id: " + propId); String propertyKey = graph.getNameSubstitutionStrategy().inflate(decodeString(in)); String propertyName = graph.getNameSubstitutionStrategy().inflate(decodeString(in)); Visibility propertyVisibility = new Visibility(decodeString(in)); long propertyTimestamp = in.readLong();
org.vertexium.accumulo.iterator.model.EdgeInfo edgeInfo = new EdgeInfo(getGraph().getNameSubstitutionStrategy().deflate(LABEL_LABEL1), "v2"); assertEquals(new Key(new Text("v1"), AccumuloVertex.CF_OUT_EDGE, new Text("e1"), new Text("a"), 100L), pair.getKey()); assertEquals(edgeInfo.toValue(), pair.getValue()); edgeInfo = new EdgeInfo(getGraph().getNameSubstitutionStrategy().deflate(LABEL_LABEL1), "v1"); assertEquals(new Key(new Text("v2"), AccumuloVertex.CF_IN_EDGE, new Text("e1"), new Text("a"), 100L), pair.getKey()); assertEquals(edgeInfo.toValue(), pair.getValue());
protected AccumuloNameSubstitutionStrategy(NameSubstitutionStrategy nameSubstitutionStrategy) { this.nameSubstitutionStrategy = nameSubstitutionStrategy; inflateTextCache = CacheBuilder .newCache(ByteSequence.class, String.class) .name(AccumuloNameSubstitutionStrategy.class, "inflateTextCache-" + System.identityHashCode(this)) .maxSize(10000) .source(byteSequence -> inflate(ByteSequenceUtils.toString(byteSequence))) .build(); }
String outVertexId = row.getKey().getRow().toString(); String inVertexId = edgeInfo.getVertexId(); String label = getNameSubstitutionStrategy().inflate(edgeInfo.getLabel());
String outVertexId = row.getKey().getRow().toString(); String inVertexId = edgeInfo.getVertexId(); String label = getNameSubstitutionStrategy().inflate(edgeInfo.getLabel());
String inVertexId = DataInputStreamUtils.decodeString(in); String outVertexId = DataInputStreamUtils.decodeString(in); String label = graph.getNameSubstitutionStrategy().inflate(DataInputStreamUtils.decodeString(in));
String inVertexId = DataInputStreamUtils.decodeString(in); String outVertexId = DataInputStreamUtils.decodeString(in); String label = graph.getNameSubstitutionStrategy().inflate(DataInputStreamUtils.decodeString(in));