private Schema(Topology topology, String name) { this.topology = topology; this.name = name; this.sqlgGraph = this.topology.getSqlgGraph(); }
private Schema(Topology topology, String name) { this.topology = topology; this.name = name; this.sqlgGraph = this.topology.getSqlgGraph(); }
EdgeLabel(Topology topology, String edgeLabelName, PartitionType partitionType, String partitionExpression) { super(topology.getSqlgGraph(), edgeLabelName, partitionType, partitionExpression); this.topology = topology; }
EdgeLabel(Topology topology, String edgeLabelName, PartitionType partitionType, String partitionExpression) { super(topology.getSqlgGraph(), edgeLabelName, partitionType, partitionExpression); this.topology = topology; }
EdgeLabel(Topology topology, String edgeLabelName) { super(topology.getSqlgGraph(), edgeLabelName, Collections.emptyMap(), new ListOrderedSet<>()); this.topology = topology; }
EdgeLabel(Topology topology, String edgeLabelName) { super(topology.getSqlgGraph(), edgeLabelName, Collections.emptyMap(), new ListOrderedSet<>()); this.topology = topology; }
/** * Creates a new schema on the database. i.e. 'CREATE SCHEMA...' sql statement. */ private void createSchemaOnDb() { StringBuilder sql = new StringBuilder(); sql.append(topology.getSqlgGraph().getSqlDialect().createSchemaStatement(this.name)); if (this.sqlgGraph.getSqlDialect().needsSemicolon()) { sql.append(";"); } if (logger.isDebugEnabled()) { logger.debug(sql.toString()); } Connection conn = this.sqlgGraph.tx().getConnection(); try (Statement stmt = conn.createStatement()) { stmt.execute(sql.toString()); } catch (SQLException e) { logger.error("schema creation failed " + this.sqlgGraph.toString(), e); throw new RuntimeException(e); } }
/** * Creates a new schema on the database. i.e. 'CREATE SCHEMA...' sql statement. */ private void createSchemaOnDb() { StringBuilder sql = new StringBuilder(); sql.append(topology.getSqlgGraph().getSqlDialect().createSchemaStatement(this.name)); if (this.sqlgGraph.getSqlDialect().needsSemicolon()) { sql.append(";"); } if (logger.isDebugEnabled()) { logger.debug(sql.toString()); } Connection conn = this.sqlgGraph.tx().getConnection(); try (Statement stmt = conn.createStatement()) { stmt.execute(sql.toString()); } catch (SQLException e) { logger.error("schema creation failed " + this.sqlgGraph.toString(), e); throw new RuntimeException(e); } }
private Set<SchemaTableTree> calculatePathFromVertexToEdge(SchemaTableTree schemaTableTree, SchemaTable schemaTableTo, Direction direction, Map<SchemaTable, List<Multimap<BiPredicate, RecordId>>> groupedIds) { Set<SchemaTableTree> result = new HashSet<>(); //add the child for schemaTableTo to the tree SchemaTableTree schemaTableTree1 = schemaTableTree.addChild( schemaTableTo, direction, Vertex.class, this, this.labels ); SchemaTable schemaTable = SchemaTable.from(this.topology.getSqlgGraph(), schemaTableTo.toString()); List<Multimap<BiPredicate, RecordId>> biPredicateRecordIs = groupedIds.get(schemaTable.withOutPrefix()); addIdHasContainers(schemaTableTree1, biPredicateRecordIs); result.add(schemaTableTree1); return result; }
private Set<SchemaTableTree> calculatePathFromVertexToEdge(SchemaTableTree schemaTableTree, SchemaTable schemaTableTo, Direction direction, Map<SchemaTable, List<Multimap<BiPredicate, RecordId>>> groupedIds) { Set<SchemaTableTree> result = new HashSet<>(); //add the child for schemaTableTo to the tree SchemaTableTree schemaTableTree1 = schemaTableTree.addChild( schemaTableTo, direction, Vertex.class, this, this.labels ); SchemaTable schemaTable = SchemaTable.from(this.topology.getSqlgGraph(), schemaTableTo.toString()); List<Multimap<BiPredicate, RecordId>> biPredicateRecordIs = groupedIds.get(schemaTable.withOutPrefix()); addIdHasContainers(schemaTableTree1, biPredicateRecordIs); result.add(schemaTableTree1); return result; }
@Override protected void topologyEagerCreation(Topology topology) { BlackDuckIo.Builder builder = BlackDuckIo.build(); configureBdio.accept(builder); BlackDuckIo bdio = topology.getSqlgGraph().io(builder); BlackDuckIoOptions options = bdio.options(); BdioFrame frame = bdio.mapper().create().createMapper(); List<TraversalStrategy<?>> strategies = topology.getSqlgGraph().traversal() .withStrategies(this.strategies.toArray(new TraversalStrategy<?>[this.strategies.size()])) .getStrategies().toList(); // Define the schema vertex(topology, options, frame.context(), strategies); dataProperties(topology, options, frame.context()); objectProperties(topology, frame.context(), strategies); metadata(topology, options, frame.context(), strategies); }
if (passesLabelHasContainers(this.topology.getSqlgGraph(), false, inEdgeLabelToTravers.toString())) { SchemaTableTree schemaTableTreeChild = schemaTableTree.addChild( inEdgeLabelToTravers, this.labels); SchemaTable schemaTable = SchemaTable.from(this.topology.getSqlgGraph(), inEdgeLabelToTravers.toString()); List<Multimap<BiPredicate, RecordId>> biPredicateRecordIs = groupedIds.get(schemaTable.withOutPrefix()); addIdHasContainers(schemaTableTreeChild, biPredicateRecordIs); String foreignKeyTable = foreignKey.getSchemaTable().getTable(); SchemaTable schemaTableTo = SchemaTable.of(foreignKeySchema, VERTEX_PREFIX + SqlgUtil.removeTrailingOutId(foreignKeyTable)); if (schemaTables.add(schemaTableTo) && passesLabelHasContainers(this.topology.getSqlgGraph(), true, schemaTableTo.toString())) { if (first) { first = false; if (passesLabelHasContainers(this.topology.getSqlgGraph(), false, outEdgeLabelToTravers.toString())) { SchemaTable schemaTable = SchemaTable.from(this.topology.getSqlgGraph(), outEdgeLabelToTravers.toString()); List<Multimap<BiPredicate, RecordId>> biPredicateRecordIds = groupedIds.get(schemaTable.withOutPrefix()); addIdHasContainers(schemaTableTreeChild, biPredicateRecordIds); String foreignKeyTable = foreignKey.getSchemaTable().getTable(); SchemaTable schemaTableTo = SchemaTable.of(foreignKeySchema, VERTEX_PREFIX + SqlgUtil.removeTrailingInId(foreignKeyTable)); if (passesLabelHasContainers(this.topology.getSqlgGraph(), true, schemaTableTo.toString())) { if (first) { first = false;
if (passesLabelHasContainers(this.topology.getSqlgGraph(), false, inEdgeLabelToTravers.toString())) { SchemaTableTree schemaTableTreeChild = schemaTableTree.addChild( inEdgeLabelToTravers, this.labels); SchemaTable schemaTable = SchemaTable.from(this.topology.getSqlgGraph(), inEdgeLabelToTravers.toString()); List<Multimap<BiPredicate, RecordId>> biPredicateRecordIs = groupedIds.get(schemaTable.withOutPrefix()); addIdHasContainers(schemaTableTreeChild, biPredicateRecordIs); String foreignKeyTable = foreignKey.getSchemaTable().getTable(); SchemaTable schemaTableTo = SchemaTable.of(foreignKeySchema, VERTEX_PREFIX + SqlgUtil.removeTrailingOutId(foreignKeyTable)); if (schemaTables.add(schemaTableTo) && passesLabelHasContainers(this.topology.getSqlgGraph(), true, schemaTableTo.toString())) { if (first) { first = false; if (passesLabelHasContainers(this.topology.getSqlgGraph(), false, outEdgeLabelToTravers.toString())) { SchemaTable schemaTable = SchemaTable.from(this.topology.getSqlgGraph(), outEdgeLabelToTravers.toString()); List<Multimap<BiPredicate, RecordId>> biPredicateRecordIds = groupedIds.get(schemaTable.withOutPrefix()); addIdHasContainers(schemaTableTreeChild, biPredicateRecordIds); String foreignKeyTable = foreignKey.getSchemaTable().getTable(); SchemaTable schemaTableTo = SchemaTable.of(foreignKeySchema, VERTEX_PREFIX + SqlgUtil.removeTrailingInId(foreignKeyTable)); if (passesLabelHasContainers(this.topology.getSqlgGraph(), true, schemaTableTo.toString())) { if (first) { first = false;
if (passesLabelHasContainers(this.topology.getSqlgGraph(), true, schemaTable.toString())) { SchemaTableTree schemaTableTreeChild = schemaTableTree.addChild( schemaTable, if (passesLabelHasContainers(this.topology.getSqlgGraph(), true, schemaTable.toString())) { SchemaTableTree schemaTableTreeChild = schemaTableTree.addChild( schemaTable,
if (passesLabelHasContainers(this.topology.getSqlgGraph(), true, schemaTable.toString())) { SchemaTableTree schemaTableTreeChild = schemaTableTree.addChild( schemaTable, if (passesLabelHasContainers(this.topology.getSqlgGraph(), true, schemaTable.toString())) { SchemaTableTree schemaTableTreeChild = schemaTableTree.addChild( schemaTable,