Search in sources :

Example 1 with GridFilesystem

use of org.infinispan.io.GridFilesystem in project indy by Commonjava.

the class StorageFileIOTest method setup.

@Before
public void setup() throws IOException {
    storageRoot = temp.newFolder("data");
    Properties storageProps = new Properties();
    storageProps.setProperty(StorageFileIO.STORAGE_ROOT_DIR, storageRoot.getAbsolutePath());
    Configuration dataConfig = new ConfigurationBuilder().persistence().passivation(true).addStore(CustomStoreConfigurationBuilder.class).customStoreClass(StorageFileIO.class).properties(storageProps).build();
    String dataName = name.getMethodName() + "-data";
    CACHE_MANAGER.defineConfiguration(dataName, dataConfig);
    Configuration mdConfig = new ConfigurationBuilder().build();
    String metadataName = name.getMethodName() + "-metadata";
    CACHE_MANAGER.defineConfiguration(metadataName, mdConfig);
    dataCache = CACHE_MANAGER.getCache(dataName);
    fs = new GridFilesystem(dataCache, CACHE_MANAGER.getCache(metadataName));
}
Also used : ConfigurationBuilder(org.infinispan.configuration.cache.ConfigurationBuilder) CustomStoreConfigurationBuilder(org.infinispan.configuration.cache.CustomStoreConfigurationBuilder) Configuration(org.infinispan.configuration.cache.Configuration) GridFilesystem(org.infinispan.io.GridFilesystem) Properties(java.util.Properties) CustomStoreConfigurationBuilder(org.infinispan.configuration.cache.CustomStoreConfigurationBuilder) Before(org.junit.Before)

Example 2 with GridFilesystem

use of org.infinispan.io.GridFilesystem in project galley by Commonjava.

the class GridFileSystemCacheProviderTest method setup.

@Before
public void setup() throws Exception {
    final PathGenerator pathgen = new HashedLocationPathGenerator();
    final FileEventManager events = new TestFileEventManager();
    final TransferDecorator decorator = new TestTransferDecorator();
    Cache<String, byte[]> data = CACHE_MANAGER.getCache(name.getMethodName() + "-data");
    Cache<String, GridFile.Metadata> metadata = CACHE_MANAGER.getCache(name.getMethodName() + "-metadata");
    final GridFilesystem fs = new GridFilesystem(data, metadata);
    provider = new GridFileSystemCacheProvider(pathgen, events, decorator, fs);
}
Also used : TestTransferDecorator(org.commonjava.maven.galley.cache.testutil.TestTransferDecorator) GridFileSystemCacheProvider(org.commonjava.maven.galley.cache.infinispan.GridFileSystemCacheProvider) TestFileEventManager(org.commonjava.maven.galley.cache.testutil.TestFileEventManager) FileEventManager(org.commonjava.maven.galley.spi.event.FileEventManager) GridFilesystem(org.infinispan.io.GridFilesystem) HashedLocationPathGenerator(org.commonjava.maven.galley.io.HashedLocationPathGenerator) HashedLocationPathGenerator(org.commonjava.maven.galley.io.HashedLocationPathGenerator) PathGenerator(org.commonjava.maven.galley.spi.io.PathGenerator) TestFileEventManager(org.commonjava.maven.galley.cache.testutil.TestFileEventManager) TestTransferDecorator(org.commonjava.maven.galley.cache.testutil.TestTransferDecorator) TransferDecorator(org.commonjava.maven.galley.spi.io.TransferDecorator) Before(org.junit.Before)

Aggregations

GridFilesystem (org.infinispan.io.GridFilesystem)2 Before (org.junit.Before)2 Properties (java.util.Properties)1 GridFileSystemCacheProvider (org.commonjava.maven.galley.cache.infinispan.GridFileSystemCacheProvider)1 TestFileEventManager (org.commonjava.maven.galley.cache.testutil.TestFileEventManager)1 TestTransferDecorator (org.commonjava.maven.galley.cache.testutil.TestTransferDecorator)1 HashedLocationPathGenerator (org.commonjava.maven.galley.io.HashedLocationPathGenerator)1 FileEventManager (org.commonjava.maven.galley.spi.event.FileEventManager)1 PathGenerator (org.commonjava.maven.galley.spi.io.PathGenerator)1 TransferDecorator (org.commonjava.maven.galley.spi.io.TransferDecorator)1 Configuration (org.infinispan.configuration.cache.Configuration)1 ConfigurationBuilder (org.infinispan.configuration.cache.ConfigurationBuilder)1 CustomStoreConfigurationBuilder (org.infinispan.configuration.cache.CustomStoreConfigurationBuilder)1