Search in sources :

Example 26 with IgfsGroupDataBlocksKeyMapper

use of org.apache.ignite.igfs.IgfsGroupDataBlocksKeyMapper in project ignite by apache.

the class HadoopIgfs20FileSystemAbstractSelfTest method dataCacheConfiguration.

/**
     * Gets cache configuration.
     *
     * @param igniteInstanceName Ignite instance name.
     * @return Cache configuration.
     */
protected CacheConfiguration dataCacheConfiguration(String igniteInstanceName) {
    CacheConfiguration cacheCfg = defaultCacheConfiguration();
    cacheCfg.setCacheMode(PARTITIONED);
    cacheCfg.setNearConfiguration(null);
    cacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
    cacheCfg.setAffinityMapper(new IgfsGroupDataBlocksKeyMapper(GRP_SIZE));
    cacheCfg.setBackups(0);
    cacheCfg.setAtomicityMode(TRANSACTIONAL);
    return cacheCfg;
}
Also used : IgfsGroupDataBlocksKeyMapper(org.apache.ignite.igfs.IgfsGroupDataBlocksKeyMapper) CacheConfiguration(org.apache.ignite.configuration.CacheConfiguration)

Example 27 with IgfsGroupDataBlocksKeyMapper

use of org.apache.ignite.igfs.IgfsGroupDataBlocksKeyMapper in project ignite by apache.

the class IgniteHadoopFileSystemLoggerStateSelfTest method startUp.

/**
     * Startup the grid and instantiate the file system.
     *
     * @throws Exception If failed.
     */
private void startUp() throws Exception {
    FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
    igfsCfg.setName("igfs");
    igfsCfg.setBlockSize(512 * 1024);
    igfsCfg.setDefaultMode(PRIMARY);
    IgfsIpcEndpointConfiguration endpointCfg = new IgfsIpcEndpointConfiguration();
    endpointCfg.setType(IgfsIpcEndpointType.TCP);
    endpointCfg.setPort(10500);
    igfsCfg.setIpcEndpointConfiguration(endpointCfg);
    CacheConfiguration dataCacheCfg = defaultCacheConfiguration();
    dataCacheCfg.setName("partitioned");
    dataCacheCfg.setCacheMode(PARTITIONED);
    dataCacheCfg.setNearConfiguration(null);
    dataCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
    dataCacheCfg.setAffinityMapper(new IgfsGroupDataBlocksKeyMapper(128));
    dataCacheCfg.setBackups(0);
    dataCacheCfg.setAtomicityMode(TRANSACTIONAL);
    CacheConfiguration metaCacheCfg = defaultCacheConfiguration();
    metaCacheCfg.setName("replicated");
    metaCacheCfg.setCacheMode(REPLICATED);
    metaCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
    metaCacheCfg.setAtomicityMode(TRANSACTIONAL);
    igfsCfg.setDataCacheConfiguration(dataCacheCfg);
    igfsCfg.setMetaCacheConfiguration(metaCacheCfg);
    IgniteConfiguration cfg = new IgniteConfiguration();
    cfg.setIgniteInstanceName("igfs-grid");
    TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
    discoSpi.setIpFinder(new TcpDiscoveryVmIpFinder(true));
    cfg.setDiscoverySpi(discoSpi);
    cfg.setFileSystemConfiguration(igfsCfg);
    cfg.setLocalHost("127.0.0.1");
    cfg.setConnectorConfiguration(null);
    Ignite g = G.start(cfg);
    igfs = (IgfsEx) g.fileSystem("igfs");
    igfs.globalSampling(sampling);
    fs = fileSystem();
}
Also used : IgfsGroupDataBlocksKeyMapper(org.apache.ignite.igfs.IgfsGroupDataBlocksKeyMapper) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) TcpDiscoveryVmIpFinder(org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder) IgfsIpcEndpointConfiguration(org.apache.ignite.igfs.IgfsIpcEndpointConfiguration) Ignite(org.apache.ignite.Ignite) FileSystemConfiguration(org.apache.ignite.configuration.FileSystemConfiguration) CacheConfiguration(org.apache.ignite.configuration.CacheConfiguration) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Example 28 with IgfsGroupDataBlocksKeyMapper

use of org.apache.ignite.igfs.IgfsGroupDataBlocksKeyMapper in project ignite by apache.

the class IgfsMetaManagerSelfTest method cacheConfiguration.

/** {@inheritDoc} */
protected CacheConfiguration cacheConfiguration(@NotNull String cacheName) {
    CacheConfiguration cacheCfg = defaultCacheConfiguration();
    cacheCfg.setName(cacheName);
    if (META_CACHE_NAME.equals(cacheName))
        cacheCfg.setCacheMode(REPLICATED);
    else {
        cacheCfg.setCacheMode(PARTITIONED);
        cacheCfg.setNearConfiguration(null);
        cacheCfg.setBackups(0);
        cacheCfg.setAffinityMapper(new IgfsGroupDataBlocksKeyMapper(128));
    }
    cacheCfg.setWriteSynchronizationMode(FULL_SYNC);
    cacheCfg.setAtomicityMode(TRANSACTIONAL);
    return cacheCfg;
}
Also used : IgfsGroupDataBlocksKeyMapper(org.apache.ignite.igfs.IgfsGroupDataBlocksKeyMapper) CacheConfiguration(org.apache.ignite.configuration.CacheConfiguration)

