mirror of https://github.com/apache/nifi.git
NIFI-2615 Addressing documentation issues that caused checkstyle failures and the build to fail
This closes #1447. Signed-off-by: Andy LoPresto <alopresto@apache.org>
This commit is contained in:
parent
c15111d985
commit
250c4a8941
|
@ -56,6 +56,8 @@ abstract class AbstractSocketHandler {
|
|||
protected final byte endOfMessageByte;
|
||||
|
||||
/**
|
||||
* This constructor configures the address to bind to, the size of the buffer to use for reading, and
|
||||
* the byte pattern to use for demarcating the end of a message.
|
||||
*
|
||||
* @param address the socket address
|
||||
* @param readingBufferSize the buffer size
|
||||
|
@ -70,7 +72,10 @@ abstract class AbstractSocketHandler {
|
|||
}
|
||||
|
||||
/**
|
||||
* Once the handler is constructed this should be called to start the handler. Although
|
||||
* this method is safe to be called by multiple threads, it should only be called once.
|
||||
*
|
||||
* @throws IllegalStateException if it fails to start listening on the port that is configured
|
||||
*
|
||||
*/
|
||||
public void start() {
|
||||
|
@ -96,7 +101,9 @@ abstract class AbstractSocketHandler {
|
|||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* This should be called to stop the handler from listening on the socket. Although it is recommended
|
||||
* that this is called once, by a single thread, this method does protect itself from being called by more
|
||||
* than one thread and more than one time.
|
||||
*
|
||||
*/
|
||||
public void stop() {
|
||||
|
@ -135,13 +142,15 @@ abstract class AbstractSocketHandler {
|
|||
}
|
||||
|
||||
/**
|
||||
* This must be overridden by an implementing class and should establish the socket connection.
|
||||
*
|
||||
* @throws Exception if an exception occurs
|
||||
*/
|
||||
abstract InetSocketAddress connect() throws Exception;
|
||||
|
||||
/**
|
||||
* Will process the data received from the channel
|
||||
* Will process the data received from the channel.
|
||||
*
|
||||
* @param selectionKey key for the channel the data came from
|
||||
* @param buffer buffer of received data
|
||||
* @throws IOException if there is a problem processing the data
|
||||
|
@ -149,6 +158,8 @@ abstract class AbstractSocketHandler {
|
|||
abstract void processData(SelectionKey selectionKey, ByteBuffer buffer) throws IOException;
|
||||
|
||||
/**
|
||||
* This does not perform any work at this time as all current implementations of this class
|
||||
* provide the client side of the connection and thus do not accept connections.
|
||||
*
|
||||
* @param selectionKey the selection key
|
||||
* @throws IOException if there is a problem
|
||||
|
@ -193,14 +204,21 @@ abstract class AbstractSocketHandler {
|
|||
}
|
||||
|
||||
/**
|
||||
* Accept the selectable channel
|
||||
*
|
||||
* @throws IOException in the event that something goes wrong accepting it
|
||||
*/
|
||||
private void accept(SelectionKey selectionKey) throws IOException {
|
||||
AbstractSocketHandler.this.doAccept(selectionKey);
|
||||
}
|
||||
|
||||
/**
|
||||
* This will connect the channel; if it is in a pending state then this will finish
|
||||
* establishing the connection. Finally the socket handler is registered with this
|
||||
* channel.
|
||||
*
|
||||
* @throws IOException if anything goes wrong during the connection establishment
|
||||
* or registering of the handler
|
||||
*/
|
||||
private void connect(SelectionKey selectionKey) throws IOException {
|
||||
SocketChannel clientChannel = (SocketChannel) selectionKey.channel();
|
||||
|
|
|
@ -28,7 +28,6 @@ import java.util.Map;
|
|||
import java.util.Set;
|
||||
import java.util.concurrent.ScheduledThreadPoolExecutor;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.apache.nifi.annotation.behavior.InputRequirement;
|
||||
import org.apache.nifi.annotation.behavior.SideEffectFree;
|
||||
import org.apache.nifi.annotation.behavior.TriggerSerially;
|
||||
|
@ -269,7 +268,9 @@ public class GetTCP extends AbstractSessionFactoryProcessor {
|
|||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* This handles taking the message that has been received off the wire and writing it to the
|
||||
* content of a flowfile. If only a partial message is received then the flowfile is sent to
|
||||
* the Partial relationship. If a full message is received then it is sent to the Success relationship.
|
||||
*/
|
||||
private class NiFiDelegatingMessageHandler implements MessageHandler {
|
||||
private final ProcessSessionFactory sessionFactory;
|
||||
|
|
|
@ -59,7 +59,9 @@ class ReceivingClient extends AbstractSocketHandler {
|
|||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Connects to the endpoint specified and if that fails, will attempt to connect to the
|
||||
* secondary endpoint up to the number of reconnection attempts (inclusive) using the
|
||||
* configured delay between attempts.
|
||||
*/
|
||||
@Override
|
||||
InetSocketAddress connect() throws Exception {
|
||||
|
@ -119,7 +121,7 @@ class ReceivingClient extends AbstractSocketHandler {
|
|||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Process the message that has arrived off the wire.
|
||||
*/
|
||||
@Override
|
||||
void processData(SelectionKey selectionKey, ByteBuffer messageBuffer) throws IOException {
|
||||
|
|
Loading…
Reference in New Issue