adds linker output artifacts to the given map , to be registered on the configured target as output groups

private static map < string , nested set < artifact > > add linker output artifacts ( rule context rule context , cc toolchain provider cc toolchain , cpp configuration cpp configuration , build configuration configuration , cc compilation outputs cc compilation outputs , feature configuration feature configuration ) throws rule error exception { nested set builder < artifact > archive file = new nested set builder < > ( order stable order ) ; nested set builder < artifact > dynamic library = new nested set builder < > ( order stable order ) ; immutable sorted map builder < string , nested set < artifact > > output groups = immutable sorted map natural order ( ) ; if ( ! rule context attributes ( ) has ( " alwayslink " , type boolean ) | | ! rule context attributes ( ) has ( " linkstatic " , type boolean ) ) { return output groups build ( ) ; } if ( rule context attributes ( ) get ( " alwayslink " , type boolean ) ) { archive file add ( cpp helper get linked artifact ( rule context , cc toolchain , configuration , link link target type always link static library , / * linked artifact name suffix = * / " " ) ) ; } else { archive file add ( cpp helper get linked artifact ( rule context , cc toolchain , configuration , link link target type static library , / * linked artifact name suffix = * / " " ) ) ; } if ( ! rule context attributes ( ) get ( " linkstatic " , type boolean ) & & ! cc compilation outputs is empty ( ) ) { dynamic library add ( cpp helper get linked artifact ( rule context , cc toolchain , configuration , link link target type nodeps dynamic library , cpp helper get d l l hash suffix ( rule context , feature configuration ) ) ) ; if ( cpp helper use interface shared libraries ( cpp configuration , cc toolchain , feature configuration ) ) { dynamic library add ( cpp helper get linked artifact ( rule context , cc toolchain , configuration , link target type interface dynamic library , / * linked artifact name suffix = * / " " ) ) ; } } output groups put ( archive library output group name , archive file build ( ) ) ; output groups put ( dynamic library output group name , dynamic library build ( ) ) ; return output groups build ( ) ; }


check if snapshot roots are created for all existing snapshottable directories create them if not

void check and provision snapshot trash roots ( ) throws i o exception { snapshottable directory status [ ] dir status list = get snapshottable dir listing ( ) ; if ( dir status list = = null ) { return ; } for ( snapshottable directory status dir status : dir status list ) { string curr dir = dir status get full path ( ) to string ( ) ; if ( ! curr dir ends with ( path separator ) ) { curr dir + = path separator ; } string trash path = curr dir + file system trash prefix ; hdfs file status file status = get file info ( trash path , false , false , false ) ; if ( file status = = null ) { log info ( " trash doesn ' t exist for snapshottable directory { } " + " creating trash at { } " , curr dir , trash path ) ; permission status permission status = new permission status ( get remote user ( ) get short user name ( ) , null , shared trash permission ) ; mkdirs ( trash path , permission status , false ) ; } } }


test the property ' quadrilateral type '

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


test using the gzip codec with two input files

public void test gzip with two inputs ( ) throws exception { compression codec gzip = new gzip codec ( ) ; local fs delete ( work dir , true ) ; job job = job get instance ( default conf ) ; fixed length input format format = new fixed length input format ( ) ; format set record length ( job get configuration ( ) , 5 ) ; reflection utils set conf ( gzip , job get configuration ( ) ) ; file input format set input paths ( job , work dir ) ; / / create files with fixed length records with 5 byte long records write file ( local fs , new path ( work dir , " part 1 txt gz " ) , gzip , " one two threefour five six seveneightnine ten " ) ; write file ( local fs , new path ( work dir , " part 2 txt gz " ) , gzip , " ten nine eightsevensix five four threetwo one " ) ; list < input split > splits = format get splits ( job ) ; assert equals ( " compressed splits = = 2 " , 2 , splits size ( ) ) ; file split tmp = ( file split ) splits get ( 0 ) ; if ( tmp get path ( ) get name ( ) equals ( " part 2 txt gz " ) ) { splits set ( 0 , splits get ( 1 ) ) ; splits set ( 1 , tmp ) ; } list < string > results = read split ( format , splits get ( 0 ) , job ) ; assert equals ( " splits [ 0 ] length " , 10 , results size ( ) ) ; assert equals ( " splits [ 0 ] [ 5 ] " , " six " , results get ( 5 ) ) ; results = read split ( format , splits get ( 1 ) , job ) ; assert equals ( " splits [ 1 ] length " , 10 , results size ( ) ) ; assert equals ( " splits [ 1 ] [ 0 ] " , " ten " , results get ( 0 ) ) ; assert equals ( " splits [ 1 ] [ 1 ] " , " nine " , results get ( 1 ) ) ; }


public non resident name table get non resident name table ( ) { return non res name table ; }


tests that during reroute when a node is detected as leaving the cluster , the right unassigned meta is set

public void test node leave ( ) { allocation service allocation = create allocation service ( ) ; metadata metadata = metadata builder ( ) put ( index metadata builder ( " test " ) settings ( settings ( version current ) ) number of shards ( 1 ) number of replicas ( 1 ) ) build ( ) ; cluster state cluster state = cluster state builder ( cluster name cluster name setting get default ( settings empty ) ) metadata ( metadata ) routing table ( routing table builder ( ) add as new ( metadata index ( " test " ) ) build ( ) ) build ( ) ; cluster state = cluster state builder ( cluster state ) nodes ( discovery nodes builder ( ) add ( new node ( " node 1 " ) ) add ( new node ( " node 2 " ) ) ) build ( ) ; cluster state = allocation reroute ( cluster state , " reroute " ) ; / / starting primaries cluster state = start initializing shards and reroute ( allocation , cluster state ) ; / / starting replicas cluster state = start initializing shards and reroute ( allocation , cluster state ) ; assert that ( cluster state get routing nodes ( ) unassigned ( ) size ( ) > 0 , equal to ( false ) ) ; / / remove node 2 and reroute cluster state = cluster state builder ( cluster state ) nodes ( discovery nodes builder ( cluster state nodes ( ) ) remove ( " node 2 " ) ) build ( ) ; cluster state = allocation disassociate dead nodes ( cluster state , true , " reroute " ) ; / / verify that node leave is the reason for meta assert that ( cluster state get routing nodes ( ) unassigned ( ) size ( ) > 0 , equal to ( true ) ) ; assert that ( cluster state get routing nodes ( ) shards with state ( unassigned ) size ( ) , equal to ( 1 ) ) ; assert that ( cluster state get routing nodes ( ) shards with state ( unassigned ) get ( 0 ) unassigned info ( ) , not null value ( ) ) ; assert that ( cluster state get routing nodes ( ) shards with state ( unassigned ) get ( 0 ) unassigned info ( ) get reason ( ) , equal to ( unassigned info reason node left ) ) ; assert that ( cluster state get routing nodes ( ) shards with state ( unassigned ) get ( 0 ) unassigned info ( ) get unassigned time in millis ( ) , greater than ( 0l ) ) ; }


returns the color used for subsequently added text modifying the color affects text subsequently added to the cache , but does not affect existing text currently in the cache

public color get color ( ) { return color ; }


enhance a class to intercept constructors and class instance methods

