configure the { @ link job } for enabling compression emulation

static void configure ( final job job ) throws i o exception , interrupted exception , class not found exception { / / set the random text mapper job set mapper class ( random text data mapper class ) ; job set num reduce tasks ( 0 ) ; job set map output key class ( text class ) ; job set map output value class ( text class ) ; job set input format class ( gen data format class ) ; job set jar by class ( generate data class ) ; / / set the output compression true file output format set compress output ( job , true ) ; try { file input format add input path ( job , new path ( " ignored " ) ) ; } catch ( i o exception e ) { log error ( " error while adding input path " , e ) ; } }


returns the url for an elasticsearch plugin in maven

private string get maven url ( terminal terminal , string [ ] coordinates , string platform ) throws i o exception { final string group id = coordinates [ 0 ] replace ( " " , " / " ) ; final string artifact id = coordinates [ 1 ] ; final string version = coordinates [ 2 ] ; final string base url = string format ( locale root , " https : / / repo 1 maven org / maven 2 / % s / % s / % s " , group id , artifact id , version ) ; final string platform url = string format ( locale root , " % s / % s - % s - % s zip " , base url , artifact id , platform , version ) ; if ( url exists ( terminal , platform url ) ) { return platform url ; } return string format ( locale root , " % s / % s - % s zip " , base url , artifact id , version ) ; }


write key and value to the named output output path is a unique file generated for the named output for example , { named output } - ( m | r ) - { part - number }

public < k , v > void write ( string named output , k key , v value ) throws i o exception , interrupted exception { write ( named output , key , value , named output ) ; }


configure how long , as a duration , the response from a pre - flight request can be cached by clients

public void set max age ( duration max age ) { this max age = max age get seconds ( ) ; }


creates a directory with the name of the current path , not following symbolic links returns normally iff the directory exists after the call : true if the directory was created by this call , false if the directory was already in existence throws an exception if the directory could not be created for any reason

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


constructs a new { @ code caffeine } instance with the settings specified in { @ code spec }

public static caffeine < object , object > from ( caffeine spec spec ) { caffeine < object , object > builder = spec to builder ( ) ; builder strict parsing = false ; return builder ; }


public string realm ( ) { return realm ; }


override the default kotlin serialization json { @ code decoder }

void kotlin serialization json decoder ( decoder < ? > decoder ) ;


configures the host to which the driver server bound

public builder with host ( string host ) { this host = host ; return this ; }


router safemode service get safemode service ( ) { return this safemode service ; }


returns whether the given method calls the invokedynamic instruction

public static boolean invokes dynamically ( method method ) { method optimization info info = method optimization info get method optimization info ( method ) ; return info = = null | | info invokes dynamically ( ) ; }


returns the class of the actual instance in the field

public class < ? > field class ( ) { return field instance ! = null ? field instance get class ( ) : null ; }


returns a copy of { @ code multiset } as an { @ link immutable multiset } whose iteration order is highest count first , with ties broken by the iteration order of the original multiset

public static < e > immutable multiset < e > copy highest count first ( multiset < e > multiset ) { entry < e > [ ] entries = ( entry < e > [ ] ) multiset entry set ( ) to array ( new entry [ 0 ] ) ; arrays sort ( entries , decreasing count instance ) ; return immutable multiset copy from entries ( arrays as list ( entries ) ) ; }


public string get sc a e t h flow points ( ) { return sc a e t h flow points ; }


when using fuzzy or prefix type query , the number of term expansions to use defaults to unbounded so its recommended to set it to a reasonable value for faster execution

public multi match query builder max expansions ( int max expansions ) { if ( max expansions < = 0 ) { throw new illegal argument exception ( " max expansions must be strictly great than zero " ) ; } this max expansions = max expansions ; return this ; }


