Skip to content

Commit

Permalink
Ridbags are not created together with clusters in distributed storage
Browse files Browse the repository at this point in the history
  • Loading branch information
laa committed Aug 1, 2019
1 parent f889302 commit 12a2890
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
Expand Up @@ -4969,7 +4969,7 @@ private int doAddCluster(String clusterName, final int clusterPos) throws IOExce

((OClusterBasedStorageConfiguration) configuration).updateCluster(cluster.generateClusterConfig());

sbTreeCollectionManager.createComponent(createdClusterId);
sbTreeCollectionManager.createComponentIfPossible(createdClusterId);
}

return createdClusterId;
Expand Down
Expand Up @@ -108,12 +108,13 @@ public void delete(OBonsaiCollectionPointer collectionPointer) {
super.delete(collectionPointer);
}

public void createComponent(final int clusterId) throws IOException {
checkAccess();

final OSBTreeBonsaiLocal<OIdentifiable, Integer> tree = new OSBTreeBonsaiLocal<>(FILE_NAME_PREFIX + clusterId,
DEFAULT_EXTENSION, storage);
tree.createComponent();
public void createComponentIfPossible(final int clusterId) throws IOException {
//ignore creation of ridbags in distributed storage
if (!prohibitAccess) {
final OSBTreeBonsaiLocal<OIdentifiable, Integer> tree = new OSBTreeBonsaiLocal<>(FILE_NAME_PREFIX + clusterId,
DEFAULT_EXTENSION, storage);
tree.createComponent();
}
}

public long createComponent(final String fileName) throws IOException {
Expand Down

0 comments on commit 12a2890

Please sign in to comment.