verify that this client ' s host info was included in the map returned in the assignment , and trigger a rebalance if not this may be necessary when using static membership , as a rejoining client will be handed back its original assignment to avoid an unnecessary rebalance if the client ' s endpoint has changed , we need to force a rebalance for the other members in the group to get the updated host info for this client

private boolean verify host info ( final set < host info > group host info ) { if ( user end point ! = null & & ! group host info is empty ( ) ) { final host info my host info = host info build from endpoint ( user end point ) ; return group host info contains ( my host info ) ; } else { return true ; } }


set the source path to the specified storage policy

public void satisfy storage policy ( final path path ) throws i o exception { dfs satisfy storage policy ( path ) ; }


number of non - fatal errors detected while writing the i node section and i node directory section sections

public long get num image errors ( ) { return num image errors ; }


test writing to a file and reading its value

public void test read file ( ) throws exception { byte [ ] data = " yaks " get bytes ( ) ; path file = touch ( local fs , name get method name ( ) to lower case ( ) , data ) ; f s data input stream is = null ; try { is = sftp fs open ( file ) ; byte [ ] b = new byte [ data length ] ; is read ( b ) ; assert array equals ( data , b ) ; } finally { if ( is ! = null ) { is close ( ) ; } } assert true ( sftp fs delete ( file , false ) ) ; assert that ( ( ( s f t p file system ) sftp fs ) get connection pool ( ) get live conn count ( ) , is ( 1 ) ) ; }


public builder set diff threshold ( int value ) { this diff threshold = value ; return this ; }


gets the total length of the data created when this data type is placed at the indicated address in memory

public int get length ( memory memory , address address , byte [ ] bytes ) { program program = memory get program ( ) ; / / align this structure based on pointer size so the pointers have proper alignment int pointer size = is 6 4 bit ( program ) ? 8 : 4 ; if ( address get offset ( ) % pointer size ! = 0 ) { return 0 ; } / / check that we have enough bytes for the expected pointers and at least 1 byte for the / / name string if ( bytes length < ( pointer size * 2 ) + 1 ) { return 0 ; } / / first component should be direct reference ( this is actually a pointer to the class functions ) address vf table address = get absolute address ( program , address ) ; if ( vf table address = = null | | ! memory contains ( vf table address ) ) { return 0 ; } int name offset = get name offset ( program ) ; / / next component should be zeros ( this is actually a pointer to the class data if any ) for ( int i = get spare data offset ( program ) ; i < name offset ; i + + ) { if ( bytes [ i ] ! = 0 ) { return 0 ; } } string vf table name = get v f table name ( new memory buffer impl ( memory , address ) ) ; if ( vf table name = = null ) { return 0 ; } int name length = vf table name length ( ) ; if ( name length = = 0 ) { return 0 ; } int length without align padding = name offset + name length ; int mod = length without align padding % pointer size ; int pad size = ( mod = = 0 ) ? 0 : ( pointer size - mod ) ; int padded length = length without align padding + pad size ; if ( padded length > bytes length ) { return 0 ; } if ( contains whitespace ( vf table name ) ) { return 0 ; } return padded length ; }


public void id test ( ) { / / todo : test id }


returns the newly created namespace or null if one was not created

public namespace get namespace ( ) { return leaf namespace ; }


turns a path ( relative or otherwise ) into an obs key , adding a trailing " " if the path is not the root and does not already have a " " at the end

static string maybe add trailing slash ( final string key ) { if ( ! string utils is empty ( key ) & & ! key ends with ( " / " ) ) { return key + ' / ' ; } else { return key ; } }


generate a big integer value by invoking buf get bytes at the specified offset

public big integer get big integer ( mem buffer buf , int offset , int size , boolean signed ) throws memory access exception ;


the analysis function used e g count , rare , min etc

public detector function get function ( ) { return function ; }


