Search in sources :

Example 1 with PART_FILE_TEMPLATE

use of org.apache.ignite.internal.processors.cache.persistence.file.FilePageStoreManager.PART_FILE_TEMPLATE in project ignite by apache.

the class PagesPossibleCorruptionDiagnosticTest method filePageStore.

/**
 * @param ignite Ignite instance.
 * @param partId Partition id.
 * @return File page store for given partition id.
 * @throws IgniteCheckedException If failed.
 */
private FilePageStore filePageStore(IgniteEx ignite, int partId) throws IgniteCheckedException {
    final PdsFolderSettings folderSettings = ignite.context().pdsFolderResolver().resolveFolders();
    File storeWorkDir = new File(folderSettings.persistentStoreRootPath(), folderSettings.folderName());
    File cacheWorkDir = new File(storeWorkDir, CACHE_DIR_PREFIX + DEFAULT_CACHE_NAME);
    File partFile = new File(cacheWorkDir, format(PART_FILE_TEMPLATE, partId));
    return (FilePageStore) storeFactory.createPageStore(FLAG_DATA, partFile, a -> {
    });
}
Also used : CacheAtomicityMode(org.apache.ignite.cache.CacheAtomicityMode) RandomAccessFile(java.io.RandomAccessFile) PageIdUtils.pageId(org.apache.ignite.internal.pagemem.PageIdUtils.pageId) CACHE_DIR_PREFIX(org.apache.ignite.internal.processors.cache.persistence.file.FilePageStoreManager.CACHE_DIR_PREFIX) FLAG_DATA(org.apache.ignite.internal.pagemem.PageIdAllocator.FLAG_DATA) GridCacheUtils.cacheGroupId(org.apache.ignite.internal.processors.cache.GridCacheUtils.cacheGroupId) ClusterState(org.apache.ignite.cluster.ClusterState) PdsFolderSettings(org.apache.ignite.internal.processors.cache.persistence.filename.PdsFolderSettings) LongListReuseBag(org.apache.ignite.internal.processors.cache.persistence.tree.reuse.LongListReuseBag) IgniteEx(org.apache.ignite.internal.IgniteEx) IGNITE_PDS_SKIP_CRC(org.apache.ignite.IgniteSystemProperties.IGNITE_PDS_SKIP_CRC) ByteBuffer(java.nio.ByteBuffer) RendezvousAffinityFunction(org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction) IgniteSystemProperties(org.apache.ignite.IgniteSystemProperties) PART_META_REUSE_LIST_ROOT_OFF(org.apache.ignite.internal.processors.cache.persistence.tree.io.PagePartitionMetaIOV2.PART_META_REUSE_LIST_ROOT_OFF) DataStorageConfiguration(org.apache.ignite.configuration.DataStorageConfiguration) AbstractFreeList(org.apache.ignite.internal.processors.cache.persistence.freelist.AbstractFreeList) FilePageStore(org.apache.ignite.internal.processors.cache.persistence.file.FilePageStore) ReuseBag(org.apache.ignite.internal.processors.cache.persistence.tree.reuse.ReuseBag) PART_FILE_TEMPLATE(org.apache.ignite.internal.processors.cache.persistence.file.FilePageStoreManager.PART_FILE_TEMPLATE) GridCommonAbstractTest(org.apache.ignite.testframework.junits.common.GridCommonAbstractTest) IgniteCheckedException(org.apache.ignite.IgniteCheckedException) CorruptedFreeListException(org.apache.ignite.internal.processors.cache.persistence.freelist.CorruptedFreeListException) PartitionUpdateCounter(org.apache.ignite.internal.processors.cache.PartitionUpdateCounter) AsyncFileIOFactory(org.apache.ignite.internal.processors.cache.persistence.file.AsyncFileIOFactory) Test(org.junit.Test) FileVersionCheckingFactory(org.apache.ignite.internal.processors.cache.persistence.file.FileVersionCheckingFactory) File(java.io.File) IgniteCache(org.apache.ignite.IgniteCache) String.format(java.lang.String.format) IgniteCacheOffheapManager(org.apache.ignite.internal.processors.cache.IgniteCacheOffheapManager) WithSystemProperty(org.apache.ignite.testframework.junits.WithSystemProperty) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) CacheConfiguration(org.apache.ignite.configuration.CacheConfiguration) FailureHandlerWithCallback(org.apache.ignite.failure.FailureHandlerWithCallback) FileChannel(java.nio.channels.FileChannel) DataRegionConfiguration(org.apache.ignite.configuration.DataRegionConfiguration) FilePageStore(org.apache.ignite.internal.processors.cache.persistence.file.FilePageStore) PdsFolderSettings(org.apache.ignite.internal.processors.cache.persistence.filename.PdsFolderSettings) RandomAccessFile(java.io.RandomAccessFile) File(java.io.File)

Aggregations

File (java.io.File)1 RandomAccessFile (java.io.RandomAccessFile)1 String.format (java.lang.String.format)1 ByteBuffer (java.nio.ByteBuffer)1 FileChannel (java.nio.channels.FileChannel)1 IgniteCache (org.apache.ignite.IgniteCache)1 IgniteCheckedException (org.apache.ignite.IgniteCheckedException)1 IgniteSystemProperties (org.apache.ignite.IgniteSystemProperties)1 IGNITE_PDS_SKIP_CRC (org.apache.ignite.IgniteSystemProperties.IGNITE_PDS_SKIP_CRC)1 CacheAtomicityMode (org.apache.ignite.cache.CacheAtomicityMode)1 RendezvousAffinityFunction (org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction)1 ClusterState (org.apache.ignite.cluster.ClusterState)1 CacheConfiguration (org.apache.ignite.configuration.CacheConfiguration)1 DataRegionConfiguration (org.apache.ignite.configuration.DataRegionConfiguration)1 DataStorageConfiguration (org.apache.ignite.configuration.DataStorageConfiguration)1 IgniteConfiguration (org.apache.ignite.configuration.IgniteConfiguration)1 FailureHandlerWithCallback (org.apache.ignite.failure.FailureHandlerWithCallback)1 IgniteEx (org.apache.ignite.internal.IgniteEx)1 FLAG_DATA (org.apache.ignite.internal.pagemem.PageIdAllocator.FLAG_DATA)1 PageIdUtils.pageId (org.apache.ignite.internal.pagemem.PageIdUtils.pageId)1