public boolean isPartition() { return !partitionType.isNone(); }
public boolean isPartition() { return !partitionType.isNone(); }
sql.append(this.to); sql.append(")"); if (!this.partitionType.isNone()) { sql.append("\nPARTITION BY "); sql.append(this.partitionType.name()); if (this.partitionType.isNone()) { AbstractLabel abstractLabel = getAbstractLabel(); if (abstractLabel instanceof EdgeLabel) { throw new RuntimeException(e); if (this.partitionType.isNone()) { for (Index index : getAbstractLabel().getIndexes().values()) {
} else { PartitionType partitionType = PartitionType.valueOf(vertexLabelJson.get("partitionType").asText()); if (partitionType.isNone()) { vertexLabel = new VertexLabel(this, vertexLabelName); } else {
} else { PartitionType partitionType = PartitionType.valueOf(vertexLabelJson.get("partitionType").asText()); if (partitionType.isNone()) { vertexLabel = new VertexLabel(this, vertexLabelName); } else {
sql.append(this.to); sql.append(")"); if (!this.partitionType.isNone()) { sql.append("\nPARTITION BY "); sql.append(this.partitionType.name()); if (this.partitionType.isNone()) { AbstractLabel abstractLabel = getAbstractLabel(); if (abstractLabel instanceof EdgeLabel) { throw new RuntimeException(e); if (this.partitionType.isNone()) { for (Index index : getAbstractLabel().getIndexes().values()) {
public void createIndexOnLeafPartitions(Index index) { if (this.partitionType.isNone()) { //Append the partition name to the index name. String indexName = index.getName() + "_" + this.getName(); if (indexName.length() > this.sqlgGraph.getSqlDialect().getMaximumIndexNameLength()) { indexName = Index.generateName(this.sqlgGraph.getSqlDialect()); } index.createIndex(this.sqlgGraph, SchemaTable.of(getAbstractLabel().getSchema().getName(), this.getName()), indexName); } else { for (Partition partition : this.partitions.values()) { partition.createIndexOnLeafPartitions(index); } } }
public void createIndexOnLeafPartitions(Index index) { if (this.partitionType.isNone()) { //Append the partition name to the index name. String indexName = index.getName() + "_" + this.getName(); if (indexName.length() > this.sqlgGraph.getSqlDialect().getMaximumIndexNameLength()) { indexName = Index.generateName(this.sqlgGraph.getSqlDialect()); } index.createIndex(this.sqlgGraph, SchemaTable.of(getAbstractLabel().getSchema().getName(), this.getName()), indexName); } else { for (Partition partition : this.partitions.values()) { partition.createIndexOnLeafPartitions(index); } } }
if (partitionExpression.isPresent()) { PartitionType partitionType1 = PartitionType.from(partitionType.value()); Preconditions.checkState(!partitionType1.isNone()); partition = new Partition( this.sqlgGraph, } else { PartitionType partitionType1 = PartitionType.from(partitionType.value()); Preconditions.checkState(partitionType1.isNone()); partition = new Partition( this.sqlgGraph, if (partitionExpression.isPresent()) { PartitionType partitionType1 = PartitionType.from(partitionType.value()); Preconditions.checkState(!partitionType1.isNone()); partition = new Partition( this.sqlgGraph, } else { PartitionType partitionType1 = PartitionType.from(partitionType.value()); Preconditions.checkState(partitionType1.isNone()); partition = new Partition( this.sqlgGraph,
if (partitionExpression.isPresent()) { PartitionType partitionType1 = PartitionType.from(partitionType.value()); Preconditions.checkState(!partitionType1.isNone()); partition = new Partition( this.sqlgGraph, } else { PartitionType partitionType1 = PartitionType.from(partitionType.value()); Preconditions.checkState(partitionType1.isNone()); partition = new Partition( this.sqlgGraph, if (partitionExpression.isPresent()) { PartitionType partitionType1 = PartitionType.from(partitionType.value()); Preconditions.checkState(!partitionType1.isNone()); partition = new Partition( this.sqlgGraph, } else { PartitionType partitionType1 = PartitionType.from(partitionType.value()); Preconditions.checkState(partitionType1.isNone()); partition = new Partition( this.sqlgGraph,
if (!this.partitionType.isNone() && identifiers.isEmpty()) { throw new IllegalStateException("Partitioned table must have identifiers."); sql.append("."); sql.append(sqlDialect.maybeWrapInQoutes(tableName)); if (this.partitionType.isNone() && identifiers.isEmpty()) { sql.append("(\n\t"); sql.append(sqlDialect.maybeWrapInQoutes("ID")); sql.append(" "); if (this.partitionType.isNone()) { sql.append(sqlDialect.getAutoIncrementPrimaryKeyConstruct()); } else { if (this.partitionType.isNone() && !identifiers.isEmpty()) { sql.append(",\n\tPRIMARY KEY("); int count = 1; if (partitionType.isNone() && this.sqlgGraph.getTopology().isImplementingForeignKeys()) { sql.append(",\n\t"); sql.append("FOREIGN KEY ("); if (!partitionType.isNone()) { sql.append(" PARTITION BY "); sql.append(this.partitionType.name()); if (partitionType.isNone() && sqlDialect.needForeignKeyIndex() && !sqlDialect.isIndexPartOfCreateTable()) { sql.append("\n\tCREATE INDEX"); if (sqlDialect.requiresIndexName()) {
if (!this.partitionType.isNone() && identifiers.isEmpty()) { throw new IllegalStateException("Partitioned table must have identifiers."); sql.append("."); sql.append(sqlDialect.maybeWrapInQoutes(tableName)); if (this.partitionType.isNone() && identifiers.isEmpty()) { sql.append("(\n\t"); sql.append(sqlDialect.maybeWrapInQoutes("ID")); sql.append(" "); if (this.partitionType.isNone()) { sql.append(sqlDialect.getAutoIncrementPrimaryKeyConstruct()); } else { if (this.partitionType.isNone() && !identifiers.isEmpty()) { sql.append(",\n\tPRIMARY KEY("); int count = 1; if (partitionType.isNone() && this.sqlgGraph.getTopology().isImplementingForeignKeys()) { sql.append(",\n\t"); sql.append("FOREIGN KEY ("); if (!partitionType.isNone()) { sql.append(" PARTITION BY "); sql.append(this.partitionType.name()); if (partitionType.isNone() && sqlDialect.needForeignKeyIndex() && !sqlDialect.isIndexPartOfCreateTable()) { sql.append("\n\tCREATE INDEX"); if (sqlDialect.requiresIndexName()) {
private String foreignKeyIndexSql() { Preconditions.checkState(this.partitionType.isNone(), "Only leaf partitions can have indexes."); Preconditions.checkState(this.getAbstractLabel() instanceof EdgeLabel); SqlDialect sqlDialect = this.sqlgGraph.getSqlDialect();
private String foreignKeyIndexSql() { Preconditions.checkState(this.partitionType.isNone(), "Only leaf partitions can have indexes."); Preconditions.checkState(this.getAbstractLabel() instanceof EdgeLabel); SqlDialect sqlDialect = this.sqlgGraph.getSqlDialect();
if (!edgeLabelOptional.isPresent()) { PartitionType partitionType = PartitionType.valueOf(uncommittedOutEdgeLabel.get("partitionType").asText()); if (partitionType.isNone()) { edgeLabel = new EdgeLabel(this.getSchema().getTopology(), edgeLabelName); } else {
if (!edgeLabelOptional.isPresent()) { PartitionType partitionType = PartitionType.valueOf(uncommittedOutEdgeLabel.get("partitionType").asText()); if (partitionType.isNone()) { edgeLabel = new EdgeLabel(this.getSchema().getTopology(), edgeLabelName); } else {
vertexLabel = this.vertexLabels.get(schemaName + "." + VERTEX_PREFIX + tableName); if (vertexLabel == null) { if (!partitionType.isNone()) { vertexLabel = new VertexLabel(this, tableName, partitionType, partitionExpression.value()); } else { EdgeLabel edgeLabel; if (!edgeLabelOptional.isPresent()) { if (partitionType.isNone()) { edgeLabel = EdgeLabel.loadFromDb(vertexLabel.getSchema().getTopology(), edgeLabelName); } else {
vertexLabel = this.vertexLabels.get(schemaName + "." + VERTEX_PREFIX + tableName); if (vertexLabel == null) { if (!partitionType.isNone()) { vertexLabel = new VertexLabel(this, tableName, partitionType, partitionExpression.value()); } else { EdgeLabel edgeLabel; if (!edgeLabelOptional.isPresent()) { if (partitionType.isNone()) { edgeLabel = EdgeLabel.loadFromDb(vertexLabel.getSchema().getTopology(), edgeLabelName); } else {