idx int64 0 165k | question stringlengths 73 5.81k | target stringlengths 5 918 |
|---|---|---|
139,700 | public void writeClass ( String className ) throws IOException { ConstantPool pool = _javaClass . getConstantPool ( ) ; ClassConstant classConst = pool . getClass ( className ) ; if ( classConst != null ) writeShort ( classConst . getIndex ( ) ) ; else writeShort ( 0 ) ; } | Writes a class constant . |
139,701 | public void writeUTF8Const ( String value ) throws IOException { ConstantPool pool = _javaClass . getConstantPool ( ) ; Utf8Constant entry = pool . getUTF8 ( value ) ; if ( entry != null ) writeShort ( entry . getIndex ( ) ) ; else throw new NullPointerException ( L . l ( "utf8 constant {0} does not exist" , value ) ) ... | Writes a UTF8 constant . |
139,702 | public void writeFloat ( float v ) throws IOException { int bits = Float . floatToIntBits ( v ) ; _os . write ( bits >> 24 ) ; _os . write ( bits >> 16 ) ; _os . write ( bits >> 8 ) ; _os . write ( bits ) ; } | Writes a float |
139,703 | public void writeDouble ( double v ) throws IOException { long bits = Double . doubleToLongBits ( v ) ; _os . write ( ( int ) ( bits >> 56 ) ) ; _os . write ( ( int ) ( bits >> 48 ) ) ; _os . write ( ( int ) ( bits >> 40 ) ) ; _os . write ( ( int ) ( bits >> 32 ) ) ; _os . write ( ( int ) ( bits >> 24 ) ) ; _os . write... | Writes a double |
139,704 | public String getDefaultArg ( ) { String defaultArg = null ; if ( _defaultArgs . length > 0 ) { defaultArg = _defaultArgs [ 0 ] ; } return defaultArg ; } | finds first argument that follows no dash prefixed token |
139,705 | private Iterator detailChildrenIterator ( Detail detail ) { DetailEntry firstDetailEntry = getFirstDetailEntry ( detail ) ; if ( firstDetailEntry != null ) { String localName = firstDetailEntry . getElementName ( ) . getLocalName ( ) ; if ( localName . endsWith ( "Exception" ) ) { return firstDetailEntry . getChildElem... | It can either e within an extra tag or directly . |
139,706 | private boolean [ ] parseRange ( String range , int rangeMin , int rangeMax ) throws ConfigException { boolean [ ] values = new boolean [ rangeMax + 1 ] ; int j = 0 ; while ( j < range . length ( ) ) { char ch = range . charAt ( j ) ; int min = 0 ; int max = 0 ; int step = 1 ; if ( ch == '*' ) { min = rangeMin ; max = ... | parses a range following cron rules . |
139,707 | public void init ( StreamImpl source ) { _disableClose = false ; _isDisableCloseSource = false ; _readTime = 0 ; if ( _source != null && _source != source ) { close ( ) ; } if ( source == null ) { throw new IllegalArgumentException ( ) ; } _source = source ; if ( source . canRead ( ) ) { if ( _tempRead == null ) { _tem... | Initializes the stream with a given source . |
139,708 | public void setEncoding ( String encoding ) throws UnsupportedEncodingException { String mimeName = Encoding . getMimeName ( encoding ) ; if ( mimeName != null && mimeName . equals ( _readEncodingName ) ) return ; _readEncoding = Encoding . getReadEncoding ( this , encoding ) ; _readEncodingName = mimeName ; } | Sets the current read encoding . The encoding can either be a Java encoding name or a mime encoding . |
139,709 | public final int readChar ( ) throws IOException { if ( _readEncoding != null ) { int ch = _readEncoding . read ( ) ; return ch ; } if ( _readLength <= _readOffset ) { if ( ! readBuffer ( ) ) return - 1 ; } return _readBuffer [ _readOffset ++ ] & 0xff ; } | Reads a character from the stream returning - 1 on end of file . |
139,710 | public final int read ( char [ ] buf , int offset , int length ) throws IOException { if ( _readEncoding != null ) { return _readEncoding . read ( buf , offset , length ) ; } byte [ ] readBuffer = _readBuffer ; if ( readBuffer == null ) return - 1 ; int readOffset = _readOffset ; int readLength = _readLength ; int subl... | Reads into a character buffer from the stream . Like the byte array version read may return less characters even though more characters are available . |
139,711 | public int read ( CharBuffer buf , int length ) throws IOException { int len = buf . length ( ) ; buf . length ( len + length ) ; int readLength = read ( buf . buffer ( ) , len , length ) ; if ( readLength < 0 ) { buf . length ( len ) ; } else if ( readLength < length ) { buf . length ( len + readLength ) ; } return le... | Reads characters from the stream appending to the character buffer . |
139,712 | public int readInt ( ) throws IOException { if ( _readOffset + 4 < _readLength ) { return ( ( ( _readBuffer [ _readOffset ++ ] & 0xff ) << 24 ) + ( ( _readBuffer [ _readOffset ++ ] & 0xff ) << 16 ) + ( ( _readBuffer [ _readOffset ++ ] & 0xff ) << 8 ) + ( ( _readBuffer [ _readOffset ++ ] & 0xff ) ) ) ; } else { return (... | Reads a 4 - byte network encoded integer |
139,713 | public int readUTF8ByByteLength ( char [ ] buffer , int offset , int byteLength ) throws IOException { int k = 0 ; for ( int i = 0 ; i < byteLength ; i ++ ) { if ( _readLength <= _readOffset ) { readBuffer ( ) ; } int ch = _readBuffer [ _readOffset ++ ] & 0xff ; if ( ch < 0x80 ) { buffer [ k ++ ] = ( char ) ch ; } else... | Reads a utf - 8 string |
139,714 | public boolean fillIfLive ( long timeout ) throws IOException { StreamImpl source = _source ; byte [ ] readBuffer = _readBuffer ; if ( readBuffer == null || source == null ) { _readOffset = 0 ; _readLength = 0 ; return false ; } if ( _readOffset > 0 ) { System . arraycopy ( readBuffer , _readOffset , readBuffer , 0 , _... | Fills the buffer with a timed read testing for the end of file . Used for cases like comet to test if the read stream has closed . |
139,715 | public boolean isSecure ( ) { if ( _s == null || _sslSocketClass == null ) return false ; else return _sslSocketClass . isAssignableFrom ( _s . getClass ( ) ) ; } | Returns true if the connection is secure . |
139,716 | public int cipherBits ( ) { if ( ! ( _s instanceof SSLSocket ) ) return super . cipherBits ( ) ; SSLSocket sslSocket = ( SSLSocket ) _s ; SSLSession sslSession = sslSocket . getSession ( ) ; if ( sslSession != null ) return _sslKeySizes . get ( sslSession . getCipherSuite ( ) ) ; else return 0 ; } | Returns the bits in the socket . |
139,717 | public void postMultipart ( String url , Map < String , String > map ) throws Exception { String boundaryStr = "-----boundary0" ; StringBuilder sb = new StringBuilder ( ) ; map . forEach ( ( k , v ) -> { sb . append ( boundaryStr + "\r" ) ; sb . append ( "Content-Disposition: form-data; name=\"" + k + "\"\r" ) ; sb . a... | Performs multipart post |
139,718 | public void setBackgroundInterval ( long interval , TimeUnit unit ) { if ( ! isValid ( ) ) { return ; } long period = unit . toMillis ( interval ) ; if ( _state == StateProfile . IDLE ) { if ( period > 0 ) { _profileTask . setPeriod ( period ) ; _profileTask . start ( ) ; _state = StateProfile . BACKGROUND ; } } else i... | Sets the time interval for the background profile . |
139,719 | public void start ( long interval , TimeUnit unit ) { if ( ! isValid ( ) ) { return ; } long period = unit . toMillis ( interval ) ; if ( period < 0 ) { return ; } _profileTask . stop ( ) ; _profileTask . setPeriod ( period ) ; _profileTask . start ( ) ; _state = StateProfile . ACTIVE ; } | Starts a dedicated profile . |
139,720 | public ProfileReport stop ( ) { if ( ! isValid ( ) ) { return null ; } if ( _state != StateProfile . ACTIVE ) { return null ; } _profileTask . stop ( ) ; ProfileReport report = _profileTask . getReport ( ) ; if ( _backgroundPeriod > 0 ) { _profileTask . setPeriod ( _backgroundPeriod ) ; _profileTask . start ( ) ; _stat... | Ends the dedicated profile restarting the background . |
139,721 | private MethodRefAmp findLocalMethod ( ) { ServiceRefAmp serviceRefLocal = _serviceRef . getLocalService ( ) ; if ( serviceRefLocal == null ) { return null ; } if ( _type != null ) { return serviceRefLocal . methodByName ( _name , _type ) ; } else { return serviceRefLocal . methodByName ( _name ) ; } } | Return the local method for this pod method when the pod is on the same jvm . |
139,722 | private MethodRefActive createMethodRefActive ( ServiceRefAmp serviceRef ) { MethodRefAmp methodRef ; if ( _type != null ) { methodRef = serviceRef . methodByName ( _name , _type ) ; } else { methodRef = serviceRef . methodByName ( _name ) ; } MethodShim methodShim ; ClassLoader methodLoader = methodRef . serviceRef ( ... | Create an MethodRefActive for the given serviceRef . |
139,723 | private IProvider getProviderFromTemplate ( eu . atos . sla . parser . data . wsag . Template templateXML ) throws ModelConversionException { Context context = templateXML . getContext ( ) ; String provider = null ; try { ServiceProvider ctxProvider = ServiceProvider . fromString ( context . getServiceProvider ( ) ) ; ... | we retrieve the providerUUID from the template and get the provider object from the database |
139,724 | public void write ( byte [ ] buf , int offset , int length , boolean isEnd ) throws IOException { while ( length > 0 ) { if ( _tail == null ) { addBuffer ( TempBuffer . create ( ) ) ; } else if ( _tail . buffer ( ) . length <= _tail . length ( ) ) { addBuffer ( TempBuffer . create ( ) ) ; } TempBuffer tail = _tail ; in... | Writes a chunk of data to the temp stream . |
139,725 | public TempStream copy ( ) { TempStream newStream = new TempStream ( ) ; TempBuffer ptr = _head ; for ( ; ptr != null ; ptr = ptr . next ( ) ) { TempBuffer newPtr = TempBuffer . create ( ) ; if ( newStream . _tail != null ) newStream . _tail . next ( newPtr ) ; else newStream . _head = newPtr ; newStream . _tail = newP... | Copies the temp stream ; |
139,726 | public void flush ( ) { _logWriterQueue . wake ( ) ; waitForFlush ( 10 ) ; try { super . flush ( ) ; } catch ( IOException e ) { log . log ( Level . FINER , e . toString ( ) , e ) ; } } | must be synchronized by _bufferLock . |
139,727 | public boolean isModified ( ) { I instance = _instance ; if ( instance == null ) { return true ; } if ( DeployMode . MANUAL . equals ( _strategy . redeployMode ( ) ) ) { return false ; } return instance . isModified ( ) ; } | Returns true if the entry is modified . |
139,728 | public void startOnInit ( Result < I > result ) { DeployFactory2 < I > builder = builder ( ) ; if ( builder == null ) { result . ok ( null ) ; return ; } if ( ! _lifecycle . toInit ( ) ) { result . ok ( get ( ) ) ; return ; } _strategy . startOnInit ( this , result ) ; } | Starts the entry on initialization |
139,729 | public final void shutdown ( ShutdownModeAmp mode , Result < Boolean > result ) { _strategy . shutdown ( this , mode , result ) ; } | Stops the controller from an admin command . |
139,730 | public final void request ( Result < I > result ) { I instance = _instance ; if ( instance != null && _lifecycle . isActive ( ) && ! isModified ( ) ) { result . ok ( instance ) ; } else if ( _lifecycle . isDestroyed ( ) ) { result . ok ( null ) ; } else { _strategy . request ( this , result ) ; } } | Returns the instance for a top - level request |
139,731 | public void startImpl ( Result < I > result ) { DeployFactory2 < I > builder = builder ( ) ; if ( builder == null ) { result . ok ( null ) ; return ; } if ( ! _lifecycle . toStarting ( ) ) { result . ok ( _instance ) ; return ; } I deployInstance = null ; boolean isActive = false ; try { deployInstance = builder . get ... | Starts the entry . |
139,732 | public void validate ( byte [ ] blockBuffer , int rowOffset , int rowHead , int blobTail ) { int offset = rowOffset + offset ( ) ; int blobLen = BitsUtil . readInt16 ( blockBuffer , offset + 2 ) ; int blobOffset = BitsUtil . readInt16 ( blockBuffer , offset ) ; if ( blobLen == 0 ) { return ; } if ( blobOffset < 0 || bl... | Validates the column checking for corruption . |
139,733 | public MonitoringRules getMonitoringRulesByTemplateId ( String monitoringRuleTemplateId ) { return getJerseyClient ( ) . target ( getEndpoint ( ) + "/planner/monitoringrules/" + monitoringRuleTemplateId ) . request ( ) . buildGet ( ) . invoke ( ) . readEntity ( MonitoringRules . class ) ; } | Creates proxied HTTP GET request to SeaClouds Planner which returns the monitoring rules according to the template id |
139,734 | public String getAdps ( String aam ) { Entity content = Entity . entity ( aam , MediaType . TEXT_PLAIN ) ; Invocation invocation = getJerseyClient ( ) . target ( getEndpoint ( ) + "/planner/plan" ) . request ( ) . buildPost ( content ) ; return invocation . invoke ( ) . readEntity ( String . class ) ; } | Creates proxied HTTP POST request to SeaClouds Planner which returns a list TOSCA compliant SeaClouds ADP in JSON format |
139,735 | public String getDam ( String adp ) { Entity content = Entity . entity ( adp , MediaType . TEXT_PLAIN ) ; Invocation invocation = getJerseyClient ( ) . target ( getEndpoint ( ) + "/planner/damgen" ) . request ( ) . buildPost ( content ) ; return invocation . invoke ( ) . readEntity ( String . class ) ; } | Creates proxied HTTP POST request to SeaClouds Planner which returns a SeaClouds TOSCA DAM file |
139,736 | public static boolean isMatch ( Class < ? > [ ] paramA , Class < ? > [ ] paramB ) { if ( paramA . length != paramB . length ) return false ; for ( int i = paramA . length - 1 ; i >= 0 ; i -- ) { if ( ! paramA [ i ] . equals ( paramB [ i ] ) ) return false ; } return true ; } | Tests if parameters match a method s parameter types . |
139,737 | public boolean isServerPrimary ( ServerBartender server ) { for ( int i = 0 ; i < Math . min ( 1 , _owners . length ) ; i ++ ) { ServerBartender serverBar = server ( i ) ; if ( serverBar == null ) { continue ; } else if ( serverBar . isSameServer ( server ) ) { return true ; } } return false ; } | Test if the server is the primary for the node . |
139,738 | public boolean isServerOwner ( ServerBartender server ) { for ( int i = 0 ; i < _owners . length ; i ++ ) { ServerBartender serverBar = server ( i ) ; if ( serverBar == null ) { continue ; } else if ( serverBar . isSameServer ( server ) ) { return server . isUp ( ) ; } else if ( serverBar . isUp ( ) ) { return false ; ... | Test if the server is the current owner of the node . The owner is the first live server in the backup list . |
139,739 | public boolean isServerCopy ( ServerBartender server ) { for ( int i = 0 ; i < _owners . length ; i ++ ) { ServerBartender serverBar = server ( i ) ; if ( serverBar != null && serverBar . isSameServer ( server ) ) { return true ; } } return false ; } | Test if the server is the one of the node copies . |
139,740 | public ServerBartender owner ( ) { for ( int i = 0 ; i < _owners . length ; i ++ ) { ServerBartender serverBar = server ( i ) ; if ( serverBar != null && serverBar . isUp ( ) ) { return serverBar ; } } return null ; } | Return the current server owner . |
139,741 | public BartenderBuilderPod pod ( String id , String clusterId ) { Objects . requireNonNull ( id ) ; Objects . requireNonNull ( clusterId ) ; ClusterHeartbeat cluster = createCluster ( clusterId ) ; return new PodBuilderConfig ( id , cluster , this ) ; } | Create a configured pod . |
139,742 | private UpdatePod initLocalPod ( ) { ServerBartender serverSelf = _bartender . serverSelf ( ) ; ServicesAmp rampManager = AmpSystem . currentManager ( ) ; UpdatePodBuilder podBuilder = new UpdatePodBuilder ( ) ; podBuilder . name ( "local" ) ; podBuilder . cluster ( _bartender . serverSelf ( ) . getCluster ( ) ) ; Serv... | The local pod refers to the server itself . |
139,743 | public static JavaCompilerUtil create ( ClassLoader loader ) { JavacConfig config = JavacConfig . getLocalConfig ( ) ; String javac = config . getCompiler ( ) ; JavaCompilerUtil javaCompiler = new JavaCompilerUtil ( ) ; if ( loader == null ) { loader = Thread . currentThread ( ) . getContextClassLoader ( ) ; } javaComp... | Creates a new compiler . |
139,744 | public String getClassPath ( ) { String rawClassPath = buildClassPath ( ) ; if ( true ) return rawClassPath ; char sep = CauchoUtil . getPathSeparatorChar ( ) ; String [ ] splitClassPath = rawClassPath . split ( "[" + sep + "]" ) ; String javaHome = System . getProperty ( "java.home" ) ; PathImpl pwd = VfsOld . lookup ... | Returns the classpath . |
139,745 | private String buildClassPath ( ) { String classPath = null ; if ( classPath != null ) { return classPath ; } if ( classPath == null && _loader instanceof DynamicClassLoader ) { classPath = ( ( DynamicClassLoader ) _loader ) . getClassPath ( ) ; } else { StringBuilder sb = new StringBuilder ( ) ; sb . append ( CauchoUt... | Returns the classpath for the compiler . |
139,746 | public void setArgs ( String argString ) { try { if ( argString != null ) { String [ ] args = Pattern . compile ( "[\\s,]+" ) . split ( argString ) ; _args = new ArrayList < String > ( ) ; for ( int i = 0 ; i < args . length ; i ++ ) { if ( ! args [ i ] . equals ( "" ) ) _args . add ( args [ i ] ) ; } } } catch ( Excep... | Sets any additional arguments for the compiler . |
139,747 | public void setEncoding ( String encoding ) { _charEncoding = encoding ; String javaEncoding = Encoding . getJavaName ( encoding ) ; if ( "ISO8859_1" . equals ( javaEncoding ) ) _charEncoding = null ; } | Sets the Java encoding for the compiler . |
139,748 | public static String mangleName ( String name ) { boolean toLower = CauchoUtil . isCaseInsensitive ( ) ; CharBuffer cb = new CharBuffer ( ) ; cb . append ( "_" ) ; for ( int i = 0 ; i < name . length ( ) ; i ++ ) { char ch = name . charAt ( i ) ; if ( ch == '/' || ch == CauchoUtil . getPathSeparatorChar ( ) ) { if ( i ... | Mangles the path into a valid Java class name . |
139,749 | public void compileBatch ( String [ ] files ) throws IOException , ClassNotFoundException { if ( _compileParent ) { try { if ( _loader instanceof Make ) ( ( Make ) _loader ) . make ( ) ; } catch ( Exception e ) { throw new IOException ( e ) ; } } if ( files . length == 0 ) return ; int batchCount = _maxBatch ; if ( bat... | Compiles a batch list of classes . |
139,750 | final public void write ( char [ ] buf ) { try { _out . print ( buf , 0 , buf . length ) ; } catch ( IOException e ) { log . log ( Level . FINE , e . toString ( ) , e ) ; } } | Writes a character buffer . |
139,751 | void waitForExit ( ) { Runtime runtime = Runtime . getRuntime ( ) ; ShutdownSystem shutdown = _resinSystem . getSystem ( ShutdownSystem . class ) ; if ( shutdown == null ) { throw new IllegalStateException ( L . l ( "'{0}' requires an active {1}" , this , ShutdownSystem . class . getSimpleName ( ) ) ) ; } while ( ! _se... | Thread to wait until Resin should be stopped . |
139,752 | public ServiceRefAmp getLocalService ( ) { ServiceRefAmp serviceRefRoot = _podRoot . getLocalService ( ) ; if ( serviceRefRoot == null ) { return null ; } ServiceRefActive serviceRefLocal = _serviceRefLocal ; if ( serviceRefLocal != null ) { ServiceRefAmp serviceRef = serviceRefLocal . getService ( serviceRefRoot ) ; i... | Returns the active service for this pod and path s hash . |
139,753 | public PathImpl lookupImpl ( String userPath , Map < String , Object > newAttributes , boolean isAllowRoot ) { String newPath ; if ( userPath == null ) return _root . fsWalk ( getPath ( ) , newAttributes , "/" ) ; int length = userPath . length ( ) ; int colon = userPath . indexOf ( ':' ) ; int slash = userPath . index... | Overrides the default lookup to parse the host and port before parsing the path . |
139,754 | public PathImpl schemeWalk ( String userPath , Map < String , Object > attributes , String uri , int offset ) { int length = uri . length ( ) ; if ( length < 2 + offset || uri . charAt ( offset ) != '/' || uri . charAt ( offset + 1 ) != '/' ) throw new RuntimeException ( L . l ( "bad scheme in `{0}'" , uri ) ) ; CharBu... | Walk down the path starting from the portion immediately following the scheme . i . e . schemeWalk is responsible for parsing the host and port from the URL . |
139,755 | public PathImpl fsWalk ( String userPath , Map < String , Object > attributes , String uri ) { String path ; String query = null ; int queryIndex = uri . indexOf ( '?' ) ; if ( queryIndex >= 0 ) { path = uri . substring ( 0 , queryIndex ) ; query = uri . substring ( queryIndex + 1 ) ; } else path = uri ; if ( path . le... | Scans the path portion of the URI i . e . everything after the host and port . |
139,756 | public String getURL ( ) { int port = getPort ( ) ; return ( getScheme ( ) + "://" + getHost ( ) + ( port == 80 ? "" : ":" + getPort ( ) ) + getPath ( ) + ( _query == null ? "" : "?" + _query ) ) ; } | Returns a full URL for the path . |
139,757 | private V putImpl ( K key , V value ) { V item = null ; int hash = key . hashCode ( ) & _mask ; int count = _values . length ; for ( ; count > 0 ; count -- ) { item = _values [ hash ] ; if ( item == null ) { _keys [ hash ] = key ; _values [ hash ] = value ; _size ++ ; return null ; } if ( _keys [ hash ] . equals ( key ... | Implementation of the put . |
139,758 | public String getURL ( ) { if ( ! isWindows ( ) ) return escapeURL ( "file:" + getFullPath ( ) ) ; String path = getFullPath ( ) ; int length = path . length ( ) ; CharBuffer cb = new CharBuffer ( ) ; cb . append ( "file:" ) ; char ch ; int offset = 0 ; if ( length >= 3 && path . charAt ( 0 ) == '/' && path . charAt ( ... | Returns the full url for the given path . |
139,759 | public String getNativePath ( ) { if ( ! isWindows ( ) ) { return getFullPath ( ) ; } String path = getFullPath ( ) ; int length = path . length ( ) ; CharBuffer cb = new CharBuffer ( ) ; char ch ; int offset = 0 ; if ( length >= 3 && path . charAt ( 0 ) == '/' && path . charAt ( 2 ) == ':' && ( 'a' <= ( ch = path . ch... | Returns the native path . |
139,760 | public String [ ] list ( ) throws IOException { try { String [ ] list = getFile ( ) . list ( ) ; if ( list != null ) return list ; } catch ( AccessControlException e ) { log . finer ( e . toString ( ) ) ; } return new String [ 0 ] ; } | Returns a list of files in the directory . |
139,761 | public StreamImpl openReadImpl ( ) throws IOException { if ( _isWindows && isAux ( ) ) throw new FileNotFoundException ( _file . toString ( ) ) ; return new FileReadStream ( new FileInputStream ( getFile ( ) ) , this ) ; } | Returns the stream implementation for a read stream . |
139,762 | public boolean isAux ( ) { if ( ! _isWindows ) return false ; File file = getFile ( ) ; String path = getFullPath ( ) . toLowerCase ( Locale . ENGLISH ) ; int len = path . length ( ) ; int p = path . indexOf ( "/aux" ) ; int ch ; if ( p >= 0 && ( len <= p + 4 || path . charAt ( p + 4 ) == '.' ) ) return true ; p = path... | Special case for the evil windows special |
139,763 | public void clearCache ( ) { if ( _lifecycle . isStopping ( ) ) { return ; } if ( log . isLoggable ( Level . FINER ) ) { log . finest ( "clearCache" ) ; } getInvocationManager ( ) . clearCache ( ) ; } | Clears the proxy cache . |
139,764 | public void init ( ) { _offset = 0 ; if ( _tempBuffer == null ) { _tempBuffer = TempBuffer . create ( ) ; _buffer = _tempBuffer . buffer ( ) ; _bufferEnd = _buffer . length ; } } | Initialize the output stream . |
139,765 | public void write ( byte [ ] buffer , int offset , int length ) throws IOException { while ( length > 0 ) { if ( _bufferEnd <= _offset ) { flushBlock ( false ) ; } int sublen = Math . min ( _bufferEnd - _offset , length ) ; System . arraycopy ( buffer , offset , _buffer , _offset , sublen ) ; offset += sublen ; _offset... | Writes a buffer . |
139,766 | public void close ( ) throws IOException { if ( _isClosed ) { return ; } _isClosed = true ; flushBlock ( true ) ; _cursor . setBlob ( _column . index ( ) , this ) ; } | Completes the stream . |
139,767 | private void flushBlock ( boolean isClose ) throws IOException { if ( isClose ) { if ( ! _isLargeBlob && _offset <= _table . getInlineBlobMax ( ) ) { return ; } } _isLargeBlob = true ; if ( _blobOut == null ) { _blobOut = _table . getTempStore ( ) . openWriter ( ) ; } if ( _offset != _bufferEnd && ! isClose ) { throw n... | flushes a block of the blob to the temp store if larger than the inline size . |
139,768 | public static Integer getSPECint ( String providerName , String instanceType ) { String key = providerName + "." + instanceType ; return SPECint . get ( key ) ; } | Gets the SPECint of the specified instance of the specified offerings provider |
139,769 | public static String toHex ( byte [ ] bytes , int offset , int len ) { if ( bytes == null ) return "null" ; StringBuilder sb = new StringBuilder ( ) ; for ( int i = 0 ; i < len ; i ++ ) { int d1 = ( bytes [ offset + i ] >> 4 ) & 0xf ; int d2 = ( bytes [ offset + i ] ) & 0xf ; if ( d1 < 10 ) sb . append ( ( char ) ( '0'... | Convert bytes to hex |
139,770 | public static byte [ ] toBytes ( String hex ) { if ( hex == null ) return null ; int len = hex . length ( ) ; byte [ ] bytes = new byte [ len / 2 ] ; int k = 0 ; for ( int i = 0 ; i < len ; i += 2 ) { int digit = 0 ; char ch = hex . charAt ( i ) ; if ( '0' <= ch && ch <= '9' ) digit = ch - '0' ; else if ( 'a' <= ch && ... | Convert hex to bytes |
139,771 | public static Class < ? > loadClass ( String name , boolean init , ClassLoader loader ) throws ClassNotFoundException { if ( loader == null ) loader = Thread . currentThread ( ) . getContextClassLoader ( ) ; if ( loader == null || loader . equals ( CauchoUtil . class . getClassLoader ( ) ) ) return Class . forName ( na... | Loads a class from a classloader . If the loader is null uses the context class loader . |
139,772 | protected void flush ( Buffer data , boolean isEnd ) { if ( isClosed ( ) ) { throw new IllegalStateException ( ) ; } _request . outProxy ( ) . write ( _request , data , isEnd ) ; } | Writes data to the output . If the headers have not been written they should be written . |
139,773 | private Client getClient ( ) { Client client = hostMap . get ( basePath ) ; if ( client != null ) return client ; final ClientConfig clientConfig = new ClientConfig ( ) ; clientConfig . register ( MultiPartFeature . class ) ; if ( debug ) { clientConfig . register ( LoggingFilter . class ) ; } client = ClientBuilder . ... | Get an existing client or create a new client to handle HTTP request . |
139,774 | public void onAccept ( ) { if ( _request != null ) { System . out . println ( "OLD_REQUEST: " + _request ) ; } _sequenceClose . set ( - 1 ) ; } | Called first when the connection is first accepted . |
139,775 | public StateConnection service ( ) throws IOException { try { ConnectionProtocol request = requestOrCreate ( ) ; if ( request == null ) { log . warning ( "Unexpected empty request: " + this ) ; return StateConnection . CLOSE ; } StateConnection next = request . service ( ) ; if ( next != StateConnection . CLOSE ) { ret... | Service a HTTP request . |
139,776 | public StateConnection onCloseRead ( ) { ConnectionProtocol request = request ( ) ; if ( request != null ) { request . onCloseRead ( ) ; } _sequenceClose . set ( _sequenceRead . get ( ) ) ; if ( _sequenceFlush . get ( ) < _sequenceClose . get ( ) ) { _isClosePending . set ( true ) ; if ( _sequenceFlush . get ( ) < _seq... | Called by reader thread on reader end of file . |
139,777 | public boolean isWriteComplete ( ) { long seqClose = _sequenceClose . get ( ) ; long seqWrite = _sequenceWrite . get ( ) ; return seqClose > 0 && seqClose <= seqWrite ; } | The last write has completed after the read . |
139,778 | public Map < String , HashSet < String > > match ( Map < String , IndexedNodeType > aamModules , Map < String , NodeTemplate > offerings ) { Map < String , HashSet < String > > mathedOfferings = new HashMap < > ( ) ; for ( String moduleName : aamModules . keySet ( ) ) { IndexedNodeType module = aamModules . get ( modul... | Matches for each module the technical requirement with the available offerings . |
139,779 | public static String encodeURL ( String uri ) { CharBuffer cb = CharBuffer . allocate ( ) ; for ( int i = 0 ; i < uri . length ( ) ; i ++ ) { char ch = uri . charAt ( i ) ; switch ( ch ) { case '<' : case '>' : case ' ' : case '%' : case '\'' : case '\"' : cb . append ( '%' ) ; cb . append ( encodeHex ( ch >> 4 ) ) ; c... | Encode the url with % encoding . |
139,780 | public long extractAlarm ( long now , boolean isTest ) { long lastTime = _now . getAndSet ( now ) ; long nextTime = _nextAlarmTime . get ( ) ; if ( now < nextTime ) { return nextTime ; } _nextAlarmTime . set ( now + CLOCK_NEXT ) ; int delta ; delta = ( int ) ( now - lastTime ) / CLOCK_INTERVAL ; delta = Math . min ( de... | Returns the next alarm ready to run |
139,781 | public static int createIpAddress ( byte [ ] address , char [ ] buffer ) { if ( isIpv4 ( address ) ) { return createIpv4Address ( address , 0 , buffer , 0 ) ; } int offset = 0 ; boolean isZeroCompress = false ; boolean isInZeroCompress = false ; buffer [ offset ++ ] = '[' ; for ( int i = 0 ; i < 16 ; i += 2 ) { int val... | Convert a system ip address to an actual address . |
139,782 | public void setAttribute ( String name , Object value ) { if ( _stream != null ) { _stream . setAttribute ( name , value ) ; } } | Sets a header for the request . |
139,783 | public UpdatePodBuilder name ( String name ) { Objects . requireNonNull ( name ) ; if ( name . indexOf ( '.' ) >= 0 ) { throw new IllegalArgumentException ( name ) ; } _name = name ; return this ; } | name is the name of the pod |
139,784 | public UpdatePod build ( ) { if ( getServers ( ) == null ) { int count = Math . max ( _primaryServerCount , _depth ) ; if ( _type == PodType . off ) { count = 0 ; } _servers = buildServers ( count ) ; } Objects . requireNonNull ( getServers ( ) ) ; return new UpdatePod ( this ) ; } | Builds the configured pod . |
139,785 | public long getLength ( ) { StreamSource indirectSource = _indirectSource ; if ( indirectSource != null ) { return indirectSource . getLength ( ) ; } TempOutputStream out = _out ; if ( out != null ) { return out . getLength ( ) ; } else { return - 1 ; } } | Returns the length of the stream if known . |
139,786 | public void freeUseCount ( ) { if ( _indirectSource != null ) { _indirectSource . freeUseCount ( ) ; } else if ( _useCount != null ) { if ( _useCount . decrementAndGet ( ) < 0 ) { closeSelf ( ) ; } } } | Frees a use - counter so getInputStream can be called multiple times . |
139,787 | public InputStream openInputStream ( ) throws IOException { StreamSource indirectSource = _indirectSource ; if ( indirectSource != null ) { return indirectSource . openInputStream ( ) ; } TempOutputStream out = _out ; if ( out != null ) { return out . openInputStreamNoFree ( ) ; } throw new IOException ( L . l ( "{0}: ... | Returns an input stream without freeing the results |
139,788 | public final < T > SerializerJson < T > serializer ( Class < T > cl ) { return ( SerializerJson ) _serMap . get ( cl ) ; } | The serializer for the given class . |
139,789 | public final < T > SerializerJson < T > serializer ( Type type ) { SerializerJson < T > ser = ( SerializerJson < T > ) _serTypeMap . get ( type ) ; if ( ser == null ) { TypeRef typeRef = TypeRef . of ( type ) ; Class < T > rawClass = ( Class < T > ) typeRef . rawClass ( ) ; ser = serializer ( rawClass ) . withType ( ty... | The serializer for the given type . |
139,790 | private JarDepend getJarDepend ( ) { if ( _depend == null || _depend . isModified ( ) ) _depend = new JarDepend ( new Depend ( getBacking ( ) ) ) ; return _depend ; } | Returns the dependency . |
139,791 | public Certificate [ ] getCertificates ( String path ) { if ( ! isSigned ( ) ) return null ; if ( path . length ( ) > 0 && path . charAt ( 0 ) == '/' ) path = path . substring ( 1 ) ; try { if ( ! getBacking ( ) . canRead ( ) ) return null ; JarFile jarFile = getJarFile ( ) ; JarEntry entry ; InputStream is = null ; tr... | Returns any certificates . |
139,792 | public long getLastModified ( String path ) { try { ZipEntry entry = getZipEntry ( path ) ; return entry != null ? entry . getTime ( ) : - 1 ; } catch ( IOException e ) { log . log ( Level . FINE , e . toString ( ) , e ) ; } return - 1 ; } | Returns the last - modified time of the entry in the jar file . |
139,793 | public long getLength ( String path ) { try { ZipEntry entry = getZipEntry ( path ) ; long length = entry != null ? entry . getSize ( ) : - 1 ; return length ; } catch ( IOException e ) { log . log ( Level . FINE , e . toString ( ) , e ) ; return - 1 ; } } | Returns the length of the entry in the jar file . |
139,794 | public boolean canRead ( String path ) { try { ZipEntry entry = getZipEntry ( path ) ; return entry != null && ! entry . isDirectory ( ) ; } catch ( IOException e ) { log . log ( Level . FINE , e . toString ( ) , e ) ; return false ; } } | Readable if the jar is readable and the path refers to a file . |
139,795 | public void clearCache ( ) { ZipFile zipFile = _zipFileRef . getAndSet ( null ) ; if ( zipFile != null ) try { zipFile . close ( ) ; } catch ( Exception e ) { } } | Clears any cached JarFile . |
139,796 | public ClassLoader buildClassLoader ( ClassLoader serviceLoader ) { synchronized ( _loaderMap ) { SoftReference < ClassLoader > extLoaderRef = _loaderMap . get ( serviceLoader ) ; if ( extLoaderRef != null ) { ClassLoader extLoader = extLoaderRef . get ( ) ; if ( extLoader != null ) { return extLoader ; } } } String pa... | Builds a combined class - loader with the target service loader as a parent and this calling pod loader as a child . |
139,797 | public ServerHeartbeat getServer ( String serverId ) { ServerHeartbeat server = _serverMap . get ( serverId ) ; return server ; } | Returns the server with the given canonical id . |
139,798 | public ServerBartender findServerByName ( String name ) { for ( ClusterHeartbeat cluster : _clusterMap . values ( ) ) { ServerBartender server = cluster . findServerByName ( name ) ; if ( server != null ) { return server ; } } return null ; } | Returns the server with the given display name . |
139,799 | ClusterHeartbeat createCluster ( String clusterName ) { ClusterHeartbeat cluster = _clusterMap . get ( clusterName ) ; if ( cluster == null ) { cluster = new ClusterHeartbeat ( clusterName , this ) ; _clusterMap . putIfAbsent ( clusterName , cluster ) ; cluster = _clusterMap . get ( clusterName ) ; } return cluster ; } | Returns the cluster with the given name creating it if necessary . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.