returns the length - limited description the method tries to take html tags within the description into account , but it is a best - effort attempt also , the method will likely not work properly if a non - html { @ link hudson markup markup formatter } is used

public @ check for null string get truncated description ( ) { if ( truncated description limit < 0 ) { / / disabled return description ; } if ( truncated description limit = = 0 ) { / / someone wants to suppress descriptions , why not ? return " " ; } final int max descr length = truncated description limit ; final string local description = description ; if ( local description = = null | | local description length ( ) < max descr length ) { return local description ; } final string ending = " " ; final int sz = local description length ( ) , max trunc length = max descr length - ending length ( ) ; boolean in tag = false ; int display chars = 0 ; int last truncatable point = - 1 ; for ( int i = 0 ; i < sz ; i + + ) { char ch = local description char at ( i ) ; if ( ch = = ' < ' ) { in tag = true ; } else if ( ch = = ' > ' ) { in tag = false ; if ( display chars < = max trunc length ) { last truncatable point = i + 1 ; } } if ( ! in tag ) { display chars + + ; if ( display chars < = max trunc length & & ch = = ' ' ) { last truncatable point = i ; } } } string trunc desc = local description ; / / could not find a preferred truncatable index , force a trunc at max trunc length if ( last truncatable point = = - 1 ) last truncatable point = max trunc length ; if ( display chars > = max descr length ) { trunc desc = trunc desc substring ( 0 , last truncatable point ) + ending ; } return trunc desc ; }


generate salted md5 hash for specified message supplied salt is returned as prefix to returned hash

public static char [ ] get salted m d 5 hash ( char [ ] salt , char [ ] msg ) { return hash utilities get salted hash ( hash utilities md5 algorithm , salt , msg ) ; }


public distro data on query ( distro key distro key ) { string resource type = distro key get resource type ( ) ; distro data storage distro data storage = distro component holder find data storage ( resource type ) ; if ( null = = distro data storage ) { loggers distro warn ( " [ distro ] can ' t find data storage for received key { } " , resource type ) ; return new distro data ( distro key , new byte [ 0 ] ) ; } return distro data storage get distro data ( distro key ) ; }


sets the maximum allowed number of dns queries to send when resolving a host name

public dns name resolver builder max queries per resolve ( int max queries per resolve ) { this max queries per resolve = max queries per resolve ; return this ; }


public void clear ( list < ? > list ) { int size = list size ( ) ; list clear ( ) ; notify item range removed ( 0 , size ) ; }


return the first readable storage file of the given name across any of the ' current ' directories in s ds of the given type , or null if no such file exists

private file find file ( name node dir type dir type , string name ) { for ( storage directory sd : dir iterable ( dir type ) ) { file candidate = new file ( sd get current dir ( ) , name ) ; if ( file util can read ( sd get current dir ( ) ) & & candidate exists ( ) ) { return candidate ; } } return null ; }


convert the given request object to serialized form , possibly using a { @ link org springframework messaging converter message converter } , send it as a { @ link message } with the given headers , to the specified destination , receive the reply and convert its body of the specified target class

< t > t convert send and receive ( string destination name , object request , @ nullable map < string , object > headers , class < t > target class ) throws messaging exception ;


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

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


note : currently the concept of minmax idle state retention has been deprecated and only idle state retention time is supported the min idle state retention is regarded as idle state retention and the max idle state retention is derived from idle state retention as 1 5 x idle state retention

public long get max idle state retention time ( ) { return get min idle state retention time ( ) * 3 / 2 ; }


public long get total ( ) { return this total ; }


returns the inner { @ link create index request } allows to configure mappings , settings and aliases for the new index

public create index request get create index request ( ) { return create index request ; }


private item get consistent item ( final path path ) throws i o exception { primary key key = path to key ( path ) ; final get item spec spec = new get item spec ( ) with primary key ( key ) with consistent read ( true ) ; / / strictly consistent read return read op retry ( " get " , path to string ( ) , true , ( ) - > { records read ( 1 ) ; return table get item ( spec ) ; } ) ; }


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


public object get anytype 3 ( ) { return anytype 3 ; }


public album page navigate to page ( ) { try { page = this web client get page ( page url ) ; } catch ( i o exception e ) { e print stack trace ( ) ; } return this ; }


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


