From: Tuukka Lehtonen Date: Wed, 24 May 2017 10:40:28 +0000 (+0300) Subject: Merge "StreamingTransferableGraphImportProcess assumes index root cluster set" X-Git-Tag: v1.29.0~34 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=e5b73a681e5035fae3b53825dceb3bbe48e921d3;hp=0b1f301a6a42beea2716b3268a402db125b927eb;p=simantics%2Fplatform.git Merge "StreamingTransferableGraphImportProcess assumes index root cluster set" --- diff --git a/bundles/org.simantics.graph.db/src/org/simantics/graph/db/StreamingTransferableGraphImportProcess.java b/bundles/org.simantics.graph.db/src/org/simantics/graph/db/StreamingTransferableGraphImportProcess.java index 06abd615f..754ae6123 100644 --- a/bundles/org.simantics.graph.db/src/org/simantics/graph/db/StreamingTransferableGraphImportProcess.java +++ b/bundles/org.simantics.graph.db/src/org/simantics/graph/db/StreamingTransferableGraphImportProcess.java @@ -288,6 +288,14 @@ public class StreamingTransferableGraphImportProcess implements TransferableGrap void findClusterSet(WriteOnlyGraph graph, Resource rootLibrary, int[] clustering, int[] clusterSets, long[] clusters, int id) throws DatabaseException { ClusteringSupport support = graph.getService(ClusteringSupport.class); if(id == Extensions.ROOT_LIBRARY_CLUSTER_SET || id == Extensions.INDEX_ROOT_CLUSTER_SET) return; + Resource indexRootClusterSetResource = rootLibrary; + if(support.isClusterSet(indexRoot)) { + indexRootClusterSetResource = indexRoot; + } else { + graph.setClusterSet4NewResource(rootLibrary); + graph.flushCluster(); + } + int indexRootCsHandle = builder.handle(indexRootClusterSetResource); for(int pos=0,index=0;index