public void test hs tasks block ( ) { task task = get task ( 0 ) ; map < task id , task > tasks = new hash map < task id , task > ( ) ; tasks put ( task get i d ( ) , task ) ; app context ctx = mock ( app context class ) ; app for test app = new app for test ( ctx ) ; job job = mock ( job class ) ; when ( job get tasks ( ) ) then return ( tasks ) ; app set job ( job ) ; hs tasks block for test block = new hs tasks block for test ( app ) ; block add parameter ( a m params task type , " r " ) ; print writer p writer = new print writer ( data ) ; block html = new block for test ( new html block for test ( ) , p writer , 0 , false ) ; block render ( html ) ; p writer flush ( ) ; / / should be printed information about task assert true ( data to string ( ) contains ( " task 0 0001 r 000000 " ) ) ; assert true ( data to string ( ) contains ( " succeeded " ) ) ; assert true ( data to string ( ) contains ( " 100001 " ) ) ; assert true ( data to string ( ) contains ( " 100011 " ) ) ; assert true ( data to string ( ) contains ( " " ) ) ; }


fetch devices greater than or equal to date

public collection < ? extends u 2 f device registration > fetch devices from ( final local date expiration date ) { val time = expiration date at start of day ( zone offset utc ) to instant ( ) to epoch milli ( ) ; return get records by keys ( dynamo db query builder builder ( ) operator ( comparison operator ge ) attribute value ( list of ( attribute value builder ( ) n ( string value of ( time ) ) build ( ) ) ) key ( column names created date get column name ( ) ) build ( ) ) ; }


same as byte to hex string ( bytes , 0 , bytes length )

public static string byte to hex string ( byte bytes [ ] ) { return byte to hex string ( bytes , 0 , bytes length ) ; }


set the exact list of strategies to use note : use of this method is mutually exclusive with use of all other setters in this class which customize a default , fixed set of strategies see class level doc for more details

public void strategies ( @ nullable list < content negotiation strategy > strategies ) { this factory set strategies ( strategies ) ; }


invoke api by sending http request with the given options

public < t > t invoke a p i ( string path , string method , list < pair > query params , list < pair > collection query params , object body , map < string , string > header params , map < string , string > cookie params , map < string , object > form params , string accept , string content type , string [ ] auth names , generic type < t > return type ) throws api exception { client response response = get a p i response ( path , method , query params , collection query params , body , header params , cookie params , form params , accept , content type , auth names ) ; status code = response get status info ( ) get status code ( ) ; response headers = response get headers ( ) ; if ( response get status info ( ) get status code ( ) = = client response status no content get status code ( ) ) { return null ; } else if ( response get status info ( ) get family ( ) = = family successful ) { if ( return type = = null ) return null ; else return response get entity ( return type ) ; } else { string message = " error " ; string resp body = null ; if ( response has entity ( ) ) { try { resp body = response get entity ( string class ) ; message = resp body ; } catch ( runtime exception e ) { / / e print stack trace ( ) ; } } throw new api exception ( response get status info ( ) get status code ( ) , message , response get headers ( ) , resp body ) ; } }


selects all elements from input collection which match the given predicate into an output collection a < code > null < code > predicate matches no elements

public static < e > collection < e > select ( collection < e > input collection , predicate < e > predicate ) { if ( input collection = = null | | predicate = = null ) return new array list < > ( ) ; array list < e > answer = new array list < > ( input collection size ( ) ) ; for ( e o : input collection ) { if ( predicate evaluate ( o ) ) { answer add ( o ) ; } } return answer ; }


test the dfs datanode failed volumes tolerated key configuration option , ie the dn shuts itself down when the number of failures experienced drops below the tolerated amount

public void test configure min valid volumes ( ) throws exception { assume not windows ( ) ; / / bring up two additional datanodes that need both of their volumes / / functioning in order to stay up conf set int ( d f s config keys dfs datanode failed volumes tolerated key , 0 ) ; conf set time duration ( d f s config keys dfs datanode disk check min gap key , 0 , time unit milliseconds ) ; cluster start data nodes ( conf , 2 , true , null , null ) ; cluster wait active ( ) ; final datanode manager dm = cluster get namesystem ( ) get block manager ( ) get datanode manager ( ) ; long orig capacity = d f s test util get live datanode capacity ( dm ) ; long dn capacity = d f s test util get datanode capacity ( dm , 0 ) ; / / fail a volume on the 2nd dn file dn 2 vol 1 = cluster get instance storage dir ( 1 , 0 ) ; data node test utils inject data dir failure ( dn 2 vol 1 ) ; / / should only get two replicas ( the first dn and the 3rd ) path file 1 = new path ( " / test 1 " ) ; d f s test util create file ( fs , file 1 , 1024 , ( short ) 3 , 1l ) ; d f s test util wait replication ( fs , file 1 , ( short ) 2 ) ; / / check that this single failure caused a dn to die d f s test util wait for datanode status ( dm , 2 , 1 , 0 , orig capacity - ( 1 * dn capacity ) , wait for heartbeats ) ; / / if we restore the volume we should still only be able to get / / two replicas since the dn is still considered dead data node test utils restore data dir from failure ( dn 2 vol 1 ) ; path file 2 = new path ( " / test 2 " ) ; d f s test util create file ( fs , file 2 , 1024 , ( short ) 3 , 1l ) ; d f s test util wait replication ( fs , file 2 , ( short ) 2 ) ; }


parse the supplied xml file data to a { @ link document }

public static @ non null document parse ( @ non null file file ) throws s a x exception , i o exception { if ( ! file exists ( ) | | ! file is file ( ) ) { throw new illegal argument exception ( string format ( " file % s does not exist or is not a ' normal ' file " , file get absolute path ( ) ) ) ; } try ( input stream file input stream = files new input stream ( file to path ( ) ) ) { return parse ( file input stream ) ; } catch ( invalid path exception e ) { throw new i o exception ( e ) ; } }