a version of { @ link hdfs admin # get inotify event stream ( ) } meant for advanced users who are aware of hdfs edits up to last read txid ( e g because they have access to an f s image inclusive of last read txid ) and only want to read events after this point

public d f s inotify event input stream get inotify event stream ( long last read txid ) throws i o exception { return dfs get inotify event stream ( last read txid ) ; }


throws the excpetion for when an attempt is made to write past the end of the instance

private static void throw bounds ( ) { throw new index out of bounds exception ( " attempt to write past the end " ) ; }


creates an empty optional using reflection to stay backwards - compatible with older j d ks

public static object empty optional ( ) { / / no need for double - checked locking if ( empty optional ! = null ) { return empty optional ; } return empty optional = invoke nullary factory method ( " java util optional " , " empty " ) ; }


public void db error ( i o exception e ) { err handler db error ( e ) ; }


this supplier is used for all fields that expect to be aggregated as a numeric value this includes floating points , and formatted types that use numerics internally for storage ( date , boolean , etc )

private static significant terms aggregator supplier numeric supplier ( ) { return new significant terms aggregator supplier ( ) { @ override public aggregator build ( string name , aggregator factories factories , values source values source , doc value format format , terms aggregator bucket count thresholds bucket count thresholds , include exclude include exclude , string execution hint , aggregation context context , aggregator parent , significance heuristic significance heuristic , significance lookup lookup , cardinality upper bound cardinality , map < string , object > metadata ) throws i o exception { if ( ( include exclude ! = null ) & & ( include exclude is regex based ( ) ) ) { throw new illegal argument exception ( " aggregation [ " + name + " ] cannot support regular expression style include / exclude " + " settings as they can only be applied to string fields use an array of numeric " + " values for include / exclude clauses used to filter numeric fields " ) ; } values source numeric numeric values source = ( values source numeric ) values source ; if ( numeric values source is floating point ( ) ) { throw new unsupported operation exception ( " no support for examining floating point numerics " ) ; } include exclude long filter long filter = null ; if ( include exclude ! = null ) { long filter = include exclude convert to long filter ( format ) ; } return new numeric terms aggregator ( name , factories , agg - > agg new significant long terms results ( lookup , significance heuristic , cardinality ) , numeric values source , format , null , bucket count thresholds , context , parent , sub agg collection mode breadth first , long filter , cardinality , metadata ) ; } } ; }


register one or more component classes to be processed note that { @ link # refresh ( ) } must be called in order for the context to fully process the new classes

public void register ( class < ? > component classes ) { assert not empty ( component classes , " at least one component class must be specified " ) ; collections add all ( this component classes , component classes ) ; }


determine if directory is empty call with lock held

private tristate is empty directory ( path p ) { dir listing metadata dlm = get dir listing meta ( p ) ; return dlm without tombstones ( ) is empty ( ) ; }


< b > warning : < b > this is a dangerous method and should only be used for testing convenience a method that blocks until availability does not go together well with the concept of asynchronous notifications and non - blocking polling get and remove the first element from the queue the call blocks if the queue is empty the problem with this method is that it may loop internally until an element is available and that way eagerly reset the availability future if a consumer thread is blocked in taking an element , it will receive availability notifications from { @ link # notify available ( ) } and immediately reset them by calling { @ link # poll ( ) } and finding the queue empty

public t take ( ) throws interrupted exception { t next ; while ( ( next = poll ( ) ) = = null ) { / / use the future to wait for availability to avoid busy waiting try { get availability future ( ) get ( ) ; } catch ( execution exception | completion exception e ) { / / this should never happen , but we propagate just in case throw new flink runtime exception ( " exception in queue future completion " , e ) ; } } return next ; }


the sequence number of the document that was used to create this watch , { @ link sequence numbers # unassigned seq no } if the watch wasn ' t read from a document

public long get source seq no ( ) { return source seq no ; }


emits a record to the side output identified by the { @ link output tag }

public abstract < x > void output ( output tag < x > output tag , x value ) ;


if the mouse is dragging a rectangle , pick the vertices contained in that rectangle clean up settings from mouse pressed

public void mouse released ( mouse event e ) { visualization viewer < v , e > vv = ( visualization viewer < v , e > ) e get source ( ) ; if ( e get modifiers ex ( ) = = this add to selection modifiers ) { if ( down ! = null ) { point 2 d out = e get point ( ) ; if ( vertex = = null & & hey thats too close ( down , out , 5 ) = = false ) { pick contained vertices ( vv , down , out , false ) ; } } } else { / / mouse released without the ' add to selection ' modifiers see if we have been dragging if ( down ! = null ) { / / check to see if we were dragging ( no vertex picked and a large enough rectangle ) point 2 d out = e get point ( ) ; if ( vertex = = null & & hey thats too close ( down , out , 5 ) = = false ) { pick contained vertices ( vv , down , out , true ) ; } } } down = null ; vertex = null ; edge = null ; rect set frame ( 0 , 0 , 0 , 0 ) ; vv remove post render paintable ( lens paintable ) ; vv repaint ( ) ; }


public int action save ( string file name , string app name , long lifetime , string queue ) throws i o exception , yarn exception { int result = exit success ; try { service service = load app json from local f s ( file name , app name , lifetime , queue ) ; service set state ( service state stopped ) ; string buffer = json ser deser to json ( service ) ; client response response = get api client ( ) post ( client response class , buffer ) ; result = process response ( response ) ; } catch ( exception e ) { log error ( " fail to save application : " , e ) ; result = exit exception thrown ; } return result ; }


returns the mock fs without checking fs type

protected file system get destination f s ( path out , configuration config ) throws i o exception { return out get file system ( config ) ; }


test serialization of object with outer number type

public void fake outer composite serialize test ( ) throws api exception { outer composite body = null ; outer composite response = api fake outer composite serialize ( body ) ; / / todo : test validations }


writes a portion of a { @ code byte [ ] } to this instance

public void write ( byte [ ] bytes , int offset , int length ) ;


the test expects read ahead manager to return data from previously read ahead data of same offset

public void test read ahead manager for successful read ahead ( ) throws exception { / / mock failure for client read ( ) abfs client client = get mock abfs client ( ) ; / / success operation mock abfs rest operation op = get mock rest op ( ) ; / / stub : / / pass all read aheads and fail the post eviction request to / / prove read ahead buffer is used do return ( op ) do return ( op ) do return ( op ) do throw ( new timeout exception ( " internal server error for rah - x " ) ) / / for post eviction request do throw ( new timeout exception ( " internal server error for rah - y " ) ) do throw ( new timeout exception ( " internal server error for rah - z " ) ) when ( client ) read ( any ( string class ) , any ( long class ) , any ( byte [ ] class ) , any ( integer class ) , any ( integer class ) , any ( string class ) , any ( string class ) ) ; abfs input stream input stream = get abfs input stream ( client , " test successful read ahead txt " ) ; queue read aheads ( input stream ) ; / / abfs input stream read would have waited for the read - ahead for the requested offset / / as we are testing from read ahead manager directly , sleep for a sec to / / get the read ahead threads to complete thread sleep ( 1000 ) ; / / only the 3 read ahead threads should have triggered client read verify read call count ( client , 3 ) ; / / get block for a new read should return the buffer read - ahead int bytes read = read buffer manager get buffer manager ( ) get block ( input stream , one kb , one kb , new byte [ one kb ] ) ; assert assert true ( " bytes read should be non - zero from the " + " buffer that was read - ahead " , bytes read > 0 ) ; / / once created , mock will remember all interactions / / as the above read should not have triggered any server calls , total / / number of read calls made at this point will be same as last verify read call count ( client , 3 ) ; / / stub will throw exception for client read ( ) for 4th and later calls / / if not using the read - ahead buffer exception will be thrown on read check evicted status ( input stream , 0 , true ) ; }


failure recovery after processing 23 data with time characteristic : event time producer parallelism = 1 ; kafka partition # = 1 ; consumer parallelism = 1

public void test failure recovery event time ( ) throws exception { test kafka shuffle failure recovery ( 1000 , event time ) ; }


return the additional ( undeclared ) property with the specified name

public object get additional property ( string key ) { if ( this additional properties = = null ) { return null ; } return this additional properties get ( key ) ; }


public static byte [ ] decode base 6 4 ( byte [ ] base 6 4 data ) { return new base 6 4 ( ) decode ( base 6 4 data ) ; }


returns { @ code true } if { @ code object } is an { @ code immutable int array } containing the same values as this one , in the same order

public boolean equals ( @ nullable decl object object ) { if ( object = = this ) { return true ; } if ( ! ( object instanceof immutable int array ) ) { return false ; } immutable int array that = ( immutable int array ) object ; if ( this length ( ) ! = that length ( ) ) { return false ; } for ( int i = 0 ; i < length ( ) ; i + + ) { if ( this get ( i ) ! = that get ( i ) ) { return false ; } } return true ; }


adds the diff details for the indicated register to the details document

private void add register diff details ( program context pc 1 , program context pc 2 , register reg 1 ) throws concurrent modification exception { string name = reg 1 get name ( ) ; register reg 2 = pc 2 get register ( name ) ; address range iterator p 1 address range iter = check p 1 address set get address ranges ( ) ; while ( p 1 address range iter has next ( ) ) { address range p 1 range = p 1 address range iter next ( ) ; address min 1 = p 1 range get min address ( ) ; address max 1 = p 1 range get max address ( ) ; address min 2 = simple diff utility get compatible address ( p 1 , min 1 , p 2 ) ; address max 2 = simple diff utility get compatible address ( p 1 , max 1 , p 2 ) ; address range iterator it 1 = pc 1 get register value address ranges ( reg 1 , min 1 , max 1 ) ; / / can throw concurrent modification exception address range iterator it 2 = pc 2 get register value address ranges ( reg 2 , min 2 , max 2 ) ; / / can throw concurrent modification exception / / combined address range iterator only works for iterators from the same program / / so convert the program 2 iterator to a program 1 iterator and pass it to the constructor address range iterator converter converted it 2 = new address range iterator converter ( it 2 , p 1 ) ; address range iterator p 1 combined iterator = new combined address range iterator ( it 1 , converted it 2 ) ; while ( p 1 combined iterator has next ( ) ) { address range addr range 1 = p 1 combined iterator next ( ) ; address range min 1 = addr range 1 get min address ( ) ; address range max 1 = addr range 1 get max address ( ) ; address range min 2 = simple diff utility get compatible address ( p 1 , range min 1 , p 2 ) ; big integer value 1 = pc 1 get value ( reg 1 , range min 1 , false ) ; big integer value 2 = pc 2 get value ( reg 2 , range min 2 , false ) ; boolean same value = ( value 1 = = null ) ? ( value 2 = = null ) : value 1 equals ( value 2 ) ; if ( ! same value ) { if ( ! has program context diffs ) { add diff header ( " program context " ) ; add display reg values ( null , range min 1 , range max 1 , value 1 , value 2 ) ; has program context diffs = true ; } add display reg values ( reg 1 , range min 1 , range max 1 , value 1 , value 2 ) ; } } } }


returns the action name for purposes of querying the crosstool

private string get action name ( ) { / / we check that this action is not lto - indexing , or when it is , it ' s either for executable / / or transitive or nodeps dynamic library preconditions check argument ( ! is lto indexing | | link type is executable ( ) | | link type is dynamic library ( ) ) ; if ( is lto indexing & & cpp configuration use standalone lto indexing command lines ( ) ) { if ( link type is executable ( ) ) { return cpp action names lto index executable ; } else if ( link type is transitive dynamic library ( ) ) { return cpp action names lto index dynamic library ; } else { return cpp action names lto index nodeps dynamic library ; } } return link type get action name ( ) ; }


returns an instance of { @ link rest client } pointing to the current node creates a new client if the method is invoked for the first time in the context of the current test scope the returned client gets automatically closed when needed , it shouldn ' t be closed as part of tests otherwise it cannot be reused by other tests anymore

protected rest client get rest client ( ) { return get rest client ( client ( ) ) ; }


returns the key class for a named output

public static class < ? > get named output key class ( job conf conf , string named output ) { check named output ( conf , named output , false ) ; return conf get class ( mo prefix + named output + key , null , object class ) ; }


return whether to toggle the ascending flag if the same property gets set again ( that is , { @ code set property } gets called with already set property name again )

public boolean is toggle ascending on property ( ) { return this toggle ascending on property ; }


set the query parameter values after removing all existing ones note : please , review the javadoc of { @ link # query param ( string , object ) } for further notes on the treatment and encoding of individual query parameters

uri builder replace query params ( multi value map < string , string > params ) ;


returns the time in milliseconds when this task will be executed next

public synchronized long get execute time millis ( ) { return execute time millis ; }


if the originating { @ link get index request } object was configured to include defaults , this will contain a mapping of index name to { @ link settings } objects the returned { @ link settings } objects will contain only those settings taking effect as defaults any settings explicitly set on the index will be available via { @ link # settings ( ) } see also { @ link get index request # include defaults ( boolean ) }

public immutable open map < string , settings > default settings ( ) { return default settings ; }


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


enqueues an event to be run on currently known listeners , with a label

public void enqueue ( event < l > event , string label ) { enqueue helper ( event , label ) ; }


check to see if guid and age in xml file matches g u i d signature and age of binary

private void verify pdb signature ( ) throws i o exception , pdb exception { xml element xmlelem ; try { xmlelem = parser peek ( ) ; } catch ( exception e ) { if ( ! is x m l ) { if ( has errors ( ) ) { throw new pdb exception ( get error and warning messages ( ) ) ; } throw new pdb exception ( " pdb execution failure of " + pdb exe + " \ n " + " this was likely caused by severe execution failure which can occur if executed \ n " + " on an unsupported platform it may be necessary to rebuild the pdb executable \ n " + " for your platform ( see ghidra / features / pdb / src ) " ) ; } throw new pdb exception ( " pdb parsing problem : " + e get message ( ) ) ; } if ( ! " pdb " equals ( xmlelem get name ( ) ) ) { throw new pdb exception ( " unexpected pdb xml element : " + xmlelem get name ( ) ) ; } string xml guid = xmlelem get attribute ( " guid " ) ; string xml age = xmlelem get attribute ( " age " ) ; string warning = " " ; string pdb guid = program attributes get pdb guid ( ) ; if ( pdb guid = = null ) { string pdb signature = program attributes get pdb signature ( ) ; if ( pdb signature ! = null ) { pdb guid = reformat signature to guid form ( pdb signature ) ; } } string pdb age = program attributes get pdb age ( ) ; if ( ( xml guid = = null ) | | ( pdb guid = = null ) ) { if ( xml guid = = null ) { warning + = " no guid was listed in the xml file " ; } if ( pdb guid = = null ) { warning + = " could not find a pdb guid for the binary " ; } warning + = " could not complete verification of matching pdb signatures " ; } else { / / reformat pdb guid so that it matches the way g u i ds are stored in xml pdb guid = pdb guid to upper case ( ) ; pdb guid = " { " + pdb guid + " } " ; if ( ! xml guid equals ( pdb guid ) ) { warning = " pdb signature does not match \ n " + " program guid : " + pdb guid + " \ n x m l guid : " + xml guid ; } else { / / also check that pdb ages match , if they are both available if ( ( xml age ! = null ) & & ( pdb age ! = null ) ) { int pdb age decimal = integer parse int ( pdb age , 16 ) ; int xml age decimal = integer parse int ( xml age ) ; if ( xml age decimal ! = pdb age decimal ) { warning = " pdb ages do not match " ; } } } } if ( warning length ( ) > 0 ) { if ( system utilities is in headless mode ( ) ) { throw new pdb exception ( warning + " skipping pdb processing " ) ; } int option = option dialog show yes no dialog ( null , " continue loading pdb ? " , warning + " \ n " + " \ n continue anyway ? " + " \ n " + " \ n please note : invalid disassembly may be produced ! " ) ; if ( option ! = option dialog option one ) { throw new pdb exception ( warning ) ; } } }


partition sigma and execute the computations

private summation execute ( string name , summation sigma ) { final summation [ ] summations = sigma partition ( parameters n jobs ) ; final list < computation > computations = new array list < computation > ( ) ; for ( int i = 0 ; i < summations length ; i + + ) computations add ( new computation ( i , name , summations [ i ] ) ) ; try { util execute ( parameters n threads , computations ) ; } catch ( exception e ) { throw new runtime exception ( e ) ; } final list < summation > combined = util combine ( arrays as list ( summations ) ) ; return combined size ( ) = = 1 ? combined get ( 0 ) : null ; }


paint each of the given nodes that is inside of the clips

private void paint nodes ( list < g tree node > nodes , graphics g ) { tree cell renderer cell renderer = tree get cell renderer ( ) ; rectangle clip = g get clip bounds ( ) ; container parent = tree get parent ( ) ; int y offset = 0 ; try { for ( g tree node node : nodes ) { int row = tree get row for path ( node get tree path ( ) ) ; rectangle row bounds = tree get row bounds ( row ) ; row bounds = swing utilities convert rectangle ( tree , row bounds , parent ) ; if ( clip y > row bounds y + row bounds height ) { continue ; / / above our clip } if ( clip y + clip height < row bounds y + row bounds height ) { / / painted past the bounds of our clip return ; } component renderer = cell renderer get tree cell renderer component ( tree , node , true , true , node is leaf ( ) , row , false ) ; renderer set size ( renderer get preferred size ( ) ) ; / / move down the point in our graphics space into which we will paint y offset + = row bounds height ; g translate ( 0 , row bounds height ) ; renderer paint ( g ) ; } } finally { / / restore the point into graphics that we will paint g translate ( 0 , - y offset ) ; } }


lightweight stack trace recorder tracks the calls of various print stack trace ( ) , and ensures that suppressed exceptions are printed only once

public void test lightweight stack trace recorder ( ) throws i o exception { mimic desugaring strategy strategy = new mimic desugaring strategy ( ) ; exception for test receiver = new exception for test ( strategy ) ; file not found exception suppressed = new file not found exception ( ) ; strategy add suppressed ( receiver , suppressed ) ; string trace = print stack trace stderr to string ( ( ) - > strategy print stack trace ( receiver ) ) ; assert that ( trace ) contains ( suppressed prefix ) ; assert that ( count occurrences ( trace , suppressed prefix ) ) is equal to ( 1 ) ; }


returns the current setting for blocks repl work multiplier , set by { @ code d f s config keys dfs namenode replication work multiplier per iteration }

public int get blocks repl work multiplier ( ) { return blocks repl work multiplier ; }


set the list of acceptable { @ linkplain charset charsets } , as specified by the { @ code accept - charset } header

b accept charset ( charset acceptable charsets ) ;


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

public select object content result select ( final path source , final select object content request request , final string action ) throws i o exception { string bucket name = request get bucket name ( ) ; preconditions check argument ( bucket equals ( bucket name ) , " wrong bucket : % s " , bucket name ) ; if ( log is debug enabled ( ) ) { log debug ( " initiating select call { } { } " , source , request get expression ( ) ) ; log debug ( select binding to string ( request ) ) ; } return invoker retry ( action , source to string ( ) , true , ( ) - > { try ( duration info ignored = new duration info ( log , " s3 select operation " ) ) { try { return owner get amazon s 3 client ( ) select object content ( request ) ; } catch ( amazon s 3 exception e ) { log error ( " failure of s3 select request against { } " , source ) ; log debug ( " s3 select request against { } : \ n { } " , source , select binding to string ( request ) , e ) ; throw e ; } } } ) ; }


returns all provided libraries needed to run the program

public static list < url > get job jar and dependencies ( file jar file , @ nullable string entry point class name ) throws program invocation exception { url jar file url = load jar file ( jar file ) ; list < file > extracted temp libraries = jar file url = = null ? collections empty list ( ) : extract contained libraries ( jar file url ) ; list < url > libs = new array list < url > ( extracted temp libraries size ( ) + 1 ) ; if ( jar file url ! = null ) { libs add ( jar file url ) ; } for ( file tmp lib : extracted temp libraries ) { try { libs add ( tmp lib get absolute file ( ) to u r i ( ) to u r l ( ) ) ; } catch ( malformed u r l exception e ) { throw new runtime exception ( " url is invalid this should not happen " , e ) ; } } if ( is python ( entry point class name ) ) { libs add ( packaged program utils get python jar ( ) ) ; } return libs ; }


public static < t > consumer < t > do if ( final boolean condition , final consumer < t > true function , final consumer < t > false function ) { return account - > { if ( condition ) { true function accept ( account ) ; } else { false function accept ( account ) ; } } ; }


type string of the literal value e g " boolean "

public literal value of ( string type string ) { this type info = type string ; return this ; }


returns a json adapter that was already created for this call , or null if this is the first time in this call that the cache key has been requested in this call this may return a lookup that isn ' t yet ready if this lookup is reentrant

< t > json adapter < t > push ( type type , @ nullable string field name , object cache key ) { / / try to find a lookup with the same key for the same call for ( int i = 0 , size = call lookups size ( ) ; i < size ; i + + ) { lookup < ? > lookup = call lookups get ( i ) ; if ( lookup cache key equals ( cache key ) ) { lookup < t > hit = ( lookup < t > ) lookup ; stack add ( hit ) ; return hit adapter ! = null ? hit adapter : hit ; } } / / we might need to know about this cache key later in this call prepare for that lookup < object > lookup = new lookup < > ( type , field name , cache key ) ; call lookups add ( lookup ) ; stack add ( lookup ) ; return null ; }


public void test type holder default ( ) { / / todo : test type holder default }


public ab script ( script script ) { if ( script = = null ) { throw new illegal argument exception ( " [ script ] must not be null " ) ; } this script = script ; return ( ab ) this ; }


public boolean matches ( method description target ) { return target get return type ( ) as erasure ( ) get name ( ) equals ( return type name ) ; }


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

public model without setter on bind ( on model bound listener < model without setter , object > listener ) { on mutation ( ) ; this on model bound listener epoxy generated model = listener ; return this ; }


public static void put warning cookie ( final request context context , final boolean cookie value ) { context get flow scope ( ) put ( " warn cookie value " , cookie value ) ; }


returns the first element in { @ code iterator } that satisfies the given predicate if no such element is found , { @ code default value } will be returned from this method and the iterator will be left exhausted : its { @ code has next ( ) } method will return { @ code false } note that this can usually be handled more naturally using { @ code try find ( iterator , predicate ) or ( default value ) }

public static < t > t find ( iterator < ? extends t > iterator , predicate < ? super t > predicate , @ nullable decl t default value ) { check not null ( iterator ) ; check not null ( predicate ) ; while ( iterator has next ( ) ) { t t = iterator next ( ) ; if ( predicate apply ( t ) ) { return t ; } } return default value ; }


returns < tt > true < tt > if this deque contains no elements

public boolean is empty ( ) { return head = = tail ; }


determine the bean class name corresponding to the supplied { @ link element }

protected string get bean class name ( element element ) { return null ; }


get the remote server ' s principal the value will be obtained from the config and cross - checked against the server ' s advertised principal

string get server principal ( sasl auth auth type ) throws i o exception { kerberos info krb info = security util get kerberos info ( protocol , conf ) ; log debug ( " get kerberos info proto : " + protocol + " info : " + krb info ) ; if ( krb info = = null ) { / / protocol has no support for kerberos return null ; } string server key = krb info server principal ( ) ; if ( server key = = null ) { throw new illegal argument exception ( " can ' t obtain server kerberos config key from protocol = " + protocol get canonical name ( ) ) ; } / / construct server advertised principal for comparision string server principal = new kerberos principal ( auth type get protocol ( ) + " / " + auth type get server id ( ) , kerberos principal krb nt srv hst ) get name ( ) ; / / use the pattern if defined string server key pattern = conf get ( server key + " pattern " ) ; if ( server key pattern ! = null & & ! server key pattern is empty ( ) ) { pattern pattern = glob pattern compile ( server key pattern ) ; if ( ! pattern matcher ( server principal ) matches ( ) ) { throw new illegal argument exception ( string format ( " server has invalid kerberos principal : % s , " + " doesn ' t match the pattern : % s " , server principal , server key pattern ) ) ; } } else { / / check that the server advertised principal matches our conf string conf principal = security util get server principal ( conf get ( server key ) , server addr get address ( ) ) ; if ( log is debug enabled ( ) ) { log debug ( " getting server key : " + server key + " conf value : " + conf get ( server key ) + " principal : " + conf principal ) ; } if ( conf principal = = null | | conf principal is empty ( ) ) { throw new illegal argument exception ( " failed to specify server ' s kerberos principal name " ) ; } kerberos name name = new kerberos name ( conf principal ) ; if ( name get host name ( ) = = null ) { throw new illegal argument exception ( " kerberos principal name does not have the expected hostname part : " + conf principal ) ; } if ( ! server principal equals ( conf principal ) ) { throw new illegal argument exception ( string format ( " server has invalid kerberos principal : % s , expecting : % s " , server principal , conf principal ) ) ; } } return server principal ; }


uses the index templates api to determine if index templates exist

public boolean exists template ( index templates exist request index templates request , request options options ) throws i o exception { return rest high level client perform request ( index templates request , indices request converters : : templates exist , options , rest high level client : : convert exists response , empty set ( ) ) ; }


finds the corresponding instruction for a given move result

private ssa insn get insn for move ( ssa insn move insn ) { int pred = move insn get block ( ) get predecessors ( ) next set bit ( 0 ) ; array list < ssa insn > pred insns = ssa meth get blocks ( ) get ( pred ) get insns ( ) ; return pred insns get ( pred insns size ( ) - 1 ) ; }


returns the target kind of this class of rule ( e g " cc library rule " )

string get target kind ( ) { return target kind ; }


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


sets new values to all fields of the tuple


public list < key pair > get keys ( ) { return collections unmodifiable list ( private keys ) ; }


print the result contents as tableau form to client console this method has slightly different behaviors under different checkpointing settings ( to enable checkpointing for a streaming job , set checkpointing properties through { @ link table config # get configuration ( ) } ) for batch jobs or streaming jobs without checkpointing , this method has neither exactly - once nor at - least - once guarantee query results are immediately accessible by the clients once they ' re produced , but exceptions will be thrown when the job fails and restarts for streaming jobs with exactly - once checkpointing , this method guarantees an end - to - end exactly - once record delivery a result will be accessible by clients only after its corresponding checkpoint completes for streaming jobs with at - least - once checkpointing , this method guarantees an end - to - end at - least - once record delivery query results are immediately accessible by the clients once they ' re produced , but it is possible for the same result to be delivered multiple times in order to fetch result to local , you can call either { @ link # collect ( ) } and { @ link # print ( ) } but , they can ' t be called both on the same { @ link table result } instance , because the result can only be accessed once


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

boolean contains ( @ nullable object element ) ;


public void do trim ( ) { if ( value ! = null ) { value = value trim ( ) ; } }


this method is responsible for unmounting the item from the { @ link host } and unbinding the item from the { @ link mount delegate target }

void unmount ( extension state < state > extension state , mount item mount item , host host ) ;


get the instant recursively when the schemas defined in one ofanyof happen to be one ofany of schema as well

public object get actual instance recursively ( ) { return get actual instance recursively ( this ) ; }


use { @ link # close outbound ( channel promise ) }

public channel future close ( channel promise promise ) { return close outbound ( promise ) ; }


read - only settings the mock object was created with see { @ link org mockito mockito # mock ( class , mock settings ) }

mock creation settings < t > get mock settings ( ) ;


use this if you can ' t bundle images with your app this may be useful if you download the animations from the network or have the images saved to an sd card in that case , lottie will defer the loading of the bitmap to this delegate

@ suppress warnings ( " unused " ) public void set image asset delegate ( image asset delegate asset delegate ) { lottie drawable set image asset delegate ( asset delegate ) ; }


dumps out the given options for the given config extractor

static void dump options ( config extractor cfg ) { if ( cfg = = null ) { return ; } log info ( " base directory = " + cfg get base directory ( ) ) ; log info ( " data directory = " + cfg get data path ( ) ) ; log info ( " output directory = " + cfg get output path ( ) ) ; log info ( " result file = " + cfg get result file ( ) ) ; log info ( " grid queue = " + cfg get queue name ( ) ) ; log info ( " should exit on first error = " + cfg should exit on first error ( ) ) ; { string duration = " duration = " ; if ( cfg get duration milliseconds ( ) = = integer max value ) { duration + = " unlimited " ; } else { duration + = cfg get duration milliseconds ( ) + " milliseconds " ; } log info ( duration ) ; } log info ( " map amount = " + cfg get map amount ( ) ) ; log info ( " reducer amount = " + cfg get reducer amount ( ) ) ; log info ( " operation amount = " + cfg get op count ( ) ) ; log info ( " total file limit = " + cfg get total files ( ) ) ; log info ( " total dir file limit = " + cfg get dir size ( ) ) ; { string read = " read size = " ; if ( cfg should read full file ( ) ) { read + = " entire file " ; } else { read + = cfg get read size ( ) + " bytes " ; } log info ( read ) ; } { string write = " write size = " ; if ( cfg should write use block size ( ) ) { write + = " blocksize " ; } else { write + = cfg get write size ( ) + " bytes " ; } log info ( write ) ; } { string append = " append size = " ; if ( cfg should append use block size ( ) ) { append + = " blocksize " ; } else { append + = cfg get append size ( ) + " bytes " ; } log info ( append ) ; } { string bsize = " block size = " ; bsize + = cfg get block size ( ) + " bytes " ; log info ( bsize ) ; } if ( cfg get random seed ( ) ! = null ) { log info ( " random seed = " + cfg get random seed ( ) ) ; } if ( cfg get sleep range ( ) ! = null ) { log info ( " sleep range = " + cfg get sleep range ( ) + " milliseconds " ) ; } log info ( " replication amount = " + cfg get replication ( ) ) ; log info ( " operations are : " ) ; number format perc formatter = formatter get percent formatter ( ) ; map < operation type , operation data > operations = cfg get operations ( ) ; for ( operation type type : operations key set ( ) ) { string name = type name ( ) ; log info ( name ) ; operation data op info = operations get ( type ) ; log info ( " " + op info get distribution ( ) name ( ) ) ; if ( op info get percent ( ) ! = null ) { log info ( " " + perc formatter format ( op info get percent ( ) ) ) ; } else { log info ( " ? ? ? " ) ; } } }


set the value of the < code > name < code > property to a < code > float < code >

public void set float ( string name , float value ) { set ( name , float to string ( value ) ) ; }


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


make the replica unreachable , perhaps by renaming it to an invalid file name

void make unreachable ( ) throws i o exception ;


set the uri to use with the following conditions : if { @ link # path ( string ) path } is also set , it overrides the path of the uri provided here if { @ link # context path ( string ) context path } is also set , or already present , it must match the start of the path of the uri provided here


set { @ link # block u c state } to { @ link block u c state # committed }

void commit ( ) { block u c state = block u c state committed ; }


clone the key at the top of this rr into the given object

public void key ( k key ) throws i o exception { writable utils clone into ( key , key ( ) ) ; }


returns true if this is a floating point type

default boolean is float ( ) { return false ; }


public object get value ( ) { return value ; }


creates list of users with given input array

public void create users with list input test ( test context context ) { async async = context async ( ) ; list < user > user = null ; api create users with list input ( user , result - > { / / todo : test validations async complete ( ) ; } ) ; }


returns { @ code true } if { @ code x } represents a mathematical integer this is equivalent to , but not necessarily implemented as , the expression { @ code ! double is na n ( x ) & & ! double is infinite ( x ) & & x = = math rint ( x ) }

public static boolean is mathematical integer ( double x ) { return is finite ( x ) & & ( x = = 0 0 | | significand bits - long number of trailing zeros ( get significand ( x ) ) < = get exponent ( x ) ) ; }


guard against the default value changing by accident

@ test public void default prefix ( ) { assert that ( new platform ( ) get prefix ( ) ) is equal to ( " ok http " ) ; }


return a map of the meta mappers that have been registered the returned map uses the name of the field as a key

public map < string , metadata field mapper type parser > get metadata mapper parsers ( version index created version ) { if ( index created version on or after ( version v 8 0 0 ) ) { return metadata mapper parsers ; } return metadata mapper parsers 7x ; }


sets delay time before starting loading task default - no delay

public builder delay before loading ( int delay in millis ) { this delay before loading = delay in millis ; return this ; }


does this committer have a thread pool ?

public synchronized boolean has thread pool ( ) { return thread pool ! = null ; }


test concurrent acquirerelease semantics

public void verify concurrent acquire and release ( ) { val executor = executors new fixed thread pool ( concurrent size ) ; try { test concurrency ( executor , arrays as list ( get concurrent locks ( " concurrent - new " ) ) ) ; } catch ( final exception e ) { throw new assertion error ( " test concurrent acquire and release failed " , e ) ; } finally { executor shutdown now ( ) ; } }


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

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


find a { @ link registered service } by matching with the supplied name

default < t extends registered service > t find service by name ( final string name , final class < t > clazz ) { val service = find service by name ( name ) ; if ( service ! = null & & clazz is assignable from ( service get class ( ) ) ) { return ( t ) service ; } return null ; }


returns { @ code true } if the { @ link channel } is open and may get active later


add a service under a path for the current user

public string register self ( service record record , boolean delete tree first ) throws i o exception { self registration path = put service ( user , service class , instance name , record , delete tree first ) ; set self registration ( record ) ; return self registration path ; }


utility method for generating control sequences takes a collection of byte arrays , which contain the components of a control sequence , concatenates them , and prints them to the terminal

private void write bytes ( byte [ ] stuff ) throws i o exception { for ( byte [ ] bytes : stuff ) { out write ( bytes ) ; } }


determine if further error handling should be bypassed

public boolean trigger after error ( native web request request , deferred result < ? > deferred result , throwable ex ) throws exception { for ( deferred result processing interceptor interceptor : this interceptors ) { if ( deferred result is set or expired ( ) ) { return false ; } if ( ! interceptor handle error ( request , deferred result , ex ) ) { return false ; } } return true ; }


best effort means that the client will try to replace the failed datanode ( provided that the policy is satisfied ) , however , it will continue the write operation in case that the datanode replacement also fails

public boolean is best effort ( ) { return best effort ; }


returns the separations of this manifold , a negative value indicates overlap , in meters use get number of contact points to determine how many separations there are ( 0 , 1 or 2 )

public float [ ] get separations ( ) { return separations ; }


returns a copy of the given { @ code entry }

e copy entry ( e original , e new next ) { return this map entry helper copy ( self ( ) , original , new next ) ; }


return the message associated with the event here is an example of obtaining information about the session id or any headers in the message : < pre class = " code " > stomp header accessor headers = stomp header accessor wrap ( message ) ; headers get session id ( ) ; headers get session attributes ( ) ; headers get principal ( ) ;

public message < byte [ ] > get message ( ) { return this message ; }


return a { @ link resolvable type } for the specified { @ link field } with the given nesting level

public static resolvable type for field ( field field , int nesting level ) { assert not null ( field , " field must not be null " ) ; return for type ( null , new field type provider ( field ) , null ) get nested ( nesting level ) ; }


creates a random string whose length is the number of characters specified characters will be chosen from the set of alpha - numeric characters as indicated by the arguments

public static string random ( final int count , final boolean letters , final boolean numbers ) { return random ( count , 0 , 0 , letters , numbers ) ; }


replaces an ssa insn containing a plain insn with a new plain insn the new plain insn is constructed with a new reg op and new sources todo move this somewhere else

private void replace plain insn ( normal ssa insn insn , register spec list new sources , int new opcode , constant cst ) { insn original rop insn = insn get original rop insn ( ) ; rop new rop = rops rop for ( new opcode , insn get result ( ) , new sources , cst ) ; insn new rop insn ; if ( cst = = null ) { new rop insn = new plain insn ( new rop , original rop insn get position ( ) , insn get result ( ) , new sources ) ; } else { new rop insn = new plain cst insn ( new rop , original rop insn get position ( ) , insn get result ( ) , new sources , cst ) ; } normal ssa insn new insn = new normal ssa insn ( new rop insn , insn get block ( ) ) ; list < ssa insn > insns = insn get block ( ) get insns ( ) ; ssa meth on insn removed ( insn ) ; insns set ( insns last index of ( insn ) , new insn ) ; ssa meth on insn added ( new insn ) ; }


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


reconnect to remote server of current transaction service group

void reconnect ( string transaction service group ) { list < string > avail list = null ; try { avail list = get avail server list ( transaction service group ) ; } catch ( exception e ) { logger error ( " failed to get available servers : { } " , e get message ( ) , e ) ; return ; } if ( collection utils is empty ( avail list ) ) { registry service registry service = registry factory get instance ( ) ; string cluster name = registry service get service group ( transaction service group ) ; if ( string utils is blank ( cluster name ) ) { logger error ( " can not get cluster name in registry config ' { } { } ' , please make sure registry config correct " , configuration keys service group mapping prefix , transaction service group ) ; return ; } if ( ! ( registry service instanceof file registry service impl ) ) { logger error ( " no available service found in cluster ' { } ' , please make sure registry config correct and keep your seata server running " , cluster name ) ; } return ; } for ( string server address : avail list ) { try { acquire channel ( server address ) ; } catch ( exception e ) { logger error ( " { } can not connect to { } cause : { } " , framework error code net connect get err code ( ) , server address , e get message ( ) , e ) ; } } }


init the parameter metric and index map for given resource package - private for test

public static void init param metrics for ( resource wrapper resource wrapper , / * @ valid * / param flow rule rule ) { if ( resource wrapper = = null | | resource wrapper get name ( ) = = null ) { return ; } string resource name = resource wrapper get name ( ) ; parameter metric metric ; / / assume that the resource is valid if ( ( metric = metrics map get ( resource name ) ) = = null ) { synchronized ( lock ) { if ( ( metric = metrics map get ( resource name ) ) = = null ) { metric = new parameter metric ( ) ; metrics map put ( resource wrapper get name ( ) , metric ) ; record log info ( " [ parameter metric storage ] creating parameter metric for : { } " , resource wrapper get name ( ) ) ; } } } metric initialize ( rule ) ; }


reset the map ' s record and bucket area ' s memory segments for reusing

public void reset ( ) { set bucket variables ( bucket segments ) ; reset bucket segments ( bucket segments ) ; num elements = 0 ; log info ( " reset bytes hash map with record memory segments { } , { } in bytes , init allocating { } for bucket area " , memory pool free pages ( ) , memory pool free pages ( ) * segment size , bucket segments size ( ) ) ; }


outputs < tt > message < tt > to < tt > out < tt > if it ' s not null

private static void log ( final java io print stream out , final string message ) { / / log / / message / / if / / requested if ( out ! = null ) { out println ( message ) ; } } / / end log


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


switch the target object , replacing the cached introspection results only if the class of the new object is different to that of the replaced object

public void set wrapped instance ( object object ) { set wrapped instance ( object , " " , null ) ; }


create equivalent external location in other program

public static external location create ext location ( program program , external location ext loc , program other program ) throws invalid input exception , duplicate name exception { address addr = ext loc get address ( ) ; address other addr = null ; if ( addr ! = null ) { other addr = get compatible address ( program , addr , other program ) ; } / / fixme should this be passing the namespace ? return other program get external manager ( ) add ext location ( ext loc get library name ( ) , ext loc get label ( ) , other addr , ext loc get source ( ) ) ; }


check whether one of { @ code bit positions } has been occupied

public boolean check false hit ( int [ ] bit positions , bits array bits ) { for ( int j = 0 ; j < bit positions length ; j + + ) { int pos = bit positions [ j ] ; / / check position of bits has been set / / that mean no one occupy the position if ( ! bits get bit ( pos ) ) { return false ; } } return true ; }


returns the { @ link objc provider } which contains information about the transitive dependencies linked into the dylib

public objc provider get deps objc provider ( ) { return deps objc provider ; }


returns the summary stats for the duration of completed checkpoints

public min max avg stats get end to end duration stats ( ) { return duration ; }


public void test model 2 0 0 response ( ) { / / todo : test model 2 0 0 response }


sample algorithm for the second phase this operation should be executed as the udf of an all reduce operation

public iterator < t > sample in coordinator ( iterator < intermediate sample data < t > > input ) { if ( num samples = = 0 ) { return empty iterable ; } / / this queue holds fixed number elements with the top k weight for the coordinator priority queue < intermediate sample data < t > > reservoir = new priority queue < intermediate sample data < t > > ( num samples ) ; int index = 0 ; intermediate sample data < t > smallest = null ; while ( input has next ( ) ) { intermediate sample data < t > element = input next ( ) ; if ( index < num samples ) { / / fill the queue with first k elements from input reservoir add ( element ) ; smallest = reservoir peek ( ) ; } else { / / if current element weight is larger than the smallest one in queue , remove the / / element / / with the smallest weight , and append current element into the queue if ( element get weight ( ) > smallest get weight ( ) ) { reservoir remove ( ) ; reservoir add ( element ) ; smallest = reservoir peek ( ) ; } } index + + ; } final iterator < intermediate sample data < t > > itr = reservoir iterator ( ) ; return new iterator < t > ( ) { @ override public boolean has next ( ) { return itr has next ( ) ; } @ override public t next ( ) { return itr next ( ) get element ( ) ; } @ override public void remove ( ) { itr remove ( ) ; } } ; }


gets the memory size of the processor architecture of this process note that the memory address size might be different than the actual hardware architecture , due to the installed os ( 3 2bit os ) or when installing a 32 bit jre in a 64 bit os

public static memory address size get memory address size ( ) { return get processor architecture ( ) get address size ( ) ; }


private long generate random worker id ( ) { return new random ( ) next int ( max worker id + 1 ) ; }


returns an array type whose elements are all instances of { @ code component type }

public static generic array type array of ( type component type ) { return new generic array type impl ( component type ) ; }


test generated permissions for all configured paths

public void test environment paths ( ) throws exception { path path = create temp dir ( ) ; / / make a fake es home and ensure we only grant permissions to that path es home = path resolve ( " es home " ) ; settings builder settings builder = settings builder ( ) ; settings builder put ( environment path home setting get key ( ) , es home resolve ( " home " ) to string ( ) ) ; settings builder put list ( environment path data setting get key ( ) , es home resolve ( " data 1 " ) to string ( ) , es home resolve ( " data 2 " ) to string ( ) ) ; settings builder put ( environment path shared data setting get key ( ) , es home resolve ( " custom " ) to string ( ) ) ; settings builder put ( environment path logs setting get key ( ) , es home resolve ( " logs " ) to string ( ) ) ; settings builder put ( environment node pidfile setting get key ( ) , es home resolve ( " test pid " ) to string ( ) ) ; settings settings = settings builder build ( ) ; path fake tmp dir = create temp dir ( ) ; string real tmp dir = system get property ( " java io tmpdir " ) ; permissions permissions ; environment environment ; try { system set property ( " java io tmpdir " , fake tmp dir to string ( ) ) ; environment = new environment ( settings , es home resolve ( " conf " ) ) ; permissions = security create permissions ( environment ) ; } finally { system set property ( " java io tmpdir " , real tmp dir ) ; } / / the fake es home assert no permissions ( es home , permissions ) ; / / its parent assert no permissions ( es home get parent ( ) , permissions ) ; / / some other sibling assert no permissions ( es home get parent ( ) resolve ( " other " ) , permissions ) ; / / double check we overwrote java io tmpdir correctly for the test assert no permissions ( path utils get ( real tmp dir ) , permissions ) ; / / check that all directories got permissions : / / bin file : ro assert exact permissions ( new file permission ( environment bin file ( ) to string ( ) , " read , readlink " ) , permissions ) ; / / lib file : ro assert exact permissions ( new file permission ( environment lib file ( ) to string ( ) , " read , readlink " ) , permissions ) ; / / modules file : ro assert exact permissions ( new file permission ( environment modules file ( ) to string ( ) , " read , readlink " ) , permissions ) ; / / config file : ro assert exact permissions ( new file permission ( environment config file ( ) to string ( ) , " read , readlink " ) , permissions ) ; / / plugins : ro assert exact permissions ( new file permission ( environment plugins file ( ) to string ( ) , " read , readlink " ) , permissions ) ; / / data paths : r / w for ( path data path : environment data files ( ) ) { assert exact permissions ( new file permission ( data path to string ( ) , " read , readlink , write , delete " ) , permissions ) ; } assert exact permissions ( new file permission ( environment shared data file ( ) to string ( ) , " read , readlink , write , delete " ) , permissions ) ; / / logs : r / w assert exact permissions ( new file permission ( environment logs file ( ) to string ( ) , " read , readlink , write , delete " ) , permissions ) ; / / temp dir : r / w assert exact permissions ( new file permission ( fake tmp dir to string ( ) , " read , readlink , write , delete " ) , permissions ) ; / / pid file : delete only ( for the shutdown hook ) assert exact permissions ( new file permission ( environment pid file ( ) to string ( ) , " delete " ) , permissions ) ; }


set the http status to use for the response the response status is set just prior to view rendering

public void set status ( @ nullable http status status ) { this status = status ; }


for this test the item in row 1 of the available tags table must be an editable item if not , edit the function tags xml file to remove all items and re - run this

public void test edit tag ( ) { show provider ( function tag provider class ) ; wait for swing ( ) ; add table data ( ) ; function tag provider provider = get provider ( function tag provider class ) ; source tags panel source panel = provider get source panel ( ) ; function tag table table = source panel get table ( ) ; rectangle bounds = table get cell rect ( 7 , 0 , false ) ; / / cell 7 is an editable item double click ( table , bounds x , bounds y ) ; input dialog edit dialog = wait for dialog component ( input dialog class ) ; capture dialog ( edit dialog ) ; }


public static void build ( mesh part builder builder , float width , float height , float inner width , float inner height , int divisions , float center x , float center y , float center z , float normal x , float normal y , float normal z ) { build ( builder , width , height , inner width , inner height , divisions , center x , center y , center z , normal x , normal y , normal z , 0f , 3 6 0f ) ; }


sets the backing { @ link thread factory } for new threads created with this thread factory threads will be created by invoking # new thread ( runnable ) on this backing { @ link thread factory }

public thread factory builder set thread factory ( thread factory backing thread factory ) { this backing thread factory = check not null ( backing thread factory ) ; return this ; }


create an instance of { @ link service discovery registry } if supported

public static service discovery registry create ( url registry u r l ) { return supports ( registry u r l ) ? new service discovery registry ( registry u r l ) : null ; }


gets principal attributes will attempt to locate the principal attribute repository from the context if one is defined to use that instance to locate attributes if none is available , will use the default principal attributes

protected map < string , list < object > > get principal attributes from release policy ( final principal p , final service service , final registered service registered service ) { if ( registered service ! = null & & registered service get access strategy ( ) is service access allowed ( ) ) { logger debug ( " located service [ { } ] in the registry attempting to resolve attributes for [ { } ] " , registered service , p get id ( ) ) ; if ( registered service get attribute release policy ( ) = = null ) { logger debug ( " no attribute release policy is defined for [ { } ] returning default principal attributes " , service get id ( ) ) ; return p get attributes ( ) ; } return registered service get attribute release policy ( ) get attributes ( p , service , registered service ) ; } logger debug ( " could not locate service [ { } ] in the registry " , service get id ( ) ) ; throw new unauthorized service exception ( unauthorized service exception code unauthz service ) ; }


sets the < code > prefix boolean < code > property

public xml item prefix boolean ( boolean prefix boolean ) { this prefix boolean = prefix boolean ; return this ; }


whether the decoder supports audio with a given channel count must not be called if the device sdk version is less than 21

public boolean is audio channel count supported v 2 1 ( int channel count ) { if ( capabilities = = null ) { log no support ( " channel count caps " ) ; return false ; } audio capabilities audio capabilities = capabilities get audio capabilities ( ) ; if ( audio capabilities = = null ) { log no support ( " channel count a caps " ) ; return false ; } int max input channel count = adjust max input channel count ( name , mime type , audio capabilities get max input channel count ( ) ) ; if ( max input channel count < channel count ) { log no support ( " channel count support , " + channel count ) ; return false ; } return true ; }


public string to string ( ) { string builder sb = new string builder ( ) ; sb append ( ' { ' ) ; boolean first = true ; for ( int i = bits find first ( bits , 0 ) ; i > = 0 ; i = bits find first ( bits , i + 1 ) ) { if ( ! first ) { sb append ( " , " ) ; } first = false ; sb append ( i ) ; } sb append ( ' } ' ) ; return sb to string ( ) ; }


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

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


sets the configuration properties for the kafka consumer resets previously set properties

public kafka properties ( properties properties ) { preconditions check not null ( properties ) ; if ( this kafka properties = = null ) { this kafka properties = new hash map < > ( ) ; } this kafka properties clear ( ) ; properties for each ( ( k , v ) - > this kafka properties put ( ( string ) k , ( string ) v ) ) ; return this ; }


in this test , we root all streams at the connection , and then verify that data is split equally among the stream , since they all have the same weight 0 \ \ a b c d

public void same priority should distribute based on data ( ) throws http 2 exception { / / root the streams at the connection with the same weights set priority ( stream a , 0 , default priority weight , false ) ; set priority ( stream b , 0 , default priority weight , false ) ; set priority ( stream c , 0 , default priority weight , false ) ; set priority ( stream d , 0 , default priority weight , false ) ; init state ( stream a , 400 , true ) ; init state ( stream b , 500 , true ) ; init state ( stream c , 0 , true ) ; init state ( stream d , 700 , true ) ; / / set allocation quantum to 1 so it is easier to see the ratio of total bytes written between each stream distributor allocation quantum ( 1 ) ; assert true ( write ( 999 ) ) ; assert equals ( 333 , capture writes ( stream a ) ) ; assert equals ( 333 , capture writes ( stream b ) ) ; verify write ( times ( 1 ) , stream c , 0 ) ; assert equals ( 333 , capture writes ( stream d ) ) ; }


check if we are ready to initialize replication queues

private void initialize repl queues if necessary ( ) { assert namesystem has write lock ( ) ; / / whether it has reached the threshold for initializing replication queues boolean can initialize repl queues = block manager should populate repl queues ( ) & & block safe > = block repl queue threshold ; if ( can initialize repl queues & & ! block manager is populating repl queues ( ) & & ! ha enabled ) { block manager initialize repl queues ( ) ; } }


void clear ( balance job job ) throws i o exception ;


whether this load balancer can handle empty address group list to be passed to { @ link # handle resolved addresses ( resolved addresses ) } the default implementation returns { @ code false } , meaning that if the name resolver returns an empty list , the channel will turn that into an error and call { @ link # handle name resolution error } load balancers that want to accept empty lists should override this method and return { @ code true } this method should always return a constant value it ' s not specified when this will be called

public boolean can handle empty address list from name resolution ( ) { return false ; }


clear all of the state held within the parent z node this recursively deletes everything within the znode as well as the parent znode itself it should only be used when it ' s certain that no electors are currently participating in the election

public synchronized void clear parent z node ( ) throws i o exception , interrupted exception { preconditions check state ( ! want to be in election , " clear parent z node ( ) may not be called while in the election " ) ; try { log info ( " recursively deleting " + znode working dir + " from zk " ) ; zk do with retries ( new z k action < void > ( ) { @ override public void run ( ) throws keeper exception , interrupted exception { z k util delete recursive ( zk client , znode working dir ) ; return null ; } } ) ; } catch ( keeper exception e ) { throw new i o exception ( " couldn ' t clear parent znode " + znode working dir , e ) ; } log info ( " successfully deleted " + znode working dir + " from zk " ) ; }


returns all dependencies that should be constraint - checked against the current rule , including both " unconditional " deps ( outside selects ) and deps that only appear in selects

private static deps to check get constraint checked dependencies ( rule context rule context ) { set < transitive info collection > deps to check = new linked hash set < > ( ) ; set < transitive info collection > select only deps = new linked hash set < > ( ) ; set < transitive info collection > deps outside selects = new linked hash set < > ( ) ; attribute map attributes = rule context attributes ( ) ; for ( string attr : attributes get attribute names ( ) ) { attribute attr def = attributes get attribute definition ( attr ) ; if ( attr def get type ( ) get label class ( ) ! = label class dependency | | attr def skip constraints override ( ) ) { continue ; } if ( ! attr def check constraints override ( ) ) { / / use the same implicit deps check that query uses this facilitates running queries to / / determine exactly which rules need to be constraint - annotated for depot migrations if ( ! dependency filter no implicit deps apply ( rule context get rule ( ) , attr def ) | | attr def get transition factory ( ) is tool ( ) ) { continue ; } } set < label > select only deps for this attribute = get deps only in selects ( rule context , attr , attributes get attribute type ( attr ) ) ; for ( transitive info collection dep : rule context get prerequisites ( attr ) ) { / / output files inherit the environment spec of their generating rule if ( dep instanceof output file configured target ) { / / note this reassignment means constraint violation errors reference the generating / / rule , not the file this makes the source of the environmental mismatch more clear dep = ( ( output file configured target ) dep ) get generating rule ( ) ; } / / input files don ' t support environments we may subsequently opt them into constraint / / checking , but for now just pass them by if ( dep get provider ( supported environments provider class ) ! = null ) { deps to check add ( dep ) ; / / for normal configured targets the target ' s label is the same label appearing in the / / select ( ) but for alias configured targets the label in the select ( ) refers to the alias , / / while dep get label ( ) refers to the target the alias points to so add this quick check / / to make sure we ' re comparing the same labels label dep label in select = ( dep instanceof configured target ) ? ( ( configured target ) dep ) get original label ( ) : dep get label ( ) ; if ( ! select only deps for this attribute contains ( dep label in select ) ) { deps outside selects add ( dep ) ; } } } } for ( transitive info collection dep : deps to check ) { if ( ! deps outside selects contains ( dep ) ) { select only deps add ( dep ) ; } } return new deps to check ( deps to check , select only deps ) ; }


register a callback listener and async task will start executing right away

public void listen ( find multi callback < t > callback ) { cb = callback ; execute ( ) ; }


set replication for an existing file implement the abstract < tt > set replication < tt > of < tt > file system < tt >

public boolean set replication ( path src , short replication ) throws i o exception , unresolved link exception { boolean value = get my fs ( ) set replication ( src , replication ) ; if ( ! value ) { return false ; } path check file = get checksum file ( src ) ; if ( exists ( check file ) ) { get my fs ( ) set replication ( check file , replication ) ; } return true ; }


private static void print stack ( throwable e , string text , object args ) { err ( text , args ) ; e print stack trace ( stderr ) ; }


get the name of the image which in most cases will be the associated data file path


sets the log file size limit ; if unset or 0 , log size is unlimited if unset , the value of " rotate limit bytes " from the jvm logging configuration for { @ link simple log handler } will be used ; and if that ' s unset , the log fie size is unlimited

public builder set rotate limit bytes ( int rotate limit bytes ) { this rotate limit bytes = integer value of ( rotate limit bytes ) ; return this ; }


command to get the upgrade status of each namenode in the nameservice usage : hdfs dfsadmin - upgrade query @ exception i o exception

public int get upgrade status ( ) throws i o exception { distributed file system dfs = get d f s ( ) ; configuration dfs conf = dfs get conf ( ) ; uri dfs uri = dfs get uri ( ) ; boolean is ha and logical uri = h a util client is logical uri ( dfs conf , dfs uri ) ; if ( is ha and logical uri ) { / / in the case of ha and logical uri , run upgrade query for all / / n ns in this nameservice string ns id = dfs uri get host ( ) ; list < proxy and info < client protocol > > proxies = h a util get proxies for all name nodes in nameservice ( dfs conf , ns id , client protocol class ) ; list < i o exception > exceptions = new array list < > ( ) ; for ( proxy and info < client protocol > proxy : proxies ) { try { boolean upgrade finalized = proxy get proxy ( ) upgrade status ( ) ; if ( upgrade finalized ) { system out println ( " upgrade finalized for " + proxy get address ( ) ) ; } else { system out println ( " upgrade not finalized for " + proxy get address ( ) ) ; } } catch ( i o exception ioe ) { system err println ( " getting upgrade status failed for " + proxy get address ( ) ) ; exceptions add ( ioe ) ; } } if ( ! exceptions is empty ( ) ) { throw multiple i o exception create i o exception ( exceptions ) ; } } else { if ( dfs upgrade status ( ) ) { system out println ( " upgrade finalized " ) ; } else { system out println ( " upgrade not finalized " ) ; } } return 0 ; }


returns a new array that prepends { @ code element } to { @ code array }

public static < t > t [ ] concat ( @ nullable t element , t [ ] array ) { t [ ] result = new array ( array , array length + 1 ) ; result [ 0 ] = element ; system arraycopy ( array , 0 , result , 1 , array length ) ; return result ; }


returns a string containing the supplied { @ code short } values separated by { @ code separator } for example , { @ code join ( " - " , ( short ) 1 , ( short ) 2 , ( short ) 3 ) } returns the string { @ code " 1 - 2 - 3 " }

public static string join ( string separator , short array ) { check not null ( separator ) ; if ( array length = = 0 ) { return " " ; } / / for pre - sizing a builder , just get the right order of magnitude string builder builder = new string builder ( array length * 6 ) ; builder append ( array [ 0 ] ) ; for ( int i = 1 ; i < array length ; i + + ) { builder append ( separator ) append ( array [ i ] ) ; } return builder to string ( ) ; }


called when the { @ link application } is resumed from a paused state , usually when it regains focus


void load into ( map < string , class < ? extends i route group > > routes ) ;


public void set range ( int start , int end ) { if ( end < start | | start < 0 | | end > size ) { throw new illegal argument exception ( ) ; } if ( end = = start ) { return ; } end - - ; / / will be easier to treat this as the last actually set bit - - inclusive int first int = start / 32 ; int last int = end / 32 ; for ( int i = first int ; i < = last int ; i + + ) { int first bit = i > first int ? 0 : start & 0x 1 f ; int last bit = i < last int ? 31 : end & 0x 1 f ; / / ones from first bit to last bit , inclusive int mask = ( 2 < < last bit ) - ( 1 < < first bit ) ; bits [ i ] | = mask ; } }


returns whether the message delivery has been canceled

public synchronized boolean is canceled ( ) { return is canceled ; }


requests an immediate publish of all metrics from sources to sinks

public synchronized void publish metrics now ( ) { if ( sinks size ( ) > 0 ) { publish metrics ( sample metrics ( ) , true ) ; } }


test serialization of outer boolean types

public void fake outer boolean serialize test ( ) throws i o exception { boolean body = null ; boolean response = api fake outer boolean serialize ( body ) ; / / todo : test validations }


make sure the polar regions are handled properly mercator projection does not show anything above 85 or below - 85 , so ensure they are clipped correctly

public void test singularity at poles ( ) { double min lat = - geo tile utils latitude mask ; double max lat = geo tile utils latitude mask ; double lon = random int between ( - 180 , 180 ) ; double lat = random boolean ( ) ? random double between ( - 90 , min lat , true ) : random double between ( max lat , 90 , true ) ; double clipped lat = math min ( math max ( lat , min lat ) , max lat ) ; int zoom = random int between ( 0 , max zoom ) ; string tile index = string encode ( long encode ( lon , lat , zoom ) ) ; string clipped tile index = string encode ( long encode ( lon , clipped lat , zoom ) ) ; assert equals ( tile index , clipped tile index ) ; }


reset the timer using a new timeout note that this does not update the cached current time in milliseconds , so it typically must be accompanied with a separate call to { @ link # update ( ) } typically , you can just use { @ link # update and reset ( long ) }

public void reset ( long timeout ms ) { if ( timeout ms < 0 ) throw new illegal argument exception ( " invalid negative timeout " + timeout ms ) ; this timeout ms = timeout ms ; this start ms = this current time ms ; if ( current time ms > long max value - timeout ms ) this deadline ms = long max value ; else this deadline ms = current time ms + timeout ms ; }


creates a new , empty { @ code hash multiset } with the specified expected number of distinct elements

public static < e > hash multiset < e > create ( int distinct elements ) { return new hash multiset < e > ( distinct elements ) ; }


return the processing time of the request in milliseconds

public long get processing time millis ( ) { return this processing time millis ; }


get the meta info of a block stored in volume map block is looked up without matching the generation stamp

replica info get replica info ( string bpid , long blkid ) throws replica not found exception { replica info info = volume map get ( bpid , blkid ) ; if ( info = = null ) { throw new replica not found exception ( replica not found exception non existent replica + bpid + " : " + blkid ) ; } return info ; }


if the spec has injected dependencies , generate a di constructor otherwise , generate a private constructor to enforce singleton - ity

static type spec data holder generate constructor ( spec model spec model ) { final method spec builder constructor builder = method spec constructor builder ( ) add statement ( " super ( $ s ) " , spec model get component name ( ) ) ; if ( spec model has injected dependencies ( ) ) { final method spec di constructor = spec model get dependency injection helper ( ) generate constructor ( spec model ) ; constructor builder add annotations ( di constructor annotations ) add code ( di constructor code ) add modifiers ( di constructor modifiers ) add parameters ( di constructor parameters ) ; } else { constructor builder add modifiers ( modifier private ) ; } return type spec data holder new builder ( ) add method ( constructor builder build ( ) ) build ( ) ; }


returns the number of ranges in the list

public int get num ranges ( ) { return set size ( ) ; }


returns { @ code true } iff this test cluster should use a dummy geo shape field mapper

protected boolean add mock geo shape field mapper ( ) { return true ; }


restitution mixing law feel free to customize this todo djm : add customization

public static float mix restitution ( float restitution 1 , float restitution 2 ) { return restitution 1 > restitution 2 ? restitution 1 : restitution 2 ; }


public synchronized int next raw value ( value bytes val ) throws i o exception { / / position stream to current value seek to current value ( ) ; if ( ! block compressed ) { int val length = record length - key length ; if ( decompress ) { compressed bytes value = ( compressed bytes ) val ; value reset ( in , val length ) ; } else { uncompressed bytes value = ( uncompressed bytes ) val ; value reset ( in , val length ) ; } return val length ; } else { int val length = writable utils read v int ( val len in ) ; uncompressed bytes raw value = ( uncompressed bytes ) val ; raw value reset ( val in , val length ) ; - - no buffered values ; return val length ; } }


see original { @ link stubber # do return ( object ) }

b d d stubber will return ( object to be returned , object next to be returned ) ;


public abstract string get node name ( ) ;


if there exists an initial set of template parameters bracketed by ' < ' and ' > ' in the given demangled name , strip them

private static string remove template params ( demangled object demangled obj ) { string name = demangled obj get demangled name ( ) ; int pos 1 = name index of ( ' < ' ) ; if ( pos 1 < 0 ) { return null ; } int nesting = 1 ; int pos 2 ; for ( pos 2 = pos 1 + 1 ; pos 2 < name length ( ) ; + + pos 2 ) { char c = name char at ( pos 2 ) ; if ( c = = ' < ' ) { nesting + = 1 ; } else if ( c = = ' > ' ) { nesting - = 1 ; if ( nesting = = 0 ) { break ; } } } if ( nesting ! = 0 ) { return null ; } return name substring ( 0 , pos 1 + 1 ) + name substring ( pos 2 ) ; }


http : tools ietf orghtmldraft - ietf - httpbis - header - compression - 12 # appendix - c 2 4

@ test public void read indexed header field from static table without buffering ( ) throws i o exception { bytes in write byte ( 0x 2 0 ) ; / / dynamic table size update ( size = 0 ) bytes in write byte ( 0x 8 2 ) ; / / = = indexed - add = = / / idx = 2 - > : method : get hpack reader read headers ( ) ; / / not buffered in header table assert that ( hpack reader header count ) is equal to ( 0 ) ; assert that ( hpack reader get and reset header list ( ) ) is equal to ( header entries ( " : method " , " get " ) ) ; }


public static builder builder ( ) { return new builder ( ) ; }


adds a new update to the list , merging it with any existing one with the same subject

public void add ( item update update ) { item id value subject = update get item id ( ) ; if ( index contains key ( subject ) ) { int i = index get ( subject ) ; item update old update = updates get ( i ) ; updates set ( i , old update merge ( update ) ) ; } else { index put ( subject , updates size ( ) ) ; updates add ( update ) ; } }


apply this filter to the given request and exchange function the given { @ linkplain exchange function } represents the next entity in the chain , to be invoked via { @ linkplain exchange function # exchange ( client request ) invoked } in order to proceed with the exchange , or not invoked to shortcut the chain

mono < client response > filter ( client request request , exchange function next ) ;


protected void with bind holder ( ultimate recyclerview view holder holder , t data , int position ) { m item manger update convert view ( holder , position ) ; }


returns < code > true < code > if the index has a custom data path

public boolean has custom data path ( ) { return strings is not empty ( custom data path ( ) ) ; }


visits a declaration block which contains one - to - many declarations

public void visit decl block ( s decl block user decl block node , semantic scope semantic scope ) { for ( s declaration user declaration node : user decl block node get declaration nodes ( ) ) { visit ( user declaration node , semantic scope ) ; } }


normalize type by wrapping primitive types with single quotes

private string normalize type ( string type ) { return type replace all ( " \ \ b ( boolean | integer | number | string | date | blob ) \ \ b " , " ' $ 1 ' " ) ; }


called by workspace impl when it is restoring its state

public plugin tool get tool ( string tool name ) { tool template template = tool services get tool chest ( ) get tool template ( tool name ) ; if ( template = = null ) { return null ; } plugin tool tool = template create tool ( project ) ; if ( tool ! = null ) { register tool ( tool name , tool ) ; } return tool ; }


for bucketed data floored to the day for example , dependency links

public static long midnight u t c ( long epoch millis ) { calendar day = calendar get instance ( utc ) ; day set time in millis ( epoch millis ) ; day set ( calendar millisecond , 0 ) ; day set ( calendar second , 0 ) ; day set ( calendar minute , 0 ) ; day set ( calendar hour of day , 0 ) ; return day get time in millis ( ) ; }


helper function which puts a given s 3 a file status into the metadata store and returns the same s 3 a file status instrumentation monitors the put operation

public static s 3 a file status put and return ( final metadata store ms , final s 3 a file status status , final i ttl time provider time provider , @ nullable final bulk operation state operation state ) throws i o exception { long start time nano = system nano time ( ) ; try { put with ttl ( ms , new path metadata ( status ) , time provider , operation state ) ; } finally { ms get instrumentation ( ) entry added ( ( system nano time ( ) - start time nano ) ) ; } return status ; }


callback method allowing a child interior node to request balancing of its content with its sibling nodes balancing is only done if the specified node is half - full or less

private var key node balance child ( var key interior node node ) throws i o exception { / / do nothing if node more than half full if ( node get free space ( ) < ( half key capacity * ( max key length + entry size ) ) ) { return get root ( ) ; } / / balance with right sibling except if node corresponds to the right - most / / key within this interior node - in that case balance with left sibling int index = get id index ( node get key field ( 0 ) ) ; if ( index = = ( key count - 1 ) ) { return balance child ( ( var key interior node ) node mgr get var key node ( get buffer id ( index - 1 ) ) , node ) ; } return balance child ( node , ( var key interior node ) node mgr get var key node ( get buffer id ( index + 1 ) ) ) ; }


writes all fields of the specified object to the current json object

public void write fields ( object object ) { class type = object get class ( ) ; object [ ] default values = get default values ( type ) ; ordered map < string , field metadata > fields = get fields ( type ) ; int default index = 0 ; array < string > field names = fields ordered keys ( ) ; for ( int i = 0 , n = field names size ; i < n ; i + + ) { field metadata metadata = fields get ( field names get ( i ) ) ; if ( ignore deprecated & & metadata deprecated ) continue ; field field = metadata field ; try { object value = field get ( object ) ; if ( default values ! = null ) { object default value = default values [ default index + + ] ; if ( value = = null & & default value = = null ) continue ; if ( value ! = null & & default value ! = null ) { if ( value equals ( default value ) ) continue ; if ( value get class ( ) is array ( ) & & default value get class ( ) is array ( ) ) { equals 1 [ 0 ] = value ; equals 2 [ 0 ] = default value ; if ( arrays deep equals ( equals 1 , equals 2 ) ) continue ; } } } if ( debug ) system out println ( " writing field : " + field get name ( ) + " ( " + type get name ( ) + " ) " ) ; writer name ( field get name ( ) ) ; write value ( value , field get type ( ) , metadata element type ) ; } catch ( reflection exception ex ) { throw new serialization exception ( " error accessing field : " + field get name ( ) + " ( " + type get name ( ) + " ) " , ex ) ; } catch ( serialization exception ex ) { ex add trace ( field + " ( " + type get name ( ) + " ) " ) ; throw ex ; } catch ( exception runtime ex ) { serialization exception ex = new serialization exception ( runtime ex ) ; ex add trace ( field + " ( " + type get name ( ) + " ) " ) ; throw ex ; } } }


< code > optional aapt pb source position position = 2 ; < code >

public com android aapt resources source position get position ( ) { return instance get position ( ) ; }


public get snapshots request repositories ( string repositories ) { this repositories = repositories ; return this ; }


decodes an { @ link inet address } from an a or aaaa { @ link dns raw record }

static inet address decode address ( dns record record , string name , boolean decode idn ) { if ( ! ( record instanceof dns raw record ) ) { return null ; } final byte buf content = ( ( byte buf holder ) record ) content ( ) ; final int content len = content readable bytes ( ) ; if ( content len ! = inaddrsz4 & & content len ! = inaddrsz6 ) { return null ; } final byte [ ] addr bytes = new byte [ content len ] ; content get bytes ( content reader index ( ) , addr bytes ) ; try { return inet address get by address ( decode idn ? idn to unicode ( name ) : name , addr bytes ) ; } catch ( unknown host exception e ) { / / should never reach here throw new error ( e ) ; } }


returns the integer array of < code > n elements < code > starting at < code > index < code >

public int [ ] read int array ( long index , int n elements , int min clamp , int max clamp , integer exceptions ) throws i o exception { int [ ] array = read int array ( index , n elements ) ; for ( int ii = 0 ; ii < array length ; + + ii ) { array [ ii ] = clamp int ( array [ ii ] , min clamp , max clamp , exceptions ) ; } return array ; }


variant of { @ link # tcp ( string , int ) } and { @ link # websocket ( uri ) } with an already initialized { @ link client transport }

r socket requester transport ( client transport transport ) ;


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


an opaque identifier for the mcp node < code > string id = 1 ; < code >

public java lang string get id ( ) { java lang object ref = id ; if ( ref instanceof java lang string ) { return ( java lang string ) ref ; } else { com google protobuf byte string bs = ( com google protobuf byte string ) ref ; java lang string s = bs to string utf 8 ( ) ; id = s ; return s ; } }


creates list of users with given input array

public void create users with list input ( list < user > body ) throws api exception , processing exception ;


gets the current value of the wasb bytes written last second counter

public static long get current bytes written ( azure file system instrumentation instrumentation ) { return get long gauge value ( instrumentation , wasb bytes written ) ; }


retrieves modification date of the specified file the method intelligently handles the case of { @ link jar u r l connection } pointing to files within jar

/ * package * / static long get modification date ( @ non null url url ) throws i o exception { u r l connection uc = url open connection ( ) ; / / it prevents file descriptor leak if the url references a file within jar / / see jenkins - 37332 for more info / / the code idea is taken from https : / / github com / jknack / handlebars java / pull / 394 if ( uc instanceof jar u r l connection ) { final jar u r l connection connection = ( jar u r l connection ) uc ; final url jar u r l = connection get jar file u r l ( ) ; if ( jar u r l get protocol ( ) equals ( " file " ) ) { string file = jar u r l get file ( ) ; return new file ( file ) last modified ( ) ; } else { / / we access the data without file protocol if ( connection get entry name ( ) ! = null ) { logger log ( warning , " accessing modification date of { 0 } file , which is an entry in jar file " + " the access protocol is not file : , falling back to the default logic ( risk of file descriptor leak ) " , url ) ; } } } / / fallbak to the default implementation return uc get last modified ( ) ; }


parameters used for controlling the response and thus might not be consumed during preparation of the request execution in { @ link base rest handler # prepare request ( rest request , node client ) }

protected set < string > response params ( ) { return settings format params ; }


get metadata for all topics present in kafka cluster

public map < string , list < partition info > > get topic metadata ( metadata request builder request , timer timer ) { / / save the round trip if no topics are requested if ( ! request is all topics ( ) & & request empty topic list ( ) ) return collections empty map ( ) ; do { request future < client response > future = send metadata request ( request ) ; client poll ( future , timer ) ; if ( future failed ( ) & & ! future is retriable ( ) ) throw future exception ( ) ; if ( future succeeded ( ) ) { metadata response response = ( metadata response ) future value ( ) response body ( ) ; cluster cluster = response cluster ( ) ; set < string > unauthorized topics = cluster unauthorized topics ( ) ; if ( ! unauthorized topics is empty ( ) ) throw new topic authorization exception ( unauthorized topics ) ; boolean should retry = false ; map < string , errors > errors = response errors ( ) ; if ( ! errors is empty ( ) ) { / / if there were errors , we need to check whether they were fatal or whether / / we should just retry log debug ( " topic metadata fetch included errors : { } " , errors ) ; for ( map entry < string , errors > error entry : errors entry set ( ) ) { string topic = error entry get key ( ) ; errors error = error entry get value ( ) ; if ( error = = errors invalid topic exception ) throw new invalid topic exception ( " topic ' " + topic + " ' is invalid " ) ; else if ( error = = errors unknown topic or partition ) / / if a requested topic is unknown , we just continue and let it be absent / / in the returned map continue ; else if ( error exception ( ) instanceof retriable exception ) should retry = true ; else throw new kafka exception ( " unexpected error fetching metadata for topic " + topic , error exception ( ) ) ; } } if ( ! should retry ) { hash map < string , list < partition info > > topics partition infos = new hash map < > ( ) ; for ( string topic : cluster topics ( ) ) topics partition infos put ( topic , cluster partitions for topic ( topic ) ) ; return topics partition infos ; } } timer sleep ( retry backoff ms ) ; } while ( timer not expired ( ) ) ; throw new timeout exception ( " timeout expired while fetching topic metadata " ) ; }


gets the { @ code unsigned short } value at a particular offset

public int get unsigned short ( int off ) { check offsets ( off , off + 2 ) ; return ( get unsigned byte 0 ( off ) < < 8 ) | get unsigned byte 0 ( off + 1 ) ; }


check that a query is generally cacheable tests for query builders that are not always cacheable should overwrite this method and make sure the different cases are always tested

public void test cacheability ( ) throws i o exception { qb query builder = create test query builder ( ) ; query shard context context = create shard context ( ) ; query builder rewrite query = rewrite query ( query builder , new query shard context ( context ) ) ; assert not null ( rewrite query to query ( context ) ) ; assert true ( " query should be cacheable : " + query builder to string ( ) , context is cacheable ( ) ) ; }


public void array enum test ( ) { / / todo : test array enum }


reports whether the value { @ code x } has a field or method of the given name , as if by the starlark expression { @ code hasattr ( x , name ) }

public static boolean hasattr ( starlark semantics semantics , object x , string name ) throws eval exception { return ( x instanceof structure & & ( ( structure ) x ) get value ( name ) ! = null ) | | call utils get annotated methods ( semantics , x get class ( ) ) contains key ( name ) ; }


the namespace uri of this element < code > optional string namespace uri = 2 ; < code >

public builder set namespace uri ( java lang string value ) { copy on write ( ) ; instance set namespace uri ( value ) ; return this ; }


set the return value when there is no error notify the caller the call is done

public synchronized void set rpc response ( writable rpc response ) { this rpc response = rpc response ; call complete ( ) ; }


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

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


the next time to update the cluster info is the maximum of the time the current info will expire and the time the current info can be updated ( i e backoff time has elapsed ) ; if an update has been request then the expiry time is now

public synchronized long time to next update ( long now ms ) { long time to expire = update requested ( ) ? 0 : math max ( this last successful refresh ms + this metadata expire ms - now ms , 0 ) ; return math max ( time to expire , time to allow update ( now ms ) ) ; }


draws the actor the batch is configured to draw in the parent ' s coordinate system { @ link batch # draw ( com badlogic gdx graphics g 2d texture region , float , float , float , float , float , float , float , float , float ) this draw method } is convenient to draw a rotated and scaled texture region { @ link batch # begin ( ) } has already been called on the batch if { @ link batch # end ( ) } is called to draw without the batch then { @ link batch # begin ( ) } must be called before the method returns the default implementation does nothing

public void draw ( batch batch , float parent alpha ) { }


returns the number of elements of the handler list that begins with the given element

static int get exception table length ( final handler first handler ) { int length = 0 ; handler handler = first handler ; while ( handler ! = null ) { length + + ; handler = handler next handler ; } return length ; }