public class StandardRemoteGroupPort extends AbstractPort implements RemoteGroupPort
| Modifier and Type | Class and Description |
|---|---|
private static class |
StandardRemoteGroupPort.EndpointConnectionState |
| Modifier and Type | Field and Description |
|---|---|
private Set<CommunicationsSession> |
activeCommsChannels |
private static String |
CATEGORY |
static String |
CONTENT_TYPE |
private ConcurrentMap<String,BlockingQueue<StandardRemoteGroupPort.EndpointConnectionState>> |
endpointConnectionMap |
static int |
GZIP_COMPRESSION_LEVEL |
private Lock |
interruptLock |
private static org.slf4j.Logger |
logger |
static long |
PEER_REFRESH_PERIOD |
private AtomicLong |
peerIndex |
private ReentrantLock |
peerRefreshLock |
private long |
peerRefreshTime |
private List<PeerStatus> |
peerStatuses |
private ConcurrentMap<PeerStatus,Long> |
peerTimeoutExpirations |
private RemoteProcessGroup |
remoteGroup |
private boolean |
shutdown |
private SSLContext |
sslContext |
private AtomicBoolean |
targetExists |
private AtomicBoolean |
targetRunning |
private AtomicBoolean |
useCompression |
static String |
USER_AGENT |
DEFAULT_TIME_UNIT, DEFAULT_YIELD_PERIOD, DEFAULT_YIELD_TIME_UNIT, MINIMUM_PENALIZATION_MILLIS, MINIMUM_YIELD_MILLIS, PORT_RELATIONSHIPMINIMUM_SCHEDULING_NANOS| Constructor and Description |
|---|
StandardRemoteGroupPort(String id,
String name,
ProcessGroup processGroup,
RemoteProcessGroup remoteGroup,
TransferDirection direction,
ConnectableType type,
SSLContext sslContext,
ProcessScheduler scheduler) |
addConnection, disable, enable, getComments, getConnectableType, getConnections, getConnections, getIdentifier, getIncomingConnections, getMaxConcurrentTasks, getName, getPenalizationPeriod, getPenalizationPeriod, getPosition, getProcessGroup, getRelationship, getRelationships, getScheduledState, getSchedulingPeriod, getSchedulingPeriod, getYieldExpiration, getYieldPeriod, hasIncomingConnection, isAutoTerminated, isLossTolerant, isRunning, onTrigger, setComments, setLossTolerant, setMaxConcurrentTasks, setName, setPenalizationPeriod, setPosition, setProcessGroup, setScheduldingPeriod, setYieldPeriod, updateConnection, verifyCanDelete, verifyCanDelete, verifyCanDisable, verifyCanEnable, verifyCanStop, verifyCanUpdate, yieldclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddConnection, getComments, getConnectableType, getConnections, getConnections, getIdentifier, getIncomingConnections, getName, getPenalizationPeriod, getPenalizationPeriod, getPosition, getProcessGroup, getRelationship, getRelationships, getYieldExpiration, getYieldPeriod, hasIncomingConnection, isAutoTerminated, isLossTolerant, setComments, setLossTolerant, setName, setPenalizationPeriod, setPosition, setProcessGroup, setYieldPeriod, updateConnection, verifyCanDelete, verifyCanDelete, verifyCanDisable, verifyCanEnable, verifyCanStop, verifyCanUpdate, yieldgetMaxConcurrentTasks, getScheduledState, getSchedulingPeriod, getSchedulingPeriod, isRunning, onTrigger, setMaxConcurrentTasks, setScheduldingPeriodpublic static final String USER_AGENT
public static final String CONTENT_TYPE
public static final int GZIP_COMPRESSION_LEVEL
public static final long PEER_REFRESH_PERIOD
private static final String CATEGORY
private static final org.slf4j.Logger logger
private final RemoteProcessGroup remoteGroup
private final SSLContext sslContext
private final AtomicBoolean useCompression
private final AtomicBoolean targetExists
private final AtomicBoolean targetRunning
private final AtomicLong peerIndex
private volatile List<PeerStatus> peerStatuses
private volatile long peerRefreshTime
private final ReentrantLock peerRefreshLock
private final ConcurrentMap<String,BlockingQueue<StandardRemoteGroupPort.EndpointConnectionState>> endpointConnectionMap
private final ConcurrentMap<PeerStatus,Long> peerTimeoutExpirations
private final Set<CommunicationsSession> activeCommsChannels
private final Lock interruptLock
private boolean shutdown
public StandardRemoteGroupPort(String id, String name, ProcessGroup processGroup, RemoteProcessGroup remoteGroup, TransferDirection direction, ConnectableType type, SSLContext sslContext, ProcessScheduler scheduler)
public boolean isTargetRunning()
isTargetRunning in interface RemoteGroupPortpublic void setTargetRunning(boolean targetRunning)
public boolean isTriggerWhenEmpty()
isTriggerWhenEmpty in interface Connectablepublic void shutdown()
shutdown in interface Portshutdown in class AbstractPortpublic void onSchedulingStart()
onSchedulingStart in interface PortonSchedulingStart in class AbstractPortvoid cleanupSockets()
public void onTrigger(ProcessContext context, ProcessSession session)
onTrigger in class AbstractPortprivate void penalize(Peer peer)
peer - private void cleanup(SocketClientProtocol protocol, Peer peer)
public String getYieldPeriod()
getYieldPeriod in interface ConnectablegetYieldPeriod in class AbstractPortpublic CommunicationsSession establishSiteToSiteConnection(PeerStatus peerStatus) throws IOException
IOExceptionprivate PeerStatus getNextPeerStatus()
private boolean isPenalized(PeerStatus peerStatus)
private List<PeerStatus> createPeerStatusList() throws IOException, BadRequestException, HandshakeException, UnknownPortException, PortNotRunningException
private void transferFlowFiles(Peer peer, ClientProtocol protocol, ProcessContext context, ProcessSession session, FlowFileCodec codec) throws IOException, ProtocolException
IOExceptionProtocolExceptionprivate void receiveFlowFiles(Peer peer, ClientProtocol protocol, ProcessContext context, ProcessSession session, FlowFileCodec codec) throws IOException, ProtocolException
IOExceptionProtocolExceptionprivate List<PeerStatus> formulateDestinationList(ClusterNodeInformation clusterNodeInfo) throws IOException
IOExceptionstatic List<PeerStatus> formulateDestinationList(ClusterNodeInformation clusterNodeInfo, ConnectableType connectableType)
public boolean getTargetExists()
getTargetExists in interface RemoteGroupPortpublic boolean isValid()
isValid in interface PortisValid in class AbstractPortpublic Collection<ValidationResult> getValidationErrors()
getValidationErrors in interface Connectablepublic void verifyCanStart()
verifyCanStart in interface ConnectableverifyCanStart in class AbstractPortpublic void setUseCompression(boolean useCompression)
setUseCompression in interface RemoteGroupPortpublic boolean isUseCompression()
isUseCompression in interface RemoteGroupPortpublic String toString()
toString in class AbstractPortpublic RemoteProcessGroup getRemoteProcessGroup()
getRemoteProcessGroup in interface RemoteGroupPortpublic TransferDirection getTransferDirection()
getTransferDirection in interface RemoteGroupPortpublic void setTargetExists(boolean exists)
public void removeConnection(Connection connection) throws IllegalArgumentException, IllegalStateException
removeConnection in interface ConnectableremoveConnection in class AbstractPortIllegalArgumentExceptionIllegalStateExceptionpublic SchedulingStrategy getSchedulingStrategy()
getSchedulingStrategy in interface Connectablepublic boolean isSideEffectFree()
isSideEffectFree in interface ConnectableCopyright © 2015 Apache NiFi (incubating). All rights reserved.