build call for test query parameter collection format

public okhttp 3 call test query parameter collection format call ( list < string > pipe , list < string > ioutil , list < string > http , list < string > url , list < string > context , final api callback callback ) throws api exception { object local var post body = null ; / / create path and map variables string local var path = " / fake / test - query - paramters " ; list < pair > local var query params = new array list < pair > ( ) ; list < pair > local var collection query params = new array list < pair > ( ) ; map < string , string > local var header params = new hash map < string , string > ( ) ; map < string , string > local var cookie params = new hash map < string , string > ( ) ; map < string , object > local var form params = new hash map < string , object > ( ) ; if ( pipe ! = null ) { local var collection query params add all ( local var api client parameter to pairs ( " csv " , " pipe " , pipe ) ) ; } if ( ioutil ! = null ) { local var collection query params add all ( local var api client parameter to pairs ( " csv " , " ioutil " , ioutil ) ) ; } if ( http ! = null ) { local var collection query params add all ( local var api client parameter to pairs ( " ssv " , " http " , http ) ) ; } if ( url ! = null ) { local var collection query params add all ( local var api client parameter to pairs ( " csv " , " url " , url ) ) ; } if ( context ! = null ) { local var collection query params add all ( local var api client parameter to pairs ( " multi " , " context " , context ) ) ; } final string [ ] local var accepts = { } ; final string local var accept = local var api client select header accept ( local var accepts ) ; if ( local var accept ! = null ) { local var header params put ( " accept " , local var accept ) ; } final string [ ] local var content types = { } ; final string local var content type = local var api client select header content type ( local var content types ) ; local var header params put ( " content - type " , local var content type ) ; string [ ] local var auth names = new string [ ] { } ; return local var api client build call ( local var path , " put " , local var query params , local var collection query params , local var post body , local var header params , local var cookie params , local var form params , local var auth names , callback ) ; }


returns the external package prefix of the given external class name

public static string external package prefix ( string external class name ) { return external class name substring ( 0 , external class name last index of ( java constants package separator , external class name length ( ) - 2 ) + 1 ) ; }


returns the undo stack depth ( the number of items on the undo stack ) this method is for j units

int get undo stack depth ( ) { return undo list size ( ) ; }


gets the list of " line number " entries associated with this instance

public line number list get line numbers ( ) { return line numbers ; }


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

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


returns the audio input stream of a file

public audio input stream get audio stream ( string file path ) throws unsupported audio file exception , i o exception { return audio system get audio input stream ( new file ( file path ) get absolute file ( ) ) ; }


returns whether checkpointing is force - enabled

public boolean is force checkpointing ( ) { return checkpoint cfg is force checkpointing ( ) ; }


enumerate the partitions inside this topics spec

public map < string , partitions spec > materialize ( ) { hash map < string , partitions spec > all = new hash map < > ( ) ; for ( map entry < string , partitions spec > entry : map entry set ( ) ) { string topic name = entry get key ( ) ; partitions spec partitions = entry get value ( ) ; for ( string expanded topic name : string expander expand ( topic name ) ) all put ( expanded topic name , partitions ) ; } return all ; }


deletes the database table used to store this range map

public void dispose ( ) { lock acquire ( ) ; try { if ( range map table ! = null ) { try { db handle delete table ( table name ) ; } catch ( i o exception e ) { err handler db error ( e ) ; } last start = null ; last end = null ; last value = null ; last range = null ; range map table = null ; } } finally { lock release ( ) ; } }


verifies that requests for non - existing ( failedcancelled ) input channels are properly cancelled the receiver receives data , but there is no input channel to receive the data this should cancel the request

public void test cancel partition request ( ) throws exception { netty server and client server and client = null ; try { test pooled buffer provider outbound buffers = new test pooled buffer provider ( 16 ) ; result partition manager partitions = mock ( result partition manager class ) ; result partition i d pid = new result partition i d ( ) ; count down latch sync = new count down latch ( 1 ) ; final result subpartition view view = spy ( new infinite subpartition view ( outbound buffers , sync ) ) ; / / return infinite subpartition when ( partitions create subpartition view ( eq ( pid ) , eq ( 0 ) , any ( buffer availability listener class ) ) ) then answer ( new answer < result subpartition view > ( ) { @ override public result subpartition view answer ( invocation on mock invocation on mock ) throws throwable { buffer availability listener listener = ( buffer availability listener ) invocation on mock get arguments ( ) [ 2 ] ; listener notify data available ( ) ; return view ; } } ) ; netty protocol protocol = new netty protocol ( partitions , mock ( task event dispatcher class ) ) ; server and client = init server and client ( protocol ) ; channel ch = connect ( server and client ) ; / / request for non - existing input channel = > results in cancel request ch write and flush ( new partition request ( pid , 0 , new input channel i d ( ) , integer max value ) ) await ( ) ; / / wait for the notification if ( ! sync await ( testing utils testing duration ( ) to millis ( ) , time unit milliseconds ) ) { fail ( " timed out after waiting for " + testing utils testing duration ( ) to millis ( ) + " ms to be notified about cancelled partition " ) ; } verify ( view , times ( 1 ) ) release all resources ( ) ; } finally { shutdown ( server and client ) ; } }


gets the agent node of the give name , hooked under this jenkins

public @ check for null node get node ( string name ) { return nodes get node ( name ) ; }


if decset 2004 is set , prefix paste with " \ 033 [ 200 ~ " and suffix with " \ 033 [ 201 ~ "

public void paste ( string text ) { / / first : always remove escape key and c1 control characters [ 0x 8 0 , 0x 9 f ] : text = text replace all ( " ( \ u 0 0 1 b | [ \ u 0 0 8 0 - \ u 0 0 9 f ] ) " , " " ) ; / / second : replace all newlines ( \ n ) or crlf ( \ r \ n ) with carriage returns ( \ r ) text = text replace all ( " \ r ? \ n " , " \ r " ) ; / / then : implement bracketed paste mode if enabled : boolean bracketed = is decset internal bit set ( decset bit bracketed paste mode ) ; if ( bracketed ) m session write ( " \ 033 [ 200 ~ " ) ; m session write ( text ) ; if ( bracketed ) m session write ( " \ 033 [ 201 ~ " ) ; }


add a new status item component to the status area the preferred height and border for the component will be altered

void add status item ( j component c , boolean add border , boolean right side ) { j panel p = new status panel ( c , add border ) ; p set name ( c get name ( ) ) ; min height = math max ( min height , p get preferred size ( ) height + status bar gap ) ; if ( right side ) { status area panel add ( p ) ; } else { status area panel add ( p , 0 ) ; } }


if the value is a compound value , this is set < code > optional aapt pb compound value compound value = 5 ; < code >

private void set compound value ( com android aapt resources compound value builder builder for value ) { compound value = builder for value build ( ) ; bit field 0 | = 0x 0 0 0 0 0 0 1 0 ; }


