test that server default values can be retrieved on the client side

public void test server defaults ( ) throws i o exception { try { vfs get server defaults ( not in mountpoint path ) ; fail ( " get server defaults on view fs did not throw excetion ! " ) ; } catch ( not in mountpoint exception e ) { fs server defaults server defaults = vfs get server defaults ( test file path ) ; assert equals ( dfs block size default , server defaults get block size ( ) ) ; assert equals ( dfs bytes per checksum default , server defaults get bytes per checksum ( ) ) ; assert equals ( dfs client write packet size default , server defaults get write packet size ( ) ) ; assert equals ( io file buffer size default , server defaults get file buffer size ( ) ) ; assert equals ( dfs replication default + 1 , server defaults get replication ( ) ) ; } }


returns the major version of the host java runtime ( e g ' 8 ' for jdk 8 ) , using { @ link runtime # version } if it is available , and otherwise falling back to the { @ code java class version } system property

static int host major version ( ) { try { method version method = runtime class get method ( " version " ) ; object version = version method invoke ( null ) ; return ( int ) version get class ( ) get method ( " major " ) invoke ( version ) ; } catch ( reflective operation exception e ) { / / runtime version ( ) isn ' t available on jdk 8 ; continue below } int version = ( int ) double parse double ( system get property ( " java class version " ) ) ; if ( 49 < = version & & version < = 52 ) { return version - ( 49 - 5 ) ; } throw new illegal state exception ( " unknown java version : " + system get property ( " java specification version " ) ) ; }


this method sets the subscription type if it is not already set ( i e when it is none ) , or verifies that the subscription type is equal to the give type when it is set ( i e when it is not none )

private void set subscription type ( subscription type type ) { if ( this subscription type = = subscription type none ) this subscription type = type ; else if ( this subscription type ! = type ) throw new illegal state exception ( subscription exception message ) ; }


public synchronized void dump ( print stream out ) { out println ( " string indexer content : \ n " ) ; out println ( indexer ) ; out println ( " action cache ( " + map size ( ) + " records ) : \ n " ) ; for ( map entry < integer , byte [ ] > entry : map entry set ( ) ) { if ( entry get key ( ) = = validation key ) { continue ; } string content ; try { content = compact persistent action cache decode ( indexer , entry get value ( ) ) to string ( ) ; } catch ( i o exception e ) { content = e + " \ n " ; } out println ( entry get key ( ) + " , " + indexer get string for index ( entry get key ( ) ) + " : \ n " + content + " \ n packed len = " + entry get value ( ) length + " \ n " ) ; } }


merges unsorted sections by reading them completely into memory and sorting in memory

public final void merge unsorted ( ) { get section ( contents out ) off = out get position ( ) ; list < unsorted value > all = new array list < unsorted value > ( ) ; for ( int i = 0 ; i < dexes length ; i + + ) { all add all ( read unsorted values ( dexes [ i ] , index maps [ i ] ) ) ; } collections sort ( all ) ; int out count = 0 ; for ( int i = 0 ; i < all size ( ) ; ) { unsorted value e 1 = all get ( i + + ) ; update index ( e 1 offset , e 1 index map , e 1 index , out count - 1 ) ; while ( i < all size ( ) & & e 1 compare to ( all get ( i ) ) = = 0 ) { unsorted value e 2 = all get ( i + + ) ; update index ( e 2 offset , e 2 index map , e 2 index , out count - 1 ) ; } write ( e 1 value ) ; out count + + ; } get section ( contents out ) size = out count ; }


get the { @ code n } th entry in the constant pool , which must be valid unless { @ code n = = 0 } , in which case { @ code null } is returned


returns the aliases as was originally specified by the user

public string [ ] get original aliases ( ) { return original aliases ; }


verify that successful znode create result becomes active and monitoring is started

public void test create node result become active ( ) throws exception { mock no prior active ( ) ; elector join election ( data ) ; elector process result ( code ok int value ( ) , zk lock name , mock z k , zk lock name ) ; mockito verify ( mock app , mockito times ( 1 ) ) become active ( ) ; verify exist call ( 1 ) ; / / monitor callback verifies the leader is ephemeral owner of lock but does / / not call become active since its already active stat stat = new stat ( ) ; stat set ephemeral owner ( 1l ) ; mockito when ( mock z k get session id ( ) ) then return ( 1l ) ; elector process result ( code ok int value ( ) , zk lock name , mock z k , stat ) ; / / should not call neutral mode / standby / active mockito verify ( mock app , mockito times ( 0 ) ) enter neutral mode ( ) ; mockito verify ( mock app , mockito times ( 0 ) ) become standby ( ) ; mockito verify ( mock app , mockito times ( 1 ) ) become active ( ) ; / / another join election not called mockito verify ( mock z k , mockito times ( 1 ) ) create ( zk lock name , data , ids open acl unsafe , create mode ephemeral , elector , mock z k ) ; / / no new monitor called verify exist call ( 1 ) ; }


sets layout constraint only if x y layout is active

public void set layout constraint ( edit part child , i figure child figure , object constraint ) { super set layout constraint ( child , child figure , constraint ) ; }


emits the given exception if possible or adds it to the given error container to be emitted by a concurrent on next if one is running undeliverable exceptions are sent to the rx java plugins on error

public static void on error ( observer < ? > observer , throwable ex , atomic integer wip , atomic throwable errors ) { if ( errors try add throwable or report ( ex ) ) { if ( wip get and increment ( ) = = 0 ) { errors try terminate consumer ( observer ) ; } } }


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


creates a { @ link future combiner } requiring that all passed in futures are successful if any input fails , the returned future fails immediately

public static < v > future combiner < v > when all succeed ( iterable < ? extends listenable future < ? extends v > > futures ) { return new future combiner < v > ( true , immutable list copy of ( futures ) ) ; }


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

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


public void triangle type test ( ) { / / todo : test triangle type }


returns a shift count that is used to align the logical sector < br > this count is log 2 of the segment sector size this value corresponds to the alignment [ a ] linker switch it is typically 4 , but the default is 9 when the linker command line contains a : 16 , the shift count is 4 when the linker command line contains a : 256 , the shift count is 9

short get segment alignment shift count ( ) { return ne align ; }


assert the total number of errors in the model

public result matcher error count ( int expected count ) { return result - > { int actual count = get error count ( get model and view ( result ) get model map ( ) ) ; assert equals ( " binding / validation error count " , expected count , actual count ) ; } ; }


see original { @ link stubber # do return ( object ) }

b d d stubber will return ( object to be returned ) ;


public map < t , mapping registration < t > > get registrations ( ) { return this registry ; }


creates the filesystem ; updates the { @ link # abfs } field

public azure blob file system create file system ( ) throws i o exception { if ( abfs = = null ) { abfs = ( azure blob file system ) file system new instance ( raw config ) ; } return abfs ; }


verifies that the automated { @ link descriptor } lookup works

public void descriptor lookup ( ) throws exception { descriptor < fish > d = new sishamo ( ) get descriptor ( ) ; descriptor extension list < fish , descriptor < fish > > list = j jenkins get descriptor list ( fish class ) ; assert same ( d , list get ( sishamo descriptor impl class ) ) ; assert same ( d , j jenkins get descriptor ( sishamo class ) ) ; }


returns the hedged read metrics object for this client

public d f s hedged read metrics get hedged read metrics ( ) { return dfs get hedged read metrics ( ) ; }


getter for the record - reader , opened to the chunk - file

public sequence file record reader < k , v > get reader ( ) { assert reader ! = null : " reader un - initialized ! " ; return reader ; }


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

public void update user test ( ) throws api exception { string username = null ; user body = null ; completable future < void > response = api update user ( username , body ) ; / / todo : test validations }


try to establish a connection to server with id sid the function will return quickly and the connection will be established asynchronously

synchronized void connect one ( long sid ) { if ( sender worker map get ( sid ) ! = null ) { log debug ( " there is a connection already for server { } " , sid ) ; if ( self is multi address enabled ( ) & & self is multi address reachability check enabled ( ) ) { / / since zookeeper - 3188 we can use multiple election addresses to reach a server it is possible , that the / / one we are using is already dead and we need to clean - up , so when we will create a new connection / / then we will choose an other one , which is actually reachable sender worker map get ( sid ) async validate if socket is still reachable ( ) ; } return ; } synchronized ( self qv lock ) { boolean known id = false ; / / resolve hostname for the remote server before attempting to / / connect in case the underlying ip address has changed self recreate socket addresses ( sid ) ; map < long , quorum peer quorum server > last committed view = self get view ( ) ; quorum verifier last seen q v = self get last seen quorum verifier ( ) ; map < long , quorum peer quorum server > last proposed view = last seen q v get all members ( ) ; if ( last committed view contains key ( sid ) ) { known id = true ; log debug ( " server { } knows { } already , it is in the last committed view " , self get id ( ) , sid ) ; if ( connect one ( sid , last committed view get ( sid ) election addr ) ) { return ; } } if ( last seen q v ! = null & & last proposed view contains key ( sid ) & & ( ! known id | | ( last proposed view get ( sid ) election addr ! = last committed view get ( sid ) election addr ) ) ) { known id = true ; log debug ( " server { } knows { } already , it is in the last proposed view " , self get id ( ) , sid ) ; if ( connect one ( sid , last proposed view get ( sid ) election addr ) ) { return ; } } if ( ! known id ) { log warn ( " invalid server id : { } " , sid ) ; } } }


return whether the given job object is eligible for having its bean properties populated the default implementation ignores { @ link quartz job bean } instances , which will inject bean properties themselves

protected boolean is eligible for property population ( object job object ) { return ( ! ( job object instanceof quartz job bean ) ) ; }


tests that when idle channels become active again , they need to " catch up " with the latest watermark before they are considered for min watermark computation again

public void test multiple input watermark realignment after resume active ( ) throws exception { status watermark output valve output = new status watermark output ( ) ; status watermark valve valve = new status watermark valve ( 3 ) ; valve input watermark ( new watermark ( 10 ) , 0 , valve output ) ; valve input watermark ( new watermark ( 7 ) , 1 , valve output ) ; valve input watermark ( new watermark ( 3 ) , 2 , valve output ) ; assert equals ( new watermark ( 3 ) , valve output pop last seen output ( ) ) ; assert equals ( null , valve output pop last seen output ( ) ) ; valve input stream status ( stream status idle , 2 , valve output ) ; assert equals ( new watermark ( 7 ) , valve output pop last seen output ( ) ) ; assert equals ( null , valve output pop last seen output ( ) ) ; / / let channel 2 become active again ; since the min watermark has now advanced to 7 , / / channel 2 should have been marked as non - aligned valve input stream status ( stream status active , 2 , valve output ) ; assert false ( valve get input channel status ( 2 ) is watermark aligned ) ; / / during the realignment process , watermarks should still be accepted by channel 2 ( but / / shouldn ' t yield new watermarks ) valve input watermark ( new watermark ( 5 ) , 2 , valve output ) ; assert equals ( 5 , valve get input channel status ( 2 ) watermark ) ; assert equals ( null , valve output pop last seen output ( ) ) ; / / let channel 2 catch up with the min watermark ; now should be realigned valve input watermark ( new watermark ( 9 ) , 2 , valve output ) ; assert true ( valve get input channel status ( 2 ) is watermark aligned ) ; assert equals ( null , valve output pop last seen output ( ) ) ; / / check that realigned inputs is now taken into account for watermark advancement valve input watermark ( new watermark ( 12 ) , 1 , valve output ) ; assert equals ( new watermark ( 9 ) , valve output pop last seen output ( ) ) ; assert equals ( null , valve output pop last seen output ( ) ) ; }


invokes { @ link audio renderer event listener # on audio position advancing ( long ) }

public void position advancing ( long playout start system time ms ) { if ( handler ! = null ) { handler post ( ( ) - > cast non null ( listener ) on audio position advancing ( playout start system time ms ) ) ; } }


resumes engine work paused " load & display " tasks will continue its work

void resume ( ) { paused set ( false ) ; synchronized ( pause lock ) { pause lock notify all ( ) ; } }


serialize the given query builder and asserts that both are equal

protected query builder assert serialization ( query builder test query , version version ) throws i o exception { try ( bytes stream output output = new bytes stream output ( ) ) { output set version ( version ) ; output write named writeable ( test query ) ; try ( stream input in = new named writeable aware stream input ( output bytes ( ) stream input ( ) , named writeable registry ( ) ) ) { in set version ( version ) ; query builder deserialized query = in read named writeable ( query builder class ) ; assert equals ( test query , deserialized query ) ; assert equals ( test query hash code ( ) , deserialized query hash code ( ) ) ; assert not same ( test query , deserialized query ) ; return deserialized query ; } } }


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


test serialization of object with outer number type

public single < outer composite > rx fake outer composite serialize ( outer composite body , api client auth info auth info ) { return single create ( new io vertx rx java single on subscribe adapter < > ( fut - > delegate fake outer composite serialize ( body , auth info , fut ) ) ) ; }


overridden here to ensure the test is only run if at least one type is present in the mappings geo queries do not execute if the field is not explicitly mapped

public void test to query ( ) throws i o exception { super test to query ( ) ; }


this is method can set the required < b > < code > dmang < code > < b > reference in this class the normal way of setting this is through the constructor , which takes the appropriate argument but if this class is constructed with < b > < code > new instance ( ) < code > < b > , then we need a way to set the value

public void set m d mang ( m d mang dmang ) { this dmang = dmang ; }


returns whether matrix organized as row major ( vs column major )

public boolean is row major ( ) { return row major ; }


add load indirect ( consumes 2 - bytes )

public void add bytes load ( string addr , int src reg index , int dest reg index ) throws memory access exception { add instruction words ( addr ( addr ) , ( short ) ( 0xd 6 0 0 | ( src reg index & 0x 0f ) | ( ( dest reg index & 0x 0f ) < < 4 ) ) ) ; / / load d , [ s ] }


should this request trigger a refresh ( { @ linkplain refresh policy # immediate } , the default ) , wait for a refresh ( { @ linkplain refresh policy # wait until } ) , or proceed ignore refreshes entirely ( { @ linkplain refresh policy # none } )

public refresh policy get refresh policy ( ) { return refresh policy ; }


public long append pointer and record ( long pointer , t record ) throws i o exception { set write position ( append position ) ; return no seek append pointer and record ( pointer , record ) ; }


returns whether or not the { @ code octet } is in the base 3 2 alphabet

public boolean is in alphabet ( final byte octet ) { return octet > = 0 & & octet < decode table length & & decode table [ octet ] ! = - 1 ; }


the model timestamp when these stats were created

public instant get timestamp ( ) { return timestamp ; }


resolve the zone to an inode , find the encryption zone info associated with that inode , and return the key name does not contact the kms

static string get key name for zone ( final f s directory dir , final f s permission checker pc , final string zone ) throws i o exception { assert dir get provider ( ) ! = null ; final i nodes in path iip ; dir get f s namesystem ( ) read lock ( ) ; try { iip = dir resolve path ( pc , zone , dir op read ) ; dir ez manager check encryption zone root ( iip get last i node ( ) , zone ) ; return dir ez manager get key name ( iip ) ; } finally { dir get f s namesystem ( ) read unlock ( ) ; } }


constructs an update operation arguments are as for the zoo keeper method of the same name

public static op set data ( string path , byte [ ] data , int version ) { return new set data ( path , data , version ) ; }


show a { @ link option dialog # plain message plain } { @ link ok dialog } with the given title and message

public static void show ( string title , string message ) { swing run now ( ( ) - > { new ok dialog ( title , message , option dialog plain message ) show ( ) ; } ) ; }


removes ' value ' from wrapped collection replacing this collection instance for array list from compact hash set

public synchronized boolean remove ( t value ) { collection < t > collection = this collection ; if ( collection = = null ) { / / null return false ; } int previous size = collection size ( ) ; if ( previous size = = 1 ) { if ( collection contains ( value ) ) { / / - > null this collection = null ; return true ; } else { return false ; } } / / now remove the value if ( collection remove ( value ) ) { / / may need to change representation if ( previous size = = 2 ) { / / - > singleton list list < t > list = collections singleton list ( collection iterator ( ) next ( ) ) ; this collection = list ; return true ; } else if ( previous size = = 1 + arraylist threshold ) { / / - > array list collection < t > new array list = new array list < > ( arraylist threshold ) ; new array list add all ( collection ) ; this collection = new array list ; return true ; } return true ; } return false ; }


generate the name to use to set the header defined by the specified { @ code header name } to the protocol specific message

protected string from header name ( string header name ) { string property name = header name ; if ( string utils has text ( this outbound prefix ) & & ! property name starts with ( this outbound prefix ) ) { property name = this outbound prefix + header name ; } return property name ; }


set the configuration for this service this method is called during { @ link # init ( configuration ) } and should only be needed if for some reason a service implementation needs to override that initial setting - for example replacing it with a new subclass of { @ link configuration }

protected void set config ( configuration conf ) { this config = conf ; }


checks whether or not { @ code symbol } can follow the current state in the atn the behavior of this method is equivalent to the following , but is implemented such that the complete context - sensitive follow set does not need to be explicitly constructed return get expected tokens ( ) contains ( symbol ) ;

public boolean is expected token ( int symbol ) { / / return get interpreter ( ) atn next tokens ( ctx ) ; atn atn = get interpreter ( ) atn ; parser rule context ctx = ctx ; a t n state s = atn states get ( get state ( ) ) ; interval set following = atn next tokens ( s ) ; if ( following contains ( symbol ) ) { return true ; } / / system out println ( " following " + s + " = " + following ) ; if ( ! following contains ( token epsilon ) ) return false ; while ( ctx ! = null & & ctx invoking state > = 0 & & following contains ( token epsilon ) ) { a t n state invoking state = atn states get ( ctx invoking state ) ; rule transition rt = ( rule transition ) invoking state transition ( 0 ) ; following = atn next tokens ( rt follow state ) ; if ( following contains ( symbol ) ) { return true ; } ctx = ( parser rule context ) ctx parent ; } if ( following contains ( token epsilon ) & & symbol = = token eof ) { return true ; } return false ; }


if the state store throws an error after recovery has been performed then we can not trust it any more to reflect the nm state we need to mark the store and node unhealthy errors during the recovery will cause a service failure and thus a nm start failure do not need to mark the store unhealthy for those

private void mark store un healthy ( d b exception db err ) { / / always log the error here , we might not see the error in the caller log error ( " statestore exception : " , db err ) ; / / we have already been marked unhealthy so no need to do it again if ( ! is healthy ) { return ; } / / mark unhealthy , an out of band heartbeat will be sent and the state / / will remain unhealthy ( not recoverable ) / / no need to close the store : does not make any difference at this point is healthy = false ; / / we could get here before the node status updater is set node status updater nsu = get node status updater ( ) ; if ( nsu ! = null ) { nsu report exception ( db err ) ; } }


sets the < code > name < code > property

public pet name ( string name ) { this name = name ; return this ; }


allocates a { @ value # default buffer size } byte [ ] for use as a temporary buffer and calls { @ link # copy stream ( input stream , output stream , byte [ ] ) }

public static void copy stream ( input stream input , output stream output ) throws i o exception { copy stream ( input , output , new byte [ default buffer size ] ) ; }


{ @ inherit doc } the default implementation does nothing

@ override public void exit show schemas ( sql base parser show schemas context ctx ) { }


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


retrieve the { @ linkplain platform transaction manager transaction manager } to use for the supplied { @ linkplain test context test context } the following algorithm is used to retrieve the transaction manager from the { @ link org springframework context application context application context } of the supplied test context : look up the transaction manager by type and explicit name , if the supplied { @ code name } is non - empty , throwing a { @ link beans exception } if the named transaction manager does not exist attempt to look up the transaction manager via a { @ link transaction management configurer } , if present attempt to look up the single transaction manager by type attempt to look up the primary transaction manager by type attempt to look up the transaction manager by type and the { @ linkplain # default transaction manager name default transaction manager name }

public static platform transaction manager retrieve transaction manager ( test context test context , @ nullable string name ) { assert not null ( test context , " test context must not be null " ) ; bean factory bf = test context get application context ( ) get autowire capable bean factory ( ) ; try { / / look up by type and explicit name if ( string utils has text ( name ) ) { return bf get bean ( name , platform transaction manager class ) ; } } catch ( beans exception ex ) { logger error ( string format ( " failed to retrieve transaction manager named ' % s ' for test context % s " , name , test context ) , ex ) ; throw ex ; } try { if ( bf instanceof listable bean factory ) { listable bean factory lbf = ( listable bean factory ) bf ; / / look up single transaction management configurer map < string , transaction management configurer > configurers = bean factory utils beans of type including ancestors ( lbf , transaction management configurer class ) ; assert state ( configurers size ( ) < = 1 , " only one transaction management configurer may exist in the application context " ) ; if ( configurers size ( ) = = 1 ) { transaction manager tm = configurers values ( ) iterator ( ) next ( ) annotation driven transaction manager ( ) ; assert state ( tm instanceof platform transaction manager , ( ) - > " transaction manager specified via transaction management configurer " + " is not a platform transaction manager : " + tm ) ; return ( platform transaction manager ) tm ; } / / look up single bean by type map < string , platform transaction manager > tx mgrs = bean factory utils beans of type including ancestors ( lbf , platform transaction manager class ) ; if ( tx mgrs size ( ) = = 1 ) { return tx mgrs values ( ) iterator ( ) next ( ) ; } try { / / look up single bean by type , with support for ' primary ' beans return bf get bean ( platform transaction manager class ) ; } catch ( beans exception ex ) { log beans exception ( test context , ex , platform transaction manager class ) ; } } / / look up by type and default name return bf get bean ( default transaction manager name , platform transaction manager class ) ; } catch ( beans exception ex ) { log beans exception ( test context , ex , platform transaction manager class ) ; return null ; } }


public boolean is support dtd ( ) { return this support dtd ; }


returns the { @ link org elasticsearch index store store } instance that provides access to the { @ link org apache lucene store directory } used for the engines { @ link org apache lucene index index writer } to write it ' s index files to note : in order to use this instance the consumer needs to increment the stores reference before it ' s used the first time and hold it ' s reference until it ' s not needed anymore

public store get store ( ) { return store ; }


by default does not support multiple emits per next token invocation for efficiency reasons subclass and override this method , next token , and get token ( to push tokens into a list and pull from that list rather than a single variable as this implementation does )

public void emit ( token token ) { / / system err println ( " emit " + token ) ; this token = token ; }


retain the given data buffer , if it is a { @ link pooled data buffer }

public static < t extends data buffer > t retain ( t data buffer ) { if ( data buffer instanceof pooled data buffer ) { return ( t ) ( ( pooled data buffer ) data buffer ) retain ( ) ; } else { return data buffer ; } }


public static list index request get list index request ( final string attribute name , final string attribute value , final object reference reference , final cloud directory properties cloud ) { val range = get object attribute ranges ( cloud get schema arn ( ) , cloud get facet name ( ) , attribute name , attribute value ) ; return list index request builder ( ) directory arn ( cloud get directory arn ( ) ) index reference ( reference ) ranges on indexed values ( range ) build ( ) ; }


finds a vertex that matches the given vertex < p > grouping can trigger vertex adds and removals this method is a way for subclasses to search for a vertex that matches the given vertex , but may or may not be the same instance

public abstract v find matching vertex ( v v ) ;


returns the after value set for this source

t get after ( ) { return after value ; }


assert that only a single subscription to a stream occurs and that all events are received

public void grouped event stream ( ) throws throwable { final atomic integer event counter = new atomic integer ( ) ; final atomic integer subscribe counter = new atomic integer ( ) ; final atomic integer group counter = new atomic integer ( ) ; final count down latch latch = new count down latch ( 1 ) ; final int count = 100 ; final int group count = 2 ; observable < event > es = observable unsafe create ( new observable source < event > ( ) { @ override public void subscribe ( final observer < ? super event > observer ) { observer on subscribe ( disposable empty ( ) ) ; system out println ( " * * * subscribing to event stream * * * " ) ; subscribe counter increment and get ( ) ; new thread ( new runnable ( ) { @ override public void run ( ) { for ( int i = 0 ; i < count ; i + + ) { event e = new event ( ) ; e source = i % group count ; e message = " event - " + i ; observer on next ( e ) ; } observer on complete ( ) ; } } ) start ( ) ; } } ) ; es group by ( new function < event , integer > ( ) { @ override public integer apply ( event e ) { return e source ; } } ) flat map ( new function < grouped observable < integer , event > , observable < string > > ( ) { @ override public observable < string > apply ( grouped observable < integer , event > event grouped observable ) { system out println ( " grouped observable key : " + event grouped observable get key ( ) ) ; group counter increment and get ( ) ; return event grouped observable map ( new function < event , string > ( ) { @ override public string apply ( event event ) { return " source : " + event source + " message : " + event message ; } } ) ; } } ) subscribe ( new default observer < string > ( ) { @ override public void on complete ( ) { latch count down ( ) ; } @ override public void on error ( throwable e ) { e print stack trace ( ) ; latch count down ( ) ; } @ override public void on next ( string output message ) { system out println ( output message ) ; event counter increment and get ( ) ; } } ) ; latch await ( 5000 , time unit milliseconds ) ; assert equals ( 1 , subscribe counter get ( ) ) ; assert equals ( group count , group counter get ( ) ) ; assert equals ( count , event counter get ( ) ) ; }


specify zoo keeper host : port for a particular context path the host : port string is passed to the zk client , so this can be formatted with more than a single host : port pair

synchronized public static void map context ( string context path , endpoint e ) { context map put ( context path , e ) ; }


discard all resources held by this class , notably the egl context

public void release ( ) { if ( m e g l ! = null ) { if ( m e g l egl get current context ( ) equals ( m e g l context ) ) { / / clear the current context and surface to ensure they are discarded immediately m e g l egl make current ( m e g l display , egl10 egl no surface , egl10 egl no surface , egl10 egl no context ) ; } m e g l egl destroy surface ( m e g l display , m e g l surface ) ; m e g l egl destroy context ( m e g l display , m e g l context ) ; / / m e g l egl terminate ( m e g l display ) ; } m surface release ( ) ; / / this causes a bunch of warnings that appear harmless but might confuse someone : / / w buffer queue : [ unnamed - 3997 - 2 ] cancel buffer : buffer queue has been abandoned ! / / m surface texture release ( ) ; / / null everything out so future attempts to use this object will cause an npe m e g l display = null ; m e g l context = null ; m e g l surface = null ; m e g l = null ; m texture render = null ; m surface = null ; m surface texture = null ; }


add the specified map data to this map within the size constraints of this map

void add change map data ( byte [ ] other map data ) { int limit = map data length ; if ( other map data length < limit ) { limit = other map data length ; } for ( int byte offset = 0 ; byte offset < limit ; byte offset + + ) { map data [ byte offset ] | = other map data [ byte offset ] ; } }


clear the variable that has the dragged data

void clear drag data ( ) { dragged nodes = null ; }


gets the minimum resource of this stream transformation

public resource spec get min resources ( ) { return min resources ; }


attempt to find the data type whose dt name and specified namespace match a stored data type within the specified data type manager the best match will be returned the namespace will be used in checking data type parent categories , however if no type corresponds to the namespace another type whose name matches may be returned

public static data type find data type ( data type manager data type manager , namespace namespace , string dt name , class < ? extends data type > class constraint ) { return find data type ( data type manager , dt name , class constraint , category path - > has preferred namespace category ( category path , namespace ) ) ; }


get a float parameter , throwing an exception if it isn ' t found or isn ' t a number

public static float get required float parameter ( servlet request request , string name ) throws servlet request binding exception { return float parser parse float ( name , request get parameter ( name ) ) ; }


returns an array containing all the long keys

public long [ ] get keys ( ) { return indexer get keys ( ) ; }


public static void clear ( @ non null final cache double utils cache double utils ) { cache double utils clear ( ) ; }


bitmap factory calculates the density scale factor as a float this introduces some non - trivial error this method attempts to account for that error by adjusting the in target density so that the final scale factor is as close to our target as possible

private static int adjust target density for error ( double adjusted scale factor ) { int density multiplier = get density multiplier ( adjusted scale factor ) ; int target density = round ( density multiplier * adjusted scale factor ) ; float scale factor with error = target density / ( float ) density multiplier ; double difference = adjusted scale factor / scale factor with error ; return round ( difference * target density ) ; }


creates a new builder that is pre - populated with the content of this container

public builder to builder ( ) { return new builder ( this ) ; }


sets the alias to rollover to another index

public void set new index name ( string new index name ) { this new index name = new index name ; }


initialize this service exporter , registering the service as rmi object creates an rmi registry on the specified port if none exists

public void prepare ( ) throws remote exception { check service ( ) ; if ( this service name = = null ) { throw new illegal argument exception ( " property ' service name ' is required " ) ; } / / check socket factories for exported object if ( this client socket factory instanceof r m i server socket factory ) { this server socket factory = ( r m i server socket factory ) this client socket factory ; } if ( ( this client socket factory ! = null & & this server socket factory = = null ) | | ( this client socket factory = = null & & this server socket factory ! = null ) ) { throw new illegal argument exception ( " both r m i client socket factory and r m i server socket factory or none required " ) ; } / / check socket factories for rmi registry if ( this registry client socket factory instanceof r m i server socket factory ) { this registry server socket factory = ( r m i server socket factory ) this registry client socket factory ; } if ( this registry client socket factory = = null & & this registry server socket factory ! = null ) { throw new illegal argument exception ( " r m i server socket factory without r m i client socket factory for registry not supported " ) ; } this created registry = false ; / / determine rmi registry to use if ( this registry = = null ) { this registry = get registry ( this registry host , this registry port , this registry client socket factory , this registry server socket factory ) ; this created registry = true ; } / / initialize and cache exported object this exported object = get object to export ( ) ; if ( logger is debug enabled ( ) ) { logger debug ( " binding service ' " + this service name + " ' to rmi registry : " + this registry ) ; } / / export rmi object if ( this client socket factory ! = null ) { unicast remote object export object ( this exported object , this service port , this client socket factory , this server socket factory ) ; } else { unicast remote object export object ( this exported object , this service port ) ; } / / bind rmi object to registry try { if ( this replace existing binding ) { this registry rebind ( this service name , this exported object ) ; } else { this registry bind ( this service name , this exported object ) ; } } catch ( already bound exception ex ) { / / already an rmi object bound for the specified service name unexport object silently ( ) ; throw new illegal state exception ( " already an rmi object bound for name ' " + this service name + " ' : " + ex to string ( ) ) ; } catch ( remote exception ex ) { / / registry binding failed : let ' s unexport the rmi object as well unexport object silently ( ) ; throw ex ; } }


returns < code > true < code > if the line is too long , < code > false < code > otherwise

private boolean is line too long ( i document document , int line ) throws bad location exception { string line contents = get line ( document , line ) ; return calculate displayed width ( line contents ) > get margin ( ) ; }


public void test hang on sink read ( ) throws exception { new config builder ( ) add ( " * period " , 8 ) add ( " test sink test class " , test sink class get name ( ) ) save ( test metrics config get test filename ( " hadoop - metrics 2 - test " ) ) ; metrics system impl ms = new metrics system impl ( " test " ) ; ms start ( ) ; try { count down latch collecting latch = new count down latch ( 1 ) ; metrics sink sink = new test closable sink ( collecting latch ) ; ms register sink ( " closeable sink " , " the sink will be used to test closeability " , sink ) ; / / trigger metric collection first time ms on timer event ( ) ; / / make sure that sink is collecting metrics assert true ( collecting latch await ( 1 , time unit seconds ) ) ; } finally { ms stop ( ) ; } }


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


public static endpoint find endpoint ( service record record , string api , boolean external , int address elements , int address tuple size ) { endpoint epr = external ? record get external endpoint ( api ) : record get internal endpoint ( api ) ; if ( epr ! = null ) { assert equals ( " wrong # of addresses " , address elements , epr addresses size ( ) ) ; assert equals ( " wrong # of elements in an address tuple " , address tuple size , epr addresses get ( 0 ) size ( ) ) ; return epr ; } list < endpoint > endpoints = external ? record external : record internal ; string builder builder = new string builder ( ) ; for ( endpoint endpoint : endpoints ) { builder append ( " \ " " ) append ( endpoint ) append ( " \ " " ) ; } fail ( " did not find " + api + " in endpoints " + builder ) ; / / never reached ; here to keep the compiler happy return null ; }


public long get bind slot ( ) { return ( ( data high level shader language symbol internals 3 2 extended ) internals ) get bind slot ( ) ; }


the primary payload for the resource < code > google protobuf any body = 2 ; < code >

public com google protobuf any or builder get body or builder ( ) { return get body ( ) ; }


notify the component tree that it needs to synchronously perform a state update

public void update state sync ( state update state update , string attribution ) { check if no state updates method ( ) ; if ( m component tree = = null ) { return ; } m component tree update state sync ( get global key ( ) , state update , attribution , is create layout in progress ( ) ) ; }


decommissioning using a pre - configured exclude hosts file

public void test decommission with exclude hosts ( ) throws exception { configuration conf = new configuration ( ) ; conf set ( yarn configuration rm nodes exclude file path , host file get absolute path ( ) ) ; write to hosts file ( " " ) ; rm = new mock r m ( conf ) ; rm start ( ) ; mock n m nm 1 = rm register node ( " host 1 : 1234 " , 5120 ) ; mock n m nm 2 = rm register node ( " host 2 : 5678 " , 10240 ) ; mock n m nm 3 = rm register node ( " localhost : 4433 " , 1024 ) ; int metric count = cluster metrics get metrics ( ) get num decommisioned n ms ( ) ; node heartbeat response node heartbeat = nm 1 node heartbeat ( true ) ; assert assert true ( node action normal equals ( node heartbeat get node action ( ) ) ) ; node heartbeat = nm 2 node heartbeat ( true ) ; assert assert true ( node action normal equals ( node heartbeat get node action ( ) ) ) ; rm drain events ( ) ; / / to test that i ps also work string ip = net utils normalize host name ( " localhost " ) ; write to hosts file ( " host 2 " , ip ) ; rm get nodes list manager ( ) refresh nodes ( conf ) ; check decommissioned n m count ( rm , metric count + 2 ) ; node heartbeat = nm 1 node heartbeat ( true ) ; assert assert true ( node action normal equals ( node heartbeat get node action ( ) ) ) ; node heartbeat = nm 2 node heartbeat ( true ) ; assert assert true ( " the decommisioned metrics are not updated " , node action shutdown equals ( node heartbeat get node action ( ) ) ) ; node heartbeat = nm 3 node heartbeat ( true ) ; assert assert true ( " the decommisioned metrics are not updated " , node action shutdown equals ( node heartbeat get node action ( ) ) ) ; rm drain events ( ) ; write to hosts file ( " " ) ; rm get nodes list manager ( ) refresh nodes ( conf ) ; nm 3 = rm register node ( " localhost : 4433 " , 1024 ) ; node heartbeat = nm 3 node heartbeat ( true ) ; rm drain events ( ) ; assert assert true ( node action normal equals ( node heartbeat get node action ( ) ) ) ; / / decommissined node is 1 since 1 node is rejoined after updating exclude / / file check decommissioned n m count ( rm , metric count + 1 ) ; }


delete purchase order by id for valid response try integer i ds with value & lt ; 1000 anything above 1000 or nonintegers will generate api errors < b > 400 < b > - invalid id supplied < b > 404 < b > - order not found

public mono < void > delete order ( string order id ) throws web client response exception { object post body = null ; / / verify the required parameter ' order id ' is set if ( order id = = null ) { throw new web client response exception ( " missing the required parameter ' order id ' when calling delete order " , http status bad request value ( ) , http status bad request get reason phrase ( ) , null , null , null ) ; } / / create path and map variables final map < string , object > path params = new hash map < string , object > ( ) ; path params put ( " order id " , order id ) ; final multi value map < string , string > query params = new linked multi value map < string , string > ( ) ; final http headers header params = new http headers ( ) ; final multi value map < string , string > cookie params = new linked multi value map < string , string > ( ) ; final multi value map < string , object > form params = new linked multi value map < string , object > ( ) ; final string [ ] local var accepts = { } ; final list < media type > local var accept = api client select header accept ( local var accepts ) ; final string [ ] local var content types = { } ; final media type local var content type = api client select header content type ( local var content types ) ; string [ ] local var auth names = new string [ ] { } ; parameterized type reference < void > local var return type = new parameterized type reference < void > ( ) { } ; return api client invoke a p i ( " / store / order / { order id } " , http method delete , path params , query params , post body , header params , cookie params , form params , local var accept , local var content type , local var auth names , local var return type ) ; }


public void put ( @ non null final string key , final parcelable value , final int save time ) { m cache memory utils put ( key , value , save time ) ; m cache disk utils put ( key , value , save time ) ; }


public swipe builder 2 right ( ) { return with directions ( item touch helper right ) ; }


public long get blocksize k b ( ) { return blocksize k b ; }


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


the response resources wrapped in the common mcp resource message these are typed resources that match the type url in the request resources message when ` incremental ` is true , this contains an array of resources to addupdate for the specified collection this modifies the existing collection at the sink when ` incremental ` is false , this contains the full set of resources for the specified collection this replaces any previously delivered resources < code > repeated istio mcp v 1alpha 1 resource resources = 3 ; < code >

public com alibaba nacos istio model mcp resource get resources ( int index ) { if ( resources builder = = null ) { return resources get ( index ) ; } else { return resources builder get message ( index ) ; } }


reads the map following a < code > type map < code > code

public tree map read map ( ) throws i o exception { int length = read map header ( ) ; tree map result = new tree map ( ) ; for ( int i = 0 ; i < length ; i + + ) { object key = read ( ) ; object value = read ( ) ; result put ( key , value ) ; } return result ; }


required if mode is ` simple ` or ` mutual ` the path to the file holding the server ' s private key < code > string private key = 4 ; < code >

public builder clear private key ( ) { private key = get default instance ( ) get private key ( ) ; on changed ( ) ; return this ; }


tries to fulfill with the given allocated slot a pending slot request or add the allocated slot to the set of available slots if no matching request is available

private void try fulfill slot request or make available ( allocated slot allocated slot ) { preconditions check state ( ! allocated slot is used ( ) , " provided slot is still in use " ) ; final pending request pending request = find matching pending request ( allocated slot ) ; if ( pending request ! = null ) { log debug ( " fulfilling pending slot request [ { } ] with slot [ { } ] " , pending request get slot request id ( ) , allocated slot get allocation id ( ) ) ; remove pending request ( pending request get slot request id ( ) ) ; allocated slots add ( pending request get slot request id ( ) , allocated slot ) ; pending request get allocated slot future ( ) complete ( allocated slot ) ; / / this allocation may become orphan once its corresponding request is removed final optional < allocation i d > allocation id of request = pending request get allocation id ( ) ; / / the allocation id can be null if the request was fulfilled by a slot directly offered / / by a reconnected task executor before the resource manager is connected if ( allocation id of request is present ( ) ) { maybe remap orphaned allocation ( allocation id of request get ( ) , allocated slot get allocation id ( ) ) ; } } else { log debug ( " adding slot [ { } ] to available slots " , allocated slot get allocation id ( ) ) ; available slots add ( allocated slot , clock relative time millis ( ) ) ; } }


{ @ inherit doc } the default implementation does nothing

@ override public void exit logical binary ( sql base parser logical binary context ctx ) { }


returns the parent task id that tasks should be filtered by

public task id get parent task id ( ) { return parent task id ; }


public int compare to ( byte writable o ) { int this value = this value ; int that value = o value ; return ( this value < that value ? - 1 : ( this value = = that value ? 0 : 1 ) ) ; }


called when the { @ link surface texture } receives a new frame from its image producer


public int write debug info item ( debug info item debug info item ) { ensure four bytes aligned ( table of contents debug infos , true ) ; return super write debug info item ( debug info item ) ; }


sets the encapsulated char to the specified value

public void set value ( char value ) { this value = value ; }


returns the index of the closest value inside the values array ranges ( stacked barchart ) to the value given as a parameter

protected int get closest stack index ( range [ ] ranges , float value ) { if ( ranges = = null | | ranges length = = 0 ) return 0 ; int stack index = 0 ; for ( range range : ranges ) { if ( range contains ( value ) ) return stack index ; else stack index + + ; } int length = math max ( ranges length - 1 , 0 ) ; return ( value > ranges [ length ] to ) ? length : 0 ; } / /


formats the cluster uuid into json fields

public void format ( log event event , string builder to append to ) { if ( node and cluster id state listener node and cluster id get ( ) ! = null ) { to append to append ( node and cluster id state listener node and cluster id get ( ) v 2 ( ) ) ; } / / node id / cluster uuid not received yet , not appending }


calls the parser and returns any gathered deprecations

public list < string > get query deprecations ( named x content registry named x content registry ) { list < string > deprecations = new array list < > ( ) ; parse query ( named x content registry , deprecations ) ; return deprecations ; }


output the proper model name ( capitalized ) in case the name belongs to the type system it won ' t be renamed

public string to model name ( final string name ) { string result = camelize ( sanitize name ( name ) ) ; if ( ! string utils is empty ( model name prefix ) ) { result = model name prefix + " " + result ; } / / model name cannot use reserved keyword , e g return if ( is reserved word ( name ) ) { string model name = " model " + result ; logger warn ( name + " ( reserved word ) cannot be used as model name renamed to " + model name ) ; return model name ; } / / model name starts with number if ( result matches ( " ^ \ \ d * " ) ) { string model name = " model " + result ; / / e g 2 0 0 response = > model 2 0 0 response ( after camelize ) logger warn ( name + " ( model name starts with number ) cannot be used as model name renamed to " + model name ) ; return model name ; } if ( language specific primitives contains ( result ) ) { string model name = " model " + result ; logger warn ( name + " ( model name matches existing language type ) cannot be used as a model name renamed to " + model name ) ; return model name ; } if ( ! string utils is empty ( model name suffix ) ) { result = result + " " + model name suffix ; } return result ; }


returns a { @ link androidx media 2 common media metadata } corresponding to the given { @ link media item exo player media item }

protected androidx media 2 common media metadata get metadata ( media item exo player media item ) { @ nullable string title = exo player media item media metadata title ; androidx media 2 common media metadata builder metadata builder = new androidx media 2 common media metadata builder ( ) put string ( metadata key media id , exo player media item media id ) ; if ( title ! = null ) { metadata builder put string ( metadata key title , title ) ; metadata builder put string ( metadata key display title , title ) ; } return metadata builder build ( ) ; }


protected void render text ( string s ) { log debug ( " { } : { } " , mime type text , s ) ; context ( ) rendered = true ; response ( ) set content type ( mime type text ) ; writer ( ) print ( s ) ; }


test serialization of outer number types

public void fake outer number serialize test ( ) { big decimal body = null ; / / big decimal response = api fake outer number serialize ( body ) ; / / todo : test validations }


quick validation on the input to check some obvious fail conditions ( fail fast ) the input and returns the appropriate { @ link plan } associated with the specified { @ link queue } or throws an exception message illustrating the details of any validation check failures

public plan validate reservation update request ( reservation system reservation system , reservation update request request ) throws yarn exception { reservation id reservation id = request get reservation id ( ) ; plan plan = validate reservation ( reservation system , reservation id , audit constants update reservation request ) ; validate reservation definition ( reservation id , request get reservation definition ( ) , plan , audit constants update reservation request ) ; return plan ; }


this function tries to determine the fill value used by the current program the byte value occurring most is the winner

private string determine filler value ( ) throws exception { function iterator func iter = listing get functions ( true ) ; hash map < string , integer > fill values hash = new hash map < string , integer > ( ) ; while ( func iter has next ( ) & & ! monitor is cancelled ( ) ) { / / get undefined byte immediately following function address max address = func iter next ( ) get body ( ) get max address ( ) ; data undefined data = listing get undefined data at ( max address next ( ) ) ; if ( undefined data = = null ) { / / no undefined filler bytes found , keep going to next function continue ; } / / add filler to hash string key = program utilities get byte code string ( undefined data ) ; if ( fill values hash contains key ( key ) ) { / / hash already contains key , just increment count int val = fill values hash get ( key ) ; fill values hash put ( key , val + 1 ) ; } else { / / add to hash fill values hash put ( key , 1 ) ; } } println ( " possible filler values ( and their counts ) : " + fill values hash to string ( ) ) ; / / decide that filler value is the one with the greatest count string filler = get value with highest count ( fill values hash ) ; return filler ; }


returns the duration of the ad at index { @ code ad index in ad group } in the ad group at { @ code ad group index } , in microseconds , or { @ link c # time unset } if not yet known

public long get ad duration us ( int ad group index , int ad index in ad group ) { ad playback state ad group ad group = ad playback state ad groups [ ad group index ] ; return ad group count ! = c length unset ? ad group durations us [ ad index in ad group ] : c time unset ; }


public red black entry < k , v > get first ( ) { return min entry ; }


adds the given mount links to the given hadoop compatible file system path mount link mappings are in sources , targets at their respective index locations

static void add mount links to file ( string mount table , string [ ] sources , string [ ] targets , path mount table conf path , configuration conf ) throws i o exception , u r i syntax exception { child fs getter cfs = new view file system overload scheme child fs getter ( mount table conf path to uri ( ) get scheme ( ) ) ; try ( file system fs = cfs get new instance ( mount table conf path to uri ( ) , conf ) ) { try ( f s data output stream out = fs create ( mount table conf path ) ) { string prefix = new string builder ( constants config viewfs prefix ) append ( " " ) append ( ( mount table = = null ? config util get default mount table name ( conf ) : mount table ) ) append ( " " ) to string ( ) ; out write bytes ( " < configuration > " ) ; for ( int i = 0 ; i < sources length ; i + + ) { string src = sources [ i ] ; string target = targets [ i ] ; boolean is nfly = src starts with ( constants config viewfs link nfly ) ; out write bytes ( " < property > < name > " ) ; if ( is nfly ) { string [ ] src parts = src split ( " [ ] " ) ; assert assert equals ( " invalid n fly link format " , 3 , src parts length ) ; string actual src = src parts [ src parts length - 1 ] ; string params = src parts [ src parts length - 2 ] ; out write bytes ( prefix + constants config viewfs link nfly + " " + params + " " + actual src ) ; } else if ( constants config viewfs link fallback equals ( src ) ) { out write bytes ( prefix + constants config viewfs link fallback ) ; } else if ( constants config viewfs link merge slash equals ( src ) ) { out write bytes ( prefix + constants config viewfs link merge slash ) ; } else { out write bytes ( prefix + constants config viewfs link + " " + src ) ; } out write bytes ( " < / name > " ) ; out write bytes ( " < value > " ) ; out write bytes ( target ) ; out write bytes ( " < / value > < / property > " ) ; out flush ( ) ; } out write bytes ( ( " < / configuration > " ) ) ; out flush ( ) ; } } }


resize the internal table to given capacity

protected void resize ( int cap ) { int new capacity = actual array length ( cap ) ; if ( new capacity = = this capacity ) { return ; } this capacity = new capacity ; this threshold = ( int ) ( capacity * load factor ) ; this hash mask = capacity - 1 ; linked element [ ] old entries = entries ; entries = new linked element [ capacity ] ; for ( int i = 0 ; i < old entries length ; i + + ) { linked element e = old entries [ i ] ; while ( e ! = null ) { linked element next = e get next ( ) ; int index = get index ( ( e ) e ) ; e set next ( entries [ index ] ) ; entries [ index ] = e ; e = next ; } } }


public static set < string > get all running services ( ) { activity manager am = ( activity manager ) utils get app ( ) get system service ( context activity service ) ; list < running service info > info = am get running services ( 0x 7 f f f f f f f ) ; set < string > names = new hash set < > ( ) ; if ( info = = null | | info size ( ) = = 0 ) return null ; for ( running service info a info : info ) { names add ( a info service get class name ( ) ) ; } return names ; }


provide a comparator to sort request mapping infos matched to a request

protected comparator < request mapping info > get mapping comparator ( final http servlet request request ) { return ( info 1 , info 2 ) - > info 1 compare to ( info 2 , request ) ; }


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

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


public static void set default ( json json ) { json json = json ; }


retrieve the given column as string from the given result set might simply invoke { @ code result set get string } or work with { @ code result set get clob } , depending on the database and driver

string get clob as string ( result set rs , string column name ) throws s q l exception ;


source line and column info < code > optional aapt pb source position source = 3 ; < code >

com android aapt resources source position get source ( ) ;


returns a shallow copy of the tuple with swapped values


public synchronized void add ( string name , long value ) { mutable metric m = metrics map get ( name ) ; if ( m ! = null ) { if ( m instanceof mutable stat ) { ( ( mutable stat ) m ) add ( value ) ; } else { throw new metrics exception ( " unsupported add ( value ) for metric " + name ) ; } } else { metrics map put ( name , new rate ( name ) ) ; / / default is a rate metric add ( name , value ) ; } }


during normal use cases the { @ link ascii string } should be immutable , but if the underlying array is shared , and changes then this needs to be called

public void array changed ( ) { string = null ; hash = 0 ; }


default response entity < void > test body with query params ( string query , user body ) { return new response entity < > ( http status not implemented ) ; }


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


validates an implementation method such as { @ code eval ( ) } or { @ code accumulate ( ) }

private static void validate implementation method ( class < ? extends user defined function > clazz , boolean reject static , boolean is optional , string method name options ) { final set < string > name set = new hash set < > ( arrays as list ( method name options ) ) ; final list < method > methods = get all declared methods ( clazz ) ; boolean found = false ; for ( method method : methods ) { if ( ! name set contains ( method get name ( ) ) ) { continue ; } found = true ; final int modifier = method get modifiers ( ) ; if ( ! modifier is public ( modifier ) ) { throw new validation exception ( string format ( " method ' % s ' of function class ' % s ' is not public " , method get name ( ) , clazz get name ( ) ) ) ; } if ( modifier is abstract ( modifier ) ) { throw new validation exception ( string format ( " method ' % s ' of function class ' % s ' must not be abstract " , method get name ( ) , clazz get name ( ) ) ) ; } if ( reject static & & modifier is static ( modifier ) ) { throw new validation exception ( string format ( " method ' % s ' of function class ' % s ' must not be static " , method get name ( ) , clazz get name ( ) ) ) ; } } if ( ! found & & ! is optional ) { throw new validation exception ( string format ( " function class ' % s ' does not implement a method named % s " , clazz get name ( ) , name set stream ( ) map ( s - > " ' " + s + " ' " ) collect ( collectors joining ( " or " ) ) ) ) ; } }


there ' s a problem with the parser where in this case it skips over the first 2 records instead of to the end of the first record which is invalid json this means we miss the next record after a bad one

public void test read recover from bad json ( ) throws json parse exception , i o exception { / / no opening ' { ' string data = " \ " a \ " : 10 , \ " b \ " : 20 , \ " c \ " : 30 } \ n { \ " b \ " : 21 , \ " a \ " : 11 , \ " c \ " : 31 } \ n " + " { \ " c \ " : 32 , \ " b \ " : 22 , \ " a \ " : 12 } " ; x content parser parser = create parser ( data ) ; map < string , integer > field map = create field map ( ) ; x content record reader reader = new x content record reader ( parser , field map , mock ( logger class ) ) ; string record [ ] = new string [ 3 ] ; boolean got fields [ ] = new boolean [ 3 ] ; assert equals ( 0 , reader read ( record , got fields ) ) ; assert equals ( 3 , reader read ( record , got fields ) ) ; assert equals ( " 12 " , record [ 0 ] ) ; assert equals ( " 22 " , record [ 1 ] ) ; assert equals ( " 32 " , record [ 2 ] ) ; assert equals ( - 1 , reader read ( record , got fields ) ) ; }


marks the current { @ code writer index } in this buffer you can reposition the current { @ code writer index } to the marked { @ code writer index } by calling { @ link # reset writer index ( ) } the initial value of the marked { @ code writer index } is { @ code 0 }

public abstract byte buf mark writer index ( ) ;


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 }


gets called when the user clicks on the cancel action for the dialog

protected void cancel callback ( ) { cancelled = true ; close ( ) ; }


returns a { @ link decision } whether the given shard routing can be allocated on the given node the default is { @ link decision # always }

public decision can allocate ( shard routing shard routing , routing node node , routing allocation allocation ) { return can move ( shard routing , allocation ) ; }


public boolean get auto play animations ( ) { return m auto play animations ; }


returns the current type of link target set

public link target type get link target type ( ) { return link target type ; }


iterate through the list of providers , to find one with credentials if { @ link # reuse last provider } is true , then it is re - used

public a w s credentials get credentials ( ) { if ( is closed ( ) ) { log warn ( credentials requested when closed ) ; throw new no auth with a w s exception ( name + credentials requested when closed ) ; } check not empty ( ) ; if ( reuse last provider & & last provider ! = null ) { return last provider get credentials ( ) ; } amazon client exception last exception = null ; for ( a w s credentials provider provider : providers ) { try { a w s credentials credentials = provider get credentials ( ) ; preconditions check not null ( credentials , " null credentials returned by % s " , provider ) ; if ( ( credentials get a w s access key id ( ) ! = null & & credentials get a w s secret key ( ) ! = null ) | | ( credentials instanceof anonymous a w s credentials ) ) { last provider = provider ; log debug ( " using credentials from { } " , provider ) ; return credentials ; } } catch ( no aws credentials exception e ) { / / don ' t bother with the stack trace here as it is usually a / / minor detail / / only update the last exception if it isn ' t set / / why so ? stops delegation token issues being lost on the fallback / / values if ( last exception = = null ) { last exception = e ; } log debug ( " no credentials from { } : { } " , provider , e to string ( ) ) ; } catch ( amazon client exception e ) { last exception = e ; log debug ( " no credentials provided by { } : { } " , provider , e to string ( ) , e ) ; } } / / no providers had any credentials rethrow the last exception / / or create a new one string message = name + " no aws credentials provided by " + list provider names ( ) ; if ( last exception ! = null ) { message + = " : " + last exception ; } if ( last exception instanceof credential initialization exception ) { throw last exception ; } else { throw new no auth with a w s exception ( message , last exception ) ; } }


dump all components for use in { @ link # to string ( ) } representation

protected void dump components ( string builder buffer , string pad ) { / / limit output of filler components for unaligned structures data type component [ ] components = get defined components ( ) ; for ( data type component dtc : components ) { data type data type = dtc get data type ( ) ; buffer append ( pad + dtc get offset ( ) ) ; buffer append ( pad + data type get name ( ) ) ; if ( data type instanceof bit field data type ) { bit field data type bf dt = ( bit field data type ) data type ; buffer append ( " ( " ) ; buffer append ( integer to string ( bf dt get bit offset ( ) ) ) ; buffer append ( " ) " ) ; } buffer append ( pad + dtc get length ( ) ) ; buffer append ( pad + dtc get field name ( ) ) ; string comment = dtc get comment ( ) ; if ( comment = = null ) { comment = " " ; } buffer append ( pad + " \ " " + comment + " \ " " ) ; buffer append ( " \ n " ) ; } }


public reindex request add sort field ( string name , sort order order ) { this get search request ( ) source ( ) sort ( name , order ) ; return this ; }


protected void on session change ( wparam w param , lparam l param ) { switch ( w param int value ( ) ) { case wtsapi 3 2 wts console connect : { this on console connect ( l param int value ( ) ) ; break ; } case wtsapi 3 2 wts console disconnect : { this on console disconnect ( l param int value ( ) ) ; break ; } case wtsapi 3 2 wts session logon : { this on machine logon ( l param int value ( ) ) ; break ; } case wtsapi 3 2 wts session logoff : { this on machine logoff ( l param int value ( ) ) ; break ; } case wtsapi 3 2 wts session lock : { this on machine locked ( l param int value ( ) ) ; break ; } case wtsapi 3 2 wts session unlock : { this on machine unlocked ( l param int value ( ) ) ; break ; } } }


the number of search hits to return defaults to { @ code 10 }

public search request builder set size ( int size ) { source builder ( ) size ( size ) ; return this ; }


public boolean is in bounds x ( float x ) { return is in bounds left ( x ) & & is in bounds right ( x ) ; }


patch another - fakedummy : to test special tags to test special tags and operation id starting with number

default response entity < client > call 1 2 3test special tags ( @ api param ( value = " client model " , required = true ) @ valid @ request body client body ) { get request ( ) if present ( request - > { for ( media type media type : media type parse media types ( request get header ( " accept " ) ) ) { if ( media type is compatible with ( media type value of ( " application / json " ) ) ) { string example string = " { \ " client \ " : \ " client \ " } " ; api util set example response ( request , " application / json " , example string ) ; break ; } } } ) ; return new response entity < > ( http status not implemented ) ; }


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

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


returns a " smart " node client to a random node in the cluster

public client smart client ( ) { node and client random node and client = get random node and client ( ) ; if ( random node and client ! = null ) { return random node and client node client ( ) ; } throw new assertion error ( " no smart client found " ) ; }


returns the children of this value as a newly allocated short array

public short [ ] as short array ( ) { if ( type ! = value type array ) throw new illegal state exception ( " value is not an array : " + type ) ; short [ ] array = new short [ size ] ; int i = 0 ; for ( json value value = child ; value ! = null ; value = value next , i + + ) { short v ; switch ( value type ) { case string value : v = short parse short ( value string value ) ; break ; case double value : v = ( short ) value double value ; break ; case long value : v = ( short ) value long value ; break ; case boolean value : v = value long value ! = 0 ? ( short ) 1 : 0 ; break ; default : throw new illegal state exception ( " value cannot be converted to short : " + value type ) ; } array [ i ] = v ; } return array ; }


runtime classloader for loading user - defined classes


returns a new { @ link execution transition factory } for the default { @ link com google devtools build lib packages exec group }

public static execution transition factory create ( ) { return new execution transition factory ( default exec group name ) ; }


consider { @ code advisor } beans with the specified prefix as eligible , if activated

protected boolean is eligible advisor bean ( string bean name ) { if ( ! is use prefix ( ) ) { return true ; } string prefix = get advisor bean name prefix ( ) ; return ( prefix ! = null & & bean name starts with ( prefix ) ) ; }


weighted fair sharing test with min shares as in the min share test above , pool 1 has a min share greater than its demand so it only gets its demand pool 3 has a min share of 15 even though its weight is very small , so it gets 15 slots the remaining pools share the remaining 20 slots equally , getting 10 each pool 3 ' s min share of 5 slots doesn ' t affect this

public void test weighted sharing with min shares ( ) { scheds add ( new fake schedulable ( 20 , 2 0f ) ) ; scheds add ( new fake schedulable ( 0 , 1 0f ) ) ; scheds add ( new fake schedulable ( 5 , 1 0f ) ) ; scheds add ( new fake schedulable ( 15 , 0 5f ) ) ; compute fair shares compute shares ( scheds , resources create resource ( 45 ) , resource information memory mb get name ( ) ) ; verify memory shares ( 20 , 5 , 5 , 15 ) ; }


removes the edge connecting { @ code node u } to { @ code node v } , if it is present

boolean remove edge ( n node u , n node v ) ;


default boolean supports ( final authentication transaction transaction ) { return transaction ! = null ; }


returns providers that are missing if none are missing , returns { @ code required providers } that accept anything

public required providers get missing ( advertised provider set set ) { builder builder = accept any builder ( ) ; if ( constraint satisfies ( set , this , builder ) ) { / / ignore all collected missing providers return accept any builder ( ) build ( ) ; } return builder build ( ) ; }


returns an unspecified hash code for the contents of this immutable array

public int hash code ( ) { int hash = 1 ; for ( int i = start ; i < end ; i + + ) { hash * = 31 ; hash + = ints hash code ( array [ i ] ) ; } return hash ; }


returns true if field parallelism hint is set ( has been assigned a value ) and false otherwise

public boolean is set parallelism hint ( ) { return isset bit vector get ( parallelism hint isset id ) ; }


starts this service if it is not already running this method will block until the server has been fully started and is ready to handle commands

public void start ( ) throws i o exception { lock lock ( ) ; try { if ( process ! = null ) { return ; } process = new command line ( this executable , args to array ( new string [ ] { } ) ) ; process set environment variables ( environment ) ; process copy output to ( get output stream ( ) ) ; process execute async ( ) ; completable future < boolean > server started = completable future supply async ( ( ) - > { wait until available ( ) ; return true ; } ) ; completable future < boolean > process finished = completable future supply async ( ( ) - > { process wait for ( get timeout ( ) to millis ( ) ) ; return false ; } ) ; try { boolean started = ( boolean ) completable future any of ( server started , process finished ) get ( get timeout ( ) to millis ( ) * 2 , time unit milliseconds ) ; if ( ! started ) { process = null ; throw new web driver exception ( " driver server process died prematurely " ) ; } } catch ( execution exception | timeout exception e ) { throw new web driver exception ( " timed out waiting for driver server to start " , e ) ; } catch ( interrupted exception e ) { thread current thread ( ) interrupt ( ) ; throw new web driver exception ( " timed out waiting for driver server to start " , e ) ; } } finally { lock unlock ( ) ; } }


flink - 5667 tests that a concurrent cancel operation discards the state handles of a not yet acknowledged checkpoint and prevents sending an acknowledge message to the checkpoint coordinator the situation can only happen if the cancel call is executed before environment acknowledge checkpoint ( )

public void test async checkpointing concurrent close before acknowledge ( ) throws exception { final testing keyed state handle managed keyed state handle = new testing keyed state handle ( ) ; final testing keyed state handle raw keyed state handle = new testing keyed state handle ( ) ; final testing operator state handle managed operator state handle = new testing operator state handle ( ) ; final testing operator state handle raw operator state handle = new testing operator state handle ( ) ; final blocking runnable future < snapshot result < keyed state handle > > raw keyed state handle future = new blocking runnable future < > ( 2 , snapshot result of ( raw keyed state handle ) ) ; operator snapshot futures operator snapshot result = new operator snapshot futures ( done future of ( snapshot result of ( managed keyed state handle ) ) , raw keyed state handle future , done future of ( snapshot result of ( managed operator state handle ) ) , done future of ( snapshot result of ( raw operator state handle ) ) , done future of ( snapshot result empty ( ) ) , done future of ( snapshot result empty ( ) ) ) ; final one input stream operator < string , string > stream operator = stream operator with snapshot ( operator snapshot result ) ; final acknowledge dummy environment mock environment = new acknowledge dummy environment ( ) ; running task < mock stream task > task = run task ( ( ) - > create mock stream task ( mock environment , operator chain ( stream operator ) ) ) ; wait task is running ( task stream task , task invocation future ) ; final long checkpoint id = 42l ; task stream task trigger checkpoint async ( new checkpoint meta data ( checkpoint id , 1l ) , checkpoint options for checkpoint with default location ( ) , false ) ; raw keyed state handle future await run ( ) ; task stream task cancel ( ) ; final future utils conjunct future < void > discard future = future utils wait for all ( as list ( managed keyed state handle get discard future ( ) , raw keyed state handle get discard future ( ) , managed operator state handle get discard future ( ) , raw operator state handle get discard future ( ) ) ) ; / / make sure that all state handles have been discarded discard future get ( ) ; try { mock environment get acknowledge checkpoint future ( ) get ( 10l , time unit milliseconds ) ; fail ( " the checkpoint should not get acknowledged " ) ; } catch ( timeout exception expected ) { / / future should not be completed } task wait for task completion ( true ) ; }


hides all models currently located after the given model in the { @ link # models } list

protected void hide all after model ( epoxy model < ? > model ) { hide models ( get all models after ( model ) ) ; }


returns a list of parameters for invoking an overload of check state , check argument or check not null

private static immutable list < immutable list < class < ? > > > all signatures ( class < ? > predicate type ) { immutable set builder < immutable list < class < ? > > > all overloads = immutable set builder ( ) ; / / the first two are for the overloads that don ' t take formatting args , e g / / check argument ( boolean ) and check argument ( boolean , object ) all overloads add ( immutable list < class < ? > > of ( predicate type ) ) ; all overloads add ( immutable list < class < ? > > of ( predicate type , object class ) ) ; list < list < class < ? > > > types lists = new array list < > ( ) ; for ( int i = 0 ; i < 2 ; i + + ) { types lists add ( possible param types ) ; for ( list < class < ? > > curr : lists cartesian product ( types lists ) ) { all overloads add ( immutable list < class < ? > > builder ( ) add ( predicate type ) add ( string class ) / / the format string add all ( curr ) build ( ) ) ; } } return all overloads build ( ) as list ( ) ; }


add a maximum statistic to dynamically return the latest value of the source

public dynamic i o statistics builder with atomic integer maximum ( string key , atomic integer source ) { with long function maximum ( key , s - > source get ( ) ) ; return this ; }


gets oidc prompt from authorization request

public static set < string > get oidc prompt from authorization request ( final @ non null string url ) { return new u r i builder ( url ) get query params ( ) stream ( ) filter ( p - > oidc constants prompt equals ( p get name ( ) ) ) map ( param - > param get value ( ) split ( " " ) ) flat map ( arrays : : stream ) collect ( collectors to set ( ) ) ; }


removes all but the base acl entries of files and directories the entries for user , group , and others are retained for compatibility with permission bits

public void remove acl ( path path ) throws i o exception { path abs f = fix relative part ( path ) ; new f s link resolver < void > ( ) { @ override public void next ( final abstract file system fs , final path p ) throws i o exception { fs remove acl ( p ) ; return null ; } } resolve ( this , abs f ) ; }


clip a polygon with camera near plane if necessary

private int clip quad ( quaternion [ ] vertices in , quaternion [ ] vertices out ) { int num verts = vertices in length ; int num verts behind = 0 ; float [ ] s = new float [ 4 ] ; for ( int i = 0 ; i < num verts ; i + + ) { s [ i ] = vertices in [ i ] z + vertices in [ i ] w ; if ( s [ i ] < 0 ) num verts behind + + ; } if ( num verts behind = = num verts ) { / / all vertices outside frustum return 0 ; } else if ( num verts behind > 0 ) { / / some vertices are behind the camera , so perform clipping int new num verts = 0 ; for ( int i = num verts - 1 , j = 0 ; j < num verts ; i = j + + ) { quaternion a = tmp q 1 set ( vertices in [ i ] ) ; quaternion b = tmp q 2 set ( vertices in [ j ] ) ; float t = s [ i ] / ( a w + a z - b w - b z ) ; if ( ( t > 0 ) & & ( t < 1 ) ) vertices out [ new num verts + + ] set ( a ) mul add ( b sub ( a ) , t ) ; if ( s [ j ] > 0 ) vertices out [ new num verts + + ] set ( vertices in [ j ] ) ; } return new num verts ; } else { / / no clipping needed for ( int i = 0 ; i < num verts ; i + + ) vertices out [ i ] set ( vertices in [ i ] ) ; return num verts ; } }


public void set transaction isolation ( int level ) throws s q l exception { delegate set transaction isolation ( level ) ; transaction isolation = level ; dirty bits | = dirty bit isolation ; }


defines which spatial strategy will be used for building the geo shape query when not set , the strategy that will be used will be the one that is associated with the geo shape field in the mappings

public geo shape query builder strategy ( spatial strategy strategy ) { if ( strategy ! = null & & strategy = = spatial strategy term & & relation ! = shape relation intersects ) { throw new illegal argument exception ( " strategy [ " + strategy get strategy name ( ) + " ] only supports relation [ " + shape relation intersects get relation name ( ) + " ] found relation [ " + relation get relation name ( ) + " ] " ) ; } this strategy = strategy ; return this ; }


public long get total kb ( ) throws keyword not found exception { return get ram kb ( " mem total " ) ; }


applies a select function to the detected pattern sequence for each pattern sequence the provided { @ link pattern select function } is called the pattern select function can produce exactly one resulting element applies a timeout function to a partial pattern sequence which has timed out for each partial pattern sequence the provided { @ link pattern timeout function } is called the pattern timeout function can produce exactly one resulting element you can get the stream of timed - out data resulting from the { @ link single output stream operator # get side output ( output tag ) } on the { @ link single output stream operator } resulting from the select operation with the same { @ link output tag }

public < l , r > single output stream operator < r > select ( final output tag < l > timed out partial matches tag , final pattern timeout function < t , l > pattern timeout function , final pattern select function < t , r > pattern select function ) { final type information < r > right type info = type extractor get unary operator return type ( pattern select function , pattern select function class , 0 , 1 , type extractor no index , builder get input type ( ) , null , false ) ; return select ( timed out partial matches tag , pattern timeout function , right type info , pattern select function ) ; }


suspends encoding of the stream may be helpful if you need to embed a piece of base 6 4 - encoded data in a stream

public void suspend encoding ( ) throws java io i o exception { flush base 6 4 ( ) ; this suspend encoding = true ; }


creates an instance of type { @ link # type remote }

public static exo playback exception create for remote ( string message ) { return new exo playback exception ( type remote , message ) ; }


static resource estimator server start resource estimator server ( ) throws i o exception , interrupted exception { configuration config = new yarn configuration ( ) ; config add resource ( resource estimator configuration config file ) ; resource estimator server resource estimator server = null ; try { resource estimator server = new resource estimator server ( ) ; shutdown hook manager get ( ) add shutdown hook ( new composite service shutdown hook ( resource estimator server ) , 30 ) ; resource estimator server init ( config ) ; resource estimator server start ( ) ; } catch ( throwable t ) { logger error ( " error starting resource estimator server " , t ) ; } return resource estimator server ; }


public void test no record length ( ) throws exception { local fs delete ( work dir , true ) ; path file = new path ( work dir , new string ( " test format txt " ) ) ; create file ( file , null , 10 , 10 ) ; / / create the job and do not set fixed record length job job = job get instance ( default conf ) ; file input format set input paths ( job , work dir ) ; fixed length input format format = new fixed length input format ( ) ; list < input split > splits = format get splits ( job ) ; boolean exception thrown = false ; for ( input split split : splits ) { try { task attempt context context = map reduce test util create dummy map task attempt context ( job get configuration ( ) ) ; record reader < long writable , bytes writable > reader = format create record reader ( split , context ) ; map context < long writable , bytes writable , long writable , bytes writable > mcontext = new map context impl < long writable , bytes writable , long writable , bytes writable > ( job get configuration ( ) , context get task attempt i d ( ) , reader , null , null , map reduce test util create dummy reporter ( ) , split ) ; reader initialize ( split , mcontext ) ; } catch ( i o exception ioe ) { exception thrown = true ; log info ( " exception message : " + ioe get message ( ) ) ; } } assert true ( " exception for not setting record length : " , exception thrown ) ; }


return true if this pet object is equal to o

public boolean equals ( object o ) { if ( this = = o ) { return true ; } if ( o = = null | | get class ( ) ! = o get class ( ) ) { return false ; } pet pet = ( pet ) o ; return objects equals ( this id , pet id ) & & objects equals ( this category , pet category ) & & objects equals ( this name , pet name ) & & objects equals ( this photo urls , pet photo urls ) & & objects equals ( this tags , pet tags ) & & objects equals ( this status , pet status ) ; }


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


add the providers for the build dependencies

builder add deps ( list < configured target and data > deps ) { immutable list builder < objc provider > propagated objc deps = immutable list builder ( ) ; immutable list builder < cc info > cpp deps = immutable list builder ( ) ; immutable list builder < cc info > direct cpp deps = immutable list builder ( ) ; immutable list builder < cc linking context > cpp dep link params = immutable list builder ( ) ; for ( configured target and data dep : deps ) { configured target dep c t = dep get configured target ( ) ; if ( dep c t get ( objc provider starlark constructor ) ! = null ) { add any providers ( propagated objc deps , dep c t , objc provider starlark constructor ) ; } else { / / this is the way we inject cc library attributes into direct fields add any providers ( direct cpp deps , dep c t , cc info provider ) ; } add any providers ( cpp deps , dep c t , cc info provider ) ; if ( is cc library ( dep ) ) { cpp dep link params add ( dep c t get ( cc info provider ) get cc linking context ( ) ) ; } } add dep objc providers ( propagated objc deps build ( ) ) ; add dep cc header providers ( cpp deps build ( ) ) ; add dep cc direct providers ( direct cpp deps build ( ) ) ; this dep cc link providers = iterables concat ( this dep cc link providers , cpp dep link params build ( ) ) ; return this ; }


resolves the { @ link dns record } s that are matched by the specified { @ link dns question } unlike { @ link # query ( dns question ) } , this method handles redirection , c n a m es and multiple name servers if the specified { @ link dns question } is { @ code a } or { @ code aaaa } , this method looks up the configured { @ link hosts file entries } before sending a query to the name servers if a match is found in the { @ link hosts file entries } , a synthetic { @ code a } or { @ code aaaa } record will be returned

public final future < list < dns record > > resolve all ( dns question question , iterable < dns record > additionals , promise < list < dns record > > promise ) { final dns record [ ] additionals array = to array ( additionals , true ) ; return resolve all ( question , additionals array , promise ) ; }


tests if character in the input string is a vowel

boolean is vowel ( int at ) { if ( ( at < 0 ) | | ( at > = m length ) ) { return false ; } char it = char at ( at ) ; if ( is vowel ( it ) ) { return true ; } return false ; }


sets what group this channel belongs to group information is only used for presentation , not for behavior only modifiable before the channel is submitted to { @ link notification manager # create notification channel ( notification channel ) } , unless the channel is not currently part of a group

public channel config set group ( string group id ) { if ( build version sdk int > = build version codes o ) { m notification channel set group ( group id ) ; } return this ; }


the sink node making the request < code > istio mcp v 1alpha 1 sink node sink node = 1 ; < code >

public builder clear sink node ( ) { if ( sink node builder = = null ) { sink node = null ; on changed ( ) ; } else { sink node = null ; sink node builder = null ; } return this ; }


used for verifyinspect error received from server

void on rpc error ( throwable exception ) ;


callback after a given method successfully returned

void after returning ( @ nullable object return value , method method , object [ ] args , @ nullable object target ) throws throwable ;


clear all the data for storing associated models ' data

void clear associated data ( ) { clear id of model with f k ( ) ; clear id of model without f k ( ) ; clear id of model for join table ( ) ; clear f k name list ( ) ; }


lazy creation of the { @ link terms enum } for each segment present in this reader

private terms enum [ ] get or load terms enums ( ) { if ( lookups = = null ) { lookups = new terms enum [ segment afd length ] ; for ( int i = 0 ; i < lookups length ; i + + ) { try { lookups [ i ] = segment afd [ i ] get ordinals values ( ) terms enum ( ) ; } catch ( i o exception e ) { throw new unchecked i o exception ( " failed to load terms enum " , e ) ; } } } return lookups ; }


encode integer according to < a href = " https : tools ietf orghtmlrfc 7 5 4 1 # section - 5 1 " > section 5 1

private static void encode integer ( byte buf out , int mask , int n , long i ) { assert n > = 0 & & n < = 8 : " n : " + n ; int nbits = 0x f f > > > ( 8 - n ) ; if ( i < nbits ) { out write byte ( ( int ) ( mask | i ) ) ; } else { out write byte ( mask | nbits ) ; long length = i - nbits ; for ( ; ( length & ~ 0x 7 f ) ! = 0 ; length > > > = 7 ) { out write byte ( ( int ) ( ( length & 0x 7 f ) | 0x 8 0 ) ) ; } out write byte ( ( int ) length ) ; } }


applies { @ link json path expectations helper # assert value is array ( string ) }

public web test client body content spec is array ( ) { this path helper assert value is array ( this content ) ; return this body spec ; }


we can only handle patch version change in the main process , we will need to kill all other process to ensure that all process ' s code is the same you can delete the old patch version file as { @ link default load reporter # on load patch version changed ( string , string , file , string ) } or you can restart your other process here

public void on load patch version changed ( string old version , string new version , file patch directory file , string current patch name ) { share tinker log i ( tag , " patch load reporter on load patch version changed : patch version change from " + old version + " to " + new version ) ; if ( old version = = null | | new version = = null ) { return ; } if ( old version equals ( new version ) ) { return ; } / / check main process if ( ! tinker with ( context ) is main process ( ) ) { return ; } / / / / unnecessary now since other processes are killed in tinker loader / / share tinker log i ( tag , " on load patch version changed , try kill all other process " ) ; / / / / kill all other process to ensure that all process ' s code is the same / / share tinker internals kill all other process ( context ) ; / / reset retry count to 1 , for interpret retry upgrade patch retry get instance ( context ) on patch reset max check ( new version ) ; / / delete old patch files file [ ] files = patch directory file list files ( ) ; if ( files ! = null ) { for ( file file : files ) { string name = file get name ( ) ; if ( file is directory ( ) & & ! name equals ( current patch name ) ) { share patch file util delete dir ( file ) ; } } } }


the total amount of time spend on executing delete operations

public time value get delete time ( ) { return new time value ( delete time in millis ) ; }


compare the actual output with the expected output

private boolean compare test output ( comparator data compdata , result cmd result ) { / / compare the output based on the comparator string comparator type = compdata get comparator type ( ) ; class < ? > comparator class = null ; / / if test mode is " test " , then run the command and compare the output / / if test mode is " nocompare " , then run the command and dump the output / / do not compare boolean compare output = false ; if ( test mode equals ( testmode test ) ) { try { / / initialize the comparator class and run its compare method comparator class = class for name ( " org apache hadoop cli util " + comparator type ) ; comparator base comp = ( comparator base ) comparator class new instance ( ) ; compare output = comp compare ( cmd result get command output ( ) , expand command ( compdata get expected output ( ) ) ) ; } catch ( exception e ) { log info ( " error in instantiating the comparator " + e ) ; } } return compare output ; }


remove entire project note : this will not remove the parent < code > directory < code > of the project

public static boolean delete project ( string directory , string name ) { project locator locator = new project locator ( directory , name ) ; file lock file = locator get project lock file ( ) ; if ( ! delete lock file ( lock file ) ) { throw new assert exception ( " project is in use and can ' t be deleted : " + locator get project dir ( ) ) ; } file project dir = locator get project dir ( ) ; boolean success = delete dir ( locator get project dir ( ) ) ; if ( ! success ) { / / make sure the dir exists before failing if ( project dir exists ( ) ) { return false ; } } locator get marker file ( ) delete ( ) ; return true ; }


public void for each insn ( ssa insn visitor visitor ) { / / this gets called a lot , and not using an iterator / / saves a lot of allocations and reduces memory usage int len = insns size ( ) ; for ( int i = 0 ; i < len ; i + + ) { insns get ( i ) accept ( visitor ) ; } }


polyfill of objects hash that can be used on api < 19

public static int hash ( object values ) { return arrays hash code ( values ) ; }


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


get a list of events related to the entity

public list < timeline event > get events ( ) { return events ; }


tests the effect of { @ link with plugin }

@ test public void with recipe hpi ( ) { assert not null ( r jenkins get plugin ( " legacy " ) ) ; }


updates the context register extent and clears the context register filter

public void update extent and clear filter ( context register extent context register extent ) { this extent = context register extent ; this register filter = null ; }


sets the query that is to be executed for every record

public cassandra sink builder < in > set query ( string query ) { this query = query ; return this ; }


adds an { @ link delete request } to the list of actions to execute

public bulk processor add ( delete request request ) { return add ( ( doc write request < ? > ) request ) ; }


returns a fingerprint of a token the fingerprint is suitable for use in logging , because it cannot be used to determine the secret the fingerprint is built using the first 10 bytes of a sha - 256 hash of the string encoding of the token the returned string contains the hex representation of each byte , delimited by a space

static string build token fingerprint ( token < ? extends token identifier > tk ) throws i o exception { char [ ] digest = digest utils sha 2 5 6 hex ( tk encode to url string ( ) ) to char array ( ) ; string builder fingerprint = new string builder ( ) ; for ( int i = 0 ; i < 10 ; + + i ) { if ( i > 0 ) { fingerprint append ( ' ' ) ; } fingerprint append ( digest [ 2 * i ] ) ; fingerprint append ( digest [ 2 * i + 1 ] ) ; } return fingerprint to string ( ) ; }


return the day of week in chinese the pattern is { @ code yyyy - mm - dd hh : mm : ss }

public static string get chinese week ( final string time ) { return get chinese week ( string 2 date ( time , get default format ( ) ) ) ; }


wrap a comparator in one for this direction

public abstract < t > comparator < t > wrap ( comparator < t > delegate ) ;


gets a url for the internet connection check

public string get connection check url ( ) { data dt = get data ( ) ; if ( dt = = null ) return " http : / / www google com / " ; return dt connection check url ; }


type - safe alternative to { @ link # for base package ( string ) } to specify a base package through a class

public builder base package class ( class < ? > package classes ) { arrays stream ( package classes ) for each ( clazz - > add base package ( class utils get package name ( clazz ) ) ) ; return this ; }


reads a { @ link named writeable } from the current stream , by first reading its name and then looking for the corresponding entry in the registry by name , so that the proper object can be read and returned default implementation throws { @ link unsupported operation exception } as stream input doesn ' t hold a registry use { @ link filter input stream } instead which wraps a stream and supports a { @ link named writeable registry } too

public < c extends named writeable > c read named writeable ( @ suppress warnings ( " unused " ) class < c > category class ) throws i o exception { throw new unsupported operation exception ( " can ' t read named writeable from stream input " ) ; }


override this if you do not want to depend on { @ link s q lite database }

public void on create ( database db ) { / / do nothing by default }


public string get errors ( ) { string [ ] error snapshot = error store to array ( new string [ 0 ] ) ; string builder errors = new string builder ( ) ; for ( string error : error snapshot ) { errors append ( error ) append ( ' \ n ' ) ; } return errors to string ( ) ; }


hash codes on statuses are not well defined

public int hash code ( ) { return super hash code ( ) ; }


creates a new ewma which is equivalent to the unix fifteen minute load average and which expects to be ticked every 5 seconds

public static ewma fifteen minute e w m a ( ) { return new ewma ( m15 alpha , interval , time unit seconds ) ; }