note that this is just a basic check whether the file is zlib compressed other checks ( e g the magic bytes of the binary profile file ) are done later

private static boolean is old binary profile ( file profile ) { try ( input stream input stream = new file input stream ( profile ) ) { byte [ ] magic bytes = new byte [ 2 ] ; int num bytes read = input stream read ( magic bytes ) ; if ( num bytes read = = 2 & & magic bytes [ 0 ] = = ( byte ) 0x 7 8 & & ( magic bytes [ 1 ] = = ( byte ) 0x 0 1 | | magic bytes [ 1 ] = = ( byte ) 0x 9 c | | magic bytes [ 1 ] = = ( byte ) 0x d a ) ) { return true ; } } catch ( exception e ) { / / silently ignore any exception } return false ; }


escape characters that are special to graphviz

private static string escape special characters ( string label ) { return label replace ( " < " , " \ \ < " ) replace ( " > " , " \ \ > " ) replace ( " \ " " , " \ \ \ " " ) ; }


mark the given offset as having a property

void add ( short offset ) { add key ( offset ) ; }


call < pet > get pet by id ( @ retrofit 2 http path ( " pet id " ) long pet id ) ;


checkpoint stats counts create snapshot ( ) { return new checkpoint stats counts ( num restored checkpoints , num total checkpoints , num in progress checkpoints , num completed checkpoints , num failed checkpoints ) ; }


public string get name ( ) { return get contents name ( ) + " " + stream index ; }


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 " ) ; }


the radius of the distortion , ranging from 0 0 to 1 0 , with a default of 0 5

public void set radius ( float radius ) { this radius = radius ; set float ( radius location , radius ) ; }


this method is called for each joined pair of elements it can output zero or more elements through the provided { @ link collector } and has access to the timestamps of the joined elements and the result through the { @ link context }

public abstract void process element ( in1 left , in2 right , context ctx , collector < out > out ) throws exception ;


helper method to access package private method to set datagram socket needed for unit test

public static void set datagram socket ( abstract ganglia sink ganglia sink , datagram socket datagram socket ) { ganglia sink set datagram socket ( datagram socket ) ; }


public static void put warning cookie ( final request context context , final boolean cookie value ) { context get flow scope ( ) put ( " warn cookie value " , cookie value ) ; }


method : only for regex , parse regex group when regex include group

public static list < string > parse regex group ( final string string , final string regex ) { list < string > group list = null ; if ( string ! = null & & regex ! = null ) { pattern pattern = pattern compile ( regex ) ; matcher matcher = pattern matcher ( string ) ; int group count = matcher group count ( ) ; int count = 1 ; group list = new array list < string > ( ) ; if ( matcher find ( ) ) { while ( count < = group count ) { group list add ( matcher group ( count ) ) ; count + + ; } } } return group list ; }


private void read dictionary id data ( int total , writable int vector c , int row id ) { int left = total ; while ( left > 0 ) { if ( this current count = = 0 ) { this read next group ( ) ; } int n = math min ( left , this current count ) ; switch ( mode ) { case rle : c set ints ( row id , n , current value ) ; break ; case packed : c set ints ( row id , n , current buffer , current buffer idx ) ; current buffer idx + = n ; break ; } row id + = n ; left - = n ; current count - = n ; } }


public void add pet ( pet body ) { / / todo : implement }


private void copy table ( table old table , packed d b handle new handle ) throws i o exception , cancelled exception { / / pull out table configuration elements string table name = old table get name ( ) ; / / name schema schema = old table get schema ( ) ; / / schema int [ ] indexed columns = old table get indexed columns ( ) ; / / secondardy indices table new table = new handle create table ( table name , schema , indexed columns ) ; / / create new table monitor set message ( " copying table : " + table name ) ; monitor set maximum ( old table get record count ( ) ) ; monitor set progress ( 0 ) ; record iterator iterator = old table iterator ( ) ; while ( iterator has next ( ) ) { / / iterate through old records d b record record = iterator next ( ) ; new table put record ( record ) ; / / copy as is into new table monitor check canceled ( ) ; monitor increment progress ( 1 ) ; } }


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


creates a new listenable future - style stub that supports unary calls on the service

public static channelz future stub new future stub ( io grpc channel channel ) { io grpc stub abstract stub stub factory < channelz future stub > factory = new io grpc stub abstract stub stub factory < channelz future stub > ( ) { @ java lang override public channelz future stub new stub ( io grpc channel channel , io grpc call options call options ) { return new channelz future stub ( channel , call options ) ; } } ; return channelz future stub new stub ( factory , channel ) ; }


declare that create operator will not be called any more for the specified lifespan , and release any resources associated with this factory this method will be called only once for each lifespan implementation doesn ' t need to worry about duplicate invocations it is guaranteed that this method will be invoked for all applicable driver groups before { @ link # no more operators ( ) } is invoked

default void no more operators ( lifespan lifespan ) { / / do nothing }


public constant get constant ( ) { return constant ; }


returns the set of advertised transitive info providers when computing the set of aspects required for a rule , only the providers listed here are considered the presence of a provider here does not mean that the rule < b > must < b > implement said provider , merely that it < b > can < b > after the configured target is constructed from this rule , aspects will be filtered according to the set of actual providers this is here so that we can do the loading phase overestimation required for " blaze query " , which does not have the configured targets available

public advertised provider set get advertised providers ( ) { return advertised providers ; }


public static model and view produce error view ( final exception e ) { return new model and view ( cas webflow constants view id service error , collection utils wrap ( " root cause exception " , e ) ) ; }


resource to uri res 2 uri ( [ res type ] [ res name ] ) - > res 2 uri ( drawableicon ) , res 2 uri ( rawicon ) res 2 uri ( [ resource id ] ) - > res 2 uri ( r drawable icon )

public static uri res 2 uri ( string res path ) { return uri parse ( " android resource : / / " + utils get app ( ) get package name ( ) + " / " + res path ) ; }


public acl permission type permission type ( ) { return data permission type ( ) ; }


convenient short - cut for { @ code get a c l ( ) has permission 2 ( a , permission ) }

default boolean has permission 2 ( @ non null authentication a , @ non null permission permission ) { if ( a equals ( acl system2 ) ) { return true ; } return get a c l ( ) has permission 2 ( a , permission ) ; }


this creates a vanilla { @ link jdbi } instance based on the specified data source ; this can be overridden if required

protected jdbi new instance ( final managed data source data source ) { return jdbi create ( data source ) ; }


returns true if field corresponding to field i d is set ( has been assigned a value ) and false otherwise

public boolean is set ( fields field ) { if ( field = = null ) { throw new illegal argument exception ( ) ; } switch ( field ) { case arg : return is set arg ( ) ; } throw new illegal state exception ( ) ; }


updates the default references for a new or updated instruction