Example 29 with IgfsGroupDataBlocksKeyMapper

use of org.apache.ignite.igfs.IgfsGroupDataBlocksKeyMapper in project ignite by apache.

the class IgfsModesSelfTest method startUp.

/**
     * Perform initial startup.
     *
     * @throws Exception If failed.
     */
@SuppressWarnings("NullableProblems")
private void startUp() throws Exception {
    startUpSecondary();
    FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
    igfsCfg.setName("igfs");
    igfsCfg.setBlockSize(512 * 1024);
    if (setNullMode)
        igfsCfg.setDefaultMode(null);
    else if (mode != null)
        igfsCfg.setDefaultMode(mode);
    igfsCfg.setPathModes(pathModes);
    if (setSecondaryFs)
        igfsCfg.setSecondaryFileSystem(igfsSecondary.asSecondary());
    CacheConfiguration dataCacheCfg = defaultCacheConfiguration();
    dataCacheCfg.setCacheMode(PARTITIONED);
    dataCacheCfg.setNearConfiguration(null);
    dataCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
    dataCacheCfg.setAffinityMapper(new IgfsGroupDataBlocksKeyMapper(128));
    dataCacheCfg.setBackups(0);
    dataCacheCfg.setAtomicityMode(TRANSACTIONAL);
    CacheConfiguration metaCacheCfg = defaultCacheConfiguration();
    metaCacheCfg.setCacheMode(REPLICATED);
    metaCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
    metaCacheCfg.setAtomicityMode(TRANSACTIONAL);
    igfsCfg.setMetaCacheConfiguration(metaCacheCfg);
    igfsCfg.setDataCacheConfiguration(dataCacheCfg);
    IgniteConfiguration cfg = new IgniteConfiguration();
    cfg.setIgniteInstanceName("igfs-grid");
    TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
    discoSpi.setIpFinder(new TcpDiscoveryVmIpFinder(true));
    cfg.setDiscoverySpi(discoSpi);
    cfg.setFileSystemConfiguration(igfsCfg);
    cfg.setLocalHost("127.0.0.1");
    cfg.setConnectorConfiguration(null);
    grid = (IgniteEx) G.start(cfg);
    igfs = (IgfsImpl) grid.fileSystem("igfs");
}
Also used : IgfsGroupDataBlocksKeyMapper(org.apache.ignite.igfs.IgfsGroupDataBlocksKeyMapper) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) TcpDiscoveryVmIpFinder(org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder) FileSystemConfiguration(org.apache.ignite.configuration.FileSystemConfiguration) CacheConfiguration(org.apache.ignite.configuration.CacheConfiguration) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Example 30 with IgfsGroupDataBlocksKeyMapper

use of org.apache.ignite.igfs.IgfsGroupDataBlocksKeyMapper in project ignite by apache.

the class IgfsOneClientNodeTest method cacheConfiguration.

/** {@inheritDoc} */
protected CacheConfiguration cacheConfiguration(@NotNull String cacheName) {
    CacheConfiguration cacheCfg = defaultCacheConfiguration();
    cacheCfg.setName(cacheName);
    cacheCfg.setCacheMode(PARTITIONED);
    cacheCfg.setBackups(0);
    cacheCfg.setAffinityMapper(new IgfsGroupDataBlocksKeyMapper(128));
    cacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
    cacheCfg.setAtomicityMode(TRANSACTIONAL);
    return cacheCfg;
}
Also used : IgfsGroupDataBlocksKeyMapper(org.apache.ignite.igfs.IgfsGroupDataBlocksKeyMapper) CacheConfiguration(org.apache.ignite.configuration.CacheConfiguration)

Aggregations

IgfsGroupDataBlocksKeyMapper (org.apache.ignite.igfs.IgfsGroupDataBlocksKeyMapper)43 CacheConfiguration (org.apache.ignite.configuration.CacheConfiguration)40 FileSystemConfiguration (org.apache.ignite.configuration.FileSystemConfiguration)24 IgniteConfiguration (org.apache.ignite.configuration.IgniteConfiguration)23 TcpDiscoverySpi (org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)21 TcpDiscoveryVmIpFinder (org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder)12 IgfsIpcEndpointConfiguration (org.apache.ignite.igfs.IgfsIpcEndpointConfiguration)6 HashMap (java.util.HashMap)5 Ignite (org.apache.ignite.Ignite)5 IgfsMode (org.apache.ignite.igfs.IgfsMode)4 ArrayList (java.util.ArrayList)3 NearCacheConfiguration (org.apache.ignite.configuration.NearCacheConfiguration)3 AffinityKeyMapper (org.apache.ignite.cache.affinity.AffinityKeyMapper)2 IgniteUuid (org.apache.ignite.lang.IgniteUuid)2 HashSet (java.util.HashSet)1 Map (java.util.Map)1 IgniteCheckedException (org.apache.ignite.IgniteCheckedException)1 IgfsPerBlockLruEvictionPolicy (org.apache.ignite.cache.eviction.igfs.IgfsPerBlockLruEvictionPolicy)1 HadoopConfiguration (org.apache.ignite.configuration.HadoopConfiguration)1 IgniteInternalFuture (org.apache.ignite.internal.IgniteInternalFuture)1