read from minimum source d ns required for reconstruction in the iteration first try the success list which we think they are the best d ns if source dn is corrupt or slow , try to read some other source dn , and will update the success list remember the updated success list and return it for following operations and next iteration read

void read minimum sources ( int reconstruct length ) throws i o exception { corrupted blocks corrupted blocks = new corrupted blocks ( ) ; try { success list = do read minimum sources ( reconstruct length , corrupted blocks ) ; } finally { / / report corrupted blocks to nn datanode report corrupted blocks ( corrupted blocks ) ; } }


identify start address of relocation area skip any sections with a non - zero address when an image is relocatable generally all sections will have a zero address it is only when special sections are present ( e g , ksymtab ) that we may encounter sections with a non - zero address

private long compute relocation start address ( address space space , long base offset , task monitor monitor ) throws cancelled exception { if ( ! elf is relocatable ( ) ) { return 0 ; / / not applicable } long reloc start addr = 0 ; address space default space = get default address space ( ) ; elf section header [ ] sections = elf get sections ( ) ; for ( elf section header elf section to load : sections ) { monitor check canceled ( ) ; long addr = elf section to load get address ( ) ; if ( addr < 0 ) { reloc start addr = 0 ; break ; } if ( elf section to load is alloc ( ) & & addr ! = 0 ) { address space load space = get section address space ( elf section to load ) ; if ( load space equals ( space ) ) { long section byte length = elf section to load get adjusted size ( ) ; / / size in bytes long section length = section byte length / space get addressable unit size ( ) ; reloc start addr = math max ( reloc start addr , addr + section length ) ; } } } / / if more than half the address space is skipped - fall back to default relocation base long test offset = reloc start addr < < 1 ; if ( test offset ! = default space get truncated address ( test offset , true ) get offset ( ) ) { reloc start addr = 0 ; } return reloc start addr + base offset ; }


invokes the authorizer to obtain a sas token

string get s a s token ( string account , string file system , string path , string operation ) throws i o exception , access control exception ;


logs in to the wikibase instance , using usernamepassword if failed to login , the connection will be set to null

public boolean login ( string media wiki api endpoint , string username , string password ) { basic api connection connection = new basic api connection ( media wiki api endpoint ) ; setup connection ( connection ) ; try { connection login ( username , password ) ; endpoint to connection put ( media wiki api endpoint , connection ) ; return true ; } catch ( login failed exception e ) { logger error ( e get message ( ) , e ) ; return false ; } }


transform this node ' s properties this always returns something of the same type as the current node but since { @ link node } doesn ' t have a { @ code self t } parameter we return the closest thing we do have : { @ code t } , which is the root of the hierarchy for the this node

protected final < e > t transform node props ( class < e > type token , function < ? super e , ? extends e > rule ) { return info ( ) transform ( rule , type token ) ; }


test that verifies headers can be up to 64k long the test adds a 63k header leaving 1k for other headers this is because the header buffer setting is for all headers , names and values included

protected void test long header ( http u r l connection conn ) throws i o exception { string builder sb = new string builder ( ) ; for ( int i = 0 ; i < 63 * 1024 ; i + + ) { sb append ( " a " ) ; } conn set request property ( " longheader " , sb to string ( ) ) ; assert equals ( http u r l connection http ok , conn get response code ( ) ) ; }


a class not from the split packages is not gathered

public void non java classes not gathered ( ) { assume assume true ( " the telemetry should be enabled " , missing class telemetry enabled ( ) ) ; try { cl load class ( " jenkins my non existent class " ) ; } catch ( class not found exception ignored ) { } / / get the events gathered missing class events events = missing class telemetry get events ( ) ; concurrent hash map < list < stack trace element > , missing class event > events gathered = events get events and clean ( ) ; / / no events gathered assert equals ( 0 , events gathered size ( ) ) ; / / no log assert equals ( " no log if the class is not a java one " , 0 , logging get records ( ) stream ( ) filter ( r - > r get message ( ) contains ( non existing class ) ) count ( ) ) ; }


thread - safe call to update disk stats update occurs if the thread is able to acquire the lock ( i e , no other thread is updating it at the same time ) , and it has been at least restat interval ms since the last update assumes that initialization has been completed before this method is called

private void maybe update stats ( ) { / / update the free space if able to get the lock , / / with a frequency of once in restat interval ms if ( lock try lock ( ) ) { try { if ( ( system clock uptime millis ( ) - m last restat time ) > restat interval ms ) { update stats ( ) ; } } finally { lock unlock ( ) ; } } }


create but do not start the test webapp server the test webapp dir is preparedchecked in advance

public static http server 2 create test server ( configuration conf ) throws i o exception { prepare test webapp ( ) ; return create server ( test , conf ) ; }


a tuple domain that represents a predicate that every row this table scan node produces is guaranteed to satisfy this guarantee can have different origins for example , it may be successful predicate push down , or inherent guarantee provided by the underlying data

public tuple domain < column handle > get predicate ( ) { return predicate ; }


public float get progress ( ) throws i o exception { return pos / ( float ) split get length ( ) ; }


store a processing time value for an rpc call into this scheduler

default void add response time ( string call name , schedulable schedulable , processing details details ) { / / for the sake of backwards compatibility with old implementations of / / this interface , a default implementation is supplied which uses the old / / method all new implementations must override this interface and should / / not use the other add response time method int queue time = ( int ) details get ( processing details timing queue , rpc metrics timeunit ) ; int processing time = ( int ) details get ( processing details timing processing , rpc metrics timeunit ) ; add response time ( call name , schedulable get priority level ( ) , queue time , processing time ) ; }


public void add attribute ( string name , long value ) { add attribute ( name , value , false ) ; }


the value of the { @ code package count } item indicates the number of entries in the { @ code package index } table

public int get package count ( ) { return package count & 0xffff ; }


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


public string to json ( ) { return jackson utils to json ( this ) ; }


returns the preferred discovery node for this request the remote cluster client will attempt to send this request directly to this node otherwise , it will send the request as a proxy action that will be routed by the remote cluster to this node

discovery node get preferred target node ( ) ;


public string get client info ( string name ) throws s q l exception { return null ; }


public output stream stdout ( ) { return stdout ; }


given a parameterized type a & lt ; b , c & gt ; , returns b if the specified type is not a generic type , returns null

public static type get first type argument ( type type ) throws exception { if ( ! ( type instanceof parameterized type ) ) return null ; parameterized type ptype = ( parameterized type ) type ; type [ ] actual type arguments = ptype get actual type arguments ( ) ; if ( actual type arguments length = = 0 ) return null ; return $ gson $ types canonicalize ( actual type arguments [ 0 ] ) ; }


take a map of capabilities and extract those specific to a browser

map < string , object > apply ( map < string , object > capabilities ) ;


gets action that invokes cache key method , the result of execution is used as cache key

public method execution action get cache key method ( ) { return cache key method ; }


public migration client migration ( ) { return migration client ; }


public list < path > get paths ( ) { return path model get paths ( ) ; }


whether the persistent test runner is enabled note that not all test rules support this feature , in which case bazel should fall back to the normal test runner therefore , this method must only be called by test rules , and never for test actions for actions , use { @ code test target properties is persistent test runner } instead

public boolean is persistent test runner ( ) { return options persistent test runner ; }


this implementation compares the underlying servlet context resource locations

public boolean equals ( @ nullable object other ) { if ( this = = other ) { return true ; } if ( ! ( other instanceof servlet context resource ) ) { return false ; } servlet context resource other res = ( servlet context resource ) other ; return ( this servlet context equals ( other res servlet context ) & & this path equals ( other res path ) ) ; }


public boolean diff less than ( metric diff that ) { return this diff ( ) < that diff ( ) ; }


test case where a new writer picks up from an old one with no failures and the previous unfinalized segment entirely consistent - - i e all the journal nodes end at the same transaction id

public void test change writers logs in sync ( ) throws exception { write segment ( cluster , qjm , 1 , 3 , false ) ; q j m test util assert exists in quorum ( cluster , n n storage get in progress edits file name ( 1 ) ) ; / / make a new qjm qjm = close later ( new quorum journal manager ( conf , cluster get quorum journal u r i ( jid ) , fake nsinfo ) ) ; qjm recover unfinalized segments ( ) ; check recovery ( cluster , 1 , 3 ) ; }


ensure that variable $ ( @ d ) gets expanded correctly in the genrule cmd

public void test output dir expansion ( ) throws exception { scratch file ( " foo / build " , " genrule ( name = ' bar ' , " , " srcs = [ ' bar in txt ' ] , " , " cmd = ' touch $ ( @ d ) ' , " , " outs = [ ' bar / bar out txt ' ] ) " , " genrule ( name = ' baz ' , " , " srcs = [ ' bar / bar out txt ' ] , " , " cmd = ' touch $ ( @ d ) ' , " , " outs = [ ' logs / baz out txt ' , ' logs / baz log ' ] ) " ) ; get configured target ( " / / foo : bar " ) ; file configured target baz out target = get file configured target ( " / / foo : logs / baz out txt " ) ; spawn action baz action = ( spawn action ) get generating action ( baz out target get artifact ( ) ) ; / / make sure the expansion for $ ( @ d ) results in the / / directory of the build file ( " foo " ) , not the common parent / / directory of the output files ( " logs " ) string baz expected = " touch " + baz out target get artifact ( ) get exec path ( ) get parent directory ( ) get parent directory ( ) get path string ( ) ; assert command equals ( baz expected , baz action get arguments ( ) get ( 2 ) ) ; assert that ( baz action get arguments ( ) get ( 2 ) ) ends with ( " / foo " ) ; get configured target ( " / / foo : bar " ) ; artifact bar out = baz action get inputs ( ) to list ( ) get ( 0 ) ; assert that ( bar out get exec path ( ) ends with ( path fragment create ( " foo / bar / bar out txt " ) ) ) is true ( ) ; spawn action bar action = ( spawn action ) get generating action ( bar out ) ; string bar expected = " touch " + bar out get exec path ( ) get parent directory ( ) get path string ( ) ; assert command equals ( bar expected , bar action get arguments ( ) get ( 2 ) ) ; assert that ( baz expected equals ( bar expected ) ) is false ( ) ; }


reads and returns { @ link byte buffer } from the underlying { @ link socket channel } represented by the < code > key < code > due to the fact that there is a dedicated channel for each client connection we don ' t need to store the sender

public byte buffer read ( selection key key ) throws i o exception { var socket channel = ( socket channel ) key channel ( ) ; var buffer = byte buffer allocate ( 1024 ) ; var read = socket channel read ( buffer ) ; buffer flip ( ) ; if ( read = = - 1 ) { throw new i o exception ( " socket closed " ) ; } return buffer ; }


