interrupt the execution mark the cause and the status accordingly

public void interrupt ( result result , cause of interruption causes ) { interrupt ( result , false , causes ) ; }


this method always creates a { @ link buffer consumer } starting from position 0 of { @ link memory segment }

public buffer consumer create buffer consumer from beginning ( ) { return create buffer consumer ( 0 ) ; }


public builder setnum readers ( int num readers ) { this num readers = num readers ; return this ; }


formats a millisecond duration as a english string expressing the number of hours , minutes and seconds in the duration

public static string format duration ( long millis ) { long days = 0 ; int hours = 0 ; int minutes = 0 ; int seconds = 0 ; if ( millis > = ms per day ) { days = millis / ms per day ; millis = millis % ms per day ; } if ( millis > = ms per hour ) { hours = ( int ) ( millis / ms per hour ) ; / / this cast is safe millis = millis % ms per hour ; } if ( millis > = ms per min ) { minutes = ( int ) ( millis / ms per min ) ; millis = millis % ms per min ; } if ( millis > = ms per sec ) { seconds = ( int ) ( millis / ms per sec ) ; millis = millis % ms per sec ; } string builder sb = new string builder ( ) ; if ( days > 0 ) { sb append ( long to string ( days ) ) append ( " days , " ) ; } if ( sb length ( ) > 0 | | hours > 0 ) { sb append ( integer to string ( hours ) ) append ( " hours , " ) ; } if ( sb length ( ) > 0 | | minutes > 0 ) { sb append ( integer to string ( minutes ) ) append ( " mins , " ) ; } sb append ( integer to string ( seconds ) ) append ( " secs " ) ; return sb to string ( ) ; }


set the maximum motor torque , usually in n - m

public void set max motor torque ( float torque ) { joint set max motor torque ( torque ) ; }


tests all fs edit log ops that are converted to inotify events

