ibessonov commented on code in PR #4640: URL: https://github.com/apache/ignite-3/pull/4640#discussion_r1824095691
########## modules/storage-api/src/main/java/org/apache/ignite/internal/storage/engine/NullStorageEngine.java: ########## @@ -0,0 +1,68 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ignite.internal.storage.engine; + +import org.apache.ignite.internal.storage.StorageException; +import org.apache.ignite.internal.storage.index.StorageIndexDescriptorSupplier; +import org.jetbrains.annotations.Nullable; + +/** + * {@link StorageEngine} implementation used when the node currently does not have the storage profile declared for the table + * and/or the corresponding storage engine. Such an object is used as a placeholder to have ability to create a table object, + * but any storage functionality will be absent (exceptions will be thrown). + * + * <p>Before a node starts getting assignments for partitions of such a table, both storage engine and storage profile must be created + * on the node and this placeholder object must be replaced with a 'real' storage object. + */ +public class NullStorageEngine implements StorageEngine { Review Comment: Same comments here ########## modules/storage-api/src/main/java/org/apache/ignite/internal/storage/engine/NullMvTableStorage.java: ########## @@ -0,0 +1,136 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ignite.internal.storage.engine; + +import java.util.concurrent.CompletableFuture; +import org.apache.ignite.internal.storage.MvPartitionStorage; +import org.apache.ignite.internal.storage.StorageException; +import org.apache.ignite.internal.storage.index.HashIndexStorage; +import org.apache.ignite.internal.storage.index.IndexStorage; +import org.apache.ignite.internal.storage.index.SortedIndexStorage; +import org.apache.ignite.internal.storage.index.StorageHashIndexDescriptor; +import org.apache.ignite.internal.storage.index.StorageSortedIndexDescriptor; +import org.jetbrains.annotations.Nullable; + +/** + * {@link MvTableStorage} implementation used when the node currently does not have the storage profile declared for the table + * and/or the corresponding storage engine. Such an object is used as a placeholder to have ability to create a table object, + * but any storage functionality will be absent (exceptions will be thrown). + * + * <p>Before a node starts getting assignments for partitions of such a table, both storage engine and storage profile must be created + * on the node and this placeholder object must be replaced with a 'real' storage object. + */ +public class NullMvTableStorage implements MvTableStorage { Review Comment: Should we move it into `table` module? ########## modules/table/src/main/java/org/apache/ignite/internal/table/distributed/TableManager.java: ########## @@ -1737,7 +1738,10 @@ private CompletableFuture<List<Assignments>> getOrCreateAssignments( protected MvTableStorage createTableStorage(CatalogTableDescriptor tableDescriptor, CatalogZoneDescriptor zoneDescriptor) { StorageEngine engine = dataStorageMgr.engineByStorageProfile(tableDescriptor.storageProfile()); - assert engine != null : "tableId=" + tableDescriptor.id() + ", storageProfile=" + tableDescriptor.storageProfile(); + if (engine == null) { Review Comment: Does everything else work? ########## modules/storage-api/src/main/java/org/apache/ignite/internal/storage/engine/NullMvTableStorage.java: ########## @@ -0,0 +1,136 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ignite.internal.storage.engine; + +import java.util.concurrent.CompletableFuture; +import org.apache.ignite.internal.storage.MvPartitionStorage; +import org.apache.ignite.internal.storage.StorageException; +import org.apache.ignite.internal.storage.index.HashIndexStorage; +import org.apache.ignite.internal.storage.index.IndexStorage; +import org.apache.ignite.internal.storage.index.SortedIndexStorage; +import org.apache.ignite.internal.storage.index.StorageHashIndexDescriptor; +import org.apache.ignite.internal.storage.index.StorageSortedIndexDescriptor; +import org.jetbrains.annotations.Nullable; + +/** + * {@link MvTableStorage} implementation used when the node currently does not have the storage profile declared for the table + * and/or the corresponding storage engine. Such an object is used as a placeholder to have ability to create a table object, + * but any storage functionality will be absent (exceptions will be thrown). + * + * <p>Before a node starts getting assignments for partitions of such a table, both storage engine and storage profile must be created + * on the node and this placeholder object must be replaced with a 'real' storage object. + */ +public class NullMvTableStorage implements MvTableStorage { Review Comment: I would prefer not to have a table storage instance at all, but that is a much more involved change in the code. We should consider it in the future. Current approach feels more like a warkaround -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@ignite.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org