check whether the given class matches the user - specified type name

public static boolean matches type name ( class < ? > clazz , @ nullable string type name ) { return ( type name ! = null & & ( type name equals ( clazz get type name ( ) ) | | type name equals ( clazz get simple name ( ) ) ) ) ; }


set up the mock to return info for some prior active node in zk

private void mock prior active ( byte [ ] data ) throws exception { mockito do return ( data ) when ( mock z k ) get data ( mockito eq ( zk breadcrumb name ) , mockito any boolean ( ) , mockito < stat > any ( ) ) ; }


converts the specified byte array into a hexadecimal value

public static string to hex string ( byte [ ] src , int offset , int length ) { return to hex string ( new string builder ( length < < 1 ) , src , offset , length ) to string ( ) ; }


a formatted string for reporting the status of the data node

public string get datanode report ( ) { string builder buffer = new string builder ( ) ; long c = get capacity ( ) ; long r = get remaining ( ) ; long u = get dfs used ( ) ; long non d f s used = get non dfs used ( ) ; float used percent = get dfs used percent ( ) ; float remaining percent = get remaining percent ( ) ; long cc = get cache capacity ( ) ; long cr = get cache remaining ( ) ; long cu = get cache used ( ) ; float cache used percent = get cache used percent ( ) ; float cache remaining percent = get cache remaining percent ( ) ; string lookup name = net utils get host name of i p ( get name ( ) ) ; int block count = get num blocks ( ) ; buffer append ( " name : " ) append ( get name ( ) ) ; if ( lookup name ! = null ) { buffer append ( " ( " ) append ( lookup name ) append ( " ) " ) ; } buffer append ( " \ n " ) append ( " hostname : " ) append ( get host name ( ) ) append ( " \ n " ) ; if ( ! network topology default rack equals ( location ) ) { buffer append ( " rack : " ) append ( location ) append ( " \ n " ) ; } if ( upgrade domain ! = null ) { buffer append ( " upgrade domain : " ) append ( upgrade domain ) append ( " \ n " ) ; } buffer append ( " decommission status : " ) ; if ( is decommissioned ( ) ) { buffer append ( " decommissioned \ n " ) ; } else if ( is decommission in progress ( ) ) { buffer append ( " decommission in progress \ n " ) ; } else if ( is in maintenance ( ) ) { buffer append ( " in maintenance \ n " ) ; } else if ( is entering maintenance ( ) ) { buffer append ( " entering maintenance \ n " ) ; } else { buffer append ( " normal \ n " ) ; } buffer append ( " configured capacity : " ) append ( c ) append ( " ( " ) append ( string utils byte desc ( c ) ) append ( " ) " ) append ( " \ n " ) append ( " dfs used : " ) append ( u ) append ( " ( " ) append ( string utils byte desc ( u ) ) append ( " ) " ) append ( " \ n " ) append ( " non dfs used : " ) append ( non d f s used ) append ( " ( " ) append ( string utils byte desc ( non d f s used ) ) append ( " ) " ) append ( " \ n " ) append ( " dfs remaining : " ) append ( r ) append ( " ( " ) append ( string utils byte desc ( r ) ) append ( " ) " ) append ( " \ n " ) append ( " dfs used % : " ) append ( percent 2 string ( used percent ) ) append ( " \ n " ) append ( " dfs remaining % : " ) append ( percent 2 string ( remaining percent ) ) append ( " \ n " ) append ( " configured cache capacity : " ) append ( cc ) append ( " ( " ) append ( string utils byte desc ( cc ) ) append ( " ) " ) append ( " \ n " ) append ( " cache used : " ) append ( cu ) append ( " ( " ) append ( string utils byte desc ( cu ) ) append ( " ) " ) append ( " \ n " ) append ( " cache remaining : " ) append ( cr ) append ( " ( " ) append ( string utils byte desc ( cr ) ) append ( " ) " ) append ( " \ n " ) append ( " cache used % : " ) append ( percent 2 string ( cache used percent ) ) append ( " \ n " ) append ( " cache remaining % : " ) append ( percent 2 string ( cache remaining percent ) ) append ( " \ n " ) append ( " xceivers : " ) append ( get xceiver count ( ) ) append ( " \ n " ) append ( " last contact : " ) append ( new date ( last update ) ) append ( " \ n " ) append ( " last block report : " ) append ( last block report time ! = 0 ? new date ( last block report time ) : " never " ) append ( " \ n " ) append ( " num of blocks : " ) append ( block count ) append ( " \ n " ) ; return buffer to string ( ) ; }


sets a built - in timestamp extractor that converts the assigned timestamps from a data stream api record into the rowtime attribute and thus preserves the assigned timestamps from the source note : this extractor only works in streaming environments

public rowtime timestamps from source ( ) { internal properties put string ( rowtime timestamps type , rowtime timestamps type value from source ) ; return this ; }


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


public iterable < string > get candidates ( ) { return candidates ; }


set the prefix for bean names that will cause them to be included for auto - proxying by this object this prefix should be set to avoid circular references default value is the bean name of this object + a dot

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


check for a { @ code big integer } { @ code big decimal } long overflow before returning the given number as a long value

