tkalkirill commented on code in PR #815: URL: https://github.com/apache/ignite-3/pull/815#discussion_r882764623
########## modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/persistence/store/FilePageStoreManager.java: ########## @@ -0,0 +1,329 @@ +/* + * 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.pagememory.persistence.store; + +import static java.nio.file.Files.createDirectories; +import static org.apache.ignite.internal.pagememory.PageIdAllocator.INDEX_PARTITION; +import static org.apache.ignite.internal.pagememory.PageIdAllocator.MAX_PARTITION_ID; +import static org.apache.ignite.internal.pagememory.persistence.store.PageStore.TYPE_DATA; +import static org.apache.ignite.internal.pagememory.persistence.store.PageStore.TYPE_IDX; +import static org.apache.ignite.internal.util.IgniteUtils.closeAll; + +import java.io.IOException; +import java.nio.ByteBuffer; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Iterator; +import java.util.List; +import org.apache.ignite.internal.fileio.FileIo; +import org.apache.ignite.internal.fileio.FileIoFactory; +import org.apache.ignite.internal.manager.IgniteComponent; +import org.apache.ignite.internal.pagememory.PageIdAllocator; +import org.apache.ignite.internal.pagememory.persistence.PageReadWriteManager; +import org.apache.ignite.internal.util.IgniteStripedLock; +import org.apache.ignite.lang.IgniteInternalCheckedException; +import org.apache.ignite.lang.IgniteLogger; +import org.jetbrains.annotations.Nullable; + +/** + * File page store manager. + */ +public class FilePageStoreManager implements IgniteComponent, PageReadWriteManager { + /** File suffix. */ + public static final String FILE_SUFFIX = ".bin"; + + /** Partition file prefix. */ + public static final String PART_FILE_PREFIX = "part-"; + + /** Index file prefix. */ + public static final String INDEX_FILE_PREFIX = "index"; + + /** Index file name. */ + public static final String INDEX_FILE_NAME = INDEX_FILE_PREFIX + FILE_SUFFIX; + + /** Partition file template. */ + public static final String PART_FILE_TEMPLATE = PART_FILE_PREFIX + "%d" + FILE_SUFFIX; + + /** Group directory prefix. */ + public static final String GROUP_DIR_PREFIX = "group-"; + + /** Logger. */ + private final IgniteLogger log; + + /** Starting directory for all file page stores, for example: 'db/group-123/index.bin'. */ + private final Path dbDir; + + /** {@link FileIo} factory for file page store. */ + private final FileIoFactory filePageStoreFileIoFactory; + + /** Page size in bytes. */ + private final int pageSize; + + /** Page read write manager. */ + private final PageReadWriteManagerImpl pageReadWriteManager = new PageReadWriteManagerImpl(this); Review Comment: Fix it. -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
