this method gives back the names of the foreign key columns that need to remove , cause their associations in the classes are no longer exist

private list < string > find foreign key to remove ( table model table model ) { list < string > remove relations = new array list < > ( ) ; list < string > foreign key columns = get foreign key columns ( table model ) ; string self table name = table model get table name ( ) ; for ( string foreign key column : foreign key columns ) { string associated table name = d b utility get table name by foreign column ( foreign key column ) ; if ( should drop foreign key ( self table name , associated table name ) ) { remove relations add ( foreign key column ) ; } } lite pal log d ( tag , " find foreign key to remove > > " + table model get table name ( ) + " " + remove relations ) ; return remove relations ; }


public boolean has messages ( ) { return count > 0 ; }


returns a new { @ code cache stats } representing the difference between this { @ code cache stats } and { @ code other } negative values , which aren ' t supported by { @ code cache stats } will be rounded up to zero

public cache stats minus ( cache stats other ) { return new cache stats ( math max ( 0 , saturated subtract ( hit count , other hit count ) ) , math max ( 0 , saturated subtract ( miss count , other miss count ) ) , math max ( 0 , saturated subtract ( load success count , other load success count ) ) , math max ( 0 , saturated subtract ( load exception count , other load exception count ) ) , math max ( 0 , saturated subtract ( total load time , other total load time ) ) , math max ( 0 , saturated subtract ( eviction count , other eviction count ) ) ) ; }


public type information < in1 > get type 1 ( ) { return non broadcast stream get type ( ) ; }


create a " catch - all " index template with the lowest priority prior to running tests to ensure that the index templates created during tests with higher priority function as designed only applicable for es > = 7 8

void set up catch all template ( ) throws i o exception { aggregated http request update template = aggregated http request of ( request headers of ( put , catch all index path ( ) , content type , json utf 8 ) , http data of utf 8 ( catch all template ( ) ) ) ; internal instance http ( storage ) new call ( update template , ( parser , content string ) - > null , " update - template " ) execute ( ) ; }


add a list of tombstones to the graveyard

builder add built tombstones ( final list < tombstone > tombstones ) { this tombstones add all ( tombstones ) ; return this ; }


private int get new port ( int base port , int retry count ) { return base port + retry count / 3 ; }


find the bean name for the current invocation assumes that an expose bean name advisor has been included in the interceptor chain , and that the invocation is exposed with expose invocation interceptor

public static string get bean name ( ) throws illegal state exception { return get bean name ( expose invocation interceptor current invocation ( ) ) ; }


gets the allocation id for the shard copy , if it exists

public string get allocation id ( ) { return allocation id ; }


public integer get integer ( ) { return integer ; }


public static config service create config service ( properties properties ) throws nacos exception { return config factory create config service ( properties ) ; }


to test the collection format in query parameters < b > 200 < b > - success

public void test query parameter collection format ( list < string > pipe , list < string > ioutil , list < string > http , list < string > url , list < string > context ) throws rest client exception { test query parameter collection format with http info ( pipe , ioutil , http , url , context ) ; }


get consumer name , will be null if efo registration type is ' none '

public optional < string > get consumer name ( ) { return optional of nullable ( consumer name ) ; }


sets the sprite ' s scale for both x and y the sprite scales out from the origin this will not affect the values returned by { @ link # get width ( ) } and { @ link # get height ( ) }

public void set scale ( float scale x , float scale y ) { this scale x = scale x ; this scale y = scale y ; dirty = true ; }


returns the full path of this datatype note : if the datatype name contains any " " characters , then the resulting path string may be ambiguous as to where the category path ends and the datatype name begins

public string get path ( ) { string buffer buf = new string buffer ( category path get path ( ) ) ; if ( buf char at ( buf length ( ) - 1 ) ! = category path delimiter char ) { buf append ( category path delimiter char ) ; } buf append ( data type name ) ; return buf to string ( ) ; }


escapes all regex characters with the ' \ ' character , except for those in the given exclusion array

static string escape some regex characters ( string input , char [ ] do not escape ) { string buffer buffy = new string buffer ( ) ; for ( int i = 0 ; i < input length ( ) ; i + + ) { char c = input char at ( i ) ; if ( contains ( do not escape , c ) ) { / / a bit inefficient , but the array should always be short buffy append ( c ) ; continue ; } switch ( c ) { case ' ^ ' : buffy append ( " \ \ ^ " ) ; break ; case ' ' : buffy append ( " \ \ " ) ; break ; case ' $ ' : buffy append ( " \ \ $ " ) ; break ; case ' ( ' : buffy append ( " \ \ ( " ) ; break ; case ' ) ' : buffy append ( " \ \ ) " ) ; break ; case ' [ ' : buffy append ( " \ \ [ " ) ; break ; case ' ] ' : buffy append ( " \ \ ] " ) ; break ; case ' + ' : buffy append ( " \ \ + " ) ; break ; case ' & ' : buffy append ( " \ \ & " ) ; break ; case ' { ' : buffy append ( " \ \ { " ) ; break ; case ' } ' : buffy append ( " \ \ } " ) ; break ; case ' * ' : buffy append ( " \ \ * " ) ; break ; case ' ? ' : buffy append ( " \ \ ? " ) ; break ; case ' | ' : buffy append ( " \ \ | " ) ; break ; default : buffy append ( c ) ; break ; } } return buffy to string ( ) ; }


can disable a plugin with a mandatory dependent plugin before its dependent plugin with all strategy

public void can disable dependent plugin wrong order strategy all ( ) { assert that ( disable plugins c li command ( " dependee " , " mandatory - depender " , " - strategy " , " all " ) , succeeded ( ) ) ; assert plugin disabled ( " mandatory - depender " ) ; assert plugin disabled ( " dependee " ) ; }


public get repositories request builder set repositories ( string repositories ) { request repositories ( repositories ) ; return this ; }


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

public response entity < set < pet > > find pets by tags ( @ not null @ api param ( value = " tags to filter by " , required = true ) @ valid @ request param ( value = " tags " , required = true ) set < string > tags ) { for ( media type media type : media type parse media types ( request get header ( " 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 \ " } " ; api util set example response ( request , " application / json " , 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 > " ; api util set example response ( request , " application / xml " , example string ) ; break ; } } return new response entity < > ( http status not implemented ) ; }


read rule config file to { @ link rules }

public rules read rules ( ) { rules rules = new rules ( ) ; if ( objects non null ( yaml data ) ) { read rules config ( rules ) ; read web hook config ( rules ) ; read grpc config ( rules ) ; read slack config ( rules ) ; read wechat config ( rules ) ; read composite rule config ( rules ) ; read dingtalk config ( rules ) ; } return rules ; }


returns an estimate of the number of additional bytes that can be written to the audio track ' s buffer without running out of space may only be called if the output encoding is one of the pcm encodings

public int get available buffer size ( long written bytes ) { int bytes pending = ( int ) ( written bytes - ( get playback head position ( ) * output pcm frame size ) ) ; return buffer size - bytes pending ; }


verify block placement policy node group uses network topology with node group

public void test b p p node group ( ) throws exception { configuration conf = create conf ( ) ; conf set boolean ( d f s config keys dfs use dfs network topology key , true ) ; long [ ] capacities = new long [ ] { capacity , capacity , capacity , capacity } ; string [ ] racks = new string [ ] { rack0 , rack0 , rack1 , rack1 } ; string [ ] node groups = new string [ ] { nodegroup0 , nodegroup0 , nodegroup1 , nodegroup2 } ; int num of datanodes = capacities length ; assert equals ( num of datanodes , racks length ) ; assert equals ( num of datanodes , node groups length ) ; mini d f s cluster builder builder = new mini d f s cluster builder ( conf ) num data nodes ( capacities length ) racks ( racks ) simulated capacities ( capacities ) ; mini d f s cluster with node group set node groups ( node groups ) ; lambda test utils intercept ( illegal argument exception class , " configured cluster topology should be " + " org apache hadoop net network topology with node group " , ( ) - > new mini d f s cluster with node group ( builder ) ) ; }


helper method that maps the supplied matrix to the current drawable

private rect f get display rect ( matrix matrix ) { drawable d = m image view get drawable ( ) ; if ( d ! = null ) { m display rect set ( 0 , 0 , d get intrinsic width ( ) , d get intrinsic height ( ) ) ; matrix map rect ( m display rect ) ; return m display rect ; } return null ; }


removes a single instance of the specified element from this queue if the queue does not contain the element , it is unchanged more formally , removes the first element < tt > e < tt > such that < tt > o equals ( e ) < tt > ( if such an element exists ) returns < tt > true < tt > if this queue contained the specified element ( or equivalently , if this queue changed as a result of the call )

public boolean remove ( object o ) { if ( o = = null ) return false ; int mask = elements length - 1 ; int i = head ; object x ; while ( ( x = elements [ i ] ) ! = null ) { if ( o equals ( x ) ) { delete ( i ) ; return true ; } i = ( i + 1 ) & mask ; } return false ; }


sets the strategy for inferring the final output data type of a function call required

public builder output type strategy ( type strategy output type strategy ) { this output type strategy = preconditions check not null ( output type strategy , " output type strategy must not be null " ) ; return this ; }


returns a new copy of this object that is backed by its own char array closing the new instance has no effect on the instance it was created from this is useful for a p is which accept a char array and you want to be safe about the api potentially modifying the char array for example : try ( secure string copy = secure string clone ( ) ) { pass thee char [ ] to a external api password authentication auth = new password authentication ( username , copy get chars ( ) ) ; }

public synchronized secure string clone ( ) { ensure not closed ( ) ; return new secure string ( arrays copy of ( chars , chars length ) ) ; }


whether module map generation and interpretation is enabled

public boolean module maps enabled ( ) { return module maps enabled ; }


