use of org.apache.ignite.igfs.IgfsIpcEndpointConfiguration in project ignite by apache.
the class IgniteHadoopFileSystemClientSelfTest method getConfiguration.
/** {@inheritDoc} */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
discoSpi.setIpFinder(new TcpDiscoveryVmIpFinder(true));
cfg.setDiscoverySpi(discoSpi);
FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
igfsCfg.setDataCacheConfiguration(dataCacheConfiguration());
igfsCfg.setMetaCacheConfiguration(metaCacheConfiguration());
igfsCfg.setName("igfs");
igfsCfg.setBlockSize(512 * 1024);
IgfsIpcEndpointConfiguration endpointCfg = new IgfsIpcEndpointConfiguration();
endpointCfg.setType(IgfsIpcEndpointType.TCP);
endpointCfg.setPort(DFLT_IPC_PORT);
igfsCfg.setIpcEndpointConfiguration(endpointCfg);
cfg.setFileSystemConfiguration(igfsCfg);
return cfg;
}
use of org.apache.ignite.igfs.IgfsIpcEndpointConfiguration in project ignite by apache.
the class IgniteHadoopFileSystemHandshakeSelfTest method gridConfiguration.
/**
* Create Grid configuration.
*
* @param dfltIgniteInstanceName Default Ignite instance name.
* @return Grid configuration.
* @throws Exception If failed.
*/
private IgniteConfiguration gridConfiguration(boolean dfltIgniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(dfltIgniteInstanceName ? null : IGNITE_INSTANCE_NAME);
cfg.setLocalHost("127.0.0.1");
cfg.setConnectorConfiguration(null);
TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
discoSpi.setIpFinder(IP_FINDER);
cfg.setDiscoverySpi(discoSpi);
TcpCommunicationSpi commSpi = new TcpCommunicationSpi();
commSpi.setSharedMemoryPort(-1);
cfg.setCommunicationSpi(commSpi);
CacheConfiguration metaCacheCfg = defaultCacheConfiguration();
metaCacheCfg.setCacheMode(REPLICATED);
metaCacheCfg.setWriteSynchronizationMode(FULL_SYNC);
metaCacheCfg.setAtomicityMode(TRANSACTIONAL);
CacheConfiguration dataCacheCfg = defaultCacheConfiguration();
dataCacheCfg.setCacheMode(PARTITIONED);
dataCacheCfg.setNearConfiguration(null);
dataCacheCfg.setWriteSynchronizationMode(FULL_SYNC);
dataCacheCfg.setAffinityMapper(new IgfsGroupDataBlocksKeyMapper(128));
dataCacheCfg.setBackups(0);
dataCacheCfg.setAtomicityMode(TRANSACTIONAL);
FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
igfsCfg.setName(IGFS_NAME);
igfsCfg.setPrefetchBlocks(1);
igfsCfg.setDefaultMode(PRIMARY);
igfsCfg.setDataCacheConfiguration(dataCacheCfg);
igfsCfg.setMetaCacheConfiguration(metaCacheCfg);
IgfsIpcEndpointConfiguration endpointCfg = new IgfsIpcEndpointConfiguration();
endpointCfg.setType(IgfsIpcEndpointType.TCP);
endpointCfg.setPort(DFLT_IPC_PORT);
igfsCfg.setIpcEndpointConfiguration(endpointCfg);
igfsCfg.setManagementPort(-1);
igfsCfg.setBlockSize(512 * 1024);
cfg.setFileSystemConfiguration(igfsCfg);
return cfg;
}
use of org.apache.ignite.igfs.IgfsIpcEndpointConfiguration in project ignite by apache.
the class IpcSharedMemoryNodeStartup method main.
/**
* @param args Args.
* @throws Exception If failed.
*/
public static void main(String[] args) throws Exception {
IgniteConfiguration cfg = new IgniteConfiguration();
FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
discoSpi.setIpFinder(new TcpDiscoveryVmIpFinder(true));
cfg.setDiscoverySpi(discoSpi);
IgfsIpcEndpointConfiguration endpointCfg = new IgfsIpcEndpointConfiguration();
endpointCfg.setType(IgfsIpcEndpointType.SHMEM);
endpointCfg.setPort(10500);
igfsCfg.setIpcEndpointConfiguration(endpointCfg);
igfsCfg.setName("igfs");
CacheConfiguration metaCacheCfg = new CacheConfiguration();
metaCacheCfg.setName("partitioned");
metaCacheCfg.setCacheMode(PARTITIONED);
metaCacheCfg.setNearConfiguration(null);
metaCacheCfg.setWriteSynchronizationMode(FULL_SYNC);
metaCacheCfg.setEvictionPolicy(null);
metaCacheCfg.setBackups(0);
CacheConfiguration dataCacheCfg = new CacheConfiguration();
dataCacheCfg.setName("partitioned");
dataCacheCfg.setCacheMode(PARTITIONED);
dataCacheCfg.setNearConfiguration(null);
dataCacheCfg.setWriteSynchronizationMode(FULL_SYNC);
dataCacheCfg.setEvictionPolicy(null);
dataCacheCfg.setBackups(0);
igfsCfg.setMetaCacheConfiguration(metaCacheCfg);
igfsCfg.setDataCacheConfiguration(dataCacheCfg);
cfg.setFileSystemConfiguration(igfsCfg);
cfg.setIncludeEventTypes(EVT_TASK_FAILED, EVT_TASK_FINISHED, EVT_JOB_MAPPED);
try (Ignite ignored = G.start(cfg)) {
X.println("Press any key to stop grid...");
System.in.read();
}
}
use of org.apache.ignite.igfs.IgfsIpcEndpointConfiguration in project ignite by apache.
the class HadoopIgfs20FileSystemShmemPrimarySelfTest method primaryIpcEndpointConfiguration.
/** {@inheritDoc} */
@Override
protected IgfsIpcEndpointConfiguration primaryIpcEndpointConfiguration(final String igniteInstanceName) {
IgfsIpcEndpointConfiguration cfg = new IgfsIpcEndpointConfiguration();
cfg.setType(IgfsIpcEndpointType.SHMEM);
cfg.setPort(DFLT_IPC_PORT + getTestIgniteInstanceIndex(igniteInstanceName));
return cfg;
}
use of org.apache.ignite.igfs.IgfsIpcEndpointConfiguration 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();
}
Aggregations