retrieve all the erasure coding policies supported by this file system , including enabled , disabled and removed policies , but excluding replication policy

public collection < erasure coding policy info > get all erasure coding policies ( ) throws i o exception { statistics increment read ops ( 1 ) ; storage statistics increment op counter ( op type get ec policies ) ; return arrays as list ( dfs get erasure coding policies ( ) ) ; }


inserts a single line of html into a { @ link string buffer } , with the given attributes

protected void insert h t m l line ( string builder buffer , string string , simple attribute set attributes ) { if ( string = = null ) { return ; } insert h t m l string ( buffer , string , attributes ) ; / / row padding - newline space buffer append ( br ) ; }


public java util logging logger get parent logger ( ) throws s q l feature not supported exception { throw new s q l feature not supported exception ( ) ; }


estimate the resources consumed when this action is run locally

public resource set estimate resource consumption local ( ) { / / it ' s ok if this behaves differently even if the key is identical resource set min link resources = get link command line ( ) get linking mode ( ) = = linking mode dynamic ? min dynamic link resources : min static link resources ; int input size = get link command line ( ) get linker input artifacts ( ) memoized flatten and get size ( ) ; return resource set create with ram cpu ( math max ( input size * link resources per input get memory mb ( ) , min link resources get memory mb ( ) ) , math max ( input size * link resources per input get cpu usage ( ) , min link resources get cpu usage ( ) ) ) ; }


todo : describe this functionality and its necessity


public final builder add ( extra link time library b ) { class < ? extends extra link time library > c = b get class ( ) ; libraries compute if absent ( c , k - > b get builder ( ) ) ; libraries get ( c ) add transitive ( b ) ; return this ; }


dispose and unexport all remote buffer file impl instances associated with the specified owner

public static synchronized boolean dispose ( object owner ) { boolean found = false ; list < remote buffer file impl > list = instance owner map remove ( owner ) ; if ( list ! = null ) { for ( remote buffer file impl rbf : list ) { found = true ; rbf dispose ( ) ; } } if ( found ) { / / if files were found , may need to repeat since pre - save / / files may have been constructed during dispose dispose ( owner ) ; } return found ; }


protected synchronized void set reduce progress ( float p ) { this reduce progress = ( float ) math min ( 1 0 , math max ( 0 0 , p ) ) ; }


this method retrieves the state for a specific app , and it is reachable by using { @ link r m w s consts # apps appid state }

app state get app state ( http servlet request hsr , string app id ) throws authorization exception ;


utility function to compute the hash code of an array using the murmur hash algorithm

public static < t > int hash code ( t [ ] data , int seed ) { int hash = initialize ( seed ) ; for ( t value : data ) { hash = update ( hash , value ) ; } hash = finish ( hash , data length ) ; return hash ; }


creates list of users with given input array

public api response < void > create users with array input with http info ( list < user > body ) throws api exception { okhttp 3 call local var call = create users with array input validate before call ( body , null ) ; return local var api client execute ( local var call ) ; }


public int get register count ( ) { return 0 ; }


verify get at most when sync generation policy = all

public void testget at most policy a l l ( ) throws exception { mock filler filler = new mock filler ( ) ; final value queue < string > vq = new value queue < string > ( 10 , 0 1f , 30000 , 1 , sync generation policy all , filler ) ; / / trigger a prefill ( 1 ) and an async refill ( 10 ) assert assert equals ( " test " , vq get next ( " k 1 " ) ) ; assert assert equals ( 1 , filler get top ( ) num ) ; / / wait for the async task to finish wait for refill ( vq , " k 1 " , 10 ) ; / / refill task should add 10 values to get to a full queue ( 1 produced by / / the prefill to the low watermark , 1 consumed by get next ( ) ) assert assert equals ( 10 , filler get top ( ) num ) ; / / drain completely , no further refills triggered vq drain ( " k 1 " ) ; / / wait a while to make sure that no async refills are triggered try { wait for refill ( vq , " k 1 " , 10 ) ; } catch ( timeout exception ignored ) { / / this is the correct outcome - no refill is expected } assert assert null ( filler get top ( ) ) ; / / synchronous call : / / 1 synchronously fill returned list / / 2 start another async task to fill the queue in the cache assert assert equals ( " failed in sync call " , 10 , vq get at most ( " k 1 " , 10 ) size ( ) ) ; assert assert equals ( " sync call filler got wrong number " , 10 , filler get top ( ) num ) ; / / wait for the async task to finish wait for refill ( vq , " k 1 " , 10 ) ; / / refill task should add 10 values to get to a full queue assert assert equals ( " failed in async call " , 10 , filler get top ( ) num ) ; / / drain completely after filled by the async thread vq drain ( " k 1 " ) ; assert assert equals ( " failed to drain completely after async " , 0 , vq get size ( " k 1 " ) ) ; / / synchronous call assert assert equals ( " failed to get all 19 " , 19 , vq get at most ( " k 1 " , 19 ) size ( ) ) ; assert assert equals ( " failed in sync call " , 19 , filler get top ( ) num ) ; vq shutdown ( ) ; }


returns whether this integer value is less than the given particular integer value : < code > never < code > , < code > maybe < code > , or < code > always < code >

public int less than ( particular integer value other ) { return less than ( ( specific integer value ) other ) ; }


removes entries in { @ code values to inject } whose values are equal to the present values in the graph

private void prune injected values ( map < sky key , sky value > values to inject ) { for ( iterator < map entry < sky key , sky value > > it = values to inject entry set ( ) iterator ( ) ; it has next ( ) ; ) { map entry < sky key , sky value > entry = it next ( ) ; sky key key = entry get key ( ) ; sky value new value = entry get value ( ) ; node entry prev entry = graph get ( null , reason other , key ) ; if ( prev entry ! = null & & prev entry is done ( ) ) { if ( keep edges ) { try { if ( ! prev entry has at least one dep ( ) ) { if ( new value equals ( prev entry get value ( ) ) & & ! values to dirty contains ( key ) & & ! values to delete contains ( key ) ) { it remove ( ) ; } } else { / / rare situation of an injected dep that depends on another node usually the dep is / / the error transience node when working with external repositories , it can also be / / an external workspace file don ' t bother injecting it , just invalidate it / / we ' ll wastefully evaluate the node freshly during evaluation , but this happens very / / rarely values to dirty add ( key ) ; it remove ( ) ; } } catch ( interrupted exception e ) { throw new illegal state exception ( " in memory graph does not throw : " + entry + " , " + prev entry , e ) ; } } else { / / no incrementality just delete the old value from the graph the new value is about to / / be injected graph remove ( key ) ; } } } }


convert a yarn url into a string value of a normal url

public static string stringify ( org apache hadoop yarn api records url url ) { string builder builder = new string builder ( ) ; builder append ( url get scheme ( ) ) append ( " : / / " ) ; if ( url get host ( ) ! = null ) { builder append ( url get host ( ) ) append ( " : " ) append ( url get port ( ) ) ; } builder append ( url get file ( ) ) ; return builder to string ( ) ; }


convenience method to create a model with a single node containing a sphere shape the resources the material might contain are not managed , use { @ link model # manage disposable ( disposable ) } to add those to the model

public model create sphere ( float width , float height , float depth , int divisions u , int divisions v , final material material , final long attributes , float angle u from , float angle u to , float angle v from , float angle v to ) { return create sphere ( width , height , depth , divisions u , divisions v , gl20 gl triangles , material , attributes , angle u from , angle u to , angle v from , angle v to ) ; }


creates a { @ link dynamic table sink } from a { @ link catalog table } it considers { @ link catalog # get factory ( ) } if provided

public static dynamic table sink create table sink ( @ nullable catalog catalog , object identifier object identifier , catalog table catalog table , readable config configuration , class loader class loader , boolean is temporary ) { final default dynamic table context context = new default dynamic table context ( object identifier , catalog table , configuration , class loader , is temporary ) ; try { final dynamic table sink factory factory = get dynamic table factory ( dynamic table sink factory class , catalog , context ) ; return factory create dynamic table sink ( context ) ; } catch ( throwable t ) { throw new validation exception ( string format ( " unable to create a sink for writing table ' % s ' \ n \ n " + " table options are : \ n \ n " + " % s " , object identifier as summary string ( ) , catalog table get options ( ) entry set ( ) stream ( ) map ( e - > stringify option ( e get key ( ) , e get value ( ) ) ) sorted ( ) collect ( collectors joining ( " \ n " ) ) ) , t ) ; } }


private byte [ ] encode ( dex file file , string prefix , print writer debug print , annotated output out , boolean consume ) { byte [ ] result = encode 0 ( file , prefix , debug print , out , consume ) ; if ( enable encoder self check & & ( file ! = null ) ) { try { debug info decoder validate encode ( result , file , ref , code , is static ) ; } catch ( runtime exception ex ) { / / reconvert , annotating to system err encode 0 ( file , " " , new print writer ( system err , true ) , null , false ) ; throw ex ; } } return result ; }


called whenever the program slection changes

public void program selection changed ( program selection selection ) ;


run recoverysynchronization for a specific segment postconditions : this segment will be finalized on a majority of nodes all nodes which contain the finalized segment will agree on the length

private void recover unclosed segment ( long segment tx id ) throws i o exception { preconditions check argument ( segment tx id > 0 ) ; log info ( " beginning recovery of unclosed segment starting at txid " + segment tx id ) ; / / step 1 prepare recovery quorum call < async logger , prepare recovery response proto > prepare = loggers prepare recovery ( segment tx id ) ; map < async logger , prepare recovery response proto > prepare responses = loggers wait for write quorum ( prepare , prepare recovery timeout ms , " prepare recovery ( " + segment tx id + " ) " ) ; log info ( " recovery prepare phase complete responses : \ n " + quorum call map to string ( prepare responses ) ) ; / / determine the logger who either : / / a ) has already accepted a previous proposal that ' s higher than any / / other / / / / or , if no such logger exists : / / / / b ) has the longest log starting at this transaction id / / todo : we should collect any " ties " and pass the url for all of them / / when syncing , so we can tolerate failure during recovery better entry < async logger , prepare recovery response proto > best entry = collections max ( prepare responses entry set ( ) , segment recovery comparator instance ) ; async logger best logger = best entry get key ( ) ; prepare recovery response proto best response = best entry get value ( ) ; / / log the above decision , check invariants if ( best response has accepted in epoch ( ) ) { log info ( " using already - accepted recovery for segment " + " starting at txid " + segment tx id + " : " + best entry ) ; } else if ( best response has segment state ( ) ) { log info ( " using longest log : " + best entry ) ; } else { / / none of the responses to prepare recovery ( ) had a segment at the given / / txid this can happen for example in the following situation : / / - 3 j ns : jn1 , jn2 , jn3 / / - writer starts segment 101 on jn1 , then crashes before / / writing to jn2 and jn3 / / - during new epoch ( ) , we saw the segment on jn1 and decide to / / recover segment 101 / / - before prepare ( ) , jn1 crashes , and we only talk to jn2 and jn3 , / / neither of which has any entry for this log / / in this case , it is allowed to do nothing for recovery , since the / / segment wasn ' t started on a quorum of nodes / / sanity check : we should only get here if none of the responses had / / a log this should be a postcondition of the recovery comparator , / / but a bug in the comparator might cause us to get here for ( prepare recovery response proto resp : prepare responses values ( ) ) { assert ! resp has segment state ( ) : " one of the loggers had a response , but no best logger " + " was found " ; } log info ( " none of the responders had a log to recover : " + quorum call map to string ( prepare responses ) ) ; return ; } segment state proto log to sync = best response get segment state ( ) ; assert segment tx id = = log to sync get start tx id ( ) ; / / sanity check : none of the loggers should be aware of a higher / / txid than the txid we intend to truncate to for ( map entry < async logger , prepare recovery response proto > e : prepare responses entry set ( ) ) { async logger logger = e get key ( ) ; prepare recovery response proto resp = e get value ( ) ; if ( resp has last committed tx id ( ) & & resp get last committed tx id ( ) > log to sync get end tx id ( ) ) { throw new assertion error ( " decided to synchronize log to " + log to sync + " but logger " + logger + " had seen txid " + resp get last committed tx id ( ) + " committed " ) ; } } url sync from url = best logger build u r l to fetch logs ( segment tx id ) ; quorum call < async logger , void > accept = loggers accept recovery ( log to sync , sync from url ) ; loggers wait for write quorum ( accept , accept recovery timeout ms , " accept recovery ( " + text format short debug string ( log to sync ) + " ) " ) ; / / if one of the loggers above missed the synchronization step above , but / / we send a finalize ( ) here , that ' s ok it validates the log before / / finalizing hence , even if it is not " in sync " , it won ' t incorrectly / / finalize quorum call < async logger , void > finalize = loggers finalize log segment ( log to sync get start tx id ( ) , log to sync get end tx id ( ) ) ; loggers wait for write quorum ( finalize , finalize segment timeout ms , string format ( " finalize log segment ( % s - % s ) " , log to sync get start tx id ( ) , log to sync get end tx id ( ) ) ) ; }


default void cleanup idle clients ( ) { / / do nothing by default }


public list < list < read only first > > get array array of model ( ) { return array array of model ; }


public date get latest record time stamp ( ) { return latest record time stamp ; }


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

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


tests the future behavior of the options usage output for short & medium verbosity , this should be the same as the current default

private string get terminal usage with tags ( string field name , help verbosity verbosity ) { string builder builder = new string builder ( ) ; options usage get usage ( data get option definition from name ( field name ) , builder , verbosity , data , true ) ; return builder to string ( ) ; }


returns the contents of this instance as a { @ code dex } file , in { @ code byte [ ] } form

public byte [ ] to dex ( writer human out , boolean verbose ) throws i o exception { boolean annotate = ( human out ! = null ) ; byte array annotated output result = to dex 0 ( annotate , verbose ) ; if ( annotate ) { result write annotations to ( human out ) ; } return result get array ( ) ; }


gets info about which nodes the input split is stored on and how it is stored at each location

split location info [ ] get location info ( ) throws i o exception ;


create the appropriate { @ link licenses provider } for a rule based on its { @ code rule context }

public static licenses provider of ( rule context rule context ) { if ( ! rule context get configuration ( ) check licenses ( ) ) { return empty ; } nested set builder < target license > builder = nested set builder link order ( ) ; build configuration configuration = rule context get configuration ( ) ; rule rule = rule context get rule ( ) ; attribute map attributes = rule context attributes ( ) ; license tool output license = rule get tool output license ( attributes ) ; target license output licenses = tool output license = = null ? null : new target license ( rule get label ( ) , tool output license ) ; if ( configuration is tool configuration ( ) & & tool output license ! = null ) { if ( tool output license ! = license no license ) { builder add ( output licenses ) ; } } else { if ( rule get license ( ) ! = license no license ) { builder add ( new target license ( rule get label ( ) , rule get license ( ) ) ) ; } list multimap < string , ? extends transitive info collection > configured map = rule context get configured target map ( ) ; for ( string dep attr name : attributes get attribute names ( ) ) { / / only add the transitive licenses for the attributes that do not have the output licenses attribute attribute = attributes get attribute definition ( dep attr name ) ; for ( transitive info collection dep : configured map get ( dep attr name ) ) { licenses provider provider = dep get provider ( licenses provider class ) ; if ( provider = = null ) { continue ; } if ( use output licenses ( attribute , configuration ) & & provider has output licenses ( ) ) { builder add ( provider get output licenses ( ) ) ; } else { builder add transitive ( provider get transitive licenses ( ) ) ; } } } } return new licenses provider impl ( builder build ( ) , output licenses ) ; }


sets the db access related fields in the job conf

public static void configure d b ( job conf job , string driver class , string db url , string user name , string passwd ) { job set ( driver class property , driver class ) ; job set ( url property , db url ) ; if ( user name ! = null ) job set ( username property , user name ) ; if ( passwd ! = null ) job set ( password property , passwd ) ; }


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 illegal argument exception ( ) ; } switch ( field ) { case arg : return is set arg ( ) ; } throw new illegal state exception ( ) ; }