private void add references for instruction ( instruction d b inst ) { list < reference > old ref list = null ; if ( redisassembly mode ) { for ( reference ref : ref manager get references from ( inst get min address ( ) ) ) { if ( ref get source ( ) ! = source type default | | ! ref is memory reference ( ) ) { continue ; } if ( old ref list = = null ) { old ref list = new array list < > ( ) ; } old ref list add ( ref ) ; } } instruction prototype prototype = inst get prototype ( ) ; address [ ] flow addrs = prototype get flows ( inst ) ; int remaining addrs = flow addrs length ; int op count = prototype get num operands ( ) ; for ( int op index = 0 ; op index < op count ; op index + + ) { / / don ' t go through the instruction , go to the prototype , / / we only want the addresses reported by the prototype , / / not any addresses that are added by the user int ref cnt = 0 ; reference operand primary ref = null ; / / first look through the pieces of the operand to find the addresses array list < object > op list = prototype get op representation list ( op index , inst ) ; for ( object obj : op list ) { if ( obj instanceof address ) { address ref addr = ( address ) obj ; + + ref cnt ; ref type ref type = get operand memory reference type ( inst , op index , flow addrs , ref addr ) ; if ( ref type ! = null ) { operand primary ref = add default memory reference if missing ( inst , op index , ref addr , ref type , old ref list , operand primary ref ) ; - - remaining addrs ; } } } / / if there are still more addresses on this operand , see if the whole operand has any if ( ref cnt = = 0 & & remaining addrs > 0 ) { address ref addr = prototype get address ( op index , inst ) ; if ( ref addr ! = null ) { ref type ref type = get operand memory reference type ( inst , op index , flow addrs , ref addr ) ; if ( ref type ! = null ) { operand primary ref = add default memory reference if missing ( inst , op index , ref addr , ref type , old ref list , operand primary ref ) ; - - remaining addrs ; } } } if ( operand primary ref ! = null & & ! operand primary ref is primary ( ) ) { / / ensure that we have a primary ref on the operand if one exists ref manager set primary ( operand primary ref , true ) ; } } reference mnemonic primary ref = null ; for ( address flow addr : flow addrs ) { if ( flow addr ! = null & & flow addr is memory address ( ) ) { flow type flow type = ref type factory get default flow type ( inst , flow addr , false ) ; if ( flow type = = null ) { flow type = ref type invalid ; } boolean is fallthrough = ( flow type is jump ( ) & & flow addr equals ( inst get max address ( ) next ( ) ) ) ; if ( ! is fallthrough ) { mnemonic primary ref = add default memory reference if missing ( inst , reference mnemonic , flow addr , flow type , old ref list , mnemonic primary ref ) ; } } } if ( mnemonic primary ref ! = null & & ! mnemonic primary ref is primary ( ) ) { / / ensure that we have a primary ref on the mnemonic if one exists ref manager set primary ( mnemonic primary ref , true ) ; } if ( old ref list ! = null & & ! old ref list is empty ( ) ) { for ( reference ref : old ref list ) { ref manager delete ( ref ) ; } } }


simplifies a list of terms and combines them into an or modifies the list in place

private rex node simplify ors ( list < rex node > terms , rex unknown as unknown as ) { final sarg collector sarg collector = new sarg collector ( rex builder , false ) ; final list < rex node > new terms = new array list < > ( ) ; terms for each ( t - > sarg collector accept ( t , new terms ) ) ; if ( sarg collector need to fix ( ) ) { terms clear ( ) ; new terms for each ( t - > terms add ( sarg collector fix ( rex builder , t ) ) ) ; } / / calcite - 3198 auxiliary map to simplify cases like : / / x < > a or x < > b = > x is not null or null / / the map key will be the ' x ' ; and the value the first call ' x < > a ' that is found , / / or ' x is not null ' if a simplification takes place ( because another ' x < > b ' is found ) final map < rex node , rex node > not equals comparison map = new hash map < > ( ) ; final rex literal true literal = rex builder make literal ( true ) ; for ( int i = 0 ; i < terms size ( ) ; i + + ) { final rex node term = terms get ( i ) ; switch ( term get kind ( ) ) { case literal : if ( rex literal is null literal ( term ) ) { if ( unknown as = = false ) { terms remove ( i ) ; - - i ; continue ; } else if ( unknown as = = true ) { return true literal ; } } else { if ( rex literal boolean value ( term ) ) { return term ; / / true } else { terms remove ( i ) ; - - i ; continue ; } } break ; case not equals : final comparison not equals comparison = comparison of ( term ) ; if ( not equals comparison ! = null ) { / / we are dealing with a x < > a term , check if we saw before another / / not equals involving x final rex node prev not equals = not equals comparison map get ( not equals comparison ref ) ; if ( prev not equals = = null ) { / / this is the first not equals involving x , put it in the map not equals comparison map put ( not equals comparison ref , term ) ; } else { / / there is already in the map another not equals involving x : / / - if it is already an is not null : it was already simplified , / / ignore this term / / - if it is not an is not null ( i e it is a not equals ) : check / / comparison values if ( prev not equals get kind ( ) ! = sql kind is not null ) { final comparable comparable 1 = not equals comparison literal get value ( ) ; final comparable comparable 2 = comparison of ( prev not equals ) literal get value ( ) ; / / noinspection unchecked if ( comparable 1 compare to ( comparable 2 ) ! = 0 ) { / / x < > a or x < > b = > x is not null or null final rex node is not null = rex builder make call ( sql std operator table is not null , not equals comparison ref ) ; final rex node constant null = rex builder make null literal ( true literal get type ( ) ) ; final rex node new condition = simplify ( rex builder make call ( sql std operator table or , is not null , constant null ) , unknown as ) ; if ( new condition is always true ( ) ) { return true literal ; } not equals comparison map put ( not equals comparison ref , is not null ) ; final int pos = terms index of ( prev not equals ) ; terms set ( pos , new condition ) ; } } terms remove ( i ) ; - - i ; continue ; } } break ; } } return rex util compose disjunction ( rex builder , terms ) ; }


set hibernate properties , such as " hibernate dialect " note : do not specify a transaction provider here when using spring - driven transactions it is also advisable to omit connection provider settings and use a spring - set data source instead

public void set hibernate properties ( properties hibernate properties ) { this hibernate properties = hibernate properties ; }


public query result select ( final string query , final optional < json object > parameters ) { val formatted query = string format ( " select * from ` % s ` where % s " , properties get bucket ( ) , query ) ; val options = query options query options ( ) scan consistency ( query scan consistency value of ( properties get scan consistency ( ) ) ) ; parameters if present ( options : : parameters ) ; return execute query ( options , formatted query ) ; }


this method asserts that the weapon object that is passed is an instance of the clazz

private void verify weapon ( weapon weapon , class < ? > clazz ) { assert true ( clazz is instance ( weapon ) , " weapon must be an object of : " + clazz get name ( ) ) ; }


get the instance of noop action listener cast appropriately

public static < response > task listener < response > instance ( ) { return ( task listener < response > ) instance ; }


add a set of deleted indexes to the list of tombstones in the cluster state

public builder add tombstones ( final collection < index > indices ) { for ( index index : indices ) { add tombstone ( index ) ; } return this ; }


reads all bytes from input stream and writes them to output stream when all bytes are read output stream to byte buffer is called and obtained memory pooled byte buffer is returned

memory pooled byte buffer new byte buf ( input stream input stream , memory pooled byte buffer output stream output stream ) throws i o exception { m pooled byte streams copy ( input stream , output stream ) ; return output stream to byte buffer ( ) ; }


equivalent semantic value to was run { @ code status = " run | notrun " } on the xml schema

public boolean was run ( ) { return was run ; }


， ， copy from commons lang 3 5 string utils

public static list < string > split ( @ nullable final string str , final char separator char ) { return split ( str , separator char , 10 ) ; }


protected void configure oidc client ( final collection < indirect client > properties ) { val pac 4j properties = cas properties get authn ( ) get pac 4j ( ) ; pac 4j properties get oidc ( ) for each ( oidc - > { val client = get oidc client from ( oidc ) ; if ( client ! = null ) { logger debug ( " created client [ { } ] " , client ) ; properties add ( client ) ; } } ) ; }


@ test public void test left recursive rule ref with arg ( ) throws exception { string grammar = " grammar t ; \ n " + " statement \ n " + " locals [ scope scope ] \ n " + " : expression a [ $ scope ] ' ; ' \ n " + " ; \ n " + " expression a [ scope scope ] \ n " + " : atom [ $ scope ] \ n " + " | expression a [ $ scope ] ' [ ' expression a [ $ scope ] ' ] ' \ n " + " ; \ n " + " atom [ scope scope ] \ n " + " : ' dummy ' \ n " + " ; \ n " ; string expected = " error ( " + error type nonconforming lr rule code + " ) : t g 4 : 6 : 0 : rule expression a is left recursive but doesn ' t conform to a pattern antlr can handle \ n " ; test errors ( new string [ ] { grammar , expected } , false ) ; }


ensure there ' s no query limit problem around links

@ test protected void many links ( ) throws exception { int count = 1000 ; / / larger than 10 , which is the default es search limit that tripped this list < span > spans = new array list < > ( count ) ; for ( int i = 1 ; i < = count ; i + + ) { string trace id = new trace id ( ) ; endpoint web = frontend to builder ( ) service name ( " web - " + i ) build ( ) ; endpoint app = backend to builder ( ) service name ( " app - " + i ) build ( ) ; endpoint db = db to builder ( ) service name ( " db - " + i ) build ( ) ; spans add ( span new builder ( ) trace id ( trace id ) id ( " 10 " ) name ( " get " ) timestamp ( ( today + 50l ) * 1000l ) duration ( 250l * 1000l ) kind ( kind client ) local endpoint ( web ) build ( ) ) ; spans add ( span new builder ( ) trace id ( trace id ) id ( " 10 " ) name ( " get " ) shared ( true ) timestamp ( ( today + 100 ) * 1000l ) duration ( 150 * 1000l ) kind ( kind server ) local endpoint ( app ) build ( ) ) ; spans add ( span new builder ( ) trace id ( trace id ) parent id ( " 10 " ) id ( " 11 " ) name ( " get " ) timestamp ( ( today + 150l ) * 1000l ) duration ( 50l * 1000l ) kind ( kind client ) local endpoint ( app ) remote endpoint ( db ) build ( ) ) ; } process dependencies ( spans ) ; list < dependency link > links = store ( ) get dependencies ( end ts ( spans ) , day ) execute ( ) ; assert that ( links ) has size ( count * 2 ) ; / / web - ? - > app - ? , app - ? - > db - ? assert that ( links ) extracting ( dependency link : : call count ) all satisfy ( call count - > assert that ( call count ) is equal to ( 1 ) ) ; }


{ @ inherit doc } the default implementation returns the result of calling { @ link # visit children } on { @ code ctx }

@ override public t visit comp ( painless parser comp context ctx ) { return visit children ( ctx ) ; }


returns an iterator over elements of type { @ code t } the elements are returned in nondecreasing order according to the associated { @ link # comparator }


public int list get cases ( ) { return cases ; }


{ @ linkplan # call count count of calls } known to be errors ( having one { @ linkplain span # tags ( ) tag } named " error " )

public long error count ( ) { return error count ; }


protected list < row lock > collect row locks ( branch session branch session ) { list < row lock > locks = new array list < > ( ) ; if ( branch session = = null | | string utils is blank ( branch session get lock key ( ) ) ) { return locks ; } string xid = branch session get xid ( ) ; string resource id = branch session get resource id ( ) ; long transaction id = branch session get transaction id ( ) ; string lock key = branch session get lock key ( ) ; return collect row locks ( lock key , resource id , xid , transaction id , branch session get branch id ( ) ) ; }


tests the case where one dependency is valid and another one isn ' t

public void one dependency is invalid ( ) throws exception { new environment group maker ( " buildenv / foo " ) set environments ( " a " , " b " ) set defaults ( " a " ) make ( ) ; scratch file ( " hello / build " , get rule def ( " sh library " , " bad dep " , constrained to ( " / / buildenv / foo : b " ) ) , get rule def ( " sh library " , " good dep " , compatible with ( " / / buildenv / foo : b " ) ) , get rule def ( " sh library " , " depender " , constrained to ( " / / buildenv / foo : a " , " / / buildenv / foo : b " ) , get attr def ( " deps " , " good dep " , " bad dep " ) ) ) ; reporter remove handler ( fail fast handler ) ; assert that ( get configured target ( " / / hello : depender " ) ) is null ( ) ; assert contains event ( " / / hello : bad dep doesn ' t support expected environment : / / buildenv / foo : a " ) ; assert does not contain event ( " / / hello : good dep " ) ; }


lifted from core ' s rollup job caps , so that we can test without having to include this actual logic in the request

private static map < string , rollup job caps rollup field caps > create rollup field caps ( final rollup job config rollup job config ) { final map < string , list < map < string , object > > > temp field caps = new hash map < > ( ) ; final group config group config = rollup job config get group config ( ) ; if ( group config ! = null ) { / / create rollup field caps for the date histogram final date histogram group config date histogram = group config get date histogram ( ) ; final map < string , object > date histogram agg cap = new hash map < > ( ) ; date histogram agg cap put ( " agg " , date histogram aggregation builder name ) ; date histogram agg cap put ( " interval " , date histogram get interval ( ) to string ( ) ) ; if ( date histogram get delay ( ) ! = null ) { date histogram agg cap put ( " delay " , date histogram get delay ( ) to string ( ) ) ; } date histogram agg cap put ( " time zone " , date histogram get time zone ( ) ) ; list < map < string , object > > date agg caps = temp field caps get or default ( date histogram get field ( ) , new array list < > ( ) ) ; date agg caps add ( date histogram agg cap ) ; temp field caps put ( date histogram get field ( ) , date agg caps ) ; / / create rollup field caps for the histogram final histogram group config histogram = group config get histogram ( ) ; if ( histogram ! = null ) { final map < string , object > histogram agg cap = new hash map < > ( ) ; histogram agg cap put ( " agg " , histogram aggregation builder name ) ; histogram agg cap put ( " interval " , histogram get interval ( ) ) ; arrays stream ( rollup job config get group config ( ) get histogram ( ) get fields ( ) ) for each ( field - > { list < map < string , object > > caps = temp field caps get or default ( field , new array list < > ( ) ) ; caps add ( histogram agg cap ) ; temp field caps put ( field , caps ) ; } ) ; } / / create rollup field caps for the term final terms group config terms = group config get terms ( ) ; if ( terms ! = null ) { final map < string , object > terms agg cap = singleton map ( " agg " , terms aggregation builder name ) ; arrays stream ( rollup job config get group config ( ) get terms ( ) get fields ( ) ) for each ( field - > { list < map < string , object > > caps = temp field caps get or default ( field , new array list < > ( ) ) ; caps add ( terms agg cap ) ; temp field caps put ( field , caps ) ; } ) ; } } / / create rollup field caps for the metrics final list < metric config > metrics config = rollup job config get metrics config ( ) ; if ( metrics config size ( ) > 0 ) { rollup job config get metrics config ( ) for each ( metric config - > { final list < map < string , object > > metrics = metric config get metrics ( ) stream ( ) map ( metric - > singleton map ( " agg " , ( object ) metric ) ) collect ( collectors to list ( ) ) ; metrics for each ( m - > { list < map < string , object > > caps = temp field caps get or default ( metric config get field ( ) , new array list < > ( ) ) ; caps add ( m ) ; temp field caps put ( metric config get field ( ) , caps ) ; } ) ; } ) ; } return collections unmodifiable map ( temp field caps entry set ( ) stream ( ) collect ( collectors to map ( map entry : : get key , e - > new rollup job caps rollup field caps ( e get value ( ) ) ) ) ) ; }


post storeorder : place an order for a pet

response entity < order > place order ( @ api param ( value = " order placed for purchasing the pet " , required = true ) @ valid @ request body order body ) ;


configure locations to serve static resources from based on pre - resolved { @ code resource } references

public resource handler registration add resource locations ( resource locations ) { this locations resources add all ( arrays as list ( locations ) ) ; return this ; }


returns < code > true < code > if this setting is deprecated , otherwise < code > false < code >

public boolean is deprecated ( ) { return properties contains ( property deprecated ) ; }


determine the http status code to apply for the given error view the default implementation returns the status code for the given view name ( specified through the { @ link # set status codes ( properties ) status codes } property ) , or falls back to the { @ link # set default status code default status code } if there is no match override this in a custom subclass to customize this behavior

protected integer determine status code ( http servlet request request , string view name ) { if ( this status codes contains key ( view name ) ) { return this status codes get ( view name ) ; } return this default status code ; }


public collection < couch db cas event > find by principal id ( final string principal id ) { return query view ( " by principal id " , principal id ) ; }


the first character position this span applies to , in utf - 16 offset < code > optional uint 3 2 first char = 2 ; < code >


gets the component id for the specified task id the component id maps to a component id specified for a spout or bolt in the topology definition

public string get component id ( int task id ) { if ( task id = = constants system task id ) { return constants system component id ; } else { return task to component get ( task id ) ; } }


clears some memory with the exact amount depending on the given level

public void trim memory ( int level ) { / / engine asserts this anyway when removing resources , fail faster and consistently util assert main thread ( ) ; / / request managers need to be trimmed before the caches and pools , in order for the latter to / / have the most benefit synchronized ( managers ) { for ( request manager manager : managers ) { manager on trim memory ( level ) ; } } / / memory cache needs to be trimmed before bitmap pool to trim re - pooled bitmaps too see # 687 memory cache trim memory ( level ) ; bitmap pool trim memory ( level ) ; array pool trim memory ( level ) ; }


returns a sequential { @ link stream } of the contents of { @ code iterable } , delegating to { @ link collection # stream } if possible

public static < t > stream < t > stream ( iterable < t > iterable ) { return ( iterable instanceof collection ) ? ( ( collection < t > ) iterable ) stream ( ) : stream support stream ( iterable spliterator ( ) , false ) ; }


this also verifies that the timestamps ouf side - emitted records is correct

public void test side output ( ) throws exception { keyed process operator < integer , integer , string > operator = new keyed process operator < > ( new side output process function ( ) ) ; one input stream operator test harness < integer , string > test harness = new keyed one input stream operator test harness < > ( operator , new identity key selector < > ( ) , basic type info int type info ) ; test harness setup ( ) ; test harness open ( ) ; test harness process element ( new stream record < > ( 42 , 17l / * timestamp * / ) ) ; concurrent linked queue < object > expected output = new concurrent linked queue < > ( ) ; expected output add ( new stream record < > ( " in : 42 " , 17l / * timestamp * / ) ) ; test harness util assert output equals ( " output was not correct " , expected output , test harness get output ( ) ) ; concurrent linked queue < stream record < integer > > expected int side output = new concurrent linked queue < > ( ) ; expected int side output add ( new stream record < > ( 42 , 17l / * timestamp * / ) ) ; concurrent linked queue < stream record < integer > > int side output = test harness get side output ( side output process function integer output tag ) ; test harness util assert output equals ( " side output was not correct " , expected int side output , int side output ) ; concurrent linked queue < stream record < long > > expected long side output = new concurrent linked queue < > ( ) ; expected long side output add ( new stream record < > ( 42l , 17l / * timestamp * / ) ) ; concurrent linked queue < stream record < long > > long side output = test harness get side output ( side output process function long output tag ) ; test harness util assert output equals ( " side output was not correct " , expected long side output , long side output ) ; test harness close ( ) ; }


create config strings that will be used for the test servers

private array list < string > build server strings ( ) { array list < string > server strings = new array list < string > ( ) ; for ( int i = 0 ; i < num servers ; i + + ) { client ports [ i ] = port assignment unique ( ) ; string server = " server " + i + " = localhost : " + port assignment unique ( ) + " : " + port assignment unique ( ) + " : participant ; " + " localhost : " + client ports [ i ] ; server strings add ( server ) ; } return server strings ; }


public void test array merger illegal argument exception ( ) { string [ ] string array = { " 1 " , " 2 " , " 3 " } ; integer [ ] integer array = { 3 , 4 , 5 } ; try { object result = array merger instance merge ( string array , null , integer array ) ; assertions fail ( " expected illegal argument exception for different arguments ' types " ) ; } catch ( illegal argument exception exception ) { assertions assert equals ( " arguments ' types are different " , exception get message ( ) ) ; } }


adds a field to be highlighted with default fragment size of 100 characters , and default number of fragments of 5 using the default encoder

public highlight builder field ( string name ) { return field ( new field ( name ) ) ; }


constructs and returns a metadata request builder for fetching cluster data and all active topics

protected metadata request builder new metadata request builder ( ) { return metadata request builder all topics ( ) ; }


set the { @ linkplain media type media type } of the body , as specified by the { @ code content - type } header

body builder content type ( media type content type ) ;


increment or decrement the number of bytes that have been allocated to service this request and potentially trigger a { @ link circuit breaking exception } the number of bytes allocated is automatically decremented with the circuit breaker service on closure of this aggregator if memory has been returned , decrement it without tripping the breaker for performance reasons subclasses should not call this millions of times each with small increments and instead batch up into larger allocations

protected long add request circuit breaker bytes ( long bytes ) { / / only use the potential to circuit break if bytes are being incremented if ( bytes > 0 ) { context breaker ( ) add estimate bytes and maybe break ( bytes , " < agg [ " + name + " ] > " ) ; } else { context breaker ( ) add without breaking ( bytes ) ; } this request bytes used + = bytes ; return request bytes used ; }


removes the mapping with the specified key from this map

public v remove ( long key ) { entry < v > entry = remove entry ( key ) ; if ( entry = = null ) return null ; v ret = entry value ; entry value = null ; entry key = long min value ; reuse after delete = entry ; return ret ; }


returns true if no tuple could ever satisfy this tuple domain

public boolean is none ( ) { return ! domains is present ( ) ; }


< code > optional bool sex = 5 ; < code >

public boolean get sex ( ) { return sex ; }


this method checks if { @ code serializer } supports { @ code null } value

public static < t > boolean check if null supported ( @ nonnull type serializer < t > serializer ) { int length = serializer get length ( ) > 0 ? serializer get length ( ) : 1 ; data output serializer dos = new data output serializer ( length ) ; try { serializer serialize ( null , dos ) ; } catch ( i o exception | runtime exception e ) { return false ; } check argument ( serializer get length ( ) < 0 | | serializer get length ( ) = = dos get copy of buffer ( ) length , " the serialized form of the null value should have the same length " + " as any other if the length is fixed in the serializer " ) ; data input deserializer dis = new data input deserializer ( dos get shared buffer ( ) ) ; try { check argument ( serializer deserialize ( dis ) = = null ) ; } catch ( i o exception e ) { throw new runtime exception ( string format ( " unexpected failure to deserialize just serialized null value with % s " , serializer get class ( ) get name ( ) ) , e ) ; } check argument ( serializer copy ( null ) = = null , " serializer % s has to be able properly copy null value if it can serialize it " , serializer get class ( ) get name ( ) ) ; return true ; }


public string last modified ( ) { return last modified ; }


builder for configuring and creating instances of { @ link modify kind set }

public static builder new builder ( ) { return new builder ( ) ; }


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


public okhttp 3 call get inventory call ( final api callback callback ) throws api exception { object local var post body = null ; / / create path and map variables string local var path = " / store / inventory " ; list < pair > local var query params = new array list < pair > ( ) ; list < pair > local var collection query params = new array list < pair > ( ) ; map < string , string > local var header params = new hash map < string , string > ( ) ; map < string , string > local var cookie params = new hash map < string , string > ( ) ; map < string , object > local var form params = new hash map < string , object > ( ) ; final string [ ] local var accepts = { " application / json " } ; final string local var accept = local var api client select header accept ( local var accepts ) ; if ( local var accept ! = null ) { local var header params put ( " accept " , local var accept ) ; } final string [ ] local var content types = { } ; final string local var content type = local var api client select header content type ( local var content types ) ; local var header params put ( " content - type " , local var content type ) ; string [ ] local var auth names = new string [ ] { " api key " } ; return local var api client build call ( local var path , " get " , local var query params , local var collection query params , local var post body , local var header params , local var cookie params , local var form params , local var auth names , callback ) ; }


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


public void clear memory caches ( ) { predicate < cache key > all predicate = new predicate < cache key > ( ) { @ override public boolean apply ( cache key key ) { return true ; } } ; m bitmap memory cache remove all ( all predicate ) ; m encoded memory cache remove all ( all predicate ) ; }


gets the current state true if the file exists , false if it doesn ' t

public boolean get ( ) { return state = file exists ( ) ; }


whether playback will proceed when { @ link # get playback state ( ) } = = { @ link # state ready }


tests if the file regions provided by the file region provider can belong to the providevolume

public void test provided volume contents ( ) throws i o exception { int expected blocks = 5 ; int min id = 0 ; / / use a path which has the same prefix as provided base path / / all these blocks can belong to the provided volume int blocks found = get blocks in provided volumes ( provided base path + " / test 1 / " , expected blocks , min id ) ; assert equals ( " number of blocks in provided volumes should be " + expected blocks , expected blocks , blocks found ) ; blocks found = get blocks in provided volumes ( " file : / " + provided base path + " / test 1 / " , expected blocks , min id ) ; assert equals ( " number of blocks in provided volumes should be " + expected blocks , expected blocks , blocks found ) ; / / use a path that is entirely different from the provided base path / / none of these blocks can belong to the volume blocks found = get blocks in provided volumes ( " randomtest 1 / " , expected blocks , min id ) ; assert equals ( " number of blocks in provided volumes should be 0 " , 0 , blocks found ) ; }


notes that an action has started , giving the key

void note action evaluation started ( action lookup data action lookup data , action action ) ;


returns an array of { @ link method } containing the methods declared by the class represented by the supplied class

static public method [ ] get declared methods ( class c ) { com badlogic gwtref client method [ ] methods = reflection cache get type ( c ) get declared methods ( ) ; method [ ] result = new method [ methods length ] ; for ( int i = 0 , j = methods length ; i < j ; i + + ) { result [ i ] = new method ( methods [ i ] ) ; } return result ; }


determines the addresses where one program initialized memory and the other didn ' t

address set get initialization differs address set ( address set view addrs ) { address set in common = pgm mem comp get addresses in common ( ) ; address set same type = pgm mem comp get same mem type addresses in common ( ) ; address set init differs = in common subtract ( same type ) ; if ( addrs ! = null ) { init differs = init differs intersect ( addrs ) ; } return init differs ; }


public string get index ( ) { return get result get index ( ) ; }


centers the dialog on the given component

public void set centered on component ( component c ) { if ( c = = null ) { set centered on screen ( ) ; return ; } if ( c instanceof hidden docking frame ) { set centered on screen ( ) ; return ; / / don ' t center over a hidden frame , as it may be is offscreen } if ( ! c is visible ( ) ) { / / hidden frames cause us to be put in the upper - left - - don ' t do that set centered on screen ( ) ; return ; } rectangle r = get bounds ( ) ; point p = window utilities center on component ( c , this ) ; r set location ( p ) ; set bounds ( r ) ; }


decode a specific range of bytes of the given byte array to a string using utf8

public static string bytes 2 string ( byte [ ] bytes , int offset , int length ) { return d f s util client bytes 2 string ( bytes , 0 , bytes length ) ; }


deregister the { @ link channel } of the { @ link channel promise } from { @ link event loop } and notify the { @ link channel promise } once the operation was complete

void deregister ( channel promise promise ) ;


variant of { @ link # register ( object ) } that also allows the caller to apply the properties from { @ link default codec config } to the given codec if you want to apply all the properties , prefer using { @ link # register with default config ( object ) } the consumer is called every time { @ link # get readers ( ) } or { @ link # get writers ( ) } are used to obtain the list of configured readers or writers

void register with default config ( object codec , consumer < default codec config > config consumer ) ;


public enum string enum get enum string ( ) { return enum string ; }


print a formatted string followed by a newline to the output stream

protected static void println ( print stream out , string format , object args ) { out println ( string format ( format , args ) ) ; }


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 ) ; }


escapes html special characters present in the string

public static string escape h t m l ( string string ) { if ( string = = null ) { return null ; } string builder sb = new string builder ( ) ; boolean last character was space = false ; char [ ] chars = string to char array ( ) ; for ( char c : chars ) { if ( c = = ' ' ) { if ( last character was space ) { last character was space = false ; sb append ( " & nbsp ; " ) ; } else { last character was space = true ; sb append ( " " ) ; } } else { last character was space = false ; switch ( c ) { case ' < ' : sb append ( " & lt ; " ) ; break ; case ' > ' : sb append ( " & gt ; " ) ; break ; case ' & ' : sb append ( " & amp ; " ) ; break ; case ' " ' : sb append ( " & quot ; " ) ; break ; default : sb append ( c ) ; break ; } } } return sb to string ( ) ; }


returns the amount of free physical memory in bytes

public long get free physical memory size ( ) { if ( get free physical memory size = = null ) { logger warn ( " get free physical memory size is not available " ) ; return 0 ; } try { final long free mem = ( long ) get free physical memory size invoke ( os mx bean ) ; if ( free mem < 0 ) { logger debug ( " os reported a negative free memory value [ { } ] " , free mem ) ; return 0 ; } return free mem ; } catch ( exception e ) { logger warn ( " exception retrieving free physical memory " , e ) ; return 0 ; } }


reads a repository location on disk and extracts the list of blobs for each shards

private map < string , blob store index shard snapshot > blobs in snapshot ( path repository location , string snapshot id ) throws i o exception { final map < string , blob store index shard snapshot > blobs per shard = new hash map < > ( ) ; for each file recursively ( repository location resolve ( " indices " ) , ( ( file , basic file attributes ) - > { final string file name = file get file name ( ) to string ( ) ; if ( file name equals ( blob store repository snapshot format blob name ( snapshot id ) ) ) { blobs per shard put ( string join ( " / " , snapshot id , file get parent ( ) get parent ( ) get file name ( ) to string ( ) , file get parent ( ) get file name ( ) to string ( ) ) , index shard snapshot format deserialize ( file name , x content registry ( ) , streams read fully ( files new input stream ( file ) ) ) ) ; } } ) ) ; return map copy of ( blobs per shard ) ; }


public static string read u t f ( data input in ) throws i o exception { return data input stream read u t f ( in ) ; }


creates a long buffer based on a newly allocated long array

public static long buffer allocate ( int capacity ) { if ( capacity < 0 ) { throw new illegal argument exception ( ) ; } return buffer factory new long buffer ( capacity ) ; }


returns true if all requested configuration fragment are present ( this may be slow )

public boolean has all fragments ( set < class < ? > > fragment classes ) { for ( class < ? > fragment class : fragment classes ) { if ( ! has fragment ( fragment class as subclass ( fragment class ) ) ) { return false ; } } return true ; }


protected body inserter < ? , ? super client http request > select body ( object obj , multi value map < string , object > form params , media type content type ) { if ( media type application form urlencoded equals ( content type ) ) { multi value map < string , string > map = new linked multi value map < > ( ) ; form params to single value map ( ) entry set ( ) for each ( es - > map add ( es get key ( ) , string value of ( es get value ( ) ) ) ) ; return body inserters from form data ( map ) ; } else if ( media type multipart form data equals ( content type ) ) { return body inserters from multipart data ( form params ) ; } else { return obj ! = null ? body inserters from object ( obj ) : null ; } }


public map < string , big decimal > get map number ( ) { return map number ; }


post pet { pet id } : updates a pet in the store with form data

completable future < response entity < void > > update pet with form ( @ api param ( value = " id of pet that needs to be updated " , required = true ) @ path variable ( " pet id " ) long pet id , @ api param ( value = " updated name of the pet " ) @ request param ( value = " name " , required = false ) string name , @ api param ( value = " updated status of the pet " ) @ request param ( value = " status " , required = false ) string status ) ;


the interface used by client to get a shell to a container

public abstract void shell to container ( container id container id , shell container command command ) throws i o exception ;


public void map integer test ( ) { / / todo : test map integer }


tests when the node returns data with a shard allocation id that does not match active allocation ids , it will be moved to ignore unassigned

public void test no matching allocation id found ( ) { routing allocation allocation = routing allocation with one primary no replicas ( yes allocation deciders ( ) , cluster recovered , " id 2 " ) ; test allocator add data ( node 1 , " id 1 " , random boolean ( ) ) ; allocate all unassigned ( allocation ) ; assert that ( allocation routing nodes changed ( ) , equal to ( true ) ) ; assert that ( allocation routing nodes ( ) unassigned ( ) ignored ( ) size ( ) , equal to ( 1 ) ) ; assert that ( allocation routing nodes ( ) unassigned ( ) ignored ( ) get ( 0 ) shard id ( ) , equal to ( shard id ) ) ; assert cluster health status ( allocation , cluster health status yellow ) ; }


checks to see whether or not this instance is immutable this is the same as calling { @ code ! is mutable ( ) }

public final boolean is immutable ( ) { return ! mutable ; }


internal method to simplify an expression unlike the public { @ link # simplify ( rex node ) } and { @ link # simplify unknown as false ( rex node ) } methods , never calls { @ link # verify ( rex node , rex node , rex unknown as ) } verify adds an overhead that is only acceptable for a top - level call

rex node simplify ( rex node e , rex unknown as unknown as ) { if ( strong is null ( e ) ) { / / only boolean null ( aka unknown ) can be converted to false even in / / unknown as = false mode , we must not convert a null integer ( say ) to false if ( e get type ( ) get sql type name ( ) = = sql type name boolean ) { switch ( unknown as ) { case false : case true : return rex builder make literal ( unknown as to boolean ( ) ) ; } } return rex builder make null literal ( e get type ( ) ) ; } switch ( e get kind ( ) ) { case and : return simplify and ( ( rex call ) e , unknown as ) ; case or : return simplify or ( ( rex call ) e , unknown as ) ; case not : return simplify not ( ( rex call ) e , unknown as ) ; case case : return simplify case ( ( rex call ) e , unknown as ) ; case coalesce : return simplify coalesce ( ( rex call ) e ) ; case cast : return simplify cast ( ( rex call ) e ) ; case ceil : case floor : return simplify ceil floor ( ( rex call ) e ) ; case is null : case is not null : case is true : case is not true : case is false : case is not false : assert e instanceof rex call ; return simplify is ( ( rex call ) e , unknown as ) ; case equals : case greater than : case greater than or equal : case less than : case less than or equal : case not equals : return simplify comparison ( ( rex call ) e , unknown as ) ; case search : return simplify search ( ( rex call ) e , unknown as ) ; case like : return simplify like ( ( rex call ) e ) ; case minus prefix : return simplify unary minus ( ( rex call ) e , unknown as ) ; case plus prefix : return simplify unary plus ( ( rex call ) e , unknown as ) ; default : if ( e get class ( ) = = rex call class ) { return simplify generic node ( ( rex call ) e ) ; } else { return e ; } } }


adds { @ code edge } connecting { @ code node u } to { @ code node v } if the network is directed , { @ code edge } will be directed in this network ; otherwise , it will be undirected < b > { @ code edge } must be unique to this network < b > , just as a { @ code map } key must be it must also be non - null if { @ code node u } and { @ code node v } are not already present in this network , this method will silently { @ link # add node ( object ) add } { @ code node u } and { @ code node v } to the network if { @ code edge } already connects { @ code node u } to { @ code node v } ( in the specified order if this network { @ link # is directed ( ) } , else in any order ) , then this method will have no effect

public immutable network builder < n , e > add edge ( n node u , n node v , e edge ) { mutable network add edge ( node u , node v , edge ) ; return this ; }


sets the quaternion from the given matrix , optionally removing any scaling

public quaternion set from matrix ( boolean normalize axes , matrix 3 matrix ) { return set from axes ( normalize axes , matrix val [ matrix 3 m00 ] , matrix val [ matrix 3 m01 ] , matrix val [ matrix 3 m02 ] , matrix val [ matrix 3 m10 ] , matrix val [ matrix 3 m11 ] , matrix val [ matrix 3 m12 ] , matrix val [ matrix 3 m20 ] , matrix val [ matrix 3 m21 ] , matrix val [ matrix 3 m22 ] ) ; }


disconnected from the given node , if not connected , will do nothing

public void disconnect from node ( discovery node node ) { transport connection node channels = connected nodes remove ( node ) ; if ( node channels ! = null ) { / / if we found it and removed it we close node channels close ( ) ; } }


fully qualify the path to a binary that should be in a known hadoop bin location this is primarily useful for disambiguating call - outs to executable sub - components of hadoop to avoid clashes with other executables that may be in the path caveat : this call doesn ' t just format the path to the bin directory it also checks for file existence of the composed path the output of this call should be cached by callers

public static string get qualified bin path ( string executable ) throws i o exception { return get qualified bin ( executable ) get canonical path ( ) ; }


guaranteed to throw an exception and leave the list unmodified

public final void sort ( comparator < ? super e > c ) { throw new unsupported operation exception ( ) ; }


the predecessors of this node within a sub - topology note , sources do not have any predecessors will never be { @ code null }


translates a starlark objc provider value to a java objc provider value

nested set < ? > value for java ( key < ? > java key , object starlark value ) throws eval exception ;


set whether overloaded methods should be enabled for remote invocations default is " false "

public void set overload enabled ( boolean overload enabled ) { this proxy factory set overload enabled ( overload enabled ) ; }


helper to create a create partitions result instance for a given throwable create partitions result ' s constructor is only accessible from within the admin package

public static create partitions result create partitions result ( string topic , throwable t ) { kafka future impl < void > future = new kafka future impl < > ( ) ; future complete exceptionally ( t ) ; return new create partitions result ( collections singleton map ( topic , future ) ) ; }


set the ( new ) value of the { @ code if - match } header

public void set if match ( list < string > if match list ) { set ( if match , to comma delimited string ( if match list ) ) ; }


force client username to be used throughout ghidra this may be required when testing so that the default login name can be forced

public static void set local user ( string username ) { test utils set instance field ( " user name " , system utilities class , username ) ; if ( ! username equals ( client util get user name ( ) ) ) { throw new assert exception ( " failed to force client username : " + username ) ; } }


appends the node to the tail of the list

public void append to tail ( node head ) { node tail = head prev ; head prev = this ; tail next = this ; next = head ; prev = tail ; }


verifies that the two given key ' s are different in total and also have different hashes

static void verify key different hash different ( blob key key 1 , blob key key 2 ) { assert not equals ( key 1 , key 2 ) ; assert that ( key 1 get hash ( ) , not ( equal to ( key 2 get hash ( ) ) ) ) ; }


shutdown sync http client holder and remove template

public static void shutdown nacost sync rest ( string class name ) throws exception { final nacos rest template nacos rest template = singleton rest get ( class name ) ; if ( nacos rest template ! = null ) { nacos rest template close ( ) ; singleton rest remove ( class name ) ; } }


hook designed for extensibility so one can pass a different cache on each resolution attempt instead of using the global one

protected void do resolve ( string inet host , dns record [ ] additionals , promise < inet address > promise , dns cache resolve cache ) throws exception { if ( inet host = = null | | inet host is empty ( ) ) { / / if an empty hostname is used we should use " localhost " , just like inet address get by name ( ) does promise set success ( loopback address ( ) ) ; return ; } final byte [ ] bytes = net util create byte array from ip address string ( inet host ) ; if ( bytes ! = null ) { / / the inet host is actually an ipaddress promise set success ( inet address get by address ( bytes ) ) ; return ; } final string hostname = hostname ( inet host ) ; inet address hosts file entry = resolve hosts file entry ( hostname ) ; if ( hosts file entry ! = null ) { promise set success ( hosts file entry ) ; return ; } if ( ! do resolve cached ( hostname , additionals , promise , resolve cache ) ) { do resolve uncached ( hostname , additionals , promise , resolve cache , true ) ; } }


resumes engine work paused " load & display " tasks will continue its work

void resume ( ) { paused set ( false ) ; synchronized ( pause lock ) { pause lock notify all ( ) ; } }


{ @ code opens index } must be a valid index into the constant pool the entry at this index must be a { @ link constant pool package info } structure representing a package opened by the current module

public int get opens index ( ) { return opens index & 0xffff ; }


actually unregister the specified m bean from the server

protected void do unregister ( object name object name ) { assert state ( this server ! = null , " no m bean server set " ) ; boolean actually unregistered = false ; synchronized ( this registered beans ) { if ( this registered beans remove ( object name ) ) { try { / / m bean might already have been unregistered by an external process if ( this server is registered ( object name ) ) { this server unregister m bean ( object name ) ; actually unregistered = true ; } else { if ( logger is info enabled ( ) ) { logger info ( " could not unregister m bean [ " + object name + " ] as said m bean " + " is not registered ( perhaps already unregistered by an external process ) " ) ; } } } catch ( j m exception ex ) { if ( logger is info enabled ( ) ) { logger info ( " could not unregister m bean [ " + object name + " ] " , ex ) ; } } } } if ( actually unregistered ) { on unregister ( object name ) ; } }


{ @ link predicate } always return < code > true < code >

static < t > predicate < t > always true ( ) { return e - > true ; }


returns a rule context which is the same as the original rule context of the target parameter

public rule context get rule context for testing ( configured target target , stored event handler event handler , build configuration collection configurations ) throws dependency resolver failure , invalid configuration exception , interrupted exception , inconsistent aspect order exception , toolchain exception , starlark transition transition exception , invalid exec group exception { build configuration target config = skyframe executor get configuration ( event handler , target get configuration key ( ) ) ; sky function environment skyframe env = skyframe executor get sky function environment for testing ( event handler ) ; starlark builtins value starlark builtins value = ( starlark builtins value ) preconditions check not null ( skyframe env get value ( starlark builtins value key ( ) ) ) ; caching analysis environment analysis env = new caching analysis environment ( get artifact factory ( ) , skyframe executor get action key context ( ) , configured target key builder ( ) set label ( target get label ( ) ) set configuration ( target config ) build ( ) , / * is system env = * / false , target config extended sanity checks ( ) , target config allow analysis failures ( ) , event handler , skyframe env , starlark builtins value ) ; return get rule context for testing ( event handler , target , analysis env , configurations ) ; }


public synchronized class < ? > get key class ( ) { if ( null = = key class ) { try { key class = writable name get class ( get key class name ( ) , conf ) ; } catch ( i o exception e ) { throw new runtime exception ( e ) ; } } return key class ; }


attempt to obtain a modification lock on the domain object when generating a background snapshot

final synchronized locking task monitor lock for snapshot ( domain object adapter d b domain obj , boolean has progress , string title ) { if ( system utilities is in headless mode ( ) ) { msg warn ( this , " snapshot not supported in headless mode " ) ; return null ; } check domain object ( domain obj ) ; if ( lock count ! = 0 | | get current transaction ( ) ! = null | | locking task monitor ! = null ) { return null ; } + + lock count ; / / prevent prepare to save try { if ( lock ( " snapshot " ) ) { locking task monitor = new locking task monitor ( domain obj , has progress , title ) ; return locking task monitor ; } } finally { - - lock count ; } return null ; }


public map < string , map < string , object > > get map map anytype ( ) { return map map anytype ; }


get the actual instance , which can be the following : equilateral triangle , isosceles triangle , scalene triangle

public object get actual instance ( ) { return super get actual instance ( ) ; }


returns everything below the endpoint relative to the specified comparator , with the specified endpoint behavior

static < t > general range < t > up to ( comparator < ? super t > comparator , @ nullable decl t endpoint , bound type bound type ) { return new general range < t > ( comparator , false , null , open , true , endpoint , bound type ) ; }


get the { @ link request template # url ( ) } before feign reflective feign build template by resolving args # resolve ( object [ ] , request template , map ) put it into the { @ link path var interceptor # url context }

public void before method ( enhanced instance obj inst , method method , object [ ] all arguments , class < ? > [ ] arguments types , method intercept result result ) { request template template = ( request template ) all arguments [ 1 ] ; url context set ( new feign resolved u r l ( template url ( ) ) ) ; }


compare the parents of each node for equality to be overridden in subclasses for specific network topology implementations , as alternative to overriding the full { @ link # is on same rack ( node , node ) } method

protected boolean is same parents ( node node 1 , node node 2 ) { return node 1 get parent ( ) = = node 2 get parent ( ) ; }


performs the default outgoing bpmn 2 0 behavior , which is having parallel paths of executions for the outgoing sequence flow more precisely : every sequence flow that has a condition which evaluates to true ( or which doesn ' t have a condition ) , is selected for continuation of the process instance if multiple sequencer flow are selected , multiple , parallel paths of executions are created

public void perform default outgoing behavior ( execution entity activity execution ) { perform outgoing behavior ( activity execution , true , false ) ; }


deserializes a record for collection , and accordingly updates the shard state in the fetcher the last successfully collected sequence number in this shard consumer is also updated so that a { @ link record publisher } may be able to use the correct sequence number to refresh shard iterators if necessary note that the server - side kinesis timestamp is attached to the record when collected when the user programs uses { @ link time characteristic # event time } , this timestamp will be used by default

private void deserialize record for collection and update state ( final user record record ) { byte buffer record data = record get data ( ) ; byte [ ] data bytes = new byte [ record data remaining ( ) ] ; record data get ( data bytes ) ; final long approx arrival timestamp = record get approximate arrival timestamp ( ) get time ( ) ; final t value ; try { value = deserializer deserialize ( data bytes , record get partition key ( ) , record get sequence number ( ) , approx arrival timestamp , subscribed shard get stream name ( ) , subscribed shard get shard ( ) get shard id ( ) ) ; } catch ( i o exception e ) { throw new runtime exception ( e ) ; } sequence number collected sequence number = ( record is aggregated ( ) ) ? new sequence number ( record get sequence number ( ) , record get sub sequence number ( ) ) : new sequence number ( record get sequence number ( ) ) ; fetcher ref emit record and update state ( value , approx arrival timestamp , subscribed shard state index , collected sequence number ) ; this last sequence num = collected sequence number ; }


called to to register a more specific analyzer

static public void claim processor ( string processor name ) { handled processors add ( processor name ) ; }


remembers the value ' n ' in the cache for future { @ link # resolve ( job ) }

protected void update cache ( @ non null job < ? , ? > job , @ check for null run < ? , ? > b ) { file build dir = job get build dir ( ) ; map < string , integer > cache = cache for ( build dir ) ; synchronized ( cache ) { cache put ( get id ( ) , b = = null ? resolves to none : b get number ( ) ) ; file storage = storage for ( build dir ) ; logger fine ( ( ) - > " saving to " + storage + " : " + cache ) ; try ( atomic file writer cw = new atomic file writer ( storage ) ) { try { for ( map entry < string , integer > entry : cache entry set ( ) ) { cw write ( entry get key ( ) ) ; cw write ( ' ' ) ; cw write ( integer to string ( entry get value ( ) ) ) ; cw write ( ' \ n ' ) ; } cw commit ( ) ; } finally { cw abort ( ) ; } } catch ( i o exception x ) { logger log ( level warning , " failed to update " + storage , x ) ; } } }


merges unsorted sections by reading them completely into memory and sorting in memory

public final void merge unsorted ( ) { get section ( contents out ) off = out get position ( ) ; list < unsorted value > all = new array list < unsorted value > ( ) ; for ( int i = 0 ; i < dexes length ; i + + ) { all add all ( read unsorted values ( dexes [ i ] , index maps [ i ] ) ) ; } collections sort ( all ) ; int out count = 0 ; for ( int i = 0 ; i < all size ( ) ; ) { unsorted value e 1 = all get ( i + + ) ; update index ( e 1 offset , e 1 index map , e 1 index , out count - 1 ) ; while ( i < all size ( ) & & e 1 compare to ( all get ( i ) ) = = 0 ) { unsorted value e 2 = all get ( i + + ) ; update index ( e 2 offset , e 2 index map , e 2 index , out count - 1 ) ; } write ( e 1 value ) ; out count + + ; } get section ( contents out ) size = out count ; }


returns an estimate of the number of bytes that can be read ( or skipped over ) from this chaining input stream without blocking by the next caller of a method for this stream the next caller might be the same thread or another thread a single read or skip of this many bytes will not block , but may read or skip fewer bytes this simply forwards the { @ code available } call to the current component input stream , so the returned value is a conservative lower bound of the available byte count ; i e it ' s possible that subsequent component streams have available bytes but this method only returns the available bytes of the current component

public int available ( ) throws i o exception { ensure open ( ) ; if ( current in = = null ) { next in ( ) ; } return current in available ( ) ; }


the interface used by clients to get a report of containers for an application attempt from the < code > resource manager < code > or < code > application history server < code > the client , via { @ link get containers request } provides the { @ link application attempt id } of the application attempt in secure mode , the < code > resource manager < code > or < code > application history server < code > verifies access to the method before accepting the request the < code > resource manager < code > or < code > application history server < code > responds with a { @ link get containers response } which includes a list of { @ link container report } for all the containers of a specific application attempt

public get containers response get containers ( get containers request request ) throws yarn exception , i o exception ;


return a newly constructed { @ link processor } instance the supplier should always generate a new instance each time { @ link processor supplier # get ( ) } gets called creating a single { @ link processor } object and returning the same object reference in { @ link processor supplier # get ( ) } is a violation of the supplier pattern and leads to runtime exceptions

processor < k in , v in , k out , v out > get ( ) ;


return a builder for a { @ code sse event } , populated with the give { @ linkplain # data ( ) data }

public static < t > builder < t > builder ( t data ) { return new builder impl < > ( data ) ; }


assert an int counter metric as expected

public static void assert counter ( string name , int expected , metrics record builder rb ) { assert assert equals ( " bad value for metric " + name , expected , get int counter ( name , rb ) ) ; }


public string get branch type ( ) { return branch type ; }


basically same as { @ link # find first ( class , boolean ) } but pending to a new thread for executing

public static < t > find executor < t > find first async ( final class < t > model class , final boolean is eager ) { return operator find first async ( model class , is eager ) ; }


returns the x500 distinguished name for the specified user

public synchronized x 5 0 0 principal get distinguished name ( string username ) throws i o exception { update user list ( true ) ; user entry entry = user list get ( username ) ; if ( entry ! = null ) { return entry x 5 0 0 user ; } return null ; }


describe topics result describe topics ( collection < string > topic names , describe topics options options ) ;


returns a list of the application root directories an application root directory is a directory containing one or more modules applications support multiple application root directories so that it can contain modules that don ' t have a common file system root this is useful if the application contains modules from more than one source code repository application roots are returned in the order they appear in the classpath

public static collection < resource file > get application root directories ( ) { check app initialized ( ) ; return app layout get application root dirs ( ) ; }


sets a new data renderer object for the chart

public void set renderer ( data renderer renderer ) { if ( renderer ! = null ) m renderer = renderer ; }


the body type : static , kinematic , or dynamic note : if a dynamic body would have zero mass , the mass is set to one

public body type get type ( ) { return type ; }


return a { @ link resource http request handler } instance

protected resource http request handler get request handler ( ) { resource http request handler handler = new resource http request handler ( ) ; if ( this resource chain registration ! = null ) { handler set resource resolvers ( this resource chain registration get resource resolvers ( ) ) ; handler set resource transformers ( this resource chain registration get resource transformers ( ) ) ; } handler set location values ( this location values ) ; handler set locations ( this locations resources ) ; if ( this cache control ! = null ) { handler set cache control ( this cache control ) ; } else if ( this cache period ! = null ) { handler set cache seconds ( this cache period ) ; } handler set use last modified ( this use last modified ) ; return handler ; }


adds a python dependency which could be py files , python packages ( zip , egg etc ) or local directories the dependencies will be added to the pythonpath of the python udf worker and the local py 4 j python client

private void add python file ( string file path ) { preconditions check not null ( file path ) ; string file key = generate unique file key ( python file prefix , file path ) ; register cached file if not exist ( file path , file key ) ; if ( ! internal config contains ( python files ) ) { internal config set ( python files , new hash map < > ( ) ) ; } internal config get ( python files ) put ( file key , new file ( file path ) get name ( ) ) ; }


the primary term of the last primary that has changed this document , if found

public long get primary term ( ) { return primary term ; }


public void map property test ( ) { / / todo : test map property }


check whether the specified interfaces is a published introduction interface

public boolean implements interface ( class < ? > ifc ) { for ( class < ? > pub ifc : this published interfaces ) { if ( ifc is interface ( ) & & ifc is assignable from ( pub ifc ) ) { return true ; } } return false ; }


check combine service name format the service name can ' t be blank service name = " @ @ " ; the length = 0 ; illegal service name = " group @ @ " ; the length = 1 ; illegal service name = " @ @ service name " ; the length = 2 ; legal service name = " group @ @ service name " ; the length = 2 ; legal

public static void check service name format ( string combine service name ) { string [ ] split = combine service name split ( constants service info spliter ) ; if ( split length < = 1 ) { throw new illegal argument exception ( " param ' service name ' is illegal , it should be format as ' group name @ @ service name ' " ) ; } }


returns { @ code true } if { @ code subject } ends with { @ code suffix }

private static boolean ends with ( byte [ ] subject , byte [ ] suffix ) { int start = subject length - suffix length ; if ( start < 0 ) { return false ; } for ( int i = start ; i < subject length ; i + + ) { if ( subject [ i ] ! = suffix [ i - start ] ) { return false ; } } return true ; }


set the { @ code time zone } to normalize the date values into , if any

public void set time zone ( time zone time zone ) { this time zone = time zone ; }


the < a href = " https : en wikipedia orgwiki entropy ( information theory ) " > shannon entropy value computed over all terms collected by the aggregation shannon entropy quantifies the amount of information contained in the field it is a very useful metric for measuring a wide range of properties of a data set , such as diversity , similarity , randomness etc

public double get entropy ( ) { return entropy ; }


test for block id c k with datanode maintenance

public void test block id c k maintenance ( ) throws exception { final short repl factor = 2 ; short num dn = 2 ; final long block size = 512 ; string [ ] hosts = { " host 1 " , " host 2 " } ; string [ ] racks = { " / rack 1 " , " / rack 2 " } ; conf set long ( d f s config keys dfs block size key , block size ) ; conf set int ( d f s config keys dfs replication key , repl factor ) ; conf set int ( d f s config keys dfs namenode replication min key , repl factor ) ; conf set int ( d f s config keys dfs namenode maintenance replication min key , repl factor ) ; distributed file system dfs ; file builder base dir = new file ( generic test utils get randomized temp path ( ) ) ; cluster = new mini d f s cluster builder ( conf , builder base dir ) num data nodes ( num dn ) hosts ( hosts ) racks ( racks ) build ( ) ; assert not null ( " failed cluster creation " , cluster ) ; cluster wait cluster up ( ) ; dfs = cluster get file system ( ) ; assert not null ( " failed to get file system " , dfs ) ; d f s test util util = new d f s test util builder ( ) set name ( get class ( ) get simple name ( ) ) set num files ( 1 ) build ( ) ; / / create files final string path string = new string ( " / testfile " ) ; final path path = new path ( path string ) ; util create file ( dfs , path , 1024 , repl factor , 1000l ) ; util wait replication ( dfs , path , repl factor ) ; string builder sb = new string builder ( ) ; for ( located block lb : util get all blocks ( dfs , path ) ) { sb append ( lb get block ( ) get local block ( ) get block name ( ) + " " ) ; } string [ ] b ids = sb to string ( ) split ( " " ) ; / / make sure datanode that has replica is fine before maintenance string out str = run fsck ( conf , 0 , true , " / " , " - maintenance " , " - block id " , b ids [ 0 ] ) ; system out println ( out str ) ; assert true ( out str contains ( namenode fsck healthy status ) ) ; f s namesystem fsn = cluster get name node ( ) get namesystem ( ) ; block manager bm = fsn get block manager ( ) ; datanode manager dnm = bm get datanode manager ( ) ; datanode descriptor dn = dnm get datanode ( cluster get data nodes ( ) get ( 0 ) get datanode id ( ) ) ; bm get datanode manager ( ) get datanode admin manager ( ) start maintenance ( dn , long max value ) ; final string dn name = dn get xfer addr ( ) ; / / wait for the node to enter maintenance state generic test utils wait for ( new supplier < boolean > ( ) { @ override public boolean get ( ) { datanode info datanode info = null ; try { for ( datanode info info : dfs get data node stats ( ) ) { if ( dn name equals ( info get xfer addr ( ) ) ) { datanode info = info ; } } if ( datanode info ! = null & & datanode info is entering maintenance ( ) ) { string fsck out = run fsck ( conf , 5 , false , " / " , " - maintenance " , " - block id " , b ids [ 0 ] ) ; assert true ( fsck out contains ( namenode fsck entering maintenance status ) ) ; return true ; } } catch ( exception e ) { log warn ( " unexpected exception : " + e ) ; return false ; } return false ; } } , 500 , 30000 ) ; / / start 3rd data node cluster start data nodes ( conf , 1 , true , null , new string [ ] { " / rack 3 " } , new string [ ] { " host 3 " } , null , false ) ; / / wait for 1st node to reach in maintenance state generic test utils wait for ( new supplier < boolean > ( ) { @ override public boolean get ( ) { try { datanode info datanode info = null ; for ( datanode info info : dfs get data node stats ( ) ) { if ( dn name equals ( info get xfer addr ( ) ) ) { datanode info = info ; } } if ( datanode info ! = null & & datanode info is in maintenance ( ) ) { return true ; } } catch ( exception e ) { log warn ( " unexpected exception : " + e ) ; return false ; } return false ; } } , 500 , 30000 ) ; / / check in maintenance node string fsck out = run fsck ( conf , 4 , false , " / " , " - maintenance " , " - block id " , b ids [ 0 ] ) ; assert true ( fsck out contains ( namenode fsck in maintenance status ) ) ; / / check in maintenance node are not printed when not requested fsck out = run fsck ( conf , 4 , false , " / " , " - block id " , b ids [ 0 ] ) ; assert false ( fsck out contains ( namenode fsck in maintenance status ) ) ; }


public list < x attr > get x attrs ( ) { if ( x attrs = = null ) { return x attr format to x attrs ( attrs ) ; } else { if ( attrs = = null ) { return x attrs ; } else { list < x attr > result = new array list < > ( ) ; result add all ( x attr format to x attrs ( attrs ) ) ; result add all ( x attrs ) ; return result ; } } }


given an { @ link input stream } parse it into an instance of the declared type so that it can be passed to application code

public t parse ( input stream stream ) ;


public static elf symbol create section symbol 3 2 ( elf header header , long section address , short section header index , string name , int symbol index , elf symbol table symbol table ) { return new elf symbol ( header , name , 0 , section address , 0 , stt section , ( byte ) 0 , section header index , symbol index , symbol table ) ; }


creates a new workspace rule event for an extract event

public static workspace rule event new extract event ( string archive , string output , string strip prefix , string rule label , location location ) { extract event e = workspace log protos extract event new builder ( ) set archive ( archive ) set output ( output ) set strip prefix ( strip prefix ) build ( ) ; workspace log protos workspace event builder result = workspace log protos workspace event new builder ( ) ; result = result set extract event ( e ) ; if ( location ! = null ) { result = result set location ( location to string ( ) ) ; } if ( rule label ! = null ) { result = result set rule ( rule label ) ; } return new workspace rule event ( result build ( ) ) ; }


this is a hack editors should listen txn commitrollback and update their dirty flag ( active transaction makes sql editor dirty ) making each editor qm listener is too expensive

private static void update editors dirty flag ( ) { i editor reference [ ] editors = u i utils get active workbench window ( ) get active page ( ) get editor references ( ) ; for ( i editor reference ref : editors ) { final i editor part editor = ref get editor ( false ) ; if ( editor instanceof s q l editor ) { u i utils async exec ( ( ( s q l editor ) editor ) : : update dirty flag ) ; } } }


checks whether there are entries with absent keys or values

public boolean has absent keys or values ( ) { for ( entry < string , key value < k , v > > entry : underlying map entry set ( ) ) { if ( key or value is absent ( entry ) ) { return true ; } } return false ; }


determine the canonical name for the given property path removes surrounding quotes from map keys : < br > { @ code map [ ' key ' ] } - > { @ code map [ key ] } < br > { @ code map [ " key " ] } - > { @ code map [ key ] }

public static string canonical property name ( @ nullable string property name ) { if ( property name = = null ) { return " " ; } string builder sb = new string builder ( property name ) ; int search index = 0 ; while ( search index ! = - 1 ) { int key start = sb index of ( property accessor property key prefix , search index ) ; search index = - 1 ; if ( key start ! = - 1 ) { int key end = sb index of ( property accessor property key suffix , key start + property accessor property key prefix length ( ) ) ; if ( key end ! = - 1 ) { string key = sb substring ( key start + property accessor property key prefix length ( ) , key end ) ; if ( ( key starts with ( " ' " ) & & key ends with ( " ' " ) ) | | ( key starts with ( " \ " " ) & & key ends with ( " \ " " ) ) ) { sb delete ( key start + 1 , key start + 2 ) ; sb delete ( key end - 2 , key end - 1 ) ; key end = key end - 2 ; } search index = key end + property accessor property key suffix length ( ) ; } } } return sb to string ( ) ; }


fills ' dst ' with bytes from ' in ' , throwing e o f exception if insufficient bytes are available

public static void read fully ( input stream in , byte [ ] dst ) throws i o exception { read fully ( in , dst , 0 , dst length ) ; }


test a cluster with even distribution , g then three nodes are added to the cluster , runs balancer with two of the nodes in the exclude list

public void test balancer cli with exclude list with ports in a file ( ) throws exception { final configuration conf = new hdfs configuration ( ) ; init conf ( conf ) ; do test ( conf , new long [ ] { capacity , capacity } , new string [ ] { rack0 , rack1 } , capacity , rack2 , new port number based nodes ( 3 , 2 , 0 ) , true , true ) ; }


public void upload file test ( ) { long pet id = null ; string additional metadata = null ; file file = null ; / / model api response response = api upload file ( pet id , additional metadata , file ) ; / / todo : test validations }


replaces all parameters with the given parameters

public media type with parameters ( multimap < string , string > parameters ) { return create ( type , subtype , parameters ) ; }


public void error ( string message , @ nullable object source , @ nullable parse state parse state ) { error ( message , source , parse state , null ) ; }


public static result code get ( int ordinal ) { for ( result code result code : result code values ( ) ) { if ( result code ordinal ( ) = = ordinal ) { return result code ; } } throw new illegal argument exception ( " unknown result code [ " + ordinal + " ] " ) ; }


test what happens when there are two racks , and an entire rack is decommissioned since the cluster is multi - rack , it will consider the block under - replicated rather than create a third replica on the same rack adding a new node on a third rack should cause re - replication to that node

public void test one of two racks decommissioned ( ) throws exception { add nodes ( nodes ) ; name node init metrics ( new configuration ( ) , hdfs server constants namenode role namenode ) ; for ( int i = 0 ; i < num test iters ; i + + ) { do test one of two racks decommissioned ( i ) ; } }


returns { @ code s } with control characters and non - ascii characters replaced with ' ? '

public static string to human readable ascii ( string s ) { for ( int i = 0 , length = s length ( ) , c ; i < length ; i + = character char count ( c ) ) { c = s code point at ( i ) ; if ( c > ' \ u 0 0 1f ' & & c < ' \ u 0 0 7f ' ) continue ; buffer buffer = new buffer ( ) ; buffer write utf 8 ( s , 0 , i ) ; for ( int j = i ; j < length ; j + = character char count ( c ) ) { c = s code point at ( j ) ; buffer write utf 8 code point ( c > ' \ u 0 0 1f ' & & c < ' \ u 0 0 7f ' ? c : ' ? ' ) ; } return buffer read utf 8 ( ) ; } return s ; }


public static local date time local date time of ( final long time ) { return local date time of instant ( instant of epoch milli ( time ) , zone offset utc ) ; }


you should pay attention to pass this parameter with two way : for example : 1 only class name , like " simple indicator " ( this way would use default package name with " com wang avi indicators " ) 2 class name with full package , like " com my android indicators simple indicator "

public void set indicator ( string indicator name ) { if ( text utils is empty ( indicator name ) ) { return ; } string builder drawable class name = new string builder ( ) ; if ( ! indicator name contains ( " " ) ) { string default package name = get class ( ) get package ( ) get name ( ) ; drawable class name append ( default package name ) append ( " " ) ; } drawable class name append ( indicator name ) ; try { class < ? > drawable class = class for name ( drawable class name to string ( ) ) ; indicator indicator = ( indicator ) drawable class new instance ( ) ; set indicator ( indicator ) ; } catch ( class not found exception e ) { log e ( tag , " didn ' t find your class , check the name again ! " ) ; } catch ( instantiation exception e ) { e print stack trace ( ) ; } catch ( illegal access exception e ) { e print stack trace ( ) ; } }


publish a fake metric under the " hadoop : " domain and ensure it is logged by the metrics logger

public void test metrics log output ( ) throws i o exception , interrupted exception , timeout exception { test fake metric metrics provider = new test fake metric ( ) ; m beans register ( this get class ( ) get simple name ( ) , " dummy metrics " , metrics provider ) ; start d n for test ( true ) ; assert not null ( dn ) ; final pattern matching appender appender = new pattern matching appender ( " ^ * fake metric * $ " ) ; add appender ( data node metrics log , appender ) ; / / ensure that the supplied pattern was matched generic test utils wait for ( new supplier < boolean > ( ) { @ override public boolean get ( ) { return appender is matched ( ) ; } } , 1000 , 60000 ) ; dn shutdown ( ) ; }


public string get failure ( ) { return failure ; }


authorizes the request and returns the application specific request processing pipeline

private request interceptor chain wrapper authorize and get interceptor chain ( ) throws yarn exception { a m r m token identifier token identifier = yarn server security utils authorize request ( ) ; return get interceptor chain ( token identifier ) ; }


protected string grant service ticket ( final string ticket granting ticket , final web application service service , final authentication result authentication result ) { val ticket = central authentication service grant service ticket ( ticket granting ticket , service , authentication result ) ; logger debug ( " generated service ticket [ { } ] " , ticket get id ( ) ) ; return ticket get id ( ) ; }


returns true if this monitor { @ link # disable ( boolean ) isn ' t disabled } earlier this flag implements the ability for the admin to say " no thank you " to the monitor that he wants to ignore

public boolean is enabled ( ) { return ! jenkins get ( ) get disabled administrative monitors ( ) contains ( id ) ; }


detect the default configuration classes for the supplied test class the default implementation simply delegates to { @ link annotation config context loader utils # detect default configuration classes ( class ) }

protected class < ? > [ ] detect default configuration classes ( class < ? > declaring class ) { return annotation config context loader utils detect default configuration classes ( declaring class ) ; } / / abstract context loader


marks that the assignee is done with this task and that it can be send back to the owner can only be called when this task is { @ link delegation state # pending } delegation after this method returns , the { @ link task # get delegation state ( ) delegation state } is set to { @ link delegation state # resolved }


close the web application context of this servlet

public void destroy ( ) { get servlet context ( ) log ( " destroying spring framework servlet ' " + get servlet name ( ) + " ' " ) ; / / only call close ( ) on web application context if locally managed if ( this web application context instanceof configurable application context & & ! this web application context injected ) { ( ( configurable application context ) this web application context ) close ( ) ; } }


subclasses should implement this method to test { @ link encoder # can encode }

public abstract void can encode ( ) throws exception ;


notifies the executor that the command is complete may safely be called multiple times for a single command , so callers should err on the side of calling it more frequently should be idempotent , so that calls after the first one in the same evaluation should be quick

public void notify command complete ( extended event handler event handler ) throws interrupted exception { memoizing evaluator note evaluations at same version may be finished ( event handler ) ; }


{ @ inherit doc } forwards to older method { @ link # matches ( string , string ) }

public boolean matches ( server objs server objs , match values match values ) { return implementation matches ( match values get id ( ) , match values get acl expr ( ) ) ; }


set to { @ code true } to force only creation , not an update of an index template if it already exists , it will fail with an { @ link illegal argument exception }

public request create ( boolean create ) { this create = create ; return this ; }


public void write long ( long value ) { write ( ( short ) value ) ; write ( ( short ) ( value > > 16 ) ) ; write ( ( short ) ( value > > 32 ) ) ; write ( ( short ) ( value > > 48 ) ) ; }


add a " max - age = " directive this directive is well suited for publicly caching resources , knowing that they won ' t change within the configured amount of time additional directives can be also used , in case resources shouldn ' t be cached ( { @ link # cache private ( ) } ) or transformed ( { @ link # no transform ( ) } ) by shared caches in order to prevent caches to reuse the cached response even when it has become stale ( i e the " max - age " delay is passed ) , the " must - revalidate " directive should be set ( { @ link # must revalidate ( ) }

public static cache control max age ( duration max age ) { cache control cc = new cache control ( ) ; cc max age = max age ; return cc ; }


return the default html escape setting , differentiating between no default specified and an explicit value

public boolean get default html escape ( ) { return this default html escape ; }


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


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 void user status test ( ) { / / todo : test user status }


specifies the expected number of nodes in the graph

public graph builder < n > expected node count ( int expected node count ) { this expected node count = optional of ( check non negative ( expected node count ) ) ; return this ; }


captures the state of this builder and run all associated tests

public void build and run tests ( ) throws exception { build ( ) run tests ( ) ; }


test dst end with interval rounding cet : 25 october 2015 , 03 : 00 : 00 clocks were turned backward 1 hour to 25 october 2015 , 02 : 00 : 00 local standard time


public string get name ( ) { return field get name ( ) ; }


revert a commit by deleting the file relies on retry code in filesystem

public void revert commit ( string dest key , @ nullable bulk operation state operation state ) throws i o exception { once ( " revert commit " , dest key , ( ) - > { path dest path = owner key to qualified path ( dest key ) ; owner delete object at path ( dest path , dest key , true , operation state ) ; owner maybe create fake parent directory ( dest path ) ; } ) ; }


void new column ( grid column column , int index ) { if ( index = = - 1 ) { columns add ( column ) ; } else { columns add ( index , column ) ; } }


string information about a summary entry for debug messages

public static string stringify ( s 3 object summary summary ) { string builder builder = new string builder ( summary get key ( ) length ( ) + 100 ) ; builder append ( summary get key ( ) ) append ( ' ' ) ; builder append ( " size = " ) append ( summary get size ( ) ) ; return builder to string ( ) ; }


removes the embedded console notes in the given log lines

public static list < string > remove notes ( collection < string > log lines ) { list < string > r = new array list < > ( log lines size ( ) ) ; for ( string l : log lines ) r add ( remove notes ( l ) ) ; return r ; }


update the job with details about the file split

private void update job with split ( final job conf job , input split input split ) { if ( input split instanceof file split ) { file split file split = ( file split ) input split ; job set ( job context map input file , file split get path ( ) to string ( ) ) ; job set long ( job context map input start , file split get start ( ) ) ; job set long ( job context map input path , file split get length ( ) ) ; } log info ( " processing split : " + input split ) ; }


createinitialize the housekeeping service { @ link scheduled executor service } if the user specified an executor to be used in the { @ link hikari config } , then we use that if no executor was specified ( typical ) , then create an executor and configure it

private scheduled executor service initialize house keeping executor service ( ) { if ( config get scheduled executor ( ) = = null ) { final thread factory thread factory = optional of nullable ( config get thread factory ( ) ) or else get ( ( ) - > new default thread factory ( pool name + " housekeeper " , true ) ) ; final scheduled thread pool executor executor = new scheduled thread pool executor ( 1 , thread factory , new thread pool executor discard policy ( ) ) ; executor set execute existing delayed tasks after shutdown policy ( false ) ; executor set remove on cancel policy ( true ) ; return executor ; } else { return config get scheduled executor ( ) ; } }


find all supported generic fields in the class supporting rule is in { @ link base utility # is generic type supported ( string ) }

protected list < field > get supported generic fields ( string class name ) { list < field > generic field list = class generic fields map get ( class name ) ; if ( generic field list = = null ) { list < field > supported generic fields = new array list < > ( ) ; class < ? > clazz ; try { clazz = class for name ( class name ) ; } catch ( class not found exception e ) { throw new database generate exception ( database generate exception class not found + class name ) ; } recursive supported generic fields ( clazz , supported generic fields ) ; class generic fields map put ( class name , supported generic fields ) ; return supported generic fields ; } return generic field list ; }


public list < list < big decimal > > get array array number ( ) { return array array number ; }


read { @ code byte count } bytes of headers from the source stream this implementation does not propagate the never indexed flag of a header

void read headers ( ) throws i o exception { while ( ! source exhausted ( ) ) { int b = source read byte ( ) & 0xff ; if ( b = = 0x 8 0 ) { / / 10000000 throw new i o exception ( " index = = 0 " ) ; } else if ( ( b & 0x 8 0 ) = = 0x 8 0 ) { / / 1nnnnnnn int index = read int ( b , prefix 7 bits ) ; read indexed header ( index - 1 ) ; } else if ( b = = 0x 4 0 ) { / / 01000000 read literal header with incremental indexing new name ( ) ; } else if ( ( b & 0x 4 0 ) = = 0x 4 0 ) { / / 01nnnnnn int index = read int ( b , prefix 6 bits ) ; read literal header with incremental indexing indexed name ( index - 1 ) ; } else if ( ( b & 0x 2 0 ) = = 0x 2 0 ) { / / 001nnnnn max dynamic table byte count = read int ( b , prefix 5 bits ) ; if ( max dynamic table byte count < 0 | | max dynamic table byte count > header table size setting ) { throw new i o exception ( " invalid dynamic table size update " + max dynamic table byte count ) ; } adjust dynamic table byte count ( ) ; } else if ( b = = 0x 1 0 | | b = = 0 ) { / / 000 ? 0000 - ignore never indexed bit read literal header without indexing new name ( ) ; } else { / / 000 ? nnnn - ignore never indexed bit int index = read int ( b , prefix 4 bits ) ; read literal header without indexing indexed name ( index - 1 ) ; } } }


creates a test instant with a monotonic timestamp that is offset from the wall time

public static test instant test instant ( instant wall time ) { return new test instant ( wall time , duration of millis ( initial relative timestamp + wall time to epoch milli ( ) ) ) ; }


same as above , but across multiple directories

public void test purge multiple dirs ( ) throws i o exception { test case description tc = new test case description ( ) ; tc add root ( " / foo 1 " , name node dir type image and edits ) ; tc add root ( " / foo 2 " , name node dir type image and edits ) ; tc add image ( " / foo 1 / current / " + get image file name ( 100 ) , true ) ; tc add image ( " / foo 1 / current / " + get image file name ( 200 ) , true ) ; tc add image ( " / foo 2 / current / " + get image file name ( 200 ) , true ) ; tc add image ( " / foo 1 / current / " + get image file name ( 300 ) , false ) ; tc add image ( " / foo 1 / current / " + get image file name ( 400 ) , false ) ; tc add log ( " / foo 1 / current / " + get finalized edits file name ( 101 , 200 ) , true ) ; tc add log ( " / foo 1 / current / " + get finalized edits file name ( 201 , 300 ) , true ) ; tc add log ( " / foo 2 / current / " + get finalized edits file name ( 201 , 300 ) , true ) ; tc add log ( " / foo 1 / current / " + get finalized edits file name ( 301 , 400 ) , false ) ; tc add log ( " / foo 2 / current / " + get finalized edits file name ( 301 , 400 ) , false ) ; tc add log ( " / foo 1 / current / " + get in progress edits file name ( 401 ) , false ) ; run test ( tc ) ; }


tracks the given new non runnable app so that it can be made runnable when it would not violate max running app limits

private void track non runnable app ( fi ca scheduler app app ) { string user = app get user ( ) ; users non runnable apps put ( user , app ) ; }


ensures the truth of an expression involving one or more parameters to the calling method see { @ link # check argument ( boolean , string , object ) } for details

public static void check argument ( boolean b , @ nullable decl string error message template , @ nullable decl object p 1 , @ nullable decl object p 2 ) { if ( ! b ) { throw new illegal argument exception ( lenient format ( error message template , p 1 , p 2 ) ) ; } }


returns the artifacts needed on the runtime classpath of this target see also { @ link # get runtime class path for archive ( ) }

public nested set < artifact > get runtime class path ( ) { return runtime class path ; }


returns a function that allows to wrap filter all clients that are exposed by the test cluster this is useful for debugging or request response pre and post processing it also allows to intercept all calls done by the test framework by default this method returns an identity function { @ link function # identity ( ) }

protected function < client , client > get client wrapper ( ) { return function identity ( ) ; }


decorrelates a query this is the main entry point to { @ code rel decorrelator }

public static rel node decorrelate query ( rel node root rel , rel builder rel builder ) { final corel map corel map = new corel map builder ( ) build ( root rel ) ; if ( ! corel map has correlation ( ) ) { return root rel ; } final rel opt cluster cluster = root rel get cluster ( ) ; final rel decorrelator decorrelator = new rel decorrelator ( corel map , cluster get planner ( ) get context ( ) , rel builder ) ; rel node new root rel = decorrelator remove correlation via rule ( root rel ) ; if ( sql2rel logger is debug enabled ( ) ) { sql2rel logger debug ( rel opt util dump plan ( " plan after removing correlator " , new root rel , sql explain format text , sql explain level expplan attributes ) ) ; } if ( ! decorrelator cm map cor to cor rel is empty ( ) ) { new root rel = decorrelator decorrelate ( new root rel ) ; } / / re - propagate the hints new root rel = rel opt util propagate rel hints ( new root rel , true ) ; return new root rel ; }


sse builder comment ( string comment ) ;


returns the package name of the class , without attempting to load the class behaves identically to { @ link package # get name ( ) } but does not require the class ( or package ) to be loaded

public string get package name ( ) { return reflection get package name ( class name ) ; }