when failing over , new active rm should read from current state of store , including any updates when the new active rm was in standby

public void test failover reads from updated store ( ) throws exception { h a service protocol state change request info req = new h a service protocol state change request info ( h a service protocol request source request by user ) ; configuration conf 1 = create r m h a conf ( " rm 1 , rm 2 " , " rm 1 " , 1234 ) ; resource manager rm 1 = new mock r m ( conf 1 ) ; rm 1 start ( ) ; rm 1 get r m context ( ) get r m admin service ( ) transition to active ( req ) ; assert equals ( " rm with z k store didn ' t start " , service state started , rm 1 get service state ( ) ) ; assert equals ( " rm should be active " , h a service protocol h a service state active , rm 1 get r m context ( ) get r m admin service ( ) get service status ( ) get state ( ) ) ; assert null ( ( ( mutable conf scheduler ) rm 1 get resource scheduler ( ) ) get configuration ( ) get ( " key " ) ) ; configuration conf 2 = create r m h a conf ( " rm 1 , rm 2 " , " rm 2 " , 5678 ) ; resource manager rm 2 = new mock r m ( conf 2 ) ; rm 2 start ( ) ; assert equals ( " rm should be standby " , h a service protocol h a service state standby , rm 2 get r m context ( ) get r m admin service ( ) get service status ( ) get state ( ) ) ; / / update configuration on rm1 sched conf update info sched conf update info = new sched conf update info ( ) ; sched conf update info get global params ( ) put ( " key " , " val " ) ; mutable configuration provider conf provider = ( ( mutable conf scheduler ) rm 1 get resource scheduler ( ) ) get mutable conf provider ( ) ; user group information user = user group information create user for testing ( test user , new string [ 0 ] ) ; log mutation log = conf provider log and apply mutation ( user , sched conf update info ) ; rm 1 get resource scheduler ( ) reinitialize ( conf 1 , rm 1 get r m context ( ) ) ; assert equals ( " val " , ( ( mutable conf scheduler ) rm 1 get resource scheduler ( ) ) get configuration ( ) get ( " key " ) ) ; conf provider confirm pending mutation ( log , true ) ; assert equals ( " val " , ( ( mutable c s configuration provider ) conf provider ) get conf store ( ) retrieve ( ) get ( " key " ) ) ; / / next update is not persisted , it should not be recovered sched conf update info get global params ( ) put ( " key " , " bad val " ) ; log = conf provider log and apply mutation ( user , sched conf update info ) ; / / start rm2 and verifies it starts with updated configuration rm 2 get r m context ( ) get r m admin service ( ) transition to active ( req ) ; assert equals ( " rm with z k store didn ' t start " , service state started , rm 2 get service state ( ) ) ; assert equals ( " rm should be active " , h a service protocol h a service state active , rm 2 get r m context ( ) get r m admin service ( ) get service status ( ) get state ( ) ) ; for ( int i = 0 ; i < zk timeout ms / 50 ; i + + ) { if ( h a service protocol h a service state active = = rm 1 get r m context ( ) get r m admin service ( ) get service status ( ) get state ( ) ) { thread sleep ( 100 ) ; } } assert equals ( " rm should have been fenced " , h a service protocol h a service state standby , rm 1 get r m context ( ) get r m admin service ( ) get service status ( ) get state ( ) ) ; assert equals ( " rm should be active " , h a service protocol h a service state active , rm 2 get r m context ( ) get r m admin service ( ) get service status ( ) get state ( ) ) ; assert equals ( " val " , ( ( mutable c s configuration provider ) ( ( capacity scheduler ) rm 2 get resource scheduler ( ) ) get mutable conf provider ( ) ) get conf store ( ) retrieve ( ) get ( " key " ) ) ; assert equals ( " val " , ( ( mutable conf scheduler ) rm 2 get resource scheduler ( ) ) get configuration ( ) get ( " key " ) ) ; / / transition to standby will set rm ' s ha status and then reinitialize in / / a separate thread despite asserting for standby state , it ' s / / possible for reinitialization to be unfinished wait here for it to / / finish , otherwise closing rm 1 will close zk manager and the unfinished / / reinitialization will throw an exception thread sleep ( 10000 ) ; rm 1 close ( ) ; rm 2 close ( ) ; }


