collects the output files ( both implicit and explicit ) all the implicit output files are added first , followed by any explicit files additionally both implicit and explicit output files will retain the relative order in which they were declared

void populate output files ( event handler event handler , package builder pkg builder ) throws label syntax exception , interrupted exception { populate output files internal ( event handler , pkg builder , / * perform checks = * / true ) ; }


write a new value to the store with the provided key the key should be a composite of the record key , and the timestamp information etc as described by the { @ link key schema }

void put ( bytes key , byte [ ] value ) ;


append to the path using path segments for example : < pre class = " code " > builder path segment ( " first - value " , " second - value " , " { id } " ) build ( " 123 " ) results is " first - valuesecond - value 1 2 3 " if slashes are present in a path segment , they are encoded : < pre class = " code " > builder path segment ( " baz " , " { id } " ) build ( " ab " ) results is " ba % 2 fza % 2 fb " to insert a trailing slash , use the { @ link # path } builder method : < pre class = " code " > builder path segment ( " first - value " , " second - value " ) path ( " " ) results is " first - valuesecond - value "

uri builder path segment ( string path segments ) throws illegal argument exception ;


set the name of the cookie to use for the session id by default set to " session "

public void set cookie name ( string cookie name ) { assert has text ( cookie name , " ' cookie name ' must not be empty " ) ; this cookie name = cookie name ; }


check the current extension can be processed

private boolean can load file extension ( property source loader loader , string extension ) { return arrays stream ( loader get file extensions ( ) ) any match ( ( file extension ) - > string utils ends with ignore case ( extension , file extension ) ) ; }


creates a simple animation backend that cycles through a list of colors

public static animation backend create sample color animation backend ( resources resources ) { / / get the animation duration in ms for each color frame int frame duration ms = resources get integer ( android r integer config medium anim time ) ; / / create and return the backend return new example color backend ( sample data colors , frame duration ms ) ; }


return the jdbc username to use for connecting through the driver

public string get username ( ) { return this username ; }


adds all the test classes ( top - level or nested ) found in package { @ code pkg name } or its subpackages to the set of tests this builder will search

public test suite builder add package recursive ( string pkg name ) { for ( class < ? > c : get classes recursive ( pkg name ) ) { add test class ( c ) ; } return this ; }


register a listener that will be called when this model is bound to a view the listener will contribute to this model ' s hash code state per the { @ link com airbnb epoxy epoxy attribute option # do not hash } rules you may clear the listener by setting a null value , or by calling { @ link # reset ( ) }

public layout overloads view model on bind ( on model bound listener < layout overloads view model , layout overloads view > listener ) { on mutation ( ) ; this on model bound listener epoxy generated model = listener ; return this ; }


sets the pad top , pad left , pad bottom , and pad right to the specified value

public cell < t > pad ( value pad ) { if ( pad = = null ) throw new illegal argument exception ( " pad cannot be null " ) ; pad top = pad ; pad left = pad ; pad bottom = pad ; pad right = pad ; return this ; }


the entries defined for this type < code > repeated aapt pb entry entry = 3 ; < code >

public builder clear entry ( ) { copy on write ( ) ; instance clear entry ( ) ; return this ; }


loads json from a json - with - { @ code post message } url

public static string load j s o n h t m l ( url src ) throws i o exception { u r l connection con = proxy configuration open ( src ) ; if ( con instanceof http u r l connection ) { / / prevent problems from misbehaving plugins disabling redirects by default ( ( http u r l connection ) con ) set instance follow redirects ( true ) ; } try ( input stream is = con get input stream ( ) ) { string jsonp = i o utils to string ( is , standard charsets utf 8 ) ; string preamble = " window parent post message ( json stringify ( " ; int start = jsonp index of ( preamble ) ; int end = jsonp last index of ( " ) , ' * ' ) ; " ) ; if ( start > = 0 & & end > start ) { return jsonp substring ( start + preamble length ( ) , end ) trim ( ) ; } else { throw new i o exception ( " could not find json in " + src ) ; } } }


sets the { @ link analytics collector } that will collect and forward all player events

public builder set analytics collector ( analytics collector analytics collector ) { assertions check state ( ! build called ) ; this analytics collector = analytics collector ; return this ; }


function to return how much memory we should set aside for yarn containers if a number is specified in the configuration file , then that number is returned if nothing is specified - 1 if the os is an " unknown " os ( one for which we don ' t have resource calculator plugin implemented ) , return the default node manager physical memory 2 if the os has a resource calculator plugin implemented , the calculation is 0 8 ( ram - 2 jvm - memory ) i e use 80 % of the memory after accounting for memory used by the data node and the node manager if the number is less than 1gb , log a warning message

public static long get container memory m b ( resource calculator plugin plugin , configuration conf ) { if ( ! is hardware detection enabled ( conf ) | | plugin = = null ) { return get configured memory m b ( conf ) ; } return get container memory m b internal ( plugin , conf ) ; }


{ @ link headers # get all ( object ) } and convert each element of { @ link list } to a { @ link string }

list < string > get all as string ( char sequence name ) ;


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


gets the number of tasks holding { @ link class loader } references for the given job

int get number of reference holders ( job i d job id ) { synchronized ( lock object ) { library cache entry entry = cache entries get ( job id ) ; return entry = = null ? 0 : entry get reference count ( ) ; } }


returns a predicate that returns the result of { @ link java nio file files # is regular file ( path , link option ) } on input paths with the given link options

public static predicate < path > is regular file ( link option options ) { final link option [ ] options copy = options clone ( ) ; return new predicate < path > ( ) { @ override public boolean apply ( path input ) { return files is regular file ( input , options copy ) ; } @ override public string to string ( ) { return " more files is regular file ( " + arrays to string ( options copy ) + " ) " ; } } ; }


move all the source files that should be renamed or deleted to the tmp directory

private void move to tmp dir ( diff info [ ] diffs , distributed file system target fs , path tmp dir ) throws i o exception { / / sort the diffs based on their source paths to make sure the files and / / subdirs are moved before moving their parents / ancestors arrays sort ( diffs , diff info source comparator ) ; random random = new random ( ) ; for ( diff info diff : diffs ) { path tmp target = new path ( tmp dir , diff get source ( ) get name ( ) ) ; while ( target fs exists ( tmp target ) ) { tmp target = new path ( tmp dir , diff get source ( ) get name ( ) + random next int ( ) ) ; } diff set tmp ( tmp target ) ; target fs rename ( diff get source ( ) , tmp target ) ; } }


test for { @ link default bean } that does not define the container factory to use as a default is registered with an explicit default

protected void test explicit container factory configuration ( application context context ) { jms listener container test factory default factory = context get bean ( " simple factory " , jms listener container test factory class ) ; assert that ( default factory get listener containers ( ) size ( ) ) is equal to ( 1 ) ; }


sets the failure image and its scale type

public generic drawee hierarchy builder set failure image ( int resource id , @ nullable scaling utils scale type failure image scale type ) { m failure image = m resources get drawable ( resource id ) ; m failure image scale type = failure image scale type ; return this ; }


remove ' this ' parameter if using thiscall and first non - auto parameter is a pointer and named ' this ' variables must be pre - loaded

private boolean remove explicit this parameter ( ) { if ( compiler spec calling convention thiscall equals ( get calling convention name ( ) ) ) { int this index = find explicit this parameter ( params ) ; if ( this index > = 0 ) { remove parameter ( this index ) ; / / remove explicit ' this ' parameter return true ; } } return false ; }


schedules { @ link # action } after { @ link # delay ms } the { @ link # next } node will be scheduled immediately after { @ link # action } is executed

public void schedule ( simple exo player player , default track selector track selector , @ nullable surface surface , handler wrapper main handler ) { this player = player ; this track selector = track selector ; this surface = surface ; this main handler = main handler ; if ( delay ms = = 0 & & looper my looper ( ) = = main handler get looper ( ) ) { run ( ) ; } else { main handler post delayed ( this , delay ms ) ; } }


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


serializes and deserializes the specified object < b > gwt warning : < b > under gwt , this method simply returns its input , as proper gwt serialization tests require more setup this no - op behavior allows test authors to intersperse { @ code serializable tester } calls with other , gwt - compatible tests note that the specified object may not be known by the compiler to be a { @ link java io serializable } instance , and is thus declared an { @ code object } for example , it might be declared as a { @ code list }

public static < t > t reserialize ( t object ) { return platform reserialize ( object ) ; }


returns the current event - time watermark


test to ensure nameservice specific keys in the configuration are copied to generic keys when the namenode starts

public void test conf modification federation only ( ) { final hdfs configuration conf = new hdfs configuration ( ) ; string ns id = " ns 1 " ; conf set ( dfs nameservices , ns id ) ; conf set ( dfs nameservice id , ns id ) ; / / set the nameservice specific keys with nameservice id in the config key for ( string key : name node namenode specific keys ) { / / note : value is same as the key conf set ( d f s util add key suffixes ( key , ns id ) , key ) ; } / / initialize generic keys from specific keys name node initialize generic keys ( conf , ns id , null ) ; / / retrieve the keys without nameservice id and ensure generic keys are set / / to the correct value for ( string key : name node namenode specific keys ) { assert equals ( key , conf get ( key ) ) ; } }


determine an empty value for the specified field the default implementation returns : { @ code boolean false } for boolean fields an empty array for array types collection implementations for collection types map implementations for map types else , { @ code null } is used as default

public object get empty value ( class < ? > field type ) { try { if ( boolean class = = field type | | boolean class = = field type ) { / / special handling of boolean property return boolean false ; } else if ( field type is array ( ) ) { / / special handling of array property return array new instance ( field type get component type ( ) , 0 ) ; } else if ( collection class is assignable from ( field type ) ) { return collection factory create collection ( field type , 0 ) ; } else if ( map class is assignable from ( field type ) ) { return collection factory create map ( field type , 0 ) ; } } catch ( illegal argument exception ex ) { if ( logger is debug enabled ( ) ) { logger debug ( " failed to create default value - falling back to null : " + ex get message ( ) ) ; } } / / default value : null return null ; }


a bad block need to be handled , either to add to block scanner suspect queue or report to name node directly if the method is called by scanner , then the block must be a bad block , we report it to name node directly otherwise if we judge it as a bad block according to exception type , then we try to add the bad block to block scanner suspect queue if block scanner is enabled , or report to name node directly otherwise

void handle bad block ( extended block block , i o exception e , boolean from scanner ) { boolean is bad block = from scanner | | ( e instanceof disk file corrupt exception | | e instanceof corrupt meta header exception ) ; if ( ! is bad block ) { return ; } if ( ! from scanner & & block scanner is enabled ( ) ) { block scanner mark suspect block ( data get volume ( block ) get storage i d ( ) , block ) ; } else { try { report bad blocks ( block ) ; } catch ( i o exception ie ) { log warn ( " report bad block { } failed " , block , ie ) ; } } }


gets the latch that is counted down when an exception is thrown in { @ code abstract queue visitor } for use in tests to check if an exception actually was thrown calling { @ code abstract queue visitor # await exception for testing only } can throw a spurious { @ link interrupted exception } because { @ link count down latch # await } checks the interrupted bit before returning , even if the latch is already at 0 see bug " test two errors is flaky "

count down latch get exception latch for testing ( ) { return evaluator context get visitor ( ) get exception latch for testing only ( ) ; }


returns the { @ link playback stats } for the currently playback session , or null if no session is active

public playback stats get playback stats ( ) { @ nullable playback stats tracker active stats tracker = active ad playback ! = null ? playback stats trackers get ( active ad playback ) : active content playback ! = null ? playback stats trackers get ( active content playback ) : null ; return active stats tracker = = null ? null : active stats tracker build ( / * is final = * / false ) ; }


set whether the proxy should be exposed by the aop framework as a { @ link thread local } for retrieval via the { @ link aop context } class it can be necessary to expose the proxy if an advised object needs to invoke a method on itself with advice applied otherwise , if an advised object invokes a method on { @ code this } , no advice will be applied default is { @ code false } , for optimal performance

void set expose proxy ( boolean expose proxy ) ;


copies an existing blob ' s contents , properties , and metadata to this instance of the < code > cloud blob < code > class , using the specified operation context

public abstract void start copy from blob ( cloud blob wrapper source blob , blob request options options , operation context op context , boolean overwrite destination ) throws storage exception , u r i syntax exception ;


public void fire component registered ( component definition component definition ) { this event listener component registered ( component definition ) ; }


performs an action for each cache entry in the cache while iterating over the cache entries this method is protected from mutations that occurs within the same cache segment by acquiring the segment ' s read lock during all the iteration as such , the specified consumer should not try to modify the cache modifications that occur in already traveled segments won ' t been seen by the consumer but modification that occur in non yet traveled segments should be

public void for each ( bi consumer < k , v > consumer ) { for ( cache segment < k , v > segment : segments ) { try ( releasable lock ignored = segment read lock acquire ( ) ) { for ( completable future < entry < k , v > > future : segment map values ( ) ) { try { if ( future ! = null & & future is done ( ) ) { final entry < k , v > entry = future get ( ) ; consumer accept ( entry key , entry value ) ; } } catch ( execution exception | interrupted exception e ) { throw new illegal state exception ( e ) ; } } } } }


converts a legal starlark value x into an java value of type t x must be directly convertible to this type this therefore disqualifies " selector expressions " of the form " { config 1 : ' value 1 of orig type ' , config 2 : ' value 2 of orig type ; } " ( which support configurable attributes ) to handle those expressions , see { @ link com google devtools build lib packages build type # selectable convert }

public abstract t convert ( object x , object what , @ nullable object context ) throws conversion exception ; / / todo ( bazel - team ) : check external calls ( e g in package factory ) , verify they always want / / this over selectable convert


public node get parent ( ) { return parent ; }


sets the given producer value for the specified variable , without disturbing it

public void set producer value ( int index , value value ) { producer variables store ( index , value ) ; }


return the delivery delay to use for send calls ( in milliseconds )

public long get delivery delay ( ) { return this delivery delay ; }


stops any of the current nodes but not the master node

public synchronized void stop random non master node ( ) throws i o exception { node and client node and client = get random node and client ( new node name predicate ( get master name ( ) ) negate ( ) ) ; if ( node and client ! = null ) { logger info ( " closing random non master node [ { } ] current master [ { } ] " , node and client name , get master name ( ) ) ; stop nodes and client ( node and client ) ; } }


check if we are ready to send another chunk

private void check flush ( boolean force ) { if ( ( force & & sb length ( ) > 0 ) | | sb length ( ) > 2048 ) { send buffer sync ( byte buffer wrap ( sb to string ( ) get bytes ( utf 8 ) ) ) ; / / clear our internal buffer sb set length ( 0 ) ; } }


public boolean accept ( final path key path , final string prefix ) { return false ; }


public void test delete expired data action deletes empty state indices ( ) throws exception { client ( ) admin ( ) indices ( ) prepare create ( " ml - state " ) get ( ) ; client ( ) admin ( ) indices ( ) prepare create ( " ml - state - 000001 " ) get ( ) ; client ( ) prepare index ( " ml - state - 000001 " ) set source ( " field 1 " , " value 1 " ) get ( ) ; client ( ) admin ( ) indices ( ) prepare create ( " ml - state - 000003 " ) get ( ) ; client ( ) admin ( ) indices ( ) prepare create ( " ml - state - 000005 " ) get ( ) ; client ( ) prepare index ( " ml - state - 000005 " ) set source ( " field 5 " , " value 5 " ) get ( ) ; client ( ) admin ( ) indices ( ) prepare create ( " ml - state - 000007 " ) add alias ( new alias ( " ml - state - write " ) is hidden ( true ) ) get ( ) ; refresh ( ) ; get index response get index response = client ( ) admin ( ) indices ( ) prepare get index ( ) set indices ( " ml - state * " ) get ( ) ; assert that ( strings to string ( get index response ) , get index response get indices ( ) , is ( array containing ( " ml - state " , " ml - state - 000001 " , " ml - state - 000003 " , " ml - state - 000005 " , " ml - state - 000007 " ) ) ) ; client ( ) execute ( delete expired data action instance , new delete expired data action request ( ) ) get ( ) ; refresh ( ) ; get index response = client ( ) admin ( ) indices ( ) prepare get index ( ) set indices ( " ml - state * " ) get ( ) ; assert that ( strings to string ( get index response ) , get index response get indices ( ) , / / only non - empty or current indices should survive deletion process is ( array containing ( " ml - state - 000001 " , " ml - state - 000005 " , " ml - state - 000007 " ) ) ) ; }


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

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


obtains the best mac address found on local network interfaces generally speaking , an active network interface used on public networks is better than a local network interface

public static byte [ ] best available mac ( ) { / / find the best mac address available byte [ ] best mac addr = empty bytes ; inet address best inet addr = net util localhost4 ; / / retrieve the list of available network interfaces map < network interface , inet address > ifaces = new linked hash map < network interface , inet address > ( ) ; try { enumeration < network interface > interfaces = network interface get network interfaces ( ) ; if ( interfaces ! = null ) { while ( interfaces has more elements ( ) ) { network interface iface = interfaces next element ( ) ; / / use the interface with proper inet addresses only enumeration < inet address > addrs = socket utils addresses from network interface ( iface ) ; if ( addrs has more elements ( ) ) { inet address a = addrs next element ( ) ; if ( ! a is loopback address ( ) ) { ifaces put ( iface , a ) ; } } } } } catch ( socket exception e ) { logger warn ( " failed to retrieve the list of available network interfaces " , e ) ; } for ( entry < network interface , inet address > entry : ifaces entry set ( ) ) { network interface iface = entry get key ( ) ; inet address inet addr = entry get value ( ) ; if ( iface is virtual ( ) ) { continue ; } byte [ ] mac addr ; try { mac addr = socket utils hardware address from network interface ( iface ) ; } catch ( socket exception e ) { logger debug ( " failed to get the hardware address of a network interface : { } " , iface , e ) ; continue ; } boolean replace = false ; int res = compare addresses ( best mac addr , mac addr ) ; if ( res < 0 ) { / / found a better mac address replace = true ; } else if ( res = = 0 ) { / / two mac addresses are of pretty much same quality res = compare addresses ( best inet addr , inet addr ) ; if ( res < 0 ) { / / found a mac address with better inet address replace = true ; } else if ( res = = 0 ) { / / cannot tell the difference choose the longer one if ( best mac addr length < mac addr length ) { replace = true ; } } } if ( replace ) { best mac addr = mac addr ; best inet addr = inet addr ; } } if ( best mac addr = = empty bytes ) { return null ; } switch ( best mac addr length ) { case eui48 mac address length : / / eui - 48 - convert to eui - 64 byte [ ] new addr = new byte [ eui64 mac address length ] ; system arraycopy ( best mac addr , 0 , new addr , 0 , 3 ) ; new addr [ 3 ] = ( byte ) 0x f f ; new addr [ 4 ] = ( byte ) 0x f e ; system arraycopy ( best mac addr , 3 , new addr , 5 , 3 ) ; best mac addr = new addr ; break ; default : / / unknown best mac addr = arrays copy of ( best mac addr , eui64 mac address length ) ; } return best mac addr ; }


streams lines from a url , stopping when our callback returns false , or we have read all of the lines

public static < t > t read lines ( url url , charset charset , line processor < t > callback ) throws i o exception { return as char source ( url , charset ) read lines ( callback ) ; }


create a payload with data only the created payload is { @ link byte buf payload } if the input is { @ link netty data buffer } or otherwise it is { @ link default payload }

public static payload create payload ( data buffer data ) { return data instanceof netty data buffer ? byte buf payload create ( as byte buf ( data ) ) : default payload create ( as byte buffer ( data ) ) ; }


returns whether this session allows playback of clear samples prior to keys being loaded

default boolean play clear samples without keys ( ) { return false ; }


rename through copy - and - delete this is a consequence of the swift filesystem using the path as the hash into the distributed hash table , " the ring " of filenames because of the nature of the operation , it is not atomic

public void rename ( path src , path dst ) throws file not found exception , swift operation failed exception , i o exception { if ( log is debug enabled ( ) ) { log debug ( " mv " + src + " " + dst ) ; } boolean renaming on to self = src equals ( dst ) ; swift object path src object = to object path ( src ) ; swift object path dest object = to object path ( dst ) ; if ( swift utils is root dir ( src object ) ) { throw new swift operation failed exception ( " cannot rename root dir " ) ; } final swift file status src metadata ; src metadata = get object metadata ( src ) ; swift file status dst metadata ; try { dst metadata = get object metadata ( dst ) ; } catch ( file not found exception e ) { / / destination does not exist log debug ( " destination does not exist " ) ; dst metadata = null ; } / / check to see if the destination parent directory exists path src parent = src get parent ( ) ; path dst parent = dst get parent ( ) ; / / skip the overhead of a head call if the src and dest share the same / / parent dir ( in which case the dest dir exists ) , or the destination / / directory is root , in which case it must also exist if ( dst parent ! = null & & ! dst parent equals ( src parent ) ) { swift file status file status ; try { file status = get object metadata ( dst parent ) ; } catch ( file not found exception e ) { / / destination parent doesn ' t exist ; bail out log debug ( " destination parent directory " + dst parent + " doesn ' t exist " ) ; throw e ; } if ( ! file status is dir ( ) ) { throw new parent not directory exception ( dst parent to string ( ) ) ; } } boolean dest exists = dst metadata ! = null ; boolean dest is dir = dest exists & & swift utils is directory ( dst metadata ) ; / / calculate the destination swift object path dest path ; / / enum the child entries and everything underneath list < file status > child stats = list directory ( src object , true , true ) ; boolean src is file = ! src metadata is directory ( ) ; if ( src is file ) { / / source is a simple file or a partitioned file / / outcomes : / / # 1 dest exists and is file : fail / / # 2 dest exists and is dir : destination path becomes under dest dir / / # 3 dest does not exist : use dest as name if ( dest exists ) { if ( dest is dir ) { / / outcome # 2 - move to subdir of dest dest path = to object path ( new path ( dst , src get name ( ) ) ) ; } else { / / outcome # 1 dest it ' s a file : fail if different if ( ! renaming on to self ) { throw new file already exists exception ( " cannot rename a file over one that already exists " ) ; } else { / / is mv self self where self is a file this becomes a no - op log debug ( " renaming file onto self : no - op = > success " ) ; return ; } } } else { / / outcome # 3 - new entry dest path = to object path ( dst ) ; } int child count = child stats size ( ) ; / / here there is one of : / / - a single object = = > standard file / / - > if ( child count = = 0 ) { copy then delete object ( src object , dest path ) ; } else { / / do the copy swift utils debug ( log , " source file appears to be partitioned " + " copying file and deleting children " ) ; copy object ( src object , dest path ) ; for ( file status stat : child stats ) { swift utils debug ( log , " deleting partitioned file % s " , stat ) ; delete object ( stat get path ( ) ) ; } swift rest client delete ( src object ) ; } } else { / / here the source exists and is a directory / / outcomes ( given we know the parent dir exists if we get this far ) / / # 1 destination is a file : fail / / # 2 destination is a directory : create a new dir under that one / / # 3 destination doesn ' t exist : create a new dir with that name / / # 3 and # 4 are only allowed if the dest path is not = = or under src if ( dest exists & & ! dest is dir ) { / / # 1 destination is a file : fail throw new file already exists exception ( " the source is a directory , but not the destination " ) ; } path target path ; if ( dest exists ) { / / # 2 destination is a directory : create a new dir under that one target path = new path ( dst , src get name ( ) ) ; } else { / / # 3 destination doesn ' t exist : create a new dir with that name target path = dst ; } swift object path target object path = to object path ( target path ) ; / / final check for any recursive operations if ( src object is equal to or parent of ( target object path ) ) { / / you can ' t rename a directory onto itself throw new swift operation failed exception ( " cannot move a directory under itself " ) ; } log info ( " mv " + src object + " " + target path ) ; log directory ( " directory to copy " , src object , child stats ) ; / / iterative copy of everything under the directory / / by listing all children this can be done iteratively / / rather than recursively - everything in this list is either a file / / or a 0 - byte - len file pretending to be a directory string src u r i = src to uri ( ) to string ( ) ; int prefix strip count = src u r i length ( ) + 1 ; for ( file status file status : child stats ) { path copy source path = file status get path ( ) ; string copy source u r i = copy source path to uri ( ) to string ( ) ; string copy dest sub path = copy source u r i substring ( prefix strip count ) ; path copy dest path = new path ( target path , copy dest sub path ) ; if ( log is trace enabled ( ) ) { / / trace to debug some low - level rename path problems ; retained / / in case they ever come back log trace ( " src u r i = " + src u r i + " ; copy source u r i = " + copy source u r i + " ; copy dest sub path = " + copy dest sub path + " ; copy dest path = " + copy dest path ) ; } swift object path copy destination = to object path ( copy dest path ) ; try { copy then delete object ( to object path ( copy source path ) , copy destination ) ; } catch ( file not found exception e ) { log info ( " skipping rename of " + copy source path ) ; } / / add a throttle delay throttle ( ) ; } / / now rename self if missing , create the dest directory and warn if ( ! swift utils is root dir ( src object ) ) { try { copy then delete object ( src object , target object path ) ; } catch ( file not found exception e ) { / / create the destination directory log warn ( " source directory deleted during rename " , e ) ; inner create directory ( dest object ) ; } } } }


public void test dog all of ( ) { / / todo : test dog all of }


validates the use of a label within a particular context note that " ok " responses ( and any textmarkup that may be set on them ) will be ignored only warnings and errors are taken into account , and aggregated across all validators this method exists to allow plugins to implement an override for it , enabling checking in non - abstract project contexts without needing to update their jenkins dependency ( and using the new { @ link jenkins model labels label validator } instead )

public form validation check item ( @ non null item item , @ non null label label ) { if ( item instanceof abstract project < ? , ? > ) { return this check ( ( abstract project < ? , ? > ) item , label ) ; } return form validation ok ( ) ; }


returns the common super type of the two given types the default implementation of this method loads the two given classes and uses the java lang class methods to find the common super class it can be overridden to compute this common super type in other ways , in particular without actually loading any class , or to take into account the class that is currently being generated by this class writer , which can of course not be loaded since it is under construction

protected string get common super class ( final string type 1 , final string type 2 ) { class loader class loader = get class loader ( ) ; class < ? > class 1 ; try { class 1 = class for name ( type 1 replace ( ' / ' , ' ' ) , false , class loader ) ; } catch ( class not found exception e ) { throw new type not present exception ( type 1 , e ) ; } class < ? > class 2 ; try { class 2 = class for name ( type 2 replace ( ' / ' , ' ' ) , false , class loader ) ; } catch ( class not found exception e ) { throw new type not present exception ( type 2 , e ) ; } if ( class 1 is assignable from ( class 2 ) ) { return type 1 ; } if ( class 2 is assignable from ( class 1 ) ) { return type 2 ; } if ( class 1 is interface ( ) | | class 2 is interface ( ) ) { return " java / lang / object " ; } else { do { class 1 = class 1 get superclass ( ) ; } while ( ! class 1 is assignable from ( class 2 ) ) ; return class 1 get name ( ) replace ( ' ' , ' / ' ) ; } }


returns the index of the last appearance of the value { @ code target } in { @ code array }

public static int last index of ( boolean [ ] array , boolean target ) { return last index of ( array , target , 0 , array length ) ; }


serializes the response sent to the { @ link org apache flink queryablestate network client }

public static < resp extends message body > byte buf serialize response ( final byte buf allocator alloc , final long request id , final resp response ) { preconditions check not null ( response ) ; return write payload ( alloc , request id , message type request result , response serialize ( ) ) ; }


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


declare executor service : if null , the tasks are executed in a single thread

public builder < i > execute with ( submitter submitter ) { this service = submitter ; return this ; }


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


assert we get an illegal state exception if trying to subscribe to an inner grouped observable more than once

public void exception if subscribe to child more than once ( ) { observable < integer > source = observable just ( 0 ) ; final atomic reference < grouped observable < integer , integer > > inner = new atomic reference < > ( ) ; observable < grouped observable < integer , integer > > m = source group by ( identity , dbl ) ; m subscribe ( new consumer < grouped observable < integer , integer > > ( ) { @ override public void accept ( grouped observable < integer , integer > t 1 ) { inner set ( t 1 ) ; } } ) ; inner get ( ) subscribe ( ) ; observer < integer > o 2 = test helper mock observer ( ) ; inner get ( ) subscribe ( o 2 ) ; verify ( o 2 , never ( ) ) on complete ( ) ; verify ( o 2 , never ( ) ) on next ( any int ( ) ) ; verify ( o 2 ) on error ( any ( illegal state exception class ) ) ; }


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


created to handle records where 0 < input record timestamp < time difference ms these records would create windows with negative start times , which is not supported instead , we will put them into the [ 0 , time difference ms ] window as a " workaround " , and we will update or create their right windows as new records come in later

private void process early ( final k key , final v value , final long input record timestamp , final long close time ) { if ( input record timestamp < 0 | | input record timestamp > = windows time difference ms ( ) ) { log error ( " early record for sliding windows must fall between fall between 0 < = input record timestamp timestamp { } does not fall between 0 < = { } " , input record timestamp , windows time difference ms ( ) ) ; throw new illegal argument exception ( " early record for sliding windows must fall between fall between 0 < = input record timestamp " ) ; } / / a window from [ 0 , time difference ms ] that holds all early records key value < windowed < k > , value and timestamp < agg > > combined window = null ; value and timestamp < agg > right win agg = null ; boolean right win already created = false ; final set < long > window start times = new hash set < > ( ) ; long previous record timestamp = null ; try ( final key value iterator < windowed < k > , value and timestamp < agg > > iterator = window store fetch ( key , key , 0 , / / add 1 to upper bound to catch the current record ' s right window , if it exists , without more calls to the store input record timestamp + 1 ) ) { while ( iterator has next ( ) ) { final key value < windowed < k > , value and timestamp < agg > > window being processed = iterator next ( ) ; final long start time = window being processed key window ( ) start ( ) ; window start times add ( start time ) ; final long window max record timestamp = window being processed value timestamp ( ) ; if ( start time = = 0 ) { combined window = window being processed ; / / we don ' t need to store previous record timestamp if max record timestamp > = timestamp / / because the previous record ' s right window ( if there is a previous record ) / / would have already been created by max record timestamp if ( window max record timestamp < input record timestamp ) { previous record timestamp = window max record timestamp ; } } else if ( start time < = input record timestamp ) { right win agg = window being processed value ; update window and forward ( window being processed key window ( ) , window being processed value , key , value , close time , input record timestamp ) ; } else if ( start time = = input record timestamp + 1 ) { right win already created = true ; } else { log error ( " unexpected window with start { } found when processing record at { } in ` k stream sliding window aggregate ` " , start time , input record timestamp ) ; throw new illegal state exception ( " unexpected window found when processing sliding windows " ) ; } } } / / if there wasn ' t a right window agg found and we need a right window for our new record , / / the current aggregate in the combined window will go in the new record ' s right window we can be sure that the combined / / window only holds records that fall into the current record ' s right window for two reasons : / / 1 if there were records earlier than the current record and later than the current record , there would be a right window found / / when we looked for right window agg / / 2 if there was only a record before the current record , we wouldn ' t need a right window for the current record and wouldn ' t update the / / right win agg value here , as the combined window value timestamp ( ) < input record timestamp if ( right win agg = = null & & combined window ! = null & & combined window value timestamp ( ) > input record timestamp ) { right win agg = combined window value ; } if ( ! right win already created & & right window is not empty ( right win agg , input record timestamp ) ) { create current record right window ( input record timestamp , right win agg , key ) ; } / / create the right window for the previous record if the previous record exists and the window hasn ' t already been created if ( previous record timestamp ! = null & & ! window start times contains ( previous record timestamp + 1 ) ) { create previous record right window ( previous record timestamp + 1 , input record timestamp , key , value , close time ) ; } if ( combined window = = null ) { final time window window = new time window ( 0 , windows time difference ms ( ) ) ; final value and timestamp < agg > value and time = value and timestamp make ( initializer apply ( ) , input record timestamp ) ; update window and forward ( window , value and time , key , value , close time , input record timestamp ) ; } else { / / update the combined window with the new aggregate update window and forward ( combined window key window ( ) , combined window value , key , value , close time , input record timestamp ) ; } }


reserve memory of certain size if it is available adjusted version of { @ link java nio bits # reserve memory ( long , int ) } taken from java 11

void reserve memory ( long size ) throws memory reservation exception { reserve memory ( size , max sleeps ) ; }


gets the ticket granting ticket id from the request and flow scopes

public static string get ticket granting ticket id ( final request context context ) { val tgt from request = get ticket granting ticket id from ( context get request scope ( ) ) ; val tgt from flow = get ticket granting ticket id from ( context get flow scope ( ) ) ; return optional of nullable ( tgt from request ) or else ( tgt from flow ) ; }


before calling this , call { @ link collector metrics # increment messages ( ) } , and { @ link collector metrics # increment bytes ( int ) } do not call any other metrics callbacks as those are handled internal to this method

public void accept spans ( byte [ ] serialized , callback < void > callback ) { bytes decoder < span > decoder ; try { decoder = span bytes decoder detector decoder for list message ( serialized ) ; } catch ( runtime exception | error e ) { handle decode error ( e , callback ) ; return ; } accept spans ( serialized , decoder , callback ) ; }


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


build a { @ linkplain function definition } for a binary function that is not aware of time zone and does not support { @ code distinct }

public static < t extends function > function definition def ( class < t > function , binary function builder < t > ctor ref , string names ) { function builder builder = ( source , children , distinct , cfg ) - > { boolean is binary optional param function = optional argument class is assignable from ( function ) ; if ( is binary optional param function & & ( children size ( ) > 2 | | children size ( ) < 1 ) ) { throw new ql illegal argument exception ( " expects one or two arguments " ) ; } else if ( ! is binary optional param function & & children size ( ) ! = 2 ) { throw new ql illegal argument exception ( " expects exactly two arguments " ) ; } if ( distinct ) { throw new ql illegal argument exception ( " does not support distinct yet it was specified " ) ; } return ctor ref build ( source , children get ( 0 ) , children size ( ) = = 2 ? children get ( 1 ) : null ) ; } ; return def ( function , builder , false , names ) ; }


if this is the first time calling this method , the buffer will be checked to make sure it starts with soi marker ( 0xffd 8 ) if the image has been identified as a non - jpeg , data will be ignored and false will be returned immediately on all subsequent calls this object maintains state of the position of the last read byte on repeated calls to this method , it will continue from where it left off

public boolean parse more data ( final encoded image encoded image ) { if ( m parser state = = not a jpeg ) { return false ; } final int data buffer size = encoded image get size ( ) ; / / is there any new data to parse ? / / m bytes parsed might be greater than size of data buffer - that happens when / / we skip more data than is available to read inside do parse more data method if ( data buffer size < = m bytes parsed ) { return false ; } final input stream buffered data stream = new pooled byte array buffered input stream ( encoded image get input stream ( ) , m byte array pool get ( buffer size ) , m byte array pool ) ; try { stream util skip ( buffered data stream , m bytes parsed ) ; return do parse more data ( buffered data stream ) ; } catch ( i o exception ioe ) { / / does not happen - streams returned by pooled byte buffers do not throw i o exceptions throwables propagate ( ioe ) ; return false ; } finally { closeables close quietly ( buffered data stream ) ; } }


simple test for writing to and rolling the edit log

public void test simple edit log ( ) throws i o exception { / / start a cluster configuration conf = get conf ( ) ; mini d f s cluster cluster = null ; file system file sys = null ; try { cluster = new mini d f s cluster builder ( conf ) num data nodes ( num data nodes ) build ( ) ; cluster wait active ( ) ; file sys = cluster get file system ( ) ; final f s namesystem namesystem = cluster get namesystem ( ) ; f s image fsimage = namesystem get f s image ( ) ; final f s edit log edit log = fsimage get edit log ( ) ; assert exists in storage dirs ( cluster , name node dir type edits , n n storage get in progress edits file name ( 1 ) ) ; edit log log set replication ( " fakefile " , ( short ) 1 ) ; edit log log sync ( ) ; edit log roll edit log ( name node layout version current layout version ) ; assert exists in storage dirs ( cluster , name node dir type edits , n n storage get finalized edits file name ( 1 , 3 ) ) ; assert exists in storage dirs ( cluster , name node dir type edits , n n storage get in progress edits file name ( 4 ) ) ; edit log log set replication ( " fakefile " , ( short ) 2 ) ; edit log log sync ( ) ; edit log close ( ) ; } finally { if ( file sys ! = null ) file sys close ( ) ; if ( cluster ! = null ) cluster shutdown ( ) ; } }


returns true if the specified index into the underlying byte provider is valid

public boolean is valid index ( int index ) throws i o exception { return provider is valid index ( index & conv int mask ) ; }


connect to the specified server via framed transport

public t transport connect ( t transport transport , string server host ) throws i o exception , t transport exception ;


returns an { @ code immutable list } containing all of the elements from this { @ code fluent iterable } in the order specified by { @ code comparator } to produce an { @ code immutable list } sorted by its natural ordering , use { @ code to sorted list ( ordering natural ( ) ) } < b > { @ code stream } equivalent : < b > pass { @ link immutable list # to immutable list } to { @ code stream sorted ( comparator ) collect ( ) }

public final immutable list < e > to sorted list ( comparator < ? super e > comparator ) { return ordering from ( comparator ) immutable sorted copy ( get delegate ( ) ) ; }


clear all of this request ' s attributes

public void clear attributes ( ) { this attributes clear ( ) ; }


public api response < model api response > upload file with required file with http info ( long pet id , file required file , string additional metadata ) throws api exception { http request builder local var request builder = upload file with required file request builder ( pet id , required file , additional metadata ) ; try { http response < input stream > local var response = member var http client send ( local var request builder build ( ) , http response body handlers of input stream ( ) ) ; if ( member var response interceptor ! = null ) { member var response interceptor accept ( local var response ) ; } if ( local var response status code ( ) / 100 ! = 2 ) { throw new api exception ( local var response status code ( ) , " upload file with required file call received non - success response " , local var response headers ( ) , local var response body ( ) = = null ? null : new string ( local var response body ( ) read all bytes ( ) ) ) ; } return new api response < model api response > ( local var response status code ( ) , local var response headers ( ) map ( ) , member var object mapper read value ( local var response body ( ) , new type reference < model api response > ( ) { } ) ) ; } catch ( i o exception e ) { throw new api exception ( e ) ; } catch ( interrupted exception e ) { thread current thread ( ) interrupt ( ) ; throw new api exception ( e ) ; } }


return the cookie " max - age " attribute in seconds a positive value indicates when the cookie expires relative to the current time a value of 0 means the cookie should expire immediately a negative value means no " max - age " attribute in which case the cookie is removed when the browser is closed

public duration get max age ( ) { return this max age ; }


return the round corner bitmap with border

public static bitmap add corner border ( final bitmap src , @ float range ( from = 1 ) final float border size , @ color int final int color , final float [ ] radii ) { return add border ( src , border size , color , false , radii , false ) ; }


returns all edges that are being added to existing nodes

public set < fcg edge > get indirect edges ( ) { return indirect edges ; }


test a command execution ( asynchronously ) that fails , has get fallback implemented but that fails as well

public void test queue failure with fallback failure ( ) { test hystrix command < integer > command = get command ( execution isolation strategy thread , abstract test hystrix command execution result failure , abstract test hystrix command fallback result failure ) ; try { command queue ( ) get ( ) ; fail ( " we shouldn ' t get here " ) ; } catch ( exception e ) { if ( e get cause ( ) instanceof hystrix runtime exception ) { hystrix runtime exception de = ( hystrix runtime exception ) e get cause ( ) ; e print stack trace ( ) ; assert not null ( de get fallback exception ( ) ) ; } else { fail ( " the cause should be hystrix runtime exception " ) ; } } assert true ( command get execution time in milliseconds ( ) > - 1 ) ; assert true ( command is failed execution ( ) ) ; assert command execution events ( command , hystrix event type failure , hystrix event type fallback failure ) ; assert not null ( command get execution exception ( ) ) ; assert equals ( 0 , command get builder ( ) metrics get current concurrent execution count ( ) ) ; assert sane hystrix request log ( 1 ) ; }


： - modify 、 ， ， ， ， ，

public void run unprivileged ( ) { / / request config rc = request config custom ( ) set connection request timeout ( 10 * 1000 ) set connect timeout ( 10 * 1000 ) set socket timeout ( 15 * 1000 ) build ( ) ; http head head = new http head ( location ) ; head set config ( rc ) ; / / if ( last modified ! = null ) { head set header ( " if - modified - since " , last modified ) ; } if ( e tags ! = null ) { head set header ( " if - none - match " , e tags ) ; } closeable http response response = null ; try { response = httpclient execute ( head ) ; / / if ( response get status line ( ) get status code ( ) = = 200 ) { if ( ( ( response get last header ( " last - modified " ) ! = null ) & & ! response get last header ( " last - modified " ) get value ( ) equals ignore case ( last modified ) ) | | ( ( response get last header ( " e tag " ) ! = null ) & & ! response get last header ( " e tag " ) get value ( ) equals ignore case ( e tags ) ) ) { / / , ， modified , e tags dictionary get singleton ( ) re load main dict ( ) ; last modified = response get last header ( " last - modified " ) = = null ? null : response get last header ( " last - modified " ) get value ( ) ; e tags = response get last header ( " e tag " ) = = null ? null : response get last header ( " e tag " ) get value ( ) ; } } else if ( response get status line ( ) get status code ( ) = = 304 ) { / / ， / / noop } else { logger info ( " remote ext dict { } return bad code { } " , location , response get status line ( ) get status code ( ) ) ; } } catch ( exception e ) { logger error ( " remote ext dict { } error ! " , e , location ) ; } finally { try { if ( response ! = null ) { response close ( ) ; } } catch ( i o exception e ) { logger error ( e get message ( ) , e ) ; } } }


writes the current leader ' s address as well the given leader session id to zoo keeper

public void write leader information ( leader information leader information ) { assert ( running ) ; / / this method does not have to be synchronized because the curator framework client / / is thread - safe we do not write the empty data to zoo keeper here because / / check - leadership - and - update / / is not a transactional operation we may wrongly clear the data written by new leader if ( log is debug enabled ( ) ) { log debug ( " write leader information : { } " , leader information ) ; } if ( leader information is empty ( ) ) { return ; } try { final byte array output stream baos = new byte array output stream ( ) ; final object output stream oos = new object output stream ( baos ) ; oos write u t f ( leader information get leader address ( ) ) ; oos write object ( leader information get leader session i d ( ) ) ; oos close ( ) ; boolean data written = false ; while ( ! data written & & leader latch has leadership ( ) ) { stat stat = client check exists ( ) for path ( leader path ) ; if ( stat ! = null ) { long owner = stat get ephemeral owner ( ) ; long session i d = client get zookeeper client ( ) get zoo keeper ( ) get session id ( ) ; if ( owner = = session i d ) { try { client set data ( ) for path ( leader path , baos to byte array ( ) ) ; data written = true ; } catch ( keeper exception no node exception no node ) { / / node was deleted in the meantime } } else { try { client delete ( ) for path ( leader path ) ; } catch ( keeper exception no node exception no node ) { / / node was deleted in the meantime - - > try again } } } else { try { client create ( ) creating parents if needed ( ) with mode ( create mode ephemeral ) for path ( leader path , baos to byte array ( ) ) ; data written = true ; } catch ( keeper exception node exists exception node exists ) { / / node has been created in the meantime - - > try again } } } if ( log is debug enabled ( ) ) { log debug ( " successfully wrote leader information : { } " , leader information ) ; } } catch ( exception e ) { fatal error handler on fatal error ( new leader election exception ( " could not write leader address and leader session id to " + " zoo keeper " , e ) ) ; } }


deprecated : change usages of this to { @ link # on fallback start } invoked before { @ link hystrix command # get fallback ( ) } is about to be executed

public < t > void on fallback start ( hystrix command < t > command instance ) { / / do nothing by default }


returns { @ code true } if an i pv 6 address should be preferred when a host has both an i pv 4 address and an i pv 6 address the default value of this property is { @ code false }

public static boolean is ip v 6 addresses preferred ( ) { return ipv6 addresses preferred ; }


test the property ' $ special property name '

public void $ special property name test ( ) { / / todo : test $ special property name }


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


public object navigation ( context m context , postcard postcard , int request code , navigation callback callback ) { return a router get instance ( ) navigation ( m context , postcard , request code , callback ) ; }


merges the partitions part of { @ code create table } statement partitioning is a single property of a table , thus there can be at most a single instance of partitioning therefore it is not possible to use { @ link merging strategy # including } with partitioning defined in both source and derived table

public list < string > merge partitions ( merging strategy merging strategy , list < string > source partitions , list < string > derived partitions ) { if ( ! derived partitions is empty ( ) & & ! source partitions is empty ( ) & & merging strategy ! = merging strategy excluding ) { throw new validation exception ( " the base table already has partitions defined you might want to specify " + " excluding partitions " ) ; } if ( ! derived partitions is empty ( ) ) { return derived partitions ; } return source partitions ; }


{ @ inherit doc } the returned collection is immutable

public collection < v > replace values ( @ nullable k key , iterable < ? extends v > values ) { iterator < ? extends v > iterator = values iterator ( ) ; if ( ! iterator has next ( ) ) { return remove all ( key ) ; } / / todo ( lowasser ) : investigate atomic failure ? collection < v > collection = get or create collection ( key ) ; collection < v > old values = create collection ( ) ; old values add all ( collection ) ; total size - = collection size ( ) ; collection clear ( ) ; while ( iterator has next ( ) ) { if ( collection add ( iterator next ( ) ) ) { total size + + ; } } return unmodifiable collection subclass ( old values ) ; }


public static < t extends throwable > t find cause ( @ not null throwable throwable , class < t > cause ) { while ( throwable ! = null ) { if ( throwable get class ( ) equals ( cause ) ) { return ( t ) throwable ; } throwable = throwable get cause ( ) ; } return null ; }


public void set cluster ( disk balancer cluster new cluster ) { this cluster = new cluster ; }


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


default path get full path ( path parent ) { if ( is empty local name ( ) ) { return parent ; } return new path ( parent , get local name ( ) ) ; }


create user this can only be done by the logged in user

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


modify configuration according user - specified generic options

private void process general options ( command line line ) throws i o exception { if ( line has option ( " fs " ) ) { file system set default uri ( conf , line get option value ( " fs " ) ) ; } if ( line has option ( " jt " ) ) { string option value = line get option value ( " jt " ) ; if ( option value equals ignore case ( " local " ) ) { conf set ( " mapreduce framework name " , option value ) ; } conf set ( " yarn resourcemanager address " , option value , " from - jt command line option " ) ; } if ( line has option ( " conf " ) ) { string [ ] values = line get option values ( " conf " ) ; for ( string value : values ) { conf add resource ( new path ( value ) ) ; } } if ( line has option ( ' d ' ) ) { string [ ] property = line get option values ( ' d ' ) ; for ( string prop : property ) { string [ ] keyval = prop split ( " = " , 2 ) ; if ( keyval length = = 2 ) { conf set ( keyval [ 0 ] , keyval [ 1 ] , " from command line " ) ; } } } if ( line has option ( " libjars " ) ) { / / for libjars , we allow expansion of wildcards conf set ( " tmpjars " , validate files ( line get option value ( " libjars " ) , true ) , " from - libjars command line option " ) ; / / setting libjars in client classpath url [ ] libjars = get lib jars ( conf ) ; if ( libjars ! = null & & libjars length > 0 ) { conf set class loader ( new u r l class loader ( libjars , conf get class loader ( ) ) ) ; thread current thread ( ) set context class loader ( new u r l class loader ( libjars , thread current thread ( ) get context class loader ( ) ) ) ; } } if ( line has option ( " files " ) ) { conf set ( " tmpfiles " , validate files ( line get option value ( " files " ) ) , " from - files command line option " ) ; } if ( line has option ( " archives " ) ) { conf set ( " tmparchives " , validate files ( line get option value ( " archives " ) ) , " from - archives command line option " ) ; } conf set boolean ( " mapreduce client genericoptionsparser used " , true ) ; / / tokens file if ( line has option ( " token cache file " ) ) { string file name = line get option value ( " token cache file " ) ; / / check if the local file exists file system local fs = file system get local ( conf ) ; path p = local fs make qualified ( new path ( file name ) ) ; local fs get file status ( p ) ; if ( log is debug enabled ( ) ) { log debug ( " setting conf tokens file : " + file name ) ; } user group information get current user ( ) add credentials ( credentials read token storage file ( p , conf ) ) ; conf set ( " mapreduce job credentials binary " , p to string ( ) , " from - token cache file command line option " ) ; } }


specify the { @ link message converter } to use for turning { @ link org springframework remoting support remote invocation } objects into request messages , as well as response messages into { @ link org springframework remoting support remote invocation result } objects default is a { @ link simple message converter } , using a standard jms { @ link javax jms object message } for each invocation invocation result object custom implementations may generally adapt { @ link java io serializable } objects into special kinds of messages , or might be specifically tailored for translating { @ code remote invocation ( result ) s } into specific kinds of messages

public void set message converter ( @ nullable message converter message converter ) { this message converter = ( message converter ! = null ? message converter : new simple message converter ( ) ) ; }


enable monitoring and waits for monitoring documents to be collected and indexed in monitoring indices this is the signal that the local exporter is started and ready for the tests

private void enable monitoring ( ) throws exception { if ( is monitoring test ( ) ) { final client yaml test response xpack usage = call api ( " xpack usage " , singleton map ( " filter path " , " monitoring enabled exporters " ) , empty list ( ) , get api call headers ( ) ) ; @ suppress warnings ( " unchecked " ) final map < string , object > exporters = ( map < string , object > ) xpack usage evaluate ( " monitoring enabled exporters " ) ; assert not null ( " list of monitoring exporters must not be null " , exporters ) ; assert that ( " list of enabled exporters must be empty before enabling monitoring " , x content map values extract raw values ( " monitoring enabled exporters " , exporters ) , has size ( 0 ) ) ; final map < string , object > settings = new hash map < > ( ) ; settings put ( " xpack monitoring collection enabled " , true ) ; settings put ( " xpack monitoring collection interval " , " 1s " ) ; settings put ( " xpack monitoring exporters local type " , " local " ) ; settings put ( " xpack monitoring exporters local enabled " , true ) ; await call api ( " cluster put settings " , empty map ( ) , singleton list ( singleton map ( " transient " , settings ) ) , response - > { object acknowledged = response evaluate ( " acknowledged " ) ; return acknowledged ! = null & & ( boolean ) acknowledged ; } , ( ) - > " exception when enabling monitoring " ) ; map < string , string > search params = new hash map < > ( ) ; search params put ( " index " , " monitoring - * " ) ; search params put ( total hits as int param , " true " ) ; await call api ( " search " , search params , empty list ( ) , response - > ( ( number ) response evaluate ( " hits total " ) ) int value ( ) > 0 , ( ) - > " exception when waiting for monitoring documents to be indexed " ) ; } }


performs a single left mouse click in the center of the given provider this is useful when trying to make a provider the active provider , while making sure that one of the provider ' s components has focus

public static component click component provider ( component provider provider ) { j component component = provider get component ( ) ; dockable component dockable component = get dockable component ( component ) ; select tab if available ( dockable component ) ; rectangle bounds = component get bounds ( ) ; int center x = ( bounds x + bounds width ) > > 1 ; int center y = ( bounds y + bounds height ) > > 1 ; return click component provider ( provider , mouse event button1 , center x , center y , 1 , 0 , false ) ; }


public type listener get listener ( ) { return listener ; }


public boolean equals ( object other ) { if ( this = = other ) { return true ; } if ( other = = null | | get class ( ) ! = other get class ( ) ) { return false ; } model size stats that = ( model size stats ) other ; return this model bytes = = that model bytes & & objects equals ( this peak model bytes , that peak model bytes ) & & objects equals ( this model bytes exceeded , that model bytes exceeded ) & & objects equals ( this model bytes memory limit , that model bytes memory limit ) & & this total by field count = = that total by field count & & this total over field count = = that total over field count & & this total partition field count = = that total partition field count & & this bucket allocation failures count = = that bucket allocation failures count & & objects equals ( this memory status , that memory status ) & & objects equals ( this assignment memory basis , that assignment memory basis ) & & this categorized doc count = = that categorized doc count & & this total category count = = that total category count & & this frequent category count = = that frequent category count & & this rare category count = = that rare category count & & this dead category count = = that dead category count & & this failed category count = = that failed category count & & objects equals ( this categorization status , that categorization status ) & & objects equals ( this timestamp , that timestamp ) & & objects equals ( this log time , that log time ) & & objects equals ( this job id , that job id ) ; }


resolve the specified data source object into a data source instance the default implementation handles data source instances and data source names ( to be resolved via a { @ link # set data source lookup data source lookup } )

protected data source resolve specified data source ( object data source ) throws illegal argument exception { if ( data source instanceof data source ) { return ( data source ) data source ; } else if ( data source instanceof string ) { return this data source lookup get data source ( ( string ) data source ) ; } else { throw new illegal argument exception ( " illegal data source value - only [ javax sql data source ] and string supported : " + data source ) ; } }


validate all given mail addresses the default implementation simply delegates to { @ link # validate address } for each address

protected void validate addresses ( internet address [ ] addresses ) throws address exception { for ( internet address address : addresses ) { validate address ( address ) ; } }


should use the client environment ' s tmpdir envvar if specified

public void test rewrite env with client tmpdir ( ) throws exception { posix local env provider p = new posix local env provider ( immutable map of ( " tmpdir " , " client - env / tmp " ) ) ; assert that ( rewrite env ( p , immutable map of ( " key 1 " , " value 1 " ) ) ) is equal to ( immutable map of ( " key 1 " , " value 1 " , " tmpdir " , " client - env / tmp " ) ) ; assert that ( rewrite env ( p , immutable map of ( " key 1 " , " value 1 " , " tmpdir " , " ignored " ) ) ) is equal to ( immutable map of ( " key 1 " , " value 1 " , " tmpdir " , " client - env / tmp " ) ) ; }


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


public void remove ( ) { check state ( key ! = long min value ) ; prev next = next ; next prev = prev ; prev = next = null ; type = null ; }


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


returns a hash function implementing the message authentication code ( mac ) algorithm , using the sha - 512 ( 512 hash bits ) hash function and the given secret key

public static hash function hmac sha 5 1 2 ( key key ) { return new mac hash function ( " hmac s h a 5 1 2 " , key , hmac to string ( " hmac sha 5 1 2 " , key ) ) ; }


callback method intended to be implemented by the caller to { @ link file system service # get derived file ( fsrl , string , derived file producer , task monitor ) } the implementation needs to return an { @ link input stream } that contains the bytes of the derived file

public input stream produce derived stream ( file src file ) throws i o exception , cancelled exception ;


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


show the given tooltip on the component with the given handle instance

public static void show tooltip on handle ( component context c , litho tooltip litho tooltip , handle handle ) { show tooltip on handle ( c , litho tooltip , handle , 0 , 0 ) ; }


writes a pkgdummy bzl file that prints a marker phrase when it finishes evaluating , and an accompanying build file that loads it

private void write pkg bzl ( string lines ) throws exception { scratch file ( " pkg / build " , " load ( ' : dummy bzl ' , ' dummy symbol ' ) " ) ; scratch file ( " pkg / dummy " ) ; list < string > modified lines = new array list < > ( arrays as list ( lines ) ) ; modified lines add ( " dummy symbol = none " ) ; / / the marker phrase might not be needed , but i don ' t entirely trust build view test case modified lines add ( " print ( ' dummy bzl evaluation completed ' ) " ) ; scratch file ( " pkg / dummy bzl " , modified lines to array ( lines ) ) ; }


alias for { @ link # get source ( ) } this method may be favored over { @ code get source ( ) } & mdash ; for example , to improve readability in sp e l expressions for event processing { @ linkplain org springframework context event event listener # condition conditions }

public final test context get test context ( ) { return get source ( ) ; }


read one line from the input stream into the given text

public int read line ( text str , int max line length , int max bytes to consume ) throws i o exception { if ( this record delimiter bytes ! = null ) { return read custom line ( str , max line length , max bytes to consume ) ; } else { return read default line ( str , max line length , max bytes to consume ) ; } }


variant of { @ link # data ( object ) } that also accepts a hint for the types of values that will be produced the class hint is used to find a compatible { @ code encoder } once , up front vs per value

retrieve spec data ( object producer , class < ? > element class ) ;


public static < t extends comparable < ? super t > > void sort reverse ( list < t > list ) { collections sort ( list , collections reverse order ( ) ) ; }


set the url of the resource that this view wraps the url must be appropriate for the concrete view implementation

public void set url ( @ nullable string url ) { this url = url ; }


determine whether the given method is an " equals " method

public static boolean is equals method ( @ nullable method method ) { return reflection utils is equals method ( method ) ; }


evaluates two expressions and asserts that their results are equal

public scenario test eval ( string src , string expected eval string ) throws exception { run test ( create comparison testable ( src , expected eval string , true ) ) ; return this ; }


compute the remainder of a dividend and divisor pair the index in the array corresponds to the power of the entry for example p [ 0 ] is the constant term of the polynomial p

public void remainder ( int [ ] dividend , int [ ] divisor ) { for ( int i = dividend length - divisor length ; i > = 0 ; i - - ) { int ratio = div table [ dividend [ i + divisor length - 1 ] ] [ divisor [ divisor length - 1 ] ] ; for ( int j = 0 ; j < divisor length ; j + + ) { int k = j + i ; dividend [ k ] = dividend [ k ] ^ mul table [ ratio ] [ divisor [ j ] ] ; } } }


handle case where at least one of { @ code a } or { @ code b } is { @ link # empty } in the following diagrams , the symbol { @ code $ } is used to represent { @ link # empty } < h 2 > local - context merges < h 2 > these local - context merge operations are used when { @ code root is wildcard } is true { @ link # empty } is superset of any graph ; return { @ link # empty } < br > < embed src = " images local merge empty root svg " type = " imagesvg + xml " > { @ link # empty } and anything is { @ code # empty } , so merged parent is { @ code # empty } ; return left graph < br > < embed src = " images local merge empty parent svg " type = " imagesvg + xml " > special case of last merge if local context < br > < embed src = " images local merge diff roots svg " type = " imagesvg + xml " > < h 2 > full - context merges < h 2 > these full - context merge operations are used when { @ code root is wildcard } is false < embed src = " images full merge empty roots svg " type = " imagesvg + xml " > must keep all contexts ; { @ link # empty } in array is a special value ( and null parent ) < br > < embed src = " images full merge empty root svg " type = " imagesvg + xml " > < embed src = " images full merge same root svg " type = " imagesvg + xml " >

public static prediction context merge root ( singleton prediction context a , singleton prediction context b , boolean root is wildcard ) { if ( root is wildcard ) { if ( a = = empty ) return empty ; / / * + b = * if ( b = = empty ) return empty ; / / a + * = * } else { if ( a = = empty & & b = = empty ) return empty ; / / $ + $ = $ if ( a = = empty ) { / / $ + x = [ x , $ ] int [ ] payloads = { b return state , empty return state } ; prediction context [ ] parents = { b parent , null } ; prediction context joined = new array prediction context ( parents , payloads ) ; return joined ; } if ( b = = empty ) { / / x + $ = [ x , $ ] ( $ is always last if present ) int [ ] payloads = { a return state , empty return state } ; prediction context [ ] parents = { a parent , null } ; prediction context joined = new array prediction context ( parents , payloads ) ; return joined ; } } return null ; }


this test checks an implementation dependent feature it tests that the method { @ code add edge } will silently add the missing nodes to the graph , then add the edge connecting them we are not using the proxy methods here as we want to test { @ code add edge } when the end - points are not elements of the graph

public void add edge nodes not in graph ( ) { assume ( ) that ( graph is mutable ( ) ) is true ( ) ; network as mutable network add node ( n1 ) ; assert true ( network as mutable network add edge ( n1 , n5 , e15 ) ) ; assert true ( network as mutable network add edge ( n4 , n1 , e41 ) ) ; assert true ( network as mutable network add edge ( n2 , n3 , e23 ) ) ; assert that ( network nodes ( ) ) contains exactly ( n1 , n5 , n4 , n2 , n3 ) ; assert that ( network edges ( ) ) contains exactly ( e15 , e41 , e23 ) ; assert that ( network edges connecting ( n1 , n5 ) ) contains exactly ( e15 ) ; assert that ( network edges connecting ( n4 , n1 ) ) contains exactly ( e41 ) ; assert that ( network edges connecting ( n2 , n3 ) ) contains exactly ( e23 ) ; assert that ( network edges connecting ( n3 , n2 ) ) contains exactly ( e23 ) ; }


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


gets the opacity from a color inspired by android color drawable

public static int get opacity from color ( int color ) { int color alpha = color > > > 24 ; if ( color alpha = = 255 ) { return pixel format opaque ; } else if ( color alpha = = 0 ) { return pixel format transparent ; } else { return pixel format translucent ; } }


boolean rename file ( file new file ) throws i o exception { if ( raf ! = null ) { raf close ( ) ; } if ( file rename to ( new file ) ) { file = new file ; if ( raf ! = null ) { raf = new random access file ( file , " rw " ) ; } return true ; } return false ; }


public void shutdown ( ) { websocket disconnect ( ) ; }


check to see if a command can be accepted

private boolean validate command ( string [ ] args ) throws exception { cli cli = new cli ( ssl conf ) ; try { cli parse arguments ( args ) ; } catch ( hadoop illegal argument exception e ) { return false ; } catch ( exception e ) { / / this is used to verify the command arguments only / / no hadoop illegal argument exception = the arguments are good return true ; } return true ; }


indicates whether the local side of this stream is open ( i e the state is either { @ link state # open } or { @ link state # half closed remote } )

public boolean local side open ( ) { return local side open ; }


appends all of the values in the specified array to the end of this array if the combined array would exceed capacity then no values are appended

boolean add all ( value array < t > source ) ;


transition to the completed state and set the exception

boolean set exception ( throwable t ) { return complete ( null , t , completed ) ; }


increment the number of operations which could not be successfully executed

public void record error ( ) { record processing errors record ( ) ; }


create a document id based on the input objects

public string get i d ( ) { if ( objects for i d generation size ( ) = = 0 ) { throw new runtime exception ( " add at least 1 object before generating the id " ) ; } bytes ref builder buffer = new bytes ref builder ( ) ; bytes ref builder hashed bytes = new bytes ref builder ( ) ; for ( object value : objects for i d generation values ( ) ) { byte [ ] v = get bytes ( value ) ; if ( v length = = 0 ) { v = empty value ; } buffer append ( v , 0 , v length ) ; buffer append ( delim ) ; / / keep the 1st byte of every object if ( hashed bytes length ( ) < = max first bytes ) { hashed bytes append ( v [ 0 ] ) ; } } murmur hash 3 hash 1 2 8 hasher = murmur hash 3 hash 1 2 8 ( buffer bytes ( ) , 0 , buffer length ( ) , seed , new murmur hash 3 hash 1 2 8 ( ) ) ; hashed bytes append ( numbers long to bytes ( hasher h 1 ) , 0 , 8 ) ; hashed bytes append ( numbers long to bytes ( hasher h 2 ) , 0 , 8 ) ; return base 6 4 get url encoder ( ) without padding ( ) encode to string ( hashed bytes bytes ( ) ) ; }


checks a range of offsets for validity , throwing if invalid

private void check offsets ( int s , int e ) { if ( ( s < 0 ) | | ( e < s ) | | ( e > size ) ) { throw new illegal argument exception ( " bad range : " + s + " " + e + " ; actual size " + size ) ; } }


determine whether an annotation of the specified { @ code annotation type } is present on the supplied { @ code clazz } and is { @ linkplain java lang annotation inherited inherited } ( i e not directly present ) meta - annotations will not be searched if the supplied { @ code clazz } is an interface , only the interface itself will be checked in accordance with standard meta - annotation semantics in java , the inheritance hierarchy for interfaces will not be traversed see the { @ linkplain java lang annotation inherited javadoc } for the { @ code @ inherited } meta - annotation for further details regarding annotation inheritance

public static boolean is annotation inherited ( class < ? extends annotation > annotation type , class < ? > clazz ) { return merged annotations from ( clazz , search strategy inherited annotations ) stream ( annotation type ) filter ( merged annotation : : is directly present ) find first ( ) or else get ( merged annotation : : missing ) get aggregate index ( ) > 0 ; }


returns a { @ link decision } whether shards of the given index should be auto - expanded to this node at this state of the { @ link routing allocation } the default is { @ link decision # always }

public decision should auto expand to node ( index metadata index metadata , discovery node node , routing allocation allocation ) { return decision always ; }


public object get table data source ( ) ;


enter a parse tree produced by { @ link eql base parser # sequence term }

void enter sequence term ( eql base parser sequence term context ctx ) ;


public string get last name ( ) { return last name ; }


marks this directory listing as full and authoritative

public void set authoritative ( boolean authoritative ) { this is authoritative = authoritative ; }


return a single bean of the given type or subtypes , also picking up beans defined in ancestor bean factories if the current bean factory is a hierarchical bean factory useful convenience method when we expect a single bean and don ' t care about the bean name does consider objects created by factory beans if the " allow eager init " flag is set , which means that factory beans will get initialized if the object created by the factory bean doesn ' t match , the raw factory bean itself will be matched against the type if " allow eager init " is not set , only raw factory beans will be checked ( which doesn ' t require initialization of each factory bean ) < b > note : beans of the same name will take precedence at the ' lowest ' factory level , i e such beans will be returned from the lowest factory that they are being found in , hiding corresponding beans in ancestor factories < b > this feature allows for ' replacing ' beans by explicitly choosing the same bean name in a child factory ; the bean in the ancestor factory won ' t be visible then , not even for by - type lookups

public static < t > t bean of type including ancestors ( listable bean factory lbf , class < t > type , boolean include non singletons , boolean allow eager init ) throws beans exception { map < string , t > beans of type = beans of type including ancestors ( lbf , type , include non singletons , allow eager init ) ; return unique bean ( type , beans of type ) ; }


protected event do execute ( final request context context ) { try { val request = web utils get http servlet request from external webflow context ( context ) ; val wa = request get parameter ( wa ) ; if ( string utils is not blank ( wa ) & & wa equals ignore case ( wsignin ) ) { ws federation response validator validate ws federation authentication request ( context ) ; return super do execute ( context ) ; } return ws federation request builder build authentication request event ( context ) ; } catch ( final exception ex ) { logging utils error ( logger , ex ) ; throw new unauthorized service exception ( unauthorized service exception code unauthz service , ex get message ( ) ) ; } }


returns all ( types of ) convenience symlinks that may be created note that this is independent of which symlinks are actually requested by the build options ; that ' s controlled by returning no candidates in { @ link symlink definition # get link paths } the order of the result indicates precedence for { @ link path pretty printer }

private static final immutable list < symlink definition > get all link definitions ( iterable < symlink definition > symlink definitions , boolean include product out ) { / / todo ( mitchellhyang ) : remove the boolean parameter " include product out " after the flag / / " - - experimental no product name out symlink " has been removed we should avoid adding new / / parameters to this method however , in this case , without the " include product out " , callers / / such as the pretty printer may print out false information immutable list builder < symlink definition > builder = immutable list builder ( ) ; builder add all ( convenience symlinks get standard link definitions ( include product out ) ) ; builder add all ( symlink definitions ) ; return builder build ( ) ; }


return the interval in common between this and o

public interval intersection ( interval other ) { return interval of ( math max ( a , other a ) , math min ( b , other b ) ) ; }


awaits until the internal latch is counted down if the wait times out or gets interrupted , the { @ code test observer } { @ code test subscriber } is cancelled

public final u await done ( long time , @ non null time unit unit ) { try { if ( ! done await ( time , unit ) ) { timeout = true ; dispose ( ) ; } } catch ( interrupted exception ex ) { dispose ( ) ; throw exception helper wrap or throw ( ex ) ; } return ( u ) this ; }


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


returns the process cpu usage in percent

public short get process cpu percent ( ) { return probes get load and scale to percent ( get process cpu load , os mx bean ) ; }


the value of the inner class info index item must be a valid index into the constant pool table the constant pool entry at that index must be a constant class info structure representing c the remaining items in the classes array entry give information about c

public int get inner class info index ( ) { return inner class info index & 0xffff ; }


create a sax { @ link x m l reader } that reads from the given st a x { @ link x m l stream reader }

public static x m l reader create x m l reader ( x m l stream reader stream reader ) { return new stax stream x m l reader ( stream reader ) ; }


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

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


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

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


create a proxy for the specified { @ code target source } that extends the target class of the { @ code target source }

public static object get proxy ( target source target source ) { if ( target source get target class ( ) = = null ) { throw new illegal argument exception ( " cannot create class proxy for target source with null target class " ) ; } proxy factory proxy factory = new proxy factory ( ) ; proxy factory set target source ( target source ) ; proxy factory set proxy target class ( true ) ; return proxy factory get proxy ( ) ; }


decide if the given block is a good candidate to move or not

private boolean is good block candidate ( d block block ) { / / source and target must have the same storage type final storage type source storage type = get storage type ( ) ; for ( task t : tasks ) { if ( dispatcher this is good block candidate ( this , t target , source storage type , block ) ) { return true ; } } return false ; }


get all the forwarded data this context has observed the returned list will not be affected by subsequent interactions with the context the data in the list is in the same order as the calls to { @ code forward ( ) }

public list < captured forward < ? extends k forward , ? extends v forward > > forwarded ( ) { return new linked list < > ( captured forwards ) ; }


each entry in the { @ code opens to index } table must be a valid index into the constant pool the entry at that index must be a { @ link constant pool module info } structure denoting a module whose code can access the types and members in this opened package

public int get opens to entry ( int i ) { return opens to index [ i ] & 0xffff ; }


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


stores a bazel starlark context in the specified starlark thread about to initialize a bzl file a bzl file loaded by ( or indirectly by ) a build file may differ semantically from the same file loaded on behalf of a workspace file , because of the repository mapping and native module ; these differences much be accounted for by caching

void set starlark thread context ( starlark thread thread , label label , immutable map < repository name , repository name > repo mapping ) ;


closes the compressor and discards any unprocessed input


expose this buffer ' s bytes as a { @ link byte buffer } data between this { @ code data buffer } and the returned { @ code byte buffer } is shared ; though changes in the returned buffer ' s { @ linkplain byte buffer # position ( ) position } will not be reflected in the reading nor writing position of this data buffer


public void triangle type test ( ) { / / todo : test triangle type }


public indices stats request flags ( common stats flags flags ) { this flags = flags ; return this ; }


public acl status get acl status ( final path path ) throws i o exception { log debug ( " azure blob file system get acl status path : { } " , path ) ; if ( ! get is namespace enabled ( ) ) { throw new unsupported operation exception ( " get acl status is only supported by storage account with the " + " hierarchical namespace enabled " ) ; } path qualified path = make qualified ( path ) ; try { return abfs store get acl status ( qualified path ) ; } catch ( azure blob file system exception ex ) { check exception ( path , ex ) ; return null ; } }


creates a plain { @ link list } backed by the current { @ link extension list }

public static < t > list < t > create list ( final class < t > type ) { return new abstract list < t > ( ) { private extension list < t > storage ( ) { return jenkins get ( ) get extension list ( type ) ; } @ override public iterator < t > iterator ( ) { return storage ( ) iterator ( ) ; } public t get ( int index ) { return storage ( ) get ( index ) ; } public int size ( ) { return storage ( ) size ( ) ; } @ override public boolean add ( t t ) { return storage ( ) add ( t ) ; } @ override public void add ( int index , t t ) { / / index ignored storage ( ) add ( t ) ; } @ override public t remove ( int index ) { return storage ( ) remove ( index ) ; } @ override public boolean remove ( object o ) { return storage ( ) remove ( o ) ; } } ; }


aggregations should use this method to define a { @ link values source type } of last resort this will only be used when the resolver can ' t find a field and the user hasn ' t provided a value type hint

protected abstract values source type default value source type ( ) ;


a public method exposing the knowledge of the path extension strategy to resolve file extensions to a { @ link media type } in this case for a given { @ link resource } the method first looks up any explicitly registered file extensions first and then falls back on { @ link media type factory } if available

public media type get media type for resource ( resource resource ) { assert not null ( resource , " resource must not be null " ) ; media type media type = null ; string filename = resource get filename ( ) ; string extension = string utils get filename extension ( filename ) ; if ( extension ! = null ) { media type = lookup media type ( extension ) ; } if ( media type = = null ) { media type = media type factory get media type ( filename ) or else ( null ) ; } return media type ; }


appends a new group pattern to the existing one the new pattern enforces strict temporal contiguity this means that the whole pattern sequence matches only if an event which matches this pattern directly follows the preceding matching event thus , there cannot be any events in between two matching events

public group pattern < t , f > next ( pattern < t , f > group ) { return new group pattern < > ( this , group , consuming strategy strict , after match skip strategy ) ; }


public void 1 2 3number test ( ) { / / todo : test 1 2 3number }


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


public api response < pet > get pet by id with http info ( long pet id ) throws api exception { object local var post body = null ; / / verify the required parameter ' pet id ' is set if ( pet id = = null ) { throw new api exception ( 400 , " missing the required parameter ' pet id ' when calling get pet by id " ) ; } / / create path and map variables string local var path = " / pet / { pet id } " replace all ( " \ \ { " + " pet id " + " \ \ } " , api client escape string ( pet id to string ( ) ) ) ; / / query params list < pair > local var query params = new array list < pair > ( ) ; map < string , string > local var header params = new hash map < string , string > ( ) ; map < string , string > local var cookie params = new hash map < string , string > ( ) ; map < string , object > local var form params = new hash map < string , object > ( ) ; final string [ ] local var accepts = { " application / xml " , " application / json " } ; final string local var accept = api client select header accept ( local var accepts ) ; final string [ ] local var content types = { } ; final string local var content type = api client select header content type ( local var content types ) ; string [ ] local var auth names = new string [ ] { " api key " } ; generic type < pet > local var return type = new generic type < pet > ( ) { } ; return api client invoke a p i ( " pet api get pet by id " , local var path , " get " , local var query params , local var post body , local var header params , local var cookie params , local var form params , local var accept , local var content type , local var auth names , local var return type , false ) ; }


public int elements ( ) { return ints size ( ) ; }


build a list of undeleted paths from a { @ code multi object delete exception } outside of unit tests , the qualifier function should be { @ link s 3 a file system # key to qualified path ( string ) }

public static list < path > extract undeleted paths ( final multi object delete exception delete exception , final function < string , path > qualifier fn ) { return to path list ( extract undeleted key paths ( delete exception , qualifier fn ) ) ; }


see original { @ link stubber # do throw ( class ) }

b d d stubber will throw ( class < ? extends throwable > to be thrown ) ;


get petfind by tags : finds pets by tags multiple tags can be provided with comma separated strings use tag 1 , tag 2 , tag 3 for testing

default mono < response entity < flux < pet > > > find pets by tags ( set < string > tags , server web exchange exchange ) { mono < void > result = mono empty ( ) ; exchange get response ( ) set status code ( http status not implemented ) ; for ( media type media type : exchange get request ( ) get headers ( ) get accept ( ) ) { if ( media type is compatible with ( media type value of ( " application / json " ) ) ) { string example string = " { \ " photo urls \ " : [ \ " photo urls \ " , \ " photo urls \ " ] , \ " name \ " : \ " doggie \ " , \ " id \ " : 0 , \ " category \ " : { \ " name \ " : \ " default - name \ " , \ " id \ " : 6 } , \ " tags \ " : [ { \ " name \ " : \ " name \ " , \ " id \ " : 1 } , { \ " name \ " : \ " name \ " , \ " id \ " : 1 } ] , \ " status \ " : \ " available \ " } " ; result = api util get example response ( exchange , example string ) ; break ; } if ( media type is compatible with ( media type value of ( " application / xml " ) ) ) { string example string = " < pet > < id > 123456789 < / id > < name > doggie < / name > < photo urls > < photo urls > aeiou < / photo urls > < / photo urls > < tags > < / tags > < status > aeiou < / status > < / pet > " ; result = api util get example response ( exchange , example string ) ; break ; } } return result then ( mono empty ( ) ) ; }


see appel algorithm 19 6 : place phi functions in appropriate locations

private static void place phi functions ( ssa method ssa meth , local variable info local info , int threshold ) { array list < ssa basic block > ssa blocks ; int reg count ; int block count ; ssa blocks = ssa meth get blocks ( ) ; block count = ssa blocks size ( ) ; reg count = ssa meth get reg count ( ) - threshold ; dom front df = new dom front ( ssa meth ) ; dom front dom info [ ] dom infos = df run ( ) ; / / bit set of registers vs block index " definition sites " bit set [ ] defsites = new bit set [ reg count ] ; / / bit set of registers vs block index " phi placement sites " bit set [ ] phisites = new bit set [ reg count ] ; for ( int i = 0 ; i < reg count ; i + + ) { defsites [ i ] = new bit set ( block count ) ; phisites [ i ] = new bit set ( block count ) ; } / * * for each register , build a set of all basic blocks where * containing an assignment to that register * / for ( int bi = 0 , s = ssa blocks size ( ) ; bi < s ; bi + + ) { ssa basic block b = ssa blocks get ( bi ) ; for ( ssa insn insn : b get insns ( ) ) { register spec rs = insn get result ( ) ; if ( rs ! = null & & rs get reg ( ) - threshold > = 0 ) { defsites [ rs get reg ( ) - threshold ] set ( bi ) ; } } } if ( debug ) { system out println ( " defsites " ) ; for ( int i = 0 ; i < reg count ; i + + ) { string builder sb = new string builder ( ) ; sb append ( ' v ' ) append ( i ) append ( " : " ) ; sb append ( defsites [ i ] to string ( ) ) ; system out println ( sb ) ; } } bit set worklist ; / * * for each register , compute all locations for phi placement * based on dominance - frontier algorithm * / for ( int reg = 0 , s = reg count ; reg < s ; reg + + ) { int work block index ; / * worklist set starts out with each node where reg is assigned * / worklist = ( bit set ) ( defsites [ reg ] clone ( ) ) ; while ( 0 < = ( work block index = worklist next set bit ( 0 ) ) ) { worklist clear ( work block index ) ; int iterator df iterator = dom infos [ work block index ] dominance frontiers iterator ( ) ; while ( df iterator has next ( ) ) { int df block index = df iterator next ( ) ; if ( ! phisites [ reg ] get ( df block index ) ) { phisites [ reg ] set ( df block index ) ; int t reg = reg + threshold ; register spec rs = local info get starts ( df block index ) get ( t reg ) ; if ( rs = = null ) { ssa blocks get ( df block index ) add phi insn for reg ( t reg ) ; } else { ssa blocks get ( df block index ) add phi insn for reg ( rs ) ; } if ( ! defsites [ reg ] get ( df block index ) ) { worklist set ( df block index ) ; } } } } } if ( debug ) { system out println ( " phisites " ) ; for ( int i = 0 ; i < reg count ; i + + ) { string builder sb = new string builder ( ) ; sb append ( ' v ' ) append ( i ) append ( " : " ) ; sb append ( phisites [ i ] to string ( ) ) ; system out println ( sb ) ; } } }


creates a new builder initialized with data from the given authentication source

public static authentication builder new instance ( final authentication source ) { val builder = new default authentication builder ( source get principal ( ) ) ; builder set authentication date ( source get authentication date ( ) ) ; builder set credentials ( source get credentials ( ) ) ; builder set successes ( source get successes ( ) ) ; builder set failures ( source get failures ( ) ) ; builder set attributes ( source get attributes ( ) ) ; builder set warnings ( source get warnings ( ) ) ; return builder ; }


public static void clear ( ) { clipboard manager cm = ( clipboard manager ) utils get app ( ) get system service ( context clipboard service ) ; / / noinspection constant conditions cm set primary clip ( clip data new plain text ( null , " " ) ) ; }


public all types model view model double value ( double double value ) { on mutation ( ) ; this double value double = double value ; return this ; }


public resource get increment resource ( ) { return increment resource ; }


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