exposes a translog associated with the given engine for testing purpose

public static translog get translog ( engine engine ) { assert engine instanceof internal engine : " only internal engines have translogs , got : " + engine get class ( ) ; internal engine internal engine = ( internal engine ) engine ; return internal engine get translog ( ) ; }


returns an identifier for the shard state that can be used to check whether a shard has changed between snapshots or not

public string shard state identifier ( ) { return shard state identifier ; }


gets the string form for a stack element this is the same as { @ code to string ( ) } except that { @ code null } is converted to { @ code " < invalid > " }

private static string stack element string ( type bearer type ) { if ( type = = null ) { return " < invalid > " ; } return type to string ( ) ; }


public void small snake test ( ) { / / todo : test small snake }


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


public static int hash unsafe bytes ( object base , long offset , int length in bytes ) { return hash unsafe bytes ( base , offset , length in bytes , default seed ) ; }


determines whether or not this step requires a workspace context ( working directory and launcher ) when such a context is required ( the default ) , { @ link # perform ( run , file path , env vars , launcher , task listener ) } applies otherwise , { @ link # perform ( run , env vars , task listener ) } applies

default boolean requires workspace ( ) { return true ; }


tests nested repeatable and use of @ data bound constructor to process form data

public void test nested enabled top button inner ( ) throws exception { html page p = create web client ( ) go to ( " self / test nested top button inner " ) ; html form f = p get form by name ( " config " ) ; try { click button ( p , f , " add " , true ) ; f get input by value ( " " ) set value attribute ( " title one " ) ; click button ( p , f , " add foo " , true ) ; f get input by value ( " " ) set value attribute ( " txt one " ) ; click button ( p , f , " add foo " , false ) ; f get input by value ( " " ) set value attribute ( " txt two " ) ; f get inputs by name ( " bool " ) get ( 1 ) click ( ) ; click button ( p , f , " add " , false ) ; f get input by value ( " " ) set value attribute ( " title two " ) ; f get elements by tag name ( " button " ) get ( 2 ) click ( ) ; / / 2nd " add foo " button f get input by value ( " " ) set value attribute ( " txt 2 1 " ) ; } catch ( exception e ) { system err println ( " html at time of failure : \ n " + p get body ( ) as xml ( ) ) ; throw e ; } bind class = foo list class ; submit ( f ) ; assert equals ( " [ foo list : title one : [ foo : txt one : false , foo : txt two : true ] , " + " foo list : title two : [ foo : txt 2 1 : false ] ] " , bind result to string ( ) ) ; }


parse the given properties into a nameattribute map expects method names as keys and string attributes definitions as values , parsable into { @ link transaction attribute } instances via a { @ link transaction attribute editor }

public void set properties ( properties transaction attributes ) { transaction attribute editor tae = new transaction attribute editor ( ) ; enumeration < ? > prop names = transaction attributes property names ( ) ; while ( prop names has more elements ( ) ) { string method name = ( string ) prop names next element ( ) ; string value = transaction attributes get property ( method name ) ; tae set as text ( value ) ; transaction attribute attr = ( transaction attribute ) tae get value ( ) ; add transactional method ( method name , attr ) ; } }


the signature of the returned method handle is ( block from map , int position , sql function properties properties , block builder map block builder ) void the processor will get the value from from map , cast it and write to to block

private method handle build processor ( function and type manager function and type manager , type from type , type to type , boolean is key ) { method handle getter = native value getter ( from type ) ; / / adapt cast that takes ( [ sql function properties , ] ? ) to one that takes ( ? , sql function properties ) , where ? is the return type of getter built in scalar function implementation cast implementation = function and type manager get built in scalar function implementation ( function and type manager lookup cast ( cast type cast , from type get type signature ( ) , to type get type signature ( ) ) ) ; method handle cast = cast implementation get method handle ( ) ; if ( cast type ( ) parameter array ( ) [ 0 ] ! = sql function properties class ) { cast = method handles drop arguments ( cast , 0 , sql function properties class ) ; } cast = permute arguments ( cast , method type ( cast type ( ) return type ( ) , cast type ( ) parameter array ( ) [ 1 ] , cast type ( ) parameter array ( ) [ 0 ] ) , 1 , 0 ) ; method handle target = compose ( cast , getter ) ; / / if the key cast function is nullable , check the result is not null if ( is key & & cast implementation is nullable ( ) ) { target = compose ( null checker ( target type ( ) return type ( ) ) , target ) ; } method handle writer = native value writer ( to type ) ; writer = permute arguments ( writer , method type ( void class , writer type ( ) parameter array ( ) [ 1 ] , writer type ( ) parameter array ( ) [ 0 ] ) , 1 , 0 ) ; return compose ( writer , target as type ( method type ( unwrap ( target type ( ) return type ( ) ) , target type ( ) parameter array ( ) ) ) ) ; }


get the next tcp - based peer - - either from the cache or by creating it

private block reader peer next tcp peer ( ) throws i o exception { if ( remaining cache tries > 0 ) { peer peer = client context get peer cache ( ) get ( datanode , false ) ; if ( peer ! = null ) { log trace ( " next tcp peer : reusing existing peer { } " , peer ) ; return new block reader peer ( peer , true ) ; } } try { peer peer = remote peer factory new connected peer ( inet socket address , token , datanode ) ; log trace ( " next tcp peer : created new connected peer { } " , peer ) ; return new block reader peer ( peer , false ) ; } catch ( i o exception | unresolved address exception e ) { log trace ( " next tcp peer : failed to create new connected peer connected to " + " { } " , datanode ) ; throw e ; } }


create a builder with the { @ linkplain http message reader message readers } , method name , uri , headers , cookies , and attributes of the given request

static builder from ( server request other ) { return new default server request builder ( other ) ; }


appends { @ code values } , in order , to the end of the values the built { @ link immutable double array } will contain

public builder add all ( collection < double > values ) { ensure room for ( values size ( ) ) ; for ( double value : values ) { array [ count + + ] = value ; } return this ; }


create a new { @ code message builder } instance for the given class this method uses a concurrent hash map for caching method lookups

private static message builder get message builder ( class < ? > clazz ) throws exception { method method = method cache get ( clazz ) ; if ( method = = null ) { method = clazz get method ( " new builder " ) ; method cache put ( clazz , method ) ; } return ( message builder ) method invoke ( clazz ) ; }


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


put ticket granting ticket into map that is either backed by the flowrequest scope will override the previous value and blank out the setting if value is null or empty

public static void put ticket granting ticket into map ( final mutable attribute map map , final string ticket value ) { map put ( parameter ticket granting ticket id , ticket value ) ; }


the request from clients to get a report of applications matching the giving application types in the cluster from the < code > resource manager < code >

public static get applications request new instance ( applications request scope scope ) { get applications request request = records new record ( get applications request class ) ; request set scope ( scope ) ; return request ; }


before updating model , it will be analyzed first put all the data contained by the model into content values , including the fields value and foreign key value if the associations between models has been removed the foreign key value in database should be cleared too

private void before update ( lite pal support base obj , list < field > supported fields , content values values ) throws security exception , illegal argument exception , no such method exception , illegal access exception , invocation target exception { put fields value ( base obj , supported fields , values ) ; put foreign key value ( values , base obj ) ; for ( string fk name : base obj get list to clear self f k ( ) ) { values put null ( fk name ) ; } }


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


associate the given message with the given code

public void add message ( string code , locale locale , string msg ) { assert not null ( code , " code must not be null " ) ; assert not null ( locale , " locale must not be null " ) ; assert not null ( msg , " message must not be null " ) ; this message map compute if absent ( code , key - > new hash map < > ( 4 ) ) put ( locale , new message holder ( msg , locale ) ) ; if ( logger is debug enabled ( ) ) { logger debug ( " added message [ " + msg + " ] for code [ " + code + " ] and locale [ " + locale + " ] " ) ; } }


calls { @ link # add ( object , int ) } with all the arguments

public synchronized void add all ( map < ? extends t , integer > nodes ) { for ( map entry < ? extends t , integer > node : nodes entry set ( ) ) { add internal ( node get key ( ) , node get value ( ) ) ; } refresh table ( ) ; }


tests the update global aggregate functionality

public void test job master aggregates values correctly ( ) throws exception { final job master job master = new job master builder ( job graph , rpc service ) with configuration ( configuration ) with high availability services ( ha services ) with heartbeat services ( heartbeat services ) create job master ( ) ; job master start ( ) ; final job master gateway job master gateway = job master get self gateway ( job master gateway class ) ; try { completable future < object > update aggregate future ; aggregate function < integer , integer , integer > aggregate function = create aggregate function ( ) ; closure cleaner clean ( aggregate function , execution config closure cleaner level recursive , true ) ; byte [ ] serialized aggregate function = instantiation util serialize object ( aggregate function ) ; update aggregate future = job master gateway update global aggregate ( " agg 1 " , 1 , serialized aggregate function ) ; assert that ( update aggregate future get ( ) , equal to ( 1 ) ) ; update aggregate future = job master gateway update global aggregate ( " agg 1 " , 2 , serialized aggregate function ) ; assert that ( update aggregate future get ( ) , equal to ( 3 ) ) ; update aggregate future = job master gateway update global aggregate ( " agg 1 " , 3 , serialized aggregate function ) ; assert that ( update aggregate future get ( ) , equal to ( 6 ) ) ; update aggregate future = job master gateway update global aggregate ( " agg 1 " , 4 , serialized aggregate function ) ; assert that ( update aggregate future get ( ) , equal to ( 10 ) ) ; update aggregate future = job master gateway update global aggregate ( " agg 2 " , 10 , serialized aggregate function ) ; assert that ( update aggregate future get ( ) , equal to ( 10 ) ) ; update aggregate future = job master gateway update global aggregate ( " agg 2 " , 23 , serialized aggregate function ) ; assert that ( update aggregate future get ( ) , equal to ( 33 ) ) ; } finally { rpc utils terminate rpc endpoint ( job master , testing timeout ) ; } }


tries to infer the type information of an aggregate function ' s accumulator type

public static < t > type information < t > get return type of table function ( table function < t > table function ) { return get return type of table function ( table function , null ) ; }


clear fields in the program node objects so everything can be garbage collected

private void dispose of nodes ( ) { for ( int i = 0 ; i < node list size ( ) ; i + + ) { program node node = node list get ( i ) ; node dispose ( ) ; } }


public < t > t execute ( function < response , t > handler ) { return handler apply ( rest assured given ( ) spec ( req spec build ( ) ) expect ( ) spec ( resp spec build ( ) ) when ( ) request ( req method , req uri ) ) ; }


construct an inner node from a path - like string


return the contents of the json file to represent the operations to be performed for a folder rename

public string make rename pending file contents ( ) { simple date format sdf = new simple date format ( " yyyy - mm - dd hh : mm : ss sss " ) ; sdf set time zone ( time zone get time zone ( " utc " ) ) ; string time = sdf format ( new date ( ) ) ; / / make file list string string builder builder = new string builder ( ) ; builder append ( " [ \ n " ) ; for ( int i = 0 ; i ! = file metadata length ; i + + ) { if ( i > 0 ) { builder append ( " , \ n " ) ; } builder append ( " " ) ; string no prefix = string utils remove start ( file metadata [ i ] get key ( ) , src key + " / " ) ; / / quote string file names , escaping any possible " characters or other / / necessary characters in the name builder append ( quote ( no prefix ) ) ; if ( builder length ( ) > = max rename pending file size - formatting buffer ) { / / give up now to avoid using too much memory log error ( " internal error : exceeded maximum rename pending file size of { } bytes " , max rename pending file size ) ; / / return some bad json with an error message to make it human readable return " exceeded maximum rename pending file size " ; } } builder append ( " \ n ] " ) ; string file list = builder to string ( ) ; / / make file contents as a string again , quote file names , escaping / / characters as appropriate string contents = " { \ n " + " format version : \ " 1 0 \ " , \ n " + " operation u t c time : \ " " + time + " \ " , \ n " + " old folder name : " + quote ( src key ) + " , \ n " + " new folder name : " + quote ( dst key ) + " , \ n " + " file list : " + file list + " \ n " + " } \ n " ; return contents ; }


test that program merge can apply the byte differences between program 1 and program 2 when merging bytes and code units both when the bytes differ for an instruction but its prototype doesn ' t

public void test apply byte and code unit differences same prototype diff byte ( ) throws exception { program builder 1 clear code units ( " 0x 0 1 0 0 2cf 8 " , " 0x 0 1 0 0 2cfb " , false ) ; program builder 1 set bytes ( " 0x 0 1 0 0 2cf 8 " , " 3b 74 24 08 " , true ) ; program builder 2 clear code units ( " 0x 0 1 0 0 2cf 8 " , " 0x 0 1 0 0 2cfb " , false ) ; program builder 2 set bytes ( " 0x 0 1 0 0 2cf 8 " , " 3b 74 24 0c " , true ) ; / / p 1 & p 2 differ at byte at 0x 0 1 0 0 2cfb program merge = new program merge manager ( p 1 , p 2 , task monitor adapter dummy monitor ) ; program merge set diff filter ( new program diff filter ( program diff filter byte diffs | program diff filter code unit diffs ) ) ; program merge set merge filter ( new program merge filter ( program merge filter bytes | program merge filter code units , program merge filter replace ) ) ; address set as = new address set ( ) ; as add range ( addr ( 0x 0 1 0 0 2cf 8 ) , addr ( 0x 0 1 0 0 2cfb ) ) ; assert equals ( as , program merge get filtered differences ( ) ) ; program merge merge ( as , task monitor adapter dummy monitor ) ; address set un mergable byte addresses = new address set ( ) ; / / none that can ' t merge assert equals ( un mergable byte addresses , program merge get filtered differences ( ) ) ; }


public static consent reminder options value of ( final int value ) { return arrays stream ( values ( ) ) filter ( v - > v get value ( ) = = value ) find first ( ) or else throw ( illegal argument exception : : new ) ; }


loads the global configuration and adds the given dynamic properties configuration

public static configuration load configuration ( configuration dynamic properties ) { final string config dir = system getenv ( config constants env flink conf dir ) ; if ( config dir = = null ) { return new configuration ( dynamic properties ) ; } return load configuration ( config dir , dynamic properties ) ; }


returns { @ code true } if this method is final , per { @ code modifier is final ( get modifiers ( ) ) } note that a method may still be effectively " final " , or non - overridable when it has no { @ code final } keyword for example , it could be private , or it could be declared by a final class to tell whether a method is overridable , use { @ link invokable # is overridable }

public final boolean is final ( ) { return modifier is final ( get modifiers ( ) ) ; }


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


here , injecting rule injects an aspect which acts on a action rule ( ) and registers an action the action rule ( ) registers another action of its own this test asserts that both actions are reported

public void rule extra actions dont hide aspect extra actions ( ) throws exception { use configuration ( " - - experimental action listener = / / pkg : listener " ) ; scratch file ( " x / build " , " load ( ' : extension bzl ' , ' injecting rule ' , ' action rule ' ) " , " injecting rule ( name = ' a ' , deps = [ ' : b ' ] ) " , " action rule ( name = ' b ' ) " ) ; scratch file ( " x / extension bzl " , " def aspect 1 impl ( target , ctx ) : " , " ctx actions do nothing ( mnemonic = ' mnemonic ' ) " , " return [ ] " , " aspect 1 = aspect ( aspect 1 impl , attr aspects = [ ' deps ' ] ) " , " " , " def injecting rule impl ( ctx ) : " , " return [ ] " , " injecting rule = rule ( injecting rule impl , " , " attrs = { ' deps ' : attr label list ( aspects = [ aspect 1 ] ) } ) " , " " , " def action rule impl ( ctx ) : " , " out = ctx actions declare file ( ctx label name ) " , " ctx actions run shell ( outputs = [ out ] , command = ' dontcare ' , mnemonic = ' mnemonic ' ) " , " return [ ] " , " action rule = rule ( action rule impl , attrs = { ' deps ' : attr label list ( ) } ) " ) ; scratch file ( " pkg / build " , " extra action ( name = ' xa ' , cmd = ' echo dont - care ' ) " , " action listener ( name = ' listener ' , mnemonics = [ ' mnemonic ' ] , extra actions = [ ' : xa ' ] ) " ) ; analysis result analysis result = update ( " / / x : a " ) ; list < string > owners = new array list < > ( ) ; for ( artifact artifact : analysis result get top level artifacts to owner labels ( ) get artifacts ( ) ) { if ( " xa " equals ( artifact get extension ( ) ) ) { owners add ( artifact get owner label ( ) to string ( ) ) ; } } assert that ( owners ) contains exactly ( " / / x : b " , " / / x : b " ) ; }


randomly choose num of replicas targets from the given scope

protected datanode storage info choose random ( int num of replicas , string scope , set < node > excluded nodes , long blocksize , int max nodes per rack , list < datanode storage info > results , boolean avoid stale nodes , enum map < storage type , integer > storage types ) throws not enough replicas exception { string builder builder = debug logging builder get ( ) ; if ( log is debug enabled ( ) ) { builder set length ( 0 ) ; builder append ( " [ " ) ; } choose random reasons get ( ) clear ( ) ; boolean bad target = false ; datanode storage info first chosen = null ; while ( num of replicas > 0 ) { / / the storage type that current node has storage type include type = null ; datanode descriptor chosen node = null ; if ( cluster map instanceof d f s network topology ) { for ( storage type type : storage types key set ( ) ) { chosen node = choose data node ( scope , excluded nodes , type ) ; if ( chosen node ! = null ) { include type = type ; break ; } } } else { chosen node = choose data node ( scope , excluded nodes ) ; } if ( chosen node = = null ) { break ; } preconditions check state ( excluded nodes add ( chosen node ) , " chosen node " + chosen node + " is already in excluded nodes " + excluded nodes ) ; if ( log is debug enabled ( ) ) { builder append ( " \ n node " ) append ( node base get path ( chosen node ) ) append ( " [ " ) ; } datanode storage info storage = null ; if ( is good datanode ( chosen node , max nodes per rack , consider load , results , avoid stale nodes ) ) { for ( iterator < map entry < storage type , integer > > iter = storage types entry set ( ) iterator ( ) ; iter has next ( ) ; ) { map entry < storage type , integer > entry = iter next ( ) ; / / if there is one storage type the node has already contained , / / then no need to loop through other storage type if ( include type ! = null & & entry get key ( ) ! = include type ) { continue ; } storage = choose storage 4 block ( chosen node , blocksize , results , entry get key ( ) ) ; if ( storage ! = null ) { num of replicas - - ; if ( first chosen = = null ) { first chosen = storage ; } / / add node ( subclasses may also add related nodes ) to excluded node add to excluded nodes ( chosen node , excluded nodes ) ; int num = entry get value ( ) ; if ( num = = 1 ) { iter remove ( ) ; } else { entry set value ( num - 1 ) ; } break ; } } if ( log is debug enabled ( ) ) { builder append ( " \ n ] " ) ; } / / if no candidate storage was found on this dn then set bad target bad target = ( storage = = null ) ; } } if ( num of replicas > 0 ) { string detail = enable debug logging ; if ( log is debug enabled ( ) ) { detail = builder to string ( ) ; if ( bad target ) { builder set length ( 0 ) ; } else { if ( detail length ( ) > 1 ) { / / only log if there ' s more than " [ " , which is always appended at / / the beginning of this method log debug ( detail ) ; } detail = " " ; } } final hash map < node not chosen reason , integer > reason map = choose random reasons get ( ) ; if ( ! reason map is empty ( ) ) { log info ( " not enough replicas was chosen reason : { } " , reason map ) ; } throw new not enough replicas exception ( detail ) ; } return first chosen ; }


removes and returns the object with the highest priority number in the queue if more than one object has the same priority , then the object that was added to the queue last is considered to have the higher priority value null is returned if the queue is empty

public t remove last ( ) { if ( tree is empty ( ) ) { return null ; } size - - ; integer key = tree last key ( ) ; linked list < t > list = tree get ( key ) ; if ( list size ( ) = = 1 ) { tree remove ( key ) ; } return list remove last ( ) ; }


public get index request include defaults ( boolean include defaults ) { this include defaults = include defaults ; return this ; }


return the target type that was requested to convert to

public type descriptor get target type ( ) { return this target type ; }


create a { @ link namespaces } containing the singular namespace used by the name , or an empty one

public static namespaces from ( q name name ) { if ( name get prefix ( ) is empty ( ) ) { return empty ( ) ; } return new namespaces ( immutable sorted map of ( name get prefix ( ) , name get namespace u r i ( ) ) ) ; }


get the leftover contents of the input buffer when the error occurred

public string get buffer ( ) { return buffer ; }


adds condition to check if the index is at least < code > age < code > old

public rollover request add max index age condition ( time value age ) { max age condition max age condition = new max age condition ( age ) ; if ( this conditions contains key ( max age condition name ( ) ) ) { throw new illegal argument exception ( max age condition name ( ) + " condition is already set " ) ; } this conditions put ( max age condition name ( ) , max age condition ) ; return this ; }


public void add ( string string ) { elements add ( string = = null ? json null instance : new json primitive ( string ) ) ; }


insert a failiure injection point for a read call @ throw i o exception , as codepath is on input stream , not other sdk call

private void read failpoint ( int off , int len ) throws i o exception { if ( should inject failure ( get key ( ) ) ) { string error = string format ( " read ( b , % d , % d ) on key % s failed : injecting error % d / % d " + " for test " , off , len , get key ( ) , read failure counter , max read failures ) ; throw new file not found exception ( error ) ; } }


returns the highlight object ( contains x - index and data set index ) of the selected value at the given touch point inside the bar chart

public highlight get highlight by touch point ( float x , float y ) { if ( m data = = null ) { log e ( log tag , " can ' t select by touch no data set " ) ; return null ; } else { highlight h = get highlighter ( ) get highlight ( x , y ) ; if ( h = = null | | ! is highlight full bar enabled ( ) ) return h ; / / for is highlight full bar enabled , remove stack index return new highlight ( h get x ( ) , h get y ( ) , h get x px ( ) , h get y px ( ) , h get data set index ( ) , - 1 , h get axis ( ) ) ; } }


call this with the latest data when you want models to be rebuilt the data will be passed on to { @ link # build models ( object , object ) }

public void set data ( t data 1 , u data 2 ) { this data 1 = data 1 ; this data 2 = data 2 ; allow model build requests = true ; request model build ( ) ; allow model build requests = false ; }


writes { @ code value } as an unsigned integer to { @ code out } , starting at { @ code offset } returns the number of bytes written

public static void write unsigned leb 1 2 8 ( byte output out , int value ) { int remaining = value > > > 7 ; while ( remaining ! = 0 ) { out write byte ( ( byte ) ( ( value & 0x 7f ) | 0x 8 0 ) ) ; value = remaining ; remaining > > > = 7 ; } out write byte ( ( byte ) ( value & 0x 7f ) ) ; }


returns the most significant bits of the uuid ' s 128 value

public long get most significant bits ( ) { return this most significant bits ; }


the fill ratio of the underlying tree set holding blocks

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


adds cookie to the response can be invoked multiple times to insert more than one cookie

public void cookie ( string path , string name , string value , int max age , boolean secured ) { cookie ( " " , path , name , value , max age , secured , false ) ; }


returns true if the arbiter runs in unbounded mode

public final boolean is unbounded ( ) { return unbounded ; }


write all changes to the specified out file

private void do save ( buffer file out file , task monitor monitor ) throws i o exception , cancelled exception { int index cnt = index provider get index count ( ) ; int pre save cnt = out file get index count ( ) ; if ( monitor = = null ) { monitor = task monitor dummy ; } monitor initialize ( index cnt ) ; monitor set message ( " saving file " ) ; / / determine number of buffers to be written ( required for remote stream transfer ) / / count non - empty buffers which have been created or modified / / empty buffers will be flushed when out file is closed int buf count = 0 ; for ( int id = 0 ; id < index cnt ; id + + ) { monitor check canceled ( ) ; buffer node node = get cached buffer node ( id ) ; if ( node ! = null ) { / / check nod which resides in cache if ( ! node empty & & ( id > = pre save cnt | | node checkpoint ! = 0 | | node modified ) ) { + + buf count ; } } else if ( id > = pre save cnt & & ! index provider is free ( id ) ) { / / node not in cache , must be copied if not empty / / will cause buffer to be cached for use during output below data buffer buf = get buffer ( id ) ; / / will add to cache for use during output below if ( buf ! = null ) { + + buf count ; release buffer ( buf ) ; } } } / / write / update all non - empty buffers try ( output block stream out = local buffer file get output block stream ( out file , buf count ) ) { for ( int id = 0 ; id < index cnt ; id + + ) { monitor check canceled ( ) ; monitor set progress ( id ) ; / / get buffer node from cache / / if not contained within cache it does not need to be stored buffer node node = get cached buffer node ( id ) ; if ( node ! = null ) { if ( ! node empty & & ( id > = pre save cnt | | node checkpoint ! = 0 | | node modified ) ) { load cached node ( node ) ; buffer file block block = local buffer file get buffer file block ( node buffer , buffer size ) ; out write block ( block ) ; } } } } / / set free id list for output file / / it is important that this is done after the streaming is complete / / so that the change map and free buffers are updated properly out file set free indexes ( index provider get free indexes ( ) ) ; / / copy file parameters from cache file string [ ] parm names = cache file get parameter names ( ) ; for ( int i = 0 ; i < parm names length ; i + + ) { string name = parm names [ i ] ; out file set parameter ( name , cache file get parameter ( name ) ) ; } }


returns the default value of a register at a given address

public register value get default value ( register register , address address ) ;


public boolean get prefix ns boolean ( ) { return prefix ns boolean ; }


token is icon id it can be used to refer on icons in plugin extensions

public string get token ( ) { return token ; }


checks if the hadoop dependency is at least the given version

public static boolean is min hadoop version ( int major , int minor ) throws flink runtime exception { final tuple 2 < integer , integer > hadoop version = get major minor bundled hadoop version ( ) ; int maj = hadoop version f 0 ; int min = hadoop version f 1 ; return maj > major | | ( maj = = major & & min > = minor ) ; }


this appender does not ignore throwables

public boolean ignores throwable ( ) { return false ; }


protected void assert multipart uploads pending ( path path ) throws i o exception { assert true ( " no multipart uploads in progress under " + path , count multipart uploads ( path ) > 0 ) ; }


set was loading to true so when the fragment on resume is called , the initial search is done

private void set search on resume ( ) { was loading set ( true ) ; }


processes a list of { @ link aggregation } s and writes a flat json document for each of its leaf aggregations supported sub - aggregations include : { @ link multi buckets aggregation } { @ link numeric metrics aggregation single value } { @ link percentiles }

private void process aggs ( long doc count , list < aggregation > aggregations ) throws i o exception { if ( aggregations is empty ( ) ) { / / this means we reached a bucket aggregation without sub - aggs thus , we can flush the path written so far queue doc to write ( key value pairs , doc count ) ; return ; } list < aggregation > leaf aggregations = new array list < > ( ) ; list < multi buckets aggregation > bucket aggregations = new array list < > ( ) ; list < single bucket aggregation > single bucket aggregations = new array list < > ( ) ; / / sort into leaf and bucket aggregations / / the leaf aggregations will be processed first for ( aggregation agg : aggregations ) { if ( agg instanceof multi buckets aggregation ) { bucket aggregations add ( ( multi buckets aggregation ) agg ) ; } else if ( agg instanceof single bucket aggregation ) { / / skip a level down for single bucket aggs , if they have a sub - agg that is not / / a bucketed agg we should treat it like a leaf in this bucket single bucket aggregation single bucket aggregation = ( single bucket aggregation ) agg ; for ( aggregation sub agg : single bucket aggregation get aggregations ( ) ) { if ( sub agg instanceof multi buckets aggregation | | sub agg instanceof single bucket aggregation ) { single bucket aggregations add ( single bucket aggregation ) ; } else { leaf aggregations add ( sub agg ) ; } } } else { leaf aggregations add ( agg ) ; } } / / if on the current level ( indicated via bucket aggregations ) or one of the next levels ( single bucket aggregations ) / / we have more than 1 ` multi buckets aggregation ` , we should error out / / we need to make the check in this way as each of the items in ` single bucket aggregations ` is treated as a separate branch / / in the recursive handling of this method int bucket agg level count = math max ( bucket aggregations size ( ) , ( int ) single bucket aggregations stream ( ) flat map ( s - > as list ( s get aggregations ( ) ) stream ( ) ) filter ( multi buckets aggregation class : : is instance ) count ( ) ) ; if ( bucket agg level count > 1 ) { throw new illegal argument exception ( " multiple bucket aggregations at the same level are not supported " ) ; } list < string > added leaf keys = new array list < > ( ) ; for ( aggregation leaf agg : leaf aggregations ) { if ( time field equals ( leaf agg get name ( ) ) ) { process time field ( leaf agg ) ; } else if ( fields contains ( leaf agg get name ( ) ) ) { boolean leaf added = process leaf ( leaf agg ) ; if ( leaf added ) { added leaf keys add ( leaf agg get name ( ) ) ; } } } boolean no more buckets to process = bucket aggregations is empty ( ) ; if ( no more buckets to process = = false ) { multi buckets aggregation bucket agg = bucket aggregations get ( 0 ) ; if ( bucket agg instanceof histogram ) { process date histogram ( ( histogram ) bucket agg ) ; } else { / / ignore bucket aggregations that don ' t contain a field we / / are interested in this avoids problems with pipeline bucket / / aggregations where we would create extra docs traversing a / / bucket agg that isn ' t used but is required for the pipeline agg if ( bucket agg contains required agg ( bucket agg ) ) { process bucket ( bucket agg , fields contains ( bucket agg get name ( ) ) ) ; } else { no more buckets to process = true ; } } } no more buckets to process = single bucket aggregations is empty ( ) & & no more buckets to process ; / / we support more than one ` single bucket aggregation ` at each level / / however , we only want to recurse with multi / single bucket aggs / / non - bucketed sub - aggregations were handle as leaf aggregations at this level for ( single bucket aggregation single bucket aggregation : single bucket aggregations ) { process aggs ( single bucket aggregation get doc count ( ) , as list ( single bucket aggregation get aggregations ( ) ) stream ( ) filter ( aggregation - > ( aggregation instanceof multi buckets aggregation | | aggregation instanceof single bucket aggregation ) ) collect ( collectors to list ( ) ) ) ; } / / if there are no more bucket aggregations to process we ' ve reached the end / / and it ' s time to write the doc if ( no more buckets to process ) { queue doc to write ( key value pairs , doc count ) ; } added leaf keys for each ( k - > key value pairs remove ( k ) ) ; }


public void set data type name ( string data type name ) { this data type name = data type name ; }


test the wrapper parameter with a good name , to ensure the security fix doesn ' t break anything

public void wrapper good name ( ) throws exception { string wrapper = " good name - - ok " ; check wrapper param ( wrapper , http servlet response sc ok , null ) ; }


look for an argument value that either corresponds to the given index in the constructor argument list or generically matches by type

public value holder get argument value ( int index , class < ? > required type , string required name ) { return get argument value ( index , required type , required name , null ) ; }


optional hook for error processing default is to call { @ link exceptions # error callback not implemented ( throwable ) }

protected void hook on error ( throwable throwable ) { throw exceptions error callback not implemented ( throwable ) ; }


tracks one last definitive failure and returns to the caller by notifying the wrapped listener

void on definitive failure ( exception exception ) { track failure ( exception ) ; response listener on failure ( this exception ) ; }


test the property ' prefix namespace array '

public void prefix namespace array test ( ) { / / todo : test prefix namespace array }


returns the used ids bucket for the given tileset name if it doesn ' t exist one will be created with the specified size if its > 0 , else null will be returned

private int array get used ids bucket ( string tileset name , int size ) { if ( tileset used ids contains key ( tileset name ) ) { return tileset used ids get ( tileset name ) ; } if ( size < = 0 ) { return null ; } int array bucket = new int array ( size ) ; tileset used ids put ( tileset name , bucket ) ; return bucket ; }


returns { @ code true } if and only if the user - defined writability flag at the specified index is set to { @ code true }

public boolean get user defined writability ( int index ) { return ( unwritable & writability mask ( index ) ) = = 0 ; }


try to call { @ link accessible object # set accessible ( boolean ) } but will catch any { @ link security exception } and { @ link java lang reflect inaccessible object exception } and return it the caller must check if it returns { @ code null } and if not handle the returned exception

public static throwable try set accessible ( accessible object object , boolean check accessible ) { if ( check accessible & & ! platform dependent 0 is explicit try reflection set accessible ( ) ) { return new unsupported operation exception ( " reflective set accessible ( true ) disabled " ) ; } try { object set accessible ( true ) ; return null ; } catch ( security exception e ) { return e ; } catch ( runtime exception e ) { return handle inaccessible object exception ( e ) ; } }


if a write would exceed the capacity of the direct buffers , it is set aside to be loaded by this function while the compressed data are consumed

void set input from saved data ( ) { compressed direct buf len = math min ( user buf len , direct buffer size ) ; / / reinitialize snappy ' s input direct buffer compressed direct buf rewind ( ) ; ( ( byte buffer ) compressed direct buf ) put ( user buf , user buf off , compressed direct buf len ) ; / / note how much data is being fed to snappy user buf off + = compressed direct buf len ; user buf len - = compressed direct buf len ; }


merges { @ code other } into this set , so this set becomes the union of the two


returns true if the editor has a valid value

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


get the amount of time that has elapsed since the timer began if the timer was reset , this will be the amount of time since the last reset

public long elapsed ms ( ) { return current time ms - start ms ; }


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


dumps the configuration of hierarchy of queues with the xml file path given it is to be used directly only for testing

static void dump configuration ( writer out , string config file , configuration conf ) throws i o exception { if ( conf ! = null & & conf get ( deprecated queue configuration parser mapred queue names key ) ! = null ) { return ; } json factory dump factory = new json factory ( ) ; json generator dump generator = dump factory create generator ( out ) ; queue configuration parser parser ; boolean acls enabled = false ; if ( conf ! = null ) { acls enabled = conf get boolean ( m r config mr acls enabled , false ) ; } if ( config file ! = null & & ! " " equals ( config file ) ) { parser = new queue configuration parser ( config file , acls enabled ) ; } else { parser = get queue configuration parser ( null , false , acls enabled ) ; } dump generator write start object ( ) ; dump generator write field name ( " queues " ) ; dump generator write start array ( ) ; dump configuration ( dump generator , parser get root ( ) get children ( ) ) ; dump generator write end array ( ) ; dump generator write end object ( ) ; dump generator flush ( ) ; }


verifies that we can create multiple tls client transports from the same builder

public void creating multiple tls transports should succeed ( ) throws exception { start server ( ) ; / / create a couple client transports protocol negotiator negotiator = new negotiator ( ) ; for ( int index = 0 ; index < 2 ; + + index ) { netty client transport transport = new transport ( negotiator ) ; call me maybe ( transport start ( client transport listener ) ) ; } / / send a single rpc on each transport final list < rpc > rpcs = new array list < > ( transports size ( ) ) ; for ( netty client transport transport : transports ) { rpcs add ( new rpc ( transport ) half close ( ) ) ; } / / wait for the r p cs to complete for ( rpc rpc : rpcs ) { rpc wait for response ( ) ; } }


public void direct map test ( ) { / / todo : test direct map }


guides the allowed concurrency among update operations used as a hint for internal sizing the table is internally partitioned to try to permit the indicated number of concurrent updates without contention because assignment of entries to these partitions is not necessarily uniform , the actual concurrency observed may vary ideally , you should choose a value to accommodate as many threads as will ever concurrently modify the table using a significantly higher value than you need can waste space and time , and a significantly lower value can lead to thread contention but overestimates and underestimates within an order of magnitude do not usually have much noticeable impact a value of one permits only one thread to modify the cache at a time , but since read operations and cache loading computations can proceed concurrently , this still yields higher concurrency than full synchronization defaults to 4 < b > note : < b > the default may change in the future if you care about this value , you should always choose it explicitly the current implementation uses the concurrency level to create a fixed number of hashtable segments , each governed by its own write lock the segment lock is taken once for each explicit write , and twice for each cache loading computation ( once prior to loading the new value , and once after loading completes ) much internal cache management is performed at the segment granularity for example , access queues and write queues are kept per segment when they are required by the selected eviction algorithm as such , when writing unit tests it is not uncommon to specify { @ code concurrency level ( 1 ) } in order to achieve more deterministic eviction behavior note that future implementations may abandon segment locking in favor of more advanced concurrency controls

public cache builder < k , v > concurrency level ( int concurrency level ) { check state ( this concurrency level = = unset int , " concurrency level was already set to % s " , this concurrency level ) ; check argument ( concurrency level > 0 ) ; this concurrency level = concurrency level ; return this ; }


public static void drop table ( database db , boolean if exists ) { string sql = " drop table " + ( if exists ? " if exists " : " " ) + " \ " indexed string entity \ " " ; db exec s q l ( sql ) ; }


returns true if the edges in this graph are directed directed edges connect a { @ link endpoint pair # source ( ) source node } to a { @ link endpoint pair # target ( ) target node } , while undirected edges connect a pair of nodes to each other


animate the text color of any view that extends { @ link text view } ( buttons , edit text )

public static void animate text color ( final text view view , final long duration , @ color int final int color start , @ color int final int color end ) { if ( debug ) { log d ( tag , " animate text color ( ) called with : " + " view = [ " + view + " ] , duration = [ " + duration + " ] , " + " color start = [ " + color start + " ] , color end = [ " + color end + " ] " ) ; } final value animator view property animator = value animator of object ( new argb evaluator ( ) , color start , color end ) ; view property animator set interpolator ( new fast out slow in interpolator ( ) ) ; view property animator set duration ( duration ) ; view property animator add update listener ( animation - > view set text color ( ( int ) animation get animated value ( ) ) ) ; view property animator add listener ( new animator listener adapter ( ) { @ override public void on animation end ( final animator animation ) { view set text color ( color end ) ; } @ override public void on animation cancel ( final animator animation ) { view set text color ( color end ) ; } } ) ; view property animator start ( ) ; }


adds a listener that gets invoked with the current cluster state before processor factories get invoked this is useful for components that are used by ingest processors , so that they have the opportunity to update before these components get used by the ingest processor factory

public void add ingest cluster state listener ( consumer < cluster state > listener ) { ingest cluster state listeners add ( listener ) ; }


constructs an { @ link evaluation result } from the { @ link # graph } looks for cycles if there are unfinished nodes but no error was already found through bubbling up ( as indicated by { @ code bubble error info } being null ) { @ code visitor } may be null , but only in the case where all graph entries corresponding to { @ code sky keys } are known to be in the done state ( { @ code entry is done ( ) } returns true )

< t extends sky value > evaluation result < t > construct result ( iterable < sky key > sky keys , @ nullable map < sky key , value with metadata > bubble error info , boolean catastrophe ) throws interrupted exception { preconditions check state ( ! catastrophe | | evaluator context keep going ( ) , " catastrophe not consistent with keep going mode : % s % s % s " , sky keys , catastrophe , bubble error info ) ; evaluation result builder < t > result = evaluation result builder ( ) ; list < sky key > cycle roots = new array list < > ( ) ; for ( sky key sky key : sky keys ) { sky value unwrapped value = maybe get value from error ( sky key , graph get ( null , reason pre or post evaluation , sky key ) , bubble error info ) ; value with metadata value with metadata = unwrapped value = = null ? null : value with metadata wrap with metadata ( unwrapped value ) ; / / cycle checking : if there is a cycle , evaluation cannot progress , therefore , / / the final values will not be in done state when the work runs out if ( value with metadata = = null ) { / / don ' t look for cycles if the build failed for a known reason if ( bubble error info = = null ) { cycle roots add ( sky key ) ; } continue ; } sky value value = value with metadata get value ( ) ; error info error info = value with metadata get error info ( ) ; preconditions check state ( value ! = null | | error info ! = null , sky key ) ; if ( ! evaluator context keep going ( ) & & error info ! = null ) { / / value will be null here unless the value was already built on a prior keep going build result add error ( sky key , error info ) ; continue ; } if ( value = = null ) { / / note that we must be in the keep going case only make this value an error if it doesn ' t / / have a value the error shouldn ' t matter to the caller since the value succeeded after a / / fashion result add error ( sky key , error info ) ; } else { result add result ( sky key , value ) ; } } if ( ! cycle roots is empty ( ) ) { cycle detector check for cycles ( cycle roots , result , evaluator context ) ; } if ( catastrophe & & bubble error info ! = null ) { / / we may not have a top - level node completed inform the caller of at least one catastrophic / / exception that shut down the evaluation so that it has some context for ( value with metadata value with metadata : bubble error info values ( ) ) { error info error info = preconditions check not null ( value with metadata get error info ( ) , " bubble error info should have contained element with error info : % s " , bubble error info ) ; preconditions check state ( error info is catastrophic ( ) , " bubble error info should have contained element with catastrophe : % s " , bubble error info ) ; result set catastrophe ( error info get exception ( ) ) ; } } evaluation result < t > built result = result build ( ) ; preconditions check state ( bubble error info = = null | | built result has error ( ) , " if an error bubbled up , some top - level node must be in error : % s % s % s " , bubble error info , sky keys , built result ) ; return built result ; }


whether the given type is a handler with handler methods

protected abstract boolean is handler ( class < ? > bean type ) ;


public static byte [ ] encrypt d e s ( final byte [ ] data , final byte [ ] key , final string transformation , final byte [ ] iv ) { return symmetric template ( data , key , " des " , transformation , iv , true ) ; }


returns a sun misc unsafe suitable for use in a 3rd party package replace with a simple call to unsafe get unsafe when integrating into a jdk

private static sun misc unsafe do get unsafe ( ) { try { return sun misc unsafe get unsafe ( ) ; } catch ( throwable try reflection instead ) { } try { return java security access controller do privileged ( new java security privileged exception action < sun misc unsafe > ( ) { @ override public sun misc unsafe run ( ) throws exception { class < sun misc unsafe > k = sun misc unsafe class ; for ( java lang reflect field f : k get declared fields ( ) ) { f set accessible ( true ) ; object x = f get ( null ) ; if ( k is instance ( x ) ) { return k cast ( x ) ; } } throw new no such field error ( " the unsafe " ) ; } } ) ; } catch ( throwable t ) { return null ; } }


initializes the array with the provided number of bytes

private void initialize ( int bytes ) { int capacity = bytes / element length in bytes ; preconditions check argument ( capacity > 0 , " requested array with zero capacity " ) ; preconditions check argument ( capacity < = max array size , " requested capacity exceeds limit of " + max array size ) ; data = new short [ capacity ] ; }


creates a { @ link reentrant read write lock } with the given fairness policy the { @ code lock name } is used in the warning or exception output to help identify the locks involved in the detected deadlock

public reentrant read write lock new reentrant read write lock ( string lock name , boolean fair ) { return policy = = policies disabled ? new reentrant read write lock ( fair ) : new cycle detecting reentrant read write lock ( new lock graph node ( lock name ) , fair ) ; }


public void test to string ( ) { branch report request branch report request = new branch report request ( ) ; branch report request set xid ( " 127 0 0 1 : 8091 : 1249853 " ) ; branch report request set branch id ( 3 ) ; branch report request set resource id ( " resource 0 0 3 " ) ; branch report request set status ( branch status phase one timeout ) ; branch report request set application data ( " test app data " ) ; assertions assert equals ( " xid = 127 0 0 1 : 8091 : 1249853 , branch id = 3 , resource id = resource 0 0 3 , status = phase one timeout , " + " application data = test app " + " data " , branch report request to string ( ) ) ; }


alternative to { @ link # unsubscribe ( ) } with additional custom headers to send to the server note : there is no need to set the subscription id

void unsubscribe ( @ nullable stomp headers headers ) ;


tests finding n recent valid snapshots from set of snapshots and data logs

public void test find n valid snapshots ( ) throws exception { int n recent snap = 4 ; / / n recent snap shots int n recent count = 30 ; int offset = 0 ; file version 2 = new file ( tmp dir to string ( ) , " version - 2 " ) ; assert true ( version 2 mkdir ( ) , " failed to create version 2 dir : " + version 2 to string ( ) ) ; / / test that with no snaps , find n valid snapshots returns empty list file txn snap log txn log = new file txn snap log ( tmp dir , tmp dir ) ; list < file > found snaps = txn log find n valid snapshots ( 1 ) ; assert equals ( 0 , found snaps size ( ) ) ; list < file > expected n recent snap files = new array list < file > ( ) ; int counter = offset + ( 2 * n recent count ) ; for ( int i = 0 ; i < n recent count ; i + + ) { / / simulate log file file log file = new file ( version 2 + " / log " + long to hex string ( - - counter ) ) ; assert true ( log file create new file ( ) , " failed to create log file : " + log file to string ( ) ) ; / / simulate snapshot file file snap file = new file ( version 2 + " / snapshot " + long to hex string ( - - counter ) ) ; assert true ( snap file create new file ( ) , " failed to create snap file : " + snap file to string ( ) ) ; make valid snapshot ( snap file ) ; / / add the n recent snap files for assertion if ( i < n recent snap ) { expected n recent snap files add ( snap file ) ; } } / / test that when we ask for recent snaps we get the number we asked for and / / the files we expected list < file > n recent valid snap files = txn log find n valid snapshots ( n recent snap ) ; assert equals ( 4 , n recent valid snap files size ( ) , " exactly 4 snapshots " ) ; expected n recent snap files remove all ( n recent valid snap files ) ; assert equals ( 0 , expected n recent snap files size ( ) , " didn ' t get the recent snap files " ) ; / / test that when asking for more snaps than we created , we still only get snaps / / not logs or anything else ( per zookeeper - 2420 ) n recent valid snap files = txn log find n valid snapshots ( n recent count + 5 ) ; assert equals ( n recent count , n recent valid snap files size ( ) ) ; for ( file f : n recent valid snap files ) { assert true ( ( util get zxid from name ( f get name ( ) , " snapshot " ) ! = - 1 ) , " find n valid snapshots ( ) returned a non - snapshot : " + f get path ( ) ) ; } txn log close ( ) ; }


collects all source output jars from { @ link # output jars }

public iterable < artifact > get all src output jars ( ) { return output jars stream ( ) map ( output jar : : get src jars ) reduce ( immutable list of ( ) , iterables : : concat ) ; }


tests that the sync and block report metrics get updated on cluster startup

public void test sync and block report metric ( ) throws exception { metrics record builder rb = get metrics ( nn metrics ) ; / / we have one sync when the cluster starts up , just opening the journal assert counter ( " syncs num ops " , 4l , rb ) ; / / each datanode reports in when the cluster comes up assert counter ( " storage block report num ops " , ( long ) datanode count * cluster get storages per datanode ( ) , rb ) ; / / sleep for an interval + slop to let the percentiles rollover thread sleep ( ( percentiles interval + 1 ) * 1000 ) ; / / check that the percentiles were updated assert quantile gauges ( " syncs 1s " , rb ) ; assert quantile gauges ( " storage block report 1s " , rb ) ; }


called by { @ link # do action and schedule next impl ( simple exo player , default track selector , surface , handler wrapper , action node ) } to perform the action

protected abstract void do action impl ( simple exo player player , default track selector track selector , @ nullable surface surface ) ;


{ @ inherit doc } the default implementation does nothing

@ override public void exit string literal ( eql base parser string literal context ctx ) { }


register the handlers for always on services

private dispatcher setup dispatcher ( ) { dispatcher dispatcher = create dispatcher ( ) ; dispatcher register ( r m fatal event type class , new resource manager r m fatal event dispatcher ( ) ) ; return dispatcher ; }


public cancellable get role mappings async ( final get role mappings request request , final request options options , final action listener < get role mappings response > listener ) { return rest high level client perform request async and parse entity ( request , security request converters : : get role mappings , options , get role mappings response : : from x content , listener , empty set ( ) ) ; }


if not sure has the active span , use this method , will be cause npe when has no active span , use context manager : : is active method to determine whether there has the active span

public static abstract span active span ( ) { return get ( ) active span ( ) ; }


this method asserts that the weapon object that is passed is an instance of the clazz

private void verify weapon ( weapon weapon , class < ? > clazz ) { assert true ( clazz is instance ( weapon ) , " weapon must be an object of : " + clazz get name ( ) ) ; }


gets a view of log records per agent matching this recorder

public map < computer , list < log record > > get slave log records ( ) { map < computer , list < log record > > result = new tree map < > ( new comparator < computer > ( ) { final collator coll = collator get instance ( ) ; public int compare ( computer c 1 , computer c 2 ) { return coll compare ( c 1 get display name ( ) , c 2 get display name ( ) ) ; } } ) ; for ( computer c : jenkins get ( ) get computers ( ) ) { if ( c get name ( ) length ( ) = = 0 ) { continue ; / / master } list < log record > recs = new array list < > ( ) ; try { for ( log record rec : c get log records ( ) ) { for ( target t : targets ) { if ( t includes ( rec ) ) { recs add ( rec ) ; break ; } } } } catch ( i o exception | interrupted exception x ) { continue ; } if ( ! recs is empty ( ) ) { result put ( c , recs ) ; } } return result ; }


returns the preferred resources of this data sink if no preferred resources have been set , this returns the default resource profile

public resource spec get preferred resources ( ) { return this preferred resources ; }


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

public response entity < void > test group parameters ( @ not null @ api param ( value = " required string in group parameters " , required = true ) @ valid @ request param ( value = " required string group " , required = true ) integer required string group , @ api param ( value = " required boolean in group parameters " , required = true ) @ request header ( value = " required boolean group " , required = true ) boolean required boolean group , @ not null @ api param ( value = " required integer in group parameters " , required = true ) @ valid @ request param ( value = " required int 6 4 group " , required = true ) long required int 6 4 group , @ api param ( value = " string in group parameters " ) @ valid @ request param ( value = " string group " , required = false ) integer string group , @ api param ( value = " boolean in group parameters " ) @ request header ( value = " boolean group " , required = false ) boolean boolean group , @ api param ( value = " integer in group parameters " ) @ valid @ request param ( value = " int 6 4 group " , required = false ) long int 6 4 group ) { return new response entity < > ( http status not implemented ) ; }


teturns whether or not the node stores data

public boolean is data ( ) { return roles contains ( " data " ) ; }


tells a plugin that it is no longer needed the plugin should remove itself from anything that it is registered to and release any resources

public void dispose ( ) { / / close all editors dismiss editors ( null ) ; }


creates list of users with given input array

public void create users with list input test ( ) { list < user > body = null ; / / api create users with list input ( body ) ; / / todo : test validations }


public int get code ( ) { return code ; }


sets the minimum and maximum frame to the start marker start and the maximum frame to the end marker start play end marker start frame determines whether or not to play the frame that the end marker is on if the end marker represents the end of the section that you want , it should be true if the marker represents the beginning of the next section , it should be false

public void set min and max frame ( final string start marker name , final string end marker name , final boolean play end marker start frame ) { if ( composition = = null ) { lazy composition tasks add ( new lazy composition task ( ) { @ override public void run ( lottie composition composition ) { set min and max frame ( start marker name , end marker name , play end marker start frame ) ; } } ) ; return ; } marker start marker = composition get marker ( start marker name ) ; if ( start marker = = null ) { throw new illegal argument exception ( " cannot find marker with name " + start marker name + " " ) ; } int start frame = ( int ) start marker start frame ; final marker end marker = composition get marker ( end marker name ) ; if ( end marker = = null ) { throw new illegal argument exception ( " cannot find marker with name " + end marker name + " " ) ; } int end frame = ( int ) ( end marker start frame + ( play end marker start frame ? 1f : 0f ) ) ; set min and max frame ( start frame , end frame ) ; }


tells the background thread to stop does not wait for it to exit

public void stop ( ) { if ( compare and set state ( new state [ ] { state running , state starting } , state stopping ) ) { watcher thread interrupt ( ) ; } }


returns the given string if it is nonempty ; { @ code null } otherwise

public static string empty to null ( @ nullable decl string string ) { return platform empty to null ( string ) ; }


matches the middle of each string to its pattern

private static int index middle ( binary string data pattern , memory segment [ ] segments , int start , int len ) { return segments util find ( segments , start , len , pattern get segments ( ) , pattern get offset ( ) , pattern get size in bytes ( ) ) ; }


adds a standard border with the title that corresponds to the given key in the gui resources

private void add border ( j component component , string title key ) { border old border = component get border ( ) ; border new border = border factory create titled border ( border , msg ( title key ) ) ; component set border ( old border = = null ? new border : new compound border ( new border , old border ) ) ; }


public void execute ( file system fs ) throws i o exception { fs modify acl entries ( path , acl entries ) ; return null ; }


public static boolean is quota set ( quota usage quota ) { if ( quota ! = null ) { long ns quota = quota get quota ( ) ; long ss quota = quota get space quota ( ) ; / / once ns quota or ss quota was set , this mount table is quota set if ( ns quota ! = hdfs constants quota reset | | ss quota ! = hdfs constants quota reset | | quota or by storage type ( t - > quota get type quota ( t ) ! = hdfs constants quota reset ) ) { return true ; } } return false ; }


overridden since spring ' s rule - based j unit support cannot properly integrate with timed execution that is controlled by a third - party runner

public void transactional with j unit timeout ( ) { assert that transaction ( ) is not active ( ) ; }


returns the product of { @ code a } and { @ code b } unless it would overflow or underflow in which case { @ code long max value } or { @ code long min value } is returned , respectively

public static long saturated multiply ( long a , long b ) { / / see checked multiply for explanation int leading zeros = long number of leading zeros ( a ) + long number of leading zeros ( ~ a ) + long number of leading zeros ( b ) + long number of leading zeros ( ~ b ) ; if ( leading zeros > long size + 1 ) { return a * b ; } / / the return value if we will overflow ( which we calculate by overflowing a long : ) ) long limit = long max value + ( ( a ^ b ) > > > ( long size - 1 ) ) ; if ( leading zeros < long size | ( a < 0 & b = = long min value ) ) { / / overflow return limit ; } long result = a * b ; if ( a = = 0 | | result / a = = b ) { return result ; } return limit ; }


private void log memory group refinement ( ) throws cancelled exception { / / note that i ' ve seen example where pe header has two data sections ( one for initialized / / and the other for uninitialized , 0x 2 8 0 0 and 0x 2 5 0 in size , respectively ) , but the pdb / / information shows two sections totally 0x 2a 5 0 size , but sizes of 0x 2 7 5 0 and 0x 0 3 0 0 , / / the latter of which is marked as " bss " in name this suggests that the pe header is / / more focused on what needs initialized , which includes 0x 2 7 5 0 of data and 0xa 0 of / / bss , the remaining 0x 2 5 0 of bss is not initialized these bss portion that needs / / initialized is lumped with the data section in the pe header only my opinion / / however , this leaves us with question of what we do here do believe the pdb over / / the pe ? ( see vcamp 1 1 0 arm pdb and ( arm ) vcamp 1 1 0 dll ) / / todo : should we perform refinement of program memory blocks ? pdb log message ( " \ n memory group refinement " ) ; for ( pe coff group ms symbol sym : memory group refinement ) { applicator check canceled ( ) ; string name = sym get name ( ) ; int segment = sym get segment ( ) ; long offset = sym get offset ( ) ; int length = sym get length ( ) ; int characteristics = sym get characteristics ( ) ; address address = get address ( sym ) ; pdb log message ( string format ( " % s : [ % 04x : % 08x ] ( % s ) len : % 08x , characteristics : % 08x " , name , segment , offset , address to string ( ) , length , characteristics ) ) ; } } / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = / / todo : this is not complete it was a research thought , which might get looked at in the / / future


returns the machine type ( or processor )

public short get machine ( ) { return machine ; }


public string get small snake ( ) { return small snake ; }


correct broken data gracefully ( # 1537 )

private object read resolve ( ) { if ( child projects = = null ) return child projects = " " ; return this ; }


public void do progressive log ( stapler request req , stapler response rsp ) throws i o exception { get log text ( ) do progress text ( req , rsp ) ; }


run the registered command with name cmd name commands should not produce any exceptions ; any ( anticipated ) errors should be reported in the " error " entry of the returned map likewise , if no command with the given name is registered , this will be noted in the " error " entry

public static command response run command ( string cmd name , zoo keeper server zk server , map < string , string > kwargs ) { command command = get command ( cmd name ) ; if ( command = = null ) { return new command response ( cmd name , " unknown command : " + cmd name ) ; } if ( command is server required ( ) & & ( zk server = = null | | ! zk server is running ( ) ) ) { return new command response ( cmd name , " this zoo keeper instance is not currently serving requests " ) ; } return command run ( zk server , kwargs ) ; }


get replica state as reported by the data - node

hdfs server constants replica state get state ( ) { return state ; }


like { @ link # offset px } , but the relative offset is based on a percentage of the mount content height

public static dimension value height percentage offset ( float value ) { return new dimension value ( type offset height percentage , value ) ; }


protected server get server ( ) { return server ; }


returns a writer for writing to this file using the default charset parent directories will be created if necessary

public writer writer ( boolean append ) { return writer ( append , null ) ; }


returns the number of megabytes corresponding to the provided input for a particular unit of memory

public double to mega bytes ( final long input ) { double megabytes ; switch ( this ) { case bytes : megabytes = input / bytes per kilobyte / kilobytes per megabyte ; break ; case kilobytes : megabytes = input / kilobytes per megabyte ; break ; case megabytes : megabytes = input ; break ; case gigabytes : megabytes = input * megabytes per gigabyte ; break ; default : throw new runtime exception ( " no value ' " + this + " ' recognized for enum memory unit " ) ; } return megabytes ; }


make sure that the differ is in a correct state , and then running it produces no changes

private void check differ state ( ) { differ observer operation count = 0 ; test adapter register adapter data observer ( differ observer ) ; test adapter notify models changed ( ) ; test adapter unregister adapter data observer ( differ observer ) ; assert assert equals ( " should not have any operations " , 0 , differ observer operation count ) ; }


creates a new min - max priority queue using natural order , no maximum size , and initially containing the given elements

public static < e extends comparable < e > > min max priority queue < e > create ( iterable < ? extends e > initial contents ) { return new builder < e > ( ordering < e > natural ( ) ) create ( initial contents ) ; }


schedules a build of this project , and returns a { @ link future } object to wait for the completion of the build

public queue task future < r > schedule build 2 ( int quiet period , cause c ) { return schedule build 2 ( quiet period , c , new action [ 0 ] ) ; }


public static void main ( string [ ] args ) throws exception { var context = new default camel context ( ) ; context add routes ( new route builder ( ) { @ override public void configure ( ) throws exception { from ( " direct : origin " ) multicast ( ) to ( " mock : foo " , " mock : bar " , " stream : out " ) ; } } ) ; var template = context create producer template ( ) ; context start ( ) ; context get routes ( ) for each ( r - > logger info ( r to string ( ) ) ) ; template send body ( " direct : origin " , " hello from origin " ) ; context stop ( ) ; }


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


resume the background refresh thread and return the value of group names

public static void resume ( ) { / / if latch is null , it means pause was not called and it is / / safe to ignore if ( latch ! = null ) { latch count down ( ) ; } }


public int hash code ( ) { return path ! = null ? path hash code ( ) : 0 ; }


get class desc object class = > " ljavalang object ; " boolean [ ] class = > " [ z "

public static string get desc ( final ct class c ) throws not found exception { string builder ret = new string builder ( ) ; if ( c is array ( ) ) { ret append ( ' [ ' ) ; ret append ( get desc ( c get component type ( ) ) ) ; } else if ( c is primitive ( ) ) { string t = c get name ( ) ; if ( " void " equals ( t ) ) { ret append ( jvm void ) ; } else if ( " boolean " equals ( t ) ) { ret append ( jvm boolean ) ; } else if ( " byte " equals ( t ) ) { ret append ( jvm byte ) ; } else if ( " char " equals ( t ) ) { ret append ( jvm char ) ; } else if ( " double " equals ( t ) ) { ret append ( jvm double ) ; } else if ( " float " equals ( t ) ) { ret append ( jvm float ) ; } else if ( " int " equals ( t ) ) { ret append ( jvm int ) ; } else if ( " long " equals ( t ) ) { ret append ( jvm long ) ; } else if ( " short " equals ( t ) ) { ret append ( jvm short ) ; } } else { ret append ( ' l ' ) ; ret append ( c get name ( ) replace ( ' ' , ' / ' ) ) ; ret append ( ' ; ' ) ; } return ret to string ( ) ; }


tests that the { @ link future # get ( ) } method blocks until a value is available

public void test get blocks until value available ( ) throws throwable { assert false ( future is done ( ) ) ; assert false ( future is cancelled ( ) ) ; final count down latch success latch = new count down latch ( 1 ) ; final throwable [ ] badness = new throwable [ 1 ] ; / / wait on the future in a separate thread new thread ( new runnable ( ) { @ override public void run ( ) { try { assert same ( boolean true , future get ( ) ) ; success latch count down ( ) ; } catch ( throwable t ) { t print stack trace ( ) ; badness [ 0 ] = t ; } } } ) start ( ) ; / / release the future value latch count down ( ) ; assert true ( success latch await ( 10 , time unit seconds ) ) ; if ( badness [ 0 ] ! = null ) { throw badness [ 0 ] ; } assert true ( future is done ( ) ) ; assert false ( future is cancelled ( ) ) ; }


convert the given object to string with each line indented by 4 spaces ( except the first line )

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


security context create context ( security configuration security config ) throws security context initialize exception ;


public void define return value ( object ret ) { this is continue = false ; this ret = ret ; }


string representation includes the i o statistics when logging is at debug

public string to string ( ) { final string builder sb = new string builder ( " s 3 a instrumentation { " ) ; if ( log is debug enabled ( ) ) { sb append ( " instance i o statistics = " ) append ( instance i o statistics ) ; } sb append ( ' } ' ) ; return sb to string ( ) ; }


returns a { @ link session command group } with custom commands to publish to the controller , or { @ code null } if no custom commands should be published

session command group get custom commands ( media session session , controller info controller info ) ;


this namespace destroys all thread pool resources under the grouping

public void destroy ( final string namespace , final string group ) { final object monitor = lockers get ( namespace ) ; if ( monitor = = null ) { return ; } synchronized ( monitor ) { map < string , set < executor service > > sub resource = resources manager get ( namespace ) ; if ( sub resource = = null ) { return ; } set < executor service > wait destroy = sub resource get ( group ) ; for ( executor service executor : wait destroy ) { thread utils shutdown thread pool ( executor ) ; } resources manager get ( namespace ) remove ( group ) ; } }


sets the requirements that need to be met for downloads to progress

public void set requirements ( requirements requirements ) { if ( requirements equals ( requirements watcher get requirements ( ) ) ) { return ; } requirements watcher stop ( ) ; requirements watcher = new requirements watcher ( context , requirements listener , requirements ) ; int not met requirements = requirements watcher start ( ) ; on requirements state changed ( requirements watcher , not met requirements ) ; }


stores a key - value pair in the multimap

public boolean put ( @ nullable decl k key , @ nullable decl v value ) { return super put ( key , value ) ; }


public static void main ( string [ ] args ) throws exception { boolean usage = false ; int server port = 0 ; int driver port = 0 ; for ( string arg : args ) { if ( ! arg starts with ( " - - " ) ) { system err println ( " all arguments must start with ' - - ' : " + arg ) ; usage = true ; break ; } string [ ] parts = arg substring ( 2 ) split ( " = " , 2 ) ; string key = parts [ 0 ] ; if ( " help " equals ( key ) ) { usage = true ; break ; } if ( parts length ! = 2 ) { system err println ( " all arguments must be of the form - - arg = value " ) ; usage = true ; break ; } string value = parts [ 1 ] ; if ( " server port " equals ( key ) ) { server port = integer value of ( value ) ; } else if ( " driver port " equals ( key ) ) { driver port = integer value of ( value ) ; } else { system err println ( " unknown argument : " + key ) ; usage = true ; break ; } } if ( usage | | driver port = = 0 ) { system err println ( " usage : [ args ] " + " \ n " + " \ n - - driver port = < port > " + " \ n port to expose grpc testing worker service , used by driver to initiate work " + " \ n - - server port = < port > " + " \ n port to start load servers on , if not specified by the server config " + " \ n message defaults to any available port " ) ; system exit ( 1 ) ; } load worker load worker = new load worker ( driver port , server port ) ; load worker start ( ) ; load worker driver server await termination ( ) ; log log ( level info , " driver server has terminated " ) ; / / allow enough time for quit worker to deliver ok status to the driver thread sleep ( 3000 ) ; }


set the sort definition for this holder typically an instance of mutable sort definition

public void set sort ( @ nullable sort definition sort ) { this sort = sort ; }


start a new line of output , reset values

private void new line ( ) { num blocks = 0 ; perms = username = group = path = link target = " " ; filesize = 0l ; replication = 0 ; in inode = true ; }


public void set before image ( table records before image ) { this before image = before image ; }


void cancel ( execution vertex i d execution vertex id ) ;


configures whether to split dex files along with class files

public split zip set split dexed classes ( boolean flag ) { split dex files = flag ; return this ; }


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


returns the escaped form of a given literal string , starting at the given index this method is called by the { @ link # escape ( string ) } method when it discovers that escaping is required it is protected to allow subclasses to override the fastpath escaping function to inline their escaping test see { @ link char escaper builder } for an example usage

protected final string escape slow ( string s , int index ) { int slen = s length ( ) ; / / get a destination buffer and setup some loop variables char [ ] dest = platform char buffer from thread local ( ) ; int dest size = dest length ; int dest index = 0 ; int last escape = 0 ; / / loop through the rest of the string , replacing when needed into the / / destination buffer , which gets grown as needed as well for ( ; index < slen ; index + + ) { / / get a replacement for the current character char [ ] r = escape ( s char at ( index ) ) ; / / if no replacement is needed , just continue if ( r = = null ) { continue ; } int rlen = r length ; int chars skipped = index - last escape ; / / this is the size needed to add the replacement , not the full size / / needed by the string we only regrow when we absolutely must , and / / when we do grow , grow enough to avoid excessive growing grow int size needed = dest index + chars skipped + rlen ; if ( dest size < size needed ) { dest size = size needed + dest pad multiplier * ( slen - index ) ; dest = grow buffer ( dest , dest index , dest size ) ; } / / if we have skipped any characters , we need to copy them now if ( chars skipped > 0 ) { s get chars ( last escape , index , dest , dest index ) ; dest index + = chars skipped ; } / / copy the replacement string into the dest buffer as needed if ( rlen > 0 ) { system arraycopy ( r , 0 , dest , dest index , rlen ) ; dest index + = rlen ; } last escape = index + 1 ; } / / copy leftover characters if there are any int chars left = slen - last escape ; if ( chars left > 0 ) { int size needed = dest index + chars left ; if ( dest size < size needed ) { / / regrow and copy , expensive ! no padding as this is the final copy dest = grow buffer ( dest , dest index , size needed ) ; } s get chars ( last escape , slen , dest , dest index ) ; dest index = size needed ; } return new string ( dest , 0 , dest index ) ; }


get userlogout : logs out current logged in user session

default response entity < void > logout user ( ) { return new response entity < > ( http status not implemented ) ; }


return declared " consumable " types but only among those that also match the " methods " condition

public set < media type > get consumable media types ( ) { set < media type > result = new linked hash set < > ( ) ; for ( partial match match : this partial matches ) { if ( match has methods match ( ) ) { result add all ( match get info ( ) get consumes condition ( ) get consumable media types ( ) ) ; } } return result ; }


public collection < ? extends cas event > get events of type ( final string type ) { val query = dynamo db query builder builder ( ) key ( column names type get column name ( ) ) attribute value ( list of ( attribute value builder ( ) s ( type ) build ( ) ) ) operator ( comparison operator eq ) build ( ) ; return get records by keys ( query ) ; }


model tests for additional properties string

public void test additional properties string ( ) { / / todo : test additional properties string }


returns an immutable set of the values for the given key if no mappings in the multimap have the provided key , an empty immutable set is returned the values are in the same order as the parameters used to build this multimap

public immutable set < v > get ( @ nullable decl k key ) { / / this cast is safe as its type is known in constructor immutable set < v > set = ( immutable set < v > ) map get ( key ) ; return more objects first non null ( set , empty set ) ; }


public big decimal get length cm ( ) { return length cm ; }


to be used when - - universe scope is set

static universe scope from universe scope list ( immutable list < string > constant universe scope ) { return new constant universe scope ( constant universe scope ) ; }


sets the next media period holder in the queue

public void set next ( @ nullable media period holder next media period holder ) { if ( next media period holder = = next ) { return ; } disable track selections in result ( ) ; next = next media period holder ; enable track selections in result ( ) ; }


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


public void move ( int src , int dest , int length ) { dirty = true ; system arraycopy ( data , src , data , dest , length ) ; }


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

public static fields find by thrift id ( int field id ) { switch ( field id ) { default : return null ; } }


public int chunk size ( ) { return allocator chunk size ( ) ; }


public boolean is empty ( ) { return size = = 0 ; }


public string to string ( ) { string builder buf = new string builder ( ) ; for ( int i = 0 ; i < args size ( ) ; i + + ) { string arg = args get ( i ) ; if ( mask get ( i ) ) arg = " * * * * * * " ; if ( buf length ( ) > 0 ) buf append ( ' ' ) ; if ( arg index of ( ' ' ) > = 0 | | arg length ( ) = = 0 ) buf append ( ' " ' ) append ( arg ) append ( ' " ' ) ; else buf append ( arg ) ; } return buf to string ( ) ; }


the bulk iteration meta operator cannot have broadcast inputs this method always throws an exception

public void set broadcast variable ( string name , operator < ? > root ) { throw new unsupported operation exception ( " the bulk iteration meta operator cannot have broadcast inputs " ) ; }


the center about which to apply the distortion , with a default of ( 0 5 , 0 5 )

public void set center ( point f center ) { this center = center ; set point ( center location , center ) ; }


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


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


not supported this method exists only to hide { @ link immutable set # builder with expected size } from consumers of { @ code immutable sorted set }

public static < e > immutable sorted set builder < e > builder with expected size ( int expected size ) { throw new unsupported operation exception ( ) ; }


returns the time when the result was created , in milliseconds since epoch

public long get time ( ) { return time ; }


inform this skyframe executor that a new command is starting


set the class loader that will be used to load the various objects

public void set class loader ( class loader class loader ) { this class loader = class loader ; }


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


public optimizer node get target ( ) { return this target ; }


convert the given object to string with each line indented by 4 spaces ( except the first line )

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


get the scheme for this specific fetcher

protected string get scheme ( ) { return file system uri schemes abfs secure scheme ; }


returns the offset from the virtual base table entry

long get offset ( address address , int ordinal , int size ) throws pdb exception { virtual base table table = vbt by address get ( address ) ; if ( table = = null ) { throw new pdb exception ( " virtual base table does not exist for address : " + address ) ; } if ( ! ( table instanceof pdb virtual base table ) ) { throw new pdb exception ( " not a pdb virtual base table for address : " + address ) ; } virtual base table entry entry = ( ( pdb virtual base table ) table ) get or parse entry by ordinal ( ordinal ) ; return entry get offset ( ) ; }


creates a packaged program from the given command line options and the effective configuration

packaged program build program ( final program options run options , final configuration configuration ) throws file not found exception , program invocation exception , cli args exception { run options validate ( ) ; string [ ] program args = run options get program args ( ) ; string jar file path = run options get jar file path ( ) ; list < url > classpaths = run options get classpaths ( ) ; / / get assembler class string entry point class = run options get entry point class name ( ) ; file jar file = jar file path ! = null ? get jar file ( jar file path ) : null ; return packaged program new builder ( ) set jar file ( jar file ) set user class paths ( classpaths ) set entry point class name ( entry point class ) set configuration ( configuration ) set savepoint restore settings ( run options get savepoint restore settings ( ) ) set arguments ( program args ) build ( ) ; }


filters should handle white - listing correctly

@ test public void include only should only include matched ( ) { subset configuration wl = new config builder ( ) add ( " p include " , " foo " ) add ( " p include tags " , " foo : f " ) subset ( " p " ) ; should accept ( wl , " foo " ) ; should accept ( wl , arrays as list ( tag ( " bar " , " " , " " ) , tag ( " foo " , " " , " f " ) ) , new boolean [ ] { false , true } ) ; should accept ( wl , mock metrics record ( " foo " , arrays as list ( tag ( " bar " , " " , " " ) , tag ( " foo " , " " , " f " ) ) ) ) ; should reject ( wl , " bar " ) ; should reject ( wl , arrays as list ( tag ( " bar " , " " , " " ) ) ) ; should reject ( wl , arrays as list ( tag ( " foo " , " " , " boo " ) ) ) ; should reject ( wl , mock metrics record ( " bar " , arrays as list ( tag ( " foo " , " " , " f " ) ) ) ) ; should reject ( wl , mock metrics record ( " foo " , arrays as list ( tag ( " bar " , " " , " " ) ) ) ) ; }


match all classes that both of the given class filters match

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


public boolean is verifying ssl ( ) { return verifying ssl ; }