takes a list of operators and creates a cascade of unions of this inputs , if needed if not needed ( there was only one operator in the list ) , then that operator is returned

public static < t > operator < t > create union cascade ( operator < t > operators ) { return create union cascade ( null , operators ) ; }


public void swing run ( boolean is cancelled ) ;


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

public average executor average async ( final class < ? > model class , final string column ) { return average async ( base utility change case ( d b utility get table name by class name ( model class get name ( ) ) ) , column ) ; }


returns the number of streams found in this { @ link abstract msf }

public int get num streams ( ) { return stream table get num streams ( ) ; }


test proctime temporal join changelog stream

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


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

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


public void install actions ( ) { if ( actions = = null ) { return ; } for ( docking action if action : actions ) { tool add action ( action ) ; } }


steam : view a listing on the workshop by an id

default void view listing i d ( string mapid ) { }


public int get tree height ( ) { return m contact manager m broad phase get tree height ( ) ; }


tests that a namenode in observer state rejects any state transition request from zkfc , as a result of namenode ' s participation in the zk election before getting transition to observer state , since observer namenode isn ' t supposed to participate in zkfc elections

public void test observer reject zkfc call ( ) throws exception { namenode protocols nn 1 = cluster get name node ( 1 ) get rpc server ( ) ; nn 1 transition to observer ( new state change request info ( request source request by user forced ) ) ; wait for h a state ( 1 , h a service state observer ) ; lambda test utils intercept ( access control exception class , " denied since the namenode is in observer state " , ( ) - > nn 1 transition to standby ( new state change request info ( request source request by zkfc ) ) ) ; }


convert the value of source to target - type value if possible

static < t > t convert if possible ( object source , class < t > target type ) { converter converter = get converter ( source get class ( ) , target type ) ; if ( converter ! = null ) { return ( t ) converter convert ( source ) ; } return null ; }


update this holder ' s state with the latest time values

public void update ( date last scheduled execution time , date last actual execution time , date last completion time ) { this last scheduled execution time = last scheduled execution time ; this last actual execution time = last actual execution time ; this last completion time = last completion time ; }


test request scoped caching with a mixture of commands

public void test request cache 3 ( ) throws exception { test circuit breaker circuit breaker = new test circuit breaker ( ) ; successful cacheable command < string > command 1 = new successful cacheable command < string > ( circuit breaker , true , " a " ) ; successful cacheable command < string > command 2 = new successful cacheable command < string > ( circuit breaker , true , " b " ) ; successful cacheable command < string > command 3 = new successful cacheable command < string > ( circuit breaker , true , " a " ) ; assert true ( command 1 is command running in thread ( ) ) ; future < string > f 1 = command 1 queue ( ) ; future < string > f 2 = command 2 queue ( ) ; future < string > f 3 = command 3 queue ( ) ; assert equals ( " a " , f 1 get ( ) ) ; assert equals ( " b " , f 2 get ( ) ) ; assert equals ( " a " , f 3 get ( ) ) ; assert true ( command 1 executed ) ; / / both should execute as they are different assert true ( command 2 executed ) ; / / but the 3rd should come from cache assert false ( command 3 executed ) ; assert true ( command 3 is response from cache ( ) ) ; assert command execution events ( command 1 , hystrix event type success ) ; assert command execution events ( command 2 , hystrix event type success ) ; assert command execution events ( command 3 , hystrix event type success , hystrix event type response from cache ) ; assert equals ( 0 , circuit breaker metrics get current concurrent execution count ( ) ) ; system out println ( " req log : " + hystrix request log get current request ( ) get executed commands as string ( ) ) ; assert sane hystrix request log ( 3 ) ; }