returns a string representation of { @ code x } for the given radix , where { @ code x } is treated as unsigned < b > java 8 users : < b > use { @ link integer # to unsigned string ( int , int ) } instead

public static string to string ( int x , int radix ) { long as long = x & int mask ; return long to string ( as long , radix ) ; }


public boolean is bool item ( ) { return bool item ; }


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

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


public void set comment ( int comment type , string comment ) { comments put ( comment type , comment ) ; / / string old value = comments get ( comment type ) ; comments put ( comment type , comment ) ; / / int change type ; / / switch ( comment type ) { / / case code unit eol comment : / / change type = change manager docr eol comment changed ; / / break ; / / case code unit plate comment : / / change type = change manager docr plate comment changed ; / / break ; / / case code unit post comment : / / change type = change manager docr post comment changed ; / / break ; / / case code unit pre comment : / / change type = change manager docr pre comment changed ; / / break ; / / case code unit repeatable comment : / / change type = change manager docr repeatable comment changed ; / / break ; / / default : / / change type = change manager docr eol comment changed ; / / break ; / / } / / / / program set obj changed ( change type , get min address ( ) , this , old value , comment ) ; / / throw new unsupported operation exception ( ) ; }


enable indenting for the supplied { @ link javax xml transform transformer } if the underlying xslt engine is xalan , then the special output key { @ code indent - amount } will be also be set to a value of { @ link # default indent amount } characters

public static void enable indenting ( transformer transformer ) { enable indenting ( transformer , default indent amount ) ; }


helper method to set api key value for the first api key authentication

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


the value of the element name index item must be a valid index into the constant pool table the constant pool entry at that index must be a constant utf 8 info ( ? 4 4 7 ) structure representing a valid field descriptor that denotes the name of the annotation type element represented by this element value pairs entry

public int get element name index ( ) { return element name index & 0xffff ; }


public int get queue length ( ) { return queue length ; }


public void send typing ( signal service address recipient , optional < unidentified access pair > unidentified access , signal service typing message message ) throws i o exception , untrusted identity exception { byte [ ] content = create typing content ( message ) ; send message ( recipient , get target unidentified access ( unidentified access ) , message get timestamp ( ) , content , true , null ) ; }


processes the dyld cache ' s dylib files this will mark up the dylib files , added them to the program tree , and make memory blocks for them

private void process dylibs ( ) throws exception { / / create an " info " object for each dyld cache dylib , which will make processing them / / easier monitor set message ( " parsing dylib ' s " ) ; monitor initialize ( dyld cache header get image infos ( ) size ( ) ) ; tree set < dyld cache macho info > info set = new tree set < > ( ( a , b ) - > a header addr compare to ( b header addr ) ) ; for ( dyld cache image info dyld cache image info : dyld cache header get image infos ( ) ) { info set add ( new dyld cache macho info ( provider , dyld cache image info get address ( ) - dyld cache header get base address ( ) , space get address ( dyld cache image info get address ( ) ) , dyld cache image info get path ( ) ) ) ; monitor check canceled ( ) ; monitor increment progress ( 1 ) ; } / / markup dyld cache mach - o headers monitor set message ( " marking up dylib headers " ) ; monitor initialize ( info set size ( ) ) ; for ( dyld cache macho info info : info set ) { info markup headers ( ) ; monitor check canceled ( ) ; monitor increment progress ( 1 ) ; } / / add dyld cache mach - o ' s to program tree monitor set message ( " adding dylib ' s to program tree " ) ; monitor initialize ( info set size ( ) ) ; iterator < dyld cache macho info > iter = info set iterator ( ) ; if ( iter has next ( ) ) { dyld cache macho info curr = iter next ( ) ; do { dyld cache macho info next = iter has next ( ) ? iter next ( ) : null ; curr add to program tree ( next ) ; curr = next ; monitor check canceled ( ) ; monitor increment progress ( 1 ) ; } while ( iter has next ( ) ) ; } / / process dyld cache dylib memory blocks monitor set message ( " processing dylib memory blocks " ) ; monitor initialize ( info set size ( ) ) ; for ( dyld cache macho info info : info set ) { info process memory blocks ( ) ; monitor check canceled ( ) ; monitor increment progress ( 1 ) ; } }


sets the category of the process definition process definitions can be queried by category : see { @ link process definition query # process definition category ( string ) }

void set process definition category ( string process definition id , string category ) ;


test the property ' prefix wrapped array '

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


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


many tokens directly represent a variable in the data - flow

public varnode get varnode ( ) { return null ; }


returns whether the first liquid can ' stay ' on the second one currently , the only place where this can happen is oil on water

private static boolean can stay on ( liquid liquid , liquid other ) { return liquid = = liquids oil & & other = = liquids water ; }


specifies what type of requested indices to ignore and wildcard indices expressions for example indices that don ' t exist

public delete index request builder set indices options ( indices options options ) { request indices options ( options ) ; return this ; }


calls { @ link channel handler context # disconnect ( channel promise ) } to forward to the next { @ link channel outbound handler } in the { @ link channel pipeline } sub - classes may override this method to change behavior

public void disconnect ( channel handler context ctx , channel promise promise ) throws exception { ctx disconnect ( promise ) ; }


set the bean name of the multipart resolver to fetch from spring ' s root application context default is " filter multipart resolver "

public void set multipart resolver bean name ( string multipart resolver bean name ) { this multipart resolver bean name = multipart resolver bean name ; }


listens for changes to the cluster state , in order to know whether to toggle indexing and to set the cluster uuid and node id these can ' t be set in the constructor because the initial cluster state won ' t be set yet

public void cluster changed ( cluster changed event event ) { final cluster state state = event state ( ) ; final boolean new enabled = write deprecation logs to index get ( state get metadata ( ) settings ( ) ) ; if ( appender is enabled ( ) ! = new enabled ) { / / we ' ve flipped from disabled to enabled make sure we start with a clean cache of / / previously - seen keys , otherwise we won ' t index anything if ( new enabled ) { this filter reset ( ) ; } appender set enabled ( new enabled ) ; } }


public void configure ( long new check interval ) { check interval = new check interval ; if ( traffic counter ! = null ) { traffic counter configure ( check interval ) ; } }


test method refresh nodes this method is present and it works

public void test refresh nodes ( ) throws exception { resource manager get client r m service ( ) ; refresh nodes request request = refresh nodes request new instance ( decommission type normal ) ; refresh nodes response response = client refresh nodes ( request ) ; assert not null ( response ) ; }


sets the { @ link query config } object that references the desired query to use when fetching the data

public builder set query config ( query config query config ) { this query config = query config ; return this ; }


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


assert that a connector and its tasks are not running

public void assert connector and tasks are stopped ( string connector name , string detail message ) throws interrupted exception { try { wait for condition ( ( ) - > check connector and tasks are stopped ( connector name ) , connector setup duration ms , " at least the connector or one of its tasks is still running " ) ; } catch ( assertion error e ) { throw new assertion error ( detail message , e ) ; } }


appends a new invocation event to the history

public int invoke ( object input ) { final int id = next id get and increment ( ) ; events add ( new event ( event type invocation , input , id ) ) ; return id ; }


adds all elements in the iteration to the given collection

public static < e > void add all ( collection < e > collection , iterator < e > iterator ) { if ( collection = = null | | iterator = = null ) return ; while ( iterator has next ( ) ) { collection add ( iterator next ( ) ) ; } }


get a packed database whose unpacking may be cached if possible provided do not cache is false

public static packed database get packed database ( file packed db file , boolean never cache , task monitor monitor ) throws i o exception , cancelled exception { return get packed database ( new resource file ( packed db file ) , never cache , monitor ) ; }


returns the first function in the current program

public final function get first function ( ) { function iterator iterator = current program get listing ( ) get functions ( true ) ; if ( iterator has next ( ) ) { return iterator next ( ) ; } return null ; }


whether this instance contains 0 conditions or not

public boolean is empty ( ) { return object utils is empty ( this request conditions ) ; }


public void add learner handler ( learner handler learner ) { synchronized ( learners ) { learners add ( learner ) ; } }


public job get job ( job i d job id ) throws i o exception , interrupted exception { job status status = client get job status ( job id ) ; if ( status ! = null ) { job conf conf ; try { conf = new job conf ( status get job file ( ) ) ; } catch ( runtime exception ex ) { / / if job file doesn ' t exist it means we can ' t find the job if ( ex get cause ( ) instanceof file not found exception ) { return null ; } else { throw ex ; } } return job get instance ( this , status , conf ) ; } return null ; }


test to verify that server is able to start with valid credentials

public void test valid credentials ( ) throws exception { map < string , string > auth configs = new hash map < string , string > ( ) ; auth configs put ( quorum auth quorum sasl auth enabled , " true " ) ; auth configs put ( quorum auth quorum server sasl auth required , " true " ) ; auth configs put ( quorum auth quorum learner sasl auth required , " true " ) ; string connect str = start quorum ( 3 , auth configs , 3 ) ; countdown watcher watcher = new countdown watcher ( ) ; zoo keeper zk = new zoo keeper ( connect str , client base connection timeout , watcher ) ; watcher wait for connected ( client base connection timeout ) ; for ( int i = 0 ; i < 10 ; i + + ) { zk create ( " / " + i , new byte [ 0 ] , ids open acl unsafe , create mode persistent ) ; } zk close ( ) ; }


delete user this can only be done by the logged in user

public void delete user test ( ) throws exception { string username = null ; response entity < void > response = api delete user ( username , accept ) ; / / todo : test validations }


template to allow for customizing the given { @ link x stream } the default implementation is empty

protected void customize x stream ( x stream xstream ) { }


equivalent to { @ code nanoseconds convert ( duration , this ) }

public long to nanos ( long duration ) { throw new abstract method error ( ) ; }


creates list of users with given input array

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


attempt to gracefully cleanup the transform so it can be terminated this tries to remove the job from the scheduler and completes the persistent task

public synchronized void shutdown ( ) { logger debug ( " [ { } ] shutdown of transform requested " , transform get id ( ) ) ; deregister scheduler job ( ) ; mark as completed ( ) ; }


returns all the registered { @ link s c m checkout strategy } s

public static descriptor extension list < s c m checkout strategy , s c m checkout strategy descriptor > all ( ) { return jenkins get ( ) get descriptor list ( s c m checkout strategy class ) ; }


called once the upstream sets a { @ link subscription } on this { @ code resource subscriber } you can perform initialization at this moment the default implementation requests { @ link long # max value } from upstream

protected void on start ( ) { request ( long max value ) ; }


get the recommended percentage by which to trim the cache on receiving this event

public double get suggested trim ratio ( ) { return m suggested trim ratio ; }


returns the data properties of this data source ' s splits

public split data properties < out > get split data properties ( ) { return this split properties ; }


buck builds with " source - based abi generation " and those builds don ' t support { @ link type element # get kind ( ) } test to confirm that we don ' t use that api

@ test public void class name from type element doesnt use get kind ( ) { elements elements = compilation rule get elements ( ) ; type element object = elements get type element ( object class get canonical name ( ) ) ; assert that ( class name get ( prevent get kind ( object ) ) to string ( ) ) is equal to ( " java lang object " ) ; type element outer = elements get type element ( $ outer class get canonical name ( ) ) ; assert that ( class name get ( prevent get kind ( outer ) ) to string ( ) ) is equal to ( " com squareup javapoet class name test $ outer " ) ; type element inner = elements get type element ( $ outer $ inner class get canonical name ( ) ) ; assert that ( class name get ( prevent get kind ( inner ) ) to string ( ) ) is equal to ( " com squareup javapoet class name test $ outer $ inner " ) ; }


any comments associated with the entry < code > optional string comment = 2 ; < code >

private void set comment ( java lang string value ) { if ( value = = null ) { throw new null pointer exception ( ) ; } bit field 0 | = 0x 0 0 0 0 0 0 0 2 ; comment = value ; }


public static collection < object [ ] > params ( ) { boolean [ ] bools = new boolean [ ] { false , true } ; list < object [ ] > combos = new array list < > ( 64 ) ; for ( boolean enable client message compression : bools ) { for ( boolean client accept encoding : bools ) { for ( boolean client encoding : bools ) { for ( boolean enable server message compression : bools ) { for ( boolean server accept encoding : bools ) { for ( boolean server encoding : bools ) { combos add ( new object [ ] { enable client message compression , client accept encoding , client encoding , enable server message compression , server accept encoding , server encoding } ) ; } } } } } } return combos ; }


public static void stop server ( ) throws i o exception { if ( blob server ! = null ) { blob server close ( ) ; } }


returns an immutable set containing each of { @ code elements } , minus duplicates , in the order each appears first in the source array

public static < e > immutable set < e > copy of ( e [ ] elements ) { switch ( elements length ) { case 0 : return of ( ) ; case 1 : return of ( elements [ 0 ] ) ; default : return construct ( elements length , elements clone ( ) ) ; } }


returns the full options modified by the given consumer { @ code option modifier }

private map < string , string > get modified options ( consumer < map < string , string > > option modifier ) { map < string , string > options = get all options ( ) ; option modifier accept ( options ) ; return options ; }


returns the first eight bytes of { @ linkplain # as bytes ( ) this hashcode ' s bytes } , converted to a { @ code long } value in little - endian order


deserialization path for flink versions in [ 1 4 , 1 6 ]

static < t > type serializer snapshot < t > deserialize v 1 ( data input view in , class loader cl , @ nullable type serializer < t > serializer ) throws i o exception { type serializer snapshot < t > snapshot = read and instantiate snapshot class ( in , cl ) ; / / if the snapshot was created before flink 1 7 , we need to distinguish the following / / cases : / / - old snapshot type that needs serializer from the outside / / - new snapshot type that understands the old format and can produce a restore / / serializer from it if ( snapshot instanceof type serializer config snapshot ) { type serializer config snapshot < t > old type snapshot = ( type serializer config snapshot < t > ) snapshot ; old type snapshot set prior serializer ( serializer ) ; old type snapshot set user code class loader ( cl ) ; old type snapshot read ( in ) ; } else { / / new type , simple case int read version = in read int ( ) ; snapshot read snapshot ( read version , in , cl ) ; } return snapshot ; }


called by the player to perform a track selection

public abstract track selector result select tracks ( renderer capabilities [ ] renderer capabilities , track group array track groups , media period id period id , timeline timeline ) throws exo playback exception ;


sets { @ link query request # annotation query ( ) }

public builder annotation query ( map < string , string > annotation query ) { if ( annotation query = = null ) throw new null pointer exception ( " annotation query = = null " ) ; this annotation query = annotation query ; return this ; }


all tests run as a superuser but use < code > es - security - runas - user < code > to become a less privileged user

protected settings rest client settings ( ) { return secure client settings ( ) ; }


uses a custom partitioner for the grouping


test access when requested permissions match the existing permissions

public void test access when permissions match for all and read write ( ) throws throwable { configuration conf = fs get conf ( ) ; fs set conf ( conf ) ; final path test path = new path ( " / test access when permissions match for all and read write " ) ; / / for all and read - write fs action authorizer init ( conf ) ; authorizer add auth rule for owner ( " / " , write , true ) ; authorizer add auth rule for owner ( test path to string ( ) , write , true ) ; authorizer add auth rule for owner ( test path to string ( ) , read , true ) ; fs update wasb authorizer ( authorizer ) ; try { fs mkdirs ( test path ) ; assert path exists ( fs , " test path does not exist " , test path ) ; fs access ( test path , fs action all ) ; fs access ( test path , fs action read write ) ; } finally { recursive delete ( test path ) ; } }


builds a simple aac lc audio specific config , as defined in iso 14496 - 3 1 6 2 1

public static byte [ ] build aac lc audio specific config ( int sample rate , int channel count ) { int sample rate index = c index unset ; for ( int i = 0 ; i < audio specific config sampling rate table length ; + + i ) { if ( sample rate = = audio specific config sampling rate table [ i ] ) { sample rate index = i ; } } int channel config = c index unset ; for ( int i = 0 ; i < audio specific config channel count table length ; + + i ) { if ( channel count = = audio specific config channel count table [ i ] ) { channel config = i ; } } if ( sample rate = = c index unset | | channel config = = c index unset ) { throw new illegal argument exception ( " invalid sample rate or number of channels : " + sample rate + " , " + channel count ) ; } return build audio specific config ( audio object type aac lc , sample rate index , channel config ) ; }


public void test fd passing path security ( ) throws exception { temporary socket directory tmp = new temporary socket directory ( ) ; try { string prefix = tmp get dir ( ) get absolute path ( ) ; shell exec command ( new string [ ] { " mkdir " , " - p " , prefix + " / foo / bar / baz " } ) ; shell exec command ( new string [ ] { " chmod " , " 0700 " , prefix + " / foo / bar / baz " } ) ; shell exec command ( new string [ ] { " chmod " , " 0700 " , prefix + " / foo / bar " } ) ; shell exec command ( new string [ ] { " chmod " , " 0707 " , prefix + " / foo " } ) ; shell exec command ( new string [ ] { " mkdir " , " - p " , prefix + " / q 1 / q 2 " } ) ; shell exec command ( new string [ ] { " chmod " , " 0700 " , prefix + " / q 1 " } ) ; shell exec command ( new string [ ] { " chmod " , " 0700 " , prefix + " / q 1 / q 2 " } ) ; test validate socket path ( prefix + " / q 1 / q 2 " , prefix ) ; try { test validate socket path ( prefix + " / foo / bar / baz " , prefix ) ; } catch ( i o exception e ) { generic test utils assert exception contains ( " world - writable " , e ) ; generic test utils assert exception contains ( " / foo ' " , e ) ; } try { test validate socket path ( prefix + " / nope " , prefix ) ; } catch ( i o exception e ) { generic test utils assert exception contains ( " failed to stat a path " + " component : " , e ) ; } / / root should be secure domain socket validate socket path security 0 ( " / foo " , 0 ) ; } finally { tmp close ( ) ; } }


disposal will happen automatically in { @ link # finalize ( ) } but can be done explicitly if desired

public void dispose ( ) { deflater end ( ) ; }


gets the current database name that will be used when resolving table path

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


applies this function to four inputs , or throws an exception if unable to do so any objects that are passed to { @ link deferred closer # eventually close ( closeable , executor ) closer eventually close ( ) } will be closed when the { @ link closing future } pipeline is done ( but not before this method completes ) , even if this method throws or the pipeline is cancelled

closing future < u > apply ( deferred closer closer , @ nullable decl v1 value 1 , @ nullable decl v2 value 2 , @ nullable decl v3 value 3 , @ nullable decl v4 value 4 ) throws exception ;


returns the directory name of the current platform

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


public string get script author ( ) { return script author text get text ( ) ; }


private byte sequence build registry key prefix ( string cluster ) { return byte sequence from ( registry key prefix + cluster , utf 8 ) ; }


creates a new tuple and assigns the given values to the tuple ' s fields this is more convenient than using the constructor , because the compiler can infer the generic type arguments implicitly for example : { @ code tuple 3 of ( n , x , s ) } instead of { @ code new tuple 3 < integer , double , string > ( n , x , s ) }


1 detect if has awb dependency yes : special process no : default process 2 parse to atlas dependency tree

public set < android dependency > resolve dependencies ( @ non null variant dependencies variant deps ) { this ap dependency = resolve ap dependencies ( variant deps ) ; atlas dependency tree atlas dependency tree = new atlas dep tree parser ( project , extra model info , awbs ) parse dependency tree ( variant deps ) ; s logger info ( " [ dependency tree " + variant deps get name ( ) + " ] { } " , json to j s o n string ( atlas dependency tree get dependency json ( ) , true ) ) ; if ( plugin type utils is app project ( project ) ) { atlas build context android dependency trees put ( variant deps get name ( ) , atlas dependency tree ) ; } else { atlas build context lib dependency trees put ( variant deps get name ( ) , atlas dependency tree ) ; } / / set < android dependency > libs to explode = super resolve dependencies ( variant deps , tested project path ) ; / / return libs to explode ; return new hash set < > ( 0 ) ; }


creates a { @ link char stream } given an opened { @ link readable byte channel } and the charset of the bytes contained in the channel reads the entire contents of the { @ code channel } into the result before returning , then closes the { @ code channel }

public static char stream from channel ( readable byte channel channel , charset charset ) throws i o exception { return from channel ( channel , default buffer size , coding error action replace , int stream unknown source name ) ; }


implements the resolver ' s module interface

public resolver scope resolve ( string name ) throws undefined { / / global ? if ( global index contains key ( name ) ) { return resolver scope global ; } / / predeclared ? object v = predeclared get ( name ) ; if ( v ! = null ) { if ( v instanceof flag guarded value ) { / / name is correctly spelled , but access is disabled by a flag throw new undefined ( ( ( flag guarded value ) v ) get error from attempting access ( name ) , null ) ; } return resolver scope predeclared ; } / / universal ? if ( starlark universe contains key ( name ) ) { return resolver scope universal ; } / / undefined set < string > candidates = new hash set < > ( ) ; candidates add all ( global index key set ( ) ) ; candidates add all ( predeclared key set ( ) ) ; candidates add all ( starlark universe key set ( ) ) ; throw new undefined ( string format ( " name ' % s ' is not defined " , name ) , candidates ) ; }


specify web service feature objects ( e g as inner bean definitions ) to apply to jax - ws port stub creation

public void set port features ( web service feature features ) { this port features = features ; }


verifies that a task executor hosting multiple partitions of a data set receives a release call if a subset of its partitions is lost

public void test report processing with partition loss on same task executor ( ) { test cluster partition releaser partition releaser = new test cluster partition releaser ( ) ; final resource manager partition tracker tracker = new resource manager partition tracker impl ( partition releaser ) ; report ( tracker , task executor id 1 , data set id , 2 , partition id 1 , partition id 2 ) ; report ( tracker , task executor id 1 , data set id , 2 , partition id 2 ) ; assert that ( partition releaser release calls , contains ( tuple 2 of ( task executor id 1 , collections singleton ( data set id ) ) ) ) ; }


the set of enumsflags defined in this attribute only makes sense if the format includes either format flags : : enum or format flags : : flags having both is an error < code > repeated aapt pb attribute symbol symbol = 4 ; < code >


returns quality information for the image image classes that can contain intermediate results should override this as appropriate

public quality info get quality info ( ) { return immutable quality info full quality ; }


public string name ( ) { return this name ; }


find the fields constant that matches field id , throwing an exception if it is not found

public static fields find by thrift id or throw ( int field id ) { fields fields = find by thrift id ( field id ) ; if ( fields = = null ) throw new illegal argument exception ( " field " + field id + " doesn ' t exist ! " ) ; return fields ; }


register a prototype bean with the underlying bean factory for more advanced needs , register with the underlying bean factory directly

public void register prototype ( string name , class < ? > clazz , mutable property values pvs ) throws beans exception { generic bean definition bd = new generic bean definition ( ) ; bd set scope ( bean definition scope prototype ) ; bd set bean class ( clazz ) ; bd set property values ( pvs ) ; get default listable bean factory ( ) register bean definition ( name , bd ) ; }


when false , the scroll bars don ' t respond to touch or mouse events default is true

public void set scroll bar touch ( boolean scroll bar touch ) { this scroll bar touch = scroll bar touch ; }


merges all the fields of { @ code other } with the current { @ link source file coverage } into a new { @ link source file coverage } assumes both the current and the given { @ link source file coverage } have the same { @ code source file name }

static source file coverage merge ( source file coverage source 1 , source file coverage source 2 ) { assert source 1 source file name equals ( source 2 source file name ) ; source file coverage merged = new source file coverage ( source 2 source file name ) ; merged add all line numbers ( merge line numbers ( source 1 , source 2 ) ) ; merged add all functions execution ( merge functions execution ( source 1 , source 2 ) ) ; merged add all branches ( merge branches ( source 1 , source 2 ) ) ; merged add all lines ( merge lines ( source 1 , source 2 ) ) ; return merged ; }


privileged wrapper that invokes action with subject do as to perform work as given subject

private static < t > t do as wrapper ( final subject subject , final privileged exception action < t > action ) throws privileged action exception { try { return access controller do privileged ( ( privileged exception action < t > ) ( ) - > subject do as ( subject , action ) ) ; } catch ( privileged action exception pae ) { if ( pae get cause ( ) instanceof privileged action exception ) { throw ( privileged action exception ) pae get cause ( ) ; } throw pae ; } }


sets the { @ code input spec } and returns a reference to this builder so that the methods can be chained together

public builder with input spec ( string input spec ) { if ( input spec ! = null ) { this input spec = input spec ; } return this ; }


initializes the user - agent header to send in http requests to aws services we always include the hadoop version number the user also may set an optional custom prefix to put in front of the hadoop version number the aws sdk internally appends its own information , which seems to include the aws sdk version , os and jvm version

private static void init user agent ( configuration conf , client configuration aws conf ) { string user agent = " hadoop " + version info get version ( ) ; string user agent prefix = conf get trimmed ( user agent prefix , " " ) ; if ( ! user agent prefix is empty ( ) ) { user agent = user agent prefix + " , " + user agent ; } log debug ( " using user - agent : { } " , user agent ) ; aws conf set user agent prefix ( user agent ) ; }


this method is needed because if the disappearing item ended up being remounted to the root , then the index can be different than the one it was created with

public void start disappearing mount item ( mount item mount item ) { final int index = m mount items key at ( m mount items index of value ( mount item ) ) ; start unmount disappearing item ( index , mount item ) ; }


loads a queue from a queue element in the configuration file

private void load queue ( string parent name , element element , queue properties builder builder ) throws allocation configuration exception { string queue name = fair scheduler utilities trim queue name ( element get attribute ( " name " ) ) ; if ( queue name contains ( " " ) ) { throw new allocation configuration exception ( " bad fair scheduler config " + " file : queue name ( " + queue name + " ) shouldn ' t contain period " ) ; } if ( queue name is empty ( ) ) { throw new allocation configuration exception ( " bad fair scheduler config " + " file : queue name shouldn ' t be empty or " + " consist only of whitespace " ) ; } if ( parent name ! = null ) { queue name = parent name + " " + queue name ; } node list fields = element get child nodes ( ) ; boolean is leaf = true ; boolean is reservable = false ; boolean is max a m share set = false ; for ( int j = 0 ; j < fields get length ( ) ; j + + ) { node field node = fields item ( j ) ; if ( ! ( field node instanceof element ) ) { continue ; } element field = ( element ) field node ; if ( min resources equals ( field get tag name ( ) ) ) { string text = get trimmed text data ( field ) ; configurable resource val = fair scheduler configuration parse resource config value ( text , 0l ) ; builder min queue resources ( queue name , val get resource ( ) ) ; } else if ( max resources equals ( field get tag name ( ) ) ) { string text = get trimmed text data ( field ) ; configurable resource val = fair scheduler configuration parse resource config value ( text ) ; builder max queue resources ( queue name , val ) ; } else if ( max child resources equals ( field get tag name ( ) ) ) { string text = get trimmed text data ( field ) ; configurable resource val = fair scheduler configuration parse resource config value ( text ) ; builder max child queue resources ( queue name , val ) ; } else if ( max running apps equals ( field get tag name ( ) ) ) { string text = get trimmed text data ( field ) ; int val = integer parse int ( text ) ; builder queue max apps ( queue name , val ) ; } else if ( max amshare equals ( field get tag name ( ) ) ) { string text = get trimmed text data ( field ) ; float val = float parse float ( text ) ; val = math min ( val , 1 0f ) ; builder queue max a m shares ( queue name , val ) ; is max a m share set = true ; } else if ( max container allocation equals ( field get tag name ( ) ) ) { string text = get trimmed text data ( field ) ; configurable resource val = fair scheduler configuration parse resource config value ( text ) ; builder queue max container allocation ( queue name , val get resource ( ) ) ; } else if ( weight equals ( field get tag name ( ) ) ) { string text = get trimmed text data ( field ) ; double val = double parse double ( text ) ; builder queue weights ( queue name , ( float ) val ) ; } else if ( min share preemption timeout equals ( field get tag name ( ) ) ) { string text = get trimmed text data ( field ) ; long val = long parse long ( text ) * 1000l ; builder min share preemption timeouts ( queue name , val ) ; } else if ( fair share preemption timeout equals ( field get tag name ( ) ) ) { string text = get trimmed text data ( field ) ; long val = long parse long ( text ) * 1000l ; builder fair share preemption timeouts ( queue name , val ) ; } else if ( fair share preemption threshold equals ( field get tag name ( ) ) ) { string text = get trimmed text data ( field ) ; float val = float parse float ( text ) ; val = math max ( math min ( val , 1 0f ) , 0 0f ) ; builder fair share preemption thresholds ( queue name , val ) ; } else if ( scheduling policy equals ( field get tag name ( ) ) | | scheduling mode equals ( field get tag name ( ) ) ) { string text = get trimmed text data ( field ) ; scheduling policy policy = scheduling policy parse ( text ) ; builder queue policies ( queue name , policy ) ; } else if ( acl submit apps equals ( field get tag name ( ) ) ) { string text = ( ( text ) field get first child ( ) ) get data ( ) ; builder queue acls ( queue name , access type submit app , new access control list ( text ) ) ; } else if ( acl administer apps equals ( field get tag name ( ) ) ) { string text = ( ( text ) field get first child ( ) ) get data ( ) ; builder queue acls ( queue name , access type administer queue , new access control list ( text ) ) ; } else if ( acl administer reservations equals ( field get tag name ( ) ) ) { string text = ( ( text ) field get first child ( ) ) get data ( ) ; builder reservation acls ( queue name , reservation a c l administer reservations , new access control list ( text ) ) ; } else if ( acl list reservations equals ( field get tag name ( ) ) ) { string text = ( ( text ) field get first child ( ) ) get data ( ) ; builder reservation acls ( queue name , reservation a c l list reservations , new access control list ( text ) ) ; } else if ( acl submit reservations equals ( field get tag name ( ) ) ) { string text = ( ( text ) field get first child ( ) ) get data ( ) ; builder reservation acls ( queue name , reservation a c l submit reservations , new access control list ( text ) ) ; } else if ( reservation equals ( field get tag name ( ) ) ) { is reservable = true ; builder reservable queues ( queue name ) ; builder configured queues ( f s queue type parent , queue name ) ; } else if ( allow preemption from equals ( field get tag name ( ) ) ) { string text = get trimmed text data ( field ) ; if ( ! boolean parse boolean ( text ) ) { builder non preemptable queues ( queue name ) ; } } else if ( queue ends with ( field get tag name ( ) ) | | pool equals ( field get tag name ( ) ) ) { load queue ( queue name , field , builder ) ; is leaf = false ; } } / / if a leaf in the alloc file is marked as type = ' parent ' / / then store it as a parent queue if ( is leaf & & ! " parent " equals ( element get attribute ( " type " ) ) ) { / / reservable queue has been already configured as parent if ( ! is reservable ) { builder configured queues ( f s queue type leaf , queue name ) ; } } else { if ( is reservable ) { throw new allocation configuration exception ( get error string ( queue name , reservation ) ) ; } else if ( is max a m share set ) { throw new allocation configuration exception ( get error string ( queue name , max amshare ) ) ; } builder configured queues ( f s queue type parent , queue name ) ; } / / set default acls if not defined / / the root queue defaults to all access for ( queue a c l acl : queue a c l values ( ) ) { access type access type = scheduler utils to access type ( acl ) ; if ( ! builder is acl defined for access type ( queue name , access type ) ) { access control list default acl = queue name equals ( root ) ? everybody acl : nobody acl ; builder queue acls ( queue name , access type , default acl ) ; } } check min and max resource ( builder get min queue resources ( ) , builder get max queue resources ( ) , queue name ) ; }


get job - specific shared directory for use as scratch space when a job starts , a shared directory is created at location < code > $ { mapreduce cluster local dir } task tracker $ userjobcache $ jobidwork < code > this directory is exposed to the users through < code > mapreduce job local dir < code > so , the tasks can use this space as scratch space and share files among them this value is available as system property also

public string get job local dir ( ) { return get ( job context job local dir ) ; }


check for an authentication error on a given node and raise the exception if there is one

public void maybe throw auth failure ( node node ) { lock lock ( ) ; try { authentication exception exception = client authentication exception ( node ) ; if ( exception ! = null ) throw exception ; } finally { lock unlock ( ) ; } }


returns the stat information about the file if the given path is a symlink , the path will be resolved to a target path and it will get the resolved path ' s file status object it will not be represented as a symlink and is directory api returns true if the resolved path is a directory , false otherwise

public file status get file status ( path f ) throws i o exception { statistics increment read ops ( 1 ) ; storage statistics increment op counter ( op type get file status ) ; path abs f = fix relative part ( f ) ; return new file system link resolver < file status > ( ) { @ override public file status do call ( final path p ) throws i o exception { hdfs file status fi = dfs get file info ( get path name ( p ) ) ; if ( fi ! = null ) { return fi make qualified ( get uri ( ) , p ) ; } else { throw new file not found exception ( " file does not exist : " + p ) ; } } @ override public file status next ( final file system fs , final path p ) throws i o exception { return fs get file status ( p ) ; } } resolve ( this , abs f ) ; }


test cleanup for a job that finishes ordinarily

public void test blob server cleanup finished job ( ) throws exception { test blob server cleanup ( test case job finishes sucessfully ) ; }


writes the timers snapshot to the output view

void write timers snapshot ( data output view out ) throws i o exception ;


checks if the current security principal has this permission

public final boolean has permission ( @ non null permission p ) { authentication a = jenkins get authentication 2 ( ) ; if ( a equals ( system2 ) ) { return true ; } return has permission 2 ( a , p ) ; }


test that the name " localhost " resolves to something if this fails , your machine ' s network is in a mess , go edit etchosts

public void test localhost resolves ( ) throws exception { inet address localhost = inet address get by name ( " localhost " ) ; assert not null ( " localhost is null " , localhost ) ; log info ( " localhost i p addr is " + localhost to string ( ) ) ; }


stops other instances of the same spawn before writing outputs this should be called once by each of the concurrent spawns to ensure that the others are stopped , thus preventing conflicts when writing to the output tree

void stop ( ) throws interrupted exception ;


indicates whether this domain name ends in a { @ linkplain # is registry suffix ( ) registry suffix } , including if it is a registry suffix itself for example , returns { @ code true } for { @ code www google com } , { @ code foo co uk } and { @ code com } , but not for { @ code invalid } or { @ code google invalid } note that this method is equivalent to { @ link # has public suffix ( ) } because all registry suffixes are public suffixes and all public suffixes have registry suffixes

public boolean has registry suffix ( ) { return registry suffix index ! = no suffix found ; }


tests that we never get an optimal hashes number of zero

public void test optimal hashes ( ) { for ( int n = 1 ; n < 1000 ; n + + ) { for ( int m = 0 ; m < 1000 ; m + + ) { assert true ( bloom filter optimal num of hash functions ( n , m ) > 0 ) ; } } }


this method creates a namespace in one program ( the " to " program ) that is effectively the same as the namespace from another program ( the " from " program ) it will resolve each parent namespace in this namespace ' s parent hierarchy until reaching the global namespace for the program or until there is no parent namespace when resolving any namespace the type of namespace will be the same as it was in the " from " program however , the name of the namespace will match the original name in the " from " program or will be the original name with a conflict suffix attached < br > if a namespace that is effectively the same can ' t be found then this method will create one and the name may match the original or have a conflict name < br > if the namespace can ' t be resolved , an exception is thrown < br > any namespaces that are created with a conflict name will have their symbol i ds mapped into the < code > conflict symbol i d map < code >

namespace resolve namespace ( namespace from namespace , long long hashtable conflict symbol i d map ) throws duplicate name exception , invalid input exception { namespace from global ns = from program get global namespace ( ) ; if ( from namespace = = null ) { return null ; } if ( from namespace equals ( from global ns ) ) { return to program get global namespace ( ) ; } namespace resolved namespace = diff utility get namespace ( from namespace , to program ) ; if ( resolved namespace ! = null ) { return resolved namespace ; } symbol from namespace symbol = from namespace get symbol ( ) ; / / try to resolve the parent namespace and use it to get / create a namespace namespace from parent ns = from namespace get parent namespace ( ) ; namespace resolved parent ns = resolve namespace ( from parent ns , conflict symbol i d map ) ; string name = from namespace symbol get name ( ) ; symbol type from namespace symbol type = from namespace symbol get symbol type ( ) ; address to namespace symbol addr = origin to result translator get address ( from namespace symbol get address ( ) ) ; / / for the resolved parent namespace try to get the namespace we want list < symbol > to namespace symbols = to symbol table get symbols ( name , resolved parent ns ) ; for ( symbol to namespace symbol : to namespace symbols ) { symbol type to namespace symbol type = to namespace symbol get symbol type ( ) ; if ( to namespace symbol type is namespace ( ) ) { if ( to namespace symbol type equals ( from namespace symbol type ) & & to namespace symbol addr equals ( to namespace symbol get address ( ) ) ) { return ( namespace ) to namespace symbol get object ( ) ; / / found the equivalent namespace so return it } } } / / if we can ' t get the desired namespace from the resolved parent , then create it resolved namespace = create namespace ( name , from namespace symbol type , to namespace symbol addr , resolved parent ns , from namespace symbol get source ( ) ) ; if ( ! resolved namespace get name ( ) equals ( name ) ) { conflict symbol i d map put ( from namespace get symbol ( ) get i d ( ) , resolved namespace get symbol ( ) get i d ( ) ) ; } return resolved namespace ; }


public int get num active connections ( ) { int total = 0 ; read lock lock ( ) ; try { for ( connection pool pool : this pools values ( ) ) { total + = pool get num active connections ( ) ; } } finally { read lock unlock ( ) ; } return total ; }


returns true if the method includes an annotation of the provided class type

public boolean is annotation present ( class < ? extends java lang annotation annotation > annotation type ) { return method is annotation present ( annotation type ) ; }


in case of an incomplete part which had not reached the minimum part size at the time of snapshotting , this returns a file containing the in - progress part at which writing can be resumed

optional < file > get incomplete part ( ) ;


create an { @ code http range } that ranges over the last given number of bytes

public static http range create suffix range ( long suffix length ) { return new suffix byte range ( suffix length ) ; }


enables quoted string parsing field delimiters in quoted strings are ignored a string is parsed as quoted if it starts and ends with a quoting character and as unquoted otherwise leading or tailing whitespaces are not allowed

public csv reader parse quoted strings ( char quote character ) { this parse quoted strings = true ; this quote character = quote character ; return this ; }


returns the element at the specified position in this fluent iterable < b > { @ code stream } equivalent : < b > { @ code stream skip ( position ) find first ( ) get ( ) } ( but note that this throws different exception types , and throws an exception if { @ code null } would be returned )

public final e get ( int position ) { return iterables get ( get delegate ( ) , position ) ; }


rotates the subtree so that its root ' s right child is the new root

private void rotate left ( node < k , v > root ) { node < k , v > left = root left ; node < k , v > pivot = root right ; node < k , v > pivot left = pivot left ; node < k , v > pivot right = pivot right ; / / move the pivot ' s left child to the root ' s right root right = pivot left ; if ( pivot left ! = null ) { pivot left parent = root ; } replace in parent ( root , pivot ) ; / / move the root to the pivot ' s left pivot left = root ; root parent = pivot ; / / fix heights root height = math max ( left ! = null ? left height : 0 , pivot left ! = null ? pivot left height : 0 ) + 1 ; pivot height = math max ( root height , pivot right ! = null ? pivot right height : 0 ) + 1 ; }


the default mapping type to use for fields of this { @ link x content field type } when defined as runtime fields by default , the lowercase field type is used

string default runtime mapping type ( ) { return to string ( ) ; }


returns an { @ link element order } that specifies the order of iteration for the elements of { @ link # edges ( ) } , { @ link # adjacent nodes ( object ) } , { @ link # predecessors ( object ) } , { @ link # successors ( object ) } and { @ link # incident edges ( object ) }

element order < n > incident edge order ( ) ; / / / / element - level accessors / /


returns the future register value at the specified address if no future value is stored , it will return the value stored in the program the value returned may not have a complete value for the requested register use this method if keeping separate flows from different flow from addresses is not important

public register value get register value ( register register , address address ) { return get register value ( register , address no address , address ) ; }


ensures the cluster has a green state via the cluster health api this method will also wait for relocations it is useful to ensure that all action on the cluster have finished and all shards that were currently relocating are now allocated and started

public cluster health status ensure green ( time value timeout , string indices ) { return ensure color ( cluster health status green , timeout , false , indices ) ; }


set the name of the target bean in the spring application context the target bean must implement the standard servlet filter interface by default , the { @ code filter - name } as specified for the delegating filter proxy in { @ code web xml } will be used

public void set target bean name ( @ nullable string target bean name ) { this target bean name = target bean name ; }


public static synchronized void on pin create failure ( ) { log i ( tag , " on pin create failure ( ) " ) ; if ( get state ( ) = = state no registration lock ) { signal store kbs values ( ) on pin create failure ( ) ; } }


return the generic return type of the method , with support of suspending functions via kotlin reflection

private static type get generic return type ( method method ) { try { k function < ? > function = reflect jvm mapping get kotlin function ( method ) ; if ( function ! = null & & function is suspend ( ) ) { return reflect jvm mapping get java type ( function get return type ( ) ) ; } } catch ( unsupported operation exception ex ) { / / probably a synthetic class - let ' s use java reflection instead } return method get generic return type ( ) ; }


get the first header value , if any , for the header for the given name returns { @ code null } if no header values are found

default string first header ( string header name ) { list < string > list = header ( header name ) ; return list is empty ( ) ? null : list get ( 0 ) ; }


returns true if the array has one or more items

public boolean not empty ( ) { return size > 0 ; }


whether this partition is released a partition is released when each subpartition is either consumed and communication is closed by consumer or failed a partition is also released if task is cancelled

public boolean is released ( ) { return is released get ( ) ; }


this is a helper routing for { @ link # resolve symbolic links ( path ) } , i e the " user - mode " routing for canonicalising paths it is analogous to the code in glibc ' s realpath ( 3 ) just like realpath , resolve symbolic links requires a quadratic number of directory lookups : n path segments are statted , and each stat requires a linear amount of work in the " kernel " routine

protected path fragment resolve one link ( path path ) throws i o exception { / / beware , this seemingly simple code belies the complex specification of / / file system resolve one link ( ) in memory content info status = inode stat ( path , false ) ; return status is symbolic link ( ) ? ( ( in memory link info ) status ) get link content ( ) : null ; }


provides the expected maximum number of produced records for limiting on a best - effort basis


produce a readable representation for a given method name with specified arguments

public static string format method for message ( string name , list < type descriptor > argument types ) { string joiner sj = new string joiner ( " , " , " ( " , " ) " ) ; for ( type descriptor type descriptor : argument types ) { if ( type descriptor ! = null ) { sj add ( format class name for message ( type descriptor get type ( ) ) ) ; } else { sj add ( format class name for message ( null ) ) ; } } return name + sj to string ( ) ; }


return the back edges found in this depth first search

public edge [ ] back edges ( ) { return back edges to array ( new edge [ back edges size ( ) ] ) ; }


public builder kind ( @ nullable kind kind ) { this kind = kind ; return this ; }


starts the event processors and returns the fully configured ring buffer the ring buffer is set up to prevent overwriting any entry that is yet to be processed by the slowest event processor this method must only be called once after all event processors have been added

public ring buffer < t > start ( ) { check only started once ( ) ; for ( final consumer info consumer info : consumer repository ) { consumer info start ( executor ) ; } return ring buffer ; }


returns the addresses that are in program 1 , but not in program 2

public address set view get addresses only in one ( ) { return program diff get addresses only in one ( ) ; }


provides the name qualified by the package it belongs to

public string qualified name ( ) { return ( pkg equals ( default package ) ? " " : pkg + " : " ) + name ; }


returns the ' float ' value at the specified address in memory

public final float get float ( address address ) throws memory access exception { int bits = current program get memory ( ) get int ( address ) ; return float int bits to float ( bits ) ; }


public nodes info request builder set jvm ( boolean jvm ) { add or remove metric ( jvm , nodes info request metric jvm ) ; return this ; }


append null values for the block as a stream of bits

public static void encode nulls as bits ( slice output slice output , block block ) { boolean may have null = block may have null ( ) ; slice output write boolean ( may have null ) ; if ( ! may have null ) { return ; } int position count = block get position count ( ) ; for ( int position = 0 ; position < ( position count & ~ 0b 1 1 1 ) ; position + = 8 ) { byte value = 0 ; value | = block is null ( position ) ? 0b 1 0 0 0 0000 : 0 ; value | = block is null ( position + 1 ) ? 0b 0 1 0 0 0000 : 0 ; value | = block is null ( position + 2 ) ? 0b 0 0 1 0 0000 : 0 ; value | = block is null ( position + 3 ) ? 0b 0 0 0 1 0000 : 0 ; value | = block is null ( position + 4 ) ? 0b 0 0 0 0 1000 : 0 ; value | = block is null ( position + 5 ) ? 0b 0 0 0 0 0100 : 0 ; value | = block is null ( position + 6 ) ? 0b 0 0 0 0 0010 : 0 ; value | = block is null ( position + 7 ) ? 0b 0 0 0 0 0001 : 0 ; slice output append byte ( value ) ; } / / write last null bits if ( ( position count & 0b 1 1 1 ) > 0 ) { byte value = 0 ; int mask = 0b 1 0 0 0 0000 ; for ( int position = position count & ~ 0b 1 1 1 ; position < position count ; position + + ) { value | = block is null ( position ) ? mask : 0 ; mask > > > = 1 ; } slice output append byte ( value ) ; } }


analyze and load storage directories recover from previous transitions if required the block pool storages are either all analyzed or none of them is loaded therefore , a failure on loading any block pool storage results a faulty data volume

list < storage directory > load bp storage directories ( namespace info ns info , storage location location , startup option start opt , list < callable < storage directory > > callables , configuration conf ) throws i o exception { list < storage directory > succeed dirs = lists new array list ( ) ; try { if ( contains storage dir ( location , ns info get block pool i d ( ) ) ) { throw new i o exception ( " block pool slice storage recover transition read : " + " attempt to load an used block storage : " + location ) ; } final storage directory sd = load storage directory ( ns info , location , start opt , callables , conf ) ; succeed dirs add ( sd ) ; } catch ( i o exception e ) { log warn ( " failed to analyze storage directories for block pool { } " , ns info get block pool i d ( ) , e ) ; throw e ; } return succeed dirs ; }


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


this test validates the correctness of { @ link r m web service protocol # update app queue ( ) } inside router

public void test update app queue x m l ( ) throws exception { string app id = submit application ( ) ; / / test with a wrong http method client response bad response = perform call ( rm web service path + format ( apps appid queue , app id ) , null , null , null , post ) ; assert equals ( sc internal server error , bad response get status ( ) ) ; / / test with the correct http method app queue app queue = new app queue ( " default " ) ; client response response = perform call ( rm web service path + format ( apps appid queue , app id ) , null , null , app queue , put ) ; assert equals ( sc ok , response get status ( ) ) ; app queue ci = response get entity ( app queue class ) ; assert not null ( ci ) ; }


tool set was added to the project toolchest

public void tool set added ( tool set toolset ) { tool chest tool chest = tool get project ( ) get local tool chest ( ) ; tool template added ( tool chest get tool template ( toolset get name ( ) ) ) ; }


get the type of this request , used by each person in the chain of command to see if they should or can handle this particular request

public request type get request type ( ) { return request type ; }


specify a custom traversable resolver to use for this validator factory and its exposed default validator

public void set traversable resolver ( traversable resolver traversable resolver ) { this traversable resolver = traversable resolver ; }


shift the bits @ { code n } positions left this implements both a signed and unsigned shift

public masked long shift left ( long n ) { if ( n = = 0 ) { return this ; } / / zeros , not unknowns , fill the right long atright = ~ ( ( - 1l ) < < n ) ; return from mask and value ( ( this msk < < n ) | atright , this val < < n ) ; }


returns the number of ipc messages sent during command execution , if available

public long get ipc messages sent ( ) { return resource usage proto get msgsnd ( ) ; }


will either run the delegated task directly calling { @ link runnable # run ( ) } and return { @ code true } or will offload the delegated task using { @ link executor # execute ( runnable ) } and return { @ code false } if the task is offloaded it will take care to resume its work on the { @ link event executor } once there are no more tasks to process

private boolean run delegated tasks ( boolean in unwrap ) { if ( delegated task executor = = immediate executor instance | | in event loop ( delegated task executor ) ) { / / we should run the task directly in the event executor thread and not offload at all run all delegated tasks ( engine ) ; return true ; } else { execute delegated tasks ( in unwrap ) ; return false ; } }


make sure emission - subscription races are handled correctly https : github com reactive x rx javaissues 1 1 4 7

public void race for terminal state ( ) { final list < integer > expected = arrays as list ( 1 ) ; for ( int i = 0 ; i < 100000 ; i + + ) { test subscriber ex < integer > ts = new test subscriber ex < > ( ) ; flowable just ( 1 ) subscribe on ( schedulers computation ( ) ) cache ( ) subscribe ( ts ) ; ts await done ( 5 , time unit seconds ) ; ts assert value sequence ( expected ) ; ts assert terminated ( ) ; } }


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


deep equality for tuples by calling equals ( ) on the tuple members

public boolean equals ( object o ) { if ( this = = o ) { return true ; } if ( ! ( o instanceof tuple 1 5 ) ) { return false ; } @ suppress warnings ( " rawtypes " ) tuple 1 5 tuple = ( tuple 1 5 ) o ; if ( f 0 ! = null ? ! f 0 equals ( tuple f 0 ) : tuple f 0 ! = null ) { return false ; } if ( f 1 ! = null ? ! f 1 equals ( tuple f 1 ) : tuple f 1 ! = null ) { return false ; } if ( f 2 ! = null ? ! f 2 equals ( tuple f 2 ) : tuple f 2 ! = null ) { return false ; } if ( f 3 ! = null ? ! f 3 equals ( tuple f 3 ) : tuple f 3 ! = null ) { return false ; } if ( f 4 ! = null ? ! f 4 equals ( tuple f 4 ) : tuple f 4 ! = null ) { return false ; } if ( f 5 ! = null ? ! f 5 equals ( tuple f 5 ) : tuple f 5 ! = null ) { return false ; } if ( f 6 ! = null ? ! f 6 equals ( tuple f 6 ) : tuple f 6 ! = null ) { return false ; } if ( f 7 ! = null ? ! f 7 equals ( tuple f 7 ) : tuple f 7 ! = null ) { return false ; } if ( f 8 ! = null ? ! f 8 equals ( tuple f 8 ) : tuple f 8 ! = null ) { return false ; } if ( f 9 ! = null ? ! f 9 equals ( tuple f 9 ) : tuple f 9 ! = null ) { return false ; } if ( f 1 0 ! = null ? ! f 1 0 equals ( tuple f 1 0 ) : tuple f 1 0 ! = null ) { return false ; } if ( f 1 1 ! = null ? ! f 1 1 equals ( tuple f 1 1 ) : tuple f 1 1 ! = null ) { return false ; } if ( f 1 2 ! = null ? ! f 1 2 equals ( tuple f 1 2 ) : tuple f 1 2 ! = null ) { return false ; } if ( f 1 3 ! = null ? ! f 1 3 equals ( tuple f 1 3 ) : tuple f 1 3 ! = null ) { return false ; } if ( f 1 4 ! = null ? ! f 1 4 equals ( tuple f 1 4 ) : tuple f 1 4 ! = null ) { return false ; } return true ; }


sets whether or not the field header component is visible at the top of the listing panel

public void show header ( boolean show ) { if ( show ) { header panel = new field header ( format manager , scroller , field panel ) ; / / set the model to that of the field at the cursor location listing field current field = ( listing field ) field panel get current field ( ) ; if ( current field ! = null ) { header panel set selected field factory ( current field get field factory ( ) ) ; } } else { header panel set view component ( null ) ; header panel = null ; } build panels ( ) ; }


test that concurrent failed method invocations only result in a single failover

public void test concurrent method failures ( ) throws interrupted exception { flip flop proxy provider < unreliable interface > proxy provider = new flip flop proxy provider < unreliable interface > ( unreliable interface class , new synchronized unreliable implementation ( " impl 1 " , type of exception to fail with standby exception , 2 ) , new unreliable implementation ( " impl 2 " , type of exception to fail with standby exception ) ) ; final unreliable interface unreliable = ( unreliable interface ) retry proxy create ( unreliable interface class , proxy provider , retry policies failover on network exception ( 10 ) ) ; concurrent method thread t 1 = new concurrent method thread ( unreliable ) ; concurrent method thread t 2 = new concurrent method thread ( unreliable ) ; t 1 start ( ) ; t 2 start ( ) ; t 1 join ( ) ; t 2 join ( ) ; assert equals ( " impl 2 " , t 1 result ) ; assert equals ( " impl 2 " , t 2 result ) ; assert equals ( 1 , proxy provider get failovers occurred ( ) ) ; }


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 { @ link inet address } having the given string representation this deliberately avoids all nameservice lookups ( e g no dns )

public static inet address for string ( string ip string ) { byte [ ] addr = ip string to bytes ( ip string ) ; / / the argument was malformed , i e not an ip string literal if ( addr = = null ) { throw new illegal argument exception ( string format ( locale root , " ' % s ' is not an ip string literal " , ip string ) ) ; } return bytes to inet address ( addr ) ; }


public shape get main shape ( ) { return main shape ; }


reverses the elements of { @ code array } between { @ code from index } inclusive and { @ code to index } exclusive this is equivalent to { @ code collections reverse ( shorts as list ( array ) sub list ( from index , to index ) ) } , but is likely to be more efficient

public static void reverse ( short [ ] array , int from index , int to index ) { check not null ( array ) ; check position indexes ( from index , to index , array length ) ; for ( int i = from index , j = to index - 1 ; i < j ; i + + , j - - ) { short tmp = array [ i ] ; array [ i ] = array [ j ] ; array [ j ] = tmp ; } }


this implementation returns { @ code null }

public property editor registry get property editor registry ( ) { return null ; }


executes this action using provided { @ link atomic cluster state writer }

long execute ( atomic cluster state writer writer ) throws write state exception ;


returns the initial mapping from p i ds to payload readers this method allows the injection of payload readers for reserved p i ds , excluding pid 0

sparse array < ts payload reader > create initial payload readers ( ) ;


perform a sanity check on the packet , returning true if it is sane

public boolean sanity check ( long last seq no ) { / / we should only have a non - positive data length for the last packet if ( proto get data len ( ) < = 0 & & ! proto get last packet in block ( ) ) return false ; / / the last packet should not contain data if ( proto get last packet in block ( ) & & proto get data len ( ) ! = 0 ) return false ; / / seqnos should always increase by 1 with each packet received return proto get seqno ( ) = = last seq no + 1 ; }


completes the history with response events for invocations that are missing corresponding responses

public void complete ( function < object , object > missing response generator ) { final map < integer , event > uncompleted invocations = new hash map < > ( ) ; for ( event event : events ) { if ( event type = = event type invocation ) { uncompleted invocations put ( event id , event ) ; } else { final event removed = uncompleted invocations remove ( event id ) ; if ( removed = = null ) { throw new illegal argument exception ( " history not well - formed : " + events ) ; } } } for ( map entry < integer , event > entry : uncompleted invocations entry set ( ) ) { events add ( new event ( event type response , missing response generator apply ( entry get value ( ) value ) , entry get key ( ) ) ) ; } }


push a request to disable automatic sleep for hardware useful for making sure computers don ' t go to sleep during long builds must be matched with a { @ link # pop disable sleep } call

public static native int push disable sleep ( ) ;


clears the internal state of the cache and becomes unusable

public static void destroy ( cache < ? , ? > cache ) { local cache < ? , ? > local = ( cache instanceof abstract cache view < ? , ? > ) ? ( ( abstract cache view < ? , ? > ) cache ) async cache ( ) cache ( ) : ( local cache < ? , ? > ) cache as map ( ) ; if ( local instanceof unbounded local cache ) { unbounded local cache < ? , ? > unbounded = ( unbounded local cache < ? , ? > ) local ; unbounded data clear ( ) ; } else if ( local instanceof bounded local cache ) { @ suppress warnings ( " unchecked " ) bounded local cache < object , object > bounded = ( bounded local cache < object , object > ) local ; bounded eviction lock lock ( ) ; try { for ( node < ? , ? > node : bounded data values ( ) ) { destroy node ( bounded , node ) ; } if ( bounded expires variable ( ) ) { destroy timer wheel ( bounded ) ; } bounded data clear ( ) ; } finally { bounded eviction lock unlock ( ) ; } } }


get the allocation tags of the constraint

public set < string > get allocation tags ( ) { return allocation tags ; }


public int get color ( ) { return m color ; }


creates a new initializing shard the shard will will be put in its proper path under the supplied node id

protected index shard new shard ( shard id shard id , boolean primary , string node id , index metadata index metadata , @ nullable checked function < directory reader , directory reader , i o exception > reader wrapper , runnable global checkpoint syncer ) throws i o exception { shard routing shard routing = test shard routing new shard routing ( shard id , node id , primary , shard routing state initializing , primary ? recovery source empty store recovery source instance : recovery source peer recovery source instance ) ; return new shard ( shard routing , index metadata , reader wrapper , new internal engine factory ( ) , global checkpoint syncer , retention lease syncer empty ) ; }


may be called on receipt of an apply commit request updates the committed configuration accordingly

public void handle commit ( apply commit request apply commit ) { if ( apply commit get term ( ) ! = get current term ( ) ) { logger debug ( " handle commit : ignored commit request due to term mismatch " + " ( expected : [ term { } version { } ] , actual : [ term { } version { } ] ) " , get last accepted term ( ) , get last accepted version ( ) , apply commit get term ( ) , apply commit get version ( ) ) ; throw new coordination state rejected exception ( " incoming term " + apply commit get term ( ) + " does not match current term " + get current term ( ) ) ; } if ( apply commit get term ( ) ! = get last accepted term ( ) ) { logger debug ( " handle commit : ignored commit request due to term mismatch " + " ( expected : [ term { } version { } ] , actual : [ term { } version { } ] ) " , get last accepted term ( ) , get last accepted version ( ) , apply commit get term ( ) , apply commit get version ( ) ) ; throw new coordination state rejected exception ( " incoming term " + apply commit get term ( ) + " does not match last accepted term " + get last accepted term ( ) ) ; } if ( apply commit get version ( ) ! = get last accepted version ( ) ) { logger debug ( " handle commit : ignored commit request due to version mismatch ( term { } , expected : [ { } ] , actual : [ { } ] ) " , get last accepted term ( ) , get last accepted version ( ) , apply commit get version ( ) ) ; throw new coordination state rejected exception ( " incoming version " + apply commit get version ( ) + " does not match current version " + get last accepted version ( ) ) ; } logger trace ( " handle commit : applying commit request for term [ { } ] and version [ { } ] " , apply commit get term ( ) , apply commit get version ( ) ) ; persisted state mark last accepted state as committed ( ) ; assert get last committed configuration ( ) equals ( get last accepted configuration ( ) ) ; }


try to transition the execution state from the current state to the new state

private boolean transition state ( execution state current state , execution state new state ) { return transition state ( current state , new state , null ) ; }


interrupt any running poll ( ) calls , causing a wakeup exception to be thrown in the thread invoking that method

public void wakeup ( ) { this client wakeup ( ) ; }


combine input splits from child input formats into a { @ link composite input split }

public input split [ ] get splits ( job conf job , int num splits ) throws i o exception { input split [ ] [ ] splits = new input split [ kids size ( ) ] [ ] ; for ( int i = 0 ; i < kids size ( ) ; + + i ) { final input split [ ] tmp = kids get ( i ) get splits ( job , num splits ) ; if ( null = = tmp ) { throw new i o exception ( " error gathering splits from child r reader " ) ; } if ( i > 0 & & splits [ i - 1 ] length ! = tmp length ) { throw new i o exception ( " inconsistent split cardinality from child " + i + " ( " + splits [ i - 1 ] length + " / " + tmp length + " ) " ) ; } splits [ i ] = tmp ; } final int size = splits [ 0 ] length ; composite input split [ ] ret = new composite input split [ size ] ; for ( int i = 0 ; i < size ; + + i ) { ret [ i ] = new composite input split ( splits length ) ; for ( int j = 0 ; j < splits length ; + + j ) { ret [ i ] add ( splits [ j ] [ i ] ) ; } } return ret ; }


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


get the byte storage array associated with this buffer

protected byte [ ] get data ( ) { return data ; }


returns true if this bitmap font has been flipped for use with a y - down coordinate system

public boolean is flipped ( ) { return flipped ; }


public builder < t > named ( string method name ) { add filter ( " method name = " + method name , method - > method get name ( ) equals ( method name ) ) ; return this ; }


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

public base model view model on visibility changed ( on model visibility changed listener < base model view model , base model view > listener ) { on mutation ( ) ; this on model visibility changed listener epoxy generated model = listener ; return this ; }


returns whether this method is safe a safe request does nothing except retrieval so it has no side effects on the server side

public boolean is safe ( ) { return safe ; }


configures this { @ code builder } to order entries by value according to the specified comparator the sort order is stable , that is , if two entries have values that compare as equivalent , the entry that was inserted first will be first in the built map ' s iteration order

public builder < k , v > order entries by value ( comparator < ? super v > value comparator ) { check state ( this value comparator = = null , " value comparator was already set " ) ; this value comparator = check not null ( value comparator , " value comparator " ) ; return this ; }


create an application a record descriptor

protected void create a info ( service record record ) throws exception { a application record descriptor record info = new a application record descriptor ( get path ( ) , record ) ; register record descriptor ( type a , record info ) ; }


removes touch focus for the specified listener , pointer , and button note the listener will not receive a touch up event when this method is used

public void remove touch focus ( event listener listener , actor listener actor , actor target , int pointer , int button ) { snapshot array < touch focus > touch focuses = this touch focuses ; for ( int i = touch focuses size - 1 ; i > = 0 ; i - - ) { touch focus focus = touch focuses get ( i ) ; if ( focus listener = = listener & & focus listener actor = = listener actor & & focus target = = target & & focus pointer = = pointer & & focus button = = button ) { touch focuses remove index ( i ) ; pools free ( focus ) ; } } }


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

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


public int execute update ( string sql , int [ ] column indexes ) throws s q l exception { return 0 ; }


public int get key offset ( int index ) { return buffer get int ( base + ( index * entry size ) ) ; }


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


find the fields constant that matches field id , throwing an exception if it is not found

public static fields find by thrift id or throw ( int field id ) { fields fields = find by thrift id ( field id ) ; if ( fields = = null ) throw new illegal argument exception ( " field " + field id + " doesn ' t exist ! " ) ; return fields ; }


test that program merge can determine the function return types are different

public void test apply function return diff ( ) throws exception { / / 0x 0 1 0 0 4 8a 3 : p 1 returns d word , p 2 returns float / / 0x 0 1 0 0 5 9a 3 : p 1 returns byte , p 2 returns word / / 0x 0 1 0 0 2 2 3 9 : functions are the same , both return ascii int transaction i d = p 1 start transaction ( " test transaction " ) ; function manager function manager 1 = p 1 get function manager ( ) ; function function 1 = function manager 1 get function at ( addr ( 0x 0 1 0 0 4 8a 3 ) ) ; assert not null ( function 1 ) ; function 1 set return type ( new d word data type ( ) , source type user defined ) ; function 1 = function manager 1 get function at ( addr ( 0x 0 1 0 0 5 9a 3 ) ) ; assert not null ( function 1 ) ; function 1 set return type ( new byte data type ( ) , source type user defined ) ; function 1 = function manager 1 get function at ( addr ( 0x 0 1 0 0 2 2 3 9 ) ) ; assert not null ( function 1 ) ; function 1 set return type ( new char data type ( ) , source type user defined ) ; p 1 end transaction ( transaction i d , true ) ; int transaction i d 2 = p 2 start transaction ( " test transaction " ) ; function manager function manager 2 = p 2 get function manager ( ) ; function function 2 = function manager 2 get function at ( addr ( 0x 0 1 0 0 4 8a 3 ) ) ; assert not null ( function 2 ) ; function 2 set return type ( new float data type ( ) , source type user defined ) ; function 2 = function manager 2 get function at ( addr ( 0x 0 1 0 0 5 9a 3 ) ) ; assert not null ( function 2 ) ; function 2 set return type ( new word data type ( ) , source type user defined ) ; function 2 = function manager 2 get function at ( addr ( 0x 0 1 0 0 2 2 3 9 ) ) ; assert not null ( function 2 ) ; function 2 set return type ( new char data type ( ) , source type user defined ) ; p 2 end transaction ( transaction i d 2 , true ) ; program merge = new program merge manager ( p 1 , p 2 , task monitor adapter dummy monitor ) ; address set diff as = new address set ( ) ; diff as add range ( addr ( 0x 0 1 0 0 4 8a 3 ) , addr ( 0x 0 1 0 0 4 8a 3 ) ) ; diff as add range ( addr ( 0x 0 1 0 0 5 9a 3 ) , addr ( 0x 0 1 0 0 5 9a 3 ) ) ; program merge set diff filter ( new program diff filter ( program diff filter function diffs ) ) ; program merge set merge filter ( new program merge filter ( program merge filter functions , program merge filter replace ) ) ; assert equals ( diff as , program merge get filtered differences ( ) ) ; program merge merge ( diff as , task monitor adapter dummy monitor ) ; assert equals ( new address set ( ) , program merge get filtered differences ( ) ) ; }


public test field prop callback prop view model on visibility changed ( on model visibility changed listener < test field prop callback prop view model , test field prop callback prop view > listener ) { on mutation ( ) ; this on model visibility changed listener epoxy generated model = listener ; return this ; }


checks whether a methodconstructor can be called with the given argument classes this includes type widening and vararg { @ code null } is a wildcard e g , { @ code ( int class , int class ) } matches { @ code f ( object ) , f ( int , int ) , f ( integer , object ) } and so forth

public static boolean is invokable ( executable executable , class < ? > classes ) { final int m = executable get modifiers ( ) ; if ( ! modifier is public ( m ) ) { return false ; } final int param count = executable get parameter count ( ) ; final int class count = classes length ; / / check for enough classes for each parameter if ( class count < param count | | ( executable is var args ( ) & & class count < param count - 1 ) ) { return false ; } int current class = 0 ; for ( int current param = 0 ; current param < param count ; current param + + ) { final class < ? > param = executable get parameter types ( ) [ current param ] ; / / last parameter is a vararg that needs to consume remaining classes if ( current param = = param count - 1 & & executable is var args ( ) ) { final class < ? > param component = executable get parameter types ( ) [ current param ] get component type ( ) ; / / we have more than 1 classes left so the vararg needs to consume them all if ( class count - current class > 1 ) { while ( current class < class count & & extraction utils is assignable ( classes [ current class ] , param component , true ) ) { current class + + ; } } else if ( parameter matches ( classes [ current class ] , param ) | | parameter matches ( classes [ current class ] , param component ) ) { current class + + ; } } / / entire parameter matches else if ( parameter matches ( classes [ current class ] , param ) ) { current class + + ; } } / / check if all classes have been consumed return current class = = class count ; }


public purge task status get purge task status ( ) { return purge task status ; }


invokes with { @ code receiver } as ' this ' and { @ code args } passed to the underlying method and returns the return value ; or calls the underlying constructor with { @ code args } and returns the constructed instance

public final r invoke ( @ nullable decl t receiver , object args ) throws invocation target exception , illegal access exception { return ( r ) invoke internal ( receiver , check not null ( args ) ) ; }


get mount tables which quota was set during this time , the quota usage cache will also be updated by quota manager : 1 stale paths ( entries ) will be removed 2 existing entries will be override and updated

private list < mount table > get quota set mount tables ( ) throws i o exception { list < mount table > mount tables = get mount table entries ( ) ; set < string > all paths = this quota manager get all ( ) ; set < string > stale paths = new hash set < > ( all paths ) ; list < mount table > needed mount tables = new linked list < > ( ) ; for ( mount table entry : mount tables ) { / / select mount tables which is quota set if ( is quota set ( entry ) ) { needed mount tables add ( entry ) ; } / / update mount table entries info in quota cache string src = entry get source path ( ) ; this quota manager update quota ( src , entry get quota ( ) ) ; stale paths remove ( src ) ; } / / remove stale paths that currently cached for ( string stale path : stale paths ) { this quota manager remove ( stale path ) ; } return needed mount tables ; }


waits for the first window of the given class this method assumes that the desired dialog is parented by < code > parent window < code >

public static < t extends dialog component provider > t wait for dialog component ( window parent window , class < t > clazz , int timeout m s ) { if ( ! dialog component provider class is assignable from ( clazz ) ) { throw new illegal argument exception ( clazz get name ( ) + " does not extend " + dialog component provider class get simple name ( ) ) ; } int total time = 0 ; while ( total time < = default wait timeout ) { t provider = get dialog component ( parent window , clazz ) ; if ( provider ! = null ) { return provider ; } total time + = sleep ( default wait delay ) ; } throw new assertion failed error ( " timed - out waiting for window of class : " + clazz ) ; }


used for translating field names in according to the passed ` field mappings ` parameter this mutates the ` fields ` parameter in - place fields are only appended if the expected field name already exists , it is not createdoverwritten original fields are not deleted

public static void map fields if necessary ( map < string , object > fields , map < string , string > field mapping ) { if ( field mapping ! = null ) { field mapping for each ( ( src , dest ) - > { object src value = map helper dig ( src , fields ) ; if ( src value ! = null ) { fields put if absent ( dest , src value ) ; } } ) ; } }


get the delay that should be used for delaying a response in accordance with configured behavior

public long calculate delay ( time unit unit ) { float delta = variance percent / 1 0 0f ; / / e g , 20 / 1 0 0f = = 0 2f float lower bound = 1f - delta ; / / 0 2f - - > 0 8f float upper bound = 1f + delta ; / / 0 2f - - > 1 2f float bound = upper bound - lower bound ; / / 1 2f - 0 8f = = 0 4f float delay percent = lower bound + ( random next float ( ) * bound ) ; / / 0 8 + ( rnd * 0 4 ) long call delay ms = ( long ) ( delay ms * delay percent ) ; return milliseconds convert ( call delay ms , unit ) ; }


synchronized void clear ( ) { for ( value value : multimap values ( ) ) { i o utils client cleanup with logger ( log , value get peer ( ) ) ; } multimap clear ( ) ; }


populates the embedded binaries directory with all files found in any of the directories in { @ link test constants # embedded scripts paths } by creating symlinks in { @ link blaze directories # get embedded binaries root } that point to the runfiles tree of the currently running test ( as obtained from { @ link blaze test utils # runfiles dir } )

public bin tools get integration bin tools ( file system file system , blaze directories directories ) throws i o exception { path embedded binaries root = directories get embedded binaries root ( ) ; embedded binaries root create directory and parents ( ) ; path runfiles = file system get path ( blaze test utils runfiles dir ( ) ) ; / / copy over everything in embedded scripts collection < path > files = new array list < > ( ) ; for ( string embedded script path : test constants embedded scripts paths ) { path embedded scripts = runfiles get relative ( embedded script path ) ; if ( embedded scripts exists ( ) ) { files add all ( embedded scripts get directory entries ( ) ) ; } else { system err println ( " test does not have " + embedded scripts ) ; } } for ( path from file : files ) { try { embedded binaries root get child ( from file get base name ( ) ) create symbolic link ( from file ) ; } catch ( i o exception e ) { system err println ( " could not symlink : " + e get message ( ) ) ; } } return bin tools for integration testing ( directories , test constants embedded tools ) ; }


public void test big cat ( ) { / / todo : test big cat }


receives the backlog from the producer ' s buffer response if the number of available buffers is less than backlog + initial credit , it will request floating buffers from the buffer manager , and then notify unannounced credits to the producer

void on sender backlog ( int backlog ) throws i o exception { int num requested buffers = buffer manager request floating buffers ( backlog + initial credit ) ; if ( num requested buffers > 0 & & unannounced credit get and add ( num requested buffers ) = = 0 ) { notify credit available ( ) ; } }


create a single image source for a given image request

public static image source for image request ( @ nullable image request image request ) { if ( image request = = null ) { return empty source ( ) ; } return get ( ) single image request ( image request ) ; }


not supported < b > you are attempting to create a map that may contain a non - { @ code comparable } key < b > proper calls will resolve to the version in { @ code immutable sorted map } , not this dummy version

public static < k , v > immutable sorted map < k , v > of ( k k 1 , v v 1 ) { throw new unsupported operation exception ( ) ; }


create an instance of { @ code joined } with an other value { @ link serde } { @ code null } values are accepted and will be replaced by the default value serde as defined in config

public static < k , v , vo > joined < k , v , vo > other value serde ( final serde < vo > other value serde ) { return new joined < > ( null , null , other value serde , null ) ; }


adds the given key , value to the map if the map does not allow duplicate keys and a key already exists , the old value will be replaced by the new value and the old value will be returned

public pair < red black node < k , v > , boolean > put ( k key , v value ) { if ( root = = null ) { size + + ; root = new red black node < k , v > ( key , value , null ) ; return new pair < red black node < k , v > , boolean > ( root , boolean true ) ; } red black node < k , v > node = root ; while ( true ) { int comp = comparator compare ( key , node key ) ; if ( comp = = 0 & & ! allow duplicate keys ) { node value = value ; return new pair < red black node < k , v > , boolean > ( node , boolean false ) ; } else if ( comp < 0 ) { if ( node left ! = null ) { node = node left ; } else { size + + ; red black node < k , v > new node = new red black node < k , v > ( key , value , node ) ; node left = new node ; fix after insertion ( new node ) ; return new pair < red black node < k , v > , boolean > ( new node , boolean true ) ; } } else { if ( node right ! = null ) { node = node right ; } else { size + + ; red black node < k , v > new node = new red black node < k , v > ( key , value , node ) ; node right = new node ; fix after insertion ( new node ) ; return new pair < red black node < k , v > , boolean > ( new node , boolean true ) ; } } } }


only supposed to be called at startup time

public static void register class ( class < ? > clazz , object serializer ) { if ( clazz = = null ) { throw new illegal argument exception ( " class registered to kryo cannot be null ! " ) ; } registrations put ( clazz , serializer ) ; }


validates that the given component template is not used by any index templates , throwing an error if it is still in use

static void validate not in use ( metadata metadata , string template name or wildcard ) { final set < string > matching component templates = metadata component templates ( ) key set ( ) stream ( ) filter ( name - > regex simple match ( template name or wildcard , name ) ) collect ( collectors to set ( ) ) ; final set < string > components being used = new hash set < > ( ) ; final list < string > templates still using = metadata templates v 2 ( ) entry set ( ) stream ( ) filter ( e - > { set < string > intersecting = sets intersection ( new hash set < > ( e get value ( ) composed of ( ) ) , matching component templates ) ; if ( intersecting size ( ) > 0 ) { components being used add all ( intersecting ) ; return true ; } return false ; } ) map ( map entry : : get key ) collect ( collectors to list ( ) ) ; if ( templates still using size ( ) > 0 ) { throw new illegal argument exception ( " component templates " + components being used + " cannot be removed as they are still in use by index templates " + templates still using ) ; } }


abstract void register timer ( context ctx , long cleanup time ) ;


regression test : " oom in skyframe cycle detection " we only store the first 20 cycles found below any given root value

public void many cycles ( ) throws exception { graph = new in memory graph impl ( ) ; sky key top key = graph tester to sky key ( " top " ) ; for ( int i = 0 ; i < 100 ; i + + ) { sky key dep = graph tester to sky key ( integer to string ( i ) ) ; tester get or create ( top key ) add dependency ( dep ) ; tester get or create ( dep ) add dependency ( dep ) ; } evaluation result < string value > result = eval ( / * keep going = * / true , immutable list of ( top key ) ) ; assert that ( result get ( top key ) ) is null ( ) ; assert many cycles ( result get error ( top key ) , top key , / * self edge = * / false ) ; }


void clear password ( ) { if ( password ! = null ) { arrays fill ( password , ' ' ) ; } }


get the ' value ' corresponding to the last read ' key '

public synchronized object get current value ( object val ) throws i o exception { if ( val instanceof configurable ) { ( ( configurable ) val ) set conf ( this conf ) ; } / / position stream to ' current ' value seek to current value ( ) ; if ( ! block compressed ) { val = deserialize value ( val ) ; if ( val in read ( ) > 0 ) { log info ( " available bytes : " + val in available ( ) ) ; throw new i o exception ( val + " read " + ( val buffer get position ( ) - key length ) + " bytes , should read " + ( val buffer get length ( ) - key length ) ) ; } } else { / / get the value int val length = writable utils read v int ( val len in ) ; val = deserialize value ( val ) ; / / read another compressed ' value ' - - no buffered values ; / / sanity check if ( ( val length < 0 ) & & log is debug enabled ( ) ) { log debug ( val + " is a zero - length value " ) ; } } return val ; }


log the cancellation of expired tokens to edit logs

public void log expire delegation token ( delegation token identifier id ) { assert ! is in safe mode ( ) : " this should never be called while in safemode , since we stop " + " the dt manager before entering safemode ! " ; / / edit log rolling is not thread - safe and must be protected by the / / fsn lock not updating namespace so read lock is sufficient assert has read lock ( ) ; / / do not log sync so expiration edits are batched get edit log ( ) log cancel delegation token ( id ) ; }


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


return the key associated with this collection


the yarn router will forward to the respective yarn rm in which the am is running possible failure : client : identical behavior as { @ code client r m service } router : the client will timeout and resubmit the request resource manager : the router will timeout and the call will fail state store : the router will timeout and it will retry depending on the federation facade settings - if the failure happened before the select operation

public get application report response get application report ( get application report request request ) throws yarn exception , i o exception { long start time = clock get time ( ) ; if ( request = = null | | request get application id ( ) = = null ) { router metrics incr apps failed retrieved ( ) ; router server util log and throw exception ( " missing get application report request or application id information " , null ) ; } sub cluster id sub cluster id = null ; try { sub cluster id = federation facade get application home sub cluster ( request get application id ( ) ) ; } catch ( yarn exception e ) { router metrics incr apps failed retrieved ( ) ; router server util log and throw exception ( " application " + request get application id ( ) + " does not exist in federation state store " , e ) ; } application client protocol client r m proxy = get client r m proxy for sub cluster ( sub cluster id ) ; get application report response response = null ; try { response = client r m proxy get application report ( request ) ; } catch ( exception e ) { router metrics incr apps failed retrieved ( ) ; log error ( " unable to get the application report for " + request get application id ( ) + " to sub cluster " + sub cluster id get id ( ) , e ) ; throw e ; } if ( response = = null ) { log error ( " no response when attempting to retrieve the report of " + " the application " + request get application id ( ) + " to sub cluster " + sub cluster id get id ( ) ) ; } long stop time = clock get time ( ) ; router metrics succeeded apps retrieved ( stop time - start time ) ; return response ; }


{ @ inherit doc } the default implementation returns the result of calling { @ link # visit children } on { @ code ctx }

@ override public t visit pipe ( eql base parser pipe context ctx ) { return visit children ( ctx ) ; }