public class IpcSharedMemoryServerEndpoint extends Object implements IpcServerEndpoint
Modifier and Type | Field and Description |
---|---|
static int |
DFLT_IPC_PORT
Default endpoint port number.
|
static int |
DFLT_SPACE_SIZE
Default shared memory space in bytes.
|
static String |
DFLT_TOKEN_DIR_PATH
Default token directory.
|
static String |
OUT_OF_RESOURCES_MSG
IPC error message.
|
static String |
TOKEN_FILE_NAME
Shared memory token file name prefix.
|
Constructor and Description |
---|
IpcSharedMemoryServerEndpoint(IgniteLogger log,
UUID locNodeId,
String igniteInstanceName,
String workDir)
Constructor to set dependencies explicitly.
|
IpcSharedMemoryServerEndpoint(String workDir)
Use this constructor when dependencies could be injected
with
GridResourceProcessor.injectGeneric(Object) . |
Modifier and Type | Method and Description |
---|---|
IpcEndpoint |
accept()
Accepts client IPC connection.
|
void |
close()
Closes server IPC.
|
@Nullable String |
getHost()
Gets host endpoint is bound to.
|
int |
getPort()
Gets port endpoint is bound to.
|
int |
getSize()
Gets size of shared memory spaces that are created by the endpoint.
|
String |
getTokenDirectoryPath()
Gets token directory path.
|
boolean |
isManagement()
Indicates if this endpoint is a management endpoint.
|
void |
omitOutOfResourcesWarning(boolean omitOutOfResourcesWarn) |
void |
setPort(int port)
Sets port endpoint will be bound to.
|
void |
setSize(int size)
Sets size of shared memory spaces that are created by the endpoint.
|
void |
setTokenDirectoryPath(String tokDirPath)
Sets token directory path.
|
void |
setupConfiguration(Map<String,String> endpointCfg)
Sets configuration properties from the map.
|
void |
start()
Starts configured endpoint implementation.
|
String |
toString() |
public static final String OUT_OF_RESOURCES_MSG
public static final int DFLT_IPC_PORT
public static final int DFLT_SPACE_SIZE
public static final String DFLT_TOKEN_DIR_PATH
IGNITE_HOME/work
folder
if IGNITE_HOME
system or environment variable specified, otherwise it is relative to
work
folder under system java.io.tmpdir
folder.public static final String TOKEN_FILE_NAME
public IpcSharedMemoryServerEndpoint(String workDir)
GridResourceProcessor.injectGeneric(Object)
.workDir
- Work directory.public IpcSharedMemoryServerEndpoint(IgniteLogger log, UUID locNodeId, String igniteInstanceName, String workDir)
log
- Log.locNodeId
- Node id.igniteInstanceName
- Ignite instance name.workDir
- Work directory.public void omitOutOfResourcesWarning(boolean omitOutOfResourcesWarn)
omitOutOfResourcesWarn
- If true
, out of resources warning will not be printed by server.public void start() throws IgniteCheckedException
start
in interface IpcServerEndpoint
IgniteCheckedException
- If failed to start server endpoint.public IpcEndpoint accept() throws IgniteCheckedException
accept
in interface IpcServerEndpoint
IgniteCheckedException
- If accept failed and the endpoint is not usable anymore.public int getPort()
getPort
in interface IpcServerEndpoint
@Nullable public @Nullable String getHost()
null
.getHost
in interface IpcServerEndpoint
public boolean isManagement()
isManagement
in interface IpcServerEndpoint
false
as shared memory endpoints can not be used for management.public void setPort(int port)
port
- Port number.public String getTokenDirectoryPath()
public void setTokenDirectoryPath(String tokDirPath)
tokDirPath
- Token directory path.public int getSize()
public void setSize(int size)
size
- Size of shared memory space.public void close()
close
in interface Closeable
close
in interface AutoCloseable
close
in interface IpcServerEndpoint
public void setupConfiguration(Map<String,String> endpointCfg) throws IgniteCheckedException
endpointCfg
- Map of properties.IgniteCheckedException
- If invalid property name or value.
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.10.0 Release Date : March 10 2021