returns an < b > immutable < b > list containing { @ code elements } sorted by this ordering the input is not modified unlike { @ link sets # new tree set ( iterable ) } , this method does not discard elements that are duplicates according to the comparator the sort performed is stable , meaning that such elements will appear in the returned list in the same order they appeared in { @ code elements } < b > performance note : < b > according to our benchmarking on open jdk 7 , this method is the most efficient way to make a sorted copy of a collection

public < e extends t > immutable list < e > immutable sorted copy ( iterable < e > elements ) { return immutable list sorted copy of ( this , elements ) ; }


returns a { @ code removal listener } which processes all eviction notifications using { @ code executor }

public static < k , v > removal listener < k , v > asynchronous ( final removal listener < k , v > listener , final executor executor ) { check not null ( listener ) ; check not null ( executor ) ; return new removal listener < k , v > ( ) { @ override public void on removal ( final removal notification < k , v > notification ) { executor execute ( new runnable ( ) { @ override public void run ( ) { listener on removal ( notification ) ; } } ) ; } } ; }


the id of the type this may be 0 , which indicates no id is set < code > optional uint 3 2 id = 1 ; < code >


default boolean supports ( final set < authentication handler > handlers , final authentication transaction transaction ) { return ! handlers is empty ( ) & & transaction ! = null ; }


get the list of register overlay layout event listeners

public field panel over layout listener [ ] get layout listeners ( ) { return layout listeners to array ( new field panel over layout listener [ 0 ] ) ; }


this function " breaks hardlinks " to the current replica file when doing a data node upgrade , we create a bunch of hardlinks to each block file this cleverly ensures that both the old and the new storage directories can contain the same block file , without using additional space for the data however , when we want to append to the replica file , we need to " break " the hardlink to ensure that the old snapshot continues to contain the old data length if we failed to do that , we could roll back to the previous directory during a downgrade , and find that the block contents were longer than they were at the time of upgrade

public boolean break hard links if needed ( ) throws i o exception { final file file = get block file ( ) ; final file io provider file io provider = get file io provider ( ) ; if ( file = = null | | get volume ( ) = = null ) { throw new i o exception ( " detach block : block not found " + this ) ; } file meta = get meta file ( ) ; int link count = file io provider get hard link count ( get volume ( ) , file ) ; if ( link count > 1 ) { data node log info ( " breaking hardlink for " + link count + " x - linked " + " block " + this ) ; break hardlinks ( file , this ) ; } if ( file io provider get hard link count ( get volume ( ) , meta ) > 1 ) { break hardlinks ( meta , this ) ; } return true ; }


inserts { @ link channel handler } s at the last position of this pipeline

channel pipeline add last ( channel handler handlers ) ;


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

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


returns the total number of stripes in this instance


create the most appropriate map for the given map type warning : since the parameterized type { @ code k } is not bound to the supplied { @ code key type } , type safety cannot be guaranteed if the desired { @ code map type } is { @ link enum map } in such scenarios , the caller is responsible for ensuring that the { @ code key type } is an enum type matching type { @ code k } as an alternative , the caller may wish to treat the return value as a raw map or map keyed by { @ link object } similarly , type safety cannot be enforced if the desired { @ code map type } is { @ link multi value map }

public static < k , v > map < k , v > create map ( class < ? > map type , @ nullable class < ? > key type , int capacity ) { assert not null ( map type , " map type must not be null " ) ; if ( map type is interface ( ) ) { if ( map class = = map type ) { return new linked hash map < > ( capacity ) ; } else if ( sorted map class = = map type | | navigable map class = = map type ) { return new tree map < > ( ) ; } else if ( multi value map class = = map type ) { return new linked multi value map ( ) ; } else { throw new illegal argument exception ( " unsupported map interface : " + map type get name ( ) ) ; } } else if ( enum map class = = map type ) { assert not null ( key type , " cannot create enum map for unknown key type " ) ; return new enum map ( as enum type ( key type ) ) ; } else { if ( ! map class is assignable from ( map type ) ) { throw new illegal argument exception ( " unsupported map type : " + map type get name ( ) ) ; } try { return ( map < k , v > ) reflection utils accessible constructor ( map type ) new instance ( ) ; } catch ( throwable ex ) { throw new illegal argument exception ( " could not instantiate map type : " + map type get name ( ) , ex ) ; } } }


get the landing pad address which indicates the < code > catch < code > for this call site

public address get landing pad ( ) { return landing pad addr ; }


prepare the compressor to be used in a new stream with settings defined in the given configuration

public void reinit ( configuration conf ) ;


configure a strategy for expanding uri templates by default , { @ link default uri builder factory } is used and for backwards compatibility , the encoding mode is set to { @ link encoding mode # uri component uri component } as of 5 0 8 , prefer using { @ link encoding mode # template and values template and values } note : in 5 0 the switch from { @ link org springframework web util default uri template handler default uri template handler } ( deprecated in 4 3 ) , as the default to use , to { @ link default uri builder factory } brings in a different default for the { @ code parse path } property ( switching from false to true )

public void set uri template handler ( uri template handler handler ) { assert not null ( handler , " uri template handler must not be null " ) ; this uri template handler = handler ; }


returns the { @ code writer index } of this buffer


determines whether a character is a bmp digit according to { @ linkplain character # is digit ( char ) java ' s definition } if you only care to match ascii digits , you can use { @ code in range ( ' 0 ' , ' 9 ' ) }

public static char matcher java digit ( ) { return java digit instance ; }


evaluates a block of instructions , starting at the given offset and ending at a branch instruction , a return instruction , or a throw instruction

private void evaluate instruction block ( clazz clazz , method method , code attribute code attribute , traced variables variables , traced stack stack , int start offset ) { / / execute the initial instruction block evaluate single instruction block ( clazz , method , code attribute , variables , stack , start offset ) ; / / execute all resulting instruction blocks on the execution stack while ( ! instruction block stack empty ( ) ) { if ( debug ) system out println ( " popping alternative branch out of " + instruction block stack size ( ) + " blocks " ) ; my instruction block instruction block = ( my instruction block ) instruction block stack pop ( ) ; evaluate single instruction block ( clazz , method , code attribute , instruction block variables , instruction block stack , instruction block start offset ) ; } }


copy a range of nodes and put them on the clipboard ; called from an action listener on a menu

private void copy range ( ) { / / generate a list of selected modules that are / / " root " - type modules , i e , not submodules within the selection tree path [ ] paths = tree get selection paths ( ) ; if ( paths length = = 0 ) { return ; } / / cut to clipboard set clipboard contents ( g clipboard get system clipboard ( ) , paths ) ; }


return the amount of time in milliseconds when the server has not sent any messages

public long get heartbeat time ( ) { return this heartbeat time ; }


called when new data arrives to the sink , and forwards it to kafka

public void invoke ( in next , context context ) throws exception { / / propagate asynchronous errors check erroneous ( ) ; byte [ ] serialized key = schema serialize key ( next ) ; byte [ ] serialized value = schema serialize value ( next ) ; string target topic = schema get target topic ( next ) ; if ( target topic = = null ) { target topic = default topic id ; } int [ ] partitions = this topic partitions map get ( target topic ) ; if ( null = = partitions ) { partitions = get partitions by topic ( target topic , producer ) ; this topic partitions map put ( target topic , partitions ) ; } producer record < byte [ ] , byte [ ] > record ; if ( flink kafka partitioner = = null ) { record = new producer record < > ( target topic , serialized key , serialized value ) ; } else { record = new producer record < > ( target topic , flink kafka partitioner partition ( next , serialized key , serialized value , target topic , partitions ) , serialized key , serialized value ) ; } if ( flush on checkpoint ) { synchronized ( pending records lock ) { pending records + + ; } } producer send ( record , callback ) ; }


a comma separated list of routing values to control the shards the search will be executed on

public cluster search shards request builder set routing ( string routing ) { request routing ( routing ) ; return this ; }


render exceptions sets the response status accordingly to note bad requests

private static void render exception ( final map < string , object > model , final http servlet response response ) { response set status ( http servlet response sc bad request ) ; model put ( " status " , http servlet response sc bad request ) ; render ( model , response ) ; }


get all possible configuration files for config directory that actually exist as files

private list < resource > scan for configuration resources ( final file config , final list < string > profiles ) { val possible files = get all possible external config dir filenames ( config , profiles ) ; return possible files stream ( ) filter ( file : : exists ) filter ( file : : is file ) map ( file system resource : : new ) collect ( collectors to list ( ) ) ; }


abstract template method called from { @ link # write internal ( object , http output message ) }

protected abstract void write to result ( t t , http headers headers , result result ) throws exception ;


return the fragments in stack in manager

public static list < fragment > get fragments in stack ( @ non null final fragment manager fm ) { list < fragment > fragments = get fragments ( fm ) ; list < fragment > result = new array list < > ( ) ; for ( fragment fragment : fragments ) { if ( fragment ! = null ) { bundle args = fragment get arguments ( ) ; if ( args ! = null & & args get boolean ( args is add stack ) ) { result add ( fragment ) ; } } } return result ; }


build an array to hold the " top " buckets for each ordinal

abstract b [ ] [ ] build top buckets per ord ( int size ) ;


delete all fields in the ranges in the given field selection from this one

public final void delete ( field selection selection ) { if ( selection = = null | | this ranges size ( ) = = 0 | | selection ranges size ( ) = = 0 ) { return ; } / / process all ranges in the selection , delete each one ' s / / associated fields from this set for ( field range range : selection ranges ) { remove range ( range start , range end ) ; } }


all all elements in the collection expand if necessary

public boolean add all ( collection < ? extends t > to add ) { boolean changed = false ; for ( t elem : to add ) { changed | = add elem ( elem ) ; } expand if necessary ( ) ; return changed ; }


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


returns the time left between the deadline and now if no time is left , a { @ link timeout exception } will be thrown

public duration time left if any ( ) throws timeout exception { long nanos = math subtract exact ( time nanos , system nano time ( ) ) ; if ( nanos < = 0 ) { throw new timeout exception ( ) ; } return duration of nanos ( nanos ) ; }


template method for preparing the given { @ link http u r l connection } the default implementation prepares the connection for input and output , and sets the http method

protected void prepare connection ( http u r l connection connection , string http method ) throws i o exception { if ( this connect timeout > = 0 ) { connection set connect timeout ( this connect timeout ) ; } if ( this read timeout > = 0 ) { connection set read timeout ( this read timeout ) ; } boolean may write = ( " post " equals ( http method ) | | " put " equals ( http method ) | | " patch " equals ( http method ) | | " delete " equals ( http method ) ) ; connection set do input ( true ) ; connection set instance follow redirects ( " get " equals ( http method ) ) ; connection set do output ( may write ) ; connection set request method ( http method ) ; }


register a listener that will be called when this model visibility has changed the listener will contribute to this model ' s hash code state per the { @ link com airbnb epoxy epoxy attribute option # do not hash } rules

public model factory basic model with attribute on visibility changed ( on model visibility changed listener < model factory basic model with attribute , object > listener ) { on mutation ( ) ; this on model visibility changed listener epoxy generated model = listener ; return this ; }


checks if the current security principal has one of the supplied permissions

public static void check any permission ( access controlled ac , permission [ ] permissions ) { if ( permissions = = null | | permissions length = = 0 ) { return ; } ac check any permission ( permissions ) ; }


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


test delete behavior and metrics for producer

public void run all deletes test ( ) throws exception { final string topic = " alldeletestest " ; create test topic ( topic , 1 , 1 ) ; final int element count = 300 ; / / - - - - - - - - - - - write some data into kafka - - - - - - - - - - - - - - - - - - - stream execution environment env = stream execution environment get execution environment ( ) ; env set parallelism ( 1 ) ; env get config ( ) set restart strategy ( restart strategies no restart ( ) ) ; data stream < tuple 2 < byte [ ] , pojo value > > kv stream = env add source ( new source function < tuple 2 < byte [ ] , pojo value > > ( ) { @ override public void run ( source context < tuple 2 < byte [ ] , pojo value > > ctx ) throws exception { random rnd = new random ( 1337 ) ; for ( long i = 0 ; i < element count ; i + + ) { final byte [ ] key = new byte [ 200 ] ; rnd next bytes ( key ) ; ctx collect ( new tuple 2 < > ( key , ( pojo value ) null ) ) ; } } @ override public void cancel ( ) { } } ) ; type information key value serialization schema < byte [ ] , pojo value > schema = new type information key value serialization schema < > ( byte [ ] class , pojo value class , env get config ( ) ) ; properties producer properties = flink kafka producer base get properties from broker list ( broker connection strings ) ; producer properties set property ( " retries " , " 3 " ) ; producer properties put all ( secure props ) ; kafka server produce into kafka ( kv stream , topic , schema , producer properties , null ) ; env execute ( " write deletes to kafka " ) ; / / - - - - - - - - - - - read the data again - - - - - - - - - - - - - - - - - - - env = stream execution environment get execution environment ( ) ; env set parallelism ( 1 ) ; env get config ( ) set restart strategy ( restart strategies no restart ( ) ) ; properties props = new properties ( ) ; props put all ( standard props ) ; props put all ( secure props ) ; data stream < tuple 2 < byte [ ] , pojo value > > from kafka = env add source ( kafka server get consumer ( topic , schema , props ) ) ; from kafka flat map ( new rich flat map function < tuple 2 < byte [ ] , pojo value > , object > ( ) { long counter = 0 ; @ override public void flat map ( tuple 2 < byte [ ] , pojo value > value , collector < object > out ) throws exception { / / ensure that deleted messages are passed as nulls assert null ( value f 1 ) ; counter + + ; if ( counter = = element count ) { / / we got the right number of elements throw new success exception ( ) ; } } } ) ; try execute ( env , " read deletes from kafka " ) ; delete test topic ( topic ) ; }


returns the accumulated number of gc pauses since this jvm started

public long get accumulated gc count ( ) { return total gc count ; }


delete a directory tree this is done by asking the filesystem for a list of all objects under the directory path , without using any s 3 guard tombstone markers to hide objects which may be returned in s3 listings but which are considered deleted once the first { @ link # page size } worth of objects has been listed , a batch delete is queued for execution in a separate thread ; subsequent batches block waiting for the first call to complete or fail before again , being deleted in the separate thread after all listed objects are queued for deletion , if the path is considered authoritative in the client , a final scan of s3 without s 3 guard is executed , so as to find and delete any out - of - band objects in the tree

protected void delete directory tree ( final path path , final string dir key ) throws i o exception { / / create an operation state so that the store can manage the bulk / / operation if it needs to operation state = s 3 guard initiate bulk write ( metadata store , bulk operation state operation type delete , path ) ; try ( duration info ignored = new duration info ( log , false , " deleting % s " , dir key ) ) { / / init the lists of keys and paths to delete reset delete list ( ) ; delete future = null ; / / list files including any under tombstones through s 3 guard log debug ( " getting objects for directory prefix { } to delete " , dir key ) ; final remote iterator < s 3 a located file status > located files = callbacks list files and directory markers ( path , status , false , true ) ; / / iterate through and delete the next ( ) call will block when a new s3 / / page is required ; this any active delete submitted to the executor / / will run in parallel with this while ( located files has next ( ) ) { / / get the next entry in the listing s 3 a file status child = located files next ( ) to s 3 a file status ( ) ; queue for deletion ( child ) ; } log debug ( " deleting final batch of listed files " ) ; submit next batch ( ) ; maybe await completion ( delete future ) ; / / if s 3guard is authoritative we follow up with a bulk list and / / delete process on s3 this helps recover from any situation where s3 / / and s 3 guard have become inconsistent / / this is only needed for auth paths ; by performing the previous listing / / without tombstone filtering , any files returned by the non - auth / / s3 list which were hidden under tombstones will have been found / / and deleted if ( callbacks allow authoritative ( path ) ) { log debug ( " path is authoritatively guarded ; " + " listing files on s3 for completeness " ) ; / / let the ongoing delete finish to avoid duplicates final remote iterator < s 3 a file status > objects = callbacks list objects ( path , dir key ) ; / / iterate through and delete the next ( ) call will block when a new s3 / / page is required ; this any active delete submitted to the executor / / will run in parallel with this while ( objects has next ( ) ) { / / get the next entry in the listing extra files deleted + + ; s 3 a file status next = objects next ( ) ; log debug ( " found unlisted entry { } " , next ) ; queue for deletion ( deletion key ( next ) , null , next is directory ( ) ) ; } if ( extra files deleted > 0 ) { log debug ( " raw s3 scan found { } extra file ( s ) to delete " , extra files deleted ) ; / / there is no more data : / / await any ongoing operation submit next batch ( ) ; maybe await completion ( delete future ) ; } } / / final cleanup of the directory tree in the metastore , including the / / directory entry itself try ( duration info ignored 2 = new duration info ( log , false , " delete metastore " ) ) { metadata store delete subtree ( path , operation state ) ; } } finally { i o utils cleanup with logger ( log , operation state ) ; } log debug ( " delete \ " { } \ " completed ; deleted { } objects " , path , files deleted ) ; }


sets the color of this decal , expanding the alpha from 0 - 254 to 0 - 255

public void set packed color ( float color ) { color abgr 8 8 8 8 to color ( this color , color ) ; vertices [ c1 ] = color ; vertices [ c2 ] = color ; vertices [ c3 ] = color ; vertices [ c4 ] = color ; }


get the default value of attribute on the specified annotation

static < t > t get default value ( annotation annotation , string attribute name ) { return get default value ( annotation annotation type ( ) , attribute name ) ; }


increment time by x note that incrementing by multiples of delay or period time will not execute multiple times you must call increment time multiple times each increment being larger than ' period ' on subsequent calls to cause multiple executions this is because executing multiple times in a tight - loop would not achieve the correct behavior , such as batching , since it will all execute " now " not after intervals of time

public synchronized void increment time ( int time in milliseconds ) { for ( a task t : tasks ) { t increment time ( time in milliseconds ) ; } }


gets a template path relative to user template or embedded template

public string get template file ( ) { return template file ; }


returns the tab font size enabled of this m t config object

public boolean is tab font size enabled ( ) { return tab font size enabled ; }


closes the given { @ link input stream } , logging any { @ code i o exception } that ' s thrown rather than propagating it while it ' s not safe in the general case to ignore exceptions that are thrown when closing an io resource , it should generally be safe in the case of a resource that ' s being used only for reading , such as an { @ code input stream } unlike with writable resources , there ' s no chance that a failure that occurs when closing the stream indicates a meaningful problem such as a failure to flush all bytes to the underlying resource

public static void close quietly ( @ nullable input stream input stream ) { try { close ( input stream , true ) ; } catch ( i o exception impossible ) { throw new assertion error ( impossible ) ; } }


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


use for unit testing , so we can turn this feature onoff

public void set snapshot size factor ( double snapshot size factor ) { this snapshot size factor = snapshot size factor ; }


create the wrapped committer this includes customizing its options , and setting up the destination directory

protected file output committer create wrapped committer ( job context context , configuration conf ) throws i o exception { / / explicitly choose commit algorithm init file output committer options ( context ) ; commits directory = paths get multipart upload commits directory ( conf , get u u i d ( ) ) ; return new file output committer ( commits directory , context ) ; }


specify group key and look up whether subsciber and data is lastest ip - > is uptodate

public static map < string , boolean > list subscriber by group ( string group key ) { map < string , boolean > subs = new hash map < string , boolean > ( 100 ) ; for ( client record client rec : client records values ( ) ) { string client md 5 = client rec get group key 2md 5 map ( ) get ( group key ) ; if ( null ! = client md 5 ) { boolean isuptodate = config cache service is uptodate ( group key , client md 5 ) ; subs put ( client rec get ip ( ) , isuptodate ) ; } } return subs ; }


post fakeoutercomposite test serialization of object with outer number type

default response entity < outer composite > fake outer composite serialize ( @ api param ( value = " input composite as post body " ) @ valid @ request body ( required = false ) outer composite body ) { get request ( ) if present ( request - > { for ( media type media type : media type parse media types ( request get header ( " accept " ) ) ) { if ( media type is compatible with ( media type value of ( " * / * " ) ) ) { string example string = " { \ " my string \ " : \ " my string \ " , \ " my number \ " : 0 8008281904610115 , \ " my boolean \ " : true } " ; api util set example response ( request , " * / * " , example string ) ; break ; } } } ) ; return new response entity < > ( http status not implemented ) ; }


public void delete ( string path , string accept type , route route , response transformer transformer ) { add route ( http method delete , response transformer route impl create ( path , accept type , route , transformer ) ) ; }


public builder add output ( string arch , output type output type , artifact artifact ) { outputs by arch compute if absent ( arch , k - > new hash map < string , artifact > ( ) ) ; outputs by arch get ( arch ) put ( output type to string ( ) , artifact ) ; return this ; }


perform serializationdeserialization checks for several simple nested set examples

public static void check codec ( object codecs object codecs , boolean allow future blocking , boolean assert symmetric equality ) throws exception { new serialization tester ( nested set builder empty set ( order stable order ) , nested set builder empty set ( order naive link order ) , nested set builder create ( order stable order , " a " ) , nested set builder create ( order stable order , " a " , " b " , " c " ) , nested set builder < string > stable order ( ) add ( " a " ) add ( " b " ) add transitive ( nested set builder < string > stable order ( ) add ( " c " ) add transitive ( shared nested set ) build ( ) ) add transitive ( nested set builder < string > stable order ( ) add ( " d " ) add transitive ( shared nested set ) build ( ) ) add transitive ( nested set builder empty set ( order stable order ) ) build ( ) , nested set builder create ( order stable order , new has nested set ( nested set builder create ( order stable order , " a " ) ) ) ) set object codecs ( object codecs ) make memoizing and allow future blocking ( allow future blocking ) set verification function ( verification function ( assert symmetric equality ) ) run tests ( ) ; }


test case where the flush ( ) fails at close time - make sure that we clean up after ourselves and don ' t touch any existing file at the destination

public void test fail to flush ( ) throws i o exception { / / create a file at destination file output stream fos = new file output stream ( dst file ) ; fos write ( test string 2 get bytes ( ) ) ; fos close ( ) ; output stream failing stream = create failing stream ( ) ; failing stream write ( test string get bytes ( ) ) ; try { failing stream close ( ) ; fail ( " close didn ' t throw exception " ) ; } catch ( i o exception ioe ) { / / expected } / / should not have touched original file assert equals ( test string 2 , d f s test util read file ( dst file ) ) ; assert equals ( " temporary file should have been cleaned up " , dst file get name ( ) , joiner on ( " , " ) join ( test dir list ( ) ) ) ; }


returns an immutable dict containing the entries of { @ code m }

public static < k , v > dict < k , v > immutable copy of ( map < ? extends k , ? extends v > m ) { return copy of ( null , m ) ; }


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

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


check that this query is generally cacheable except for builders using { @ link script score function builder } or { @ link random score function builder } without a seed

public void test cacheability ( ) throws i o exception { function score query builder query builder = create test query builder ( ) ; boolean is cacheable = is cacheable ( query builder ) ; query shard context context = create shard context ( ) ; query builder rewrite query = rewrite query ( query builder , new query shard context ( context ) ) ; assert not null ( rewrite query to query ( context ) ) ; / / we occasionally need to update the expected " is cacheable " flag after rewrite for match none query builder if ( rewrite query instanceof match none query builder ) { is cacheable = true ; } assert equals ( " query should " + ( is cacheable ? " " : " not " ) + " be cacheable : " + query builder to string ( ) , is cacheable , context is cacheable ( ) ) ; score function builder < ? > script score function = new script score function builder ( new script ( script type inline , mock script engine name , " 1 " , collections empty map ( ) ) ) ; query builder = new function score query builder ( new filter function builder [ ] { new filter function builder ( random query builder create query ( random ( ) ) , script score function ) } ) ; context = create shard context ( ) ; rewrite query = rewrite query ( query builder , new query shard context ( context ) ) ; assert not null ( rewrite query to query ( context ) ) ; assert true ( " function script query should be cacheable " + query builder to string ( ) , context is cacheable ( ) ) ; random score function builder random score function builder = new random score function builder with fixed seed ( ) ; query builder = new function score query builder ( new filter function builder [ ] { new filter function builder ( random query builder create query ( random ( ) ) , random score function builder ) } ) ; context = create shard context ( ) ; rewrite query = rewrite query ( query builder , new query shard context ( context ) ) ; assert not null ( rewrite query to query ( context ) ) ; assert false ( " function random query should not be cacheable : " + query builder to string ( ) , context is cacheable ( ) ) ; }


visits a jump instruction a jump instruction is an instruction that may jump to another instruction

public void visit jump insn ( final int opcode , final label label ) { if ( mv ! = null ) { mv visit jump insn ( opcode , label ) ; } }


one or more endpoints associated with the service < code > repeated istio networking v 1alpha 3 service entry endpoint endpoints = 6 ; < code >

public builder add endpoints ( com alibaba nacos istio model naming service entry endpoint builder builder for value ) { if ( endpoints builder = = null ) { ensure endpoints is mutable ( ) ; endpoints add ( builder for value build ( ) ) ; on changed ( ) ; } else { endpoints builder add message ( builder for value build ( ) ) ; } return this ; }


get the number of return instructions , i e , the number of instructions immediately before ( and including ) a return instruction

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


set the project name of the subscription to pull messages from

subscription name builder < out > with project name ( string project name ) ;


enabledisable debugging for this api client

public api client set debugging ( boolean debugging ) { this debugging = debugging ; / / rebuild http client according to the new " debugging " value this http client = build http client ( ) ; return this ; }


public void add ( map < path fragment , artifact > input manifest , conflict checker checker ) { for ( map entry < path fragment , artifact > entry : input manifest entry set ( ) ) { checker put ( manifest , check for workspace ( entry get key ( ) ) , entry get value ( ) ) ; } }


returns the sql string with identifiers replaced according to the given unparse function

public string substitute ( function < sql node , string > fn ) { final sql shuttle shuttle = new sql shuttle ( ) { @ override public sql node visit ( sql call call ) { sql operator operator = call get operator ( ) ; if ( operator instanceof sql unresolved function ) { final sql unresolved function unresolved function = ( sql unresolved function ) operator ; final sql identifier function i d = unresolved function get sql identifier ( ) ; if ( function i d is simple ( ) & & func name to id contains key ( function i d get simple ( ) ) ) { sql unresolved function new func = new sql unresolved function ( func name to id get ( function i d get simple ( ) ) , unresolved function get return type inference ( ) , unresolved function get operand type inference ( ) , unresolved function get operand type checker ( ) , unresolved function get param types ( ) , unresolved function get function type ( ) ) ; return new func create call ( call get function quantifier ( ) , call get parser position ( ) , call get operand list ( ) to array ( new sql node [ 0 ] ) ) ; } } return super visit ( call ) ; } @ override public sql node visit ( sql identifier id ) { if ( id is star ( ) ) { return id ; } final sql identifier to replace = identifiers map get ( id get parser position ( ) ) ; if ( to replace = = null | | id names size ( ) > = to replace names size ( ) ) { return id ; } return to replace ; } } ; final sql node substituted = this ori node accept ( shuttle ) ; return fn apply ( substituted ) ; }


postmultiplies this matrix with a scale matrix postmultiplication is also used by open g l es ' 1 x gl translategl rotategl scale

public matrix 3 scale ( vector 2 scale ) { float [ ] tmp = this tmp ; tmp [ m00 ] = scale x ; tmp [ m10 ] = 0 ; tmp [ m20 ] = 0 ; tmp [ m01 ] = 0 ; tmp [ m11 ] = scale y ; tmp [ m21 ] = 0 ; tmp [ m02 ] = 0 ; tmp [ m12 ] = 0 ; tmp [ m22 ] = 1 ; mul ( val , tmp ) ; return this ; }


return the ith row of the column as a set of wrapped strings , each at most wrap width in length

string [ ] get row ( int idx ) { string raw = rows get ( idx ) ; / / line - wrap if it ' s too long string [ ] lines = new string [ ] { raw } ; if ( wrap ) { lines = org apache hadoop util string utils wrap ( lines [ 0 ] , wrap width , " \ n " , true ) split ( " \ n " ) ; } for ( int i = 0 ; i < lines length ; i + + ) { if ( justification = = justification left ) { lines [ i ] = string utils right pad ( lines [ i ] , max width ) ; } else if ( justification = = justification right ) { lines [ i ] = string utils left pad ( lines [ i ] , max width ) ; } } return lines ; }


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


get an array of double parameters , throwing an exception if not found or one is not a number

public static double [ ] get required double parameters ( servlet request request , string name ) throws servlet request binding exception { return double parser parse doubles ( name , request get parameter values ( name ) ) ; }


returns a typed array containing a snapshot of all values of the subject the method follows the conventions of collection to array by setting the array element after the last value to null ( if the capacity permits ) the method is thread - safe

public t [ ] get values ( t [ ] array ) { return buffer get values ( array ) ; }


increments { @ code counter } , store the unincremented value in { @ code old counter }

static void increment counter ( byte [ ] counter , byte [ ] old counter ) throws general security exception { system arraycopy ( counter , 0 , old counter , 0 , counter length ) ; int i = 0 ; for ( ; i < counter overflow length ; i + + ) { counter [ i ] + + ; if ( counter [ i ] ! = ( byte ) 0x 0 0 ) { break ; } } if ( i = = counter overflow length ) { / / restore old counter value to ensure that encrypt and decrypt keep failing system arraycopy ( old counter , 0 , counter , 0 , counter length ) ; throw new general security exception ( " counter has overflowed " ) ; } }


locate the vertices and the codewords area of a black blob using the start and stop patterns as locators

private static result point [ ] find vertices ( bit matrix matrix , int start row , int start column ) { int height = matrix get height ( ) ; int width = matrix get width ( ) ; result point [ ] result = new result point [ 8 ] ; copy to result ( result , find rows with pattern ( matrix , height , width , start row , start column , start pattern ) , indexes start pattern ) ; if ( result [ 4 ] ! = null ) { start column = ( int ) result [ 4 ] get x ( ) ; start row = ( int ) result [ 4 ] get y ( ) ; } copy to result ( result , find rows with pattern ( matrix , height , width , start row , start column , stop pattern ) , indexes stop pattern ) ; return result ; }


resolves the given factories the thread local factory has preference over the static factory if none is set , the method returns { @ link optional # empty ( ) }

public static < t > optional < t > resolve factory ( thread local < t > thread local factory , @ nullable t static factory ) { final t local factory = thread local factory get ( ) ; final t factory = local factory = = null ? static factory : local factory ; return optional of nullable ( factory ) ; }


protected abstract model and view handle request internal ( http servlet request request , http servlet response response ) throws exception ;


public static void put ( @ non null final string key , final long value , final boolean is commit , @ non null final s p utils sp utils ) { sp utils put ( key , value , is commit ) ; }


write address - zookeeper client relationship to map

void write to client map ( list < string > address list , zookeeper client zookeeper client ) { for ( string address : address list ) { zookeeper client map put ( address , zookeeper client ) ; } }


return in general how things flow out of this node this method exists for the simpleblock model since it doesn ' t make a great deal of sense to ask for this method in the case of subroutines , we return flow type unknown as long as the block exists if this block has no valid instructions , it can ' t flow , so flow type invalid is returned

public flow type get flow type ( code block block ) { / * if there are multiple unique ways out of the node , then we should return flow type unknown ( or flow type multiflow ? ) possible considerations for the future which are particularly applicable to model - p subroutines : add flow type multicall if only calls out and flow type multijump if multiple jumps out ( as opposed to jumping within the subroutine ) might want to consider flow type multiterminal for multiple returns ? * / if ( ! ( block get model ( ) instanceof overlap code sub model ) ) { throw new illegal argument exception ( ) ; } return ref type flow ; }


returns true if < code > i < code > is greater than < code > j < code >

public static boolean unsigned greater than ( byte i , byte j ) { return comp ( greater than , i , j ) ; }


return consumer ( s ) configured to access to the { @ link client http request }

consumer < client http request > http request ( ) ;


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


projects a pair of joined elements to a { @ link tuple } with the previously selected fields requires the classes of the fields of the resulting tuples


indicates a ui event critical to initial rendering has started this will delay tasks that were scheduled via { @ link # add post render ( runnable ) } you must call { @ link # on critical render event end ( ) } for each invocation of this method

public void on critical render event start ( ) { if ( outstanding critical render events = = 0 & & post render size ( ) > 0 ) { log i ( tag , " received first critical render event " ) ; render start time = system current time millis ( ) ; post render handler remove callbacks and messages ( null ) ; post render handler post delayed ( ( ) - > { log w ( tag , " reached the failsafe event for post - render ! either someone forgot to call # on render end ( ) , the activity was started while the phone was locked , or app start is taking a very long time " ) ; execute post render ( ) ; } , failsafe render time ) ; } outstanding critical render events + + ; }


test that a tree multimap created from another uses the natural ordering

public void test multimap create from tree multimap ( ) { tree multimap < string , integer > tree = tree multimap create ( string length comparator , decreasing int comparator ) ; tree put ( " google " , 2 ) ; tree put ( " google " , 6 ) ; tree put ( " tree " , 0 ) ; tree put ( " tree " , 3 ) ; assert that ( tree key set ( ) ) contains exactly ( " tree " , " google " ) in order ( ) ; assert that ( tree get ( " google " ) ) contains exactly ( 6 , 2 ) in order ( ) ; tree multimap < string , integer > copy = tree multimap create ( tree ) ; assert equals ( tree , copy ) ; assert that ( copy key set ( ) ) contains exactly ( " google " , " tree " ) in order ( ) ; assert that ( copy get ( " google " ) ) contains exactly ( 2 , 6 ) in order ( ) ; assert equals ( ordering natural ( ) , copy key comparator ( ) ) ; assert equals ( ordering natural ( ) , copy value comparator ( ) ) ; assert equals ( ordering natural ( ) , copy get ( " google " ) comparator ( ) ) ; }


resets compressor so that a new set of input data can be processed

public void reset ( ) { finish = false ; finished = false ; uncompressed direct buf clear ( ) ; uncompressed direct buf len = 0 ; compressed direct buf clear ( ) ; compressed direct buf limit ( 0 ) ; user buf off = user buf len = 0 ; bytes read = bytes written = 0l ; }


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


update status , only access with profile module

void update status ( profile status status ) { this status = status ; }


adds a dynamic constant reference to the constant pool of the class being build does nothing if the constant pool already contains a similar item this method is intended for { @ link attribute } sub classes , and is normally not needed by class generators or adapters

public int new constant dynamic ( final string name , final string descriptor , final handle bootstrap method handle , final object bootstrap method arguments ) { return symbol table add constant dynamic ( name , descriptor , bootstrap method handle , bootstrap method arguments ) index ; }


test that , in the case of an error , the position and limit of a byte buffer are left unchanged this is not mandated by byte buffer readable , but clients of this class might immediately issue a retry on failure , so it ' s polite

public void test stable position after corrupt read ( ) throws exception { final short repl factor = 1 ; final long file length = 512l ; hdfs configuration conf = get configuration ( null ) ; file basedir = new file ( generic test utils get randomized temp path ( ) ) ; mini d f s cluster cluster = new mini d f s cluster builder ( conf , basedir ) num data nodes ( 1 ) build ( ) ; cluster wait active ( ) ; file system fs = cluster get file system ( ) ; path path = new path ( " / corrupted " ) ; d f s test util create file ( fs , path , file length , repl factor , 12345l ) ; d f s test util wait replication ( fs , path , repl factor ) ; extended block block = d f s test util get first block ( fs , path ) ; int block files corrupted = cluster corrupt block on data nodes ( block ) ; assert equals ( " all replicas not corrupted " , repl factor , block files corrupted ) ; f s data input stream dis = cluster get file system ( ) open ( path ) ; byte buffer buf = byte buffer allocate direct ( ( int ) file length ) ; boolean saw exception = false ; try { dis read ( buf ) ; } catch ( checksum exception ex ) { saw exception = true ; } assert true ( saw exception ) ; assert equals ( 0 , buf position ( ) ) ; assert equals ( buf capacity ( ) , buf limit ( ) ) ; dis = cluster get file system ( ) open ( path ) ; buf position ( 3 ) ; buf limit ( 25 ) ; saw exception = false ; try { dis read ( buf ) ; } catch ( checksum exception ex ) { saw exception = true ; } assert true ( saw exception ) ; assert equals ( 3 , buf position ( ) ) ; assert equals ( 25 , buf limit ( ) ) ; cluster shutdown ( ) ; }


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


this function is kept to provide backward compatibility

public static void authorize ( user group information user , string remote address , configuration conf ) throws authorization exception { authorize ( user , remote address ) ; }


test serialization of outer string types

public single < string > rx fake outer string serialize ( string body , api client auth info auth info ) { return single create ( new io vertx rx java single on subscribe adapter < > ( fut - > delegate fake outer string serialize ( body , auth info , fut ) ) ) ; }


public void set fetch size ( int rows ) throws s q l exception { }


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


public < t extends socket address > t destination address ( ) { return ( t ) destination address ; }


returns the original element list , unchanged

public list < long > order ( list < long > insertion order ) { return insertion order ; }


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 new response entity < > ( http status not implemented ) ; }


creates a temporary directory which will be used for storing the unpacked database files

private static file create d b dir ( ) throws i o exception { file tmp dir = new file ( system get property ( " java io tmpdir " ) ) ; int tries = 0 ; while ( tries + + < 10 ) { file dir = new file ( tmp dir , tempdb dir prefix + get random string ( ) + tempdb dir ext ) ; if ( dir mkdir ( ) ) { return dir ; } } throw new i o exception ( " unable to create temporary database " ) ; }


returns true if the current array or object has another element

public boolean has next ( ) throws i o exception { int p = peeked ; if ( p = = peeked none ) { p = do peek ( ) ; } return p ! = peeked end object & & p ! = peeked end array ; }


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


returns if the required cache matches the provided type

private static boolean has cache of type ( method test method , class < ? > cache type ) { return arrays stream ( test method get parameter types ( ) ) any match ( cache type : : is assignable from ) ; }


get the initial token in this context note that the range from start to stop is inclusive , so for rules that do not consume anything ( for example , zero length or error productions ) this token may exceed stop

public token get start ( ) { return start ; }


task status get task status ( task id task id ) ;


apply an additional mask to this masked long any { @ code 0 } bit in { @ code msk } will result in an undefined bit in the result { @ code 1 } bits result in a copy of the corresponding bit in the result

public masked long mask ( long mask ) { return from mask and value ( this msk & mask , this val ) ; }


converts this descriptor into a set of connector properties usually prefixed with { @ link connector descriptor validator # connector }

protected abstract map < string , string > to connector properties ( ) ;


gets the test name in a user - friendly format will generally include the target name and runshard numbers , if applicable

public string get test name ( ) { string suffix = get test suffix ( ) ; string label = label print ( get owner ( ) get label ( ) ) ; return suffix is empty ( ) ? label : label + " " + suffix ; }


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


public byte buffer get buffer ( ) { return chunk buffer ; }


return the underlying entity manager that this proxy will delegate to in case of an extended entity manager , this will be the associated raw entity manager in case of a shared ( " transactional " ) entity manager , this will be the raw entity manager that is currently associated with the transaction outside of a transaction , an illegal state exception will be thrown

entity manager get target entity manager ( ) throws illegal state exception ;


test the case where we have a failure to complete a short circuit read that occurs , and then later on , we have a success any thread waiting on a cache load should receive the failure ( if it occurs ) ; however , the failure result should not be cached we want to be able to retry later and succeed

public void test short circuit cache temporary failure ( ) throws exception { block reader test util enable block reader factory tracing ( ) ; final atomic boolean replica creation should fail = new atomic boolean ( true ) ; final atomic boolean test failed = new atomic boolean ( false ) ; d f s input stream tcp reads disabled for testing = true ; block reader factory create short circuit replica info callback = new short circuit cache short circuit replica creator ( ) { @ override public short circuit replica info create short circuit replica info ( ) { if ( replica creation should fail get ( ) ) { / / insert a short delay to increase the chance that one client / / thread waits for the other client thread ' s failure via / / a condition variable uninterruptibles sleep uninterruptibly ( 2 , time unit seconds ) ; return new short circuit replica info ( ) ; } return null ; } } ; temporary socket directory sock dir = new temporary socket directory ( ) ; configuration conf = create short circuit conf ( " test short circuit cache temporary failure " , sock dir ) ; final mini d f s cluster cluster = new mini d f s cluster builder ( conf ) num data nodes ( 1 ) build ( ) ; cluster wait active ( ) ; final distributed file system dfs = cluster get file system ( ) ; final string test file = " / test file " ; final int test file len = 4000 ; final int num threads = 2 ; final int seed = 0x f a d e d ; final count down latch got failure latch = new count down latch ( num threads ) ; final count down latch should retry latch = new count down latch ( 1 ) ; d f s test util create file ( dfs , new path ( test file ) , test file len , ( short ) 1 , seed ) ; runnable reader runnable = new runnable ( ) { @ override public void run ( ) { try { / / first time should fail list < located block > located blocks = cluster get name node ( ) get rpc server ( ) get block locations ( test file , 0 , test file len ) get located blocks ( ) ; located block lblock = located blocks get ( 0 ) ; / / first block block reader block reader = null ; try { block reader = block reader test util get block reader ( cluster get file system ( ) , lblock , 0 , test file len ) ; assert fail ( " expected get block reader to fail the first time " ) ; } catch ( throwable t ) { assert assert true ( " expected to see ' tcp reads were disabled " + " for testing ' in exception " + t , t get message ( ) contains ( " tcp reads were disabled for testing " ) ) ; } finally { if ( block reader ! = null ) block reader close ( ) ; / / keep findbugs happy } got failure latch count down ( ) ; should retry latch await ( ) ; / / second time should succeed try { block reader = block reader test util get block reader ( cluster get file system ( ) , lblock , 0 , test file len ) ; } catch ( throwable t ) { log error ( " error trying to retrieve a block reader " + " the second time " , t ) ; throw t ; } finally { if ( block reader ! = null ) block reader close ( ) ; } } catch ( throwable t ) { log error ( " get block reader failure " , t ) ; test failed set ( true ) ; } } } ; thread threads [ ] = new thread [ num threads ] ; for ( int i = 0 ; i < num threads ; i + + ) { threads [ i ] = new thread ( reader runnable ) ; threads [ i ] start ( ) ; } got failure latch await ( ) ; replica creation should fail set ( false ) ; should retry latch count down ( ) ; for ( int i = 0 ; i < num threads ; i + + ) { uninterruptibles join uninterruptibly ( threads [ i ] ) ; } cluster shutdown ( ) ; sock dir close ( ) ; assert assert false ( test failed get ( ) ) ; }


calculate a resource ' s min share ratios the { @ code ratios } array will be populated with the { @ code resource } divided by { @ code min share } for each resource type if the min shares are 5 mb and 10 vcores , and the usage ( { @ code resource } ) is 10 mb and 5 cpu , the ratios will be 2 and 0 5 the { @ code ratios } array must be n x 3 , where n is the number of resource types only the third index of the inner arrays in the { @ code ratios } array will be used , e g { @ code ratios [ x ] [ 2 ] }

void calculate min share ratios ( resource resource , resource min share , float [ ] [ ] ratios ) { resource information [ ] resource info = resource get resources ( ) ; resource information [ ] min share info = min share get resources ( ) ; for ( int i = 0 ; i < min share info length ; i + + ) { ratios [ i ] [ 2 ] = resource info [ i ] get value ( ) / ( float ) min share info [ i ] get value ( ) ; } }


saves the current state of the chart to the gallery as a jpeg image the filename and compression can be set 0 = = maximum compression , 100 = low compression ( high quality ) note : needs permission write external storage

public boolean save to gallery ( string file name , int quality ) { return save to gallery ( file name , " " , " m p android chart - library save " , bitmap compress format png , quality ) ; }


the name of the enumflag as a reference enumsflag items are generated as id resource values < code > optional aapt pb reference name = 3 ; < code >


gets the fuzziness used when evaluated to a fuzzy query type

public fuzziness fuzziness ( ) { return this fuzziness ; }


creates a new deprecation logger for the supplied class internally , it delegates to { @ link # get logger ( string ) } , passing the full class name

public static deprecation logger get logger ( class < ? > a class ) { return get logger ( to logger name ( a class ) ) ; }


exposes the field cache to subclasses : a map from string field name to object value

protected final map < string , object > get field cache ( ) { return this field cache ; }


register custom http message readers or writers in addition to the ones registered by default


unmounts an existing sandboxfs instance unless the user asked not to by providing the { @ code - - sandbox debug } flag

private void unmount sandboxfs ( ) { if ( sandboxfs process ! = null ) { if ( should cleanup sandbox base ) { sandboxfs process destroy ( ) ; sandboxfs process = null ; } else { check not null ( env , " env not initialized ; was before command called ? " ) ; env get reporter ( ) handle ( event info ( " leaving sandboxfs mounted because of - - sandbox debug " ) ) ; } } }


static cas event repository filter no op ( ) { return new no op cas event repository filter ( ) ; }


returns the parent artifact containing this artifact artifacts without parents shall return null

public special artifact get parent ( ) { return null ; }


public field list get fields ( ) { parse to end if necessary ( ) ; return fields ; }


return the row position within the stripes being read by this reader this position will include rows that were never read due to row groups that are excluded due to row group statistics thus , it will advance faster than the number of rows actually read

public long get reader position ( ) { return current position ; }


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


the main factory method for creating a file system get a file system for the uri ' s scheme and authority the scheme of the < code > uri < code > determines a configuration property name , < tt > fs abstract file system scheme impl < tt > whose value names the abstract file system class the entire uri and conf is passed to the abstract file system factory method

public static abstract file system get ( final uri uri , final configuration conf ) throws unsupported file system exception { return create file system ( uri , conf ) ; }


increment the count of layout calculations in litho components ( by one )

public static long increment component calculate layout count ( ) { return s component calculate layout count add and get ( 1 ) ; }


create a private clone of a public token

public token < t > private clone ( text new service ) { return new private token < > ( this , new service ) ; }


get all bean names whose { @ code class } has the supplied { @ link annotation } type , including those defined in ancestor factories , without creating any bean instances yet will return unique names in case of overridden bean definitions

public static string [ ] bean names for annotation including ancestors ( listable bean factory lbf , class < ? extends annotation > annotation type ) { assert not null ( lbf , " listable bean factory must not be null " ) ; string [ ] result = lbf get bean names for annotation ( annotation type ) ; if ( lbf instanceof hierarchical bean factory ) { hierarchical bean factory hbf = ( hierarchical bean factory ) lbf ; if ( hbf get parent bean factory ( ) instanceof listable bean factory ) { string [ ] parent result = bean names for annotation including ancestors ( ( listable bean factory ) hbf get parent bean factory ( ) , annotation type ) ; result = merge names with parent ( result , parent result , hbf ) ; } } return result ; }


test the new method close resources ( ) in the runtime library the method is introduced to fix b 3 7 1 6 7 4 3 3

public void test close resource ( ) throws throwable { / * * * a resource implementing the interface auto closeable this interface is only available since * api 19 * / class auto closeable resource extends abstract resource implements auto closeable { protected auto closeable resource ( boolean exception on close ) { super ( exception on close ) ; } @ override public void close ( ) throws exception { internal close ( ) ; } }


static void notify framework listeners ( final int state , final bundle bundle , final throwable throwable ) { if ( framework listeners is empty ( ) ) { return ; } final framework event event = new framework event ( state ) ; final framework listener [ ] listeners = framework listeners to array ( new framework listener [ framework listeners size ( ) ] ) ; for ( int i = 0 ; i < listeners length ; i + + ) { final framework listener listener = listeners [ i ] ; listener framework event ( event ) ; } }


create a configuration with no defaults and bonded to a file provider , so that { @ link # set provider option ( configuration , string , string ) } can be used to set a secret

private configuration conf with provider ( ) throws exception { final configuration conf = empty conf ( ) ; add file provider ( conf ) ; return conf ; }


the errors encountered while retrying , in the encounter order

public list < exception > errors ( ) { return collections unmodifiable list ( this errors ) ; }


processes the output generated by an auxiliary include - scanning binary stored in a file

public static list < inclusion > process includes ( path file ) throws i o exception { try { byte [ ] data = file system utils read content ( file ) ; return include parser process includes ( arrays as list ( new string ( data , iso 8859 1 ) split ( " \ n " ) ) ) ; } catch ( i o exception e ) { throw new i o exception ( " error reading include file " + file + " : " + e get message ( ) ) ; } }


copy the data from an { @ link input stream } to a string using the specified charset

public static string copy stream to string ( input stream input , int estimated size , @ null string charset ) throws i o exception { input stream reader reader = charset = = null ? new input stream reader ( input ) : new input stream reader ( input , charset ) ; string writer writer = new string writer ( math max ( 0 , estimated size ) ) ; char [ ] buffer = new char [ default buffer size ] ; int chars read ; while ( ( chars read = reader read ( buffer ) ) ! = - 1 ) { writer write ( buffer , 0 , chars read ) ; } return writer to string ( ) ; }


public void move to tail ( ) { / / unlink prev next = next ; next prev = prev ; / / link next = sentinel ; prev = sentinel prev ; sentinel prev = this ; prev next = this ; }


compute the number of ordinals stored for a value given its current position

private static int num ordinals ( int level , long offset ) { return ( 1 < < level ) + ( int ) ( offset & slots mask ( level ) ) ; }


effectively returns { @ link # get num instances ( ) }

public int get num instances ( ) { return buffer limit ( ) * 4 / attributes vertex size ; }


saves state of ui controls to handler configuration

private void save handler settings ( ) { if ( selected profile = = null ) { return ; } for ( tab item handler tab : handlers folder get items ( ) ) { network handler descriptor handler = ( network handler descriptor ) handler tab get data ( ) ; handler block handler block = configurations get ( handler ) ; d b w handler configuration handler configuration = handler block loaded configs get ( selected profile ) ; if ( handler block use handler check get selection ( ) ) { if ( handler configuration = = null ) { handler configuration = new d b w handler configuration ( handler , null ) ; } handler configuration set properties ( collections empty map ( ) ) ; handler block configurator save settings ( handler configuration ) ; } } }


returns the first { @ link detailed exit code } encountered , or { @ code null } if there were none

public detailed exit code get detailed exit code ( ) { return error code get ( ) ; }


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

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


post - processes a test class after execution of all tests within the class this method should be called immediately after framework - specific after class lifecycle callbacks the default implementation is empty can be overridden by concrete classes as necessary

default void after test class ( test context test context ) throws exception { }


returns the number of occurrences of an element in this multiset ( the count of the element ) note that for an { @ link object # equals } - based multiset , this gives the same result as { @ link collections # frequency } ( which would presumably perform more poorly ) < b > note : < b > the utility method { @ link iterables # frequency } generalizes this operation ; it correctly delegates to this method when dealing with a multiset , but it can also accept any other iterable type

int count ( @ nullable decl @ compatible with ( " e " ) object element ) ; / / bulk operations


performs an automatic merge of my changes that are not conflicts for all the mergers specified each of the merger ' s auto merge is performed in the order they are found in the array each auto merge will cause that merger to determine conflicts < br > note : this method should be called a single time for any set of listing mergers and then be followed by the merge conflicts ( ) call to resolve conflicts

private void auto merge ( listing merger [ ] mergers , task monitor monitor ) throws program conflict exception , memory access exception , cancelled exception { float progress range size = 100 / mergers length ; int progress min = 0 ; for ( int merger index = 0 ; merger index < mergers length ; merger index + + ) { conflict info panel set conflict type ( mergers [ merger index ] get conflict type ( ) ) ; current merger = mergers [ merger index ] ; / / give each of the mergers an equal portion of the progress bar to fill in int progress max = ( int ) progress range size * ( merger index + 1 ) ; mergers [ merger index ] auto merge ( progress min , progress max , monitor ) ; progress min = progress max ; } }


set the radius of the inner progress circle

public void set radius ( float radius ) { this m radius = radius ; this m progress oval = null ; invalidate ( ) ; }


insert a node as a predecessor to this node in the linked list note : called only after the node is inserted into the tree

private void insert before ( node item ) { item prev = prev ; item next = this ; if ( this prev = = null ) { head = item ; } else { this prev next = item ; } this prev = item ; }


execute an s3 select operation on a failure , the request is only logged at debug to avoid the select exception being printed

select object content result select ( path source , select object content request request , string action ) throws i o exception ;


get the { @ linkplain class class } that declared { @ code @ test property source }

class < ? > get declaring class ( ) { return this declaring class ; }


subscribe to the given list of topics to get dynamically assigned partitions < b > topic subscriptions are not incremental this list will replace the current assignment ( if there is one ) < b > note that it is not possible to combine topic subscription with group management with manual partition assignment through { @ link # assign ( collection ) } if the given list of topics is empty , it is treated the same as { @ link # unsubscribe ( ) } as part of group management , the consumer will keep track of the list of consumers that belong to a particular group and will trigger a rebalance operation if any one of the following events are triggered : number of partitions change for any of the subscribed topics a subscribed topic is created or deleted an existing member of the consumer group is shutdown or fails a new member is added to the consumer group when any of these events are triggered , the provided listener will be invoked first to indicate that the consumer ' s assignment has been revoked , and then again when the new assignment has been received note that rebalances will only occur during an active call to { @ link # poll ( duration ) } , so callbacks will also only be invoked during that time the provided listener will immediately override any listener set in a previous call to subscribe it is guaranteed , however , that the partitions revokedassigned through this interface are from topics subscribed in this call see { @ link consumer rebalance listener } for more details

public void subscribe ( collection < string > topics , consumer rebalance listener listener ) { acquire and ensure open ( ) ; try { maybe throw invalid group id exception ( ) ; if ( topics = = null ) throw new illegal argument exception ( " topic collection to subscribe to cannot be null " ) ; if ( topics is empty ( ) ) { / / treat subscribing to empty topic list as the same as unsubscribing this unsubscribe ( ) ; } else { for ( string topic : topics ) { if ( topic = = null | | topic trim ( ) is empty ( ) ) throw new illegal argument exception ( " topic collection to subscribe to cannot contain null or empty topic " ) ; } throw if no assignors configured ( ) ; fetcher clear buffered data for unassigned topics ( topics ) ; log info ( " subscribed to topic ( s ) : { } " , utils join ( topics , " , " ) ) ; if ( this subscriptions subscribe ( new hash set < > ( topics ) , listener ) ) metadata request update for new topics ( ) ; } } finally { release ( ) ; } }


helper method to compute the amount of minshare starvation

private resource min share starvation ( ) { / / if demand < minshare , we should use demand to determine starvation resource starvation = resources componentwise min ( get min share ( ) , get demand ( ) ) ; resources subtract from non negative ( starvation , get resource usage ( ) ) ; boolean starved = ! resources is none ( starvation ) ; long now = scheduler get clock ( ) get time ( ) ; if ( ! starved ) { / / record that the queue is not starved set last time at min share ( now ) ; } if ( now - last time at min share < get min share preemption timeout ( ) ) { / / the queue is not starved for the preemption timeout starvation = resources clone ( resources none ( ) ) ; } return starvation ; }


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


parse mapping parameters from a map of mappings

public final void parse ( string name , parser context parser context , map < string , object > field node ) { map < string , parameter < ? > > params map = new hash map < > ( ) ; map < string , parameter < ? > > deprecated params map = new hash map < > ( ) ; for ( parameter < ? > param : get parameters ( ) ) { params map put ( param name , param ) ; for ( string deprecated name : param deprecated names ) { deprecated params map put ( deprecated name , param ) ; } } string type = ( string ) field node remove ( " type " ) ; for ( iterator < map entry < string , object > > iterator = field node entry set ( ) iterator ( ) ; iterator has next ( ) ; ) { map entry < string , object > entry = iterator next ( ) ; final string prop name = entry get key ( ) ; final object prop node = entry get value ( ) ; if ( objects equals ( " fields " , prop name ) ) { type parsers parse multi field ( multi fields builder : : add , name , parser context , prop name , prop node ) ; iterator remove ( ) ; continue ; } if ( objects equals ( " copy to " , prop name ) ) { type parsers parse copy fields ( prop node ) for each ( copy to : : add ) ; iterator remove ( ) ; continue ; } if ( objects equals ( " boost " , prop name ) ) { if ( parser context index version created ( ) before ( version v 8 0 0 ) ) { deprecation logger deprecate ( " boost " , " parameter [ boost ] on field [ { } ] is deprecated and has no effect " , name ) ; iterator remove ( ) ; continue ; } else { throw new mapper parsing exception ( " unknown parameter [ boost ] on mapper [ " + name + " ] " ) ; } } parameter < ? > parameter = deprecated params map get ( prop name ) ; if ( parameter ! = null ) { deprecation logger deprecate ( prop name , " parameter [ { } ] on mapper [ { } ] is deprecated , use [ { } ] " , prop name , name , parameter name ) ; } else { parameter = params map get ( prop name ) ; } if ( parameter = = null ) { if ( is deprecated parameter ( prop name , parser context index version created ( ) ) ) { deprecation logger deprecate ( prop name , " parameter [ { } ] has no effect on type [ { } ] and will be removed in future " , prop name , type ) ; iterator remove ( ) ; continue ; } throw new mapper parsing exception ( " unknown parameter [ " + prop name + " ] on mapper [ " + name + " ] of type [ " + type + " ] " ) ; } if ( parameter deprecated ) { deprecation logger deprecate ( prop name , " parameter [ { } ] is deprecated and will be removed in a future version " , prop name ) ; } if ( prop node = = null & & parameter accepts null = = false ) { throw new mapper parsing exception ( " [ " + prop name + " ] on mapper [ " + name + " ] of type [ " + type + " ] must not have a [ null ] value " ) ; } parameter parse ( name , parser context , prop node ) ; iterator remove ( ) ; } validate ( ) ; }


removes the current actor for the cell , if any

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


updates the operator state accessible by { @ link # get ( ) } by adding the given values to existing list of values the next time { @ link # get ( ) } is called ( for the same state partition ) the returned state will represent the updated list if null or an empty list is passed in , the state value remains unchanged

void add all ( list < t > values ) throws exception ;


returns the file within the data directory of the test resources module that matches the given relative path a { @ link file not found exception } is throw if the file does not exist

public static file get test data file ( string path ) throws file not found exception { resource file resource file = application get module data file ( " test resources " , path ) ; return resource file get file ( false ) ; }


returns the list of combined globalpublic symbols

public map < long , abstract ms symbol > get symbols by offset ( ) { return symbol records get symbols by offset ( ) ; }


returns true if < code > i < code > is less than or equal to < code > j < code >

public static boolean unsigned less than or equal ( byte i , byte j ) { return comp ( less than or equal , i , j ) ; }


transitively build all given artifacts , targets , and tests , and all necessary prerequisites thereof for sequential implementations of this interface , the top - level requests will be built in the iteration order of the set provided ; for concurrent implementations , the order is undefined this method should not be invoked more than once concurrently on the same builder instance

void build artifacts ( reporter reporter , set < artifact > artifacts , set < configured target > parallel tests , set < configured target > exclusive tests , set < configured target > targets to build , set < configured target > targets to skip , immutable set < aspect key > aspects , executor executor , set < configured target key > built targets , set < aspect key > built aspects , options provider options , @ nullable range < long > last execution time range , top level artifact context top level artifact context , boolean trust remote artifacts ) throws build failed exception , abrupt exit exception , interrupted exception , test exec exception ;


returns true iff this path denotes an existing file of any kind

public boolean exists ( symlinks follow symlinks ) { return file system exists ( this , follow symlinks to boolean ( ) ) ; }


return an iterator over all keys in this store this iterator must be closed after use the returned iterator must be safe from { @ link java util concurrent modification exception } s and must not return null values order is not guaranteed as bytes lexicographical ordering might not represent key order


adds an { @ link update request } to the list of actions to execute

public bulk request builder add ( update request request ) { super request add ( request ) ; return this ; }


precondition is that { @ code buffer ! = null }

private int add component 0 ( boolean increase writer index , int c index , byte buf buffer ) { assert buffer ! = null ; boolean was added = false ; try { check component index ( c index ) ; / / no need to consolidate - just add a component to the list component c = new component ( ensure accessible ( buffer ) , 0 ) ; int readable bytes = c length ( ) ; / / check if we would overflow / / see https : / / github com / netty / netty / issues / 10194 check for overflow ( capacity ( ) , readable bytes ) ; add comp ( c index , c ) ; was added = true ; if ( readable bytes > 0 & & c index < component count - 1 ) { update component offsets ( c index ) ; } else if ( c index > 0 ) { c reposition ( components [ c index - 1 ] end offset ) ; } if ( increase writer index ) { writer index + = readable bytes ; } return c index ; } finally { if ( ! was added ) { buffer release ( ) ; } } }


can be used to collect objects from the iterable is a terminating operation

public final optional < e > last ( ) { var list = last ( 1 ) as list ( ) ; if ( list is empty ( ) ) { return optional empty ( ) ; } return optional of ( list get ( 0 ) ) ; }


try subscribing to a { @ link maybe source } mapped from a scalar source ( which implements { @ link supplier } )

static < t , r > boolean try as maybe ( object source , function < ? super t , ? extends maybe source < ? extends r > > mapper , observer < ? super r > observer ) { if ( source instanceof supplier ) { @ suppress warnings ( " unchecked " ) supplier < t > supplier = ( supplier < t > ) source ; maybe source < ? extends r > cs = null ; try { t item = supplier get ( ) ; if ( item ! = null ) { cs = objects require non null ( mapper apply ( item ) , " the mapper returned a null maybe source " ) ; } } catch ( throwable ex ) { exceptions throw if fatal ( ex ) ; empty disposable error ( ex , observer ) ; return true ; } if ( cs = = null ) { empty disposable complete ( observer ) ; } else { cs subscribe ( maybe to observable create ( observer ) ) ; } return true ; } return false ; }


creates a dexbuilder action with the given input , output , and flags flags must have been filtered and normalized to a set that the dexbuilder tool can understand

static artifact create dex archive action ( rule context rule context , string dexbuilder prereq , artifact jar , set < string > incremental dexopts , artifact dex archive ) { custom command line args = new custom command line builder ( ) add exec path ( " - - input jar " , jar ) add exec path ( " - - output zip " , dex archive ) add all ( immutable list copy of ( incremental dexopts ) ) build ( ) ; spawn action builder dexbuilder = new spawn action builder ( ) use default shell environment ( ) set executable ( rule context get executable prerequisite ( dexbuilder prereq ) ) / / worker spawn strategy expects the last argument to be @ paramfile add input ( jar ) add output ( dex archive ) set mnemonic ( " dex builder " ) set progress message ( " dexing % s with applicable dexopts % s " , jar pretty print ( ) , incremental dexopts ) / / always use params file for compatibility with worker spawn strategy add command line ( args , param file info builder ( unquoted ) set use always ( true ) build ( ) ) ; if ( get android config ( rule context ) use workers with dexbuilder ( ) ) { dexbuilder set execution info ( execution requirements worker mode enabled ) ; } rule context register action ( dexbuilder build ( rule context ) ) ; return dex archive ; }


checks whether a field is directly readable without a getter

public static boolean is structured field directly readable ( field field ) { final int m = field get modifiers ( ) ; / / field is directly readable return modifier is public ( m ) ; }


return the error codes for the field or object , if any returns an empty array instead of null if none

public string [ ] get error codes ( ) { return this error codes ; }