return the session expiration time , if any , otherwise null the value is in nanoseconds as per { @ code system nano time ( ) } and is therefore only useful when compared to such a value - - it ' s absolute value is meaningless this value may be non - null only on the server - side it represents the time after which , in the absence of re - authentication , the broker will close the session if it receives a request unrelated to authentication we store nanoseconds here to avoid having to invoke the more expensive { @ code milliseconds ( ) } call on the broker for every request

default long server session expiration time nanos ( ) { return null ; }


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


tests the warning when the write lock is held longer than threshold

public void test write lock long holding report ( ) throws exception { string testname = name get method name ( ) ; final atomic long time = new atomic long ( 0 ) ; timer mclock = new timer ( ) { @ override public long monotonic now ( ) { return time get ( ) ; } } ; final atomic long wlogged = new atomic long ( 0 ) ; final atomic long wsuppresed = new atomic long ( 0 ) ; reentrant read write lock read write lock = new reentrant read write lock ( true ) ; instrumented write lock write lock = new instrumented write lock ( testname , log , read write lock , 2000 , 300 , mclock ) { @ override protected void log warning ( long lock held time , suppressed snapshot stats ) { wlogged increment and get ( ) ; wsuppresed set ( stats get suppressed count ( ) ) ; } } ; write lock lock ( ) ; / / t = 0 time set ( 100 ) ; write lock unlock ( ) ; / / t = 100 assert equals ( 0 , wlogged get ( ) ) ; assert equals ( 0 , wsuppresed get ( ) ) ; write lock lock ( ) ; / / t = 100 time set ( 500 ) ; write lock unlock ( ) ; / / t = 500 assert equals ( 1 , wlogged get ( ) ) ; assert equals ( 0 , wsuppresed get ( ) ) ; / / the suppress counting is only changed when / / log is needed in the test write lock lock ( ) ; / / t = 500 time set ( 900 ) ; write lock unlock ( ) ; / / t = 900 assert equals ( 1 , wlogged get ( ) ) ; assert equals ( 0 , wsuppresed get ( ) ) ; write lock lock ( ) ; / / t = 900 time set ( 3000 ) ; write lock unlock ( ) ; / / t = 3000 assert equals ( 2 , wlogged get ( ) ) ; assert equals ( 1 , wsuppresed get ( ) ) ; }


submit a task to the thread pool ; the task will be scheduled to run based on the given priority

public < t > future < t > submit ( callable < t > task , int priority ) { if ( task = = null ) { throw new null pointer exception ( ) ; } runnable future < t > ftask = new task for ( task , priority ) ; execute ( ftask ) ; return ftask ; }


public boolean is key pressed ( int key ) ;


actually builder the desired instance of the pub sub sink

public pub sub sink < in > build ( ) throws i o exception { if ( credentials = = null ) { if ( host and port = = null ) { / / no host and port is the normal scenario so we use the default credentials credentials = default credentials provider builder ( ) build ( ) get credentials ( ) ; } else { / / with host and port the pub sub emulator is used so we do not have credentials credentials = emulator credentials get instance ( ) ; } } return new pub sub sink < > ( credentials , serialization schema , project name , topic name , host and port ) ; }