if { @ link # flag override caption descriptors } is set , returns a { @ link user data reader } for { @ link # closed caption formats } if unset , parses the pmt descriptor information and returns a { @ link user data reader } for the declared formats , or { @ link # closed caption formats } if the descriptor is not present

private user data reader build user data reader ( es info es info ) { return new user data reader ( get closed caption formats ( es info ) ) ; }


map the given response to a { @ code response entity < list < t > > }

public static < t > mono < response entity < list < t > > > map to entity list ( client response response , publisher < t > body ) { return flux from ( body ) collect list ( ) map ( list - > new response entity < > ( list , response headers ( ) as http headers ( ) , response raw status code ( ) ) ) ; }


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


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


sets the tags associated with this model this causes a reload of the function table

public void set selected tags ( set < function tag > tags ) { this tags = tags ; reload ( ) ; }


public boolean is compatible ( dalv insn insn ) { return true ; }


removes all of the elements from this set , and resets the set capacity based on the provided expected number of elements

final public void clear ( int expected num elements ) { if ( expected num elements = = 0 ) { / / optimize away object allocations for empty sets this head = head element empty ; this elements = empty elements ; this size = 0 ; } else { this head = new head element ( ) ; this elements = new element [ calculate capacity ( expected num elements ) ] ; this size = 0 ; } }


option to control tagging data types and functions with their source code location ( ie filename : line number ) if the information is present in the dwarf record

public void set output source location info ( boolean output dwarf location info ) { this output d w a r f location info = output dwarf location info ; }


takes a string with keys and values separated by ' = ' and each key value pair separated by ' , ' for example max block ms = 5000 , retries = 6 , request timeout ms = 6000

private static map < string , string > updated configs ( final string formatted configs ) { final string [ ] parts = formatted configs split ( " , " ) ; final map < string , string > updated configs = new hash map < > ( ) ; for ( final string part : parts ) { final string [ ] key value = part split ( " = " ) ; updated configs put ( key value [ key ] , key value [ value ] ) ; } return updated configs ; }


get the write permission for the specified segment

public boolean is segment writable ( elf program header segment ) { return ( segment get flags ( ) & elf program header constants pf w ) ! = 0 ; }


returns the line number of this location


gets the { @ link extension point } priority

public static int get priority ( class < ? > c ) { extension point properties properties = c get annotation ( extension point properties class ) ; return properties ! = null ? properties priority ( ) : extension point properties default priority ; }


convenience method allowing lookup of the only instance of a given type equivalent to { @ code extension list lookup ( class ) get ( class ) } if there is one instance , and throws an { @ code illegal state exception } otherwise

public static @ non null < u > u lookup singleton ( class < u > type ) { extension list < u > all = lookup ( type ) ; if ( all size ( ) ! = 1 ) { throw new illegal state exception ( " expected 1 instance of " + type get name ( ) + " but got " + all size ( ) ) ; } return all get ( 0 ) ; }


retrieves , but does not remove , the greatest element of this queue , or returns { @ code null } if the queue is empty

public e peek last ( ) { return is empty ( ) ? null : element data ( get max element index ( ) ) ; }


refresh the cache with information from the state store called periodically by the cache update service to maintain data caches and versions

public void refresh caches ( boolean force ) { boolean success = true ; if ( is driver ready ( ) ) { list < state store cache > caches to update = new linked list < > ( ) ; caches to update add all ( caches to update internal ) ; caches to update add all ( caches to update external ) ; for ( state store cache cached store : caches to update ) { string cache name = cached store get class ( ) get simple name ( ) ; boolean result = false ; try { result = cached store load cache ( force ) ; } catch ( i o exception e ) { log error ( " error updating cache for { } " , cache name , e ) ; result = false ; } if ( ! result ) { success = false ; log error ( " cache update failed for cache { } " , cache name ) ; } } } else { success = false ; log info ( " skipping state store cache update , driver is not ready " ) ; } if ( success ) { / / uses local time , not driver time this cache last update time = time now ( ) ; } }


return the spring configuration that contains application beans including the ones detected by { @ link web http handler builder # application context }

protected application context create application context ( ) { annotation config application context context = new annotation config application context ( ) ; class < ? > [ ] config classes = get config classes ( ) ; assert not empty ( config classes , " no spring configuration provided through get config classes ( ) " ) ; context register ( config classes ) ; return context ; }


test if mock policy works fine : fail - mock

public void test mock invoker from override invoke fock default ( ) { url url = url value of ( " remote : / / 1 2 3 4 / " + i hello service class get name ( ) ) add parameter ( " mock " , " fail : return x " ) add parameter ( refer key , url encode ( path key + " = " + i hello service class get name ( ) ) ) add parameter ( " invoke return error " , " true " ) ; invoker < i hello service > cluster = get cluster invoker ( url ) ; / / configured with mock rpc invocation invocation = new rpc invocation ( ) ; invocation set method name ( " get something " ) ; result ret = cluster invoke ( invocation ) ; assertions assert equals ( " x " , ret get value ( ) ) ; / / if no mock was configured , return null directly invocation = new rpc invocation ( ) ; invocation set method name ( " get something 2 " ) ; ret = cluster invoke ( invocation ) ; assertions assert equals ( " x " , ret get value ( ) ) ; / / if no mock was configured , return null directly invocation = new rpc invocation ( ) ; invocation set method name ( " say hello " ) ; ret = cluster invoke ( invocation ) ; assertions assert equals ( " x " , ret get value ( ) ) ; }


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


compute the soname to use for a dynamic library this name is basically the name of the shared library in its final symlinked location

public static string get dynamic library soname ( path fragment library path , boolean preserve name ) { string mangled name ; if ( preserve name ) { mangled name = library path get base name ( ) ; } else { mangled name = " lib " + actions escaped path ( library path get path string ( ) ) ; } return mangled name ; }


returns the transformer class that contains all matrices and is responsible for transforming values into pixels on the screen and backwards

public transformer get transformer ( axis dependency which ) { if ( which = = axis dependency left ) return m left axis transformer ; else return m right axis transformer ; }


names of resources that have been deleted and to be removed from the mcp sink node removed resources for missing resources can be ignored when ` incremental ` is true , this contains an array of resource names to remove for the specified collection this modifies the existing resource collection at the sink when ` incremental ` is false , this field should be ignored < code > repeated string removed resources = 4 ; < code >

public builder add all removed resources ( java lang iterable < java lang string > values ) { ensure removed resources is mutable ( ) ; com google protobuf abstract message lite builder add all ( values , removed resources ) ; on changed ( ) ; return this ; }


test the property ' object with no declared props nullable '

public void object with no declared props nullable test ( ) { / / todo : test object with no declared props nullable }


ensure that the long value is in the range of an integer

public static int ensure output parameter in range ( string name , long size ) { if ( size > integer max value ) { log warn ( " s 3a : { } capped to ~ 2 14gb " + " ( maximum allowed size with current output mechanism ) " , name ) ; return integer max value ; } else { return ( int ) size ; } }


protected void erase data from block ( test block the block ) { erase data from chunks ( the block chunks ) ; the block set erased ( true ) ; }


method for testing rolling upgrade do not call this method from production

static void set current layout version for testing ( int lv ) { current layout version = lv ; }


called whenever the composite ' s component data changes

protected void component data changed ( ) { notify ( model listeners , composite viewer model listener : : component data changed ) ; }


the { @ link http async response consumer factory } used to create one { @ link http async response consumer } callback per retry controls how the response body gets streamed from a non - blocking http connection on the client side

public http async response consumer factory get http async response consumer factory ( ) { return http async response consumer factory ; }


called when the component is attached to the { @ link component tree }

protected void on attached ( component context c ) { }


public float get ratio ( ) { return jni get ratio ( addr ) ; }


adds a range to a object assumes that the range has already been cleared < p >

private void add range ( object obj , long start , long end ) { try { long next ; if ( obj markers has property ( start ) ) { next = start ; } else { next = obj markers get next property index ( start ) ; } while ( start < = end ) { / / find the thing at or after mark mark = get mark ( next ) ; if ( mark type = = mark end ) { mark end ( start - 1 , mark obj ) ; mark start ( start , mark obj ) ; next = start ; } else if ( start = = next ) { if ( mark type = = mark single ) { mark add ( obj ) ; start = start + 1 ; } else { / / type = = mark start next = obj markers get next property index ( next ) ; start = do split ( obj , start , next , end ) + 1 ; } next = obj markers get next property index ( next ) ; } else if ( start < next & & next < = end ) { / / add in start to next - 1 mark range ( start , next - 1 , obj ) ; start = next ; } else if ( next > end ) { break ; } } } catch ( no such index exception e ) { } if ( start < = end ) { mark range ( start , end , obj ) ; } }


method is synchronized to make the handler removal from the double linked list atomic

private synchronized void atomic remove from handler list ( abstract channel handler context ctx ) { abstract channel handler context prev = ctx prev ; abstract channel handler context next = ctx next ; prev next = next ; next prev = prev ; }


called when the end of a media source is reached during playback

public abstract void on completion ( music music ) ;


run an immediate heartbeat from all actors used by tests

void trigger heartbeat for tests ( ) throws i o exception { for ( b p service actor actor : bp services ) { actor trigger heartbeat for tests ( ) ; } }


this forces page to be redisplayed when location has not changed

private void reload page ( url help u r l ) { if ( ! ( main h b instanceof g help broker ) ) { / / not our broker installed ; can ' t force a reload return ; } ( ( g help broker ) main h b ) reload help page ( validate url ( help u r l ) ) ; }


marshals the object graph with the given root into the provided { @ code javax xml transform result } this implementation inspects the given result , and calls { @ code marshal dom result } , { @ code marshal sax result } , or { @ code marshal stream result }

public final void marshal ( object graph , result result ) throws i o exception , xml mapping exception { if ( result instanceof d o m result ) { marshal dom result ( graph , ( d o m result ) result ) ; } else if ( stax utils is stax result ( result ) ) { marshal stax result ( graph , result ) ; } else if ( result instanceof s a x result ) { marshal sax result ( graph , ( s a x result ) result ) ; } else if ( result instanceof stream result ) { marshal stream result ( graph , ( stream result ) result ) ; } else { throw new illegal argument exception ( " unknown result type : " + result get class ( ) ) ; } }


this function returns a md 5 hash of a file

public static string get file m d 5 ( file file ) throws i o exception { return m d 5 file utils compute md 5 for file ( file ) to string ( ) ; }


return the { @ link property sources } for this { @ code environment } in mutable form , allowing for manipulation of the set of { @ link property source } objects that should be searched when resolving properties against this { @ code environment } object the various { @ link mutable property sources } methods such as { @ link mutable property sources # add first add first } , { @ link mutable property sources # add last add last } , { @ link mutable property sources # add before add before } and { @ link mutable property sources # add after add after } allow for fine - grained control over property source ordering this is useful , for example , in ensuring that certain user - defined property sources have search precedence over default property sources such as the set of system properties or the set of system environment variables

mutable property sources get property sources ( ) ;


returns an { @ code unsigned long } corresponding to a given bit representation the argument is interpreted as an unsigned 64 - bit value specifically , the sign bit of { @ code bits } is interpreted as a normal bit , and all other bits are treated as usual if the argument is nonnegative , the returned result will be equal to { @ code bits } , otherwise , the result will be equal to { @ code 2 ^ 64 + bits } to represent decimal constants less than { @ code 2 ^ 63 } , consider { @ link # value of ( long ) } instead

public static unsigned long from long bits ( long bits ) { / / todo ( lowasser ) : consider caching small values , like long value of return new unsigned long ( bits ) ; }


simulates a user initiated keystroke using the keybinding of the given action

public static void trigger action key ( component destination , docking action if action ) { objects require non null ( destination ) ; key stroke key stroke = action get key binding ( ) ; if ( key stroke = = null ) { throw new illegal argument exception ( " no key stroke assigned for the given action " ) ; } int modifiers = key stroke get modifiers ( ) ; int key code = key stroke get key code ( ) ; char key char = key stroke get key char ( ) ; boolean is defined = character is defined ( key char ) ; if ( ! is defined ) { key char = key event vk undefined ; } trigger key ( destination , modifiers , key code , key char ) ; }


checks whether reduce does behave as expected if both values are the same object

public void test min by comparison multiple ( ) { select by min function < tuple 5 < integer , long , string , long , integer > > min by tuple = new select by min function < tuple 5 < integer , long , string , long , integer > > ( tuple type info , new int [ ] { 0 , 1 , 2 , 3 , 4 } ) ; try { assert assert same ( " select by min must return smaller tuple " , smaller , min by tuple reduce ( smaller , bigger ) ) ; assert assert same ( " select by min must return smaller tuple " , smaller , min by tuple reduce ( bigger , smaller ) ) ; } catch ( exception e ) { assert fail ( " no exception should be thrown while comparing both tuples " ) ; } }


this method is deprecated and will be removed in the future releases handle async db operation in your own logic instead

public < t > find executor < t > sum async ( final string table name , final string column name , final class < t > column type ) { final find executor < t > executor = new find executor < > ( ) ; runnable runnable = new runnable ( ) { @ override public void run ( ) { synchronized ( lite pal support class ) { final t t = sum ( table name , column name , column type ) ; if ( executor get listener ( ) ! = null ) { operator get handler ( ) post ( new runnable ( ) { @ override public void run ( ) { executor get listener ( ) on finish ( t ) ; } } ) ; } } } } ; executor submit ( runnable ) ; return executor ; }


converts this descriptor into a set of properties

public map < string , string > to properties ( ) { final descriptor properties properties = new descriptor properties ( ) ; properties put properties ( internal properties ) ; return properties as map ( ) ; }


public final string get long description ( ) { byte array output stream out = new byte array output stream ( ) ; print stream ps = new print stream ( out ) ; print usage summary ( ps ) ; ps close ( ) ; return out to string ( ) ; }


get the maximum number of elements that will fit this means the undefined bytes available up to the next instruction or end of defined memory

private int get max elements ignore existing ( program program , address addr , int element size ) { / / can ' t go past the end of a block to start with address set view asv = program get memory ( ) ; address range range = asv get range containing ( addr ) ; if ( range = = null ) { return 0 ; } address max address = range get max address ( ) ; instruction instruction after = program get listing ( ) get instruction after ( addr ) ; if ( instruction after ! = null & & max address compare to ( instruction after get address ( ) ) > 0 ) { max address = instruction after get address ( ) previous ( ) ; } int length = ( int ) max address subtract ( addr ) + 1 ; if ( length < 0 ) { return 0 ; } return ( length / element size ) ; }


returns a new supplier which is the composition of the provided function and supplier in other words , the new supplier ' s value will be computed by retrieving the value from { @ code supplier } , and then applying { @ code function } to that value note that the resulting supplier will not call { @ code supplier } or invoke { @ code function } until it is called

public static < f , t > supplier < t > compose ( function < ? super f , t > function , supplier < f > supplier ) { return new supplier composition < > ( function , supplier ) ; }


reports whether int x exactly equals float y

static boolean int equals float ( starlark int x , starlark float y ) { double yf = y to double ( ) ; return ! double is na n ( yf ) & & compare int and double ( x , yf ) = = 0 ; }


if the length of the content is unknown , { @ link http content encoder } should not skip encoding the content even if the actual length is turned out to be 0

public void test empty split content ( ) throws exception { embedded channel ch = new embedded channel ( new http content compressor ( ) ) ; ch write inbound ( new request ( ) ) ; ch write outbound ( new default http response ( http version http 1 1 , http response status ok ) ) ; assert encoded response ( ch ) ; ch write outbound ( last http content empty last content ) ; http content chunk = ch read outbound ( ) ; assert that ( byte buf util hex dump ( chunk content ( ) ) , is ( " 1f 8b 0 8 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 " ) ) ; assert that ( chunk , is ( instance of ( http content class ) ) ) ; chunk release ( ) ; chunk = ch read outbound ( ) ; assert that ( chunk content ( ) is readable ( ) , is ( false ) ) ; assert that ( chunk , is ( instance of ( last http content class ) ) ) ; chunk release ( ) ; assert that ( ch read outbound ( ) , is ( null value ( ) ) ) ; }


example for testing blocking server - streaming

public void list features error ( ) { final feature response feature 1 = feature new builder ( ) set name ( " feature 1 " ) build ( ) ; final atomic reference < rectangle > rectangle delivered = new atomic reference < rectangle > ( ) ; final status runtime exception fake error = new status runtime exception ( status invalid argument ) ; / / implement the fake service route guide impl base list features impl = new route guide impl base ( ) { @ override public void list features ( rectangle rectangle , stream observer < feature > response observer ) { rectangle delivered set ( rectangle ) ; / / send one response message response observer on next ( response feature 1 ) ; / / let the rpc fail response observer on error ( fake error ) ; } } ; service registry add service ( list features impl ) ; client list features ( 1 , 2 , 3 , 4 ) ; assert equals ( rectangle new builder ( ) set lo ( point new builder ( ) set latitude ( 1 ) set longitude ( 2 ) build ( ) ) set hi ( point new builder ( ) set latitude ( 3 ) set longitude ( 4 ) build ( ) ) build ( ) , rectangle delivered get ( ) ) ; argument captor < throwable > error captor = argument captor for class ( throwable class ) ; verify ( test helper ) on message ( response feature 1 ) ; verify ( test helper ) on rpc error ( error captor capture ( ) ) ; assert equals ( fake error get status ( ) , status from throwable ( error captor get value ( ) ) ) ; }


prepare the compressor to be used in a new stream with settings defined in the given configuration it will reset the compressor ' s compression level and compression strategy

public void reinit ( configuration conf ) { reset ( ) ; if ( conf = = null ) { return ; } end ( stream ) ; level = zlib factory get compression level ( conf ) ; strategy = zlib factory get compression strategy ( conf ) ; stream = init ( level compression level ( ) , strategy compression strategy ( ) , window bits window bits ( ) ) ; if ( log is debug enabled ( ) ) { log debug ( " reinit compressor with new compression configuration " ) ; } }


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


returns the list of resource references currently registered under the cache entry if the list is empty , it returns an empty collection the returned collection is unmodifiable and a snapshot of the information at the time of the query the state may change after this query returns the caller should handle the situation that some or all of these resource references are no longer relevant

public collection < shared cache resource reference > get resource references ( string key ) { string interned = intern ( key ) ; synchronized ( interned ) { shared cache resource resource = cached resources get ( interned ) ; if ( resource = = null ) { return collections empty set ( ) ; } set < shared cache resource reference > refs = new hash set < shared cache resource reference > ( resource get resource references ( ) ) ; return collections unmodifiable set ( refs ) ; } }


overridden to support the { @ link # set target bean name " target bean name " } feature

public object get target object ( ) { object target object = super get target object ( ) ; if ( target object = = null & & this target bean name ! = null ) { assert state ( this bean factory ! = null , " bean factory must be set when using ' target bean name ' " ) ; target object = this bean factory get bean ( this target bean name ) ; } return target object ; }


returns the name of the wchar charset in use for pdb processing

public string get wide char charset name ( ) { return two byte charset name ; }


sets the indicator style of this m t config object

public void set indicator style ( final indicator styles indicator style ) { this indicator style = indicator style ; }


get the cache use specified name and { @ link key generator } create cache if not existed yet

public static reference config cache get cache ( string name ) { return get cache ( name , default key generator ) ; }


public string get test rule class ( ) { return test rule class ; }


sets the callback that signals when this path highlighter should not be performing any work

public void set work pauser ( path highlighter work pauser pauser ) { if ( pauser ! = null ) { this work pauser = pauser ; } }


public boolean exists ( get index request request , request options options ) throws i o exception { return rest high level client perform request ( request , indices request converters : : indices exist , options , rest high level client : : convert exists response , collections empty set ( ) ) ; }


public static string hex decode ( final string data ) { if ( string utils is not blank ( data ) ) { return hex decode ( data to char array ( ) ) ; } return null ; }


returned value is guaranteed to be unique between operators within the same job and to be stable and the same across job submissions this operation is currently only supported in streaming ( data stream ) contexts

public string get operator unique i d ( ) { return operator unique i d ; }


gets the most up - to - date data point value

public float get latest ( time scale time scale ) { return pick ( time scale ) get latest ( ) ; }


specifies the expected number of nodes in the graph

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


this method should be invoked to notify the policy about responses being received this is useful for stateful policies that make decisions based on previous responses being received

void notify of response ( sub cluster id sub cluster id , allocate response response ) throws yarn exception ;


returns record associated with this bookmark or null if bookmark has been deleted

d b record get record ( ) { return check is valid ( ) ? record : null ; }


public get basic status response get basic status ( request options options ) throws i o exception { return rest high level client perform request and parse entity ( validatable empty , request - > license request converters get license basic status ( ) , options , get basic status response : : from x content , empty set ( ) ) ; }


clears the currently set job in case the currently set job has been scheduled but not started yet , the job won ' t be executed

public void clear job ( ) { encoded image old encoded image ; synchronized ( this ) { old encoded image = m encoded image ; m encoded image = null ; m status = 0 ; } encoded image close safely ( old encoded image ) ; }


try to match a sign - less numeric literal , or a program label

protected collection < assembly parse numeric token > match ( int s , string buffer , assembly grammar grammar , map < string , long > labels ) { if ( s > = buffer length ( ) ) { return collections empty set ( ) ; } / / try a literal number first if ( character is digit ( buffer char at ( s ) ) ) { return match literal ( s , buffer , s , false , grammar ) ; } / / now , try a label int b = s ; while ( b < buffer length ( ) ) { char c = buffer char at ( b ) ; if ( character is java identifier part ( c ) ) { b + + ; continue ; } break ; } string lab = buffer substring ( s , b ) ; long val = labels get ( lab ) ; if ( val = = null ) { return collections empty set ( ) ; } return collections singleton ( new assembly parse numeric token ( grammar , this , lab , val ) ) ; }


generate the hash smash for a superior full hashinferior id

public static long generate inferior full hash smash ( function record superior function , function record inferior function ) { long hash value = inferior function get key ( ) * f n v 1a 6 4 message digest fnv 64 prime ; / / improve bit diversity on key return hash value ^ superior function get full hash ( ) ; }


whether to match to u r ls irrespective of the presence of a trailing slash if enabled a method mapped to " users " also matches to " users " the default value is { @ code true }

public path match configurer set use trailing slash match ( boolean trailing slash match ) { this trailing slash match = trailing slash match ; return this ; }


encodes the given string content as an aztec symbol ( without eci code )

public static aztec code encode ( string data , int min e c c percent , int user specified layers ) { return encode ( data get bytes ( standard charsets iso 8859 1 ) , min e c c percent , user specified layers , null ) ; }


sets the busy state of all glass panes created in the vm

public static void set all glass panes busy ( boolean is busy ) { for ( g glass pane glass pane : system glass panes ) { glass pane set busy ( is busy ) ; } }


returns a read - only buffer that shares its content with this buffer the returned buffer is guaranteed to be a new instance , even if this buffer is read - only itself the new buffer ' s position , limit , capacity and mark are the same as this buffer ' s the new buffer shares its content with this buffer , which means that this buffer ' s change of content will be visible to the new buffer the two buffer ' s position , limit and mark are independent

public abstract double buffer as read only buffer ( ) ;


this appender does not ignore throwables

public boolean ignores throwable ( ) { return false ; }


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


resolves all type variables in { @ code type } and all downstream types and returns a corresponding type with type variables resolved

public type resolve type ( type type ) { check not null ( type ) ; if ( type instanceof type variable ) { return type table resolve ( ( type variable < ? > ) type ) ; } else if ( type instanceof parameterized type ) { return resolve parameterized type ( ( parameterized type ) type ) ; } else if ( type instanceof generic array type ) { return resolve generic array type ( ( generic array type ) type ) ; } else if ( type instanceof wildcard type ) { return resolve wildcard type ( ( wildcard type ) type ) ; } else { / / if class < ? > , no resolution needed , we are done return type ; } }


public static map < string , enrich policy > get policies ( cluster state state ) { final map < string , enrich policy > policies ; final enrich metadata enrich metadata = state metadata ( ) custom ( enrich metadata type ) ; if ( enrich metadata ! = null ) { / / make a copy , because policies map inside custom metadata is read only : policies = new hash map < > ( enrich metadata get policies ( ) ) ; } else { policies = new hash map < > ( ) ; } return policies ; }


returns the trusted channel resolver configured for use with data transfer protocol , or null if not configured

public trusted channel resolver get trusted channel resolver ( ) { return trusted channel resolver ; }


public offset date time get date time ( ) { return date time ; }


adds a given exception to the exceptions attribute

public void add exception ( int exception index ) { int exception index table length = target exceptions attribute u 2exception index table length ; int [ ] exception index table = target exceptions attribute u 2exception index table ; / / make sure there is enough space for the new exception if ( exception index table length < = exception index table length ) { target exceptions attribute u 2exception index table = new int [ exception index table length + 1 ] ; system arraycopy ( exception index table , 0 , target exceptions attribute u 2exception index table , 0 , exception index table length ) ; exception index table = target exceptions attribute u 2exception index table ; } / / add the exception exception index table [ target exceptions attribute u 2exception index table length + + ] = exception index ; }


public byte first ( ) { if ( size = = 0 ) throw new illegal state exception ( " array is empty " ) ; return items [ 0 ] ; }


gets the number of paths that have watches set on them

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


sets the content of this gif image view to the specified uri if uri destination is not a gif then { @ link android widget image view # set image u r i ( android net uri ) } is called as fallback for supported uri schemes see : { @ link android content content resolver # open asset file descriptor ( android net uri , string ) }

public void set image u r i ( uri uri ) { if ( ! gif view utils set gif image uri ( this , uri ) ) { super set image u r i ( uri ) ; } }


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


obtains the log file the default implementation get this from { @ link # worker thread } , so when it ' s complete , the log could be gone any time derived classes that persist the text should override this method so that it fetches the file from disk

public annotated large text obtain log ( ) { weak reference < annotated large text > l = log ; if ( l = = null ) return null ; return l get ( ) ; }


returns the canonical string representation of this entry , defined as follows if the count for this entry is one , this is simply the string representation of the corresponding element otherwise , it is the string representation of the element , followed by the three characters { @ code " x " } ( space , letter x , space ) , followed by the count


get the " size " of the constant pool this corresponds to the class file field { @ code constant pool count } , and is in fact always at least one more than the actual size of the constant pool , as element { @ code 0 } is always invalid


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

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


empties out the ring buffer , discarding all the bytes written to it , i e any following read calls don ' t return any bytes

void clear ( ) { head = position = tail = 0 ; }


calculates diff between two immutable open maps of non - diffable objects

public static < k , t > map diff < k , t , immutable open map < k , t > > diff ( immutable open map < k , t > before , immutable open map < k , t > after , key serializer < k > key serializer , value serializer < k , t > value serializer ) { assert after ! = null & & before ! = null ; return new immutable open map diff < > ( before , after , key serializer , value serializer ) ; }


add resolvers to support custom controller method argument types this does not override the built - in support for resolving handler method arguments to customize the built - in support for argument resolution , configure { @ link request mapping handler adapter } directly

default void add argument resolvers ( list < handler method argument resolver > resolvers ) { }


equivalent to { @ link # expect missing keys ( object [ ] ) expect missing keys } { @ code ( null ) } except that the call to { @ code contains ( null ) } is permitted to throw a { @ code null pointer exception }

protected void expect null key missing when null keys unsupported ( string message ) { try { assert false ( message , get map ( ) contains key ( null ) ) ; } catch ( null pointer exception tolerated ) { / / tolerated } }


read from minimum source d ns required for reconstruction in the iteration first try the success list which we think they are the best d ns if source dn is corrupt or slow , try to read some other source dn , and will update the success list remember the updated success list and return it for following operations and next iteration read

void read minimum sources ( int reconstruct length ) throws i o exception { corrupted blocks corrupted blocks = new corrupted blocks ( ) ; try { success list = do read minimum sources ( reconstruct length , corrupted blocks ) ; } finally { / / report corrupted blocks to nn datanode report corrupted blocks ( corrupted blocks ) ; } }


verify that the read at a specific offset in a stream matches that expected

public static void verify read ( f s data input stream stm , byte [ ] file contents , int seek off , int to read ) throws i o exception { byte [ ] out = new byte [ to read ] ; stm seek ( seek off ) ; stm read fully ( out ) ; byte [ ] expected = arrays copy of range ( file contents , seek off , seek off + to read ) ; compare byte arrays ( expected , out , to read ) ; }


returns a color according to specific conditions : if material theme is enabled , returns the mt color otherwise if laf is dark returns the dark color otherwise if laf is light returns the light color

public static color get color ( final color mt color , @ not null final color dark color , @ not null final color light color ) { final color default color = u i util is under darcula ( ) ? dark color : light color ; return object utils not null ( mt color , default color ) ; }


public void reset size ( ) { if ( get measured width ( ) = = 0 & & get measured height ( ) = = 0 ) { return ; } measure ( measure spec make measure spec ( 0 , measure spec exactly ) , measure spec make measure spec ( 0 , measure spec exactly ) ) ; layout ( 0 , 0 , 0 , 0 ) ; }


adds the specified mesh part to the current node the mesh will be managed by the model and disposed when the model is disposed the resources the material might contain are not managed , use { @ link # manage ( disposable ) } to add those to the model

public void part ( final mesh part meshpart , final material material ) { if ( node = = null ) node ( ) ; node parts add ( new node part ( meshpart , material ) ) ; }


json schema specifies type : ' null ' ' null ' type is supported in open a p i specification 3 1 and above it is not supported in open a p i 3 0 x note : the validator invokes check null type ( ) for every top - level schema in the oas document the method is not called for nested schemas that are defined inline

private static validation rule result check null type ( schema wrapper schema wrapper ) { schema schema = schema wrapper get schema ( ) ; validation rule result result = validation rule pass empty ( ) ; if ( schema wrapper get open a p i ( ) ! = null ) { sem ver version = new sem ver ( schema wrapper get open a p i ( ) get openapi ( ) ) ; if ( version at least ( " 3 0 " ) & & version compare to ( new sem ver ( " 3 1 " ) ) < 0 ) { / / oas spec is 3 0 x if ( model utils is null type ( schema ) ) { result = new validation rule fail ( ) ; string name = schema get name ( ) ; if ( name = = null ) { name = schema get title ( ) ; } result set details ( string format ( locale root , " schema ' % s ' uses a ' null ' type , which is specified in oas 3 1 and above , but oas document is version % s " , name , schema wrapper get open a p i ( ) get openapi ( ) ) ) ; return result ; } } } return result ; }


submits the task and adds a listener that adds the future to { @ code queue } when it completes

private static < t > listenable future < t > submit and add queue listener ( listening executor service executor service , callable < t > task , final blocking queue < future < t > > queue ) { final listenable future < t > future = executor service submit ( task ) ; future add listener ( new runnable ( ) { @ override public void run ( ) { queue add ( future ) ; } } , direct executor ( ) ) ; return future ; }


merge byte ranges on each internal block into a set of inclusive { @ link aligned stripe } instances

private static aligned stripe [ ] merge ranges for internal blocks ( erasure coding policy ec policy , vertical range [ ] ranges , located striped block block group , int cell size ) { int data blk num = ec policy get num data units ( ) ; int parity blk num = ec policy get num parity units ( ) ; list < aligned stripe > stripes = new array list < > ( ) ; sorted set < long > stripe points = new tree set < > ( ) ; for ( vertical range r : ranges ) { if ( r ! = null ) { stripe points add ( r offset in block ) ; stripe points add ( r offset in block + r span in block ) ; } } / / add block group last cell offset in stripe points if it is fall in to read / / offset range int last cell idx in b g = ( int ) ( block group get block size ( ) / cell size ) ; int idx in internal blk = last cell idx in b g / ec policy get num data units ( ) ; long last cell end offset = ( idx in internal blk * ( long ) cell size ) + ( block group get block size ( ) % cell size ) ; if ( stripe points first ( ) < last cell end offset & & stripe points last ( ) > last cell end offset ) { stripe points add ( last cell end offset ) ; } long prev = - 1 ; for ( long point : stripe points ) { if ( prev > = 0 ) { stripes add ( new aligned stripe ( prev , point - prev , data blk num + parity blk num ) ) ; } prev = point ; } return stripes to array ( new aligned stripe [ stripes size ( ) ] ) ; }


public int get eh frame table encoding ( ) { return eh frame table encoding ; }


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

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


indicates whether some other object is " equal to " this one the < tt > equals < tt > method for class < code > object < code > implements the most discriminating possible equivalence relation on objects ; that is , for any reference values < code > x < code > and < code > y < code > , this method returns < code > true < code > if and only if < code > x < code > and < code > y < code > refer to the same object ( < code > x = = y < code > has the value < code > true < code > )

public boolean equals ( object obj ) { if ( obj = = null ) { return false ; } if ( obj = = this ) { return true ; } if ( get class ( ) ! = obj get class ( ) ) { return false ; } byte block range r = ( byte block range ) obj ; return block = = r block & & start index equals ( r start index ) & & end index equals ( r end index ) ; }


sets the rewind increment in milliseconds

public session callback builder set rewind increment ms ( int rewind ms ) { this rewind ms = rewind ms ; return this ; }


get the resident set size ( rss ) memory used by all the processes in the process - tree that are older than the passed in age

public long get rss memory size ( int older than age ) { return unavailable ; }


default void bundle built ( ghidra bundle bundle , string summary ) { / / }


returns the minimum should match to apply to the resulting query should that be a boolean query

public string minimum should match ( ) { return minimum should match ; }


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


creates the renderers needed for this combined - renderer in the required order also takes the draw order into consideration

public void create renderers ( ) { m renderers clear ( ) ; combined chart chart = ( combined chart ) m chart get ( ) ; if ( chart = = null ) return ; draw order [ ] orders = chart get draw order ( ) ; for ( draw order order : orders ) { switch ( order ) { case bar : if ( chart get bar data ( ) ! = null ) m renderers add ( new bar chart renderer ( chart , m animator , m view port handler ) ) ; break ; case bubble : if ( chart get bubble data ( ) ! = null ) m renderers add ( new bubble chart renderer ( chart , m animator , m view port handler ) ) ; break ; case line : if ( chart get line data ( ) ! = null ) m renderers add ( new line chart renderer ( chart , m animator , m view port handler ) ) ; break ; case candle : if ( chart get candle data ( ) ! = null ) m renderers add ( new candle stick chart renderer ( chart , m animator , m view port handler ) ) ; break ; case scatter : if ( chart get scatter data ( ) ! = null ) m renderers add ( new scatter chart renderer ( chart , m animator , m view port handler ) ) ; break ; } } }


set the encoding used for reading the script resource the default value for regular resources is " utf - 8 " a { @ code null } value implies the platform default

public void set encoding ( @ nullable string encoding ) { this resource = new encoded resource ( this resource get resource ( ) , encoding ) ; }


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


public test group parameters oper resp spec ( consumer < response spec builder > resp spec customizer ) { resp spec customizer accept ( resp spec ) ; return this ; }


take the bucket key and return it in the format for the index , taking the mapped type into account

object value ( object key , string type ) ;


test the property ' prefix ns wrapped array '

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


public void set object ( object type obj ) { object = obj ; }


public boolean is valid ( final string expected audience , final string expected issuer , final long time drift ) { if ( ! this audience equals ignore case ( expected audience ) ) { logger warn ( " audience [ { } ] is invalid where the expected audience should be [ { } ] " , this audience , expected audience ) ; return false ; } if ( ! this issuer equals ignore case ( expected issuer ) ) { logger warn ( " issuer [ { } ] is invalid since the expected issuer should be [ { } ] " , this issuer , expected issuer ) ; return false ; } val retrieved on time drift = get retrieved on ( ) minus ( time drift , chrono unit millis ) ; if ( get issued on ( ) is before ( retrieved on time drift ) ) { logger warn ( " ticket is issued before the allowed drift issued on [ { } ] while allowed drift is [ { } ] " , this issued on , retrieved on time drift ) ; return false ; } val retrieved on time after drift = get retrieved on ( ) plus ( time drift , chrono unit millis ) ; if ( get issued on ( ) is after ( retrieved on time after drift ) ) { logger warn ( " ticket is issued after the allowed drift issued on [ { } ] while allowed drift is [ { } ] " , get issued on ( ) , retrieved on time after drift ) ; return false ; } if ( get retrieved on ( ) is after ( this not on or after ) ) { logger warn ( " ticket is too late because it ' s retrieved on [ { } ] which is after [ { } ] " , get retrieved on ( ) , this not on or after ) ; return false ; } logger debug ( " ws fed credential is validated for [ { } ] and [ { } ] " , expected audience , expected issuer ) ; return true ; }


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


starts a process that may persist its state

public void start ( executor service executor service , state processor state processor ) throws i o exception { start ( executor service ) ; assert process pipes get persist stream ( ) is present ( ) ; state processor future = executor service submit ( ( ) - > { try ( input stream in = process pipes get persist stream ( ) get ( ) ) { state processor process ( in ) ; if ( process killed = = false ) { logger info ( " [ { } ] state output finished " , job id ) ; } } catch ( i o exception e ) { if ( process killed = = false ) { logger error ( new parameterized message ( " [ { } ] error reading { } state output " , job id , get name ( ) ) , e ) ; } } } ) ; }


returns the distance configured as radius

public double distance ( ) { return distance ; }


determine the number of segments to merge in a given pass assuming more than factor segments , the first pass should attempt to bring the total number of segments - 1 to be divisible by the factor - 1 ( each pass takes x segments and produces 1 ) to minimize the number of merges

private int get pass factor ( int factor , int pass no , int num segments ) { if ( pass no > 1 | | num segments < = factor | | factor = = 1 ) return factor ; int mod = ( num segments - 1 ) % ( factor - 1 ) ; if ( mod = = 0 ) return factor ; return mod + 1 ; }


creates a { @ link leaf bucket collector } that extracts all values from a document and invokes { @ link leaf bucket collector # collect } on the provided < code > next < code > collector for each of them the current value of this source is set on each call and can be accessed by < code > next < code > via the { @ link # copy current ( int ) } and { @ link # compare current ( int ) } methods note that these methods are only valid when invoked from the { @ link leaf bucket collector } created in this source

abstract leaf bucket collector get leaf collector ( leaf reader context context , leaf bucket collector next ) throws i o exception ;


evict and close sockets older than expiry period from the cache

private synchronized void evict expired ( long expiry period ) { while ( multimap size ( ) ! = 0 ) { iterator < entry < key , value > > iter = multimap entries ( ) iterator ( ) ; entry < key , value > entry = iter next ( ) ; / / if oldest socket expired , remove it if ( entry = = null | | time monotonic now ( ) - entry get value ( ) get time ( ) < expiry period ) { break ; } i o utils client cleanup with logger ( log , entry get value ( ) get peer ( ) ) ; iter remove ( ) ; } }


public nodes info request builder set jvm ( boolean jvm ) { add or remove metric ( jvm , nodes info request metric jvm ) ; return this ; }


gets the value at the { @ code block } { @ code internal position - offset base } as a boolean without boundary checks

boolean get boolean unchecked ( unchecked block block , int internal position ) ;


tests safemode get with view f s overload scheme , but without any mount links configured the view f s overload scheme should consider initialized fs as fallback fs automatically

public void test get safemode without mount links configured ( ) throws exception { final d f s admin dfs admin = new d f s admin ( conf ) ; try { redirect stream ( ) ; int ret = tool runner run ( dfs admin , new string [ ] { " - fs " , default f s u r i to string ( ) , " - safemode " , " get " } ) ; assert out msg ( " safe mode is off " , 0 ) ; assert equals ( 0 , ret ) ; } finally { dfs admin close ( ) ; } }


public int get service class ( ) { return service class ; }


set the maximum motor force , usually in n

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


fills the cache with bitmaps for the given dataset

protected void fill ( i line data set set , boolean draw circle hole , boolean draw transparent circle hole ) { int color count = set get circle color count ( ) ; float circle radius = set get circle radius ( ) ; float circle hole radius = set get circle hole radius ( ) ; for ( int i = 0 ; i < color count ; i + + ) { bitmap config conf = bitmap config argb 4444 ; bitmap circle bitmap = bitmap create bitmap ( ( int ) ( circle radius * 2 1 ) , ( int ) ( circle radius * 2 1 ) , conf ) ; canvas canvas = new canvas ( circle bitmap ) ; circle bitmaps [ i ] = circle bitmap ; m render paint set color ( set get circle color ( i ) ) ; if ( draw transparent circle hole ) { / / begin path for circle with hole m circle path buffer reset ( ) ; m circle path buffer add circle ( circle radius , circle radius , circle radius , path direction cw ) ; / / cut hole in path m circle path buffer add circle ( circle radius , circle radius , circle hole radius , path direction ccw ) ; / / fill in - between canvas draw path ( m circle path buffer , m render paint ) ; } else { canvas draw circle ( circle radius , circle radius , circle radius , m render paint ) ; if ( draw circle hole ) { canvas draw circle ( circle radius , circle radius , circle hole radius , m circle paint inner ) ; } } } }


this method makes coordinates of connection flow better

protected static list < graphic info > connection perfectionizer ( default process diagram canvas process diagram canvas , bpmn model bpmn model , base element source element , base element target element , list < graphic info > graphic info list ) { graphic info source graphic info = bpmn model get graphic info ( source element get id ( ) ) ; graphic info target graphic info = bpmn model get graphic info ( target element get id ( ) ) ; default process diagram canvas shape type source shape type = get shape type ( source element ) ; default process diagram canvas shape type target shape type = get shape type ( target element ) ; return process diagram canvas connection perfectionizer ( source shape type , target shape type , source graphic info , target graphic info , graphic info list ) ; }


tests the update global aggregate functionality

public void test job master aggregates values correctly ( ) throws exception { final job master job master = new job master builder ( job graph , rpc service ) with configuration ( configuration ) with high availability services ( ha services ) with heartbeat services ( heartbeat services ) create job master ( ) ; job master start ( ) ; final job master gateway job master gateway = job master get self gateway ( job master gateway class ) ; try { completable future < object > update aggregate future ; aggregate function < integer , integer , integer > aggregate function = create aggregate function ( ) ; closure cleaner clean ( aggregate function , execution config closure cleaner level recursive , true ) ; byte [ ] serialized aggregate function = instantiation util serialize object ( aggregate function ) ; update aggregate future = job master gateway update global aggregate ( " agg 1 " , 1 , serialized aggregate function ) ; assert that ( update aggregate future get ( ) , equal to ( 1 ) ) ; update aggregate future = job master gateway update global aggregate ( " agg 1 " , 2 , serialized aggregate function ) ; assert that ( update aggregate future get ( ) , equal to ( 3 ) ) ; update aggregate future = job master gateway update global aggregate ( " agg 1 " , 3 , serialized aggregate function ) ; assert that ( update aggregate future get ( ) , equal to ( 6 ) ) ; update aggregate future = job master gateway update global aggregate ( " agg 1 " , 4 , serialized aggregate function ) ; assert that ( update aggregate future get ( ) , equal to ( 10 ) ) ; update aggregate future = job master gateway update global aggregate ( " agg 2 " , 10 , serialized aggregate function ) ; assert that ( update aggregate future get ( ) , equal to ( 10 ) ) ; update aggregate future = job master gateway update global aggregate ( " agg 2 " , 23 , serialized aggregate function ) ; assert that ( update aggregate future get ( ) , equal to ( 33 ) ) ; } finally { rpc utils terminate rpc endpoint ( job master , testing timeout ) ; } }


test method ' task counters ' should print message about error or set counters page class for rendering

public void test get task counters ( ) { when ( job check access ( any ( user group information class ) , any ( job a c l class ) ) ) then return ( false ) ; app controller task counters ( ) ; verify ( app controller response ( ) ) set content type ( mime type text ) ; assert equals ( " access denied : user user does not have permission to view job job 01 01 " , app controller get data ( ) ) ; when ( job check access ( any ( user group information class ) , any ( job a c l class ) ) ) then return ( true ) ; app controller get property ( ) remove ( a m params task id ) ; app controller task counters ( ) ; assert equals ( " access denied : user user does not have permission to view job job 01 0 1missing task id " , app controller get data ( ) ) ; app controller get property ( ) put ( a m params task id , task id ) ; app controller task counters ( ) ; assert equals ( counters page class , app controller get clazz ( ) ) ; }


create a scratch file in the given filesystem , with the given path name , consisting of a set of lines the method returns a path instance for the scratch file

void write file ( string file name , string lines ) throws i o exception ;


execute a void operation with the default retry callback invoked when do retry = true , else just once

public void maybe retry ( boolean do retry , string action , string path , boolean idempotent , void operation operation ) throws i o exception { maybe retry ( do retry , action , path , idempotent , retry callback , operation ) ; }


build a string that consists of the names of the classesinterfaces in the given collection basically like { @ code abstract collection to string ( ) } , but stripping the " class " " interface " prefix before every class name

public static string class names to string ( @ nullable collection < class < ? > > classes ) { if ( collection utils is empty ( classes ) ) { return " [ ] " ; } string joiner string joiner = new string joiner ( " , " , " [ " , " ] " ) ; for ( class < ? > clazz : classes ) { string joiner add ( clazz get name ( ) ) ; } return string joiner to string ( ) ; }


sets the interval of the date histogram using calendar units ( ` 1d ` , ` 1w ` , ` 1m ` , etc ) these units are calendar - aware , meaning they respect leap additions , variable days per month , etc this is mutually exclusive with { @ link date histogram values source builder # fixed interval ( date histogram interval ) }

public date histogram values source builder calendar interval ( date histogram interval interval ) { date histogram interval calendar interval ( interval ) ; return this ; }


gets a fast digest for the given path , or { @ code null } if there isn ' t one available the digest should be suitable for detecting changes to the file

public byte [ ] get fast digest ( ) throws i o exception { return file system get fast digest ( this ) ; }


simple test for the case with dependencies

public void dependent tree artifacts ( ) throws exception { special artifact tree 1 = create tree artifact ( " tree 1 " ) ; touching test action action 1 = new touching test action ( tree 1 , " out 1 " , " out 2 " ) ; register action ( action 1 ) ; special artifact tree 2 = create tree artifact ( " tree 2 " ) ; copy tree action action 2 = new copy tree action ( tree 1 , tree 2 ) ; register action ( action 2 ) ; tree artifact value result = build artifact ( tree 2 ) ; assert that ( tree 1 get path ( ) get relative ( " out 1 " ) exists ( ) ) is true ( ) ; assert that ( tree 1 get path ( ) get relative ( " out 2 " ) exists ( ) ) is true ( ) ; verify output tree ( result , tree 2 , " out 1 " , " out 2 " ) ; }


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


test that , if the remote node gets unsynchronized ( eg some edits were missed or the node rebooted ) , the client stops sending edits until the next roll test for hdfs - 3726

public void test stop sending edits when out of sync ( ) throws exception { mockito do throw ( new i o exception ( " injected error " ) ) when ( mock proxy ) journal ( mockito < request info > any ( ) , mockito eq ( 1l ) , mockito eq ( 1l ) , mockito eq ( 1 ) , mockito same ( fake data ) ) ; try { ch send edits ( 1l , 1l , 1 , fake data ) get ( ) ; fail ( " injected joose did not cause send edits ( ) to throw " ) ; } catch ( execution exception ee ) { generic test utils assert exception contains ( " injected " , ee ) ; } mockito verify ( mock proxy ) journal ( mockito < request info > any ( ) , mockito eq ( 1l ) , mockito eq ( 1l ) , mockito eq ( 1 ) , mockito same ( fake data ) ) ; assert true ( ch is out of sync ( ) ) ; try { ch send edits ( 1l , 2l , 1 , fake data ) get ( ) ; fail ( " send edits ( ) should throw until next roll " ) ; } catch ( execution exception ee ) { generic test utils assert exception contains ( " disabled until next roll " , ee get cause ( ) ) ; } / / it should have failed without even sending the edits , since it was not sync mockito verify ( mock proxy , mockito never ( ) ) journal ( mockito < request info > any ( ) , mockito eq ( 1l ) , mockito eq ( 2l ) , mockito eq ( 1 ) , mockito same ( fake data ) ) ; / / it should have sent a heartbeat instead mockito verify ( mock proxy ) heartbeat ( mockito < request info > any ( ) ) ; / / after a roll , sending new edits should not fail ch start log segment ( 3l , name node layout version current layout version ) get ( ) ; assert false ( ch is out of sync ( ) ) ; ch send edits ( 3l , 3l , 1 , fake data ) get ( ) ; }


set the quietness - mode in the quiet - mode , error and informational messages might not be logged

public synchronized void set quiet mode ( boolean quietmode ) { this quietmode = quietmode ; }


registers a { @ link template expansion action } to write the test executable

private artifact create test executable ( rule context rule context ) throws rule error exception { artifact test executable = rule context create output artifact ( ) ; rule context register action ( new template expansion action ( rule context get action owner ( ) , test executable , android instrumentation test stub script , get template substitutions ( rule context ) , / * make executable = * / true ) ) ; return test executable ; }


this is the most hammered method of this class this is the version using unrolled loops normally i never use such ones in java code the unrolling has shown a noticable performance improvement on jre 1 4 2 ( linux i 5 8 6 hot spot client ) of course it depends on the jit compiler of the vm

private boolean main simple sort ( final data data shadow , final int lo , final int hi , final int d ) { final int big n = hi - lo + 1 ; if ( big n < 2 ) { return this first attempt & & ( this work done > this work limit ) ; } int hp = 0 ; while ( incs [ hp ] < big n ) { hp + + ; } final int [ ] fmap = data shadow fmap ; final char [ ] quadrant = data shadow quadrant ; final byte [ ] block = data shadow block ; final int last shadow = this last ; final int last plus 1 = last shadow + 1 ; final boolean first attempt shadow = this first attempt ; final int work limit shadow = this work limit ; int work done shadow = this work done ; / / following block contains unrolled code which could be shortened by / / coding it in additional loops hp : while ( - - hp > = 0 ) { final int h = incs [ hp ] ; final int mj = lo + h - 1 ; for ( int i = lo + h ; i < = hi ; ) { / / copy for ( int k = 3 ; ( i < = hi ) & & ( - - k > = 0 ) ; i + + ) { final int v = fmap [ i ] ; final int vd = v + d ; int j = i ; / / for ( int a ; / / ( j > mj ) & & main gt u ( ( a = fmap [ j - h ] ) + d , vd , / / block , quadrant , last shadow ) ; / / j - = h ) { / / fmap [ j ] = a ; / / } / / / / unrolled version : / / start inline main g t u boolean once runned = false ; int a = 0 ; hammer : while ( true ) { if ( once runned ) { fmap [ j ] = a ; if ( ( j - = h ) < = mj ) { break hammer ; } } else { once runned = true ; } a = fmap [ j - h ] ; int i 1 = a + d ; int i 2 = vd ; / / following could be done in a loop , but / / unrolled it for performance : if ( block [ i 1 + 1 ] = = block [ i 2 + 1 ] ) { if ( block [ i 1 + 2 ] = = block [ i 2 + 2 ] ) { if ( block [ i 1 + 3 ] = = block [ i 2 + 3 ] ) { if ( block [ i 1 + 4 ] = = block [ i 2 + 4 ] ) { if ( block [ i 1 + 5 ] = = block [ i 2 + 5 ] ) { if ( block [ ( i 1 + = 6 ) ] = = block [ ( i 2 + = 6 ) ] ) { int x = last shadow ; x : while ( x > 0 ) { x - = 4 ; if ( block [ i 1 + 1 ] = = block [ i 2 + 1 ] ) { if ( quadrant [ i 1 ] = = quadrant [ i 2 ] ) { if ( block [ i 1 + 2 ] = = block [ i 2 + 2 ] ) { if ( quadrant [ i 1 + 1 ] = = quadrant [ i 2 + 1 ] ) { if ( block [ i 1 + 3 ] = = block [ i 2 + 3 ] ) { if ( quadrant [ i 1 + 2 ] = = quadrant [ i 2 + 2 ] ) { if ( block [ i 1 + 4 ] = = block [ i 2 + 4 ] ) { if ( quadrant [ i 1 + 3 ] = = quadrant [ i 2 + 3 ] ) { if ( ( i 1 + = 4 ) > = last plus 1 ) { i 1 - = last plus 1 ; } if ( ( i 2 + = 4 ) > = last plus 1 ) { i 2 - = last plus 1 ; } work done shadow + + ; continue x ; } else if ( ( quadrant [ i 1 + 3 ] > quadrant [ i 2 + 3 ] ) ) { continue hammer ; } else { break hammer ; } } else if ( ( block [ i 1 + 4 ] & 0xff ) > ( block [ i 2 + 4 ] & 0xff ) ) { continue hammer ; } else { break hammer ; } } else if ( ( quadrant [ i 1 + 2 ] > quadrant [ i 2 + 2 ] ) ) { continue hammer ; } else { break hammer ; } } else if ( ( block [ i 1 + 3 ] & 0xff ) > ( block [ i 2 + 3 ] & 0xff ) ) { continue hammer ; } else { break hammer ; } } else if ( ( quadrant [ i 1 + 1 ] > quadrant [ i 2 + 1 ] ) ) { continue hammer ; } else { break hammer ; } } else if ( ( block [ i 1 + 2 ] & 0xff ) > ( block [ i 2 + 2 ] & 0xff ) ) { continue hammer ; } else { break hammer ; } } else if ( ( quadrant [ i 1 ] > quadrant [ i 2 ] ) ) { continue hammer ; } else { break hammer ; } } else if ( ( block [ i 1 + 1 ] & 0xff ) > ( block [ i 2 + 1 ] & 0xff ) ) { continue hammer ; } else { break hammer ; } } break hammer ; } / / while x > 0 else { if ( ( block [ i 1 ] & 0xff ) > ( block [ i 2 ] & 0xff ) ) { continue hammer ; } else { break hammer ; } } } else if ( ( block [ i 1 + 5 ] & 0xff ) > ( block [ i 2 + 5 ] & 0xff ) ) { continue hammer ; } else { break hammer ; } } else if ( ( block [ i 1 + 4 ] & 0xff ) > ( block [ i 2 + 4 ] & 0xff ) ) { continue hammer ; } else { break hammer ; } } else if ( ( block [ i 1 + 3 ] & 0xff ) > ( block [ i 2 + 3 ] & 0xff ) ) { continue hammer ; } else { break hammer ; } } else if ( ( block [ i 1 + 2 ] & 0xff ) > ( block [ i 2 + 2 ] & 0xff ) ) { continue hammer ; } else { break hammer ; } } else if ( ( block [ i 1 + 1 ] & 0xff ) > ( block [ i 2 + 1 ] & 0xff ) ) { continue hammer ; } else { break hammer ; } } / / hammer / / end inline main g t u fmap [ j ] = v ; } if ( first attempt shadow & & ( i < = hi ) & & ( work done shadow > work limit shadow ) ) { break hp ; } } } this work done = work done shadow ; return first attempt shadow & & ( work done shadow > work limit shadow ) ; }


public static long byte to long ( byte b ) { return int to long ( b & byte mask ) ; }


tests that exception thrown in the on stop method are returned by the termination future

public void test on stop exception propagation ( ) throws exception { failing on stop endpoint rpc endpoint = new failing on stop endpoint ( akka rpc service , " failing on stop endpoint " ) ; rpc endpoint start ( ) ; completable future < void > termination future = rpc endpoint close async ( ) ; try { termination future get ( ) ; } catch ( execution exception e ) { assert true ( e get cause ( ) instanceof failing on stop endpoint on stop exception ) ; } }


should be called by threads running { @ link g tree task } s

void set thread local monitor ( task monitor monitor ) { thread local monitor set ( monitor ) ; }


tests that the underlying stream file is deleted if the close and get handle method fails

public void test cleanup when failing close and get handle ( ) throws i o exception { final file system fs = mock ( file system class ) ; final f s data output stream output stream = mock ( f s data output stream class ) ; final argument captor < path > path captor = argument captor for class ( path class ) ; when ( fs create ( path captor capture ( ) , any ( file system write mode class ) ) ) then return ( output stream ) ; do throw ( new i o exception ( " test i o exception " ) ) when ( output stream ) close ( ) ; checkpoint stream factory checkpoint state output stream stream = new fs checkpoint stream factory fs checkpoint state output stream ( path from local file ( temp dir new folder ( ) ) , fs , 4 , 0 , relative paths ) ; / / this should create the underlying file stream stream write ( new byte [ ] { 1 , 2 , 3 , 4 , 5 } ) ; verify ( fs ) create ( any ( path class ) , any ( file system write mode class ) ) ; try { stream close and get handle ( ) ; fail ( " expected i o exception " ) ; } catch ( i o exception io e ) { / / expected exception } verify ( fs ) delete ( eq ( path captor get value ( ) ) , any boolean ( ) ) ; }


creates an instance of type { @ link # type timeout }

public static exo playback exception create for timeout ( timeout exception cause , @ timeout operation int timeout operation ) { return new exo playback exception ( type timeout , cause , / * custom message = * / null , / * renderer name = * / null , / * renderer index = * / c index unset , / * renderer format = * / null , / * renderer format support = * / renderer capabilities format handled , timeout operation ) ; }


test timer fired event for intermediate timer bpmn event

public void test timer fired for intermediate timer ( ) throws exception { runtime service start process instance by key ( " test timer fired for intermediate timer " ) ; / / force timer to start the process calendar tomorrow = calendar get instance ( ) ; tomorrow add ( calendar day of year , 1 ) ; process engine configuration get clock ( ) set current time ( tomorrow get time ( ) ) ; wait for job executor to process all jobs ( 2000 , 100 ) ; check event count ( 1 , activiti event type timer scheduled ) ; check event count ( 0 , activiti event type job canceled ) ; check event count ( 1 , activiti event type timer fired ) ; }


calls the { @ link # detect handlers ( ) } method in addition to the superclass ' s initialization

public void init application context ( ) throws application context exception { super init application context ( ) ; detect handlers ( ) ; }


public static date begin of month ( @ not null final date date ) { return date utils truncate ( date , calendar month ) ; }


asserts correct reading of standard test data from { @ code sample queue }

private void assert read test data ( format start format , int first sample index , int sample count ) { assert read test data ( start format , first sample index , sample count , / * sample offset us = * / 0 , / * decode only until us = * / 0 ) ; }


figures out how many slice statuses to expect in the response

protected int expected slice statuses ( int request slices , collection < string > indices ) { int slices configured = expected slices ( request slices , indices ) ; if ( slices configured > 1 ) { return slices configured ; } else { return 0 ; } }


assert that a counter has an expected value

public static long verify statistic counter value ( final i o statistics stats , final string key , final long value ) { return verify statistic value ( counter , key , verify statistics not null ( stats ) counters ( ) , value ) ; }


private < t > int fast max ( t [ ] items , comparator < t > comp , int size ) { int highest idx = 0 ; for ( int i = 1 ; i < size ; i + + ) { int comparison = comp compare ( items [ i ] , items [ highest idx ] ) ; if ( comparison > 0 ) { highest idx = i ; } } return highest idx ; }


public float [ ] get vertices ( ) { return vertices ; }


@ test public void null pointers ( ) { list < function < cassandra storage builder < ? > , cassandra storage builder < ? > > > null pointers = as list ( b - > b autocomplete keys ( null ) , b - > b contact points ( null ) , b - > b local dc ( null ) , b - > b keyspace ( null ) ) ; null pointers for each ( customizer - > assert that thrown by ( ( ) - > customizer apply ( builder ) ) is instance of ( null pointer exception class ) ) ; }


sets the operating rate of this renderer , where 1 is the default rate , 2 is twice the default rate , 0 5 is half the default rate and so on the operating rate is a hint to the renderer of the speed at which playback will proceed , and may be used for resource planning the default implementation is a no - op

default void set operating rate ( float operating rate ) throws exo playback exception { }


public void check disk error ( ) throws i o exception { set < fs volume spi > unhealthy volumes ; try { unhealthy volumes = volume checker check all volumes ( data ) ; last disk error check = time monotonic now ( ) ; } catch ( interrupted exception e ) { log error ( " interrupted while running disk check " , e ) ; throw new i o exception ( " interrupted while running disk check " , e ) ; } if ( unhealthy volumes size ( ) > 0 ) { log warn ( " check disk error got { } failed volumes - { } " , unhealthy volumes size ( ) , unhealthy volumes ) ; handle volume failures ( unhealthy volumes ) ; } else { log debug ( " check disk error encountered no failures " ) ; } }


fake endpoint to test group parameters ( optional ) fake endpoint to test group parameters ( optional )

public void test group parameters test ( ) { integer required string group = null ; boolean required boolean group = null ; long required int 6 4 group = null ; integer string group = null ; boolean boolean group = null ; long int 6 4 group = null ; / / api test group parameters ( required string group , required boolean group , required int 6 4 group , string group , boolean group , int 6 4 group ) ; / / todo : test validations }


set one or more customizers to be applied to this evaluator ' s compiler configuration note that this modifies the shared compiler configuration held by this evaluator

public void set compilation customizers ( compilation customizer compilation customizers ) { this compiler configuration add compilation customizers ( compilation customizers ) ; }


inserts the specified number of items at the specified index the new items will have values equal to the values at those indices before the insertion

public void insert range ( int index , int count ) { if ( index > size ) throw new index out of bounds exception ( " index can ' t be > size : " + index + " > " + size ) ; int size needed = size + count ; if ( size needed > items length ) items = resize ( math max ( math max ( 8 , size needed ) , ( int ) ( size * 1 7 5f ) ) ) ; system arraycopy ( items , index , items , index + count , size - index ) ; size = size needed ; }


public static void mark parameter used ( method method , int variable index ) { method optimization info info = method optimization info get method optimization info ( method ) ; if ( info ! = null ) { info set parameter used ( variable index ) ; } }


apply constructors as indicated by a path returned by the context resolution graph please note : the path given will be emptied during processing

protected assembly resolution results apply recursion path ( deque < assembly constructor semantic > path , assembly parse branch branch , assembly production rec , assembly resolved constructor child ) { / * * a constructor may have multiple patterns , so i cannot assume i will get at most one * output at each constructor in the path start ( 1 ) collecting all the results , then ( 2 ) * filter out and report the errors , then ( 3 ) feed successful resolutions into the next * constructor in the path ( or finish ) * / assembly resolution results result = new assembly resolution results ( ) ; assembly resolution results collected = new assembly resolution results ( ) ; set < assembly resolved constructor > into next = new linked hash set < > ( ) ; into next add ( child ) ; while ( ! path is empty ( ) ) { assembly constructor semantic sem = path poll last ( ) ; list < assembly parse tree node > substs = list of ( ( assembly parse tree node ) branch ) ; / / 1 for ( final assembly resolved constructor res : into next ) { list < assembly resolved constructor > sel = list of ( res ) ; collected absorb ( resolve selected children ( rec , substs , sel , list of ( sem ) ) ) ; } into next clear ( ) ; / / 2 for ( assembly resolution res : collected ) { if ( res is error ( ) ) { result add ( res ) ; } else { / / 3 into next add ( ( assembly resolved constructor ) res ) ; } } } result add all ( into next ) ; return result ; }


< code > optional aapt pb attribute attr = 1 ; < code >

private void merge attr ( com android aapt resources attribute value ) { if ( attr ! = null & & attr ! = com android aapt resources attribute get default instance ( ) ) { attr = com android aapt resources attribute new builder ( attr ) merge from ( value ) build partial ( ) ; } else { attr = value ; } bit field 0 | = 0x 0 0 0 0 0 0 0 1 ; }


public void close ( ) throws exception { for ( state < t > state : get states ( ) ) { for ( state transition < t > transition : state get state transitions ( ) ) { iterative condition condition = transition get condition ( ) ; function utils close function ( condition ) ; } } }


get and return the byte size of encoding

private int get current size ( string content ) { try { return content get bytes ( charset for name ( constants encode ) ) length ; } catch ( exception e ) { logger error ( " [ capacity management ] get current size " , e ) ; } return 0 ; }


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

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


serializes the exception containing the failure message sent to the { @ link org apache flink queryablestate network client } in case of protocol related errors

public static byte buf serialize request failure ( final byte buf allocator alloc , final long request id , final throwable cause ) throws i o exception { final byte buf buf = alloc io buffer ( ) ; / / frame length is set at the end buf write int ( 0 ) ; write header ( buf , message type request failure ) ; buf write long ( request id ) ; try ( byte buf output stream bbos = new byte buf output stream ( buf ) ; object output out = new object output stream ( bbos ) ) { out write object ( cause ) ; } / / set frame length int frame length = buf readable bytes ( ) - integer bytes ; buf set int ( 0 , frame length ) ; return buf ; }


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


whether to assume the dexbuilder tool supports local worker mode

public boolean use workers with dexbuilder ( ) { return use workers with dexbuilder ; }


sets all deprecated properties that are not currently set but have a corresponding new property that is set useful for iterating the properties when all deprecated properties for currently set properties need to be present

public void set deprecated properties ( ) { deprecation context deprecations = deprecation context get ( ) ; properties props = get props ( ) ; properties overlay = get overlay ( ) ; for ( map entry < string , deprecated key info > entry : deprecations get deprecated key map ( ) entry set ( ) ) { string dep key = entry get key ( ) ; if ( ! overlay contains ( dep key ) ) { for ( string new key : entry get value ( ) new keys ) { string val = overlay get property ( new key ) ; if ( val ! = null ) { props set property ( dep key , val ) ; overlay set property ( dep key , val ) ; break ; } } } } }


computes the quantile value of the given dataset

public double compute ( double dataset ) { return compute in place ( dataset clone ( ) ) ; }


public acl operation operation ( ) { return data operation ( ) ; }


public integer get prefix ns integer ( ) { return prefix ns integer ; }


prints usage information to standard output

private static void usage ( ) { system out println ( " generates a distance field image from a black and white input image \ n " + " the distance field image contains a solid color and stores the distance \ n " + " in the alpha channel \ n " + " \ n " + " the output file format is inferred from the file name \ n " + " \ n " + " command line arguments : infile outfile [ option ] \ n " + " \ n " + " possible options : \ n " + " - - color rrggbb color of output image ( default : ffffff ) \ n " + " - - downscale n downscale by factor of n ( default : 1 ) \ n " + " - - spread n edge scan distance ( default : 1 ) \ n " ) ; }


use the given { @ link org apache http client redirect strategy } instance

public http client builder using ( redirect strategy redirect strategy ) { this redirect strategy = redirect strategy ; return this ; }


tests the supplied trace against the current request this is used when the backend cannot fully refine a trace query

public boolean test ( list < span > spans ) { / / v 2 returns raw spans in any order , get the root ' s timestamp or the first timestamp long timestamp = 0l ; for ( span span : spans ) { if ( span timestamp as long ( ) = = 0l ) continue ; if ( span parent id ( ) = = null ) { timestamp = span timestamp as long ( ) ; break ; } if ( timestamp = = 0l | | timestamp > span timestamp as long ( ) ) { timestamp = span timestamp as long ( ) ; } } if ( timestamp = = 0l | | timestamp < ( end ts ( ) - lookback ( ) ) * 1000 | | timestamp > end ts ( ) * 1000 ) { return false ; } boolean tested duration = min duration ( ) = = null & & max duration ( ) = = null ; string service name to match = service name ( ) ; string remote service name to match = remote service name ( ) ; string span name to match = span name ( ) ; map < string , string > annotation query remaining = new linked hash map < string , string > ( annotation query ( ) ) ; for ( span span : spans ) { string local service name = span local service name ( ) ; / / service name , when present , constrains other queries if ( service name ( ) = = null | | service name ( ) equals ( local service name ) ) { service name to match = null ; for ( annotation a : span annotations ( ) ) { if ( " " equals ( annotation query remaining get ( a value ( ) ) ) ) { annotation query remaining remove ( a value ( ) ) ; } } for ( map entry < string , string > t : span tags ( ) entry set ( ) ) { string value = annotation query remaining get ( t get key ( ) ) ; if ( value = = null ) continue ; if ( value is empty ( ) | | value equals ( t get value ( ) ) ) { annotation query remaining remove ( t get key ( ) ) ; } } if ( remote service name to match ! = null & & remote service name to match equals ( span remote service name ( ) ) ) { remote service name to match = null ; } if ( span name to match ! = null & & span name to match equals ( span name ( ) ) ) { span name to match = null ; } if ( ! tested duration ) { if ( min duration ( ) ! = null & & max duration ( ) ! = null ) { tested duration = span duration as long ( ) > = min duration ( ) & & span duration as long ( ) < = max duration ( ) ; } else if ( min duration ( ) ! = null ) { tested duration = span duration as long ( ) > = min duration ( ) ; } } } } return ( service name ( ) = = null | | service name to match = = null ) & & remote service name to match = = null & & span name to match = = null & & annotation query remaining is empty ( ) & & tested duration ; }


configure path prefixes to apply to controller methods prefixes are used to enrich the mappings of every { @ code @ request mapping } method whose controller type is matched by a corresponding { @ code predicate } in the map the prefix for the first matching predicate is used , assuming the input map has predictable order consider using { @ link org springframework web method handler type predicate handler type predicate } to group controllers

public void set path prefixes ( map < string , predicate < class < ? > > > prefixes ) { this path prefixes clear ( ) ; prefixes entry set ( ) stream ( ) filter ( entry - > string utils has text ( entry get key ( ) ) ) for each ( entry - > this path prefixes put ( entry get key ( ) , entry get value ( ) ) ) ; }


public static boolean internal user ( ) { return get boolean ( internal user , false ) ; }


verifies repository on the master node and returns the verification token if the verification token is not null , it ' s passed to all data nodes for verification if it ' s null - no additional verification is required


this method saves the mount links in a local files

void add mount links ( string mount table , string [ ] sources , string [ ] targets , configuration conf ) throws i o exception , u r i syntax exception { / / we don ' t use conf here , instead we use config paths to store links / / mount - table old version file mount - table - < version > xml try ( buffered writer out = new buffered writer ( new file writer ( new file ( old mount table path to uri ( ) ) ) ) ) { out write ( " < configuration > \ n " ) ; / / invalid tag this file should not be read out write ( " < / \ \ \ name / / \ \ > " ) ; out write ( " < / configuration > \ n " ) ; out flush ( ) ; } view fs test setup add mount links to file ( mount table , sources , targets , latest mount tablepath , conf ) ; }


regression test for hdfs - 8965 which verifies that f s edit log file input stream # scan op verifies op checksums

public void test scan corrupt edit log ( ) throws exception { configuration conf = new configuration ( ) ; file edit log = new file ( generic test utils get temp path ( " test corrupt edit log " ) ) ; log debug ( " creating test edit log file : " + edit log ) ; edit log file output stream elos = new edit log file output stream ( conf , edit log get absolute file ( ) , 8192 ) ; elos create ( name node layout version current layout version ) ; f s edit log op op instance cache cache = new f s edit log op op instance cache ( ) ; f s edit log op mkdir op mkdir op = f s edit log op mkdir op get instance ( cache ) ; mkdir op reset ( ) ; mkdir op set rpc call id ( 123 ) ; mkdir op set transaction id ( 1 ) ; mkdir op set inode id ( 789l ) ; mkdir op set path ( " / mydir " ) ; permission status perms = permission status create immutable ( " myuser " , " mygroup " , fs permission create immutable ( ( short ) 0777 ) ) ; mkdir op set permission status ( perms ) ; elos write ( mkdir op ) ; mkdir op reset ( ) ; mkdir op set rpc call id ( 456 ) ; mkdir op set transaction id ( 2 ) ; mkdir op set inode id ( 123l ) ; mkdir op set path ( " / mydir 2 " ) ; perms = permission status create immutable ( " myuser " , " mygroup " , fs permission create immutable ( ( short ) 0666 ) ) ; mkdir op set permission status ( perms ) ; elos write ( mkdir op ) ; elos set ready to flush ( ) ; elos flush and sync ( false ) ; elos close ( ) ; long file len = edit log length ( ) ; log debug ( " corrupting last 4 bytes of edit log file " + edit log + " , whose length is " + file len ) ; random access file rwf = new random access file ( edit log , " rw " ) ; rwf seek ( file len - 4 ) ; int b = rwf read int ( ) ; rwf seek ( file len - 4 ) ; rwf write int ( b + 1 ) ; rwf close ( ) ; edit log file input stream elis = new edit log file input stream ( edit log ) ; assert assert equals ( name node layout version current layout version , elis get version ( true ) ) ; assert assert equals ( 1 , elis scan next op ( ) ) ; log debug ( " read transaction 1 from " + edit log ) ; try { elis scan next op ( ) ; assert fail ( " expected scan next op to fail when op checksum was corrupt " ) ; } catch ( i o exception e ) { log debug ( " caught expected checksum error when reading corrupt " + " transaction 2 " , e ) ; generic test utils assert exception contains ( " transaction is corrupt " , e ) ; } elis close ( ) ; }


the logger that is used to log errors made by the cache

public builder set cache error logger ( cache error logger cache error logger ) { m cache error logger = cache error logger ; return this ; }


public int get port ( ) { return this port ; }


get dfs namenode replication work multiplier per iteration from configuration

public static int get repl work multiplier ( configuration conf ) { int blocks repl work multiplier = conf get int ( d f s config keys dfs namenode replication work multiplier per iteration , d f s config keys dfs namenode replication work multiplier per iteration default ) ; preconditions check argument ( ( blocks repl work multiplier > 0 ) , d f s config keys dfs namenode replication work multiplier per iteration + " = ' " + blocks repl work multiplier + " ' is invalid " + " it should be a positive , non - zero integer value " ) ; return blocks repl work multiplier ; }


calculate the length of the current constructor state assuming all its operands are constructed

public void calc current length ( int min length , int numopers ) { min length + = point get offset ( ) ; / / convert relative length to absolute length for ( int i = 0 ; i < numopers ; + + i ) { construct state subpoint = point get sub state ( i ) ; int sublength = subpoint get length ( ) + subpoint get offset ( ) ; / / since subpoint offset is an absolute offset / / ( relative to beginning of instruction ) sublength / / is absolute and must be compared to absolute length if ( sublength > min length ) min length = sublength ; } point set length ( min length - point get offset ( ) ) ; / / convert back to relative length }


public int execute update ( string sql , int auto generated keys ) throws s q l exception { return 0 ; }


checks if the encoded image is valid i e is not null , and is not closed

public static boolean is valid ( @ nullable encoded image encoded image ) { return encoded image ! = null & & encoded image is valid ( ) ; }


set the type to use in case the current field is not mapped in an index specifying a type tells elasticsearch what type the sort values should have , which is important for cross - index search , if there are sort fields that exist on some indices only if the unmapped type is { @ code null } then query execution will fail if one or more indices don ' t have a mapping for the current field

public field sort builder unmapped type ( string type ) { this unmapped type = type ; return this ; }


adds the map to the provided map under the provided field name if it ' s should be included

public map builder add ( string field name , boolean include , @ nullable map < string , ? > map value ) { if ( include & & map value ! = null & & ! map value is empty ( ) ) { map put ( get field name ( field name ) , map value ) ; } return this ; }


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

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


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


indicates if the given type can be mocked by this mockmaker mockmaker may have different capabilities in term of mocking , typically mockito 1 x ' s internal mockmaker cannot mock final types other implementations , may have different limitations

type mockability is type mockable ( class < ? > type ) ;


print out what ' s going on the logging a p is aren ' t used and the text delimited for more details

private void println ( string name , string text ) { system out println ( name + " : # " + text + " # " ) ; }


returns and nulls out the aggregation for this search results this allows to free up memory once the aggregation is consumed

public delayable writeable < internal aggregations > consume aggs ( ) { if ( aggregations = = null ) { throw new illegal state exception ( " aggs already consumed " ) ; } delayable writeable < internal aggregations > aggs = aggregations ; aggregations = null ; return aggs ; }


removes all of the mappings from this map the map will be empty after this call returns this method is not atomic : the map may not be empty after returning if there were concurrent writes

public void clear ( ) { map clear ( ) ; }


for all alts , find which ref x or r needs list must see across alts if any alt needs x or r as list , then define as list

public set < decl > get decls for all elements ( list < alt a s t > alt a s ts ) { set < string > needs list = new hash set < string > ( ) ; set < string > non optional = new hash set < string > ( ) ; list < grammar a s t > all refs = new array list < grammar a s t > ( ) ; boolean first alt = true ; interval set reftypes = new interval set ( rule ref , token ref , string literal ) ; for ( alt a s t ast : alt a s ts ) { list < grammar a s t > refs = get rule tokens ( ast get nodes with type ( reftypes ) ) ; all refs add all ( refs ) ; pair < frequency set < string > , frequency set < string > > min and alt freq = get element frequencies for alt ( ast ) ; frequency set < string > min freq = min and alt freq a ; frequency set < string > alt freq = min and alt freq b ; for ( grammar a s t t : refs ) { string ref label name = get name ( t ) ; if ( ref label name ! = null ) { if ( alt freq count ( ref label name ) > 1 ) { needs list add ( ref label name ) ; } if ( first alt & & min freq count ( ref label name ) ! = 0 ) { non optional add ( ref label name ) ; } } } for ( string ref : non optional to array ( new string [ non optional size ( ) ] ) ) { if ( min freq count ( ref ) = = 0 ) { non optional remove ( ref ) ; } } first alt = false ; } set < decl > decls = new linked hash set < decl > ( ) ; for ( grammar a s t t : all refs ) { string ref label name = get name ( t ) ; if ( ref label name = = null ) { continue ; } list < decl > d = get decl for alt element ( t , ref label name , needs list contains ( ref label name ) , ! non optional contains ( ref label name ) ) ; decls add all ( d ) ; } return decls ; }


whether this shader instance implements the specified uniform , only valid after a call to init ( )

public final boolean has ( final int input i d ) { return input i d > = 0 & & input i d < locations length & & locations [ input i d ] > = 0 ; }


for pointer needing update , skip unaligned part ( 4 bytes ) for convenient updating

private int check skip write for pointer ( abstract paged output view out view ) throws i o exception { / / skip if there is no enough size int available = out view get segment size ( ) - out view get current position in segment ( ) ; if ( available < element point length ) { out view advance ( ) ; return available ; } return 0 ; }


closes the connection if the graceful shutdown process has completed

private void check close connection ( channel future future ) { / / if this connection is closing and the graceful shutdown has completed , close the connection / / once this operation completes if ( close listener ! = null & & is graceful shutdown complete ( ) ) { channel future listener close listener = this close listener ; / / this method could be called multiple times / / and we don ' t want to notify the close listener multiple times this close listener = null ; try { close listener operation complete ( future ) ; } catch ( exception e ) { throw new illegal state exception ( " close listener threw an unexpected exception " , e ) ; } } }


evaluates an expression ' s response to binding the specified input symbols to null

private row expression null input evaluator ( final collection < variable reference expression > null symbols , row expression expression ) { expression = row expression node inliner replace expression ( expression , null symbols stream ( ) collect ( collectors to map ( identity ( ) , variable - > constant null ( variable get type ( ) ) ) ) ) ; return new row expression optimizer ( metadata ) optimize ( expression , expression optimizer level optimized , session to connector session ( ) ) ; }


returns the reverse of this ordering ; the { @ code ordering } equivalent to { @ link collections # reverse order ( comparator ) } < b > java 8 users : < b > use { @ code this comparator reversed ( ) } instead

public < s extends t > ordering < s > reverse ( ) { return new reverse ordering < s > ( this ) ; }