resolves the given path with respect to given base if the path represents an absolute path , a file representing it is returned , otherwise a file representing a path relative to base is returned it would be nice if file # file ( file , string ) were doing this

public static file absolutize ( file base , string path ) { if ( is absolute ( path ) ) return new file ( path ) ; return new file ( base , path ) ; }


public long get int 6 4 ( ) { return int 6 4 ; }


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


returns the offset to the name of this resource

public int get name offset ( ) { return name offset ; }


private void setup audit logs ( ) throws i o exception { logger logger = ( ( log 4 j logger ) f s namesystem audit log ) get logger ( ) ; / / enable logging now that the test is ready to run logger set level ( level info ) ; }


sets the optional end position in milliseconds which must be a value larger than or equal to zero , or { @ link c # time end of source } to end when playback reaches the end of media ( default : { @ link c # time end of source } )

public builder set clip end position ms ( long end position ms ) { assertions check argument ( end position ms = = c time end of source | | end position ms > = 0 ) ; this clip end position ms = end position ms ; return this ; }


test that a structure can contain a pointer in it to the same structure

public void test no cyclic dependency problem for structure pointer ( ) { pointer structure pointer = create pointer ( struct , 4 ) ; try { struct add ( structure pointer ) ; } catch ( illegal argument exception e ) { assert fail ( " should be able to add a structure pointer to the pointer ' s structure " ) ; } try { struct insert ( 0 , structure pointer ) ; } catch ( illegal argument exception e ) { assert fail ( " should be able to insert a structure pointer into the pointer ' s structure " ) ; } try { struct replace ( 0 , structure pointer , structure pointer get length ( ) ) ; } catch ( illegal argument exception e ) { assert fail ( " should be able to replace a structure component with the structure ' s pointer " ) ; } }


public big decimal get prefix ns number ( ) { return prefix ns number ; }


public void use cache aside stategy ( ) { logger info ( " # caching policy aside " ) ; app manager init caching policy ( caching policy aside ) ; logger info ( app manager print cache content ( ) ) ; var user account 3 = new user account ( " 003 " , " adam " , " he likes food " ) ; var user account 4 = new user account ( " 004 " , " rita " , " she hates cats " ) ; var user account 5 = new user account ( " 005 " , " isaac " , " he is allergic to mustard " ) ; app manager save ( user account 3 ) ; app manager save ( user account 4 ) ; app manager save ( user account 5 ) ; logger info ( app manager print cache content ( ) ) ; app manager find ( " 003 " ) ; logger info ( app manager print cache content ( ) ) ; app manager find ( " 004 " ) ; logger info ( app manager print cache content ( ) ) ; }


rejects the timestamp last polled in { @ link # maybe poll timestamp ( long ) } the instance will enter the error state and poll timestamps infrequently until the next call to { @ link # accept timestamp ( ) }

public void reject timestamp ( ) { update state ( state error ) ; }


public task attempt i d get task attempt id ( ) { return task attempt i d for name ( datum get attempt id ( ) to string ( ) ) ; }


returns an immutable array containing a single value

public static immutable double array of ( double e 0 ) { return new immutable double array ( new double [ ] { e 0 } ) ; }


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


this method should catch the most common errors however , another validation is required in deeper layers as we don ' t know whether the data type is used for input or output declaration

private static < c > class < c > perform early class validation ( logical type logical type , class < c > candidate ) { if ( candidate ! = null & & ! logical type supports input conversion ( candidate ) & & ! logical type supports output conversion ( candidate ) ) { throw new validation exception ( string format ( " logical type ' % s ' does not support a conversion from or to class ' % s ' " , logical type as summary string ( ) , candidate get name ( ) ) ) ; } return candidate ; }


public void remove status item ( j component c ) { root remove status item ( c ) ; }


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


register a check that a parameter update will cause a conflict , using the minimal mapping as a base

public void register conflict check ( string param , checked consumer < x content builder , i o exception > update ) throws i o exception { conflict checks put ( param , new conflict check ( top mapping ( b - > b start object ( field name ( ) ) end object ( ) ) , top mapping ( b - > { b start object ( field name ( ) ) ; update accept ( b ) ; b end object ( ) ; } ) ) ) ; }


inserts the string representation of the specified subsequence of the { @ code char [ ] } at the specified { @ code offset } the { @ code char [ ] } value is converted to a string according to the rule defined by { @ link string # value of ( char [ ] , int , int ) }

public string builder insert ( int offset , char [ ] str , int str offset , int str len ) { insert 0 ( offset , str , str offset , str len ) ; return this ; }


public void test delete tag ( ) throws exception { string name = " test " ; / / first add a tag ( so we have something to delete ) create tag ( name ) ; assert true ( tag exists ( name , get all tags ( ) ) ) ; delete tag ( name ) ; assert false ( tag exists ( name , get all tags ( ) ) ) ; }


log in the login principal as the current user

public void login principal ( ) throws i o exception { login user ( get login principal ( ) ) ; }


retrieve the theme message for the given code note that theme messages are never html - escaped , as they typically denote theme - specific resource paths and not client - visible messages

public string get theme message ( string code , @ nullable list < ? > args ) throws no such message exception { return get theme ( ) get message source ( ) get message ( code , ( args ! = null ? args to array ( ) : null ) , get locale ( ) ) ; }


get the { @ link url urls } that { @ link dubbo metadata service } exported by the specified { @ link service instance service instances }

public list < url > get dubbo metadata service u r ls ( list < service instance > service instances , string service interface , string version , string protocol ) { return service instances stream ( ) map ( this : : get dubbo metadata service u r ls ) flat map ( list : : stream ) filter ( url - > protocol = = null | | objects equals ( protocol , url get protocol ( ) ) ) filter ( url - > objects equals ( service interface , url get service interface ( ) ) ) filter ( url - > objects equals ( version , url get parameter ( version key ) ) ) collect ( collectors to list ( ) ) ; }


returns the { @ link method } instance for { @ link # test add supported null present ( ) } so that tests can suppress it see { @ link collection add tester # get add null supported method ( ) } for details

public static method get add supported null present method ( ) { return helpers get method ( list add tester class , " test add supported null present " ) ; }


delegates to the { @ link log # is warn enabled } method of the underlying { @ link log } instance

public boolean is warn enabled ( ) { return logger is warn enabled ( ) ; }


sets the specified value on the stack , without disturbing it

public void set top ( int index , value value ) { values [ current size - index - 1 ] = value ; }


tests that metasave overwrites the output file ( not append )

public void test meta save overwrite ( ) throws exception { / / meta save twice nn rpc meta save ( " meta save overwrite out txt " ) ; nn rpc meta save ( " meta save overwrite out txt " ) ; / / read output file file input stream fis = null ; input stream reader isr = null ; buffered reader rdr = null ; try { fis = new file input stream ( get log file ( " meta save overwrite out txt " ) ) ; isr = new input stream reader ( fis ) ; rdr = new buffered reader ( isr ) ; / / validate that file was overwritten ( not appended ) by checking for / / presence of only one " live datanodes " line boolean found live datanodes line = false ; string line = rdr read line ( ) ; while ( line ! = null ) { if ( line starts with ( " live datanodes " ) ) { if ( found live datanodes line ) { fail ( " multiple live datanodes lines , output file not overwritten " ) ; } found live datanodes line = true ; } line = rdr read line ( ) ; } } finally { i o utils cleanup ( null , rdr , isr , fis ) ; } }


tests that default license behavior is unaffected

public void licenses default ( ) throws exception { scratch file ( " test / build " , " config setting ( " , " name = ' match ' , " , " values = { " , " ' copt ' : ' - dfoo ' , " , " } ) " ) ; use configuration ( " - - copt " , " - dfoo " ) ; assert that ( get licenses ( " / / test : match " ) ) contains exactly ( license type none ) ; }


get the parameters to be selected ( filtered )

public map < string , string > get parameters ( predicate < string > name to select ) { map < string , string > selected parameters = new linked hash map < > ( ) ; for ( map entry < string , string > entry : get parameters ( ) entry set ( ) ) { string name = entry get key ( ) ; if ( name to select test ( name ) ) { selected parameters put ( name , entry get value ( ) ) ; } } return collections unmodifiable map ( selected parameters ) ; }


sets the maximum parallelism of this operator the maximum parallelism specifies the upper bound for dynamic scaling it also defines the number of key groups used for partitioned state

public single output stream operator < t > set max parallelism ( int max parallelism ) { operator validation utils validate max parallelism ( max parallelism , can be parallel ( ) ) ; transformation set max parallelism ( max parallelism ) ; return this ; }


test that a parent of a cached but invalidated error doesn ' t successfully build first build the error then invalidate the error via a dependency ( so it will not actually change ) and build two new parents parent a will request error and abort since error isn ' t done yet error is then revalidated , and a is restarted if a does not throw upon encountering the error , and instead sets its value , then we throw in parent b , which waits for error to be done before requesting it then there will be the impossible situation of a node that was built during this evaluation depending on a node in error

public void shut down build on cached error done ( ) throws exception { / / error key will be invalidated due to its dependence on invalidated key , but later revalidated / / since invalidated key re - evaluates to the same value on a subsequent build sky key error key = graph tester to sky key ( " error " ) ; sky key invalidated key = graph tester non hermetic key ( " invalidated - leaf " ) ; tester set ( invalidated key , new string value ( " invalidated - leaf - value " ) ) ; tester get or create ( error key ) add dependency ( invalidated key ) set has error ( true ) ; / / names are alphabetized in reverse deps of error key sky key fast to request slow to set value key = graph tester to sky key ( " a - slow - set - value - parent " ) ; sky key failing key = graph tester to sky key ( " b - fast - fail - parent " ) ; tester get or create ( fast to request slow to set value key ) add dependency ( error key ) set computed value ( concatenate ) ; tester get or create ( failing key ) add dependency ( error key ) set computed value ( concatenate ) ; / / we only want to force a particular order of operations at some points during evaluation atomic boolean synchronize threads = new atomic boolean ( false ) ; / / we don ' t expect slow - set - value to actually be built , but if it is , we wait for it count down latch slow built = new count down latch ( 1 ) ; inject graph listener for testing ( ( key , type , order , context ) - > { if ( ! synchronize threads get ( ) ) { return ; } if ( type = = event type get dirty state & & key equals ( failing key ) ) { / / wait for the build to abort or for the other node to incorrectly build try { assert that ( slow built await ( test utils wait timeout seconds , time unit seconds ) ) is true ( ) ; } catch ( interrupted exception e ) { / / this is ok , because it indicates the build is shutting down thread current thread ( ) interrupt ( ) ; } } else if ( type = = event type set value & & key equals ( fast to request slow to set value key ) & & order = = order after ) { / / this indicates a problem - - this parent shouldn ' t be built since it depends on / / an error slow built count down ( ) ; / / before this node actually sets its value ( and then throws an exception ) we wait / / for the other node to throw an exception try { thread sleep ( test utils wait timeout milliseconds ) ; throw new illegal state exception ( " uninterrupted in " + key ) ; } catch ( interrupted exception e ) { thread current thread ( ) interrupt ( ) ; } } } , / * deterministic = * / true ) ; / / initialize graph tester eval ( / * keep going = * / true , error key ) ; tester get or create ( invalidated key , / * mark as modified = * / true ) ; tester invalidate ( ) ; synchronize threads set ( true ) ; tester eval ( / * keep going = * / false , fast to request slow to set value key , failing key ) ; }


method that checks if the lifecycle state of the cluster service is stopped or closed this enhances the readability of the code

private boolean is cluster service stopped or closed ( ) { final state state = cluster service lifecycle state ( ) ; return state = = state stopped | | state = = state closed ; }


removes manifest file , global metadata and all index metadata

public void delete all ( ) throws i o exception { / / to ensure that the metadata is never reimported by load full state b w c in case where the deletions here fail mid - way through , / / we first write an empty manifest file so that the indices become unreferenced , then clean up the indices , and only then delete / / the manifest file unreference all ( ) ; for ( string index folder name : node env available index folders ( ) ) { / / delete meta state directories of indices metadata state format delete meta state ( node env resolve index folder ( index folder name ) ) ; } manifest format cleanup old files ( long max value , node env node data paths ( ) ) ; / / finally delete manifest }


checks whether all of the data buffers allocated by this factory have also been released if not , then an { @ link assertion error } is thrown typically used from a j unit after method

public void check for leaks ( ) { this track created set ( false ) ; instant start = instant now ( ) ; while ( true ) { if ( this created stream ( ) none match ( leak aware data buffer : : is allocated ) ) { return ; } if ( instant now ( ) is before ( start plus ( duration of seconds ( 5 ) ) ) ) { try { thread sleep ( 50 ) ; } catch ( interrupted exception ex ) { / / ignore } continue ; } list < assertion error > errors = this created stream ( ) filter ( leak aware data buffer : : is allocated ) map ( leak aware data buffer : : leak error ) collect ( collectors to list ( ) ) ; errors for each ( it - > logger error ( " leaked error : " , it ) ) ; throw new assertion error ( errors size ( ) + " buffer leaks detected ( see logs above ) " ) ; } }


sends a simple patch request to the given path you only specify the $ path part of http : $ host : $ host $ path

public void send patch request ( string path , duration timeout ) throws timeout exception , interrupted exception { if ( ! path starts with ( " / " ) ) { path = " / " + path ; } http request get request = new default full http request ( http version http 1 1 , http method patch , path ) ; get request headers ( ) set ( http headers names host , host ) ; get request headers ( ) set ( http headers names connection , http headers values close ) ; send request ( get request , timeout ) ; }


creates a new factory with the specified policy

public static cycle detecting lock factory new instance ( policy policy ) { return new cycle detecting lock factory ( policy ) ; }


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


appends { @ code values } , in order , to the end of the values the built { @ link immutable int array } will contain

public builder add all ( collection < integer > values ) { ensure room for ( values size ( ) ) ; for ( integer value : values ) { array [ count + + ] = value ; } return this ; }


execute the runnable in the main thread of the underlying rpc endpoint

protected void run async ( runnable runnable ) { component main thread executor execute ( runnable ) ; }


public void set floor under ( floor floor ) { block overlay = this overlay ; set floor ( floor ) ; set overlay ( overlay ) ; }


asynchronously deletes license from the cluster

public cancellable delete license async ( delete license request request , request options options , action listener < acknowledged response > listener ) { return rest high level client perform request async and parse entity ( request , license request converters : : delete license , options , acknowledged response : : from x content , listener , empty set ( ) ) ; }


creates { @ link realm factory factories } for each internal realm type this excludes the { @ link reserved realm } , as it cannot be created dynamically

public static map < string , realm factory > get factories ( thread pool thread pool , resource watcher service resource watcher service , s s l service ssl service , native users store native users store , native role mapping store native role mapping store , security index manager security index ) { return map of ( / / file realm file realm settings type , config - > new file realm ( config , resource watcher service , thread pool ) , / / native realm native realm settings type , config - > { final native realm native realm = new native realm ( config , native users store , thread pool ) ; security index add index state listener ( native realm : : on security index state change ) ; return native realm ; } , / / active directory realm ldap realm settings ad type , config - > new ldap realm ( config , ssl service , resource watcher service , native role mapping store , thread pool ) , / / ldap realm ldap realm settings ldap type , config - > new ldap realm ( config , ssl service , resource watcher service , native role mapping store , thread pool ) , / / pki realm pki realm settings type , config - > new pki realm ( config , resource watcher service , native role mapping store ) , / / saml realm saml realm settings type , config - > saml realm create ( config , ssl service , resource watcher service , native role mapping store ) , / / kerberos realm kerberos realm settings type , config - > new kerberos realm ( config , native role mapping store , thread pool ) , / / open i d connect realm open id connect realm settings type , config - > new open id connect realm ( config , ssl service , native role mapping store , resource watcher service ) ) ; }


record statistics and perform rule checking for the given resource with provided classification

entry entry with type ( string name , int resource type , entry type traffic type , int batch count , object [ ] args ) throws block exception ;


called before each analysis request to ensure that the current options ( which may have user - defined input ) will work with the current demangler

protected boolean validate options ( demangler options options , message log log ) { / / override to validate custom options for a particular demangler return true ; }


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


deselects all selected items in the receiver if cell selection is enabled , all cells are deselected

public void deselect all ( ) { check widget ( ) ; selected cells clear ( ) ; update selection cache ( ) ; redraw ( ) ; }


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


get the selected row numbers in the model

int [ ] get selected rows ( ) { return table get selected rows ( ) ; }


returns an unmodifiable map describing keys that appear in both maps , but with different values

map < k , value difference < v > > entries differing ( ) ;


validates the implementation of input stream mark and reset for version 1 of the block blob input stream

public void test 0303 mark and reset v 1 ( ) throws exception { assume huge file exists ( ) ; try ( f s data input stream input stream = fs open ( test file path ) ) { input stream mark ( kilobyte - 1 ) ; byte [ ] buffer = new byte [ kilobyte ] ; int bytes read = input stream read ( buffer ) ; assert equals ( buffer length , bytes read ) ; input stream reset ( ) ; assert equals ( " rest - > pos 0 " , 0 , input stream get pos ( ) ) ; input stream mark ( 8 * kilobyte - 1 ) ; buffer = new byte [ 8 * kilobyte ] ; bytes read = input stream read ( buffer ) ; assert equals ( buffer length , bytes read ) ; intercept ( i o exception class , " resetting to invalid mark " , new callable < f s data input stream > ( ) { @ override public f s data input stream call ( ) throws exception { input stream reset ( ) ; return input stream ; } } ) ; } }


creates and configures a { @ link deserialization schema } using the given properties

deserialization schema < t > create deserialization schema ( map < string , string > properties ) ;


returns a command for this tool to fix { @ code recipient } by adding all { @ code missing } dependencies for this target

string get fix command ( iterable < string > missing , string recipient ) ;


void incr expired heartbeats ( ) { expired heartbeats + + ; }


public string get receipt id ( ) { return get first ( receipt id ) ; }


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


test that when a function throws an exception this is propagated through on error

public void function throws error ( ) { test flowable f = new test flowable ( " one " ) ; flowable < string > w = flowable unsafe create ( f ) ; final atomic reference < throwable > captured exception = new atomic reference < > ( ) ; flowable < string > flowable = w on error return ( new function < throwable , string > ( ) { @ override public string apply ( throwable e ) { captured exception set ( e ) ; throw new runtime exception ( " exception from function " ) ; } } ) ; subscriber < string > subscriber = test helper mock subscriber ( ) ; flowable subscribe ( subscriber ) ; try { f t join ( ) ; } catch ( interrupted exception e ) { fail ( e get message ( ) ) ; } / / we should get the " one " value before the error verify ( subscriber , times ( 1 ) ) on next ( " one " ) ; / / we should have received an on error call on the observer since the resume function threw an exception verify ( subscriber , times ( 1 ) ) on error ( any ( throwable class ) ) ; verify ( subscriber , times ( 0 ) ) on complete ( ) ; assert not null ( captured exception get ( ) ) ; }


sets the coordinator for the two views within this code comparison panel it coordinates their scrolling and location synchronization

public void set field panel coordinator ( t field panel coordinator ) { if ( this field panel coordinator ! = null ) { this field panel coordinator dispose ( ) ; } this field panel coordinator = field panel coordinator ; }


create snapshot for a dir using a given snapshot name

public static path create snapshot ( distributed file system hdfs , path snapshot root , string snapshot name ) throws exception { log info ( " create snapshot " + snapshot name + " for " + snapshot root ) ; assert true ( hdfs exists ( snapshot root ) ) ; hdfs allow snapshot ( snapshot root ) ; hdfs create snapshot ( snapshot root , snapshot name ) ; / / set quota to a large value for testing counts hdfs set quota ( snapshot root , long max value - 1 , long max value - 1 ) ; return snapshot test helper get snapshot root ( snapshot root , snapshot name ) ; }


dynamically create a new ssl context based on the current state of the configuration because the { @ link # get key config ( ) key config } and { @ link # get trust config ( ) trust config } may change based on the contents of their referenced files ( see { @ link # get dependent files ( ) } , consecutive calls to this method may return ssl - contexts with different configurations

public s s l context create ssl context ( ) { final x 5 0 9 extended key manager key manager = key config create key manager ( ) ; final x 5 0 9 extended trust manager trust manager = trust config create trust manager ( ) ; try { s s l context ssl context = s s l context get instance ( context protocol ( ) ) ; ssl context init ( new x 5 0 9 extended key manager [ ] { key manager } , new x 5 0 9 extended trust manager [ ] { trust manager } , null ) ; return ssl context ; } catch ( general security exception e ) { throw new ssl config exception ( " cannot create ssl context " , e ) ; } }


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


in most cases it will only be retrieved once ( see linked methods )

public byte [ ] get ( ) { return bytes ; }


public static void axpy ( double a , double [ ] x , double [ ] y ) { preconditions check argument ( x length = = y length , " array dimension mismatched " ) ; f2j blas daxpy ( x length , a , x , 1 , y , 1 ) ; }


method that adds delimiter information ( based on the state to the { @ link string } representation of the input argument the boolean argument is available to give the caller a single - line way of calling the method in a conditional sense ( i e , eliminates the need for a conditional block wrapping the call )

public string out ( boolean output , string val ) { if ( output ) { if ( first ) { first = false ; return delim start + val ; } return delim + val ; } return " " ; }


post - process the supplied { @ link annotation attributes } , preserving nested annotations as { @ code annotation } instances specifically , this method enforces attribute alias semantics for annotation attributes that are annotated with { @ link alias for @ alias for } and replaces default value placeholders with their original default values

public static void post process annotation attributes ( @ nullable object annotated element , @ nullable annotation attributes attributes , boolean class values as string ) { if ( attributes = = null ) { return ; } if ( ! attributes validated ) { class < ? extends annotation > annotation type = attributes annotation type ( ) ; if ( annotation type = = null ) { return ; } annotation type mapping mapping = annotation type mappings for annotation type ( annotation type ) get ( 0 ) ; for ( int i = 0 ; i < mapping get mirror sets ( ) size ( ) ; i + + ) { mirror set mirror set = mapping get mirror sets ( ) get ( i ) ; int resolved = mirror set resolve ( attributes display name , attributes , annotation utils : : get attribute value for mirror resolution ) ; if ( resolved ! = - 1 ) { method attribute = mapping get attributes ( ) get ( resolved ) ; object value = attributes get ( attribute get name ( ) ) ; for ( int j = 0 ; j < mirror set size ( ) ; j + + ) { method mirror = mirror set get ( j ) ; if ( mirror ! = attribute ) { attributes put ( mirror get name ( ) , adapt value ( annotated element , value , class values as string ) ) ; } } } } } for ( map entry < string , object > attribute entry : attributes entry set ( ) ) { string attribute name = attribute entry get key ( ) ; object value = attribute entry get value ( ) ; if ( value instanceof default value holder ) { value = ( ( default value holder ) value ) default value ; attributes put ( attribute name , adapt value ( annotated element , value , class values as string ) ) ; } } }


gets a worker may block indefinitely if too many high - priority workers are in use and the requested worker is not high priority

public worker borrow object ( worker key key ) throws i o exception , interrupted exception { worker result ; try { result = get pool ( key ) borrow object ( key ) ; } catch ( throwable t ) { throwables propagate if possible ( t , i o exception class , interrupted exception class ) ; throw new runtime exception ( " unexpected " , t ) ; } if ( high priority worker mnemonics contains ( key get mnemonic ( ) ) ) { high priority workers in use increment and get ( ) ; } else { try { wait for high priority workers to finish ( ) ; } catch ( interrupted exception e ) { return object ( key , result ) ; throw e ; } } return result ; }


specify a custom prefix to use for this view ' s json output default is none

public void set json prefix ( string json prefix ) { this json prefix = json prefix ; }


test that the restore can be stopped via the provided closeable registry

public void test can be canceled via registry ( ) throws exception { closeable registry closeable registry = new closeable registry ( ) ; one shot latch wait for block = new one shot latch ( ) ; one shot latch unblock = new one shot latch ( ) ; operator state handle blocking restore handle = mock ( operator state handle class ) ; when ( blocking restore handle open input stream ( ) ) then return ( new blocking f s data input stream ( wait for block , unblock ) ) ; list < state object collection < operator state handle > > sorted restore options = collections singleton list ( new state object collection < > ( collections singleton list ( blocking restore handle ) ) ) ; backend restorer procedure < operator state backend , operator state handle > restorer procedure = new backend restorer procedure < > ( backend supplier , closeable registry , " test op state backend " ) ; atomic reference < exception > exception reference = new atomic reference < > ( null ) ; thread restore thread = new thread ( ( ) - > { try { restorer procedure create and restore ( sorted restore options ) ; } catch ( exception e ) { exception reference set ( e ) ; } } ) ; restore thread start ( ) ; wait for block await ( ) ; closeable registry close ( ) ; unblock trigger ( ) ; restore thread join ( ) ; exception exception = exception reference get ( ) ; assert assert true ( exception instanceof flink exception ) ; }


public cancellable get trained models async ( get trained models request request , request options options , action listener < get trained models response > listener ) { return rest high level client perform request async and parse entity ( request , m l request converters : : get trained models , options , get trained models response : : from x content , listener , collections empty set ( ) ) ; }


processes each model ' s property mapped to date type and adds related vendor extensions

public void process date type property ( codegen model model , codegen property property , string description , ktorm schema ktorm schema ) { map < string , object > column definition = new hash map < string , object > ( ) ; string base name = property get base name ( ) ; string col name = to column name ( base name ) ; string data type = property get data type ( ) ; string data format = property get data format ( ) ; string actual type = to column type ( data type , data format ) ; ktorm schema put ( " column definition " , column definition ) ; column definition put ( " col name " , col name ) ; column definition put ( " col type " , actual type ) ; column definition put ( " col kotlin type " , data type ) ; process type args ( data type , data format , null , null , column definition ) ; process null and default ( model , property , description , column definition ) ; }


create a pre - configured token filter that may vary based on the elasticsearch version

public static pre configured token filter elasticsearch version ( string name , boolean use filter for multiterm queries , boolean use filter for parsing synonyms , bi function < token stream , version , token stream > create ) { return new pre configured token filter ( name , use filter for multiterm queries , use filter for parsing synonyms , caching strategy elasticsearch , create ) ; }


test the property ' sc a e t h flow points '

public void sc a e t h flow points test ( ) { / / todo : test sc a e t h flow points }


adds constraints describing the execution environment

public builder add exec constraints ( iterable < constraint value info > constraints ) { this exec constraints add constraints ( constraints ) ; return this ; }


public static byte [ ] read sasl message ( input stream in ) throws i o exception { data transfer encryptor message proto proto = data transfer encryptor message proto parse from ( vint prefixed ( in ) ) ; if ( proto get status ( ) = = data transfer encryptor status error unknown key ) { throw new invalid encryption key exception ( proto get message ( ) ) ; } else if ( proto get status ( ) = = data transfer encryptor status error ) { throw new i o exception ( proto get message ( ) ) ; } else { return proto get payload ( ) to byte array ( ) ; } }


handles an incoming put request from a blob client

private void put ( input stream input stream , output stream output stream , byte [ ] buf ) throws i o exception { file incoming file = null ; try { / / read header contents : job id , ha mode / permanent or transient blob final int mode = input stream read ( ) ; if ( mode < 0 ) { throw new e o f exception ( " premature end of put request " ) ; } final job i d job id ; if ( mode = = job unrelated content ) { job id = null ; } else if ( mode = = job related content ) { byte [ ] jid bytes = new byte [ job i d size ] ; read fully ( input stream , jid bytes , 0 , job i d size , " job i d " ) ; job id = job i d from byte array ( jid bytes ) ; } else { throw new i o exception ( " unknown type of blob addressing " ) ; } final blob key blob type blob type ; { final int read = input stream read ( ) ; if ( read < 0 ) { throw new e o f exception ( " read an incomplete blob type " ) ; } else if ( read = = transient blob ordinal ( ) ) { blob type = transient blob ; } else if ( read = = permanent blob ordinal ( ) ) { blob type = permanent blob ; check argument ( job id ! = null , " invalid blob addressing for permanent b l o bs " ) ; } else { throw new i o exception ( " invalid data received for the blob type : " + read ) ; } } if ( log is debug enabled ( ) ) { log debug ( " received put request for blob of job { } with from { } " , job id , client socket get inet address ( ) ) ; } incoming file = blob server create temporary filename ( ) ; byte [ ] digest = read file fully ( input stream , incoming file , buf ) ; blob key blob key = blob server move temp file to store ( incoming file , job id , digest , blob type ) ; / / return computed key to client for validation output stream write ( return okay ) ; blob key write to output stream ( output stream ) ; } catch ( socket exception e ) { / / happens when the other side disconnects log debug ( " socket connection closed " , e ) ; } catch ( throwable t ) { log error ( " put operation failed " , t ) ; try { write error to stream ( output stream , t ) ; } catch ( i o exception e ) { / / since we are in an exception case , it means not much that we could not send the / / error / / ignore this } client socket close ( ) ; } finally { if ( incoming file ! = null ) { if ( ! incoming file delete ( ) & & incoming file exists ( ) ) { log warn ( " cannot delete blob server staging file " + incoming file get absolute path ( ) ) ; } } } }


public void anytype 1 test ( ) { / / todo : test anytype 1 }


return the { @ link content summary } of path f

public content summary get content summary ( path f ) throws access control exception , file not found exception , unsupported file system exception , i o exception { file status status = file context this get file status ( f ) ; if ( status is file ( ) ) { long length = status get len ( ) ; return new content summary builder ( ) length ( length ) file count ( 1 ) directory count ( 0 ) space consumed ( length ) build ( ) ; } long [ ] summary = { 0 , 0 , 1 } ; remote iterator < file status > status iterator = file context this list status ( f ) ; while ( status iterator has next ( ) ) { file status s = status iterator next ( ) ; long length = s get len ( ) ; content summary c = s is directory ( ) ? get content summary ( s get path ( ) ) : new content summary builder ( ) length ( length ) file count ( 1 ) directory count ( 0 ) space consumed ( length ) build ( ) ; summary [ 0 ] + = c get length ( ) ; summary [ 1 ] + = c get file count ( ) ; summary [ 2 ] + = c get directory count ( ) ; } return new content summary builder ( ) length ( summary [ 0 ] ) file count ( summary [ 1 ] ) directory count ( summary [ 2 ] ) space consumed ( summary [ 0 ] ) build ( ) ; }


adds a dependency from this module to { @ code key } when the injector is created , guice will report an error if { @ code key } cannot be injected note that this requirement may be satisfied by implicit binding , such as a public no - arguments constructor

protected void require binding ( key < ? > key ) { binder get provider ( key ) ; }


creates an instance of { @ link decimal data } for a zero value with the given precision and scale the precision will be checked if the precision overflows , null will be returned

public static @ nullable decimal data zero ( int precision , int scale ) { if ( precision < = max compact precision ) { return new decimal data ( precision , scale , 0 , null ) ; } else { return from big decimal ( big decimal zero , precision , scale ) ; } }


public list < timeline event > get events ( ) { return events ; }


returns true if and only if the underlying action is complete , i e , it is legal to call { @ link # get } the return value of a single object must not change over time instead , call { @ link action step or result # of } to return a final result ( or exception )


public void build ( ) { if ( sample status equals ( sample status sampled ) ) { source receiver receive ( error log ) ; } }


tests the reloading of a key config backed by pem files when there is an exception during reloading an exception is caused by truncating the key file that is being monitored

public void test reloading p e m key config exception ( ) throws exception { path temp dir = create temp dir ( ) ; path key path = temp dir resolve ( " testnode pem " ) ; path cert path = temp dir resolve ( " testnode crt " ) ; path client cert path = temp dir resolve ( " testclient crt " ) ; files copy ( get data path ( " / org / elasticsearch / xpack / security / transport / ssl / certs / simple / testnode pem " ) , key path ) ; files copy ( get data path ( " / org / elasticsearch / xpack / security / transport / ssl / certs / simple / testnode crt " ) , cert path ) ; files copy ( get data path ( " / org / elasticsearch / xpack / security / transport / ssl / certs / simple / testclient crt " ) , client cert path ) ; mock secure settings secure settings = new mock secure settings ( ) ; secure settings set string ( " xpack security transport ssl secure key passphrase " , " testnode " ) ; settings settings = settings builder ( ) put ( " xpack security transport ssl enabled " , true ) put ( " xpack security transport ssl key " , key path ) put ( " xpack security transport ssl certificate " , cert path ) put list ( " xpack security transport ssl certificate authorities " , cert path to string ( ) , client cert path to string ( ) ) put ( " path home " , create temp dir ( ) ) set secure settings ( secure settings ) build ( ) ; environment env = test environment new environment ( settings ) ; final s s l service ssl service = new s s l service ( env ) ; final s s l configuration config = ssl service get s s l configuration ( " xpack security transport ssl " ) ; final atomic reference < exception > exception ref = new atomic reference < > ( ) ; final count down latch latch = new count down latch ( 1 ) ; final consumer < s s l configuration > reload consumer = ssl configuration - > { try { ssl service reload s s l context ( ssl configuration ) ; } catch ( exception e ) { exception ref set ( e ) ; throw e ; } finally { latch count down ( ) ; } } ; new s s l configuration reloader ( env , reload consumer , resource watcher service , s s l service get s s l configurations ( settings ) values ( ) ) ; final s s l context context = ssl service ssl context holder ( config ) ssl context ( ) ; / / truncate the file try ( output stream ignore = files new output stream ( key path , standard open option truncate existing ) ) { } latch await ( ) ; assert not null ( exception ref get ( ) ) ; assert that ( exception ref get ( ) get message ( ) , contains string ( " error parsing private key " ) ) ; assert that ( ssl service ssl context holder ( config ) ssl context ( ) , same instance ( context ) ) ; }


returns the choices for the set identified by < code > key < code >

public object [ ] get choices ( object key ) { return f value map get ( key ) ; }


returns the index of the specified word in the list

public int index of ( string word ) { return list get ( word ) ; }


calls the invokable to trigger a checkpoint

public void trigger checkpoint barrier ( final long checkpoint i d , final long checkpoint timestamp , final checkpoint options checkpoint options , final boolean advance to end of event time ) { final abstract invokable invokable = this invokable ; final checkpoint meta data checkpoint meta data = new checkpoint meta data ( checkpoint i d , checkpoint timestamp ) ; if ( execution state = = execution state running & & invokable ! = null ) { try { invokable trigger checkpoint async ( checkpoint meta data , checkpoint options , advance to end of event time ) ; } catch ( rejected execution exception ex ) { / / this may happen if the mailbox is closed it means that the task is shutting / / down , so we just ignore it log debug ( " triggering checkpoint { } for { } ( { } ) was rejected by the mailbox " , checkpoint i d , task name with subtask , execution id ) ; } catch ( throwable t ) { if ( get execution state ( ) = = execution state running ) { fail externally ( new exception ( " error while triggering checkpoint " + checkpoint i d + " for " + task name with subtask , t ) ) ; } else { log debug ( " encountered error while triggering checkpoint { } for " + " { } ( { } ) while being not in state running " , checkpoint i d , task name with subtask , execution id , t ) ; } } } else { log debug ( " declining checkpoint request for non - running task { } ( { } ) " , task name with subtask , execution id ) ; / / send back a message that we did not do the checkpoint checkpoint responder decline checkpoint ( job id , execution id , checkpoint i d , new checkpoint exception ( " task name with subtask : " + task name with subtask , checkpoint failure reason checkpoint declined task not ready ) ) ; } }


public boolean is reg none ( ) { return ( register = = 0 ) ; }


checks whether this state is globally terminal a globally terminal job is complete and cannot fail any more and will not be restarted or recovered by another standby master node when a globally terminal state has been reached , all recovery data for the job is dropped from the high - availability services

public boolean is globally terminal state ( ) { return terminal state = = terminal state globally ; }


create a name for a lexical block , with " " separated numbers indicating nesting information of the lexical block

public static string get lexical block name ( d i e aggregate diea ) { return " lexical block " + get lexical block name worker ( diea get head fragment ( ) ) ; }


forwards the value from the source future to the target future

public static < t > void forward ( completable future < t > source , completable future < t > target ) { source when complete ( forward to ( target ) ) ; }


get the url to use for binding where bind hostname can be specified to override the hostname in the web app u r l without scheme port specified in the web app u r l without scheme will be used

public static string get web app bind u r l ( configuration conf , string host property , string web app u r l without scheme ) { / / if the bind - host setting exists then it overrides the hostname / / portion of the corresponding web app u r l without scheme string host = conf get trimmed ( host property ) ; if ( host ! = null & & ! host is empty ( ) ) { if ( web app u r l without scheme contains ( " : " ) ) { web app u r l without scheme = host + " : " + web app u r l without scheme split ( " : " ) [ 1 ] ; } else { throw new yarn runtime exception ( " web app u r l without scheme must include port specification but doesn ' t : " + web app u r l without scheme ) ; } } return web app u r l without scheme ; }


adds the add remove item to the list of items to be processed in the addremove phase this call is not allowed on running jobs , only pending jobs

public synchronized void add remove ( add remove list item < t > item , int max add remove count ) { if ( current state ! = not running ) { throw new illegal state exception ( " cannot add or remove once a job starts " ) ; } if ( reload data ) { return ; / / no need to process add remove , since a total reload is scheduled } if ( add remove list size ( ) > max add remove count ) { reload ( ) ; return ; } add remove list add ( item ) ; }


public int size ( ) { return on going recoveries size ( ) ; }


sets the element at the given index the given element must be immutable

public void set ( int n , annotations a ) { a throw if mutable ( ) ; set 0 ( n , a ) ; }


get the number of first instructions , i e , the number of instructions immediately after ( and including ) a function start

public int get num first instructions ( ) { return num first instructions ; }


called after the fielddata is loaded during the cache phase

default void on cache ( shard id shard id , string field name , accountable ram usage ) { }


sets the redis database number databases are only available for redis standalone and redis master slave

public void set database ( int database ) { assert util is true ( database > = 0 , " invalid database number : " + database ) ; this database = database ; }


takes an i o exception , filedirectory path , and method name and returns an i o exception with the input exception as the cause and also include the file , method details the new exception provides the stack trace of the place where the exception is thrown and some extra diagnostics information return instance of same exception if exception class has a public string constructor ; otherwise return an path i o exception interrupted i o exception and path i o exception are returned unwrapped

public static i o exception wrap exception ( final string path , final string method name , final i o exception exception ) { if ( exception instanceof interrupted i o exception | | exception instanceof path i o exception ) { return exception ; } else { string msg = string format ( " failed with % s while processing file / directory : [ % s ] in " + " method : [ % s ] " , exception get class ( ) get name ( ) , path , method name ) ; try { return wrap with message ( exception , msg ) ; } catch ( exception ex ) { / / for subclasses which have no ( string ) constructor throw i o exception / / with wrapped message return new path i o exception ( path , exception ) ; } } }


creates a { @ link join record state view } depends on { @ link join input side spec }

public static join record state view create ( runtime context ctx , string state name , join input side spec input side spec , internal type info < row data > record type , long retention time ) { state ttl config ttl config = create ttl config ( retention time ) ; if ( input side spec has unique key ( ) ) { if ( input side spec join key contains unique key ( ) ) { return new join key contains unique key ( ctx , state name , record type , ttl config ) ; } else { return new input side has unique key ( ctx , state name , record type , input side spec get unique key type ( ) , input side spec get unique key selector ( ) , ttl config ) ; } } else { return new input side has no unique key ( ctx , state name , record type , ttl config ) ; } }


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

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


get the output stream for block appender ' s consumption

public input stream get input stream ( ) { return in ; }


public block info get truncate block ( ) { return truncate block ; }


builds annotation processor arguments for data binding

public immutable list < string > build ( ) { return flags build ( ) ; }


get the value of the ' { @ code rows } ' attribute

protected string get rows ( ) { return this rows ; }


public sort by sort ( ) { return sort ; }


public prepared statement prepare statement ( string sql , int auto generated keys ) throws s q l exception { if ( throw exception ) { throw new s q l exception ( ) ; } return new stub prepared statement ( this ) ; }


public long get zxid ( ) { synchronized ( fzk ) { return fzk get zxid ( ) ; } }


returns the name of the writeable object


create a { @ code sql xml value } instance for the given xml data , as supported by the underlying jdbc driver

sql xml value new sql xml value ( string value ) ;


informs if the stubbing was used what does it mean ' used stubbing ' ? stubbing like < code > when ( mock foo ( ) ) then return ( true ) < code > is considered used when the method < code > mock foo ( ) < code > is actually invoked during the execution of code under test this method is used internally by mockito to report and detect unused stubbings unused stubbings are dead code and should be deleted to increase clarity of tests ( see { @ link org mockito quality mockito hint } to understand how this method is useful , see the description at { @ link mocking details # get stubbings ( ) }


public builder subprotocol ( string subprotocol ) { this subprotocol = subprotocol ; return this ; }


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


return { @ code true } if the cookie has the " http only " attribute

public boolean is http only ( ) { return this http only ; }


add multiple attributes to this material if the material already contains an attribute of the same type it is overwritten

public final void set ( final attribute attribute 1 , final attribute attribute 2 , final attribute attribute 3 , final attribute attribute 4 ) { set ( attribute 1 ) ; set ( attribute 2 ) ; set ( attribute 3 ) ; set ( attribute 4 ) ; }


public synchronized mutable stat new stat ( string name , string desc , string sample name , string value name , boolean extended ) { check metric name ( name ) ; mutable stat ret = new mutable stat ( name , desc , sample name , value name , extended ) ; metrics map put ( name , ret ) ; return ret ; }


public void add and override r r set ( resource request set request set ) throws yarn exception { if ( request set = = null ) { return ; } for ( resource request rr : request set get r rs ( ) ) { add and override r r ( rr ) ; } }


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


get the covariance between the two fields

public double get covariance ( string field x , string field y ) { if ( results = = null ) { return double na n ; } return results get covariance ( field x , field y ) ; }


test that a union can ' t contain another union that contains a typedef to it

public void test cyclic dependency problem 5 ( ) { union another union = create union ( " another union " ) ; type def type def = create type def ( union ) ; another union add ( type def ) ; try { union add ( another union ) ; assert fail ( " shouldn ' t be able to add another union , which contains a typedef of this union , to this union " ) ; } catch ( illegal argument exception e ) { / / should get an exception from adding the union to itself } try { union insert ( 0 , another union ) ; assert fail ( " shouldn ' t be able to insert another union , which contains a typedef of this union , to this union " ) ; } catch ( illegal argument exception e ) { / / should get an exception from inserting the union to itself } }


assert that a path exists - but make no assertions as to the type of that entry

public static void assert path exists ( file context file context , string message , path path ) throws i o exception { if ( ! file context util ( ) exists ( path ) ) { / / failure , report it throw new file not found exception ( message + " : not found " + path + " in " + path get parent ( ) ) ; } }


fill the given properties from the given encoded resource , potentially defining a specific encoding for the properties file

public static void fill properties ( properties props , encoded resource resource ) throws i o exception { fill properties ( props , resource , resource properties persister instance ) ; }


public date get ship date ( ) { return ship date ; }


for parameterized type , gson ignores the more - specific type and sticks to the declared type

public void test parameterized subclass fields ( ) { class with parameterized base fields target = new class with parameterized base fields ( new parameterized sub < string > ( " one " , " two " ) ) ; string json = gson to json ( target ) ; assert true ( json contains ( " \ " t \ " : \ " one \ " " ) ) ; assert false ( json contains ( " \ " s \ " " ) ) ; }


returns the { @ link http 2 connection decoder } to use

protected http 2 connection decoder decoder ( ) { return decoder ; }


public void test add and get latest checkpoint ( ) throws exception { shared state registry shared state registry = new shared state registry ( ) ; completed checkpoint store checkpoints = create completed checkpoints ( 4 ) ; / / empty state assert equals ( 0 , checkpoints get number of retained checkpoints ( ) ) ; assert equals ( 0 , checkpoints get all checkpoints ( ) size ( ) ) ; test completed checkpoint [ ] expected = new test completed checkpoint [ ] { create checkpoint ( 0 , shared state registry ) , create checkpoint ( 1 , shared state registry ) } ; / / add and get latest checkpoints add checkpoint ( expected [ 0 ] , new checkpoints cleaner ( ) , ( ) - > { } ) ; assert equals ( 1 , checkpoints get number of retained checkpoints ( ) ) ; verify checkpoint ( expected [ 0 ] , checkpoints get latest checkpoint ( false ) ) ; checkpoints add checkpoint ( expected [ 1 ] , new checkpoints cleaner ( ) , ( ) - > { } ) ; assert equals ( 2 , checkpoints get number of retained checkpoints ( ) ) ; verify checkpoint ( expected [ 1 ] , checkpoints get latest checkpoint ( false ) ) ; }


get the list of { @ link function bit pattern info } objects , one object per function examined

public list < function bit pattern info > get f info list ( ) { return f info list ; }


public static container id verify and get container id ( block html , string container id str ) { if ( container id str = = null | | container id str is empty ( ) ) { html h 1 ( ) ( " cannot get container logs without a container id " ) ( ) ; return null ; } container id container id = null ; try { container id = container id from string ( container id str ) ; } catch ( illegal argument exception e ) { html h 1 ( ) ( " cannot get container logs for invalid container id : " + container id str ) ( ) ; return null ; } return container id ; }


initialize the metrics for jmx with priority levels

public void init ( int num levels ) { log info ( " initializing rpc stats for { } priority levels " , num levels ) ; queue names for levels = new string [ num levels ] ; processing names for levels = new string [ num levels ] ; for ( int i = 0 ; i < num levels ; i + + ) { queue names for levels [ i ] = get queue name ( i + 1 ) ; processing names for levels [ i ] = get processing name ( i + 1 ) ; } rpc queue rates init ( queue names for levels ) ; rpc processing rates init ( processing names for levels ) ; }


returns the protoc version used for the build

public static string get protoc version ( ) { return common version info get protoc version ( ) ; }


public void set qid ( long id , string qid ) { map put ( id , qid ) ; }


sets the x and y - coordinates of ellipse center from a { @ link vector 2 }

public ellipse set position ( vector 2 position ) { this x = position x ; this y = position y ; return this ; }


gets the file currently selected in the gui

private ghidra file get user selected file in display ( ) { file selected file = directory model get selected file ( ) ; if ( selected file = = null ) { return null ; } return new ghidra file ( selected file get absolute path ( ) , file chooser model get separator ( ) ) ; }


public boolean remove ( final cache key key ) { preconditions check not null ( key ) ; final encoded image encoded image ; synchronized ( this ) { encoded image = m map remove ( key ) ; } if ( encoded image = = null ) { return false ; } try { return encoded image is valid ( ) ; } finally { encoded image close ( ) ; } }


marks this node dirty as specified by the provided { @ link dirty type } { @ code mark dirty ( dirty type dirty ) } may only be called on a node p for which { @ code p is done ( ) | | p is changed ( ) } ( the latter is permitted but has no effect ) similarly , { @ code mark dirty ( dirty type change ) } may only be called on a node p for which { @ code p is done ( ) | | ! p is changed ( ) } otherwise , this will throw { @ link illegal state exception } { @ code mark dirty ( dirty type force rebuild ) } may be called multiple times ; only the first has any effect

marked dirty result mark dirty ( dirty type dirty type ) throws interrupted exception ;


get the number of finished reducers for the job

public int get succeeded reduces ( ) { return succeeded reduces ; }


public boolean is simple consumer group ( ) { return is simple consumer group ; }


sets a cancellable on this emitter ; any previous { @ link disposable } or { @ link cancellable } will be disposedcancelled

void set cancellable ( @ nullable cancellable c ) ;


default void on shuffle mode changed ( event time event time , boolean shuffle mode enabled ) { }


loads a class from the classpath that implements the custom command line interface

private static custom command line load custom command line ( string class name , object params ) throws exception { class < ? extends custom command line > custom cli class = class for name ( class name ) as subclass ( custom command line class ) ; / / construct class types from the parameters class < ? > [ ] types = new class < ? > [ params length ] ; for ( int i = 0 ; i < params length ; i + + ) { check not null ( params [ i ] , " parameters for custom command - lines may not be null " ) ; types [ i ] = params [ i ] get class ( ) ; } constructor < ? extends custom command line > constructor = custom cli class get constructor ( types ) ; return constructor new instance ( params ) ; }


generate the cumulative distribution in [ 0 , 1 ] where each value will have the same frequency and interval size

public void generate uniform ( ) { float freq = 1f / values size ; for ( int i = 0 ; i < values size ; + + i ) { / / reset the interval to the normalized frequency values items [ i ] interval = freq ; values items [ i ] frequency = ( i + 1 ) * freq ; } }


public static j s o n array get j s o n array ( @ non null final string key , final j s o n array default value , @ non null final cache double utils cache double utils ) { return cache double utils get j s o n array ( key , default value ) ; } / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / bitmap cache / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /


match input against the compiled glob pattern

public boolean matches ( char sequence s ) { return compiled matcher ( s ) matches ( ) ; }


public static < v > fluent future < v > from ( fluent future < v > future ) { return check not null ( future ) ; }


this method returns { @ link application attempt history data } for specified { @ link application id }

application attempt history data get application attempt ( application attempt id app attempt id ) throws i o exception ;


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


converts a float value to a sortable int

public static int float to sortable int ( float value ) { int bits = float float to int bits ( value ) ; return bits ^ ( bits > > 31 ) & integer max value ; }


private void flatten paths ( open a p i open a p i ) { paths paths = open a p i get paths ( ) ; if ( paths = = null ) { return ; } for ( string pathname : paths key set ( ) ) { path item path = paths get ( pathname ) ; list < operation > operations = new array list < > ( path read operations ( ) ) ; / / include callback operation as well for ( operation operation : path read operations ( ) ) { map < string , callback > callbacks = operation get callbacks ( ) ; if ( callbacks ! = null ) { operations add all ( callbacks values ( ) stream ( ) flat map ( callback - > callback values ( ) stream ( ) ) flat map ( path item - > path item read operations ( ) stream ( ) ) collect ( collectors to list ( ) ) ) ; } } for ( operation operation : operations ) { flatten request body ( open a p i , pathname , operation ) ; flatten parameters ( open a p i , pathname , operation ) ; flatten responses ( open a p i , pathname , operation ) ; } } }


order by execution id ( needs to be followed by { @ link # asc ( ) } or { @ link # desc ( ) } )

historic activity instance query order by execution id ( ) ;


returns a location for the given file , line and column if { @ code column } is non - zero , { @ code line } too must be non - zero

public static location from file line column ( string file , int line , int column ) { preconditions check argument ( line ! = 0 | | column = = 0 , " non - zero column but no line number " ) ; return new location ( file , line , column ) ; }


creates an xml item this route creates an xml item

public void create xml item test ( ) throws api exception { xml item xml item = null ; api create xml item ( xml item ) ; / / todo : test validations }


a convenience method for { @ code extract bare method name ( get full method name ( ) ) }

public string get bare method name ( ) { return extract bare method name ( full method name ) ; }


call this in a { @ link test subtype } public method asserting that subtype relationship does not hold

final < x > x not subtype ( @ suppress warnings ( " unused " ) object sub ) { type return type = method get generic return type ( ) ; type param type = get only parameter type ( ) ; test subtype spec = method get annotation ( test subtype class ) ; assert with message ( " % s is subtype of % s " , param type , return type ) that ( type token of ( param type ) is subtype of ( return type ) ) is false ( ) ; assert with message ( " % s is supertype of % s " , return type , param type ) that ( type token of ( return type ) is supertype of ( param type ) ) is false ( ) ; if ( ! spec suppress get subtype ( ) ) { try { assert that ( get subtype ( return type , type token of ( param type ) get raw type ( ) ) ) is not equal to ( param type ) ; } catch ( illegal argument exception not subtype 1 ) { / / the raw class isn ' t even a subclass } } if ( ! spec suppress get supertype ( ) ) { try { assert that ( get supertype ( param type , type token of ( return type ) get raw type ( ) ) ) is not equal to ( return type ) ; } catch ( illegal argument exception not subtype 2 ) { / / the raw class isn ' t even a subclass } } return null ; }


get a local file name under a directory named in dirs prop with the given path if dirs prop contains multiple directories , then one is chosen based on path ' s hash code if the selected directory does not exist , an attempt is made to create it

public file get file ( string dirs prop , string path ) throws i o exception { string [ ] dirs = get trimmed strings ( dirs prop ) ; int hash code = path hash code ( ) ; for ( int i = 0 ; i < dirs length ; i + + ) { / / try each local dir int index = ( hash code + i & integer max value ) % dirs length ; file file = new file ( dirs [ index ] , path ) ; file dir = file get parent file ( ) ; if ( dir exists ( ) | | dir mkdirs ( ) ) { return file ; } } throw new i o exception ( " no valid local directories in property : " + dirs prop ) ; }


calls { @ link tree string # dedup ( map ) } recursively

private void dedup ( final map < string , char [ ] > table ) { node dedup ( table ) ; for ( child child : children values ( ) ) { child dedup ( table ) ; } }


builds a new connection to { @ code peer } with settings acked

private http 2 connection connect ( mock http 2 peer peer , push observer push observer , http 2 connection listener listener ) throws exception { http 2 connection connection = new http 2 connection builder ( true , task runner instance ) socket ( peer open socket ( ) ) push observer ( push observer ) listener ( listener ) build ( ) ; connection start ( / * send connection preface = * / false ) ; / / verify the peer received the ack in frame ack frame = peer take frame ( ) ; assert that ( ack frame type ) is equal to ( http 2 type settings ) ; assert that ( ack frame stream id ) is equal to ( 0 ) ; assert that ( ack frame ack ) is true ( ) ; return connection ; }


adds a dynamic constant reference to the constant pool of the class being build does nothing if the constant pool already contains a similar item this method is intended for { @ link attribute } sub classes , and is normally not needed by class generators or adapters

public int new constant dynamic ( final string name , final string descriptor , final handle bootstrap method handle , final object bootstrap method arguments ) { return symbol table add constant dynamic ( name , descriptor , bootstrap method handle , bootstrap method arguments ) index ; }


called when the provided field name matches the current field but the entire field has been marked as deprecated with no replacement

void used deprecated field ( string parser name , supplier < x content location > location , string used name ) ;


set the additional ( undeclared ) property with the specified name and value if the property does not already exist , create it otherwise replace it

public additional properties object put additional property ( string key , map value ) { if ( this additional properties = = null ) { this additional properties = new hash map < string , map > ( ) ; } this additional properties put ( key , value ) ; return this ; }


method called when the action is invoked

public void action performed ( action context context ) { listing action context program action context = ( listing action context ) context get context object ( ) ; plugin tool tool = plugin get tool ( ) ; program program = program action context get program ( ) ; program location loc = program action context get location ( ) ; data data = program get listing ( ) get data containing ( loc get address ( ) ) ; data type type = data get data type ( ) ; if ( type instanceof composite ) { composite comp = ( composite ) type ; int [ ] comp path = loc get component path ( ) ; for ( int i = 0 ; i < comp path length - 1 ; i + + ) { data type component sub comp = comp get component ( comp path [ i ] ) ; type = sub comp get data type ( ) ; if ( type instanceof composite ) comp = ( composite ) type ; else return ; } data instance = data get component ( comp path ) ; data type component sub comp = comp get component ( comp path [ comp path length - 1 ] ) ; dialog set data component ( program , sub comp , instance get field name ( ) ) ; tool show dialog ( dialog , tool get component provider ( plugin constants code browser ) ) ; } }


post fakeouterboolean test serialization of outer boolean types

public response entity < boolean > fake outer boolean serialize ( @ api param ( value = " input boolean as post body " ) @ valid @ request body ( required = false ) boolean body ) { return new response entity < > ( http status not implemented ) ; }


adds a new action to be added to the toolbar andor drop - down menu

void add action ( docking action if action ) { if ( ! swing utilities is event dispatch thread ( ) ) { throw new assert exception ( " actions must be added from swing thread " ) ; } if ( action get menu bar data ( ) ! = null ) { menu manager add action ( action ) ; } if ( action get tool bar data ( ) ! = null ) { tool bar manager add action ( action ) ; } update tool bar ( ) ; }


child class implements this method to realize { @ code array offset ( ) }

abstract int protected array offset ( ) ;


returns the top gutter ( black bar ) y in screen coordinates

public int get top gutter y ( ) { return screen y + screen height ; }


determines whether the exception is recoverable using exponential - backoff

protected static boolean is recoverable exception ( amazon service exception ex ) { if ( ex get error type ( ) = = null ) { return false ; } switch ( ex get error type ( ) ) { case client : return ex instanceof provisioned throughput exceeded exception ; case service : case unknown : return true ; default : return false ; } }


decodes the server side encryption key from base 6 4 into an aes key , then gets the md 5 of it , then encodes it in base 6 4 so it will match the version that aws returns to us

public static string convert key to md 5 ( file system fs ) { string base 6 4 key = fs get conf ( ) get trimmed ( server side encryption key ) ; byte [ ] key = base 6 4 decode base 6 4 ( base 6 4 key ) ; byte [ ] md 5 = digest utils md 5 ( key ) ; return base 6 4 encode base 6 4 string ( md 5 ) trim ( ) ; }


get the number of container for this spec

public int get num containers ( ) { return num containers ; }


sets a configuration property with the specified name and value to override this method properly , you must call the super class : public boolean set option ( channel option & lt ; t & gt ; option , t value ) { if ( super set option ( option , value ) ) { return true ; } if ( option equals ( additional option ) ) { return true ; } return false ; }

< t > boolean set option ( channel option < t > option , t value ) ;


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


wraps an abstract runnable to easier supply on failure and do run methods via lambdas this ensures that the uncaught exception handler in the executing threadpool does not get called

private static abstract runnable wrap watcher service ( runnable run , consumer < exception > exception consumer ) { return new abstract runnable ( ) { @ override public void on failure ( exception e ) { exception consumer accept ( e ) ; } @ override protected void do run ( ) throws exception { run run ( ) ; } } ; }


the set of xml attributevalue pairs for this style < code > repeated aapt pb style entry entry = 3 ; < code >

public builder add all entry ( java lang iterable < ? extends com android aapt resources style entry > values ) { copy on write ( ) ; instance add all entry ( values ) ; return this ; }


called by generate font to create a new { @ link bitmap font } instance this allows injecting a customized { @ link bitmap font } , eg for a rtl font

protected bitmap font new bitmap font ( bitmap font data data , array < texture region > page regions , boolean integer ) { return new bitmap font ( data , page regions , integer ) ; }


test for the case when the following submit application and administer queue a c ls are defined : root : ( none ) d : ( none ) d1 : ( none ) expected result : the user will have to none of the queues

public void test queue acl no access ( ) throws i o exception { update config with d and d 1 queues ( none acl , none acl , none acl ) ; check access ( false , false , false ) ; }


whether the ' circuit - breaker ' is open meaning that < code > execute ( ) < code > will immediately return the < code > get fallback ( ) < code > response and not attempt a hystrix command execution 4 columns are forced open | forced closed | circuit breaker open due to health | | | expected result t | t | t | | | open ( true ) t | t | f | | | open ( true ) t | f | t | | | open ( true ) t | f | f | | | open ( true ) f | t | t | | | closed ( false ) f | t | f | | | closed ( false ) f | f | t | | | open ( true ) f | f | f | | | closed ( false )

public boolean is circuit breaker open ( ) { return properties circuit breaker force open ( ) get ( ) | | ( ! properties circuit breaker force closed ( ) get ( ) & & circuit breaker is open ( ) ) ; }


registers the given command registered commands can be run by passing any of their names to run command

public static void register command ( command command ) { for ( string name : command get names ( ) ) { command prev = commands put ( name , command ) ; if ( prev ! = null ) { log warn ( " re - registering command { } ( primary name = { } ) " , name , command get primary name ( ) ) ; } } primary names add ( command get primary name ( ) ) ; }


return the milliseconds differ time span

public static long get millis ( final long millis , final long time span , @ time constants unit final int unit ) { return millis + time span 2 millis ( time span , unit ) ; }


public get order by id oper resp spec ( consumer < response spec builder > resp spec customizer ) { resp spec customizer accept ( resp spec ) ; return this ; }


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


returns whether the request should be validated without altering the configs

public boolean validate only ( ) { return this validate only ; }


public void set message ( string message ) { this message = message ; }


get the request handle to expose to { @ link # render merged output model } , i e to the view the default implementation wraps the original request for exposure of spring beans as request attributes ( if demanded )

protected http servlet request get request to expose ( http servlet request original request ) { if ( this expose context beans as attributes | | this exposed context bean names ! = null ) { web application context wac = get web application context ( ) ; assert state ( wac ! = null , " no web application context " ) ; return new context exposing http servlet request ( original request , wac , this exposed context bean names ) ; } return original request ; }


public string to human ( ) { return annotations to human ( ) ; }


post fakeouternumber test serialization of outer number types

default response entity < big decimal > fake outer number serialize ( @ api param ( value = " input number as post body " ) @ valid @ request body ( required = false ) big decimal body ) { return new response entity < > ( http status not implemented ) ; }


public void test enum class ( ) { / / todo : test enum class }


protected boolean combine ( object [ ] srcs , tuple writable dst ) { assert srcs length = = dst size ( ) ; return true ; }


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


premultiplies this matrix with the provided matrix and stores the result in this matrix for example : a mul left ( b ) results in a : = ba

public matrix 3 mul left ( matrix 3 m ) { float [ ] val = this val ; float v 0 0 = m val [ m00 ] * val [ m00 ] + m val [ m01 ] * val [ m10 ] + m val [ m02 ] * val [ m20 ] ; float v 0 1 = m val [ m00 ] * val [ m01 ] + m val [ m01 ] * val [ m11 ] + m val [ m02 ] * val [ m21 ] ; float v 0 2 = m val [ m00 ] * val [ m02 ] + m val [ m01 ] * val [ m12 ] + m val [ m02 ] * val [ m22 ] ; float v 1 0 = m val [ m10 ] * val [ m00 ] + m val [ m11 ] * val [ m10 ] + m val [ m12 ] * val [ m20 ] ; float v 1 1 = m val [ m10 ] * val [ m01 ] + m val [ m11 ] * val [ m11 ] + m val [ m12 ] * val [ m21 ] ; float v 1 2 = m val [ m10 ] * val [ m02 ] + m val [ m11 ] * val [ m12 ] + m val [ m12 ] * val [ m22 ] ; float v 2 0 = m val [ m20 ] * val [ m00 ] + m val [ m21 ] * val [ m10 ] + m val [ m22 ] * val [ m20 ] ; float v 2 1 = m val [ m20 ] * val [ m01 ] + m val [ m21 ] * val [ m11 ] + m val [ m22 ] * val [ m21 ] ; float v 2 2 = m val [ m20 ] * val [ m02 ] + m val [ m21 ] * val [ m12 ] + m val [ m22 ] * val [ m22 ] ; val [ m00 ] = v 0 0 ; val [ m10 ] = v 1 0 ; val [ m20 ] = v 2 0 ; val [ m01 ] = v 0 1 ; val [ m11 ] = v 1 1 ; val [ m21 ] = v 2 1 ; val [ m02 ] = v 0 2 ; val [ m12 ] = v 1 2 ; val [ m22 ] = v 2 2 ; return this ; }


set the maximum time allowed in milliseconds after the web socket connection is established and before the first sub - protocol message is received this handler is for web socket connections that use a sub - protocol therefore , we expect the client to send at least one sub - protocol message in the beginning , or else we assume the connection isn ' t doing well , e g proxy issue , slow network , and can be closed by default this is set to { @ code 60 , 000 } ( 1 minute )

public web socket transport registration set time to first message ( int time to first message ) { this time to first message = time to first message ; return this ; }


creates a nodes tasks request against one or more nodes pass { @ code null } or an empty array for all nodes

public static cancel tasks request cancel tasks request ( ) { return new cancel tasks request ( ) ; }


converts the given address range back from the source range back to the mapped range note : it is important that the specified mapped source range is restricted to the mapped source area of the specified mapped block

private address range get mapped range ( memory block mapped block , address range mapped source range ) { address start , end ; long source range length = mapped source range get length ( ) ; if ( source range length < = 0 ) { throw new assert exception ( " invalid mapped source range length " ) ; } memory block source info info = mapped block get source infos ( ) get ( 0 ) ; long start offset = mapped source range get min address ( ) subtract ( info get mapped range ( ) get ( ) get min address ( ) ) ; boolean is bit mapped = mapped block get type ( ) = = memory block type bit mapped ; try { if ( is bit mapped ) { start offset * = 8 ; start = mapped block get start ( ) add no wrap ( start offset ) ; long end offset = start offset + ( source range length * 8 ) - 1 ; / / since end may only partially consume a byte we must limit end address end = ( end offset < mapped block get size ( ) ) ? mapped block get start ( ) add no wrap ( end offset ) : mapped block get end ( ) ; } else { / / byte mapped byte mapping scheme byte mapping scheme = info get byte mapping scheme ( ) get ( ) ; start = byte mapping scheme get mapped address ( mapped block , start offset , false ) ; long end offset = start offset + source range length - 1 ; end = byte mapping scheme get mapped address ( mapped block , end offset , true ) ; if ( start = = null | | start compare to ( end ) > 0 ) { return null ; / / mapped source range corresponds to non - mapped / skipped bytes } } } catch ( address overflow exception e ) { throw new address out of bounds exception ( e get message ( ) ) ; } return new address range impl ( start , end ) ; }


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


callback hook for nested spring : argument tags to pass their value to the parent tag

void add argument ( @ nullable object argument ) throws jsp tag exception ;


public void set max concurrent searches ( int max concurrent searches ) { this max concurrent searches = max concurrent searches ; }


sets the internal seed of this generator based on the given { @ code long } value the given seed is passed twice through a hash function this way , if the user passes a small value we avoid the short irregular transient associated with states having a very small number of bits set

public void set seed ( final long seed ) { long seed 0 = murmur hash 3 ( seed = = 0 ? long min value : seed ) ; set state ( seed 0 , murmur hash 3 ( seed 0 ) ) ; }


used as ad hoc to check the time stamp of the last full cycle of { @ link # lazy persist file scrubber } daemon this is used by the junit tests to block until { @ link # lazy persist file scrubber t s } is updated

public long get lazy persist file scrubber t s ( ) { return lazy persist file scrubber = = null ? - 1 : lazy persist file scrubber t s get ( ) ; }


tests a bug in quorum cnx manager that causes a npe when a 3 4 6 observer connects to a 3 5 0 server see https : issues apache orgjirabrowse z o o k e e p e r - 1789

public void test cnx manager n p e ( ) throws exception { / / the connecting peer ( id = 2 ) is a 3 4 6 observer peers get ( 2l ) type = learner type observer ; quorum peer peer = new quorum peer ( peers , peer tmpdir [ 1 ] , peer tmpdir [ 1 ] , peer client port [ 1 ] , 3 , 1 , 1000 , 2 , 2 , 2 ) ; quorum cnx manager cnx manager = peer create cnxn manager ( ) ; quorum cnx manager listener listener = cnx manager listener ; if ( listener ! = null ) { listener start ( ) ; } else { log error ( " null listener when initializing cnx manager " ) ; } inet socket address address = peers get ( peer get id ( ) ) election addr get reachable or one ( ) ; log info ( " election port : { } " , address get port ( ) ) ; thread sleep ( 1000 ) ; socket channel sc = socket channel open ( ) ; sc socket ( ) connect ( address , 5000 ) ; / * * write id ( 3 4 6 protocol ) this previously caused a npe in * quorum cnx manager * / byte [ ] msg bytes = new byte [ 8 ] ; byte buffer msg buffer = byte buffer wrap ( msg bytes ) ; msg buffer put long ( 2l ) ; msg buffer position ( 0 ) ; sc write ( msg buffer ) ; msg buffer = byte buffer wrap ( new byte [ 8 ] ) ; / / write length of message msg buffer put int ( 4 ) ; / / write message msg buffer put int ( 5 ) ; msg buffer position ( 0 ) ; sc write ( msg buffer ) ; message m = cnx manager poll recv queue ( 1000 , time unit milliseconds ) ; assert not null ( m ) ; peer shutdown ( ) ; cnx manager halt ( ) ; assert false ( cnx manager listener is alive ( ) ) ; }


source line and column info < code > optional aapt pb source position source = 4 ; < code >

public builder set source ( com android aapt resources source position builder builder for value ) { copy on write ( ) ; instance set source ( builder for value ) ; return this ; }


set whether to track all invocations that go through this interceptor , or just invocations with trace logging enabled default is " false " : only invocations with trace logging enabled will be monitored specify " true " to let j a mon track all invocations , gathering statistics even when trace logging is disabled

public void set track all invocations ( boolean track all invocations ) { this track all invocations = track all invocations ; }


persists the entry in the cache to the underlay state

public void close ( ) throws exception { shared buffer flush cache ( ) ; }


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


returns a set of nodes that have at least one shard of the given index

public synchronized set < string > nodes include ( string index ) { if ( cluster service ( ) state ( ) routing table ( ) has index ( index ) ) { list < shard routing > all shards = cluster service ( ) state ( ) routing table ( ) all shards ( index ) ; discovery nodes discovery nodes = cluster service ( ) state ( ) get nodes ( ) ; set < string > nodes = new hash set < > ( ) ; for ( shard routing shard routing : all shards ) { if ( shard routing assigned to node ( ) ) { discovery node discovery node = discovery nodes get ( shard routing current node id ( ) ) ; nodes add ( discovery node get name ( ) ) ; } } return nodes ; } return collections empty set ( ) ; }


read a script from the provided { @ code line number reader } , using the supplied comment prefixes and statement separator , and build a { @ code string } containing the lines lines beginning with one of the comment prefixes are excluded from the results ; however , line comments anywhere else & mdash ; for example , within a statement & mdash ; will be included in the results

public static string read script ( line number reader line number reader , @ nullable string [ ] line comment prefixes , @ nullable string separator , @ nullable string block comment end delimiter ) throws i o exception { string current statement = line number reader read line ( ) ; string builder script builder = new string builder ( ) ; while ( current statement ! = null ) { if ( ( block comment end delimiter ! = null & & current statement contains ( block comment end delimiter ) ) | | ( line comment prefixes ! = null & & ! starts with any ( current statement , line comment prefixes , 0 ) ) ) { if ( script builder length ( ) > 0 ) { script builder append ( ' \ n ' ) ; } script builder append ( current statement ) ; } current statement = line number reader read line ( ) ; } append separator to script if necessary ( script builder , separator ) ; return script builder to string ( ) ; }


protected string get prefix ( ) { return prefix ; }


starts a new flow initializes the current state for all registers using any future flow state that has been set use this method if keeping separate flows from different flow from addresses is not important

public void flow start ( address address ) { flow start ( address no address , address ) ; }


register a listener that will be called when this model visibility 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 ignore require hash code view model on visibility changed ( on model visibility changed listener < ignore require hash code view model , ignore require hash code view > listener ) { on mutation ( ) ; this on model visibility changed listener epoxy generated model = listener ; return this ; }


call refresh on the indexes we ' ve written to after the request ends ?

public self refresh ( boolean refresh ) { request set refresh ( refresh ) ; return self ( ) ; }


valid given namespace string and parse it to a list of sub - strings that can be consumed by the parser according to the type of the namespace currently the size of return list should be either 1 or 2 extra slash is escaped during the normalization

private static list < string > normalize ( string namespace str ) throws invalid allocation tags query exception { list < string > result = new array list < > ( ) ; if ( namespace str = = null ) { return result ; } string [ ] ns values = namespace str split ( namespace delimiter ) ; for ( string str : ns values ) { if ( ! strings is null or empty ( str ) ) { result add ( str ) ; } } / / currently we only allow 1 or 2 values for a namespace string if ( result size ( ) = = 0 | | result size ( ) > 2 ) { throw new invalid allocation tags query exception ( " invalid namespace string : " + namespace str + " , the syntax is < namespace prefix > or " + " < namespace prefix > / < namespace value > " ) ; } return result ; }


void add type ( int type i d , string type ) throws i o exception { throw new unsupported operation exception ( " bookmarks are read - only and may not be added " ) ; }


normally only used in testing avoids thread leak when life cycle of this object doesn ' t follow that of the jvm

public void close ( ) throws i o exception { if ( closed compare and set ( false , true ) ) { timer cancel ( ) ; / / if there was a currently executing task wait for it , to / / avoid false positives on file handle leak try { timer thread join ( ) ; } catch ( interrupted exception e ) { thread current thread ( ) interrupt ( ) ; / / restore interrupted flag } try { i o utils close ( systems cache values ( ) ) ; } finally { stores cache clear ( ) ; } } }


gets an iterator indicating all the addresses that have a stack depth change value specified within a program ' s indicated address set

public static address iterator get stack depth changes ( program program , address set view address set ) { property map manager pmm = program get usr property manager ( ) ; int property map ipm = pmm get int property map ( stack depth change name ) ; if ( ipm = = null ) { return new empty address iterator ( ) ; } return ipm get property iterator ( address set ) ; }


writes an { @ code int } as specified by { @ link data output stream # write int ( int ) } , except using little - endian byte order

public void write int ( int v ) throws i o exception { out write ( 0x f f & v ) ; out write ( 0x f f & ( v > > 8 ) ) ; out write ( 0x f f & ( v > > 16 ) ) ; out write ( 0x f f & ( v > > 24 ) ) ; }


gets the number of 32 - bit words required to hold instances of all the elements of this list this is a sum of the widths ( categories ) of all the elements


private o auth registered service get registered service by client id ( final string client id ) { return o auth 2 0 utils get registered o auth service by client id ( get o auth configuration context ( ) get services manager ( ) , client id ) ; }


creates a new operator using a factory and makes sure that all special factory traits are properly handled

public static < out , op extends stream operator < out > > tuple 2 < op , optional < processing time service > > create operator ( stream operator factory < out > operator factory , stream task < out , ? > containing task , stream config configuration , output < stream record < out > > output , operator event dispatcher operator event dispatcher ) { mailbox executor mailbox executor = containing task get mailbox executor factory ( ) create executor ( configuration get chain index ( ) ) ; if ( operator factory instanceof yielding operator factory ) { ( ( yielding operator factory < ? > ) operator factory ) set mailbox executor ( mailbox executor ) ; } final supplier < processing time service > processing time service factory = ( ) - > containing task get processing time service factory ( ) create processing time service ( mailbox executor ) ; final processing time service processing time service ; if ( operator factory instanceof processing time service aware ) { processing time service = processing time service factory get ( ) ; ( ( processing time service aware ) operator factory ) set processing time service ( processing time service ) ; } else { processing time service = null ; } / / todo : what to do with processing time service aware ? op op = operator factory create stream operator ( new stream operator parameters < > ( containing task , configuration , output , processing time service ! = null ? ( ) - > processing time service : processing time service factory , operator event dispatcher ) ) ; return new tuple 2 < > ( op , optional of nullable ( processing time service ) ) ; }


set the value for a parameter the method used is based on the sql type of the parameter and we can handle complex types like arrays and l o bs

public static void set parameter value ( prepared statement ps , int param index , int sql type , @ nullable object in value ) throws s q l exception { set parameter value internal ( ps , param index , sql type , null , null , in value ) ; }


gatling does not need the models to have escaped words as it builds models dynamically instead of through an instance of the object

public string escape reserved word ( string name ) { return name ; }


kills the application with the application id as app id

private void kill application ( string application id ) throws yarn exception , i o exception { application id app id = application id from string ( application id ) ; application report app report = null ; try { app report = client get application report ( app id ) ; } catch ( application not found exception e ) { sysout println ( " application with id ' " + application id + " ' doesn ' t exist in rm " ) ; throw e ; } if ( apps is application final state ( app report get yarn application state ( ) ) ) { sysout println ( " application " + application id + " has already finished " ) ; } else { sysout println ( " killing application " + application id ) ; client kill application ( app id ) ; } }


delete storeorder { order id } : delete purchase order by id for valid response try integer i ds with value & lt ; 1000 anything above 1000 or nonintegers will generate api errors

default response entity < void > delete order ( string order id ) { return new response entity < > ( http status not implemented ) ; }


implementation can choose to provide different acl for different items this can be used as a basis for more fine - grained access control the default implementation returns { @ link # get root a c l ( ) }

public @ non null acl get a c l ( @ non null abstract item item ) { return get root a c l ( ) ; }


public void launch ( ghidra application layout layout , string [ ] args ) throws i o exception { application initialize application ( layout , new headless ghidra application configuration ( ) ) ; if ( args length = = 0 ) { usage ( args ) ; } list < file > ghidra dirs = new array list < > ( ) ; file output file = null ; file srczip = null ; file extra bin dir = null ; string main class arg = null ; boolean using gradle = false ; string property = system get property ( ghidra dir ) ; if ( property ! = null ) { ghidra dirs add ( new file ( property ) ) ; } for ( int i = 0 ; i < args length ; i + + ) { string arg = args [ i ] ; if ( arg equals ( " - output " ) ) { if ( i = = args length - 1 ) { usage ( args ) ; } output file = new file ( args [ + + i ] ) ; } else if ( arg equals ( " - srczip " ) ) { if ( i = = args length - 1 ) { usage ( args ) ; } srczip = new file ( args [ + + i ] ) ; } else if ( arg equals ( " - bin " ) ) { if ( i = = args length - 1 ) { usage ( args ) ; } extra bin dir = new file ( args [ + + i ] ) ; } else if ( arg equals ( " - main " ) ) { if ( i = = args length - 1 ) { usage ( args ) ; } main class arg = args [ + + i ] ; } else if ( arg equals ( " - gradle " ) ) { if ( i = = args length - 1 ) { usage ( args ) ; } using gradle = true ; parse libs file ( args [ + + i ] ) ; } else if ( arg starts with ( " - " ) ) { usage ( args ) ; } else { ghidra dirs add ( new file ( arg ) ) ; } } if ( ghidra dirs is empty ( ) ) { usage ( args ) ; } if ( output file = = null ) { output file = new file ( " ghidra jar " ) ; } system out println ( " ghidra dirs = " + ghidra dirs ) ; system out println ( " output file = " + output file ) ; if ( srczip ! = null ) { system out println ( " source zip file = " + srczip ) ; } if ( extra bin dir ! = null ) { system out println ( " extra bin dir = " + extra bin dir ) ; } try { ghidra jar builder builder = new ghidra jar builder ( ghidra dirs ) ; if ( main class arg ! = null ) { builder set main class ( main class arg ) ; } if ( using gradle ) { builder set gradle mode ( ) ; } builder add excluded file extension ( " pdf " ) ; / / builder add excluded file extension ( " htm " ) ; / / builder add excluded file extension ( " html " ) ; / / builder add all modules ( ) ; list < application module > module list = builder get included modules ( ) ; for ( application module module : module list ) { system out println ( " include " + module get name ( ) ) ; } module list = builder get excluded modules ( ) ; for ( application module module : module list ) { system out println ( " exclude " + module get name ( ) ) ; } builder build jar ( output file , extra bin dir , task monitor adapter dummy monitor ) ; if ( srczip ! = null ) { builder build src zip ( srczip , task monitor adapter dummy monitor ) ; } } catch ( exception e ) { system err println ( " exception build ghidra jar " ) ; e print stack trace ( ) ; } system out println ( " done " ) ; }


tear down the fuse - dfs process and mount

private static void teardown mount ( ) throws i o exception { exec wait ret ( " fusermount - u " + mount point ) ; try { assert equals ( 0 , fuse process wait for ( ) ) ; / / fuse dfs should exit cleanly } catch ( interrupted exception e ) { fail ( " interrupted while waiting for fuse dfs process to exit " ) ; } }


returns an event type that , if applied as a transition on this state , will result in an illegal state transition

public event type random invalid transition ( random rnd ) { while ( true ) { event type candidate = event type values ( ) [ rnd next int ( event type values ( ) length ) ] ; if ( transition ( candidate ) = = invalid transition ) { return candidate ; } } }


returns the size of the buffer used by the bio for non - application based writes

public int get bio non application buffer size ( ) { return bio non application buffer size ; }


adds the given directories to the quote include directories ( they are passed with { @ code " - iquote " } to the compiler ) ; these are also passed to dependent rules

public cc compilation helper add quote include dirs ( nested set < path fragment > quote include dirs ) { this quote include dirs add all ( quote include dirs to list ( ) ) ; return this ; }


get number of occupied map slots in the cluster

public int get occupied map slots ( ) { return occupied map slots ; }