await termination on the main thread since the grpc library uses daemon threads

private void block until shutdown ( ) throws interrupted exception { if ( server ! = null ) { server await termination ( ) ; } }


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


next largest power of 2 : given a binary integer value x , the next largest power of 2 can be computed by a swar algorithm that recursively " folds " the upper bits into the lower bits this process yields a bit vector with the same most significant 1 as x , but all 1 ' s below it adding 1 to that value yields the next largest power of 2

public final static int next power of two ( int x ) { x | = x > > 1 ; x | = x > > 2 ; x | = x > > 4 ; x | = x > > 8 ; x | = x > > 16 ; return x + 1 ; }


shuts the given { @ link rpc endpoint rpc endpoints } down and waits for their termination

public static void terminate rpc endpoints ( time timeout , rpc endpoint rpc endpoints ) throws interrupted exception , execution exception , timeout exception { terminate async closeables ( arrays as list ( rpc endpoints ) , timeout ) ; }


return a specified persistence unit for the given unit name , as defined through the " persistence units " map

protected entity manager factory get persistence unit ( @ nullable string unit name ) { if ( this persistence units ! = null ) { string unit name for lookup = ( unit name ! = null ? unit name : " " ) ; if ( unit name for lookup is empty ( ) ) { unit name for lookup = this default persistence unit name ; } string jndi name = this persistence units get ( unit name for lookup ) ; if ( jndi name = = null & & unit name for lookup is empty ( ) & & this persistence units size ( ) = = 1 ) { jndi name = this persistence units values ( ) iterator ( ) next ( ) ; } if ( jndi name ! = null ) { try { return lookup ( jndi name , entity manager factory class ) ; } catch ( exception ex ) { throw new illegal state exception ( " could not obtain entity manager factory [ " + jndi name + " ] from jndi " , ex ) ; } } } return null ; }


incrementing exists ( ) calls from superclass for statistic collection

public boolean exists ( path f ) throws i o exception { stat increment ( call exist ) ; return super exists ( f ) ; }


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 with annotated class on bind ( on model bound listener < model with annotated class , object > listener ) { on mutation ( ) ; this on model bound listener epoxy generated model = listener ; return this ; }


test a command execution that throws an exception that should not be wrapped

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


returns the total number of key - value headers in this metadata , including duplicates


iterate over deferred hi16 relocations iterator may be used to remove entries as they are processed

iterator < mips deferred relocation > iterate hi 1 6 ( ) { return hi 1 6list iterator ( ) ; }


asserts that the x content filters of a { @ link filtered monitoring doc } contains the common filters and the expected custom ones

private void assert x content filters ( final f document ) { final set < string > expected filters = sets union ( common xcontent filters , get expected x content filters ( ) ) ; final set < string > actual filters = document get filters ( ) ; expected filters for each ( filter - > assert that ( actual filters , has item ( filter ) ) ) ; assert that ( actual filters size ( ) , equal to ( expected filters size ( ) ) ) ; }


return the cors setting as an array of origins

public static string [ ] cors setting as array ( string cors setting ) { if ( strings is null or empty ( cors setting ) ) { return new string [ 0 ] ; } return arrays as list ( cors setting split ( " , " ) ) stream ( ) map ( string : : trim ) to array ( size - > new string [ size ] ) ; }


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


returns an iterator over all the ranges in this list

public iterator < range > get ranges ( ) { return set iterator ( ) ; }


static byte [ ] build part handle payload ( final string path , final string upload id , final int part number , final string etag , final long len ) throws i o exception { return new part handle payload ( path , upload id , part number , len , etag ) to bytes ( ) ; }


