starts new mocking session ! creates new { @ code mockito session } instance to initialize the session at this point annotated fields are initialized per { @ link # init mocks ( object ) } method when you are done with the session it is required to invoke { @ link mockito session # finish mocking ( ) } this will trigger stubbing validation , cleaning up the internal state like removal of internal listeners mockito tracks created sessions internally and prevents the user from creating new sessions without using { @ link mockito session # finish mocking ( ) } when you run tests concurrently in multiple threads , it is legal for each thread to have single active mockito session when you attempt to start new session in a thread that already has an unfinished session { @ link unfinished mocking session exception } will be triggered see examples in { @ link mockito session }

mockito session start mocking ( ) throws unfinished mocking session exception ;


public boolean is raw ( ) { return is raw ; }


public void confirmed ( ) { if ( loader get file name ( ) = = null | | loader get file name ( ) equals ( " " ) ) { view show message ( " please give the name of the file first ! " ) ; return ; } if ( loader file exists ( ) ) { var data = loader load data ( ) ; view display data ( data ) ; } else { view show message ( " the file specified does not exist " ) ; } }


sets the command timeout for synchronous command execution

public void set timeout ( long timeout ) { assert util not null ( timeout , " timeout must not be null " ) ; assert util is true ( timeout > = 0 , " timeout must be greater or equal 0 " ) ; this timeout = timeout ; }


{ @ link r m app attempt state # failed }

private void test app attempt failed state ( container container , string diagnostics ) { send attempt update saved event ( application attempt ) ; assert equals ( r m app attempt state failed , application attempt get app attempt state ( ) ) ; assert equals ( diagnostics , application attempt get diagnostics ( ) ) ; assert equals ( 0 , application attempt get just finished containers ( ) size ( ) ) ; assert equals ( container , application attempt get master container ( ) ) ; assert equals ( 0 0 , ( double ) application attempt get progress ( ) , 0 0001 ) ; assert equals ( 0 , application get ran nodes ( ) size ( ) ) ; / / check events verify ( application , times ( 1 ) ) handle ( any ( r m app failed attempt event class ) ) ; verify token count ( application attempt get app attempt id ( ) , 1 ) ; verify attempt final state saved ( ) ; verify application attempt finished ( r m app attempt state failed ) ; }


tests that custom error messages are displayed for non - selectable options

public void nonselectable custom message option ( ) throws exception { check error ( " foo " , " badoption " , " option ' nonselectable custom message option ' cannot be used in a config setting " + " for very important reasons " , " config setting ( " , " name = ' badoption ' , " , " values = { " , " ' nonselectable custom message option ' : ' true ' , " , " } , " , " ) " ) ; }


obtain an accessible constructor for the given class and parameters

public static < t > constructor < t > accessible constructor ( class < t > clazz , class < ? > parameter types ) throws no such method exception { constructor < t > ctor = clazz get declared constructor ( parameter types ) ; make accessible ( ctor ) ; return ctor ; }


public ab script ( script script ) { if ( script = = null ) { throw new illegal argument exception ( " [ script ] must not be null " ) ; } this script = script ; return ( ab ) this ; }


returns human - friendly help for the generator provide the consumer with help tips , parameters here

public string get help ( ) { return " generates a python server library using the connexion project by default , " + " it will also generate service classes - - which you can disable with the ` - dnoservice ` environment variable " ; }


short - circuit ? : no threadsemaphore : thread thread pool full ? : no thread pool queue full ? : no timeout : no execution result : synchronous hystrix runtime exception fallback : success

public void test execution hook thread exception successful fallback ( ) { assert hooks on success ( new func 0 < test hystrix command < integer > > ( ) { @ override public test hystrix command < integer > call ( ) { return get command ( execution isolation strategy thread , abstract test hystrix command execution result failure , 0 , abstract test hystrix command fallback result success ) ; } } , new action 1 < test hystrix command < integer > > ( ) { @ override public void call ( test hystrix command < integer > command ) { testable execution hook hook = command get builder ( ) execution hook ; assert true ( hook command emissions match ( 1 , 0 , 1 ) ) ; assert true ( hook execution events match ( 0 , 1 , 0 ) ) ; assert true ( hook fallback events match ( 1 , 0 , 1 ) ) ; assert equals ( runtime exception class , hook get execution exception ( ) get class ( ) ) ; assert equals ( " on start - on thread start - ! on run start - on execution start - on execution error - ! on run error - on thread complete - on fallback start - on fallback emit - ! on fallback success - ! on complete - on emit - on fallback success - on success - " , hook execution sequence to string ( ) ) ; } } ) ; }


reducing the resources with a time out should first preempt and then kill

public void test reduce preempt and kill ( ) throws exception { container container = create container ( am , 2 * gb ) ; assert memory ( scheduler , nm id , 4 * gb , 0 ) ; / / we give an overcommit time out of 2 seconds final int timeout = ( int ) time unit seconds to millis ( 2 ) ; / / reducing to 2gb should first preempt the container long t 0 = time now ( ) ; update node resource ( rm , nm id , 2 * gb , 2 , timeout ) ; wait memory ( scheduler , nm , 4 * gb , - 2 * gb , interval , timeout ) ; / / wait until mark container for preemption is handled rm drain events ( ) ; / / we should receive a notification to preempt the container preemption message preempt msg = am schedule ( ) get preemption message ( ) ; assert preemption ( container get id ( ) , preempt msg ) ; / / wait until the container is killed wait memory ( scheduler , nm , 2 * gb , 0 , interval , timeout + 2 * interval ) ; / / check that the container was killed list < container status > completed containers = am schedule ( ) get completed containers statuses ( ) ; assert equals ( 1 , completed containers size ( ) ) ; container status container status = completed containers get ( 0 ) ; assert container killed ( container get id ( ) , container status ) ; / / check how long it took to kill the container assert time ( timeout , time now ( ) - t 0 ) ; }


run a s 3 guard tool command from a varags list and the configuration returned by { @ code get configuration ( ) }

protected int run ( object args ) throws exception { return run s 3 guard command ( get configuration ( ) , args ) ; }


gets the action record from the table by its index

public l s d a action record get action record ( int action index ) { action index - = 1 ; if ( action index < 0 ) { return null ; } return records get ( action index ) ; }


public void test purge ( ) throws exception { client base setup test env ( ) ; zoo keeper server zks = new zoo keeper server ( tmp dir , tmp dir , 3000 ) ; sync request processor set snap count ( 100 ) ; final int port = integer parse int ( hostport split ( " : " ) [ 1 ] ) ; server cnxn factory f = server cnxn factory create factory ( port , - 1 ) ; f startup ( zks ) ; assert true ( client base wait for server up ( hostport , connection timeout ) , " waiting for server being up " ) ; zoo keeper zk = client base create z k client ( hostport ) ; try { for ( int i = 0 ; i < 2000 ; i + + ) { zk create ( " / invalidsnap - " + i , new byte [ 0 ] , ids open acl unsafe , create mode persistent ) ; } } finally { zk close ( ) ; } f shutdown ( ) ; zks get txn log factory ( ) close ( ) ; assert true ( client base wait for server down ( hostport , connection timeout ) , " waiting for server to shutdown " ) ; / / now corrupt the snapshot purge txn log purge ( tmp dir , tmp dir , 3 ) ; file txn snap log snaplog = new file txn snap log ( tmp dir , tmp dir ) ; list < file > list logs = snaplog find n valid snapshots ( 4 ) ; int num snaps = 0 ; for ( file ff : list logs ) { if ( ff get name ( ) starts with ( " snapshot " ) ) { num snaps + + ; } } assert true ( ( num snaps = = 3 ) , " exactly 3 snapshots " ) ; snaplog close ( ) ; zks shutdown ( ) ; }


rewind to the first entry in the scanner the entry returned by the previous entry ( ) call will be invalid

public void rewind ( ) throws i o exception { seek to ( begin location ) ; }


returns the minimum of the two values , according to the given comparator if the values compare as equal , the first is returned the recommended solution for finding the { @ code minimum } of some values depends on the type of your data and the number of elements you have read more in the guava user guide article on < a href = " https : github comgoogleguavawiki collection utilities explained # comparators " > { @ code comparators }

public static < t > t min ( @ nullable decl t a , @ nullable decl t b , comparator < t > comparator ) { return ( comparator compare ( a , b ) < = 0 ) ? a : b ; }


convert a string to a fs permission object

static fs permission to fs permission ( final string s ) { return null = = s ? null : new fs permission ( short parse short ( s , 8 ) ) ; }


protected void run test ( testable testable ) throws exception { run ( new testable decorator ( setup , testable ) ) ; }


set the node update type ( null indicates absent node update type )

public void set node update type ( node update type node update type ) { }


creates an { @ link elasticsearch security exception } that indicates the token was expired it is up to the client to re - authenticate and obtain a new token the format for this response is defined in < a href = " https : tools ietf orghtmlrfc 6 7 5 0 # section - 3 1 " >

private static elasticsearch security exception expired token exception ( ) { elasticsearch security exception e = new elasticsearch security exception ( " token expired " , rest status unauthorized ) ; e add header ( " www - authenticate " , expired token www auth value ) ; return e ; }


public void proxy get ( string server , string api , map < string , string > params ) throws exception { / / do proxy if ( ! i p util contains port ( server ) ) { server = server + i p util ip port spliter + env util get port ( ) ; } string url = " http : / / " + server + env util get context path ( ) + api ; rest result < string > result = http client http get ( url , null , params ) ; if ( ! result ok ( ) ) { throw new illegal state exception ( " leader failed , caused by : " + result get message ( ) ) ; } }


do not override this ! this method only exists for legacy support no new aggregations need this , nor should they override it

protected boolean serialize target value type ( version version ) { return false ; }


blocks until { @ link block manager # low redundancy blocks count } reaches a certain value

protected void wait for low redundancy count ( final long cnt ) throws timeout exception , interrupted exception { final block manager bm = cluster get namesystem ( ) get block manager ( ) ; generic test utils wait for ( ( ) - > cnt = = bm get low redundancy blocks count ( ) , 2 * wait poll interval large ms , wait for redundancy ms ) ; }


get the stack variable " first use offsets "

public int [ ] get stack var first use offsets ( ) { return stack var f u offsets ; }


returns the long array of < code > n elements < code > starting at < code > index < code >

public long [ ] read long array ( long index , int n elements , long min clamp , long max clamp , long exceptions ) throws i o exception { long [ ] array = read long array ( index , n elements ) ; for ( int ii = 0 ; ii < array length ; + + ii ) { array [ ii ] = clamp long ( array [ ii ] , min clamp , max clamp , exceptions ) ; } return array ; }


creates cluster state with several indexes , shards and replicas and all shards started

public static cluster state state with assigned primaries and replicas ( string [ ] indices , int number of shards , int number of replicas ) { int number of data nodes = number of replicas + 1 ; discovery nodes builder disco builder = discovery nodes builder ( ) ; for ( int i = 0 ; i < number of data nodes + 1 ; i + + ) { final discovery node node = new node ( i ) ; disco builder = disco builder add ( node ) ; } disco builder local node id ( new node ( 0 ) get id ( ) ) ; disco builder master node id ( new node ( number of data nodes + 1 ) get id ( ) ) ; cluster state builder state = cluster state builder ( new cluster name ( " test " ) ) ; state nodes ( disco builder ) ; builder routing table builder = routing table builder ( ) ; metadata builder metadata builder = metadata builder ( ) ; for ( string index : indices ) { index metadata index metadata = index metadata builder ( index ) settings ( settings builder ( ) put ( setting version created , version current ) put ( setting number of shards , number of shards ) put ( setting number of replicas , number of replicas ) put ( setting creation date , system current time millis ( ) ) ) timestamp range ( index long field range unknown ) build ( ) ; metadata builder put ( index metadata , false ) generate cluster uuid if needed ( ) ; index routing table builder index routing table builder = index routing table builder ( index metadata get index ( ) ) ; for ( int i = 0 ; i < number of shards ; i + + ) { final shard id shard id = new shard id ( index , " na " , i ) ; index shard routing table builder index shard routing builder = new index shard routing table builder ( shard id ) ; index shard routing builder add shard ( test shard routing new shard routing ( index , i , new node ( 0 ) get id ( ) , null , true , shard routing state started ) ) ; for ( int replica = 0 ; replica < number of replicas ; replica + + ) { index shard routing builder add shard ( test shard routing new shard routing ( index , i , new node ( replica + 1 ) get id ( ) , null , false , shard routing state started ) ) ; } index routing table builder add index shard ( index shard routing builder build ( ) ) ; } routing table builder add ( index routing table builder build ( ) ) ; } state metadata ( metadata builder ) ; state routing table ( routing table builder build ( ) ) ; return state build ( ) ; }


calls the parser and returns any gathered deprecations

public list < string > get query deprecations ( named x content registry named x content registry ) { list < string > deprecations = new array list < > ( ) ; parse query ( named x content registry , deprecations ) ; return deprecations ; }


return the configured handlers , or possibly { @ code null } if not initialized yet via { @ link # after properties set ( ) }

public list < handler method return value handler > get return value handlers ( ) { return ( this return value handlers ! = null ? this return value handlers get handlers ( ) : null ) ; }


inserts the specified element into this priority queue

public boolean add ( e e ) { return offer ( e ) ; }


returns a hash function implementing the message authentication code ( mac ) algorithm , using the md5 ( 128 hash bits ) hash function and a { @ link secret key spec } created from the given byte array and the md5 algorithm

public static hash function hmac md 5 ( byte [ ] key ) { return hmac md 5 ( new secret key spec ( check not null ( key ) , " hmac m d 5 " ) ) ; }


invoke a method on an object and return whatever it returns

protected static < t > t invoke ( method method , object object , object parameters ) throws i o exception , runtime exception { try { return ( t ) method invoke ( object , parameters ) ; } catch ( illegal argument exception | illegal access exception e ) { throw new runtime exception ( e ) ; } catch ( invocation target exception e ) { if ( e get target exception ( ) instanceof i o exception ) { throw ( i o exception ) e get target exception ( ) ; } else { throw new runtime exception ( e ) ; } } }


called by ghidra when bundle is activated

protected void start ( bundle context bundle context , object api ) { if ( stored action ! = null ) { msg show error ( this , null , " activator error ! " , " stored action non - null on bundle start ! " ) ; } }


private void write object ( final object output stream out ) throws i o exception { out write object ( reducer get class ( ) ) ; out write object ( combiner get class ( ) ) ; job conf write ( out ) ; }


calls { @ link # set text ( bitmap font , char sequence , int , int , color , float , int , boolean , string ) set text } with the whole string and no truncation

public void set text ( bitmap font font , char sequence str , color color , float target width , int halign , boolean wrap ) { set text ( font , str , 0 , str length ( ) , color , target width , halign , wrap , null ) ; }


adds a precommit task , which depends on non - test verification tasks

public static void create ( project project ) { project get plugin manager ( ) apply ( jar hell precommit plugin class ) ; }


confirm that the requested number of workers are up and running

protected optional < boolean > check workers up ( int num workers , bi function < integer , integer , boolean > comp ) { try { int num up = connect active workers ( ) size ( ) ; return optional of ( comp apply ( num up , num workers ) ) ; } catch ( exception e ) { log error ( " could not check active workers " , e ) ; return optional empty ( ) ; } }


returns a string that is extended to length len with zeroes

public static string zeropad ( string s , int len ) { if ( s = = null ) s = " " ; string buffer buffer = new string buffer ( s ) ; int zeros needed = len - s length ( ) ; for ( int i = 0 ; i < zeros needed ; + + i ) { buffer insert ( 0 , ' 0 ' ) ; } return buffer to string ( ) ; }


create a builder with the template name , status code , headers and model of the given response

static builder from ( rendering response other ) { return new default rendering response builder ( other ) ; }


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


static string new block pool i d ( ) throws unknown host exception { string ip ; try { ip = dns get default i p ( " default " ) ; } catch ( unknown host exception e ) { log warn ( " could not find ip address of \ " default \ " inteface " ) ; throw e ; } int rand = d f s util get secure random ( ) next int ( integer max value ) ; return " bp - " + rand + " - " + ip + " - " + time now ( ) ; }


writes this record to the given output view this method is similar to { @ link org apache flink core io i o readable writable # write ( org apache flink core memory data output view ) } , but it returns the number of bytes written

public long serialize ( data output view target ) throws i o exception { update binary represenation ( ) ; long bytes for len = 1 ; int len = this binary len ; while ( len > = max bit ) { target write ( len | max bit ) ; len > > = 7 ; bytes for len + + ; } target write ( len ) ; target write ( this binary data , 0 , this binary len ) ; return bytes for len + this binary len ; }


the implementing class must define this method , which must at least flush the bytes in { @ code buffer [ 0 ] - buffer [ len - 1 ] } , and reset { @ code len = 0 } don ' t forget to synchronized the implementation of this method on whatever underlying object it writes to !

protected abstract void flushing hook ( ) throws i o exception ;


public void init ( ) { for ( int i = 0 ; i < pool size ; i + + ) { byte buffer byte buffer = byte buffer allocate direct ( file size ) ; final long address = ( ( direct buffer ) byte buffer ) address ( ) ; pointer pointer = new pointer ( address ) ; lib c instance mlock ( pointer , new native long ( file size ) ) ; available buffers offer ( byte buffer ) ; } }


equivalent to { @ link # remove video listener ( com google android exoplayer 2 video video listener ) }

public void clear video listener ( video listener listener ) { remove video listener ( listener ) ; }


put the bytes provided into the buffer at the specified offset the number of bytes stored is determined by the length of the bytes array

public void put ( int offset , byte [ ] bytes ) throws i o exception { synchronized ( dbh ) { dbh check transaction ( ) ; buf put ( offset , bytes ) ; } }


set the route for the setup payload the rules for formatting and encoding the route are the same as those for a request route as described in { @ link # route ( string , object ) } by default this is not set

r socket requester builder setup route ( string route , object route vars ) ;


returns a class ' s { @ link class # get simple name } , but also includes the outer class ' s simple name if this is an inner class for example , given { @ code my inner class } under { @ code my outer class } , returns { @ code " my outer class $ my inner class " }

public static string get simple name with outer ( class < ? > clazz ) { string name = clazz get name ( ) ; return name substring ( name last index of ( " " ) + 1 ) ; }


returns the paths to the children of this directory returns an empty list if this file handle represents a file and not a directory on the desktop , an { @ link file type # internal } handle to a directory on the classpath will return a zero length array @ throw gdx runtime exception if this file is an { @ link file type # classpath } file

public file handle [ ] list ( ) { throw new gdx runtime exception ( " stub " ) ; }


report the start a new run of the cleaner

public void report cleaning start ( ) { processed files set ( 0 ) ; deleted files set ( 0 ) ; file errors set ( 0 ) ; }


add the object to the droppable component the drop target adapter calls this method from its drop ( ) method

public void add ( object obj , drop target drop event e , data flavor f ) ;


sets the policy for the case where the configuration is missing the required fragment class ( see { @ link # requires configuration fragments } )

public builder set missing fragment policy ( class < ? > fragment class , missing fragment policy missing fragment policy ) { configuration fragment policy set missing fragment policy ( fragment class , missing fragment policy ) ; return this ; }


helper method for summarizing a list of values

protected numeric column summary < integer > summarize ( integer values ) { return new aggregate combine harness < integer , numeric column summary < integer > , integer summary aggregator > ( ) { @ override protected void compare results ( numeric column summary < integer > result 1 , numeric column summary < integer > result 2 ) { assert assert equals ( result 1 get total count ( ) , result 2 get total count ( ) ) ; assert assert equals ( result 1 get null count ( ) , result 2 get null count ( ) ) ; assert assert equals ( result 1 get missing count ( ) , result 2 get missing count ( ) ) ; assert assert equals ( result 1 get non missing count ( ) , result 2 get non missing count ( ) ) ; assert assert equals ( result 1 get infinity count ( ) , result 2 get infinity count ( ) ) ; assert assert equals ( result 1 get nan count ( ) , result 2 get nan count ( ) ) ; assert assert equals ( result 1 contains null ( ) , result 2 contains null ( ) ) ; assert assert equals ( result 1 contains non null ( ) , result 2 contains non null ( ) ) ; assert assert equals ( result 1 get min ( ) int value ( ) , result 2 get min ( ) int value ( ) ) ; assert assert equals ( result 1 get max ( ) int value ( ) , result 2 get max ( ) int value ( ) ) ; assert assert equals ( result 1 get sum ( ) int value ( ) , result 2 get sum ( ) int value ( ) ) ; assert assert equals ( result 1 get mean ( ) double value ( ) , result 2 get mean ( ) double value ( ) , 1e - 1 2d ) ; assert assert equals ( result 1 get variance ( ) double value ( ) , result 2 get variance ( ) double value ( ) , 1e - 9d ) ; assert assert equals ( result 1 get standard deviation ( ) double value ( ) , result 2 get standard deviation ( ) double value ( ) , 1e - 1 2d ) ; } } summarize ( values ) ; }


public void add dump point ( address break addr , register dump addr reg , int relative offset , address space dump addr space , int dump size , int element size , dump format element format , string comment ) { list < dump point > list = dump point map get ( break addr ) ; if ( list = = null ) { list = new array list < > ( ) ; dump point map put ( break addr , list ) ; } list add ( new register relative dump point ( break addr , dump addr reg , relative offset , dump addr space , dump size , element size , element format , comment ) ) ; }


check if a shard exists in the backup store


fails the whole job graph in case an in - progress synchronous savepoint is discarded if the checkpoint was cancelled at the checkpoint coordinator , i e before the synchronous savepoint barrier was sent to the tasks , then we do not cancel the job as we do not risk having a deadlock

void handle synchronous savepoint failure ( final throwable cause ) { if ( ! is pre flight failure ( cause ) ) { failure callback fail job ( cause ) ; } }


method to be called after starlark - transitions are applied checks outputs we only do validation on starlark - defined build settings native options ( designated with { @ code command line option prefix } ) already have their output values checked in { @ link function transition util # apply transition } remove build settings in { @ code to options } that have been set to their default value this is how we ensure that an unset build setting and a set - to - default build settings represent the same configuration deduplicate redundant build settings from the result of split transitions the first encountered split key is used to represent the deduped build setting

public static map < string , build options > validate ( configuration transition root , map < package value key , package value > build setting packages , map < string , build options > to options ) throws transition exception { / / collect settings changed during this transition and their types map < label , rule > changed setting to rule = maps new hash map ( ) ; root visit ( ( starlark transition visitor ) transition - > { immutable set < label > changed settings = get relevant starlark settings from transition ( transition , settings outputs ) ; for ( label setting : changed settings ) { changed setting to rule put ( setting , get actual ( build setting packages , setting ) get associated rule ( ) ) ; } } ) ; / / return early if no starlark settings were affected if ( changed setting to rule is empty ( ) ) { return to options ; } immutable map builder < label , label > alias to actual builder = new immutable map builder < > ( ) ; for ( map entry < label , rule > changed setting with rule : changed setting to rule entry set ( ) ) { label setting = changed setting with rule get key ( ) ; rule rule = changed setting with rule get value ( ) ; if ( ! rule get label ( ) equals ( setting ) ) { alias to actual builder put ( setting , rule get label ( ) ) ; } } immutable map < label , label > alias to actual = alias to actual builder build ( ) ; / / verify changed settings were changed to something reasonable for their type and filter out / / default values immutable map builder < string , build options > cleaned option map = immutable map builder ( ) ; set < build options > cleaned option set = sets new linked hash set with expected size ( to options size ( ) ) ; for ( string split key : to options key set ( ) ) { / / lazily initialized to optimize for the common case where we don ' t modify anything build options builder cleaned options = null ; / / clean up aliased values build options options = unalias ( to options get ( split key ) , alias to actual ) ; for ( map entry < label , rule > changed setting with rule : changed setting to rule entry set ( ) ) { / / if the build setting was referenced in the transition via an alias , this is that alias label maybe alias setting = changed setting with rule get key ( ) ; rule rule = changed setting with rule get value ( ) ; / / if the build setting was * not * referenced in the transition by an alias , this is the same / / value as { @ code maybe alias setting } above label actual setting = rule get label ( ) ; object new value = options get starlark options ( ) get ( actual setting ) ; / / todo ( b / 154132845 ) : fix npe occasionally observed here preconditions check state ( new value ! = null , " error while attempting to validate new values from starlark " + " transition ( s ) with the outputs % s post - transition configuration should include " + " ' % s ' but only includes starlark options : % s if you run into this error " + " please ping b / 154132845 or email blaze - configurability @ google com " , changed setting to rule key set ( ) , actual setting , options get starlark options ( ) key set ( ) ) ; boolean allows multiple = rule get rule class object ( ) get build setting ( ) allows multiple ( ) ; if ( allows multiple ) { / / if this setting allows multiple settings if ( ! ( new value instanceof list ) ) { throw new transition exception ( string format ( " ' % s ' allows multiple values and must be set " + " in transition using a starlark list instead of single value ' % s ' " , actual setting , new value ) ) ; } list < ? > raw new value as list = ( list < ? > ) new value ; list < object > converted value = new array list < > ( ) ; type < ? > type = rule get rule class object ( ) get build setting ( ) get type ( ) ; for ( object value : raw new value as list ) { try { converted value add ( type convert ( value , maybe alias setting ) ) ; } catch ( conversion exception e ) { throw new transition exception ( e ) ; } } if ( converted value equals ( immutable list of ( rule get attr ( starlark build setting default attr name ) ) ) ) { if ( cleaned options = = null ) { cleaned options = options to builder ( ) ; } cleaned options remove starlark option ( rule get label ( ) ) ; } } else { / / if this setting does not allow multiple settings object converted value ; try { converted value = rule get rule class object ( ) get build setting ( ) get type ( ) convert ( new value , maybe alias setting ) ; } catch ( conversion exception e ) { throw new transition exception ( e ) ; } if ( converted value equals ( rule get attr ( starlark build setting default attr name ) ) ) { if ( cleaned options = = null ) { cleaned options = options to builder ( ) ; } cleaned options remove starlark option ( rule get label ( ) ) ; } } } / / keep the same instance if we didn ' t do anything to maintain reference equality later on options = cleaned options ! = null ? cleaned options build ( ) : options ; if ( cleaned option set add ( options ) ) { cleaned option map put ( split key , options ) ; } } return cleaned option map build ( ) ; } / * * resolve aliased build setting issues * * < p > if a build setting is transitioned upon via an alias , the resulting { @ link * build options # get starlark options ( ) } map will look like this : * * < entry 1 > alias - label - > new - value * < entry 2 > actual - label - > old - value * * < p > we need to collapse this to the correct single entry : actual - label - > new - value * by the end of this method , the starlark options map in the returned { @ link build options }


if you have image assets and use { @ link lottie drawable } directly , you must call this yourself calling recycle bitmaps ( ) doesn ' t have to be final and { @ link lottie drawable } will recreate the bitmaps if needed but they will leak if you don ' t recycle them

@ suppress warnings ( " weaker access " ) public void recycle bitmaps ( ) { if ( image asset bitmap manager ! = null ) { image asset bitmap manager recycle bitmaps ( ) ; } }


clears the current header entries and copies all header entries of the specified { @ code headers }

t set ( headers < ? extends k , ? extends v , ? > headers ) ;


initialize the given property editor registry with the custom editors that have been registered with this bean factory to be called for bean wrappers that will create and populate bean instances , and for simple type converter used for constructor argument and factory method type conversion

protected void register custom editors ( property editor registry registry ) { if ( registry instanceof property editor registry support ) { ( ( property editor registry support ) registry ) use config value editors ( ) ; } if ( ! this property editor registrars is empty ( ) ) { for ( property editor registrar registrar : this property editor registrars ) { try { registrar register custom editors ( registry ) ; } catch ( bean creation exception ex ) { throwable root cause = ex get most specific cause ( ) ; if ( root cause instanceof bean currently in creation exception ) { bean creation exception bce = ( bean creation exception ) root cause ; string bce bean name = bce get bean name ( ) ; if ( bce bean name ! = null & & is currently in creation ( bce bean name ) ) { if ( logger is debug enabled ( ) ) { logger debug ( " property editor registrar [ " + registrar get class ( ) get name ( ) + " ] failed because it tried to obtain currently created bean ' " + ex get bean name ( ) + " ' : " + ex get message ( ) ) ; } on suppressed exception ( ex ) ; continue ; } } throw ex ; } } } if ( ! this custom editors is empty ( ) ) { this custom editors for each ( ( required type , editor class ) - > registry register custom editor ( required type , bean utils instantiate class ( editor class ) ) ) ; } }


returns true if the editor has a valid value

public boolean has valid filter value ( ) { return editor has valid value ( ) ; }


static method spec builder initialize serialize method builder ( type element encoded type , auto codec annotation , processing environment env ) { method spec builder builder = method spec method builder ( " serialize " ) add modifiers ( modifier public ) returns ( void class ) add annotation ( override class ) add annotation ( annotation spec builder ( class name get ( suppress warnings class ) ) add member ( " value " , " $ s " , " unchecked " ) build ( ) ) add exception ( serialization exception class ) add exception ( i o exception class ) add parameter ( serialization context class , " context " ) add parameter ( type name get ( env get type utils ( ) erasure ( encoded type as type ( ) ) ) , " input " ) add parameter ( coded output stream class , " coded out " ) ; if ( annotation check class explicitly allowed ( ) ) { builder add statement ( " context check class explicitly allowed ( get encoded class ( ) , input ) " ) ; } list < ? extends type mirror > explicitly allowed classes ; try { explicitly allowed classes = arrays stream ( annotation explicitly allow class ( ) ) map ( ( clazz ) - > get type ( clazz , env ) ) collect ( collectors to list ( ) ) ; } catch ( mirrored types exception e ) { explicitly allowed classes = e get type mirrors ( ) ; } for ( type mirror explicitly allowed class : explicitly allowed classes ) { builder add statement ( " context add explicitly allowed class ( $ t class ) " , explicitly allowed class ) ; } return builder ; }


post usercreate with list : creates list of users with given input array

default response entity < void > create users with list input ( @ api param ( value = " list of user object " , required = true ) @ valid @ request body list < user > body ) { return get delegate ( ) create users with list input ( body ) ; }


inform listeners that node is being removed

public static void fire on deleted ( @ non null node node ) { for ( node listener nl : all ( ) ) { try { nl on deleted ( node ) ; } catch ( throwable ex ) { logger log ( level warning , " listener invocation failed " , ex ) ; } } }


public static void main ( string [ ] args ) { spring application run ( price application class , args ) ; }


implementation variation to use , or all if unset

optional < implementation > implementation ( ) { return optional of nullable ( enums get if present ( implementation class , system get property ( " implementation " , " " ) ) or null ( ) ) ; }


removes the current actor for the cell , if any

public cell < t > clear actor ( ) { set actor ( null ) ; return this ; }


closes the local side of the { @ code stream } depending on the { @ code stream } state this may result in { @ code stream } being closed see { @ link # close stream ( http 2 stream , channel future ) }

void close stream local ( http 2 stream stream , channel future future ) ;


returns the registered action for the given keystroke , or null of no action is bound to that keystroke

public static action get action ( j component component , key stroke key stroke , int focus condition ) { input map input map = component get input map ( focus condition ) ; action map action map = component get action map ( ) ; if ( input map = = null | | action map = = null ) { return null ; } object binding = input map get ( key stroke ) ; return ( binding = = null ) ? null : action map get ( binding ) ; }


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


override this if you want to specify the asset path for a given font family

public string get font path ( string font family ) { return null ; }


formats a { @ code long } as an 8 - byte signed hex value

public static string s 8 ( long v ) { char [ ] result = new char [ 17 ] ; if ( v < 0 ) { result [ 0 ] = ' - ' ; v = - v ; } else { result [ 0 ] = ' + ' ; } for ( int i = 0 ; i < 16 ; i + + ) { result [ 16 - i ] = character for digit ( ( int ) v & 0x 0f , 16 ) ; v > > = 4 ; } return new string ( result ) ; }


sets the is status bar theme of this m t config object

public void set status bar theme ( final boolean is status bar theme ) { status bar theme = is status bar theme ; }


testcase to reproduce act - 950 ( https : jira codehaus orgbrowse a c t - 950 )

public void test find active activity id process with error event and sub process ( ) { process instance process instance = process engine get runtime service ( ) start process instance by key ( " error event subprocess " ) ; list < string > active activities = runtime service get active activity ids ( process instance get id ( ) ) ; assert that ( active activities ) has size ( 5 ) ; list < task > tasks = task service create task query ( ) list ( ) ; assert that ( tasks ) has size ( 2 ) ; task parallel user task = null ; for ( task task : tasks ) { assert that ( task get name ( ) ) as ( " expected : < parallel user task > or < main user task > but was < " + task get name ( ) + " > " ) is in ( " parallel user task " , " main user task " ) ; if ( task get name ( ) equals ( " parallel user task " ) ) { parallel user task = task ; } } assert that ( parallel user task ) is not null ( ) ; task service complete ( parallel user task get id ( ) ) ; execution execution = runtime service create execution query ( ) process instance id ( process instance get id ( ) ) activity id ( " subprocess 1 wait before error " ) single result ( ) ; runtime service trigger ( execution get id ( ) ) ; active activities = runtime service get active activity ids ( process instance get id ( ) ) ; assert that ( active activities ) has size ( 4 ) ; tasks = task service create task query ( ) list ( ) ; assert that ( tasks ) has size ( 2 ) ; task before error user task = null ; for ( task task : tasks ) { assert that ( task get name ( ) ) as ( " expected : < before error > or < main user task > but was < " + task get name ( ) + " > " ) is in ( " before error " , " main user task " ) ; if ( task get name ( ) equals ( " before error " ) ) { before error user task = task ; } } assert that ( before error user task ) is not null ( ) ; task service complete ( before error user task get id ( ) ) ; active activities = runtime service get active activity ids ( process instance get id ( ) ) ; assert that ( active activities ) has size ( 2 ) ; tasks = task service create task query ( ) list ( ) ; assert that ( tasks ) has size ( 2 ) ; task after error user task = null ; for ( task task : tasks ) { assert that ( task get name ( ) ) as ( " expected : < after error > or < main user task > but was < " + task get name ( ) + " > " ) is in ( " after error " , " main user task " ) ; if ( task get name ( ) equals ( " after error " ) ) { after error user task = task ; } } assert that ( after error user task ) is not null ( ) ; task service complete ( after error user task get id ( ) ) ; tasks = task service create task query ( ) list ( ) ; assert that ( tasks ) has size ( 1 ) ; assert that ( tasks get ( 0 ) get name ( ) ) is equal to ( " main user task " ) ; active activities = runtime service get active activity ids ( process instance get id ( ) ) ; assert that ( active activities ) has size ( 1 ) ; assert that ( active activities get ( 0 ) ) is equal to ( " main user task " ) ; task service complete ( tasks get ( 0 ) get id ( ) ) ; assert process ended ( process instance get id ( ) ) ; }


model api response upload file ( @ param ( " pet id " ) long pet id , @ param ( " additional metadata " ) string additional metadata , @ param ( " file " ) file file ) ;


returns true if field success is set ( has been assigned a value ) and false otherwise

public boolean is set success ( ) { return this success ! = null ; }


returns the current value for the current thread

public final v get ( ) { internal thread local map thread local map = internal thread local map get ( ) ; object v = thread local map indexed variable ( index ) ; if ( v ! = internal thread local map unset ) { return ( v ) v ; } return initialize ( thread local map ) ; }


public static boolean is leap year ( final date date ) { calendar cal = calendar get instance ( ) ; cal set time ( date ) ; int year = cal get ( calendar year ) ; return is leap year ( year ) ; }


public void close ( ) { if ( writer ! = null ) { writer on completed ( ) ; } }


public void write short ( int value ) { int write at = cursor ; int end = write at + 2 ; if ( stretchy ) { ensure capacity ( end ) ; } else if ( end > data length ) { throw bounds ( ) ; return ; } data [ write at ] = ( byte ) value ; data [ write at + 1 ] = ( byte ) ( value > > 8 ) ; cursor = end ; }


return the mapping lookup path for the given request , within the current servlet mapping if applicable , else within the web application detects include request url if called within a request dispatcher include

public string get lookup path for request ( http servlet request request ) { string path within app = get path within application ( request ) ; / / always use full path within current servlet context ? if ( this always use full path | | skip servlet path determination ( request ) ) { return path within app ; } / / else , use path within current servlet mapping if applicable string rest = get path within servlet mapping ( request , path within app ) ; if ( string utils has length ( rest ) ) { return rest ; } else { return path within app ; } }


public void add ( register tree tree ) { children add ( tree ) ; tree parent = this ; }


creates a launchable task for fenzo to process

private launchable mesos worker create launchable mesos worker ( protos task i d task i d ) { log debug ( " launchable mesos worker parameters : { } " , task manager parameters ) ; return new launchable mesos worker ( artifact server , task manager parameters , task manager container spec , task i d , mesos config ) ; }


public resource type [ ] get resource types ( ) { return types ; }


private static files to run provider get adb ( rule context rule context ) { return android sdk provider from rule context ( rule context ) get adb ( ) ; }


convenience method to set this bt indexed mesh to the specified vertex and index data the specified data must be indexed and triangulated and must outlive this bt indexed mesh

public void set ( final object tag , final float buffer vertices , int size in bytes of each vertex , int vertex count , int position offset in bytes , final short buffer indices , int index offset , int index count ) { set vertices ( vertices , size in bytes of each vertex , vertex count , position offset in bytes ) ; set indices ( indices , index offset , index count ) ; this tag = tag ; }


specify the type that the result object is required to match if not specified , the result value will be exposed as returned by the jdbc driver

public void set result type ( class < t > result type ) { this row mapper set required type ( result type ) ; }


invokes { @ code executor } { @ link executor service # await termination ( long , time unit ) await termination ( long , time unit ) } uninterruptibly

public static boolean await termination uninterruptibly ( executor service executor , long timeout , time unit unit ) { boolean interrupted = false ; try { long remaining nanos = unit to nanos ( timeout ) ; long end = system nano time ( ) + remaining nanos ; while ( true ) { try { return executor await termination ( remaining nanos , nanoseconds ) ; } catch ( interrupted exception e ) { interrupted = true ; remaining nanos = end - system nano time ( ) ; } } } finally { if ( interrupted ) { thread current thread ( ) interrupt ( ) ; } } }


gets a list of all the settings definitions used by this datatype

protected settings definition [ ] get built in settings definitions ( ) { return null ; }


ensure that getfilestatus ( get ) and liststatus ( get ) work in all modes getxattrs ( get ) works in read - write and read - only but write - only throws an exception setpermission ( put ) works in read - write and write only but read - only throws an exception setpermission ( post ) works in read - write and write only but read - only throws an exception delete ( delete ) works in read - write and write only but read - only throws an exception

public void test acess controlled f s ( ) throws exception { final string test rw msg = " test read - write " ; final string test ro msg = " test read - only " ; final string test wo msg = " test write - only " ; final string def user 1 = " default : user : glarch : r - x " ; final string dir = " / test access " ; final string path r w = dir + " / foo - rw " ; final string path w o = dir + " / foo - wo " ; final string path r o = dir + " / foo - ro " ; final string set perm spec = " 744 " ; final string snapshop spec = " snapshotname = test - snap " ; start mini d f s ( ) ; create http f s server ( ) ; file system fs = file system get ( nn conf ) ; fs mkdirs ( new path ( dir ) ) ; output stream os = fs create ( new path ( path r w ) ) ; os write ( 1 ) ; os close ( ) ; os = fs create ( new path ( path w o ) ) ; os write ( 1 ) ; os close ( ) ; os = fs create ( new path ( path r o ) ) ; os write ( 1 ) ; os close ( ) ; configuration conf = http f s server web app get ( ) get config ( ) ; / * test read - write mode * / conf set strings ( " httpfs access mode " , " read - write " ) ; get cmd ( path r w , test rw msg + " get " , " getfilestatus " , true ) ; get cmd ( path r w , test rw msg + " get " , " liststatus " , true ) ; get cmd ( path r w , test rw msg + " get " , " getxattrs " , true ) ; put cmd ( path r w , test rw msg + " put " , " setpermission " , set perm spec , true ) ; post cmd ( path r w , test rw msg + " post " , " unsetstoragepolicy " , null , true ) ; delete cmd ( path r w , test rw msg + " delete " , " delete " , null , true ) ; / * test write - only mode * / conf set strings ( " httpfs access mode " , " write - only " ) ; get cmd ( path w o , test wo msg + " get " , " getfilestatus " , true ) ; get cmd ( path w o , test wo msg + " get " , " liststatus " , true ) ; get cmd ( path w o , test wo msg + " get " , " getxattrs " , false ) ; put cmd ( path w o , test wo msg + " put " , " setpermission " , set perm spec , true ) ; post cmd ( path w o , test wo msg + " post " , " unsetstoragepolicy " , null , true ) ; delete cmd ( path w o , test wo msg + " delete " , " delete " , null , true ) ; / * test read - only mode * / conf set strings ( " httpfs access mode " , " read - only " ) ; get cmd ( path r o , test ro msg + " get " , " getfilestatus " , true ) ; get cmd ( path r o , test ro msg + " get " , " liststatus " , true ) ; get cmd ( path r o , test ro msg + " get " , " getxattrs " , true ) ; put cmd ( path r o , test ro msg + " put " , " setpermission " , set perm spec , false ) ; post cmd ( path r o , test ro msg + " post " , " unsetstoragepolicy " , null , false ) ; delete cmd ( path r o , test ro msg + " delete " , " delete " , null , false ) ; conf set strings ( " httpfs access mode " , " read - write " ) ; mini dfs shutdown ( ) ; }


public void get pet by id test ( ) throws api exception { / / long pet id = null ; / / pet response = api get pet by id ( pet id ) ; / / todo : test validations }


validate and set ctime from { @ link properties }

protected void setc time ( properties props , storage directory sd ) throws inconsistent f s state exception { c time = long parse long ( get property ( props , sd , " c time " ) ) ; }


returns a builder that creates immutable sorted maps whose keys are ordered by their natural ordering the sorted maps use { @ link ordering # natural ( ) } as the comparator

public static < k extends comparable < ? > , v > builder < k , v > natural order ( ) { return new builder < > ( ordering natural ( ) ) ; }


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


return the configured { @ link requested content type resolver }

public requested content type resolver get content type resolver ( ) { return this content type resolver ; }


public static synchronized activity task mgr get instance ( ) { if ( s instance = = null ) { s instance = new activity task mgr ( ) ; } return s instance ; }


protected boolean requires delayed commit output in file system ( ) { return true ; }


sets the function used to obtain a source reader when subsequently formatting a call stack the default supplier returns source readers that read from the file system , but a security - conscious client may wish to disable this capability or provide an alternative

public static synchronized void set source reader supplier ( supplier < source reader > f ) { source reader supplier = f ; }


attempts to return a { @ code host specifier } for the given string , throwing an exception if parsing fails always use this method in preference to { @ link # from valid ( string ) } for a specifier that is not already known to be valid

public static host specifier from ( string specifier ) throws parse exception { try { return from valid ( specifier ) ; } catch ( illegal argument exception e ) { / / since the iae can originate at several different points inside / / from valid ( ) , we implement this method in terms of that one rather / / than the reverse parse exception parse exception = new parse exception ( " invalid host specifier : " + specifier , 0 ) ; parse exception init cause ( e ) ; throw parse exception ; } }


public static litho view mount component ( component context context , litho view litho view , component component , boolean incremental mount enabled , boolean visibility processing enabled , int width , int height ) { return mount component ( litho view , component tree create ( context , component ) incremental mount ( incremental mount enabled ) layout diffing ( false ) visibility processing ( visibility processing enabled ) build ( ) , make measure spec ( width , exactly ) , make measure spec ( height , exactly ) ) ; }


public int size ( ) { lock lock ( ) ; try { return queue size ( ) ; } finally { lock unlock ( ) ; } }


obtain a new prototype instance for every call

public object get target ( ) throws beans exception { return new prototype instance ( ) ; }


tests oauthbearer fails the connection when the client presents a token with insufficient scope

public void test insufficient scope sasl oauth bearer mechanism ( ) throws exception { security protocol security protocol = security protocol sasl ssl ; test jaas config jaas config = configure mechanisms ( " oauthbearer " , arrays as list ( " oauthbearer " ) ) ; / / now update the server side to require a scope the client does not provide map < string , object > server jaas config options map = test jaas config default server options ( " oauthbearer " ) ; server jaas config options map put ( " unsecured validator required scope " , " login to kafka " ) ; / / causes the failure jaas config create or update entry ( " kafka server " , " org apache kafka common security oauthbearer o auth bearer login module " , server jaas config options map ) ; server = create echo server ( security protocol ) ; create and check client authentication failure ( security protocol , " node - " + o auth bearer login module oauthbearer mechanism , o auth bearer login module oauthbearer mechanism , " { \ " status \ " : \ " insufficient scope \ " , \ " scope \ " : \ " [ login to kafka ] \ " } " ) ; }


a sensible , albeit inefficient , definition of { @ link # size } in terms of { @ link # entry set } if you override { @ link # entry set } , you may wish to override { @ link # size } to forward to this implementation

protected int standard size ( ) { return multisets linear time size impl ( this ) ; }


public void delete pet ( @ path param ( " pet id " ) long pet id , @ header param ( " api key " ) string api key ) ;


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


returns whether this node is marked as deleted

public boolean is cut ( ) { return is cut ; }


returns the number of milliseconds since time given by start nano time , which must have been previously returned from a call to { @ link system nano time ( ) }

long millis elapsed since ( long start nano time ) { return nanoseconds to millis ( system nano time ( ) - start nano time ) ; }


determines if the given property passes this filter

boolean select ( object object , d b p property descriptor property ) ;


optional choice of single - value field on which to diversify sampled search results

public void sample diversity field ( string name ) { sample diversity field = name ; }


formats a network address and port range for display purposes this formats the address with { @ link # format ( inet address ) } and appends the port range in brackets in case there is only one port , the result is the same with { @ link # format ( inet address , int ) } example output : i pv 4 no port : { @ code 127 0 0 1 } i pv 4 single port : { @ code 127 0 0 1 : 9300 } i pv 4 multiple ports : { @ code 127 0 0 1 : [ 9300 - 9400 ] } i pv 6 multiple ports : { @ code [ : : 1 ] : [ 9300 - 9400 ] }

public static string format ( inet address address , ports range ports range ) { objects require non null ( address ) ; string builder builder = new string builder ( ) ; int number of ports = ports range ports ( ) length ; if ( number of ports ! = 0 & & address instanceof inet 6 address ) { builder append ( inet addresses to uri string ( address ) ) ; } else { builder append ( inet addresses to addr string ( address ) ) ; } if ( number of ports ! = 0 ) { builder append ( ' : ' ) ; if ( number of ports = = 1 ) { builder append ( ports range get port range string ( ) ) ; } else { builder append ( " [ " ) append ( ports range get port range string ( ) ) append ( " ] " ) ; } } return builder to string ( ) ; }


determines an index ' s current state , with respect to whether its mappings can be updated

upgrade status get upgrade status ( cluster state cluster state , system index descriptor descriptor ) { final state index state = calculate index state ( cluster state , descriptor ) ; final string index description = " [ " + descriptor get primary index ( ) + " ] ( alias [ " + descriptor get alias name ( ) + " ] ) " ; / / the messages below will be logged on every cluster state update , which is why even in the index closed / red / / cases , the log levels are debug if ( index state index state = = index metadata state close ) { logger debug ( " index { } is closed this is likely to prevent some features from functioning correctly " , index description ) ; return upgrade status closed ; } if ( index state index health = = cluster health status red ) { logger debug ( " index { } health status is red , any pending mapping upgrades will wait until this changes " , index description ) ; return upgrade status unhealthy ; } if ( index state is index up to date = = false ) { logger debug ( " index { } is not on the current version features relying " + " on the index will not be available until the index is upgraded " , index description ) ; return upgrade status needs upgrade ; } else if ( index state mapping up to date ) { logger trace ( " index { } is up - to - date , no action required " , index description ) ; return upgrade status up to date ; } else { logger info ( " index { } mappings are not up - to - date and will be updated " , index description ) ; return upgrade status needs mappings update ; } }


updates the context register extent and clears the context register filter

public void update extent and clear filter ( context register extent context register extent ) { this extent = context register extent ; this register filter = null ; }


when should create static libraries is true , there are no actions created for static libraries

public cc linking helper set should create static libraries ( boolean emit static libraries ) { this should create static libraries = emit static libraries ; return this ; }


creates a ssl context provider used for retrieving a client - side ssl context

ssl context provider find or create client ssl context provider ( upstream tls context upstream tls context ) ;


creates and returns the task manager services

public static task manager services from configuration ( task manager services configuration task manager services configuration , permanent blob service permanent blob service , metric group task manager metric group , executor service io executor , fatal error handler fatal error handler ) throws exception { / / pre - start checks check temp dirs ( task manager services configuration get tmp dir paths ( ) ) ; final task event dispatcher task event dispatcher = new task event dispatcher ( ) ; / / start the i / o manager , it will create some temp directories final i o manager io manager = new i o manager async ( task manager services configuration get tmp dir paths ( ) ) ; final shuffle environment < ? , ? > shuffle environment = create shuffle environment ( task manager services configuration , task event dispatcher , task manager metric group , io executor ) ; final int listening data port = shuffle environment start ( ) ; final kv state service kv state service = kv state service from configuration ( task manager services configuration ) ; kv state service start ( ) ; final unresolved task manager location unresolved task manager location = new unresolved task manager location ( task manager services configuration get resource i d ( ) , task manager services configuration get external address ( ) , / / we expose the task manager location with the listening port / / iff the external data port is not explicitly defined task manager services configuration get external data port ( ) > 0 ? task manager services configuration get external data port ( ) : listening data port ) ; final broadcast variable manager broadcast variable manager = new broadcast variable manager ( ) ; final task slot table < task > task slot table = create task slot table ( task manager services configuration get number of slots ( ) , task manager services configuration get task executor resource spec ( ) , task manager services configuration get timer service shutdown timeout ( ) , task manager services configuration get page size ( ) , io executor ) ; final job table job table = default job table create ( ) ; final job leader service job leader service = new default job leader service ( unresolved task manager location , task manager services configuration get retrying registration configuration ( ) ) ; final string [ ] state root directory strings = task manager services configuration get local recovery state root directories ( ) ; final file [ ] state root directory files = new file [ state root directory strings length ] ; for ( int i = 0 ; i < state root directory strings length ; + + i ) { state root directory files [ i ] = new file ( state root directory strings [ i ] , local state sub directory root ) ; } final task executor local state stores manager task state manager = new task executor local state stores manager ( task manager services configuration is local recovery enabled ( ) , state root directory files , io executor ) ; final boolean fail on jvm metaspace oom error = task manager services configuration get configuration ( ) get boolean ( core options fail on user class loading metaspace oom ) ; final boolean check class loader leak = task manager services configuration get configuration ( ) get boolean ( core options check leaked classloader ) ; final library cache manager library cache manager = new blob library cache manager ( permanent blob service , blob library cache manager default class loader factory ( task manager services configuration get class loader resolve order ( ) , task manager services configuration get always parent first loader patterns ( ) , fail on jvm metaspace oom error ? fatal error handler : null , check class loader leak ) ) ; return new task manager services ( unresolved task manager location , task manager services configuration get managed memory size ( ) get bytes ( ) , io manager , shuffle environment , kv state service , broadcast variable manager , task slot table , job table , job leader service , task state manager , task event dispatcher , io executor , library cache manager ) ; }


invoke predicate by each storage type and bitwise and the results

public static boolean and by storage type ( predicate < storage type > predicate ) { boolean res = false ; for ( storage type type : storage type values ( ) ) { res & = predicate test ( type ) ; } return res ; }


put faketest - query - paramters to test the collection format in query parameters

default response entity < void > test query parameter collection format ( @ not null @ api param ( value = " " , required = true ) @ valid @ request param ( value = " pipe " , required = true ) list < string > pipe , @ not null @ api param ( value = " " , required = true ) @ valid @ request param ( value = " ioutil " , required = true ) list < string > ioutil , @ not null @ api param ( value = " " , required = true ) @ valid @ request param ( value = " http " , required = true ) list < string > http , @ not null @ api param ( value = " " , required = true ) @ valid @ request param ( value = " url " , required = true ) list < string > url , @ not null @ api param ( value = " " , required = true ) @ valid @ request param ( value = " context " , required = true ) list < string > context ) { return get delegate ( ) test query parameter collection format ( pipe , ioutil , http , url , context ) ; }


hash codes on statuses are not well defined

public int hash code ( ) { return super hash code ( ) ; }


test behavior when the named analysis component isn ' t defined on the index in that case we should build with defaults

public void test no index analyzers ( ) throws i o exception { / / refer to an analyzer by its type so we get its default configuration analyze action request request = new analyze action request ( ) ; request text ( " the quick brown fox " ) ; request analyzer ( " standard " ) ; analyze action response analyze = transport analyze action analyze ( request , registry , null , max token count ) ; list < analyze action analyze token > tokens = analyze get tokens ( ) ; assert equals ( 4 , tokens size ( ) ) ; / / we can refer to a pre - configured token filter by its name to get it request = new analyze action request ( ) ; request text ( " the qu 1ck brown fox " ) ; request tokenizer ( " standard " ) ; request add char filter ( " append " ) ; / / < - - no config , so use preconfigured filter analyze = transport analyze action analyze ( request , registry , null , max token count ) ; tokens = analyze get tokens ( ) ; assert equals ( 4 , tokens size ( ) ) ; assert equals ( " the " , tokens get ( 0 ) get term ( ) ) ; assert equals ( " qu 1ck " , tokens get ( 1 ) get term ( ) ) ; assert equals ( " brown " , tokens get ( 2 ) get term ( ) ) ; assert equals ( " foxfoo " , tokens get ( 3 ) get term ( ) ) ; / / if the preconfigured filter doesn ' t exist , we use a global filter with no settings request = new analyze action request ( ) ; request text ( " the qu 1ck brown fox " ) ; request tokenizer ( " standard " ) ; request add token filter ( " mock " ) ; / / < - - not preconfigured , but a global one available analyze = transport analyze action analyze ( request , registry , null , max token count ) ; tokens = analyze get tokens ( ) ; assert equals ( 3 , tokens size ( ) ) ; assert equals ( " qu 1ck " , tokens get ( 0 ) get term ( ) ) ; assert equals ( " brown " , tokens get ( 1 ) get term ( ) ) ; assert equals ( " fox " , tokens get ( 2 ) get term ( ) ) ; / / we can build a new char filter to get default values request = new analyze action request ( ) ; request text ( " the qu 1ck brown fox " ) ; request tokenizer ( " standard " ) ; request add token filter ( map of ( " type " , " mock " , " stopword " , " brown " ) ) ; request add char filter ( map of ( " type " , " append " ) ) ; / / < - - basic config , uses defaults analyze = transport analyze action analyze ( request , registry , null , max token count ) ; tokens = analyze get tokens ( ) ; assert equals ( 3 , tokens size ( ) ) ; assert equals ( " the " , tokens get ( 0 ) get term ( ) ) ; assert equals ( " qu 1ck " , tokens get ( 1 ) get term ( ) ) ; assert equals ( " foxbar " , tokens get ( 2 ) get term ( ) ) ; / / we can pass a new configuration request = new analyze action request ( ) ; request text ( " the qu 1ck brown fox " ) ; request tokenizer ( " standard " ) ; request add token filter ( map of ( " type " , " mock " , " stopword " , " brown " ) ) ; request add char filter ( map of ( " type " , " append " , " suffix " , " baz " ) ) ; analyze = transport analyze action analyze ( request , registry , null , max token count ) ; tokens = analyze get tokens ( ) ; assert equals ( 3 , tokens size ( ) ) ; assert equals ( " the " , tokens get ( 0 ) get term ( ) ) ; assert equals ( " qu 1ck " , tokens get ( 1 ) get term ( ) ) ; assert equals ( " foxbaz " , tokens get ( 2 ) get term ( ) ) ; }


sets the < code > ghidra file chooser < code > to allow the user to just select files , just select directories , or select both files and directories the default is < code > j files chooser files only < code >

public void set file selection mode ( int mode ) { this file selection mode = ghidra file chooser mode values ( ) [ mode ] ; }


prune files , in batches there ' s optionally a sleep between each batch

public long prune ( prune mode prune mode , long cutoff , string key prefix ) throws i o exception { log debug ( " prune { } under { } with age { } " , prune mode = = prune mode all by modtime ? " files and tombstones " : " tombstones " , key prefix , cutoff ) ; final item collection < scan outcome > items = expired files ( prune mode , cutoff , key prefix ) ; return inner prune ( prune mode , cutoff , key prefix , items ) ; }


notifies the view that the transform ended

void on transform end ( matrix transform ) ;


public string get index ( ) { return index ; }


unit test for an invalid output directory from a mnemonic via a dep transition integration test for top - level transition in srctestshellintegration : starlark configurations test # test invalid mnemonic from transition top level has to be an integration test because the error is emitted in build tool

public void invalid mnemonic from dep transition ( ) throws exception { write allowlist file ( ) ; scratch file ( " test / transitions bzl " , " def impl ( settings , attr ) : " , " return { ' / / command line option : cpu ' : ' / / bad : cpu ' } " , " my transition = transition ( implementation = impl , inputs = [ ] , " , " outputs = [ ' / / command line option : cpu ' ] ) " ) ; scratch file ( " test / rules bzl " , " load ( ' / / test : transitions bzl ' , ' my transition ' ) " , " def impl ( ctx ) : " , " return [ ] " , " my rule = rule ( " , " implementation = impl , " , " cfg = my transition , " , " attrs = { " , " ' allowlist function transition ' : attr label ( " , " default = ' / / tools / allowlists / function transition allowlist ' , " , " ) , " , " } ) " ) ; scratch file ( " test / build " , " load ( ' / / test : rules bzl ' , ' my rule ' ) " , " my rule ( name = ' bottom ' ) " , " genrule ( name = ' test ' , srcs = [ ' : bottom ' ] , outs = [ ' out ' ] , cmd = ' touch $ @ ' ) " ) ; reporter remove handler ( fail fast handler ) ; assert that ( get configured target ( " / / test : test " ) ) is null ( ) ; assert contains event ( " output directory name ' / / bad : cpu ' specified by cpp configuration is invalid as part of a " + " path : must not contain / " ) ; }


gets the root vertices of the given graph if this is a top - down navigator , then the sources are returned ; otherwise , the sinks are returned

public set < v > get sources ( g directed graph < v , e > graph ) { if ( is top down ) { return as set ( graph algorithms get sources ( graph ) ) ; } return as set ( graph algorithms get sinks ( graph ) ) ; }


copies all bytes from a file to an output stream < b > { @ link java nio file path } equivalent : < b > { @ link java nio file files # copy ( java nio file path , output stream ) }

public static void copy ( file from , output stream to ) throws i o exception { as byte source ( from ) copy to ( to ) ; }


tests that un - registration of task managers will free and remove all registered slots

public void test task manager unregistration ( ) throws exception { final task executor gateway task executor gateway = new testing task executor gateway builder ( ) set request slot function ( tuple 6 - > new completable future < > ( ) ) create testing task executor gateway ( ) ; final task executor connection task manager connection = create task executor connection ( task executor gateway ) ; final resource i d resource id = task manager connection get resource i d ( ) ; final slot i d slot id 1 = new slot i d ( resource id , 0 ) ; final slot i d slot id 2 = new slot i d ( resource id , 1 ) ; final slot report slot report = new slot report ( arrays as list ( create allocated slot status ( slot id 1 ) , create free slot status ( slot id 2 ) ) ) ; final resource requirements resource requirements = create resource requirements for single slot ( ) ; final default slot tracker slot tracker = new default slot tracker ( ) ; try ( declarative slot manager slot manager = create declarative slot manager builder ( ) set slot tracker ( slot tracker ) build and start with direct exec ( ) ) { slot manager register task manager ( task manager connection , slot report , resource profile any , resource profile any ) ; assert equals ( " the number registered slots does not equal the expected number " , 2 , slot manager get number registered slots ( ) ) ; slot manager process resource requirements ( resource requirements ) ; slot manager unregister task manager ( task manager connection get instance i d ( ) , test exception ) ; assert equals ( 0 , slot manager get number registered slots ( ) ) ; } }


public integer get int 3 2 ( ) { return int 3 2 ; }


create mount links as follows hdfs : localhost : xxx h d f s user - - > hdfs : localhost : xxx h d f s user hdfs : localhost : xxxlocal - - > file : test root d i rroot it cannot find any mount link view f s expects a mount point from root

public void test create on root ( ) throws exception { test create on root ( false ) ; }


returns the extra data record with the specified id , or null if it does not exist

public extra data get ( short id ) { return entries get ( id ) ; }


test case where the nn is configured with a name - only and an edits - only dir , with storage - restore turned on in this case , if the name - only dir disappears and comes back , a new checkpoint after it has been restored should function correctly

public void test checkpoint with separate dirs after name fails ( ) throws exception { mini d f s cluster cluster = null ; secondary name node secondary = null ; file current dir = null ; configuration conf = new hdfs configuration ( ) ; file base dir = new file ( mini d f s cluster get base directory ( ) ) ; conf set boolean ( d f s config keys dfs namenode name dir restore key , true ) ; conf set ( d f s config keys dfs namenode name dir key , mini d f s cluster get base directory ( ) + " / name - only " ) ; conf set ( d f s config keys dfs namenode edits dir key , mini d f s cluster get base directory ( ) + " / edits - only " ) ; conf set ( d f s config keys dfs namenode checkpoint dir key , file as u r i ( new file ( base dir , " namesecondary 1 " ) ) to string ( ) ) ; try { cluster = new mini d f s cluster builder ( conf ) num data nodes ( 0 ) format ( true ) manage name dfs dirs ( false ) build ( ) ; secondary = start secondary name node ( conf ) ; / / checkpoint once secondary do checkpoint ( ) ; / / now primary nn experiences failure of its only name dir - - fake by / / setting its current dir to a - x permissions namenode protocols nn = cluster get name node rpc ( ) ; n n storage storage = cluster get name node ( ) get f s image ( ) get storage ( ) ; storage directory sd 0 = storage get storage dir ( 0 ) ; assert equals ( name node dir type image , sd 0 get storage dir type ( ) ) ; current dir = sd 0 get current dir ( ) ; assert equals ( 0 , file util chmod ( current dir get absolute path ( ) , " 000 " ) ) ; / / try to upload checkpoint - - this should fail since there are no / / valid storage dirs try { secondary do checkpoint ( ) ; fail ( " did not fail to checkpoint when there are no valid storage dirs " ) ; } catch ( i o exception ioe ) { generic test utils assert exception contains ( " no targets in destination storage " , ioe ) ; } / / restore the good dir assert equals ( 0 , file util chmod ( current dir get absolute path ( ) , " 755 " ) ) ; nn restore failed storage ( " true " ) ; nn roll edit log ( ) ; / / checkpoint again - - this should upload to the restored name dir secondary do checkpoint ( ) ; assert n n has checkpoints ( cluster , immutable list of ( 8 ) ) ; assert parallel files invariant ( cluster , immutable list of ( secondary ) ) ; } finally { if ( current dir ! = null ) { file util chmod ( current dir get absolute path ( ) , " 755 " ) ; } cleanup ( secondary ) ; secondary = null ; cleanup ( cluster ) ; cluster = null ; } }


start an allocated container the < code > application master < code > or other applications that use the client must provide the details of the allocated container , including the id , the assigned node ' s id and the token via { @ link container } in addition , the am needs to provide the { @ link container launch context } as well

public abstract map < string , byte buffer > start container ( container container , container launch context container launch context ) throws yarn exception , i o exception ;


set whether to send the java collection type for each serialized collection default is " true "

public void set send collection type ( boolean send collection type ) { this serializer factory set send collection type ( send collection type ) ; }


called when a single loop of the animation is completed

void on animation completed ( int loop number ) ;


static grouping context group by ( list < ? extends expression > groupings ) { if ( groupings is empty ( ) ) { return null ; } map < integer , group by key > agg map = new linked hash map < > ( ) ; for ( expression exp : groupings ) { group by key key = null ; integer hash = integer value of ( exp hash code ( ) ) ; string agg id = expressions id ( exp ) ; / / change analyzed to non non - analyzed attributes if ( exp instanceof field attribute ) { field attribute field = ( field attribute ) exp ; field = field exact attribute ( ) ; key = new group by value ( agg id , field name ( ) ) ; } / / handle functions else if ( exp instanceof function ) { / / dates are handled differently because of date histograms if ( exp instanceof date time histogram function ) { date time histogram function dthf = ( date time histogram function ) exp ; expression field = dthf field ( ) ; if ( field instanceof field attribute ) { if ( dthf calendar interval ( ) ! = null ) { key = new group by date histogram ( agg id , query translator name of ( exp ) , dthf calendar interval ( ) , dthf zone id ( ) ) ; } else { key = new group by date histogram ( agg id , query translator name of ( exp ) , dthf fixed interval ( ) , dthf zone id ( ) ) ; } } / / use scripting for functions else if ( field instanceof function ) { script template script = ( ( function ) field ) as script ( ) ; if ( dthf calendar interval ( ) ! = null ) { key = new group by date histogram ( agg id , script , dthf calendar interval ( ) , dthf zone id ( ) ) ; } else { key = new group by date histogram ( agg id , script , dthf fixed interval ( ) , dthf zone id ( ) ) ; } } } / / all other scalar functions become a script else if ( exp instanceof scalar function ) { scalar function sf = ( scalar function ) exp ; key = new group by value ( agg id , sf as script ( ) ) ; } / / histogram else if ( exp instanceof grouping function ) { if ( exp instanceof histogram ) { histogram h = ( histogram ) exp ; expression field = h field ( ) ; / / date histogram if ( is date based ( h data type ( ) ) ) { object value = h interval ( ) value ( ) ; / / interval of exactly 1 year or 1 month if ( value instanceof interval year month & & ( ( ( interval year month ) value ) interval ( ) equals ( period of years ( 1 ) ) | | ( ( interval year month ) value ) interval ( ) equals ( period of months ( 1 ) ) ) ) { period year month = ( ( interval year month ) value ) interval ( ) ; string calendar interval = year month equals ( period of years ( 1 ) ) ? year interval : month interval ; / / when the histogram is ` interval ' 1 ' year ` or ` interval ' 1 ' month ` , the interval used in / / the es date histogram will be a calendar interval with value " 1y " or " 1m " respectively if ( field instanceof field attribute ) { key = new group by date histogram ( agg id , query translator name of ( field ) , calendar interval , h zone id ( ) ) ; } else if ( field instanceof function ) { key = new group by date histogram ( agg id , ( ( function ) field ) as script ( ) , calendar interval , h zone id ( ) ) ; } } / / interval of exactly 1 day else if ( value instanceof interval day time & & ( ( interval day time ) value ) interval ( ) equals ( duration of days ( 1 ) ) ) { / / when the histogram is ` interval ' 1 ' day ` the interval used in / / the es date histogram will be a calendar interval with value " 1d " if ( field instanceof field attribute ) { key = new group by date histogram ( agg id , query translator name of ( field ) , day interval , h zone id ( ) ) ; } else if ( field instanceof function ) { key = new group by date histogram ( agg id , ( ( function ) field ) as script ( ) , day interval , h zone id ( ) ) ; } } / / all other intervals will be fixed intervals expressed in ms else { long interval as millis = intervals in millis ( h interval ( ) ) ; / / when the histogram in sql is applied on date type instead of datetime , the interval / / specified is truncated to the multiple of a day if the interval specified is less / / than 1 day , then the interval used will be ` interval ' 1 ' day ` if ( h data type ( ) = = date ) { interval as millis = date utils min day interval ( interval as millis ) ; } if ( field instanceof field attribute ) { key = new group by date histogram ( agg id , query translator name of ( field ) , interval as millis , h zone id ( ) ) ; } else if ( field instanceof function ) { key = new group by date histogram ( agg id , ( ( function ) field ) as script ( ) , interval as millis , h zone id ( ) ) ; } } } / / numeric histogram else { if ( field instanceof field attribute | | field instanceof function ) { double interval = ( double ) sql data type converter convert ( foldables value of ( h interval ( ) ) , data types double ) ; if ( field instanceof field attribute ) { key = new group by numeric histogram ( agg id , query translator name of ( field ) , interval ) ; } else { key = new group by numeric histogram ( agg id , ( ( function ) field ) as script ( ) , interval ) ; } } } if ( key = = null ) { throw new sql illegal argument exception ( " unsupported histogram field { } " , field ) ; } } else { throw new sql illegal argument exception ( " unsupproted grouping function { } " , exp ) ; } } / / bumped into into an invalid function ( which should be caught by the verifier ) else { throw new sql illegal argument exception ( " cannot group by function { } " , exp ) ; } } / / catch corner - case else { throw new sql illegal argument exception ( " cannot group by { } " , exp ) ; } agg map put ( hash , key ) ; } return new grouping context ( agg map ) ; }


scan all the blocks held on a datanodes for a node being decommissioned we assume that the majority of blocks on the node will need to have new replicas made , and therefore we do not check if they are under replicated here and instead add them to the list of blocks to track for a node being moved into maintenance , we assume most blocks will be replicated ok and hence we do check their under - replicated status here , hopefully reducing the number of blocks to track on a re - scan ( inital scan = false ) we assume the node has been processed already , and hence there should be few under - replicated blocks , so we check the under - replicated status before adding the blocks to the tracking list this means that for a node being decomission there should be a large number of blocks to process later but for maintenance , a smaller number as this method does not schedule any blocks for reconstuction , this scan can be performed under the namenode readlock , and the lock is dropped and reaquired for each storage on the dn

private void scan datanode storage ( datanode descriptor dn , boolean initial scan ) { hash map < block info , integer > block list = out of service node blocks get ( dn ) ; if ( block list = = null ) { block list = new hash map < > ( ) ; out of service node blocks put ( dn , block list ) ; } datanode storage info [ ] storage ; namesystem read lock ( ) ; try { storage = dn get storage infos ( ) ; } finally { namesystem read unlock ( ) ; } for ( datanode storage info s : storage ) { namesystem read lock ( ) ; try { / / as the lock is dropped and re - taken between each storage , we need / / to check the storage is still present before processing it , as it / / may have been removed if ( dn get storage info ( s get storage i d ( ) ) = = null ) { continue ; } iterator < block info > it = s get block iterator ( ) ; while ( it has next ( ) ) { block info b = it next ( ) ; if ( ! initial scan | | dn is entering maintenance ( ) ) { / / this is a rescan , so most blocks should be replicated now , / / or this node is going into maintenance on a healthy / / cluster using racks or upgrade domain , a node should be / / able to go into maintenance without replicating many blocks / / so we will check them immediately if ( ! is block replicated ok ( dn , b , false , null ) ) { block list put ( b , null ) ; } } else { block list put ( b , null ) ; } num blocks checked + + ; } } finally { namesystem read unlock ( ) ; } } }


associate the specified value with the specified key in this cache if the cache previously contained a mapping for this key , the old value is replaced by the specified value actual registration may be performed in an asynchronous or deferred fashion , with subsequent lookups possibly not seeing the entry yet this may for example be the case with transactional cache decorators use { @ link # put if absent } for guaranteed immediate registration

void put ( object key , @ nullable object value ) ;


adds the given values to the dataset the stream will be completely consumed by this method

public void add all ( long stream values ) { add all ( values collect ( stats accumulator : : new , stats accumulator : : add , stats accumulator : : add all ) ) ; }


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


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


times and records the duration of event should not throw exceptions , for that use the { @ link # time ( callable ) } method

public < t > t time supplier ( supplier < t > event ) { final long start time = clock get tick ( ) ; try { return event get ( ) ; } finally { update ( clock get tick ( ) - start time ) ; } }


returns a required broadcast shuffle type

public static required shuffle broadcast ( ) { return new required shuffle ( shuffle type broadcast ) ; }


equivalent of { @ link android opengl gles20 # gl tex sub image 2 d ( int , int , int , int , int , int , int , int , buffer ) } where < code > buffer < code > contains pixels of the current frame

public void gl tex sub image 2 d ( int target , int level ) { m gif info handle gl tex sub image 2 d ( target , level ) ; }


public void set custom load more view ( view customview ) { custom load more view = customview ; }


locates a given method anywhere in the class inheritance hierarchy

public static method find method ( object instance , string name , class < ? > parameter types ) throws no such method exception { for ( class < ? > clazz = instance get class ( ) ; clazz ! = null ; clazz = clazz get superclass ( ) ) { try { method method = clazz get declared method ( name , parameter types ) ; if ( ! method is accessible ( ) ) { method set accessible ( true ) ; } return method ; } catch ( no such method exception e ) { / / ignore and search next } } throw new no such method exception ( " method " + name + " with parameters " + arrays as list ( parameter types ) + " not found in " + instance get class ( ) ) ; }


returns { @ link method } instances for the read tests that assume multisets support duplicates so that the test of { @ code multisets for set ( ) } can suppress them

public static list < method > get count duplicate initializing methods ( ) { return arrays as list ( helpers get method ( multiset count tester class , " test count 3 " ) ) ; }


check whether a service reference has been set , and whether it matches the specified service

protected void check service interface ( ) throws illegal argument exception { class < ? > service interface = get service interface ( ) ; assert not null ( service interface , " property ' service interface ' is required " ) ; object service = get service ( ) ; if ( service instanceof string ) { throw new illegal argument exception ( " service [ " + service + " ] is a string " + " rather than an actual service reference : have you accidentally specified " + " the service bean name as value instead of as reference ? " ) ; } if ( ! service interface is instance ( service ) ) { throw new illegal argument exception ( " service interface [ " + service interface get name ( ) + " ] needs to be implemented by service [ " + service + " ] of class [ " + service get class ( ) get name ( ) + " ] " ) ; } }


pause existing requests with the given tag use { @ link # resume tag ( object ) } to resume requests with the given tag

public void pause tag ( @ non null object tag ) { check not null ( tag , " tag = = null " ) ; dispatcher dispatch pause tag ( tag ) ; }


see { @ link file status # get access time ( ) }


called when the window content is damaged and needs to be refreshed when this occurs , { @ link lwjgl 3 graphics # request rendering ( ) } is automatically called


reset all indexed colors with the default color from the color theme

public void reset ( ) { system arraycopy ( color scheme m default colors , 0 , m current colors , 0 , text style num indexed colors ) ; }


sets whether to acquire or release the { @ link wifi lock } the wifi lock will not be acquired unless handling has been enabled through { @ link # set enabled ( boolean ) }

public void set stay awake ( boolean stay awake ) { this stay awake = stay awake ; update wifi lock ( ) ; }


public counter counter ( string name ) { return noop counter instance ; }


move any pending nodes into out of service node blocks to initiate the decommission or maintenance mode process this method must be executed under the namenode write lock to prevent the pending nodes list from being modified externally

private void process pending nodes ( ) { while ( ! pending nodes is empty ( ) & & ( max concurrent tracked nodes = = 0 | | out of service node blocks size ( ) < max concurrent tracked nodes ) ) { out of service node blocks put ( pending nodes poll ( ) , null ) ; } }


adjust { @ code item } using specific { @ code sparse index map }

protected t adjust item ( abstract index map index map , t item ) { return item ; }


< code > required uint 6 4 client protocol version = 3 ; < code > protocol version of class declaring the called method


public static void do and ignore ( final checked consumer < object > consumer , final object params ) { unchecked consumer ( s - > consumer accept ( params ) ) accept ( null ) ; }


delete user this can only be done by the logged in user < b > 400 < b > - invalid username supplied < b > 404 < b > - user not found

public void delete user ( string username , map < string , object > params ) throws i o exception { delete user for http response ( username , params ) ; }


set the path to use for this nested aggregation the path must match the path to a nested object in the mappings if it is not specified then this aggregation will go back to the root document

public reverse nested aggregation builder path ( string path ) { if ( path = = null ) { throw new illegal argument exception ( " [ path ] must not be null : [ " + name + " ] " ) ; } this path = path ; return this ; }


get the objs associated with the given address

public object [ ] get objects ( address addr ) { object objarray [ ] = get obj ( addr map get key ( addr ) ) ; return objarray ; }


make a clean target source available if code wants to use it the target must be set verification will be automatic in tear down to ensure that it was used appropriately by code

public void set up ( ) { mock target source reset ( ) ; }


get the interface class of the dubbo proxy which be generated by javaassist

public static class < ? > get assist interface ( object proxy bean ) throws no such field exception , security exception , illegal argument exception , illegal access exception , no such method exception , invocation target exception { if ( proxy bean = = null ) { return null ; } if ( ! is dubbo proxy name ( proxy bean get class ( ) get name ( ) ) ) { return null ; } field handler field = proxy bean get class ( ) get declared field ( " handler " ) ; handler field set accessible ( true ) ; object invoker invocation handler = handler field get ( proxy bean ) ; field invoker field = invoker invocation handler get class ( ) get declared field ( " invoker " ) ; invoker field set accessible ( true ) ; object invoker = invoker field get ( invoker invocation handler ) ; field failover cluster invoker field = invoker get class ( ) get declared field ( " invoker " ) ; failover cluster invoker field set accessible ( true ) ; object failover cluster invoker = failover cluster invoker field get ( invoker ) ; return ( class < ? > ) reflection util invoke method ( failover cluster invoker , " get interface " ) ; }


public double get double ( ) { return double ; }


initializes the connection to rmq using the default connection factory from { @ link # setup connection factory ( ) } the user may override this method to setup and configure their own { @ link connection }

protected connection setup connection ( ) throws exception { return setup connection factory ( ) new connection ( ) ; }


creates a new { @ code sorted set multimap } that uses the provided map and factory it can generate a multimap based on arbitrary { @ link map } and { @ link sorted set } classes the { @ code factory } - generated and { @ code map } classes determine the multimap iteration order they also specify the behavior of the { @ code equals } , { @ code hash code } , and { @ code to string } methods for the multimap and its returned views however , the multimap ' s { @ code get } method returns instances of a different class than { @ code factory get ( ) } does the multimap is serializable if { @ code map } , { @ code factory } , the sets generated by { @ code factory } , and the multimap contents are all serializable the multimap is not threadsafe when any concurrent operations update the multimap , even if { @ code map } and the instances generated by { @ code factory } are concurrent read operations will work correctly to allow concurrent update operations , wrap the multimap with a call to { @ link # synchronized sorted set multimap } call this method only when the simpler methods { @ link tree multimap # create ( ) } and { @ link tree multimap # create ( comparator , comparator ) } won ' t suffice note : the multimap assumes complete ownership over of { @ code map } and the sets returned by { @ code factory } those objects should not be manually updated and they should not use soft , weak , or phantom references

public static < k , v > sorted set multimap < k , v > new sorted set multimap ( map < k , collection < v > > map , final supplier < ? extends sorted set < v > > factory ) { return new custom sorted set multimap < > ( map , factory ) ; }


creates a { @ link name resolver } for the given target uri , or { @ code null } if the given uri cannot be resolved by this factory the decision should be solely based on the scheme of the uri

public name resolver new name resolver ( uri target uri , final attributes params ) { args args = args new builder ( ) set default port ( params get ( params default port ) ) set proxy detector ( params get ( params proxy detector ) ) set synchronization context ( params get ( params sync context ) ) set service config parser ( params get ( params parser ) ) build ( ) ; return new name resolver ( target uri , args ) ; }


finds the lowest - order bit set at or after the given index in the given { @ code int }

public static int find first ( int value , int idx ) { value & = ~ ( ( 1 < < idx ) - 1 ) ; / / mask off too - low bits int result = integer number of trailing zeros ( value ) ; return ( result = = 32 ) ? - 1 : result ; }


public void cancel ( configuration conf ) throws i o exception , interrupted exception { get renewer ( ) cancel ( this , conf ) ; }


upgrades a connection with transport encryption by the specified symmetric cipher

public connection encrypt connection ( secret key session key , string algorithm ) throws i o exception , general security exception { cipher cout = cipher get instance ( algorithm ) ; cout init ( cipher encrypt mode , session key , create iv ( session key ) ) ; cipher output stream o = new cipher output stream ( out , cout ) ; cipher cin = cipher get instance ( algorithm ) ; cin init ( cipher decrypt mode , session key , create iv ( session key ) ) ; cipher input stream i = new cipher input stream ( in , cin ) ; return new connection ( i , o ) ; }


join records of this stream with { @ link global k table } ' s records using non - windowed inner equi join the join is a primary key table lookup join with join attribute { @ code key value mapper map ( stream key value ) = = table key } " table lookup join " means , that results are only computed if { @ code k stream } records are processed this is done by performing a lookup for matching records in the current internal { @ link global k table } state in contrast , processing { @ link global k table } input records will only update the internal { @ link global k table } state and will not produce any result records for each { @ code k stream } record that finds a corresponding record in { @ link global k table } the provided { @ link value joiner } will be called to compute a value ( with arbitrary type ) for the result record the key of the result record is the same as the key of this { @ code k stream } if a { @ code k stream } input record key or value is { @ code null } the record will not be included in the join operation and thus no output record will be added to the resulting { @ code k stream } if { @ code key value mapper } returns { @ code null } implying no match exists , no output record will be added to the resulting { @ code k stream }

< gk , gv , rv > k stream < k , rv > join ( final global k table < gk , gv > global table , final key value mapper < ? super k , ? super v , ? extends gk > key selector , final value joiner < ? super v , ? super gv , ? extends rv > joiner ) ;


creates a bit matrix by sampling the provided image top left , top right , bottom right , and bottom left are the centers of the squares on the diagonal just outside the bull ' s eye

private bit matrix sample grid ( bit matrix image , result point top left , result point top right , result point bottom right , result point bottom left ) throws not found exception { grid sampler sampler = grid sampler get instance ( ) ; int dimension = get dimension ( ) ; float low = dimension / 2 0f - nb center layers ; float high = dimension / 2 0f + nb center layers ; return sampler sample grid ( image , dimension , dimension , low , low , / / topleft high , low , / / topright high , high , / / bottomright low , high , / / bottomleft top left get x ( ) , top left get y ( ) , top right get x ( ) , top right get y ( ) , bottom right get x ( ) , bottom right get y ( ) , bottom left get x ( ) , bottom left get y ( ) ) ; }


copies playback info with new loading state

public playback info copy with is loading ( boolean is loading ) { return new playback info ( timeline , period id , requested content position us , playback state , playback error , is loading , track groups , track selector result , loading media period id , play when ready , playback suppression reason , playback parameters , buffered position us , total buffered duration us , position us , offload scheduling enabled ) ; }


creates a new { @ code bloom filter } that ' s a copy of this instance the new instance is equal to this instance but shares no mutable state

public bloom filter < t > copy ( ) { return new bloom filter < t > ( bits copy ( ) , num hash functions , funnel , strategy ) ; }


get the byte value for the specified field

public byte get byte value ( int col index ) { return field values [ col index ] get byte value ( ) ; }


private void assert id ( meter id meter id , string name , meter id meter type type , list < meter id tag > tags ) { assert assert equals ( name , meter id get name ( ) ) ; assert assert equals ( type , meter id get type ( ) ) ; assert assert equals ( tags , meter id get tags ( ) ) ; }