static VertexLabel createSqlgSchemaVertexLabel(Schema schema, String label, Map<String, PropertyType> columns) { Preconditions.checkArgument(schema.isSqlgSchema(), "createSqlgSchemaVertexLabel may only be called for \"%s\"", SQLG_SCHEMA); VertexLabel vertexLabel = new VertexLabel(schema, label); //Add the properties directly. As they are pre-created do not add them to uncommittedProperties. for (Map.Entry<String, PropertyType> propertyEntry : columns.entrySet()) { PropertyColumn property = new PropertyColumn(vertexLabel, propertyEntry.getKey(), propertyEntry.getValue()); vertexLabel.properties.put(propertyEntry.getKey(), property); } return vertexLabel; }
static VertexLabel createSqlgSchemaVertexLabel(Schema schema, String label, Map<String, PropertyType> columns) { Preconditions.checkArgument(schema.isSqlgSchema(), "createSqlgSchemaVertexLabel may only be called for \"%s\"", SQLG_SCHEMA); VertexLabel vertexLabel = new VertexLabel(schema, label); //Add the properties directly. As they are pre-created do not add them to uncommittedProperties. for (Map.Entry<String, PropertyType> propertyEntry : columns.entrySet()) { PropertyColumn property = new PropertyColumn(vertexLabel, propertyEntry.getKey(), propertyEntry.getValue()); vertexLabel.properties.put(propertyEntry.getKey(), property); } return vertexLabel; }
static VertexLabel createPartitionedVertexLabel( SqlgGraph sqlgGraph, Schema schema, String label, Map<String, PropertyType> columns, ListOrderedSet<String> identifiers, PartitionType partitionType, String partitionExpression) { Preconditions.checkArgument(!schema.isSqlgSchema(), "createVertexLabel may not be called for \"%s\"", SQLG_SCHEMA); Preconditions.checkArgument(partitionType != PartitionType.NONE, "PartitionType must be RANGE or LIST. Found NONE."); Preconditions.checkArgument(!StringUtils.isEmpty(partitionExpression), "partitionExpression may not be null or empty when creating a partitioned vertex label."); Preconditions.checkArgument(!identifiers.isEmpty(), "Partitioned label must have at least one identifier."); VertexLabel vertexLabel = new VertexLabel(schema, label, columns, identifiers, partitionType, partitionExpression); vertexLabel.createPartitionedVertexLabelOnDb(columns, identifiers); TopologyManager.addVertexLabel(sqlgGraph, schema.getName(), label, columns, identifiers, partitionType, partitionExpression); vertexLabel.committed = false; return vertexLabel; }
static VertexLabel createPartitionedVertexLabel( SqlgGraph sqlgGraph, Schema schema, String label, Map<String, PropertyType> columns, ListOrderedSet<String> identifiers, PartitionType partitionType, String partitionExpression) { Preconditions.checkArgument(!schema.isSqlgSchema(), "createVertexLabel may not be called for \"%s\"", SQLG_SCHEMA); Preconditions.checkArgument(partitionType != PartitionType.NONE, "PartitionType must be RANGE or LIST. Found NONE."); Preconditions.checkArgument(!StringUtils.isEmpty(partitionExpression), "partitionExpression may not be null or empty when creating a partitioned vertex label."); Preconditions.checkArgument(!identifiers.isEmpty(), "Partitioned label must have at least one identifier."); VertexLabel vertexLabel = new VertexLabel(schema, label, columns, identifiers, partitionType, partitionExpression); vertexLabel.createPartitionedVertexLabelOnDb(columns, identifiers); TopologyManager.addVertexLabel(sqlgGraph, schema.getName(), label, columns, identifiers, partitionType, partitionExpression); vertexLabel.committed = false; return vertexLabel; }
static VertexLabel createVertexLabel(SqlgGraph sqlgGraph, Schema schema, String label, Map<String, PropertyType> columns, ListOrderedSet<String> identifiers) { Preconditions.checkArgument(!schema.isSqlgSchema(), "createVertexLabel may not be called for \"%s\"", SQLG_SCHEMA); VertexLabel vertexLabel = new VertexLabel(schema, label, columns, identifiers); vertexLabel.createVertexLabelOnDb(columns, identifiers); TopologyManager.addVertexLabel(sqlgGraph, schema.getName(), label, columns, identifiers); vertexLabel.committed = false; return vertexLabel; }
static VertexLabel createVertexLabel(SqlgGraph sqlgGraph, Schema schema, String label, Map<String, PropertyType> columns, ListOrderedSet<String> identifiers) { Preconditions.checkArgument(!schema.isSqlgSchema(), "createVertexLabel may not be called for \"%s\"", SQLG_SCHEMA); VertexLabel vertexLabel = new VertexLabel(schema, label, columns, identifiers); vertexLabel.createVertexLabelOnDb(columns, identifiers); TopologyManager.addVertexLabel(sqlgGraph, schema.getName(), label, columns, identifiers); vertexLabel.committed = false; return vertexLabel; }
PartitionType partitionType = PartitionType.valueOf(vertexLabelJson.get("partitionType").asText()); if (partitionType.isNone()) { vertexLabel = new VertexLabel(this, vertexLabelName); } else { String partitionExpression = vertexLabelJson.get("partitionExpression").asText(); vertexLabel = new VertexLabel(this, vertexLabelName, partitionType, partitionExpression);
PartitionType partitionType = PartitionType.valueOf(vertexLabelJson.get("partitionType").asText()); if (partitionType.isNone()) { vertexLabel = new VertexLabel(this, vertexLabelName); } else { String partitionExpression = vertexLabelJson.get("partitionExpression").asText(); vertexLabel = new VertexLabel(this, vertexLabelName, partitionType, partitionExpression);
VertexLabel vertexLabel = this.vertexLabels.get(schemaName + "." + VERTEX_PREFIX + tableName); if (vertexLabel == null) { vertexLabel = new VertexLabel(this, tableName); this.vertexLabels.put(schemaName + "." + VERTEX_PREFIX + tableName, vertexLabel);
VertexLabel vertexLabel = this.vertexLabels.get(schemaName + "." + VERTEX_PREFIX + tableName); if (vertexLabel == null) { vertexLabel = new VertexLabel(this, tableName); this.vertexLabels.put(schemaName + "." + VERTEX_PREFIX + tableName, vertexLabel);
VertexLabel vertexLabel = this.vertexLabels.get(schemaName + "." + VERTEX_PREFIX + tableName); if (vertexLabel == null) { vertexLabel = new VertexLabel(this, tableName); this.vertexLabels.put(schemaName + "." + VERTEX_PREFIX + tableName, vertexLabel);
VertexLabel vertexLabel = this.vertexLabels.get(schemaName + "." + VERTEX_PREFIX + tableName); if (vertexLabel == null) { vertexLabel = new VertexLabel(this, tableName); this.vertexLabels.put(schemaName + "." + VERTEX_PREFIX + tableName, vertexLabel);
if (vertexLabel == null) { if (!partitionType.isNone()) { vertexLabel = new VertexLabel(this, tableName, partitionType, partitionExpression.value()); } else { vertexLabel = new VertexLabel(this, tableName);
if (vertexLabel == null) { if (!partitionType.isNone()) { vertexLabel = new VertexLabel(this, tableName, partitionType, partitionExpression.value()); } else { vertexLabel = new VertexLabel(this, tableName);