public void test basic ( ) throws i o exception , u r i syntax exception , interrupted exception , missing events exception { configuration conf = new hdfs configuration ( ) ; conf set long ( d f s config keys dfs block size key , block size ) ; conf set boolean ( d f s config keys dfs namenode acls enabled key , true ) ; / / so that we can get an atime change conf set long ( d f s config keys dfs namenode accesstime precision key , 1 ) ; mini q j m h a cluster builder builder = new mini q j m h a cluster builder ( conf ) ; builder get dfs builder ( ) num data nodes ( 2 ) ; mini q j m h a cluster cluster = builder build ( ) ; try { cluster get dfs cluster ( ) wait active ( ) ; cluster get dfs cluster ( ) transition to active ( 0 ) ; d f s client client = new d f s client ( cluster get dfs cluster ( ) get name node ( 0 ) get name node address ( ) , conf ) ; file system fs = cluster get dfs cluster ( ) get file system ( 0 ) ; d f s test util create file ( fs , new path ( " / file " ) , block size , ( short ) 1 , 0l ) ; d f s test util create file ( fs , new path ( " / file 3 " ) , block size , ( short ) 1 , 0l ) ; d f s test util create file ( fs , new path ( " / file 5 " ) , block size , ( short ) 1 , 0l ) ; d f s test util create file ( fs , new path ( " / truncate file " ) , block size * 2 , ( short ) 1 , 0l ) ; d f s inotify event input stream eis = client get inotify event stream ( ) ; client rename ( " / file " , " / file 4 " , null ) ; / / rename op - > rename event client rename ( " / file 4 " , " / file 2 " ) ; / / rename old op - > rename event / / delete op , add op - > unlink event , create event output stream os = client create ( " / file 2 " , true , ( short ) 2 , block size ) ; os write ( new byte [ block size ] ) ; os close ( ) ; / / close op - > close event / / add op - > append event os = client append ( " / file 2 " , block size , enum set of ( create flag append ) , null , null ) ; os write ( new byte [ block size ] ) ; os close ( ) ; / / close op - > close event thread sleep ( 10 ) ; / / so that the atime will get updated on the next line client open ( " / file 2 " ) read ( new byte [ 1 ] ) ; / / times op - > metadata update event / / set replication op - > metadata update event client set replication ( " / file 2 " , ( short ) 1 ) ; / / concat delete op - > append event , unlink event , close event client concat ( " / file 2 " , new string [ ] { " / file 3 " } ) ; client delete ( " / file 2 " , false ) ; / / delete op - > unlink event client mkdirs ( " / dir " , null , false ) ; / / mkdir op - > create event / / set permissions op - > metadata update event client set permission ( " / dir " , fs permission value of ( " - rw - rw - rw - " ) ) ; / / set owner op - > metadata update event client set owner ( " / dir " , " username " , " groupname " ) ; client create symlink ( " / dir " , " / dir 2 " , false ) ; / / symlink op - > create event client set x attr ( " / file 5 " , " user field " , " value " get bytes ( ) , enum set of ( x attr set flag create ) ) ; / / set x attr op - > metadata update event / / remove x attr op - > metadata update event client remove x attr ( " / file 5 " , " user field " ) ; / / set acl op - > metadata update event client set acl ( " / file 5 " , acl entry parse acl spec ( " user : : rwx , user : foo : rw - , group : : r - - , other : : - - - " , true ) ) ; client remove acl ( " / file 5 " ) ; / / set acl op - > metadata update event client rename ( " / file 5 " , " / dir " ) ; / / rename old op - > rename event / / truncate op - > truncate event client truncate ( " / truncate file " , block size ) ; client create ( " / file ec test 1 " , false ) ; event batch batch = null ; / / rename op batch = wait for next events ( eis ) ; assert assert equals ( 1 , batch get events ( ) length ) ; long txid = batch get txid ( ) ; assert assert true ( batch get events ( ) [ 0 ] get event type ( ) = = event event type rename ) ; event rename event re = ( event rename event ) batch get events ( ) [ 0 ] ; assert assert equals ( " / file 4 " , re get dst path ( ) ) ; assert assert equals ( " / file " , re get src path ( ) ) ; assert assert true ( re get timestamp ( ) > 0 ) ; log info ( re to string ( ) ) ; assert assert true ( re to string ( ) starts with ( " rename event [ src path = " ) ) ; long events behind = eis get txids behind estimate ( ) ; / / rename old op batch = wait for next events ( eis ) ; assert assert equals ( 1 , batch get events ( ) length ) ; txid = check txid ( batch , txid ) ; assert assert true ( batch get events ( ) [ 0 ] get event type ( ) = = event event type rename ) ; event rename event re 2 = ( event rename event ) batch get events ( ) [ 0 ] ; assert assert true ( re 2 get dst path ( ) equals ( " / file 2 " ) ) ; assert assert true ( re 2 get src path ( ) equals ( " / file 4 " ) ) ; assert assert true ( re 2 get timestamp ( ) > 0 ) ; log info ( re 2 to string ( ) ) ; / / add op with overwrite batch = wait for next events ( eis ) ; assert assert equals ( 1 , batch get events ( ) length ) ; txid = check txid ( batch , txid ) ; assert assert true ( batch get events ( ) [ 0 ] get event type ( ) = = event event type create ) ; event create event ce = ( event create event ) batch get events ( ) [ 0 ] ; assert assert true ( ce geti node type ( ) = = event create event i node type file ) ; assert assert true ( ce get path ( ) equals ( " / file 2 " ) ) ; assert assert true ( ce get ctime ( ) > 0 ) ; assert assert true ( ce get replication ( ) > 0 ) ; assert assert true ( ce get symlink target ( ) = = null ) ; assert assert true ( ce get overwrite ( ) ) ; assert assert equals ( block size , ce get default block size ( ) ) ; assert assert true ( ce is erasure coded ( ) is present ( ) ) ; assert assert false ( ce is erasure coded ( ) get ( ) ) ; log info ( ce to string ( ) ) ; assert assert true ( ce to string ( ) starts with ( " create event [ i node type = " ) ) ; / / close op batch = wait for next events ( eis ) ; assert assert equals ( 1 , batch get events ( ) length ) ; txid = check txid ( batch , txid ) ; assert assert true ( batch get events ( ) [ 0 ] get event type ( ) = = event event type close ) ; event close event ce 2 = ( event close event ) batch get events ( ) [ 0 ] ; assert assert true ( ce 2 get path ( ) equals ( " / file 2 " ) ) ; assert assert true ( ce 2 get file size ( ) > 0 ) ; assert assert true ( ce 2 get timestamp ( ) > 0 ) ; log info ( ce 2 to string ( ) ) ; assert assert true ( ce 2 to string ( ) starts with ( " close event [ path = " ) ) ; / / append op batch = wait for next events ( eis ) ; assert assert equals ( 1 , batch get events ( ) length ) ; txid = check txid ( batch , txid ) ; assert assert true ( batch get events ( ) [ 0 ] get event type ( ) = = event event type append ) ; event append event append 2 = ( event append event ) batch get events ( ) [ 0 ] ; assert assert equals ( " / file 2 " , append 2 get path ( ) ) ; assert assert false ( append 2 to new block ( ) ) ; log info ( append 2 to string ( ) ) ; assert assert true ( append 2 to string ( ) starts with ( " append event [ path = " ) ) ; / / close op batch = wait for next events ( eis ) ; assert assert equals ( 1 , batch get events ( ) length ) ; txid = check txid ( batch , txid ) ; assert assert true ( batch get events ( ) [ 0 ] get event type ( ) = = event event type close ) ; assert assert true ( ( ( event close event ) batch get events ( ) [ 0 ] ) get path ( ) equals ( " / file 2 " ) ) ; / / times op batch = wait for next events ( eis ) ; assert assert equals ( 1 , batch get events ( ) length ) ; txid = check txid ( batch , txid ) ; assert assert true ( batch get events ( ) [ 0 ] get event type ( ) = = event event type metadata ) ; event metadata update event mue = ( event metadata update event ) batch get events ( ) [ 0 ] ; assert assert true ( mue get path ( ) equals ( " / file 2 " ) ) ; assert assert true ( mue get metadata type ( ) = = event metadata update event metadata type times ) ; log info ( mue to string ( ) ) ; assert assert true ( mue to string ( ) starts with ( " metadata update event [ path = " ) ) ; / / set replication op batch = wait for next events ( eis ) ; assert assert equals ( 1 , batch get events ( ) length ) ; txid = check txid ( batch , txid ) ; assert assert true ( batch get events ( ) [ 0 ] get event type ( ) = = event event type metadata ) ; event metadata update event mue 2 = ( event metadata update event ) batch get events ( ) [ 0 ] ; assert assert true ( mue 2 get path ( ) equals ( " / file 2 " ) ) ; assert assert true ( mue 2 get metadata type ( ) = = event metadata update event metadata type replication ) ; assert assert true ( mue 2 get replication ( ) = = 1 ) ; log info ( mue 2 to string ( ) ) ; / / concat delete op batch = wait for next events ( eis ) ; assert assert equals ( 3 , batch get events ( ) length ) ; txid = check txid ( batch , txid ) ; assert assert true ( batch get events ( ) [ 0 ] get event type ( ) = = event event type append ) ; assert assert true ( ( ( event append event ) batch get events ( ) [ 0 ] ) get path ( ) equals ( " / file 2 " ) ) ; assert assert true ( batch get events ( ) [ 1 ] get event type ( ) = = event event type unlink ) ; event unlink event ue 2 = ( event unlink event ) batch get events ( ) [ 1 ] ; assert assert true ( ue 2 get path ( ) equals ( " / file 3 " ) ) ; assert assert true ( ue 2 get timestamp ( ) > 0 ) ; log info ( ue 2 to string ( ) ) ; assert assert true ( ue 2 to string ( ) starts with ( " unlink event [ path = " ) ) ; assert assert true ( batch get events ( ) [ 2 ] get event type ( ) = = event event type close ) ; event close event ce 3 = ( event close event ) batch get events ( ) [ 2 ] ; assert assert true ( ce 3 get path ( ) equals ( " / file 2 " ) ) ; assert assert true ( ce 3 get timestamp ( ) > 0 ) ; / / delete op batch = wait for next events ( eis ) ; assert assert equals ( 1 , batch get events ( ) length ) ; txid = check txid ( batch , txid ) ; assert assert true ( batch get events ( ) [ 0 ] get event type ( ) = = event event type unlink ) ; event unlink event ue = ( event unlink event ) batch get events ( ) [ 0 ] ; assert assert true ( ue get path ( ) equals ( " / file 2 " ) ) ; assert assert true ( ue get timestamp ( ) > 0 ) ; log info ( ue to string ( ) ) ; / / mkdir op batch = wait for next events ( eis ) ; assert assert equals ( 1 , batch get events ( ) length ) ; txid = check txid ( batch , txid ) ; assert assert true ( batch get events ( ) [ 0 ] get event type ( ) = = event event type create ) ; event create event ce 4 = ( event create event ) batch get events ( ) [ 0 ] ; assert assert true ( ce 4 geti node type ( ) = = event create event i node type directory ) ; assert assert true ( ce 4 get path ( ) equals ( " / dir " ) ) ; assert assert true ( ce 4 get ctime ( ) > 0 ) ; assert assert true ( ce 4 get replication ( ) = = 0 ) ; assert assert true ( ce 4 get symlink target ( ) = = null ) ; log info ( ce 4 to string ( ) ) ; / / set permissions op batch = wait for next events ( eis ) ; assert assert equals ( 1 , batch get events ( ) length ) ; txid = check txid ( batch , txid ) ; assert assert true ( batch get events ( ) [ 0 ] get event type ( ) = = event event type metadata ) ; event metadata update event mue 3 = ( event metadata update event ) batch get events ( ) [ 0 ] ; assert assert true ( mue 3 get path ( ) equals ( " / dir " ) ) ; assert assert true ( mue 3 get metadata type ( ) = = event metadata update event metadata type perms ) ; assert assert true ( mue 3 get perms ( ) to string ( ) contains ( " rw - rw - rw - " ) ) ; log info ( mue 3 to string ( ) ) ; / / set owner op batch = wait for next events ( eis ) ; assert assert equals ( 1 , batch get events ( ) length ) ; txid = check txid ( batch , txid ) ; assert assert true ( batch get events ( ) [ 0 ] get event type ( ) = = event event type metadata ) ; event metadata update event mue 4 = ( event metadata update event ) batch get events ( ) [ 0 ] ; assert assert true ( mue 4 get path ( ) equals ( " / dir " ) ) ; assert assert true ( mue 4 get metadata type ( ) = = event metadata update event metadata type owner ) ; assert assert true ( mue 4 get owner name ( ) equals ( " username " ) ) ; assert assert true ( mue 4 get group name ( ) equals ( " groupname " ) ) ; log info ( mue 4 to string ( ) ) ; / / symlink op batch = wait for next events ( eis ) ; assert assert equals ( 1 , batch get events ( ) length ) ; txid = check txid ( batch , txid ) ; assert assert true ( batch get events ( ) [ 0 ] get event type ( ) = = event event type create ) ; event create event ce 5 = ( event create event ) batch get events ( ) [ 0 ] ; assert assert true ( ce 5 geti node type ( ) = = event create event i node type symlink ) ; assert assert true ( ce 5 get path ( ) equals ( " / dir 2 " ) ) ; assert assert true ( ce 5 get ctime ( ) > 0 ) ; assert assert true ( ce 5 get replication ( ) = = 0 ) ; assert assert true ( ce 5 get symlink target ( ) equals ( " / dir " ) ) ; log info ( ce 5 to string ( ) ) ; / / set x attr op batch = wait for next events ( eis ) ; assert assert equals ( 1 , batch get events ( ) length ) ; txid = check txid ( batch , txid ) ; assert assert true ( batch get events ( ) [ 0 ] get event type ( ) = = event event type metadata ) ; event metadata update event mue 5 = ( event metadata update event ) batch get events ( ) [ 0 ] ; assert assert true ( mue 5 get path ( ) equals ( " / file 5 " ) ) ; assert assert true ( mue 5 get metadata type ( ) = = event metadata update event metadata type xattrs ) ; assert assert true ( mue 5 getx attrs ( ) size ( ) = = 1 ) ; assert assert true ( mue 5 getx attrs ( ) get ( 0 ) get name ( ) contains ( " field " ) ) ; assert assert true ( ! mue 5 isx attrs removed ( ) ) ; log info ( mue 5 to string ( ) ) ; / / remove x attr op batch = wait for next events ( eis ) ; assert assert equals ( 1 , batch get events ( ) length ) ; txid = check txid ( batch , txid ) ; assert assert true ( batch get events ( ) [ 0 ] get event type ( ) = = event event type metadata ) ; event metadata update event mue 6 = ( event metadata update event ) batch get events ( ) [ 0 ] ; assert assert true ( mue 6 get path ( ) equals ( " / file 5 " ) ) ; assert assert true ( mue 6 get metadata type ( ) = = event metadata update event metadata type xattrs ) ; assert assert true ( mue 6 getx attrs ( ) size ( ) = = 1 ) ; assert assert true ( mue 6 getx attrs ( ) get ( 0 ) get name ( ) contains ( " field " ) ) ; assert assert true ( mue 6 isx attrs removed ( ) ) ; log info ( mue 6 to string ( ) ) ; / / set acl op ( 1 ) batch = wait for next events ( eis ) ; assert assert equals ( 1 , batch get events ( ) length ) ; txid = check txid ( batch , txid ) ; assert assert true ( batch get events ( ) [ 0 ] get event type ( ) = = event event type metadata ) ; event metadata update event mue 7 = ( event metadata update event ) batch get events ( ) [ 0 ] ; assert assert true ( mue 7 get path ( ) equals ( " / file 5 " ) ) ; assert assert true ( mue 7 get metadata type ( ) = = event metadata update event metadata type acls ) ; assert assert true ( mue 7 get acls ( ) contains ( acl entry parse acl entry ( " user : : rwx " , true ) ) ) ; log info ( mue 7 to string ( ) ) ; / / set acl op ( 2 ) batch = wait for next events ( eis ) ; assert assert equals ( 1 , batch get events ( ) length ) ; txid = check txid ( batch , txid ) ; assert assert true ( batch get events ( ) [ 0 ] get event type ( ) = = event event type metadata ) ; event metadata update event mue 8 = ( event metadata update event ) batch get events ( ) [ 0 ] ; assert assert true ( mue 8 get path ( ) equals ( " / file 5 " ) ) ; assert assert true ( mue 8 get metadata type ( ) = = event metadata update event metadata type acls ) ; assert assert true ( mue 8 get acls ( ) = = null ) ; log info ( mue 8 to string ( ) ) ; / / rename op ( 2 ) batch = wait for next events ( eis ) ; assert assert equals ( 1 , batch get events ( ) length ) ; txid = check txid ( batch , txid ) ; assert assert true ( batch get events ( ) [ 0 ] get event type ( ) = = event event type rename ) ; event rename event re 3 = ( event rename event ) batch get events ( ) [ 0 ] ; assert assert true ( re 3 get dst path ( ) equals ( " / dir / file 5 " ) ) ; assert assert true ( re 3 get src path ( ) equals ( " / file 5 " ) ) ; assert assert true ( re 3 get timestamp ( ) > 0 ) ; log info ( re 3 to string ( ) ) ; / / truncate op batch = wait for next events ( eis ) ; assert assert equals ( 1 , batch get events ( ) length ) ; txid = check txid ( batch , txid ) ; assert assert true ( batch get events ( ) [ 0 ] get event type ( ) = = event event type truncate ) ; event truncate event et = ( ( event truncate event ) batch get events ( ) [ 0 ] ) ; assert assert true ( et get path ( ) equals ( " / truncate file " ) ) ; assert assert true ( et get file size ( ) = = block size ) ; assert assert true ( et get timestamp ( ) > 0 ) ; log info ( et to string ( ) ) ; assert assert true ( et to string ( ) starts with ( " truncate event [ path = " ) ) ; / / create event without overwrite batch = wait for next events ( eis ) ; assert assert equals ( 1 , batch get events ( ) length ) ; txid = check txid ( batch , txid ) ; assert assert true ( batch get events ( ) [ 0 ] get event type ( ) = = event event type create ) ; ce = ( event create event ) batch get events ( ) [ 0 ] ; assert assert true ( ce geti node type ( ) = = event create event i node type file ) ; assert assert true ( ce get path ( ) equals ( " / file ec test 1 " ) ) ; assert assert true ( ce get ctime ( ) > 0 ) ; assert assert true ( ce get replication ( ) > 0 ) ; assert assert true ( ce get symlink target ( ) = = null ) ; assert assert false ( ce get overwrite ( ) ) ; assert assert equals ( block size , ce get default block size ( ) ) ; assert assert true ( ce is erasure coded ( ) is present ( ) ) ; assert assert false ( ce is erasure coded ( ) get ( ) ) ; log info ( ce to string ( ) ) ; assert assert true ( ce to string ( ) starts with ( " create event [ i node type = " ) ) ; / / returns null when there are no further events assert assert true ( eis poll ( ) = = null ) ; / / make sure the estimate hasn ' t changed since the above assertion / / tells us that we are fully caught up to the current namesystem state / / and we should not have been behind at all when events behind was set / / either , since there were few enough events that they should have all / / been read to the client during the first poll ( ) call assert assert true ( eis get txids behind estimate ( ) = = events behind ) ; } finally { cluster shutdown ( ) ; } }


public string type ( ) { return this type ; }


how many nanoseconds per iop , byte , etc

public long nanos per operation ( long operations ) { return duration ( ) / operations ; }


public completable future < model api response > upload file ( long pet id , string additional metadata , file file ) throws api exception { try { http request builder local var request builder = upload file request builder ( pet id , additional metadata , file ) ; return member var http client send async ( local var request builder build ( ) , http response body handlers of string ( ) ) then compose async ( local var response - > { if ( local var response status code ( ) / 100 ! = 2 ) { return completable future failed future ( get api exception ( " upload file " , local var response ) ) ; } try { return completable future completed future ( member var object mapper read value ( local var response body ( ) , new type reference < model api response > ( ) { } ) ) ; } catch ( i o exception e ) { return completable future failed future ( new api exception ( e ) ) ; } } ) ; } catch ( api exception e ) { return completable future failed future ( e ) ; } }


public static void connect ( string path , template view route route , template engine engine ) { get instance ( ) connect ( path , route , engine ) ; }


load a spring application context from the supplied { @ link merged context configuration } implementation details : calls { @ link # validate merged context configuration ( merged context configuration ) } to allow subclasses to validate the supplied configuration before proceeding calls { @ link # create context ( ) } to create a { @ link generic application context } instance if the supplied { @ code merged context configuration } references a { @ linkplain merged context configuration # get parent ( ) parent configuration } , the corresponding { @ link merged context configuration # get parent application context ( ) application context } will be retrieved and { @ linkplain generic application context # set parent ( application context ) set as the parent } for the context created by this method calls { @ link # prepare context ( generic application context ) } for backwards compatibility with the { @ link org springframework test context context loader context loader } spi calls { @ link # prepare context ( configurable application context , merged context configuration ) } to allow for customizing the context before bean definitions are loaded calls { @ link # customize bean factory ( default listable bean factory ) } to allow for customizing the context ' s { @ code default listable bean factory } delegates to { @ link # load bean definitions ( generic application context , merged context configuration ) } to populate the context from the locations or classes in the supplied { @ code merged context configuration } delegates to { @ link annotation config utils } for { @ link annotation config utils # register annotation config processors registering } annotation configuration processors calls { @ link # customize context ( generic application context ) } to allow for customizing the context before it is refreshed calls { @ link # customize context ( configurable application context , merged context configuration ) } to allow for customizing the context before it is refreshed { @ link configurable application context # refresh refreshes } the context and registers a jvm shutdown hook for it

public final configurable application context load context ( merged context configuration merged config ) throws exception { if ( logger is debug enabled ( ) ) { logger debug ( string format ( " loading application context for merged context configuration [ % s ] " , merged config ) ) ; } validate merged context configuration ( merged config ) ; generic application context context = create context ( ) ; application context parent = merged config get parent application context ( ) ; if ( parent ! = null ) { context set parent ( parent ) ; } prepare context ( context ) ; prepare context ( context , merged config ) ; customize bean factory ( context get default listable bean factory ( ) ) ; load bean definitions ( context , merged config ) ; annotation config utils register annotation config processors ( context ) ; customize context ( context ) ; customize context ( context , merged config ) ; context refresh ( ) ; context register shutdown hook ( ) ; return context ; }


reads floats from the current position into the specified float array and increases the position by the number of floats read calling this method has the same effect as { @ code get ( dest , 0 , dest length ) }

public float buffer get ( float [ ] dest ) { return get ( dest , 0 , dest length ) ; }


tests that broadcasted events ' buffers are independent ( in their ( reader ) indices ) once they are put into the queue for netty when broadcasting events to multiple channels

public void test broadcast event buffer independence ( ) throws exception { verify broadcast buffer or event independence ( true ) ; }


this supplier is used for all fields that expect to be aggregated as a numeric value this includes floating points , and formatted types that use numerics internally for storage ( date , boolean , etc )

private static significant terms aggregator supplier numeric supplier ( ) { return new significant terms aggregator supplier ( ) { @ override public aggregator build ( string name , aggregator factories factories , values source values source , doc value format format , terms aggregator bucket count thresholds bucket count thresholds , include exclude include exclude , string execution hint , aggregation context context , aggregator parent , significance heuristic significance heuristic , significance lookup lookup , cardinality upper bound cardinality , map < string , object > metadata ) throws i o exception { if ( ( include exclude ! = null ) & & ( include exclude is regex based ( ) ) ) { throw new illegal argument exception ( " aggregation [ " + name + " ] cannot support regular expression style include / exclude " + " settings as they can only be applied to string fields use an array of numeric " + " values for include / exclude clauses used to filter numeric fields " ) ; } values source numeric numeric values source = ( values source numeric ) values source ; if ( numeric values source is floating point ( ) ) { throw new unsupported operation exception ( " no support for examining floating point numerics " ) ; } include exclude long filter long filter = null ; if ( include exclude ! = null ) { long filter = include exclude convert to long filter ( format ) ; } return new numeric terms aggregator ( name , factories , agg - > agg new significant long terms results ( lookup , significance heuristic , cardinality ) , numeric values source , format , null , bucket count thresholds , context , parent , sub agg collection mode breadth first , long filter , cardinality , metadata ) ; } } ; }


shift jis is a multi - byte character encoding in it , 0x 8 2 0x 8 3 is モ , and 0x 8 3 0x 8 2 is ｃ so if aren ' t careful , we ' ll parse the text incorrectly

public void tail shift j i s ( ) throws exception { file f = tmp new file ( ) ; text file t = new text file ( f ) ; try ( output stream o = new file output stream ( f ) ) { for ( int i = 0 ; i < 80 ; i + + ) { for ( int j = 0 ; j < 40 ; j + + ) { o write ( 0x 8 3 ) ; o write ( 0x 8 2 ) ; } o write ( 0x 0 a ) ; } } string tail = t fast tail ( 35 , charset for name ( " shift jis " ) ) ; assert equals ( string utils repeat ( " \ u 3 0e 2 " , 34 ) + " \ n " , tail ) ; assert equals ( 35 , tail length ( ) ) ; / / add one more byte to force fast tail to read from one byte ahead / / between this and the previous case , it should start parsing text incorrectly , until it hits nl / / where it comes back in sync try ( output stream o = new file output stream ( f , true ) ) { o write ( 0x 0 a ) ; } tail = t fast tail ( 35 , charset for name ( " shift jis " ) ) ; assert equals ( string utils repeat ( " \ u 3 0e 2 " , 33 ) + " \ n \ n " , tail ) ; assert equals ( 35 , tail length ( ) ) ; }


used by tests that require a map , but don ' t care whether it ' s populated or not

protected map < k , v > make either map ( ) { try { return make populated map ( ) ; } catch ( unsupported operation exception e ) { return make empty map ( ) ; } }


validates loading a file system state backend with additional parameters from the cluster configuration

public void test load file system state backend ( ) throws exception { final string checkpoint dir = new path ( tmp new folder ( ) to u r i ( ) ) to string ( ) ; final string savepoint dir = new path ( tmp new folder ( ) to u r i ( ) ) to string ( ) ; final string local dir 1 = tmp new folder ( ) get absolute path ( ) ; final string local dir 2 = tmp new folder ( ) get absolute path ( ) ; final string local dirs = local dir 1 + file path separator + local dir 2 ; final boolean incremental = ! checkpointing options incremental checkpoints default value ( ) ; final path expected checkpoints path = new path ( checkpoint dir ) ; final path expected savepoints path = new path ( savepoint dir ) ; / / we configure with the explicit string ( rather than / / abstract state backend # x state backend name ) / / to guard against config - breaking changes of the name final configuration config 1 = new configuration ( ) ; config 1 set string ( backend key , " rocksdb " ) ; config 1 set string ( checkpointing options checkpoints directory , checkpoint dir ) ; config 1 set string ( checkpointing options savepoint directory , savepoint dir ) ; config 1 set string ( rocks d b options local directories , local dirs ) ; config 1 set boolean ( checkpointing options incremental checkpoints , incremental ) ; final configuration config 2 = new configuration ( ) ; config 2 set string ( backend key , rocks d b state backend factory class get name ( ) ) ; config 2 set string ( checkpointing options checkpoints directory , checkpoint dir ) ; config 2 set string ( checkpointing options savepoint directory , savepoint dir ) ; config 2 set string ( rocks d b options local directories , local dirs ) ; config 2 set boolean ( checkpointing options incremental checkpoints , incremental ) ; state backend backend 1 = state backend loader load state backend from config ( config 1 , cl , null ) ; state backend backend 2 = state backend loader load state backend from config ( config 2 , cl , null ) ; assert true ( backend 1 instanceof rocks d b state backend ) ; assert true ( backend 2 instanceof rocks d b state backend ) ; rocks d b state backend fs 1 = ( rocks d b state backend ) backend 1 ; rocks d b state backend fs 2 = ( rocks d b state backend ) backend 2 ; abstract file state backend fs 1back = ( abstract file state backend ) fs 1 get checkpoint backend ( ) ; abstract file state backend fs 2back = ( abstract file state backend ) fs 2 get checkpoint backend ( ) ; assert equals ( expected checkpoints path , fs 1back get checkpoint path ( ) ) ; assert equals ( expected checkpoints path , fs 2back get checkpoint path ( ) ) ; assert equals ( expected savepoints path , fs 1back get savepoint path ( ) ) ; assert equals ( expected savepoints path , fs 2back get savepoint path ( ) ) ; assert equals ( incremental , fs 1 is incremental checkpoints enabled ( ) ) ; assert equals ( incremental , fs 2 is incremental checkpoints enabled ( ) ) ; check paths ( fs 1 get db storage paths ( ) , local dir 1 , local dir 2 ) ; check paths ( fs 2 get db storage paths ( ) , local dir 1 , local dir 2 ) ; }


writes the build file under < code > directory < code > using iso 8859 1 overrides the file if it exists , creates the file if it does not exist

public static void write build ( path directory , string lines ) throws i o exception { path build file = create file ( directory , " build " ) ; write file ( build file , lines ) ; }


given a frame number , prepares the canvas to render based on the nearest cached frame at or before the frame on return the canvas will be prepared as if the nearest cached frame had been rendered and disposed the returned index is the next frame that needs to be composited onto the canvas

private int prepare canvas with closest cached frame ( int previous frame number , canvas canvas ) { for ( int index = previous frame number ; index > = 0 ; index - - ) { frame needed result needed result = is frame needed for rendering ( index ) ; switch ( needed result ) { case required : animated drawable frame info frame info = m animated drawable backend get frame info ( index ) ; closeable reference < bitmap > start bitmap = m callback get cached bitmap ( index ) ; if ( start bitmap ! = null ) { try { canvas draw bitmap ( start bitmap get ( ) , 0 , 0 , null ) ; if ( frame info disposal method = = disposal method dispose to background ) { dispose to background ( canvas , frame info ) ; } return index + 1 ; } finally { start bitmap close ( ) ; } } else { if ( is key frame ( index ) ) { return index ; } else { / / keep going break ; } } case not required : return index + 1 ; case abort : return index ; case skip : default : / / keep going } } return 0 ; }


returns an immutable snapshot of the statistics on the { @ code y } values alone

public stats y stats ( ) { return y stats snapshot ( ) ; }


finds pets by tags multiple tags can be provided with comma separated strings use tag 1 , tag 2 , tag 3 for testing

completion stage < response < set < pet > > > find pets by tags ( @ retrofit 2 http query ( " tags " ) c s v params tags ) ;


public static void check version ( string version ) throws incompatible version exception { long current = convert version ( current ) ; long client version = convert version ( version ) ; long divide version = convert version ( version 0 7 1 ) ; if ( ( current > divide version & & client version < divide version ) | | ( current < divide version & & client version > divide version ) ) { throw new incompatible version exception ( " incompatible client version : " + version ) ; } }


public void prefix array test ( ) { / / todo : test prefix array }


convert an { @ link optional } to a guava { @ link com google common base optional }

public static < t > com google common base optional < t > to guava optional ( final optional < t > optional ) { return com google common base optional from nullable ( optional or else ( null ) ) ; }


create a cci connection via this template ' s connection factory

protected connection do create connection ( ) throws resource exception { connection factory connection factory = get target connection factory ( ) ; assert state ( connection factory ! = null , " no ' target connection factory ' set " ) ; return connection factory get connection ( ) ; }


creates a new client - side { @ link ssl context }

public static ssl context new client context ( file cert chain file , trust manager factory trust manager factory ) throws s s l exception { return new client context ( null , cert chain file , trust manager factory ) ; }


split ip and port strings , support i pv 4 and i pv 6 , ip in i pv 6 must be enclosed with [ ]

public static string [ ] split i p port str ( string str ) { if ( string utils is blank ( str ) ) { throw new illegal argument exception ( " ip and port string cannot be empty ! " ) ; } string [ ] server addr arr ; if ( str starts with ( ipv6 start mark ) & & string utils contains ignore case ( str , ipv6 end mark ) ) { if ( str ends with ( ipv6 end mark ) ) { server addr arr = new string [ 1 ] ; server addr arr [ 0 ] = str ; } else { server addr arr = new string [ 2 ] ; server addr arr [ 0 ] = str substring ( 0 , ( str index of ( ipv6 end mark ) + 1 ) ) ; server addr arr [ 1 ] = str substring ( ( str index of ( ipv6 end mark ) + 2 ) ) ; } if ( ! is i pv 6 ( server addr arr [ 0 ] ) ) { throw new illegal argument exception ( " the i pv 6 address ( \ " " + server addr arr [ 0 ] + " \ " ) is incorrect " ) ; } } else { server addr arr = str split ( " : " ) ; if ( server addr arr length > split ip port result length ) { throw new illegal argument exception ( " the ip address ( \ " " + str + " \ " ) is incorrect if it is an i pv 6 address , please use [ ] to enclose the ip part ! " ) ; } if ( ! is i pv 4 ( server addr arr [ 0 ] ) ) { throw new illegal argument exception ( " the i pv 4 address ( \ " " + server addr arr [ 0 ] + " \ " ) is incorrect " ) ; } } return server addr arr ; }


default class < ? > load jar ( fi jar , string main class ) throws exception { u r l class loader class loader = new u r l class loader ( new url [ ] { jar file ( ) to u r i ( ) to u r l ( ) } , get class ( ) get class loader ( ) ) ; return class for name ( main class , true , class loader ) ; }


get the root causes of the target may be empty

public nested set < cause > get root causes ( ) { return root causes ; }


returns { @ code true } for { @ code unary } and { @ code client streaming } , which do not permit the server to stream

public final boolean server sends one message ( ) { return this = = unary | | this = = client streaming ; }


set movement method ( link movement method get instance ( ) )

public builder set url ( @ non null string url ) { this url = url ; return this ; }


public test field prop text prop view model value quantity res ( @ plurals res int plural res , int quantity , object format args ) { on mutation ( ) ; assigned attributes epoxy generated model set ( 0 ) ; value string attribute data set value ( plural res , quantity , format args ) ; return this ; }


set the flag which if set to true , { @ link skip bad records # counter reduce processed groups } is incremented by framework after invoking the reduce function this value must be set to false for applications which process the records asynchronously or buffer the input records for example streaming in such cases applications should increment this counter on their own default value is true

public static void set auto incr reducer proc count ( configuration conf , boolean auto incr ) { conf set boolean ( auto incr reduce proc count , auto incr ) ; }


checks various conditions for file access if all checks pass this method returns , and processing of the request may continue if any check fails this method throws a { @ link rest handler exception } , and further processing of the request must be limited to sending an error response

public static void check file validity ( file file , file root path , logger logger ) throws i o exception , rest handler exception { / / this check must be done first to prevent probing for arbitrary files if ( ! file get canonical file ( ) to path ( ) starts with ( root path to path ( ) ) ) { if ( logger is debug enabled ( ) ) { logger debug ( " requested path { } points outside the root directory " , file get absolute path ( ) ) ; } throw new rest handler exception ( " forbidden " , forbidden ) ; } if ( ! file exists ( ) | | file is hidden ( ) ) { if ( logger is debug enabled ( ) ) { logger debug ( " requested path { } cannot be found " , file get absolute path ( ) ) ; } throw new rest handler exception ( " file not found " , not found ) ; } if ( file is directory ( ) | | ! file is file ( ) ) { if ( logger is debug enabled ( ) ) { logger debug ( " requested path { } does not point to a file " , file get absolute path ( ) ) ; } throw new rest handler exception ( " file not found " , method not allowed ) ; } }


returns a sample value for the field , to be used when querying the field normally this is the same format as what is indexed as part of a document , and returned by { @ link # get sample value for document ( ) } , but there are cases where fields are queried differently frow how they are indexed e g token count or runtime fields

protected object get sample value for query ( ) { return get sample value for document ( ) ; }


public big decimal get big decimal ( string column label ) throws s q l exception { return null ; }


return the map of hints to use to customize body extraction


updates the toolbar to remove the given action

public void action removed ( docking action if action ) { tool bar mgr remove action ( action ) ; }


register a listener that will be called when this model is unbound from a view the listener will contribute to this model ' s hash code state per the { @ link com airbnb epoxy epoxy attribute option # do not hash } rules you may clear the listener by setting a null value , or by calling { @ link # reset ( ) }

public generate default layout method next parent layout $ no layout on unbind ( on model unbound listener < generate default layout method next parent layout $ no layout , object > listener ) { on mutation ( ) ; this on model unbound listener epoxy generated model = listener ; return this ; }


adds to the input the union of the given operators

public void add inputs ( list < ? extends operator < in > > inputs ) { check not null ( inputs , " the inputs may not be null " ) ; this input = create union cascade ( this input , ( operator < in > [ ] ) inputs to array ( new operator [ inputs size ( ) ] ) ) ; }


public void add ( int value ) { int index = ints binarysearch ( value ) ; if ( index < 0 ) { ints insert ( - ( index + 1 ) , value ) ; } }


retrieve the bloom filter used by this instance of the reader

public filter get bloom filter ( ) { return bloom filter ; }


public final list < aggregation > as list ( ) { return collections unmodifiable list ( aggregations ) ; }


set the group path object in the given node

void set group path ( program node node ) { tree node [ ] pnodes = node get path ( ) ; string [ ] names = new string [ pnodes length ] ; for ( int i = 0 ; i < pnodes length ; i + + ) { program node n = ( program node ) pnodes [ i ] ; names [ i ] = n to string ( ) ; } node set group path ( new group path ( names ) ) ; }


create a new { @ code k table } by transforming the value of each record in this { @ code k table } into a new value ( with possibly a new type ) in the new { @ code k table } , with the { @ link serde key serde } , { @ link serde value serde } , and the underlying { @ link key value store materialized state storage } configured in the { @ link materialized } instance for each { @ code k table } update the provided { @ link value mapper } is applied to the value of the updated record and computes a new value for it , resulting in an updated record for the result { @ code k table } thus , an input record { @ code < k , v > } can be transformed into an output record { @ code < k : v ' > } this is a stateless record - by - record operation the example below counts the number of token of the value string { @ code k table < string , string > input table = builder table ( " topic " ) ; k table < string , integer > output table = input table map value ( new value mapper < string , integer > { integer apply ( string value ) { return value split ( " " ) length ; } } ) ; } to query the local { @ link key value store } representing output table above it must be obtained via { @ link kafka streams # store ( store query parameters ) kafka streams # store ( ) } : for non - local keys , a custom rpc mechanism must be implemented using { @ link kafka streams # all metadata ( ) } to query the value of the key on a parallel running instance of your kafka streams application the store name to query with is specified by { @ link materialized # as ( string ) } or { @ link materialized # as ( key value bytes store supplier ) } this operation preserves data co - location with respect to the key thus , no internal data redistribution is required if a key based operator ( like a join ) is applied to the result { @ code k table } note that { @ code map values } for a changelog stream works differently than { @ link k stream # map values ( value mapper ) record stream filters } , because { @ link key value records } with { @ code null } values ( so - called tombstone records ) have delete semantics thus , for tombstones the provided value - mapper is not evaluated but the tombstone record is forwarded directly to delete the corresponding record in the result { @ code k table }

< vr > k table < k , vr > map values ( final value mapper < ? super v , ? extends vr > mapper , final materialized < k , vr , key value store < bytes , byte [ ] > > materialized ) ;


updated user this can only be done by the logged in user

void update user ( @ param ( " username " ) string username , user body ) ;


add interval ; i e , add all integers from a to b to set if b & lt ; a , do nothing keep list in sorted order ( by left range value ) if overlap , combine ranges for example , if this is { 1 5 , 10 20 } , adding 6 7 yields { 1 5 , 6 7 , 10 20 } adding 4 8 yields { 1 8 , 10 20 }

public void add ( int a , int b ) { add ( interval of ( a , b ) ) ; }


verify disk checker bails after 3 file creation errors

public final void test disk io detects create errors ( ) throws throwable { disk checker replace file output stream provider ( new test file io provider ( disk checker disk io max iterations , 0 ) ) ; check dirs ( false ) ; }


public void clear ( ) { if ( size = = 0 ) return ; this head = 0 ; this tail = 0 ; this size = 0 ; }


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


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


set the first incoming edge of v to be e it is assumed that v has already been added to the graph

void set first incoming edge ( vertex v , edge e ) { try { first incoming edge [ index ( v ) ] = e ; } catch ( array index out of bounds exception exc ) { msg error ( this , " no value exception in set first incoming edge ( ) " + " \ t vertex : " + v to string ( ) + " \ t edge : " + e to string ( ) , exc ) ; } }


returns all variables , as instances of the { @ link variable instance } interface , which gives more information than only the value ( type , execution id , etc )

map < string , variable instance > get variable instances ( ) ;


sets the heuristic network cost for this costs object

public void set heuristic network cost ( double cost ) { if ( cost < = 0 ) { throw new illegal argument exception ( " heuristic costs must be positive " ) ; } this heuristic network cost = cost ; }


public completable future < user > get user by name ( string username ) throws api exception { try { http request builder local var request builder = get user by name request builder ( username ) ; return member var http client send async ( local var request builder build ( ) , http response body handlers of string ( ) ) then compose async ( local var response - > { if ( local var response status code ( ) / 100 ! = 2 ) { return completable future failed future ( get api exception ( " get user by name " , local var response ) ) ; } try { return completable future completed future ( member var object mapper read value ( local var response body ( ) , new type reference < user > ( ) { } ) ) ; } catch ( i o exception e ) { return completable future failed future ( new api exception ( e ) ) ; } } ) ; } catch ( api exception e ) { return completable future failed future ( e ) ; } }


create subdirectories and files under test for those tests that want them doing so adds overhead to setup and teardown , so should only be done for those tests that need them

private void create test subdirs ( ) throws i o exception { test dirs = new path [ ] { path ( " / test / hadoop / a " ) , path ( " / test / hadoop / b " ) , path ( " / test / hadoop / c / 1 " ) , } ; assert path does not exist ( " test directory setup " , test dirs [ 0 ] ) ; for ( path path : test dirs ) { mkdirs ( path ) ; } }


creates a session window the boundary of session windows are defined by intervals of inactivity , i e , a session window is closes if no event appears for a defined gap period

public static session with gap with gap ( expression gap ) { return new session with gap ( gap ) ; }


formats the header of an aggregated log file

private static byte [ ] format container log header ( string container id , string node id , container log aggregation type log type , string file name , string last modified time , long file length ) { string builder sb = new string builder ( ) ; string container str = string format ( log tool utils container on node pattern , container id , node id ) ; sb append ( container str + " \ n " ) append ( " log aggregation type : " + log type + " \ n " ) append ( string utils repeat ( " = " , container str length ( ) ) + " \ n " ) append ( " log type : " + file name + " \ n " ) append ( " log last modified time : " + last modified time + " \ n " ) append ( " log length : " + file length + " \ n " ) append ( " log contents : \ n " ) ; return sb to string ( ) get bytes ( charset for name ( " utf - 8 " ) ) ; }


returns a cache builder configured according to this instance ' s specification

cache builder < object , object > to cache builder ( ) { cache builder < object , object > builder = cache builder new builder ( ) ; if ( initial capacity ! = null ) { builder initial capacity ( initial capacity ) ; } if ( maximum size ! = null ) { builder maximum size ( maximum size ) ; } if ( maximum weight ! = null ) { builder maximum weight ( maximum weight ) ; } if ( concurrency level ! = null ) { builder concurrency level ( concurrency level ) ; } if ( key strength ! = null ) { switch ( key strength ) { case weak : builder weak keys ( ) ; break ; default : throw new assertion error ( ) ; } } if ( value strength ! = null ) { switch ( value strength ) { case soft : builder soft values ( ) ; break ; case weak : builder weak values ( ) ; break ; default : throw new assertion error ( ) ; } } if ( record stats ! = null & & record stats ) { builder record stats ( ) ; } if ( write expiration time unit ! = null ) { builder expire after write ( write expiration duration , write expiration time unit ) ; } if ( access expiration time unit ! = null ) { builder expire after access ( access expiration duration , access expiration time unit ) ; } if ( refresh time unit ! = null ) { builder refresh after write ( refresh duration , refresh time unit ) ; } return builder ; }


trim leading whitespace from the given { @ code string }

public static string trim leading whitespace ( string str ) { if ( ! has length ( str ) ) { return str ; } int begin idx = 0 ; while ( begin idx < str length ( ) & & character is whitespace ( str char at ( begin idx ) ) ) { begin idx + + ; } return str substring ( begin idx ) ; }


add a mapping of a key to a mean statistic function

void add mean statistic function ( string key , function < string , mean statistic > eval ) { mean statistics add function ( key , eval ) ; }


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


returns the next buffer to write data into

public byte buffer get next buffer ( byte buffer last buffer ) { if ( m buffers = = null ) { throw new runtime exception ( when closed ) ; } if ( last buffer ! = m buffers peek last ( ) ) { m buffers add last ( last buffer ) ; } if ( last buffer has remaining ( ) ) { return last buffer ; } else { return byte buffer allocate direct ( 8096 ) ; } }


returns the duration of the window in milliseconds , or { @ link c # time unset } if unknown

public long get duration ms ( ) { return c us to ms ( duration us ) ; }


sets a single { @ code server variables } and returns a reference to this builder so that the methods can be chained together

public builder with server variable ( string key , string value ) { if ( this server variables = = null ) { this server variables = new hash map < > ( ) ; } this server variables put ( key , value ) ; return this ; }


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

public void test body with file schema ( file schema test class body ) throws api exception { test body with file schema with http info ( body ) ; }


returns { @ code true } if the { @ code hash code ( ) } method runs quickly

boolean is hash code fast ( ) { return false ; }


encode and encrypt credential password using the public key supplied by the service the result is base 6 4 encoded and put into the attributes collection again , overwriting the previous value

protected void encode and encrypt credential password ( final map < string , object > attributes , final map < string , string > cached attributes to encode , final registered service cipher executor cipher , final registered service registered service ) { if ( cached attributes to encode contains key ( cas view constants model attribute name principal credential ) ) { val value = cached attributes to encode get ( cas view constants model attribute name principal credential ) ; val decoded value = this cache credential cipher executor decode ( value , array utils empty object array ) ; cached attributes to encode remove ( cas view constants model attribute name principal credential ) ; if ( string utils is not blank ( decoded value ) ) { cached attributes to encode put ( cas view constants model attribute name principal credential , decoded value ) ; } } encrypt and encode and put into attributes map ( attributes , cached attributes to encode , cas view constants model attribute name principal credential , cipher , registered service ) ; }


periodically analyzes a snapshot of the blob storage metrics and updates the sleep duration in order to appropriately throttle storage operations

public void run ( ) { boolean do work = false ; try { do work = doing work compare and set ( 0 , 1 ) ; / / prevent concurrent execution of this task if ( ! do work ) { return ; } long now = system current time millis ( ) ; if ( now - blob metrics get ( ) start time > = analysis period ms ) { abfs operation metrics old metrics = blob metrics get and set ( new abfs operation metrics ( now ) ) ; old metrics end time = now ; sleep duration = analyze metrics and update sleep duration ( old metrics , sleep duration ) ; } } finally { if ( do work ) { doing work set ( 0 ) ; } } }


allowed ip address intelligence response

public static i p address intelligence response allowed ( ) { return builder ( ) status ( i p address intelligence status allowed ) score ( i p address intelligence status allowed get score ( ) ) build ( ) ; }


create a cast where the original type will be boxed , and then the cast will be performed

public static painless cast box original type ( class < ? > original type , class < ? > target type , boolean explicit cast , class < ? > box original type ) { objects require non null ( original type ) ; objects require non null ( target type ) ; objects require non null ( box original type ) ; return new painless cast ( original type , target type , explicit cast , null , null , box original type , null ) ; }


adds a new constraint set to this column based table filter

public < t > void add constraint set ( logic operation logical op , int column index , list < column constraint < t > > constraints ) { constraint sets add ( new column constraint set < > ( model , column index , constraints , logical op ) ) ; or list = null ; / / the current or list is now invalid , this will cause it to be rebuilt when needed }


public action get action ( ) { return action ; }


writes a portion of an array of characters

public void write ( char cbuf [ ] , int off , int len ) throws i o exception { final int off plus len = off + len ; for ( int i = off ; i < off plus len ; ) { char c = cbuf [ i + + ] ; if ( c < 0x 8 0 ) { bytes [ index ] = ( byte ) c ; if ( + + index > = bytes length ) { flush buffer ( ) ; } } else { write ( c ) ; } } }


clears the { @ link surface view } onto which video is being rendered if it matches the one passed else does nothing

void clear video surface view ( @ nullable surface view surface view ) ;


encapsulate the obtained log information into a map

private map < string , string > to message map ( string logger name , string level , object args ) { map < string , string > message map = new hash map < > ( ) ; message map put ( " log kind " , logger name ) ; message map put ( " event " , level ) ; int param start = 2 ; / / like ` warn ( string format , object arg ) ` if ( args [ 0 ] instanceof string ) { param start = 1 ; message map put ( " message " , args [ 0 ] to string ( ) ) ; } else { message map put ( " message " , args [ 1 ] to string ( ) ) ; } / / build log for ( int i = param start ; i < args length ; i + + ) { string key = " param " + ( i - param start + 1 ) ; message map put ( key , args [ i ] to string ( ) ) ; } return message map ; }


creates a new late bound default which always returns the given value this is used primarily for matching names with late - bound attributes on other rules and for testing use normal default values if the name does not matter

public static label late bound default < void > from constant for testing ( label default value ) { return new label late bound default < void > ( false , void class , preconditions check not null ( default value ) , ( rule , attributes , unused ) - > default value ) { } ; }


query configuration information ; database atomic operation , minimum sql action , no business encapsulation

config info find config info ( final string data id , final string group , final string tenant ) ;


returns a supplier whose { @ code get ( ) } method synchronizes on { @ code delegate } before calling it , making it thread - safe

public static < t > supplier < t > synchronized supplier ( supplier < t > delegate ) { return new thread safe supplier < t > ( delegate ) ; }


returns a dispatcher that queues events that are posted in a single global queue this behavior matches the original behavior of async event bus exactly , but is otherwise not especially useful for async dispatch , an { @ linkplain # immediate ( ) immediate } dispatcher should generally be preferable

static dispatcher legacy async ( ) { return new legacy async dispatcher ( ) ; }


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 test outer enum ( ) { / / todo : test outer enum }


an expectation for checking web element with given locator has attribute which contains specific value

public static expected condition < boolean > attribute contains ( final web element element , final string attribute , final string value ) { return new expected condition < boolean > ( ) { @ override public boolean apply ( web driver driver ) { return get attribute or css value ( element , attribute ) map ( seen - > seen contains ( value ) ) or else ( false ) ; } @ override public string to string ( ) { return string format ( " value to contain \ " % s \ " " , value ) ; } } ; }


creates a new instance has a different name and zero incremental file counts but is identical to this instance in terms of the files it references

public blob store index shard snapshot as clone ( string target snapshot name , long start time , long time ) { return new blob store index shard snapshot ( target snapshot name , index version , index files , start time , time , 0 , 0 ) ; }


return { @ code true } if this bounds is assignable to all the specified types

public boolean is assignable from ( resolvable type types ) { for ( resolvable type bound : this bounds ) { for ( resolvable type type : types ) { if ( ! is assignable ( bound , type ) ) { return false ; } } } return true ; }


externally muting a channel should be done via selector to ensure proper state handling

void mute ( ) { if ( mute state = = channel mute state not muted ) { if ( ! disconnected ) transport layer remove interest ops ( selection key op read ) ; mute state = channel mute state muted ; } }


{ @ inherit doc } { @ code proxy hash code ( ) } delegates to { @ link abstract invocation handler # hash code } { @ code proxy to string ( ) } delegates to { @ link abstract invocation handler # to string } { @ code proxy equals ( argument ) } returns true if : { @ code proxy } and { @ code argument } are of the same type and { @ link abstract invocation handler # equals } returns true for the { @ link invocation handler } of { @ code argument } other method calls are dispatched to { @ link # handle invocation }

public final object invoke ( object proxy , method method , @ nullable decl object [ ] args ) throws throwable { if ( args = = null ) { args = no args ; } if ( args length = = 0 & & method get name ( ) equals ( " hash code " ) ) { return hash code ( ) ; } if ( args length = = 1 & & method get name ( ) equals ( " equals " ) & & method get parameter types ( ) [ 0 ] = = object class ) { object arg = args [ 0 ] ; if ( arg = = null ) { return false ; } if ( proxy = = arg ) { return true ; } return is proxy of same interfaces ( arg , proxy get class ( ) ) & & equals ( proxy get invocation handler ( arg ) ) ; } if ( args length = = 0 & & method get name ( ) equals ( " to string " ) ) { return to string ( ) ; } return handle invocation ( proxy , method , args ) ; }


each value of the attributes table must be an attribute structure a method can have any number of optional attributes associated with it the attributes defined by this specification as appearing in the attributes table of a method info structure are the code , exceptions , synthetic , signature , deprecated , runtime visible annotations , runtime invisible annotations , runtime visible parameter annotations , runtime invisible parameter annotations , annotation default attributes a java virtual machine implementation must recognize and correctly read code and exceptions attributes found in the attributes table of a method info structure if a java virtual machine implementation recognizes class files whose version number is 49 0 or above , it must recognize and correctly read signature , runtime visible annotations , runtime invisible annotations , runtime visible parameter annotations , runtime invisible parameter annotations , and annotation default attributes found in the attributes table of a method info structure of a class file whose version number is 49 0 or above a java virtual machine implementation is required to silently ignore any or all attributes in the attributes table of a method info structure that it does not recognize attributes not defined in this specification are not allowed to affect the semantics of the class file , but only to provide additional descriptive information

public abstract attribute info [ ] get attributes ( ) { return attributes ; }


return and access condition for this lease , or else null if there ' s no lease

private access condition get lease condition ( self renewing lease lease ) { access condition lease condition = null ; if ( lease ! = null ) { lease condition = access condition generate lease condition ( lease get lease i d ( ) ) ; } return lease condition ; }


we never render " null " values to x content , but we should test that we can parse them ( and they return correct defaults )

public void test parsing null ( ) throws i o exception { final string range aggregation = " { \ n " + " \ " field \ " : \ " price \ " , \ n " + " \ " ranges \ " : [ \ n " + " { \ " from \ " : null , \ " to \ " : null } \ n " + " ] \ n " + " } " ; x content parser parser = create parser ( json x content json x content , range aggregation ) ; range aggregation builder aggregation builder = range aggregation builder parser parse ( parser , " aggregation name " ) ; assert equals ( 1 , aggregation builder ranges ( ) size ( ) ) ; assert equals ( double negative infinity , aggregation builder ranges ( ) get ( 0 ) get from ( ) , 0 0 ) ; assert equals ( double positive infinity , aggregation builder ranges ( ) get ( 0 ) get to ( ) , 0 0 ) ; }


build an ` http uri request ` in post way

protected static http uri request post request ( string url , map < string , string > params , boolean support enhanced content type ) { http post http post = new http post ( url ) ; if ( params ! = null & & params size ( ) > 0 ) { list < name value pair > list = new array list < > ( params size ( ) ) ; for ( entry < string , string > entry : params entry set ( ) ) { list add ( new basic name value pair ( entry get key ( ) , entry get value ( ) ) ) ; } http post set entity ( new url encoded form entity ( list , consts utf 8 ) ) ; if ( ! support enhanced content type ) { http post set header ( http header content type , http header content type urlencoded ) ; } } return http post ; }


tests { @ link network buffer pool # request memory segments ( int ) } , verifying it may be aborted in case of a concurrent { @ link network buffer pool # destroy ( ) } call

public void test request memory segments interruptable ( ) throws exception { final int num buffers = 10 ; network buffer pool global pool = new network buffer pool ( num buffers , 128 ) ; memory segment segment = global pool request memory segment ( ) ; assert not null ( segment ) ; final one shot latch is running = new one shot latch ( ) ; checked thread async request = new checked thread ( ) { @ override public void go ( ) throws i o exception { is running trigger ( ) ; global pool request memory segments ( 10 ) ; } } ; async request start ( ) ; / / we want the destroy call inside the blocking part of the / / global pool request memory segments ( ) / / call above we cannot guarantee this though but make it highly probable : is running await ( ) ; thread sleep ( 10 ) ; global pool destroy ( ) ; segment free ( ) ; expected exception expect ( illegal state exception class ) ; expected exception expect message ( " destroyed " ) ; try { async request sync ( ) ; } finally { global pool destroy ( ) ; } }


tests that with { @ link high availability mode # zookeeper } distributed j a rs are recoverable from any participating blob server when uploaded via a blob cache

public void test blob cache recovery ( ) throws exception { org apache flink configuration configuration config = new org apache flink configuration configuration ( ) ; config set string ( high availability options ha mode , " zookeeper " ) ; config set string ( blob server options storage directory , temporary folder new folder ( ) get absolute path ( ) ) ; config set string ( high availability options ha storage path , hdfs u r i ) ; blob store service blob store service = blob utils create blob store from config ( config ) ; try { blob cache recovery test test blob cache recovery ( config , blob store service ) ; } finally { blob store service close and cleanup all data ( ) ; } }


crawls the specified input path and collects the raw rule and rule attribute documentation this method crawls the specified input directory ( recursively calling itself for all subdirectories ) and reads each java source file using { @ link source file reader } to extract the raw rule and attribute documentation embedded in comments in a specific format the extracted documentation is then further processed , such as by { @ link build doc collector # collect ( list < string > , string , rule link expander ) , collect } , in order to associate each rule ' s documentation with its attribute documentation this method returns the following through its parameters : the set of java source files processed , a map of rule name to the source file it was extracted from , a map of rule name to the documentation to the rule , and a multimap of attribute name to attribute documentation

public void collect docs ( set < file > processed files , map < string , file > rule class files , map < string , rule documentation > rule doc entries , set < string > deny list , list multimap < string , rule documentation attribute > attribute doc entries , file input path ) throws build encyclopedia doc exception , i o exception { if ( processed files contains ( input path ) ) { return ; } if ( input path is file ( ) ) { if ( docgen consts java source file suffix apply ( input path get name ( ) ) ) { source file reader sfr = new source file reader ( rule class provider , input path get absolute path ( ) ) ; sfr read docs from comments ( ) ; for ( rule documentation d : sfr get rule doc entries ( ) ) { string rule name = d get rule name ( ) ; if ( ! deny list contains ( rule name ) ) { if ( rule doc entries contains key ( rule name ) & & ! rule class files get ( rule name ) equals ( input path ) ) { system err printf ( " warning : ' % s ' from ' % s ' overrides value already in map from ' % s ' \ n " , d get rule name ( ) , input path , rule class files get ( rule name ) ) ; } rule class files put ( rule name , input path ) ; rule doc entries put ( rule name , d ) ; } } if ( attribute doc entries ! = null ) { / / collect all attribute documentations from this file attribute doc entries put all ( sfr get attribute doc entries ( ) ) ; } } } else if ( input path is directory ( ) ) { for ( file child path : input path list files ( ) ) { collect docs ( processed files , rule class files , rule doc entries , deny list , attribute doc entries , child path ) ; } } processed files add ( input path ) ; }


sets the { @ link load control } that will be used by the player

public builder set load control ( load control load control ) { assertions check state ( ! build called ) ; this load control = load control ; return this ; }


were there overrides for this bean ? only valid after processing has occurred at least once

public boolean has property overrides for ( string bean name ) { return this bean names contains ( bean name ) ; }


returns the set of command - line lto backend options

public immutable list < string > get lto backend options ( ) { return ltobackend options ; }


checks if the location of the tool is overridden for the given node , and if so , return the node - specific home directory otherwise return { @ code installation get home ( ) } this is the core logic behind { @ link node specific # for node ( node , task listener ) } for { @ link tool installation }

public static string get tool home ( node node , tool installation installation , task listener log ) throws i o exception , interrupted exception { string result = null ; / / node - specific configuration takes precedence tool location node property property = node get node properties ( ) get ( tool location node property class ) ; if ( property ! = null ) { result = property get home ( installation ) ; } if ( result ! = null ) { return result ; } / / consult translators for ( tool location translator t : tool location translator all ( ) ) { result = t get tool home ( node , installation , log ) ; if ( result ! = null ) { return result ; } } / / fall back is no - op return installation get home ( ) ; }


get a { @ link reader } that corresponds to a specified column index from { @ link result set }

public reader get nullable result ( result set rs , int column index ) throws s q l exception { return to reader ( rs get clob ( column index ) ) ; }


public span utils append line ( ) { apply ( m type char sequence ) ; m text = line separator ; return this ; }


create a { @ link jms response } targeting the queue with the specified name

public static < t > jms response < t > for queue ( t result , string queue name ) { assert not null ( queue name , " queue name must not be null " ) ; return new jms response < > ( result , new destination name holder ( queue name , false ) ) ; }


convert binary data to a sequence of hex characters

public static char [ ] hex dump ( byte [ ] data ) { char buf [ ] = new char [ data length * 2 ] ; for ( int i = 0 ; i < data length ; i + + ) { string b = integer to hex string ( data [ i ] & 0x f f ) ; if ( b length ( ) < 2 ) { buf [ i * 2 + 0 ] = ' 0 ' ; buf [ i * 2 + 1 ] = b char at ( 0 ) ; } else { buf [ i * 2 + 0 ] = b char at ( 0 ) ; buf [ i * 2 + 1 ] = b char at ( 1 ) ; } } return buf ; }


public void string item test ( ) { / / todo : test string item }


find a single { @ link annotation } of { @ code annotation type } on the supplied { @ link class } , traversing its interfaces , annotations , and superclasses if the annotation is not directly present on the given class itself this method explicitly handles class - level annotations which are not declared as { @ link java lang annotation inherited inherited } as well as meta - annotations and annotations on interfaces the algorithm operates as follows : search for the annotation on the given class and return it if found recursively search through all annotations that the given class declares recursively search through all interfaces that the given class declares recursively search through the superclass hierarchy of the given class note : in this context , the term recursively means that the search process continues by returning to step # 1 with the current interface , annotation , or superclass as the class to look for annotations on

public static < a extends annotation > a find annotation ( class < ? > clazz , @ nullable class < a > annotation type ) { if ( annotation type = = null ) { return null ; } / / shortcut : directly present on the element , with no merging needed ? if ( annotation filter plain matches ( annotation type ) | | annotations scanner has plain java annotations only ( clazz ) ) { a annotation = clazz get declared annotation ( annotation type ) ; if ( annotation ! = null ) { return annotation ; } / / for backwards compatibility , perform a superclass search with plain annotations / / even if not marked as @ inherited : e g a find annotation search for @ deprecated class < ? > superclass = clazz get superclass ( ) ; if ( superclass = = null | | superclass = = object class ) { return null ; } return find annotation ( superclass , annotation type ) ; } / / exhaustive retrieval of merged annotations return merged annotations from ( clazz , search strategy type hierarchy , repeatable containers none ( ) ) get ( annotation type ) with non merged attributes ( ) synthesize ( merged annotation : : is present ) or else ( null ) ; }


loads ( but doesn ' t link or initialize ) the class

public class < ? > load ( ) { try { return loader load class ( class name ) ; } catch ( class not found exception e ) { / / shouldn ' t happen , since the class name is read from the class path throw new illegal state exception ( e ) ; } }


start a keep - alive thread that will continue to renew the lease until it is freed or the process dies

public void run ( ) { log debug ( " starting lease keep - alive thread " ) ; access condition access condition = access condition generate empty condition ( ) ; access condition set lease i d ( lease i d ) ; while ( ! lease freed ) { try { thread sleep ( lease renewal period ) ; } catch ( interrupted exception e ) { log debug ( " keep - alive thread for lease " + lease i d + " interrupted " ) ; / / restore the interrupted status thread current thread ( ) interrupt ( ) ; } try { if ( ! lease freed ) { blob wrapper get blob ( ) renew lease ( access condition ) ; / / it ' ll be very rare to renew the lease ( most will be short ) / / so log that we did it , to help with system debugging log info ( " renewed lease " + lease i d + " on " + get cloud blob ( ) get uri ( ) ) ; } } catch ( storage exception e ) { if ( ! lease freed ) { / / free the lease so we don ' t leave this thread running forever lease freed = true ; / / normally leases should be freed and there should be no / / exceptions , so log a warning log warn ( " attempt to renew lease " + lease i d + " on " + get cloud blob ( ) get uri ( ) + " failed , but lease not yet freed reason : " + e get message ( ) ) ; } } } }


tells this thread to commit a set of offsets this method does not block , the committing operation will happen asynchronously only one commit operation may be pending at any time if the committing takes longer than the frequency with which this method is called , then some commits may be skipped due to being superseded by newer ones

void set offsets to commit ( map < topic partition , offset and metadata > offsets to commit , @ nonnull kafka commit callback commit callback ) { / / record the work to be committed by the main consumer thread and make sure the consumer / / notices that if ( next offsets to commit get and set ( tuple 2 of ( offsets to commit , commit callback ) ) ! = null ) { log warn ( " committing offsets to kafka takes longer than the checkpoint interval " + " skipping commit of previous offsets because newer complete checkpoint offsets are available " + " this does not compromise flink ' s checkpoint integrity " ) ; } / / if the consumer is blocked in a poll ( ) or handover operation , wake it up to commit soon handover wakeup producer ( ) ; synchronized ( consumer reassignment lock ) { if ( consumer ! = null ) { consumer wakeup ( ) ; } else { / / the consumer is currently isolated for partition reassignment ; / / set this flag so that the wakeup state is restored once the reassignment is / / complete has buffered wakeup = true ; } } }


returns the decision for where a shard should reside in the cluster if the shard is unassigned , then the { @ link allocate unassigned decision } will be non - null if the shard is not in the unassigned state , then the { @ link move decision } will be non - null this method is primarily used by the cluster allocation explain api to provide detailed explanations for the allocation of a single shard implementations of the { @ link # allocate ( routing allocation ) } method may use the results of this method implementation to decide on allocating shards in the routing table to the cluster if an implementation of this interface does not support explaining decisions for a single shard through the cluster explain api , then this method should throw a { @ code unsupported operation exception }

shard allocation decision decide shard allocation ( shard routing shard , routing allocation allocation ) ;


suppose this method is called back from the above native method pro guard would remove it , because it is not referenced from java the annotation will make sure it is preserved anyhow

public int get answer ( ) { return 42 ; }


public static view set status bar color ( @ non null final activity activity , @ color int final int color ) { return set status bar color ( activity , color , false ) ; }


a sensible definition of { @ link # lower entry } in terms of the { @ code last entry ( ) } of { @ link # head map ( object , boolean ) } if you override { @ code head map } , you may wish to override { @ code lower entry } to forward to this implementation

protected entry < k , v > standard lower entry ( k key ) { return head map ( key , false ) last entry ( ) ; }


called when a track of type { @ code track type } is not supported by the player

void on unsupported track ( int track type ) ;


compute the value using { @ link montgomery # mod ( long ) }

double compute montgomery ( ) { long e = e value ; long n = n value ; double s = 0 ; for ( ; e > e limit ; e + = e delta ) { s = modular add mod ( s , montgomery set ( n ) mod ( e ) / ( double ) n ) ; n + = n delta ; } return s ; }


public void set name ( string name ) { if ( name = = null ) { throw new null pointer exception ( ) ; } this name = name ; }


adds an { @ link extension } that will be invoked with the other attachdetach binders can be used to add generic functionality ( e g dynamic props ) to a render unit nb : this method should only be called while initially configuring the render unit see the class - level javadocs about immutability

public void add attach detach extension ( extension < ? , ? super mount content > extension ) { if ( m attach detach extensions = = null ) { m attach detach extensions = new array list < > ( ) ; if ( m attach detach binder type to extension map ! = null ) { throw new illegal state exception ( " extension map and extension list out of sync ! " ) ; } m attach detach binder type to extension map = new hash map < > ( ) ; } add extension ( m attach detach binder type to extension map , m attach detach extensions , extension ) ; }


delegates to the underlying file type map

public string get content type ( file file ) { return get file type map ( ) get content type ( file ) ; }


calculates the new value for the accumulated mean when a value is added , in the case where at least one of the previous mean and the value is non - finite

static double calculate new mean non finite ( double previous mean , double value ) { / * * desired behaviour is to match the results of applying the naive mean formula in particular , * the update formula can subtract infinities in cases where the naive formula would add them * * consequently : * 1 if the previous mean is finite and the new value is non - finite then the new mean is that * value ( whether it is na n or infinity ) * 2 if the new value is finite and the previous mean is non - finite then the mean is unchanged * ( whether it is na n or infinity ) * 3 if both the previous mean and the new value are non - finite and * 3a either or both is na n ( so mean ! = value ) then the new mean is na n * 3b they are both the same infinities ( so mean = = value ) then the mean is unchanged * 3c they are different infinities ( so mean ! = value ) then the new mean is na n * / if ( is finite ( previous mean ) ) { / / this is case 1 return value ; } else if ( is finite ( value ) | | previous mean = = value ) { / / this is case 2 or 3b return previous mean ; } else { / / this is case 3a or 3c return na n ; } }


returns the signed integer value of the requested attribute after resolving any dwarf expression opcodes

public int parse int ( int attribute , int default value ) throws i o exception , d w a r f expression exception { attr info attr info = find attribute ( attribute ) ; if ( attr info = = null ) { return default value ; } d w a r f attribute value attr = attr info attr ; if ( attr instanceof d w a r f numeric attribute ) { return assert valid int ( ( ( d w a r f numeric attribute ) attr ) get value ( ) ) ; } else if ( attr instanceof d w a r f blob attribute ) { byte [ ] expr bytes = ( ( d w a r f blob attribute ) attr ) get bytes ( ) ; d w a r f expression evaluator evaluator = d w a r f expression evaluator create ( get head fragment ( ) ) ; ghidra app util bin format dwarf 4 expression d w a r f expression expr = evaluator read expr ( expr bytes ) ; evaluator evaluate ( expr , 0 ) ; return assert valid int ( evaluator pop ( ) ) ; } else { throw new i o exception ( " dwarf attribute form not valid for integer value : " + attr info form ) ; } }


creates a new { @ link inet socket address } that overrides the host with { @ link # test server host }

public static inet socket address test server address ( string host , int port ) { try { inet address inet address = inet address get by name ( host ) ; inet address = inet address get by address ( test server host , inet address get address ( ) ) ; return new inet socket address ( inet address , port ) ; } catch ( unknown host exception e ) { throw new runtime exception ( e ) ; } }


returns type variable named { @ code name } without bounds

public static type variable name get ( string name ) { return type variable name of ( name , collections empty list ( ) ) ; }


write all contents from the { @ link input stream } as a prefix file for the combined zip file

public void prepend executable ( input stream in ) throws i o exception { out start prefix file ( ) ; copy stream ( in , out ) ; out end prefix file ( ) ; }


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 docking action if get action ( ) { return tool bar action ; }


public void test add mem fallthrough conflict 3 ( ) throws exception { mtf initialize ( " notepad merge listing test " , new program modifier listener ( ) { / * ( non - javadoc ) * @ see ghidra framework data program modifier listener # modify latest ( ghidra program database program d b ) * / @ override public void modify latest ( program d b program ) { int tx id = program start transaction ( " modify latest program " ) ; boolean commit = false ; try { reference manager ref mgr = program get reference manager ( ) ; ref mgr add memory reference ( addr ( program , " 0x 0 1 0 0 2f 4 9 " ) , addr ( program , " 0x 0 1 0 0 2f 5 5 " ) , ref type read write , source type user defined , - 1 ) ; ref mgr add memory reference ( addr ( program , " 0x 0 1 0 0 2f 4 9 " ) , addr ( program , " 0x 0 1 0 0 2f 5d " ) , ref type fall through , source type user defined , - 1 ) ; commit = true ; } finally { program end transaction ( tx id , commit ) ; } } / * ( non - javadoc ) * @ see ghidra framework data program modifier listener # modify private ( ghidra program database program d b ) * / @ override public void modify private ( program d b program ) { int tx id = program start transaction ( " modify my program " ) ; boolean commit = false ; try { reference manager ref mgr = program get reference manager ( ) ; ref mgr add memory reference ( addr ( program , " 0x 0 1 0 0 2f 4 9 " ) , addr ( program , " 0x 0 1 0 0 2f 5 5 " ) , ref type fall through , source type user defined , - 1 ) ; commit = true ; } finally { program end transaction ( tx id , commit ) ; } } } ) ; execute merge ( ask user ) ; choose code unit ( " 0x 1 0 0 2f 4 9 " , " 0x 1 0 0 2f 4a " , keep latest ) ; / / fallthrough is now a code unit diff wait for merge completion ( ) ; reference manager ref mgr = result program get reference manager ( ) ; reference [ ] refs ; refs = ref mgr get references from ( addr ( " 0x 0 1 0 0 2f 4 9 " ) , - 1 ) ; arrays sort ( refs ) ; assert equals ( 2 , refs length ) ; assert equals ( addr ( " 0x 0 1 0 0 2f 5 5 " ) , refs [ 0 ] get to address ( ) ) ; assert equals ( ref type read write , refs [ 0 ] get reference type ( ) ) ; assert equals ( true , refs [ 0 ] is primary ( ) ) ; assert equals ( addr ( " 0x 0 1 0 0 2f 5d " ) , refs [ 1 ] get to address ( ) ) ; assert equals ( ref type fall through , refs [ 1 ] get reference type ( ) ) ; assert equals ( false , refs [ 1 ] is primary ( ) ) ; }


write out a credentials object as a local file

public static void do formatted write ( file f , string format , credentials creds , configuration conf ) throws i o exception { / / default to oldest supported format for compatibility credentials serialized format creds format = credentials serialized format writable ; if ( format equals ( format pb ) ) { creds format = credentials serialized format protobuf ; } creds write token storage file ( file to path ( f ) , conf , creds format ) ; }


returns the maximum number of queued control frames that are allowed before the connection is closed this allows to protected against various attacks that can lead to high cpu memory usage if the remote - peer floods us with frames that would have us produce control frames , but stops to read from the underlying socket { @ code 0 } means no protection is in place

protected int encoder enforce max queued control frames ( ) { return max queued control frames ; }


public static void build ( mesh part builder builder , float width , float height , float inner width , float inner height , int divisions , vector 3 center , vector 3 normal ) { build ( builder , width , height , inner width , inner height , divisions , center x , center y , center z , normal x , normal y , normal z , 0f , 3 6 0f ) ; }


public string get small snake ( ) { return small snake ; }


returns the current event - time watermark


checks whether the pruning marker was set

public boolean is prune marker set ( ) { return this p flag ; }


determine if further error handling should be bypassed

public boolean trigger after error ( native web request request , deferred result < ? > deferred result , throwable ex ) throws exception { for ( deferred result processing interceptor interceptor : this interceptors ) { if ( deferred result is set or expired ( ) ) { return false ; } if ( ! interceptor handle error ( request , deferred result , ex ) ) { return false ; } } return true ; }


set the date format used to parseformat date parameters

public api client set date format ( date format date format ) { this date format = date format ; / / also set the date format for model ( de ) serialization with date properties this json set date format ( ( date format ) date format clone ( ) ) ; return this ; }


convert the specified checked { @ link javax jms j m s exception j m s exception } to a spring runtime { @ link org springframework jms jms exception jms exception } equivalent

public static jms exception convert jms access exception ( j m s exception ex ) { assert not null ( ex , " j m s exception must not be null " ) ; if ( ex instanceof javax jms illegal state exception ) { return new org springframework jms illegal state exception ( ( javax jms illegal state exception ) ex ) ; } if ( ex instanceof javax jms invalid client i d exception ) { return new invalid client i d exception ( ( javax jms invalid client i d exception ) ex ) ; } if ( ex instanceof javax jms invalid destination exception ) { return new invalid destination exception ( ( javax jms invalid destination exception ) ex ) ; } if ( ex instanceof javax jms invalid selector exception ) { return new invalid selector exception ( ( javax jms invalid selector exception ) ex ) ; } if ( ex instanceof javax jms j m s security exception ) { return new jms security exception ( ( javax jms j m s security exception ) ex ) ; } if ( ex instanceof javax jms message e o f exception ) { return new message e o f exception ( ( javax jms message e o f exception ) ex ) ; } if ( ex instanceof javax jms message format exception ) { return new message format exception ( ( javax jms message format exception ) ex ) ; } if ( ex instanceof javax jms message not readable exception ) { return new message not readable exception ( ( javax jms message not readable exception ) ex ) ; } if ( ex instanceof javax jms message not writeable exception ) { return new message not writeable exception ( ( javax jms message not writeable exception ) ex ) ; } if ( ex instanceof javax jms resource allocation exception ) { return new resource allocation exception ( ( javax jms resource allocation exception ) ex ) ; } if ( ex instanceof javax jms transaction in progress exception ) { return new transaction in progress exception ( ( javax jms transaction in progress exception ) ex ) ; } if ( ex instanceof javax jms transaction rolled back exception ) { return new transaction rolled back exception ( ( javax jms transaction rolled back exception ) ex ) ; } / / fallback return new uncategorized jms exception ( ex ) ; }


finds the result type of a decimal rounding operation

public static decimal type find round decimal type ( int precision , int scale , int round ) { if ( round > = scale ) { return new decimal type ( false , precision , scale ) ; } if ( round < 0 ) { return new decimal type ( false , math min ( decimal type max precision , 1 + precision - scale ) , 0 ) ; } / / 0 < = r < s / / note : rounding may increase the digits by 1 , therefore we need + 1 on precisions return new decimal type ( false , 1 + precision - scale + round , round ) ; }


add static data to this view , exposed in each view " static " attributes are fixed attributes that are specified in the view instance configuration " dynamic " attributes , on the other hand , are values passed in as part of the model must be invoked before any calls to { @ code render }

public void add static attribute ( string name , object value ) { this static attributes put ( name , value ) ; }


register a listener that will be called when this model visibility state has changed the listener will contribute to this model ' s hash code state per the { @ link com airbnb epoxy epoxy attribute option # do not hash } rules

public test many types view model on visibility state changed ( on model visibility state changed listener < test many types view model , test many types view > listener ) { on mutation ( ) ; this on model visibility state changed listener epoxy generated model = listener ; return this ; }


return field error arguments for a binding error on the given field invoked for each missing required field and each type mismatch the default implementation returns a single argument indicating the field name ( of type default message source resolvable , with " object name field " and " field " as codes )

protected object [ ] get arguments for bind error ( string object name , string field ) { string [ ] codes = new string [ ] { object name + errors nested path separator + field , field } ; return new object [ ] { new default message source resolvable ( codes , field ) } ; }


public cache get cache ( ) { return this cache ; }


release an allocated container on this node it also releases from the reservation list to trigger preemption allocations

public synchronized void release container ( container id container id , boolean released by node ) { r m container container = get container ( container id ) ; super release container ( container id , released by node ) ; if ( container ! = null ) { containers for preemption remove ( container ) ; } }


string extract local username from uri ( string uri ) ;


returns whether the two defined data objects are the same

private boolean is same data ( data d 1 , data d 2 ) { if ( d 1 get length ( ) ! = d 2 get length ( ) ) { return false ; } ghidra program model data data type dt 1 = d 1 get data type ( ) ; ghidra program model data data type dt 2 = d 2 get data type ( ) ; if ( ! dt 1 is equivalent ( dt 2 ) ) { return false ; } / / detect that data type name or path differs ? if ( ! dt 1 get path name ( ) equals ( dt 2 get path name ( ) ) ) { return false ; } return true ; }


public int get type ( ) { return type ; }


returns true if - - fission contains the current compilation mode

public boolean fission is active for current compilation mode ( ) { return cpp options fission modes contains ( compilation mode ) ; }


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


returns the { @ link format } that can be used to decode the wrapped metadata in { @ link # get wrapped metadata bytes ( ) } , or null if this entry doesn ' t contain wrapped metadata

default format get wrapped metadata format ( ) { return null ; }


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

public static fields find by thrift id ( int field id ) { switch ( field id ) { case 1 : / / millis return millis ; default : return null ; } }


gets the string form for a stack element this is the same as { @ code to string ( ) } except that { @ code null } is converted to { @ code " < invalid > " }

private static string stack element string ( type bearer type ) { if ( type = = null ) { return " < invalid > " ; } return type to string ( ) ; }


public void add pet test ( ) { pet pet = null ; / / api add pet ( pet ) ; / / todo : test validations }


public list < integer > get array item ( ) { return array item ; }


patch fake classname test : to test class name in snake case to test class name in snake case

response entity < client > test classname ( @ api param ( value = " client model " , required = true ) @ valid @ request body client body ) ;


returns ids for dependent nodes of a given node , sorted by attribute note that some dependencies do not have a corresponding attribute here , and we use the null attribute to represent those edges if { @ code aspect } is null , returns the dependent nodes of the configured target node representing the given target and configuration , otherwise that of the aspect node accompanying the aforementioned configured target node for the specified aspect the values are not simply labels because this also implements the first step of applying configuration transitions , namely , split transitions this needs to be done before the labels are resolved because late bound attributes depend on the configuration a good example for this is @ { code : cc toolchain } the long - term goal is that most configuration transitions be applied here however , in order to do that , we first have to eliminate transitions that depend on the rule class of the dependency

public final ordered set multimap < dependency kind , dependency key > dependent node map ( target and configuration node , build configuration host config , @ nullable aspect aspect , immutable map < label , config matching provider > config conditions , @ nullable toolchain collection < toolchain context > toolchain contexts , boolean use toolchain transition , @ nullable transition factory < rule > trimming transition factory ) throws failure , interrupted exception , inconsistent aspect order exception { nested set builder < cause > root causes = nested set builder stable order ( ) ; ordered set multimap < dependency kind , dependency key > outgoing edges = dependent node map ( node , host config , aspect ! = null ? immutable list of ( aspect ) : immutable list of ( ) , config conditions , toolchain contexts , use toolchain transition , root causes , trimming transition factory ) ; if ( ! root causes is empty ( ) ) { throw new illegal state exception ( root causes build ( ) to list ( ) iterator ( ) next ( ) to string ( ) ) ; } return outgoing edges ; }


use this to connect the zipkin v 1 interface will be under " apiv 1 "

public string http url ( ) { return string format ( " http : / / % s : % s " , server get host name ( ) , server get port ( ) ) ; }


return a hash code derived from the { @ code name } property of this { @ code property source } object

public int hash code ( ) { return object utils null safe hash code ( get name ( ) ) ; }


public depset / * < symlink entry > * / get root symlinks for starlark ( ) { return depset of ( symlink entry type , root symlinks ) ; }


this saves scripts that not only have keybindings , but that are also marked as " in tool " from the gui

void save scripts that are in tool ( save state save state ) { set < resource file > action script files = action map key set ( ) ; set < string > script paths = new hash set < > ( action script files size ( ) ) ; for ( resource file file : action script files ) { script paths add ( generic util path to path string ( file ) ) ; } string [ ] array = script paths to array ( new string [ script paths size ( ) ] ) ; save state put strings ( script actions key , array ) ; }


instantiate & amp ; start a single datanode daemon and wait for it to finish if this thread is specifically interrupted , it will stop waiting

public static data node create data node ( string args [ ] , configuration conf , secure resources resources ) throws i o exception { data node dn = instantiate data node ( args , conf , resources ) ; if ( dn ! = null ) { dn run datanode daemon ( ) ; } return dn ; }