use this in case no { @ code gl viewport } is in use otherwise please supply the used { @ link viewport } to { @ link # begin ( viewport ) }

public void begin ( camera camera ) { this camera = camera ; shape renderer set projection matrix ( camera combined ) ; shape renderer begin ( shape type line ) ; }


when retrieved this will iterate over the contained { @ link hystrix property } instances until a non - null value is found and return that

public static < t > hystrix property < t > as property ( final hystrix property < t > values ) { return new hystrix property < t > ( ) { @ override public t get ( ) { for ( hystrix property < t > v : values ) { / / return the first one that doesn ' t return null if ( v get ( ) ! = null ) { return v get ( ) ; } } return null ; } } ; }


public void user status test ( ) { / / todo : test user status }


public void grow capacity ( int new capacity ) { if ( new capacity < = capacity ) { return ; } int [ ] temp = new int [ new capacity ] ; system arraycopy ( links , 0 , temp , 0 , capacity ) ; for ( int i = capacity ; i < new capacity ; i + + ) { temp [ i ] = i + 1 ; } temp [ new capacity - 1 ] = end of list ; free ptr = capacity ; capacity = new capacity ; links = temp ; }


the settings on which the validity of this setting depends the values of the specified settings are passed to { @ link # validate ( object , map ) } by default this returns an empty iterator , indicating that this setting does not depend on any other settings

default iterator < setting < ? > > settings ( ) { return collections empty iterator ( ) ; }


the type of the rule it can be an abstract rule , a normal rule or a test rule if the rule type is abstract , the configured class must not be set

public abstract rule class type type ( ) ;


resolves the given class name into a { @ link type element } the class name is a binary name , but { @ link elements # get type element ( char sequence ) } wants a canonical name so this method searches the space of possible canonical names , starting with the most likely ( since ' $ ' is rarely used in canonical class names )

@ visible for testing static type element resolve type ( elements elements , string class name ) { int index = next dollar ( class name , class name , 0 ) ; if ( index = = - 1 ) { return get type element ( elements , class name ) ; } / / have to test various possibilities of replacing ' $ ' with ' ' since ' ' in a canonical name / / of a nested type is replaced with ' $ ' in the binary name string builder sb = new string builder ( class name ) ; return resolve type ( elements , class name , sb , index ) ; }


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

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


covert an exception to an i o exception for a non - i o exception , wrap it with i o exception for a remote exception , unwrap it for an i o exception which is not a remote exception , return it

private static i o exception to i o exception ( exception e ) { if ( ! ( e instanceof i o exception ) ) { return new i o exception ( e ) ; } final i o exception ioe = ( i o exception ) e ; if ( ! ( ioe instanceof remote exception ) ) { return ioe ; } return ( ( remote exception ) ioe ) unwrap remote exception ( ) ; }


returns true if this monitor has timed - out

public boolean did timeout ( ) { return did timeout get ( ) ; }


get a snapshot of the current values of all the tracked quantiles

synchronized public map < quantile , long > snapshot ( ) { / / flush the buffer first for best results insert batch ( ) ; if ( samples is empty ( ) ) { return null ; } map < quantile , long > values = new tree map < quantile , long > ( ) ; for ( int i = 0 ; i < quantiles length ; i + + ) { values put ( quantiles [ i ] , query ( quantiles [ i ] quantile ) ) ; } return values ; }


consume and decode the response body to a single object of type { @ code < b > } and then apply assertions

< b > body spec < b , ? > expect body ( class < b > body type ) ;


this test checks edge cases , when trying to increasedecrease the lfu cache fraction to more than 1less than 0 ( of the cache size ) the expected behaviour is not to update the lfu fraction

public void test l f u fraction overflow ( ) { final int adaptive rate = 700 ; / / in order to cause an overflow m cache = create dummy adaptive counting memory cache ( m params supplier , m cache trim strategy , m value descriptor , adaptive rate , 1 , 2 , initial l f u cache fraction promil ) ; / / add item 1 to lfu closeable reference < integer > original ref 1 = new reference ( 10 ) ; closeable reference < integer > value ref 1 = m cache cache ( keys [ 1 ] , original ref 1 ) ; original ref 1 close ( ) ; value ref 1 close ( ) ; assert l f u exclusively owned ( keys [ 1 ] , 10 ) ; / / add item 2 to lfu closeable reference < integer > original ref 2 = new reference ( 20 ) ; closeable reference < integer > value ref 2 = m cache cache ( keys [ 2 ] , original ref 2 ) ; original ref 2 close ( ) ; value ref 2 close ( ) ; assert l f u exclusively owned ( keys [ 1 ] , 10 ) ; assert l f u exclusively owned ( keys [ 2 ] , 20 ) ; / / add item 3 to lfu , item 1 will be evicted from lfu and will be inserted to the lfu ghost list closeable reference < integer > original ref 3 = new reference ( 30 ) ; closeable reference < integer > value ref 3 = m cache cache ( keys [ 3 ] , original ref 3 ) ; original ref 3 close ( ) ; value ref 3 close ( ) ; assert l f u exclusively owned ( keys [ 2 ] , 20 ) ; assert l f u exclusively owned ( keys [ 3 ] , 30 ) ; assert not cached ( keys [ 1 ] , 10 ) ; / / item 1 in the lfu ghost list assert key is in l f u ghost list ( keys [ 1 ] , 1 ) ; / / try to access item 1 , which was already evicted , which will result in updating the lfu / / fraction assert equals ( initial l f u cache fraction promil , m cache m l f u fraction promil ) ; closeable reference < integer > value ref 1a = m cache get ( keys [ 1 ] ) ; assert null ( value ref 1a ) ; / / make sure the lfu cache fraction was not updated , because if we do it will cause in overflow assert equals ( initial l f u cache fraction promil , m cache m l f u fraction promil ) ; / / make item 2 and item 3 " frequently used " by accessing them more than m frequently used threshiold closeable reference < integer > value ref 2a = m cache get ( keys [ 2 ] ) ; closeable reference < integer > value ref 3a = m cache get ( keys [ 3 ] ) ; value ref 2a close ( ) ; value ref 3a close ( ) ; assert m f u exclusively owned ( keys [ 2 ] , 20 ) ; assert m f u exclusively owned ( keys [ 3 ] , 30 ) ; / / insert item 4 to mfu , item 2 will be evicted from mfu and inserted in the mfu ghost list closeable reference < integer > original ref 4 = new reference ( 40 ) ; closeable reference < integer > value ref 4 = m cache cache ( keys [ 4 ] , original ref 4 ) ; closeable reference < integer > value ref 4a = m cache get ( keys [ 4 ] ) ; original ref 4 close ( ) ; value ref 4 close ( ) ; value ref 4a close ( ) ; assert equals ( initial l f u cache fraction promil , m cache m l f u fraction promil ) ; closeable reference < integer > value ref 2b = m cache get ( keys [ 2 ] ) ; assert null ( value ref 2b ) ; / / make sure the lfu cache fraction was not updated , because if we do it will cause in overflow assert equals ( initial l f u cache fraction promil , m cache m l f u fraction promil ) ; }


public void write ( byte [ ] bytes , int offset , int length ) { int write at = cursor ; int end = write at + length ; int bytes end = offset + length ; / / twos - complement math trick : ( ( x < 0 ) | | ( y < 0 ) ) < = > ( ( x | y ) < 0 ) if ( ( ( offset | length | end ) < 0 ) | | ( bytes end > bytes length ) ) { throw new index out of bounds exception ( " bytes length " + bytes length + " ; " + offset + " ! " + end ) ; } if ( stretchy ) { ensure capacity ( end ) ; } else if ( end > data length ) { throw bounds ( ) ; return ; } system arraycopy ( bytes , offset , data , write at , length ) ; cursor = end ; }


public map < string , config key > config keys ( ) { return config keys ; }


clear warnings from authentication handler execution result

authentication handler execution result clear warnings ( ) ;


public abstract void load model ( list < row > model rows ) ;


test what happens we collide with an meteoroid

public void test collide meteoroid ( ) { test collision ( new meteoroid ( 1 , 1 , 3 , 4 ) , false , false , false , true ) ; }


verify disk checker bails after 3 file write errors

public final void test disk io detects write errors ( ) throws throwable { disk checker replace file output stream provider ( new test file io provider ( 0 , disk checker disk io max iterations ) ) ; check dirs ( false ) ; }


returns the column table filter that has been set on this g table filter panel or null if there is none

public column based table filter < row object > get column table filter ( ) { return column table filter ; }


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


determine the shards of an index with a specific state

public list < shard routing > shards with state ( string index , shard routing state states ) { list < shard routing > shards = new array list < > ( ) ; if ( states length = = 1 ) { if ( states [ 0 ] = = shard routing state initializing ) { for ( shard routing shard entry : initializing shards ) { if ( shard entry get index name ( ) equals ( index ) = = false ) { continue ; } shards add ( shard entry ) ; } return shards ; } else if ( states [ 0 ] = = shard routing state relocating ) { for ( shard routing shard entry : relocating shards ) { if ( shard entry get index name ( ) equals ( index ) = = false ) { continue ; } shards add ( shard entry ) ; } return shards ; } } for ( shard routing shard entry : this ) { if ( ! shard entry get index name ( ) equals ( index ) ) { continue ; } for ( shard routing state state : states ) { if ( shard entry state ( ) = = state ) { shards add ( shard entry ) ; } } } return shards ; }


create a new { @ code transactional application listener } for the given payload consumer

static < t > transactional application listener < payload application event < t > > for payload ( transaction phase phase , consumer < t > consumer ) { transactional application listener adapter < payload application event < t > > listener = new transactional application listener adapter < > ( event - > consumer accept ( event get payload ( ) ) ) ; listener set transaction phase ( phase ) ; return listener ; }


gets the type of the key by which the data set is partitioned

type information [ ] get key types ( ) ;


unmap the provided mapped or direct byte buffer this buffer cannot be referenced after this call , so it ' s highly recommended that any fields referencing it should be set to null

public static void unmap ( string resource description , byte buffer buffer ) throws i o exception { if ( ! buffer is direct ( ) ) throw new illegal argument exception ( " unmapping only works with direct buffers " ) ; if ( unmap = = null ) throw unmap not supported exception ; try { unmap invoke exact ( buffer ) ; } catch ( throwable throwable ) { throw new i o exception ( " unable to unmap the mapped buffer : " + resource description , throwable ) ; } }


public static d b type valueof ( string db type ) { for ( d b type dt : values ( ) ) { if ( string utils equals ignore case ( dt name ( ) , db type ) ) { return dt ; } } throw new illegal argument exception ( " unknown dbtype : " + db type ) ; }


the number of error - free flow events that were passed to plugins

public int flow events ( ) { return flow events ; }


configure retention period for window and session stores ignored for keyvalue stores overridden by pre - configured store suppliers ( { @ link materialized # as ( session bytes store supplier ) } or { @ link materialized # as ( window bytes store supplier ) } ) note that the retention period must be at least long enough to contain the windowed data ' s entire life cycle , from window - start through window - end , and for the entire grace period

public materialized < k , v , s > with retention ( final duration retention ) throws illegal argument exception { final string msg prefix = prepare millis check fail msg prefix ( retention , " retention " ) ; final long retenation ms = validate millisecond duration ( retention , msg prefix ) ; if ( retenation ms < 0 ) { throw new illegal argument exception ( " retention must not be negative " ) ; } this retention = retention ; return this ; }


render exceptions adds error messages and the stack trace to the json model and sets the response status accordingly to note bad requests

public static void render exception ( final exception ex , final http servlet response response ) { val map = new hash map < string , object > ( ) ; map put ( " error " , ex get message ( ) ) ; map put ( " stacktrace " , arrays deep to string ( ex get stack trace ( ) ) ) ; render exception ( map , response ) ; }


called when the last engine is ending its live , it can occur when : 1 service is dying 2 service is switching from one engine to another 3 [ only my assumption ] when wallpaper is not visible and system is going to restore some memory for foreground processing by disposing not used wallpaper engine we can ' t destroy app there , because : 1 in won ' t work - gl context is disposed right now and after app on destroy ( ) app would stuck somewhere in gl thread synchronizing code 2 we don ' t know if service create more engines , app is shared between them and should stay initialized waiting for new engines

public void on deep pause application ( ) { if ( debug ) log d ( tag , " > android live wallpaper service - on deep pause application ( ) " ) ; / / free native resources consuming runtime memory , note that it can cause some lag when resuming wallpaper if ( app ! = null ) { app graphics clear managed caches ( ) ; } }


sets whether animation position is saved in { @ link # on save instance state ( ) } and restored in { @ link # on restore instance state ( parcelable ) }

public void set freezes animation ( boolean freezes animation ) { m freezes animation = freezes animation ; }


whether or not the rule should be negated ! foo means foo should be removed from previous matches example : \ bak excludes all backup adding ! test bak will include test bak in the project root note : it is not possible to re - include a file if a parent directory of that file is excluded

public boolean get negated ( ) { return this syntax ! = null & & this syntax size ( ) > 0 & & this syntax get ( 0 ) get token ( ) = = ignore line parser token negate ; }


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


expect that a rename will fail with an exception using the role f s

private access denied exception expect rename forbidden ( path src , path dest ) throws exception { try ( duration info ignored = new duration info ( log , true , " rename ( % s , % s ) " , src , dest ) ) { return forbidden ( " renaming " + src + " to " + dest , " " , ( ) - > { boolean result = role f s rename ( src , dest ) ; log error ( " rename should have been forbidden but returned { } " , result ) ; log error ( " source directory : \ n { } " , contract test utils ls ( get file system ( ) , src get parent ( ) ) ) ; log error ( " destination directory : \ n { } " , contract test utils ls ( get file system ( ) , src get parent ( ) ) ) ; return " rename unexpectedly returned " + result ; } ) ; } }


standard method that must be overridden when creating custom renderers the primary changes here are to change the attributes of the cell based on the contents of the underlying { @ link instruction table data object }

public component get table cell renderer component ( g table cell rendering data data ) { object value = data get value ( ) ; j table table = data get table ( ) ; int column = data get column view index ( ) ; boolean is selected = data is selected ( ) ; boolean has focus = data has focus ( ) ; / / do a null check on the input here to protect ourselves this value can be null / / in certain cases ( eg : change resolution on the screen [ ctrl - + on mac ] , then move the / / instruction window to a different monitor , then click on a cell ) if ( value = = null ) { return this ; } / / get the data object backing the cell instruction table data object data object = ( instruction table data object ) value ; string str data = data object get data ( ) ; g table cell rendering data render data = data copy with new value ( str data ) ; j label the renderer = ( j label ) super get table cell renderer component ( render data ) ; set text attributes ( table , value , column ) ; set background attributes ( is selected , has focus , data object ) ; set border attributes ( data object , the renderer ) ; set foreground attributes ( data object , the renderer ) ; return this ; }


test that a collection of strings are written out correctly to the local file system

public void test write strings file system ( ) throws i o exception { uri uri = tmp to u r i ( ) ; configuration conf = new configuration ( ) ; file system fs = file system get ( uri , conf ) ; path test path = new path ( new path ( uri ) , " writestrings out " ) ; collection < string > write = arrays as list ( " over " , " the " , " lazy " , " dog " ) ; file util write ( fs , test path , write , standard charsets utf 8 ) ; list < string > read = file utils read lines ( new file ( test path to uri ( ) ) , standard charsets utf 8 ) ; assert equals ( write , read ) ; }


the list of subject alternate names allowed for workload instances that implement this service this information is used to enforce [ secure - naming ] ( https : istio iodocsconceptssecurity # secure - naming ) if specified , the proxy will verify that the server certificate ' s subject alternate name matches one of the specified values < code > repeated string subject alt names = 8 ; < code >

public java lang string get subject alt names ( int index ) { return subject alt names get ( index ) ; }


try set cgroup devices params for the container using container - executor if it has real device major number , minor number or dev path , we ' ll do the enforcement otherwise , won ' t do it

private void try isolate devices ( device mapping manager device allocation allocation , string container id str ) throws resource handler exception { try { / / execute c - e to setup device isolation before launch the container privileged operation privileged operation = new privileged operation ( privileged operation operation type device , arrays as list ( container id cli option , container id str ) ) ; boolean need native device operation = false ; int major number ; int minor number ; list < string > dev numbers = new array list < > ( ) ; if ( ! allocation get denied ( ) is empty ( ) ) { device type dev type ; for ( device denied device : allocation get denied ( ) ) { major number = denied device get major number ( ) ; minor number = denied device get minor number ( ) ; / / add device type dev type = get device type ( denied device ) ; if ( dev type ! = null ) { dev numbers add ( dev type get name ( ) + " - " + major number + " : " + minor number + " - rwm " ) ; } } if ( dev numbers size ( ) ! = 0 ) { privileged operation append args ( arrays as list ( excluded devices cli option , string utils join ( " , " , dev numbers ) ) ) ; need native device operation = true ; } } if ( ! allocation get allowed ( ) is empty ( ) ) { dev numbers clear ( ) ; for ( device allowed device : allocation get allowed ( ) ) { major number = allowed device get major number ( ) ; minor number = allowed device get minor number ( ) ; if ( major number ! = - 1 & & minor number ! = - 1 ) { dev numbers add ( major number + " : " + minor number ) ; } } if ( dev numbers size ( ) > 0 ) { privileged operation append args ( arrays as list ( allowed devices cli option , string utils join ( " , " , dev numbers ) ) ) ; need native device operation = true ; } } if ( need native device operation ) { privileged operation executor execute privileged operation ( privileged operation , true ) ; } } catch ( privileged operation exception e ) { c groups handler delete c group ( c groups handler c group controller devices , container id str ) ; log warn ( " could not update cgroup for container " , e ) ; throw new resource handler exception ( e ) ; } }


the certificate chain , as a new byte array generally should be pem - encoded

public byte [ ] get certificate chain ( ) { return arrays copy of ( certificate chain , certificate chain length ) ; }


get information about the elector ' s connection to zookeeper

string get zookeeper connection state ( ) ;


public static void put ( @ non null final string key , final object value , int save time ) { put ( key , value , save time , get default cache memory utils ( ) ) ; }


public void remove all method proxies ( ) { m internal method proxies clear ( ) ; }


the method used by the node manager ' s < code > shared cache upload service < code > to request whether a resource can be uploaded the < code > shared cache manager < code > responds with whether or not the node manager can upload the file

public s c m uploader can upload response can upload ( s c m uploader can upload request request ) throws yarn exception , i o exception ;


transforms this fluent iterable into a new one containing objects of the type t

public < t > fluent iterable < t > map ( function < ? super e , t > function ) { return new lazy fluent iterable < > ( ) { @ override public iterator < t > iterator ( ) { return new decorating iterator < > ( null ) { final iterator < e > old type iterator = iterable iterator ( ) ; @ override public t compute next ( ) { if ( old type iterator has next ( ) ) { e candidate = old type iterator next ( ) ; return function apply ( candidate ) ; } else { return null ; } } } ; } } ; }


spnego client after usage needs to be closed in order to logout from { @ link login context } and dispose { @ link g s s context }

public void close ( ) throws login exception , g s s exception , privileged action exception { if ( login context ! = null ) { access controller do privileged ( ( privileged exception action < void > ) ( ) - > { login context logout ( ) ; return null ; } ) ; } if ( gss context ! = null ) { access controller do privileged ( ( privileged exception action < void > ) ( ) - > { gss context dispose ( ) ; return null ; } ) ; } }


get type pool resolution of the witness class

private type pool resolution get resolution ( string witness class , class loader class loader ) { class loader mapping key = class loader = = null ? null class loader instance : class loader ; if ( ! pool map contains key ( mapping key ) ) { synchronized ( pool map ) { if ( ! pool map contains key ( mapping key ) ) { type pool class type pool = class loader = = null ? type pool default of boot loader ( ) : type pool default of ( class loader ) ; pool map put ( mapping key , class type pool ) ; } } } type pool type pool = pool map get ( mapping key ) ; return type pool describe ( witness class ) ; }


< code > required uint 3 2 day of month = 4 ; < code >


get the angle in degrees of the rotation this quaternion represents use { @ link # get axis angle ( vector 3 ) } to get both the axis and the angle of this rotation use { @ link # get angle around ( vector 3 ) } to get the angle around a specific axis

public float get angle ( ) { return get angle rad ( ) * math utils radians to degrees ; }


get the path variable with the given name , if present

default string path variable ( string name ) { map < string , string > path variables = path variables ( ) ; if ( path variables contains key ( name ) ) { return path variables ( ) get ( name ) ; } else { throw new illegal argument exception ( " no path variable with name \ " " + name + " \ " available " ) ; } }


public static transaction manager get ( ) { if ( singleton holder instance = = null ) { throw new should never happen exception ( " transaction manager is not ready ! " ) ; } return singleton holder instance ; }


specify the limit for the number of consumers that are allowed to be idle at any given time this limit is used by the { @ link # schedule new invoker if appropriate } method to determine if a new invoker should be created increasing the limit causes invokers to be created more aggressively this can be useful to ramp up the number of invokers faster the default is 1 , only scheduling a new invoker ( which is likely to be idle initially ) if none of the existing invokers is currently idle

public void set idle consumer limit ( int idle consumer limit ) { assert is true ( idle consumer limit > 0 , " ' idle consumer limit ' must be 1 or higher " ) ; synchronized ( this lifecycle monitor ) { this idle consumer limit = idle consumer limit ; } }


the smallest integer allowed for this xml attribute only makes sense if the format includes format flags : : integer < code > optional int 3 2 min int = 2 ; < code >

public int get min int ( ) { return min int ; }


basic idea of the test : 1 register a token for 2 seconds with no cancel at the end 2 cancel it immediately 3 sleep and check that the 2 seconds renew didn ' t happen ( totally 5 renewals ) 4 check cancellation

public void test d t renewal with no cancel ( ) throws exception { my f s dfs = ( my f s ) file system get ( conf ) ; log info ( " dfs = " + ( object ) dfs hash code ( ) + " ; conf = " + conf hash code ( ) ) ; credentials ts = new credentials ( ) ; my token token 1 = dfs get delegation token ( " user 1 " ) ; / / to cause this one to be set for renew in 2 secs renewer token to renew in 2 sec = token 1 ; log info ( " token = " + token 1 + " should be renewed for 2 secs " ) ; string nn 1 = delegation token renewer scheme + " : / / host 1 : 0 " ; ts add token ( new text ( nn 1 ) , token 1 ) ; application id application id 1 = builder utils new application id ( 0 , 1 ) ; delegation token renewer add application async ( application id 1 , ts , false , " user " , new configuration ( ) ) ; wait for events to get processed ( delegation token renewer ) ; delegation token renewer application finished ( application id 1 ) ; wait for events to get processed ( delegation token renewer ) ; int number of expected renewals = renewer counter ; / / number of renewals so far try { thread sleep ( 6 * 1000 ) ; / / sleep 6 seconds , so it has time to renew } catch ( interrupted exception e ) { } log info ( " counter = " + renewer counter + " ; t = " + renewer last renewed ) ; / / counter and the token should still be the old ones assert equals ( " renew wasn ' t called as many times as expected " , number of expected renewals , renewer counter ) ; / / also renewing of the canceled token should not fail , because it has not / / been canceled token 1 renew ( conf ) ; }


returns the arguments of this expression

protected list < string > get arguments ( ) { return this arguments ; }


public synchronized boolean try read lock ( ) { if ( is write locked ( ) ) { return false ; } else { status + + ; return true ; } }


private static string get test name ( i invoked method method ) { return string utils substring after last ( method get test method ( ) get test class ( ) get name ( ) , " " ) + " # " + method get test method ( ) get constructor or method ( ) get name ( ) ; }


returns an { @ link optional } { @ link address range } for the mapped addresses if this is a mapped memory block ( bit mapped or byte mapped ) otherwise , the optional is empty

optional < address range > get mapped range ( ) ;


writes a { @ link tuple } data set as csv file ( s ) to the specified location < b > note : only a tuple data set can written as a csv file < b > for each tuple field the result of { @ link object # to string ( ) } is written tuple fields are separated by the default field delimiter { @ code " comma " ( , ) } tuples are are separated by the newline character ( { @ code \ n } )

public data sink < t > write as csv ( string file path , write mode write mode ) { return internal write as csv ( new path ( file path ) , csv output format default line delimiter , csv output format default field delimiter , write mode ) ; }


strategy for an argument that corresponds to a given { @ link logical type family } and nullability implicit casts will be inserted if possible

public static family argument type strategy logical ( logical type family expected family , boolean expected nullability ) { return new family argument type strategy ( expected family , expected nullability ) ; }


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


returns the content of the input source callers must not modify the result

char [ ] get content ( ) { return content ; }


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


wrapper of { @ link pl droidsonroids gif gif drawable # gif drawable ( byte [ ] ) }

public t from ( byte [ ] bytes ) { m input source = new input source byte array source ( bytes ) ; return self ( ) ; }


add a search request to execute note , the order is important , the search response will be returned in the same order as the search requests

public multi search request add ( search request request ) { requests add ( request ) ; return this ; }


test the safe mode monitor the monitor will make block manager leave the safe mode after extension period

public void test safe mode monitor ( ) throws exception { bm safe mode activate ( block total ) ; set block safe ( block threshold ) ; / / pending threshold - > extension bm safe mode check safe mode ( ) ; assert true ( bm safe mode is in safe mode ( ) ) ; wait for extension period ( ) ; assert false ( bm safe mode is in safe mode ( ) ) ; }


sets the text of the text field at the given index

public void set value ( string text , int index ) { text fields [ index ] set text ( text ) ; }


retrieves and removes the first element of this deque this method differs from { @ link # poll first poll first } only in that it throws an exception if this deque is empty


public list < plugin wrapper > get plugins ( ) { return collections unmodifiable list ( plugins ) ; }


get the value of the ' { @ code title } ' attribute may be a runtime expression

protected string get title ( ) { return this title ; }


whether { @ code value } matches { @ code regex }

public abstract boolean matches ( string regex , string value ) ;


adds a configuration properties for the kafka consumer

public kafka property ( string key , string value ) { preconditions check not null ( key ) ; preconditions check not null ( value ) ; if ( this kafka properties = = null ) { this kafka properties = new hash map < > ( ) ; } kafka properties put ( key , value ) ; return this ; }


set the parallax header of the recyclerview

public void set parallax header ( view header ) { m header = new custom relative wrapper ( header get context ( ) ) ; m header set layout params ( new view group layout params ( view group layout params wrap content , view group layout params wrap content ) ) ; m header add view ( header , new relative layout layout params ( view group layout params match parent , view group layout params match parent ) ) ; is parallax header = true ; }


tests that we can merge two different function tags that have been added to the same function note : the test programs must be modified a bit to facilitate this test specifically we have to add a function at the same address in both programs , then add tags to each program , then add those tags to the newly created functions

public void test function tag merge ( ) { try { load program ( diff test p 1 ) ; load program ( diff test p 2 ) ; function manager d b func mgr 1 = ( function manager d b ) diff test p 1 get function manager ( ) ; function manager d b func mgr 2 = ( function manager d b ) diff test p 2 get function manager ( ) ; / / create a function in program 1 int id = diff test p 1 start transaction ( " create 1 " ) ; func mgr 1 create function ( " testfunc " , addr ( " 1002040 " ) , new address set ( addr ( " 1002040 " ) , addr ( " 1002048 " ) ) , source type default ) ; diff test p 1 end transaction ( id , true ) ; / / create a function in program 2 id = diff test p 2 start transaction ( " create 2 " ) ; func mgr 2 create function ( " testfunc " , addr ( " 1002040 " ) , new address set ( addr ( " 1002040 " ) , addr ( " 1002048 " ) ) , source type default ) ; diff test p 2 end transaction ( id , true ) ; function f 1 = diff test p 1 get function manager ( ) get function at ( addr ( " 1002040 " ) ) ; function f 2 = diff test p 2 get function manager ( ) get function at ( addr ( " 1002040 " ) ) ; / / create a tag and add it to program 1 id = diff test p 1 start transaction ( " create 1 " ) ; func mgr 1 get function tag manager ( ) create function tag ( " tag a " , " tag a comment " ) ; f 1 add tag ( " tag a " ) ; diff test p 1 end transaction ( id , true ) ; / / create a tag and add it to program 2 id = diff test p 2 start transaction ( " create 2 " ) ; func mgr 2 get function tag manager ( ) create function tag ( " tag b " , " tag b comment " ) ; f 2 add tag ( " tag b " ) ; diff test p 2 end transaction ( id , true ) ; / / open the diff display and apply the merge open diff ( diff test p 1 , diff test p 2 ) ; show apply settings ( ) ; merge ( function tag apply c b ) ; address set as = new address set ( addr ( " 1002040 " ) , addr ( " 1002040 " ) ) ; set diff selection ( as ) ; apply ( ) ; / / check the results we should have both tags now in the target program / / ( program 1 ) , so check the number of tags and make sure the names are / / correct iterator < function tag > iter = f 1 get tags ( ) iterator ( ) ; list < string > tag names = new array list < > ( ) ; while ( iter has next ( ) ) { function tag tag = iter next ( ) ; tag names add ( tag get name ( ) ) ; } assert equals ( tag names size ( ) , 2 ) ; assert true ( tag names contains ( " tag a " ) ) ; assert true ( tag names contains ( " tag b " ) ) ; } catch ( invalid input exception | overlapping function exception e ) { msg error ( this , " error setting up function tag diff test " , e ) ; } }


receive a message synchronously from the specified destination , but only wait up to a specified time for delivery this method should be used carefully , since it will block the thread until the message becomes available or until the timeout value is exceeded


sets the { @ link data spec # length } the default value is { @ link c # length unset }

public builder set length ( long length ) { this length = length ; return this ; }


fire a mouse moved event for the given component

public static void move mouse ( component comp , int x , int y ) { post event ( new mouse event ( comp , mouse event mouse moved , system current time millis ( ) , 0 , x , y , 0 , false ) ) ; }


identify workers which we think should be running but do not appear in the agent ' s response we need to send start worker requests for those

private void handle missing workers ( agent status response agent status ) { for ( map entry < long , managed worker > entry : workers entry set ( ) ) { long worker id = entry get key ( ) ; if ( ! agent status workers ( ) contains key ( worker id ) ) { managed worker worker = entry get value ( ) ; if ( worker should run ) { worker try create ( ) ; } } } }


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

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


create the scheduler instance for the given factory and scheduler name called by { @ link # after properties set } the default implementation invokes scheduler factory ' s { @ code get scheduler } method can be overridden for custom scheduler creation

protected scheduler create scheduler ( scheduler factory scheduler factory , @ nullable string scheduler name ) throws scheduler exception { / / override thread context class loader to work around naive quartz class load helper loading thread current thread = thread current thread ( ) ; class loader thread context class loader = current thread get context class loader ( ) ; boolean override class loader = ( this resource loader ! = null & & this resource loader get class loader ( ) ! = thread context class loader ) ; if ( override class loader ) { current thread set context class loader ( this resource loader get class loader ( ) ) ; } try { scheduler repository repository = scheduler repository get instance ( ) ; synchronized ( repository ) { scheduler existing scheduler = ( scheduler name ! = null ? repository lookup ( scheduler name ) : null ) ; scheduler new scheduler = scheduler factory get scheduler ( ) ; if ( new scheduler = = existing scheduler ) { throw new illegal state exception ( " active scheduler of name ' " + scheduler name + " ' already registered " + " in quartz scheduler repository cannot create a new spring - managed scheduler of the same name ! " ) ; } if ( ! this expose scheduler in repository ) { / / need to remove it in this case , since quartz shares the scheduler instance by default ! scheduler repository get instance ( ) remove ( new scheduler get scheduler name ( ) ) ; } return new scheduler ; } } finally { if ( override class loader ) { / / reset original thread context class loader current thread set context class loader ( thread context class loader ) ; } } }


returns the set of shard allocation ids that are in the in - sync set but have no assigned routing entry

public set < string > get unavailable in sync shards ( ) { return unavailable in sync shards ; }


protected list < string > resolve event from http request ( final http servlet request request ) { val mfa request header = cas properties get authn ( ) get mfa ( ) get request header ( ) ; val headers = request get headers ( mfa request header ) ; if ( headers ! = null & & headers has more elements ( ) ) { logger debug ( " received request header [ { } ] as [ { } ] " , mfa request header , headers ) ; return collections list ( headers ) ; } val mfa request parameter = cas properties get authn ( ) get mfa ( ) get request parameter ( ) ; val params = request get parameter values ( mfa request parameter ) ; if ( params ! = null & & params length > 0 ) { logger debug ( " received request parameter [ { } ] as [ { } ] " , mfa request parameter , params ) ; return arrays stream ( params ) collect ( collectors to list ( ) ) ; } val attribute name = cas properties get authn ( ) get mfa ( ) get session attribute ( ) ; val session = request get session ( false ) ; var attribute value = optional of nullable ( session ) map ( http session - > http session get attribute ( attribute name ) ) or else ( null ) ; if ( attribute value = = null ) { logger trace ( " no value could be found for session attribute [ { } ] checking request attributes " , attribute name ) ; attribute value = request get attribute ( attribute name ) ; } if ( attribute value = = null ) { logger trace ( " no value could be found for [ { } ] " , attribute name ) ; return null ; } val values = collection utils to collection ( attribute value ) ; logger debug ( " found values [ { } ] mapped to attribute name [ { } ] " , values , attribute name ) ; return values stream ( ) map ( object : : to string ) collect ( collectors to list ( ) ) ; }


returns if this connector requires a format descriptor

protected final boolean is format needed ( ) { return format needed ; }


returns true if all services are currently in the { @ linkplain state # running running } state users who want more detailed information should use the { @ link # services by state } method to get detailed information about which services are not running

public boolean is healthy ( ) { for ( service service : services ) { if ( ! service is running ( ) ) { return false ; } } return true ; }


determine the class to use for naming a variable containing the given value will return the class of the given value , except when encountering a jdk proxy , in which case it will determine the ' primary ' interface implemented by that proxy

private static class < ? > get class for value ( object value ) { class < ? > value class = value get class ( ) ; if ( proxy is proxy class ( value class ) ) { class < ? > [ ] ifcs = value class get interfaces ( ) ; for ( class < ? > ifc : ifcs ) { if ( ! class utils is java language interface ( ifc ) ) { return ifc ; } } } else if ( value class get name ( ) last index of ( ' $ ' ) ! = - 1 & & value class get declaring class ( ) = = null ) { / / ' $ ' in the class name but no inner class - / / assuming it ' s a special subclass ( e g by open j p a ) value class = value class get superclass ( ) ; } return value class ; }


true if this request is a multipart request


set whether the framework should use the new api for the mapper this is the default for jobs submitted with the new job api

public void set use new mapper ( boolean flag ) { set boolean ( " mapred mapper new - api " , flag ) ; }


select the given row object no selection will be made if the object is filtered out of view

public void set selected item ( row object t ) { int view row = text filter model get view index ( t ) ; if ( view row > = 0 ) { table set row selection interval ( view row , view row ) ; scroll to selected row ( ) ; } }


creates a proxy object that executes the callee in the context that impersonates this executor useful to export an object to a remote channel

public < t > t new impersonating proxy ( class < t > type , t core ) { return new intercepting proxy ( ) { protected object call ( object o , method m , object [ ] args ) throws throwable { final executor old = impersonation get ( ) ; impersonation set ( executor this ) ; try { return m invoke ( o , args ) ; } finally { impersonation set ( old ) ; } } } wrap ( type , core ) ; }


computes the bzl load value for all given bzl load keys using ordinary skyframe evaluation , returning { @ code null } if skyframe deps were missing and have been requested { @ code program loads } provides the locations of the load statements in source order , for error reporting

private static list < bzl load value > compute bzl loads with skyframe ( environment env , list < bzl load value key > keys , list < pair < string , location > > program loads ) throws bzl load failed exception , interrupted exception { list < bzl load value > bzl loads = lists new array list with expected size ( keys size ( ) ) ; map < sky key , value or exception < bzl load failed exception > > values = env get values or throw ( keys , bzl load failed exception class ) ; / / process loads ( and report first error ) in source order for ( int i = 0 ; i < keys size ( ) ; i + + ) { try { bzl loads add ( ( bzl load value ) values get ( keys get ( i ) ) get ( ) ) ; } catch ( bzl load failed exception ex ) { throw bzl load failed exception while loading dep ( program loads get ( i ) second , ex ) ; } } return env values missing ( ) ? null : bzl loads ; }


public void remove ( ) { prev next = next ; next prev = prev ; next = prev = null ; }


create a orc vector from partition spec value see hive { @ code vectorized row batch ctx # add partition cols to batch }

private static column vector create hive vector from constant ( logical type type , object value , int batch size ) { switch ( type get type root ( ) ) { case char : case varchar : case binary : case varbinary : return create bytes vector ( batch size , value ) ; case boolean : return create long vector ( batch size , ( boolean ) value ? 1 : 0 ) ; case tinyint : case smallint : case integer : case bigint : return create long vector ( batch size , value ) ; case decimal : decimal type decimal type = ( decimal type ) type ; return create decimal vector ( batch size , decimal type get precision ( ) , decimal type get scale ( ) , value ) ; case float : case double : return create double vector ( batch size , value ) ; case date : if ( value instanceof local date ) { value = date value of ( ( local date ) value ) ; } return create long vector ( batch size , date to internal ( ( date ) value ) ) ; case timestamp without time zone : return timestamp util create vector from constant ( batch size , value ) ; default : throw new unsupported operation exception ( " unsupported type : " + type ) ; } }


return the time ( according to system current time millis ( ) ) at which the service of this request was started

public long get start time ( ) { return start time millis ; }


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


tells whether the target was compiled with gs buffer security checks

public boolean is compiled with gs buffer security checks ( ) { return compiled with gs buffer security checks ; }


multiplies the vector with the given matrix , performing a division by w the matrix array is assumed to hold a 4x 4 column major matrix as you can get from { @ link matrix 4 # val } the vector array is assumed to hold a 3 - component vector , with x being the first element , y being the second and z being the last component the result is stored in the vector array this is the same as { @ link vector 3 # prj ( matrix 4 ) }

public static void prj ( float [ ] mat , float [ ] vec ) { matrix 4 proj ( mat , vec , 0 ) ; }


private static timestamp timestamp of ( final instant time ) { return timestamp from ( time ) ; }


initialize data organization to reflect big - endian mips 3 2 cspec specification ( mips 32 - bit )

public static void init data organization 3 2 bit mips ( data organization impl data org ) { data org set big endian ( true ) ; data org set pointer size ( 4 ) ; data org set float size ( 4 ) ; data org set double size ( 8 ) ; data org set long double size ( 8 ) ; data org set size alignment ( 1 , 1 ) ; data org set size alignment ( 2 , 2 ) ; data org set size alignment ( 4 , 4 ) ; data org set size alignment ( 8 , 8 ) ; bit field packing impl bit field packing = new bit field packing impl ( ) ; / / use defaults data org set bit field packing ( bit field packing ) ; }


get the directories where the namenode stores its edits

public collection < uri > get name edits dirs ( int nn index ) throws i o exception { return f s namesystem get namespace edits dirs ( get n n ( nn index ) conf ) ; }


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


helper method that sets the cache size limit to be either a high , or a low limit if there is not enough free space to satisfy the high limit , it is set to the low limit

private void update file cache size limit ( ) { / / test if m cache size limit can be set to the high limit boolean is available space lower than high limit ; stat fs helper storage type storage type = m storage is external ( ) ? stat fs helper storage type external : stat fs helper storage type internal ; is available space lower than high limit = m stat fs helper test low disk space ( storage type , m default cache size limit - m cache stats get size ( ) ) ; if ( is available space lower than high limit ) { m cache size limit = m low disk space cache size limit ; } else { m cache size limit = m default cache size limit ; } }


public static string canonical name ( string blob name ) { if ( blob name contains ( " part " ) ) { return blob name substring ( 0 , blob name index of ( " part " ) ) ; } return blob name ; }


projects a { @ link tuple } { @ link data stream } to the previously selected fields

public < t0 > single output stream operator < tuple 1 < t0 > > project tuple 1 ( ) { type information < ? > [ ] f types = extract field types ( field indexes , data stream get type ( ) ) ; tuple type info < tuple 1 < t0 > > t type = new tuple type info < tuple 1 < t0 > > ( f types ) ; return data stream transform ( " projection " , t type , new stream project < in , tuple 1 < t0 > > ( field indexes , t type create serializer ( data stream get execution config ( ) ) ) ) ; }


public static execution sequencer create ( ) { return new execution sequencer ( ) ; }


collects layout outputs and release the layout tree the layout outputs hold necessary information to be used by { @ link mount state } to mount components into a { @ link component host } whenever a component has view content ( view tags , click handler , etc ) , a new host ' marker ' is added for it the mount pass will use the markers to decide which host should be used for each layout output the root node unconditionally generates a layout output corresponding to the root host the order of layout outputs follows a depth - first traversal in the tree to ensure the hosts will be created at the right order when mounting the host markers will be define which host each mounted artifacts will be attached to at this stage all the { @ link internal node } for which we have layout outputs that can be recycled will have a diff node associated if the cached measures are valid we ' ll try to recycle both the host and the contents ( including backgroundforeground ) in all other cases instead we ' ll only try to re - use the hosts in some cases the host ' s structure might change between two updates even if the component is of the same type this can happen for example when a click listener is added to avoid trying to re - use the wrong host type we explicitly check that after all the children for a subtree have been added ( this is when the actual host type is resolved ) if the host type changed compared to the one in the diff node we need to refresh the ids for the whole subtree in order to ensure that the mount state will unmount the subtree and mount it again on the correct host

private static void collect results ( @ nullable render tree node parent , component context parent context , @ nullable debug hierarchy node parent hierarchy , internal node node , layout state layout state , @ nullable diff node parent diff node ) { if ( parent context was layout canceled ( ) ) { return ; } if ( node has new layout ( ) ) { node mark layout seen ( ) ; } final component component = node get tail component ( ) ; final string component global key = component utils get global key ( component , node get tail component key ( ) ) ; final boolean is tracing = components systrace is tracing ( ) ; final debug hierarchy node hierarchy ; / / update the hierarchy if we are tracking it if ( components configuration is debug hierarchy enabled ) { hierarchy = debug hierarchy new node ( parent hierarchy , component , node get components ( ) ) ; } else { hierarchy = null ; } / / early return if collecting results of a node holding a nested tree if ( node is nested tree holder ( ) ) { / / if the nested tree is defined , it has been resolved during a measure call during / / layout calculation if ( is tracing ) { components systrace begin section with args ( " resolve nested tree : " + node get simple name ( ) ) arg ( " width spec " , " exactly " + node get width ( ) ) arg ( " height spec " , " exactly " + node get height ( ) ) arg ( " root component id " , node get tail component ( ) get id ( ) ) flush ( ) ; } internal node nested tree = layout create ( parent context , node , size spec make size spec ( node get width ( ) , exactly ) , size spec make size spec ( node get height ( ) , exactly ) ) ; if ( is tracing ) { components systrace end section ( ) ; } if ( nested tree = = null layout ) { return ; } / / account for position of the holder node layout state m current x + = node get x ( ) ; layout state m current y + = node get y ( ) ; collect results ( parent , parent context , hierarchy , nested tree , layout state , parent diff node ) ; layout state m current x - = node get x ( ) ; layout state m current y - = node get y ( ) ; return ; } / / important for accessibility yes hide descendants sets node to yes and children to / / no hide descendants if ( node get important for accessibility ( ) = = important for accessibility important for accessibility yes hide descendants ) { node important for accessibility ( important for accessibility important for accessibility yes ) ; for ( int i = 0 , size = node get child count ( ) ; i < size ; i + + ) { node get child at ( i ) important for accessibility ( important for accessibility important for accessibility no hide descendants ) ; } } final boolean should generate diff tree = layout state m should generate diff tree ; final diff node current diff node = node get diff node ( ) ; final boolean should use cached outputs = is mount spec ( component ) & & current diff node ! = null ; final boolean is cached output updated = should use cached outputs & & node are cached measures valid ( ) ; final diff node diff node ; if ( should generate diff tree ) { if ( components configuration use internal nodes for layout diffing ) { diff node = node ; } else { diff node = create diff node ( node , parent diff node ) ; } if ( parent diff node = = null ) { layout state m diff tree root = diff node ; } } else { diff node = null ; } / / if the parent of this node is disabled , this node has to be disabled too if ( layout state m parent enabled state = = enabled set false ) { node get or create node info ( ) set enabled ( false ) ; } final boolean needs host view = needs host view ( node , layout state ) ; final long current host marker = layout state m current host marker ; final int current host output position = layout state m current host output position ; final transition id current transition id = layout state m current transition id ; final output units affinity group < animatable item > current layout output affinity group = layout state m current layout output affinity group ; layout state m current transition id = get transition id for node ( node ) ; layout state m current layout output affinity group = layout state m current transition id ! = null ? new output units affinity group < animatable item > ( ) : null ; / / 1 insert a host layout output if we have some interactive content to be attached to if ( needs host view ) { final int host layout position = add host layout output ( parent , node , layout state , diff node , hierarchy ) ; add current affinity group to transition mapping ( layout state ) ; parent = layout state m mountable outputs get ( host layout position ) ; final layout output output = layout output get layout output ( parent ) ; layout state m current level + + ; layout state m current host marker = output get id ( ) ; layout state m current host output position = host layout position ; } / / we need to take into account flattening when setting duplicate parent state the parent after / / flattening may no longer exist therefore the value of duplicate parent state should only be / / true if the path between us ( inclusive ) and our inner / root host ( exclusive ) all are / / duplicate parent state final boolean should duplicate parent state = layout state m should duplicate parent state ; layout state m should duplicate parent state = needs host view | | ( should duplicate parent state & & node is duplicate parent state enabled ( ) ) ; / / generate the layout output for the given node final layout output layout output = create generic layout output ( node , layout state , hierarchy , needs host view ) ; if ( layout output ! = null ) { final long previous id = should use cached outputs & & current diff node get content output ( ) ! = null ? current diff node get content output ( ) get id ( ) : - 1 ; layout state calculate and set layout output id and update state ( layout output , layout state m current level , output unit type content , previous id , is cached output updated , hierarchy ) ; } / / 2 add background if defined if ( ! layout state m should disable drawable outputs ) { final drawable background = node get background ( ) ; if ( background ! = null ) { if ( layout output ! = null & & layout output get view node info ( ) ! = null ) { layout output get view node info ( ) set background ( background ) ; } else { final layout output convert background = ( current diff node ! = null ) ? current diff node get background output ( ) : null ; final layout output background output = add drawable component ( parent , node , layout state , convert background , hierarchy , background , output unit type background , needs host view ) ; if ( diff node ! = null ) { diff node set background output ( background output ) ; } } } } / / 3 now add the mount spec ( either view or drawable ) to the outputs if ( is mount spec ( component ) ) { / / notify component about its final size if ( is tracing ) { components systrace begin section ( " on bounds defined : " + node get simple name ( ) ) ; } component on bounds defined ( component get scoped context ( layout state get layout state context ( ) , component global key ) , node ) ; if ( is tracing ) { components systrace end section ( ) ; } add mountable output ( layout state , layout output , parent ) ; add layout output id to positions map ( layout state m outputs id to position map , layout output , layout state m mountable outputs size ( ) - 1 ) ; maybe add layout output to affinity group ( layout state m current layout output affinity group , output unit type content , layout output ) ; if ( diff node ! = null ) { diff node set content output ( layout output ) ; } } / / 4 extract the transitions if ( layout are transitions enabled ( component ! = null ? component get scoped context ( layout state get layout state context ( ) , component global key ) : null ) ) { final array list < transition > transitions = node get transitions ( ) ; if ( transitions ! = null ) { for ( int i = 0 , size = transitions size ( ) ; i < size ; i + + ) { final transition transition = transitions get ( i ) ; if ( layout state m transitions = = null ) { layout state m transitions = new array list < > ( ) ; } transition utils add transitions ( transition , layout state m transitions , layout state m root component name ) ; } } final map < string , component > components needing previous render data = node get components needing previous render data ( ) ; if ( components needing previous render data ! = null ) { if ( layout state m components needing previous render data = = null ) { layout state m components needing previous render data = new array list < > ( ) ; } if ( layout state m component keys needing previous render data = = null ) { layout state m component keys needing previous render data = new array list < > ( ) ; } / / we ' ll check for animations in mount for ( map entry < string , component > entry : components needing previous render data entry set ( ) ) { layout state m component keys needing previous render data add ( entry get key ( ) ) ; layout state m components needing previous render data add ( entry get value ( ) ) ; } } } layout state m current x + = node get x ( ) ; layout state m current y + = node get y ( ) ; @ node info enabled state final int parent enabled state = layout state m parent enabled state ; layout state m parent enabled state = ( node get node info ( ) ! = null ) ? node get node info ( ) get enabled state ( ) : enabled unset ; / / we must process the nodes in order so that the layout state output order is correct for ( int i = 0 , size = node get child count ( ) ; i < size ; i + + ) { collect results ( parent , node get context ( ) , hierarchy , node get child at ( i ) , layout state , diff node ) ; } layout state m parent enabled state = parent enabled state ; layout state m current x - = node get x ( ) ; layout state m current y - = node get y ( ) ; / / 5 add border color if defined if ( node should draw borders ( ) ) { final layout output convert border = ( current diff node ! = null ) ? current diff node get border output ( ) : null ; final layout output border output = add drawable component ( parent , node , layout state , convert border , hierarchy , get border color drawable ( node ) , output unit type border , needs host view ) ; if ( diff node ! = null ) { diff node set border output ( border output ) ; } } / / 6 add foreground if defined if ( ! layout state m should disable drawable outputs ) { final drawable foreground = node get foreground ( ) ; if ( foreground ! = null ) { if ( layout output ! = null & & layout output get view node info ( ) ! = null & & sdk int > = m ) { layout output get view node info ( ) set foreground ( foreground ) ; } else { final layout output convert foreground = ( current diff node ! = null ) ? current diff node get foreground output ( ) : null ; final layout output foreground output = add drawable component ( parent , node , layout state , convert foreground , hierarchy , foreground , output unit type foreground , needs host view ) ; if ( diff node ! = null ) { diff node set foreground output ( foreground output ) ; } } } } / / 7 add visibility outputs if any visibility - related event handlers are present if ( node has visibility handlers ( ) ) { final visibility output visibility output = create visibility output ( node , layout state ) ; layout state m visibility outputs add ( visibility output ) ; if ( diff node ! = null ) { diff node set visibility output ( visibility output ) ; } } / / 8 if we ' re in a testing environment , maintain an additional data structure with / / information about nodes that we can query later if ( layout state m test outputs ! = null & & ! text utils is empty ( node get test key ( ) ) ) { final test output test output = create test output ( node , layout state , layout output ) ; layout state m test outputs add ( test output ) ; } / / 9 extract the working range registrations list < working range container registration > registrations = node get working range registrations ( ) ; if ( registrations ! = null & & ! registrations is empty ( ) ) { if ( layout state m working range container = = null ) { layout state m working range container = new working range container ( ) ; } for ( working range container registration registration : registrations ) { layout state m working range container register working range ( registration m name , registration m working range , registration m component , registration m key ) ; } } if ( component ! = null ) { final rect rect = new rect ( ) ; if ( layout output ! = null ) { rect set ( layout output get bounds ( ) ) ; } else { rect left = layout state m current x + node get x ( ) ; rect top = layout state m current y + node get y ( ) ; rect right = rect left + node get width ( ) ; rect bottom = rect top + node get height ( ) ; } final list < string > component keys = node get component keys ( ) ; final layout state context layout state context = layout state get layout state context ( ) ; for ( int i = 0 , size = node get components ( ) size ( ) ; i < size ; i + + ) { final component delegate = node get components ( ) get ( i ) ; final string delegate key = component utils get global key ( delegate , component keys = = null ? null : component keys get ( i ) ) ; / / keep a list of the components we created during this layout calculation if the layout is / / valid , the component tree will update the event handlers that have been created in the / / previous component tree with the new component dispatched , otherwise section children / / might not be accessing the correct props and state on the event handlers the null / / checkers cover tests , the scope and tree should not be null at this point of the layout / / calculation final component context delegate scoped context = delegate get scoped context ( layout state context , delegate key ) ; if ( delegate scoped context ! = null & & delegate scoped context get component tree ( ) ! = null ) { if ( layout state m components ! = null ) { layout state m components add ( delegate ) ; if ( layout state m component keys ! = null ) { layout state m component keys add ( delegate key ) ; } } if ( delegate has attach detach callback ( ) ) { if ( layout state m attachable container = = null ) { layout state m attachable container = new linked hash map < > ( ) ; } layout state m attachable container put ( delegate key , delegate ) ; } } if ( delegate key ! = null | | delegate has handle ( ) ) { rect copy rect = new rect ( rect ) ; if ( delegate key ! = null ) { layout state m component key to bounds put ( delegate key , copy rect ) ; } if ( delegate has handle ( ) ) { layout state m component handle to bounds put ( delegate get handle ( ) , copy rect ) ; } } } } / / 10 if enabled , show a debug foreground layer covering the whole litho view showing which / / thread the layout state was calculated into and number of calculations for given node if ( components configuration enable litho view debug overlay ) { if ( layout state is layout root ( node ) ) { array list < boolean > main thread calculations ; int layout id = layout state get tree id ( ) ; synchronized ( debug lock ) { if ( layout calculations on main thread = = null ) { layout calculations on main thread = new hash map < > ( ) ; } list < boolean > calculations on main thread = layout calculations on main thread get ( layout id ) ; if ( calculations on main thread = = null ) { calculations on main thread = new array list < > ( ) ; } calculations on main thread add ( thread utils is main thread ( ) ) ; layout calculations on main thread put ( layout id , calculations on main thread ) ; main thread calculations = new array list < > ( calculations on main thread ) ; } add drawable component ( parent , node , layout state , null , hierarchy , new debug overlay drawable ( main thread calculations ) , output unit type foreground , needs host view ) ; } } else if ( layout calculations on main thread ! = null ) { synchronized ( debug lock ) { layout calculations on main thread = null ; } } / / all children for the given host have been added , restore the previous / / host , level , and duplicate parent state value in the recursive queue if ( layout state m current host marker ! = current host marker ) { layout state m current host marker = current host marker ; layout state m current host output position = current host output position ; layout state m current level - - ; } layout state m should duplicate parent state = should duplicate parent state ; add current affinity group to transition mapping ( layout state ) ; layout state m current transition id = current transition id ; layout state m current layout output affinity group = current layout output affinity group ; }


private static r b node parent of ( r b node p ) { return ( p = = null ? null : p parent ) ; }


protected void reset u g i ( ) { user group information reset ( ) ; }


get all the private methods of intercept points that need custom enhancements

private hash map < string , element matcher > get enhance classes ( ) { return ( hash map < string , element matcher > ) context enhance classes ; }


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


public void test inline additional properties test ( ) { map < string , string > request body = null ; / / api test inline additional properties ( request body ) ; / / todo : test validations }


helper for { @ link # visit constant } where the constant is an { @ code int }

private void visit literal int ( int opcode , int offset , int length , int value ) { string comment or space = ( length = = 1 ) ? " / / " : " " ; string value str ; opcode = bytes get unsigned byte ( offset ) ; / / compare with orig op below if ( ( length = = 1 ) | | ( opcode = = byte ops bipush ) ) { value str = " # " + hex s 1 ( value ) ; } else if ( opcode = = byte ops sipush ) { value str = " # " + hex s 2 ( value ) ; } else { value str = " # " + hex s 4 ( value ) ; } observer parsed ( bytes , offset , length , header ( offset ) + comment or space + value str ) ; }


waits for the machine learning templates to be created by { @ link org elasticsearch plugins metadata upgrader }

public void wait for templates ( ) throws exception { try { x pack rest test helper wait for templates ( client ( ) , x pack rest test constants ml post v660 templates ) ; } catch ( assertion error e ) { throw new assertion error ( " failure in test setup : failed to initialize ml index templates " , e ) ; } }


post fakeouterboolean test serialization of outer boolean types

default response entity < boolean > fake outer boolean serialize ( @ api param ( value = " input boolean as post body " ) @ valid @ request body ( required = false ) boolean body ) { return new response entity < > ( http status not implemented ) ; }


asserts that permission is denied to the given fsuser for the given file

public static void assert file permission denied ( file system fs , user group information user , path path to check ) throws exception { try { d f s test util read file buffer ( fs , path to check ) ; fail ( " expected access control exception for user " + user + " , path = " + path to check ) ; } catch ( access control exception e ) { / / expected } }


{ @ inherit doc } < br > < br > since { @ link echo user resolver } simply returns the user ' s name passed as the argument , it doesn ' t need a target list of users

public boolean needs target users list ( ) { return false ; }


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


assert the response status code is { @ code http status no content } ( 204 )

public web test client response spec is no content ( ) { return assert status and return ( http status no content ) ; }


called when the timeline of a media item has changed and a new timeline that reflects the current playlist state needs to be created by calling { @ link # create timeline ( ) } called on the playback thread


perform the sql call and retrieve the result by entering the execution stage

fetch spec < map < string , object > > fetch ( ) ;


public void add ( byte block range range ) { list add ( range ) ; }


{ @ link org apache flink kubernetes kubeclient flink kube client # check and update config map } is a transactional operation , we should definitely guarantee that the concurrent modification could work

public void test check and update config map concurrently ( ) throws exception { / / start multiple instances to update config map concurrently final list < completable future < void > > futures = new array list < > ( ) ; final int target = 10 ; final int update interval ms = 100 ; for ( string key : data key set ( ) ) { futures add ( completable future run async ( ( ) - > { for ( int index = 0 ; index < target ; index + + ) { final boolean updated = flink kube client check and update config map ( test config map name , config map - > { final int new value = integer value of ( config map get data ( ) get ( key ) ) + 1 ; config map get data ( ) put ( key , string value of ( new value ) ) ; return optional of ( config map ) ; } ) join ( ) ; assert that ( updated , is ( true ) ) ; try { / / simulate the update interval thread sleep ( ( long ) ( update interval ms * math random ( ) ) ) ; } catch ( interrupted exception e ) { / / noop } } } , executor service ) ) ; } future utils wait for all ( futures ) get ( timeout , time unit milliseconds ) ; / / all the value should be increased exactly to the target final optional < kubernetes config map > config map opt = flink kube client get config map ( test config map name ) ; assert that ( config map opt is present ( ) , is ( true ) ) ; assert that ( config map opt get ( ) get data ( ) values ( ) , every item ( is ( string value of ( target ) ) ) ) ; }