retrieve a { @ link script engine } from the given { @ link script engine manager } by name , delegating to { @ link script engine manager # get engine by name } but throwing a descriptive exception if not found or if initialization failed

public static script engine retrieve engine by name ( script engine manager script engine manager , string engine name ) { script engine engine = script engine manager get engine by name ( engine name ) ; if ( engine = = null ) { set < string > engine names = new linked hash set < > ( ) ; for ( script engine factory engine factory : script engine manager get engine factories ( ) ) { list < string > factory names = engine factory get names ( ) ; if ( factory names contains ( engine name ) ) { / / special case : get engine by name returned null but engine is present / / let ' s assume it failed to initialize ( which script engine manager silently swallows ) / / if it happens to initialize fine now , alright , but we really expect an exception try { engine = engine factory get script engine ( ) ; engine set bindings ( script engine manager get bindings ( ) , script context global scope ) ; } catch ( throwable ex ) { throw new illegal state exception ( " script engine with name ' " + engine name + " ' failed to initialize " , ex ) ; } } engine names add all ( factory names ) ; } throw new illegal argument exception ( " script engine with name ' " + engine name + " ' not found ; registered engine names : " + engine names ) ; } return engine ; }


public string get property class ( ) { return property class ; }


creates a { @ link extension file filter } in a varargs friendly way

public static extension file filter for extensions ( string description , string exts ) { extension file filter eff = new extension file filter ( exts , description ) ; return eff ; }


sets the < code > array item < code > property

public type holder example array item ( list < integer > array item ) { this array item = array item ; return this ; }


returns the comment url of this { @ link cookie }


setter for the final directory for dist cp ( where files copied will be moved , atomically )

public static void set commit directory ( job job , path commit directory ) { job get configuration ( ) set ( dist cp constants conf label target final path , commit directory to string ( ) ) ; }


public long get count ( ) { return m count ; }


tests that the initial job registration registers a timeout which will call { @ link job leader id actions # notify job timeout ( job i d , uuid ) } when executed

public void test initial job timeout ( ) throws exception { final job i d job id = new job i d ( ) ; testing high availability services high availability services = new testing high availability services ( ) ; settable leader retrieval service leader retrieval service = new settable leader retrieval service ( null , null ) ; high availability services set job master leader retriever ( job id , leader retrieval service ) ; scheduled executor scheduled executor = mock ( scheduled executor class ) ; time timeout = time milliseconds ( 5000l ) ; job leader id actions job leader id actions = mock ( job leader id actions class ) ; job leader id service job leader id service = new job leader id service ( high availability services , scheduled executor , timeout ) ; job leader id service start ( job leader id actions ) ; job leader id service add job ( job id ) ; assert true ( job leader id service contains job ( job id ) ) ; argument captor < runnable > runnable argument captor = argument captor for class ( runnable class ) ; verify ( scheduled executor ) schedule ( runnable argument captor capture ( ) , any long ( ) , any ( time unit class ) ) ; runnable timeout runnable = runnable argument captor get value ( ) ; timeout runnable run ( ) ; argument captor < uuid > timeout id argument captor = argument captor for class ( uuid class ) ; verify ( job leader id actions , times ( 1 ) ) notify job timeout ( eq ( job id ) , timeout id argument captor capture ( ) ) ; assert true ( job leader id service is valid timeout ( job id , timeout id argument captor get value ( ) ) ) ; }


the set of values defined for this entry , each corresponding to a different configurationvariant < code > repeated aapt pb config value config value = 4 ; < code >

private void set config value ( int index , com android aapt resources config value value ) { if ( value = = null ) { throw new null pointer exception ( ) ; } ensure config value is mutable ( ) ; config value set ( index , value ) ; }


match the provided in parameter values with registered parameters and parameters defined via meta - data processing

private map < string , ? > match in parameter values with call parameters ( object [ ] args ) { return this call meta data context match in parameter values with call parameters ( args ) ; }


reads bytes from input , parsing them into a frame returns false if and only if more data is needed to obtain a full frame this method must be called repeatedly until it returns true

boolean read bytes ( byte buffer input ) throws general security exception { preconditions check not null ( input ) ; if ( is complete ) { return true ; } copy ( buffer , input ) ; if ( ! buffer has remaining ( ) ) { flush ( ) ; } return is complete ; }


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

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


public final request builder set task id ( task id task id ) { request set task id ( task id ) ; return ( request builder ) this ; }


model tests for additional properties class

public void test additional properties class ( ) { / / todo : test additional properties class }


do io reads , writes , connection establishment , etc

void poll ( long timeout ) throws i o exception ;


convert string value to long value if parameter value is legal and it automatically defaults to 0 if parameter value is null or blank str

public static long to long ( string val ) { return to long ( val , 0l ) ; }


merge two collections of accumulators the second will be merged into the first

public static void merge into ( map < string , optional failure < accumulator < ? , ? > > > target , map < string , accumulator < ? , ? > > to merge ) { for ( map entry < string , accumulator < ? , ? > > other entry : to merge entry set ( ) ) { optional failure < accumulator < ? , ? > > own accumulator = target get ( other entry get key ( ) ) ; if ( own accumulator = = null ) { / / create initial counter ( copy ! ) target put ( other entry get key ( ) , wrap unchecked ( other entry get key ( ) , ( ) - > other entry get value ( ) clone ( ) ) ) ; } else if ( own accumulator is failure ( ) ) { continue ; } else { accumulator < ? , ? > accumulator = own accumulator get unchecked ( ) ; / / both should have the same type compare accumulator types ( other entry get key ( ) , accumulator get class ( ) , other entry get value ( ) get class ( ) ) ; / / merge target counter with other counter target put ( other entry get key ( ) , wrap unchecked ( other entry get key ( ) , ( ) - > merge single ( accumulator , other entry get value ( ) clone ( ) ) ) ) ; } } }


return the permissions used in application

public static list < string > get permissions ( ) { return get permissions ( utils get app ( ) get package name ( ) ) ; }


display a modal task dialog associated with this locking task this method will not return until the task has completed and the lock has been released

void wait for task completion ( ) { synchronized ( this ) { if ( dobj = = null ) { return ; } if ( task dialog = = null ) { task dialog = new my task dialog ( ) ; } else { try { / / dialog already displayed - wait for release lock to occur wait ( ) ; } catch ( interrupted exception e ) { / / ignore } return ; } } / / show dialog without synchronization my task dialog dialog = task dialog ; if ( dialog ! = null ) { system utilities run swing now ( ( ) - > dialog show ( 0 ) ) ; } }


pastes the clipboard content the result depends on which insertion mode is currently active : insert mode replaces the selection with the dnd clipboard clipboard contents or , if there is no selection , inserts at the current caret offset overwrite mode replaces contents at the current caret offset , unless pasting would overflow the content length , in which case does nothing

public void paste ( ) { if ( ! my clipboard has contents ( ) ) return ; handle selected pre modify ( ) ; long caret pos = get caret pos ( ) ; long total = my clipboard get contents ( content , caret pos , is inserting ) ; start position = caret pos ; end position = caret pos + total ; caret stick to start = false ; redraw text areas ( true ) ; restore state after modify ( ) ; }


creates an instance of a aggregating function ( either a system or user - defined function )

public static bridging sql agg function of ( data type factory data type factory , flink type factory type factory , sql kind kind , function identifier identifier , function definition definition , type inference type inference ) { check state ( definition get kind ( ) = = function kind aggregate | | definition get kind ( ) = = function kind table aggregate , " aggregating function kind expected " ) ; return new bridging sql agg function ( data type factory , type factory , kind , identifier , definition , type inference ) ; }


public metrics record builder add record ( metrics info info ) ;


public void clean and reopen derby ( ) throws exception { do derby clean ( ) ; final string jdbc url = " jdbc : derby : " + paths get ( env util get nacos home ( ) , derby base dir ) to string ( ) + " ; create = true " ; initialize ( jdbc url ) ; }


return the number of supported entity references

public int get supported reference count ( ) { return this entity reference to character map size ( ) ; }


public void test model api response ( ) { / / todo : test model api response }


allows subclasses to vote on the inclusion of a particular attribute mutator

protected abstract boolean include write attribute ( method method , string bean key ) ;


public string get group name ( ) { return groupname ; }


sets the original query score mode the default is { @ link query rescore mode # total }

public query rescorer builder set score mode ( query rescore mode score mode ) { this score mode = score mode ; return this ; }


public static < t > t [ ] new array ( class < t > type , int length ) { return ( t [ ] ) array new instance ( type , length ) ; }


request containers for resources before calling < code > allocate < code >

public void add container request ( t req ) { client add container request ( req ) ; }


gets the launch configuration with the given name

public static i launch configuration get launch config ( string name ) throws core exception { i launch manager launch manager = debug plugin get default ( ) get launch manager ( ) ; for ( i launch configuration lc : launch manager get launch configurations ( ) ) { if ( lc get name ( ) equals ( name ) ) { return lc ; } } return null ; }


returns the first principal from subject

public static string first principal ( subject subject ) { set < principal > principals = subject get principals ( ) ; synchronized ( principals ) { iterator < principal > iterator = principals iterator ( ) ; if ( iterator has next ( ) ) return iterator next ( ) get name ( ) ; else throw new kafka exception ( " principal could not be determined from subject , this may be a transient failure due to kerberos re - login " ) ; } }


projects a { @ link tuple } { @ link data set } to the previously selected fields


public void set count ( phase phase , step step , long count ) { lazy init step ( phase , step ) count set ( count ) ; }


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

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


begins a speculative take operation this returns the item that would be returned by # take ( ) , but does not change state

public item take index ( int take rotation ) { for ( int i = 0 ; i < items length ; i + + ) { int index = ( i + take rotation ) ; if ( index > = items length ) index - = items length ; if ( items [ index ] > 0 ) { return content item ( index ) ; } } return null ; }


static method get start finalizer ( class < ? > finalizer ) { try { return finalizer get method ( " start finalizer " , class class , reference queue class , phantom reference class ) ; } catch ( no such method exception e ) { throw new assertion error ( e ) ; } }


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

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


returns the logical xor of this long value and the given long value

public long value xor ( long value other ) { return other xor ( this ) ; }


tests sending a bunch of async requests works well ( e g no timeout exception from the leased pool ) see https : github comelasticelasticsearchissues 2 4 0 6 9

public void test many async requests ( ) throws exception { int iters = random int between ( 500 , 1000 ) ; final count down latch latch = new count down latch ( iters ) ; final list < exception > exceptions = new copy on write array list < > ( ) ; for ( int i = 0 ; i < iters ; i + + ) { request request = new request ( " put " , " / 200 " ) ; request set entity ( new n string entity ( " { } " , content type application json ) ) ; rest client perform request async ( request , new response listener ( ) { @ override public void on success ( response response ) { latch count down ( ) ; } @ override public void on failure ( exception exception ) { exceptions add ( exception ) ; latch count down ( ) ; } } ) ; } assert true ( " timeout waiting for requests to be sent " , latch await ( 10 , time unit seconds ) ) ; if ( exceptions is empty ( ) = = false ) { assertion error error = new assertion error ( " expected no failures but got some see suppressed for first 10 of [ " + exceptions size ( ) + " ] failures " ) ; for ( exception exception : exceptions sub list ( 0 , math min ( 10 , exceptions size ( ) ) ) ) { error add suppressed ( exception ) ; } throw error ; } }


check if this registry contains a singleton instance with the given name only checks already instantiated singletons ; does not return { @ code true } for singleton bean definitions which have not been instantiated yet the main purpose of this method is to check manually registered singletons ( see { @ link # register singleton } ) can also be used to check whether a singleton defined by a bean definition has already been created to check whether a bean factory contains a bean definition with a given name , use listable bean factory ' s { @ code contains bean definition } calling both { @ code contains bean definition } and { @ code contains singleton } answers whether a specific bean factory contains a local bean instance with the given name use bean factory ' s { @ code contains bean } for general checks whether the factory knows about a bean with a given name ( whether manually registered singleton instance or created by bean definition ) , also checking ancestor factories < b > note : < b > this lookup method is not aware of factory bean prefixes or aliases you need to resolve the canonical bean name first before checking the singleton status

boolean contains singleton ( string bean name ) ;


returns this get exec path ( ) get path string ( )

public final string get exec path string ( ) { return get exec path ( ) get path string ( ) ; }


test decode method with initialized parameter

public void test decode more less than four with zero ( ) { bb clear ( ) ; for ( int i = 0 ; i < 4 ; i + + ) { bb write zero ( i ) ; } try { seata serializer deserialize ( bb array ( ) ) ; assertions fail ( ) ; } catch ( exception e ) { assertions assert true ( e get message ( ) contains ( " not support " ) , " error data " ) ; } }


sets the correct { @ code content type } and encodes the given content object via { @ link # json } , then sets it as the content

public http request builder json content ( object content ) { validate ( ) ; http request set header ( http request header content type , " application / json " ) ; string json content = json to json ( content ) ; http request set content ( json content ) ; return this ; }


build a exception to throw with a formatted message

protected static exit util exit exception exit exception ( final int exit code , final string format , final object args ) { return new exit util exit exception ( exit code , string format ( format , args ) ) ; }


configures the reader to read the csv data and parse it to the given type the type must be a subclass of { @ link tuple } the type information for the fields is obtained from the type class the type consequently needs to specify all generic field types of the tuple

public < t extends tuple > data source < t > tuple type ( class < t > target type ) { preconditions check not null ( target type , " the target type class must not be null " ) ; if ( ! tuple class is assignable from ( target type ) ) { throw new illegal argument exception ( " the target type must be a subclass of " + tuple class get name ( ) ) ; } @ suppress warnings ( " unchecked " ) tuple type info < t > type info = ( tuple type info < t > ) type extractor create type info ( target type ) ; csv input format < t > input format = new tuple csv input format < t > ( path , this line delimiter , this field delimiter , type info , this included mask ) ; class < ? > [ ] classes = new class < ? > [ type info get arity ( ) ] ; for ( int i = 0 ; i < type info get arity ( ) ; i + + ) { classes [ i ] = type info get type at ( i ) get type class ( ) ; } configure input format ( input format ) ; return new data source < t > ( execution context , input format , type info , utils get call location name ( ) ) ; }


returns the c + + fdo optimization support provider

public fdo context get fdo context ( ) { return fdo context ; }


record that the tuple contains an element at the position provided

void set written ( int i ) { written set ( i ) ; }


the bulk iteration meta operator cannot have broadcast inputs this method always throws an exception

public < x > void set broadcast variables ( map < string , operator < x > > inputs ) { throw new unsupported operation exception ( " the bulk iteration meta operator cannot have broadcast inputs " ) ; }


this instantiates the gl10 , gl11 and gl20 instances includes the check for certain devices that pretend to support gl11 but fuck up vertex buffer objects this includes the pixelflinger which segfaults when buffers are deleted as well as the motorola cliq and the samsung behold ii

protected void setup g l ( javax microedition khronos opengles gl10 gl ) { string version string = gl gl get string ( gl10 gl version ) ; string vendor string = gl gl get string ( gl10 gl vendor ) ; string renderer string = gl gl get string ( gl10 gl renderer ) ; gl version = new g l version ( application application type android , version string , vendor string , renderer string ) ; if ( config use g l 3 0 & & gl version get major version ( ) > 2 ) { if ( gl 3 0 ! = null ) return ; gl 2 0 = gl 3 0 = new android g l 3 0 ( ) ; gdx gl = gl 3 0 ; gdx gl 2 0 = gl 3 0 ; gdx gl 3 0 = gl 3 0 ; } else { if ( gl 2 0 ! = null ) return ; gl 2 0 = new android g l 2 0 ( ) ; gdx gl = gl 2 0 ; gdx gl 2 0 = gl 2 0 ; } gdx app log ( log tag , " ogl renderer : " + gl gl get string ( gl10 gl renderer ) ) ; gdx app log ( log tag , " ogl vendor : " + gl gl get string ( gl10 gl vendor ) ) ; gdx app log ( log tag , " ogl version : " + gl gl get string ( gl10 gl version ) ) ; gdx app log ( log tag , " ogl extensions : " + gl gl get string ( gl10 gl extensions ) ) ; }


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

@ override public t visit arithmetic unary ( sql base parser arithmetic unary context ctx ) { return visit children ( ctx ) ; }


set the message body converters to use these converters are used to convert objects to mime parts

public void set part converters ( list < http message converter < ? > > part converters ) { assert not empty ( part converters , " ' part converters ' must not be empty " ) ; this part converters = part converters ; }


returns true if this elf was created for a little endian processor

public boolean is little endian ( ) { return e ident data = = elf constants elf data le ; }


test for block recovery taking longer than the heartbeat interval

public void test recovery slower than heartbeat ( ) throws exception { tear down ( ) ; / / stop the mocked dn started in startup ( ) sleep answer delayer = new sleep answer ( 3000 , 6000 ) ; test recovery with datanode delayed ( delayer ) ; }


control structure abstraction for safely extracting a prereq from the launcher attribute or { @ code - - java launcher } flag returns { @ code null } if either { @ code create executable } or { @ code use launcher } are disabled

private static string filter launcher for target ( rule context rule context ) { / / create executable = 0 disables the launcher if ( rule context get rule ( ) is attr defined ( " create executable " , type boolean ) & & ! rule context attributes ( ) get ( " create executable " , type boolean ) ) { return null ; } / / use launcher = false disables the launcher if ( rule context get rule ( ) is attr defined ( " use launcher " , type boolean ) & & ! rule context attributes ( ) get ( " use launcher " , type boolean ) ) { return null ; } / / build rule " launcher " attribute if ( rule context get rule ( ) is attr defined ( " launcher " , build type label ) & & rule context attributes ( ) get ( " launcher " , build type label ) ! = null ) { return " launcher " ; } / / blaze flag - - java launcher java configuration java config = rule context get fragment ( java configuration class ) ; if ( rule context get rule ( ) is attr defined ( " : java launcher " , build type label ) & & java config get java launcher label ( ) ! = null ) { return " : java launcher " ; } return null ; }


public static file temp file ( configuration conf , string prefix , long size ) throws i o exception { return get allocator ( conf , buffer dir ) create tmp file for write ( prefix , size , conf ) ; }


check queue label expression , check if node label in queue ' s node - label - expression existed in cluster node labels if rm context ! = null

public static boolean check queue label expression ( set < string > queue labels , string label expression , r m context rm context ) { / / if label expression is empty , we can allocate container on any node if ( label expression = = null ) { return true ; } for ( string str : label expression split ( " & & " ) ) { str = str trim ( ) ; if ( ! str trim ( ) is empty ( ) ) { / / check queue label if ( queue labels = = null ) { return false ; } else { if ( ! queue labels contains ( str ) & & ! queue labels contains ( r m node labels manager any ) ) { return false ; } } } } return true ; }


int join ( ) throws interrupted exception { if ( rpc server ! = null ) { rpc server join ( ) ; } return result code ; }


sets the source of this symbol { @ link source type }

public void set source ( source type source ) ;


attempts to memory map this file android files must not be compressed

public byte buffer map ( file channel map mode mode ) { if ( type = = file type classpath ) throw new gdx runtime exception ( " cannot map a classpath file : " + this ) ; random access file raf = null ; try { raf = new random access file ( file , mode = = map mode read only ? " r " : " rw " ) ; file channel file channel = raf get channel ( ) ; byte buffer map = file channel map ( mode , 0 , file length ( ) ) ; map order ( byte order native order ( ) ) ; return map ; } catch ( exception ex ) { throw new gdx runtime exception ( " error memory mapping file : " + this + " ( " + type + " ) " , ex ) ; } finally { stream utils close quietly ( raf ) ; } }


returns whether this source supports nested projection

boolean supports nested projection ( ) ;


finds the position of the first path separator

private int find separator ( string pattern ) { int idx 1 = pattern index of ( ' \ \ ' ) ; int idx 2 = pattern index of ( ' / ' ) ; if ( idx 1 = = - 1 ) return idx 2 ; if ( idx 2 = = - 1 ) return idx 1 ; return math min ( idx 1 , idx 2 ) ; }


returns the current highlight ( marked area )

public field selection get highlight ( ) { return new field selection ( highlight ) ; }


sets the primary callback to be executed when this action changes its action state this builder will throw an { @ link illegal state exception } if one of the build methods is called without providing this callback

public multi state action builder < t > on action state changed ( bi consumer < action state < t > , event trigger > bi consumer ) { action state changed callback = bi consumer ; return self ( ) ; }


called by internal mechanisms , do not call yourself

public void set dao session ( dao session dao session ) { this dao session = dao session ; my dao = dao session ! = null ? dao session get tree entity dao ( ) : null ; }


incrementing abfs counters with a long value

private void increment counter ( abfs statistic statistic , long value ) { if ( abfs counters ! = null ) { abfs counters increment counter ( statistic , value ) ; } }


boolean lock query ( branch type branch type , string resource id , string xid , string lock keys ) throws transaction exception ;


get a set of offsets for the specified partition identifiers this may be more efficient than calling { @ link # offset ( map ) } repeatedly note that when errors occur , this method omits the associated data and tries to return as many of the requested values as possible this allows a task that ' s managing many partitions to still proceed with any available data therefore , implementations should take care to check that the data is actually available in the returned response the only case when an exception will be thrown is if the entire request failed , e g because the underlying storage was unavailable

< t > map < map < string , t > , map < string , object > > offsets ( collection < map < string , t > > partitions ) ;


create from unmasked mode and umask if the mode is already an fs create modes object , return it

public static fs permission apply u mask ( fs permission mode , fs permission umask ) { if ( mode get unmasked ( ) ! = null ) { return mode ; } return create ( mode apply u mask ( umask ) , mode ) ; }


searches this database for functions whose name matches the given regular expression

public list < function record > find functions by name regex ( string regex ) { try { list < function record > list = functions table get function records by name regex ( regex ) ; return list ; } catch ( i o exception e ) { msg error ( this , " serious problem search for fid functions by regular expression " , e ) ; } return null ; }


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


public static void main ( final string [ ] args ) { / / the captain can only operate rowing boats but with adapter he is able to / / use fishing boats as well var captain = new captain ( new fishing boat adapter ( ) ) ; captain row ( ) ; }


returns a serialized composite key , from the key and key - group provided in a previous call to { @ link # set key and key group ( object , int ) } and the given namespace

public < n > byte [ ] build composite key namespace ( @ nonnull n namespace , @ nonnull type serializer < n > namespace serializer ) { try { serialize namespace ( namespace , namespace serializer ) ; final byte [ ] result = key out view get copy of buffer ( ) ; reset to key ( ) ; return result ; } catch ( i o exception should never happen ) { throw new flink runtime exception ( should never happen ) ; } }


get total current reservations used only by unit tests

public resource get current reservation ( ) { return attempt resource usage get reserved ( ) ; }


flag to indicate that this test is being executed in parallel this is used by some of the scale tests to validate test time expectations

protected boolean is parallel execution ( ) { return boolean get boolean ( s 3 a test constants key parallel test execution ) ; }


creates list of users with given input array

public void create users with array input ( list < user > user ) throws api exception { create users with array input with http info ( user ) ; }


gets the list of assigned user jar paths

public map < string , distributed cache distributed cache entry > get user artifacts ( ) { return user artifacts ; }


browser single version performance related source

browser app single version perf to browser app single version perf ( ) { browser app single version perf perf = new browser app single version perf ( ) ; perf set name ( service version ) ; perf set service name ( service ) ; to browser app perf source ( perf ) ; return perf ; }


handles failed extraction of an authentication token this can happen in a few different scenarios : this is an initial request from a client without preemptive authentication , so we must return an authentication challenge this is a request that contained an authorization header that we can ' t validate this is a request made internally within a node and there is a fallback user , which is typically the { @ link system user } anonymous access is enabled and this will be considered an anonymous request regardless of the scenario , this method will call the listener with either failure or success

void handle null token ( ) { list < realm > unlicensed realms = realms get unlicensed realms ( ) ; if ( unlicensed realms is empty ( ) = = false ) { logger warn ( " no authentication credential could be extracted using realms [ { } ] " + " realms [ { } ] were skipped because they are not permitted on the current license " , strings collection to comma delimited string ( default ordered realm list ) , strings collection to comma delimited string ( unlicensed realms ) ) ; } final authentication authentication ; if ( fallback user ! = null ) { logger trace ( " no valid credentials found in request [ { } ] , using fallback [ { } ] " , request , fallback user principal ( ) ) ; realm ref authenticated by = new realm ref ( " fallback " , " fallback " , node name ) ; authentication = new authentication ( fallback user , authenticated by , null , version current , authentication type internal , collections empty map ( ) ) ; } else if ( fallback to anonymous ) { logger trace ( " no valid credentials found in request [ { } ] , using anonymous [ { } ] " , request , anonymous user principal ( ) ) ; realm ref authenticated by = new realm ref ( " anonymous " , " anonymous " , node name ) ; authentication = new authentication ( anonymous user , authenticated by , null , version current , authentication type anonymous , collections empty map ( ) ) ; } else { authentication = null ; } runnable action ; if ( authentication ! = null ) { action = ( ) - > write auth to context ( authentication ) ; } else { action = ( ) - > { logger debug ( " no valid credentials found in request [ { } ] , rejecting " , request ) ; listener on failure ( request anonymous access denied ( ) ) ; } ; } / / we assign the listener call to an action to avoid calling the listener within a try block and auditing the wrong thing when / / an exception bubbles up even after successful authentication action run ( ) ; }


set the class loader to use for loading jackson extension modules

public jackson 2 object mapper builder module class loader ( class loader module class loader ) { this module class loader = module class loader ; return this ; }


takes the serialized accumulator results and tries to deserialize them using the provided class loader

public static map < string , optional failure < object > > deserialize accumulators ( map < string , serialized value < optional failure < object > > > serialized accumulators , class loader loader ) throws i o exception , class not found exception { if ( serialized accumulators = = null | | serialized accumulators is empty ( ) ) { return collections empty map ( ) ; } map < string , optional failure < object > > accumulators = new hash map < > ( serialized accumulators size ( ) ) ; for ( map entry < string , serialized value < optional failure < object > > > entry : serialized accumulators entry set ( ) ) { optional failure < object > value = null ; if ( entry get value ( ) ! = null ) { value = entry get value ( ) deserialize value ( loader ) ; } accumulators put ( entry get key ( ) , value ) ; } return accumulators ; }


protected string get prefix ( ) { return prefix ; }


/ * package * / void dedup ( final map < string , char [ ] > table ) { string l = get label ( ) ; char [ ] v = table get ( l ) ; if ( v ! = null ) { label = v ; } else { table put ( l , label ) ; } }


sets whether or not { @ link text delegate } will cache ( memoize ) the results of get text if this isn ' t necessary then set it to false

public void set cache text ( boolean cache text ) { this cache text = cache text ; }


load the values defined from a configuration file including the delta progress and the maximum time between each log message

public static void set task log progress delta thresholds ( final configuration conf ) { if ( progress min delta threshold = = null ) { progress min delta threshold = new double ( progress min delta factor * conf get double ( m r job config task log progress delta threshold , m r job config task log progress delta threshold default ) ) ; } if ( progress max wait delta time threshold = = null ) { progress max wait delta time threshold = time unit seconds to millis ( conf get long ( m r job config task log progress wait interval seconds , m r job config task log progress wait interval seconds default ) ) ; } }


gets the { @ link rule context } at the time this exception was thrown if the context is not available , this method returns { @ code null }

public rule context get ctx ( ) { return ctx ; }


to test class name in snake case to test class name in snake case < b > 200 < b > - successful operation

public client test classname ( client body , map < string , object > params ) throws i o exception { http response response = test classname for http response ( body , params ) ; type reference < client > type ref = new type reference < client > ( ) { } ; return api client get object mapper ( ) read value ( response get content ( ) , type ref ) ; }


constructs an { @ code array list multimap } with the same mappings as the specified multimap this method will soon be deprecated in favor of { @ code multimap builder hash keys ( ) array list values ( ) build ( multimap ) }

public static < k , v > array list multimap < k , v > create ( multimap < ? extends k , ? extends v > multimap ) { return new array list multimap < > ( multimap ) ; }


public string get name ( ) { return name ; }


set the converter that will convert incoming jms messages to listener method arguments , and objects returned from listener methods back to jms messages the default converter is a { @ link simple message converter } , which is able to handle { @ link javax jms bytes message bytes messages } , { @ link javax jms text message text messages } and { @ link javax jms object message object messages }

public void set message converter ( @ nullable message converter message converter ) { this message converter = message converter ; }


public void set threshold ( float threshold percent ) { preconditions check state ( ( threshold percent > = 0 0f ) & & ( threshold percent < = 100 0f ) , " a percentage value expected " ) ; this threshold = threshold percent ; }


returns the unsigned long integer value of the requested attribute , or - default value - if the attribute is missing the ' unsigned ' ness of this method refers to how the binary value is read from the dwarf information ( ie a value with the high bit set is not treated as signed ) the - default value - parameter can accept a negative value

public long get unsigned long ( int attribute , long default value ) { d w a r f numeric attribute attr = get attribute ( attribute , d w a r f numeric attribute class ) ; return ( attr ! = null ) ? attr get unsigned value ( ) : default value ; }


returns the apple architecture implied by apple command line options and core options

private string determine single architecture ( apple command line options apple options , core options config options ) { if ( ! strings is null or empty ( apple options apple split cpu ) ) { return apple options apple split cpu ; } switch ( apple options apple platform type ) { case ios : if ( ! apple options ios multi cpus is empty ( ) ) { return apple options ios multi cpus get ( 0 ) ; } else { return apple configuration ios cpu from cpu ( config options cpu ) ; } case watchos : if ( apple options watchos cpus is empty ( ) ) { return apple command line options default watchos cpu ; } return apple options watchos cpus get ( 0 ) ; case tvos : if ( apple options tvos cpus is empty ( ) ) { return apple command line options default tvos cpu ; } return apple options tvos cpus get ( 0 ) ; case macos : if ( apple options macos cpus is empty ( ) ) { return apple command line options default macos cpu ; } return apple options macos cpus get ( 0 ) ; case catalyst : if ( apple options catalyst cpus is empty ( ) ) { return apple command line options default catalyst cpu ; } return apple options catalyst cpus get ( 0 ) ; default : throw new illegal argument exception ( " unhandled platform type " + apple options apple platform type ) ; } }


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


write out the xml for the external entry points

void write ( xml writer writer , address set view set , task monitor monitor ) throws cancelled exception { monitor set message ( " writing comments " ) ; if ( set = = null ) { set = program get memory ( ) ; } writer start element ( " comments " ) ; code unit iterator iter = listing get code unit iterator ( code unit comment property , set , true ) ; while ( iter has next ( ) ) { if ( monitor is cancelled ( ) ) { throw new cancelled exception ( ) ; } code unit cu = iter next ( ) ; for ( int i = 0 ; i < comment types length ; i + + ) { if ( monitor is cancelled ( ) ) { return ; } string comments = cu get comment ( comment types [ i ] ) ; if ( comments ! = null ) { write comment ( writer , cu get min address ( ) , comment tags [ i ] , comments ) ; } } } writer end element ( " comments " ) ; }


propagate a counter from the instance - level statistics to the s3a instrumentation , subtracting the previous merged value

void promote i o counter ( string name ) { increment mutable counter ( name , lookup counter value ( name ) - merged stats counters ( ) get ( name ) ) ; }


public static boolean is available ( ) { try { final int millis = 100 ; final int margin = 20 ; delay ( 0 ) ; final long time 1 = unit help ping ( " localhost " ) ; delay ( millis ) ; final long time 2 = unit help ping ( " localhost " ) ; delay ( 0 ) ; final long time 3 = unit help ping ( " localhost " ) ; return time 2 > = time 1 + millis - margin & & time 2 > = time 3 + millis - margin ; } catch ( final throwable e ) { log debug ( " " , e ) ; return false ; } }


enable or disable the recommendation check for schemas containing type definitions , specifically for changes between open a p i 3 0 x and 3 1 for more details , see { @ link rule configuration # is enable schema type recommendation ( ) }

public void set enable schema type recommendation ( boolean enable schema type recommendation ) { this enable schema type recommendation = enable schema type recommendation ; }


converts the given number of the current units into kibibytes

public long to kibibytes ( long l ) { return kibibytes convert ( l , this ) ; }


return the default value of the property

public string to default value ( schema p ) { if ( model utils is boolean schema ( p ) ) { if ( p get default ( ) ! = null ) { if ( p get default ( ) to string ( ) equals ignore case ( " false " ) ) return " false " ; else return " true " ; } } else if ( model utils is date schema ( p ) ) { / / todo } else if ( model utils is date time schema ( p ) ) { / / todo } else if ( model utils is number schema ( p ) ) { if ( p get default ( ) ! = null ) { return p get default ( ) to string ( ) ; } } else if ( model utils is integer schema ( p ) ) { if ( p get default ( ) ! = null ) { return p get default ( ) to string ( ) ; } } else if ( model utils is string schema ( p ) ) { if ( p get default ( ) ! = null ) { return " ' " + ( string ) p get default ( ) + " ' " ; } } return null ; }


create a tree using a custom comparator to order the values

public static < k , v > tree value sorted map < k , v > create with comparator ( comparator < v > comparator ) { return new tree value sorted map < > ( comparator ) ; }


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


returns a dirents structure , listing the names of all entries within the directory { @ code path } , plus their types ( file , directory , other )

protected collection < dirent > readdir ( path path , boolean follow symlinks ) throws i o exception { collection < string > children = get directory entries ( path ) ; list < dirent > dirents = lists new array list with capacity ( children size ( ) ) ; for ( string child : children ) { path child path = path get child ( child ) ; dirent type type = dirent from stat ( stat nullable ( child path , follow symlinks ) ) ; dirents add ( new dirent ( child , type ) ) ; } return dirents ; }


returns the next token in the string as a { @ code string } the delimiters used are changed to the specified delimiters

public string next token ( string delims ) { this delimiters = delims ; return next token ( ) ; }


from an s3 bucket name , build an arn to refer to it

public static list < statement > allow s 3 operations ( string bucket , boolean write ) { / / add the bucket operations for the specific bucket arn array list < statement > statements = lists new array list ( statement ( true , bucket to arn ( bucket ) , s3 get bucket location , s3 bucket all list ) ) ; / / then add the statements for objects in the buckets if ( write ) { statements add ( statement ( true , bucket objects to arn ( bucket ) , s3 root rw operations ) ) ; } else { statements add ( statement ( true , bucket objects to arn ( bucket ) , s3 root read operations list ) ) ; } return statements ; }


register a common { @ link com sun net httpserver authenticator } to be applied to all detected { @ link javax jws web service } annotated beans

public void set authenticator ( authenticator authenticator ) { this authenticator = authenticator ; }


right after visiting the given referred { @ link i node }

default void post visit referred ( i node referred ) { }


public map < string , configuration metadata property > properties ( ) { return repository get repository ( ) get all properties ( ) ; }


simple test validating count of one word

public void test one word ( ) { / / feed word " hello " to input topic and no kafka key , timestamp is irrelevant in this case input topic pipe input ( " hello " ) ; / / read and validate output to match word as key and count as value assert that ( output topic read key value ( ) , equal to ( new key value < > ( " hello " , 1l ) ) ) ; / / no more output in topic assert that ( output topic is empty ( ) , is ( true ) ) ; }


parse namespace from a string the string must be in legal format defined by each { @ link allocation tag namespace type }

public static target applications namespace parse ( string namespace str ) throws invalid allocation tags query exception { / / return the default namespace if no valid string is given if ( strings is null or empty ( namespace str ) ) { return new self ( ) ; } / / normalize the input , escape additional chars list < string > ns values = normalize ( namespace str ) ; / / the first string should be the prefix string ns prefix = ns values get ( 0 ) ; allocation tag namespace type allocation tag namespace type = from string ( ns prefix ) ; switch ( allocation tag namespace type ) { case self : return new self ( ) ; case not self : return new not self ( ) ; case all : return new all ( ) ; case app id : if ( ns values size ( ) ! = 2 ) { throw new invalid allocation tags query exception ( " missing the application id in the namespace string : " + namespace str ) ; } string app i d str = ns values get ( 1 ) ; return parse app i d ( app i d str ) ; case app tag : if ( ns values size ( ) ! = 2 ) { throw new invalid allocation tags query exception ( " missing the application tag in the namespace string : " + namespace str ) ; } return new app tag ( ns values get ( 1 ) ) ; default : throw new invalid allocation tags query exception ( " invalid namespace string " + namespace str ) ; } }


retrieves the { @ link py runtime info } object in the given field of the given { @ link toolchain info } if the field holds { @ code none } , null is returned instead if the field does not exist on the given { @ code toolchain info } , or is not a { @ code py runtime info } and not { @ code none } , an error is reported on the { @ code rule context } and null is returned if the { @ code py runtime info } does not have { @ code expected version } as its python version , an error is reported on the { @ code rule context } ( but the provider is still returned )

private static py runtime info parse runtime field ( rule context rule context , python version expected version , toolchain info toolchain info , string field ) { object field value ; try { field value = toolchain info get value ( field ) ; } catch ( eval exception e ) { rule context rule error ( string format ( " error parsing the python toolchain ' s toolchain info : could not retrieve field " + " ' % s ' : % s " , field , e get message ( ) ) ) ; return null ; } if ( field value = = null ) { rule context rule error ( string format ( " error parsing the python toolchain ' s toolchain info : field ' % s ' is missing " , field ) ) ; return null ; } if ( field value = = none ) { return null ; } if ( ! ( field value instanceof py runtime info ) ) { rule context rule error ( string format ( " error parsing the python toolchain ' s toolchain info : expected a py runtime info in " + " field ' % s ' , but got ' % s ' " , field , starlark type ( field value ) ) ) ; return null ; } py runtime info py runtime info = ( py runtime info ) field value ; if ( py runtime info get python version ( ) ! = expected version ) { rule context rule error ( string format ( " error retrieving the python runtime from the toolchain : expected field ' % s ' to have " + " a runtime with python version = ' % s ' , but got python version = ' % s ' " , field , expected version name ( ) , py runtime info get python version ( ) name ( ) ) ) ; } return py runtime info ; }


positions the reader at the named key , or if none such exists , at the first entry after the named key

private synchronized int seek internal ( writable comparable key ) throws i o exception { return seek internal ( key , false ) ; }


set the character set to use when writing multipart data to encode file names encoding is based on the { @ code encoded - word } syntax defined in rfc 2047 and relies on { @ code mime utility } from { @ code javax mail } as of 5 0 by default part headers , including { @ code content - disposition } ( and its filename parameter ) will be encoded based on the setting of { @ link # set charset ( charset ) } or { @ code utf - 8 } by default

public void set multipart charset ( charset charset ) { this multipart charset = charset ; }


public static byte [ ] encrypt d e s ( final byte [ ] data , final byte [ ] key , final string transformation , final byte [ ] iv ) { return symmetric template ( data , key , " des " , transformation , iv , true ) ; }


return the specified node to cache with the associated buffer object

private void return to cache ( buffer node node , data buffer buf ) { / / ? ? should not happen if ( node buffer ! = null | | buf = = null ) { throw new assert exception ( ) ; } node buffer = buf ; / / todo : set buffer id node add to cache ( cache head ) ; + + buffers on hand ; }


public builder add exempt generator ( string exempt generator ) { exempt generators add ( exempt generator ) ; return this ; }


public row id get row id ( int column index ) throws s q l exception { return null ; }


fits this rectangle around another rectangle while maintaining aspect ratio this scales and centers the rectangle to the other rectangle ( e g having a camera translate and scale to show a given area )

public rectangle fit outside ( rectangle rect ) { float ratio = get aspect ratio ( ) ; if ( ratio > rect get aspect ratio ( ) ) { / / wider than tall set size ( rect height * ratio , rect height ) ; } else { / / taller than wide set size ( rect width , rect width / ratio ) ; } set position ( ( rect x + rect width / 2 ) - width / 2 , ( rect y + rect height / 2 ) - height / 2 ) ; return this ; }


writes a field to the given { @ link data output view } this write method avoids java serialization , by writing only the classname of the field ' s declaring class and the field name the written field can be read using { @ link # read field ( data input view , class loader ) }

static void write field ( data output view out , field field ) throws i o exception { class < ? > declaring class = field get declaring class ( ) ; out write u t f ( declaring class get name ( ) ) ; out write u t f ( field get name ( ) ) ; }


gets the current field panel coordinator used to synchronize scrolling between the left and right view for this code comparison panel

protected t get field panel coordinator ( ) { return field panel coordinator ; }


add the { @ code owning bucket ord , value } pair return the ord for their bucket if they have yet to be added , or { @ code - 1 - ord } if they were already present

public abstract long add ( long owning bucket ord , long value ) ;


clone the supplied configuration but remove the shared edits dirs

private static configuration get configuration without shared edits ( configuration conf ) throws i o exception { list < uri > edits dirs = f s namesystem get namespace edits dirs ( conf , false ) ; string edits dirs string = joiner on ( " , " ) join ( edits dirs ) ; configuration conf without shared = new configuration ( conf ) ; conf without shared unset ( d f s config keys dfs namenode shared edits dir key ) ; conf without shared set strings ( d f s config keys dfs namenode edits dir key , edits dirs string ) ; return conf without shared ; }


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


extracts a sorted list of declared version constants from a class the argument would normally be version class but is exposed for testing with other classes - containing - version - constants

public static list < version > get declared versions ( final class < ? > version class ) { final field [ ] fields = version class get fields ( ) ; final list < version > versions = new array list < > ( fields length ) ; for ( final field field : fields ) { final int mod = field get modifiers ( ) ; if ( false = = modifier is static ( mod ) & & modifier is final ( mod ) & & modifier is public ( mod ) ) { continue ; } if ( field get type ( ) ! = version class ) { continue ; } switch ( field get name ( ) ) { case " current " : case " v empty " : continue ; } assert field get name ( ) matches ( " v ( \ \ d + ) { 3 } ? " ) : field get name ( ) ; try { versions add ( ( ( version ) field get ( null ) ) ) ; } catch ( final illegal access exception e ) { throw new runtime exception ( e ) ; } } collections sort ( versions ) ; return versions ; }


public void add ( double value ) { if ( count = = 0 ) { count = 1 ; mean = value ; min = value ; max = value ; if ( ! is finite ( value ) ) { sum of squares of deltas = na n ; } } else { count + + ; if ( is finite ( value ) & & is finite ( mean ) ) { / / art of computer programming vol 2 , knuth , 4 2 2 , ( 15 ) and ( 16 ) double delta = value - mean ; mean + = delta / count ; sum of squares of deltas + = delta * ( value - mean ) ; } else { mean = calculate new mean non finite ( mean , value ) ; sum of squares of deltas = na n ; } min = math min ( min , value ) ; max = math max ( max , value ) ; } }


signals that the client expected the system under test ( sut ) to report errors use this when you wish to verify that errors are reported and you do not want those errors to fail the test the default value for this setting is false , which means that any errors reported will fail the running test


returns an immutable set of all eight primitive - wrapper types

public static set < class < ? > > all wrapper types ( ) { return wrapper to primitive type key set ( ) ; }


evaluate this expression in the given environment ( bindings )

public object evaluate ( properties bindings ) ;


returns all data objects in row : line - bar - scatter - candle - bubble if not null

public list < bar line scatter candle bubble data > get all data ( ) { list < bar line scatter candle bubble data > data = new array list < bar line scatter candle bubble data > ( ) ; if ( m line data ! = null ) data add ( m line data ) ; if ( m bar data ! = null ) data add ( m bar data ) ; if ( m scatter data ! = null ) data add ( m scatter data ) ; if ( m candle data ! = null ) data add ( m candle data ) ; if ( m bubble data ! = null ) data add ( m bubble data ) ; return data ; }


waits for the specified time ( in milliseconds ) for the thread to terminate ( using { @ link thread # join ( long ) } ) , else interrupts the thread ( in the hope that it may terminate later ) and fails

void await termination ( thread t , long timeout millis ) { try { t join ( timeout millis ) ; } catch ( interrupted exception ie ) { thread unexpected exception ( ie ) ; } finally { if ( t get state ( ) ! = thread state terminated ) { t interrupt ( ) ; fail ( " test timed out " ) ; } } }


private static j s o n object normalize key config ( object key ) throws j s o n exception { j s o n object jobject ; if ( key instanceof string ) { jobject = new j s o n object ( ) ; jobject put ( " key " , key ) ; } else if ( key instanceof j s o n object ) { jobject = ( j s o n object ) key ; } else { throw new j s o n exception ( " an key in the extra - key matrix must be a string or an object " ) ; } return jobject ; }


returns the installed bundled ( external ) themes

public map < string , m t bundled theme > get bundled themes ( ) { return collections unmodifiable map ( bundled themes ) ; }


@ t c description : @ test step : @ expect result :

public void multiple tenant deregister instance ( ) throws exception { string service name = random domain name ( ) ; naming 1 register instance ( service name , " 11 11 11 11 " , test port , " c 1 " ) ; naming 1 register instance ( service name , " 22 22 22 22 " , test port , " c 1 " ) ; naming 2 register instance ( service name , " 22 22 22 22 " , test port , " c 1 " ) ; list < instance > instances = naming 1 get all instances ( service name ) ; verify instance list for naming ( naming 1 , 2 , service name ) ; assert assert equals ( 2 , naming 1 get all instances ( service name ) size ( ) ) ; naming 1 deregister instance ( service name , " 22 22 22 22 " , test port , " c 1 " ) ; time unit seconds sleep ( 12 ) ; assert assert equals ( 1 , naming 1 get all instances ( service name ) size ( ) ) ; assert assert equals ( 1 , naming 2 get all instances ( service name ) size ( ) ) ; }


calculate the { @ link bounding box } of the specified part

public bounding box calculate bounding box ( final bounding box out , int offset , int count , final matrix 4 transform ) { return extend bounding box ( out inf ( ) , offset , count , transform ) ; }


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


verify that when a service fails during its stop operation , its state does not change

public void test failing stop ( ) throws throwable { breakable service svc = new breakable service ( false , false , true ) ; svc init ( new configuration ( ) ) ; svc start ( ) ; try { svc stop ( ) ; fail ( " expected a failure , got " + svc ) ; } catch ( breakable service broken lifecycle event e ) { / / expected } assert state count ( svc , service state stopped , 1 ) ; }


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


tests that clients with disabled sasl mechanism fail authentication with connection close delay if configured

public void test disabled sasl mechanism ( ) throws exception { string node = " 0 " ; security protocol security protocol = security protocol sasl ssl ; test jaas config jaas config = configure mechanisms ( " scram - sha - 256 " , collections singleton list ( " scram - sha - 256 " ) ) ; jaas config set client options ( " plain " , test jaas config username , " invalidpassword " ) ; server = create echo server ( security protocol ) ; create and check client authentication failure ( security protocol , node , " scram - sha - 256 " , null ) ; server verify authentication metrics ( 0 , 1 ) ; }


returns a new instance of the module class created using a no - args constructor only used when a manually - constructed module is not supplied

protected t new module ( ) { throw new unsupported operation exception ( " no no - args constructor on " + get class ( ) get name ( ) ) ; }


get the sum of all buckets in the rolling counter for the given { @ link hystrix rolling number event } type the { @ link hystrix rolling number event } must be a " counter " type < code > hystrix rolling number event is counter ( ) = = true < code >

public long get rolling sum ( hystrix rolling number event type ) { bucket last bucket = get current bucket ( ) ; if ( last bucket = = null ) return 0 ; long sum = 0 ; for ( bucket b : buckets ) { sum + = b get adder ( type ) sum ( ) ; } return sum ; }


creates a { @ code collector tester } for the specified { @ code collector } the result of the { @ code collector } will be compared to the expected value using the specified { @ code equivalence }

public static < t , a , r > collector tester < t , a , r > of ( collector < t , a , r > collector , bi predicate < ? super r , ? super r > equivalence ) { return new collector tester < > ( collector , equivalence ) ; }


ignore { @ code constructor } in the tests that follow returns this object

public null pointer tester ignore ( constructor < ? > constructor ) { ignored members add ( check not null ( constructor ) ) ; return this ; }


returns the ( immutable ) list of targets to build in commandline form

public list < string > get targets ( ) { return targets ; }


as ninja files describe the action graph , we must establish the dependency between ninja files and the ninja graph configured target for the sky frame we are doing it by computing all related file value sky values

private static void establish dependency on ninja files ( environment env , artifact main file , immutable list < artifact > ninja srcs ) throws interrupted exception { array list < sky key > dep keys = lists new array list ( ) ; dep keys add ( get artifact rooted path ( main file ) ) ; for ( artifact artifact : ninja srcs ) { dep keys add ( get artifact rooted path ( artifact ) ) ; } env get values ( dep keys ) ; }


sets the trust store key type the ca key generated for the test context will be of this type

public builder set trust store key type ( x 5 0 9 key type key type ) { trust store key type = key type ; return this ; }


public long get sampler slot start ( ) { return ( ( data high level shader language symbol internals 3 2 ) internals ) get sampler slot start ( ) ; }


returns the element type of { @ code type } if it is an array type , or null if it is not an array type

static type array component type ( type type ) { if ( type instanceof generic array type ) { return ( ( generic array type ) type ) get generic component type ( ) ; } else if ( type instanceof class ) { return ( ( class < ? > ) type ) get component type ( ) ; } else { return null ; } }


verifies that invalid bound host will fail with illegal argument exception during encoding

public void test invalid address ( ) { test socks cmd response decoder with different params ( socks cmd status success , socks address type i pv 4 , " 1 " , 80 ) ; }


public void delete permission ( string role , string resource , string action ) { string sql = " delete from permissions where role = ? and resource = ? and action = ? " ; try { jt update ( sql , role , resource , action ) ; } catch ( cannot get jdbc connection exception e ) { log util fatal log error ( " [ db - error ] " + e to string ( ) , e ) ; throw e ; } }


compute the value of an expression given a ( possibly - intermediate ) resolution

public masked long value for resolution ( pattern expression exp , assembly resolved constructor rc ) { return get registered ( exp get class ( ) ) value for resolution ( exp , rc ) ; }


notifies the provider that the component is being hidden this happens when the provider is being closed

public void component hidden ( ) { / / subclasses implement as needed }


lookup the { @ link kv state location } for the given job and queryable state name the job manager will be queried for the location only if forced or no cached location can be found there are no guarantees about

private completable future < kv state location > get kv state lookup info ( final job i d job id , final string queryable state name , final boolean force update ) { final tuple 2 < job i d , string > cache key = new tuple 2 < > ( job id , queryable state name ) ; final completable future < kv state location > cached future = lookup cache get ( cache key ) ; if ( ! force update & & cached future ! = null & & ! cached future is completed exceptionally ( ) ) { log debug ( " retrieving location for state = { } of job = { } from the cache " , queryable state name , job id ) ; return cached future ; } final kv state location oracle kv state location oracle = proxy get kv state location oracle ( job id ) ; if ( kv state location oracle ! = null ) { log debug ( " retrieving location for state = { } of job = { } from the key - value state location oracle " , queryable state name , job id ) ; final completable future < kv state location > location = new completable future < > ( ) ; lookup cache put ( cache key , location ) ; kv state location oracle request kv state location ( job id , queryable state name ) when complete ( ( kv state location kv state location , throwable throwable ) - > { if ( throwable ! = null ) { if ( exception utils strip completion exception ( throwable ) instanceof flink job not found exception ) { / / if the job id was wrong , remove the entry from the cache lookup cache remove ( cache key ) ; } location complete exceptionally ( throwable ) ; } else { location complete ( kv state location ) ; } } ) ; return location ; } else { return future utils completed exceptionally ( new unknown location exception ( " could not retrieve location of state = " + queryable state name + " of job = " + job id + " potential reasons are : i ) the state is not ready , or ii ) the job does not exist " ) ) ; } }


public void place order test ( ) throws api exception { / / order order = null ; / / order response = api place order ( order ) ; / / todo : test validations }


sorts the elements of { @ code array } between { @ code from index } inclusive and { @ code to index } exclusive in descending order , interpreting them as unsigned 8 - bit integers

public static void sort descending ( byte [ ] array , int from index , int to index ) { check not null ( array ) ; check position indexes ( from index , to index , array length ) ; for ( int i = from index ; i < to index ; i + + ) { array [ i ] ^ = byte max value ; } arrays sort ( array , from index , to index ) ; for ( int i = from index ; i < to index ; i + + ) { array [ i ] ^ = byte max value ; } }


returns the conflicting data types in a data type array of size 2 the first entry is the first data type in conflict the second entry is the second data type in conflict < p > note : these values can be null they are only known if this object was created using the constructor that has the conflicting data types as parameters

public data type [ ] get conflicting data types ( ) { return new data type [ ] { this datatype 1 , this datatype 2 } ; }


initializes the user - agent header to send in http requests to aws services we always include the hadoop version number the user also may set an optional custom prefix to put in front of the hadoop version number the aws sdk internally appends its own information , which seems to include the aws sdk version , os and jvm version

private static void init user agent ( configuration conf , client configuration aws conf ) { string user agent = " hadoop " + version info get version ( ) ; string user agent prefix = conf get trimmed ( user agent prefix , " " ) ; if ( ! user agent prefix is empty ( ) ) { user agent = user agent prefix + " , " + user agent ; } log debug ( " using user - agent : { } " , user agent ) ; aws conf set user agent prefix ( user agent ) ; }


returns a comparator that compares two { @ code boolean } arrays < a href = " http : en wikipedia orgwiki lexicographical order " > lexicographically that is , it compares , using { @ link # compare ( boolean , boolean ) } ) , the first pair of values that follow any common prefix , or when one array is a prefix of the other , treats the shorter array as the lesser for example , { @ code [ ] < [ false ] < [ false , true ] < [ true ] } the returned comparator is inconsistent with { @ link object # equals ( object ) } ( since arrays support only identity equality ) , but it is consistent with { @ link arrays # equals ( boolean [ ] , boolean [ ] ) }

public static comparator < boolean [ ] > lexicographical comparator ( ) { return lexicographical comparator instance ; }


set instantaneous fair share of the queue

public void set fair share ( resource resource ) { fair share m b set ( resource get memory size ( ) ) ; fair share v cores set ( resource get virtual cores ( ) ) ; if ( custom resources ! = null ) { custom resources set fair share ( resource ) ; } }


sets the text size to be a fraction of the view ' s remaining height after its top and bottom padding have been subtracted equivalent to { @ code # set fractional text size ( fraction of height , false ) }

public void set fractional text size ( float fraction of height ) { set fractional text size ( fraction of height , false ) ; }


returns an immutable set of the mappings in this map the iteration order is specified by the method used to create this map typically , this is insertion order

public immutable set < entry < k , v > > entry set ( ) { immutable set < entry < k , v > > result = entry set ; return ( result = = null ) ? entry set = create entry set ( ) : result ; }


return a predicate that represents the logical negation of this predicate

default request predicate negate ( ) { return new request predicates negate request predicate ( this ) ; }


shows a list of supported file system types and loaders

private void show supported file systems ( ) { string builder sb = new string builder ( ) ; sb append ( " < html > < table > < tr > < td > supported file systems < / td > < td > supported loaders < / td > < / tr > \ n " ) ; sb append ( " < tr valign = ' top ' > < td > < ul > " ) ; for ( string file system name : file system service get instance ( ) get all filesystem names ( ) ) { sb append ( " < li > " + file system name + " \ n " ) ; } sb append ( " < / ul > < / td > < td > < ul > " ) ; for ( string loader name : loader service get all loader names ( ) ) { sb append ( " < li > " + loader name + " \ n " ) ; } sb append ( " < / ul > < / td > < / tr > < / table > " ) ; multi line message dialog show modal message dialog ( plugin get tool ( ) get active window ( ) , " supported file systems and loaders " , " " , sb to string ( ) , multi line message dialog information message ) ; }


test that access via webhdfs puts proper entry in audit log

public void test audit web hdfs ( ) throws exception { final path file = new path ( fnames [ 0 ] ) ; fs set permission ( file , new fs permission ( ( short ) 0644 ) ) ; fs set owner ( file , " root " , null ) ; setup audit logs ( ) ; web hdfs file system webfs = web hdfs test util get web hdfs file system as ( user group info , conf , web hdfs constants webhdfs scheme ) ; input stream istream = webfs open ( file ) ; int val = istream read ( ) ; istream close ( ) ; verify audit logs repeat ( true , 3 ) ; assert true ( " failed to read from file " , val > = 0 ) ; }


returns { @ code true } if the file descriptor is open

public boolean is open ( ) { return ! is closed ( state ) ; }


returns whether this cache notifies a writer when an entry is modified

protected boolean has writer ( ) { return ( writer ! = cache writer disabled writer ( ) ) ; }


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


test verifies that configuration is passed to the metrics provider

public void test metrics provider configuration ( ) throws exception { client base setup test env ( ) ; base test metrics provider metrics provider with configuration http port set ( 0 ) ; / / setup the logger to capture all logs byte array output stream os = new byte array output stream ( ) ; writer appender appender = get console appender ( os , level warn ) ; logger qlogger = logger get logger ( " org apache zookeeper server quorum " ) ; qlogger add appender ( appender ) ; try { final int client port qp1 = port assignment unique ( ) ; final int client port qp2 = port assignment unique ( ) ; string quorum cfg section server = " server 1 = 127 0 0 1 : " + port assignment unique ( ) + " : " + port assignment unique ( ) + " ; " + client port qp1 + " \ n " + " server 2 = 127 0 0 1 : " + port assignment unique ( ) + " : " + port assignment unique ( ) + " ; " + client port qp2 + " \ n " ; / / server 1 boots with a metrics provider string quorum cfg section server 1 = quorum cfg section server + " metrics provider class name = " + base test metrics provider metrics provider with configuration class get name ( ) + " \ n " + " metrics provider http port = 1234 " ; main thread q 1 = new main thread ( 1 , client port qp1 , quorum cfg section server 1 ) ; main thread q 2 = new main thread ( 2 , client port qp2 , quorum cfg section server ) ; q 1 start ( ) ; q 2 start ( ) ; boolean isup 1 = client base wait for server up ( " 127 0 0 1 : " + client port qp1 , 30000 ) ; boolean isup 2 = client base wait for server up ( " 127 0 0 1 : " + client port qp2 , 30000 ) ; assert true ( isup 1 , " server 1 never came up " ) ; assert true ( isup 2 , " server 2 never came up " ) ; q 1 shutdown ( ) ; q 2 shutdown ( ) ; assert true ( client base wait for server down ( " 127 0 0 1 : " + client port qp1 , client base connection timeout ) , " waiting for server 1 down " ) ; assert true ( client base wait for server down ( " 127 0 0 1 : " + client port qp2 , client base connection timeout ) , " waiting for server 2 down " ) ; } finally { qlogger remove appender ( appender ) ; } assert equals ( 1234 , base test metrics provider metrics provider with configuration http port get ( ) ) ; }


make the replica unreachable , perhaps by renaming it to an invalid file name

void make unreachable ( ) throws i o exception ;


converts a hash into a bucket index ( primary or alternate ) if the hash is negative , this flips the bits the hash is then modulo num buckets to get the final index expert - level api

static int hash to index ( int hash , int num buckets ) { return hash & ( num buckets - 1 ) ; }


makes a user choice as indicated by option this is equivalent to the user clicking a mouse on a radio button indicating which program version to choose it can also be used to press the cancel button on the merge

protected void choose equate ( final string addr , final int op index , final int option , final boolean use for all ) throws exception { choose option ( " equate " , addr , option , use for all ) ; }


increments all of the associated counters

void regular increment ( long e ) { int hash = spread ( long hash code ( e ) ) ; int start = ( hash & 3 ) < < 2 ; / / loop unrolling improves throughput by 5m ops / s int index 0 = index of ( hash , 0 ) ; int index 1 = index of ( hash , 1 ) ; int index 2 = index of ( hash , 2 ) ; int index 3 = index of ( hash , 3 ) ; boolean added = increment at ( index 0 , start , step ) ; added | = increment at ( index 1 , start + 1 , step ) ; added | = increment at ( index 2 , start + 2 , step ) ; added | = increment at ( index 3 , start + 3 , step ) ; try reset ( added ) ; }


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

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


public dependency graphs create level 4 dependency graph ( @ non null variant scope variant scope , boolean with full dependency , boolean download sources , @ non null consumer < sync issue > failure consumer ) { / / fixme change the way we compare dependencies b / 64387392 try { / / get the compile artifact first set < atlas dependency graph hashable resolved artifact result > compile artifacts = get all artifacts ( variant scope , atlas android artifacts consumed config type compile classpath , dependency failure handler ) ; compile artifacts add all ( get all artifacts ( variant scope , atlas android artifacts consumed config type bundlecompile classpath , dependency failure handler ) ) ; / / force download the javadoc / source artifacts of compile scope only , since the / / the runtime - only is never used from the ide if ( download sources ) { set < component identifier > ids = sets new hash set with expected size ( compile artifacts size ( ) ) ; for ( hashable resolved artifact result artifact : compile artifacts ) { ids add ( artifact get id ( ) get component identifier ( ) ) ; } handle sources ( variant scope get global scope ( ) get project ( ) , ids , failure consumer ) ; } / / in this simpler model , faster computation of the runtime dependencies to get the / / provided bit if ( ! with full dependency ) { / / get the runtime artifacts we only care about the component identifier so we don ' t / / need to call get all artifacts ( ) which computes a lot more many things , and takes / / longer on large projects / / instead just get all the jars to get all the dependencies artifact collection runtime artifact collection = compute artifact list ( variant scope , atlas android artifacts consumed config type runtime classpath , android artifacts artifact scope all , atlas android artifacts atlas artifact type jar ) ; / / build a list of the runtime component identifiers final set < resolved artifact result > runtime artifacts = runtime artifact collection get artifacts ( ) ; final set < component identifier > runtime identifiers = sets new hash set with expected size ( runtime artifacts size ( ) ) ; for ( resolved artifact result result : runtime artifacts ) { runtime identifiers add ( result get id ( ) get component identifier ( ) ) ; } list < string > provided addresses = lists new array list ( ) ; list < graph item > compile items = lists new array list with capacity ( compile artifacts size ( ) ) ; for ( atlas dependency graph hashable resolved artifact result artifact : compile artifacts ) { final graph item impl graph item = new graph item impl ( compute address ( artifact ) , immutable list of ( ) ) ; compile items add ( graph item ) ; s library cache get ( artifact ) ; s library map put ( compute address ( artifact ) , artifact ) ; if ( ! runtime identifiers contains ( artifact get id ( ) get component identifier ( ) ) ) { provided addresses add ( graph item get artifact address ( ) ) ; } } return new simple dependency graphs impl ( compile items , provided addresses ) ; } / / now build the list of compile items list < graph item > compile items = lists new array list with capacity ( compile artifacts size ( ) ) ; for ( atlas dependency graph hashable resolved artifact result artifact : compile artifacts ) { compile items add ( new graph item impl ( compute address ( artifact ) , immutable list of ( ) ) ) ; s library cache get ( artifact ) ; s library map put ( compute address ( artifact ) , artifact ) ; } / / in this mode , compute graph item for the runtime configuration / / get the runtime artifacts set < atlas dependency graph hashable resolved artifact result > runtime artifacts = get all artifacts ( variant scope , atlas android artifacts consumed config type runtime classpath , dependency failure handler ) ; runtime artifacts add all ( get all artifacts ( variant scope , atlas android artifacts consumed config type bundlecompile classpath , dependency failure handler ) ) ; list < graph item > runtime items = lists new array list with capacity ( runtime artifacts size ( ) ) ; for ( atlas dependency graph hashable resolved artifact result artifact : runtime artifacts ) { runtime items add ( new graph item impl ( compute address ( artifact ) , immutable list of ( ) ) ) ; s library cache get ( artifact ) ; s library map put ( compute address ( artifact ) , artifact ) ; } / / compute the provided dependency list , by comparing the compile and runtime items list < graph item > provided items = lists new array list ( compile items ) ; provided items remove all ( runtime items ) ; final immutable list < string > provided addresses = provided items stream ( ) map ( graph item : : get artifact address ) collect ( immutable collectors to immutable list ( ) ) ; / / fixme : when full dependency is enabled , this should return a full graph instead of a / / flat list return new full dependency graphs impl ( compile items , runtime items , provided addresses , immutable list of ( ) ) ; / / fixme : actually get skip list } finally { dependency failure handler collect issues ( ) for each ( failure consumer ) ; } }


public static synchronized void dex 2 jar ( file input , file output ) { try { com googlecode dex 2jar tools dex 2jar cmd main ( new string [ ] { input get absolute path ( ) } ) ; string real output = input get name ( ) replace all ( " \ \ dex " , " - dex 2jar jar " ) replace all ( " \ \ apk " , " - dex 2jar jar " ) ; file real output f = new file ( real output ) ; real output f rename to ( output ) ; file real output f 2 = new file ( real output ) ; while ( real output f 2 exists ( ) ) real output f 2 delete ( ) ; } catch ( exception e ) { new the bytecode club bytecodeviewer api exception u i ( e ) ; } }


creates a generic action context with the given provider , with the given context object


registers a task to be executed repeatedly at a fixed rate this call behaves similar to { @ link org apache flink runtime concurrent scheduled executor # schedule at fixed rate ( runnable , long , long , time unit ) }

scheduled future < ? > schedule at fixed rate ( processing time callback callback , long initial delay , long period ) ;


loads a yaml - file of key - value pairs colon and whitespace " : " separate key and value ( one per line ) the hash tag " # " starts a single - line comment example : jobmanager rpc address : localhost # network address for communication with the job manager jobmanager rpc port : 6123 # network port to connect to for communication with the job manager taskmanager rpc port : 6122 # network port the task manager expects incoming ipc connections this does not span the whole yaml specification , but only the syntax of simple yaml key - value pairs ( see issue # 113 on git hub ) if at any point in time , there is a need to go beyond simple key - value pairs syntax compatibility will allow to introduce a yaml parser library

private static configuration load y a m l resource ( file file ) { final configuration config = new configuration ( ) ; try ( buffered reader reader = new buffered reader ( new input stream reader ( new file input stream ( file ) ) ) ) { string line ; int line no = 0 ; while ( ( line = reader read line ( ) ) ! = null ) { line no + + ; / / 1 check for comments string [ ] comments = line split ( " # " , 2 ) ; string conf = comments [ 0 ] trim ( ) ; / / 2 get key and value if ( conf length ( ) > 0 ) { string [ ] kv = conf split ( " : " , 2 ) ; / / skip line with no valid key - value pair if ( kv length = = 1 ) { log warn ( " error while trying to split key and value in configuration file " + file + " : " + line no + " : \ " " + line + " \ " " ) ; continue ; } string key = kv [ 0 ] trim ( ) ; string value = kv [ 1 ] trim ( ) ; / / sanity check if ( key length ( ) = = 0 | | value length ( ) = = 0 ) { log warn ( " error after splitting key and value in configuration file " + file + " : " + line no + " : \ " " + line + " \ " " ) ; continue ; } log info ( " loading configuration property : { } , { } " , key , is sensitive ( key ) ? hidden content : value ) ; config set string ( key , value ) ; } } } catch ( i o exception e ) { throw new runtime exception ( " error parsing yaml configuration " , e ) ; } return config ; }


determines whether or not an environment is a default returns false if the environment doesn ' t belong to this group

public boolean is default ( label environment ) { check initialized ( ) ; return defaults contains ( environment ) ; }


shows the given models , and notifies that each item changed if the item wasn ' t already shown

protected void show models ( iterable < epoxy model < ? > > models ) { show models ( models , true ) ; }


generate namespaced name of the external service

public static string get namespaced external service name ( string cluster id , string namespace ) { return get external service name ( cluster id ) + " " + namespace ; }


returns the size of output that can be read with { @ link # get output ( short buffer ) } , in bytes

public int get output size ( ) { return output frame count * channel count * bytes per sample ; } / / internal methods


this also verifies that we don ' t have leakage between keysnamespaces this also verifies that deleted timers don ' t fire

public void test delete event time timers ( ) throws exception { @ suppress warnings ( " unchecked " ) triggerable < integer , string > mock triggerable = mock ( triggerable class ) ; test key context key context = new test key context ( ) ; test processing time service processing time service = new test processing time service ( ) ; internal timer service impl < integer , string > timer service = create and start internal timer service ( mock triggerable , key context , processing time service , test key group range , create queue factory ( ) ) ; / / get two different keys int key 1 = get key in key group range ( test key group range , max parallelism ) ; int key 2 = get key in key group range ( test key group range , max parallelism ) ; while ( key 2 = = key 1 ) { key 2 = get key in key group range ( test key group range , max parallelism ) ; } key context set current key ( key 1 ) ; timer service register event time timer ( " ciao " , 10 ) ; timer service register event time timer ( " hello " , 10 ) ; key context set current key ( key 2 ) ; timer service register event time timer ( " ciao " , 10 ) ; timer service register event time timer ( " hello " , 10 ) ; assert equals ( 4 , timer service num event time timers ( ) ) ; assert equals ( 2 , timer service num event time timers ( " hello " ) ) ; assert equals ( 2 , timer service num event time timers ( " ciao " ) ) ; key context set current key ( key 1 ) ; timer service delete event time timer ( " hello " , 10 ) ; key context set current key ( key 2 ) ; timer service delete event time timer ( " ciao " , 10 ) ; assert equals ( 2 , timer service num event time timers ( ) ) ; assert equals ( 1 , timer service num event time timers ( " hello " ) ) ; assert equals ( 1 , timer service num event time timers ( " ciao " ) ) ; timer service advance watermark ( 10 ) ; verify ( mock triggerable , times ( 2 ) ) on event time ( any internal timer ( ) ) ; verify ( mock triggerable , times ( 1 ) ) on event time ( eq ( new timer heap internal timer < > ( 10 , key 1 , " ciao " ) ) ) ; verify ( mock triggerable , times ( 0 ) ) on event time ( eq ( new timer heap internal timer < > ( 10 , key 1 , " hello " ) ) ) ; verify ( mock triggerable , times ( 0 ) ) on event time ( eq ( new timer heap internal timer < > ( 10 , key 2 , " ciao " ) ) ) ; verify ( mock triggerable , times ( 1 ) ) on event time ( eq ( new timer heap internal timer < > ( 10 , key 2 , " hello " ) ) ) ; assert equals ( 0 , timer service num event time timers ( ) ) ; }


finds generic interface implementation based on the source class and the target interface returns null if not found recurses the interface hierarchy

private static type find generic interface ( class < ? > source class , class < ? > target base interface ) { for ( int i = 0 ; i < source class get interfaces ( ) length ; i + + ) { class < ? > inter = source class get interfaces ( ) [ i ] ; if ( inter = = target base interface ) { return source class get generic interfaces ( ) [ i ] ; } else { type deeper = find generic interface ( inter , target base interface ) ; if ( deeper ! = null ) { return deeper ; } } } return null ; }


gets oauth registered service from the context implementation attempts to locate the redirect uri from request and check with service registry to find a matching oauth service

protected o auth registered service get o auth registered service by ( final j e e context context ) { val redirect uri = get registered service identifier from request ( context ) ; var registered service = o auth 2 0 utils get registered o auth service by redirect uri ( get o auth configuration context ( ) get services manager ( ) , redirect uri ) ; if ( registered service = = null ) { val client id = o auth 2 0 utils get client id and client secret ( context ) get left ( ) ; registered service = o auth 2 0 utils get registered o auth service by client id ( get o auth configuration context ( ) get services manager ( ) , client id ) ; } logger debug ( " located registered service [ { } ] " , registered service ) ; return registered service ; }


protected < t extends s a m l object > void prepare security parameters context ( final saml registered service service provider metadata facade adaptor , final message context outbound context , final saml registered service service ) { val sec parameters context = outbound context get subcontext ( security parameters context class , true ) ; val role desc = adaptor get sso descriptor ( ) ; val signing parameters = build signature signing parameters ( role desc , service ) ; objects require non null ( sec parameters context ) set signature signing parameters ( signing parameters ) ; }


this method will remove references to the null address and it will adjust thumb references to no longer be offcut

public final static void fixup references ( objective c 1 state state ) { state monitor set message ( " fixing references " ) ; address set address set = new address set ( ) ; list < string > section names = state get objective c section names ( ) ; for ( string section name : section names ) { if ( state monitor is cancelled ( ) ) { break ; } memory block block = state program get memory ( ) get block ( section name ) ; if ( block ! = null ) { / / not all blocks will exist address set add range ( block get start ( ) , block get end ( ) ) ; } } state monitor initialize ( address set get num addresses ( ) ) ; int progress = 0 ; reference manager reference manager = state program get reference manager ( ) ; address iterator reference iterator = reference manager get reference source iterator ( address set , true ) ; while ( reference iterator has next ( ) ) { if ( state monitor is cancelled ( ) ) { break ; } + + progress ; if ( ( progress % 100 ) = = 0 ) { state monitor set progress ( progress ) ; } address source address = reference iterator next ( ) ; reference [ ] references = reference manager get references from ( source address ) ; for ( reference reference : references ) { if ( state monitor is cancelled ( ) ) { break ; } if ( objective c 1 utilities is null ( reference get to address ( ) ) ) { reference manager delete ( reference ) ; } if ( objective c 1 utilities is thumb ( state program , reference get to address ( ) ) ) { reference manager delete ( reference ) ; reference manager add memory reference ( reference get from address ( ) , reference get to address ( ) subtract ( 1 ) , reference get reference type ( ) , reference get source ( ) , reference get operand index ( ) ) ; } } } }


test to verify access check failure leaves intermediate folders undeleted

public void test delete auth check failure leaves files undeleted ( ) throws throwable { path parent dir = new path ( " / test delete auth check failure leaves files undeleted " ) ; path child path 1 = new path ( parent dir , " child 1 " ) ; path child path 2 = new path ( parent dir , " child 2 " ) ; path test path 1 = new path ( child path 1 , " test dat " ) ; path test path 2 = new path ( child path 2 , " test dat " ) ; authorizer add auth rule for owner ( " / " , write , true ) ; authorizer add auth rule for owner ( " / test delete auth check failure leaves files undeleted * " , write , true ) ; fs update wasb authorizer ( authorizer ) ; try { fs create ( test path 1 ) ; fs create ( test path 2 ) ; contract test utils assert path exists ( fs , " test path 1 was not created " , test path 1 ) ; contract test utils assert path exists ( fs , " test path 2 was not created " , test path 2 ) ; / / revoke write on one of the child folders authorizer delete all auth rules ( ) ; authorizer add auth rule for owner ( " / " , write , true ) ; authorizer add auth rule for owner ( parent dir to string ( ) , write , true ) ; authorizer add auth rule for owner ( child path 2 to string ( ) , write , true ) ; authorizer add auth rule for owner ( child path 1 to string ( ) , write , false ) ; assert false ( fs delete ( parent dir , true ) ) ; / / assert that only child 2 contents are deleted contract test utils assert path exists ( fs , " child 1 is deleted ! " , test path 1 ) ; contract test utils assert path does not exist ( fs , " child 2 exists after deletion ! " , test path 2 ) ; contract test utils assert path does not exist ( fs , " child 2 exists after deletion ! " , child path 2 ) ; contract test utils assert path exists ( fs , " parent dir is deleted ! " , parent dir ) ; } finally { allow recursive delete ( fs , parent dir to string ( ) ) ; fs delete ( parent dir , true ) ; } }


connect failures do not show up as { @ link # channel inactive } or { @ link # exception caught } , so it needs to be watched

public void connect ( channel handler context ctx , socket address remote address , socket address local address , channel promise promise ) throws exception { final class connect listener implements channel future listener { @ override public void operation complete ( channel future future ) { if ( ! future is success ( ) ) { fail writes ( future cause ( ) ) ; } } } super connect ( ctx , remote address , local address , promise ) ; promise add listener ( new connect listener ( ) ) ; }


returns whether the elements of the two given arrays are the same

public static boolean equal ( byte [ ] array 1 , byte [ ] array 2 , int size ) { for ( int index = 0 ; index < size ; index + + ) { if ( array 1 [ index ] ! = array 2 [ index ] ) { return false ; } } return true ; }


sets the vertical alignment of each column of widgets when { @ link # wrap ( ) wrapping } is enabled and sets the horizontal alignment of widgets within each column set to { @ link align # center } , { @ link align # top } , { @ link align # bottom } , { @ link align # left } , { @ link align # right } , or any combination of those

public vertical group column align ( int column align ) { this column align = column align ; return this ; }