/** {@inheritDoc} */ @Override protected IgfsIpcEndpointConfiguration primaryIpcEndpointConfiguration(final String gridName) { IgfsIpcEndpointConfiguration endpointCfg = new IgfsIpcEndpointConfiguration(); endpointCfg.setType(IgfsIpcEndpointType.TCP); endpointCfg.setPort(DFLT_IPC_PORT + getTestIgniteInstanceIndex(gridName)); return endpointCfg; }
/** * Copying constructor. * * @param cfg Configuration to copy. */ public IgfsIpcEndpointConfiguration(IgfsIpcEndpointConfiguration cfg) { type = cfg.getType(); host = cfg.getHost(); port = cfg.getPort(); memSize = cfg.getMemorySize(); tokenDirPath = cfg.getTokenDirectoryPath(); }
endPntCfg = new IgfsIpcEndpointConfiguration(); endPntCfg.setType(endPntType); endPntCfg.setPort(endPntPort); endPntCfg.setHost(endPntHost);
/** * Check invalid port handling. * * @param port Port. * @throws Exception If failed. */ private void checkInvalidPort(int port) throws Exception { final String failMsg = "IGFS endpoint TCP port is out of range"; final String igfsCfgName = "igfs-cfg"; final IgfsIpcEndpointConfiguration igfsEndpointCfg = new IgfsIpcEndpointConfiguration(); igfsEndpointCfg.setPort(port); g1IgfsCfg1.setName(igfsCfgName); g1IgfsCfg1.setIpcEndpointConfiguration(igfsEndpointCfg); checkGridStartFails(g1Cfg, failMsg, true); }
/** * @throws Exception If failed. */ @Test public void testInvalidEndpointThreadCount() throws Exception { final String failMsg = "IGFS endpoint thread count must be positive"; final String igfsCfgName = "igfs-cfg"; final IgfsIpcEndpointConfiguration igfsEndpointCfg = new IgfsIpcEndpointConfiguration(); igfsEndpointCfg.setThreadCount(0); g1IgfsCfg1.setName(igfsCfgName); g1IgfsCfg1.setIpcEndpointConfiguration(igfsEndpointCfg); checkGridStartFails(g1Cfg, failMsg, true); }
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); FileSystemConfiguration igfs = new FileSystemConfiguration(); igfs.setName("igfs"); igfs.setIpcEndpointConfiguration(new IgfsIpcEndpointConfiguration()); cfg.setFileSystemConfiguration(igfs); DataStorageConfiguration dsCfg = new DataStorageConfiguration(); DataRegionConfiguration drCfg = new DataRegionConfiguration(); drCfg.setName("testDataRegion"); drCfg.setMaxSize(100L * 1024 * 1024); dsCfg.setDefaultDataRegionConfiguration(drCfg); cfg.setDataStorageConfiguration(dsCfg); return cfg; }
final int tcpPort = ipcCfg.getPort(); ".." + MAX_TCP_PORT + "]: " + tcpPort); if (ipcCfg.getThreadCount() <= 0) throw new IgniteCheckedException("IGFS endpoint thread count must be positive: " + ipcCfg.getThreadCount());
IgfsIpcEndpointConfiguration endpointCfg = new IgfsIpcEndpointConfiguration(); endpointCfg.setType(IgfsIpcEndpointType.TCP); endpointCfg.setHost("127.0.0.1"); endpointCfg.setPort(endpointPort);
final int tcpPort = ipcCfg.getPort(); ".." + MAX_TCP_PORT + "]: " + tcpPort); if (ipcCfg.getThreadCount() <= 0) throw new IgniteCheckedException("IGFS endpoint thread count must be positive: " + ipcCfg.getThreadCount());
/** {@inheritDoc} */ @Override protected IgfsIpcEndpointConfiguration primaryIpcEndpointConfiguration(final String igniteInstanceName) { IgfsIpcEndpointConfiguration endpointCfg = new IgfsIpcEndpointConfiguration(); endpointCfg.setType(IgfsIpcEndpointType.SHMEM); endpointCfg.setPort(DFLT_IPC_PORT + getTestIgniteInstanceIndex(igniteInstanceName)); return endpointCfg; }
A.notNull(endpointCfg, "endpointCfg"); IgfsIpcEndpointType typ = endpointCfg.getType(); new IpcSharedMemoryServerEndpoint(igfsCtx.kernalContext().config().getWorkDirectory()); endpoint.setPort(endpointCfg.getPort()); endpoint.setSize(endpointCfg.getMemorySize()); endpoint.setTokenDirectoryPath(endpointCfg.getTokenDirectoryPath()); IpcServerTcpEndpoint endpoint = new IpcServerTcpEndpoint(); endpoint.setHost(endpointCfg.getHost()); endpoint.setPort(endpointCfg.getPort()); endpoint.setManagement(mgmt);
/** * Get primary IPC endpoint configuration. * * @param igniteInstanceName Ignite instance name. * @return IPC primary endpoint configuration. */ protected IgfsIpcEndpointConfiguration primaryIpcEndpointConfiguration(final String igniteInstanceName) { IgfsIpcEndpointConfiguration cfg = new IgfsIpcEndpointConfiguration(); cfg.setType(IgfsIpcEndpointType.TCP); cfg.setPort(DFLT_IPC_PORT + getTestIgniteInstanceIndex(igniteInstanceName)); return cfg; }
/** * Copying constructor. * * @param cfg Configuration to copy. */ public IgfsIpcEndpointConfiguration(IgfsIpcEndpointConfiguration cfg) { type = cfg.getType(); host = cfg.getHost(); port = cfg.getPort(); memSize = cfg.getMemorySize(); tokenDirPath = cfg.getTokenDirectoryPath(); }
/** {@inheritDoc} */ @Override protected IgfsIpcEndpointConfiguration primaryIpcEndpointConfiguration(final String igniteInstanceName) { IgfsIpcEndpointConfiguration endpointCfg = new IgfsIpcEndpointConfiguration(); endpointCfg.setType(IgfsIpcEndpointType.TCP); endpointCfg.setPort(DFLT_IPC_PORT + getTestIgniteInstanceIndex(igniteInstanceName)); return endpointCfg; } }
A.notNull(endpointCfg, "endpointCfg"); IgfsIpcEndpointType typ = endpointCfg.getType(); new IpcSharedMemoryServerEndpoint(igfsCtx.kernalContext().config().getWorkDirectory()); endpoint.setPort(endpointCfg.getPort()); endpoint.setSize(endpointCfg.getMemorySize()); endpoint.setTokenDirectoryPath(endpointCfg.getTokenDirectoryPath()); IpcServerTcpEndpoint endpoint = new IpcServerTcpEndpoint(); endpoint.setHost(endpointCfg.getHost()); endpoint.setPort(endpointCfg.getPort()); endpoint.setManagement(mgmt);
/** {@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; }
/** {@inheritDoc} */ @Override protected IgfsIpcEndpointConfiguration primaryIpcEndpointConfiguration(final String gridName) { IgfsIpcEndpointConfiguration endpointCfg = new IgfsIpcEndpointConfiguration(); endpointCfg.setType(IgfsIpcEndpointType.SHMEM); endpointCfg.setPort(DFLT_IPC_PORT + getTestIgniteInstanceIndex(gridName)); return endpointCfg; }
/** {@inheritDoc} */ @Override protected IgfsIpcEndpointConfiguration primaryIpcEndpointConfiguration(final String igniteInstanceName) { IgfsIpcEndpointConfiguration cfg = new IgfsIpcEndpointConfiguration(); cfg.setType(IgfsIpcEndpointType.TCP); cfg.setPort(DFLT_IPC_PORT + getTestIgniteInstanceIndex(igniteInstanceName)); return cfg; }
/** {@inheritDoc} */ @Override protected void start0() throws IgniteCheckedException { FileSystemConfiguration igfsCfg = igfsCtx.configuration(); if (igfsCfg.isIpcEndpointEnabled()) { IgfsIpcEndpointConfiguration ipcCfg = igfsCfg.getIpcEndpointConfiguration(); if (ipcCfg == null) ipcCfg = new IgfsIpcEndpointConfiguration(); bind(ipcCfg, /*management*/false); } if (igfsCfg.getManagementPort() >= 0) { IgfsIpcEndpointConfiguration mgmtIpcCfg = new IgfsIpcEndpointConfiguration(); mgmtIpcCfg.setType(TCP); mgmtIpcCfg.setPort(igfsCfg.getManagementPort()); bind(mgmtIpcCfg, /*management*/true); } if (bindWorker != null) new IgniteThread(bindWorker).start(); }
/** {@inheritDoc} */ @Override protected FileSystemConfiguration getIgfsConfiguration() throws IgniteCheckedException { FileSystemConfiguration igfsCfg = super.getIgfsConfiguration(); igfsCfg.setDefaultMode(IgfsMode.PRIMARY); IgfsIpcEndpointConfiguration endpointCfg = new IgfsIpcEndpointConfiguration(); endpointCfg.setType(IgfsIpcEndpointType.SHMEM); endpointCfg.setPort(IpcSharedMemoryServerEndpoint.DFLT_IPC_PORT + 1); igfsCfg.setIpcEndpointConfiguration(endpointCfg); return igfsCfg; } }