tries to determine what jar file a given class was loaded from the location is an opaque string suitable only for comparison to others similar to { @ link which # jar file ( class ) } but potentially faster , and more tolerant of unknown url formats

private static @ check for null string code source ( @ non null class < ? > c ) { code source cs = c get protection domain ( ) get code source ( ) ; if ( cs = = null ) { return null ; } url loc = cs get location ( ) ; if ( loc = = null ) { return null ; } string r = loc to string ( ) ; if ( r ends with ( " class " ) ) { / / jenkins - 49147 : tomcat bug now do the more expensive check … string suffix = c get name ( ) replace ( ' ' , ' / ' ) + " class " ; if ( r ends with ( suffix ) ) { r = r substring ( 0 , r length ( ) - suffix length ( ) ) ; } } if ( r starts with ( " jar : file : / " ) & & r ends with ( " jar ! / " ) ) { / / jenkins - 49543 : also an old behavior of tomcat legal enough , but unexpected by is location whitelisted r = r substring ( 4 , r length ( ) - 2 ) ; } return r ; }


merge the given array into the given collection

public static < e > void merge array into collection ( @ nullable object array , collection < e > collection ) { object [ ] arr = object utils to object array ( array ) ; for ( object elem : arr ) { collection add ( ( e ) elem ) ; } }


compute a vertex ' s successors < p > the default implementation compute this from the out - edges

public default collection < v > get successors ( v v ) { set < v > result = new linked hash set < > ( ) ; for ( e edge : get out edges ( v ) ) { result add ( edge get end ( ) ) ; } return result ; }


submits a request for prefetching to the encoded cache with a default priority beware that if your network fetcher doesn ' t support priorities prefetch requests may slow down images which are immediately required on screen

public data source < void > prefetch to encoded cache ( image request image request , object caller context ) { return prefetch to encoded cache ( image request , caller context , priority medium ) ; }


returns the number of threads for the query server nio event loop these threads only process network events and dispatch query requests to the query threads

public int num state server threads ( ) { return num server threads ; }


bind the parameters of the given request to this binder ' s target , also binding multipart files in case of a multipart request this call can create field errors , representing basic binding errors like a required field ( code " required " ) , or type mismatch between value and bean property ( code " type mismatch " ) multipart files are bound via their parameter name , just like normal http parameters : i e " uploaded file " to an " uploaded file " bean property , invoking a " set uploaded file " setter method the type of the target property for a multipart file can be multipart file , byte [ ] , or string the latter two receive the contents of the uploaded file ; all metadata like original file name , content type , etc are lost in those cases

public void bind ( servlet request request ) { mutable property values mpvs = new servlet request parameter property values ( request ) ; multipart request multipart request = web utils get native request ( request , multipart request class ) ; if ( multipart request ! = null ) { bind multipart ( multipart request get multi file map ( ) , mpvs ) ; } else if ( string utils starts with ignore case ( request get content type ( ) , " multipart / " ) ) { http servlet request http servlet request = web utils get native request ( request , http servlet request class ) ; if ( http servlet request ! = null ) { standard servlet part utils bind parts ( http servlet request , mpvs , is bind empty multipart files ( ) ) ; } } add bind values ( mpvs , request ) ; do bind ( mpvs ) ; }


called when the connectivity state changes

void on connectivity changed ( boolean is connected ) ;


get a filename for a temp file the generated file is deleted

protected file temp audit file ( ) throws i o exception { final file audit = file create temp file ( " audit " , " txt " ) ; audit delete ( ) ; return audit ; }


check whether the requested resource has been modified given the supplied { @ code e tag } ( entity tag ) and last - modified timestamp , as determined by the application if not modified , this method returns a response with corresponding status code and headers , otherwise an empty result typical usage : < pre class = " code " > public server response my handle method ( server request request ) { instant last modified = application - specific calculation string e tag = application - specific calculation return request check not modified ( last modified , e tag ) or else get ( ( ) - > { further request processing , actually building content return server response ok ( ) body ( ) ; } ) ; } this method works with conditional gethead requests , but also with conditional postputdelete requests

default optional < server response > check not modified ( instant last modified , string etag ) { assert not null ( last modified , " last modified must not be null " ) ; assert not null ( etag , " etag must not be null " ) ; return default server request check not modified ( servlet request ( ) , last modified , etag ) ; } / / static methods


protected static i person attribute dao get attribute repository ( ) { val repositories = application context provider get attribute repository ( ) ; return repositories or else ( null ) ; }


check that the manager won ' t try to upgrade closed indices

public void test manager skips closed indices ( ) { system indices system indices = new system indices ( map of ( " my index " , list of ( descriptor ) ) ) ; system index manager manager = new system index manager ( system indices , client ) ; final cluster state builder cluster state builder = create cluster state ( index metadata state close ) ; assert that ( manager get upgrade status ( cluster state builder build ( ) , descriptor ) , equal to ( upgrade status closed ) ) ; }


we have two running opportunistic containers , neither of which is out of limit we should kill the later one

public void test no opportunistic container over limit o o m ( ) throws exception { concurrent hash map < container id , container > containers = new concurrent hash map < > ( ) ; container c 1 = create container ( 1 , false , 1l , true ) ; containers put ( c 1 get container id ( ) , c 1 ) ; container c 2 = create container ( 2 , false , 2l , true ) ; containers put ( c 2 get container id ( ) , c 2 ) ; container executor ex = create container executor ( containers ) ; context context = mock ( context class ) ; when ( context get containers ( ) ) then return ( containers ) ; when ( context get container executor ( ) ) then return ( ex ) ; c groups handler c groups handler = mock ( c groups handler class ) ; when ( c groups handler get c group param ( c groups handler c group controller memory , " " , cgroup param memory oom control ) ) then return ( " under oom 1 " ) then return ( " under oom 0 " ) ; when ( c groups handler get c group param ( c groups handler c group controller memory , c 1 get container id ( ) to string ( ) , cgroup procs file ) ) then return ( " 1234 " ) then return ( " " ) ; when ( c groups handler get c group param ( c groups handler c group controller memory , c 1 get container id ( ) to string ( ) , cgroup param memory usage bytes ) ) then return ( get m b ( 9 ) ) ; when ( c groups handler get c group param ( c groups handler c group controller memory , c 1 get container id ( ) to string ( ) , cgroup param memory memsw usage bytes ) ) then return ( get m b ( 9 ) ) ; when ( c groups handler get c group param ( c groups handler c group controller memory , c 2 get container id ( ) to string ( ) , cgroup procs file ) ) then return ( " 1235 " ) then return ( " " ) ; when ( c groups handler get c group param ( c groups handler c group controller memory , c 2 get container id ( ) to string ( ) , cgroup param memory usage bytes ) ) then return ( get m b ( 9 ) ) ; when ( c groups handler get c group param ( c groups handler c group controller memory , c 2 get container id ( ) to string ( ) , cgroup param memory memsw usage bytes ) ) then return ( get m b ( 9 ) ) ; default o o m handler handler = new default o o m handler ( context , false ) { @ override protected c groups handler get c groups handler ( ) { return c groups handler ; } } ; handler run ( ) ; verify ( ex , times ( 1 ) ) signal container ( new container signal context builder ( ) set pid ( " 1235 " ) set container ( c 2 ) set signal ( container executor signal kill ) build ( ) ) ; verify ( ex , times ( 1 ) ) signal container ( any ( ) ) ; }


bind to the argument list , including validating the cli

protected void service start ( ) throws exception { if ( get store ( ) = = null ) { list < string > arg = get argument list ( 2 , 2 , usage message ) ; bind from c l i ( arg get ( 0 ) ) ; dest path = arg get ( 1 ) ; } }


variant of { @ link # encode ( string , charset ) } with a string charset

public static string encode ( string source , string encoding ) { return encode ( source , encoding , hierarchical uri components type uri ) ; }


public boolean is consumer side ( ) { return get url ( ) get parameter ( side key , provider side ) equals ( consumer side ) ; }


triggered on successful validation events extensions are to use this as hook to plug in behavior

protected void on successful validation ( final string service ticket id , final assertion assertion ) { }


convert the given object to string with each line indented by 4 spaces ( except the first line )

private string to indented string ( object o ) { if ( o = = null ) { return " null " ; } return o to string ( ) replace ( " \ n " , " \ n " ) ; }


public optional < duration > get wall execution time ( ) { return wall execution time ; }


boolean dispatch rewind ( player player ) ;


get a delegation token for the user from the job tracker

public token < delegation token identifier > get delegation token ( text renewer ) throws i o exception , interrupted exception { / / client has already set the service return client get delegation token ( renewer ) ; }


parses the given demangled string and creates a { @ link demangled object }

public demangled object parse ( string mangled , string demangled ) throws demangler parse exception { this mangled source = mangled ; this demangled source = demangled ; demangled object builder builder = get specialized builder ( demangled ) ; if ( builder ! = null ) { return builder build ( ) ; } return parse function or variable ( demangled ) ; }


parse build statement dependencies part : output 1 k [ | implicit output 1 k ] : rule input 1 k [ | implicit input 1 k ] [ | | order only input 1 k ]

private map < input output kind , list < ninja variable value > > parse target dependencies part ( ninja target builder builder ) throws generic parsing exception { map < input output kind , list < ninja variable value > > path values map = maps new hash map ( ) ; boolean rule name parsed = false ; ninja target parsing part parsing part = ninja target parsing part outputs ; while ( lexer has next token ( ) & & ! ninja target parsing part variables equals ( parsing part ) ) { if ( ninja target parsing part rule name equals ( parsing part ) ) { rule name parsed = true ; builder set rule name ( as string ( parse expected ( ninja token identifier ) ) ) ; parsing part = ninja target parsing part inputs ; continue ; } list < ninja variable value > paths = parse paths ( ) ; if ( paths is empty ( ) & & ! ninja target parsing part inputs equals ( parsing part ) ) { throw new generic parsing exception ( " expected paths sequence " ) ; } if ( ! paths is empty ( ) ) { path values map put ( preconditions check not null ( parsing part get input output kind ( ) ) , paths ) ; } if ( ! lexer has next token ( ) ) { if ( parsing part is transition required ( ) ) { throw new generic parsing exception ( " unexpected end of target " ) ; } break ; } ninja token lexical separator = lexer next token ( ) ; parsing part = preconditions check not null ( target parts transitions map get ( parsing part ) ) get ( lexical separator ) ; if ( parsing part = = null ) { throw new generic parsing exception ( " unexpected token : " + lexical separator ) ; } } if ( ! rule name parsed ) { throw new generic parsing exception ( " expected rule name " ) ; } preconditions check state ( ! lexer has next token ( ) | | ninja target parsing part variables equals ( parsing part ) ) ; return path values map ; }


returns the name of the f fmpeg decoder that could be used to decode the format , or { @ code null } if it ' s unsupported

/ * package * / static string get codec name ( string mime type ) { switch ( mime type ) { case mime types audio aac : return " aac " ; case mime types audio mpeg : case mime types audio mpeg l1 : case mime types audio mpeg l2 : return " mp 3 " ; case mime types audio ac3 : return " ac 3 " ; case mime types audio e ac3 : case mime types audio e ac3 joc : return " eac 3 " ; case mime types audio truehd : return " truehd " ; case mime types audio dts : case mime types audio dts hd : return " dca " ; case mime types audio vorbis : return " vorbis " ; case mime types audio opus : return " opus " ; case mime types audio amr nb : return " amrnb " ; case mime types audio amr wb : return " amrwb " ; case mime types audio flac : return " flac " ; case mime types audio alac : return " alac " ; case mime types audio mlaw : return " pcm mulaw " ; case mime types audio alaw : return " pcm alaw " ; case mime types video h264 : return " h 2 6 4 " ; case mime types video h265 : return " hevc " ; default : return null ; } }


returns iterator with the defined name outputs

public iterator < string > get named outputs ( ) { return named outputs iterator ( ) ; }


applies this function to the given argument


protected list < string > resolve event from http request ( final http servlet request request ) { val mfa request header = cas properties get authn ( ) get mfa ( ) get request header ( ) ; val headers = request get headers ( mfa request header ) ; if ( headers ! = null & & headers has more elements ( ) ) { logger debug ( " received request header [ { } ] as [ { } ] " , mfa request header , headers ) ; return collections list ( headers ) ; } val mfa request parameter = cas properties get authn ( ) get mfa ( ) get request parameter ( ) ; val params = request get parameter values ( mfa request parameter ) ; if ( params ! = null & & params length > 0 ) { logger debug ( " received request parameter [ { } ] as [ { } ] " , mfa request parameter , params ) ; return arrays stream ( params ) collect ( collectors to list ( ) ) ; } val attribute name = cas properties get authn ( ) get mfa ( ) get session attribute ( ) ; val session = request get session ( false ) ; var attribute value = optional of nullable ( session ) map ( http session - > http session get attribute ( attribute name ) ) or else ( null ) ; if ( attribute value = = null ) { logger trace ( " no value could be found for session attribute [ { } ] checking request attributes " , attribute name ) ; attribute value = request get attribute ( attribute name ) ; } if ( attribute value = = null ) { logger trace ( " no value could be found for [ { } ] " , attribute name ) ; return null ; } val values = collection utils to collection ( attribute value ) ; logger debug ( " found values [ { } ] mapped to attribute name [ { } ] " , values , attribute name ) ; return values stream ( ) map ( object : : to string ) collect ( collectors to list ( ) ) ; }


if the id has been memoized , returns its corresponding object otherwise returns null

private object lookup ( int id ) { return table get ( id ) ; }


handles the parallel case of spawning the instances will create child executions accordingly for every instance needed

protected int create instances ( delegate execution execution ) { int nr of instances = resolve nr of instances ( execution ) ; if ( nr of instances < 0 ) { throw new activiti illegal argument exception ( " invalid number of instances : must be non - negative integer value " + " , but was " + nr of instances ) ; } execution set multi instance root ( true ) ; set loop variable ( execution , number of instances , nr of instances ) ; set loop variable ( execution , number of completed instances , 0 ) ; set loop variable ( execution , number of active instances , nr of instances ) ; list < delegate execution > concurrent executions = new array list < delegate execution > ( ) ; for ( int loop counter = 0 ; loop counter < nr of instances ; loop counter + + ) { delegate execution concurrent execution = context get command context ( ) get execution entity manager ( ) create child execution ( ( execution entity ) execution ) ; concurrent execution set current flow element ( activity ) ; concurrent execution set active ( true ) ; concurrent execution set scope ( false ) ; concurrent executions add ( concurrent execution ) ; log loop details ( concurrent execution , " initialized " , loop counter , 0 , nr of instances , nr of instances ) ; } / / before the activities are executed , all executions must be created up front / / do not try to merge this loop with the previous one , as it will lead / / to bugs , due to possible child execution pruning for ( int loop counter = 0 ; loop counter < nr of instances ; loop counter + + ) { delegate execution concurrent execution = concurrent executions get ( loop counter ) ; / / executions can be inactive , if instances are all automatics / / ( no - waitstate ) and completion condition has been met in the meantime if ( concurrent execution is active ( ) & & ! concurrent execution is ended ( ) & & concurrent execution get parent ( ) is active ( ) & & ! concurrent execution get parent ( ) is ended ( ) ) { set loop variable ( concurrent execution , get collection element index variable ( ) , loop counter ) ; execute original behavior ( concurrent execution , loop counter ) ; } } / / see act - 1586 : execution query returns wrong results when using multi / / instance on a receive task the parent execution must be set to false , so it wouldn ' t show up in / / the execution query when using activity id ( something ) do not we cannot nullify the / / activity id ( that would have been a better solution ) , as it would break boundary event behavior if ( ! concurrent executions is empty ( ) ) { execution entity execution entity = ( execution entity ) execution ; execution entity set active ( false ) ; } return nr of instances ; }


{ @ inherit doc } < b > note that although the view is modifiable , no method on the returned map will ever cause entries to be automatically loaded < b >


public int get holdability ( ) throws s q l exception { return 0 ; }


public encryption secrets get encryption secrets ( ) { return encryption secrets ; }


generates a basic watch that loosely represents a monitoring cluster alert but ultimately does nothing

private static bytes reference generate watch source ( final string id , final string cluster u u i d , final integer version ) throws exception { final x content builder builder = json builder ( ) start object ( ) ; builder start object ( " metadata " ) start object ( " xpack " ) field ( " cluster uuid " , cluster u u i d ) ; if ( version ! = null ) { builder field ( " version created " , integer to string ( version ) ) ; } builder field ( " watch " , id ) end object ( ) end object ( ) start object ( " trigger " ) start object ( " schedule " ) field ( " interval " , " 3 0m " ) end object ( ) end object ( ) start object ( " input " ) start object ( " simple " ) field ( " ignore " , " ignore " ) end object ( ) end object ( ) start object ( " condition " ) start object ( " never " ) end object ( ) end object ( ) start object ( " actions " ) end object ( ) ; return bytes reference bytes ( builder end object ( ) ) ; }


the main method for the leader followers pattern

public static void main ( string [ ] args ) throws interrupted exception { var task set = new task set ( ) ; var task handler = new task handler ( ) ; var work center = new work center ( ) ; work center create workers ( 4 , task set , task handler ) ; execute ( work center , task set ) ; }


< b > note : < b > this is an internal undocumented feature for now it is not clear whether this will be supported and stable in the long term gets the key that identifies the co - location group operators with the same co - location key will have their corresponding subtasks placed into the same slot by the scheduler if this is null ( which is the default ) , it means there is no co - location constraint

public string get co location group key ( ) { return co location group key ; }


returns a { @ code comparator < boolean > } that sorts { @ code false } before { @ code true } this is particularly useful in java 8 + in combination with { @ code comparators comparing } , e g { @ code comparators comparing ( foo : : has bar , false first ( ) ) }

public static comparator < boolean > false first ( ) { return boolean comparator false first ; }


invoked after a leader has stepped down this callback may or may not fire before the next leader has been elected


when two adjacent buckets a , b overlap ( a max & gt ; b min ) then their boundary is set to the midpoint : ( a max + b min ) 2 after this adjustment , a will contain more values than indicated and b will have less

private void adjust bounds for overlapping buckets ( list < bucket > buckets , reduce context reduce context ) { for ( int i = 1 ; i < buckets size ( ) ; i + + ) { bucket cur bucket = buckets get ( i ) ; bucket prev bucket = buckets get ( i - 1 ) ; if ( cur bucket bounds min < prev bucket bounds max ) { / / we don ' t want overlapping buckets - - > adjust their bounds / / todo : think of a fairer way to do this should prev max = cur min ? cur bucket bounds min = ( prev bucket bounds max + cur bucket bounds min ) / 2 ; prev bucket bounds max = cur bucket bounds min ; } } }


inverts the matrix stores the result in this matrix


public final int yystate ( ) { return zz lexical state ; }


associates a long value with the given name

public void put long ( string name , long value ) { map put ( name , long value of ( value ) ) ; }


specify the limit for the number of consumers that are allowed to be idle at any given time this limit is used by the { @ link # schedule new invoker if appropriate } method to determine if a new invoker should be created increasing the limit causes invokers to be created more aggressively this can be useful to ramp up the number of invokers faster the default is 1 , only scheduling a new invoker ( which is likely to be idle initially ) if none of the existing invokers is currently idle

public void set idle consumer limit ( int idle consumer limit ) { assert is true ( idle consumer limit > 0 , " ' idle consumer limit ' must be 1 or higher " ) ; synchronized ( this lifecycle monitor ) { this idle consumer limit = idle consumer limit ; } }


returns list of { @ link abstract section contribution } for this database interface

public list < abstract section contribution > get section contribution list ( ) { return section contribution list ; }


public static string input stream 2 string ( final input stream is , final string charset name ) { if ( is = = null ) return " " ; try { byte array output stream baos = input 2 output stream ( is ) ; if ( baos = = null ) return " " ; return baos to string ( get safe charset ( charset name ) ) ; } catch ( unsupported encoding exception e ) { e print stack trace ( ) ; return " " ; } }


public void remove ( ) { tree tree = get tree ( ) ; if ( tree ! = null ) tree remove ( this ) ; else if ( parent ! = null ) / / parent remove ( this ) ; }


tests reconfiguration of server truststore verifies that existing connections continue to work with old truststore and new connections work with new truststore

public void test server truststore dynamic update ( args args ) throws exception { security protocol security protocol = security protocol ssl ; args ssl server configs put ( broker security configs ssl client auth config , " required " ) ; test security config config = new test security config ( args ssl server configs ) ; listener name listener name = listener name for security protocol ( security protocol ) ; channel builder server channel builder = channel builders server channel builder ( listener name , false , security protocol , config , null , null , time , new log context ( ) ) ; server = new nio echo server ( listener name , security protocol , config , " localhost " , server channel builder , null , time ) ; server start ( ) ; inet socket address addr = new inet socket address ( " localhost " , server port ( ) ) ; / / verify that client with matching keystore can authenticate , send and receive string old node = " 0 " ; selector old client selector = create selector ( args ssl client configs ) ; old client selector connect ( old node , addr , buffer size , buffer size ) ; network test utils check client connection ( selector , old node , 100 , 10 ) ; cert stores new client cert stores = cert builder ( true , " client " , args use inline pem ) add host name ( " localhost " ) build ( ) ; args ssl client configs = args get trusting config ( new client cert stores , args server cert stores ) ; map < string , object > new truststore configs = new client cert stores trust store props ( ) ; assert true ( server channel builder instanceof listener reconfigurable , " ssl channel builder not reconfigurable " ) ; listener reconfigurable reconfigurable builder = ( listener reconfigurable ) server channel builder ; assert equals ( listener name , reconfigurable builder listener name ( ) ) ; reconfigurable builder validate reconfiguration ( new truststore configs ) ; reconfigurable builder reconfigure ( new truststore configs ) ; / / verify that new client with old truststore fails old client selector connect ( " 1 " , addr , buffer size , buffer size ) ; network test utils wait for channel close ( old client selector , " 1 " , channel state state authentication failed ) ; / / verify that new client with new truststore can authenticate , send and receive selector new client selector = create selector ( args ssl client configs ) ; new client selector connect ( " 2 " , addr , buffer size , buffer size ) ; network test utils check client connection ( new client selector , " 2 " , 100 , 10 ) ; / / verify that old client continues to work network test utils check client connection ( old client selector , old node , 100 , 10 ) ; map < string , object > invalid configs = new hash map < > ( new truststore configs ) ; invalid configs put ( ssl configs ssl truststore type config , " invalid type " ) ; verify invalid reconfigure ( reconfigurable builder , invalid configs , " invalid truststore type " ) ; map < string , object > missing store configs = new hash map < > ( ) ; missing store configs put ( ssl configs ssl truststore type config , " pkcs12 " ) ; missing store configs put ( ssl configs ssl truststore location config , " some truststore path " ) ; missing store configs put ( ssl configs ssl truststore password config , new password ( " some truststore password " ) ) ; verify invalid reconfigure ( reconfigurable builder , missing store configs , " truststore not found " ) ; / / verify that new connections continue to work with the server with previously configured keystore after failed reconfiguration new client selector connect ( " 3 " , addr , buffer size , buffer size ) ; network test utils check client connection ( new client selector , " 3 " , 100 , 10 ) ; }


verifies that the given rule supports the minimum os attribute , and adds compile and link args to set the minimum os appropriately , including compile args for dependencies

protected void check minimum os link and compile arg ( rule type rule type ) throws exception { rule type scratch target ( scratch , " deps " , " [ ' / / package : objc lib ' ] " , " minimum os version " , " ' 5 4 ' " ) ; scratch file ( " package / build " , " objc library ( name = ' objc lib ' , srcs = [ ' b m ' ] ) " ) ; use configuration ( " - - xcode version = 5 8 " ) ; command action link action = link action ( " / / x : x " ) ; command action objc lib archive action = ( command action ) get generating action ( get first artifact ending with ( link action get inputs ( ) , " libobjc lib a " ) ) ; command action objc lib compile action = ( command action ) get generating action ( get first artifact ending with ( objc lib archive action get inputs ( ) , " b o " ) ) ; string link args = joiner on ( " " ) join ( link action get arguments ( ) ) ; string compile args = joiner on ( " " ) join ( objc lib compile action get arguments ( ) ) ; assert that ( link args ) contains ( " - mios - simulator - version - min = 5 4 " ) ; assert that ( compile args ) contains ( " - mios - simulator - version - min = 5 4 " ) ; }


add a new singleton bean will overwrite any existing instance for the given name

public void add bean ( string name , object bean ) { this beans put ( name , bean ) ; }


public map < string , object > release principal attributes ( final string username , final string password , final string service ) { val selected service = this service factory create service ( service ) ; val registered service = this services manager find service by ( selected service ) ; val credential = new username password credential ( username , password ) ; val result = this authentication system support handle and finalize single authentication transaction ( selected service , credential ) ; val authentication = result get authentication ( ) ; val principal = authentication get principal ( ) ; val attributes to release = registered service get attribute release policy ( ) get attributes ( principal , selected service , registered service ) ; val builder = default authentication builder of ( principal , this principal factory , attributes to release , selected service , registered service , authentication ) ; val final authentication = builder build ( ) ; val assertion = new default assertion builder ( final authentication ) with ( selected service ) with ( collection utils wrap ( final authentication ) ) build ( ) ; val res validation = new linked hash map < string , object > ( ) ; res validation put ( cas view constants model attribute name assertion , assertion ) ; res validation put ( cas view constants model attribute name service , selected service ) ; res validation put ( " registered service " , registered service ) ; return res validation ; }


extremely important : keep this up to date with find internal function above ! ! ! determine if the given identifier is a sleigh internal function used to prevent user - defined p - code names from colliding with internal names

public boolean is internal function ( string name ) { if ( " zext " equals ( name ) ) { return true ; } if ( " carry " equals ( name ) ) { return true ; } if ( " sext " equals ( name ) ) { return true ; } if ( " scarry " equals ( name ) ) { return true ; } if ( " sborrow " equals ( name ) ) { return true ; } if ( " abs " equals ( name ) ) { return true ; } if ( " nan " equals ( name ) ) { return true ; } if ( " sqrt " equals ( name ) ) { return true ; } if ( " ceil " equals ( name ) ) { return true ; } if ( " floor " equals ( name ) ) { return true ; } if ( " round " equals ( name ) ) { return true ; } if ( " int 2float " equals ( name ) ) { return true ; } if ( " float 2float " equals ( name ) ) { return true ; } if ( " trunc " equals ( name ) ) { return true ; } if ( " delayslot " equals ( name ) ) { return true ; } if ( " cpool " equals ( name ) ) { return true ; } if ( " newobject " equals ( name ) ) { return true ; } if ( " popcount " equals ( name ) ) { return true ; } return false ; }


public final string get comment ( ) { return get string ( size + get ( cennam ) + get ( cenext ) , get ( cencom ) ) ; }


public type set classes ( ) { return new class set ( ) ; }


public void prefix ns number test ( ) { / / todo : test prefix ns number }


public static < e > array deque < e > new array deque ( ) { return new array deque < e > ( ) ; }


return the view object , or { @ code null } if we are using a view name to be resolved by the dispatcher servlet via a view resolver

public view get view ( ) { return ( this view instanceof view ? ( view ) this view : null ) ; }


removes the version of a specified instance of a feature

public static void remove version ( s q lite database writable database , @ feature int feature , string instance uid ) throws database i o exception { try { if ( ! util table exists ( writable database , table name ) ) { return ; } writable database delete ( table name , where feature and instance uid equals , feature and instance uid arguments ( feature , instance uid ) ) ; } catch ( s q l exception e ) { throw new database i o exception ( e ) ; } }


protected void init object writers ( ) { this object writers clear ( ) ; if ( ! this register defaults ) { return ; } this object writers add all ( get base object writers ( ) ) ; extend object writers ( this object writers ) ; }


test the property ' enum form string array '

public void enum form string array test ( ) { / / todo : test enum form string array }


look up a method id name index from a method index cheaper than : { @ code method ids ( ) get ( method index ) get name index ( ) ; }

public int name index from method index ( int method index ) { check bounds ( method index , table of contents method ids size ) ; int position = table of contents method ids off + ( size of member id item * method index ) ; position + = size of ushort ; / / declaring class index position + = size of ushort ; / / proto index return data get int ( position ) ; / / name index }


sets the default value for { @ code type } , when dummy value for a parameter of the same type needs to be created in order to invoke a method or constructor the default value isn ' t used in testing { @ link object # equals } because more than one sample instances are needed for testing inequality

protected final < t > void set default ( class < t > type , t value ) { tester set default ( type , value ) ; }


get an optional attribute value from the annotation

< t > optional < t > get value ( string attribute name , class < t > type ) ;


returns the client environment with all settings from - - action env and - - repo env

public map < string , string > get repo env ( ) { return collections unmodifiable map ( repo env ) ; }


public integer get int 3 2 ( ) { return int 3 2 ; }


public pet status ( status enum status ) { this status = status ; return this ; }


writes { @ code len } bytes from memory segment { @ code segment } starting at offset { @ code off } , in order , to the output

void write ( memory segment segment , int off , int len ) throws i o exception ;


initialization method for the schema it is called before the actual working methods { @ link # deserialize } and thus suitable for one time setup work the provided { @ link deserialization schema initialization context } can be used to access additional features such as e g registering user metrics

default void open ( deserialization schema initialization context context ) throws exception { }


test a thread command execution timeout where the command implemented get fallback

public void test thread isolated execution timeout with successful fallback ( ) { test execution timeout with successful fallback ( execution isolation strategy thread ) ; }


restart the node that runs the { @ link task id } decoded from the provided { @ link async execution id }

protected void restart task node ( string id , string index name ) throws exception { async execution id search id = async execution id decode ( id ) ; final cluster state response cluster state = client ( ) admin ( ) cluster ( ) prepare state ( ) clear ( ) set nodes ( true ) get ( ) ; discovery node node = cluster state get state ( ) nodes ( ) get ( search id get task id ( ) get node id ( ) ) ; stop maintenance service ( ) ; internal cluster ( ) restart node ( node get name ( ) , new internal test cluster restart callback ( ) { } ) ; start maintenance service ( ) ; ensure yellow ( async results index , index name ) ; }


public void set api client ( api client api client ) { this api client = api client ; }


public string body ( ) { return this body ; }


returns the value associated with this { @ link context register info } object as a { @ link string }

public big integer get value ( ) { return value ; }


applies { @ link ints # try parse ( string ) } to the given string and asserts that the result is as expected

private static void try parse and assert equals ( integer expected , string value ) { assert equals ( expected , ints try parse ( value ) ) ; }


returns the message from the gui resources that corresponds to the given key

private static string msg ( string message key ) { return g u i resources get message ( message key ) ; }


returns the length ( in code units ) of the short hash

public byte get short hash code unit length ( ) { return short hash code unit length ; }


gets the current date and time formatted by the pattern specified

public string get current date and time ( ) { return format ( zoned date time now ( zone offset utc ) ) ; }


return true if this additional properties string object is equal to o

public boolean equals ( object o ) { if ( this = = o ) { return true ; } if ( o = = null | | get class ( ) ! = o get class ( ) ) { return false ; } additional properties string additional properties string = ( additional properties string ) o ; return objects equals ( this name , additional properties string name ) & & objects equals ( this additional properties , additional properties string additional properties ) ; }


configure the { @ link bind markers factory bind markers } to be used

builder bind markers ( bind markers factory bind markers ) ;


creates default implementation of { @ link image downloader } - { @ link base image downloader }

public static image downloader create image downloader ( context context ) { return new base image downloader ( context ) ; }


submits a { @ link runnable } to be executed asynchronously if max concurrent runnables are already running , the runnable will be queued

public < t > async result < t > submit ( final async task < t > task ) { if ( executor is shutdown ( ) ) { throw new gdx runtime exception ( " cannot run tasks on an executor that has been shutdown ( disposed ) " ) ; } return new async result ( executor submit ( new callable < t > ( ) { @ override public t call ( ) throws exception { return task call ( ) ; } } ) ) ; }


configure the pipeline for a cleartext upgrade from http to http2 0

private void configure clear text ( socket channel ch ) { final channel pipeline p = ch pipeline ( ) ; final http server codec source codec = new http server codec ( ) ; p add last ( source codec ) ; p add last ( new http server upgrade handler ( source codec , upgrade codec factory ) ) ; p add last ( new simple channel inbound handler < http message > ( ) { @ override protected void channel read 0 ( channel handler context ctx , http message msg ) throws exception { / / if this handler is hit then no upgrade has been attempted and the client is just talking http system err println ( " directly talking : " + msg protocol version ( ) + " ( no upgrade was attempted ) " ) ; channel pipeline pipeline = ctx pipeline ( ) ; pipeline add after ( ctx name ( ) , null , new hello world http 1 handler ( " direct no upgrade attempted " ) ) ; pipeline replace ( this , null , new http object aggregator ( max http content length ) ) ; ctx fire channel read ( reference count util retain ( msg ) ) ; } } ) ; p add last ( new user event logger ( ) ) ; }


if the pool implementation supports asynchronous close , then use it to avoid a blocking close call in case the channel pool map operations are called from an event loop

private static future < void > pool close async if supported ( channel pool pool ) { if ( pool instanceof simple channel pool ) { return ( ( simple channel pool ) pool ) close async ( ) ; } else { try { pool close ( ) ; return global event executor instance new succeeded future ( null ) ; } catch ( exception e ) { return global event executor instance new failed future ( e ) ; } } }


the name of the enumflag as a reference enumsflag items are generated as id resource values < code > optional aapt pb reference name = 3 ; < code >

public builder clear name ( ) { copy on write ( ) ; instance clear name ( ) ; return this ; }


helper method to configure the token endpoint of the first oauth found in the api authorizations ( there should be only one )

public token request builder get token end point ( ) { for ( interceptor api authorization : api authorizations values ( ) ) { if ( api authorization instanceof o auth ) { o auth oauth = ( o auth ) api authorization ; return oauth get token request builder ( ) ; } } return null ; }


checks the given boolean condition , and throws an { @ code program parametrization exception } if the condition is not met ( evaluates to { @ code false } ) the exception will have the given error message

public static void check parameter ( boolean condition , @ nullable object error message ) { if ( ! condition ) { throw new program parametrization exception ( string value of ( error message ) ) ; } }


gets the rule index to use for calls to { @ link recognizer # action }

public int get rule index ( ) { return rule index ; }


find all methods annotated with { @ link after permission granted } on a given object with the correct request code argument

private static void run annotated methods ( @ non null object object , int request code ) { class clazz = object get class ( ) ; if ( is using android annotations ( object ) ) { clazz = clazz get superclass ( ) ; } while ( clazz ! = null ) { for ( method method : clazz get declared methods ( ) ) { after permission granted ann = method get annotation ( after permission granted class ) ; if ( ann ! = null ) { / / check for annotated methods with matching request code if ( ann value ( ) = = request code ) { / / method must be void so that we can invoke it if ( method get parameter types ( ) length > 0 ) { throw new runtime exception ( " cannot execute method " + method get name ( ) + " because it is non - void method and / or has input parameters " ) ; } try { / / make method accessible if private if ( ! method is accessible ( ) ) { method set accessible ( true ) ; } method invoke ( object ) ; } catch ( illegal access exception e ) { log e ( tag , " run default method : illegal access exception " , e ) ; } catch ( invocation target exception e ) { log e ( tag , " run default method : invocation target exception " , e ) ; } } } } clazz = clazz get superclass ( ) ; } }


sets the uniform to whatever value was passed via { @ link # set sampler tex id ( int , int ) } or { @ link # set float ( float ) } should be called before each drawing call

public void bind ( ) { if ( type = = gles20 gl float ) { gles20 gl uniform 1fv ( location , 1 , value , 0 ) ; check gl error ( ) ; return ; } if ( tex id = = 0 ) { throw new illegal state exception ( " call set sampler tex id before bind " ) ; } gles20 gl active texture ( gles20 gl texture0 + unit ) ; if ( type = = g l e s 1 1 ext gl sampler external oes ) { gles20 gl bind texture ( g l e s 1 1 ext gl texture external oes , tex id ) ; } else if ( type = = gles20 gl sampler 2d ) { gles20 gl bind texture ( gles20 gl texture 2d , tex id ) ; } else { throw new illegal state exception ( " unexpected uniform type : " + type ) ; } gles20 gl uniform 1i ( location , unit ) ; gles20 gl tex parameteri ( gles20 gl texture 2d , gles20 gl texture mag filter , gles20 gl linear ) ; gles20 gl tex parameteri ( gles20 gl texture 2d , gles20 gl texture min filter , gles20 gl linear ) ; gles20 gl tex parameteri ( gles20 gl texture 2d , gles20 gl texture wrap s , gles20 gl clamp to edge ) ; gles20 gl tex parameteri ( gles20 gl texture 2d , gles20 gl texture wrap t , gles20 gl clamp to edge ) ; check gl error ( ) ; }


response signal to container ( string container id , string command , http servlet request req ) throws authorization exception ;


return the max number of { @ link byte buf } ' s that are composed in this instance

public int max num components ( ) { return max num components ; }


public void cancel ( configuration conf ) throws i o exception , interrupted exception { get renewer ( ) cancel ( this , conf ) ; }


return the applicable default html escape setting for this tag the default implementation checks the request context ' s setting , falling back to { @ code false } in case of no explicit default given

protected boolean is default html escape ( ) { return get request context ( ) is default html escape ( ) ; }


returns an instance that is identical to this one , except that all incompatible register numbers are renumbered sequentially from the given base , with the first number duplicated if indicated if a null bit set is given , it indicates all registers are incompatible

public register spec list with expanded registers ( int base , boolean duplicate first , bit set compat regs ) { int sz = size ( ) ; if ( sz = = 0 ) { / / don ' t bother making a new zero - element instance return this ; } expander expander = new expander ( this , compat regs , base , duplicate first ) ; for ( int reg idx = 0 ; reg idx < sz ; reg idx + + ) { expander expand register ( reg idx ) ; } return expander get result ( ) ; }


public t offset rows ( long value ) { return offset rows ( string value of ( value ) ) ; }


get the partition number for a given key ( hence record ) given the total number of partitions i e number of reduce - tasks for the job typically a hash function on a all or a subset of the key

public abstract int get partition ( key key , value value , int num partitions ) ;


update an existing pet < b > 200 < b > - successful operation < b > 400 < b > - invalid id supplied < b > 404 < b > - pet not found < b > 405 < b > - validation exception

public response entity < void > update pet with http info ( pet body ) throws rest client exception { object post body = body ; / / verify the required parameter ' body ' is set if ( body = = null ) { throw new http client error exception ( http status bad request , " missing the required parameter ' body ' when calling update pet " ) ; } string path = api client expand path ( " / pet " , collections < string , object > empty map ( ) ) ; final multi value map < string , string > query params = new linked multi value map < string , string > ( ) ; final http headers header params = new http headers ( ) ; final multi value map < string , string > cookie params = new linked multi value map < string , string > ( ) ; final multi value map < string , object > form params = new linked multi value map < string , object > ( ) ; final string [ ] local var accepts = { } ; final list < media type > local var accept = api client select header accept ( local var accepts ) ; final string [ ] content types = { " application / json " , " application / xml " } ; final media type content type = api client select header content type ( content types ) ; string [ ] auth names = new string [ ] { " petstore auth " } ; parameterized type reference < void > return type = new parameterized type reference < void > ( ) { } ; return api client invoke a p i ( path , http method put , query params , post body , header params , cookie params , form params , local var accept , content type , auth names , return type ) ; }


returns the corresponding wrapper type of { @ code type } if it is a primitive type ; otherwise returns { @ code type } itself idempotent wrap ( int class ) = = integer class wrap ( integer class ) = = integer class wrap ( string class ) = = string class

public static < t > class < t > wrap ( class < t > type ) { if ( type = = int class ) return ( class < t > ) integer class ; if ( type = = float class ) return ( class < t > ) float class ; if ( type = = byte class ) return ( class < t > ) byte class ; if ( type = = double class ) return ( class < t > ) double class ; if ( type = = long class ) return ( class < t > ) long class ; if ( type = = char class ) return ( class < t > ) character class ; if ( type = = boolean class ) return ( class < t > ) boolean class ; if ( type = = short class ) return ( class < t > ) short class ; if ( type = = void class ) return ( class < t > ) void class ; return type ; }


get the builder this must be used after the constructor has been invoked to create the actual builder : it allows for subclasses to do things after construction

public future data input stream builder builder ( ) { return get this builder ( ) ; }


in this test , we call distribute with 0 bytes and verify that all streams with 0 bytes are written 0 \ a b \ c d after the tree shift : 0 | [ a ] | b \ c d

public void zero distribute should write all zero frames ( ) throws http 2 exception { init state ( stream a , 400 , false ) ; init state ( stream b , 0 , true ) ; init state ( stream c , 0 , true ) ; init state ( stream d , 0 , true ) ; set priority ( stream b , stream a , default priority weight , true ) ; assert false ( write ( 0 ) ) ; verify never write ( stream a ) ; verify write ( stream b , 0 ) ; verify any write ( stream b , 1 ) ; verify write ( stream c , 0 ) ; verify any write ( stream c , 1 ) ; verify write ( stream d , 0 ) ; verify any write ( stream d , 1 ) ; }


public log get logger ( ) { return logger ; }


creates an appropriately sized hashtable for the given input size

private static short [ ] get hash table ( int input size ) { int ht size = 256 ; while ( ht size < max ht size & & ht size < input size ) { ht size < < = 1 ; } return new short [ ht size ] ; }


public integer get snake case ( ) { return snake case ; }


convert the given object to string with each line indented by 4 spaces ( except the first line )

private string to indented string ( object o ) { if ( o = = null ) { return " null " ; } return o to string ( ) replace ( " \ n " , " \ n " ) ; }


casts { @ link iterator } by taking advantage of its covariant - ness

public static < t > iterator < t > cast ( iterator < ? extends t > itr ) { return ( iterator ) itr ; }


returns a fixed - size list backed by the specified array , similar to { @ link arrays # as list ( object [ ] ) } the list supports { @ link list # set ( int , object ) } , but any attempt to set a value to { @ code null } will result in a { @ link null pointer exception } the returned list maintains the values , but not the identities , of { @ code integer } objects written to or read from it for example , whether { @ code list get ( 0 ) = = list get ( 0 ) } is true for the returned list is unspecified < b > note : < b > when possible , you should represent your data as an { @ link immutable int array } instead , which has an { @ link immutable int array # as list as list } view

public static list < integer > as list ( int backing array ) { if ( backing array length = = 0 ) { return collections empty list ( ) ; } return new int array as list ( backing array ) ; }


test if the { @ link guice wizard } smokes whatever instance of { @ link tobacco } is passed to him through the constructor parameter

public void test smoke every thing through constructor ( ) throws exception { list < tobacco > tobaccos = list of ( new old toby tobacco ( ) , new rivendell tobacco ( ) , new second breakfast tobacco ( ) ) ; / / verify if the wizard is smoking the correct tobacco tobaccos for each ( tobacco - > { final guice wizard guice wizard = new guice wizard ( tobacco ) ; guice wizard smoke ( ) ; string last message = appender get last message ( ) ; assert equals ( " guice wizard smoking " + tobacco get class ( ) get simple name ( ) , last message ) ; } ) ; / / and nothing else is happening assert equals ( tobaccos size ( ) , appender get log size ( ) ) ; }


creates an empty { @ code compact linked hash set } instance

public static < e > compact linked hash set < e > create ( ) { return new compact linked hash set < > ( ) ; }


check all the related { @ code bits } positions is 1

public boolean is hit ( bloom filter data filter data , bits array bits ) { if ( ! is valid ( filter data ) ) { throw new illegal argument exception ( string format ( " bloom filter data may not belong to this filter ! % s , % s " , filter data , this to string ( ) ) ) ; } return is hit ( filter data get bit pos ( ) , bits ) ; }


returns the byte order used by this buffer when converting doubles fromto bytes if this buffer is not based on a byte buffer , then this always returns the platform ' s native byte order


returns a new { @ code type token } where type variables represented by { @ code type param } are substituted by { @ code type arg } for example , it can be used to construct { @ code map < k , v > } for any { @ code k } and { @ code v } type : { @ code static < k , v > type token < map < k , v > > map of ( type token < k > key type , type token < v > value type ) { return new type token < map < k , v > > ( ) { } where ( new type parameter < k > ( ) { } , key type ) where ( new type parameter < v > ( ) { } , value type ) ; } }

public final < x > type token < t > where ( type parameter < x > type param , type token < x > type arg ) { type resolver resolver = new type resolver ( ) where ( immutable map of ( new type resolver type variable key ( type param type variable ) , type arg runtime type ) ) ; / / if there ' s any type error , we ' d report now rather than later return new simple type token < t > ( resolver resolve type ( runtime type ) ) ; }


variant of { @ link # replace query param ( string , object ) } with a collection note : please , review the javadoc of { @ link # query param ( string , object ) } for further notes on the treatment and encoding of individual query parameters

uri builder replace query param ( string name , @ nullable collection < ? > values ) ;


sets { @ link query request # end ts ( ) }

public builder end ts ( long end ts ) { this end ts = end ts ; return this ; }


clear all the bitmaps from the memory cache

public void evict all ( ) { cache clear ( ) ; }


creates the { @ link sniffer } based on the provided configuration

public sniffer build ( ) { if ( nodes sniffer = = null ) { this nodes sniffer = new elasticsearch nodes sniffer ( rest client ) ; } return new sniffer ( rest client , nodes sniffer , sniff interval millis , sniff after failure delay millis ) ; }


shows the playback controls , but only if forced or shown indefinitely

private void maybe show controller ( boolean is forced ) { if ( is playing ad ( ) & & controller hide during ads ) { return ; } if ( use controller ( ) ) { boolean was showing indefinitely = controller is visible ( ) & & controller get show timeout ms ( ) < = 0 ; boolean should show indefinitely = should show controller indefinitely ( ) ; if ( is forced | | was showing indefinitely | | should show indefinitely ) { show controller ( should show indefinitely ) ; } } }


returns the configured target for the specified label , using the given build configuration if the label corresponds to a target with a top - level configuration transition , that transition is applied to the given config in the returned configured target if the evaluation of the sky key corresponding to the configured target fails , this method may return null in that case , use a debugger to inspect the { @ link error info } for the evaluation , which is produced by the { @ link memoizing evaluator # get existing value } call in { @ link skyframe executor # get configured target for testing } see also b 2 6 3 8 2 5 0 2

protected configured target get configured target ( label label , build configuration config ) { try { return view get configured target for testing ( reporter , blaze test utils convert label ( label ) , config ) ; } catch ( invalid configuration exception | starlark transition transition exception | interrupted exception e ) { throw new assertion error ( e ) ; } }


tests that the rpc is not running if it is being stopped

public void test not running state ( ) throws interrupted exception , execution exception , timeout exception { completable future < void > stop future = new completable future < > ( ) ; running state testing endpoint endpoint = new running state testing endpoint ( rpc service , stop future ) ; running state testing endpoint gateway gateway = endpoint get self gateway ( running state testing endpoint gateway class ) ; endpoint start ( ) ; completable future < void > termination future = endpoint close and wait until on stop called ( ) ; assert that ( gateway query is running flag ( ) get ( ) , is ( false ) ) ; stop future complete ( null ) ; termination future get ( timeout to milliseconds ( ) , time unit milliseconds ) ; }


returns information about the preferred decoder for a given mime type

public static media codec info get decoder info ( string mime type , boolean secure , boolean tunneling ) throws decoder query exception { list < media codec info > decoder infos = get decoder infos ( mime type , secure , tunneling ) ; return decoder infos is empty ( ) ? null : decoder infos get ( 0 ) ; }


sets the { @ code trigger } that should be used to trigger window emission

public windowed stream < t , k , w > trigger ( trigger < ? super t , ? super w > trigger ) { builder trigger ( trigger ) ; return this ; }


return the type of attribute , i e what kind of values does this attribute hold " long " , " object " , " double " are examples

public string attribute type ( ) { return attribute type ; }


returns a new instance like { @ code object } that throws on { @ code get kind ( ) }

private type element prevent get kind ( type element object ) { type element spy = mockito spy ( object ) ; when ( spy get kind ( ) ) then throw ( new assertion error ( ) ) ; when ( spy get enclosing element ( ) ) then answer ( invocation - > { object enclosing element = invocation call real method ( ) ; return enclosing element instanceof type element ? prevent get kind ( ( type element ) enclosing element ) : enclosing element ; } ) ; return spy ; }


fills the { @ link byte buf } with zero bytes and releases it

static void zeroout and release ( byte buf buffer ) { zeroout ( buffer ) ; buffer release ( ) ; }


public map < string , boolean > get direct map ( ) { return direct map ; }


generates a factory method to delegate to constructors

private static void generate static ctor delegator ( class writer cw , int access , string delegator method name , type delegate class type , method type delegate method type ) { method wrapper method = new method ( delegator method name , delegate method type to method descriptor string ( ) ) ; method constructor method = new method ( ctor method name , delegate method type change return type ( void class ) to method descriptor string ( ) ) ; int modifiers = access | acc static ; generator adapter factory = new generator adapter ( modifiers , wrapper method , cw visit method ( modifiers , delegator method name , delegate method type to method descriptor string ( ) , null , null ) ) ; factory visit code ( ) ; factory new instance ( delegate class type ) ; factory dup ( ) ; factory load args ( ) ; factory invoke constructor ( delegate class type , constructor method ) ; factory return value ( ) ; factory end method ( ) ; }


called after a cache miss to compute a value for the corresponding key returns the computed value or null if no value can be computed the default implementation returns null the method is called without synchronization : other threads may access the cache while this method is executing if a value for { @ code key } exists in the cache when this method returns , the created value will be released with { @ link # entry removed } and discarded this can occur when multiple threads request the same key at the same time ( causing multiple values to be created ) , or when one thread calls { @ link # put } while another is creating a value for the same key

protected v create ( k key ) { return null ; }


check if current active library equals to passed

public final boolean is library ( string library ) { return library equals ( this library ) ; }


returns a writer for writing to this file parent directories will be created if necessary

public writer writer ( boolean append , string charset ) { if ( type = = file type classpath ) throw new runtime exception ( " cannot write to a classpath file : " + file ) ; parent ( ) mkdirs ( ) ; try { file output stream output = new file output stream ( file ( ) , append ) ; if ( charset = = null ) return new output stream writer ( output ) ; else return new output stream writer ( output , charset ) ; } catch ( i o exception ex ) { if ( file ( ) is directory ( ) ) throw new runtime exception ( " cannot open a stream to a directory : " + file + " ( " + type + " ) " , ex ) ; throw new runtime exception ( " error writing file : " + file + " ( " + type + " ) " , ex ) ; } }


returns the platform preferred implementation of an insertion ordered set based on a hash table

static < e > set < e > new linked hash set with expected size ( int expected size ) { return compact linked hash set create with expected size ( expected size ) ; }


extension point to bind the request to the target object

protected mono < void > bind request parameters ( web exchange data binder binder , server web exchange exchange ) { return binder bind ( exchange ) ; }


protected synchronized boolean enter closed state ( ) { if ( ! state equals ( closed ) ) { enter state ( null , closed ) ; return true ; } else { return false ; } }


public job conf get job conf ( ) { return job ; }


removes direct children of key from to visit and from the entry itself , and makes the entry ready if necessary we must do this because it would not make sense to try to build the children after building the entry it would violate the invariant that a parent can only be built after its children are built ; see bug " precondition error while evaluating a skyframe graph with a cycle "

private static set < sky key > remove descendants of cycle value ( sky key key , node entry entry , @ nullable sky key cycle child , iterable < sky key > to visit , int cycle length , parallel evaluator context evaluator context ) throws interrupted exception { grouped list < sky key > direct deps = entry get temporary direct deps ( ) ; set < sky key > unvisited deps = sets new hash set with expected size ( direct deps num elements ( ) ) ; iterables add all ( unvisited deps , iterables concat ( direct deps ) ) ; unvisited deps remove ( cycle child ) ; / / remove any children from this node that are not part of the cycle we just found they are / / irrelevant to the node as it stands , and if they are deleted from the graph because they are / / not built by the end of cycle - checking , we would have dangling references set < sky key > removed deps = remove incomplete children for cycle ( key , entry , unvisited deps , evaluator context ) ; if ( ! entry is ready ( ) ) { / / the entry has at most one undone dep now , its cycle child signal to make entry ready note / / that the entry can conceivably be ready if its cycle child already found a different cycle / / and was built entry signal dep ( evaluator context get graph version ( ) , cycle child ) ; } maybe mark rebuilding ( entry ) ; preconditions check state ( entry is ready ( ) , " % s % s % s " , key , cycle child , entry ) ; iterator < sky key > it = to visit iterator ( ) ; while ( it has next ( ) ) { sky key descendant = it next ( ) ; if ( descendant = = children finished ) { / / marker value , delineating the end of a group of children that were enqueued cycle length - - ; if ( cycle length = = 0 ) { / / we have seen # cycle length - 1 marker values , and have arrived at the one for this value , / / so we are done return removed deps ; } continue ; / / don ' t remove marker values } if ( cycle length = = 1 ) { / / remove the direct children remaining to visit of the cycle node preconditions check state ( unvisited deps contains ( descendant ) , " % s % s % s % s " , key , descendant , cycle child , entry ) ; it remove ( ) ; } } throw new illegal state exception ( string format ( " there were not % d groups of children in % s when trying to remove children of % s other " + " than % s " , cycle length , to visit , key , cycle child ) ) ; }


public void job ( ) { try { require job ( ) ; } catch ( exception e ) { render text ( e get message ( ) ) ; return ; } render ( job page ( ) ) ; }


public final boolean is modified ( ) { set modified ( check modified ( form , get config ( ) ) ) ; return super is modified ( ) ; }


selects the source shards for a local shard recovery this might either be a split or a shrink operation

public static set < shard id > select recover from shards ( int shard id , index metadata source index metadata , int num target shards ) { if ( source index metadata get number of shards ( ) > num target shards ) { return select shrink shards ( shard id , source index metadata , num target shards ) ; } else if ( source index metadata get number of shards ( ) < num target shards ) { return collections singleton ( select split shard ( shard id , source index metadata , num target shards ) ) ; } else { return collections singleton ( select clone shard ( shard id , source index metadata , num target shards ) ) ; } }


default void validate ( string key , object value , object dependency ) { }


convert the given object to string with each line indented by 4 spaces ( except the first line )

private string to indented string ( object o ) { if ( o = = null ) { return " null " ; } return o to string ( ) replace ( " \ n " , " \ n " ) ; }


creates an action for each python 2 file to convert to python 3 returns null and reports a rule error if an output file cannot be created

public static map < path fragment , artifact > generate 2to 3 actions ( rule context rule context , iterable < artifact > inputs ) { / / this creates many actions , but this is fine creating one action per library leads / / to some problems ( when the same file is generated by two different actions ) , with / / little benefits and negligible memory improvement map < path fragment , artifact > symlinks = new hash map < > ( ) ; for ( artifact input : inputs ) { artifact output = generate 2to 3 action ( rule context , input ) ; if ( output = = null ) { return null ; } symlinks put ( input get root relative path ( ) , output ) ; } return symlinks ; }


public writer to json ( final writer writer , final logging event event ) throws i o exception { throwable information ti = event get throwable information ( ) ; to json ( writer , event get logger name ( ) , event get time stamp ( ) , event get level ( ) to string ( ) , event get thread name ( ) , event get rendered message ( ) , ti ) ; return writer ; }


public static < k1 , v1 , k2 , v2 > class < mapper < k1 , v1 , k2 , v2 > > get mapper class ( job context job ) { return ( class < mapper < k1 , v1 , k2 , v2 > > ) job get configuration ( ) get class ( map class , mapper class ) ; }


determine if the given type is assignable from the given value , assuming setting by reflection considers primitive wrapper classes as assignable to the corresponding primitive types

public static boolean is assignable value ( class < ? > type , @ nullable object value ) { assert not null ( type , " type must not be null " ) ; return ( value ! = null ? is assignable ( type , value get class ( ) ) : ! type is primitive ( ) ) ; }


public static string get super user ( ) { return router owner ; }


set whether to send the java collection type for each serialized collection default is " true "

public void set send collection type ( boolean send collection type ) { this serializer factory set send collection type ( send collection type ) ; }


should the visitor keep visiting the tree called after visiting a node or skipping a tree branch , if the return value is { @ code false } , no more nodes will be visited


check if the datanode is in stale state here if the namenode has not received heartbeat msg from a datanode for more than stale interval , the datanode will be treated as stale node

public boolean is stale ( long stale interval ) { return ( time monotonic now ( ) - last update monotonic ) > = stale interval ; }


when the request resources is the first in a stream , the initial resource versions must be populated otherwise , initial resource versions must be omitted the keys are the resources names of the mcp resources known to the mcp client the values in the map are the associated resource level version info < code > map & lt ; string , string & gt ; initial resource versions = 3 ; < code >

public java lang string get initial resource versions or throw ( java lang string key ) { if ( key = = null ) { throw new java lang null pointer exception ( ) ; } java util map < java lang string , java lang string > map = internal get initial resource versions ( ) get map ( ) ; if ( ! map contains key ( key ) ) { throw new java lang illegal argument exception ( ) ; } return map get ( key ) ; }


call this method if we should use data binding compiler v 2

public data binding processor args builder enable v 2 ( ) { flags add ( create processor flag ( " enable v 2 " , " 1 " ) ) ; return this ; }


for this test , the body for this request much reference a schema named & # x 6 0 ; file & # x 6 0 ;

public api response < void > test body with file schema with http info ( file schema test class body ) throws api exception { okhttp 3 call local var call = test body with file schema validate before call ( body , null ) ; return local var api client execute ( local var call ) ; }


lists all available schemas in the root of the catalog manager it is not equivalent to listing all catalogs as it includes also different catalog parts of the temporary objects < b > note : < b > it is primarily used for interacting with calcite ' s schema

public set < string > list schemas ( ) { return stream concat ( catalogs key set ( ) stream ( ) , temporary tables key set ( ) stream ( ) map ( object identifier : : get catalog name ) ) collect ( collectors to set ( ) ) ; }


returns whether the system publisher is enabled

public static boolean system metrics publisher enabled ( configuration conf ) { return conf get boolean ( yarn configuration system metrics publisher enabled , yarn configuration default system metrics publisher enabled ) ; }


gets the number of max - parallelism with which the parallel task runs

int get max number of parallel subtasks ( ) ;


update the { @ link # next flush } variable to the next flush time add an integer number of flush intervals , preserving the initial random offset

protected void update flush time ( date now ) { / / in non - initial rounds , add an integer number of intervals to the last / / flush until a time in the future is achieved , thus preserving the / / original random offset int millis = ( int ) ( ( ( now get time ( ) - next flush get time in millis ( ) ) / roll interval millis + 1 ) * roll interval millis ) ; next flush add ( calendar millisecond , millis ) ; }


tries to load config class with spi first , then with class name directly from classpath

public static codegen config for name ( string name ) { service loader < codegen config > loader = service loader load ( codegen config class , codegen config class get class loader ( ) ) ; string builder available configs = new string builder ( ) ; for ( codegen config config : loader ) { if ( config get name ( ) equals ( name ) ) { return config ; } available configs append ( config get name ( ) ) append ( " \ n " ) ; } / / else try to load directly try { return ( codegen config ) class for name ( name ) get declared constructor ( ) new instance ( ) ; } catch ( exception e ) { throw new generator not found exception ( " can ' t load config class with name ' " concat ( name ) + " ' \ n available : \ n " + available configs to string ( ) , e ) ; } }


builds a connection profile that is dedicated to a single channel type allows passing connection and handshake timeouts and compression settings

public static connection profile build single channel profile ( transport request options type channel type , @ nullable time value connect timeout , @ nullable time value handshake timeout , @ nullable time value ping interval , @ nullable boolean compression enabled ) { builder builder = new builder ( ) ; builder add connections ( 1 , channel type ) ; final enum set < transport request options type > other types = enum set all of ( transport request options type class ) ; other types remove ( channel type ) ; builder add connections ( 0 , other types to array ( new transport request options type [ 0 ] ) ) ; if ( connect timeout ! = null ) { builder set connect timeout ( connect timeout ) ; } if ( handshake timeout ! = null ) { builder set handshake timeout ( handshake timeout ) ; } if ( ping interval ! = null ) { builder set ping interval ( ping interval ) ; } if ( compression enabled ! = null ) { builder set compression enabled ( compression enabled ) ; } return builder build ( ) ; }


the number of top - matching documents that are considered during each hop ( default is { @ link sampler aggregation builder # default shard sample size } very small values ( less than 50 ) may not provide sufficient weight - of - evidence to identify significant connections between terms very large values ( many thousands ) are not recommended with loosely defined queries ( fuzzy queries or those with many or clauses ) this is because any useful signals in the best documents are diluted with irrelevant noise from low - quality matches performance is also typically better with smaller samples as there are less look - ups required for background frequencies of terms found in the documents

public void sample size ( int max number of docs per hop ) { sample size = max number of docs per hop ; }


check whether requested sasl qop contains privacy

public static boolean requested qop contains privacy ( map < string , string > sasl props ) { set < string > requested qop = immutable set copy of ( arrays as list ( sasl props get ( sasl qop ) split ( " , " ) ) ) ; return requested qop contains ( " auth - conf " ) ; }


join records of this stream with { @ link global k table } ' s records using non - windowed inner equi join the join is a primary key table lookup join with join attribute { @ code key value mapper map ( stream key value ) = = table key } " table lookup join " means , that results are only computed if { @ code k stream } records are processed this is done by performing a lookup for matching records in the current internal { @ link global k table } state in contrast , processing { @ link global k table } input records will only update the internal { @ link global k table } state and will not produce any result records for each { @ code k stream } record that finds a corresponding record in { @ link global k table } the provided { @ link value joiner } will be called to compute a value ( with arbitrary type ) for the result record the key of the result record is the same as the key of this { @ code k stream } if a { @ code k stream } input record key or value is { @ code null } the record will not be included in the join operation and thus no output record will be added to the resulting { @ code k stream } if { @ code key value mapper } returns { @ code null } implying no match exists , no output record will be added to the resulting { @ code k stream }

< gk , gv , rv > k stream < k , rv > join ( final global k table < gk , gv > global table , final key value mapper < ? super k , ? super v , ? extends gk > key selector , final value joiner < ? super v , ? super gv , ? extends rv > joiner , final named named ) ;


sets the db access related fields in the job conf

public static void configure d b ( job conf job , string driver class , string db url , string user name , string passwd ) { job set ( driver class property , driver class ) ; job set ( url property , db url ) ; if ( user name ! = null ) job set ( username property , user name ) ; if ( passwd ! = null ) job set ( password property , passwd ) ; }


this test validates the correctness of submit application in case the cluster is composed of only 1 bad sub cluster

public void test submit application one bad s c ( ) throws yarn exception , i o exception , interrupted exception { system out println ( " test submit application with one bad sub cluster " ) ; setup cluster ( arrays as list ( bad 2 ) ) ; final application id app id = application id new instance ( system current time millis ( ) , 1 ) ; final submit application request request = mock submit application request ( app id ) ; try { interceptor submit application ( request ) ; assert fail ( ) ; } catch ( exception e ) { system out println ( e ) ; assert assert true ( e get message ( ) equals ( federation policy utils no active subcluster available ) ) ; } }


convenience method to create a model with three orthonormal vectors shapes the resources the material might contain are not managed , use { @ link model # manage disposable ( disposable ) } to add those to the model

public model create x y z coordinates ( float axis length , float cap length , float stem thickness , int divisions , int primitive type , material material , long attributes ) { begin ( ) ; mesh part builder part builder ; node node = node ( ) ; part builder = part ( " xyz " , primitive type , attributes , material ) ; part builder set color ( color red ) ; part builder arrow ( 0 , 0 , 0 , axis length , 0 , 0 , cap length , stem thickness , divisions ) ; part builder set color ( color green ) ; part builder arrow ( 0 , 0 , 0 , 0 , axis length , 0 , cap length , stem thickness , divisions ) ; part builder set color ( color blue ) ; part builder arrow ( 0 , 0 , 0 , 0 , 0 , axis length , cap length , stem thickness , divisions ) ; return end ( ) ; }


how long the resources will be kept open to support the scroll request

public time value keep alive ( ) { return keep alive ; }


method to decide whether the element signals the end of the stream if true is returned the element won ' t be emitted

boolean is end of stream ( t next element ) ;


static void reset buffer manager ( ) { buffer manager = null ; }


find the fields constant that matches name , or null if its not found

public static fields find by name ( string name ) { return by name get ( name ) ; }


return the grammar that imported us and our parents return this if we ' re root

public grammar get outermost grammar ( ) { if ( parent = = null ) return this ; return parent get outermost grammar ( ) ; }


a sensible definition of { @ link # to string } in terms of { @ link # iterator } if you override { @ link # iterator } , you may wish to override { @ link # to string } to forward to this implementation

protected string standard to string ( ) { return collections 2 to string impl ( this ) ; }


public bean definition builder set scope ( @ nullable string scope ) { this bean definition set scope ( scope ) ; return this ; }


public big decimal get attribute number ( ) { return attribute number ; }


static < t extends comparable > general range < t > from ( range < t > range ) { @ nullable t lower endpoint = range has lower bound ( ) ? range lower endpoint ( ) : null ; bound type lower bound type = range has lower bound ( ) ? range lower bound type ( ) : open ; @ nullable t upper endpoint = range has upper bound ( ) ? range upper endpoint ( ) : null ; bound type upper bound type = range has upper bound ( ) ? range upper bound type ( ) : open ; return new general range < t > ( ordering natural ( ) , range has lower bound ( ) , lower endpoint , lower bound type , range has upper bound ( ) , upper endpoint , upper bound type ) ; }


create a new method parameter for the given method or constructor this is a convenience factory method for scenarios where a method or constructor reference is treated in a generic fashion

public static method parameter for executable ( executable executable , int parameter index ) { if ( executable instanceof method ) { return new method parameter ( ( method ) executable , parameter index ) ; } else if ( executable instanceof constructor ) { return new method parameter ( ( constructor < ? > ) executable , parameter index ) ; } else { throw new illegal argument exception ( " not a method / constructor : " + executable ) ; } }


public static request matcher request to ( uri uri ) { assert not null ( uri , " ' uri ' must not be null " ) ; return request - > assert equals ( " unexpected request " , uri , request get u r i ( ) ) ; }


to watermark from the consumer side always increase schema : ( key , timestamp , source instance id ) producer parallelism = 2 ; kafka partition # = 3 ; consumer parallelism = 3

private void test watermark incremental ( int num elements per producer ) throws exception { time characteristic time characteristic = event time ; string topic = topic ( " test watermark incremental " , time characteristic ) ; final int number of partitions = 3 ; final int producer parallelism = 2 ; create test topic ( topic , number of partitions , 1 ) ; final stream execution environment env = create environment ( producer parallelism , time characteristic ) ; keyed stream < tuple 3 < integer , long , integer > , tuple > keyed stream = create kafka shuffle ( env , topic , num elements per producer , producer parallelism , time characteristic , number of partitions , true ) ; keyed stream process ( new watermark validator ( ) ) set parallelism ( number of partitions ) map ( new element count no more than validator ( num elements per producer * producer parallelism ) ) set parallelism ( 1 ) map ( new element count no less than validator ( num elements per producer * producer parallelism ) ) set parallelism ( 1 ) ; try execute ( env , topic ) ; delete test topic ( topic ) ; }


get the rest value used for determining the displacement of the spring

public double get end value ( ) { return m end value ; }


this test creates a dynamic config of new format the dynamic config is written in static config file it checks that the client port will be read from the dynamic config

public void test client port in static file ( ) throws exception { client base setup test env ( ) ; final int client port = port assignment unique ( ) ; string quorum cfg section = " server 1 = 127 0 0 1 : " + ( port assignment unique ( ) ) + " : " + ( port assignment unique ( ) ) + " : participant ; " + client port + " \ n " ; main thread mt = new main thread ( 1 , quorum cfg section , false ) ; verify standalone ( mt , client port ) ; }


tests the failure response on a rejected execution , because the query executor has been closed

public void test query executor shut down ( ) throws throwable { kv state registry registry = new kv state registry ( ) ; atomic kv state request stats stats = new atomic kv state request stats ( ) ; kv state server impl local test server = new kv state server impl ( inet address get local host ( ) get host name ( ) , collections singleton list ( 0 ) iterator ( ) , 1 , 1 , new kv state registry ( ) , new disabled kv state request stats ( ) ) ; local test server start ( ) ; local test server shutdown ( ) ; assert true ( local test server get query executor ( ) is terminated ( ) ) ; message serializer < kv state internal request , kv state response > serializer = new message serializer < > ( new kv state internal request kv state internal request deserializer ( ) , new kv state response kv state response deserializer ( ) ) ; kv state server handler handler = new kv state server handler ( local test server , registry , serializer , stats ) ; embedded channel channel = new embedded channel ( get frame decoder ( ) , handler ) ; int num key groups = 1 ; abstract state backend abstract backend = new memory state backend ( ) ; dummy environment dummy env = new dummy environment ( " test " , 1 , 0 ) ; dummy env set kv state registry ( registry ) ; keyed state backend < integer > backend = create keyed state backend ( registry , num key groups , abstract backend , dummy env ) ; final test registry listener registry listener = new test registry listener ( ) ; registry register listener ( dummy env get job i d ( ) , registry listener ) ; / / register state value state descriptor < integer > desc = new value state descriptor < > ( " any " , int serializer instance ) ; desc set queryable ( " vanilla " ) ; backend get partitioned state ( void namespace instance , void namespace serializer instance , desc ) ; assert true ( registry listener registration name equals ( " vanilla " ) ) ; kv state internal request request = new kv state internal request ( registry listener kv state id , new byte [ 0 ] ) ; byte buf ser request = message serializer serialize request ( channel alloc ( ) , 282872l , request ) ; / / write the request and wait for the response channel write inbound ( ser request ) ; byte buf buf = ( byte buf ) read inbound blocking ( channel ) ; buf skip bytes ( 4 ) ; / / skip frame length / / verify the response assert equals ( message type request failure , message serializer deserialize header ( buf ) ) ; request failure response = message serializer deserialize request failure ( buf ) ; buf release ( ) ; assert true ( response get cause ( ) get message ( ) contains ( " rejected execution exception " ) ) ; assert equals ( 1l , stats get num requests ( ) ) ; assert equals ( 1l , stats get num failed ( ) ) ; local test server shutdown ( ) ; }


return an input stream to read the contents of the file from the user is responsible for closing the returned stream

input stream get input stream ( ) throws i o exception ;


compares the two specified { @ code int } values , treating them as unsigned values between { @ code 0 } and { @ code 2 ^ 32 - 1 } inclusive < b > java 8 users : < b > use { @ link integer # compare unsigned ( int , int ) } instead

public static int compare ( int a , int b ) { return ints compare ( flip ( a ) , flip ( b ) ) ; }


returns whether incremental mount is enabled or not in this component

public boolean is incremental mount enabled ( ) { return m incremental mount enabled ; }


inject the p - code for a different instruction at this point in the p - code generation for current instruction

private void append cross build ( op tpl bld , int secnum ) throws unknown instruction exception , memory access exception { if ( secnum > = 0 ) { throw new sleigh exception ( " crossbuild recursion problem for instruction at " + walker get addr ( ) ) ; } secnum = ( int ) bld get input ( ) [ 1 ] get offset ( ) get real ( ) ; varnode tpl vn = bld get input ( ) [ 0 ] ; address space spc = vn get space ( ) fix space ( walker ) ; address addr = spc get truncated address ( vn get offset ( ) fix ( walker ) , false ) ; / / translate the address into the overlayspace if we have an overlayspace if ( overlayspace ! = null ) { addr = overlayspace get overlay address ( addr ) ; } parser walker oldwalker = walker ; long olduniqueoffset = uniqueoffset ; set unique offset ( addr ) ; try { parsercontext = ( sleigh parser context ) instcontext get parser context ( addr ) ; } catch ( unknown context exception e ) { throw new unknown instruction exception ( " could not find cached crossbuild parser context " ) ; } walker = new parser walker ( parsercontext , oldwalker get parser context ( ) ) ; walker base state ( ) ; constructor ct = walker get constructor ( ) ; construct tpl construct = ct get named templ ( secnum ) ; if ( construct = = null ) { build empty ( ct , secnum ) ; } else { build ( construct , secnum ) ; } walker = oldwalker ; parsercontext = walker get parser context ( ) ; uniqueoffset = olduniqueoffset ; }


public collection < r m container > get reserved containers ( ) { return reserved ; }


async observable and semaphore isolation user provided thread [ rx new thread ] does everything note : request context will not exist on that thread an async observable running on its own thread will not have access to the request context unless the user manages the context

public void test timeout with fallback request context with semaphore isolated asynchronous observable ( ) { request context test results results = test request context on timeout with fallback ( execution isolation strategy semaphore , schedulers new thread ( ) ) ; assert false ( results is context initialized get ( ) ) ; / / it won ' t have request context as it ' s on a user provided thread / scheduler assert true ( results origin thread get ( ) get name ( ) starts with ( " rx new thread " ) ) ; / / the user provided thread / scheduler assert true ( results is context initialized observe on get ( ) ) ; / / the timeout captures the context so it exists assert true ( results observe on thread get ( ) get name ( ) starts with ( " rx new thread " ) ) ; / / the user provided thread / scheduler / / semaphore isolated assert false ( results command is executed in thread ( ) ) ; hystrix circuit breaker factory reset ( ) ; }


creates a deferred { @ link data buffer } containing the given bytes

protected mono < data buffer > data buffer ( byte [ ] bytes ) { return mono from callable ( ( ) - > { data buffer data buffer = this buffer factory allocate buffer ( bytes length ) ; data buffer write ( bytes ) ; return data buffer ; } ) ; }


public void clear ( ) { chunk = null ; end of stream = false ; }


set the name of the cache region for queries executed by this template if this is specified , it will be applied to all query and criteria objects created by this template ( including all queries through find methods ) the cache region will not take effect unless queries created by this template are configured to be cached via the " cache queries " property

public void set query cache region ( @ nullable string query cache region ) { this query cache region = query cache region ; }


public locals array copy ( ) { return new locals array set ( this ) ; }


public void set context range ( address addr , int num , int mask , int value ) { int [ ] newcontext = create context ( addr ) ; int val = newcontext [ num ] ; val & = ~ mask ; / / clear range to zero val | = value ; newcontext [ num ] = val ; }


returns the target dependencies ' { @ link label } s of the passed in target { @ code label } s

protected map < sky key , iterable < sky key > > get fwd dep labels ( iterable < sky key > target labels ) throws interrupted exception { preconditions check state ( iterables all ( target labels , is label ) , " expected all labels : % s " , target labels ) ; return graph get direct deps ( target labels ) entry set ( ) stream ( ) collect ( immutable map to immutable map ( map entry : : get key , entry - > iterables filter ( entry get value ( ) , is label ) ) ) ; }


< code > optional aapt pb array array = 4 ; < code >


normally , a workspace is assigned by { @ link hudson model run run execution } , but this lets you set the workspace in case { @ link abstract build } is created without a build

protected void set workspace ( @ non null file path ws ) { this workspace = ws get remote ( ) ; }


listenable future < list < entity subtype > > find tenant entity view types async ( uuid tenant id ) ;


when building a proto library with multiple srcs ( say foo proto and bar proto ) , we should allow foo proto to import bar proto without tripping strict - deps checking this means that - - direct dependencies should list the srcs

public void test descriptor set output strict deps multiple srcs ( ) throws exception { use configuration ( " - - proto compiler = / / proto : compiler " , " - - strict proto deps = error " ) ; configured target target = scratch configured target ( " x " , " foo " , test constants load proto library , " proto library ( name = ' foo ' , srcs = [ ' foo proto ' , ' bar proto ' ] ) " ) ; artifact file = get first artifact ending with ( get files to build ( target ) , " proto bin " ) ; assert that ( file get root relative path string ( ) ) is equal to ( " x / foo - descriptor - set proto bin " ) ; assert that ( get generating spawn action ( file ) get remaining arguments ( ) ) contains at least ( " - - direct dependencies " , " x / foo proto : x / bar proto " ) in order ( ) ; }


get all the stack variables in the negative portion of the stack this excludes any variables defined before the parameter offset if the parameter offset is negative

private variable [ ] get negative variables ( ) { if ( variables is empty ( ) ) { return empty array ; } int length = variables size ( ) ; / / find the end of the negatives int index = 0 ; for ( index = 0 ; index < length ; index + + ) { variable var = variables get ( index ) ; if ( var get data type ( ) is deleted ( ) ) { variables remove ( index ) ; continue ; } int start = var get stack offset ( ) ; if ( start > = 0 | | start > get parameter offset ( ) ) { break ; } } if ( index = = 0 ) { return empty array ; } / / return the variables in the order of - 1 to - n list < variable > vars = variables sub list ( 0 , index ) ; int size = vars size ( ) ; variable [ ] retvars = new variable [ size ] ; int pos = size - 1 ; for ( int i = 0 ; i < size ; i + + , pos - - ) { retvars [ pos ] = vars get ( i ) ; } return retvars ; }


gets the evaluation result for this metric

optional < ? extends evaluation metric result > get result ( ) ;


returns the vertices of the given graph in post - order , which is the order the vertices are last visited when performing a depth - first traversal

public static < v , e extends g edge < v > > list < v > post order ( g directed graph < v , e > g , graph navigator < v , e > navigator ) { depth first sorter < v , e > sorter = new depth first sorter < > ( g , navigator ) ; list < v > list = sorter get vertices post order ( ) ; sorter dispose ( ) ; return list ; }


checks whether this string value starts with the given prefix string

public boolean starts with ( char sequence prefix ) { return starts with ( prefix , 0 ) ; }