/** * Deallocate all the ports for the given transformation name, across all hosts. * * @param transName * the transformation name to release * @param carteObjectId * the carte object ID to reference */ public void deallocateServerSocketPorts( String transName, String carteObjectId ) { for ( String hostname : hostServerSocketPortsMap.keySet() ) { List<SocketPortAllocation> spas = hostServerSocketPortsMap.get( hostname ); for ( SocketPortAllocation spa : spas ) { synchronized ( spa ) { if ( spa.getTransformationName().equalsIgnoreCase( transName ) && ( Utils.isEmpty( carteObjectId ) || spa.getClusterRunId().equals( carteObjectId ) ) ) { spa.setAllocated( false ); } } } } }
public void deallocateServerSocketPort( int port, String hostname ) { // Look up the sockets list for the given host // List<SocketPortAllocation> serverSocketPorts = hostServerSocketPortsMap.get( hostname ); if ( serverSocketPorts == null ) { return; // nothing to deallocate } // Find the socket port allocation in the list... // for ( SocketPortAllocation spa : serverSocketPorts ) { synchronized ( spa ) { if ( spa.getPort() == port ) { spa.setAllocated( false ); return; } } } }
for ( int index = 0; index < serverSocketPorts.size(); index++ ) { SocketPortAllocation spa = serverSocketPorts.get( index ); if ( spa.getPort() > maxPort ) { maxPort = spa.getPort(); if ( spa.getClusterRunId().equalsIgnoreCase( clusteredRunId ) && spa.getSourceSlaveName().equalsIgnoreCase( sourceSlaveName ) && spa.getTargetSlaveName().equalsIgnoreCase( targetSlaveName ) && spa.getTransformationName().equalsIgnoreCase( transformationName ) && spa.getSourceStepName().equalsIgnoreCase( sourceStepName ) && spa.getSourceStepCopy().equalsIgnoreCase( sourceStepCopy ) && spa.getTargetStepName().equalsIgnoreCase( targetStepName ) && spa.getTargetStepCopy().equalsIgnoreCase( targetStepCopy ) ) { spa.setAllocated( true ); socketPortAllocation = spa; break; if ( !spa.isAllocated() ) { if ( spa.getSourceSlaveName().equalsIgnoreCase( sourceSlaveName ) && spa.getTargetSlaveName().equalsIgnoreCase( targetSlaveName ) ) { socketPortAllocation = new SocketPortAllocation( spa.getPort(), new Date(), clusteredRunId, transformationName, sourceSlaveName, sourceStepName, sourceStepCopy, targetSlaveName, targetStepName, targetStepCopy ); serverSocketPorts.set( index, socketPortAllocation ); new SocketPortAllocation(
SocketPortAllocation allocation = iterator.next(); if ( !onlyOpen || ( onlyOpen && allocation.isAllocated() ) ) { out.println( allocation.getPort() + " : Transformation=" + allocation.getTransformationName() + ", " + allocation.getSourceSlaveName() + "/" + allocation.getSourceStepName() + "." + allocation.getSourceStepCopy() ); out.println( " --> " + allocation.getTargetSlaveName() + "/" + allocation.getTargetStepName() + "." + allocation.getTargetStepCopy() ); out.println( " id=" + allocation.getClusterRunId() + ", allocated=" + allocation.isAllocated() ); out.println( " time=" + allocation.getLastRequested() );
public boolean equals( Object obj ) { if ( obj == this ) { return true; } if ( !( obj instanceof SocketPortAllocation ) ) { return false; } SocketPortAllocation allocation = (SocketPortAllocation) obj; return allocation.getPort() == port; }
if ( useXML ) { out.print( XMLHandler.getXMLHeader( Const.XML_ENCODING ) ); out.print( XMLHandler.addTagValue( XML_TAG_PORT, port.getPort() ) ); } else { out.println( "<HTML>" );