tests the { @ link data type conflict handler # replace empty structs or rename and add handler resoraah } conflict handler to be sure that , if all else is the same , the aligned version is chosen over the unaligned version success is the aligned version is chosen over the unaligned version

public void test choose new aligned over existing unaligned when all else is equal for non empty structures ( ) { / / unaligned exists first structure data type struct 1 unaligned = create populated ( data mgr ) ; composite struct 1 aligned to add = ( composite ) struct 1 unaligned copy ( data mgr ) ; struct 1 aligned to add set internally aligned ( true ) ; string struct 1 unaligned string = struct 1 unaligned to string ( ) ; string struct 1 aligned to add string = struct 1 aligned to add to string ( ) ; structure struct 1 add result = ( structure ) data mgr add data type ( struct 1 aligned to add , data type conflict handler replace empty structs or rename and add handler ) ; string struct 1 add result string = struct 1 add result to string ( ) ; assert equals ( struct 1 aligned to add string , struct 1 add result string ) ; assert not equals ( struct 1 unaligned string , struct 1 add result string ) ; }


returns the { @ link http request } that has been setup by this builder so far after using the request , it should be returned to the pool via { @ code pools free ( request ) }

public http request build ( ) { validate ( ) ; http request request = http request ; http request = null ; return request ; }


test validates that the produced by abstract s 3 file system factory object will contains only first path from multiple paths in config

public void test multiple temp dirs config ( ) throws exception { final configuration conf = new configuration ( ) ; string dir 1 = " / tmp / dir 1 " ; string dir 2 = " / tmp / dir 2 " ; conf set string ( " io tmp dirs " , dir 1 + " , " + dir 2 ) ; test fs factory factory = new test fs factory ( ) ; factory configure ( conf ) ; flink s 3 file system fs = ( flink s 3 file system ) factory create ( new uri ( " s 3 : / / test " ) ) ; assert equals ( fs get local tmp dir ( ) , dir 1 ) ; }


notify the widget that refresh state has changed do not call this when refresh is triggered by a swipe gesture

public void set refreshing ( boolean refreshing ) { if ( m swipe refresh layout ! = null ) m swipe refresh layout set refreshing ( refreshing ) ; }


get the interface class of the dubbo proxy which be generated by javaassist

public static class < ? > get assist interface ( object proxy bean ) throws no such field exception , security exception , illegal argument exception , illegal access exception , no such method exception , invocation target exception { if ( proxy bean = = null ) { return null ; } if ( ! is dubbo proxy name ( proxy bean get class ( ) get name ( ) ) ) { return null ; } field handler field = proxy bean get class ( ) get declared field ( " handler " ) ; handler field set accessible ( true ) ; object invoker invocation handler = handler field get ( proxy bean ) ; field invoker field = invoker invocation handler get class ( ) get declared field ( " invoker " ) ; invoker field set accessible ( true ) ; object invoker = invoker field get ( invoker invocation handler ) ; field failover cluster invoker field = invoker get class ( ) get declared field ( " invoker " ) ; failover cluster invoker field set accessible ( true ) ; object failover cluster invoker = failover cluster invoker field get ( invoker ) ; return ( class < ? > ) reflection util invoke method ( failover cluster invoker , " get interface " ) ; }


creates a { @ link leader retrieval driver factory } implemented by zoo keeper

public static zoo keeper leader retrieval driver factory create leader retrieval driver factory ( final curator framework client , final configuration configuration ) { return create leader retrieval driver factory ( client , configuration , " " ) ; }


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


public static boolean write file from bytes by channel ( final string file path , final byte [ ] bytes , final boolean append , final boolean is force ) { return write file from bytes by channel ( utils bridge get file by path ( file path ) , bytes , append , is force ) ; }


use this method to look up a processor from a string when you want a processor not found exception thrown if the processor isn ' t found < b > < u > warning : < u > < b > use of this method depends upon languages being loaded see { @ link default language service }

public static synchronized processor to processor ( string name ) { initialize ( ) ; processor processor = instances get ( name ) ; if ( processor = = null ) { throw new processor not found exception ( name ) ; } return processor ; }


public static zoned date time convert to zoned date time ( final string value ) { val dt = zoned date time of ( value ) ; if ( dt ! = null ) { return dt ; } val lt = local date time of ( value ) ; return zoned date time of ( lt at zone ( zone offset utc ) ) ; }


public connection get connection ( ) { if ( ! error on connection ) { return new stub connection ( ) ; } throw new runtime exception ( " bad thing happens on datasource " ) ; }


to ticket - granting ticket expiration policy

protected expiration policy to ticket granting ticket expiration policy ( ) { val tgt = cas properties get ticket ( ) get tgt ( ) ; if ( tgt get max time to live in seconds ( ) < = 0 & & tgt get time to kill in seconds ( ) < = 0 ) { logger warn ( " ticket - granting ticket expiration policy is set to never expire tickets " ) ; return never expires expiration policy instance ; } if ( tgt get timeout ( ) get max time to live in seconds ( ) > 0 ) { logger debug ( " ticket - granting ticket expiration policy is based on a timeout of [ { } ] seconds " , tgt get timeout ( ) get max time to live in seconds ( ) ) ; return new timeout expiration policy ( tgt get timeout ( ) get max time to live in seconds ( ) ) ; } if ( tgt get throttled timeout ( ) get time in between uses in seconds ( ) > 0 & & tgt get throttled timeout ( ) get time to kill in seconds ( ) > 0 ) { val p = new throttled use and timeout expiration policy ( ) ; p set time to kill in seconds ( tgt get throttled timeout ( ) get time to kill in seconds ( ) ) ; p set time in between uses in seconds ( tgt get throttled timeout ( ) get time in between uses in seconds ( ) ) ; logger debug ( " ticket - granting ticket expiration policy is based on throttled timeouts " ) ; return p ; } if ( tgt get hard timeout ( ) get time to kill in seconds ( ) > 0 ) { logger debug ( " ticket - granting ticket expiration policy is based on a hard timeout of [ { } ] seconds " , tgt get hard timeout ( ) get time to kill in seconds ( ) ) ; return new hard timeout expiration policy ( tgt get hard timeout ( ) get time to kill in seconds ( ) ) ; } if ( tgt get max time to live in seconds ( ) > 0 & & tgt get time to kill in seconds ( ) > 0 ) { logger debug ( " ticket - granting ticket expiration policy is based on hard / idle timeouts of [ { } ] / [ { } ] seconds " , tgt get max time to live in seconds ( ) , tgt get time to kill in seconds ( ) ) ; return new ticket granting ticket expiration policy ( tgt get max time to live in seconds ( ) , tgt get time to kill in seconds ( ) ) ; } logger warn ( " ticket - granting ticket expiration policy is set to always expire tickets " ) ; return new always expires expiration policy ( ) ; }


public cached thread pool builder set keep alive secs ( int keep alive secs ) { this keep alive secs = keep alive secs ; return this ; }


public list < mime type > get supported mime types ( ) { return collections unmodifiable list ( this supported mime types ) ; }


sets the digest algorithm which is used to calculate a cryptographic digest of the http request body the exact list of supported digest algorithms depends on the installed security providers every implementation of the java platform is required to support " md5 " , " sha - 1 " and " sha - 256 " do not use " md5 " and " sha - 1 " , they are vulnerable to multiple known attacks by default , " sha - 256 " is used

public void set digest algorithm ( string digest algorithm ) { this digest algorithm = digest algorithm ; }


creates the { @ link listenable future } which will return the result of running { @ code combiner } when all futures complete { @ code combiner } will run using { @ code executor } if the combiner throws a { @ code cancellation exception } , the returned future will be cancelled canceling this future will attempt to cancel all the component futures

public listenable future < ? > run ( final runnable combiner , executor executor ) { return call ( new callable < void > ( ) { @ override public void call ( ) throws exception { combiner run ( ) ; return null ; } } , executor ) ; }


public map < string , list < object > > retrieve ( ) { var filter = i person attribute dao filter always choose ( ) ; if ( ! active attribute repository identifiers is empty ( ) ) { val repo ids array = active attribute repository identifiers to array ( array utils empty string array ) ; logger trace ( " active attribute repository identifiers [ { } ] " , active attribute repository identifiers ) ; filter = dao - > arrays stream ( dao get id ( ) ) any match ( dao id - > dao id equals ignore case ( i person attribute dao wildcard ) | | string utils equals any ignore case ( dao id , repo ids array ) | | string utils equals any ignore case ( i person attribute dao wildcard , repo ids array ) ) ; } val query = new hash map < string , object > ( ) ; query put ( " username " , principal id ) ; if ( current principal ! = null ) { query put ( " principal " , current principal get id ( ) ) ; query put all ( current principal get attributes ( ) ) ; } query put all ( query attributes ) ; logger trace ( " fetching person attributes for query [ { } ] " , query ) ; val people = attribute repository get people ( query , filter ) ; if ( people = = null | | people is empty ( ) ) { logger warn ( " no person records were fetched from attribute repositories for [ { } ] " , query ) ; return new hash map < > ( 0 ) ; } if ( people size ( ) > 1 ) { logger warn ( " multiple records were found for [ { } ] from attribute repositories for query [ { } ] the records are [ { } ] , " + " and cas will only pick the first person record from the results " , principal id , query , people ) ; } val person = people iterator ( ) next ( ) ; logger debug ( " retrieved person [ { } ] from attribute repositories for query [ { } ] " , person , query ) ; return person get attributes ( ) ; }


register a { @ link view resolver } bean instance this may be useful to configure a custom ( or 3rd party ) resolver implementation it may also be used as an alternative to other registration methods in this class when they don ' t expose some more advanced property that needs to be set

public void view resolver ( view resolver view resolver ) { if ( view resolver instanceof content negotiating view resolver ) { throw new bean initialization exception ( " add view resolver cannot be used to configure a content negotiating view resolver " + " please use the method enable content negotiation instead " ) ; } this view resolvers add ( view resolver ) ; }


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


returns the approximate number of bytes per frame for the current flac stream

public long get approx bytes per frame ( ) { long approx bytes per frame ; if ( max frame size > 0 ) { approx bytes per frame = ( ( long ) max frame size + min frame size ) / 2 + 1 ; } else { / / uses the stream ' s block - size if it ' s a known fixed block - size stream , otherwise uses the / / default value for flac block - size , which is 4096 long block size samples = ( min block size samples = = max block size samples & & min block size samples > 0 ) ? min block size samples : 4096 ; approx bytes per frame = ( block size samples * channels * bits per sample ) / 8 + 64 ; } return approx bytes per frame ; }


return number of bytes consumed by callers of compress since last reset

public long get bytes written ( ) { return bytes written ; }


common metadata describing the resource < code > istio mcp v 1alpha 1 metadata metadata = 1 ; < code >

public builder merge metadata ( com alibaba nacos istio model mcp metadata value ) { if ( metadata builder = = null ) { if ( metadata ! = null ) { metadata = com alibaba nacos istio model mcp metadata new builder ( metadata ) merge from ( value ) build partial ( ) ; } else { metadata = value ; } on changed ( ) ; } else { metadata builder merge from ( value ) ; } return this ; }


return a { @ link sorted numeric double values } that doesn ' t contain any value

public static multi geo point values empty multi geo points ( ) { return singleton ( empty geo point ( ) ) ; }


public static byte [ ] int array to bytes ( collection < integer > values ) { byte buffer buffer = byte buffer allocate ( values size ( ) * integer bytes ) ; for ( int value : values ) { buffer put int ( value ) ; } return buffer array ( ) ; }


returns a hash code for the elements of the given array , or 0 if it is null

public static int hash code or null ( object [ ] array ) { return array = = null ? 0 : hash code ( array , array length ) ; }


checks to see if the basic block is a subroutine caller block

private boolean is subroutine caller ( basic block bb ) { int list successors = bb get successors ( ) ; if ( successors size ( ) < 2 ) return false ; int sub label = successors get ( 1 ) ; return ( sub label < subroutines length ) & & ( subroutines [ sub label ] ! = null ) ; }


gets the classloader that contains the additional dependencies , which are not part of the jvm ' s classpath

class loader get user code classloader ( ) ;


returns the number of nodes this manager is connected to

public int size ( ) { return connected nodes size ( ) ; }


start a continuously executing set of unary calls that will terminate when { @ code done get ( ) } is true each completed call will increment the counter by the specified delta which benchmarks can use to measure qps or bandwidth

protected void start unary calls ( int calls per channel , final atomic long counter , final atomic boolean done , final long counter delta ) { for ( final managed channel channel : channels ) { for ( int i = 0 ; i < calls per channel ; i + + ) { stream observer < byte buf > observer = new stream observer < byte buf > ( ) { @ override public void on next ( byte buf value ) { counter add and get ( counter delta ) ; } @ override public void on error ( throwable t ) { done set ( true ) ; } @ override public void on completed ( ) { if ( ! done get ( ) ) { byte buf slice = request slice ( ) ; client calls async unary call ( channel new call ( unary method , call options ) , slice , this ) ; } } } ; observer on completed ( ) ; } } }


sets the selection to only the selected index

public void set selected index ( int index ) { if ( index < - 1 | | index > = items size ) throw new illegal argument exception ( " index must be > = - 1 and < " + items size + " : " + index ) ; if ( index = = - 1 ) { selection clear ( ) ; } else { selection set ( items get ( index ) ) ; } }


returns the weight of a cache entry there is no unit for entry weights ; rather they are simply relative to each other

int weigh ( @ non null k key , @ non null v value ) ;


copy the data from an { @ link input stream } to a byte array the stream is not closed

public static byte [ ] copy stream to byte array ( input stream input ) throws i o exception { return copy stream to byte array ( input , input available ( ) ) ; }


if this returns true , don ' t enqueue new actions

protected boolean block new actions ( ) { return is interrupted ( ) | | ( unhandled ! = null & & fail fast on exception ) ; }


redirects any http request of type post on ' from path ' to ' to path '

public void post ( string from path , string to path ) { post ( from path , to path , null ) ; }


returns a required singleton shuffle type

public static required shuffle singleton ( ) { return new required shuffle ( shuffle type singleton ) ; }


public string get call string ( ) { return this call string ; }


returns true if the given object can be equaled with this object if not , it returns false


make sure that we cannot have two connections with the same session id

public void test session move ( ) throws exception { string [ ] host ports = hostport split ( " , " ) ; disconnectable zoo keeper zk = new disconnectable zoo keeper ( host ports [ 0 ] , connection timeout , new my watcher ( " 0 " ) ) ; zk create ( " / session move test " , new byte [ 0 ] , ids open acl unsafe , create mode ephemeral ) ; / / we want to loop through the list twice for ( int i = 0 ; i < host ports length * 2 ; i + + ) { zk dont reconnect ( ) ; / / this should stomp the zk handle disconnectable zoo keeper zknew = new disconnectable zoo keeper ( host ports [ ( i + 1 ) % host ports length ] , connection timeout , new my watcher ( integer to string ( i + 1 ) ) , zk get session id ( ) , zk get session passwd ( ) ) ; final int [ ] result = new int [ 1 ] ; result [ 0 ] = integer max value ; zknew sync ( " / " , ( rc , path , ctx ) - > { synchronized ( result ) { result [ 0 ] = rc ; result notify ( ) ; } } , null ) ; synchronized ( result ) { if ( result [ 0 ] = = integer max value ) { result wait ( 5000 ) ; } } log info ( " { } sync returned { } " , host ports [ ( i + 1 ) % host ports length ] , result [ 0 ] ) ; assert true ( result [ 0 ] = = keeper exception code ok int value ( ) ) ; zknew set data ( " / " , new byte [ 1 ] , - 1 ) ; try { zk set data ( " / " , new byte [ 1 ] , - 1 ) ; fail ( " should have lost the connection " ) ; } catch ( keeper exception connection loss exception e ) { log info ( " got connection loss exception as expected " ) ; } / / zk close ( ) ; zk = zknew ; } zk close ( ) ; }


adds interest ops to selection key of the transport layer

public void add interest ops ( int ops ) { if ( ! key is valid ( ) ) throw new cancelled key exception ( ) ; else if ( ! ready ( ) ) throw new illegal state exception ( " handshake is not completed " ) ; key interest ops ( key interest ops ( ) | ops ) ; }


creates a { @ code concurrent linked queue } containing the elements of the specified iterable , in the order they are returned by the iterable ' s iterator

public static < e > concurrent linked queue < e > new concurrent linked queue ( iterable < ? extends e > elements ) { if ( elements instanceof collection ) { return new concurrent linked queue < e > ( ( collection < ? extends e > ) elements ) ; } concurrent linked queue < e > queue = new concurrent linked queue < e > ( ) ; iterables add all ( queue , elements ) ; return queue ; } / / linked blocking deque


sets the field names serialization format the first parameter defines how to read the format of the proto field names you are converting to json the second parameter defines which format to use when serializing them for example , if you use the following parameters : { @ link case format # lower underscore } , { @ link case format # lower camel } , the following conversion will occur : proto < - > json my field my field foo foo n id ct n id ct

public builder set field name serialization format ( case format from field name format , case format to field name format ) { this proto format = from field name format ; this json format = to field name format ; return this ; }


starts one opportunistic container that takes up the whole node ' s resources , and submit two more that will be queued

public void test start and queue multiple containers ( ) throws exception { container manager start ( ) ; list < start container request > list = new array list < > ( ) ; list add ( start container request new instance ( record factory new record instance ( container launch context class ) , create container token ( create container id ( 0 ) , dummy rm identifier , context get node id ( ) , user , builder utils new resource ( 2048 , 1 ) , context get container token secret manager ( ) , null , execution type opportunistic ) ) ) ; list add ( start container request new instance ( record factory new record instance ( container launch context class ) , create container token ( create container id ( 1 ) , dummy rm identifier , context get node id ( ) , user , builder utils new resource ( 1024 , 1 ) , context get container token secret manager ( ) , null , execution type opportunistic ) ) ) ; list add ( start container request new instance ( record factory new record instance ( container launch context class ) , create container token ( create container id ( 2 ) , dummy rm identifier , context get node id ( ) , user , builder utils new resource ( 1024 , 1 ) , context get container token secret manager ( ) , null , execution type opportunistic ) ) ) ; start containers request all requests = start containers request new instance ( list ) ; container manager start containers ( all requests ) ; thread sleep ( 5000 ) ; / / ensure first container is running and others are queued list < container id > stat list = new array list < container id > ( ) ; for ( int i = 0 ; i < 3 ; i + + ) { stat list add ( create container id ( i ) ) ; } get container statuses request stat request = get container statuses request new instance ( arrays as list ( create container id ( 0 ) ) ) ; list < container status > container statuses = container manager get container statuses ( stat request ) get container statuses ( ) ; for ( container status status : container statuses ) { if ( status get container id ( ) equals ( create container id ( 0 ) ) ) { assert assert equals ( container sub state running , status get container sub state ( ) ) ; } else { assert assert equals ( container sub state scheduled , status get container sub state ( ) ) ; } } container scheduler container scheduler = container manager get container scheduler ( ) ; / / ensure two containers are properly queued assert assert equals ( 2 , container scheduler get num queued containers ( ) ) ; assert assert equals ( 0 , container scheduler get num queued guaranteed containers ( ) ) ; assert assert equals ( 2 , container scheduler get num queued opportunistic containers ( ) ) ; assert assert equals ( 2 , metrics get queued opportunistic containers ( ) ) ; assert assert equals ( 0 , metrics get queued guaranteed containers ( ) ) ; }


protected issuer build saml response issuer ( final string entity id ) { val issuer = new issuer ( entity id ) ; issuer set format ( issuer entity ) ; return issuer ; }


can be used to collect objects from the iterable is a terminating operation

public final optional < e > first ( ) { var result iterator = first ( 1 ) iterator ( ) ; return result iterator has next ( ) ? optional of ( result iterator next ( ) ) : optional empty ( ) ; }


this is the main scrolling direction that the { @ link layout manager } passed to this binder will use


the index the operation failed on might return { @ code null } if it can ' t be derived

public final string index ( ) { return index ; }


verify the rack and upgrade domain policies when exclude nodes are specified

public void test choose target with exclude nodes ( ) throws exception { set < node > excluded nodes = new hash set < > ( ) ; datanode storage info [ ] targets ; list < datanode storage info > chosen nodes = new array list < > ( ) ; excluded nodes clear ( ) ; chosen nodes clear ( ) ; excluded nodes add ( data nodes [ 4 ] ) ; targets = choose target ( 3 , chosen nodes , excluded nodes ) ; assert equals ( targets length , 3 ) ; assert equals ( storages [ 0 ] , targets [ 0 ] ) ; assert equals ( get racks ( targets ) size ( ) , 2 ) ; assert equals ( get upgrade domains ( targets ) size ( ) , 3 ) ; excluded nodes clear ( ) ; chosen nodes clear ( ) ; excluded nodes add ( data nodes [ 4 ] ) ; excluded nodes add ( data nodes [ 8 ] ) ; targets = choose target ( 3 , chosen nodes , excluded nodes ) ; assert equals ( targets length , 3 ) ; assert equals ( storages [ 0 ] , targets [ 0 ] ) ; assert equals ( get racks ( targets ) size ( ) , 2 ) ; assert equals ( get upgrade domains ( targets ) size ( ) , 3 ) ; excluded nodes clear ( ) ; chosen nodes clear ( ) ; excluded nodes add ( data nodes [ 4 ] ) ; excluded nodes add ( data nodes [ 5 ] ) ; excluded nodes add ( data nodes [ 8 ] ) ; targets = choose target ( 3 , chosen nodes , excluded nodes ) ; assert equals ( targets length , 3 ) ; assert equals ( storages [ 0 ] , targets [ 0 ] ) ; assert equals ( storages [ 2 ] , targets [ 1 ] ) ; assert equals ( storages [ 7 ] , targets [ 2 ] ) ; excluded nodes clear ( ) ; chosen nodes clear ( ) ; excluded nodes add ( data nodes [ 4 ] ) ; targets = choose target ( 4 , chosen nodes , excluded nodes ) ; assert equals ( targets length , 4 ) ; assert equals ( storages [ 0 ] , targets [ 0 ] ) ; assert true ( get racks ( targets ) size ( ) > = 2 ) ; assert equals ( get upgrade domains ( targets ) size ( ) , 3 ) ; excluded nodes clear ( ) ; chosen nodes clear ( ) ; excluded nodes add ( data nodes [ 4 ] ) ; excluded nodes add ( data nodes [ 8 ] ) ; targets = choose target ( 4 , chosen nodes , excluded nodes ) ; assert equals ( targets length , 4 ) ; assert equals ( storages [ 0 ] , targets [ 0 ] ) ; assert true ( get racks ( targets ) size ( ) > = 2 ) ; assert equals ( get upgrade domains ( targets ) size ( ) , 3 ) ; excluded nodes clear ( ) ; chosen nodes clear ( ) ; excluded nodes add ( data nodes [ 1 ] ) ; chosen nodes add ( storages [ 2 ] ) ; targets = replicator choose target ( filename , 1 , data nodes [ 0 ] , chosen nodes , true , excluded nodes , block size , test block storage policy default storage policy , null ) ; system out println ( " targets = " + arrays as list ( targets ) ) ; assert equals ( 2 , targets length ) ; }


when the keyword ' pool ' is met , interpret it as identifier , not as a keyword

public void interpret pool as variable ( ) { this interpret pool as variable = true ; }


add an active search context to the list of tracked contexts package private for testing

static void add active context ( reader context context ) { active search contexts put ( context , new runtime exception ( context to string ( ) ) ) ; }


returns the commands of this instance arguments with spaces in are presented with quotes round ; other arguments are presented raw

public string to string ( ) { string builder builder = new string builder ( ) ; string [ ] args = get exec string ( ) ; for ( string s : args ) { if ( s index of ( ' ' ) > = 0 ) { builder append ( ' " ' ) append ( s ) append ( ' " ' ) ; } else { builder append ( s ) ; } builder append ( ' ' ) ; } return builder to string ( ) ; }


returns true if a resource is set , even if the request is not yet complete or the primary request has failed


returns how many rows the given row is above or below the current viewport

private int get viewport offset ( int row ) { / / do some object checking up front and exit if these aren ' t set if ( ! is state valid ( ) ) { return 0 ; } / / first figure out which rows in the table our viewport is bounding int viewport row start = viewport get view position ( ) y / table get row height ( ) ; int viewport row end = viewport row start + viewport get height ( ) / table get row height ( ) ; / / now calculate if the given row is in , above , or below the viewport if ( row < viewport row start ) { return row - viewport row start ; } else if ( row > viewport row end ) { return row - viewport row end ; } return 0 ; }


{ @ inherit doc } returns { @ code true } if the given object is also a multiset entry and the two entries represent the same element and count that is , two entries { @ code a } and { @ code b } are equal if : { @ code objects equal ( a get element ( ) , b get element ( ) ) & & a get count ( ) = = b get count ( ) }


destroy a fixture this removes the fixture from the broad - phase and destroys all contacts associated with this fixture this will automatically adjust the mass of the body if the body is dynamic and the fixture has positive density all fixtures attached to a body are implicitly destroyed when the body is destroyed

public void destroy fixture ( fixture fixture ) { body destroy fixture ( fixture fixture ) ; fixtures remove value ( fixture , true ) ; world fixtures remove ( fixture fixture ) ; }


public static bitmap get bitmap ( @ non null final string key ) { return get bitmap ( key , get default cache double utils ( ) ) ; }


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

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


sets the { @ link options data } used by this parser , based on the given { @ code options classes }

public final builder options classes ( class < ? extends options base > options classes ) { return this options data ( ( opaque options data ) get options data internal ( immutable list copy of ( options classes ) ) ) ; }


returns whether the given pattern is simple , i e , not starting with ' - ' and using none of the target matching suffixes

public static boolean is simple target pattern ( string pattern ) { if ( pattern starts with ( " - " ) ) { return false ; } for ( string suffix : suffixes ) { if ( pattern ends with ( " : " + suffix ) ) { return false ; } } return true ; }


upload a file when closed , either in one go , or , if the file is already partitioned , by uploading the remaining partition and a manifest

private void upload on close ( path keypath ) throws i o exception { boolean upload success = false ; int attempt = 0 ; while ( ! upload success ) { try { + + attempt ; bytes uploaded + = upload file attempt ( keypath , attempt ) ; upload success = true ; } catch ( i o exception e ) { log info ( " upload failed " + e , e ) ; if ( attempt > attempt limit ) { throw e ; } } } }


set the collapsed panel height in pixels

public void set panel height ( int val ) { if ( get panel height ( ) = = val ) { return ; } m panel height = val ; if ( ! m first layout ) { request layout ( ) ; } if ( get panel state ( ) = = panel state collapsed ) { smooth to bottom ( ) ; invalidate ( ) ; return ; } }


public byte block get byte block ( ) { return block ; }


when the credentials bear a principal , succeed the authentication

public void verify non null principal ( ) { val credentials = new principal bearing credential ( principal factory utils new principal factory ( ) create principal ( " scott " ) ) ; assert not null ( this handler authenticate ( credentials ) ) ; }


return true if this additional properties array object is equal to o

public boolean equals ( object o ) { if ( this = = o ) { return true ; } if ( o = = null | | get class ( ) ! = o get class ( ) ) { return false ; } additional properties array additional properties array = ( additional properties array ) o ; return objects equals ( this name , additional properties array name ) & & objects equals ( this additional properties , additional properties array additional properties ) ; }


ensures that the argument expression is true

static void require argument ( boolean expression ) { if ( ! expression ) { throw new illegal argument exception ( ) ; } }


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


returns the addresses , which is an unmodifiable list

public list < equivalent address group > get addresses ( ) { return addrs ; }


public object node list with health status ( @ request param string key ) throws nacos exception { string service name ; string namespace id ; if ( key contains ( utils and commons namespace service connector ) ) { namespace id = key split ( utils and commons namespace service connector ) [ 0 ] ; service name = key split ( utils and commons namespace service connector ) [ 1 ] ; } else { namespace id = constants default namespace id ; service name = key ; } naming utils check service name format ( service name ) ; service service = service manager get service ( namespace id , service name ) ; if ( service = = null ) { throw new nacos exception ( nacos exception not found , " service : " + service name + " not found " ) ; } list < instance > ips = service all i ps ( ) ; object node result = jackson utils create empty json node ( ) ; array node ip array = jackson utils create empty array node ( ) ; for ( instance ip : ips ) { ip array add ( ip to ip addr ( ) + " " + ip is healthy ( ) ) ; } result replace ( " ips " , ip array ) ; return result ; }


get the i ds of the connectors currently running in this worker

public set < string > connector names ( ) { return connectors key set ( ) ; }


creates a new async stub that supports all call types for the service

public static route discovery service stub new stub ( io grpc channel channel ) { io grpc stub abstract stub stub factory < route discovery service stub > factory = new io grpc stub abstract stub stub factory < route discovery service stub > ( ) { @ java lang override public route discovery service stub new stub ( io grpc channel channel , io grpc call options call options ) { return new route discovery service stub ( channel , call options ) ; } } ; return route discovery service stub new stub ( factory , channel ) ; }


an unsafe operation intended for use by a subclass that sets the reference count of the buffer directly

protected final void set ref cnt ( int ref cnt ) { updater set ref cnt ( this , ref cnt ) ; }


returns { @ code true } if and only if the < a href = " https : netty iowikinative - transports html " > { @ code netty - transport - native - epoll } is available

public static boolean is available ( ) { return unavailability cause = = null ; }


force buffered operations to the filesystem

public synchronized void flush ( ) throws i o exception { check not closed ( ) ; trim to size ( ) ; trim to file count ( ) ; journal writer flush ( ) ; }


gets the maximum length for any frame ' s payload

public int max frame payload length ( ) { return decoder config max frame payload length ( ) ; }


byte block change manager get byte block change manager ( ) { return bbcm ; }


a single trusted manager for verifying the remote endpoint ' s certificate this is helpful when custom implementation of { @ link trust manager } is needed internally , a simple wrapper of { @ link trust manager factory } that only produces this specified { @ link trust manager } will be created , thus all the requirements specified in { @ link # trust manager ( trust manager factory trust manager factory ) } also apply here

public ssl context builder trust manager ( trust manager trust manager ) { this trust manager factory = new trust manager factory wrapper ( trust manager ) ; trust cert collection = null ; return this ; }


regression test for hdfs - 9305 delayed processing of a heartbeat can cause a subsequent heartbeat storm

public void test schedule delayed heartbeat ( ) { for ( final long now : get timestamps ( ) ) { scheduler scheduler = make mock scheduler ( now ) ; scheduler schedule next heartbeat ( ) ; assert false ( scheduler is heartbeat due ( now ) ) ; / / simulate a delayed heartbeat e g due to slow processing by nn scheduler next heartbeat time = now - ( heartbeat interval ms * 10 ) ; scheduler schedule next heartbeat ( ) ; / / ensure that the next heartbeat is not due immediately assert false ( scheduler is heartbeat due ( now ) ) ; } }


creates a type by analyzing the given class it does this by using java reflection which can be supported by { @ link data type hint } annotations for nested , structured types it will throw an { @ link validation exception } in cases where the reflective extraction needs more information or simply fails see { @ link data types # of ( class ) } for further examples

< t > data type create data type ( class < t > clazz ) ;


public static vector plus ( vector vec 1 , vector vec 2 ) { return vec 1 plus ( vec 2 ) ; }


tests that track selector will prefer tracks that are within renderer ' s capabilities over tracks that have { @ link c # selection flag default } but exceed renderer ' s capabilities

public void select tracks prefer track within capabilities over selection flag ( ) throws exception { format builder format builder = audio format build upon ( ) ; format exceeded with selection flag format = format builder set id ( " exceeded format " ) set selection flags ( c selection flag default ) build ( ) ; format supported format = format builder set id ( " supported format " ) set selection flags ( 0 ) build ( ) ; track group array track groups = wrap formats ( exceeded with selection flag format , supported format ) ; map < string , integer > mapped capabilities = new hash map < > ( ) ; mapped capabilities put ( supported format id , format handled ) ; mapped capabilities put ( exceeded with selection flag format id , format exceeds capabilities ) ; renderer capabilities mapped audio renderer capabilities = new fake mapped renderer capabilities ( c track type audio , mapped capabilities ) ; track selector result result = track selector select tracks ( new renderer capabilities [ ] { mapped audio renderer capabilities } , track groups , period id , timeline ) ; assert fixed selection ( result selections get ( 0 ) , track groups , supported format ) ; }


fake endpoint for testing various parameters 가짜 엔드 포인트 ( asynchronously ) fake endpoint for testing various parameters 가짜 엔드 포인트

public okhttp 3 call test endpoint parameters async ( big decimal number , double double , string pattern without delimiter , byte [ ] byte , integer integer , integer int 3 2 , long int 6 4 , float float , string string , file binary , local date date , offset date time date time , string password , string param callback , final api callback < void > callback ) throws api exception { okhttp 3 call local var call = test endpoint parameters validate before call ( number , double , pattern without delimiter , byte , integer , int 3 2 , int 6 4 , float , string , binary , date , date time , password , param callback , callback ) ; local var api client execute async ( local var call , callback ) ; return local var call ; }


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


only select tasks with the given { @ link delegation state }

task query task delegation state ( delegation state delegation state ) ;


gets the { @ code signed byte } value at a particular offset

public int get byte ( int off ) { check offsets ( off , off + 1 ) ; return get byte 0 ( off ) ; }


returns an immutable collection of the values in this map , sorted by the ordering of the corresponding keys

public immutable collection < v > values ( ) { return value list ; }


returns the initial vote value of the peer epoch

private long get peer epoch ( ) { if ( self get learner type ( ) = = learner type participant ) { try { return self get current epoch ( ) ; } catch ( i o exception e ) { runtime exception re = new runtime exception ( e get message ( ) ) ; re set stack trace ( e get stack trace ( ) ) ; throw re ; } } else { return long min value ; } }


returns the conflict panel for resolving whether to remove or change a symbol

protected vertical choices panel get remove conflict panel ( symbol symbol , change listener listener ) { long symbol i d = symbol get i d ( ) ; string text = " symbol ' " + conflict utility get emphasize string ( symbol get name ( true ) ) + " ' @ address " + conflict utility get address string ( symbol get address ( ) ) + " ' was removed in one version and changed in other " ; conflict panel clear ( ) ; conflict panel set header ( text ) ; conflict panel set row header ( get symbol info ( null , null ) ) ; symbol latest symbol = latest pgm get symbol table ( ) get symbol ( symbol i d ) ; symbol my symbol = my pgm get symbol table ( ) get symbol ( symbol i d ) ; string latest prefix = ( latest symbol = = null ) ? " remove as in ' " : " change as in ' " ; string my prefix = ( my symbol = = null ) ? " remove as in ' " : " change as in ' " ; string suffix = " ' version " ; conflict panel add radio button row ( get symbol info ( latest pgm , latest symbol , latest prefix , suffix ) , latest button name , keep latest , listener ) ; conflict panel add radio button row ( get symbol info ( my pgm , my symbol , my prefix , suffix ) , checked out button name , keep my , listener ) ; conflict panel add info row ( get symbol info ( original pgm , symbol i d , " ' " , suffix ) ) ; return conflict panel ; }


get a random block id that is not used already

private long get free block id ( ) { long id = rand next long ( ) ; while ( true ) { id = rand next long ( ) ; if ( fs dataset test util fetch replica info ( fds , bpid , id ) = = null ) { break ; } } return id ; }


sets this instance ' s data , position and limit to match the provided { @ code parsable byte array } any modifications to the underlying data array will be visible in both instances

public void reset ( parsable byte array parsable byte array ) { reset ( parsable byte array get data ( ) , parsable byte array limit ( ) ) ; set position ( parsable byte array get position ( ) * 8 ) ; }


load patch occur unknown exception that we have wrap try catch for you ! you may need to report this exception and contact me welcome to report a new issues for us ! you can disable patch as { @ link default load reporter # on load exception ( throwable , int ) }

public void on load exception ( throwable e , int error code ) { / / for un caught or dex exception , disable tinker all the time with sp switch ( error code ) { case share constants error load exception dex : if ( e get message ( ) contains ( share constants check dex install fail ) ) { share tinker log e ( tag , " patch load reporter on load exception : tinker dex check fail : " + e get message ( ) ) ; } else { share tinker log i ( tag , " patch load reporter on load exception : patch load dex exception : % s " , e ) ; } share tinker internals set tinker disable with shared preferences ( context ) ; share tinker log i ( tag , " dex exception disable tinker forever with sp " ) ; break ; case share constants error load exception resource : if ( e get message ( ) contains ( share constants check res install fail ) ) { share tinker log e ( tag , " patch load reporter on load exception : tinker res check fail : " + e get message ( ) ) ; } else { share tinker log i ( tag , " patch load reporter on load exception : patch load resource exception : % s " , e ) ; } share tinker internals set tinker disable with shared preferences ( context ) ; share tinker log i ( tag , " res exception disable tinker forever with sp " ) ; break ; case share constants error load exception uncaught : share tinker log i ( tag , " patch load reporter on load exception : patch load un catch exception : % s " , e ) ; share tinker internals set tinker disable with shared preferences ( context ) ; share tinker log i ( tag , " un caught exception disable tinker forever with sp " ) ; string uncaught string = share patch file util check tinker last uncaught crash ( context ) ; if ( ! share tinker internals is null or nil ( uncaught string ) ) { file lase crash file = share patch file util get patch last crash file ( context ) ; share patch file util safe delete file ( lase crash file ) ; / / found really crash reason share tinker log e ( tag , " tinker uncaught real exception : " + uncaught string ) ; } break ; case share constants error load exception unknown : share tinker log i ( tag , " patch load reporter on load exception : patch load unknown exception : % s " , e ) ; / / exception can be caught , it is no need to disable tinker with shared preference break ; default : break ; } share tinker log e ( tag , " tinker load exception , welcome to submit issue to us : https : / / github com / tencent / tinker / issues " ) ; share tinker log print err stack trace ( tag , e , " tinker load exception " ) ; tinker with ( context ) set tinker disable ( ) ; check and clean patch ( ) ; }


< code > optional double money = 1 ; < code >

public double get money ( ) { return money ; }


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


the first time a particular field name is passed , simply return it the second time return it with " 2 " appended the third time return it with " 3 " appended etc

static string build field name ( map < string , integer > field name count store , string field name ) { integer number seen = field name count store compute ( field name , ( k , v ) - > 1 + ( ( v = = null ) ? 0 : v ) ) ; if ( number seen > 1 ) { return field name + number seen ; } else { return field name ; } }


retrieves a map of { @ link path } s to the { @ link mapper } class that should be used for them

static map < path , class < ? extends mapper > > get mapper type map ( job context job ) { configuration conf = job get configuration ( ) ; if ( conf get ( dir mappers ) = = null ) { return collections empty map ( ) ; } map < path , class < ? extends mapper > > m = new hash map < path , class < ? extends mapper > > ( ) ; string [ ] path mappings = conf get ( dir mappers ) split ( " , " ) ; for ( string path mapping : path mappings ) { string [ ] split = path mapping split ( " ; " ) ; class < ? extends mapper > map class ; try { map class = ( class < ? extends mapper > ) conf get class by name ( split [ 1 ] ) ; } catch ( class not found exception e ) { throw new runtime exception ( e ) ; } m put ( new path ( split [ 0 ] ) , map class ) ; } return m ; }


append a short description of the search request to a string builder used to make to string

protected void search to string ( string builder b ) { if ( search request indices ( ) ! = null & & search request indices ( ) length ! = 0 ) { b append ( arrays to string ( search request indices ( ) ) ) ; } else { b append ( " [ all indices ] " ) ; } }


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


add an http header entry for the given name while this method can take any { @ code object } as a parameter , it is recommended to use the following types : string or any object to be converted using { @ code to string ( ) } ; see { @ link # get header } string , number , or date for date headers ; see { @ link # get date header } string or number for integer headers ; see { @ link # get int header } { @ code string [ ] } or { @ code collection < string > } for multiple values ; see { @ link # get headers }

public void add header ( string name , object value ) { if ( http headers content type equals ignore case ( name ) & & ! this headers contains key ( http headers content type ) ) { set content type ( value to string ( ) ) ; } else if ( http headers accept language equals ignore case ( name ) & & ! this headers contains key ( http headers accept language ) ) { try { http headers headers = new http headers ( ) ; headers add ( http headers accept language , value to string ( ) ) ; list < locale > locales = headers get accept language as locales ( ) ; this locales clear ( ) ; this locales add all ( locales ) ; if ( this locales is empty ( ) ) { this locales add ( locale english ) ; } } catch ( illegal argument exception ex ) { / / invalid accept - language format - > just store plain header } do add header value ( name , value , true ) ; } else { do add header value ( name , value , false ) ; } }


returns a { @ link org apache flink util resource guard lease } that prevents closing this stream to allow the system to close this stream , each of the acquired leases need to call { @ link lease # close ( ) } , on their acquired leases

public final resource guard lease acquire lease ( ) throws i o exception { return resource guard acquire resource ( ) ; }


returns a supplier whose { @ code get ( ) } method synchronizes on { @ code delegate } before calling it , making it thread - safe

public static < t > supplier < t > synchronized supplier ( supplier < t > delegate ) { return new thread safe supplier < t > ( delegate ) ; }


if a pki realm is enabled , and does not support delegation ( default ) , checks to see if ssl and client authentication are enabled on at least one network communication layer

public bootstrap check result check ( bootstrap context context ) { final settings settings = context settings ( ) ; final map < realm identifier , settings > realms = realm settings get realm settings ( settings ) ; final boolean pki realm enabled without delegation = realms entry set ( ) stream ( ) filter ( e - > pki realm settings type equals ( e get key ( ) get type ( ) ) ) map ( map entry : : get value ) any match ( s - > s get as boolean ( " enabled " , true ) & & ( false = = s get as boolean ( " delegation enabled " , false ) ) ) ; if ( pki realm enabled without delegation ) { for ( string context name : get ssl context names ( settings ) ) { final s s l configuration configuration = ssl service get s s l configuration ( context name ) ; if ( ssl service is s s l client auth enabled ( configuration ) ) { return bootstrap check result success ( ) ; } } return bootstrap check result failure ( " a pki realm is enabled but cannot be used as neither http or transport have ssl and client authentication enabled " ) ; } else { return bootstrap check result success ( ) ; } }


public void set currency ( currency currency ) { this currency = currency ; }


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


get the translation of the principal name into an operating system user name

public string get short name ( ) throws i o exception { string [ ] params ; if ( host name = = null ) { / / if it is already simple , just return it if ( realm = = null ) { return service name ; } params = new string [ ] { realm , service name } ; } else { params = new string [ ] { realm , service name , host name } ; } for ( rule r : rules ) { string result = r apply ( params ) ; if ( result ! = null ) { return result ; } } throw new no matching rule ( " no rules applied to " + to string ( ) ) ; }


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

public java util list < com alibaba nacos istio model server > get servers list ( ) { if ( servers builder = = null ) { return java util collections unmodifiable list ( servers ) ; } else { return servers builder get message list ( ) ; } }


whether a { @ code locale context resolver } is configured or not , either detected from an { @ code application context } or explicitly configured via { @ link # locale context resolver }

public boolean has locale context resolver ( ) { return ( this locale context resolver ! = null ) ; }


returns audio attributes for the given exo player audio attributes

public static audio attributes compat get audio attributes compat ( audio attributes audio attributes ) { return new audio attributes compat builder ( ) set content type ( audio attributes content type ) set flags ( audio attributes flags ) set usage ( audio attributes usage ) build ( ) ; }


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


find the multifactor authentication provider in the application contact that matches the specified provider id ( e g " mfa - duo " )

public static optional < multifactor authentication provider > get multifactor authentication provider from application context ( final string provider id ) { return get multifactor authentication provider from application context ( provider id , application context provider get application context ( ) ) ; }


not supported { @ code contiguous set } instances are constructed with { @ link # create } this method exists only to hide { @ link immutable set # builder } from consumers of { @ code contiguous set }

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


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


gets the comment from the given { @ link doc tree }

private string get comment ( doc tree doc tree ) { switch ( doc tree get kind ( ) ) { case comment : return ( ( comment tree ) doc tree ) get body ( ) ; case link : return ( ( link tree ) doc tree ) get reference ( ) get signature ( ) ; case param : return get comment ( ( ( param tree ) doc tree ) get description ( ) ) ; case return : return get comment ( ( ( return tree ) doc tree ) get description ( ) ) ; case text : return ( ( text tree ) doc tree ) get body ( ) ; case throws : return get comment ( ( ( throws tree ) doc tree ) get description ( ) ) ; default : return " " ; } }


public static fresco vito image decode options defaults ( ) { return defaults ; }


create the task that will move the block

move block task make task ( ) { return new move block task ( program , block get start ( ) , new start addr , listener ) ; }


delete the entry for this { @ link registered service }


use the given { @ link org apache http client redirect strategy } instance

public http client builder using ( redirect strategy redirect strategy ) { this redirect strategy = redirect strategy ; return this ; }


public final record reader < null writable , summation writable > create record reader ( input split generic , task attempt context context ) { final summation split split = ( summation split ) generic ; / / return a record reader return new record reader < null writable , summation writable > ( ) { boolean done = false ; / * * { @ inherit doc } * / @ override public void initialize ( input split split , task attempt context context ) { } / * * { @ inherit doc } * / @ override public boolean next key value ( ) { return ! done ? done = true : false ; } / * * { @ inherit doc } * / @ override public null writable get current key ( ) { return null writable get ( ) ; } / * * { @ inherit doc } * / @ override public summation writable get current value ( ) { return new summation writable ( split get element ( ) ) ; } / * * { @ inherit doc } * / @ override public float get progress ( ) { return done ? 1f : 0f ; }


verifies that the { @ code set } returned by { @ code predecessors } has the expected mutability property ( see the { @ code graph } documentation for more information )

public abstract void predecessors check returned set mutability ( ) ;


validates that the given method ' s signature meets all of our assumptions

private static void validate method ( method method ) { string desc = method to string ( ) ; assert true ( desc , is any enter ( method ) | | is wait for ( method ) ) ; switch ( method get parameter types ( ) length ) { case 0 : assert false ( desc , is guarded ( method ) ) ; assert false ( desc , is timed ( method ) ) ; break ; case 1 : assert true ( desc , is guarded ( method ) ) ; assert false ( desc , is timed ( method ) ) ; break ; case 2 : assert false ( desc , is guarded ( method ) ) ; assert true ( desc , is timed ( method ) ) ; break ; case 3 : assert true ( desc , is guarded ( method ) ) ; assert true ( desc , is timed ( method ) ) ; break ; default : fail ( desc ) ; } if ( method get return type ( ) = = void class ) { assert false ( desc , is boolean ( method ) ) ; } else { assert true ( desc , is boolean ( method ) ) ; } switch ( method get exception types ( ) length ) { case 0 : assert false ( desc , is interruptible ( method ) ) ; break ; case 1 : assert true ( desc , is interruptible ( method ) ) ; break ; default : fail ( desc ) ; } if ( is enter if ( method ) ) { assert true ( desc , is guarded ( method ) ) ; assert true ( desc , is boolean ( method ) ) ; } else if ( is try enter ( method ) ) { assert false ( desc , is timed ( method ) ) ; assert true ( desc , is boolean ( method ) ) ; assert false ( desc , is interruptible ( method ) ) ; } else if ( is wait for ( method ) ) { assert true ( desc , is guarded ( method ) ) ; assert equals ( desc , is timed ( method ) , is boolean ( method ) ) ; } else { / / any other enter xxx method assert equals ( desc , is timed ( method ) , is boolean ( method ) ) ; } }


public indices aliases request builder remove alias ( string index , string alias ) { request add alias action ( alias actions remove ( ) index ( index ) alias ( alias ) ) ; return this ; }


return true if this $ special [ model name ] object is equal to o

public boolean equals ( object o ) { if ( this = = o ) { return true ; } if ( o = = null | | get class ( ) ! = o get class ( ) ) { return false ; } special model name $ special model name = ( special model name ) o ; return objects equals ( this $ special property name , $ special model name $ special property name ) ; }


attempt to replay the provided command updates counters accordingly

private boolean replay log ( final audit replay command command ) { final string src = command get src ( ) ; final string dst = command get dest ( ) ; file system proxy fs = fs cache get ( command get simple ugi ( ) ) ; if ( proxy fs = = null ) { user group information ugi = user group information create proxy user ( command get simple ugi ( ) , login user ) ; proxy fs = ugi do as ( ( privileged action < file system > ) ( ) - > { try { file system fs = new distributed file system ( ) ; fs initialize ( namenode uri , mapper conf ) ; return fs ; } catch ( i o exception ioe ) { throw new runtime exception ( ioe ) ; } } ) ; fs cache put ( command get simple ugi ( ) , proxy fs ) ; } final file system fs = proxy fs ; replay command replay command ; try { replay command = replay command value of ( command get command ( ) split ( " " ) [ 0 ] to upper case ( ) ) ; } catch ( illegal argument exception iae ) { log warn ( " unsupported / invalid command : " + command ) ; replay counters map get ( replaycounters totalunsupportedcommands ) increment ( 1 ) ; return false ; } try { long start time = system current time millis ( ) ; switch ( replay command ) { case create : f s data output stream fs dos = fs create ( new path ( src ) ) ; if ( create blocks ) { fs dos write byte ( 0 ) ; } fs dos close ( ) ; break ; case getfileinfo : fs get file status ( new path ( src ) ) ; break ; case contentsummary : fs get content summary ( new path ( src ) ) ; break ; case mkdirs : fs mkdirs ( new path ( src ) ) ; break ; case rename : fs rename ( new path ( src ) , new path ( dst ) ) ; break ; case liststatus : ( ( distributed file system ) fs ) get client ( ) list paths ( src , hdfs file status empty name ) ; break ; case append : fs append ( new path ( src ) ) ; return true ; case delete : fs delete ( new path ( src ) , true ) ; break ; case open : fs open ( new path ( src ) ) close ( ) ; break ; case setpermission : fs set permission ( new path ( src ) , fs permission get default ( ) ) ; break ; case setowner : fs set owner ( new path ( src ) , user group information get current user ( ) get short user name ( ) , user group information get current user ( ) get primary group name ( ) ) ; break ; case settimes : fs set times ( new path ( src ) , system current time millis ( ) , system current time millis ( ) ) ; break ; case setreplication : fs set replication ( new path ( src ) , ( short ) 1 ) ; break ; case concat : / / dst is like [ path 1 , path 2 ] - strip brackets and split on comma string bare dist = dst length ( ) < 2 ? " " : dst substring ( 1 , dst length ( ) - 1 ) trim ( ) ; list < path > dsts = new array list < > ( ) ; for ( string s : splitter on ( " , " ) omit empty strings ( ) trim results ( ) split ( bare dist ) ) { dsts add ( new path ( s ) ) ; } fs concat ( new path ( src ) , dsts to array ( new path [ ] { } ) ) ; break ; default : throw new runtime exception ( " unexpected command : " + replay command ) ; } long latency = system current time millis ( ) - start time ; user command key user command key = new user command key ( command get simple ugi ( ) , replay command to string ( ) , replay command get type ( ) to string ( ) ) ; command latency map put if absent ( user command key , new count time writable ( ) ) ; count time writable latency writable = command latency map get ( user command key ) ; latency writable set count ( latency writable get count ( ) + 1 ) ; latency writable set time ( latency writable get time ( ) + latency ) ; switch ( replay command get type ( ) ) { case write : replay counters map get ( replaycounters totalwritecommandlatency ) increment ( latency ) ; replay counters map get ( replaycounters totalwritecommands ) increment ( 1 ) ; break ; case read : replay counters map get ( replaycounters totalreadcommandlatency ) increment ( latency ) ; replay counters map get ( replaycounters totalreadcommands ) increment ( 1 ) ; break ; default : throw new runtime exception ( " unexpected command type : " + replay command get type ( ) ) ; } individual commands map get ( replay command + individual commands latency suffix ) increment ( latency ) ; individual commands map get ( replay command + individual commands count suffix ) increment ( 1 ) ; return true ; } catch ( i o exception e ) { log debug ( " i o exception : " + e get localized message ( ) ) ; individual commands map get ( replay command + individual commands invalid suffix ) increment ( 1 ) ; return false ; } }


retrieve the { @ link connection factory } identified by the given name

connection factory get connection factory ( string connection factory name ) throws connection factory lookup failure exception ;


public void test to string address ( ) { try { string string address = net util to string address ( inet socket address create unresolved ( " 127 0 0 1 " , 9828 ) ) ; } catch ( exception e ) { assert that ( e ) is instance of ( null pointer exception class ) ; } }


this is the main routine for launching the benchmark it generates random input data the input is non - splittable sort is used for benchmarking this benchmark reports the effect of having multiple sort and spill cycles over a single sort and spill

public int run ( string [ ] args ) throws exception { log info ( " starting the benchmark for threaded spills " ) ; string version = " threaded map benchmark 0 0 1 " ; system out println ( version ) ; string usage = " usage : threadedmapbenchmark " + " [ - data size per map < data size ( in mb ) per map , default is 128 mb > ] " + " [ - num spills per map < number of spills per map , default is 2 > ] " + " [ - num maps per host < number of maps per host , default is 1 > ] " ; int data size per map = 128 ; / / in mb int num spills per map = 2 ; int num maps per host = 1 ; job conf master conf = new job conf ( get conf ( ) ) ; for ( int i = 0 ; i < args length ; i + + ) { / / parse command line if ( args [ i ] equals ( " - data size per map " ) ) { data size per map = integer parse int ( args [ + + i ] ) ; } else if ( args [ i ] equals ( " - num spills per map " ) ) { num spills per map = integer parse int ( args [ + + i ] ) ; } else if ( args [ i ] equals ( " - num maps per host " ) ) { num maps per host = integer parse int ( args [ + + i ] ) ; } else { system err println ( usage ) ; system exit ( - 1 ) ; } } if ( data size per map < 1 | | / / verify arguments num spills per map < 1 | | num maps per host < 1 ) { system err println ( usage ) ; system exit ( - 1 ) ; } file system fs = null ; try { / / using random - writer to generate the input data generate input data ( data size per map , num spills per map , num maps per host , master conf ) ; / / configure job for sorting job conf job = new job conf ( master conf , threaded map benchmark class ) ; job set job name ( " threaded - map - benchmark - unspilled " ) ; job set jar by class ( threaded map benchmark class ) ; job set input format ( non splitable sequence file input format class ) ; job set output format ( sequence file output format class ) ; job set output key class ( bytes writable class ) ; job set output value class ( bytes writable class ) ; job set mapper class ( identity mapper class ) ; job set reducer class ( identity reducer class ) ; file input format add input path ( job , input dir ) ; file output format set output path ( job , output dir ) ; job client client = new job client ( job ) ; cluster status cluster = client get cluster status ( ) ; job set num map tasks ( num maps per host * cluster get task trackers ( ) ) ; job set num reduce tasks ( 1 ) ; / / set mapreduce task io sort mb to avoid spill int io sort mb = ( int ) math ceil ( factor * data size per map ) ; job set ( job context io sort mb , string value of ( io sort mb ) ) ; fs = file system get ( job ) ; log info ( " running sort with 1 spill per map " ) ; long start time = system current time millis ( ) ; job client run job ( job ) ; long end time = system current time millis ( ) ; log info ( " total time taken : " + string value of ( end time - start time ) + " millisec " ) ; fs delete ( output dir , true ) ; / / set mapreduce task io sort mb to have multiple spills job conf spilled job = new job conf ( job , threaded map benchmark class ) ; io sort mb = ( int ) math ceil ( factor * math ceil ( ( double ) data size per map / num spills per map ) ) ; spilled job set ( job context io sort mb , string value of ( io sort mb ) ) ; spilled job set job name ( " threaded - map - benchmark - spilled " ) ; spilled job set jar by class ( threaded map benchmark class ) ; log info ( " running sort with " + num spills per map + " spills per map " ) ; start time = system current time millis ( ) ; job client run job ( spilled job ) ; end time = system current time millis ( ) ; log info ( " total time taken : " + string value of ( end time - start time ) + " millisec " ) ; } finally { if ( fs ! = null ) { fs delete ( base dir , true ) ; } } return 0 ; }


private static string [ ] a ( string str ) { return str ; }


going into suspended out of running vertices should cancel all vertices once with rpc calls

public void test suspended out of running ( ) throws exception { final int parallelism = 10 ; final interactions counting task manager gateway gateway = new interactions counting task manager gateway ( parallelism ) ; final scheduler base scheduler = create scheduler ( gateway , parallelism ) ; final execution graph eg = scheduler get execution graph ( ) ; scheduler start scheduling ( ) ; execution graph test utils switch all vertices to running ( eg ) ; assert equals ( job status running , eg get state ( ) ) ; validate all vertices in state ( eg , execution state running ) ; / / suspend scheduler suspend ( new exception ( " suspend " ) ) ; assert equals ( job status suspended , eg get state ( ) ) ; validate cancel rpc calls ( gateway , parallelism ) ; ensure cannot leave suspended state ( scheduler , gateway ) ; }


returns duration of the given frame ( in milliseconds ) if there is no data ( no graphics control extension blocks or drawable is recycled ) 0 is returned

public int get frame duration ( @ int range ( from = 0 ) final int index ) { return m native info handle get frame duration ( index ) ; }


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


set an array of values for the specified http parameter if there are already one or more values registered for the given parameter name , they will be replaced

public void set parameter ( string name , string values ) { assert not null ( name , " parameter name must not be null " ) ; this parameters put ( name , values ) ; }


configures to start reading partitions from specific offsets , set independently for each partition resets previously set offsets

public kafka start from specific offsets ( map < integer , long > specific offsets ) { this startup mode = startup mode specific offsets ; this specific offsets = preconditions check not null ( specific offsets ) ; return this ; }


tests oauthbearer fails the connection when the client presents a token with insufficient scope

public void test insufficient scope sasl oauth bearer mechanism ( ) throws exception { security protocol security protocol = security protocol sasl ssl ; test jaas config jaas config = configure mechanisms ( " oauthbearer " , arrays as list ( " oauthbearer " ) ) ; / / now update the server side to require a scope the client does not provide map < string , object > server jaas config options map = test jaas config default server options ( " oauthbearer " ) ; server jaas config options map put ( " unsecured validator required scope " , " login to kafka " ) ; / / causes the failure jaas config create or update entry ( " kafka server " , " org apache kafka common security oauthbearer o auth bearer login module " , server jaas config options map ) ; server = create echo server ( security protocol ) ; create and check client authentication failure ( security protocol , " node - " + o auth bearer login module oauthbearer mechanism , o auth bearer login module oauthbearer mechanism , " { \ " status \ " : \ " insufficient scope \ " , \ " scope \ " : \ " [ login to kafka ] \ " } " ) ; }


get { @ link build options } that is threaded along with { @ link feature configuration } do this only when you ' re completely aware of why this method was added and hlopko @ allowed you to

build options get build options from feature configuration created for starlark and i know what im doing ( ) { return build options ; }


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


public synchronized boolean add ( final metric name metric name , final measurable stat stat , final metric config config ) { if ( has expired ( ) ) { return false ; } else if ( metrics contains key ( metric name ) ) { return true ; } else { final metric config stat config = config = = null ? this config : config ; final kafka metric metric = new kafka metric ( metric lock ( ) , objects require non null ( metric name ) , objects require non null ( stat ) , stat config , time ) ; registry register metric ( metric ) ; metrics put ( metric metric name ( ) , metric ) ; stats add ( new stat and config ( objects require non null ( stat ) , metric : : config ) ) ; return true ; } }


gets selectable multifactor authentication providers

public static list < string > get selectable multifactor authentication providers ( final request context request context ) { return request context get view scope ( ) get ( " mfa selectable providers " , list class ) ; }


trust access to writable memory based on initialized option

public boolean allow access ( varnode context context , address addr ) { return trust memory write ; }


equivalent to { @ link java util service loader # load } but without requiring java 6 android 2 3 ( gingerbread )

public < t > t load impl ( class < t > service ) { class loader loader = thread current thread ( ) get context class loader ( ) ; if ( loader = = null ) { loader = class loader get system class loader ( ) ; } enumeration < url > resources ; try { resources = loader get resources ( " mockito - extensions / " + service get name ( ) ) ; } catch ( i o exception e ) { throw new illegal state exception ( " failed to load " + service , e ) ; } try { string class or alias = new plugin finder ( plugin switch ) find plugin class ( iterables to iterable ( resources ) ) ; if ( class or alias ! = null ) { if ( class or alias equals ( alias ) ) { class or alias = plugins get default plugin class ( alias ) ; } class < ? > plugin class = loader load class ( class or alias ) ; object plugin = plugin class get declared constructor ( ) new instance ( ) ; return service cast ( plugin ) ; } return null ; } catch ( exception e ) { throw new illegal state exception ( " failed to load " + service + " implementation declared in " + resources , e ) ; } }


public void test rename 2 pre descendant 3 ( ) throws exception { final path root = new path ( " / " ) ; final path sdir 1 = new path ( " / dir 1 " ) ; final path sdir 2 = new path ( " / dir 2 " ) ; final path foo = new path ( sdir 1 , " foo " ) ; final path bar = new path ( foo , " bar " ) ; final path file in bar = new path ( bar , " file " ) ; hdfs mkdirs ( bar ) ; hdfs mkdirs ( sdir 2 ) ; d f s test util create file ( hdfs , file in bar , blocksize , repl , seed ) ; hdfs set quota ( sdir 1 , long max value - 1 , long max value - 1 ) ; hdfs set quota ( sdir 2 , long max value - 1 , long max value - 1 ) ; hdfs set quota ( foo , long max value - 1 , long max value - 1 ) ; hdfs set quota ( bar , long max value - 1 , long max value - 1 ) ; / / create snapshot on root snapshot test helper create snapshot ( hdfs , root , snap 1 ) ; / / delete file in bar hdfs delete ( file in bar , true ) ; / / create another snapshot on root snapshot test helper create snapshot ( hdfs , root , snap 2 ) ; / / / dir 1 / foo / bar - > / dir 2 / bar final path bar 2 = new path ( sdir 2 , " bar 2 " ) ; hdfs rename ( bar , bar 2 ) ; / / / dir 1 / foo - > / dir 2 / bar / foo final path foo 2 = new path ( bar 2 , " foo 2 " ) ; hdfs rename ( foo , foo 2 ) ; restart cluster and check image ( true ) ; / / delete snapshot snap 1 hdfs delete snapshot ( root , snap 1 ) ; restart cluster and check image ( true ) ; }


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


private void mk nonauth dir ( path path ) throws i o exception { auth f s mkdirs ( path ) ; / / overwrite entry with a nonauth one mark dir nonauth ( path ) ; }


returns the artifact for the debug key for signing the apk

static immutable list < artifact > get apk debug signing keys ( rule context rule context ) { immutable list < artifact > keys = rule context get prerequisite artifacts ( " debug signing keys " ) list ( ) ; if ( ! keys is empty ( ) ) { return keys ; } return immutable list of ( rule context get host prerequisite artifact ( " debug key " ) ) ; }


phrase abbr ( string selector , string cdata ) ; / / acronym omitted , use abbr


returns the { @ code class } object associated with the class or interface with the given string name

private static class < ? > get class ( string fqcn ) { try { return class for name ( fqcn ) ; / / any exception is really unexpected since the type name has / / already been verified } catch ( class not found exception e ) { throw new instantiation exception ( string format ( " could not find % s : % s " , fqcn , e ) , e ) ; } }


scale this matrix using the x and y components of the vector but leave the rest of the matrix alone

public matrix 3 scl ( vector 2 scale ) { val [ m00 ] * = scale x ; val [ m11 ] * = scale y ; return this ; }


returns the { @ link http 2 frame stream } that belongs to this channel


override this method to add custom { @ link converter } andor { @ link formatter } delegates to the common { @ link formatting conversion service }

protected void add formatters ( formatter registry registry ) { }


seriously complicated algorithm ( conceptually ) to ensure that we never store in our collection of ungrouped edges ( which we may sometime have to re - install ) any group vertex , as when we go to restore the edges , we do not know how to do so if the group is no longer there ( like as a result of an ungroup operation )

private void convert grouped edge ( f g edge edge , set < f g edge > updated edges ) { f g vertex start vertex = edge get start ( ) ; f g vertex destination vertex = edge get end ( ) ; if ( ! either grouped endpoint ( start vertex , destination vertex ) ) { updated edges add ( edge ) ; / / plain old edge return ; } / / / / when both endpoints are groups , we want to get all edges in common for later restoring , / / as we don ' t know which edges either group refers to if the group goes away / / if ( both grouped endpoints ( start vertex , destination vertex ) ) { set < f g edge > intersecting converted edges = get intersecting edges ( ( grouped function graph vertex ) start vertex , ( grouped function graph vertex ) destination vertex ) ; updated edges add all ( intersecting converted edges ) ; return ; } / / / / o k , one of the endpoints is grouped find out which one and get all edges that / / have the same start / destination for later restoring , / / as we don ' t know which edges the group refers to if the group goes away / / if ( start vertex instanceof grouped function graph vertex ) { set < f g edge > converted destination edges = ( ( grouped function graph vertex ) start vertex ) get all edges with destination ( destination vertex ) ; updated edges add all ( converted destination edges ) ; } else { set < f g edge > converted start edges = ( ( grouped function graph vertex ) destination vertex ) get all edges with start ( start vertex ) ; updated edges add all ( converted start edges ) ; } }


the configuration of each class is put into the kernel

private void add context enhance class ( map < string , object > configuration ) { string key = customize util generate class desc ( method configuration get clz ( configuration ) , method configuration is static ( configuration ) ) ; hash map < string , element matcher > enhance classes = get enhance classes ( ) ; element matcher matcher = enhance classes get ( key ) ; enhance classes put ( key , matcher = = null ? parser methods matcher ( configuration ) : ( ( element matcher junction ) matcher ) or ( parser methods matcher ( configuration ) ) ) ; }


return the string form of the pattern built from walking the path element chain

string compute pattern string ( ) { string builder buf = new string builder ( ) ; path element pe = this head ; while ( pe ! = null ) { buf append ( pe get chars ( ) ) ; pe = pe next ; } return buf to string ( ) ; }


get the permissions for the parent of a child with given permissions add implicit u + wx permission for parent this is based on @ { f s dir mkdir op # add implicit uwx }

private static fs permission get parent permission ( final fs permission mask ) { fs permission ret = new fs permission ( mask get user action ( ) or ( fs action write execute ) , mask get group action ( ) , mask get other action ( ) ) ; return ret ; }


adds headers that cannot be compiled individually

public builder add textual hdrs ( nested set < artifact > textual hdrs ) { this textual hdrs add transitive ( textual hdrs ) ; return this ; }


build the lucene score function for this builder implementers should ignore things defined in score function builder like weight as they will be handled by the function that calls this one

protected abstract score function do to function ( query shard context context ) throws i o exception ;


clicks in the middle of the given element equivalent to : actions move to element ( on element ) click ( )

public actions click ( web element target ) { if ( is building actions ( ) ) { action add action ( new click action ( json mouse , ( locatable ) target ) ) ; } return move in ticks ( target , 0 , 0 ) click in ticks ( left ) ; }


corners the bug revealed by spr - 8522 , in which an ( apparently ) indexed write method without a corresponding indexed read method would fail to be processed correctly by extended bean info the local class c below represents the relevant methods from google ' s gson builder class interestingly , the set date format ( int , int ) method was not actually intended to serve as an indexed write method ; it just appears that way

public void repro spr 8 5 2 2 ( ) throws introspection exception { @ suppress warnings ( " unused " ) class c { public object set date format ( string pattern ) { return new object ( ) ; } public object set date format ( int style ) { return new object ( ) ; } public object set date format ( int date style , int time style ) { return new object ( ) ; } } bean info bi = introspector get bean info ( c class ) ; assert that ( has read method for property ( bi , " date format " ) ) is false ( ) ; assert that ( has write method for property ( bi , " date format " ) ) is false ( ) ; assert that ( has indexed read method for property ( bi , " date format " ) ) is false ( ) ; assert that ( has indexed write method for property ( bi , " date format " ) ) is false ( ) ; bean info ebi = new extended bean info ( bi ) ; assert that ( has read method for property ( bi , " date format " ) ) is false ( ) ; assert that ( has write method for property ( bi , " date format " ) ) is false ( ) ; assert that ( has indexed read method for property ( bi , " date format " ) ) is false ( ) ; assert that ( has indexed write method for property ( bi , " date format " ) ) is false ( ) ; assert that ( has read method for property ( ebi , " date format " ) ) is false ( ) ; assert that ( has write method for property ( ebi , " date format " ) ) is true ( ) ; assert that ( has indexed read method for property ( ebi , " date format " ) ) is false ( ) ; assert that ( has indexed write method for property ( ebi , " date format " ) ) is false ( ) ; }


called after a plugin has been downloaded to move it into its final location the default implementation is a file rename

public void install ( download job job , file src , file dst ) throws i o exception { job replace ( dst , src ) ; }


get the world linear velocity of a world point attached to this body

public vector 2 get linear velocity from world point ( vector 2 world point ) { tmp set ( world point x , world point y ) ; vec 2 lv = body get linear velocity from world point ( tmp ) ; return lin vel world set ( lv x , lv y ) ; }


check if a block is in the needed reconstruction queue

synchronized boolean contains ( block info block ) { for ( light weight linked set < block info > set : priority queues ) { if ( set contains ( block ) ) { return true ; } } return false ; }


get the last offset read to generate this config state this offset is not guaranteed to be perfectly consistent with the recorded state because some partial updates to task configs may have been read

public long offset ( ) { return offset ; }


public list < container > get containers ( ) { return containers ; }


outputs a { @ link seek map } and returns a { @ link flac binary search seeker } if one is required to handle seeks

private static flac binary search seeker output seek map ( flac decoder jni decoder jni , flac stream metadata stream metadata , long stream length , extractor output output , output frame holder output frame holder ) { boolean have seek table = decoder jni get seek points ( / * time us = * / 0 ) ! = null ; flac binary search seeker binary search seeker = null ; seek map seek map ; if ( have seek table ) { seek map = new flac seek map ( stream metadata get duration us ( ) , decoder jni ) ; } else if ( stream length ! = c length unset & & stream metadata total samples > 0 ) { long first frame position = decoder jni get decode position ( ) ; binary search seeker = new flac binary search seeker ( stream metadata , first frame position , stream length , decoder jni , output frame holder ) ; seek map = binary search seeker get seek map ( ) ; } else { seek map = new seek map unseekable ( stream metadata get duration us ( ) ) ; } output seek map ( seek map ) ; return binary search seeker ; }


caches the image for the given frame index important : the client should use the returned reference instead of the original one it is the caller ' s responsibility to close the returned reference once not needed anymore

public closeable reference < closeable image > cache ( int frame index , closeable reference < closeable image > image ref ) { return m backing cache cache ( key for ( frame index ) , image ref , m entry state observer ) ; }


concatenates an array of path segments into a path string

private string create path ( string segments ) { string builder buf = new string builder ( ) ; for ( string segment : segments ) { if ( ! string utils is empty ( segment ) & & ! segment equals ( " " ) ) { if ( buf length ( ) ! = 0 ) buf append ( file separator char ) ; buf append ( segment ) ; } } for ( int i = 0 ; i < buf length ( ) ; i + + ) { char c = buf char at ( i ) ; if ( ( c = = ' / ' | | c = = ' \ \ ' ) & & c ! = file separator char ) buf set char at ( i , file separator char ) ; } return buf to string ( ) ; }


test initialize ( ) using a configuration object successfully

private void do test initialize with configuration ( configuration conf , string table name ) throws i o exception { dynamo d b metadata store ddbms = new dynamo d b metadata store ( ) ; try { ddbms initialize ( conf , new s 3 guard ttl time provider ( conf ) ) ; table table = verify table initialized ( table name , ddbms get dynamo d b ( ) ) ; verify table sse ( conf , table get description ( ) ) ; assert not null ( ddbms get table ( ) ) ; assert equals ( table name , ddbms get table ( ) get table name ( ) ) ; assert equals ( " unexpected key schema found ! " , key schema ( ) , ddbms get table ( ) describe ( ) get key schema ( ) ) ; } finally { destroy ( ddbms ) ; } }


adds { @ code element } to the { @ code immutable sorted set } if the { @ code immutable sorted set } already contains { @ code element } , then { @ code add } has no effect ( only the previously added element is retained )

public builder < e > add ( e element ) { super add ( element ) ; return this ; }


delete a symbol of the given name and address , knowing there are multiple symbols at the address if the symbol is primary , make another symbol at the address primary before deleting

private int delete symbol ( string match name , address addr , program program ) { int num symbols = 0 ; for ( int i = 0 ; i < 2 ; + + i ) { / / try to find non - primary matching symbol at most twice symbol [ ] symbols = program get symbol table ( ) get symbols ( addr ) ; num symbols = symbols length ; if ( num symbols < = 1 ) { break ; } for ( symbol sym : symbols ) { / / among symbols at the address if ( sym get name ( ) equals ( match name ) ) { / / find one with matching name if ( ! sym is primary ( ) ) { / / if it is not primary sym delete ( ) ; / / delete it immediately num symbols - = 1 ; break ; / / and we are done } symbol other sym = symbols [ 0 ] ; if ( other sym = = sym ) { / / otherwise find another symbol , which must not be primary other sym = symbols [ 1 ] ; } / / set the other symbol to primary set label primary cmd cmd = new set label primary cmd ( addr , other sym get name ( ) , other sym get parent namespace ( ) ) ; cmd apply to ( program ) ; break ; } } } return num symbols ; }


the transport is shutting down this transport will stop owning new streams , but existing streams may continue , and the transport may still be able to process { @ link # new stream } as long as it doesn ' t own the new streams shutdown could have been caused by an error or normal operation it is possible that this method is called without { @ link # shutdown } being called this is called exactly once , and must be called prior to { @ link # transport terminated }


upper bound binary search find the index to the first element in the list that compares greater than the input key

public static < t > int upper bound ( list < ? extends t > list , t key , comparator < ? super t > cmp ) { int low = 0 ; int high = list size ( ) ; while ( low < high ) { int mid = ( low + high ) > > > 1 ; t mid val = list get ( mid ) ; int ret = cmp compare ( mid val , key ) ; if ( ret < = 0 ) low = mid + 1 ; else high = mid ; } return low ; }


callback when a pendingset has been committed , including any source statistics

public void pendingset committed ( final i o statistics source statistics ) { io statistics aggregate ( source statistics ) ; }


disposes of all resources this vertex buffer object uses

public void dispose ( ) { gl20 gl = gdx gl 2 0 ; gl gl bind buffer ( gl20 gl array buffer , 0 ) ; gl gl delete buffer ( buffer handle ) ; buffer handle = 0 ; }


log the throwable , which occurs in dubbo rpc service

private void deal exception ( throwable throwable ) { abstract span span = context manager active span ( ) ; span log ( throwable ) ; }


return a short description of this event , only involving the most important context data

public string get short description ( ) { string builder sb = new string builder ( ) ; sb append ( " session = [ " ) append ( this session id ) append ( " ] ; " ) ; sb append ( " user = [ " ) append ( this user name ) append ( " ] ; " ) ; return sb to string ( ) ; }


returns true if there is at least one data node running

public boolean is data node up ( ) { if ( data nodes = = null | | data nodes size ( ) = = 0 ) { return false ; } for ( data node properties dn : data nodes ) { if ( dn datanode is datanode up ( ) ) { return true ; } } return false ; }