private dynamic type builder < ? > enhance instance ( type description type description , dynamic type builder < ? > new class builder , class loader class loader , enhance context context ) throws plugin exception { constructor intercept point [ ] constructor intercept points = get constructors intercept points ( ) ; instance methods intercept point [ ] instance methods intercept points = get instance methods intercept points ( ) ; string enhance origin class name = type description get type name ( ) ; boolean existed constructor intercept point = false ; if ( constructor intercept points ! = null & & constructor intercept points length > 0 ) { existed constructor intercept point = true ; } boolean existed methods intercept points = false ; if ( instance methods intercept points ! = null & & instance methods intercept points length > 0 ) { existed methods intercept points = true ; } / * * * nothing need to be enhanced in class instance , maybe need enhance static methods * / if ( ! existed constructor intercept point & & ! existed methods intercept points ) { return new class builder ; } / * * * manipulate class source code < br / > * * new class need : < br / > * 1 add field , name { @ link # context attr name } * 2 add a field accessor for this field * * and make sure the source codes manipulation only occurs once * * / if ( ! type description is assignable to ( enhanced instance class ) ) { if ( ! context is object extended ( ) ) { new class builder = new class builder define field ( context attr name , object class , acc private | acc volatile ) implement ( enhanced instance class ) intercept ( field accessor of field ( context attr name ) ) ; context extend object completed ( ) ; } } / * * * 2 enhance constructors * / if ( existed constructor intercept point ) { for ( constructor intercept point constructor intercept point : constructor intercept points ) { if ( is bootstrap instrumentation ( ) ) { new class builder = new class builder constructor ( constructor intercept point get constructor matcher ( ) ) intercept ( super method call instance and then ( method delegation with default configuration ( ) to ( bootstrap instrument boost for internal delegate class ( constructor intercept point get constructor interceptor ( ) ) ) ) ) ; } else { new class builder = new class builder constructor ( constructor intercept point get constructor matcher ( ) ) intercept ( super method call instance and then ( method delegation with default configuration ( ) to ( new constructor inter ( constructor intercept point get constructor interceptor ( ) , class loader ) ) ) ) ; } } }


name the junit thread for the class this will overridden before the individual test methods are run

public static void name test thread ( ) { thread current thread ( ) set name ( " j unit " ) ; }


find the file system counter for the given scheme and enum

public synchronized c find counter ( string scheme , file system counter key ) { return ( ( file system counter group < c > ) get group ( file system counter class get name ( ) ) get underlying group ( ) ) find counter ( scheme , key ) ; }


sets the log formatter if unset , the class named by the " formatter " field in the jvm logging configuration for { @ link simple log handler } will be used ; and if that ' s unset , { @ link single line formatter } will be used

public builder set formatter ( formatter formatter ) { this formatter = formatter ; return this ; }


copy the given collection into a string array the collection must contain string elements only

public static string [ ] to string array ( collection < string > collection ) { if ( collection = = null ) { return null ; } return collection to array ( new string [ collection size ( ) ] ) ; }


invoke predicate by each storage type and bitwise and the results

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


reads window state generated using an { @ link aggregate function }

public < k , t , acc , r > data set < r > aggregate ( string uid , aggregate function < t , acc , r > aggregate function , type information < k > key type , type information < acc > acc type , type information < r > output type ) throws i o exception { return aggregate ( uid , aggregate function , new pass through reader < > ( ) , key type , acc type , output type ) ; }


dumps this class this package - protected method is for debugging only

string dump ( ) { string builder builder = new string builder ( ) ; builder append ( " image function entry - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ n " ) ; builder append ( string format ( " starting address : 0x % 08x \ n " , starting address ) ) ; builder append ( string format ( " ending address : 0x % 08x \ n " , ending address ) ) ; builder append ( string format ( " end of prologue address : 0x % 08x \ n " , end of prologue address ) ) ; builder append ( " end image function entry - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ n " ) ; return builder to string ( ) ; }


returns the list of selected items or null if the dialog was cancelled

public list < t > get selection items ( ) { return selected items ; }


return true if the method includes the { @ code static } modifier

public boolean is static ( ) { return method is static ( ) ; }


a { @ link timer service } for querying time and registering timers

public abstract timer service timer service ( ) ;


enumerations supported only for unique constraints

public boolean supports dictionary enumeration ( ) { return true ; }


see { @ link kafka producer # send offsets to transaction ( map , string ) }

void send offsets to transaction ( map < topic partition , offset and metadata > offsets , string consumer group id ) throws producer fenced exception ;


public void test catch ( ) { assert equals ( 1 , exec ( " try { if ( params param = = ' true ' ) throw new runtime exception ( ' test ' ) ; } " + " catch ( runtime exception e ) { return 1 ; } return 2 ; " , collections singleton map ( " param " , " true " ) , true ) ) ; }


route to a built router function if the given request predicate applies this method can be used to create nested routes , where a group of routes share a common path ( prefix ) , header , or other request predicate for instance , the following example creates a nested route with a " user " path predicate , so that get requests for " user " will list users , and post request for " user " will create a new user < pre class = " code " > router function & lt ; server response & gt ; nested route = router functions route ( ) nest ( request predicates path ( " user " ) , builder - > builder get ( this : : list users ) post ( this : : create user ) ) build ( ) ;

builder nest ( request predicate predicate , consumer < builder > builder consumer ) ;


public void set num pre instructions ( int pre instructions ) { this num pre instructions = pre instructions ; }


public bi ad adapter switcher on enable refresh ( final int delay trigger ) { listview set default on refresh listener ( new swipe refresh layout on refresh listener ( ) { @ override public void on refresh ( ) { new handler ( ) post delayed ( refresh default , delay trigger ) ; } } ) ; return this ; }


used from { @ code console jelly } to write annotated log to the given output

public void write log to ( long offset , @ non null x m l output out ) throws i o exception { long start = offset ; if ( offset > 0 ) { try ( buffered input stream buffered input stream = new buffered input stream ( get log input stream ( ) ) ) { if ( offset = = buffered input stream skip ( offset ) ) { int r ; do { r = buffered input stream read ( ) ; start = ( r = = - 1 ) ? 0 : start + 1 ; } while ( r ! = - 1 & & r ! = ' \ n ' ) ; } } } get log text ( ) write html to ( start , out as writer ( ) ) ; }


checks whether or not the application is using a " single jar " layout custom application layouts that extend this class can override this method once they determine they are in single jar mode

public boolean in single jar mode ( ) { return false ; }


add a production associated with a sleigh constructor semantic

public void add production ( assembly non terminal lhs , assembly sentential < assembly non terminal > rhs , disjoint pattern pattern , constructor cons , list < integer > indices ) { assembly production prod = new production ( lhs , rhs ) ; add production ( prod ) ; map < constructor , assembly constructor semantic > map = semantics get ( prod ) ; assembly constructor semantic sem = map get ( cons ) ; if ( sem = = null ) { sem = new assembly constructor semantic ( cons , indices ) ; map put ( cons , sem ) ; } else if ( ! indices equals ( sem get operand indices ( ) ) ) { throw new illegal state exception ( " productions of the same constructor must have same operand indices " ) ; } sem add pattern ( pattern ) ; }


public void incr ( long delta ) { value add and get ( delta ) ; set changed ( ) ; }


create a { @ link kubernetes state handle store } which storing { @ link job graph }

public static kubernetes state handle store < job graph > create job graph state handle store ( configuration configuration , flink kube client flink kube client , string config map name , string lock identity ) throws exception { final retrievable state storage helper < job graph > state storage = new file system state storage helper < > ( high availability services utils get cluster high available storage path ( configuration ) , submitted jobgraph file prefix ) ; return new kubernetes state handle store < > ( flink kube client , config map name , state storage , k - > k starts with ( job graph store key prefix ) , lock identity ) ; }


the default implementation is empty can be overridden by subclasses as necessary

public void after test method ( test context test context ) throws exception { / * no - op * / }


public void namespace integer test ( ) { / / todo : test namespace integer }


get the response object of the underlying rpc protocol , e g http servlet response

public object get response ( ) { return response ; }


helper method to set access token for the first bearer authentication

public void set bearer token ( string bearer token ) { for ( authentication auth : authentications values ( ) ) { if ( auth instanceof http bearer auth ) { ( ( http bearer auth ) auth ) set bearer token ( bearer token ) ; return ; } } throw new runtime exception ( " no bearer authentication configured ! " ) ; }


get a string representation of this pair

public string to string ( ) { return name + " = " + value ; }


the application master is updating the places blacklisted by app used for containers other than a ms

public void update places blacklisted by app ( list < string > blacklist additions , list < string > blacklist removals ) { if ( update blacklisted places ( places blacklisted by app , blacklist additions , blacklist removals ) ) { user blacklist changed set ( true ) ; } }


starts a cluster with the given configuration

private void start cluster ( hdfs configuration conf ) throws i o exception { cluster = new mini d f s cluster builder ( conf ) num data nodes ( 3 ) build ( ) ; cluster wait active ( ) ; }


used to determine if an animation can be drawn with hardware acceleration

public boolean has dash pattern ( ) { return has dash pattern ; }


indicates whether the { @ linkplain # get subtype ( ) subtype } is the wildcard character < code > & # 42 ; < code > or the wildcard character followed by a suffix ( e g < code > & # 42 ; + xml < code > )

public boolean is wildcard subtype ( ) { return wildcard type equals ( get subtype ( ) ) | | get subtype ( ) starts with ( " * + " ) ; }


sets the explain flag , which will collect information about the reroute request without executing the actions similar to dry run , but human - readable

public cluster reroute request explain ( boolean explain ) { this explain = explain ; return this ; }


returns true if there is a pending request that hasn ' t started yet any currently executing requests will not affect this call

public synchronized boolean has pending updates ( ) { if ( disposed ) { return false ; } return request time ! = none ; }


find the next child that needs to be traversed

public int get operand ( ) { return breadcrumb [ depth ] ; }


returns the embedded object if there is one else returns itself

public m d object c p p get embedded object ( ) { if ( embedded object flag ) { return qualified name get basic name ( ) get embedded object ( ) ; } return this ; }


public sequence item get item ( ) { return frequent item ; }


public int get code ( ) { return code ; }


perform a binary search to locate the specified key and derive an index into the buffer id storage this method is intended to find the insertion index or exact match for a child key a negative value will be returned when an exact match is not found and may be transformed into an insertion index ( inset index = - returned index - 1 )

private int get key index ( long key ) { int min = 0 ; int max = key count - 1 ; while ( min < = max ) { int i = ( min + max ) / 2 ; long k = get key ( i ) ; if ( k = = key ) { return i ; } else if ( k < key ) { min = i + 1 ; } else { max = i - 1 ; } } return - ( min + 1 ) ; }


decodes the specified http header value into { @ link cookie } s

private set < cookie > do decode ( string header ) { list < string > names = new array list < string > ( 8 ) ; list < string > values = new array list < string > ( 8 ) ; extract key value pairs ( header , names , values ) ; if ( names is empty ( ) ) { return collections empty set ( ) ; } int i ; int version = 0 ; / / $ version is the only attribute that can appear before the actual / / cookie name - value pair if ( names get ( 0 ) equals ignore case ( version ) ) { try { version = integer parse int ( values get ( 0 ) ) ; } catch ( number format exception e ) { / / ignore } i = 1 ; } else { i = 0 ; } if ( names size ( ) < = i ) { / / there ' s a version attribute , but nothing more return collections empty set ( ) ; } set < cookie > cookies = new tree set < cookie > ( ) ; for ( ; i < names size ( ) ; i + + ) { string name = names get ( i ) ; string value = values get ( i ) ; if ( value = = null ) { value = " " ; } cookie c = init cookie ( name , value ) ; if ( c = = null ) { break ; } boolean discard = false ; boolean secure = false ; boolean http only = false ; string comment = null ; string comment u r l = null ; string domain = null ; string path = null ; long max age = long min value ; list < integer > ports = new array list < integer > ( 2 ) ; for ( int j = i + 1 ; j < names size ( ) ; j + + , i + + ) { name = names get ( j ) ; value = values get ( j ) ; if ( discard equals ignore case ( name ) ) { discard = true ; } else if ( cookie header names secure equals ignore case ( name ) ) { secure = true ; } else if ( cookie header names httponly equals ignore case ( name ) ) { http only = true ; } else if ( comment equals ignore case ( name ) ) { comment = value ; } else if ( commenturl equals ignore case ( name ) ) { comment u r l = value ; } else if ( cookie header names domain equals ignore case ( name ) ) { domain = value ; } else if ( cookie header names path equals ignore case ( name ) ) { path = value ; } else if ( cookie header names expires equals ignore case ( name ) ) { date date = date formatter parse http date ( value ) ; if ( date ! = null ) { long max age millis = date get time ( ) - system current time millis ( ) ; max age = max age millis / 1000 + ( max age millis % 1000 ! = 0 ? 1 : 0 ) ; } } else if ( cookie header names max age equals ignore case ( name ) ) { max age = integer parse int ( value ) ; } else if ( version equals ignore case ( name ) ) { version = integer parse int ( value ) ; } else if ( port equals ignore case ( name ) ) { string [ ] port list = value split ( " , " ) ; for ( string s 1 : port list ) { try { ports add ( integer value of ( s 1 ) ) ; } catch ( number format exception e ) { / / ignore } } } else { break ; } } c set version ( version ) ; c set max age ( max age ) ; c set path ( path ) ; c set domain ( domain ) ; c set secure ( secure ) ; c set http only ( http only ) ; if ( version > 0 ) { c set comment ( comment ) ; } if ( version > 1 ) { c set comment url ( comment u r l ) ; c set ports ( ports ) ; c set discard ( discard ) ; } cookies add ( c ) ; } return cookies ; }


applies { @ link longs # try parse ( string ) } to the given string and asserts that the result is as expected

private static void try parse and assert equals ( long expected , string value ) { assert equals ( expected , longs try parse ( value ) ) ; }


sets { @ code num hash functions } bits of the given bit array , by hashing a user element returns whether any bits changed as a result of this operation

< t > boolean put ( t object , funnel < ? super t > funnel , int num hash functions , lock free bit array bits ) ;


stores a key - value pair in this multimap some multimap implementations allow duplicate key - value pairs , in which case { @ code put } always adds a new key - value pair and increases the multimap size by 1 other implementations prohibit duplicates , and storing a key - value pair that ' s already in the multimap has no effect

boolean put ( @ nullable decl k key , @ nullable decl v value ) ;


get indexes array for items marked as null , either erased or not to read

static < t > int [ ] get null indexes ( t [ ] inputs ) { int [ ] null indexes = new int [ inputs length ] ; int idx = 0 ; for ( int i = 0 ; i < inputs length ; i + + ) { if ( inputs [ i ] = = null ) { null indexes [ idx + + ] = i ; } } return arrays copy of ( null indexes , idx ) ; }


public entry table get entry table ( ) { return entry table ; }


set of available keyer , by names the first keyer is considered the default one

public static list < string > get keyer names ( ) { return collections unmodifiable list ( keyer names ) ; }


set the interface of the service to access the interface must be suitable for the particular service and remoting strategy typically required to be able to create a suitable service proxy , but can also be optional if the lookup returns a typed proxy

public void set service interface ( class < ? > service interface ) { assert not null ( service interface , " ' service interface ' must not be null " ) ; assert is true ( service interface is interface ( ) , " ' service interface ' must be an interface " ) ; this service interface = service interface ; }


merges the input frame of the given { @ link frame } with the input and output frames of this { @ link frame } returns { @ literal true } if the given frame has been changed by this operation ( the input and output frames of this { @ link frame } are never changed )

final boolean merge ( final symbol table symbol table , final frame dst frame , final int catch type index ) { boolean frame changed = false ; / / compute the concrete types of the local variables at the end of the basic block corresponding / / to this frame , by resolving its abstract output types , and merge these concrete types with / / those of the local variables in the input frame of dst frame int num local = input locals length ; int num stack = input stack length ; if ( dst frame input locals = = null ) { dst frame input locals = new int [ num local ] ; frame changed = true ; } for ( int i = 0 ; i < num local ; + + i ) { int concrete output type ; if ( output locals ! = null & & i < output locals length ) { int abstract output type = output locals [ i ] ; if ( abstract output type = = 0 ) { / / if the local variable has never been assigned in this basic block , it is equal to its / / value at the beginning of the block concrete output type = input locals [ i ] ; } else { concrete output type = get concrete output type ( abstract output type , num stack ) ; } } else { / / if the local variable has never been assigned in this basic block , it is equal to its / / value at the beginning of the block concrete output type = input locals [ i ] ; } / / concrete output type might be an uninitialized type from the input locals or from the input / / stack however , if a constructor has been called for this class type in the basic block , / / then this type is no longer uninitialized at the end of basic block if ( initializations ! = null ) { concrete output type = get initialized type ( symbol table , concrete output type ) ; } frame changed | = merge ( symbol table , concrete output type , dst frame input locals , i ) ; } / / if dst frame is an exception handler block , it can be reached from any instruction of the / / basic block corresponding to this frame , in particular from the first one therefore , the / / input locals of dst frame should be compatible ( i e merged ) with the input locals of this / / frame ( and the input stack of dst frame should be compatible , i e merged , with a one / / element stack containing the caught exception type ) if ( catch type index > 0 ) { for ( int i = 0 ; i < num local ; + + i ) { frame changed | = merge ( symbol table , input locals [ i ] , dst frame input locals , i ) ; } if ( dst frame input stack = = null ) { dst frame input stack = new int [ 1 ] ; frame changed = true ; } frame changed | = merge ( symbol table , catch type index , dst frame input stack , 0 ) ; return frame changed ; } / / compute the concrete types of the stack operands at the end of the basic block corresponding / / to this frame , by resolving its abstract output types , and merge these concrete types with / / those of the stack operands in the input frame of dst frame int num input stack = input stack length + output stack start ; if ( dst frame input stack = = null ) { dst frame input stack = new int [ num input stack + output stack top ] ; frame changed = true ; } / / first , do this for the stack operands that have not been popped in the basic block / / corresponding to this frame , and which are therefore equal to their value in the input / / frame ( except for uninitialized types , which may have been initialized ) for ( int i = 0 ; i < num input stack ; + + i ) { int concrete output type = input stack [ i ] ; if ( initializations ! = null ) { concrete output type = get initialized type ( symbol table , concrete output type ) ; } frame changed | = merge ( symbol table , concrete output type , dst frame input stack , i ) ; } / / then , do this for the stack operands that have pushed in the basic block ( this code is the / / same as the one above for local variables ) for ( int i = 0 ; i < output stack top ; + + i ) { int abstract output type = output stack [ i ] ; int concrete output type = get concrete output type ( abstract output type , num stack ) ; if ( initializations ! = null ) { concrete output type = get initialized type ( symbol table , concrete output type ) ; } frame changed | = merge ( symbol table , concrete output type , dst frame input stack , num input stack + i ) ; } return frame changed ; }


check whether the text is visible or not

public boolean is text visible ( ) { return text visible ; }


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


method that assigns a unique { @ link long } value to all elements in the input data set the generated values are consecutive

public static < t > data set < tuple 2 < long , t > > zip with index ( data set < t > input ) { data set < tuple 2 < integer , long > > element count = count elements per partition ( input ) ; return input map partition ( new rich map partition function < t , tuple 2 < long , t > > ( ) { long start = 0 ; @ override public void open ( configuration parameters ) throws exception { super open ( parameters ) ; list < tuple 2 < integer , long > > offsets = get runtime context ( ) get broadcast variable with initializer ( " counts " , new broadcast variable initializer < tuple 2 < integer , long > , list < tuple 2 < integer , long > > > ( ) { @ override public list < tuple 2 < integer , long > > initialize broadcast variable ( iterable < tuple 2 < integer , long > > data ) { / / sort the list by task id to / / calculate the correct offset list < tuple 2 < integer , long > > sorted data = new array list < > ( ) ; for ( tuple 2 < integer , long > datum : data ) { sorted data add ( datum ) ; } collections sort ( sorted data , new comparator < tuple 2 < integer , long > > ( ) { @ override public int compare ( tuple 2 < integer , long > o 1 , tuple 2 < integer , long > o 2 ) { return o 1 f 0 compare to ( o 2 f 0 ) ; } } ) ; return sorted data ; } } ) ; / / compute the offset for each partition for ( int i = 0 ; i < get runtime context ( ) get index of this subtask ( ) ; i + + ) { start + = offsets get ( i ) f 1 ; } } @ override public void map partition ( iterable < t > values , collector < tuple 2 < long , t > > out ) throws exception { for ( t value : values ) { out collect ( new tuple 2 < > ( start + + , value ) ) ; } } } ) with broadcast set ( element count , " counts " ) ; }


public final numeric type numeric type ( ) { return numeric type ; }


returns a new immutable array containing the values in the specified range < b > performance note : < b > the returned array has the same full memory footprint as this one does ( no actual copying is performed ) to reduce memory usage , use { @ code sub array ( start , end ) trimmed ( ) }

public immutable int array sub array ( int start index , int end index ) { preconditions check position indexes ( start index , end index , length ( ) ) ; return start index = = end index ? empty : new immutable int array ( array , start + start index , start + end index ) ; }


gets the width of the arguments ( where a category - 2 value counts as two )

protected final int arg width ( ) { int result = 0 ; for ( int i = 0 ; i < arg count ; i + + ) { result + = args [ i ] get type ( ) get category ( ) ; } return result ; }


tell the status of this consistency service


launch the application ' s details settings

public static void launch app details settings ( final activity activity , final int request code , final string pkg name ) { if ( activity = = null | | utils bridge is space ( pkg name ) ) return ; intent intent = utils bridge get launch app details settings intent ( pkg name , false ) ; if ( ! utils bridge is intent available ( intent ) ) return ; activity start activity for result ( intent , request code ) ; }


add the jvm system properties necessary to configure { @ link container log appender } or { @ link container rolling log appender }

public static void add log 4j system properties ( task task , list < string > vargs , configuration conf ) { string log 4j property file = conf get ( m r job config mapreduce job log4j properties file , " " ) ; if ( log 4j property file is empty ( ) ) { vargs add ( " - dlog 4j configuration = container - log 4j properties " ) ; } else { uri log 4j u r i = null ; try { log 4j u r i = new uri ( log 4j property file ) ; } catch ( u r i syntax exception e ) { throw new illegal argument exception ( e ) ; } path log 4j path = new path ( log 4j u r i ) ; vargs add ( " - dlog 4j configuration = " + log 4j path get name ( ) ) ; } long log size ; string log level ; int num backups ; if ( task = = null ) { log size = conf get long ( m r job config mr am log kb , m r job config default mr am log kb ) < < 10 ; log level = conf get ( m r job config mr am log level , m r job config default mr am log level ) ; num backups = conf get int ( m r job config mr am log backups , m r job config default mr am log backups ) ; } else { log size = task log get task log limit bytes ( conf ) ; log level = get child log level ( conf , task is map task ( ) ) ; num backups = conf get int ( m r job config task log backups , m r job config default task log backups ) ; } vargs add ( " - d " + yarn configuration yarn app container log dir + " = " + application constants log dir expansion var ) ; vargs add ( " - d " + yarn configuration yarn app container log size + " = " + log size ) ; if ( log size > 0l & & num backups > 0 ) { / / log should be rolled vargs add ( " - d " + yarn configuration yarn app container log backups + " = " + num backups ) ; vargs add ( " - dhadoop root logger = " + log level + " , crla " ) ; } else { vargs add ( " - dhadoop root logger = " + log level + " , cla " ) ; } vargs add ( " - dhadoop root logfile = " + task log log name syslog ) ; if ( task ! = null & & ! task is map task ( ) & & conf get boolean ( m r job config reduce separate shuffle log , m r job config default reduce separate shuffle log ) ) { final int num shuffle backups = conf get int ( m r job config shuffle log backups , m r job config default shuffle log backups ) ; final long shuffle log size = conf get long ( m r job config shuffle log kb , m r job config default shuffle log kb ) < < 10 ; final string shuffle logger = log level + ( shuffle log size > 0l & & num shuffle backups > 0 ? " , shuffle c r l a " : " , shuffle c l a " ) ; vargs add ( " - d " + m r job config mr prefix + " shuffle logger = " + shuffle logger ) ; vargs add ( " - d " + m r job config mr prefix + " shuffle logfile = " + task log log name syslog + " shuffle " ) ; vargs add ( " - d " + m r job config mr prefix + " shuffle log filesize = " + shuffle log size ) ; vargs add ( " - d " + m r job config mr prefix + " shuffle log backups = " + num shuffle backups ) ; } }


utility function that composes a string for logging purposes the string includes the given message and the index of the task in its task group together with the number of tasks in the task group

private string get log string ( string message , string task name ) { return batch task construct log string ( message , task name , this ) ; }


static boolean ensure principal access is allowed for service ( final service service , final registered service registered service , final string principal id , final map < string , object > attributes ) { ensure service access is allowed ( service , registered service ) ; if ( ! registered service get access strategy ( ) do principal attributes allow service access ( principal id , attributes ) ) { logger warn ( " cannot grant access to service [ { } ] ; it is not authorized for use by [ { } ] " , service ! = null ? service get id ( ) : " unknown " , principal id ) ; val handler errors = new hash map < string , throwable > ( ) ; val message = string format ( " cannot grant service access to % s " , principal id ) ; val exception = new unauthorized service for principal exception ( message , registered service , principal id , attributes ) ; handler errors put ( unauthorized service for principal exception class get simple name ( ) , exception ) ; throw new principal exception ( unauthorized service for principal exception code unauthz service , handler errors , new hash map < > ( 0 ) ) ; } return true ; }


public time value last task time ( ) throws illegal state exception { if ( this last task info = = null ) { throw new illegal state exception ( " no tests run : can ' t get last interval " ) ; } return this last task info get time ( ) ; }


public void add section ( string name , string login module name , string args ) { map < string , string > conf = new hash map < string , string > ( ) ; / / loop through the args ( must be key / value sequence ) for ( int i = 0 ; i < args length - 1 ; i + = 2 ) { conf put ( args [ i ] , args [ i + 1 ] ) ; } add section ( name , login module name , conf ) ; }


test serialization of outer boolean types

public api response < boolean > fake outer boolean serialize with http info ( boolean body ) throws api exception { okhttp 3 call local var call = fake outer boolean serialize validate before call ( body , null ) ; type local var return type = new type token < boolean > ( ) { } get type ( ) ; return local var api client execute ( local var call , local var return type ) ; }


fake endpoint for testing various parameters 가짜 엔드 포인트 fake endpoint for testing various parameters 가짜 엔드 포인트

void test endpoint parameters ( @ param ( " number " ) big decimal number , @ param ( " double " ) double double , @ param ( " pattern without delimiter " ) string pattern without delimiter , @ param ( " byte " ) byte [ ] byte , @ param ( " integer " ) integer integer , @ param ( " int 3 2 " ) integer int 3 2 , @ param ( " int 6 4 " ) long int 6 4 , @ param ( " float " ) float float , @ param ( " string " ) string string , @ param ( " binary " ) file binary , @ param ( " date " ) local date date , @ param ( " date time " ) offset date time date time , @ param ( " password " ) string password , @ param ( " param callback " ) string param callback ) ;


public static < t extends throwable > t extract cause ( class < t > expected , throwable thrown ) { throwable cause = thrown get cause ( ) ; fail if ( cause = = null , " no inner cause " , thrown ) ; fail unless ( cause get class ( ) equals ( expected ) , " inner cause is of wrong type : expected " + expected , thrown ) ; return ( t ) cause ; }


limits the value to the given min and max range

private float limit ( float value , float min , float max ) { return math min ( math max ( min , value ) , max ) ; }


public void parse qualifier element ( element ele , abstract bean definition bd ) { string type name = ele get attribute ( type attribute ) ; if ( ! string utils has length ( type name ) ) { error ( " tag ' qualifier ' must have a ' type ' attribute " , ele ) ; return ; } this parse state push ( new qualifier entry ( type name ) ) ; try { autowire candidate qualifier qualifier = new autowire candidate qualifier ( type name ) ; qualifier set source ( extract source ( ele ) ) ; string value = ele get attribute ( value attribute ) ; if ( string utils has length ( value ) ) { qualifier set attribute ( autowire candidate qualifier value key , value ) ; } node list nl = ele get child nodes ( ) ; for ( int i = 0 ; i < nl get length ( ) ; i + + ) { node node = nl item ( i ) ; if ( is candidate element ( node ) & & node name equals ( node , qualifier attribute element ) ) { element attribute ele = ( element ) node ; string attribute name = attribute ele get attribute ( key attribute ) ; string attribute value = attribute ele get attribute ( value attribute ) ; if ( string utils has length ( attribute name ) & & string utils has length ( attribute value ) ) { bean metadata attribute attribute = new bean metadata attribute ( attribute name , attribute value ) ; attribute set source ( extract source ( attribute ele ) ) ; qualifier add metadata attribute ( attribute ) ; } else { error ( " qualifier ' attribute ' tag must have a ' name ' and ' value ' " , attribute ele ) ; return ; } } } bd add qualifier ( qualifier ) ; } finally { this parse state pop ( ) ; } }


indicates whether or not this { @ link org springframework web servlet view resolver } can handle the supplied view name if not , { @ link # create view ( string , java util locale ) } will return { @ code null } the default implementation checks against the configured { @ link # set view names view names }

protected boolean can handle ( string view name , locale locale ) { string [ ] view names = get view names ( ) ; return ( view names = = null | | pattern match utils simple match ( view names , view name ) ) ; }


returns the total number of bytes in the partition of that file

public long get total disk space ( ) throws i o exception , interrupted exception { return act ( new get total disk space ( ) ) ; }


a hook for subclasses to post - process the { @ link proxy factory } before creating the proxy instance with it

protected void post process proxy factory ( proxy factory proxy factory ) { }


invert a logical right shift of { @ code n } positions , that is shift left this is different from a normal shift left , in that it inserts unknowns at the right the normal left shift inserts zeros additionally , if any ones would fall off the left , the inversion is undefined

public masked long inv shift right logical ( long n ) throws solver exception { if ( n = = 0 ) { return this ; } long check def = long min value > > ( n - 1 ) & val ; if ( check def ! = 0 ) { throw new solver exception ( " cannot invert logical right shift where ones appear on the left " ) ; } return new masked long ( msk < < n , val < < n ) ; }


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


read the next character from the serialized { @ code string value }

private static char read string char ( data input view source ) throws i o exception { int c = source read byte ( ) & 0x f f ; if ( c > = high bit ) { int shift = 7 ; int curr ; c = c & 0x 7 f ; while ( ( curr = source read byte ( ) & 0x f f ) > = high bit ) { c | = ( curr & 0x 7 f ) < < shift ; shift + = 7 ; } c | = curr < < shift ; } return ( char ) c ; }


choose a committer from the fs and task configurations task configuration takes priority , allowing execution engines to dynamically change committer on a query - by - query basis

private abstract s 3 a committer factory choose committer factory ( s 3 a file system file system , path output path , configuration task conf ) throws path commit exception { abstract s 3 a committer factory factory ; / / the fs conf will have had its per - bucket values resolved , unlike / / job / task configurations configuration fs conf = file system get conf ( ) ; string name = fs conf get trimmed ( fs s3a committer name , committer name file ) ; name = task conf get trimmed ( fs s3a committer name , name ) ; log debug ( " committer option is { } " , name ) ; switch ( name ) { case committer name file : factory = null ; break ; case committer name directory : factory = new directory staging committer factory ( ) ; break ; case committer name partitioned : factory = new partitioned staging committer factory ( ) ; break ; case committer name magic : factory = new magic s 3 guard committer factory ( ) ; break ; case internal committer constants committer name staging : factory = new staging committer factory ( ) ; break ; default : throw new path commit exception ( output path , " unknown committer : \ " " + name + " \ " " ) ; } return factory ; }


handle the error in the given response with the given resolved status code the default implementation throws : { @ link http client error exception } if the status code is in the 4xx series , or one of its sub - classes such as { @ link http client error exception bad request } and others { @ link http server error exception } if the status code is in the 5xx series , or one of its sub - classes such as { @ link http server error exception internal server error } and others { @ link unknown http status code exception } for error status codes not in the { @ link http status } enum range

public void handle error ( client http response response ) throws i o exception { http status status code = http status resolve ( response get raw status code ( ) ) ; if ( status code = = null ) { byte [ ] body = get response body ( response ) ; string message = get error message ( response get raw status code ( ) , response get status text ( ) , body , get charset ( response ) ) ; throw new unknown http status code exception ( message , response get raw status code ( ) , response get status text ( ) , response get headers ( ) , body , get charset ( response ) ) ; } handle error ( response , status code ) ; }


make sure that when the field is mapped but there aren ' t any values for it we return a properly shaped " empty " result in particular , the { @ link internal mapped significant terms # get subset size ( ) } needs to be set to the number of matching documents

public void test all docs without numeric field ( ) throws i o exception { try ( directory dir = new directory ( ) ) { try ( random index writer writer = new random index writer ( random ( ) , dir ) ) { writer add document ( new document ( ) ) ; try ( index reader reader = maybe wrap reader es ( writer get reader ( ) ) ) { index searcher searcher = new index searcher ( reader ) ; significant terms aggregation builder request = new significant terms aggregation builder ( " f " ) field ( " f " ) ; significant long terms result = search and reduce ( searcher , new match all docs query ( ) , request , long field ( " f " ) ) ; assert that ( result get subset size ( ) , equal to ( 1l ) ) ; } } } }


public response get root ( @ context final user group information ugi , @ query param ( delegation param name ) @ default value ( delegation param default ) final delegation param delegation , @ query param ( user param name ) @ default value ( user param default ) final user param username , @ query param ( do as param name ) @ default value ( do as param default ) final do as param do as user , @ query param ( get op param name ) @ default value ( get op param default ) final get op param op , @ query param ( offset param name ) @ default value ( offset param default ) final offset param offset , @ query param ( length param name ) @ default value ( length param default ) final length param length , @ query param ( renewer param name ) @ default value ( renewer param default ) final renewer param renewer , @ query param ( buffer size param name ) @ default value ( buffer size param default ) final buffer size param buffer size , @ query param ( x attr name param name ) @ default value ( x attr name param default ) final list < x attr name param > xattr names , @ query param ( x attr encoding param name ) @ default value ( x attr encoding param default ) final x attr encoding param xattr encoding , @ query param ( exclude datanodes param name ) @ default value ( exclude datanodes param default ) final exclude datanodes param exclude datanodes , @ query param ( fs action param name ) @ default value ( fs action param default ) final fs action param fs action , @ query param ( snapshot name param name ) @ default value ( snapshot name param default ) final snapshot name param snapshot name , @ query param ( old snapshot name param name ) @ default value ( old snapshot name param default ) final old snapshot name param old snapshot name , @ query param ( token kind param name ) @ default value ( token kind param default ) final token kind param token kind , @ query param ( token service param name ) @ default value ( token service param default ) final token service param token service , @ query param ( no redirect param name ) @ default value ( no redirect param default ) final no redirect param noredirect , @ query param ( start after param name ) @ default value ( start after param default ) final start after param start after ) throws i o exception , interrupted exception { return get ( ugi , delegation , username , do as user , root , op , offset , length , renewer , buffer size , xattr names , xattr encoding , exclude datanodes , fs action , snapshot name , old snapshot name , token kind , token service , noredirect , start after ) ; }


tests simple deserialization using type information

public void test type info deserialization ( ) throws exception { long id = 1238123899121l ; string name = " asdlkjasjkdla 9 9 8y 1 1 2 2 " ; byte [ ] bytes = new byte [ 1024 ] ; thread local random current ( ) next bytes ( bytes ) ; timestamp timestamp = timestamp value of ( " 1990 - 10 - 14 12 : 12 : 43 " ) ; date date = date value of ( " 1990 - 10 - 14 " ) ; time time = time value of ( " 12 : 12 : 43 " ) ; map < string , long > map = new hash map < > ( ) ; map put ( " flink " , 123l ) ; map < string , map < string , integer > > nested map = new hash map < > ( ) ; map < string , integer > inner map = new hash map < > ( ) ; inner map put ( " key " , 234 ) ; nested map put ( " inner map " , inner map ) ; object mapper object mapper = new object mapper ( ) ; / / root object node root = object mapper create object node ( ) ; root put ( " id " , id ) ; root put ( " name " , name ) ; root put ( " bytes " , bytes ) ; root put ( " date 1 " , " 1990 - 10 - 14 " ) ; root put ( " date 2 " , " 1990 - 10 - 14 " ) ; root put ( " time 1 " , " 12 : 12 : 43z " ) ; root put ( " time 2 " , " 12 : 12 : 43z " ) ; root put ( " timestamp 1 " , " 1990 - 10 - 14t12 : 12 : 43z " ) ; root put ( " timestamp 2 " , " 1990 - 10 - 14t12 : 12 : 43z " ) ; root put object ( " map " ) put ( " flink " , 123 ) ; root put object ( " map 2map " ) put object ( " inner map " ) put ( " key " , 234 ) ; byte [ ] serialized json = object mapper write value as bytes ( root ) ; json row deserialization schema deserialization schema = new json row deserialization schema builder ( types row named ( new string [ ] { " id " , " name " , " bytes " , " date 1 " , " date 2 " , " time 1 " , " time 2 " , " timestamp 1 " , " timestamp 2 " , " map " , " map 2map " } , types long , types string , types primitive array ( types byte ) , types sql date , types local date , types sql time , types local time , types sql timestamp , types local date time , types map ( types string , types long ) , types map ( types string , types map ( types string , types int ) ) ) ) build ( ) ; row row = new row ( 11 ) ; row set field ( 0 , id ) ; row set field ( 1 , name ) ; row set field ( 2 , bytes ) ; row set field ( 3 , date ) ; row set field ( 4 , date to local date ( ) ) ; row set field ( 5 , time ) ; row set field ( 6 , time to local time ( ) ) ; row set field ( 7 , timestamp ) ; row set field ( 8 , timestamp to local date time ( ) ) ; row set field ( 9 , map ) ; row set field ( 10 , nested map ) ; assert that ( serialized json , when deserialized with ( deserialization schema ) equals to ( row ) ) ; }


returns true if the input contains a proj box indicates mp4 container

private static boolean is proj ( parsable byte array input ) { input skip bytes ( 4 ) ; / / size int type = input read int ( ) ; input set position ( 0 ) ; return type = = type proj ; }


in aspect j semantics , after throwing advice that specifies a throwing clause is only invoked if the thrown exception is a subtype of the given throwing type

private boolean should invoke on throwing ( throwable ex ) { return get discovered throwing type ( ) is assignable from ( ex get class ( ) ) ; }


upgrades a connection with transport encryption by the specified symmetric cipher

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


creates an action to refresh the extensions list

private void create refresh action ( extension table panel table panel , extension details panel details panel ) { string group ; icon refresh icon = icons refresh icon ; docking action refresh action = new docking action ( " extension tools " , " refresh extensions " ) { @ override public void action performed ( action context context ) { table panel refresh table ( ) ; } } ; group = " extension tools " ; refresh action set menu bar data ( new menu data ( new string [ ] { " refresh " } , refresh icon , group ) ) ; refresh action set tool bar data ( new tool bar data ( refresh icon , group ) ) ; refresh action set help location ( new help location ( generic help topics front end , " extension tools " ) ) ; refresh action set description ( " refresh extension list " ) ; add action ( refresh action ) ; }


returns the cache span corresponding to the provided key and range see { @ link cache # start read write ( string , long , long ) } for detailed descriptions of the returned spans

private simple cache span get span ( string key , long position , long length ) { @ nullable cached content cached content = content index get ( key ) ; if ( cached content = = null ) { return simple cache span create hole ( key , position , length ) ; } while ( true ) { simple cache span span = cached content get span ( position , length ) ; if ( span is cached & & span file length ( ) ! = span length ) { / / the file has been modified or deleted underneath us it ' s likely that other files will / / have been modified too , so scan the whole in - memory representation remove stale spans ( ) ; continue ; } return span ; } }


this schema never considers an element to signal end - of - stream , so this method returns always false

public boolean is end of stream ( t next element ) { return false ; }


process a data reference for possible indirect sources update block reference queue with indirect block references

private static int follow indirection ( linked list < code block reference impl > block ref queue , code block dest block , reference dest ref , task monitor monitor ) throws cancelled exception { simple block model model = ( simple block model ) dest block get model ( ) ; address addr = dest ref get from address ( ) ; listing listing = model get listing ( ) ; data data = listing get defined data containing ( addr ) ; if ( data = = null ) return 0 ; int cnt = 0 ; / / ? ? handle special cases - offset is 0 within array of pointers , or offset to pointer within array of structures int offset = ( int ) addr subtract ( data get min address ( ) ) ; data primitive = data get primitive at ( offset ) ; if ( primitive ! = null ) { / / follow references to pointer - could have multiple references reference iterator iter = primitive get reference iterator to ( ) ; while ( iter has next ( ) ) { reference ref = iter next ( ) ; if ( monitor is cancelled ( ) ) throw new cancelled exception ( ) ; ref type rt = ref get reference type ( ) ; if ( rt ! = ref type indirection & & rt ! = ref type read ) continue ; address from addr = ref get from address ( ) ; instruction instr = listing get instruction at ( from addr ) ; if ( instr = = null ) continue ; if ( rt = = ref type read & & ! instr get flow type ( ) is computed ( ) ) continue ; queue dest reference ( block ref queue , dest block , dest ref get to address ( ) , from addr , instr get flow type ( ) is call ( ) ? ref type computed call : ref type computed jump , monitor ) ; + + cnt ; } } return cnt ; }


returns the closure over the input files of an action

public set < artifact > input closure of ( action analysis metadata action ) { return artifact closure of ( action get inputs ( ) to list ( ) ) ; }


returns the index of the ad group at or before { @ code position us } , if that ad group is unplayed returns { @ link c # index unset } if the ad group at or before { @ code position us } has no ads remaining to be played , or if there is no such ad group

public int get ad group index for position us ( long position us , long period duration us ) { / / use a linear search as the array elements may not be increasing due to time end of source / / in practice we expect there to be few ad groups so the search shouldn ' t be expensive int index = ad group times us length - 1 ; while ( index > = 0 & & is position before ad group ( position us , period duration us , index ) ) { index - - ; } return index > = 0 & & ad groups [ index ] has unplayed ads ( ) ? index : c index unset ; }


the job has completed , so do works in commit job internal ( ) could retry on failure if using algorithm 2

public void commit job ( job context context ) throws i o exception { int max attempts on failure = is commit job repeatable ( context ) ? context get configuration ( ) get int ( fileoutputcommitter failure attempts , fileoutputcommitter failure attempts default ) : 1 ; int attempt = 0 ; boolean job commit not finished = true ; while ( job commit not finished ) { try { commit job internal ( context ) ; job commit not finished = false ; } catch ( exception e ) { if ( + + attempt > = max attempts on failure ) { throw e ; } else { log warn ( " exception get thrown in job commit , retry ( " + attempt + " ) time " , e ) ; } } } }


copy into the dest map all the source entries the destination is cleared first

private static < e > map < string , e > copy map ( map < string , e > dest , map < string , e > source , function < e , e > copy fn ) { / / we have to clone the values so that they aren ' t / / bound to the original values dest clear ( ) ; source entry set ( ) for each ( entry - > dest put ( entry get key ( ) , copy fn apply ( entry get value ( ) ) ) ) ; return dest ; }


create a kafka topic with the given parameters

public void create topic ( final string topic , final int partitions , final int replication ) { create topic ( topic , partitions , replication , collections empty map ( ) ) ; }


realm settings were changed in 7 0 this method validates that the settings in use on this node match the new style of setting in 6 x a realm config would be xpack security authc realms file 1 type : file xpack security authc realms file 1 order : 0 in 7 x this realm should be xpack security authc realms file file 1 order : 0 if confronted with an old style config , the es settings validation would simply fail with an error such as unknown setting [ xpack security authc realms file 1 order ] this validation method provides an error that is easier to understand and take action on

static void validate realm settings ( settings settings ) { final set < string > bad realm settings = settings key set ( ) stream ( ) filter ( k - > k starts with ( realm settings prefix ) ) filter ( key - > { final string suffix = key substring ( realm settings prefix length ( ) ) ; / / suffix - part , only contains a single ' ' return suffix index of ( ' ' ) = = suffix last index of ( ' ' ) ; } ) collect ( collectors to set ( ) ) ; if ( bad realm settings is empty ( ) = = false ) { string sample realm setting = realm settings realm setting prefix ( new realm config realm identifier ( " file " , " my file " ) ) + " order " ; throw new illegal argument exception ( " incorrect realm settings found " + " realm settings have been changed to include the type as part of the setting key \ n " + " for example ' " + sample realm setting + " ' \ n " + " found invalid config : " + strings collection to delimited string ( bad realm settings , " , " ) + " \ n " + " please see the breaking changes documentation " ) ; } }


clears the set and reduces the size of the backing arrays to be the specified capacity load factor , if they are larger

public void clear ( int maximum capacity ) { int table size = table size ( maximum capacity , load factor ) ; if ( key table length < = table size ) { clear ( ) ; return ; } size = 0 ; has zero value = false ; resize ( table size ) ; }


creates cluster state with the given indices , each index containing # ( number of primaries ) started primary shards and no replicas the cluster state contains # ( number of nodes ) nodes and assigns primaries to those nodes

public static cluster state state ( final int number of nodes , final string [ ] indices , final int number of primaries ) { discovery nodes builder disco builder = discovery nodes builder ( ) ; set < string > nodes = new hash set < > ( ) ; for ( int i = 0 ; i < number of nodes ; i + + ) { final discovery node node = new node ( i ) ; disco builder = disco builder add ( node ) ; nodes add ( node get id ( ) ) ; } disco builder local node id ( new node ( 0 ) get id ( ) ) ; disco builder master node id ( new node ( 0 ) get id ( ) ) ; metadata builder metadata = metadata builder ( ) ; routing table builder routing table = routing table builder ( ) ; list < string > nodes list = new array list < > ( nodes ) ; int current node to assign = 0 ; for ( string index : indices ) { index metadata index metadata = index metadata builder ( index ) settings ( settings builder ( ) put ( setting version created , version current ) put ( setting number of shards , number of primaries ) put ( setting number of replicas , 0 ) put ( setting creation date , system current time millis ( ) ) ) build ( ) ; index routing table builder index routing table = index routing table builder ( index metadata get index ( ) ) ; for ( int i = 0 ; i < number of primaries ; i + + ) { shard id shard id = new shard id ( index metadata get index ( ) , i ) ; index shard routing table builder index shard routing builder = new index shard routing table builder ( shard id ) ; index shard routing builder add shard ( test shard routing new shard routing ( shard id , nodes list get ( current node to assign + + ) , true , shard routing state started ) ) ; if ( current node to assign = = nodes list size ( ) ) { current node to assign = 0 ; } index routing table add index shard ( index shard routing builder build ( ) ) ; } metadata put ( index metadata , false ) ; routing table add ( index routing table ) ; } cluster state builder state = cluster state builder ( new cluster name ( " test " ) ) ; state nodes ( disco builder ) ; state metadata ( metadata generate cluster uuid if needed ( ) build ( ) ) ; state routing table ( routing table build ( ) ) ; return state build ( ) ; }


returns current time absolute reference is not important as only time deltas are used extracting this to a separate method allows better testing

protected long get current time ms ( ) { return system clock uptime millis ( ) ; }


this method retrieves all the app reports in the cluster , and it is reachable by using { @ link r m w s consts # apps }

apps info get apps ( http servlet request hsr , string state query , set < string > states query , string final status query , string user query , string queue query , string count , string started begin , string started end , string finish begin , string finish end , set < string > application types , set < string > application tags , string name , set < string > unselected fields ) ;


returns a { @ code char } matcher functionally equivalent to this one , but which may be faster to query than the original ; your mileage may vary precomputation takes time and is likely to be worthwhile only if the precomputed matcher is queried many thousands of times this method has no effect ( returns { @ code this } ) when called in gwt : it ' s unclear whether a precomputed matcher is faster , but it certainly consumes more memory , which doesn ' t seem like a worthwhile tradeoff in a browser

public char matcher precomputed ( ) { return platform precompute char matcher ( this ) ; }


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

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


{ @ link com alibaba nacos core code spring application run listener # failed }

void failed ( configurable application context context , throwable exception ) ;


ignore { @ code method } in the tests that follow returns this object

public null pointer tester ignore ( method method ) { ignored members add ( check not null ( method ) ) ; return this ; }


check to see if this die has any child die ' s

public boolean has children ( ) { return ! this children is empty ( ) ; }


test that creating proxy doesn ' t ever try to dns - resolve the logical uri regression test for hdfs - 9364

public void test create proxy doesnt dns resolve logical u r i ( ) throws i o exception { final name service spy n s = spy on name service ( ) ; final configuration conf = new hdfs configuration ( ) ; final string service = " nameservice 1 " ; final string namenode = " namenode 1 1 3 " ; conf set ( d f s config keys dfs nameservices , service ) ; conf set ( file system fs default name key , " hdfs : / / " + service ) ; conf set ( hdfs client config keys failover proxy provider key prefix + " " + service , " org apache hadoop hdfs server namenode ha " + " configured failover proxy provider " ) ; conf set ( d f s config keys dfs ha namenodes key prefix + " " + service , namenode ) ; conf set ( d f s config keys dfs namenode rpc address key + " " + service + " " + namenode , " localhost : 8020 " ) ; / / call create proxy implicitly and explicitly path p = new path ( " / " ) ; p get file system ( conf ) ; name node proxies client create proxy with client protocol ( conf , file system get default uri ( conf ) , null ) ; name node proxies create proxy ( conf , file system get default uri ( conf ) , namenode protocol class , null ) ; / / ensure that the logical hostname was never resolved mockito verify ( spy n s , mockito never ( ) ) lookup all host addr ( mockito eq ( service ) ) ; }


get the default file extension for the given image format

public string get file extension ( ) { return m file extension ; }


return topic configs in the request , not including broker defaults broker configs are passed via the { @ code configure ( ) } method of the policy implementation

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


test a point for containment in this fixture

public boolean test point ( float x , float y ) { tmp set ( x , y ) ; return fixture test point ( tmp ) ; }


gets the value from an entry returns { @ code null } if the entry is invalid , partially - collected or computing

v get live value ( e entry ) { if ( entry get key ( ) = = null ) { return null ; } return entry get value ( ) ; }


whether or not to enable layout tree diffing this will reduce the cost of updates at the expense of using extra memory true by default we will remove this option soon , please consider turning it on ( which is on by default )

public builder layout diffing ( boolean enabled ) { is layout diffing enabled = enabled ; return this ; }


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


uploads a byte array to a server which cannot move incoming files to the final blob store via the { @ link blob server } file transfers should fail

private void test put buffer fails store ( @ nullable final job i d job id , blob key blob type blob type ) throws i o exception { assume true ( ! operating system is windows ( ) ) ; / / set writable doesn ' t work on windows final configuration config = new configuration ( ) ; config set string ( blob server options storage directory , temporary folder new folder ( ) get absolute path ( ) ) ; file job store dir = null ; try ( blob server server = new blob server ( config , new void blob store ( ) ) ) { server start ( ) ; / / make sure the blob server cannot create any files in its storage dir job store dir = server get storage location ( job id , blob key create key ( blob type ) ) get parent file ( ) ; assert true ( job store dir set executable ( true , false ) ) ; assert true ( job store dir set readable ( true , false ) ) ; assert true ( job store dir set writable ( false , false ) ) ; byte [ ] data = new byte [ 2000000 ] ; rnd next bytes ( data ) ; / / upload the file to the server directly exception expect ( access denied exception class ) ; try { put ( server , job id , data , blob type ) ; } finally { / / there should be no remaining incoming files file incoming file dir = new file ( job store dir get parent ( ) , " incoming " ) ; assert array equals ( new string [ ] { } , incoming file dir list ( ) ) ; / / there should be no files in the job directory assert array equals ( new string [ ] { } , job store dir list ( ) ) ; } } finally { / / set writable again to make sure we can remove the directory if ( job store dir ! = null ) { / / noinspection result of method call ignored job store dir set writable ( true , false ) ; } } }


public tree map < string , object > get values ( ) { int dw index , result ; char [ ] lp value name ; byte [ ] lp data ; int by reference lpcch value name , lp type , lpcb data ; string name ; tree map < string , object > values = new tree map < > ( string case insensitive order ) ; lp value name = new char [ 16384 ] ; lpcch value name = new int by reference ( 16384 ) ; lp type = new int by reference ( ) ; lp data = new byte [ 1 ] ; lpcb data = new int by reference ( ) ; lpcb data set value ( 0 ) ; dw index = 0 ; outer : while ( true ) { result = advapi 3 2 instance reg enum value ( handle , dw index , lp value name , lpcch value name , null , lp type , lp data , lpcb data ) ; switch ( result ) { case winerror error no more items : return values ; case winerror error more data : lp data = new byte [ lpcb data get value ( ) ] ; lpcch value name = new int by reference ( 16384 ) ; continue outer ; case winerror error success : name = new string ( lp value name , 0 , lpcch value name get value ( ) ) ; switch ( lp type get value ( ) ) { case winnt reg sz : values put ( name , convert buffer to string ( lp data ) ) ; break ; case winnt reg dword : values put ( name , convert buffer to int ( lp data ) ) ; break ; default : break ; / / not supported yet } break ; default : check ( result ) ; } dw index + + ; lpcb data set value ( 0 ) ; } }


deletes the file denoted by this path , not following symbolic links returns normally iff the file doesn ' t exist after the call : true if this call deleted the file , false if the file already didn ' t exist throws an exception if the file could not be deleted but was present prior to this call

public boolean delete ( ) throws i o exception { return file system delete ( this ) ; }


returns an unmodifiable copy of the map of test results

public map < artifact , test result > get status map for testing ( ) { map < artifact , test result > result = new hash map < > ( ) ; for ( test result aggregator aggregator : aggregators values ( ) ) { result put all ( aggregator get status map for testing ( ) ) ; } return result ; }


request http post method with large body

public static rest result < string > http post large ( string url , map < string , string > headers , string content ) { header header = header new instance ( ) ; if ( map utils is not empty ( headers ) ) { header add all ( headers ) ; } auth header util add identity to header ( header ) ; try { return apache sync nacos rest template post json ( url , header , content , string class ) ; } catch ( exception e ) { return rest result < string > builder ( ) with code ( 500 ) with msg ( e to string ( ) ) build ( ) ; } }


append to an existing file the method returns the last block of the file if this is a partial block , which can still be used for writing more data the client uses the returned block locations to form the data pipeline for this block < br > the { @ link located block } will be null if the last block is full the client then allocates a new block with the next call using { @ link org apache hadoop hdfs protocol client protocol # add block } for description of parameters and exceptions thrown see { @ link org apache hadoop hdfs protocol client protocol # append }

static last block with status append file ( final f s namesystem fsn , final string src arg , final f s permission checker pc , final string holder , final string client machine , final boolean new block , final boolean log retry cache ) throws i o exception { assert fsn has write lock ( ) ; final located block lb ; final f s directory fsd = fsn get f s directory ( ) ; final i nodes in path iip ; fsd write lock ( ) ; try { iip = fsd resolve path ( pc , src arg , dir op write ) ; / / verify that the destination does not exist as a directory already final i node inode = iip get last i node ( ) ; final string path = iip get path ( ) ; if ( inode ! = null & & inode is directory ( ) ) { throw new file already exists exception ( " cannot append to directory " + path + " ; already exists as a directory " ) ; } if ( fsd is permission enabled ( ) ) { fsd check path access ( pc , iip , fs action write ) ; } if ( inode = = null ) { throw new file not found exception ( " failed to append to non - existent file " + path + " for client " + client machine ) ; } final i node file file = i node file value of ( inode , path , true ) ; if ( file is striped ( ) & & ! new block ) { throw new unsupported operation exception ( " append on ec file without new block is not supported use " + create flag new block + " create flag while appending file " ) ; } block manager block manager = fsd get block manager ( ) ; final block storage policy lp policy = block manager get storage policy ( " lazy persist " ) ; if ( lp policy ! = null & & lp policy get id ( ) = = file get storage policy i d ( ) ) { throw new unsupported operation exception ( " cannot append to lazy persist file " + path ) ; } / / opening an existing file for append - may need to recover lease fsn recover lease internal ( recover lease op append file , iip , path , holder , client machine , false ) ; final block info last block = file get last block ( ) ; / / check that the block has at least minimum replication if ( last block ! = null ) { if ( last block get block u c state ( ) = = block u c state committed ) { throw new retriable exception ( new not replicated yet exception ( " append : last block = " + last block + " of src = " + path + " is committed but not yet complete " ) ) ; } else if ( last block is complete ( ) & & ! block manager is sufficiently replicated ( last block ) ) { throw new i o exception ( " append : last block = " + last block + " of src = " + path + " is not sufficiently replicated yet " ) ; } } lb = prepare file for append ( fsn , iip , holder , client machine , new block , true , log retry cache ) ; } catch ( i o exception ie ) { name node state change log warn ( " dir * name system append : " + ie get message ( ) ) ; throw ie ; } finally { fsd write unlock ( ) ; } hdfs file status stat = f s dir stat and listing op get file info ( fsd , iip , false , false ) ; if ( lb ! = null ) { name node state change log debug ( " dir * name system append file : file { } for { } at { } block { } block " + " size { } " , src arg , holder , client machine , lb get block ( ) , lb get block ( ) get num bytes ( ) ) ; } return new last block with status ( lb , stat ) ; }


register a listener that will be called when this model visibility state 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 test many types view model on visibility state changed ( on model visibility state changed listener < test many types view model , test many types view > listener ) { on mutation ( ) ; this on model visibility state changed listener epoxy generated model = listener ; return this ; }


this function restores the server database after reading from the snapshots and transaction logs

public long restore ( data tree dt , map < long , integer > sessions , play back listener listener ) throws i o exception { long snap loading start time = time current elapsed time ( ) ; long deserialize result = snap log deserialize ( dt , sessions ) ; server metrics get metrics ( ) startup snap load time add ( time current elapsed time ( ) - snap loading start time ) ; file txn log txn log = new file txn log ( data dir ) ; boolean trust empty d b ; file init file = new file ( data dir get parent ( ) , " initialize " ) ; if ( files delete if exists ( init file to path ( ) ) ) { log info ( " initialize file found , an empty database will not block voting participation " ) ; trust empty d b = true ; } else { trust empty d b = auto create d b ; } restore finalizer finalizer = ( ) - > { long highest zxid = fast forward from edits ( dt , sessions , listener ) ; / / the snapshot zxid digest will reset after replaying the txn of the / / zxid in the snapshot zxid digest , if it ' s not reset to null after / / restoring , it means either there are not enough txns to cover that / / zxid or that txn is missing data tree zxid digest snapshot zxid digest = dt get digest from loaded snapshot ( ) ; if ( snapshot zxid digest ! = null ) { log warn ( " highest txn zxid 0x { } is not covering the snapshot digest zxid 0x { } , " + " which might lead to inconsistent state " , long to hex string ( highest zxid ) , long to hex string ( snapshot zxid digest get zxid ( ) ) ) ; } return highest zxid ; } ; if ( - 1l = = deserialize result ) { / * this means that we couldn ' t find any snapshot , so we need to * initialize an empty database ( reported in zookeeper - 2325 ) * / if ( txn log get last logged zxid ( ) ! = - 1 ) { / / zookeeper - 3056 : provides an escape hatch for users upgrading / / from old versions of zookeeper ( 3 4 x , pre 3 5 3 ) if ( ! trust empty snapshot ) { throw new i o exception ( empty snapshot warning + " something is broken ! " ) ; } else { log warn ( " { } this should only be allowed during upgrading " , empty snapshot warning ) ; return finalizer run ( ) ; } } if ( trust empty d b ) { / * todo : ( br 3 3d ) we should either put a concurrent hash map on restore ( ) * or use map on save ( ) * / save ( dt , ( concurrent hash map < long , integer > ) sessions , false ) ; / * return a zxid of 0 , since we know the database is empty * / return 0l ; } else { / * return a zxid of - 1 , since we are possibly missing data * / log warn ( " unexpected empty data tree , setting zxid to - 1 " ) ; dt last processed zxid = - 1l ; return - 1l ; } } return finalizer run ( ) ; }


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

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


public boolean match ( string value ) { return expression = = null | | expression matcher ( value ) matches ( ) ; }


snapshots the timers ( both processing and event time ones ) for a given { @ code key group idx }

public internal timers snapshot < k , n > snapshot timers for key group ( int key group idx ) { return new internal timers snapshot < > ( key serializer , namespace serializer , event time timers queue get subset for key group ( key group idx ) , processing time timers queue get subset for key group ( key group idx ) ) ; }


set the maximum allowed size ( in bytes ) before uploads are written to disk uploaded files will still be received past this amount , but they will not be stored in memory default is 10240 , according to commons file upload

public void set max in memory size ( int max in memory size ) { this file item factory set size threshold ( max in memory size ) ; }


check if this packet is the last packet in block

boolean is last packet in block ( ) { return last packet in block ; }


gets the { @ link user code class loader } to load classes that are not in system ' s classpath , but are part of the jar file of a user job

user code class loader get user code class loader ( ) ;


optional , lookup related options { @ link jdbc lookup options } only be used for { @ link lookupable table source }

public builder set lookup options ( jdbc lookup options lookup options ) { this lookup options = lookup options ; return this ; }


set the routing values to control the shards that the search will be executed on

public void set routings ( string routings ) { this search request routing ( routings ) ; }


return all values for the given header as a list of value objects

public list < object > get header values ( string name ) { header value holder header = this headers get ( name ) ; if ( header ! = null ) { return header get values ( ) ; } else { return collections empty list ( ) ; } }


retrieves the data contained in the regular files named by { @ code keys } in the directory given by { @ code path } non - regular files ( such as directories ) in the given directory are silently ignored

public config data get ( string path , set < string > keys ) { return get ( path , pathname - > files is regular file ( pathname ) & & keys contains ( pathname get file name ( ) to string ( ) ) ) ; }


execute the script for the provided { @ code doc id }

public final list < string > results for doc ( int doc id ) { results clear ( ) ; chars = 0 ; set document ( doc id ) ; execute ( ) ; return results ; }


asserts that { @ code transformation } is vertical with the given value of { @ code x } includes assertions about all the public instance methods of { @ link linear transformation } , including assertions that { @ link linear transformation # slope } and { @ link linear transformation # transform } throw as expected

static void assert vertical linear transformation ( linear transformation transformation , double x ) { assert that ( transformation is horizontal ( ) ) is false ( ) ; assert that ( transformation is vertical ( ) ) is true ( ) ; assert that ( transformation inverse ( ) is horizontal ( ) ) is true ( ) ; assert that ( transformation inverse ( ) is vertical ( ) ) is false ( ) ; try { transformation transform ( 0 0 ) ; fail ( " expected illegal state exception " ) ; } catch ( illegal state exception expected ) { } assert that ( transformation inverse ( ) transform ( - 1 0 ) ) is within ( allowed error ) of ( x ) ; assert that ( transformation inverse ( ) transform ( 1 0 ) ) is within ( allowed error ) of ( x ) ; try { transformation slope ( ) ; fail ( " expected illegal state exception " ) ; } catch ( illegal state exception expected ) { } assert that ( transformation inverse ( ) slope ( ) ) is within ( allowed error ) of ( 0 0 ) ; assert that ( transformation inverse ( ) ) is same instance as ( transformation inverse ( ) ) ; assert that ( transformation inverse ( ) inverse ( ) ) is same instance as ( transformation ) ; }


execute the request specified in the given { @ link request entity } and return the response as { @ link response entity } typically used in combination with the static builder methods on { @ code request entity } , for instance : < pre class = " code " > my request body = request entity request = request entity post ( new uri ( & quot ; https : example comfoo & quot ; ) ) accept ( media type application json ) body ( body ) ; response entity & lt ; my response & gt ; response = template exchange ( request , my response class ) ;

< t > response entity < t > exchange ( request entity < ? > request entity , class < t > response type ) throws rest client exception ;


adds arguments to the list of arguments to pass to the command the first argument is expected to be the binary to execute the subsequent arguments are the arguments passed to the binary

builder add arguments ( list < string > args ) { this args add all ( args ) ; return this ; }


set the clip children properties to all views in the same tree branch from the given one , up to the top litho view todo ( 17934271 ) : handle the case where two + animations with different lifespans share the same parent , in which case we shouldn ' t unset clipping until the last item is done animating

private void recursively set child clipping ( object mount content , boolean clip children ) { if ( ! ( mount content instanceof view ) ) { return ; } recursively set child clipping for view ( ( view ) mount content , clip children ) ; }


creates a new { @ link resource leak tracker } which is expected to be closed via { @ link resource leak tracker # close ( object ) } when the related resource is deallocated

public final resource leak tracker < t > track ( t obj ) { return track 0 ( obj ) ; }


returns an { @ link annotation } object reflecting the annotation provided , or null if this class doesn ' t have such an annotation this is a convenience function if the caller knows already which annotation type he ' s looking for

static public annotation get annotation ( class c , class < ? extends java lang annotation annotation > annotation type ) { java lang annotation annotation annotation = c get annotation ( annotation type ) ; if ( annotation ! = null ) return new annotation ( annotation ) ; return null ; }


constructs a { @ link build language options } object with random fields must access { @ code rand } using the same sequence of operations ( for the same fields ) as { @ link # build random semantics }

private static build language options build random options ( random rand ) throws exception { return parse options ( / / < = = add new options here in alphabetic order = = > " - - experimental disable external package = " + rand next boolean ( ) , " - - experimental sibling repository layout = " + rand next boolean ( ) , " - - experimental builtins bzl path = " + rand next double ( ) , " - - experimental builtins dummy = " + rand next boolean ( ) , " - - experimental cc skylark api enabled packages = " + rand next double ( ) + " , " + rand next double ( ) , " - - experimental enable android migration apis = " + rand next boolean ( ) , " - - experimental google legacy api = " + rand next boolean ( ) , " - - experimental ninja actions = " + rand next boolean ( ) , " - - experimental platforms api = " + rand next boolean ( ) , " - - experimental starlark config transitions = " + rand next boolean ( ) , " - - incompatible allow tags propagation = " + rand next boolean ( ) , / / flag , java names differ " - - experimental cc shared library = " + rand next boolean ( ) , " - - experimental repo remote exec = " + rand next boolean ( ) , " - - experimental exec groups = " + rand next boolean ( ) , " - - incompatible always check depset elements = " + rand next boolean ( ) , " - - incompatible applicable licenses = " + rand next boolean ( ) , " - - incompatible depset for libraries to link getter = " + rand next boolean ( ) , " - - incompatible disable target provider fields = " + rand next boolean ( ) , " - - incompatible disable depset items = " + rand next boolean ( ) , " - - incompatible disable third party license checking = " + rand next boolean ( ) , " - - incompatible disallow empty glob = " + rand next boolean ( ) , " - - incompatible disallow struct provider syntax = " + rand next boolean ( ) , " - - incompatible do not split linking cmdline = " + rand next boolean ( ) , " - - incompatible java common parameters = " + rand next boolean ( ) , " - - incompatible linkopts to linklibs = " + rand next boolean ( ) , " - - incompatible new actions api = " + rand next boolean ( ) , " - - incompatible no attr license = " + rand next boolean ( ) , " - - incompatible no implicit file export = " + rand next boolean ( ) , " - - incompatible no rule outputs param = " + rand next boolean ( ) , " - - incompatible run shell command string = " + rand next boolean ( ) , " - - incompatible struct has no methods = " + rand next boolean ( ) , " - - incompatible visibility private attributes at definition = " + rand next boolean ( ) , " - - incompatible require linker input cc api = " + rand next boolean ( ) , " - - incompatible restrict string escapes = " + rand next boolean ( ) , " - - incompatible use cc configure from rules cc = " + rand next boolean ( ) , " - - internal starlark flag test canary = " + rand next boolean ( ) , " - - max computation steps = " + rand next long ( ) ) ; }


returns a string containing the string representation of each of { @ code parts } , using the previously configured separator between each

public final string join ( iterable < ? > parts ) { return join ( parts iterator ( ) ) ; }


constructs a definition for the attribute used to restrict access to feature flags the allowlist will only be reached if the feature flags attribute is explicitly set

public static attribute builder < label > get allowlist attribute ( rule definition environment env ) { return config feature flag get allowlist attribute ( env , feature flag attr ) ; }


select the accept header ' s value from the given accepts array : if json exists in the given array , use it ; otherwise use all of them ( joining into a string )

public list < media type > select header accept ( string [ ] accepts ) { if ( accepts length = = 0 ) { return null ; } for ( string accept : accepts ) { media type media type = media type parse media type ( accept ) ; if ( is json mime ( media type ) ) { return collections singleton list ( media type ) ; } } return media type parse media types ( string utils array to comma delimited string ( accepts ) ) ; }


returns tcp user timeout channel option for epoll channel if epoll is available , otherwise null

static channel option < integer > maybe get tcp user timeout option ( ) { return get epoll channel option ( " tcp user timeout " ) ; }


public int get stream port ( ) { return base port + stream port ; }


public restore snapshot request source ( map < string , object > source ) { for ( map entry < string , object > entry : source entry set ( ) ) { string name = entry get key ( ) ; if ( name equals ( " indices " ) ) { if ( entry get value ( ) instanceof string ) { indices ( strings split string by comma to array ( ( string ) entry get value ( ) ) ) ; } else if ( entry get value ( ) instanceof array list ) { indices ( ( array list < string > ) entry get value ( ) ) ; } else { throw new illegal argument exception ( " malformed indices section , should be an array of strings " ) ; } } else if ( name equals ( " partial " ) ) { partial ( node boolean value ( entry get value ( ) , " partial " ) ) ; } else if ( name equals ( " include global state " ) ) { include global state = node boolean value ( entry get value ( ) , " include global state " ) ; } else if ( name equals ( " include aliases " ) ) { include aliases = node boolean value ( entry get value ( ) , " include aliases " ) ; } else if ( name equals ( " rename pattern " ) ) { if ( entry get value ( ) instanceof string ) { rename pattern ( ( string ) entry get value ( ) ) ; } else { throw new illegal argument exception ( " malformed rename pattern " ) ; } } else if ( name equals ( " rename replacement " ) ) { if ( entry get value ( ) instanceof string ) { rename replacement ( ( string ) entry get value ( ) ) ; } else { throw new illegal argument exception ( " malformed rename replacement " ) ; } } else if ( name equals ( " index settings " ) ) { if ( ! ( entry get value ( ) instanceof map ) ) { throw new illegal argument exception ( " malformed index settings section " ) ; } index settings ( ( map < string , object > ) entry get value ( ) ) ; } else if ( name equals ( " ignore index settings " ) ) { if ( entry get value ( ) instanceof string ) { ignore index settings ( strings split string by comma to array ( ( string ) entry get value ( ) ) ) ; } else if ( entry get value ( ) instanceof list ) { ignore index settings ( ( list < string > ) entry get value ( ) ) ; } else { throw new illegal argument exception ( " malformed ignore index settings section , should be an array of strings " ) ; } } else { if ( indices options is indices options ( name ) = = false ) { throw new illegal argument exception ( " unknown parameter " + name ) ; } } } indices options ( indices options from map ( source , indices options ) ) ; return this ; }


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

public void find pets by tags test ( ) { list < string > tags = null ; / / list < pet > response = api find pets by tags ( tags ) ; / / todo : test validations }


test that the { @ link breakable state change listener } is picking up the state changes and that its last event field is as expected

public void test event history ( ) { register ( ) ; breakable service service = new breakable service ( ) ; assert listener state ( listener , service state notinited ) ; assert equals ( 0 , listener get event count ( ) ) ; service init ( new configuration ( ) ) ; assert listener state ( listener , service state inited ) ; assert same ( service , listener get last service ( ) ) ; assert listener event count ( listener , 1 ) ; service start ( ) ; assert listener state ( listener , service state started ) ; assert listener event count ( listener , 2 ) ; service stop ( ) ; assert listener state ( listener , service state stopped ) ; assert listener event count ( listener , 3 ) ; }


check if a byte array contains valid utf - 8

public static void validate u t f 8 ( byte [ ] utf 8 ) throws malformed input exception { validate u t f 8 ( utf 8 , 0 , utf 8 length ) ; }


returns an instance which creates synchronous observables that do not operate on any scheduler by default

public static rx java call adapter factory create ( ) { return new rx java call adapter factory ( null , false ) ; }


provide a custom { @ link validator } this is delegated to { @ link standalone mock mvc builder # set validator ( validator ) }

controller spec validator ( validator validator ) ;


public int get int ( big integer index ) throws byte block access exception { address addr = get address ( index ) ; try { return memory get int ( addr , big endian ) ; } catch ( memory access exception e ) { throw new byte block access exception ( e get message ( ) ) ; } }


collapse all descendants starting at node

private void collapse node ( program node node ) { int nchild = node get child count ( ) ; for ( int i = 0 ; i < nchild ; i + + ) { program node child = ( program node ) node get child at ( i ) ; if ( child equals ( node ) | | child is leaf ( ) ) { continue ; } collapse node ( child ) ; } tree collapse path ( node get tree path ( ) ) ; }


a shortcut for decoding the raw content of the message to text with the given character encoding this is useful for text web socket messages , or otherwise when the payload is expected to contain text

public string get payload as text ( charset charset ) { return this payload to string ( charset ) ; }


to test special tags to test special tags and operation id starting with number < b > 200 < b > - successful operation

public client call 1 2 3test special tags ( client body ) throws rest client exception { return call 1 2 3test special tags with http info ( body ) get body ( ) ; }


convert this { @ link status } to a { @ link runtime exception } use { @ link # from throwable } to recover this { @ link status } instance when the returned exception is in the causal chain

public status runtime exception as runtime exception ( ) { return new status runtime exception ( this ) ; }


public string url ( string parts ) { return ujoin ( context ( ) prefix , parts ) ; }


add a long value at the specified address

public void add ( address addr , long value ) { lps put long ( addr map get key ( addr ) , value ) ; }