public class IpcSharedMemorySpace extends Object implements Closeable
| Constructor and Description |
|---|
IpcSharedMemorySpace(String tokFileName,
int writerPid,
int readerPid,
int size,
boolean reader,
IgniteLogger parent)
This will allocate system resources for the space.
|
IpcSharedMemorySpace(String tokFileName,
int writerPid,
int readerPid,
int size,
boolean reader,
int shmemId,
IgniteLogger parent)
This should be called in order to attach to already allocated system resources.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
forceClose()
Forcibly closes the space and frees all system resources.
|
int |
otherPartyPid() |
int |
read(byte[] buf,
int off,
int len,
long timeout)
Blocks until at least 1 byte is read.
|
int |
read(ByteBuffer buf,
int off,
int len,
long timeout)
Blocks until at least 1 byte is read.
|
int |
readerPid() |
int |
semaphoreId() |
int |
sharedMemoryId() |
long |
sharedMemPointer() |
int |
size() |
String |
tokenFileName() |
String |
toString() |
int |
unreadCount() |
void |
write(byte[] buf,
int off,
int len,
long timeout) |
void |
write(ByteBuffer buf,
int off,
int len,
long timeout) |
int |
writerPid() |
public IpcSharedMemorySpace(String tokFileName, int writerPid, int readerPid, int size, boolean reader, IgniteLogger parent) throws IgniteCheckedException
tokFileName - Token filename.writerPid - Writer PID.readerPid - Reader PID.size - Size in bytes.reader - True if reader.parent - Parent logger.IgniteCheckedException - If failed.public IpcSharedMemorySpace(String tokFileName, int writerPid, int readerPid, int size, boolean reader, int shmemId, IgniteLogger parent) throws IgniteCheckedException
tokFileName - Token file name (for proper cleanup).writerPid - Writer PID.readerPid - Reader PID.size - Size.reader - Reader flag.shmemId - Shared memory ID.parent - Logger.IgniteCheckedException - If failed.public void write(byte[] buf,
int off,
int len,
long timeout)
throws IgniteCheckedException,
IpcSharedMemoryOperationTimedoutException
buf - Buffer.off - Offset.len - Length.timeout - Operation timeout in milliseconds (0 to wait forever).IgniteCheckedException - If space has been closed.IpcSharedMemoryOperationTimedoutException - If operation times out.public void write(ByteBuffer buf, int off, int len, long timeout) throws IgniteCheckedException, IpcSharedMemoryOperationTimedoutException
buf - Buffer.off - Offset.len - Length.timeout - Operation timeout in milliseconds (0 to wait forever).IgniteCheckedException - If space has been closed.IpcSharedMemoryOperationTimedoutException - If operation times out.public int read(byte[] buf,
int off,
int len,
long timeout)
throws IgniteCheckedException,
IpcSharedMemoryOperationTimedoutException
buf - Buffer.off - Offset.len - Length.timeout - Operation timeout in milliseconds (0 to wait forever).IgniteCheckedException - If space has been closed.IpcSharedMemoryOperationTimedoutException - If operation times out.public int read(ByteBuffer buf, int off, int len, long timeout) throws IgniteCheckedException, IpcSharedMemoryOperationTimedoutException
buf - Buffer.off - Offset.len - Length.timeout - Operation timeout in milliseconds (0 to wait forever).IgniteCheckedException - If space has been closed.IpcSharedMemoryOperationTimedoutException - If operation times out.public void close()
close in interface Closeableclose in interface AutoCloseablepublic void forceClose()
This method should be called with caution as it may result to the other-party process crash. It is intended to call when there was an IO error during handshake and other party has not yet attached to the space.
public int sharedMemoryId()
public int semaphoreId()
public int unreadCount()
throws IgniteCheckedException
IgniteCheckedException - If failed.public long sharedMemPointer()
public int readerPid()
public int writerPid()
public int otherPartyPid()
public String tokenFileName()
public int size()
Follow @ApacheIgnite
Ignite Fabric : ver. 2.4.0 Release Date : March 5 2018