returns a new { @ code future } whose result is derived from the result of this { @ code future } if this input { @ code future } fails , the returned { @ code future } fails with the same exception ( and the function is not invoked ) example usage : { @ code listenable future < list < row > > rows future = query future transform ( query result : : get rows , executor ) ; } when selecting an executor , note that { @ code direct executor } is dangerous in some cases see the discussion in the { @ link # add listener } documentation all its warnings about heavyweight listeners are also applicable to heavyweight functions passed to this method the returned { @ code future } attempts to keep its cancellation state in sync with that of the input future that is , if the returned { @ code future } is cancelled , it will attempt to cancel the input , and if the input is cancelled , the returned { @ code future } will receive a callback in which it will attempt to cancel itself an example use of this method is to convert a serializable object returned from an rpc into a pojo this method is similar to { @ link java util concurrent completable future # then apply } and { @ link java util concurrent completable future # then apply async } it can also serve some of the use cases of { @ link java util concurrent completable future # handle } and { @ link java util concurrent completable future # handle async } when used along with { @ link # catching }

public final < t > fluent future < t > transform ( function < ? super v , t > function , executor executor ) { return ( fluent future < t > ) futures transform ( this , function , executor ) ; }


public map < string , serialized value < optional failure < object > > > get accumulators serialized ( ) { return aggregate user accumulators ( ) entry set ( ) stream ( ) collect ( collectors to map ( map entry : : get key , entry - > serialize accumulator ( entry get key ( ) , entry get value ( ) ) ) ) ; }


check that copyreadwrite operation won ' t access memory it should not

static void check bounds ( final int offset , final int other length , final int other offset , final int count , final int memory size ) { preconditions check argument ( count > = 0 ) ; preconditions check argument ( offset > = 0 ) ; preconditions check argument ( other offset > = 0 ) ; preconditions check argument ( offset + count < = memory size ) ; preconditions check argument ( other offset + count < = other length ) ; }


set the arguments for the target method call this setter is intended for java bean - style deserialization

public void set arguments ( object [ ] arguments ) { this arguments = arguments ; }


the real dialog cancel ( ) will be invoked async - ly after the animation finishes

public void cancel ( ) { dismiss with animation ( true ) ; }


subscribes to the source and calls the given actions on the current thread

public static < t > void subscribe ( publisher < ? extends t > o , final consumer < ? super t > on next , final consumer < ? super throwable > on error , final action on complete ) { objects require non null ( on next , " on next is null " ) ; objects require non null ( on error , " on error is null " ) ; objects require non null ( on complete , " on complete is null " ) ; subscribe ( o , new lambda subscriber < t > ( on next , on error , on complete , functions request max ) ) ; }


suggestions run on an empty index should return a suggest element as part of the response see # 42473 for details

public void test suggest empty index ( ) throws i o exception , interrupted exception { final completion mapping builder mapping = new completion mapping builder ( ) ; create index and mapping ( mapping ) ; completion suggestion builder prefix = suggest builders completion suggestion ( field ) prefix ( " v " ) ; search response search response = client ( ) prepare search ( index ) suggest ( new suggest builder ( ) add suggestion ( " foo " , prefix ) ) set fetch source ( " a " , " b " ) get ( ) ; suggest suggest = search response get suggest ( ) ; assert not null ( suggest ) ; completion suggestion completion suggestion = suggest get suggestion ( " foo " ) ; completion suggestion entry options = completion suggestion get entries ( ) get ( 0 ) ; assert equals ( " v " , options get text ( ) string ( ) ) ; assert equals ( 1 , options get length ( ) ) ; assert equals ( 0 , options get offset ( ) ) ; assert equals ( 0 , options options size ( ) ) ; }


subclasses should implement this the provided { @ link process definition } is guaranteed to be an active process definition ( ie not suspended )

protected abstract t execute ( command context command context , process definition entity process definition ) ;


public interval set complement ( int set vocabulary ) { if ( vocabulary = = null | | vocabulary is nil ( ) ) { return null ; / / nothing in common with null set } interval set vocabulary i s ; if ( vocabulary instanceof interval set ) { vocabulary i s = ( interval set ) vocabulary ; } else { vocabulary i s = new interval set ( ) ; vocabulary i s add all ( vocabulary ) ; } return vocabulary i s subtract ( this ) ; }


static distributed cache manager no op ( ) { return new distributed cache manager ( ) { } ; }


test if the quota can be correctly updated when file length is updated through fsync

public void test update quota for f sync ( ) throws exception { final path foo = new path ( get parent ( generic test utils get method name ( ) ) , " foo " ) ; final path bar = new path ( foo , " bar " ) ; d f s test util create file ( get d f s ( ) , bar , blocksize , replication , 0l ) ; get d f s ( ) set quota ( foo , long max value - 1 , long max value - 1 ) ; f s data output stream out = get d f s ( ) append ( bar ) ; out write ( new byte [ blocksize / 4 ] ) ; ( ( d f s output stream ) out get wrapped stream ( ) ) hsync ( enum set of ( hdfs data output stream sync flag update length ) ) ; i node directory foo node = get f s directory ( ) get i node 4 write ( foo to string ( ) ) as directory ( ) ; quota counts quota = foo node get directory with quota feature ( ) get space consumed ( ) ; long ns = quota get name space ( ) ; long ds = quota get storage space ( ) ; assert equals ( 2 , ns ) ; / / foo and bar assert equals ( blocksize * 2 * replication , ds ) ; / / file is under construction out write ( new byte [ blocksize / 4 ] ) ; out close ( ) ; foo node = get f s directory ( ) get i node 4 write ( foo to string ( ) ) as directory ( ) ; quota = foo node get directory with quota feature ( ) get space consumed ( ) ; ns = quota get name space ( ) ; ds = quota get storage space ( ) ; assert equals ( 2 , ns ) ; assert equals ( ( blocksize + blocksize / 2 ) * replication , ds ) ; / / append another block d f s test util append file ( get d f s ( ) , bar , blocksize ) ; quota = foo node get directory with quota feature ( ) get space consumed ( ) ; ns = quota get name space ( ) ; ds = quota get storage space ( ) ; assert equals ( 2 , ns ) ; / / foo and bar assert equals ( ( blocksize * 2 + blocksize / 2 ) * replication , ds ) ; }


the test expects read ahead manager to return 0 received bytes when previous read ahead on the offset had failed and not throw exception received then also checks that the read buffers are evicted as per the read buffer manager threshold criteria

public void test read ahead manager for older read ahead failure ( ) throws exception { abfs client client = get mock abfs client ( ) ; abfs rest operation success op = get mock rest op ( ) ; / / stub : / / first read request leads to 3 readahead calls : fail all 3 readahead - client read ( ) / / a second read request will see that readahead had failed for data in / / the requested offset range but also that its is an older readahead request / / system issue could have resolved by now , so attempt a new read only for the requested range do throw ( new timeout exception ( " internal server error for rah - x " ) ) do throw ( new timeout exception ( " internal server error for rah - x " ) ) do throw ( new timeout exception ( " internal server error for rah - x " ) ) do return ( success op ) / / pass the read for second read request do return ( success op ) / / pass success for post eviction test when ( client ) read ( any ( string class ) , any ( long class ) , any ( byte [ ] class ) , any ( integer class ) , any ( integer class ) , any ( string class ) , any ( string class ) ) ; abfs input stream input stream = get abfs input stream ( client , " test read ahead manager for older read ahead failure txt " ) ; queue read aheads ( input stream ) ; / / abfs input stream read would have waited for the read - ahead for the requested offset / / as we are testing from read ahead manager directly , sleep for threshold age milliseconds so that / / read buffer qualifies for to be an old buffer thread sleep ( read buffer manager get buffer manager ( ) get threshold age milliseconds ( ) ) ; / / only the 3 read ahead threads should have triggered client read verify read call count ( client , 3 ) ; / / get block from a new read request should return 0 if there is a failure / / 30 sec before in read ahead buffer for respective offset int bytes read = read buffer manager get buffer manager ( ) get block ( input stream , one kb , one kb , new byte [ one kb ] ) ; assert assert equals ( " bytes read should be zero when previously read " + " ahead buffer had failed " , 0 , bytes read ) ; / / stub returns success for the 5th read request , if read buffers still / / persisted request would have failed for position 0 check evicted status ( input stream , 0 , false ) ; }


copies moves the downloaded outputs from their download location to their declared location

private void move outputs to final location ( list < listenable future < file metadata > > downloads ) throws i o exception , interrupted exception { list < file metadata > finished downloads = new array list < > ( downloads size ( ) ) ; for ( listenable future < file metadata > finished download : downloads ) { file metadata output file = get from future ( finished download ) ; if ( output file ! = null ) { finished downloads add ( output file ) ; } } / * * sort the list lexicographically based on its temporary download path in order to avoid * filename clashes when moving the files : * * consider an action that produces two outputs foo and foo tmp these outputs would initially * be downloaded to foo tmp and foo tmp tmp when renaming them to foo and foo tmp we need to * ensure that rename ( foo tmp , foo ) happens before rename ( foo tmp tmp , foo tmp ) we ensure this * by doing the renames in lexicographical order of the download names * / collections sort ( finished downloads , comparator comparing ( f - > to tmp download path ( f path ( ) ) ) ) ; / / move the output files from their temporary name to the actual output file name for ( file metadata output file : finished downloads ) { file system utils move file ( to tmp download path ( output file path ( ) ) , output file path ( ) ) ; output file path ( ) set executable ( output file is executable ( ) ) ; } }


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


sets the lower boundary for the query ( inclusive ) can be removed ( when the query in unbounded ) through null

public boxed query request from ( ordinal begin ) { from = begin ; timestamp range gte ( begin ! = null ? begin timestamp ( ) : null ) ; return this ; }


tests that changing a config setting invalidates the rule that uses it

public void config key invalidation ( ) throws exception { write hello rules ( / * include default condition = * / true ) ; write config rules ( ) ; / / iteration 1 : - - test args = a should apply / / conditions : a use configuration ( " - - test arg = a " ) ; check rule ( " / / java / hello : hello " , " - - test arg = a " , / * expected : * / immutable list of ( adep input ) , / * not expected : * / immutable list of ( bdep input , defaultdep input ) ) ; / / rewrite the condition for / / conditions : a scratch overwrite file ( " conditions / build " , " config setting ( " , " name = ' a ' , " , " values = { ' test arg ' : ' c ' } ) " , " config setting ( " , " name = ' b ' , " , " values = { ' test arg ' : ' b ' } ) " ) ; / / iteration 2 : same exact analysis should now apply the default condition invalidate packages ( ) ; check rule ( " / / java / hello : hello " , " - - test arg = a " , / * expected : * / immutable list of ( defaultdep input ) , / * not expected : * / immutable list of ( adep input , bdep input ) ) ; }


method to populate the messaging advice bean cache ( e g to support " global " { @ code @ message exception handler } )

public void register exception handler advice ( messaging advice bean bean , abstract exception handler method resolver resolver ) { this exception handler advice cache put ( bean , resolver ) ; }


clears mockito listeners added by { @ link mockito framework # add listener ( mockito listener ) }

public void clear mockito listeners ( ) { mocking progress ( ) clear listeners ( ) ; }


start services for backup node the following services should be muted ( not run or not pass any control commands to data nodes ) on backup node : { @ link lease manager monitor } protected by safe mode { @ link block manager redundancy monitor } protected by safe mode { @ link heartbeat manager monitor } protected by safe mode { @ link datanode admin manager monitor } need to prohibit refresh nodes ( ) { @ link pending reconstruction blocks pending reconstruction monitor } harmless , because redundancy monitor is muted

public void start active services ( ) throws i o exception { try { namesystem start active services ( ) ; } catch ( throwable t ) { do immediate shutdown ( t ) ; } }


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


create the c + + link actions , and the corresponding linking related providers

public cc linking outputs link ( cc compilation outputs cc outputs ) throws rule error exception , interrupted exception { preconditions check not null ( cc outputs ) ; / / create link actions ( only if there are object files or if explicitly requested ) / / / / on some systems , the linker gives an error message if there are no input files even with / / the check above , this can still happen if there is a nopic o or o files in srcs , but no / / other files to fix that , we ' d have to check for each link action individually / / / / an additional pre - existing issue is that the header check tokens are dropped if we don ' t / / generate any link actions , effectively disabling header checking in some cases return create cc link actions ( cc outputs ) ; }


resolves the specified name into an address

public final future < inet address > resolve ( string inet host , iterable < dns record > additionals , promise < inet address > promise ) { check not null ( promise , " promise " ) ; dns record [ ] additionals array = to array ( additionals , true ) ; try { do resolve ( inet host , additionals array , promise , resolve cache ) ; return promise ; } catch ( exception e ) { return promise set failure ( e ) ; } }


public boolean is ignored ( ) { node monitor m = computer set get monitors ( ) get ( this ) ; return m = = null | | m is ignored ( ) ; }


test to verify if signals coming from an intermediate throw - event trigger the right events to be dispatched

public void test activity signal events within process ( ) throws exception { process instance process instance = runtime service start process instance by key ( " signal process " ) ; assert that ( process instance ) is not null ( ) ; task task = task service create task query ( ) process instance id ( process instance get id ( ) ) single result ( ) ; assert that ( task ) is not null ( ) ; execution execution with signal event = runtime service create execution query ( ) activity id ( " ship order " ) single result ( ) ; task service complete ( task get id ( ) ) ; assert that ( listener get events received ( ) ) has size ( 1 ) ; assert that ( listener get events received ( ) get ( 0 ) ) is instance of ( activiti signal event class ) ; activiti signal event signal event = ( activiti signal event ) listener get events received ( ) get ( 0 ) ; assert that ( signal event get type ( ) ) is equal to ( activiti event type activity signaled ) ; assert that ( signal event get activity id ( ) ) is equal to ( " ship order " ) ; assert that ( signal event get execution id ( ) ) is equal to ( execution with signal event get id ( ) ) ; assert that ( signal event get process instance id ( ) ) is equal to ( execution with signal event get process instance id ( ) ) ; assert that ( signal event get process definition id ( ) ) is equal to ( process instance get process definition id ( ) ) ; assert that ( signal event get signal name ( ) ) is equal to ( " alert " ) ; assert that ( signal event get signal data ( ) ) is null ( ) ; }


returns true if the initial protections include read

public boolean is read ( ) { return ( init prot & segment constants protection r ) ! = 0 ; }


creates a view of the event dispatcher with pre - configured window index , media period id , and media time offset

public event dispatcher with parameters ( int window index , @ nullable media period id media period id , long media time offset ms ) { return new event dispatcher ( listener and handlers , window index , media period id , media time offset ms ) ; }


return a single domain of the given domain id

public timeline domain get domain ( @ context http servlet request req , @ context http servlet response res , @ path param ( " domain id " ) string domain id ) { init ( res ) ; domain id = parse str ( domain id ) ; if ( domain id = = null | | domain id length ( ) = = 0 ) { throw new bad request exception ( " domain id is not specified " ) ; } timeline domain domain = null ; try { domain = timeline data manager get domain ( parse str ( domain id ) , get user ( req ) ) ; } catch ( exception e ) { log error ( " error getting domain " , e ) ; throw new web application exception ( e , response status internal server error ) ; } if ( domain = = null ) { throw new not found exception ( " timeline domain [ " + domain id + " ] is not found " ) ; } return domain ; }


calculate a linearly weighted moving average , such that older values are linearly less important " time " is determined by position in collection only finite values are averaged na n or null are ignored if all values are missingnull na n , the return value will be na n the average is based on the count of non - null , non - na n values

public static double linear weighted avg ( double [ ] values ) { double avg = 0 ; long total weight = 1 ; long current = 1 ; for ( double v : values ) { if ( double is na n ( v ) = = false ) { avg + = v * current ; total weight + = current ; current + = 1 ; } } return total weight = = 1 ? double na n : avg / total weight ; }


registers a compressor for both decompression and message encoding negotiation

public void register ( compressor c ) { string encoding = c get message encoding ( ) ; check argument ( ! encoding contains ( " , " ) , " comma is currently not allowed in message encoding " ) ; compressors put ( encoding , c ) ; }


returns all execution vertices for this job vertex

access execution vertex [ ] get task vertices ( ) ;


same { { @ link # mkdirs ( string , fs permission , boolean ) } except that the permissions has already been masked against umask

public boolean primitive mkdir ( string src , fs permission abs permission , boolean create parent ) throws i o exception { check open ( ) ; if ( abs permission = = null ) { abs permission = apply u mask dir ( null ) ; } log debug ( " { } : masked = { } " , src , abs permission ) ; try ( trace scope ignored = tracer new scope ( " mkdir " ) ) { return namenode mkdirs ( src , abs permission , create parent ) ; } catch ( remote exception re ) { throw re unwrap remote exception ( access control exception class , invalid path exception class , file already exists exception class , file not found exception class , parent not directory exception class , safe mode exception class , n s quota exceeded exception class , d s quota exceeded exception class , quota by storage type exceeded exception class , unresolved path exception class , snapshot access control exception class ) ; } }


public long get finish time ( ) { return finish time ; }


if the jenkins url starts from " https " , force the secure session flag

private void update secure session flag ( ) { try { servlet context context = jenkins get ( ) servlet context ; method m ; try { m = context get class ( ) get method ( " get session cookie config " ) ; } catch ( no such method exception x ) { / / 3 0 + logger log ( level fine , " failed to set secure cookie flag " , x ) ; return ; } object session cookie config = m invoke ( context ) ; class scc = class for name ( " javax servlet session cookie config " ) ; method set secure = scc get method ( " set secure " , boolean class ) ; boolean v = fix null ( jenkins url ) starts with ( " https " ) ; set secure invoke ( session cookie config , v ) ; } catch ( invocation target exception e ) { if ( e get target exception ( ) instanceof illegal state exception ) { / / servlet 3 0 spec seems to prohibit this from getting set at runtime , / / though winstone is happy to accept i see jenkins - 25019 return ; } logger log ( level warning , " failed to set secure cookie flag " , e ) ; } catch ( exception e ) { logger log ( level warning , " failed to set secure cookie flag " , e ) ; } }


gets the total number of open shards from all indices includes replicas , but does not include shards that are part of closed indices

public int get total open index shards ( ) { return this total open index shards ; }


talks to the http interface to get the json output of a status command on the given file

private void get status ( string filename , string command , boolean expect o k ) throws exception { string user = hadoop users conf test helper get hadoop users ( ) [ 0 ] ; / / remove leading / from filename if ( filename char at ( 0 ) = = ' / ' ) { filename = filename substring ( 1 ) ; } string path ops = message format format ( " / webhdfs / v 1 / { 0 } ? user name = { 1 } & op = { 2 } " , filename , user , command ) ; url url = new url ( test jetty helper get jetty u r l ( ) , path ops ) ; http u r l connection conn = ( http u r l connection ) url open connection ( ) ; conn connect ( ) ; int resp = conn get response code ( ) ; buffered reader reader ; if ( expect o k ) { assert assert equals ( http u r l connection http ok , resp ) ; reader = new buffered reader ( new input stream reader ( conn get input stream ( ) ) ) ; string res = reader read line ( ) ; assert assert true ( ! res contains ( " acl bit " ) ) ; assert assert true ( res contains ( " owner " ) ) ; / / basic sanity check } else { assert assert equals ( http u r l connection http internal error , resp ) ; reader = new buffered reader ( new input stream reader ( conn get error stream ( ) ) ) ; string res = reader read line ( ) ; assert assert true ( res contains ( " acl exception " ) ) ; assert assert true ( res contains ( " support for a c ls has been disabled " ) ) ; } }


returns the last parameter of an invocation this additional answer could be used at stub time using the < code > then | do | will { @ link org mockito stubbing answer } < code > methods for example : < pre class = " code " > < code class = " java " > given ( person remember ( dream 1 , dream 2 , dream 3 , dream 4 ) ) will ( returns last arg ( ) ) ; do answer ( returns last arg ( ) ) when ( person ) remember ( dream 1 , dream 2 , dream 3 , dream 4 ) ; < code > this methods works with varargs as well , mockito will expand the vararg to return the argument at the given position suppose the following signature : < pre class = " code " > < code class = " java " > interface person { dream remember ( dream dream , dream other dreams ) ; } returns dream 4 given ( person remember ( dream 1 , dream 2 , dream 3 , dream 4 ) ) will ( returns last arg ( ) ) ; < code > mockito will return the vararg array if the given { @ code position } targets the vararg index in the method and if the return type has the same type as the vararg array < pre class = " code " > < code class = " java " > interface person { dream [ ] remember ( dream dream 1 , dream dream 2 , dream dream 3 , dream other dreams ) ; } returns other dreams ( happens to be a single element array ) given ( person remember ( dream 1 , dream 2 , dream 3 , dream 4 ) ) will ( returns last arg ( ) ) ; < code >

public static < t > answer < t > returns last arg ( ) { return ( answer < t > ) new returns argument at ( returns argument at last argument ) ; }


specify group key and look up whether subsciber and data is lastest ip - > is uptodate

public static map < string , boolean > list subscriber by group ( string group key ) { map < string , boolean > subs = new hash map < string , boolean > ( 100 ) ; for ( client record client rec : client records values ( ) ) { string client md 5 = client rec get group key 2md 5 map ( ) get ( group key ) ; if ( null ! = client md 5 ) { boolean isuptodate = config cache service is uptodate ( group key , client md 5 ) ; subs put ( client rec get ip ( ) , isuptodate ) ; } } return subs ; }


public static protos resource mem ( double amount ) { return mem ( unreserved role , amount ) ; }


builds a map from client to state , and readies each client state for assignment by adding any missing prev tasks and computing the per - task overall lag based on the fetched end offsets for each changelog

private boolean populate client states map ( final map < uuid , client state > client states , final map < uuid , client metadata > client metadata map , final map < topic partition , task id > task for partition , final map < task id , set < topic partition > > changelogs by stateful task , final set < string > newly created changelogs , final set < string > optimized source changelogs ) { boolean fetch end offsets successful ; map < task id , long > all task end offset sums ; try { final collection < topic partition > all changelog partitions = changelogs by stateful task values ( ) stream ( ) flat map ( collection : : stream ) collect ( collectors to list ( ) ) ; final set < topic partition > preexisting changelog partitions = new hash set < > ( ) ; final set < topic partition > preexisting source changelog partitions = new hash set < > ( ) ; final set < topic partition > newly created changelog partitions = new hash set < > ( ) ; for ( final topic partition changelog : all changelog partitions ) { if ( newly created changelogs contains ( changelog topic ( ) ) ) { newly created changelog partitions add ( changelog ) ; } else if ( optimized source changelogs contains ( changelog topic ( ) ) ) { preexisting source changelog partitions add ( changelog ) ; } else { preexisting changelog partitions add ( changelog ) ; } } / / make the list offsets request first so it can fetch the offsets for non - source changelogs / / asynchronously while we use the blocking consumer # committed call to fetch source - changelog offsets final kafka future < map < topic partition , list offsets result info > > end offsets future = fetch end offsets future ( preexisting changelog partitions , admin client ) ; final map < topic partition , long > source changelog end offsets = fetch committed offsets ( preexisting source changelog partitions , main consumer supplier get ( ) ) ; final map < topic partition , list offsets result info > end offsets = client utils get end offsets ( end offsets future ) ; all task end offset sums = compute end offset sums by task ( changelogs by stateful task , end offsets , source changelog end offsets , newly created changelog partitions ) ; fetch end offsets successful = true ; } catch ( final streams exception | timeout exception e ) { all task end offset sums = changelogs by stateful task key set ( ) stream ( ) collect ( collectors to map ( t - > t , t - > unknown offset sum ) ) ; fetch end offsets successful = false ; } for ( final map entry < uuid , client metadata > entry : client metadata map entry set ( ) ) { final uuid uuid = entry get key ( ) ; final client state state = entry get value ( ) state ; state initialize prev tasks ( task for partition ) ; state compute task lags ( uuid , all task end offset sums ) ; client states put ( uuid , state ) ; } return fetch end offsets successful ; }


sets the { @ link load error handling policy } the default value is created by calling { @ link default load error handling policy # default load error handling policy ( ) } calling this method overrides any calls to { @ link # set min loadable retry count ( int ) }

public factory set load error handling policy ( @ nullable load error handling policy load error handling policy ) { this load error handling policy = load error handling policy ! = null ? load error handling policy : new default load error handling policy ( ) ; return this ; }


sets the doc to use for updates when a script is not specified

public update request doc ( index request doc ) { this doc = doc ; return this ; }


sets the < code > kind < code > property

public void set kind ( kind enum kind ) { this kind = kind ; }


performs the initial phases 0 - 2 of the build : setup , loading and analysis postcondition : on success , populates the build request ' s set of targets to build

private static analysis result run analysis phase ( command environment env , build request request , target pattern phase value loading result , build options target options , set < string > multi cpu ) throws interrupted exception , invalid configuration exception , view creation failed exception { stopwatch timer = stopwatch create started ( ) ; env get reporter ( ) handle ( event progress ( " loading complete analyzing " ) ) ; immutable set < string > explicit target patterns = get explicit target patterns ( env , request get targets ( ) ) ; build view view = new build view ( env get directories ( ) , env get runtime ( ) get rule class provider ( ) , env get skyframe executor ( ) , env get runtime ( ) get coverage report action factory ( request ) ) ; analysis result analysis result = view update ( loading result , target options , multi cpu , explicit target patterns , request get aspects ( ) , request get view options ( ) , request get keep going ( ) , request get loading phase thread count ( ) , request get top level artifact context ( ) , env get reporter ( ) , env get event bus ( ) ) ; pair < integer , integer > tcal = view get targets configured and loaded ( ) ; / / todo ( bazel - team ) : merge these into one event env get event bus ( ) post ( new analysis phase complete event ( analysis result get targets to build ( ) , / * targets loaded * / tcal second int value ( ) , / * targets configured * / tcal first int value ( ) , timer stop ( ) elapsed ( time unit milliseconds ) , view get and clear pkg manager statistics ( ) , view get actions constructed ( ) , env get skyframe executor ( ) was analysis cache discarded and reset bit ( ) ) ) ; immutable set < build configuration value key > configuration keys = stream concat ( analysis result get targets to build ( ) stream ( ) map ( configured target : : get configuration key ) distinct ( ) , analysis result get targets to test ( ) = = null ? stream empty ( ) : analysis result get targets to test ( ) stream ( ) map ( configured target : : get configuration key ) distinct ( ) ) filter ( objects : : non null ) distinct ( ) collect ( immutable set to immutable set ( ) ) ; map < build configuration value key , build configuration > configuration map = env get skyframe executor ( ) get configurations ( env get reporter ( ) , configuration keys ) ; env get event bus ( ) post ( new test filtering complete event ( analysis result get targets to build ( ) , analysis result get targets to test ( ) , analysis result get targets to skip ( ) , configuration map ) ) ; return analysis result ; }


return byte length to the auxiliary data

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


put user { username } : updated user this can only be done by the logged in user

default response entity < void > update user ( @ api param ( value = " name that need to be deleted " , required = true ) @ path variable ( " username " ) string username , @ api param ( value = " updated user object " , required = true ) @ valid @ request body user body ) { return new response entity < > ( http status not implemented ) ; }


protected list < row lock > collect row locks ( string lock key , string resource id , string xid , long transaction id , long branch i d ) { list < row lock > locks = new array list < row lock > ( ) ; string [ ] table grouped lock keys = lock key split ( " ; " ) ; for ( string table grouped lock key : table grouped lock keys ) { int idx = table grouped lock key index of ( " : " ) ; if ( idx < 0 ) { return locks ; } string table name = table grouped lock key substring ( 0 , idx ) ; string merged p ks = table grouped lock key substring ( idx + 1 ) ; if ( string utils is blank ( merged p ks ) ) { return locks ; } string [ ] pks = merged p ks split ( " , " ) ; if ( pks = = null | | pks length = = 0 ) { return locks ; } for ( string pk : pks ) { if ( string utils is not blank ( pk ) ) { row lock row lock = new row lock ( ) ; row lock set xid ( xid ) ; row lock set transaction id ( transaction id ) ; row lock set branch id ( branch i d ) ; row lock set table name ( table name ) ; row lock set pk ( pk ) ; row lock set resource id ( resource id ) ; locks add ( row lock ) ; } } } return locks ; }


public static date string 2 date ( final string time , @ non null final date format format ) { try { return format parse ( time ) ; } catch ( parse exception e ) { e print stack trace ( ) ; } return null ; }


sasl extensions that are validated by the callback handler should be accessible through the { @ code # get negotiated property ( ) } method

public void saves custom extension as negotiated property ( ) throws exception { map < string , string > custom extensions = new hash map < > ( ) ; custom extensions put ( " first key " , " value 1 " ) ; custom extensions put ( " second key " , " value 2 " ) ; byte [ ] next challenge = sasl server evaluate response ( client initial response ( null , false , custom extensions ) ) ; assert true ( next challenge length = = 0 , " next challenge is not empty " ) ; assert equals ( " value 1 " , sasl server get negotiated property ( " first key " ) ) ; assert equals ( " value 2 " , sasl server get negotiated property ( " second key " ) ) ; }


{ @ link invocation listener } instances attached to this mock , see { @ link org mockito mock settings # invocation listeners ( invocation listener ) }

list < invocation listener > get invocation listeners ( ) ;


return whether the config value is the default or if it ' s been explicitly set

public boolean is default ( ) { return source = = config source default config ; }


public < e > e [ ] to array ( e [ ] a ) { throw new unsupported operation exception ( ) ; }


this is called to configure the primary viewer ' s rendering settings subclasses can override this method to change , as needed

protected void decorate primary viewer ( graph viewer < v , e > viewer , visual graph layout < v , e > layout ) { renderer < v , e > renderer = viewer get renderer ( ) ; renderer set edge renderer ( layout get edge renderer ( ) ) ; render context < v , e > render context = viewer get render context ( ) ; / / this will paint thicker , but with the shape being used which can look odd / / render context set edge fill paint transformer ( null ) ; picked state < e > picked edge state = viewer get picked edge state ( ) ; render context set edge stroke transformer ( new visual graph edge stroke transformer < > ( picked edge state , 3 ) ) ; picked edge state add item listener ( new edge picking listener ( ) ) ; / / the layout defines the shape of the edge ( this gives the layout flexibility in how / / to render its shape ) function < e , shape > edge transformer = layout get edge shape transformer ( ) ; render context set edge shape transformer ( edge transformer ) ; render context set arrow placement tolerance ( 5 0f ) ; render context set vertex shape transformer ( new visual graph vertex shape transformer < > ( ) ) ; }


create a filename from the given headers when the headers have no " content - disposition " information , a random uuid name is generated

protected string generate filename ( multi map headers ) { string filename = uuid random u u i d ( ) to string ( ) ; string content disposition = headers get ( " content - disposition " ) ; if ( content disposition ! = null & & ! content disposition is empty ( ) ) { matcher matcher = content disposition pattern matcher ( content disposition ) ; if ( matcher find ( ) ) { filename = sanitize filename ( matcher group ( 1 ) ) ; } } return filename ; }


tests that we fail when reading an invalid yarn properties file when retrieving the cluster id

public void test invalid yarn properties file ( ) throws exception { file directory path = write yarn properties file ( invalid properties file ) ; final configuration configuration = new configuration ( ) ; configuration set string ( yarn config options properties file location , directory path get absolute path ( ) ) ; create flink yarn session cli ( configuration ) ; }


returns the count of { @ code node } ' s incident edges , counting self - loops twice ( equivalently , the number of times an edge touches { @ code node } ) for directed graphs , this is equal to { @ code in degree ( node ) + out degree ( node ) } for undirected graphs , this is equal to { @ code incident edges ( node ) size ( ) } + ( number of self - loops incident to { @ code node } ) if the count is greater than { @ code integer max value } , returns { @ code integer max value }


notifies all field mouselisteners that the cursor position changed

private void notify field mouse listeners ( final mouse event ev ) { final field location loc = new field location ( cursor position ) ; final field field = cursor handler get current field ( ) ; system utilities run swing later ( ( ) - > { for ( field mouse listener l : field mouse listeners ) { l button pressed ( loc , field , ev ) ; } } ) ; }


customize the list of client - side http message readers and writers

builder codecs ( consumer < client codec configurer > consumer ) ;


return the maximum allowable size of the dynamic table

public long capacity ( ) { return capacity ; }


returns true if this actor is the { @ link stage # get scroll focus ( ) scroll focus } actor

public boolean has scroll focus ( ) { stage stage = get stage ( ) ; return stage ! = null & & stage get scroll focus ( ) = = this ; }


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


inverts this matrix given that the determinant is ! = 0

public matrix 3 inv ( ) { float det = det ( ) ; if ( det = = 0 ) throw new gdx runtime exception ( " can ' t invert a singular matrix " ) ; float inv det = 1 0f / det ; float [ ] tmp = this tmp , val = this val ; tmp [ m00 ] = val [ m11 ] * val [ m22 ] - val [ m21 ] * val [ m12 ] ; tmp [ m10 ] = val [ m20 ] * val [ m12 ] - val [ m10 ] * val [ m22 ] ; tmp [ m20 ] = val [ m10 ] * val [ m21 ] - val [ m20 ] * val [ m11 ] ; tmp [ m01 ] = val [ m21 ] * val [ m02 ] - val [ m01 ] * val [ m22 ] ; tmp [ m11 ] = val [ m00 ] * val [ m22 ] - val [ m20 ] * val [ m02 ] ; tmp [ m21 ] = val [ m20 ] * val [ m01 ] - val [ m00 ] * val [ m21 ] ; tmp [ m02 ] = val [ m01 ] * val [ m12 ] - val [ m11 ] * val [ m02 ] ; tmp [ m12 ] = val [ m10 ] * val [ m02 ] - val [ m00 ] * val [ m12 ] ; tmp [ m22 ] = val [ m00 ] * val [ m11 ] - val [ m10 ] * val [ m01 ] ; val [ m00 ] = inv det * tmp [ m00 ] ; val [ m10 ] = inv det * tmp [ m10 ] ; val [ m20 ] = inv det * tmp [ m20 ] ; val [ m01 ] = inv det * tmp [ m01 ] ; val [ m11 ] = inv det * tmp [ m11 ] ; val [ m21 ] = inv det * tmp [ m21 ] ; val [ m02 ] = inv det * tmp [ m02 ] ; val [ m12 ] = inv det * tmp [ m12 ] ; val [ m22 ] = inv det * tmp [ m22 ] ; return this ; }


check that a transaction is created and committed

public void transaction should succeed ( ) throws exception { transaction attribute txatt = new default transaction attribute ( ) ; map transaction attribute source tas = new map transaction attribute source ( ) ; tas register ( get name method , txatt ) ; reactive transaction status = mock ( reactive transaction class ) ; reactive transaction manager rtm = mock ( reactive transaction manager class ) ; / / expect a transaction given ( rtm get reactive transaction ( txatt ) ) will return ( mono just ( status ) ) ; given ( rtm commit ( status ) ) will return ( mono empty ( ) ) ; default test bean tb = new default test bean ( ) ; test bean itb = ( test bean ) advised ( tb , rtm , tas ) ; itb get name ( ) as ( step verifier : : create ) verify complete ( ) ; verify ( rtm ) commit ( status ) ; }


efficient method to check if a range of bits is set , or not set

public boolean is range ( int start , int end , boolean value ) { if ( end < start | | start < 0 | | end > size ) { throw new illegal argument exception ( ) ; } if ( end = = start ) { return true ; / / empty range matches } end - - ; / / will be easier to treat this as the last actually set bit - - inclusive int first int = start / 32 ; int last int = end / 32 ; for ( int i = first int ; i < = last int ; i + + ) { int first bit = i > first int ? 0 : start & 0x 1 f ; int last bit = i < last int ? 31 : end & 0x 1 f ; / / ones from first bit to last bit , inclusive int mask = ( 2 < < last bit ) - ( 1 < < first bit ) ; / / return false if we ' re looking for 1s and the masked bits [ i ] isn ' t all 1s ( that is , / / equals the mask , or we ' re looking for 0s and the masked portion is not all 0s if ( ( bits [ i ] & mask ) ! = ( value ? mask : 0 ) ) { return false ; } } return true ; }


calculate md5 hex string with encode charset

public static string md 5 hex ( string value , string encode ) { try { return md 5 hex ( value get bytes ( encode ) ) ; } catch ( exception e ) { throw new runtime exception ( e ) ; } }


returns true if this is an external symbol a symbol is considered external if it ' s binding is global and it ' s size is zero

public boolean is external ( ) { return ( is global ( ) | | is weak ( ) ) & & get value ( ) = = 0 & & get size ( ) = = 0 & & get type ( ) = = stt notype & & get section header index ( ) = = elf section header constants sht null ; }


convenience method to get this array as a { @ link number } if it contains a single element

public number get as number ( ) { if ( elements size ( ) = = 1 ) { return elements get ( 0 ) get as number ( ) ; } throw new illegal state exception ( ) ; }


set the time the resource was last changed , as specified by the { @ code last - modified } header

public void set last modified ( zoned date time last modified ) { set zoned date time ( last modified , last modified with zone same instant ( gmt ) ) ; }


encodes all of the provided data , starting at in pos , for in avail bytes must be called at least twice : once with the data to encode , and once with in avail set to " - 1 " to alert encoder that eof has been reached , so flush last remaining bytes ( if not multiple of 5 )

void encode ( final byte [ ] in , int in pos , final int in avail , final context context ) { / / package protected for access from i / o streams if ( context eof ) { return ; } / / in avail < 0 is how we ' re informed of eof in the underlying data we ' re / / encoding if ( in avail < 0 ) { context eof = true ; if ( 0 = = context modulus & & line length = = 0 ) { return ; / / no leftovers to process and not using chunking } final byte [ ] buffer = ensure buffer size ( encode size , context ) ; final int saved pos = context pos ; switch ( context modulus ) { / / % 5 case 0 : break ; case 1 : / / only 1 octet ; take top 5 bits then remainder buffer [ context pos + + ] = encode table [ ( int ) ( context lbit work area > > 3 ) & mask 5bits ] ; / / 8 - 1 * 5 = 3 buffer [ context pos + + ] = encode table [ ( int ) ( context lbit work area < < 2 ) & mask 5bits ] ; / / 5 - 3 = 2 buffer [ context pos + + ] = pad ; buffer [ context pos + + ] = pad ; buffer [ context pos + + ] = pad ; buffer [ context pos + + ] = pad ; buffer [ context pos + + ] = pad ; buffer [ context pos + + ] = pad ; break ; case 2 : / / 2 octets = 16 bits to use buffer [ context pos + + ] = encode table [ ( int ) ( context lbit work area > > 11 ) & mask 5bits ] ; / / 16 - 1 * 5 = 11 buffer [ context pos + + ] = encode table [ ( int ) ( context lbit work area > > 6 ) & mask 5bits ] ; / / 16 - 2 * 5 = 6 buffer [ context pos + + ] = encode table [ ( int ) ( context lbit work area > > 1 ) & mask 5bits ] ; / / 16 - 3 * 5 = 1 buffer [ context pos + + ] = encode table [ ( int ) ( context lbit work area < < 4 ) & mask 5bits ] ; / / 5 - 1 = 4 buffer [ context pos + + ] = pad ; buffer [ context pos + + ] = pad ; buffer [ context pos + + ] = pad ; buffer [ context pos + + ] = pad ; break ; case 3 : / / 3 octets = 24 bits to use buffer [ context pos + + ] = encode table [ ( int ) ( context lbit work area > > 19 ) & mask 5bits ] ; / / 24 - 1 * 5 = 19 buffer [ context pos + + ] = encode table [ ( int ) ( context lbit work area > > 14 ) & mask 5bits ] ; / / 24 - 2 * 5 = 14 buffer [ context pos + + ] = encode table [ ( int ) ( context lbit work area > > 9 ) & mask 5bits ] ; / / 24 - 3 * 5 = 9 buffer [ context pos + + ] = encode table [ ( int ) ( context lbit work area > > 4 ) & mask 5bits ] ; / / 24 - 4 * 5 = 4 buffer [ context pos + + ] = encode table [ ( int ) ( context lbit work area < < 1 ) & mask 5bits ] ; / / 5 - 4 = 1 buffer [ context pos + + ] = pad ; buffer [ context pos + + ] = pad ; buffer [ context pos + + ] = pad ; break ; case 4 : / / 4 octets = 32 bits to use buffer [ context pos + + ] = encode table [ ( int ) ( context lbit work area > > 27 ) & mask 5bits ] ; / / 32 - 1 * 5 = 27 buffer [ context pos + + ] = encode table [ ( int ) ( context lbit work area > > 22 ) & mask 5bits ] ; / / 32 - 2 * 5 = 22 buffer [ context pos + + ] = encode table [ ( int ) ( context lbit work area > > 17 ) & mask 5bits ] ; / / 32 - 3 * 5 = 17 buffer [ context pos + + ] = encode table [ ( int ) ( context lbit work area > > 12 ) & mask 5bits ] ; / / 32 - 4 * 5 = 12 buffer [ context pos + + ] = encode table [ ( int ) ( context lbit work area > > 7 ) & mask 5bits ] ; / / 32 - 5 * 5 = 7 buffer [ context pos + + ] = encode table [ ( int ) ( context lbit work area > > 2 ) & mask 5bits ] ; / / 32 - 6 * 5 = 2 buffer [ context pos + + ] = encode table [ ( int ) ( context lbit work area < < 3 ) & mask 5bits ] ; / / 5 - 2 = 3 buffer [ context pos + + ] = pad ; break ; default : throw new illegal state exception ( " impossible modulus " + context modulus ) ; } context current line pos + = context pos - saved pos ; / / keep track of current line position / / if current pos = = 0 we are at the start of a line , so don ' t add crlf if ( line length > 0 & & context current line pos > 0 ) { / / add chunk separator if required system arraycopy ( line separator , 0 , buffer , context pos , line separator length ) ; context pos + = line separator length ; } } else { for ( int i = 0 ; i < in avail ; i + + ) { final byte [ ] buffer = ensure buffer size ( encode size , context ) ; context modulus = ( context modulus + 1 ) % bytes per unencoded block ; int b = in [ in pos + + ] ; if ( b < 0 ) { b + = 256 ; } context lbit work area = ( context lbit work area < < 8 ) + b ; / / bits per byte if ( 0 = = context modulus ) { / / we have enough bytes to create our output buffer [ context pos + + ] = encode table [ ( int ) ( context lbit work area > > 35 ) & mask 5bits ] ; buffer [ context pos + + ] = encode table [ ( int ) ( context lbit work area > > 30 ) & mask 5bits ] ; buffer [ context pos + + ] = encode table [ ( int ) ( context lbit work area > > 25 ) & mask 5bits ] ; buffer [ context pos + + ] = encode table [ ( int ) ( context lbit work area > > 20 ) & mask 5bits ] ; buffer [ context pos + + ] = encode table [ ( int ) ( context lbit work area > > 15 ) & mask 5bits ] ; buffer [ context pos + + ] = encode table [ ( int ) ( context lbit work area > > 10 ) & mask 5bits ] ; buffer [ context pos + + ] = encode table [ ( int ) ( context lbit work area > > 5 ) & mask 5bits ] ; buffer [ context pos + + ] = encode table [ ( int ) context lbit work area & mask 5bits ] ; context current line pos + = bytes per encoded block ; if ( line length > 0 & & line length < = context current line pos ) { system arraycopy ( line separator , 0 , buffer , context pos , line separator length ) ; context pos + = line separator length ; context current line pos = 0 ; } } } } }


checks that the two values are not equal , and emits a warning if their hashcodes are equal

private void assert not equals ( object a , object b ) { if ( a equals ( b ) ) throw new gdx runtime exception ( a get class ( ) get simple name ( ) + " ! equals ( ) failed : \ n " + a + " \ n = = \ n " + b ) ; if ( b equals ( a ) ) throw new gdx runtime exception ( a get class ( ) get simple name ( ) + " ! equals ( ) failed ( not symmetric ) : \ n " + b + " \ n = = \ n " + a ) ; if ( a hash code ( ) = = b hash code ( ) ) system out println ( " warning : " + a get class ( ) get simple name ( ) + " hash code ( ) may be incorrect : \ n " + a + " \ n = = \ n " + b ) ; }


public void close ( ) throws exception { log info ( " closing the slot manager " ) ; suspend ( ) ; slot manager metric group close ( ) ; }


initializes the data structures for the variables , stack , etc

private void initialize parameters ( clazz clazz , method method , code attribute code attribute , traced variables variables ) { / / create the method parameters traced variables parameters = new traced variables ( code attribute u 2max locals ) ; / / remember this instruction ' s offset with any stored value value store value = new instruction offset value ( at method entry ) ; parameters set producer value ( store value ) ; / / initialize the method parameters invocation unit enter method ( clazz , method , parameters ) ; if ( debug ) { system out println ( " params : " + parameters ) ; } / / initialize the variables with the parameters variables initialize ( parameters ) ; / / set the store value of each parameter variable instruction offset value at method entry = new instruction offset value ( at method entry ) ; for ( int index = 0 ; index < parameters size ( ) ; index + + ) { variables set producer value ( index , at method entry ) ; } }


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


set the additional ( undeclared ) property with the specified name and value if the property does not already exist , create it otherwise replace it

public additional properties object put additional property ( string key , map value ) { if ( this additional properties = = null ) { this additional properties = new hash map < string , map > ( ) ; } this additional properties put ( key , value ) ; return this ; }


public void job ( ) { try { require job ( ) ; } catch ( exception e ) { render text ( e get message ( ) ) ; return ; } render ( job page ( ) ) ; }


returns true if all the { @ link fsrl } s in the specified list are from the filesystem

public static boolean is same f s ( list < fsrl > fsrls ) { if ( fsrls is empty ( ) ) { return true ; } f s r l root fs f s r l = fsrls get ( 0 ) get f s ( ) ; for ( fsrl fsrl : fsrls ) { if ( ! fs f s r l equals ( fsrl get f s ( ) ) ) { return false ; } } return true ; }


public long get int 6 4 ( ) { return int 6 4 ; }


lists all child containers under this container a child container is defined as a container whose { @ link # path ( ) } method returns a path that has this containers { @ link # path ( ) } return as its prefix and has one more path element than the current container ' s path

map < string , blob container > children ( ) throws i o exception ;


tests that the { @ link task executor } sends the initial slot report after it registered at the resource manager

public void test initial slot report ( ) throws exception { final task executor task executor = create task executor ( 1 ) ; task executor start ( ) ; try { final testing resource manager gateway testing resource manager gateway = new testing resource manager gateway ( ) ; final completable future < resource i d > initial slot report future = new completable future < > ( ) ; testing resource manager gateway set send slot report function ( resource i d instance i d slot report tuple 3 - > { initial slot report future complete ( resource i d instance i d slot report tuple 3 f 0 ) ; return completable future completed future ( acknowledge get ( ) ) ; } ) ; rpc register gateway ( testing resource manager gateway get address ( ) , testing resource manager gateway ) ; resource manager leader retriever notify listener ( testing resource manager gateway get address ( ) , testing resource manager gateway get fencing token ( ) to u u i d ( ) ) ; assert that ( initial slot report future get ( ) , equal to ( task executor get resource i d ( ) ) ) ; } finally { rpc utils terminate rpc endpoint ( task executor , timeout ) ; } }


set the document encoding using for marshalling default is utf - 8

public void set encoding ( string encoding ) { this encoding = encoding ; }


creates a function at entry point with the specified name

public final function create function ( address entry point , string name ) { create function cmd cmd = new create function cmd ( name , entry point , null , name ! = null ? source type user defined : source type default ) ; if ( cmd apply to ( current program , monitor ) ) { return current program get listing ( ) get function at ( entry point ) ; } return null ; }


public void test simple writable ( ) throws exception { test writable ( new simple writable ( ) ) ; }


the extra takes on the stream should give enough time for all of the measured latencies to age out

public void test multiple buckets both get stored and then age out ( ) { hystrix command key key = hystrix command key factory as key ( " cmd - latency - i " ) ; stream = rolling command latency distribution stream get instance ( key , 10 , 100 ) ; stream start caching stream values if unstarted ( ) ; final count down latch latch = new count down latch ( 1 ) ; stream observe ( ) take ( 30 ) subscribe ( new subscriber < cached values histogram > ( ) { @ override public void on completed ( ) { latch count down ( ) ; } @ override public void on error ( throwable e ) { fail ( e get message ( ) ) ; } @ override public void on next ( cached values histogram distribution ) { system out println ( system current time millis ( ) + " : " + thread current thread ( ) get name ( ) + " received distribution with count : " + distribution get total count ( ) + " and mean : " + distribution get mean ( ) ) ; if ( distribution get total count ( ) = = 2 ) { assert between ( 55 , 90 , ( int ) distribution get mean ( ) ) ; } if ( distribution get total count ( ) = = 5 ) { assert equals ( 60 , 90 , ( long ) distribution get mean ( ) ) ; } } } ) ; command cmd 1 = command from ( group key , key , hystrix event type success , 10 ) ; command cmd 2 = command from ( group key , key , hystrix event type failure , 100 ) ; cmd 1 observe ( ) ; cmd 2 observe ( ) ; try { thread sleep ( 500 ) ; } catch ( interrupted exception ie ) { fail ( " interrupted ex " ) ; } command cmd 3 = command from ( group key , key , hystrix event type success , 60 ) ; command cmd 4 = command from ( group key , key , hystrix event type success , 60 ) ; command cmd 5 = command from ( group key , key , hystrix event type success , 70 ) ; cmd 3 observe ( ) ; cmd 4 observe ( ) ; cmd 5 observe ( ) ; try { assert true ( latch await ( 10000 , time unit milliseconds ) ) ; } catch ( interrupted exception ex ) { fail ( " interrupted ex " ) ; } assert equals ( 0 , stream get latest ( ) get total count ( ) ) ; }


sets the settings for filtering out terms

public term vectors request builder set filter settings ( term vectors request filter settings filter settings ) { request filter settings ( filter settings ) ; return this ; }


tells whether the target was compiled with link - time code generation

public boolean is compiled with link time code generation ( ) { return compiled with link time code generation ; }


< code > required io netty example worldclock continent continent = 1 ; < code >

public builder set continent ( io netty example worldclock world clock protocol continent value ) { if ( value = = null ) { throw new null pointer exception ( ) ; } bit field 0 | = 0x 0 0 0 0 0 0 0 1 ; continent = value ; on changed ( ) ; return this ; }


adds the specified range to this { @ code range set } ( optional operation ) that is , for equal range sets a and b , the result of { @ code a add ( range ) } is that { @ code a } will be the minimal range set for which both { @ code a encloses all ( b ) } and { @ code a encloses ( range ) } note that { @ code range } will be { @ linkplain range # span ( range ) coalesced } with any ranges in the range set that are { @ linkplain range # is connected ( range ) connected } with it moreover , if { @ code range } is empty , this is a no - op


if we don ' t read the bytes of the source , they json reader doesn ' t lose its place

public void next source not consumed ( ) throws i o exception { / / language = json json reader reader = new reader ( " { \ " a \ " : \ " b \ " , \ " c \ " : \ " d \ " } " ) ; reader begin object ( ) ; assert that ( reader next name ( ) ) is equal to ( " a " ) ; reader next source ( ) ; / / not closed assert that ( reader next name ( ) ) is equal to ( " c " ) ; assert that ( reader next string ( ) ) is equal to ( " d " ) ; }


public void test non s s l connection 2 ( ) throws exception { upload jar file ( blob server , non ssl client config ) ; }


checks whether or not a region id is valid

public static boolean is valid region ( string region ) { try { regions from name ( region to lower case ( ) ) ; } catch ( illegal argument exception e ) { return false ; } return true ; }


< code > replace function calling convention < code > changes the function calling convention in program 1 if it doesn ' t match the function calling convention in program 2 at the specified entry point address

public void replace function calling convention ( address origin entry point , task monitor monitor ) { address result entry point = origin to result translator get address ( origin entry point ) ; function f 1 = result program get function manager ( ) get function at ( result entry point ) ; function f 2 = origin program get function manager ( ) get function at ( origin entry point ) ; if ( f 1 ! = null & & f 2 ! = null ) { string name 1 = f 1 get calling convention name ( ) ; string name 2 = f 2 get calling convention name ( ) ; if ( ! name 1 equals ( name 2 ) ) { try { f 1 set calling convention ( name 2 ) ; } catch ( invalid input exception e ) { error msg append ( " invalid input exception replacing calling convention : " + e get message ( ) + " \ n " ) ; } } } }


get the plugin instance that implements a specific class , use to find your plugin singleton note : beware the classloader fun

public plugin wrapper get plugin ( class < ? extends plugin > plugin clazz ) { for ( plugin wrapper p : get plugins ( ) ) { if ( plugin clazz is instance ( p get plugin ( ) ) ) return p ; } return null ; }


return the most general type that can be passed to a { @ link # set value } method using the default context

class < ? > get value type ( ) throws evaluation exception ;


public void write ( configuration configuration ) throws i o exception { / / write the program class path ( input and output entries ) write jar options ( configuration constants injars option , configuration constants outjars option , configuration program jars ) ; writer println ( ) ; / / write the library class path ( output entries only ) write jar options ( configuration constants libraryjars option , configuration constants libraryjars option , configuration library jars ) ; writer println ( ) ; / / write the other options write option ( configuration constants skip non public library classes option , configuration skip non public library classes ) ; write option ( configuration constants dont skip non public library class members option , ! configuration skip non public library class members ) ; write option ( configuration constants keep directories option , configuration keep directories ) ; write option ( configuration constants target option , class util external class version ( configuration target class version ) ) ; write option ( configuration constants force processing option , configuration last modified = = long max value ) ; write option ( configuration constants dont shrink option , ! configuration shrink ) ; write option ( configuration constants print usage option , configuration print usage ) ; write option ( configuration constants dont optimize option , ! configuration optimize ) ; write option ( configuration constants optimizations , configuration optimizations ) ; write option ( configuration constants optimization passes , configuration optimization passes ) ; write option ( configuration constants allow access modification option , configuration allow access modification ) ; write option ( configuration constants merge interfaces aggressively option , configuration merge interfaces aggressively ) ; write option ( configuration constants dont obfuscate option , ! configuration obfuscate ) ; write option ( configuration constants print mapping option , configuration print mapping ) ; write option ( configuration constants apply mapping option , configuration apply mapping ) ; write option ( configuration constants obfuscation dictionary option , configuration obfuscation dictionary ) ; write option ( configuration constants class obfuscation dictionary option , configuration class obfuscation dictionary ) ; write option ( configuration constants package obfuscation dictionary option , configuration package obfuscation dictionary ) ; write option ( configuration constants overload aggressively option , configuration overload aggressively ) ; write option ( configuration constants use unique class member names option , configuration use unique class member names ) ; write option ( configuration constants dont use mixed case class names option , ! configuration use mixed case class names ) ; write option ( configuration constants keep package names option , configuration keep package names , true ) ; write option ( configuration constants flatten package hierarchy option , configuration flatten package hierarchy , true ) ; write option ( configuration constants repackage classes option , configuration repackage classes , true ) ; write option ( configuration constants keep attributes option , configuration keep attributes ) ; write option ( configuration constants keep parameter names option , configuration keep parameter names ) ; write option ( configuration constants rename source file attribute option , configuration new source file attribute ) ; write option ( configuration constants adapt class strings option , configuration adapt class strings , true ) ; write option ( configuration constants adapt resource file names option , configuration adapt resource file names ) ; write option ( configuration constants adapt resource file contents option , configuration adapt resource file contents ) ; write option ( configuration constants dont preverify option , ! configuration preverify ) ; write option ( configuration constants micro edition option , configuration micro edition ) ; write option ( configuration constants verbose option , configuration verbose ) ; write option ( configuration constants dont note option , configuration note , true ) ; write option ( configuration constants dont warn option , configuration warn , true ) ; write option ( configuration constants ignore warnings option , configuration ignore warnings ) ; write option ( configuration constants print configuration option , configuration print configuration ) ; write option ( configuration constants dump option , configuration dump ) ; write option ( configuration constants print seeds option , configuration print seeds ) ; writer println ( ) ; / / write the " why are you keeping " options write options ( configuration constants why are you keeping option , configuration why are you keeping ) ; / / write the keep options write options ( keep options , configuration keep ) ; / / write the " no side effect methods " options write options ( configuration constants assume no side effects option , configuration assume no side effects ) ; if ( writer check error ( ) ) { throw new i o exception ( " can ' t write configuration " ) ; } }


return the { @ link class loader } that should be used to load additional classes ( only { @ code null } if even the system class loader isn ' t accessible )


returns true if this placeholder ' s component is in a tabbed pane with other components

boolean is stacked ( ) { if ( comp node ! = null ) { return comp node is stacked ( ) ; } return false ; }


sets the preferred sizes of the given components to the maximum of their current preferred sizes

private void set common preferred size ( list components ) { / / find the maximum preferred size dimension maximum size = null ; for ( int index = 0 ; index < components size ( ) ; index + + ) { j component component = ( j component ) components get ( index ) ; dimension size = component get preferred size ( ) ; if ( maximum size = = null | | size get width ( ) > maximum size get width ( ) ) { maximum size = size ; } } / / set the size that we found as the preferred size for all components for ( int index = 0 ; index < components size ( ) ; index + + ) { j component component = ( j component ) components get ( index ) ; component set preferred size ( maximum size ) ; } }


sets the timeout for re - issuing a block recovery

public void set block recovery timeout ( long timeout ) { for ( int nn index = 0 ; nn index < get num name nodes ( ) ; nn index + + ) { get namesystem ( nn index ) get block manager ( ) set block recovery timeout ( timeout ) ; } }


reset that if we need to do the first refresh

protected void set should first refresh ( boolean should first refresh ) { this should first refresh = should first refresh ; }


returns true if per object debug info are specified and supported by the crosstool for the build implied by the given configuration , toolchain and feature configuration

public boolean should create per object debug info ( feature configuration feature configuration , cpp configuration cpp configuration ) { return cpp configuration fission is active for current compilation mode ( ) & & feature configuration is enabled ( cpp rule classes per object debug info ) ; }


convenient method to find a single object given a single int parameter and a context

public t find object ( int p 1 , @ nullable map < ? , ? > context ) throws data access exception { return find object ( new object [ ] { p 1 } , context ) ; }


create a new key generating the material for it the given key must not already exist this implementation generates the key material and calls the { @ link # create key ( string , byte [ ] , options ) } method

public key version create key ( string name , options options ) throws no such algorithm exception , i o exception { byte [ ] material = generate key ( options get bit length ( ) , options get cipher ( ) ) ; return create key ( name , material , options ) ; }


parses the semantics flags and updates the semantics used to filter predeclared bindings , and carried by subsequently created threads causes a new starlark thread and module to be created when next needed

public final void set semantics ( string options ) throws options parsing exception { this semantics = options parse ( build language options class , options ) get options ( ) to starlark semantics ( ) ; / / re - initialize the thread and module with the new semantics when needed this thread = null ; this module = null ; }


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


public static type bearer merge type ( type bearer ft 1 , type bearer ft 2 ) { if ( ( ft 1 = = null ) | | ft 1 equals ( ft 2 ) ) { return ft 1 ; } else if ( ft 2 = = null ) { return null ; } else { type type 1 = ft 1 get type ( ) ; type type 2 = ft 2 get type ( ) ; if ( type 1 = = type 2 ) { return type 1 ; } else if ( type 1 is reference ( ) & & type 2 is reference ( ) ) { if ( type 1 = = type known null ) { / * * a known - null merges with any other reference type to * be that reference type * / return type 2 ; } else if ( type 2 = = type known null ) { / * * the same as above , but this time it ' s type 2 that ' s * the known - null * / return type 1 ; } else if ( type 1 is array ( ) & & type 2 is array ( ) ) { type bearer component union = merge type ( type 1 get component type ( ) , type 2 get component type ( ) ) ; if ( component union = = null ) { / * * at least one of the types is a primitive type , * so the merged result is just object * / return type object ; } return ( ( type ) component union ) get array type ( ) ; } else { / * * all other unequal reference types get merged to be * object in this phase this is fine here , but it * won ' t be the right thing to do in the verifier * / return type object ; } } else if ( type 1 is intlike ( ) & & type 2 is intlike ( ) ) { / * * merging two non - identical int - like types results in * the type int * / return type int ; } else { return null ; } } }


gets the cached " raw " method name for this method descriptor the raw name is transport specific , and should be set using { @ link # set raw method name } by the transport

final object get raw method name ( int transport ordinal ) { return raw method names get ( transport ordinal ) ; }


replace the root pane to enable the themed title bar

private static void replace root pane ( final u i defaults defaults ) { defaults put ( " root pane u i " , m t root pane u i class get name ( ) ) ; defaults put ( m t root pane u i class get name ( ) , m t root pane u i class ) ; }


reports whether this function has a residual positional arguments parameter , { @ code def f ( args ) }

public boolean has varargs ( ) { return rfn has varargs ( ) ; }


concatenates this string and the specified string

public ascii string concat ( char sequence string ) { int this len = length ( ) ; int that len = string length ( ) ; if ( that len = = 0 ) { return this ; } if ( string instanceof ascii string ) { ascii string that = ( ascii string ) string ; if ( is empty ( ) ) { return that ; } byte [ ] new value = platform dependent allocate uninitialized array ( this len + that len ) ; system arraycopy ( value , array offset ( ) , new value , 0 , this len ) ; system arraycopy ( that value , that array offset ( ) , new value , this len , that len ) ; return new ascii string ( new value , false ) ; } if ( is empty ( ) ) { return new ascii string ( string ) ; } byte [ ] new value = platform dependent allocate uninitialized array ( this len + that len ) ; system arraycopy ( value , array offset ( ) , new value , 0 , this len ) ; for ( int i = this len , j = 0 ; i < new value length ; i + + , j + + ) { new value [ i ] = c 2b ( string char at ( j ) ) ; } return new ascii string ( new value , false ) ; }


gets the blacklisted tasktracker ' s name

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


zooms in by 1 4f , x and y are the coordinates ( in pixels ) of the zoom center

public matrix zoom in ( float x , float y ) { matrix save = new matrix ( ) ; zoom in ( x , y , save ) ; return save ; }


runs the command line interface given some arguments

public optional < throwable > run ( string arguments ) { try { if ( is flag ( help , arguments ) ) { parser print help ( std out ) ; } else if ( is flag ( version , arguments ) ) { parser print version ( std out ) ; } else { final namespace namespace = parser parse args ( arguments ) ; final command command = require non null ( commands get ( namespace get string ( command name attr ) ) , " command is not found " ) ; try { command run ( bootstrap , namespace ) ; } catch ( throwable e ) { / / the command failed to run , and the command knows / / best how to cleanup / debug exception command on error ( this , namespace , e ) ; return optional of ( e ) ; } } return optional empty ( ) ; } catch ( help screen exception ignored ) { / / this exception is triggered when the user passes in a help flag / / return true to signal that the process executed normally return optional empty ( ) ; } catch ( argument parser exception e ) { std err println ( e get message ( ) ) ; e get parser ( ) print help ( std err ) ; return optional of ( e ) ; } }


one or more endpoints associated with the service < code > repeated istio networking v 1alpha 3 service entry endpoint endpoints = 6 ; < code >

public java util list < ? extends com alibaba nacos istio model naming service entry endpoint or builder > get endpoints or builder list ( ) { return endpoints ; }


add the given { @ link handler method return value handler handler method return value handlers }

public handler method return value handler composite add handlers ( @ nullable list < ? extends handler method return value handler > handlers ) { if ( handlers ! = null ) { this return value handlers add all ( handlers ) ; } return this ; }


records a new test run result and incrementally updates the target status this event is sent upon completion of executed test runs

public void test event ( test result result ) { action owner test owner = result get test action ( ) get owner ( ) ; configured target key configured target key = configured target key builder ( ) set label ( test owner get label ( ) ) set configuration ( result get test action ( ) get configuration ( ) ) build ( ) ; aggregators get ( configured target key ) test event ( result ) ; }


public path get input file for write ( task i d map id , long size , configuration conf ) throws i o exception { return l dir alloc get local path for write ( string format ( reduce input file format string , tasktracker output , map id get id ( ) ) , size , conf ) ; }


void close all peers ( ) { log info ( " closing all peers " ) ; lock lock ( ) ; try { peers key set ( ) for each ( p - > i o utils close quietly ( p ) ) ; peers clear ( ) ; peers xceiver clear ( ) ; datanode metrics set data node active xceivers count ( 0 ) ; this no peers signal all ( ) ; } finally { lock unlock ( ) ; } }


test proper handling where an object is not equal to one the user has said should be equal

public void test invalid not equals equal object ( ) { equals tester add equality group ( reference , not equal object 1 ) ; try { equals tester test equals ( ) ; } catch ( assertion failed error e ) { assert error message ( e , reference + " [ group 1 , item 1 ] " ) ; assert error message ( e , not equal object 1 + " [ group 1 , item 2 ] " ) ; return ; } fail ( " should get not equal to equal object error " ) ; }


get an array of objects that implement the given interface class

public < t > t [ ] get services ( class < t > interface class ) { list < object > list = services by interface get ( interface class ) ; if ( list = = null ) { return ( t [ ] ) java lang reflect array new instance ( interface class , 0 ) ; } t [ ] objs = ( t [ ] ) java lang reflect array new instance ( interface class , list size ( ) ) ; return list to array ( objs ) ; }


get the ending address for this code unit

public address get max address ( ) { return max address ; }


return true to trigger { @ literal @ } on exited range method defined in the component , do nothing otherwise

boolean should exit range ( int position , int first visible index , int last visible index , int first fully visible index , int last fully visible index ) ;


simple pattern match to determine whether an ip should be checked could stand to be extended to support " real " ip addresses and patterns , but for the local first implementation regex made more sense

protected boolean ip pattern matches ( final string remote ip ) { val matcher = this ips to check pattern matcher ( remote ip ) ; if ( matcher find ( ) ) { logger debug ( " remote ip address [ { } ] should be checked based on the defined pattern [ { } ] " , remote ip , this ips to check pattern pattern ( ) ) ; return true ; } logger debug ( " no pattern or remote ip defined , or pattern does not match remote ip [ { } ] " , remote ip ) ; return false ; }


if validation required is true and the history data file has been updated , the history data will be re - initialized from the file this is undesirable and is only required when mulitple instances of a local folder item are used for a specific item path ( e g , unit testing )

private void validate ( ) throws i o exception { if ( local file system is refresh required ( ) ) { versions = null ; min version = 0 ; cur version = 0 ; } file history file = get history file ( ) ; if ( history file exists ( ) ) { version [ ] old versions = versions ; int old min version = min version ; int old cur version = cur version ; boolean success = false ; try { read history file ( ) ; success = true ; } finally { if ( ! success ) { versions = old versions ; min version = old min version ; cur version = old cur version ; } } } else { versions = new version [ 0 ] ; } }


adds a releasable that will be freed when this context is closed

public void add releasable ( releasable releasable ) { / / todo most releasables are managed by their callers we probably don ' t need this releasables add ( releasable ) ; }


public static string get description ( ) { return " provides coordination and a service for all auto analysis tasks " ; }


map settings for cache seconds to specific url paths via patterns overrides the default cache seconds setting of this interceptor can specify " - 1 " to exclude a url path from default caching for pattern syntax see { @ link ant path matcher } and { @ link path pattern } as well as the class - level javadoc for details for when each is used the syntax is largely the same with { @ link path pattern } more tailored for web usage < b > note : < b > path patterns are not supposed to overlap if a request matches several mappings , it is effectively undefined which one will apply ( due to the lack of key ordering in { @ code java util properties } )

public void set cache mappings ( properties cache mappings ) { this cache mappings clear ( ) ; enumeration < ? > prop names = cache mappings property names ( ) ; while ( prop names has more elements ( ) ) { string path = ( string ) prop names next element ( ) ; int cache seconds = integer parse int ( cache mappings get property ( path ) ) ; this cache mappings put ( this pattern parser parse ( path ) , cache seconds ) ; } }


set the default compression type for sequence files

static public void set default compression type ( configuration job , compression type val ) { job set ( " io seqfile compression type " , val to string ( ) ) ; }


copies a collection of { @ code boolean } instances into a new array of primitive { @ code boolean } values elements are copied from the argument collection as if by { @ code collection to array ( ) } calling this method is as thread - safe as calling that method < b > note : < b > consider representing the collection as a { @ link java util bit set } instead

public static boolean [ ] to array ( collection < boolean > collection ) { if ( collection instanceof boolean array as list ) { return ( ( boolean array as list ) collection ) to boolean array ( ) ; } object [ ] boxed array = collection to array ( ) ; int len = boxed array length ; boolean [ ] array = new boolean [ len ] ; for ( int i = 0 ; i < len ; i + + ) { / / check not null for gwt ( do not optimize ) array [ i ] = ( boolean ) check not null ( boxed array [ i ] ) ; } return array ; }


public builder subprotocol ( string subprotocol ) { this subprotocol = subprotocol ; return this ; }


public static int px 2dp ( final float px value ) { final float scale = resources get system ( ) get display metrics ( ) density ; return ( int ) ( px value / scale + 0 5f ) ; }


parse a serialized metadata value from an ascii string

t parse ascii string ( string serialized ) ;


public state store metrics get metrics ( ) { return metrics ; }


replaces the given instruction by an infinite loop

private void replace by infinite loop ( clazz clazz , int offset , instruction instruction ) { / / replace the instruction by an infinite loop instruction replacement instruction = new branch instruction ( instruction constants op goto , 0 ) ; if ( debug ) system out println ( " replacing unreachable instruction by infinite loop " + replacement instruction to string ( offset ) ) ; code attribute editor replace instruction ( offset , replacement instruction ) ; / / visit the instruction , if required if ( extra instruction visitor ! = null ) { / / note : we ' re not passing the right arguments for now , knowing that / / they aren ' t used anyway instruction accept ( clazz , null , null , offset , extra instruction visitor ) ; } }


sections support 1 - bit flags that describe miscellaneous attributes flag definitions appear aove

public long get flags ( ) { return sh flags ; }


asserts that a prior call that had caused this thread to block or wait has since returned normally

public void assert prior call returns ( @ nullable string method name ) throws exception { assert equals ( null , get response ( method name ) get result ( ) ) ; }


returns the line number info corresponding to the given byte code program counter

public line number info get line number info ( int pc ) { for ( int index = u 2line number table length - 1 ; index > = 0 ; index - - ) { line number info info = line number table [ index ] ; if ( pc > = info u 2start p c ) { return info ; } } return u 2line number table length > 0 ? line number table [ 0 ] : null ; }


adds a set of functions to the target list

public void add targets ( set < function > functions ) { targets add all ( functions ) ; }


have datanode manager check decommission state

public static void recheck decommission state ( datanode manager dm ) throws execution exception , interrupted exception { dm get datanode admin manager ( ) run monitor for test ( ) ; }


schedules a task to occur once as soon as possible , but not sooner than the start of the next frame

public task post task ( task task ) { return schedule task ( task , 0 , 0 , 0 ) ; }


sets the java package will be ignored except when parsing resources with data binding

public android resource parsing action builder set java package ( @ nullable string java package ) { this java package = java package ; return this ; }


generate the hash smash for a superior full hashinferior id

public static long generate inferior full hash smash ( fid hash quad superior function , function record inferior function ) { long hash value = inferior function get key ( ) * f n v 1a 6 4 message digest fnv 64 prime ; / / improve bit diversity on key return hash value ^ superior function get full hash ( ) ; }


increment the write operation counter this is somewhat inaccurate , as it appears to be invoked more often than needed in progress callbacks

public void increment write operations ( ) { statistics increment write ops ( 1 ) ; }


obtain a jms topic session that is synchronized with the current transaction , if any mainly intended for use with the jms 1 0 2 api

public static topic session get transactional topic session ( final topic connection factory cf , @ nullable final topic connection existing con , final boolean synched local transaction allowed ) throws j m s exception { return ( topic session ) do get transactional session ( cf , new resource factory ( ) { @ override @ nullable public session get session ( jms resource holder holder ) { return holder get session ( topic session class , existing con ) ; } @ override @ nullable public connection get connection ( jms resource holder holder ) { return ( existing con ! = null ? existing con : holder get connection ( topic connection class ) ) ; } @ override public connection create connection ( ) throws j m s exception { return cf create topic connection ( ) ; } @ override public session create session ( connection con ) throws j m s exception { return ( ( topic connection ) con ) create topic session ( synched local transaction allowed , session auto acknowledge ) ; } @ override public boolean is synched local transaction allowed ( ) { return synched local transaction allowed ; } } , true ) ; }


determine if the it is network exception

public static boolean is net exception ( throwable throwable ) { net exception type net exception type = get net exception type ( throwable ) ; return net exception type ! = null & & net exception type ! = net exception type not net exception ; }


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

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


adds command - line options for a static library or non - library input into options

private void add static input link options ( linker input input , sequence builder libraries to link , nested set builder < linker input > expanded linker inputs builder ) { artifact category artifact category = input get artifact category ( ) ; preconditions check argument ( artifact category equals ( artifact category object file ) | | artifact category equals ( artifact category static library ) | | artifact category equals ( artifact category alwayslink static library ) ) ; boolean is always link static library = artifact category = = artifact category alwayslink static library ; / / input disable whole archive ( ) should only be true for libstdc + + / libc + + etc boolean input is whole archive = ! input disable whole archive ( ) & & ( is always link static library | | need whole archive ) ; / / if we had any lto artifacts , lto map whould be non - null in that case , / / we should have created a thinlto param file which the lto indexing / / step will populate with the exec paths that correspond to the lto / / artifacts that the linker decided to include based on symbol resolution / / those files will be included directly in the link ( and not wrapped / / in - - start - lib / - - end - lib ) to ensure consistency between the two link / / steps preconditions check state ( lto map = = null | | thinlto param file ! = null | | ! allow lto indexing ) ; / / start - lib / end - lib library : adds its input object files if ( link use start end lib ( input , cpp helper get archive type ( cpp configuration , cc toolchain provider , feature configuration ) ) ) { iterable < artifact > archive members = input get object files ( ) ; if ( ! iterables is empty ( archive members ) ) { immutable list builder < artifact > non lto archive members builder = immutable list builder ( ) ; for ( artifact member : archive members ) { artifact a ; if ( lto map ! = null & & ( a = lto map remove ( member ) ) ! = null ) { / / when lto map is non - null the backend artifact may be missing due to libraries that / / list o files explicitly , or generate o files from assembler if ( handled by lto indexing ( a , allow lto indexing ) ) { / / the lto artifacts that should be included in the final link / / are listed in the thinlto param file , generated by the lto indexing / / even if this object file is being skipped for exposure as a build variable , it ' s / / still an input to this action expanded linker inputs builder add ( linker inputs simple linker input ( a , artifact category object file , / * disable whole archive = * / false , a get root relative path string ( ) ) ) ; continue ; } / / no lto indexing step , so use the lto backend ' s generated artifact directly / / instead of the bitcode object member = a ; } non lto archive members builder add ( member ) ; expanded linker inputs builder add ( linker inputs simple linker input ( member , artifact category object file , / * disable whole archive = * / false , member get root relative path string ( ) ) ) ; } immutable list < artifact > non lto archive members = non lto archive members builder build ( ) ; if ( ! non lto archive members is empty ( ) ) { if ( input is whole archive ) { for ( artifact member : non lto archive members ) { if ( member is tree artifact ( ) ) { / / todo ( b / 78189629 ) : this object filegroup is expanded at action time but wrapped / / with - - start / - - end - lib there ' s currently no way to force these objects to be / / linked in libraries to link add value ( library to link value for object file group ( immutable list < artifact > of ( member ) , / * is whole archive = * / true ) ) ; } else { / / todo ( b / 78189629 ) : these each need to be their own library to link value so they ' re / / not wrapped in - - start / - - end - lib ( which lets the linker leave out objects with / / unreferenced code ) libraries to link add value ( library to link value for object file ( member get exec path string ( ) , / * is whole archive = * / true ) ) ; } } } else { libraries to link add value ( library to link value for object file group ( non lto archive members , / * is whole archive = * / false ) ) ; } } } } else { artifact input artifact = input get artifact ( ) ; artifact a ; if ( lto map ! = null & & ( a = lto map remove ( input artifact ) ) ! = null ) { if ( handled by lto indexing ( a , allow lto indexing ) ) { / / the lto artifacts that should be included in the final link / / are listed in the thinlto param file , generated by the lto indexing / / even if this object file is being skipped for exposure as a build variable , it ' s / / still an input to this action expanded linker inputs builder add ( linker inputs simple linker input ( a , artifact category object file , / * disable whole archive = * / false , a get root relative path string ( ) ) ) ; return ; } / / no lto indexing step , so use the lto backend ' s generated artifact directly / / instead of the bitcode object input artifact = a ; } if ( artifact category equals ( artifact category object file ) ) { if ( input artifact is tree artifact ( ) ) { libraries to link add value ( library to link value for object file group ( immutable list < artifact > of ( input artifact ) , input is whole archive ) ) ; } else { libraries to link add value ( library to link value for object file ( input artifact get exec path string ( ) , input is whole archive ) ) ; } if ( ! input is linkstamp ( ) ) { expanded linker inputs builder add ( input ) ; } } else { libraries to link add value ( library to link value for static library ( input artifact get exec path string ( ) , input is whole archive ) ) ; expanded linker inputs builder add ( input ) ; } } }


this sets the { @ link delayed data check config } settings see { @ link delayed data check config } for more information

public builder set delayed data check config ( delayed data check config delayed data check config ) { this delayed data check config = delayed data check config ; return this ; }


fires the event for the provided { @ link transaction state }

protected void fire transaction event ( transaction state transaction state , boolean execute in new context ) { if ( state transaction listeners = = null ) { return ; } final list < transaction listener > transaction listeners = state transaction listeners get ( transaction state ) ; if ( transaction listeners = = null ) { return ; } if ( execute in new context ) { command executor command executor = command context get process engine configuration ( ) get command executor ( ) ; command config command config = new command config ( false , transaction propagation requires new ) ; command executor execute ( command config , new command < void > ( ) { public void execute ( command context command context ) { execute transaction listeners ( transaction listeners , command context ) ; return null ; } } ) ; } else { execute transaction listeners ( transaction listeners , command context ) ; } }


returns the number of bytes currently being used to store the values in this cache this may be greater than the max size if a background deletion is pending

public synchronized long size ( ) { return size ; }


public integer get snake case ( ) { return snake case ; }


underlying drawable ' s aspect ratio is smaller than view ' s , so it has to be slided vertically after scaling focus point is at 40 % and it can be completely centered

public void test configure bounds focus crop vc ( ) { rect bounds = new rect ( 10 , 10 , 410 , 310 ) ; int width = 200 ; int height = 300 ; point f focus point = new point f ( 0 5f , 0 4f ) ; matrix expected matrix = new matrix ( ) ; expected matrix set scale ( 2 0f , 2 0f ) ; expected matrix post translate ( 10 , - 79 ) ; test configure bounds ( bounds , width , height , scale type focus crop , focus point , expected matrix ) ; / / expected bounds of the actual image after the scaling has been performed ( without cropping ) test actual image bounds ( new rect f ( 1 0f , - 7 9f , 4 1 0f , 5 2 1f ) ) ; }


add the specified interface to the list of interfaces to introduce

public void add interface ( class < ? > ifc ) { assert not null ( ifc , " interface must not be null " ) ; if ( ! ifc is interface ( ) ) { throw new illegal argument exception ( " specified class [ " + ifc get name ( ) + " ] must be an interface " ) ; } this interfaces add ( ifc ) ; }


public static void set ip address ( string ip address ) { xid ip address = ip address ; }


this is like { @ link # get h t m l string ( ) } , but does not put html tags around the data

public string get h t m l content string ( ) { return original h t m l data ; }


this function combines the per - file encryption info ( obtained from the inode ' s x attrs ) , and the encryption info from its zone , and returns a consolidated file encryption info instance null is returned for non - encrypted or raw files

static file encryption info get file encryption info ( final f s directory fsd , final i nodes in path iip ) throws i o exception { if ( iip is raw ( ) | | ! fsd ez manager has created encryption zone ( ) | | ! iip get last i node ( ) is file ( ) ) { return null ; } fsd read lock ( ) ; try { encryption zone encryption zone = get e z for path ( fsd , iip ) ; if ( encryption zone = = null ) { / / not an encrypted file return null ; } else if ( encryption zone get path ( ) = = null | | encryption zone get path ( ) is empty ( ) ) { if ( name node log is debug enabled ( ) ) { name node log debug ( " encryption zone " + encryption zone get path ( ) + " does not have a valid path " ) ; } } x attr file x attr = f s dir x attr op unprotected get x attr by prefixed name ( iip get last i node ( ) , iip get path snapshot id ( ) , crypto xattr file encryption info ) ; if ( file x attr = = null ) { name node log warn ( " could not find encryption x attr for file " + iip get path ( ) + " in encryption zone " + encryption zone get path ( ) ) ; return null ; } final crypto protocol version version = encryption zone get version ( ) ; final cipher suite suite = encryption zone get suite ( ) ; final string key name = encryption zone get key name ( ) ; try { hdfs protos per file encryption info proto file proto = hdfs protos per file encryption info proto parse from ( file x attr get value ( ) ) ; return p b helper client convert ( file proto , suite , version , key name ) ; } catch ( invalid protocol buffer exception e ) { throw new i o exception ( " could not parse file encryption info for " + " inode " + iip get path ( ) , e ) ; } } finally { fsd read unlock ( ) ; } }