private static long checked long value ( number number , class < ? extends number > target class ) { big integer big int = null ; if ( number instanceof big integer ) { big int = ( big integer ) number ; } else if ( number instanceof big decimal ) { big int = ( ( big decimal ) number ) to big integer ( ) ; } / / effectively analogous to jdk 8 ' s big integer long value exact ( ) if ( big int ! = null & & ( big int compare to ( long min ) < 0 | | big int compare to ( long max ) > 0 ) ) { raise overflow exception ( number , target class ) ; } return number long value ( ) ; }


public string get id ( ) { return id ; }


return a map from topic names to futures , which can be used to check the status of individual partition creations

public map < string , kafka future < void > > values ( ) { return values ; }


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


invokes { @ code executor } { @ link executor service # await termination ( long , time unit ) await termination ( long , time unit ) } uninterruptibly with no timeout

public static void await termination uninterruptibly ( executor service executor ) { / / todo ( cpovirk ) : we could optimize this to avoid calling nano time ( ) at all verify ( await termination uninterruptibly ( executor , long max value , nanoseconds ) ) ; }


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


public void test super call to inherited default method ( ) { assert that ( new interface with inherited methods impl ( ) name ( ) ) is equal to ( " base " ) ; assert that ( new interface with inherited methods impl ( ) suffix ( ) ) is equal to ( " ! " ) ; }


removes the items between the specified indices , inclusive

public void remove range ( int start , int end ) { int n = size ; if ( end > = n ) throw new index out of bounds exception ( " end can ' t be > = size : " + end + " > = " + size ) ; if ( start > end ) throw new index out of bounds exception ( " start can ' t be > end : " + start + " > " + end ) ; int count = end - start + 1 , last index = n - count ; if ( ordered ) system arraycopy ( items , start + count , items , start , n - ( start + count ) ) ; else { int i = math max ( last index , end + 1 ) ; system arraycopy ( items , i , items , start , n - i ) ; } size = n - count ; }


given a set of features , return a new set of all features directly or indirectly implied by any of them

public static set < feature < ? > > implied features ( set < feature < ? > > features ) { set < feature < ? > > implied set = new linked hash set < > ( ) ; queue < feature < ? > > queue = new array deque < > ( features ) ; while ( ! queue is empty ( ) ) { feature < ? > feature = queue remove ( ) ; for ( feature < ? > implied : feature get implied features ( ) ) { if ( ! features contains ( implied ) & & implied set add ( implied ) ) { queue add ( implied ) ; } } } return implied set ; }


if some events are blocked on the absence of a build started event , generate such an event ; moreover , make that artificial start event announce all events blocked on it , as well as the { @ link build completing event } that caused the early end of the stream

private synchronized void clear missing start event ( build event id id ) { if ( pending events contains key ( build event id util build started id ( ) ) ) { immutable set builder < build event id > children = immutable set builder ( ) ; children add ( progress event initial progress update ) ; children add ( id ) ; children add all ( pending events get ( build event id util build started id ( ) ) stream ( ) map ( build event : : get event id ) collect ( immutable set to immutable set ( ) ) ) ; build event ( new aborted event ( build event id util build started id ( ) , children build ( ) , get last abort reason ( ) , get abort reason details ( ) ) ) ; } }


this method adds a single data types to the input data type list and marks the data as dirty ( all must need recalculated )

public void add type ( data type data type ) { if ( data type = = null ) { return ; } input set add ( create entry ( data type ) ) ; processed = false ; }


events that explain latency with a timestamp unlike log statements , annotations are often short or contain codes : for example " brave flush " annotations are sorted ascending by timestamp

public list < annotation > annotations ( ) { return annotations ; }


adds a given property to animate this also puts the builder in a state to configure the animation of this property using { @ link # animator } , { @ link # appear from } , and { @ link # disappear to }

public transition units builder animate ( animated property property ) { maybe commit current builder ( ) ; m property target = new property target ( property target type single , property ) ; return this ; }


public static void assert gauge ( string name , int expected , metrics source source ) { assert gauge ( name , expected , get metrics ( source ) ) ; }


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

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


at the end of each eval , reset the universe scope to the default if the test doesn ' t use a single universe scope

protected set < t > eval ( string query ) throws exception { maybe parse universe scope ( query ) ; set < t > query result = super eval ( query ) ; if ( ! get helper ( ) is whole test universe ( ) ) { helper set universe scope ( get default universe scope ( ) ) ; } return query result ; }


called before transactional event listener invocation

default void pre process event ( application event event ) { }


returns typecasted value for attribute or { @ code null } on no match

public < t > t get ( string attribute name , type < t > type ) throws eval exception { preconditions check not null ( type ) ; object value = get object ( attribute name ) ; try { return type cast ( value ) ; } catch ( class cast exception ex ) { throw new eval exception ( ex ) ; } }


a shortcut factory method for creating a message with the given payload and { @ code message headers } note : the given { @ code message headers } instance is used directly in the new message , i e it is not copied

public static < t > message < t > create message ( @ nullable t payload , message headers message headers ) { assert not null ( payload , " payload must not be null " ) ; assert not null ( message headers , " message headers must not be null " ) ; if ( payload instanceof throwable ) { return ( message < t > ) new error message ( ( throwable ) payload , message headers ) ; } else { return new generic message < > ( payload , message headers ) ; } }


sets the pad top , pad left , pad bottom , and pad right to the specified value

public cell < t > pad ( float pad ) { pad ( fixed value of ( pad ) ) ; return this ; }


whether configured to remove " ; " ( semicolon ) content from the request uri

public boolean should remove semicolon content ( ) { check read only ( ) ; return this remove semicolon content ; }


specify a { @ link supplier sql supplier } that provides sql to run contract for specifying an sql call along with options leading to the execution the sql string can contain either native parameter bind markers or named parameters ( e g { @ literal : foo , : bar } ) when { @ link named parameter expander } is enabled accepts { @ link prepared operation } as sql and binding { @ link supplier }

generic execute spec sql ( supplier < string > sql supplier ) ; / / static factory methods


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


test behavior when the named analysis component isn ' t defined on the index in that case we should build with defaults

public void test no index analyzers ( ) throws i o exception { / / refer to an analyzer by its type so we get its default configuration analyze action request request = new analyze action request ( ) ; request text ( " the quick brown fox " ) ; request analyzer ( " standard " ) ; analyze action response analyze = transport analyze action analyze ( request , registry , null , max token count ) ; list < analyze action analyze token > tokens = analyze get tokens ( ) ; assert equals ( 4 , tokens size ( ) ) ; / / we can refer to a pre - configured token filter by its name to get it request = new analyze action request ( ) ; request text ( " the qu 1ck brown fox " ) ; request tokenizer ( " standard " ) ; request add char filter ( " append " ) ; / / < - - no config , so use preconfigured filter analyze = transport analyze action analyze ( request , registry , null , max token count ) ; tokens = analyze get tokens ( ) ; assert equals ( 4 , tokens size ( ) ) ; assert equals ( " the " , tokens get ( 0 ) get term ( ) ) ; assert equals ( " qu 1ck " , tokens get ( 1 ) get term ( ) ) ; assert equals ( " brown " , tokens get ( 2 ) get term ( ) ) ; assert equals ( " foxfoo " , tokens get ( 3 ) get term ( ) ) ; / / if the preconfigured filter doesn ' t exist , we use a global filter with no settings request = new analyze action request ( ) ; request text ( " the qu 1ck brown fox " ) ; request tokenizer ( " standard " ) ; request add token filter ( " mock " ) ; / / < - - not preconfigured , but a global one available analyze = transport analyze action analyze ( request , registry , null , max token count ) ; tokens = analyze get tokens ( ) ; assert equals ( 3 , tokens size ( ) ) ; assert equals ( " qu 1ck " , tokens get ( 0 ) get term ( ) ) ; assert equals ( " brown " , tokens get ( 1 ) get term ( ) ) ; assert equals ( " fox " , tokens get ( 2 ) get term ( ) ) ; / / we can build a new char filter to get default values request = new analyze action request ( ) ; request text ( " the qu 1ck brown fox " ) ; request tokenizer ( " standard " ) ; request add token filter ( map of ( " type " , " mock " , " stopword " , " brown " ) ) ; request add char filter ( map of ( " type " , " append " ) ) ; / / < - - basic config , uses defaults analyze = transport analyze action analyze ( request , registry , null , max token count ) ; tokens = analyze get tokens ( ) ; assert equals ( 3 , tokens size ( ) ) ; assert equals ( " the " , tokens get ( 0 ) get term ( ) ) ; assert equals ( " qu 1ck " , tokens get ( 1 ) get term ( ) ) ; assert equals ( " foxbar " , tokens get ( 2 ) get term ( ) ) ; / / we can pass a new configuration request = new analyze action request ( ) ; request text ( " the qu 1ck brown fox " ) ; request tokenizer ( " standard " ) ; request add token filter ( map of ( " type " , " mock " , " stopword " , " brown " ) ) ; request add char filter ( map of ( " type " , " append " , " suffix " , " baz " ) ) ; analyze = transport analyze action analyze ( request , registry , null , max token count ) ; tokens = analyze get tokens ( ) ; assert equals ( 3 , tokens size ( ) ) ; assert equals ( " the " , tokens get ( 0 ) get term ( ) ) ; assert equals ( " qu 1ck " , tokens get ( 1 ) get term ( ) ) ; assert equals ( " foxbaz " , tokens get ( 2 ) get term ( ) ) ; }


to test enum parameters to test enum parameters

public void test enum parameters test ( ) throws exception { list < string > enum header string array = cache get objects ( " / test enum parameters / enum header string array " , string class ) ; string enum header string = cache get string ( " / test enum parameters / enum header string " ) ; list < string > enum query string array = cache get objects ( " / test enum parameters / enum query string array " , string class ) ; string enum query string = cache get string ( " / test enum parameters / enum query string " ) ; integer enum query integer = cache get int ( " / test enum parameters / enum query integer " ) ; double enum query double = cache get double ( " / test enum parameters / enum query double " ) ; list < string > enum form string array = cache get objects ( " / test enum parameters / enum form string array " , string class ) ; string enum form string = cache get string ( " / test enum parameters / enum form string " ) ; api test enum parameters ( enum header string array , enum header string , enum query string array , enum query string , enum query integer , enum query double , enum form string array , enum form string ) ; }


returns the index of the last appearance of the value { @ code target } in { @ code array }

public static int last index of ( int [ ] array , int target ) { return last index of ( array , target , 0 , array length ) ; }


formats a string to the equate error format given the value used for rendering formatted equates that do not point back to a datatype

public static string format name for equate error ( long equate value ) { return " 0x " + long to string ( equate value , 16 ) + " " + equate manager error tag ; }


get fakejson form data : test json serialization of form data

default response entity < void > test json form data ( @ api param ( value = " field 1 " , required = true ) @ valid @ request part ( value = " param " , required = true ) string param , @ api param ( value = " field 2 " , required = true ) @ valid @ request part ( value = " param 2 " , required = true ) string param 2 ) { return new response entity < > ( http status not implemented ) ; }


returns the defined data after the specified address or null if no data exists

public final data get data after ( address address ) { return current program get listing ( ) get defined data after ( address ) ; }


an expectation for checking number of web elements with given locator being less than defined number

public static expected condition < list < web element > > number of elements to be less than ( final by locator , final integer number ) { return new expected condition < list < web element > > ( ) { private integer current number = 0 ; @ override public list < web element > apply ( web driver web driver ) { list < web element > elements = web driver find elements ( locator ) ; current number = elements size ( ) ; return current number < number ? elements : null ; } @ override public string to string ( ) { return string format ( " number of elements found by % s to be less than \ " % s \ " current number : \ " % s \ " " , locator , number , current number ) ; } } ; }


public node < k , v > last ( ) { node < k , v > node = this ; node < k , v > child = node right ; while ( child ! = null ) { node = child ; child = node right ; } return node ; }


test negative scenarios with create overwrite = false as default with create overwrite = true ending in 3 calls : a create overwrite = false b gfs c create overwrite = true scn 1 : a fails with http409 , leading to b which fails with http404 , detect parallel access scn 2 : a fails with http409 , leading to b which fails with http500 , fail create with http500 scn 3 : a fails with http409 , leading to b and then c , which fails with http412 , detect parallel access scn 4 : a fails with http409 , leading to b and then c , which fails with http500 , fail create with http500 scn 5 : a fails with http500 , fail create with http500

public void test negative scenarios for create overwrite disabled ( ) throws throwable { final azure blob file system current fs = get file system ( ) ; configuration config = new configuration ( this get raw configuration ( ) ) ; config set ( " fs azure enable conditional create overwrite " , boolean to string ( true ) ) ; final azure blob file system fs = ( azure blob file system ) file system new instance ( current fs get uri ( ) , config ) ; / / get mock abfs client with current config abfs client mock client = test abfs client get mock abfs client ( fs get abfs store ( ) get client ( ) , fs get abfs store ( ) get abfs configuration ( ) ) ; azure blob file system store abfs store = fs get abfs store ( ) ; abfs store = set azure blob system store field ( abfs store , " client " , mock client ) ; boolean is namespace enabled = abfs store get is namespace enabled ( ) ; abfs rest operation success op = mock ( abfs rest operation class ) ; abfs http operation http 2 0 0 op = mock ( abfs http operation class ) ; when ( http 2 0 0 op get status code ( ) ) then return ( http ok ) ; when ( success op get result ( ) ) then return ( http 2 0 0 op ) ; abfs rest operation exception conflict response ex = get mock abfs rest operation exception ( http conflict ) ; abfs rest operation exception server error response ex = get mock abfs rest operation exception ( http internal error ) ; abfs rest operation exception file not found response ex = get mock abfs rest operation exception ( http not found ) ; abfs rest operation exception pre condition response ex = get mock abfs rest operation exception ( http precon failed ) ; / / mock for overwrite = false do throw ( conflict response ex ) / / scn 1 : gfs fails with http 4 0 4 do throw ( conflict response ex ) / / scn 2 : gfs fails with http 5 0 0 do throw ( conflict response ex ) / / scn 3 : create overwrite = true fails with http 4 1 2 do throw ( conflict response ex ) / / scn 4 : create overwrite = true fails with http 5 0 0 do throw ( server error response ex ) / / scn 5 : create overwrite = false fails with http 5 0 0 when ( mock client ) create path ( any ( string class ) , eq ( true ) , eq ( false ) , is namespace enabled ? any ( string class ) : eq ( null ) , is namespace enabled ? any ( string class ) : eq ( null ) , any ( boolean class ) , eq ( null ) ) ; do throw ( file not found response ex ) / / scn 1 : gfs fails with http 4 0 4 do throw ( server error response ex ) / / scn 2 : gfs fails with http 5 0 0 do return ( success op ) / / scn 3 : create overwrite = true fails with http 4 1 2 do return ( success op ) / / scn 4 : create overwrite = true fails with http 5 0 0 when ( mock client ) get path status ( any ( string class ) , eq ( false ) ) ; / / mock for overwrite = true do throw ( pre condition response ex ) / / scn 3 : create overwrite = true fails with http 4 1 2 do throw ( server error response ex ) / / scn 4 : create overwrite = true fails with http 5 0 0 when ( mock client ) create path ( any ( string class ) , eq ( true ) , eq ( true ) , is namespace enabled ? any ( string class ) : eq ( null ) , is namespace enabled ? any ( string class ) : eq ( null ) , any ( boolean class ) , eq ( null ) ) ; / / scn 1 : gfs fails with http 4 0 4 / / sequence of events expected : / / 1 create overwrite = false - fail with conflict / / 2 gfs - fail with file not found / / create will fail with concurrent write operation detected exception validate create file exception ( concurrent write operation detected exception class , abfs store ) ; / / scn 2 : gfs fails with http 5 0 0 / / sequence of events expected : / / 1 create overwrite = false - fail with conflict / / 2 gfs - fail with server error / / create will fail with 500 validate create file exception ( abfs rest operation exception class , abfs store ) ; / / scn 3 : create overwrite = true fails with http 4 1 2 / / sequence of events expected : / / 1 create overwrite = false - fail with conflict / / 2 gfs - pass / / 3 create overwrite = true - fail with pre - condition / / create will fail with concurrent write operation detected exception validate create file exception ( concurrent write operation detected exception class , abfs store ) ; / / scn 4 : create overwrite = true fails with http 5 0 0 / / sequence of events expected : / / 1 create overwrite = false - fail with conflict / / 2 gfs - pass / / 3 create overwrite = true - fail with server error / / create will fail with 500 validate create file exception ( abfs rest operation exception class , abfs store ) ; / / scn 5 : create overwrite = false fails with http 5 0 0 / / sequence of events expected : / / 1 create overwrite = false - fail with server error / / create will fail with 500 validate create file exception ( abfs rest operation exception class , abfs store ) ; }


public data set < vertex < kt , vvt > > get top vertices ( ) { return top vertices ; }


returns the current selection color setting

public final color get selected highlight color ( ) { return selected highlight color ; }


returns { @ code true } if this { @ link request } is equivalent to the given { @ link request } ( has all of the same options and sizes ) this method is identical to { @ link object # equals ( object ) } except that it ' s specific to { @ link request } subclasses we do not use { @ link object # equals ( object ) } directly because we track { @ link request } s in collections like { @ link java util set } and it ' s perfectly legitimate to have two different { @ link request } objects for two different { @ link com bumptech glide request target target } s ( for example ) using a similar but different method let ' s us selectively compare { @ link request } objects to each other when it ' s useful in specific scenarios

boolean is equivalent to ( request other ) ;


gets the minimum row index that is selected or - 1 if no index is selected

public int get min index selected ( ) { if ( ! selection is empty ( ) ) { field range field range = selection get field range ( 0 ) ; return field range get start ( ) get index ( ) int value ( ) ; } return - 1 ; }


returns an argument matcher for { @ link timeline } instances that ignores period and window uids

private static argument matcher < timeline > no uid ( timeline timeline ) { return new argument matcher < timeline > ( ) { @ override public boolean matches ( timeline argument ) { return new no uid timeline ( timeline ) equals ( new no uid timeline ( argument ) ) ; } } ; }


return the current value of the modification number which counts the number of changes this attribute has undergone

public long get modification number ( ) { return modification number ; }


convenience method to create a variable matcher which matches against the username

public static mapping rule matcher create user matcher ( string user name ) { return new variable matcher ( " % user " , user name ) ; }


public void flush undo logs ( connection proxy cp ) throws s q l exception { connection context connection context = cp get context ( ) ; if ( ! connection context has undo log ( ) ) { return ; } string xid = connection context get xid ( ) ; long branch id = connection context get branch id ( ) ; branch undo log branch undo log = new branch undo log ( ) ; branch undo log set xid ( xid ) ; branch undo log set branch id ( branch id ) ; branch undo log set sql undo logs ( connection context get undo items ( ) ) ; undo log parser parser = undo log parser factory get instance ( ) ; byte [ ] undo log content = parser encode ( branch undo log ) ; compressor type compressor type = compressor type none ; if ( need compress ( undo log content ) ) { compressor type = rollback info compress type ; undo log content = compressor factory get compressor ( compressor type get code ( ) ) compress ( undo log content ) ; } if ( logger is debug enabled ( ) ) { logger debug ( " flushing undo log : { } " , new string ( undo log content , constants default charset ) ) ; } insert undo log with normal ( xid , branch id , build context ( parser get name ( ) , compressor type ) , undo log content , cp get target connection ( ) ) ; }


returns true if the resource is released in time

boolean await released ( long duration , time unit time unit ) throws interrupted exception ;


sets the text of the text field at the given index

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


returns true , if the aggregator value is zero , false otherwise

public boolean is converged ( int iteration , long value value ) { return value get value ( ) = = 0 ; }


test storage move blocks while under replication block tasks exists in the system so , both will share the max transfer streams 1 create cluster with 3 datanode 2 create 20 files with 2 replica 3 start 2 more d ns with disk & ssd types 4 set replication factor for the 1st 10 files to 4 to trigger replica task 5 set policy to ssd to the 2nd set of files from 11 - 20 6 call sps for 11 - 20 files to trigger move block tasks to new d ns 7 wait for the under replica and sps tasks completion

public void test move blocks with under replicated blocks ( ) throws exception { try { config set int ( d f s config keys dfs namenode replication max streams key , 3 ) ; config set long ( " dfs block size " , default block size ) ; config set ( d f s config keys dfs storage policy satisfier recheck timeout millis key , " 3000 " ) ; config set ( d f s config keys dfs storage policy satisfier self retry timeout millis key , " 5000 " ) ; storage type [ ] [ ] storagetypes = new storage type [ ] [ ] { { storage type archive , storage type disk } , { storage type archive , storage type disk } } ; hdfs cluster = start cluster ( config , storagetypes , 2 , 2 , capacity ) ; hdfs cluster wait active ( ) ; dfs = hdfs cluster get file system ( ) ; / / below files will be used for pending replication block tasks for ( int i = 1 ; i < = 20 ; i + + ) { path file path = new path ( " / file " + i ) ; d f s test util create file ( dfs , file path , default block size * 5 , ( short ) 2 , 0 ) ; } storage type [ ] [ ] newtypes = new storage type [ ] [ ] { { storage type disk , storage type ssd } , { storage type disk , storage type ssd } } ; start additional d ns ( config , 2 , num of datanodes , newtypes , storages per datanode , capacity , hdfs cluster ) ; / / increase replication factor to 4 for the first 10 files and thus / / initiate replica tasks for ( int i = 1 ; i < = 10 ; i + + ) { path file path = new path ( " / file " + i ) ; dfs set replication ( file path , ( short ) 4 ) ; } / / invoke sps for 11 - 20 files for ( int i = 11 ; i < = 20 ; i + + ) { path file path = new path ( " / file " + i ) ; dfs set storage policy ( file path , " all ssd " ) ; dfs satisfy storage policy ( file path ) ; } for ( int i = 1 ; i < = 10 ; i + + ) { path file path = new path ( " / file " + i ) ; d f s test util wait expected storage type ( file path to string ( ) , storage type disk , 4 , 60000 , hdfs cluster get file system ( ) ) ; } for ( int i = 11 ; i < = 20 ; i + + ) { path file path = new path ( " / file " + i ) ; d f s test util wait expected storage type ( file path to string ( ) , storage type ssd , 2 , 30000 , hdfs cluster get file system ( ) ) ; } } finally { shutdown cluster ( ) ; } }


sets the parallelism for this sink the degree must be higher than zero

public data stream sink < t > set parallelism ( int parallelism ) { transformation set parallelism ( parallelism ) ; return this ; }


returns all tracked executions for the given host

map < execution attempt i d , execution deployment state > get executions on ( resource i d host ) ;


return the list of supported content types in cases when the content - type header is parsed but not supported , or an empty list otherwise

public list < media type > get supported media types ( ) { return this supported media types ; }


get the value of the < code > name < code > if the key is deprecated , it returns the value of the first key which replaces the deprecated key and is not null if no such property exists , then < code > default value < code > is returned

public string get ( string name , string default value ) { string [ ] names = handle deprecation ( deprecation context get ( ) , name ) ; string result = null ; for ( string n : names ) { result = substitute vars ( get props ( ) get property ( n , default value ) ) ; } return result ; }


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


sets the maximum loop count for a write operation until { @ link writable byte channel # write ( byte buffer ) } returns a non - zero value it is similar to what a spin lock is used for in concurrency programming it improves memory utilization and write throughput depending on the platform that jvm runs on the default value is { @ code 16 }

channel config set write spin count ( int write spin count ) ;


returns true if the request contains conditions that save the server from sending a response that the client has locally when the caller adds conditions , this cache won ' t participate in the request

public boolean has conditions ( ) { return if modified since ! = null | | if none match ! = null ; }


< code > optional string prefix = 1 ; < code >

private void set prefix bytes ( com google protobuf byte string value ) { if ( value = = null ) { throw new null pointer exception ( ) ; } bit field 0 | = 0x 0 0 0 0 0 0 0 1 ; prefix = value to string utf 8 ( ) ; }


public static string sha base 6 4 ( final string salt , final string data , final string separator , final boolean chunked ) { val result = raw digest ( message digest algorithms sha 1 , salt , optional of nullable ( separator ) map ( s - > data + s ) or else ( data ) ) ; return encoding utils encode base 6 4 ( result , chunked ) ; }


converts a unix timestamp into a 32 - bit dos timestamp

static int unix to dos time ( long time millis ) { calendar time = calendar get instance ( ) ; time set time in millis ( time millis ) ; if ( ! is valid in dos ( time millis ) ) { date format df = new simple date format ( " yyyy - mm - dd hh : mm : ss " ) ; throw new illegal argument exception ( string format ( " % s is not representable in the dos time " + " format it must be in the range % s to % s " , df format ( time get time ( ) ) , df format ( new date ( dos epoch ) ) , df format ( new date ( max dos date ) ) ) ) ; } int dos = time get ( calendar second ) / 2 ; dos | = time get ( calendar minute ) < < dos minute offset ; dos | = time get ( calendar hour of day ) < < dos hour offset ; dos | = time get ( calendar day of month ) < < dos day offset ; dos | = ( time get ( calendar month ) + 1 ) < < dos month offset ; dos | = ( time get ( calendar year ) - 1980 ) < < dos year offset ; return dos ; }


test ( de ) serialization on all previous released versions

public void test serialization b w c ( ) throws i o exception { for ( version version : version utils all released versions ( ) ) { has child query builder test query = create test query builder ( ) ; assert serialization ( test query , version ) ; } }


public static void write schema ( csvout out ) throws i o exception { out write ( " id " , " starttime " , " success " , " started " , " ended " , " duration " , " error " ) newline ( ) ; }


handle an inbound request the response will be returned through { @ link raft request inbound # completion }

public void handle ( raft request inbound request ) { message queue add ( objects require non null ( request ) ) ; }


public void set gmt create ( date gmt create ) { this gmt create = gmt create ; }


public static repository adapter get server repository ( string host , int port , string repository name , boolean create if needed ) throws duplicate name exception { repository server adapter repository server = client util get repository server ( host , port , true ) ; if ( ! repository server is connected ( ) ) { return null ; } try { boolean exists = false ; for ( string name : repository server get repository names ( ) ) { if ( name equals ( repository name ) ) { exists = true ; break ; } } if ( exists ) { return repository server get repository ( repository name ) ; } return repository server create repository ( repository name ) ; } catch ( not connected exception e ) { msg error ( ghidra project class , " unexpected exception getting server repository " , e ) ; } catch ( i o exception e ) { client util handle exception ( null , e , " get repository " , false , null ) ; } return null ; }


post fake { pet id } upload image with required file

public model api response execute as ( function < response , response > handler ) { type ref < model api response > type = new type ref < model api response > ( ) { } ; return execute ( handler ) as ( type ) ; }


configure the bean instance subclasses can override this to provide custom configuration logic typically called by an aspect , for all bean instances matched by a pointcut

public void configure bean ( object bean instance ) { if ( this bean factory = = null ) { if ( logger is debug enabled ( ) ) { logger debug ( " bean factory has not been set on " + class utils get short name ( get class ( ) ) + " : " + " make sure this configurer runs in a spring container unable to configure bean of type [ " + class utils get descriptive type ( bean instance ) + " ] proceeding without injection " ) ; } return ; } bean wiring info resolver bwi resolver = this bean wiring info resolver ; assert state ( bwi resolver ! = null , " no bean wiring info resolver available " ) ; bean wiring info bwi = bwi resolver resolve wiring info ( bean instance ) ; if ( bwi = = null ) { / / skip the bean if no wiring info given return ; } configurable listable bean factory bean factory = this bean factory ; assert state ( bean factory ! = null , " no bean factory available " ) ; try { string bean name = bwi get bean name ( ) ; if ( bwi indicates autowiring ( ) | | ( bwi is default bean name ( ) & & bean name ! = null & & ! bean factory contains bean ( bean name ) ) ) { / / perform autowiring ( also applying standard factory / post - processor callbacks ) bean factory autowire bean properties ( bean instance , bwi get autowire mode ( ) , bwi get dependency check ( ) ) ; bean factory initialize bean ( bean instance , ( bean name ! = null ? bean name : " " ) ) ; } else { / / perform explicit wiring based on the specified bean definition bean factory configure bean ( bean instance , ( bean name ! = null ? bean name : " " ) ) ; } } catch ( bean creation exception ex ) { throwable root cause = ex get most specific cause ( ) ; if ( root cause instanceof bean currently in creation exception ) { bean creation exception bce = ( bean creation exception ) root cause ; string bce bean name = bce get bean name ( ) ; if ( bce bean name ! = null & & bean factory is currently in creation ( bce bean name ) ) { if ( logger is debug enabled ( ) ) { logger debug ( " failed to create target bean ' " + bce get bean name ( ) + " ' while configuring object of type [ " + bean instance get class ( ) get name ( ) + " ] - probably due to a circular reference this is a common startup situation " + " and usually not fatal proceeding without injection original exception : " + ex ) ; } return ; } } throw ex ; } }


{ @ inherit doc } instances of this class compare by identity that is , { @ code x equals ( y ) } is only true if { @ code x = = y }

public boolean equals ( object other ) { return ( this = = other ) ; }


a more like this query that finds documents that are " like " the provided texts or documents which is checked against the " all " field

public static more like this query builder more like this query ( string [ ] like texts , item [ ] like items ) { return more like this query ( null , like texts , like items ) ; }


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


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


accepts a { @ link value and closer } for the last step in a { @ link closing future } pipeline

void accept ( value and closer < v > value and closer ) ;


public socket address get sender ( ) { return sender ; }


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


public static string url encode ( final string value ) { return url encode ( value , standard charsets utf 8 name ( ) ) ; }


adds the given tagaddress combo to the global conflict list

private void add to conflicts ( address addr , function tag tag ) { if ( conflict map get ( addr ) = = null ) { conflict map put ( addr , new array list < > ( ) ) ; } list < long > id list = conflict map get ( addr ) ; id list add ( tag get id ( ) ) ; conflict map put ( addr , id list ) ; }


performs base 6 4 encoding on the < code > raw < code > byte buffer , writing it to the < code > encoded < code > byte buffer this is an experimental feature currently it does not pass along any options ( such as { @ link # do break lines } or { @ link # gzip }

public static void encode ( java nio byte buffer raw , java nio byte buffer encoded ) { byte [ ] raw 3 = new byte [ 3 ] ; byte [ ] enc 4 = new byte [ 4 ] ; while ( raw has remaining ( ) ) { int rem = math min ( 3 , raw remaining ( ) ) ; raw get ( raw 3 , 0 , rem ) ; base 6 4 encode 3to 4 ( enc 4 , raw 3 , rem , base 6 4 no options ) ; encoded put ( enc 4 ) ; } / / end input remaining }


private static placement rule create rule ( element element ) throws allocation configuration exception { string rule name = element get attribute ( " name " ) ; if ( " " equals ( rule name ) ) { throw new allocation configuration exception ( " no name provided for a " + " rule element " ) ; } class < ? extends placement rule > rule class = null ; if ( rules contains key ( rule name ) ) { rule class = rules get ( rule name ) rule class ; } if ( rule class = = null ) { throw new allocation configuration exception ( " no rule class found for " + rule name ) ; } return get placement rule ( rule class , element ) ; }


private static void run ( string [ ] args ) { distance field generator generator = new distance field generator ( ) ; string input file = null ; string output file = null ; int i = 0 ; try { for ( ; i < args length ; + + i ) { string arg = args [ i ] ; if ( arg starts with ( " - " ) ) { if ( " - - help " equals ( arg ) ) { usage ( ) ; system exit ( 0 ) ; } else if ( " - - color " equals ( arg ) ) { + + i ; generator set color ( new color ( integer parse int ( args [ i ] , 16 ) ) ) ; } else if ( " - - downscale " equals ( arg ) ) { + + i ; generator set downscale ( integer parse int ( args [ i ] ) ) ; } else if ( " - - spread " equals ( arg ) ) { + + i ; generator set spread ( float parse float ( args [ i ] ) ) ; } else { throw new command line argument exception ( " unknown option " + arg ) ; } } else { if ( input file = = null ) { input file = arg ; } else if ( output file = = null ) { output file = arg ; } else { throw new command line argument exception ( " exactly two file names are expected " ) ; } } } } catch ( index out of bounds exception e ) { throw new command line argument exception ( " option " + args [ args length - 1 ] + " requires an argument " ) ; } catch ( number format exception e ) { throw new command line argument exception ( args [ i ] + " is not a number " ) ; } if ( input file = = null ) { throw new command line argument exception ( " no input file specified " ) ; } if ( output file = = null ) { throw new command line argument exception ( " no output file specified " ) ; } string output format = output file substring ( output file last index of ( ' ' ) + 1 ) ; boolean exists ; if ( ! image i o get image writers by format name ( output format ) has next ( ) ) { throw new runtime exception ( " no image writers found that can handle the format ' " + output format + " ' " ) ; } buffered image input = null ; try { input = image i o read ( new file ( input file ) ) ; } catch ( i o exception e ) { system err println ( " failed to load image : " + e get message ( ) ) ; } buffered image output = generator generate distance field ( input ) ; try { image i o write ( output , output format , new file ( output file ) ) ; } catch ( i o exception e ) { system err println ( " failed to write output image : " + e get message ( ) ) ; } }


copies the file from a single state handle to the given path

private void download data for state handle ( path restore file path , stream state handle remote file handle , closeable registry closeable registry ) throws i o exception { f s data input stream input stream = null ; output stream output stream = null ; try { input stream = remote file handle open input stream ( ) ; closeable registry register closeable ( input stream ) ; files create directories ( restore file path get parent ( ) ) ; output stream = files new output stream ( restore file path ) ; closeable registry register closeable ( output stream ) ; byte [ ] buffer = new byte [ 8 * 1024 ] ; while ( true ) { int num bytes = input stream read ( buffer ) ; if ( num bytes = = - 1 ) { break ; } output stream write ( buffer , 0 , num bytes ) ; } } finally { if ( closeable registry unregister closeable ( input stream ) ) { input stream close ( ) ; } if ( closeable registry unregister closeable ( output stream ) ) { output stream close ( ) ; } } }


returns the minimum of the two values if the values compare as 0 , the first is returned the recommended solution for finding the { @ code minimum } of some values depends on the type of your data and the number of elements you have read more in the guava user guide article on < a href = " https : github comgoogleguavawiki collection utilities explained # comparators " > { @ code comparators }

public static < t extends comparable < ? super t > > t min ( t a , t b ) { return ( a compare to ( b ) < = 0 ) ? a : b ; }


this method needs to be overwritten to contain the main work logic it takes the role of { @ link thread # run ( ) } , but should propagate exceptions


public synchronized void set ( final string host name ) { logger trace ( " reverse d n s - - found host name : [ { } ] " , host name ) ; this host name = host name ; }


some exceptions ( { @ link retriable exception } and { @ link standby exception } ) that are wrapped as a cause of parameter e are unwrapped so that they can be sent as the true cause to the client side in case of { @ link invalid token } we go one level deeper to get the true cause

private throwable get true cause ( i o exception e ) { throwable cause = e ; while ( cause ! = null ) { if ( cause instanceof retriable exception ) { return cause ; } else if ( cause instanceof standby exception ) { return cause ; } else if ( cause instanceof invalid token ) { / / fixme : hadoop method signatures are restricting the sasl / / callbacks to only returning invalid token , but some services / / need to throw other exceptions ( ex nn + standy exception ) , / / so for now we ' ll tunnel the real exceptions via an / / invalid token ' s cause which normally is not set if ( cause get cause ( ) ! = null ) { cause = cause get cause ( ) ; } return cause ; } cause = cause get cause ( ) ; } return e ; }


determine if an valid entry for the key exists in the staging area

public synchronized boolean contains key ( cache key key ) { preconditions check not null ( key ) ; if ( ! m map contains key ( key ) ) { return false ; } encoded image stored encoded image = m map get ( key ) ; synchronized ( stored encoded image ) { if ( ! encoded image is valid ( stored encoded image ) ) { / / reference is not valid , this means that someone cleared reference while it was still in / / use log error / / todo : 3697790 m map remove ( key ) ; f log w ( tag , " found closed reference % d for key % s ( % d ) " , system identity hash code ( stored encoded image ) , key get uri string ( ) , system identity hash code ( key ) ) ; return false ; } return true ; } }


public static void socket await ( final socket u d t socket , final status u d t status array ) throws exception { while ( true ) { for ( final status u d t status : status array ) { if ( socket status ( ) = = status ) { return ; } else { thread sleep ( 50 ) ; } } } }


public static string get branch ( ) { return yarn version info get branch ( ) ; }


delete files before { @ code min address }

public void truncate by min address ( final long min address ) { if ( ! is ext addr ( min address ) ) { return ; } log info ( " truncate consume queue ext by min { } " , min address ) ; list < mapped file > will remove files = new array list < mapped file > ( ) ; list < mapped file > mapped files = this mapped file queue get mapped files ( ) ; final long real offset = un decorate ( min address ) ; for ( mapped file file : mapped files ) { long file tail offset = file get file from offset ( ) + this mapped file size ; if ( file tail offset < real offset ) { log info ( " destroy consume queue ext by min : file = { } , file tail offset = { } , min offset = { } " , file get file name ( ) , file tail offset , real offset ) ; if ( file destroy ( 1000 ) ) { will remove files add ( file ) ; } } } this mapped file queue delete expired file ( will remove files ) ; }


recursively visit calls that take the structure pointer as a parameter add any new references to the offset to data type map

private void push into calls ( ) { address set done set = new address set ( ) ; while ( address to call input map size ( ) > 0 ) { current call depth + = 1 ; if ( current call depth > max call depth ) { return ; } hash map < address , address > saved list = address to call input map ; address to call input map = new hash map < > ( ) ; set < address > keys = saved list key set ( ) ; iterator < address > key iter = keys iterator ( ) ; while ( key iter has next ( ) ) { address addr = key iter next ( ) ; if ( done set contains ( addr ) ) { continue ; } done set add range ( addr , addr ) ; function func = current program get function manager ( ) get function at ( addr ) ; address storage addr = saved list get ( addr ) ; high variable param high var = compute high variable ( storage addr , func ) ; if ( param high var ! = null ) { fill out structure def ( param high var ) ; } } } }


unmarshals the given graph to the given x stream hierarchical stream writer converts exceptions using { @ link # convert x stream exception }

private object do unmarshal ( hierarchical stream reader stream reader , @ nullable data holder data holder ) { try { return get x stream ( ) unmarshal ( stream reader , null , data holder ) ; } catch ( exception ex ) { throw convert x stream exception ( ex , false ) ; } }


generate error log entry and bookmark at relocation address where import failed to be applied

public static void mark as error ( program program , address relocation address , long type , string symbol name , string msg , message log log ) { mark as error ( program , relocation address , type + " ( 0x " + long to hex string ( type ) + " ) " , symbol name , msg , log ) ; }


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


required : a list of server specifications < code > repeated istio networking v 1alpha 3 server servers = 1 ; < code >

public builder clear servers ( ) { if ( servers builder = = null ) { servers = java util collections empty list ( ) ; bit field 0 = ( bit field 0 & ~ 0x 0 0 0 0 0 0 0 1 ) ; on changed ( ) ; } else { servers builder clear ( ) ; } return this ; }


load tinker j a rs and add them to the application class loader

public static boolean load tinker ark hot ( final tinker application application , string directory , intent intent result ) { if ( ark hot apk info is empty ( ) ) { share tinker log w ( tag , " there is no apk to load " ) ; return true ; } path class loader class loader = ( path class loader ) tinker ark hot loader class get class loader ( ) ; if ( class loader ! = null ) { share tinker log i ( tag , " classloader : " + class loader to string ( ) ) ; } else { share tinker log e ( tag , " classloader is null " ) ; share intent util set intent return code ( intent result , share constants error load patch version dex classloader null ) ; return false ; } string apk path = directory + " / " + arkhot path + " / " ; array list < file > legal files = new array list < > ( ) ; / / verify merge class n apk if ( is ark hot runing & & ! ark hot apk info is empty ( ) ) { file class n file = null ; class n file = new file ( apk path + share constants arkhot patch name ) ; legal files add ( class n file ) ; } try { / / system class loader adder install apk ( class loader , legal files ) ; } catch ( throwable e ) { share tinker log e ( tag , " install dexes failed " ) ; intent result put extra ( share intent util intent patch exception , e ) ; share intent util set intent return code ( intent result , share constants error load patch version dex load exception ) ; return false ; } return true ; }


private boolean get service was shutdown ( ) { return service was shutdown get ( ) ; }


in this testcase , passed 2 favored nodes data nodes [ 0 ] , data nodes [ 1 ] both favored nodes should be chosen as target for placing replication and then should fall into block placement policy for choosing remaining targets ie third target as local writer rack , forth target on remote rack and fifth on same rack as second

public void test choose excess replica apart from favored nodes ( ) throws exception { datanode storage info [ ] targets ; list < datanode descriptor > expected targets = new array list < datanode descriptor > ( ) ; expected targets add ( data nodes [ 0 ] ) ; expected targets add ( data nodes [ 1 ] ) ; expected targets add ( data nodes [ 2 ] ) ; expected targets add ( data nodes [ 4 ] ) ; expected targets add ( data nodes [ 5 ] ) ; list < datanode descriptor > favoured nodes = new array list < datanode descriptor > ( ) ; favoured nodes add ( data nodes [ 0 ] ) ; favoured nodes add ( data nodes [ 1 ] ) ; targets = choose target ( 5 , data nodes [ 2 ] , null , favoured nodes ) ; assert equals ( targets length , 5 ) ; for ( int i = 0 ; i < targets length ; i + + ) { assert true ( " target should be a part of expected targets " , expected targets contains ( targets [ i ] get datanode descriptor ( ) ) ) ; } }


resolve the class of dubbo service interface

protected class < ? > resolve service interface class ( service rest metadata service rest metadata , class < ? > service type ) { return execute ( service type get class loader ( ) , class loader - > { string service interface = service rest metadata get service interface ( ) ; return for name ( service interface , class loader ) ; } ) ; }


perform a calculation where we should go back after successful login

public static string get from ( ) { string from = null , return value = null ; final stapler request request = stapler get current request ( ) ; / / try to obtain a return point either from the session / / or from the query parameter in this order if ( request ! = null & & request get session ( false ) ! = null ) { from = ( string ) request get session ( ) get attribute ( " from " ) ; } else if ( request ! = null ) { from = request get parameter ( " from " ) ; } / / if entry point was not found , try to deduce it from the request uri / / except pages related to login process if ( from = = null & & request ! = null & & request get request u r i ( ) ! = null & & ! request get request u r i ( ) equals ( " / login error " ) & & ! request get request u r i ( ) equals ( " / login " ) ) { from = request get request u r i ( ) ; } / / if deduced entry point isn ' t deduced yet or the content is a blank value / / use the root web point " / " as a fallback from = string utils default if blank ( from , " / " ) trim ( ) ; / / encode the return value try { return value = java net u r l encoder encode ( from , " utf - 8 " ) ; } catch ( unsupported encoding exception e ) { } / / return encoded value or at least " / " in the case exception occurred during encode ( ) / / or if the encoded content is blank value return string utils is blank ( return value ) ? " / " : return value ; }


private void set local port ( integer local port ) { set ( local port , local port ) ; }


configure the host name verification for this handler this method is introduced only for unit testing and should never be used in production

public void set disable host name verification ( boolean disable host name verification ) { this disable host name verification = disable host name verification ; }


add all configuration options which match the prefix

public int add prefixed conf options ( configuration conf , string prefix ) { int copied = 0 ; for ( map entry < string , string > entry : conf ) { if ( entry get key ( ) starts with ( prefix ) ) { define ( entry get key ( ) , entry get value ( ) ) ; copied + + ; } } return copied ; }


change focus to the parent context if the current context is the top level browsing context , the context remains unchanged see < a href = " https : w 3c github iowebdriver # switch - to - parent - frame " > w3c web driver specification for more details


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


returns the greatest value present in { @ code array }

public static byte max ( byte array ) { check argument ( array length > 0 ) ; byte max = array [ 0 ] ; for ( int i = 1 ; i < array length ; i + + ) { if ( array [ i ] > max ) { max = array [ i ] ; } } return max ; }


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


returns the mask and value for all instructions , combined into one binary string

public string get combined string ( ) { return get all masks ( ) to binary string ( ) ; }


returns a set of hashable resolved artifact result where the { @ link artifact dependency graph hashable resolved artifact result # get dependency type ( ) } and { @ link artifact dependency graph hashable resolved artifact result # is wrapped module ( ) } fields have been setup properly

public static set < atlas dependency graph hashable resolved artifact result > get all artifacts ( @ non null variant scope variant scope , @ non null atlas android artifacts consumed config type consumed config type , @ nullable dependency failure handler dependency failure handler ) { / / fixme change the way we compare dependencies b / 64387392 / / we need to figure out the following : / / - is it an external dependency or a sub - project ? / / - is it an android or a java dependency / / querying for jar type gives us all the dependencies we care about , and we can use this / / to differentiate external vs sub - projects ( to a certain degree ) artifact collection all artifact list = compute artifact list ( variant scope , consumed config type , android artifacts artifact scope all , atlas android artifacts atlas artifact type jar ) ; / / then we can query for manifest that will give us only the android project so that we / / can detect java vs android artifact collection manifest list = compute artifact list ( variant scope , consumed config type , android artifacts artifact scope all , atlas android artifacts atlas artifact type manifest ) ; / / we still need to understand wrapped jars and aars the former is difficult ( tbd ) , but / / the latter can be done by querying for exploded aar if a sub - project is in this list , / / then we need to override the type to be external , rather than sub - project / / this is why we query for scope all / / but we also simply need the exploded a a rs for external android dependencies so that / / studio can access the content artifact collection exploded aar list = compute artifact list ( variant scope , consumed config type , android artifacts artifact scope all , atlas android artifacts atlas artifact type exploded aar ) ; artifact collection exploded awb list = compute artifact list ( variant scope , consumed config type , android artifacts artifact scope all , atlas android artifacts atlas artifact type exploded awb ) ; / / we also need the actual a a rs so that we can get the artifact location and find the source / / location from it artifact collection aar list = compute artifact list ( variant scope , consumed config type , android artifacts artifact scope external , atlas android artifacts atlas artifact type aar ) ; artifact collection awb list = compute artifact list ( variant scope , consumed config type , android artifacts artifact scope external , atlas android artifacts atlas artifact type awb ) ; / / collect dependency resolution failures if ( dependency failure handler ! = null ) { / / compute the name of the configuration dependency failure handler add errors ( variant scope get global scope ( ) get project ( ) get path ( ) + " @ " + variant scope get full variant name ( ) + " / " + consumed config type get name ( ) , all artifact list get failures ( ) ) ; } / / build a list of wrapped aar , and a map of all the exploded - aar artifacts final set < component identifier > wrapper modules = new hash set < > ( ) ; final set < resolved artifact result > exploded aar artifacts = exploded aar list get artifacts ( ) ; final set < resolved artifact result > exploded awb artifacts = exploded awb list get artifacts ( ) ; final map < component identifier , resolved artifact result > exploded aar results = maps new hash map with expected size ( exploded aar artifacts size ( ) ) ; final map < component identifier , resolved artifact result > exploded awb results = maps new hash map with expected size ( exploded awb artifacts size ( ) ) ; for ( resolved artifact result result : exploded aar artifacts ) { final component identifier component identifier = result get id ( ) get component identifier ( ) ; if ( component identifier instanceof project component identifier ) { wrapper modules add ( component identifier ) ; } exploded aar results put ( component identifier , result ) ; } for ( resolved artifact result result : exploded awb artifacts ) { final component identifier component identifier = result get id ( ) get component identifier ( ) ; if ( component identifier instanceof project component identifier ) { wrapper modules add ( component identifier ) ; } exploded awb results put ( component identifier , result ) ; } final set < resolved artifact result > aar artifacts = aar list get artifacts ( ) ; final set < resolved artifact result > awb artifacts = awb list get artifacts ( ) ; final map < component identifier , resolved artifact result > aar results = maps new hash map with expected size ( aar artifacts size ( ) ) ; final map < component identifier , resolved artifact result > awb results = maps new hash map with expected size ( awb artifacts size ( ) ) ; for ( resolved artifact result result : aar artifacts ) { aar results put ( result get id ( ) get component identifier ( ) , result ) ; } for ( resolved artifact result result : awb artifacts ) { awb results put ( result get id ( ) get component identifier ( ) , result ) ; } / / build a list of android dependencies based on them publishing a manifest element final set < resolved artifact result > manifest artifacts = manifest list get artifacts ( ) ; final set < component identifier > manifest ids = sets new hash set with expected size ( manifest artifacts size ( ) ) ; for ( resolved artifact result result : manifest artifacts ) { manifest ids add ( result get id ( ) get component identifier ( ) ) ; } / / build the final list , using the main list augmented with data from the previous lists final set < resolved artifact result > all artifacts = all artifact list get artifacts ( ) ; / / use a linked hash set to keep the artifact order final set < atlas dependency graph hashable resolved artifact result > artifacts = sets new linked hash set with expected size ( all artifacts size ( ) ) ; for ( resolved artifact result artifact : all artifacts ) { final component identifier component identifier = artifact get id ( ) get component identifier ( ) ; / / check if this is a wrapped module boolean is wrapped module = wrapper modules contains ( component identifier ) ; / / check if this is an android external module in this case , we want to use the exploded / / aar as the artifact we depend on rather than just the jar , so we swap out the / / resolved artifact result atlas dependency graph dependency type dependency type = dependency type java ; / / optional result that will point to the artifact ( aar ) when the current result / / is the exploded aar resolved artifact result aar result = null ; if ( manifest ids contains ( component identifier ) ) { dependency type = dependency type android ; / / if it ' s an android dependency , we swap out the manifest result for the exploded / / aar result / / if the exploded aar is null then it ' s a sub - project and we can keep the manifest / / as the library we ' ll create will be a module library which doesn ' t care about / / the artifact file anyway resolved artifact result exploded awb = exploded awb results get ( component identifier ) ; if ( exploded awb ! = null ) { artifact = exploded awb ; dependency type = dependency type awb ; aar result = awb results get ( component identifier ) ; } else { resolved artifact result exploded aar = exploded aar results get ( component identifier ) ; if ( exploded aar ! = null ) { artifact = exploded aar ; aar result = aar results get ( component identifier ) ; } } / / and we need the aar itself ( if it exists ) } artifacts add ( new atlas dependency graph hashable resolved artifact result ( artifact , dependency type , is wrapped module , aar result ) ) ; } return artifacts ; }


sets the position so that the sprite is centered on ( x , y )

public void set center ( float x , float y ) { set position ( x - width / 2 , y - height / 2 ) ; }


returns the { @ link async execution id } of the task

public async execution id get execution id ( ) { return search id ; }


sets the settings and mappings as a single source

public create index request builder set source ( map < string , ? > source ) { request source ( source , logging deprecation handler instance ) ; return this ; }


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


required the hosts associated with the service entry could be a dns name with wildcard prefix 1 the hosts field is used to select matching hosts in virtual services and destination rules 2 for http traffic the http host authority header will be matched against the hosts field 3 for h t t ps or tls traffic containing server name indication ( sni ) , the sni value will be matched against the hosts field note that when resolution is set to type dns and no endpoints are specified , the host field will be used as the dns name of the endpoint to route traffic to < code > repeated string hosts = 1 ; < code >

public builder add all hosts ( java lang iterable < java lang string > values ) { ensure hosts is mutable ( ) ; com google protobuf abstract message lite builder add all ( values , hosts ) ; on changed ( ) ; return this ; }


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


get the path to the { @ code container - executor } binary the path will be absolute

protected string get container executor executable path ( configuration conf ) { string yarn home env var = system getenv ( application constants environment hadoop yarn home key ( ) ) ; file hadoop bin = new file ( yarn home env var , " bin " ) ; string default path = new file ( hadoop bin , " container - executor " ) get absolute path ( ) ; return null = = conf ? default path : conf get ( yarn configuration nm linux container executor path , default path ) ; }


gets the index of all columns matching the specified name

public list < field > resolve fields ( qualified name name ) { return all fields stream ( ) filter ( input - > input can resolve ( name ) ) collect ( to immutable list ( ) ) ; }


return a read - only list with the supported content codings

public list < string > get content codings ( ) { return collections unmodifiable list ( this content codings ) ; }


by default the kafka source is set to run in { @ link boundedness # continuous unbounded } manner and thus never stops until the flink job fails or is canceled to let the kafka source run in { @ link boundedness # bounded } manner and stops at some point , one can set an { @ link offsets initializer } to specify the stopping offsets for each partition when all the partitions have reached their stopping offsets , the kafka source will then exit this method is different from { @ link # set unbounded ( offsets initializer ) } that after setting the stopping offsets with this method , { @ link kafka source # get boundedness ( ) } will return { @ link boundedness # bounded } instead of { @ link boundedness # continuous unbounded } the following { @ link offsets initializer } are commonly used and provided out of the box users can also implement their own { @ link offsets initializer } for custom behaviors { @ link offsets initializer # latest ( ) } - stop at the latest offsets of the partitions when the kafka source starts to run { @ link offsets initializer # committed offsets ( ) } - stops at the committed offsets of the consumer group { @ link offsets initializer # offsets ( map ) } - stops at the specified offsets for each partition { @ link offsets initializer # timestamp ( long ) } - stops at the specified timestamp for each partition the guarantee of setting the stopping timestamp is that no kafka records whose { @ link org apache kafka clients consumer consumer record # timestamp ( ) } is greater than the given stopping timestamp will be consumed however , it is possible that some records whose timestamp is smaller than the specified stopping timestamp are not consumed

public kafka source builder < out > set bounded ( offsets initializer stopping offsets initializer ) { this boundedness = boundedness bounded ; this stopping offsets initializer = stopping offsets initializer ; return this ; }


public clear privileges cache response clear privileges cache ( clear privileges cache request request , request options options ) throws i o exception { return rest high level client perform request and parse entity ( request , security request converters : : clear privileges cache , options , clear privileges cache response : : from x content , empty set ( ) ) ; }


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


create a { @ link replica in pipeline } and add it into the fs dataset

replica create replica in pipeline ( extended block block ) throws i o exception ;


register default methods on interfaces implemented by the configuration class

private void process interfaces ( configuration class config class , source class source class ) throws i o exception { for ( source class ifc : source class get interfaces ( ) ) { set < method metadata > bean methods = retrieve bean method metadata ( ifc ) ; for ( method metadata method metadata : bean methods ) { if ( ! method metadata is abstract ( ) ) { / / a default method or other concrete method on a java 8 + interface config class add bean method ( new bean method ( method metadata , config class ) ) ; } } process interfaces ( config class , ifc ) ; } }


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


public static void set application debug tag true ( file file ) throws androlib exception { if ( file exists ( ) ) { try { document doc = load document ( file ) ; node application = doc get elements by tag name ( " application " ) item ( 0 ) ; / / load attr named node map attr = application get attributes ( ) ; node debug attr = attr get named item ( " android : debuggable " ) ; if ( debug attr = = null ) { debug attr = doc create attribute ( " android : debuggable " ) ; attr set named item ( debug attr ) ; } / / set application : debuggable to ' true debug attr set node value ( " true " ) ; save document ( file , doc ) ; } catch ( s a x exception | parser configuration exception | i o exception | transformer exception ignored ) { } } }


specifies the expected number of nodes in the graph

public value graph builder < n , v > expected node count ( int expected node count ) { this expected node count = optional of ( check non negative ( expected node count ) ) ; return this ; }


like get but does not load the entity if it was not loaded before

public e peek ( int location ) { if ( entities ! = null ) { return entities get ( location ) ; } else { return null ; } }


retrieves and deserializes the nested set contents associated with the given fingerprint we wish to only do one deserialization per fingerprint this is enforced by the { @ link # nested set cache } , which is responsible for returning the actual contents or the canonical future that will contain the results of the deserialization if that future is not owned by the current call of this method , it doesn ' t have to do anything further the return value is either an { @ code object [ ] } or a { @ code listenable future < object [ ] > } , which may be completed with a { @ link missing nested set exception }

object get contents and deserialize ( byte string fingerprint , deserialization context deserialization context ) throws i o exception { settable future < object [ ] > future = settable future create ( ) ; object contents = nested set cache put if absent ( fingerprint , future ) ; if ( contents ! = null ) { return contents ; } listenable future < byte [ ] > retrieved = nested set storage endpoint get ( fingerprint ) ; stopwatch fetch stopwatch = stopwatch create started ( ) ; future set future ( futures transform async ( retrieved , bytes - > { duration fetch duration = fetch stopwatch elapsed ( ) ; if ( fetch from storage logging threshold compare to ( fetch duration ) < 0 ) { logger at info ( ) log ( " nested set fetch took : % dms , size : % d b " , fetch duration to millis ( ) , bytes length ) ; } coded input stream coded in = coded input stream new instance ( bytes ) ; int number of elements = coded in read int 3 2 ( ) ; deserialization context new deserialization context = deserialization context get new memoizing context ( ) ; / / the elements of this list are futures for the deserialized values of these / / nested set contents for direct members , the futures complete immediately and yield / / an object for transitive members ( fingerprints ) , the futures complete with the / / underlying fetch , and yield object [ ] s list < listenable future < ? > > deserialization futures = new array list < > ( ) ; for ( int i = 0 ; i < number of elements ; i + + ) { object deserialized element = new deserialization context deserialize ( coded in ) ; if ( deserialized element instanceof byte string ) { deserialization futures add ( maybe wrap in future ( get contents and deserialize ( ( byte string ) deserialized element , deserialization context ) ) ) ; } else { deserialization futures add ( futures immediate future ( deserialized element ) ) ; } } return futures when all complete ( deserialization futures ) call ( ( ) - > { object [ ] deserialized contents = new object [ deserialization futures size ( ) ] ; for ( int i = 0 ; i < deserialization futures size ( ) ; i + + ) { deserialized contents [ i ] = futures get done ( deserialization futures get ( i ) ) ; } return deserialized contents ; } , executor ) ; } , executor ) ) ; return future ; }


public void test get pos ( ) throws exception { path seek test file path = new path ( this test root dir + " / " + " seek test file " ) ; long file size = 5 * unit mb ; contract test utils generate test file ( this fs , seek test file path , file size , 256 , 255 ) ; log info ( " 5mb file for get pos test has created " ) ; f s data input stream input stream = this fs open ( seek test file path ) ; random random = new random ( ) ; long pos = math abs ( random next long ( ) ) % file size ; input stream seek ( pos ) ; assert true ( " expected position at : " + pos + " , but got : " + input stream get pos ( ) , input stream get pos ( ) = = pos ) ; log info ( " completed get pos tests " ) ; }


when an index is created this method is invoked for each engine plugin engine plugins can inspect the index settings to determine whether or not to provide an engine factory for the given index a plugin that is not overriding the default engine should return { @ link optional # empty ( ) } if multiple plugins return an engine factory for a given index the index will not be created and an { @ link illegal state exception } will be thrown during index creation

optional < engine factory > get engine factory ( index settings index settings ) ;


update queue statistics : used - capacityabsolute - used - capacity by partition non - partitioned max - avail - resource to queue when node partition is null , all partition of used - capacityabsolute - used - capacity will be updated

public static void update queue statistics ( final resource calculator rc , final resource cluster , final abstract c s queue child queue , final r m node labels manager nlm , final string node partition ) { queue capacities queue capacities = child queue get queue capacities ( ) ; resource usage queue resource usage = child queue get queue resource usage ( ) ; if ( node partition = = null ) { for ( string partition : sets union ( queue capacities get node partitions set ( ) , queue resource usage get node partitions set ( ) ) ) { update used capacity ( rc , nlm get resource by label ( partition , cluster ) , partition , child queue ) ; / / update queue metrics w r t node labels / / in queue metrics , null label is handled the same as no label / / this is because queue metrics for partitions are not tracked / / in the future , will have to change this when / if queue metrics / / for partitions also get tracked child queue get metrics ( ) set available resources to queue ( partition , get max available resource to queue partition ( rc , child queue , cluster , partition ) ) ; } } else { update used capacity ( rc , nlm get resource by label ( node partition , cluster ) , node partition , child queue ) ; / / same as above child queue get metrics ( ) set available resources to queue ( node partition , get max available resource to queue partition ( rc , child queue , cluster , node partition ) ) ; } }


find the first { @ link class } in the inheritance hierarchy of the specified { @ code clazz } ( including the specified { @ code clazz } itself ) on which at least one of the specified { @ code annotation types } is directly present if the supplied { @ code clazz } is an interface , only the interface itself will be checked ; the inheritance hierarchy for interfaces will not be traversed meta - annotations will not be searched the standard { @ link class } api does not provide a mechanism for determining which class in an inheritance hierarchy actually declares one of several candidate { @ linkplain annotation annotations } , so we need to handle this explicitly

public static class < ? > find annotation declaring class for types ( list < class < ? extends annotation > > annotation types , @ nullable class < ? > clazz ) { if ( clazz = = null ) { return null ; } return ( class < ? > ) merged annotations from ( clazz , search strategy superclass ) stream ( ) filter ( merged annotation predicates type in ( annotation types ) and ( merged annotation : : is directly present ) ) map ( merged annotation : : get source ) find first ( ) or else ( null ) ; }


return the topic creation groups defined for a source connector as a map of topic creation group name to topic creation group instance this map maintains all the optionally defined groups besides the default group which is defined for any connector when topic creation is enabled

public map < string , topic creation group > topic groups ( ) { return topic groups ; }


reads the entire file using the given charset and returns the contents as a string

public static string read content ( path input file , charset charset ) throws i o exception { return as byte source ( input file ) as char source ( charset ) read ( ) ; }


public int get batch size ( ) { return get search request ( ) source ( ) size ( ) ; }


runs equals and serialization test on the return values test fails if default value cannot be determined for a constructor or factory method parameter , or if the constructor or factory method throws exception

public factory method return value tester test equals and serializable ( ) throws exception { for ( invokable < ? , ? > factory : get factories to test ( ) ) { try { test equals using ( factory ) ; } catch ( factory method returns null exception e ) { / / if the factory returns null , we just skip it } object instance = instantiate ( factory ) ; if ( instance ! = null ) { try { serializable tester reserialize and assert ( instance ) ; } catch ( runtime exception e ) { assertion error error = new assertion failed error ( " serialization failed on return value of " + factory ) ; error init cause ( e get cause ( ) ) ; throw error ; } catch ( assertion failed error e ) { assertion error error = new assertion failed error ( " return value of " + factory + " reserialized to an unequal value " ) ; error init cause ( e ) ; throw error ; } } } return this ; }


called when the user clicks through an ad ( for example , following a ' learn more ' link )


set the erasure coding policy for this entity ( default = null )

public builder ec policy ( erasure coding policy ec policy ) { this ec policy = ec policy ; return this ; }


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


unwrap the source behind this error : possibly an { @ link exception } ( typically { @ link org springframework beans property access exception } ) or a bean validation { @ link javax validation constraint violation } the cause of the outermost exception will be introspected as well , e g the underlying conversion exception or exception thrown from a setter ( instead of having to unwrap the { @ code property access exception } in turn )

public < t > t unwrap ( class < t > source type ) { if ( source type is instance ( this source ) ) { return source type cast ( this source ) ; } else if ( this source instanceof throwable ) { throwable cause = ( ( throwable ) this source ) get cause ( ) ; if ( source type is instance ( cause ) ) { return source type cast ( cause ) ; } } throw new illegal argument exception ( " no source object of the given type available : " + source type ) ; }


set the list of { @ link reservation request } representing the resources required by the application

public abstract void set reservation resources ( list < reservation request > reservation resources ) ;


public integer get integer ( ) { return integer ; }


find an archive file within the ghidra installation if archive has been replaced between ghidra releases , it may be re - mapped to a newer resource file

public static resource file find archive file ( string archive name ) { if ( ! archive name ends with ( file data type manager suffix ) ) { archive name = archive name + file data type manager suffix ; } archive name = archive name replace ( ' \ \ ' , ' / ' ) ; if ( archive name index of ( ' : ' ) > = 0 | | archive name char at ( 0 ) = = ' / ' ) { return null ; } if ( archive name starts with ( relative path prefix ) ) { archive name = archive name substring ( relative path prefix length ( ) ) ; } else { archive name = " / " + archive name ; / / ensure we match on whole path element name } / / relative path starts with " / " for ( resource file file : ghidra archives values ( ) ) { string path = file get absolute path ( ) replace ( ' \ \ ' , ' / ' ) ; / / note : existence check added to facilitate testing if ( path ends with ( archive name ) & & file exists ( ) ) { return file ; } } / / note : recursion could blow - out if circular archive re - mapping defined ( maps should be defined properly ) string remapped relative path = get remapped archive name ( archive name substring ( 1 ) ) ; if ( remapped relative path ! = null ) { return find archive file ( remapped relative path ) ; } return null ; }


return the name of the task to be configured

public string get name ( ) { return scope get task name ( " diff bundle info " ) ; }


returns a { @ link collection } of all the permutations of the specified { @ link iterable } notes : this is an implementation of the algorithm for lexicographical permutations generation , described in knuth ' s " the art of computer programming " , volume 4 , chapter 7 , section 7 2 1 2 the iteration order follows the lexicographical order this means that the first permutation will be in ascending order , and the last will be in descending order duplicate elements are considered equal for example , the list [ 1 , 1 ] will have only one permutation , instead of two this is why the elements have to implement { @ link comparable } an empty iterable has only one permutation , which is an empty list this method is equivalent to { @ code collections 2 ordered permutations ( list , ordering natural ( ) ) }

public static < e extends comparable < ? super e > > collection < list < e > > ordered permutations ( iterable < e > elements ) { return ordered permutations ( elements , ordering natural ( ) ) ; }


public double compute ( ) { if ( value = = null ) value = n limit < = max modular ? compute modular ( ) : compute montgomery ( ) ; return value ; }


collect all tokens on specified channel to the left of the current token up until we see a token on default token channel if channel is - 1 , find any non default channel token

public list < token > get hidden tokens to left ( int token index , int channel ) { lazy init ( ) ; if ( token index < 0 | | token index > = tokens size ( ) ) { throw new index out of bounds exception ( token index + " not in 0 " + ( tokens size ( ) - 1 ) ) ; } if ( token index = = 0 ) { / / obviously no tokens can appear before the first token return null ; } int prev on channel = previous token on channel ( token index - 1 , lexer default token channel ) ; if ( prev on channel = = token index - 1 ) return null ; / / if none onchannel to left , prev on channel = - 1 then from = 0 int from = prev on channel + 1 ; int to = token index - 1 ; return filter for channel ( from , to , channel ) ; }


put yubikey multiple device registration enabled

public static void put yubi key multiple device registration enabled ( final request context request context , final boolean enabled ) { request context get flow scope ( ) put ( " yubikey multiple device registration enabled " , enabled ) ; }


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


delete all { @ link resource skyline } s belonging to given { @ link recurrence id } note that for safety considerations , we only allow users to delete history { @ link resource skyline } s of one job run

void delete history ( recurrence id recurrence id ) throws skyline store exception ;


the f s image contains a string table which maps strings to i ds this is a simple form of compression which takes advantage of the fact that the same strings tend to occur over and over again this function will return an id which we can use to represent the given string if the string already exists in the string table , we will use that id ; otherwise , we will allocate a new one

int register string id ( string str ) throws i o exception { integer id = string table get ( str ) ; if ( id ! = null ) { return id ; } int latest id = latest string id ; if ( latest id > = 0x 1ffffff ) { throw new i o exception ( " cannot have more than 2 * * 25 " + " strings in the fsimage , because of the limitation on " + " the size of string table i ds " ) ; } string table put ( str , latest id ) ; latest string id + + ; return latest id ; }


public string binding diagnostic details ( ) { return " connection = \ " " + connection description + " \ " " + " root = \ " " + registry root + " \ " " + " " + security connection diagnostics ; }


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

public < t > t get request ( class < t > clazz ) { return ( request ! = null & & clazz is assignable from ( request get class ( ) ) ) ? ( t ) request : null ; }


cleanup method invoked by the driver manager when unregistering the driver since this happens typically when the jdbc driver gets unloaded ( from the classloader ) cleaning all debug information is a good safety check

private void close ( ) { debug close ( ) ; }


returns whether or not an open stream was closed


customize the response for async request timeout exception this method delegates to { @ link # handle exception internal }

protected response entity < object > handle async request timeout exception ( async request timeout exception ex , http headers headers , http status status , web request web request ) { if ( web request instanceof servlet web request ) { servlet web request servlet web request = ( servlet web request ) web request ; http servlet response response = servlet web request get response ( ) ; if ( response ! = null & & response is committed ( ) ) { if ( logger is warn enabled ( ) ) { logger warn ( " async request timed out " ) ; } return null ; } } return handle exception internal ( ex , null , headers , status , web request ) ; }


for this test , the body for this request much reference a schema named & # x 6 0 ; file & # x 6 0 ;

public void test body with file schema test ( ) throws api exception { file schema test class body = null ; api test body with file schema ( body ) ; / / todo : test validations }


public void attribute string test ( ) { / / todo : test attribute string }


public void add action ( action action ) { root add action ( action ) ; }


public static intent get launch app intent ( final string pkg name ) { string launcher activity = utils bridge get launcher activity ( pkg name ) ; if ( utils bridge is space ( launcher activity ) ) return null ; intent intent = new intent ( intent action main ) ; intent add category ( intent category launcher ) ; intent set class name ( pkg name , launcher activity ) ; return intent add flags ( intent flag activity new task ) ; }


convert the byte buffer to a string an specific character encoding

public string to string ( string charset name ) throws unsupported encoding exception { return new string ( this get ( ) , 0 , this get count ( ) , charset name ) ; }


singleton placeholder that indicates a value is being loaded

static < k , v > value reference < k , v > unset ( ) { return ( value reference < k , v > ) unset ; }


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


if { @ link # flag override caption descriptors } is set , returns a { @ link list < format > } of { @ link # closed caption formats } if unset , parses the pmt descriptor information and returns a { @ link list < format > } for the declared formats , or { @ link # closed caption formats } if the descriptor is not present

private list < format > get closed caption formats ( es info es info ) { if ( is set ( flag override caption descriptors ) ) { return closed caption formats ; } parsable byte array scratch descriptor data = new parsable byte array ( es info descriptor bytes ) ; list < format > closed caption formats = this closed caption formats ; while ( scratch descriptor data bytes left ( ) > 0 ) { int descriptor tag = scratch descriptor data read unsigned byte ( ) ; int descriptor length = scratch descriptor data read unsigned byte ( ) ; int next descriptor position = scratch descriptor data get position ( ) + descriptor length ; if ( descriptor tag = = descriptor tag caption service ) { / / note : see atsc a / 65 for detailed information about the caption service descriptor closed caption formats = new array list < > ( ) ; int number of services = scratch descriptor data read unsigned byte ( ) & 0x 1 f ; for ( int i = 0 ; i < number of services ; i + + ) { string language = scratch descriptor data read string ( 3 ) ; int caption type byte = scratch descriptor data read unsigned byte ( ) ; boolean is digital = ( caption type byte & 0x 8 0 ) ! = 0 ; string mime type ; int accessibility channel ; if ( is digital ) { mime type = mime types application cea708 ; accessibility channel = caption type byte & 0x 3 f ; } else { mime type = mime types application cea608 ; accessibility channel = 1 ; } / / easy reader ( 1 ) , wide aspect ratio ( 1 ) , reserved ( 6 ) byte flags = ( byte ) scratch descriptor data read unsigned byte ( ) ; / / skip reserved ( 8 ) scratch descriptor data skip bytes ( 1 ) ; @ nullable list < byte [ ] > initialization data = null ; / / the wide aspect ratio flag only has meaning for cea - 708 if ( is digital ) { boolean is wide aspect ratio = ( flags & 0x 4 0 ) ! = 0 ; initialization data = codec specific data util build cea 7 0 8 initialization data ( is wide aspect ratio ) ; } closed caption formats add ( new format builder ( ) set sample mime type ( mime type ) set language ( language ) set accessibility channel ( accessibility channel ) set initialization data ( initialization data ) build ( ) ) ; } } else { / / unknown descriptor ignore } scratch descriptor data set position ( next descriptor position ) ; } return closed caption formats ; }


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


public list < string > get user group ( final authentication authentication , final acceptto multifactor properties acceptto ) { val attributes = authentication get principal ( ) get attributes ( ) ; logger debug ( " current principal attributes are [ { } ] " , attributes ) ; if ( string utils is blank ( acceptto get group attribute ( ) ) | | ! attributes contains key ( acceptto get group attribute ( ) ) ) { return new array list < > ( 0 ) ; } return collection utils to collection ( attributes get ( acceptto get group attribute ( ) ) , array list class ) ; }


apply the x path and assert the { @ link string } value found

public result matcher string ( string expected value ) { return result - > { mock http servlet response response = result get response ( ) ; this xpath helper assert string ( response get content as byte array ( ) , get defined encoding ( response ) , expected value ) ; } ; }


adds an observer to the set of observers for this object , provided that it is not the same as some observer already in the set the order in which notifications will be delivered to multiple observers is not specified see the class comment

public synchronized void add observer ( observer o ) { objects require non null ( o , " observer " ) ; obs add ( o ) ; observer cnt + + ; if ( ! already add observer ) { notify all ( ) ; } already add observer = true ; }


indicates whether or not the local endpoint for this connection is the server


returns the current selection color setting

public final color get selection color ( ) { return selection color ; }


convert stack references from old adapter

private void process old adapter stack refs ( task monitor monitor ) throws i o exception , cancelled exception { if ( old stack ref adapter = = null ) { return ; } address map old addr map = addr map get old address map ( ) ; monitor set message ( " processing old stack references " ) ; monitor initialize ( old stack ref adapter get record count ( ) ) ; int cnt = 0 ; record iterator iter = old stack ref adapter get records ( ) ; while ( iter has next ( ) ) { monitor check canceled ( ) ; d b record rec = iter next ( ) ; address from addr = old addr map decode address ( rec get long value ( old stack ref d b adpater from addr col ) ) ; int op index = rec get short value ( old stack ref d b adpater op index col ) ; boolean user defined = rec get boolean value ( old stack ref d b adpater user defined col ) ; int offset = rec get short value ( old stack ref d b adpater stack offset col ) ; add stack reference ( from addr , op index , offset , ref type read , ( user defined ? source type user defined : source type analysis ) ) ; monitor set progress ( + + cnt ) ; } old stack ref adapter = null ; }


the client listens for configuration changes

public void listener ( http servlet request request , http servlet response response ) throws servlet exception , i o exception { request set attribute ( " org apache catalina async supported " , true ) ; string probe modify = request get parameter ( " listening - configs " ) ; if ( string utils is blank ( probe modify ) ) { throw new illegal argument exception ( " invalid probe modify " ) ; } probe modify = u r l decoder decode ( probe modify , constants encode ) ; map < string , string > client md 5 map ; try { client md 5 map = m d 5 util get client md 5 map ( probe modify ) ; } catch ( throwable e ) { throw new illegal argument exception ( " invalid probe modify " ) ; } / / do long - polling inner do polling config ( request , response , client md 5 map , probe modify length ( ) ) ; }


public static string md 5 file ( string full filename ) { string result = null ; if ( full filename ! = null ) { input stream is = null ; try { is = new buffered input stream ( new file input stream ( full filename ) ) ; result = md 5 file ( is ) ; } catch ( exception e ) { throw new runtime exception ( e ) ; } finally { i o helper close quietly ( is ) ; } } return result ; }


returns a new instance of the module class created using a no - args constructor only used when a manually - constructed module is not supplied

protected t new module ( ) { throw new unsupported operation exception ( " no no - args constructor on " + get class ( ) get name ( ) ) ; }