idx
int64
0
165k
question
stringlengths
73
5.81k
target
stringlengths
5
918
139,600
public void addMergePath ( PathImpl path ) { if ( ! ( path instanceof MergePath ) ) { ArrayList < PathImpl > pathList = ( ( MergePath ) _root ) . _pathList ; if ( ! pathList . contains ( path ) ) pathList . add ( path ) ; } else if ( ( ( MergePath ) path ) . _root == _root ) return ; else { MergePath mergePath = ( Merg...
Adds a new path to the end of the merge path .
139,601
public PathImpl fsWalk ( String userPath , Map < String , Object > attributes , String path ) { ArrayList < PathImpl > pathList = getMergePaths ( ) ; if ( ! userPath . startsWith ( "/" ) || pathList . size ( ) == 0 ) return new MergePath ( ( MergePath ) _root , userPath , attributes , path ) ; String bestPrefix = null ...
Walking down the path just extends the path . It won t be evaluated until opening .
139,602
public ArrayList < PathImpl > getResources ( String pathName ) { ArrayList < PathImpl > list = new ArrayList < PathImpl > ( ) ; String pathname = _pathname ; if ( pathname . startsWith ( "/" ) ) pathname = "." + pathname ; ArrayList < PathImpl > pathList = ( ( MergePath ) _root ) . _pathList ; for ( int i = 0 ; i < pat...
Returns all the resources matching the path .
139,603
public String [ ] list ( ) throws IOException { ArrayList < String > list = new ArrayList < String > ( ) ; String pathname = _pathname ; if ( pathname . startsWith ( "/" ) ) pathname = "." + pathname ; ArrayList < PathImpl > pathList = ( ( MergePath ) _root ) . _pathList ; for ( int i = 0 ; i < pathList . size ( ) ; i ...
List the merged directories .
139,604
public PersistentDependency createDepend ( ) { ArrayList < PathImpl > pathList = ( ( MergePath ) _root ) . _pathList ; if ( pathList . size ( ) == 1 ) return ( PersistentDependency ) pathList . get ( 0 ) . createDepend ( ) ; DependencyList dependList = new DependencyList ( ) ; for ( int i = 0 ; i < pathList . size ( ) ...
Creates a dependency .
139,605
public JType getGenericType ( ) { SignatureAttribute sigAttr = ( SignatureAttribute ) getAttribute ( "Signature" ) ; if ( sigAttr != null ) { return getClassLoader ( ) . parseParameterizedType ( sigAttr . getSignature ( ) ) ; } return getType ( ) ; }
Gets the typename .
139,606
public JAnnotation [ ] getDeclaredAnnotations ( ) { if ( _annotations == null ) { Attribute attr = getAttribute ( "RuntimeVisibleAnnotations" ) ; if ( attr instanceof OpaqueAttribute ) { byte [ ] buffer = ( ( OpaqueAttribute ) attr ) . getValue ( ) ; try { ByteArrayInputStream is = new ByteArrayInputStream ( buffer ) ;...
Returns the declared annotations .
139,607
public JavaField export ( JavaClass cl , JavaClass target ) { JavaField field = new JavaField ( ) ; field . setName ( _name ) ; field . setDescriptor ( _descriptor ) ; field . setAccessFlags ( _accessFlags ) ; target . getConstantPool ( ) . addUTF8 ( _name ) ; target . getConstantPool ( ) . addUTF8 ( _descriptor ) ; fo...
exports the field
139,608
public void write ( Buffer buffer , boolean isEnd ) throws IOException { if ( _s == null ) { buffer . free ( ) ; return ; } try { _needsFlush = true ; if ( buffer . isDirect ( ) ) { _totalWriteBytes += buffer . length ( ) ; _s . write ( buffer . direct ( ) ) ; return ; } _totalWriteBytes += buffer . length ( ) ; while ...
Writes an nio buffer to the socket .
139,609
private boolean accept ( SocketBar socket ) { PortTcp port = port ( ) ; try { while ( ! port ( ) . isClosed ( ) ) { if ( _serverSocket . accept ( socket ) ) { if ( port . isClosed ( ) ) { socket . close ( ) ; return false ; } else if ( isThrottle ( ) ) { socket . close ( ) ; } else { return true ; } } } } catch ( Throw...
Accepts a new connection .
139,610
private int writeShort ( String value , int offset , int end ) throws IOException { int ch ; OutputStreamWithBuffer os = _os ; byte [ ] buffer = os . buffer ( ) ; int bOffset = os . offset ( ) ; end = Math . min ( end , offset + buffer . length - bOffset ) ; for ( ; offset < end && ( ch = value . charAt ( offset ) ) < ...
Writes a short string .
139,611
public boolean write ( byte [ ] buf1 , int off1 , int len1 , byte [ ] buf2 , int off2 , int len2 , boolean isEnd ) throws IOException { if ( len1 == 0 ) { write ( buf2 , off2 , len2 , isEnd ) ; return true ; } else return false ; }
Writes a pair of buffer to the underlying stream .
139,612
public String removeAgreement ( String agreementId ) { Invocation invocation = getJerseyClient ( ) . target ( getEndpoint ( ) + "/agreements/" + agreementId ) . request ( ) . header ( "Accept" , MediaType . APPLICATION_JSON ) . header ( "Content-Type" , MediaType . APPLICATION_JSON ) . buildDelete ( ) ; return invocati...
Creates proxied HTTP DELETE request to SeaClouds SLA core which removes the SLA from the SLA Core
139,613
public String notifyRulesReady ( Agreement slaAgreement ) { Entity content = Entity . entity ( "" , MediaType . TEXT_PLAIN ) ; Invocation invocation = getJerseyClient ( ) . target ( getEndpoint ( ) + "/seaclouds/commands/rulesready?agreementId=" + slaAgreement . getAgreementId ( ) ) . request ( ) . header ( "Accept" , ...
Creates proxied HTTP POST request to SeaClouds SLA core which notifies that the Monitoring Rules were installed in Tower4Clouds .
139,614
public Agreement getAgreement ( String agreementId ) { return getJerseyClient ( ) . target ( getEndpoint ( ) + "/agreements/" + agreementId ) . request ( ) . header ( "Accept" , MediaType . APPLICATION_JSON ) . header ( "Content-Type" , MediaType . APPLICATION_JSON ) . buildGet ( ) . invoke ( ) . readEntity ( Agreement...
Creates proxied HTTP GET request to SeaClouds SLA core which retrieves the Agreement details
139,615
public Agreement getAgreementByTemplateId ( String slaAgreementTemplateId ) { return getJerseyClient ( ) . target ( getEndpoint ( ) + "/seaclouds/commands/fromtemplate?templateId=" + slaAgreementTemplateId ) . request ( ) . header ( "Accept" , MediaType . APPLICATION_JSON ) . header ( "Content-Type" , MediaType . APPLI...
Creates proxied HTTP GET request to SeaClouds SLA which returns the Agreement according to the template id
139,616
public GuaranteeTermsStatus getAgreementStatus ( String agreementId ) { return getJerseyClient ( ) . target ( getEndpoint ( ) + "/agreements/" + agreementId + "/guaranteestatus" ) . request ( ) . header ( "Accept" , MediaType . APPLICATION_JSON ) . header ( "Content-Type" , MediaType . APPLICATION_JSON ) . buildGet ( )...
Creates proxied HTTP GET request to SeaClouds SLA core which retrieves the Agreement Status
139,617
public List < Violation > getGuaranteeTermViolations ( Agreement agreement , GuaranteeTerm guaranteeTerm ) { String json = getJerseyClient ( ) . target ( getEndpoint ( ) + "/violations?agreementId=" + agreement . getAgreementId ( ) + "&guaranteeTerm=" + guaranteeTerm . getName ( ) ) . request ( ) . header ( "Accept" , ...
Creates proxied HTTP GET request to SeaClouds SLA core which retrieves the Agreement Term Violations
139,618
public T readObject ( InRawH3 is , InH3Amp in ) { T bean = newInstance ( ) ; in . ref ( bean ) ; FieldSerBase [ ] fields = _fields ; int size = fields . length ; for ( int i = 0 ; i < size ; i ++ ) { fields [ i ] . read ( bean , is , in ) ; } return bean ; }
Reads the bean from the stream .
139,619
public InvocationRouter < InvocationBaratine > buildRouter ( WebApp webApp ) { InjectorAmp inject = webApp . inject ( ) ; buildViews ( inject ) ; ArrayList < RouteMap > mapList = new ArrayList < > ( ) ; ServicesAmp manager = webApp . services ( ) ; ServiceRefAmp serviceRef = manager . newService ( new RouteService ( ) ...
Builds the web - app s router
139,620
public void splitQueryAndUnescape ( I invocation , byte [ ] rawURIBytes , int uriLength ) throws IOException { for ( int i = 0 ; i < uriLength ; i ++ ) { if ( rawURIBytes [ i ] == '?' ) { i ++ ; String queryString = byteToChar ( rawURIBytes , i , uriLength - i , "ISO-8859-1" ) ; invocation . setQueryString ( queryStrin...
Splits out the query string and unescape the value .
139,621
public void splitQuery ( I invocation , String rawURI ) throws IOException { int p = rawURI . indexOf ( '?' ) ; if ( p > 0 ) { invocation . setQueryString ( rawURI . substring ( p + 1 ) ) ; rawURI = rawURI . substring ( 0 , p ) ; } invocation . setRawURI ( rawURI ) ; String uri = normalizeUri ( rawURI ) ; invocation . ...
Splits out the query string and normalizes the URI assuming nothing needs unescaping .
139,622
public void normalizeURI ( I invocation , String rawURI ) throws IOException { invocation . setRawURI ( rawURI ) ; String uri = normalizeUri ( rawURI ) ; invocation . setURI ( uri ) ; }
Just normalize the URI .
139,623
private static String normalizeUriEscape ( byte [ ] rawUri , int i , int len , String encoding ) throws IOException { ByteToChar converter = allocateConverter ( ) ; if ( encoding == null ) { encoding = "utf-8" ; } try { converter . setEncoding ( encoding ) ; } catch ( UnsupportedEncodingException e ) { log . log ( Leve...
Converts the escaped URI to a string .
139,624
private static int scanUriEscape ( ByteToChar converter , byte [ ] rawUri , int i , int len ) throws IOException { int ch1 = i < len ? ( rawUri [ i ++ ] & 0xff ) : - 1 ; if ( ch1 == 'u' ) { ch1 = i < len ? ( rawUri [ i ++ ] & 0xff ) : - 1 ; int ch2 = i < len ? ( rawUri [ i ++ ] & 0xff ) : - 1 ; int ch3 = i < len ? ( ra...
Scans the next character from URI adding it to the converter .
139,625
private static int toHex ( int ch ) { if ( ch >= '0' && ch <= '9' ) return ch - '0' ; else if ( ch >= 'a' && ch <= 'f' ) return ch - 'a' + 10 ; else if ( ch >= 'A' && ch <= 'F' ) return ch - 'A' + 10 ; else return - 1 ; }
Convert a character to hex
139,626
public static PathImpl getLocalWorkDir ( ClassLoader loader ) { PathImpl path = _localWorkDir . get ( loader ) ; if ( path != null ) return path ; path = getTmpWorkDir ( ) ; _localWorkDir . setGlobal ( path ) ; try { path . mkdirs ( ) ; } catch ( java . io . IOException e ) { } return path ; }
Returns the local work directory .
139,627
public static void setLocalWorkDir ( PathImpl path , ClassLoader loader ) { try { if ( path instanceof MergePath ) path = ( ( MergePath ) path ) . getWritePath ( ) ; if ( path instanceof MemoryPath ) { String pathName = path . getPath ( ) ; path = WorkDir . getTmpWorkDir ( ) . lookup ( "qa/" + pathName ) ; } } catch ( ...
Sets the work dir .
139,628
public < S , T > Convert < S , T > converter ( Class < S > source , Class < T > target ) { ConvertFrom < S > convertType = getOrCreate ( source ) ; return convertType . converter ( target ) ; }
Returns the converter for a given source type and target type .
139,629
private < S > ConvertManagerTypeImpl < S > getOrCreate ( Class < S > sourceType ) { ConvertManagerTypeImpl < S > convertType = ( ConvertManagerTypeImpl < S > ) _convertMap . get ( sourceType ) ; if ( convertType != null ) { return convertType ; } convertType = new ConvertManagerTypeImpl < > ( sourceType ) ; _convertMap...
Returns the ConvertManagerTypeImpl for a given source type .
139,630
protected int nextOffset ( ) { int opcode = getCode ( ) [ _offset ] & 0xff ; int length = OP_LEN [ opcode ] ; switch ( opcode ) { case GOTO : case GOTO_W : case RET : case IRETURN : case LRETURN : case FRETURN : case DRETURN : case ARETURN : case RETURN : case ATHROW : return - 1 ; case TABLESWITCH : { int arg = _offse...
Goes to the next opcode .
139,631
public boolean isBranch ( ) { switch ( getOpcode ( ) ) { case IFNULL : case IFNONNULL : case IFNE : case IFEQ : case IFLT : case IFGE : case IFGT : case IFLE : case IF_ICMPEQ : case IF_ICMPNE : case IF_ICMPLT : case IF_ICMPGE : case IF_ICMPGT : case IF_ICMPLE : case IF_ACMPEQ : case IF_ACMPNE : case JSR : case JSR_W : ...
Returns true for a simple branch i . e . a branch with a simple target .
139,632
public ConstantPoolEntry getConstantArg ( ) { switch ( getOpcode ( ) ) { case LDC : return _javaClass . getConstantPool ( ) . getEntry ( getByteArg ( ) ) ; case LDC_W : return _javaClass . getConstantPool ( ) . getEntry ( getShortArg ( ) ) ; default : throw new UnsupportedOperationException ( ) ; } }
Returns a constant pool item .
139,633
public int getShort ( int offset ) { int b0 = getCode ( ) [ offset + 0 ] & 0xff ; int b1 = getCode ( ) [ offset + 1 ] & 0xff ; return ( short ) ( ( b0 << 8 ) + b1 ) ; }
Reads a short value .
139,634
public int getInt ( int offset ) { byte [ ] code = getCode ( ) ; int b0 = code [ offset + 0 ] & 0xff ; int b1 = code [ offset + 1 ] & 0xff ; int b2 = code [ offset + 2 ] & 0xff ; int b3 = code [ offset + 3 ] & 0xff ; return ( b0 << 24 ) + ( b1 << 16 ) + ( b2 << 8 ) + b3 ; }
Reads an int argument .
139,635
private void analyze ( Analyzer analyzer , boolean allowFlow , IntArray pendingTargets , IntArray completedTargets ) throws Exception { pending : while ( pendingTargets . size ( ) > 0 ) { int pc = pendingTargets . pop ( ) ; if ( allowFlow ) { if ( completedTargets . contains ( pc ) ) continue pending ; completedTargets...
Analyzes the code for a basic block .
139,636
public static ServerBartender currentSelfServer ( ) { NetworkSystem clusterService = current ( ) ; if ( clusterService == null ) throw new IllegalStateException ( L . l ( "{0} is not available in this context" , NetworkSystem . class . getSimpleName ( ) ) ) ; return clusterService . selfServer ( ) ; }
Returns the current network service .
139,637
public ConnectionTcp findConnectionByThreadId ( long threadId ) { for ( PortTcp listener : getPorts ( ) ) { ConnectionTcp conn = listener . findConnectionByThreadId ( threadId ) ; if ( conn != null ) return conn ; } return null ; }
Finds the TcpConnection given the threadId
139,638
private void updateClusterRoot ( ) { ArrayList < ServerHeartbeat > serverList = new ArrayList < > ( ) ; for ( ServerHeartbeat server : _serverSelf . getCluster ( ) . getServers ( ) ) { serverList . add ( server ) ; } Collections . sort ( serverList , ( x , y ) -> compareClusterRoot ( x , y ) ) ; UpdatePodBuilder builde...
Compare and merge the cluster_root with an update .
139,639
void onJoinStart ( ) { ArrayList < UpdatePod > updatePods = new ArrayList < > ( ) ; updateClusterRoot ( ) ; updatePods . addAll ( _podUpdateMap . values ( ) ) ; for ( UpdatePod updatePod : updatePods ) { updatePod ( updatePod ) ; } }
Update the sequence for all init pods after the join has completed .
139,640
private int keyColumnStart ( ) { int offset = 0 ; for ( int i = 0 ; i < _columns . length ; i ++ ) { if ( offset == _keyStart ) { return i ; } offset += _columns [ i ] . length ( ) ; } throw new IllegalStateException ( ) ; }
First key column index .
139,641
private int keyColumnEnd ( ) { int offset = 0 ; for ( int i = 0 ; i < _columns . length ; i ++ ) { if ( offset == _keyStart + _keyLength ) { return i ; } offset += _columns [ i ] . length ( ) ; } if ( offset == _keyStart + _keyLength ) { return _columns . length ; } throw new IllegalStateException ( ) ; }
End key column index the index after the final key .
139,642
public void autoFill ( RowCursor cursor ) { for ( Column col : columns ( ) ) { col . autoFill ( cursor . buffer ( ) , 0 ) ; } }
autofill generated values
139,643
void readStream ( InputStream is , byte [ ] buffer , int offset , RowCursor cursor ) throws IOException { for ( Column column : columns ( ) ) { column . readStream ( is , buffer , offset , cursor ) ; } for ( Column column : blobs ( ) ) { column . readStreamBlob ( is , buffer , offset , cursor ) ; } }
Fills a cursor given an input stream
139,644
int readCheckpoint ( ReadStream is , byte [ ] blockBuffer , int rowOffset , int blobTail ) throws IOException { int rowLength = length ( ) ; if ( rowOffset < blobTail ) { return - 1 ; } for ( Column column : columns ( ) ) { blobTail = column . readCheckpoint ( is , blockBuffer , rowOffset , rowLength , blobTail ) ; } r...
Reads column - specific data like blobs from the checkpoint .
139,645
public void validate ( byte [ ] buffer , int rowOffset , int rowHead , int blobTail ) { for ( Column column : columns ( ) ) { column . validate ( buffer , rowOffset , rowHead , blobTail ) ; } }
Validates the row checking for corruption .
139,646
static void incrementKey ( byte [ ] key ) { for ( int i = key . length - 1 ; i >= 0 ; i -- ) { int v = key [ i ] & 0xff ; if ( v < 0xff ) { key [ i ] = ( byte ) ( v + 1 ) ; return ; } key [ i ] = 0 ; } }
Increment a key .
139,647
static void decrementKey ( byte [ ] key ) { for ( int i = key . length - 1 ; i >= 0 ; i -- ) { int v = key [ i ] & 0xff ; if ( v > 0 ) { key [ i ] = ( byte ) ( v - 1 ) ; return ; } key [ i ] = ( byte ) 0xff ; } }
Decrement a key .
139,648
public void setThreadMax ( int max ) { if ( max == _threadMax ) { return ; } if ( max <= 0 ) { max = DEFAULT_THREAD_MAX ; } if ( max < _idleMin ) throw new ConfigException ( L . l ( "IdleMin ({0}) must be less than ThreadMax ({1})" , _idleMin , max ) ) ; if ( max < 1 ) throw new ConfigException ( L . l ( "ThreadMax ({0...
Sets the maximum number of threads .
139,649
public void setIdleMax ( int max ) { if ( max == _idleMax ) { return ; } if ( max <= 0 ) { max = DEFAULT_IDLE_MAX ; } if ( _threadMax < max ) throw new ConfigException ( L . l ( "IdleMax ({0}) must be less than ThreadMax ({1})" , max , _threadMax ) ) ; if ( max <= 0 ) throw new ConfigException ( L . l ( "IdleMax ({0}) ...
Sets the maximum number of idle threads .
139,650
public boolean isIdleExpire ( ) { if ( ! _lifecycle . isActive ( ) ) return true ; long now = currentTimeActual ( ) ; long idleExpire = _threadIdleExpireTime . get ( ) ; int idleCount = _idleCount . get ( ) ; if ( _idleMin < idleCount ) { long nextIdleExpire = now + _idleTimeout ; if ( _idleMax < idleCount && _idleMin ...
Returns true if the thread should expire instead of going to the idle state .
139,651
public static ReadStreamOld open ( String string ) { VfsStringReader ss = new VfsStringReader ( string ) ; ReadStreamOld rs = new ReadStreamOld ( ss ) ; try { rs . setEncoding ( "UTF-8" ) ; } catch ( Exception e ) { } return rs ; }
Creates a new ReadStream reading bytes from the given string .
139,652
public static void clearFreeLists ( ) { while ( _freeStandard . allocate ( ) != null ) { } while ( _freeSmall . allocate ( ) != null ) { } while ( _freeLarge . allocate ( ) != null ) { } }
Free data for OOM .
139,653
@ InService ( PageServiceImpl . class ) void writeImpl ( TableKelp table , PageServiceImpl pageServiceImpl , TableWriterService readWrite , SegmentStream sOut , long oldSequence , int saveLength , int saveTail ) { Objects . requireNonNull ( sOut ) ; if ( saveLength <= 0 || oldSequence != sOut . getSequence ( ) || _stub...
Sends a write - request to the sequence writer for the page .
139,654
@ InService ( TableWriterService . class ) public Page writeCheckpoint ( TableKelp table , OutSegment sOut , long oldSequence , int saveLength , int saveTail , int saveSequence ) throws IOException { BlockLeaf [ ] blocks = _blocks ; int size = BLOCK_SIZE * blocks . length ; WriteStream os = sOut . out ( ) ; int availab...
Callback from the writer and gc to write the page .
139,655
private PageLeafImpl compact ( TableKelp table ) { long now = CurrentTime . currentTime ( ) / 1000 ; Set < PageLeafEntry > entries = fillEntries ( table ) ; ArrayList < BlockLeaf > blocks = new ArrayList < > ( ) ; BlockLeaf block = new BlockLeaf ( getId ( ) ) ; blocks . add ( block ) ; Row row = table . row ( ) ; for (...
Compacts the leaf by rebuilding the delta entries and discarding obsolete removed entries .
139,656
@ InService ( SegmentServiceImpl . class ) private Type writeCheckpointFull ( TableKelp table , OutputStream os , int saveTail ) throws IOException { os . write ( getMinKey ( ) ) ; os . write ( getMaxKey ( ) ) ; BlockLeaf [ ] blocks = _blocks ; int index = blocks . length - ( saveTail / BLOCK_SIZE ) ; int rowFirst = sa...
Writes the page to the output stream as a full checkpoint .
139,657
@ InService ( PageServiceImpl . class ) static PageLeafImpl readCheckpointFull ( TableKelp table , PageServiceImpl pageActor , InputStream is , int pid , int nextPid , long sequence ) throws IOException { byte [ ] minKey = new byte [ table . getKeyLength ( ) ] ; byte [ ] maxKey = new byte [ table . getKeyLength ( ) ] ;...
Reads a full checkpoint entry into the page .
139,658
void readCheckpointDelta ( TableKelp table , PageServiceImpl pageActor , ReadStream is , int length ) throws IOException { Row row = table . row ( ) ; int removeLength = row . removeLength ( ) ; int rowLength = row . length ( ) ; BlockLeaf block = _blocks [ 0 ] ; long endPosition = is . position ( ) + length ; int rowH...
Reads a delta entry from the checkpoint .
139,659
void validate ( TableKelp table ) { if ( ! table . isValidate ( ) ) { return ; } Row row = table . row ( ) ; for ( BlockLeaf block : _blocks ) { block . validateBlock ( row ) ; } }
Validates the leaf blocks
139,660
void addDelta ( TableKelp db , int offset , int length ) { if ( _delta == null ) { _delta = new int [ 2 * db . getDeltaMax ( ) ] ; } _delta [ _deltaTail ++ ] = offset ; _delta [ _deltaTail ++ ] = length ; }
Adds a delta record to the leaf stub .
139,661
public String [ ] fetchAndPlan ( String aam ) throws ParsingException , IOException { String offerings = this . fetchOfferings ( ) ; return this . plan ( aam , offerings ) ; }
Fetches offerings from the Discoverer and makes plans
139,662
public String [ ] plan ( String aam , String uniqueOfferingsTosca ) throws ParsingException , IOException { log . info ( "Planning for aam: \n" + aam ) ; log . info ( "Getting Offeing Step: Start" ) ; Map < String , Pair < NodeTemplate , String > > offerings = parseOfferings ( uniqueOfferingsTosca ) ; log . info ( "Get...
Makes plans starting from the AAM and a String containing the TOSCA of the offerings available to generate the plans
139,663
public String [ ] fetchAndRePlan ( String aam , List < String > modulesToFilter ) throws ParsingException , IOException { String offerings = this . fetchOfferings ( ) ; return this . rePlan ( aam , offerings , modulesToFilter ) ; }
Fetches offerings from the Discoverer and replan
139,664
private String fetchOfferings ( ) { DiscovererFetchallResult allOfferings = null ; try { String discovererOutput = discovererClient . getRequest ( "fetch_all" , Collections . EMPTY_LIST ) ; ObjectMapper mapper = new ObjectMapper ( ) ; allOfferings = mapper . readValue ( discovererOutput , DiscovererFetchallResult . cla...
Fetches the list offerings from the Discoverer
139,665
ModuleMarshal marshal ( Class < ? > sourceType , Class < ? > targetType , Class < ? > declaredTargetType ) { ImportKey key = new ImportKey ( sourceType , targetType ) ; ModuleMarshal marshal = _marshalMap . get ( key ) ; if ( marshal != null ) { return marshal ; } marshal = marshalImpl ( sourceType , targetType , decla...
Returns the marshal to convert from the sourceType to the targetType .
139,666
public static int getBiggestPrime ( long value ) { for ( int i = PRIMES . length - 1 ; i >= 0 ; i -- ) { if ( PRIMES [ i ] <= value ) { return PRIMES [ i ] ; } } return 2 ; }
Returns the largest prime less than the given bits .
139,667
public void setCertificateChainFile ( Path certificateChainFile ) { try { _certificateChainFile = certificateChainFile . toRealPath ( ) . toString ( ) ; } catch ( IOException e ) { throw new RuntimeException ( e ) ; } }
Sets the certificateChainFile .
139,668
public void setCACertificatePath ( Path caCertificatePath ) { try { _caCertificatePath = caCertificatePath . toRealPath ( ) . toString ( ) ; } catch ( IOException e ) { throw new RuntimeException ( e ) ; } }
Sets the caCertificatePath .
139,669
public void setCACertificateFile ( Path caCertificateFile ) { try { _caCertificateFile = caCertificateFile . toRealPath ( ) . toString ( ) ; } catch ( IOException e ) { throw new RuntimeException ( e ) ; } }
Sets the caCertificateFile .
139,670
public void setCARevocationPath ( Path caRevocationPath ) { try { _caRevocationPath = caRevocationPath . toRealPath ( ) . toString ( ) ; } catch ( IOException e ) { throw new RuntimeException ( e ) ; } }
Sets the caRevocationPath .
139,671
public void setCARevocationFile ( Path caRevocationFile ) { try { _caRevocationFile = caRevocationFile . toRealPath ( ) . toString ( ) ; } catch ( IOException e ) { throw new RuntimeException ( e ) ; } }
Sets the caRevocationFile .
139,672
public void addEngineCommand ( String command ) { if ( command == null || command . length ( ) == 0 ) { return ; } int p = command . indexOf ( ':' ) ; String arg = "" ; if ( p > 0 ) { arg = command . substring ( p + 1 ) ; command = command . substring ( 0 , p ) ; } StringBuilder sb = new StringBuilder ( ) ; sb . append...
Sets the engine - commands
139,673
public void nextProtocols ( String ... protocols ) { if ( protocols == null || protocols . length == 0 ) { _nextProtocols = null ; return ; } StringBuilder sb = new StringBuilder ( ) ; for ( String protocol : protocols ) { if ( protocol == null || "" . equals ( protocol ) ) { continue ; } sb . append ( ( char ) protoco...
Sets the next protocols .
139,674
public void setVerifyClient ( String verifyClient ) throws ConfigException { if ( ! "optional_no_ca" . equals ( verifyClient ) && ! "optional-no-ca" . equals ( verifyClient ) && ! "optional" . equals ( verifyClient ) && ! "require" . equals ( verifyClient ) && ! "none" . equals ( verifyClient ) ) throw new ConfigExcept...
Sets the verifyClient .
139,675
public synchronized ByteBuffer allocateHeaderBuffer ( ) { Stack < ByteBuffer > pool = pools . get ( HEADER_SIZE ) ; if ( pool . isEmpty ( ) ) { return ByteBuffer . allocate ( HEADER_SIZE ) ; } else { return pool . pop ( ) ; } }
Returns a buffer that has the size of the Bitmessage network message header 24 bytes .
139,676
public boolean compileIsModified ( ) { if ( _compileIsModified ) return true ; CompileThread compileThread = new CompileThread ( ) ; ThreadPool . current ( ) . start ( compileThread ) ; try { synchronized ( compileThread ) { if ( ! compileThread . isDone ( ) ) compileThread . wait ( 5000 ) ; } if ( _compileIsModified )...
Returns true if the compile doesn t avoid the dependency .
139,677
ServiceRefAmp lookup ( String path , PodRef podCaller ) { if ( _linkServiceRef . address ( ) . startsWith ( "local:" ) ) { int p = path . indexOf ( '/' , 1 ) ; if ( p > 0 ) { return ( ServiceRefAmp ) _rampManager . service ( path . substring ( p ) ) ; } else { return ( ServiceRefAmp ) _rampManager . service ( path ) ; ...
Lookup returns a ServiceRef for the foreign path and calling pod .
139,678
public static StdoutStream create ( ) { if ( _stdout == null ) { _stdout = new StdoutStream ( ) ; ConstPath path = new ConstPath ( null , _stdout ) ; path . setScheme ( "stdout" ) ; } return _stdout ; }
Returns the StdoutStream singleton
139,679
public void write ( byte [ ] buf , int offset , int length , boolean isEnd ) throws IOException { System . out . write ( buf , offset , length ) ; System . out . flush ( ) ; }
Writes the data to the System . out .
139,680
public static ThreadDump create ( ) { ThreadDump threadDump = _threadDumpRef . get ( ) ; if ( threadDump == null ) { threadDump = new ThreadDumpPro ( ) ; _threadDumpRef . compareAndSet ( null , threadDump ) ; threadDump = _threadDumpRef . get ( ) ; } return threadDump ; }
Returns the singleton instance creating if necessary . An instance of com . caucho . server . admin . ProThreadDump will be returned if available and licensed . ProThreadDump includes the URI of the request the thread is processing if applicable .
139,681
public String getThreadDump ( int depth , boolean onlyActive ) { ThreadMXBean threadBean = ManagementFactory . getThreadMXBean ( ) ; long [ ] ids = threadBean . getAllThreadIds ( ) ; ThreadInfo [ ] info = threadBean . getThreadInfo ( ids , depth ) ; StringBuilder sb = new StringBuilder ( ) ; sb . append ( "Thread Dump ...
Returns dump of threads . Optionally uses cached dump .
139,682
private boolean readFlow ( ReadStream is , int length , int streamId ) throws IOException { if ( length != 4 ) { error ( "Invalid window update length {0}" , length ) ; return false ; } int credit = BitsUtil . readInt ( is ) ; if ( streamId == 0 ) { _conn . channelZero ( ) . addSendCredit ( credit ) ; return true ; } C...
window - update
139,683
private boolean readGoAway ( ReadStream is , int length ) throws IOException { int lastStream = BitsUtil . readInt ( is ) ; int errorCode = BitsUtil . readInt ( is ) ; is . skip ( length - 8 ) ; _isGoAway = true ; _conn . onReadGoAway ( ) ; if ( onCloseStream ( ) <= 0 ) { _inHandler . onGoAway ( ) ; } return true ; }
go - away
139,684
private boolean readMetaHeader ( ) throws IOException { try ( ReadStream is = openRead ( 0 , META_SEGMENT_SIZE ) ) { int crc = 17 ; long magic = BitsUtil . readLong ( is ) ; if ( magic != KELP_MAGIC ) { System . out . println ( "WRONG_MAGIC: " + magic ) ; return false ; } crc = Crc32Caucho . generate ( crc , magic ) ; ...
Reads the initial metadata for the store file as a whole .
139,685
private boolean readMetaData ( ) throws IOException { SegmentExtent10 segment = _metaSegment ; try ( ReadStream is = openRead ( segment . address ( ) , segment . length ( ) ) ) { is . position ( META_OFFSET ) ; while ( readMetaEntry ( is ) ) { } } return true ; }
Reads the metadata entries for the tables and the segments .
139,686
private boolean readMetaTable ( ReadStream is , int crc ) throws IOException { byte [ ] key = new byte [ TABLE_KEY_SIZE ] ; is . read ( key , 0 , key . length ) ; crc = Crc32Caucho . generate ( crc , key ) ; int rowLength = BitsUtil . readInt16 ( is ) ; crc = Crc32Caucho . generateInt16 ( crc , rowLength ) ; int keyOff...
Reads metadata for a table .
139,687
private void readSegments ( ) throws IOException { for ( SegmentExtent10 extent : _segmentExtents ) { try ( ReadStream is = openRead ( extent . address ( ) , extent . length ( ) ) ) { is . skip ( extent . length ( ) - BLOCK_SIZE ) ; long sequence = BitsUtil . readLong ( is ) ; byte [ ] tableKey = new byte [ TABLE_KEY_S...
Reads the segment metadata the sequence and table key .
139,688
private void upgradeDatabase ( KelpUpgrade upgradeKelp ) throws IOException { Collections . sort ( _tableList , ( x , y ) -> x . row ( ) . name ( ) . compareTo ( y . row ( ) . name ( ) ) ) ; for ( TableEntry10 table : _tableList ) { TableUpgrade upgradeTable = upgradeKelp . table ( table . key ( ) , table . row ( ) ) ;...
Upgrade the store
139,689
private void upgradeTable ( TableEntry10 table , TableUpgrade upgradeTable ) throws IOException { _pageMap = new TreeMap < > ( ) ; readTableIndex ( table ) ; for ( Page10 page : _pageMap . values ( ) ) { upgradeLeaf ( table , upgradeTable , page ) ; List < Delta10 > deltas = page . deltas ( ) ; if ( deltas != null ) { ...
Upgrade rows from a table .
139,690
private void readTableIndex ( TableEntry10 table ) throws IOException { for ( Segment10 segment : tableSegments ( table ) ) { try ( ReadStream is = openRead ( segment . address ( ) , segment . length ( ) ) ) { readSegmentIndex ( is , segment ) ; } } }
Read all page metadata for a table .
139,691
private void readSegmentIndex ( ReadStream is , Segment10 segment ) throws IOException { int address = segment . length ( ) - BLOCK_SIZE ; TempBuffer tBuf = TempBuffer . create ( ) ; byte [ ] buffer = tBuf . buffer ( ) ; is . position ( address ) ; is . read ( buffer , 0 , BLOCK_SIZE ) ; int tail = BitsUtil . readInt16...
Read page index from a segment .
139,692
private void addLeaf ( Segment10 segment , int pid , int nextPid , int address , int length ) { Page10 page = _pageMap . get ( pid ) ; if ( page != null && page . sequence ( ) < segment . sequence ( ) ) { return ; } page = new Page10 ( PageType10 . LEAF , segment , pid , nextPid , address , length ) ; _pageMap . put ( ...
Adds a new leaf entry to the page list .
139,693
private void addLeafDelta ( Segment10 segment , int pid , int nextPid , int address , int length ) { Page10 page = _pageMap . get ( pid ) ; if ( page != null && page . sequence ( ) < segment . sequence ( ) ) { return ; } if ( page != null ) { page . addDelta ( address , length ) ; } }
Adds a new leaf delta to the page list .
139,694
private ArrayList < Segment10 > tableSegments ( TableEntry10 table ) { ArrayList < Segment10 > tableSegments = new ArrayList < > ( ) ; for ( Segment10 segment : _segments ) { if ( Arrays . equals ( segment . key ( ) , table . key ( ) ) ) { tableSegments . add ( segment ) ; } } Collections . sort ( tableSegments , ( x ,...
Returns segments for a table in reverse sequence order .
139,695
private void upgradeLeaf ( TableEntry10 table , TableUpgrade upgradeTable , Page10 page ) throws IOException { try ( ReadStream is = openRead ( page . segment ( ) . address ( ) , page . segment ( ) . length ( ) ) ) { is . position ( page . address ( ) ) ; byte [ ] minKey = new byte [ table . keyLength ( ) ] ; byte [ ] ...
Upgrade a table page .
139,696
private void upgradeLeafBlock ( ReadStream is , TableEntry10 table , TableUpgrade upgradeTable , Page10 page ) throws IOException { TempBuffer tBuf = TempBuffer . create ( ) ; byte [ ] buffer = tBuf . buffer ( ) ; int blobLen = BitsUtil . readInt16 ( is ) ; is . readAll ( buffer , 0 , blobLen ) ; int rowDataLen = BitsU...
Reads data for a leaf .
139,697
private void upgradeDelta ( TableEntry10 table , TableUpgrade upgradeTable , Page10 page , Delta10 delta ) throws IOException { try ( ReadStream is = openRead ( page . segment ( ) . address ( ) , page . segment ( ) . length ( ) ) ) { is . position ( delta . address ( ) ) ; long tail = delta . address ( ) + delta . leng...
Upgrade a table leaf delta .
139,698
private void rowInsert ( RowUpgrade row , TableUpgrade upgradeTable , byte [ ] buffer , int offset ) { Cursor10 cursor = new Cursor10 ( row , buffer , offset ) ; upgradeTable . row ( cursor ) ; }
Insert a row .
139,699
private ReadStream openRead ( long address , int size ) { InStore inStore = _store . openRead ( address , size ) ; InStoreStream is = new InStoreStream ( inStore , address , address + size ) ; return new ReadStream ( new VfsStream ( is ) ) ; }
Open a read stream to a segment .