public class OutputGate extends Gate<IOReadableWritable>
| Constructor and Description |
|---|
OutputGate(JobID jobId,
GateID gateId,
int index)
Constructs a new output gate.
|
| Modifier and Type | Method and Description |
|---|---|
void |
broadcastBuffer(Buffer buffer) |
void |
broadcastEvent(AbstractEvent event) |
OutputChannel[] |
channels() |
OutputChannel |
getChannel(int index) |
int |
getNumChannels() |
void |
initializeChannels(GateDeploymentDescriptor descriptor) |
boolean |
isClosed()
Checks if the gate is closed.
|
boolean |
isInputGate()
Checks if the considered gate is an input gate.
|
void |
publishEvent(AbstractEvent event)
Publishes an event.
|
void |
releaseAllChannelResources()
Releases the allocated resources (particularly buffer) of all channels attached to this gate.
|
void |
requestClose() |
void |
sendBuffer(Buffer buffer,
int targetChannel) |
void |
sendBufferAndEvent(Buffer buffer,
AbstractEvent event,
int targetChannel) |
void |
sendEvent(AbstractEvent event,
int targetChannel) |
String |
toString() |
void |
waitForGateToBeClosed() |
deliverEvent, getChannelType, getEventNotificationManager, getGateID, getIndex, getJobID, setChannelType, subscribeToEvent, unsubscribeFromEventpublic void sendBuffer(Buffer buffer, int targetChannel) throws IOException, InterruptedException
IOExceptionInterruptedExceptionpublic void sendEvent(AbstractEvent event, int targetChannel) throws IOException, InterruptedException
IOExceptionInterruptedExceptionpublic void sendBufferAndEvent(Buffer buffer, AbstractEvent event, int targetChannel) throws IOException, InterruptedException
IOExceptionInterruptedExceptionpublic void broadcastBuffer(Buffer buffer) throws IOException, InterruptedException
IOExceptionInterruptedExceptionpublic void broadcastEvent(AbstractEvent event) throws IOException, InterruptedException
IOExceptionInterruptedExceptionpublic void initializeChannels(GateDeploymentDescriptor descriptor)
public OutputChannel[] channels()
public OutputChannel getChannel(int index)
public int getNumChannels()
public void requestClose()
throws IOException,
InterruptedException
IOExceptionInterruptedExceptionpublic boolean isClosed()
GateisClosed in class Gate<IOReadableWritable>true if the gate is closed, false otherwisepublic void waitForGateToBeClosed()
throws InterruptedException
InterruptedExceptionpublic boolean isInputGate()
GateisInputGate in class Gate<IOReadableWritable>true if the considered gate is an input gate, false if it is an output gatepublic String toString()
toString in class Gate<IOReadableWritable>public void publishEvent(AbstractEvent event) throws IOException, InterruptedException
GatepublishEvent in class Gate<IOReadableWritable>event - the event to be publishedIOException - thrown if an error occurs while transmitting the eventInterruptedException - thrown if the thread is interrupted while waiting for the event to be publishedpublic void releaseAllChannelResources()
GatereleaseAllChannelResources in class Gate<IOReadableWritable>Copyright © 2014 The Apache Software Foundation. All rights reserved.