idx int64 0 41.2k | question stringlengths 83 4.15k | target stringlengths 5 715 |
|---|---|---|
2,400 | public RuntimeManager build ( KnowledgeRuntimeManagerType type , String identifier ) { final RuntimeManager runtimeManager ; final RuntimeEnvironment runtimeEnvironment = _runtimeEnvironmentBuilder . build ( ) ; final RemoteManifest remoteManifest = RemoteManifest . removeFromEnvironment ( runtimeEnvironment . getEnvir... | Builds a RuntimeManager . |
2,401 | protected ChannelsModel toChannelsModel ( Channel [ ] channelAnnotations , KnowledgeNamespace knowledgeNamespace , ComponentModel componentModel , SwitchYardNamespace switchyardNamespace ) { if ( channelAnnotations == null || channelAnnotations . length == 0 ) { return null ; } ChannelsModel channelsModel = new V1Chann... | Converts channel annotations to a channels model . |
2,402 | protected ContainerModel toContainerModel ( Container containerAnnotation , KnowledgeNamespace knowledgeNamespace ) { if ( containerAnnotation == null ) { return null ; } ContainerModel containerModel = new V1ContainerModel ( knowledgeNamespace . uri ( ) ) ; String baseName = containerAnnotation . baseName ( ) ; if ( !... | Converts container annotation to container model |
2,403 | protected ListenersModel toListenersModel ( Listener [ ] listenerAnnotations , KnowledgeNamespace knowledgeNamespace ) { if ( listenerAnnotations == null || listenerAnnotations . length == 0 ) { return null ; } ListenersModel listenersModel = new V1ListenersModel ( knowledgeNamespace . uri ( ) ) ; for ( Listener listen... | Converts listener annotations to listeners model . |
2,404 | protected LoggersModel toLoggersModel ( Logger [ ] loggerAnnotations , KnowledgeNamespace knowledgeNamespace ) { if ( loggerAnnotations == null || loggerAnnotations . length == 0 ) { return null ; } LoggersModel loggersModel = new V1LoggersModel ( knowledgeNamespace . uri ( ) ) ; for ( Logger loggerAnnotation : loggerA... | Converts logger annotations to loggers model . |
2,405 | protected ManifestModel toManifestModel ( Manifest [ ] manifestAnnotations , KnowledgeNamespace knowledgeNamespace ) { if ( manifestAnnotations == null || manifestAnnotations . length == 0 ) { return null ; } Manifest manifestAnnotation = manifestAnnotations [ 0 ] ; ManifestModel manifestModel = new V1ManifestModel ( k... | Converts manifest annotations to manifest model . |
2,406 | protected GlobalsModel toGlobalsModel ( Global [ ] globals , KnowledgeNamespace knowledgeNamespace ) { GlobalsModel globalsModel = null ; if ( globals != null ) { for ( Global global : globals ) { if ( global != null ) { GlobalModel globalModel = new V1GlobalModel ( knowledgeNamespace . uri ( ) ) ; String from = global... | Converts globals to mappings model . |
2,407 | protected InputsModel toInputsModel ( Input [ ] inputs , KnowledgeNamespace knowledgeNamespace ) { InputsModel inputsModel = null ; if ( inputs != null ) { for ( Input input : inputs ) { if ( input != null ) { InputModel inputModel = new V1InputModel ( knowledgeNamespace . uri ( ) ) ; String from = input . from ( ) ; i... | Converts inputs to mappings model . |
2,408 | protected OutputsModel toOutputsModel ( Output [ ] outputs , KnowledgeNamespace knowledgeNamespace ) { OutputsModel outputsModel = null ; if ( outputs != null ) { for ( Output output : outputs ) { if ( output != null ) { OutputModel outputModel = new V1OutputModel ( knowledgeNamespace . uri ( ) ) ; String from = output... | Converts outputs to mappings model . |
2,409 | protected FaultsModel toFaultsModel ( Fault [ ] faults , KnowledgeNamespace knowledgeNamespace ) { FaultsModel faultsModel = null ; if ( faults != null ) { for ( Fault fault : faults ) { if ( fault != null ) { FaultModel faultModel = new V1FaultModel ( knowledgeNamespace . uri ( ) ) ; String from = fault . from ( ) ; i... | Converts faults to mappings model . |
2,410 | protected PropertiesModel toPropertiesModel ( Property [ ] propertyAnnotations , KnowledgeNamespace knowledgeNamespace ) { if ( propertyAnnotations == null || propertyAnnotations . length == 0 ) { return null ; } PropertiesModel propertiesModel = new V1PropertiesModel ( knowledgeNamespace . uri ( ) ) ; for ( Property p... | Converts property annotations to properties model . |
2,411 | protected ResourcesModel toResourcesModel ( Resource [ ] resourceAnnotations , KnowledgeNamespace knowledgeNamespace ) { if ( resourceAnnotations == null || resourceAnnotations . length == 0 ) { return null ; } ResourcesModel resourcesModel = new V1ResourcesModel ( knowledgeNamespace . uri ( ) ) ; for ( Resource resour... | Converts resource annotations to resources model . |
2,412 | public List < ExpressionMapping > getInputOnlyExpressionMappings ( ) { List < ExpressionMapping > list = new LinkedList < ExpressionMapping > ( ) ; for ( ExpressionMapping em : _inputExpressionMappings ) { if ( em . getOutput ( ) == null ) { list . add ( em ) ; } } return list ; } | Gets the input - only expression mappings . |
2,413 | public Map < String , ExpressionMapping > getInputOutputExpressionMappings ( ) { Map < String , ExpressionMapping > map = new LinkedHashMap < String , ExpressionMapping > ( ) ; for ( ExpressionMapping em : _inputExpressionMappings ) { String output = em . getOutput ( ) ; if ( output != null ) { if ( map . containsKey (... | Gets the input - output expression mappings . |
2,414 | protected static < T extends Manifest > T removeFromEnvironment ( Environment environment , Class < T > type ) { String identifier = type . getName ( ) ; Object manifest = environment . get ( identifier ) ; if ( manifest != null ) { environment . set ( identifier , null ) ; } return type . cast ( manifest ) ; } | Removes and returns the Manifest from the Environment . |
2,415 | public Expression getFromExpression ( ) { if ( _fromExpression == null && _from != null ) { _fromExpression = ExpressionFactory . INSTANCE . create ( _from , null , _propertyResolver ) ; } return _fromExpression ; } | Gets the from expression . |
2,416 | public Expression getToExpression ( ) { if ( _toExpression == null && _to != null ) { _toExpression = ExpressionFactory . INSTANCE . create ( _to , null , _propertyResolver ) ; } return _toExpression ; } | Gets the to expression . |
2,417 | public final void addConnections ( final int max ) throws Exception { if ( connections . size ( ) < maxConnections ) { for ( int i = 1 ; i < max ; i ++ ) { addNewConnection ( ) ; } } } | Adds a number of new connections to this session . |
2,418 | public final void close ( ) throws IOException { LOGGER . info ( "Closing was requested." ) ; for ( Connection c : connections ) { c . close ( ) ; } connections . clear ( ) ; factory . closedSession ( this ) ; executor . shutdown ( ) ; } | Closes this session instances with all opened connections . |
2,419 | private final Future < Void > executeTask ( final ITask task ) throws TaskExecutionException { if ( task instanceof IOTask ) { final Future < Void > returnVal = executor . submit ( ( IOTask ) task ) ; return returnVal ; } else { try { task . call ( ) ; } catch ( final Exception exc ) { throw new TaskExecutionException ... | This methods appends the given task to the end of the taskQueue and set the calling thread is sleep state . |
2,420 | public final void finishedTask ( final ITask ftask ) { try { taskBalancer . releaseConnection ( outstandingTasks . get ( ftask ) ) ; } catch ( NoSuchConnectionException e ) { e . printStackTrace ( ) ; } outstandingTasks . remove ( ftask ) ; LOGGER . debug ( "Finished a " + ftask + " for the session " + targetName ) ; } | removes Task from outstandingTasks . |
2,421 | public final void restartTask ( final ITask task ) throws ExecutionException { try { if ( task != null ) { if ( task instanceof IOTask ) { executor . submit ( ( IOTask ) task ) ; } else { task . call ( ) ; } taskBalancer . releaseConnection ( outstandingTasks . get ( task ) ) ; outstandingTasks . remove ( task ) ; } LO... | restarts a Task from outstandingTasks . |
2,422 | public final void addOutstandingTask ( final Connection connection , final ITask task ) { outstandingTasks . put ( task , connection ) ; LOGGER . debug ( "Added a Task to the outstandingTasks Queue" ) ; } | Adds a Task to the outstandingTasks Hashmap . |
2,423 | public boolean execute ( ) throws DigestException , IOException , InterruptedException , InternetSCSIException , SettingsException { running = true ; while ( running ) { ProtocolDataUnit pdu = connection . receivePdu ( ) ; BasicHeaderSegment bhs = pdu . getBasicHeaderSegment ( ) ; switch ( bhs . getOpCode ( ) ) { case ... | Starts the full feature phase . |
2,424 | public final void closeSession ( final String targetName ) throws NoSuchSessionException , TaskExecutionException { getSession ( targetName ) . logout ( ) ; sessions . remove ( targetName ) ; LOGGER . info ( "Closed the session to the iSCSI Target '" + targetName + "'." ) ; } | Closes all opened connections within this session to the given target . |
2,425 | public final synchronized void flush ( ) throws Exception { List < Long > sortedKeys = new ArrayList < Long > ( buffer . keySet ( ) ) ; Collections . sort ( sortedKeys ) ; while ( sortedKeys . size ( ) > 0 ) { long firstKey = sortedKeys . get ( 0 ) ; int firstDataLength = buffer . get ( firstKey ) . length ; int i = 1 ... | Flush the buffer to the target . |
2,426 | public void read ( byte [ ] bytes , long storageIndex ) throws IOException { long filePos = storageIndex / mFileSize ; int storageOffset = ( int ) ( storageIndex % mFileSize ) ; byte [ ] cachedBytes = mCache . getIfPresent ( filePos ) ; File fileAtPos = new File ( mBaseDir + File . separator + filePos ) ; if ( ! fileAt... | Reading bytes from file |
2,427 | final int serialize ( final ByteBuffer dst , final int offset ) throws InternetSCSIException { dst . position ( offset ) ; if ( dst . remaining ( ) < BHS_FIXED_SIZE ) { throw new IllegalArgumentException ( "Destination array is too small." ) ; } int line = 0 ; if ( immediateFlag ) { line |= IMMEDIATE_FLAG_MASK ; } line... | This method serializes the informations of this BHS object to the byte representation defined by the iSCSI Standard . |
2,428 | final int deserialize ( final ProtocolDataUnit protocolDataUnit , final ByteBuffer src ) throws InternetSCSIException { if ( src . remaining ( ) < BHS_FIXED_SIZE ) { throw new InternetSCSIException ( "This Protocol Data Unit does not contain" + " an valid Basic Header Segment." ) ; } final int firstLine = src . getInt ... | Extract from the given Protocol Data Unit the BHS . After an successful extraction this methods and setreturns the right message parser object for this kind of message . |
2,429 | final void setOperationCode ( final ProtocolDataUnit protocolDataUnit , final OperationCode initOperationCode ) { operationCode = initOperationCode ; parser = MessageParserFactory . getParser ( protocolDataUnit , initOperationCode ) ; } | Set a new operation code for this BHS object . |
2,430 | final void clear ( ) { immediateFlag = false ; operationCode = OperationCode . LOGIN_REQUEST ; finalFlag = false ; totalAHSLength = 0x00 ; dataSegmentLength = 0x00000000 ; initiatorTaskTag = 0x00000000 ; parser = null ; } | Clears all the stored content of this BasicHeaderSegment object . |
2,431 | final int serialize ( final ByteBuffer dst , final int offset ) throws InternetSCSIException { dst . position ( offset ) ; if ( dst . remaining ( ) < length ) { throw new IllegalArgumentException ( "Destination array is too small." ) ; } dst . putShort ( length ) ; dst . put ( type . value ( ) ) ; dst . put ( specificF... | This method serializes the informations of this AHS object to the byte representation defined by the iSCSI Standard . |
2,432 | final void deserialize ( final ByteBuffer pdu , final int offset ) throws InternetSCSIException { pdu . position ( offset ) ; length = pdu . getShort ( ) ; type = AdditionalHeaderSegmentType . valueOf ( pdu . get ( ) ) ; specificField = ByteBuffer . allocate ( length ) ; specificField . put ( pdu . get ( ) ) ; while ( ... | Extract the informations given by the int array to this Additional Header Segment object . |
2,433 | private final void checkIntegrity ( ) throws InternetSCSIException { switch ( type ) { case EXTENDED_CDB : case EXPECTED_BIDIRECTIONAL_READ_DATA_LENGTH : break ; default : throw new InternetSCSIException ( "AHS Package is not valid." ) ; } specificField . rewind ( ) ; Utils . isReserved ( specificField . get ( ) ) ; sw... | This method checks the integrity of the this Additional Header Segment object to garantee a valid specification . |
2,434 | private final void serializeCommonFields ( final ByteBuffer byteBuffer , final int index ) { byteBuffer . position ( index ) ; byte b = 0 ; if ( senseKeySpecificDataValid ) b = BitManip . getByteWithBitSet ( b , 7 , true ) ; byteBuffer . put ( b ) ; } | Serializes the fields common to all sense - key - specific data . |
2,435 | private final void serializeCommonFields ( final ByteBuffer byteBuffer , final int index ) { byteBuffer . position ( index ) ; byteBuffer . put ( descriptorType . getValue ( ) ) ; byteBuffer . put ( ( byte ) additionalLength ) ; } | Serializes the fields common to all sense data descriptors . |
2,436 | @ SuppressWarnings ( "unchecked" ) public CDB decode ( ByteBuffer input ) throws IOException { byte [ ] opcode = new byte [ 1 ] ; input . duplicate ( ) . get ( opcode ) ; DataInputStream in = new DataInputStream ( new ByteArrayInputStream ( opcode ) ) ; int operationCode = in . readUnsignedByte ( ) ; if ( ! _cdbs . con... | Used by iSCSI transport layer to decode CDB data off the wire . |
2,437 | private static final ByteBuffer createReadWriteMessage ( final byte opCode , final int logicalBlockAddress , final short transferLength ) { ByteBuffer cdb = ByteBuffer . allocate ( DEFAULT_CDB_LENGTH ) ; cdb . put ( opCode ) ; cdb . position ( LOGICAL_BLOCK_ADDRESS_OFFSET ) ; cdb . putInt ( logicalBlockAddress ) ; cdb ... | Creates the Command Descriptor Block for a given Operation Message . |
2,438 | public static final ByteBuffer createReadCapacityMessage ( ) { ByteBuffer cdb = ByteBuffer . allocate ( DEFAULT_CDB_LENGTH ) ; cdb . put ( READ_CAPACITY_OP_CODE ) ; cdb . rewind ( ) ; return cdb ; } | Creates the Command Descriptor Block for a Read Capacity Message . |
2,439 | public static void main ( final String [ ] args ) throws Exception { WhiskasDemo demo = new WhiskasDemo ( ) ; demo . setUp ( ) ; while ( true ) { demo . sequentialRead ( ) ; demo . randomRead ( ) ; } } | Main method to start the demo . |
2,440 | public void stop ( ) { this . running = false ; for ( TargetSession session : sessions ) { if ( ! session . getConnection ( ) . stop ( ) ) { this . running = true ; LOGGER . error ( "Unable to stop session for " + session . getTargetName ( ) ) ; } } } | Stop this target server |
2,441 | public final long serialize ( ) throws InternetSCSIException { checkIntegrity ( ) ; long isid = 0 ; int firstLine = c ; firstLine |= b << Constants . ONE_BYTE_SHIFT ; firstLine |= a << Constants . THREE_BYTES_SHIFT ; firstLine &= 0x00ffffff ; firstLine |= t . value ( ) << T_FIELD_SHIFT ; isid = Utils . getUnsignedLong ... | Serializes this ISID object ot its byte representation . |
2,442 | final void deserialize ( long isid ) throws InternetSCSIException { int line = ( int ) ( isid >>> Constants . FOUR_BYTES_SHIFT ) ; t = Format . valueOf ( ( byte ) ( line >>> T_FIELD_SHIFT ) ) ; a = ( byte ) ( ( line & A_FIELD_FLAG_MASK ) >>> Constants . THREE_BYTES_SHIFT ) ; b = ( short ) ( ( line & Constants . MIDDLE_... | Parses a given ISID in this ISID obejct . |
2,443 | protected final void checkIntegrity ( ) throws InternetSCSIException { String exceptionMessage = "" ; switch ( t ) { case OUI_FORMAT : break ; case IANA_ENTERPRISE_NUMBER : break ; case RANDOM : break ; case RESERVED : if ( a != 0 && b != 0 && c != 0 && d != 0 ) { exceptionMessage = "This ISID is not valid. All" ; } br... | This method checks if all fields are valid . In these cases an exception will be thrown . |
2,444 | public final ByteBuffer serialize ( ) throws InternetSCSIException , IOException { basicHeaderSegment . getParser ( ) . checkIntegrity ( ) ; final ByteBuffer pdu = ByteBuffer . allocate ( calcSize ( ) ) ; int offset = 0 ; offset += basicHeaderSegment . serialize ( pdu , offset ) ; if ( LOGGER . isTraceEnabled ( ) ) { L... | Serialize all informations of this PDU object to its byte representation . |
2,445 | private final int serializeAdditionalHeaderSegments ( final ByteBuffer dst , final int offset ) throws InternetSCSIException { int off = offset ; for ( AdditionalHeaderSegment ahs : additionalHeaderSegments ) { off += ahs . serialize ( dst , off ) ; } return off - offset ; } | Serialize all the contained additional header segments to the destination array starting from the given offset . |
2,446 | public final void clear ( ) { basicHeaderSegment . clear ( ) ; headerDigest . reset ( ) ; additionalHeaderSegments . clear ( ) ; dataSegment . clear ( ) ; dataSegment . flip ( ) ; dataDigest . reset ( ) ; } | Clears all stored content of this ProtocolDataUnit object . |
2,447 | public final void setDataSegment ( final IDataSegmentChunk chunk ) { if ( chunk == null ) { throw new NullPointerException ( ) ; } dataSegment = ByteBuffer . allocate ( chunk . getTotalLength ( ) ) ; dataSegment . put ( chunk . getData ( ) ) ; basicHeaderSegment . setDataSegmentLength ( chunk . getLength ( ) ) ; } | Sets a new data segment in this PDU . |
2,448 | private short getPageLength ( ) { short pageLength = 0 ; for ( int i = 0 ; i < identificationDescriptors . length ; ++ i ) { pageLength += identificationDescriptors [ i ] . size ( ) ; } return pageLength ; } | Returns the combined length of all contained IDENTIFICATION DESCRIPTORs . |
2,449 | public final void setCommandDescriptorBlock ( final ByteBuffer newCDB ) { if ( newCDB . limit ( ) - newCDB . position ( ) > CDB_SIZE ) { throw new IllegalArgumentException ( "Buffer cannot be longer than 16 bytes, because AHS-support is not implemented." ) ; } commandDescriptorBlock = newCDB ; } | Sets the new Command Descriptor Block . |
2,450 | private static synchronized boolean createStorageVolume ( final File pToCreate , final long pLength ) throws IOException { FileOutputStream outStream = null ; try { if ( pToCreate . exists ( ) ) { if ( ! pToCreate . delete ( ) ) { LOGGER . debug ( "Removal of old storage " + pToCreate . toString ( ) + " unsucessful." )... | Creating a new file if not existing at the path defined in the config . Note that it is advised to create the file beforehand . |
2,451 | public static boolean recursiveDelete ( final File pFile ) { if ( pFile . isDirectory ( ) ) { for ( final File child : pFile . listFiles ( ) ) { if ( ! recursiveDelete ( child ) ) { return false ; } } } return pFile . delete ( ) ; } | Deleting a storage recursive . Used for deleting a databases |
2,452 | public final void add ( final OperationalTextKey textKey , final String value ) { final String s = textKey . value ( ) + KEY_VALUE_DELIMITER + value + PAIR_DELIMITER ; resizeBuffer ( s . length ( ) , true ) ; dataBuffer . put ( s . getBytes ( ) ) ; isDirty = true ; } | Add a given operation text keys with the given value to the key value pairs . |
2,453 | public static final int getReponseCodeFor ( final ErrorType errorType , final SenseDataFormat senseDataFormat ) { if ( senseDataFormat == SenseDataFormat . FIXED ) { if ( errorType == ErrorType . CURRENT ) return 0x70 ; else return 0x71 ; } else { if ( errorType == ErrorType . CURRENT ) return 0x72 ; else return 0x73 ;... | Returns the proper response code for the given error type and sense data format . |
2,454 | public Collection < ModePage > get ( boolean subPages ) { List < ModePage > value = new LinkedList < ModePage > ( ) ; for ( Map < Integer , ModePage > pagelist : pages . values ( ) ) { for ( ModePage page : pagelist . values ( ) ) { if ( page . getSubPageCode ( ) == 0x00 ) { value . add ( page ) ; } else if ( subPages ... | Returns all mode pages . |
2,455 | public Collection < ModePage > get ( byte pageCode ) { if ( this . contains ( pageCode ) ) return this . pages . get ( pageCode ) . values ( ) ; else return null ; } | Returns all mode pages with the given page code . |
2,456 | public final int [ ] getTable ( final int offset ) { final int [ ] table = new int [ SIZE_OF_TABLE ] ; long numberToCalculate ; for ( int number = 0 ; number < table . length ; number ++ ) { numberToCalculate = Integer . reverseBytes ( Integer . reverse ( number ) ) ; table [ number ] = calculateCRC32 ( numberToCalcula... | Returns all remainders of the polynomial division for the given offset . |
2,457 | final void deserializeBasicHeaderSegment ( final ByteBuffer pdu ) throws InternetSCSIException { deserializeBytes1to3 ( pdu . getInt ( ) & FIRST_SPECIFIC_FIELD_MASK ) ; pdu . position ( BasicHeaderSegment . BYTES_8_11 ) ; deserializeBytes8to11 ( pdu . getInt ( ) ) ; deserializeBytes12to15 ( pdu . getInt ( ) ) ; pdu . p... | This method defines the order of the parsing process of the operation code specific fields and check their integtity . |
2,458 | final void serializeBasicHeaderSegment ( final ByteBuffer dst , final int offset ) throws InternetSCSIException { dst . position ( offset ) ; dst . putInt ( offset , dst . getInt ( ) | serializeBytes1to3 ( ) ) ; dst . position ( offset + BasicHeaderSegment . BYTES_8_11 ) ; dst . putInt ( serializeBytes8to11 ( ) ) ; dst... | This method serializes the whole BHS to its byte representation . |
2,459 | public final String getSetting ( final String targetName , final int connectionID , final OperationalTextKey textKey ) throws OperationalTextKeyException { try { final SessionConfiguration sc ; synchronized ( sessionConfigs ) { sc = sessionConfigs . get ( targetName ) ; synchronized ( sc ) { if ( sc != null ) { String ... | Returns the value of a single parameter instead of all values . |
2,460 | public final String getSessionSetting ( final String targetName , final OperationalTextKey textKey ) throws OperationalTextKeyException { return getSetting ( targetName , - 1 , textKey ) ; } | Returns the value of a single parameter . It can only return session and global parameters . |
2,461 | public final void update ( final String targetName , final int connectionID , final SettingsMap response ) throws NoSuchSessionException { final SessionConfiguration sc ; synchronized ( sessionConfigs ) { sc = sessionConfigs . get ( targetName ) ; synchronized ( sc ) { if ( sc == null ) { throw new NoSuchSessionExcepti... | Updates the stored settings of a connection with these values from the response of the iSCSI Target . |
2,462 | private final void parseSettings ( final Element root ) { if ( root == null ) { throw new NullPointerException ( ) ; } clear ( ) ; parseGlobalSettings ( root ) ; parseTargetSpecificSettings ( root ) ; } | Parses all settings form the main configuration file . |
2,463 | private final void parseGlobalSettings ( final Element root ) { final NodeList globalConfiguration = root . getElementsByTagName ( ELEMENT_GLOBAL ) ; final ResultFunctionFactory resultFunctionFactory = new ResultFunctionFactory ( ) ; Node parameter ; NodeList parameters ; NamedNodeMap attributes ; SettingEntry key ; fo... | Parses all global settings form the main configuration file . |
2,464 | private final void parseTargetSpecificSettings ( final Element root ) { final NodeList targets = root . getElementsByTagName ( ELEMENT_TARGET ) ; Node target ; Node parameter ; NodeList parameters ; try { for ( int i = 0 ; i < targets . getLength ( ) ; i ++ ) { target = targets . item ( i ) ; parameters = target . getC... | Parses all target - specific settings form the main configuration file . |
2,465 | public static String byteBufferToString ( final ByteBuffer buffer ) { if ( buffer == null ) return "null" ; final int numberOfBytes = buffer . limit ( ) ; final StringBuilder sb = new StringBuilder ( ) ; buffer . position ( 0 ) ; int value ; for ( int i = 1 ; i <= numberOfBytes ; ++ i ) { sb . append ( "0x" ) ; value =... | Returns a string containing the buffered values in the defined format . |
2,466 | public boolean execute ( ProtocolDataUnit pdu ) throws IOException , InterruptedException , InternetSCSIException , DigestException , SettingsException { final ConnectionSettingsNegotiator negotiator = connection . getConnectionSettingsNegotiator ( ) ; while ( ! negotiator . beginNegotiation ( ) ) { } boolean loginSucc... | Starts the login phase . |
2,467 | public int drainTo ( Collection < ? super Task > c ) { if ( c == this ) throw new IllegalArgumentException ( "cannot drain task set into itself" ) ; if ( c == null ) throw new NullPointerException ( "target collection must not be null" ) ; int count = 0 ; while ( true ) { try { Task t = this . poll ( 0 , TimeUnit . SEC... | Removes all available elements from this task set . Any tasks that are blocked will not be removed . Will cease draining if the thread is interrupted . |
2,468 | private static final void indent ( final StringBuilder sb , final int indent ) { for ( int i = 0 ; i < indent ; i ++ ) { sb . append ( LOG_OUT_INDENT ) ; } } | Appends to a given StringBuilder the given indents depending on the indent level . |
2,469 | public TaskServiceResponse abortTaskSet ( Nexus nexus ) { try { this . taskSet . abort ( nexus ) ; return TaskServiceResponse . FUNCTION_COMPLETE ; } catch ( InterruptedException e ) { return TaskServiceResponse . SERVICE_DELIVERY_OR_TARGET_FAILURE ; } catch ( IllegalArgumentException e ) { throw e ; } } | is simply attempting to remove a task from the scheduler |
2,470 | boolean checkIntegrity ( ) { if ( headerType == null ) return false ; if ( headerType == HeaderType . MODE_PARAMETER_HEADER_6 && longLba ) return false ; return true ; } | This method is used for checking that all required members are initialized and their respective values compatible with each other . |
2,471 | public final void update ( final SettingsMap response ) throws NoSuchSessionException { configuration . update ( referenceSession . getTargetName ( ) , connectionID , response ) ; } | Updates all entries of the given response key - values with the stored settings of this instance . |
2,472 | public final void nextState ( final IState newState ) throws InternetSCSIException { this . state = newState ; if ( this . state != null ) { do { this . state . execute ( ) ; LOGGER . info ( "State is following: " + this . state . nextStateFollowing ( ) ) ; } while ( this . state . nextStateFollowing ( ) ) ; } } | Switch to the new state . Start point of the state pattern . All states are computed one after another . |
2,473 | public final void send ( final ProtocolDataUnit protocolDataUnit ) throws InternetSCSIException { try { senderReceiver . sendOverWire ( protocolDataUnit ) ; } catch ( IOException e ) { throw new InternetSCSIException ( e ) ; } catch ( InterruptedException e ) { throw new InternetSCSIException ( e ) ; } } | Enqueue this protocol data unit to the end of the sending queue . |
2,474 | public final void send ( final Queue < ProtocolDataUnit > protocolDataUnits ) throws InternetSCSIException { for ( final ProtocolDataUnit unit : protocolDataUnits ) { send ( unit ) ; } } | Enqueue all protocol data units to the end of the sending queue . |
2,475 | @ SuppressWarnings ( { "rawtypes" , "unchecked" } ) private final void processQueue ( ) { SoftValue < V > softValue ; while ( ( softValue = ( SoftValue ) queue . poll ( ) ) != null ) { internalMap . remove ( softValue . key ) ; } } | Remove garbage collected soft values with the help of the reference queue . |
2,476 | private static final int base64ValueOf ( final char c ) { if ( 'A' <= c && c <= 'Z' ) return c - 'A' ; if ( 'a' <= c && c <= 'z' ) return c - 'a' + 26 ; if ( '0' <= c && c <= '9' ) return c - '0' + 52 ; if ( c == '+' ) return 62 ; if ( c == '/' ) return 63 ; throw new NumberFormatException ( ) ; } | Returns a character s value in Base64 |
2,477 | protected final void sendRejectPdu ( final LoginStatus errorStatus ) throws InterruptedException , IOException , InternetSCSIException { final ProtocolDataUnit rejectPDU = TargetPduFactory . createLoginResponsePdu ( false , false , stageNumber , stageNumber , session . getInitiatorSessionID ( ) , session . getTargetSes... | Sends a Login Response PDU informing the initiator that an error has occurred and that the connection must be closed . |
2,478 | public final String get ( final OperationalTextKey textKey ) { if ( textKey == null ) { throw new NullPointerException ( ) ; } return settingsMap . get ( textKey ) ; } | Returns the value of the given parameter which is not parsed . |
2,479 | public final ByteBuffer asByteBuffer ( ) { final StringBuilder sb = new StringBuilder ( ) ; for ( Map . Entry < OperationalTextKey , String > e : settingsMap . entrySet ( ) ) { sb . append ( e . getKey ( ) . value ( ) ) ; sb . append ( KEY_VALUE_DELIMITER ) ; sb . append ( e . getValue ( ) ) ; sb . append ( PAIR_DELIMI... | Returns a buffer of the serialized key - value pairs which are contained in this instance . |
2,480 | public void initialize ( ) throws IOException , NotInitializedException { logger . debug ( "Initialising TCPTransportClient. Origin address is [{}] and destination address is [{}]" , origAddress , destAddress ) ; if ( destAddress == null ) { throw new NotInitializedException ( "Destination address is not set" ) ; } soc... | Network init socket |
2,481 | public void run ( ) { int sleepTime = 250 ; logger . debug ( "Sleeping for {}ms before starting transport so that listeners can all be added and ready for messages" , sleepTime ) ; try { Thread . sleep ( sleepTime ) ; } catch ( InterruptedException e ) { } logger . debug ( "Finished sleeping for {}ms. By now, MutablePe... | PCB added logging |
2,482 | private void append ( byte [ ] data ) { if ( storage . position ( ) + data . length >= storage . capacity ( ) ) { ByteBuffer tmp = ByteBuffer . allocate ( storage . limit ( ) + data . length * 2 ) ; byte [ ] tmpData = new byte [ storage . position ( ) ] ; storage . flip ( ) ; storage . get ( tmpData ) ; tmp . put ( tmp... | Adds data to storage |
2,483 | private String makeRoutingKey ( Message message ) { String sessionId = message . getSessionId ( ) ; return new StringBuilder ( sessionId != null ? sessionId : "null" ) . append ( message . getEndToEndIdentifier ( ) ) . append ( message . getHopByHopIdentifier ( ) ) . toString ( ) ; } | PCB - Made better routing algorithm that should not grow all the time |
2,484 | public void appendElements ( ExtensionPoint ... elements ) { List < ExtensionPoint > rc = new ArrayList < ExtensionPoint > ( ) ; rc . addAll ( Arrays . asList ( this . elements ) ) ; rc . addAll ( Arrays . asList ( elements ) ) ; this . elements = rc . toArray ( new ExtensionPoint [ 0 ] ) ; } | Append extension point entries |
2,485 | protected long getNumConnections ( IPeer peer ) { if ( peer == null ) { return 0 ; } IStatistic stats = peer . getStatistic ( ) ; if ( ! stats . isEnabled ( ) ) { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Statistics for peer are disabled. Please enable statistics in client config" ) ; } return 0 ; } String... | Since num connections is not available determine throughput by reading statistics and assume the load of the peer |
2,486 | private Configuration getConfigByName ( String name ) { if ( config != null ) { for ( Configuration c : config ) { if ( c != null && c . getStringValue ( Parameters . ConcurrentEntityName . ordinal ( ) , "" ) . equals ( name ) ) { return c ; } } } return null ; } | fetch configuration for executor |
2,487 | public long nextLong ( ) { Delta d = ranges . get ( ) ; if ( d . start <= d . stop ) { mutex . lock ( ) ; value = d . update ( value ) ; mutex . unlock ( ) ; } return d . start ++ ; } | Return next uid as long |
2,488 | public static InetAddress InetAddressByIPv4 ( String address ) { StringTokenizer addressTokens = new StringTokenizer ( address , "." ) ; byte [ ] bytes ; if ( addressTokens . countTokens ( ) == 4 ) { bytes = new byte [ ] { getByBytes ( addressTokens ) , getByBytes ( addressTokens ) , getByBytes ( addressTokens ) , getB... | Convert defined string to IPv4 object instance |
2,489 | public static InetAddress InetAddressByIPv6 ( String address ) { StringTokenizer addressTokens = new StringTokenizer ( address , ":" ) ; byte [ ] bytes = new byte [ 16 ] ; if ( addressTokens . countTokens ( ) == 8 ) { int count = 0 ; while ( addressTokens . hasMoreTokens ( ) ) { int word = Integer . parseInt ( addressT... | Convert defined string to IPv6 object instance |
2,490 | private void initStack ( ) { if ( log . isInfoEnabled ( ) ) { log . info ( "Initializing Stack..." ) ; } InputStream is = null ; try { dictionary . parseDictionary ( this . getClass ( ) . getClassLoader ( ) . getResourceAsStream ( dictionaryFile ) ) ; log . info ( "AVP Dictionary successfully parsed." ) ; this . stack ... | boolean telling if we finished our interaction |
2,491 | private void printAvpsAux ( AvpSet avpSet , int level ) throws AvpDataException { String prefix = " " . substring ( 0 , level * 2 ) ; for ( Avp avp : avpSet ) { AvpRepresentation avpRep = AvpDictionary . INSTANCE . getAvp ( avp . getCode ( ) , avp . getVendorId ( ) ) ; if ( avpRep != null && avpRep... | Prints the AVPs present in an AvpSet with a specified tab level |
2,492 | public void start ( ) throws InterruptedException { logger . debug ( "Staring client TLSTransportClient {} " , socketDescription ) ; if ( isConnected ( ) ) { logger . debug ( "Already connected TLSTransportClient {} " , socketDescription ) ; return ; } workerGroup = new NioEventLoopGroup ( ) ; Bootstrap bootstrap = new... | only client side |
2,493 | public static synchronized Enumeration < Stack > getStacks ( ) { List < Stack > result = new CopyOnWriteArrayList < Stack > ( ) ; if ( ! initialized ) { initialize ( ) ; } ClassLoader callerCL = ClassLoader . getSystemClassLoader ( ) ; for ( StackInfo di : stacks ) { if ( getCallerClass ( callerCL , di . stackClassName... | Retrieves an Enumeration with all of the currently loaded Diameter stacks to which the current caller has access . |
2,494 | public static void addOriginAvps ( Message m , MetaData md ) { AvpSet set = m . getAvps ( ) ; if ( set . getAvp ( Avp . ORIGIN_HOST ) == null ) { m . getAvps ( ) . addAvp ( Avp . ORIGIN_HOST , md . getLocalPeer ( ) . getUri ( ) . getFQDN ( ) , true , false , true ) ; } if ( set . getAvp ( Avp . ORIGIN_REALM ) == null )... | Used to set origin previously done in MessageParser . |
2,495 | public RiakObject setVTag ( String vtag ) { if ( vtag != null && vtag . isEmpty ( ) ) { throw new IllegalArgumentException ( "vtag can not be zero length" ) ; } this . vtag = vtag ; return this ; } | Set the version tag for this RiakObject |
2,496 | public boolean removeNode ( RiakNode node ) { stateCheck ( State . CREATED , State . RUNNING , State . QUEUING ) ; boolean removed = false ; try { nodeListLock . writeLock ( ) . lock ( ) ; removed = nodeList . remove ( node ) ; for ( NodeStateListener listener : stateListeners ) { node . removeStateListener ( listener ... | Removes the provided node from the cluster . |
2,497 | public List < RiakNode > getNodes ( ) { stateCheck ( State . CREATED , State . RUNNING , State . SHUTTING_DOWN , State . QUEUING ) ; try { nodeListLock . readLock ( ) . lock ( ) ; return new ArrayList < > ( nodeList ) ; } finally { nodeListLock . readLock ( ) . unlock ( ) ; } } | Returns a copy of the list of nodes in this cluster . |
2,498 | private boolean keepProperty ( BeanPropertyWriter beanPropertyWriter ) { if ( beanPropertyWriter . getAnnotation ( JsonProperty . class ) != null ) { return true ; } for ( Class < ? extends Annotation > annotation : RIAK_ANNOTATIONS ) { if ( beanPropertyWriter . getAnnotation ( annotation ) != null ) { return false ; }... | Checks if the property has any of the Riak annotations on it or the Jackson JsonProperty annotation . |
2,499 | public static RiakClient newClient ( InetSocketAddress ... addresses ) throws UnknownHostException { final List < String > remoteAddresses = new ArrayList < > ( addresses . length ) ; for ( InetSocketAddress addy : addresses ) { remoteAddresses . add ( String . format ( "%s:%s" , addy . getHostName ( ) , addy . getPort... | Static factory method to create a new client instance . This method produces a client connected to the supplied addresses . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.