public static GraphCreateOptions build( final GraphCreateOptions options, final String name, final Collection<EdgeDefinition> edgeDefinitions) { return options.name(name).edgeDefinitions(edgeDefinitions); }
/** * @param numberOfShards * The number of shards that is used for every collection within this graph. Cannot be modified later. * @return options */ public GraphCreateOptions numberOfShards(final Integer numberOfShards) { getOptions().setNumberOfShards(numberOfShards); return this; }
@Override public CompletableFuture<GraphEntity> createGraph( final String name, final Collection<EdgeDefinition> edgeDefinitions) { return executor.execute(createGraphRequest(name, edgeDefinitions, new GraphCreateOptions()), createGraphResponseDeserializer()); }
client = new ArangoDBGraphClient(arangoProperties, arangoConfig.getString(PROPERTY_KEY_DB_NAME), batchSize); ArangoGraph graph = client.getGraph(graphName); GraphCreateOptions options = new GraphCreateOptions(); options.orphanCollections(ArangoDBUtil.getCollectioName(graphName, ArangoDBUtil.GRAPH_VARIABLES_COLLECTION)); if (graph.exists()) { this.name = graph.name();
.map(vc -> ArangoDBUtil.getCollectioName(graph.name(), vc)) .collect(Collectors.toList()); allVertexCollections.addAll(options.getOrphanCollections()); if (!graph.getVertexCollections().containsAll(allVertexCollections)) { Set<String> avc = new HashSet<>(allVertexCollections);
@Override public CompletableFuture<GraphEntity> createGraph( final String name, final Collection<EdgeDefinition> edgeDefinitions) { return executor.execute(createGraphRequest(name, edgeDefinitions, new GraphCreateOptions()), createGraphResponseDeserializer()); }
@Override public GraphEntity createGraph(final String name, final Collection<EdgeDefinition> edgeDefinitions) throws ArangoDBException { return executor.execute(createGraphRequest(name, edgeDefinitions, new GraphCreateOptions()), createGraphResponseDeserializer()); }
/** * @param smartGraphAttribute * The attribute name that is used to smartly shard the vertices of a graph. Every vertex in this Graph * has to have this attribute. Cannot be modified later. * @return options */ public GraphCreateOptions smartGraphAttribute(final String smartGraphAttribute) { getOptions().setSmartGraphAttribute(smartGraphAttribute); return this; }
protected Request createGraphRequest( final String name, final Collection<EdgeDefinition> edgeDefinitions, final GraphCreateOptions options) { return request(name(), RequestType.POST, InternalArangoGraph.PATH_API_GHARIAL).setBody(util().serialize( OptionsBuilder.build(options != null ? options : new GraphCreateOptions(), name, edgeDefinitions))); }
public Integer getNumberOfShards() { return getOptions().getNumberOfShards(); }
public String getSmartGraphAttribute() { return getOptions().getSmartGraphAttribute(); }
public Integer getReplicationFactor() { return getOptions().getReplicationFactor(); }
/** * @param replicationFactor * (The default is 1): in a cluster, this attribute determines how many copies of each shard are kept on * different DBServers. The value 1 means that only one copy (no synchronous replication) is kept. A * value of k means that k-1 replicas are kept. Any two copies reside on different DBServers. Replication * between them is synchronous, that is, every write operation to the "leader" copy will be replicated to * all "follower" replicas, before the write operation is reported successful. If a server fails, this is * detected automatically and one of the servers holding copies take over, usually without an error being * reported. * @return options */ public GraphCreateOptions replicationFactor(final Integer replicationFactor) { getOptions().setReplicationFactor(replicationFactor); return this; }