SchemaTable predicateValueAsSchemaTableWithPrefix = SchemaTable.from(sqlgGraph, value).withPrefix(isVertex ? VERTEX_PREFIX : EDGE_PREFIX); tableWithPrefixes.add(predicateValueAsSchemaTableWithPrefix.toString()); return biPredicate.test(schemaTableWithOutPrefix.getTable(), predicateValue); } else { SchemaTable predicateValueAsSchemaTableWithPrefix = SchemaTable.from(sqlgGraph, (String) predicateValue).withPrefix(isVertex ? VERTEX_PREFIX : EDGE_PREFIX); return biPredicate.test(table, predicateValueAsSchemaTableWithPrefix.toString());
SchemaTable predicateValueAsSchemaTableWithPrefix = SchemaTable.from(sqlgGraph, value).withPrefix(isVertex ? VERTEX_PREFIX : EDGE_PREFIX); tableWithPrefixes.add(predicateValueAsSchemaTableWithPrefix.toString()); return biPredicate.test(schemaTableWithOutPrefix.getTable(), predicateValue); } else { SchemaTable predicateValueAsSchemaTableWithPrefix = SchemaTable.from(sqlgGraph, (String) predicateValue).withPrefix(isVertex ? VERTEX_PREFIX : EDGE_PREFIX); return biPredicate.test(table, predicateValueAsSchemaTableWithPrefix.toString());
Map<String, PropertyColumn> globalUniqueIndexPropertyMap = sqlgGraph.getTopology().getPropertiesWithGlobalUniqueIndexFor(schemaTable.withPrefix(VERTEX_PREFIX));
Map<String, PropertyColumn> globalUniqueIndexPropertyMap = sqlgGraph.getTopology().getPropertiesWithGlobalUniqueIndexFor(schemaTable.withPrefix(VERTEX_PREFIX));
HasContainer labelHasContainer = this.labelHasContainers.get(0); String table = (String) labelHasContainer.getValue(); SchemaTable schemaTableWithPrefix = SchemaTable.from(sqlgGraph, table).withPrefix(VERTEX_PREFIX); if (filteredAllTables.containsKey(schemaTableWithPrefix.toString())) { collectSchemaTableTrees(sqlgGraph, replacedStepDepth, result, groupedIds, schemaTableWithPrefix.toString());
Map<String, PropertyColumn> propertyColumns = sqlgGraph.getTopology().getPropertiesWithGlobalUniqueIndexFor(schemaTable.withPrefix(VERTEX_PREFIX)); for (PropertyColumn propertyColumn : propertyColumns.values()) { for (GlobalUniqueIndex globalUniqueIndex : propertyColumn.getGlobalUniqueIndices()) {
HasContainer labelHasContainer = this.labelHasContainers.get(0); String table = (String) labelHasContainer.getValue(); SchemaTable schemaTableWithPrefix = SchemaTable.from(sqlgGraph, table).withPrefix(VERTEX_PREFIX); if (filteredAllTables.containsKey(schemaTableWithPrefix.toString())) { collectSchemaTableTrees(sqlgGraph, replacedStepDepth, result, groupedIds, schemaTableWithPrefix.toString());
Pair<SortedSet<String>, Map<SqlgVertex, Map<String, Object>>> vertices = vertexCache.get(schemaTable); Map<String, PropertyColumn> propertyColumnMap = sqlgGraph.getTopology().getPropertiesFor(schemaTable.withPrefix(VERTEX_PREFIX)); for (Map.Entry<String, PropertyColumn> propertyColumnEntry : propertyColumnMap.entrySet()) { PropertyColumn propertyColumn = propertyColumnEntry.getValue();
Map<String, PropertyColumn> propertyColumnMap = sqlgGraph.getTopology().getPropertiesFor(metaEdge.getSchemaTable().withPrefix(EDGE_PREFIX)); Map<SqlgEdge, Triple<SqlgVertex, SqlgVertex, Map<String, Object>>> rows = triples.getRight();
effectiveEdges.asMap().forEach((inVertexLabel, uids) -> { bulkAddEdges(outVertexLabel, inVertexLabel, edgeLabel, idFields, uids, edgeProperties); modificationEstimate.add(SchemaTable.from(graph(), edgeLabel).withPrefix(EDGE_PREFIX), uids.size()); });
Pair<SortedSet<String>, Map<SqlgVertex, Map<String, Object>>> vertices = vertexCache.get(schemaTable); Map<String, PropertyColumn> propertyColumnMap = sqlgGraph.getTopology().getPropertiesFor(schemaTable.withPrefix(VERTEX_PREFIX)); for (Map.Entry<String, PropertyColumn> propertyColumnEntry : propertyColumnMap.entrySet()) { PropertyColumn propertyColumn = propertyColumnEntry.getValue();
Map<String, PropertyColumn> propertyColumnMap = sqlgGraph.getTopology().getPropertiesFor(metaEdge.getSchemaTable().withPrefix(EDGE_PREFIX)); Map<SqlgEdge, Triple<SqlgVertex, SqlgVertex, Map<String, Object>>> rows = triples.getRight();
@Override public void flushVertexGlobalUniqueIndexes(SqlgGraph sqlgGraph, Map<SchemaTable, Pair<SortedSet<String>, Map<SqlgVertex, Map<String, Object>>>> vertexCache) { for (SchemaTable schemaTable : vertexCache.keySet()) { Pair<SortedSet<String>, Map<SqlgVertex, Map<String, Object>>> vertices = vertexCache.get(schemaTable); Map<String, PropertyColumn> propertyColumnMap = sqlgGraph.getTopology().getPropertiesFor(schemaTable.withPrefix(VERTEX_PREFIX)); for (Map.Entry<String, PropertyColumn> propertyColumnEntry : propertyColumnMap.entrySet()) { PropertyColumn propertyColumn = propertyColumnEntry.getValue(); for (GlobalUniqueIndex globalUniqueIndex : propertyColumn.getGlobalUniqueIndices()) { try { Connection connection = sqlgGraph.tx().getConnection(); SQLServerConnection sqlServerConnection = connection.unwrap(SQLServerConnection.class); try (SQLServerBulkCopy bulkCopy = new SQLServerBulkCopy(sqlServerConnection)) { bulkCopy.setDestinationTableName(sqlgGraph.getSqlDialect().maybeWrapInQoutes(Schema.GLOBAL_UNIQUE_INDEX_SCHEMA) + "." + sqlgGraph.getSqlDialect().maybeWrapInQoutes(VERTEX_PREFIX + globalUniqueIndex.getName()) ); bulkCopy.writeToServer(new SQLServerVertexGlobalUniqueIndexBulkRecord(bulkCopy, sqlgGraph, vertices, propertyColumn)); } } catch (SQLException e) { throw new RuntimeException(e); } } } } }
@Override public void flushEdgeGlobalUniqueIndexes(SqlgGraph sqlgGraph, Map<MetaEdge, Pair<SortedSet<String>, Map<SqlgEdge, Triple<SqlgVertex, SqlgVertex, Map<String, Object>>>>> edgeCache) { for (MetaEdge metaEdge : edgeCache.keySet()) { Pair<SortedSet<String>, Map<SqlgEdge, Triple<SqlgVertex, SqlgVertex, Map<String, Object>>>> triples = edgeCache.get(metaEdge); Map<SqlgEdge, Triple<SqlgVertex, SqlgVertex, Map<String, Object>>> edgeMap = triples.getRight(); Map<String, PropertyColumn> propertyColumnMap = sqlgGraph.getTopology().getPropertiesFor(metaEdge.getSchemaTable().withPrefix(EDGE_PREFIX)); for (Map.Entry<String, PropertyColumn> propertyColumnEntry : propertyColumnMap.entrySet()) { PropertyColumn propertyColumn = propertyColumnEntry.getValue(); for (GlobalUniqueIndex globalUniqueIndex : propertyColumn.getGlobalUniqueIndices()) { try { Connection connection = sqlgGraph.tx().getConnection(); SQLServerConnection sqlServerConnection = connection.unwrap(SQLServerConnection.class); try (SQLServerBulkCopy bulkCopy = new SQLServerBulkCopy(sqlServerConnection)) { bulkCopy.setDestinationTableName(sqlgGraph.getSqlDialect().maybeWrapInQoutes(Schema.GLOBAL_UNIQUE_INDEX_SCHEMA) + "." + sqlgGraph.getSqlDialect().maybeWrapInQoutes(VERTEX_PREFIX + globalUniqueIndex.getName()) ); bulkCopy.writeToServer(new SQLServerEdgeGlobalUniqueIndexBulkRecord(bulkCopy, sqlgGraph, edgeMap, propertyColumn)); } } catch (SQLException e) { throw new RuntimeException(e); } } } } }
static Index createIndex(SqlgGraph sqlgGraph, AbstractLabel abstractLabel, String indexName, IndexType indexType, List<PropertyColumn> properties) { Index index = new Index(indexName, indexType, abstractLabel, properties); SchemaTable schemaTable = SchemaTable.of(abstractLabel.getSchema().getName(), abstractLabel.getLabel()); //For partitioned tables the index is on each partition. //It is created when the partition is created. if (!abstractLabel.isPartition()) { String prefix = abstractLabel instanceof VertexLabel ? VERTEX_PREFIX : EDGE_PREFIX; index.createIndex(sqlgGraph, schemaTable.withPrefix(prefix), index.getName()); } else { for (Partition partition : abstractLabel.getPartitions().values()) { partition.createIndexOnLeafPartitions(index); } } TopologyManager.addIndex(sqlgGraph, index); index.committed = false; return index; }
static Index createIndex(SqlgGraph sqlgGraph, AbstractLabel abstractLabel, String indexName, IndexType indexType, List<PropertyColumn> properties) { Index index = new Index(indexName, indexType, abstractLabel, properties); SchemaTable schemaTable = SchemaTable.of(abstractLabel.getSchema().getName(), abstractLabel.getLabel()); //For partitioned tables the index is on each partition. //It is created when the partition is created. if (!abstractLabel.isPartition()) { String prefix = abstractLabel instanceof VertexLabel ? VERTEX_PREFIX : EDGE_PREFIX; index.createIndex(sqlgGraph, schemaTable.withPrefix(prefix), index.getName()); } else { for (Partition partition : abstractLabel.getPartitions().values()) { partition.createIndexOnLeafPartitions(index); } } TopologyManager.addIndex(sqlgGraph, index); index.committed = false; return index; }
SchemaTable table = SchemaTable.from(graph(), label).withPrefix(Topology.VERTEX_PREFIX);
@Override protected void createParentEdges() { SchemaTable file = SchemaTable.from(graph(), Bdio.Class.File.name()).withPrefix(VERTEX_PREFIX); SchemaTable parent = SchemaTable.from(graph(), Bdio.ObjectProperty.parent.name()).withPrefix(EDGE_PREFIX); List<TraversalStrategy<?>> strategies = traversal().getStrategies().toList(); Map<String, Object> traversalProperties = new LinkedHashMap<>();
@Override protected void createMissingFiles() { SchemaTable file = SchemaTable.from(graph(), Bdio.Class.File.name()).withPrefix(Topology.VERTEX_PREFIX); List<TraversalStrategy<?>> strategies = traversal().getStrategies().toList();
private void updateFileSystemType(Bdio.FileSystemType fileSystemType) { SchemaTable file = SchemaTable.from(graph(), Bdio.Class.File.name()).withPrefix(VERTEX_PREFIX); SchemaTable parent = SchemaTable.from(graph(), Bdio.ObjectProperty.parent.name()).withPrefix(EDGE_PREFIX); List<TraversalStrategy<?>> strategies = traversal().getStrategies().toList();