recursively evaluatesinterprets the starlark file at a given path and its transitive starlark dependencies using a fake build api and collects information about all rule definitions made in those files

private module recursive eval ( starlark semantics semantics , label label , list < rule info wrapper > rule info list , list < provider info wrapper > provider info list , list < aspect info wrapper > aspect info list , immutable map builder < label , string > module doc map ) throws interrupted exception , i o exception , label syntax exception , starlark evaluation exception { path path = path of label ( label , semantics ) ; if ( pending contains ( path ) ) { throw new starlark evaluation exception ( " cycle with " + path ) ; } else if ( loaded contains key ( path ) ) { return loaded get ( path ) ; } pending add ( path ) ; / / add fake build api immutable map builder < string , object > env = immutable map builder ( ) ; fake api add predeclared ( env , rule info list , provider info list , aspect info list ) ; add more predeclared ( env ) ; module module = module with predeclared ( semantics , env build ( ) ) ; / / parse & compile ( and get doc ) parser input input = get input source ( path to string ( ) ) ; program prog ; try { starlark file file = starlark file parse ( input , file options default ) ; module doc map put ( label , get module doc ( file ) ) ; prog = program compile file ( file , module ) ; } catch ( syntax error exception ex ) { event replay events on ( event handler , ex errors ( ) ) ; throw new starlark evaluation exception ( ex get message ( ) ) ; } / / process loads map < string , module > imports = new hash map < > ( ) ; for ( string load : prog get loads ( ) ) { label relative label = label get relative with remapping ( load , immutable map of ( ) ) ; try { module loaded module = recursive eval ( semantics , relative label , rule info list , provider info list , aspect info list , module doc map ) ; imports put ( load , loaded module ) ; } catch ( no such file exception no such file exception ) { throw new starlark evaluation exception ( string format ( " file % s imported ' % s ' , yet % s was not found , even at roots % s " , path , load , path of label ( relative label , semantics ) , dep roots ) , no such file exception ) ; } } / / execute try ( mutability mu = mutability create ( " skydoc " ) ) { starlark thread thread = new starlark thread ( mu , semantics ) ; / / we use the default print handler , which writes to stderr thread set loader ( imports : : get ) ; / / fake bazel ' s " export " hack , by which provider symbols / / bound to global variables take on the name of the global variable thread set post assign hook ( ( name , value ) - > { if ( value instanceof fake provider api ) { ( ( fake provider api ) value ) set name ( name ) ; } } ) ; starlark exec file program ( prog , module , thread ) ; } catch ( eval exception ex ) { throw new starlark evaluation exception ( ex get message with stack ( ) ) ; } pending remove ( path ) ; loaded put ( path , module ) ; return module ; }


returns a pseudorandom , uniformly distributed value between 0 ( inclusive ) and the specified value ( exclusive )

public long next long ( long n ) { if ( n < = 0 ) { throw new illegal argument exception ( " n must be positive " ) ; } / / divide n by two until small enough for next int on each / / iteration ( at most 31 of them but usually much less ) , / / randomly choose both whether to include high bit in result / / ( offset ) and whether to continue with the lower vs upper / / half ( which makes a difference only if odd ) long offset = 0 ; while ( n > = integer max value ) { int bits = next ( 2 ) ; long half = n > > > 1 ; long nextn = ( ( bits & 2 ) = = 0 ) ? half : n - half ; if ( ( bits & 1 ) = = 0 ) { offset + = n - nextn ; } n = nextn ; } return offset + next int ( ( int ) n ) ; }


adds the necessary providers to the { @ code builder } adds an { @ link android idl provider } to the target , and adds the transitive generated idl jars to the idl jars output group this also generates the actions to compile the aidl files to java , as well as the jar and srcjar files consisting of only the idl - generated source and class files

public void add transitive info providers ( rule configured target builder builder , artifact class jar , artifact manifest proto output ) { if ( ! translated idl sources is empty ( ) ) { generate android idl compilation actions ( rule context , android idl provider , translated idl sources ) ; create idl class jar action ( rule context , class jar , translated idl sources values ( ) , manifest proto output , idl class jar , idl source jar ) ; } builder add native declared provider ( android idl provider ) add output group ( idl jars output group , android idl provider get transitive idl jars ( ) ) ; }


returns a color string of the format rrrgggbbb as an example , { @ link color # red } would be returned as 255000000 ( the values are padded with 0s to make to fill up 3 digits per component )

public static string to r g b string ( color color ) { string builder buffy = new string builder ( ) ; buffy append ( string utilities pad ( integer to string ( color get red ( ) ) , ' 0 ' , 3 ) ) ; buffy append ( string utilities pad ( integer to string ( color get green ( ) ) , ' 0 ' , 3 ) ) ; buffy append ( string utilities pad ( integer to string ( color get blue ( ) ) , ' 0 ' , 3 ) ) ; return buffy to string ( ) ; }


public boolean get attribute boolean ( ) { return attribute boolean ; }


see { @ link file status # is snapshot enabled ( ) }


public void remove node ( @ non null node n ) throws i o exception { nodes remove node ( n ) ; }


public float get float ( string key , float def ) { object tmp = m map get ( key ) ; return tmp instanceof number ? ( ( number ) tmp ) float value ( ) : def ; }


add extra middlemen artifacts that should be built by reverse dependency binaries this method exists solely to support the unfortunate legacy behavior of some rules ; new uses should not be added

public builder add legacy extra middleman ( artifact middleman ) { preconditions check argument ( middleman is middleman artifact ( ) , middleman ) ; extra middlemen builder add ( middleman ) ; return this ; }


public static string md 5 file ( string full filename ) { string result = null ; if ( full filename ! = null ) { input stream is = null ; try { is = new buffered input stream ( new file input stream ( full filename ) ) ; result = md 5 file ( is ) ; } catch ( exception e ) { throw new runtime exception ( e ) ; } finally { i o helper close quietly ( is ) ; } } return result ; }


returns whether the given method calls the invokedynamic instruction

public static boolean invokes dynamically ( method method ) { method optimization info info = method optimization info get method optimization info ( method ) ; return info = = null | | info invokes dynamically ( ) ; }


writes a byte to this file , starting at the current file pointer

public void write ( byte b ) throws i o exception { check open ( ) ; write ( new byte [ ] { b } , 0 , 1 ) ; }


schedules a task that must happen during app startup in a blocking fashion

public @ non null app startup add blocking ( @ non null string name , @ non null runnable task ) { blocking add ( new task ( name , task ) ) ; return this ; }


set the fallback protocol negotiator pass null to unset a previously set value

public xds channel builder fallback protocol negotiator ( internal protocol negotiator protocol negotiator fallback protocol negotiator ) { this fallback protocol negotiator = fallback protocol negotiator ; return this ; }


set the next record range which is going to be processed by task

public void set next record range ( sorted ranges range next record range ) { this next record range = next record range ; }


public static final string escape hidden dir prefix chars ( string name ) { int prefix count = count hidden dir prefix chars ( name ) ; if ( prefix count = = 0 ) { return name ; } string builder buf = new string builder ( ) ; / / keep number of hidden prefix chars even for ( int i = 0 ; i < prefix count ; + + i ) { buf append ( hidden dir prefix char ) ; } buf append ( name ) ; return buf to string ( ) ; }


return true if there is no in - flight request directed at the given node and false otherwise

public boolean is empty ( string node ) { deque < network client in flight request > queue = requests get ( node ) ; return queue = = null | | queue is empty ( ) ; }


tests if the specified key - value pair has been cached in open s s l - to - java cache

static boolean is o 2 j cached ( string key , string protocol , string value ) { map < string , string > p 2j = o 2j get ( key ) ; if ( p 2j = = null ) { return false ; } else { return value equals ( p 2j get ( protocol ) ) ; } }


sets the parallelism for this sink the degree must be higher than zero

public data stream sink < t > set parallelism ( int parallelism ) { transformation set parallelism ( parallelism ) ; return this ; }


traverse every entry in the table , invoking { @ link consumer # accept ( object ) } on each

public void for each ( consumer < table entry < integer > > consumer ) { for ( map entry < table entry key , integer > ent : map entry set ( ) ) { consumer accept ( new table entry < > ( ent get key ( ) get state ( ) , ent get key ( ) get sym ( ) , ent get value ( ) ) ) ; } }


validate a value against the set of regular expressions returning the array of matched groups

public string [ ] match ( string value ) { if ( value = = null ) { return null ; } for ( pattern pattern : patterns ) { matcher matcher = pattern matcher ( value ) ; if ( matcher matches ( ) ) { int count = matcher group count ( ) ; string [ ] groups = new string [ count ] ; for ( int j = 0 ; j < count ; j + + ) { groups [ j ] = matcher group ( j + 1 ) ; } return groups ; } } return null ; }


return a custom path matcher to use for the patterns request condition , if any

public path matcher get path matcher ( ) { return this path matcher ; }


list < t > find all by app ( string app name ) ; / /


convert any exception into a { @ link runtime exception } if the caught exception is already of that type , it is typecast to a { @ link runtime exception } and returned all other exception types are wrapped in a new instance of { @ code service state exception }

public static runtime exception convert ( string text , throwable fault ) { if ( fault instanceof runtime exception ) { return ( runtime exception ) fault ; } else { return new service state exception ( text , fault ) ; } }


returns an immutable sorted set containing the given elements sorted by the given { @ code comparator } when multiple elements are equivalent according to { @ code compare to ( ) } , only the first one specified is included

public static < e > immutable sorted set < e > copy of ( comparator < ? super e > comparator , iterator < ? extends e > elements ) { return new builder < e > ( comparator ) add all ( elements ) build ( ) ; }


close this { @ link bzip 2 encoder } and so finish the encoding the given { @ link channel future } will be notified once the operation completes and will also be returned

public channel future close ( final channel promise promise ) { channel handler context ctx = ctx ( ) ; event executor executor = ctx executor ( ) ; if ( executor in event loop ( ) ) { return finish encode ( ctx , promise ) ; } else { executor execute ( new runnable ( ) { @ override public void run ( ) { channel future f = finish encode ( ctx ( ) , promise ) ; f add listener ( new channel promise notifier ( promise ) ) ; } } ) ; return promise ; } }


sets whether the translation gesture is enabled or not

public void set translation enabled ( boolean enabled ) { m is translation enabled = enabled ; }


returns the set of types that can be assigned to { @ code type index }

private set < integer > find assignable types ( dex dex , int type index ) { set < integer > assignable types = new hash set < integer > ( ) ; assignable types add ( type index ) ; for ( class def class def : dex class defs ( ) ) { if ( assignable types contains ( class def get supertype index ( ) ) ) { assignable types add ( class def get type index ( ) ) ; continue ; } for ( int implemented : class def get interfaces ( ) ) { if ( assignable types contains ( implemented ) ) { assignable types add ( class def get type index ( ) ) ; break ; } } } return assignable types ; }


build the insert string based on configuration and meta - data information

public string create insert string ( string generated key names ) { set < string > keys = new linked hash set < > ( generated key names length ) ; for ( string key : generated key names ) { keys add ( key to upper case ( ) ) ; } string builder insert statement = new string builder ( ) ; insert statement append ( " insert into " ) ; if ( get schema name ( ) ! = null ) { insert statement append ( get schema name ( ) ) ; insert statement append ( " " ) ; } insert statement append ( get table name ( ) ) ; insert statement append ( " ( " ) ; int column count = 0 ; for ( string column name : get table columns ( ) ) { if ( ! keys contains ( column name to upper case ( ) ) ) { column count + + ; if ( column count > 1 ) { insert statement append ( " , " ) ; } insert statement append ( column name ) ; } } insert statement append ( " ) values ( " ) ; if ( column count < 1 ) { if ( this generated key columns used ) { if ( logger is debug enabled ( ) ) { logger debug ( " unable to locate non - key columns for table ' " + get table name ( ) + " ' so an empty insert statement is generated " ) ; } } else { throw new invalid data access api usage exception ( " unable to locate columns for table ' " + get table name ( ) + " ' so an insert statement can ' t be generated " ) ; } } string params = string join ( " , " , collections n copies ( column count , " ? " ) ) ; insert statement append ( params ) ; insert statement append ( " ) " ) ; return insert statement to string ( ) ; }


prepare the base allocation response use last s c response and last heartbeat time stamp to assemble entries about cluster - wide info , e g available resource , num cluster nodes

protected allocate response generate base allocation response ( ) { allocate response base response = record factory new record instance ( allocate response class ) ; base response set available resources ( resource new instance ( 0 , 0 ) ) ; base response set num cluster nodes ( 0 ) ; set < sub cluster id > expired s c = get timed out s cs ( false ) ; for ( entry < sub cluster id , allocate response > entry : last s c response entry set ( ) ) { if ( expired s c contains ( entry get key ( ) ) ) { / / skip expired sub - clusters continue ; } allocate response response = entry get value ( ) ; if ( response get available resources ( ) ! = null ) { base response set available resources ( resources add ( base response get available resources ( ) , response get available resources ( ) ) ) ; } base response set num cluster nodes ( base response get num cluster nodes ( ) + response get num cluster nodes ( ) ) ; } return base response ; }


set the soap action uri to specify on the stub

public void set soap action uri ( @ nullable string soap action uri ) { this soap action uri = soap action uri ; }


returns { @ code true } iff this attribute requires documentation

public boolean is documented ( ) { return ! get property flag ( property flag undocumented ) ; }


< code > pattern < code > argument that matches the given regular expression see examples in javadoc for { @ link argument matchers } class

public static string matches ( pattern pattern ) { report matcher ( new matches ( pattern ) ) ; return " " ; }


given an argv array such as might be passed to execve ( 2 ) , returns a string that can be copied and pasted into a bourne shell for a similar effect

public static string pretty print argv ( list < string > argv ) { string builder buf = new string builder ( ) ; for ( string arg : argv ) { if ( buf length ( ) > 0 ) { buf append ( ' ' ) ; } buf append ( shell escape ( arg ) ) ; } return buf to string ( ) ; }


returns the queue ' s next element and removes it , the queue is non - empty otherwise , this method returns null the method throws an { @ code illegal state exception } if the queue is closed checking whether the queue is open and removing the next element is one atomic operation this method never blocks

public e poll ( ) { lock lock ( ) ; try { if ( open ) { if ( elements size ( ) > 0 ) { return elements remove first ( ) ; } else { return null ; } } else { throw new illegal state exception ( " queue is closed " ) ; } } finally { lock unlock ( ) ; } }


this method extracts the actual queue name from an app add event currently unfortunately application placement context and application submission context are used in a quite erratic way , this method helps to get the proper placement path for the queue if placement context is provided

private string get added app queue name ( app added scheduler event app added event ) { / / app added event uses the queue from application submission context but in / / the case of cs it may be only a leaf name due to legacy reasons string ret = app added event get queue ( ) ; application placement context placement context = app added event get placement context ( ) ; / / if we have a placement context , it means a mapping rule made a decision / / about the queue placement , so we use those data , it is supposed to be in / / sync with the application submission context and app added event get queue , but / / because of the aforementioned legacy reasons these two may only contain / / the leaf queue name if ( placement context ! = null ) { string leaf name = placement context get queue ( ) ; string parent name = placement context get parent queue ( ) ; if ( leaf name ! = null ) { / / building the proper queue path from the parent and leaf queue name ret = placement context has parent queue ( ) ? ( parent name + " " + leaf name ) : leaf name ; } } return ret ; }


whether this handler supports the given { @ link handler result }

boolean supports ( handler result result ) ;


public void test proc time temporal join ( ) throws exception { temporal process time join operator join operator = new temporal process time join operator ( row type , join condition , 0 , 0 , false ) ; keyed two input stream operator test harness < row data , row data , row data , row data > test harness = create test harness ( join operator ) ; test harness open ( ) ; test harness set processing time ( 1 ) ; test harness process element 1 ( insert record ( 1l , " 1a 1 " ) ) ; test harness set processing time ( 2 ) ; test harness process element 2 ( insert record ( 2l , " 2a 2 " ) ) ; test harness set processing time ( 3 ) ; test harness process element 1 ( insert record ( 2l , " 2a 3 " ) ) ; test harness set processing time ( 4 ) ; test harness process element 2 ( insert record ( 1l , " 1a 4 " ) ) ; test harness set processing time ( 5 ) ; test harness process element 1 ( insert record ( 1l , " 1a 5 " ) ) ; list < object > expected output = new array list < > ( ) ; expected output add ( insert record ( 2l , " 2a 3 " , 2l , " 2a 2 " ) ) ; expected output add ( insert record ( 1l , " 1a 5 " , 1l , " 1a 4 " ) ) ; assertor assert output equals ( " output wrong " , expected output , test harness get output ( ) ) ; test harness close ( ) ; }


public socket address get sender ( ) { return sender ; }


function which returns { @ code null } ( type : void )

public static < t > function < t , void > null fn ( ) { return ( function < t , void > ) null fn ; }


returns the message template for the error code

public string get template ( ) { return msg ; }


public long next ( ) { if ( has next ( ) ) { does have next = false ; does have previous = true ; return current ; } throw new no such element exception ( " no more indexes " ) ; }


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


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


< code > optional uint 3 2 data = 2 ; < code >

public int get data ( ) { return instance get data ( ) ; }


apply a force to the center of mass this wakes up the body

public void apply force to center ( vector 2 force , boolean wake ) { tmp set ( force x , force y ) ; body apply force to center ( tmp ) ; }


verify space quota by storage type is violated once quota is set relevant method { @ link directory with quota feature # verify quota by storage type }

public void verify quota by storage type ( ) throws d s quota exceeded exception { for ( storage type t : storage type get types supporting quota ( ) ) { long type quota = get type quota ( t ) ; if ( type quota = = hdfs constants quota reset ) { continue ; } long type consumed = get type consumed ( t ) ; if ( quota is violated ( type quota , type consumed ) ) { throw new d s quota exceeded exception ( type quota , type consumed ) ; } } }


echo the request headers from a client into response headers and trailers useful for testing end - to - end metadata propagation

private static server interceptor echo request headers interceptor ( final metadata key < ? > keys ) { final set < metadata key < ? > > key set = new hash set < > ( arrays as list ( keys ) ) ; return new server interceptor ( ) { @ override public < req t , resp t > server call listener < req t > intercept call ( server call < req t , resp t > call , final metadata request headers , server call handler < req t , resp t > next ) { return next start call ( new simple forwarding server call < req t , resp t > ( call ) { @ override public void send headers ( metadata response headers ) { response headers merge ( request headers , key set ) ; super send headers ( response headers ) ; } @ override public void close ( status status , metadata trailers ) { trailers merge ( request headers , key set ) ; super close ( status , trailers ) ; } } , request headers ) ; } } ; }


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


public float get max length ( ) { return joint get max length ( ) ; }


build the accompanying kubernetes resources that should be introduced to support this feature this could only be applicable on the client - side submission process

list < has metadata > build accompanying kubernetes resources ( ) throws i o exception ;


clear the current status - same as set status text ( " " ) without being recorded


public void set capacity ( int new capacity ) { if ( capacity > new capacity ) { clear ( ) ; / / behavior can be modified to accommodate for decrease in cache size for now , we ' ll / / just clear the cache } else { this capacity = new capacity ; } }


sets the state of zoo keeper server after changing the state , it notifies the server state change to a registered shutdown handler , if any the following are the server state transitions : during startup the server will be in the initial state after successfully starting , the server sets the state to running the server transitions to the error state if it hits an internal error { @ link zoo keeper server listener impl } notifies any critical resource error events , e g , sync request processor not being able to write a txn to disk during shutdown the server sets the state to shutdown , which corresponds to the server not running

protected void set state ( state state ) { this state = state ; / / notify server state changes to the registered shutdown handler , if any if ( zk shutdown handler ! = null ) { zk shutdown handler handle ( state ) ; } else { log debug ( " z k shutdown handler is not registered , so zoo keeper server " + " won ' t take any action on error or shutdown server state changes " ) ; } }


shows the batch import dialog ( via run swing later ) and prompts the user to select a file if the supplied { @ code batch info } is empty the dialog will chain to the { @ link import batch task } when the user clicks the ok button

public static void show and import ( plugin tool tool , batch info batch info , list < fsrl > initial files , domain folder default folder , program manager program manager ) { batch import dialog dialog = new batch import dialog ( batch info , default folder ) ; dialog set program manager ( program manager ) ; system utilities run swing later ( ( ) - > { dialog build ( ) ; if ( initial files ! = null & & ! initial files is empty ( ) ) { dialog add sources ( initial files ) ; } if ( ! dialog setup initial defaults ( ) ) { return ; } tool show dialog ( dialog ) ; } ) ; }


returns the addresses that are to indicate the difference of this comparison type for this object

public address set get address set ( object obj , program program ) { address set addrs = new address set ( ) ; if ( obj = = null ) { return addrs ; } address addr = ( address ) obj ; addrs add range ( addr , addr ) ; return addrs ; }


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

public static fields find by name ( string name ) { return by name get ( name ) ; }


returns true if the newly added vertices are callers of the source vertex ; false if the newly added vertices are called by the source vertex

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


public object current metric value ( metric name metric name ) { kafka metric metric = metrics by name get ( metric name ) ; return metric ! = null ? metric metric value ( ) : null ; }


subclasses of compiled expression generated by spel compiler will provide an implementation of this method

public abstract object get value ( @ nullable object target , @ nullable evaluation context context ) throws evaluation exception ;


set the { @ link error notifier } pass null to unset a previously set value

public xds server builder error notifier ( error notifier error notifier ) { this error notifier = error notifier ; return this ; }


public annotation read annotation ( ) { ensure four bytes aligned ( table of contents annotations , false ) ; return super read annotation ( ) ; }


the forecast expiration in seconds ( duration added to start time )

public long get expires in ( ) { return expires in ; }


return true if the system id denotes an absolute uri the same algorithm can be seen in { @ link uri } , but implementing this by ourselves allow it to be more lenient about escaping of uri

public static boolean is absolute uri ( @ non null string uri ) { int idx = uri index of ( ' : ' ) ; if ( idx < 0 ) return false ; / / no ' : ' can ' t be absolute / / # , ? , and / must not be before ' : ' return idx < index of ( uri , ' # ' ) & & idx < index of ( uri , ' ? ' ) & & idx < index of ( uri , ' / ' ) ; }


public collection < string > local j v m classpath ( ) { return split classpath ( system get property ( " java class path " ) ) ; }


always applies the interceptor if the " track all invocations " flag has been set ; else just kicks in if the log is enabled

protected boolean is interceptor enabled ( method invocation invocation , log logger ) { return ( this track all invocations | | is log enabled ( logger ) ) ; }


public void photo urls test ( ) { / / todo : test photo urls }


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

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


return a provider for the specified bean , allowing for lazy on - demand retrieval of instances , including availability and uniqueness options

< t > object provider < t > get bean provider ( class < t > required type , boolean allow eager init ) ;


public static void add activity lifecycle callbacks ( final utils activity lifecycle callbacks callbacks ) { utils bridge add activity lifecycle callbacks ( callbacks ) ; }


public static boolean is portrait ( ) { return utils get app ( ) get resources ( ) get configuration ( ) orientation = = configuration orientation portrait ; }


if the first parameter is of type join point or proceeding join point , bind " this join point " as parameter name and return true , else return false

private boolean maybe bind this join point ( ) { if ( ( this argument types [ 0 ] = = join point class ) | | ( this argument types [ 0 ] = = proceeding join point class ) ) { bind parameter name ( 0 , this join point ) ; return true ; } else { return false ; } }


this implementation creates a smart mime message , holding the specified default encoding and default file type map this special defaults - carrying message will be autodetected by { @ link mime message helper } , which will use the carried encoding and file type map unless explicitly overridden

public mime message create mime message ( ) { return new smart mime message ( get session ( ) , get default encoding ( ) , get default file type map ( ) ) ; }


public order place order ( order body ) throws api exception , processing exception ;


returns a future that completes when the in - flight requests that were registered prior to calling this method are deregistered

public completable future < void > await async ( ) { phaser arrive and deregister ( ) ; return termination future ; }


returns media period based on the provided filterable manifest

media period create media period ( t manifest , int period index ) ;


returns statistics over a dataset containing the given values the stream will be completely consumed by this method if you have a { @ code stream < double > } rather than a { @ code double stream } , you should collect the values using { @ link # to stats ( ) } instead

public static stats of ( double stream values ) { return values collect ( stats accumulator : : new , stats accumulator : : add , stats accumulator : : add all ) snapshot ( ) ; }


finds the singular tool action by the given name if more than one action exists with that name , then an exception is thrown if you want more than one matching action , the call { @ link # get actions by name ( tool , string ) } instead < p > note : more specific test case subclasses provide other methods for finding actions when you have an owner name ( which is usually the plugin name )

public static docking action if get action ( tool tool , string name ) { set < docking action if > actions = get actions by name ( tool , name ) ; if ( actions is empty ( ) ) { return null ; } if ( actions size ( ) > 1 ) { throw new assertion failed error ( " found more than one action for name ' " + name + " ' " ) ; } return collection utils any ( actions ) ; }


returns < code > true < code > iff the { @ link index metadata } for a given index has changed between the previous cluster state and the new cluster state note that this is an object reference equality test , not an equals test

public static boolean index metadata changed ( index metadata metadata 1 , index metadata metadata 2 ) { assert metadata 1 ! = null & & metadata 2 ! = null ; / / no need to check on version , since disco modules will make sure to use the / / same instance if its a version match return metadata 1 ! = metadata 2 ; }


public float get float ( ) { return float ; }


encode and get the url request parameters

private string encode request params ( map < string , string > params map , charset charset ) { if ( charset = = null ) { throw new illegal argument exception ( " charset is not allowed to be null " ) ; } if ( params map = = null | | params map is empty ( ) ) { return " " ; } try { string builder params builder = new string builder ( ) ; for ( entry < string , string > entry : params map entry set ( ) ) { if ( entry get key ( ) = = null | | entry get value ( ) = = null ) { continue ; } params builder append ( u r l encoder encode ( entry get key ( ) , charset name ( ) ) ) append ( " = " ) append ( u r l encoder encode ( entry get value ( ) , charset name ( ) ) ) append ( " & " ) ; } if ( params builder length ( ) > 0 ) { / / remove the last ' & ' params builder delete ( params builder length ( ) - 1 , params builder length ( ) ) ; } return params builder to string ( ) ; } catch ( throwable e ) { record log warn ( " encode request params fail " , e ) ; return " " ; } }


gets the { @ link channel option # so linger } option


creates an empty { @ code tree based table } that is ordered by the specified comparators

public static < r , c , v > tree based table < r , c , v > create ( comparator < ? super r > row comparator , comparator < ? super c > column comparator ) { check not null ( row comparator ) ; check not null ( column comparator ) ; return new tree based table < > ( row comparator , column comparator ) ; }


remove all activities from this local activity manager , performing an { @ link activity # on destroy } on any that are currently instantiated

public void remove all activities ( ) { dispatch destroy ( true ) ; }


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


adds a text button to the button table the dialog must have been constructed with a skin to use this method

public dialog button ( @ null string text , @ null object object ) { if ( skin = = null ) throw new illegal state exception ( " this method may only be used if the dialog was constructed with a skin " ) ; return button ( text , object , skin get ( text button style class ) ) ; }


delegates to the { @ link log # warn ( object ) } method of the underlying { @ link log } instance

public void warn ( string msg ) { logger warn ( msg ) ; }


test low - level failure handling with low level delete request

public void test multi object delete no permissions ( ) throws throwable { describe ( " delete the landsat csv file and expect it to fail " ) ; path csv path = maybe get csv path ( ) ; s 3 a file system fs = ( s 3 a file system ) csv path get file system ( get configuration ( ) ) ; list < delete objects request key version > keys = build delete request ( new string [ ] { fs path to key ( csv path ) , " missing - key csv " } ) ; multi object delete exception ex = intercept ( multi object delete exception class , ( ) - > fs remove keys ( keys , false , null ) ) ; final list < path > undeleted = extract undeleted paths ( ex , fs : : key to qualified path ) ; string undeleted files = join ( undeleted ) ; fail if ( undeleted size ( ) ! = 2 , " undeleted list size wrong : " + undeleted files , ex ) ; assert true ( " no csv in " + undeleted files , undeleted contains ( csv path ) ) ; / / and a full split , after adding a new key string marker = " / marker " ; path marker path = fs key to qualified path ( marker ) ; keys add ( new delete objects request key version ( marker ) ) ; pair < list < key path > , list < key path > > pair = new multi object delete support ( fs create store context ( ) , null ) split undeleted keys ( ex , keys ) ; assert equals ( undeleted , to path list ( pair get left ( ) ) ) ; list < key path > right = pair get right ( ) ; assertions assert that ( right ) has size ( 1 ) ; assert equals ( marker path , right get ( 0 ) get path ( ) ) ; }


add a key - value pair to the { @ link map bind parameter source }

map bind parameter source add value ( string param name , object value ) { assert not null ( param name , " parameter name must not be null " ) ; assert not null ( value , " value must not be null " ) ; this values put ( param name , parameter from or empty ( value , value get class ( ) ) ) ; return this ; }


gets the underlying netty { @ link http 2 stream } for this stream

public http 2 stream http 2 stream ( ) { return http 2 stream ; }


indicates to the cache replication monitor that there have been cache manager changes that require a rescan

public void set needs rescan ( ) { preconditions check argument ( lock is held by current thread ( ) , " must hold the crm lock when setting the needs rescan bit " ) ; if ( cur scan count > = 0 ) { / / if there is a scan in progress , we need to wait for the scan after / / that needed scan count = cur scan count + 1 ; } else { / / if there is no scan in progress , we need to wait for the next scan needed scan count = completed scan count + 1 ; } }


hook for client or server specific typed writers

protected void extend typed writers ( list < http message writer < ? > > typed writers ) { }


adds interceptors that will be called before the channel performs its real work this is functionally equivalent to using { @ link client interceptors # intercept ( channel , client interceptor ) } , but while still having access to the original { @ code managed channel } interceptors run in the reverse order in which they are added , just as with consecutive calls to { @ code client interceptors intercept ( ) }

public abstract t intercept ( client interceptor interceptors ) ;


test a point for containment in this fixture this only works for convex shapes

public boolean test point ( final vec 2 p ) { return m shape test point ( m body m xf , p ) ; }


stops forcing the app into landscape orientation

default void end force landscape ( ) { }


unmarshals the given graph to the given x stream hierarchical stream writer converts exceptions using { @ link # convert x stream exception }

private object do unmarshal ( hierarchical stream reader stream reader , @ nullable data holder data holder ) { try { return get x stream ( ) unmarshal ( stream reader , null , data holder ) ; } catch ( exception ex ) { throw convert x stream exception ( ex , false ) ; } }


public void put ( @ non null final string key , final serializable value ) { put ( key , value , - 1 ) ; }


adds a route to the given handler function that handles http { @ code options } requests

builder options ( handler function < server response > handler function ) ;


public static void expand click area ( @ non null final view view , final int expand size ) { expand click area ( view , expand size , expand size , expand size , expand size ) ; }


create a ( built ) response with the given asynchronous response parameter { @ code async response } can be a { @ link completable future completable future & lt ; server response & gt ; } or { @ link publisher publisher & lt ; server response & gt ; } ( or any asynchronous producer of a single { @ code server response } that can be adapted via the { @ link reactive adapter registry } ) this method can be used to set the response status code , headers , and body based on an asynchronous result if only the body is asynchronous , { @ link body builder # body ( object ) } can be used instead

static server response async ( object async response ) { return default async server response create ( async response , null ) ; }


return the string representation of the object in the output format for description of the options ,

public string to string ( boolean q option , boolean h option , boolean x option ) { return to string ( q option , h option , false , x option , null ) ; }


write a list of serializers and their corresponding config snapshots to the provided data output view this method writes in a fault tolerant way , so that when read again using { @ link # read serializers and configs with resilience ( data input view , class loader ) } , if deserialization of the serializer fails , its configuration snapshot will remain intact specifically , all written serializers and their config snapshots are indexed by their offset positions within the serialized bytes the serialization format is as follows : 1 number of serializer and configuration snapshot pairs 2 offsets of each serializer and configuration snapshot , in order 3 total number of bytes for the serialized serializers and the config snapshots 4 serialized serializers and the config snapshots

public static void write serializers and configs with resilience ( data output view out , list < tuple 2 < type serializer < ? > , type serializer snapshot < ? > > > serializers and configs ) throws i o exception { try ( byte array output stream with pos buffer with pos = new byte array output stream with pos ( ) ; data output view stream wrapper buffer wrapper = new data output view stream wrapper ( buffer with pos ) ) { out write int ( serializers and configs size ( ) ) ; for ( tuple 2 < type serializer < ? > , type serializer snapshot < ? > > ser and conf snapshot : serializers and configs ) { out write int ( buffer with pos get position ( ) ) ; write serializer ( buffer wrapper , ser and conf snapshot f 0 ) ; out write int ( buffer with pos get position ( ) ) ; type serializer snapshot serialization util write serializer snapshot ( buffer wrapper , ( type serializer snapshot ) ser and conf snapshot f 1 , ser and conf snapshot f 0 ) ; } out write int ( buffer with pos get position ( ) ) ; out write ( buffer with pos get buf ( ) , 0 , buffer with pos get position ( ) ) ; } }


gets the proto representation of the python user - defined aggregate functions to be executed

public flink fn api user defined aggregate functions get user defined functions proto ( ) { flink fn api user defined aggregate functions builder builder = super get user defined functions proto ( ) to builder ( ) ; builder set count star inserted ( count star inserted ) ; return builder build ( ) ; }


test transition to active when namenode in safemode

public void test transition to active when safe mode ( ) throws exception { configuration config = new configuration ( ) ; config set boolean ( dfs ha nn not become active in safemode , true ) ; try ( mini d f s cluster mini cluster = new mini d f s cluster builder ( config , new file ( generic test utils get randomized temp path ( ) ) ) nn topology ( mini d f s n n topology simple h a topology ( ) ) num data nodes ( 1 ) build ( ) ) { mini cluster wait active ( ) ; mini cluster transition to standby ( 0 ) ; mini cluster transition to standby ( 1 ) ; name node namenode 0 = mini cluster get name node ( 0 ) ; name node namenode 1 = mini cluster get name node ( 1 ) ; name node adapter enter safe mode ( namenode 0 , false ) ; name node adapter enter safe mode ( namenode 1 , false ) ; lambda test utils intercept ( service failed exception class , " name node still not leave safemode " , ( ) - > mini cluster transition to active ( 0 ) ) ; } }


public void skip bits ( int num bits ) { int num bytes = num bits / 8 ; byte offset + = num bytes ; bit offset + = num bits - ( num bytes * 8 ) ; if ( bit offset > 7 ) { byte offset + + ; bit offset - = 8 ; } assert valid offset ( ) ; }


get topics ( max 10 ) for our project id : the topic list is logged to the logger

public void get topics ( string project i d ) { logger log ( level info , " will try to get topics for project { 0 } " , project i d ) ; list topics request request = list topics request new builder ( ) set page size ( 10 ) / / get max 10 topics set project ( project i d ) / / for our project i d build ( ) ; list topics response response ; try { response = blocking stub list topics ( request ) ; } catch ( status runtime exception e ) { logger log ( level warning , " rpc failed : { 0 } " , e get status ( ) ) ; return ; } logger log ( level info , " topics list : \ n { 0 } " , response get topics list ( ) ) ; }


returns true if this context represents a type that can be null

boolean can be null ( ) { return ! ( type instanceof primitive type ) ; }


returns the one code block contained by addr ( only for a model that has shared subroutines would this method return more than one code block )

public code block [ ] get code blocks containing ( address addr , task monitor monitor ) throws cancelled exception { code block sub = get first code block containing ( addr , monitor ) ; if ( sub = = null ) { return empty block array ; } code block [ ] blocks = new code block [ 1 ] ; blocks [ 0 ] = sub ; return blocks ; }


publishes the task event to all subscribed event listeners

public void publish ( task event event ) { synchronized ( listeners ) { for ( event listener < task event > listener : listeners get ( event get class ( ) ) ) { listener on event ( event ) ; } } }


initialize properties by reading name , values from the given filename

private static void load ( string path name ) throws i o exception { / / create properties msg info ( preferences class , " loading user preferences : " + path name ) ; properties = new properties ( ) ; filename = path name ; file file = new file ( path name ) ; if ( file exists ( ) ) { try ( file input stream in = new file input stream ( path name ) ) { properties load ( in ) ; } } / / try to load a previous installation ' s preferences so that they are usable as a / / reference point for those clients that wish to maintain previous values note that / / not all previous values should be used in a new application , as that may / / cause issues when running ; for example , path preferences can cause compile issues load previous installation preferences ( ) ; }


records the caller ' s current stack trace and the specified additional arbitrary information so that the { @ link resource leak detector } can tell where the leaked resource was accessed lastly


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


checks a programs memory for direct references to the addresses indicated in the to address set direct references are only found at addresses that match the indicated alignment each direct reference is added to the direct reference list as a fromto address pair

public static void load direct reference list ( program program , int alignment , address to address , address set view to address set , accumulator < reference address pair > accumulator , task monitor monitor ) throws cancelled exception { if ( monitor = = null ) { monitor = task monitor adapter dummy monitor ; } memory memory = program get memory ( ) ; boolean is big endian = memory is big endian ( ) ; int unit size = to address get address space ( ) get addressable unit size ( ) ; / / number of bytes per addressable unit int addr size = to address get size ( ) ; short current segment = 0 ; if ( to address set = = null | | to address set get num addresses ( ) = = 1 ) { set < address > ref addrs = find direct references ( program , alignment , to address , monitor ) ; iterator < address > ref addr iter = ref addrs iterator ( ) ; while ( ref addr iter has next ( ) & & ! monitor is cancelled ( ) ) { accumulator add ( new reference address pair ( ref addr iter next ( ) , to address ) ) ; } return ; } / / just looking for the offset into the segment now , not the whole segment / offset pair if ( to address instanceof segmented address ) { segmented address seg addr = ( segmented address ) to address ; current segment = ( short ) seg addr get segment ( ) ; } / / iterate over addresses in program address iterator addr it = memory get loaded and initialized address set ( ) get addresses ( true ) ; monitor initialize ( memory get num addresses ( ) ) ; int count = 0 ; while ( addr it has next ( ) ) { monitor check canceled ( ) ; address a = addr it next ( ) ; + + count ; monitor set progress ( count ) ; if ( ( a get offset ( ) % alignment ) ! = 0 ) { continue ; } long addr long = 0 ; long addr long shifted = 0 ; try { if ( to address instanceof segmented address ) { short offset short = memory get short ( a ) ; offset short & = offset short & 0xffff ; / / this is checking to see if the ref is in the same segment as the to addr - not sure this is needed anymore / / segmented address sega = ( ( segmented address ) a ) ; / / short short sega = ( short ) ( sega get segment ( ) ) ; / / short sega & = short sega & 0xffff ; / / if ( offset short = = short current offset ) { /


public float get float ( ) { return float ; }


convert a path component that contains backslash ecape sequences to a literal string this is necessary when you want to explicitly refer to a path that contains globber metacharacters

private static string unescape path component ( string name ) { return name replace all ( " \ \ \ \ ( ) " , " $ 1 " ) ; }


test to verify that the checksum can be computed with greater than file length

public void test striped file checksum with missed data blocks range query 1 9 ( ) throws exception { int file length = 100 ; string striped file 3 = ec dir + " / striped file checksum 3 " ; prepare test files ( file length , new string [ ] { striped file 3 } ) ; test striped file checksum with missed data blocks range query ( striped file 3 , file length * 2 ) ; }


return a local map spill index file created earlier

public path get spill index file ( int spill number ) throws i o exception { return l dir alloc get local path to read ( m r job config output + " / spill " + spill number + " out index " , get conf ( ) ) ; }


the program was restored from an undo redo operation so reload it

void reload program ( boolean check root ) { if ( current program = = null ) { / / can happen when the swing update manager fires after the program has been closed return ; } listing listing = current program get listing ( ) ; string [ ] tree names = listing get tree names ( ) ; for ( string element : tree names ) { program dn d tree tree = get tree ( element ) ; if ( tree ! = null ) { reload tree ( tree , check root ) ; } } }


scenario : we got a lot of jobs all of the sudden , and we need to fire up a few nodes

@ test public void load spike ( ) throws exception { try ( bulk change bc = new bulk change ( r jenkins ) ) { dummy cloud impl cloud = init hudson ( 0 ) ; verify successful completion ( build all ( create 5 slow jobs ( new latch ( 5 ) ) ) ) ; / / the time it takes to complete a job is eternally long compared to the time it takes to launch / / a new slave , so in this scenario we end up allocating 5 slaves for 5 jobs assert equals ( 5 , cloud num provisioned ) ; } }


create a readable and parseable audit log string for a successful event

public static void log success ( string user , string operation , string target , application id app id , application attempt id attempt id ) { if ( log is info enabled ( ) ) { log info ( create success log ( user , operation , target , app id , attempt id , null , null ) ) ; } }


find and return the first aspect j annotation on the given method ( there should only be one anyway )

protected static aspect j annotation < ? > find aspect j annotation on method ( method method ) { for ( class < ? > clazz : aspectj annotation classes ) { aspect j annotation < ? > found annotation = find annotation ( method , ( class < annotation > ) clazz ) ; if ( found annotation ! = null ) { return found annotation ; } } return null ; }


is the file a magic file : this predicate doesn ' t check for the fs actually having the magic bit being set

private boolean is magic file ( list < string > elements ) { return is magic path ( elements ) & & ! is commit metadata file ( elements ) ; }


determines if the block is full and ready for compression

boolean is full ( ) { return block length > block length limit ; }


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


returns variables assigned by each iteration may be a compound target such as { @ code ( a [ b ] , c d ) }

public expression get vars ( ) { return vars ; }


sets the ( new ) value of the { @ code range } header

public void set range ( list < http range > ranges ) { string value = http range to string ( ranges ) ; set ( range , value ) ; }


partially expands variable value at the given offset if some of the variable references , used in the value , can not be found , they are left unexpanded

public ninja variable value get reduced value ( long offset , ninja variable value value , immutable set < string > variables to not expand , interner < string > interner ) { / / cache expanded variables values to save time replacing several references to the same / / variable / / this cache is local to the offset , it depends on the offset of the variable we are expanding map < string , string > cache = maps new hash map ( ) ; / / we are using the start offset of the value holding the reference to the variable / / do the same as ninja implementation : if the variable is not found , use empty string function < string , string > expander = ref - > compute expanded string ( offset , ref , cache , variables to not expand , interner ) ; return value reduce ( expander ) ; }


find data source in all available registries deprecated triggering all projects open may cause issues ( especially when they are secured )

public static d b p data source container find data source ( string data source id ) { d b p workspace workspace = d b workbench get platform ( ) get workspace ( ) ; for ( d b p project project : workspace get projects ( ) ) { d b p data source registry data source registry = project get data source registry ( ) ; if ( data source registry ! = null ) { d b p data source container data source container = data source registry get data source ( data source id ) ; if ( data source container ! = null ) { return data source container ; } } } return null ; }


create a panel for the diff details and auto update checkbox

private j panel create diff details panel ( ) { j panel panel = new j panel ( new border layout ( ) ) ; panel set preferred size ( new dimension ( 600 , 400 ) ) ; j scroll pane scrolled details = create details pane ( ) ; panel add ( scrolled details , border layout center ) ; create auto update check box ( ) ; create filter diffs check box ( ) ; j panel bottom panel = new j panel ( ) ; bottom panel set layout ( new box layout ( bottom panel , box layout x axis ) ) ; bottom panel add ( box create horizontal glue ( ) ) ; bottom panel add ( auto update c b ) ; bottom panel add ( box create horizontal strut ( 10 ) ) ; bottom panel add ( filter diffs c b ) ; bottom panel add ( box create horizontal glue ( ) ) ; panel add ( bottom panel , border layout south ) ; return panel ; }


implementation of record reader : : get current value ( )

public v get current value ( ) throws i o exception , interrupted exception { return chunk get reader ( ) get current value ( ) ; }


given an offset , populate vbytes with the associated set of deserialized value bytes should only be called during a spill

private void get v bytes for offset ( int kvoff , in mem val bytes vbytes ) { / / get the keystart for the next serialized value to be the end / / of this value if this is the last value in the buffer , use bufend final int vallen = kvmeta get ( kvoff + vallen ) ; assert vallen > = 0 ; vbytes reset ( kvbuffer , kvmeta get ( kvoff + valstart ) , vallen ) ; }


issue : add at least one assertion to this test case solution : inserted assertion to check whether the execution of the main method in { @ link app } throws an exception

void should execute application without exception ( ) { assert does not throw ( ( ) - > app main ( new string [ ] { } ) ) ; }


public void select healthy instances clusters ( ) throws exception { string service name = random domain name ( ) ; naming register instance ( service name , " 127 0 0 1 " , test port , " c 1 " ) ; naming register instance ( service name , " 127 0 0 2 " , 9090 , " c 2 " ) ; time unit seconds sleep ( 8 ) ; list < instance > instances = naming select instances ( service name , arrays as list ( " c 1 " , " c 2 " ) , true ) ; time unit seconds sleep ( 2 ) ; assert assert equals ( instances size ( ) , 2 ) ; list < instance > instances get = naming get all instances ( service name ) ; assert assert true ( verify instance list ( instances , instances get ) ) ; }


get the record key offset within the buffer

private int get record key offset ( int index ) { return buffer get int ( header size + ( index * entry size ) ) ; }


returns the upper value ( inclusive ) of the leading source

comparable get upper value lead source ( ) throws i o exception { return size ( ) > = max size ? arrays [ 0 ] to comparable ( top ( ) ) : null ; }


equality is implemented in support of tests , not for use in hash collections , since this class is mutable

public int hash code ( ) { throw new unsupported operation exception ( " processor record context is unsafe for use in hash collections " ) ; }


compares the mappings from the template and the index and asserts they are the same the assertion error message details the differences in the mappings the mappings , which are maps of maps , are flattened with the keys built from the keys of the sub - maps appended to the parent key this makes diffing the 2 maps easier and diffs more comprehensible the meta field is not compared as it contains version numbers that change even when the mappings don ' t mistakes happen and some indices may be stuck with the incorrect mappings that cannot be fixed without re - index in this case use the { @ code exceptions } parameter to filter out fields in the index mapping that are not in the template each exception should be a ' ' separated path to the value e g { @ code properties analysis analysis field type }

public static void assert legacy template matches index mappings ( rest client client , string template name , string index name , boolean not an error if index does not exist , set < string > exceptions , boolean allow system index warnings ) throws i o exception { request get template = new request ( " get " , " template / " + template name ) ; response template response = client perform request ( get template ) ; assert equals ( " missing template [ " + template name + " ] " , 200 , template response get status line ( ) get status code ( ) ) ; map < string , object > template mappings = ( map < string , object > ) x content map values extract value ( e s rest test case entity as map ( template response ) , template name , " mappings " ) ; assert not null ( template mappings ) ; request get index mapping = new request ( " get " , index name + " / mapping " ) ; if ( allow system index warnings ) { final string system index warning = " this request accesses system indices : [ " + index name + " ] , but in a future major version , " + " direct access to system indices will be prevented by default " ; get index mapping set options ( e s rest test case expect version specific warnings ( v - > { v current ( system index warning ) ; v compatible ( system index warning ) ; } ) ) ; } response index mapping response ; try { index mapping response = client perform request ( get index mapping ) ; } catch ( response exception e ) { if ( e get response ( ) get status line ( ) get status code ( ) = = 404 & & not an error if index does not exist ) { return ; } else { throw e ; } } assert equals ( " error getting mappings for index [ " + index name + " ] " , 200 , index mapping response get status line ( ) get status code ( ) ) ; map < string , object > index mappings = ( map < string , object > ) x content map values extract value ( e s rest test case entity as map ( index mapping response ) , index name , " mappings " ) ; assert not null ( index mappings ) ; / / ignore the meta field index mappings remove ( " meta " ) ; template mappings remove ( " meta " ) ; / / we cannot do a simple comparison of mappings e g / / objects equals ( index mappings , template mappings ) because some / / templates use strings for the boolean values - " true " and " false " / / which are automatically converted to booleans causing the equality / / to fail boolean mappings are the same = true ; / / flatten the map of maps map < string , object > flat template map = flatten map ( template mappings ) ; map < string , object > flat index map = flatten map ( index mappings ) ; sorted set < string > keys in template missing from index = new tree set < > ( flat template map key set ( ) ) ; keys in template missing from index remove all ( flat index map key set ( ) ) ; keys in template missing from index remove all ( exceptions ) ; sorted set < string > keys in index missing from template = new tree set < > ( flat index map key set ( ) ) ; keys in index missing from template remove all ( flat template map key set ( ) ) ; / / in the case of object fields the ' type : object ' mapping is set by default / / if this does not explicitly appear in the template it is not an error / / as es has added the default to the index mappings keys in index missing from template remove if ( key - > key ends with ( " type " ) & & " object " equals ( flat index map get ( key ) ) ) ; / / remove the exceptions keys in index missing from template remove all ( exceptions ) ; string builder error messsage = new string builder ( " error the template mappings [ " ) append ( template name ) append ( " ] and index mappings [ " ) append ( index name ) append ( " ] are not the same " ) append ( system line separator ( ) ) ; if ( keys in template missing from index is empty ( ) = = false ) { mappings are the same = false ; error messsage append ( " keys in the template missing from the index mapping : " ) append ( keys in template missing from index ) append ( system line separator ( ) ) ; } if ( keys in index missing from template is empty ( ) = = false ) { mappings are the same = false ; error messsage append ( " keys in the index missing from the template mapping : " ) append ( keys in index missing from template ) append ( system line separator ( ) ) ; } / / find values that are different for the same key set < string > common keys = new tree set < > ( flat index map key set ( ) ) ; common keys retain all ( flat template map key set ( ) ) ; for ( string key : common keys ) { object template = flat template map get ( key ) ; object index = flat index map get ( key ) ; if ( objects equals ( template , index ) = = false ) { / / both maybe be booleans but different representations if ( are boolean objects and equal ( index , template ) ) { continue ; } mappings are the same = false ; error messsage append ( " values for key [ " ) append ( key ) append ( " ] are different " ) append ( system line separator ( ) ) ; error messsage append ( " template value [ " ) append ( template ) append ( " ] " ) append ( template get class ( ) get simple name ( ) ) append ( system line separator ( ) ) ; error messsage append ( " index value [ " ) append ( index ) append ( " ] " ) append ( index get class ( ) get simple name ( ) ) append ( system line separator ( ) ) ; } } if ( mappings are the same = = false ) { fail ( error messsage to string ( ) ) ; } }


< code > optional aapt pb primitive prim = 7 ; < code >

private void set prim ( com android aapt resources primitive builder builder for value ) { prim = builder for value build ( ) ; bit field 0 | = 0x 0 0 0 0 0 0 4 0 ; }


copies the metadata from a hit to the request

protected request wrapper < ? > copy metadata ( request wrapper < ? > request , scrollable hit source hit doc ) { copy routing ( request , doc get routing ( ) ) ; return request ; }


catches common error when zero is passed instead of null for a port

@ test public void coerces zero port to null ( ) { endpoint endpoint = endpoint new builder ( ) port ( 0 ) build ( ) ; assert that ( endpoint port ( ) ) is null ( ) ; }


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

private int inner prune ( final prune mode prune mode , final long cutoff , final string key prefix , final item collection < scan outcome > items ) throws i o exception { int item count = 0 ; try ( ancestor state state = initiate bulk write ( bulk operation state operation type prune , null ) ; duration info ignored = new duration info ( log , " pruning dynamo d b store " ) ) { array list < path > deletion batch = new array list < > ( s3guard ddb batch write request limit ) ; long delay = conf get time duration ( s3guard ddb background sleep msec key , s3guard ddb background sleep msec default , time unit milliseconds ) ; set < path > parent path set = new hash set < > ( ) ; set < path > cleared parent path set = new hash set < > ( ) ; / / declare the operation to delete a batch as a function so / / as to keep the code consistent across multiple uses callable raising i o e < void > delete batch operation = ( ) - > { / / lowest path entries get deleted first deletion batch sort ( path order comparators topmost path last ) ; process batch write request ( state , path to key ( deletion batch ) , null ) ; / / set authoritative false for each pruned dir listing / / if at least one entry was not a tombstone remove authoritative dir flag ( parent path set , state ) ; / / already cleared parent paths cleared parent path set add all ( parent path set ) ; parent path set clear ( ) ; return null ; } ; for ( item item : items ) { d d b path metadata md = path metadata dynamo d b translation item to path metadata ( item , username ) ; path path = md get file status ( ) get path ( ) ; boolean tombstone = md is deleted ( ) ; log debug ( " prune entry { } " , path ) ; deletion batch add ( path ) ; / / add parent path of item so it can be marked as non - auth / / this is only done if / / * it has not already been processed / / * the entry pruned is not a tombstone ( no need to update ) / / * the file is not in the root dir path parent path = path get parent ( ) ; if ( ! tombstone & & parent path ! = null & & ! parent path is root ( ) & & ! cleared parent path set contains ( parent path ) ) { parent path set add ( parent path ) ; } item count + + ; if ( deletion batch size ( ) = = s3guard ddb batch write request limit ) { delete batch operation apply ( ) ; deletion batch clear ( ) ; if ( delay > 0 ) { thread sleep ( delay ) ; } } } / / final batch of deletes if ( ! deletion batch is empty ( ) ) { delete batch operation apply ( ) ; } } catch ( interrupted exception e ) { thread current thread ( ) interrupt ( ) ; throw new interrupted i o exception ( " pruning was interrupted " ) ; } catch ( amazon dynamo d b exception e ) { throw translate dynamo d b exception ( key prefix , " prune of " + key prefix + " failed " , e ) ; } log info ( " finished pruning { } items in batches of { } " , item count , s3guard ddb batch write request limit ) ; return item count ; }


configures the closure cleaner please see { @ link closure cleaner level } for details on the different settings

public execution config set closure cleaner level ( closure cleaner level level ) { this closure cleaner level = level ; return this ; }


return the configured argument resolvers

public list < sync handler method argument resolver > get resolvers ( ) { return this delegate get resolvers ( ) stream ( ) map ( resolver - > ( sync handler method argument resolver ) resolver ) collect ( collectors to list ( ) ) ; }


public void remove panel slide listener ( panel slide listener listener ) { synchronized ( m panel slide listeners ) { m panel slide listeners remove ( listener ) ; } }


get the text to insert when the given suggestion is activated

protected string get completion text ( t sel ) { return sel to string ( ) ; }


if you override this method , and the default behavior of checking 0 - 256 and mask values is desired , call super evaluate reference ( ) in your overriden method

public boolean evaluate reference ( varnode context context , instruction instr , int pcodeop , address address , int size , ref type ref type ) { / / unless this is a direct address copy , don ' t trust computed accesses below min store load offset / / external spaces can have low addresses so don ' t check them address space space = address get address space ( ) ; if ( space is external space ( ) ) { return true ; } long max addr offset = space get max address ( ) get addressable word offset ( ) ; long word offset = address get addressable word offset ( ) ; boolean is known reference = ! address is constant address ( ) ; if ( pcodeop ! = pcode op copy & & ( ( word offset > = 0 & & word offset < min store load offset ) | | ( math abs ( max addr offset - word offset ) < min store load offset ) ) ) { if ( ! is known reference ) { return false ; } pcode op [ ] pcode = instr get pcode ( ) ; if ( pcode length > 1 ) { / / for simple pcode , assume it is a good location return false ; } } return true ; }


returns the prerequisites keyed by their transition keys if the split transition is not active ( e g split ( ) returned an empty list ) , the key is an empty optional

public map < optional < string > , list < configured target and data > > get split prerequisite configured target and targets ( string attribute name ) { check attribute is dependency ( attribute name ) ; / / use an immutable list multimap builder here to preserve ordering immutable list multimap builder < optional < string > , configured target and data > result = immutable list multimap builder ( ) ; list < configured target and data > deps = get prerequisite configured targets ( attribute name ) ; for ( configured target and data t : deps ) { immutable list < string > transition keys = t get transition keys ( ) ; if ( transition keys is empty ( ) ) { / / the split transition is not active , i e does not change build configurations / / todo ( jungjw ) : investigate if we need to do a check here return immutable map of ( optional absent ( ) , deps ) ; } for ( string key : transition keys ) { result put ( optional of ( key ) , t ) ; } } return multimaps as map ( result build ( ) ) ; }


handle the given response , return the deserialized object when the response is successful

public < t > t handle response ( response response , type return type ) throws api exception { if ( response is successful ( ) ) { if ( return type = = null | | response code ( ) = = 204 ) { / / returning null if the return type is not defined , / / or the status code is 204 ( no content ) if ( response body ( ) ! = null ) { try { response body ( ) close ( ) ; } catch ( exception e ) { throw new api exception ( response message ( ) , e , response code ( ) , response headers ( ) to multimap ( ) ) ; } } return null ; } else { return deserialize ( response , return type ) ; } } else { string resp body = null ; if ( response body ( ) ! = null ) { try { resp body = response body ( ) string ( ) ; } catch ( i o exception e ) { throw new api exception ( response message ( ) , e , response code ( ) , response headers ( ) to multimap ( ) ) ; } } throw new api exception ( response message ( ) , response code ( ) , response headers ( ) to multimap ( ) , resp body ) ; } }


attaches < code > recycler view header < code > to < code > recycler view < code > this method will perform necessary actions to properly align the header within < code > recycler view < code > be sure that < code > set layout manager ( ) < code > has been called for < code > recycler view < code > before calling this method also , if you were planning to use < code > set on scroll listener ( ) < code > method for your < code > recycler view < code > , be sure to do it before calling this method

public void attach to ( recycler view recycler ) { attach to ( recycler , false ) ; }


retrieve the given annotation ' s attributes as a { @ link map } , preserving all attribute types equivalent to calling { @ link # get annotation attributes ( annotation , boolean , boolean ) } with the { @ code class values as string } and { @ code nested annotations as map } parameters set to { @ code false } note : this method actually returns an { @ link annotation attributes } instance however , the { @ code map } signature has been preserved for binary compatibility

public static map < string , object > get annotation attributes ( annotation annotation ) { return get annotation attributes ( null , annotation ) ; }


get all inherited types from the specified type

public static set < class < ? > > get all inherited types ( class < ? > type , predicate < class < ? > > type filters ) { / / add all super classes set < class < ? > > types = new linked hash set < > ( get all super classes ( type , type filters ) ) ; / / add all interface classes types add all ( get all interfaces ( type , type filters ) ) ; return unmodifiable set ( types ) ; }


returns true if the corresponding reference is to an offcut address

public boolean is offcut reference ( ) { return is offcut reference ; }


returns the { @ code short } value whose big - endian representation is stored in the first 2 bytes of { @ code bytes } ; equivalent to { @ code byte buffer wrap ( bytes ) get short ( ) } for example , the input byte array { @ code { 0x 5 4 , 0x 3 2 } } would yield the { @ code short } value { @ code 0x 5 4 3 2 } arguably , it ' s preferable to use { @ link java nio byte buffer } ; that library exposes much more flexibility at little cost in readability

public static short from byte array ( byte [ ] bytes ) { check argument ( bytes length > = bytes , " array too small : % s < % s " , bytes length , bytes ) ; return from bytes ( bytes [ 0 ] , bytes [ 1 ] ) ; }


match all classes that both of the given class filters match

public static class filter intersection ( class filter cf 1 , class filter cf 2 ) { assert not null ( cf 1 , " first class filter must not be null " ) ; assert not null ( cf 2 , " second class filter must not be null " ) ; return new intersection class filter ( new class filter [ ] { cf 1 , cf 2 } ) ; }


updates the queue of the media session by calling { @ link queue navigator # on timeline changed ( player ) } apps normally only need to call this method when the backing data for a given queue item has changed and the queue should be updated immediately

public final void invalidate media session queue ( ) { if ( queue navigator ! = null & & player ! = null ) { queue navigator on timeline changed ( player ) ; } }


remove a block from the low redundancy queues the pri level parameter is a hint of which queue to query first : if negative or & gt ; = { @ link # level } this shortcutting is not attmpted if the block is not found in the nominated queue , an attempt is made to remove it from all queues warning : this is not a synchronized method

boolean remove ( block info block , int pri level ) { return remove ( block , pri level , block get replication ( ) ) ; }


build an " empty " result only called if there isn ' t any data on this shard


set the query parameter values replacing existing values , or if no values are given , the query parameter is removed note : please , review the javadoc of { @ link # query param ( string , object ) } for further notes on the treatment and encoding of individual query parameters

uri builder replace query param ( string name , object values ) ;


this test checks the async exceptions handling wraps the message and cause as an asynchronous exception and propagates this to the environment

public void stream task async exception handler handle exception forwards message properly ( ) { mock environment mock environment = mock environment builder ( ) build ( ) ; runtime exception expected exception = new runtime exception ( " runtime exception " ) ; final stream task stream task async exception handler async exception handler = new stream task stream task async exception handler ( mock environment ) ; mock environment set expected external failure cause ( asynchronous exception class ) ; final string expected error message = " expected error message " ; async exception handler handle async exception ( expected error message , expected exception ) ; / / expect an asynchronous exception containing the supplied error details optional < ? extends throwable > actual external failure cause = mock environment get actual external failure cause ( ) ; final throwable actual exception = actual external failure cause or else throw ( ( ) - > new assertion error ( " expected exceptional completion " ) ) ; assert that ( actual exception , instance of ( asynchronous exception class ) ) ; assert that ( actual exception get message ( ) , is ( " expected error message " ) ) ; assert that ( actual exception get cause ( ) , is ( expected exception ) ) ; }


public cst string get signature ( ) { return spec get local item ( ) get signature ( ) ; }


protected void build entity criteria for signing credential ( final request abstract type profile request , final criteria set criteria set ) { criteria set add ( new entity id criterion ( saml id p utils get issuer from saml object ( profile request ) ) ) ; criteria set add ( new entity role criterion ( s p s s o descriptor default element name ) ) ; }


return the { @ code type } that this instance is using to filter candidates

public final class < ? > get target type ( ) { return this target type ; }


adds an unnamed value to the formatted output it is strongly encouraged to use { @ link # add ( string , long ) } instead and give value a readable name

public to string helper add value ( long value ) { return add holder ( string value of ( value ) ) ; }


public binary reader get reader ( ) { return reader ; }


tests that when the parent dirs does not exist in fallback but the parent dir is same as mount internal directory , then we create parent structure ( mount internal directory tree structure ) in fallback

public void test mkdirs with fallback link with mount path matching dir exist ( ) throws exception { configuration conf = new configuration ( ) ; conf set boolean ( constants config viewfs mount links as symlinks , false ) ; config util add link ( conf , " / user 1 / hive " , new path ( target test root to string ( ) ) to uri ( ) ) ; path fallback target = new path ( target test root , " fallback dir " ) ; fs target mkdirs ( fallback target ) ; config util add link fallback ( conf , fallback target to uri ( ) ) ; try ( file system vfs = file system get ( view fs default cluster uri , conf ) ) { / / user 1 does not exist in fallback path immediate level to internal dir = new path ( " / user 1 / test " ) ; path test = path merge paths ( fallback target , immediate level to internal dir ) ; assert false ( fs target exists ( test ) ) ; assert true ( vfs mkdirs ( immediate level to internal dir ) ) ; assert true ( fs target exists ( test ) ) ; } }


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


the name of this entry this corresponds to the ' entry ' part of a full resource name of the form package : typeentry < code > optional string name = 2 ; < code >

public com google protobuf byte string get name bytes ( ) { return com google protobuf byte string copy from utf 8 ( name ) ; }


returns whether the media currently being played has captions this method is called each time the media session playback state needs to be updated and published upon a player state change

boolean has captions ( player player ) ;


create an lsda action table from the bytes at < code > address < code > < br > note : this method must get called before any of the " get " methods

public void create ( address address , address max address ) { if ( address = = null ) { throw new illegal argument exception ( " action record ' s address cannot be null " ) ; } if ( monitor is cancelled ( ) ) { return ; } table address = address ; monitor set message ( " creating lsda action table " ) ; l s d a action record rec = null ; while ( address compare to ( max address ) < = 0 ) { rec = new l s d a action record ( monitor , program , region , this ) ; rec create ( address ) ; records add ( rec ) ; address = rec get next address ( ) ; } next address = address ; set comment cmd comment cmd = new set comment cmd ( table address , code unit plate comment , " ( lsda ) action table " ) ; comment cmd apply to ( program ) ; }


get the machine nodes that belong to the rack

public set < machine node > get machines in rack ( ) { return ( set < machine node > ) ( set ) get children ( ) ; }


given a byte ' s offset in an internal block , calculate the offset in the block group

public static long offset in blk to offset in b g ( int cell size , int data blk num , long offset in blk , int idx in block group ) { int cell idx in blk = ( int ) ( offset in blk / cell size ) ; return cell idx in blk * cell size * data blk num / / n full stripes before offset + idx in block group * cell size / / m full cells before offset + offset in blk % cell size ; / / partial cell }


appends the node to the tail of the list

public void append to tail ( node head ) { node tail = head prev ; head prev = this ; tail next = this ; next = head ; prev = tail ; }


public void set start ( float start ) { this start = start ; }


advances next cursor to the index of the first element after { @ code c } that is not in { @ code skip me } and returns { @ code size ( ) } if there is no such element

private void next not in skip me ( int c ) { if ( next cursor < c ) { if ( skip me ! = null ) { while ( c < size ( ) & & found and removed exact reference ( skip me , element data ( c ) ) ) { c + + ; } } next cursor = c ; } }


public static set < marker policy > available policies ( ) { return available policies ; }


returns the authority ( hostname & port ) used by the jetty server

public static inet socket address get authority ( ) { server server = get jetty server ( ) ; try { inet address add = inet address get by name ( ( ( server connector ) server get connectors ( ) [ 0 ] ) get host ( ) ) ; int port = ( ( server connector ) server get connectors ( ) [ 0 ] ) get port ( ) ; return new inet socket address ( add , port ) ; } catch ( unknown host exception ex ) { throw new runtime exception ( ex ) ; } }


blocks the calling thread , waiting for the task to vanish from the task manager

public void wait for task completion ( task task , long until in nanos ) { while ( system nano time ( ) - until in nanos < 0 ) { if ( get task ( task get id ( ) ) = = null ) { return ; } try { thread sleep ( wait for completion poll millis ( ) ) ; } catch ( interrupted exception e ) { throw new elasticsearch exception ( " interrupted waiting for completion of [ { } ] " , e , task ) ; } } throw new elasticsearch timeout exception ( " timed out waiting for completion of [ { } ] " , task ) ; }


selects the next item in the list with a usable completion

public void select next ( ) { if ( null = = completion list ) { return ; } for ( int i = jlist get selected index ( ) + 1 ; i < completion list size ( ) ; i + + ) { code completion completion = completion list get ( i ) ; if ( code completion is valid ( completion ) ) { jlist set selected index ( i ) ; jlist ensure index is visible ( i ) ; break ; } } }


analysis the { @ link org litepal tablemanager model associations model } by the purpose of subclasses , and generate a sql to do the intention job the implementation of this method is totally delegated to the subclasses

protected abstract void add or update association ( s q lite database db , boolean force ) ;


parses a runtime [ in ] visible type annotations attribute to find the offset of each type annotation entry it contains , to find the corresponding labels , and to visit the try catch block annotations

private int [ ] read type annotations ( final method visitor method visitor , final context context , final int runtime type annotations offset , final boolean visible ) { char [ ] char buffer = context char buffer ; int current offset = runtime type annotations offset ; / / read the num annotations field and create an array to store the type annotation offsets int [ ] type annotations offsets = new int [ read unsigned short ( current offset ) ] ; current offset + = 2 ; / / parse the ' annotations ' array field for ( int i = 0 ; i < type annotations offsets length ; + + i ) { type annotations offsets [ i ] = current offset ; / / parse the type annotation ' s target type and the target info fields the size of the / / target info field depends on the value of target type int target type = read int ( current offset ) ; switch ( target type > > > 24 ) { case type reference local variable : case type reference resource variable : / / a localvar target has a variable size , which depends on the value of their table length / / field it also references bytecode offsets , for which we need labels int table length = read unsigned short ( current offset + 1 ) ; current offset + = 3 ; while ( table length - - > 0 ) { int start pc = read unsigned short ( current offset ) ; int length = read unsigned short ( current offset + 2 ) ; / / skip the index field ( 2 bytes ) current offset + = 6 ; create label ( start pc , context current method labels ) ; create label ( start pc + length , context current method labels ) ; } break ; case type reference cast : case type reference constructor invocation type argument : case type reference method invocation type argument : case type reference constructor reference type argument : case type reference method reference type argument : current offset + = 4 ; break ; case type reference class extends : case type reference class type parameter bound : case type reference method type parameter bound : case type reference throws : case type reference exception parameter : case type reference instanceof : case type reference new : case type reference constructor reference : case type reference method reference : current offset + = 3 ; break ; case type reference class type parameter : case type reference method type parameter : case type reference method formal parameter : case type reference field : case type reference method return : case type reference method receiver : default : / / type reference type which can ' t be used in code attribute , or which is unknown throw new illegal argument exception ( ) ; } / / parse the rest of the type annotation structure , starting with the target path structure / / ( whose size depends on its path length field ) int path length = read byte ( current offset ) ; if ( ( target type > > > 24 ) = = type reference exception parameter ) { / / parse the target path structure and create a corresponding type path type path path = path length = = 0 ? null : new type path ( class file buffer , current offset ) ; current offset + = 1 + 2 * path length ; / / parse the type index field string annotation descriptor = read u t f 8 ( current offset , char buffer ) ; current offset + = 2 ; / / parse num element value pairs and element value pairs and visit these values current offset = read element values ( method visitor visit try catch annotation ( target type & 0x f f f f f f 0 0 , path , annotation descriptor , visible ) , current offset , / * named = * / true , char buffer ) ; } else { / / we don ' t want to visit the other target type annotations , so we just skip them ( which / / requires some parsing because the element value pairs array has a variable size ) first , / / skip the target path structure : current offset + = 3 + 2 * path length ; / / then skip the num element value pairs and element value pairs fields ( by reading them / / with a null annotation visitor ) current offset = read element values ( / * annotation visitor = * / null , current offset , / * named = * / true , char buffer ) ; } } return type annotations offsets ; }


ensures list encoding works : proto 3 list of spans

@ test void message with multiple spans proto 3 ( ) throws exception { message with multiple spans ( builder ( " multiple spans proto 3 " ) , span bytes encoder proto3 ) ; }


returns true if the flow is a conditional call or jump

public boolean is conditional ( ) { return false ; }


https : jira spring iobrowse s p r - 2645

public void xss exploit when action is resolved from query string ( ) throws exception { string xss query string = query string + " & stuff = \ " > < script > alert ( ' xss ! ' ) < / script > " ; request set query string ( xss query string ) ; tag do start tag ( ) ; assert that ( get output ( ) ) is equal to ( ( " < form id = \ " command \ " action = \ " / my / form ? foo = bar & amp ; stuff = & quot ; & gt ; & lt ; " + " script & gt ; alert ( & # 39 ; xss ! & # 39 ; ) & lt ; / script & gt ; \ " method = \ " post \ " > " ) ) ; }


private void get config key rst ( config key key , string builder b ) { b append ( " ` ` " ) append ( key name ) append ( " ` ` " ) append ( " \ n " ) ; for ( string doc line : key documentation split ( " \ n " ) ) { if ( doc line length ( ) = = 0 ) { continue ; } b append ( " " ) append ( doc line ) append ( " \ n \ n " ) ; } b append ( " * type : " ) append ( get config value ( key , " type " ) ) append ( " \ n " ) ; if ( key has default ( ) ) { b append ( " * default : " ) append ( get config value ( key , " default " ) ) append ( " \ n " ) ; } if ( key validator ! = null ) { b append ( " * valid values : " ) append ( get config value ( key , " valid values " ) ) append ( " \ n " ) ; } b append ( " * importance : " ) append ( get config value ( key , " importance " ) ) append ( " \ n " ) ; }


releases resources before task exits we should also fail the partition to release if the task has failed , is canceled , or is being canceled at the moment

private void release resources ( ) { log debug ( " release task { } network resources ( state : { } ) " , task name with subtask , get execution state ( ) ) ; for ( result partition writer partition writer : consumable notifying partition writers ) { task event dispatcher unregister partition ( partition writer get partition id ( ) ) ; if ( is canceled or failed ( ) ) { partition writer fail ( get failure cause ( ) ) ; } } close network resources ( ) ; try { task state manager close ( ) ; } catch ( exception e ) { log error ( " failed to close task state manager for task { } " , task name with subtask , e ) ; } }


reads the short at the current index and then increments the current index by < code > sizeof short < code >

public short read next short ( ) throws i o exception { short s = read short ( current index ) ; current index + = sizeof short ; return s ; }


determines whether this multiset contains the specified element this method refines { @ link collection # contains } to further specify that it < b > may not < b > throw an exception in response to { @ code element } being null or of the wrong type

boolean contains ( @ nullable object element ) ;


returns the file for which needs to satisfy the policy

public long get file ( ) { return file id ; }


returns the cumulative command execution user time for the { @ link action }

public optional < duration > cumulative command execution user time ( ) { return get cumulative time ( spawn result - > spawn result get user time ( ) ) ; }


advance the iterator to exactly { @ code target } and return whether { @ code target } has a value { @ code target } must be greater than or equal to the current doc id and must be a valid doc id , ie & ge ; 0 and & lt ; { @ code max doc }

public abstract boolean advance exact ( int target ) throws i o exception ;


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


available space in the { @ link # side } buffer

private int space ( ) { return side buffer size - side size ( ) ; }


return the thread name prefix to use for the names of newly created threads

public string get thread name prefix ( ) { return this thread name prefix ; }


transforms the obfuscated frame into one or more original frames , if the frame contains information about a method that can be remapped

private void transform method info ( frame info obfuscated frame , string original class name , list < frame info > original method frames ) { / / class name - > obfuscated method names map < string , set < method info > > method map = class method map get ( original class name ) ; if ( method map ! = null ) { / / obfuscated method names - > methods string obfuscated method name = obfuscated frame get method name ( ) ; set < method info > method set = method map get ( obfuscated method name ) ; if ( method set ! = null ) { int obfuscated line number = obfuscated frame get line number ( ) ; string obfuscated type = obfuscated frame get type ( ) ; string original type = obfuscated type = = null ? null : original type ( obfuscated type ) ; string obfuscated arguments = obfuscated frame get arguments ( ) ; string original arguments = obfuscated arguments = = null ? null : original arguments ( obfuscated arguments ) ; / / find all matching methods iterator < method info > method info iterator = method set iterator ( ) ; while ( method info iterator has next ( ) ) { method info method info = method info iterator next ( ) ; if ( method info matches ( obfuscated line number , original type , original arguments ) ) { / / do we have a different original first line number ? / / we ' re allowing unknown values , represented as 0 int line number = obfuscated frame get line number ( ) ; if ( method info original first line number ! = method info obfuscated first line number ) { / / do we have an original line number range and / / sufficient information to shift the line number ? line number = method info original last line number ! = 0 & & method info original last line number ! = method info original first line number & & method info obfuscated first line number ! = 0 & & line number ! = 0 ? method info original first line number - method info obfuscated first line number + line number : method info original first line number ; } original method frames add ( new frame info ( method info original class name , source file name ( method info original class name ) , line number , method info original type , obfuscated frame get field name ( ) , method info original name , method info original arguments ) ) ; } } } } }


painless { @ link class } s and names of the arguments to the { @ code execute } method the names are exposed to the painless script

public list < method argument > get execute arguments ( ) { return execute arguments ; }


iterates over the specified area of this buffer with the specified { @ code processor } in descending order ( i e { @ code ( index + length - 1 ) } , { @ code ( index + length - 2 ) } , { @ code index } )

public abstract int for each byte desc ( int index , int length , byte processor processor ) ;


expect a " content - type " header with the given value

public web test client response spec content type ( media type media type ) { return assert header ( " content - type " , media type , get headers ( ) get content type ( ) ) ; }


lazy initialization of param file name to content map

private map < string , iterable < string > > get param file name to content map ( ) { if ( param file name to content map = = null ) { param file name to content map = new hash map < > ( ) ; } return param file name to content map ; }


called when the offload buffer has been partially emptied

default void on offload buffer emptying ( ) { }


{ @ code current location } needs to be supplied if a write path exists for the table

public synchronized void create table ( connector session session , table table , principal privileges principal privileges , optional < path > current path , boolean ignore existing , partition statistics statistics ) { set shared ( ) ; / / when creating a table , it should never have partition actions this is just a sanity check check no partition action ( table get database name ( ) , table get table name ( ) ) ; schema table name schema table name = new schema table name ( table get database name ( ) , table get table name ( ) ) ; action < table and more > old table action = table actions get ( schema table name ) ; table and more table and more = new table and more ( table , optional of ( principal privileges ) , current path , optional empty ( ) , ignore existing , statistics , statistics ) ; if ( old table action = = null ) { hdfs context context = new hdfs context ( session , table get database name ( ) , table get table name ( ) ) ; table actions put ( schema table name , new action < > ( action type add , table and more , context ) ) ; return ; } switch ( old table action get type ( ) ) { case drop : throw new presto exception ( transaction conflict , " dropping and then recreating the same table in a transaction is not supported " ) ; case add : case alter : case insert existing : throw new table already exists exception ( schema table name ) ; default : throw new illegal state exception ( " unknown action type " ) ; } }


the children of this element < code > repeated aapt pb xml node child = 5 ; < code >

public builder set child ( int index , com android aapt resources xml node builder builder for value ) { copy on write ( ) ; instance set child ( index , builder for value ) ; return this ; }


returns every possible list that can be formed by choosing one element from each of the given lists in order ; the " n - ary < a href = " http : en wikipedia orgwiki cartesian product " > cartesian product " of the lists for example : { @ code lists cartesian product ( immutable list of ( immutable list of ( 1 , 2 ) , immutable list of ( " a " , " b " , " c " ) ) ) } returns a list containing six lists in the following order : { @ code immutable list of ( 1 , " a " ) } { @ code immutable list of ( 1 , " b " ) } { @ code immutable list of ( 1 , " c " ) } { @ code immutable list of ( 2 , " a " ) } { @ code immutable list of ( 2 , " b " ) } { @ code immutable list of ( 2 , " c " ) } the result is guaranteed to be in the " traditional " , lexicographical order for cartesian products that you would get from nesting for loops : { @ code for ( b b 0 : lists get ( 0 ) ) { for ( b b 1 : lists get ( 1 ) ) { immutable list < b > tuple = immutable list of ( b 0 , b 1 , ) ; operate on tuple } } } note that if any input list is empty , the cartesian product will also be empty if no lists at all are provided ( an empty list ) , the resulting cartesian product has one element , an empty list ( counter - intuitive , but mathematically consistent ) performance notes : while the cartesian product of lists of size { @ code m , n , p } is a list of size { @ code m x n x p } , its actual memory consumption is much smaller when the cartesian product is constructed , the input lists are merely copied only as the resulting list is iterated are the individual lists created , and these are not retained after iteration

public static < b > list < list < b > > cartesian product ( list < ? extends list < ? extends b > > lists ) { return cartesian list create ( lists ) ; }


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


the fill ratio of the underlying tree set holding blocks

public double tree set fill ratio ( ) { return blocks fill ratio ( ) ; }


creates a new { @ link time } of the given duration and { @ link time unit }

public static time of ( long size , time unit unit ) { return new time ( size , unit ) ; }


protected synchronized void close ( ) { long time since last active = time unit milliseconds to seconds ( time now ( ) - get last active time ( ) ) ; log debug ( " shutting down connection pool \ " { } \ " used { } seconds ago " , this connection pool id , time since last active ) ; for ( connection context connection : this connections ) { connection close ( ) ; } this connections clear ( ) ; }


public void set branch id ( long branch id ) { this branch id = branch id ; }