the test verifies that the am re - runs maps that have run on bad nodes it also verifies that the am records all successkilled events so that reduces are notified about map output status changes it also verifies that the re - run information is preserved across am restart

public void test updated nodes ( ) throws exception { int run count = 0 ; async dispatcher dispatcher = new async dispatcher ( ) ; dispatcher init ( new configuration ( ) ) ; dispatcher disp = mockito spy ( dispatcher ) ; m r app app = new m r app with history ( 2 , 2 , false , this get class ( ) get name ( ) , true , + + run count , disp ) ; configuration conf = new configuration ( ) ; / / after half of the map completion , reduce will start conf set float ( m r job config completed maps for reduce slowstart , 0 5f ) ; / / uberization forces full slowstart ( 1 0 ) , so disable that conf set boolean ( m r job config job ubertask enable , false ) ; container alloc event handler handler = new container alloc event handler ( ) ; disp register ( container allocator event type class , handler ) ; final job job 1 = app submit ( conf ) ; app wait for state ( job 1 , job state running ) ; assert assert equals ( " num tasks not correct " , 4 , job 1 get tasks ( ) size ( ) ) ; iterator < task > it = job 1 get tasks ( ) values ( ) iterator ( ) ; task map task 1 = it next ( ) ; task map task 2 = it next ( ) ; / / all maps must be running app wait for state ( map task 1 , task state running ) ; app wait for state ( map task 2 , task state running ) ; task attempt task 1 attempt = map task 1 get attempts ( ) values ( ) iterator ( ) next ( ) ; task attempt task 2 attempt = map task 2 get attempts ( ) values ( ) iterator ( ) next ( ) ; node id node 1 = task 1 attempt get node id ( ) ; node id node 2 = task 2 attempt get node id ( ) ; assert assert equals ( node 1 , node 2 ) ; / / send the done signal to the task app get context ( ) get event handler ( ) handle ( new task attempt event ( task 1 attempt get i d ( ) , task attempt event type ta done ) ) ; app get context ( ) get event handler ( ) handle ( new task attempt event ( task 2 attempt get i d ( ) , task attempt event type ta done ) ) ; / / all maps must be succeeded app wait for state ( map task 1 , task state succeeded ) ; app wait for state ( map task 2 , task state succeeded ) ; final int check interval millis = 100 ; final int wait for millis = 800 ; wait for ( new supplier < boolean > ( ) { @ override public boolean get ( ) { task attempt completion event [ ] events = job 1 get task attempt completion events ( 0 , 100 ) ; return events length = = 2 ; } } , check interval millis , wait for millis ) ; task attempt completion event [ ] events = job 1 get task attempt completion events ( 0 , 100 ) ; assert assert equals ( " expecting 2 completion events for success " , 2 , events length ) ; / / send updated nodes info array list < node report > updated nodes = new array list < node report > ( ) ; node report nr = record factory provider get record factory ( null ) new record instance ( node report class ) ; nr set node id ( node 1 ) ; nr set node state ( node state unhealthy ) ; updated nodes add ( nr ) ; app get context ( ) get event handler ( ) handle ( new job updated nodes event ( job 1 get i d ( ) , updated nodes ) ) ; app wait for state ( task 1 attempt , task attempt state killed ) ; app wait for state ( task 2 attempt , task attempt state killed ) ; wait for ( new supplier < boolean > ( ) { @ override public boolean get ( ) { task attempt completion event [ ] events = job 1 get task attempt completion events ( 0 , 100 ) ; return events length = = 4 ; } } , check interval millis , wait for millis ) ; events = job 1 get task attempt completion events ( 0 , 100 ) ; assert assert equals ( " expecting 2 more completion events for killed " , 4 , events length ) ; / / 2 map task attempts which were killed above should be requested from / / container allocator with the previous map task marked as failed if / / this happens allocator will request the container for this mapper from / / rm at a higher priority of 5 ( i e with a priority equivalent to that of / / a fail fast map ) handler wait for failed map container req events ( 2 ) ; / / all maps must be back to running app wait for state ( map task 1 , task state running ) ; app wait for state ( map task 2 , task state running ) ; iterator < task attempt > itr = map task 1 get attempts ( ) values ( ) iterator ( ) ; itr next ( ) ; task 1 attempt = itr next ( ) ; / / send the done signal to the task app get context ( ) get event handler ( ) handle ( new task attempt event ( task 1 attempt get i d ( ) , task attempt event type ta done ) ) ; / / map 1 must be succeeded map 2 must be running app wait for state ( map task 1 , task state succeeded ) ; app wait for state ( map task 2 , task state running ) ; wait for ( new supplier < boolean > ( ) { @ override public boolean get ( ) { task attempt completion event [ ] events = job 1 get task attempt completion events ( 0 , 100 ) ; return events length = = 5 ; } } , check interval millis , wait for millis ) ; events = job 1 get task attempt completion events ( 0 , 100 ) ; assert assert equals ( " expecting 1 more completion events for success " , 5 , events length ) ; / / crash the app again app stop ( ) ; / / rerun / / in rerun the 1st map will be recovered from previous run app = new m r app with history ( 2 , 2 , false , this get class ( ) get name ( ) , false , + + run count , ( dispatcher ) new async dispatcher ( ) ) ; conf = new configuration ( ) ; conf set boolean ( m r job config mr am job recovery enable , true ) ; conf set boolean ( m r job config job ubertask enable , false ) ; final job job 2 = app submit ( conf ) ; app wait for state ( job 2 , job state running ) ; assert assert equals ( " no of tasks not correct " , 4 , job 2 get tasks ( ) size ( ) ) ; it = job 2 get tasks ( ) values ( ) iterator ( ) ; map task 1 = it next ( ) ; map task 2 = it next ( ) ; task reduce task 1 = it next ( ) ; task reduce task 2 = it next ( ) ; / / map 1 will be recovered , no need to send done app wait for state ( map task 1 , task state succeeded ) ; app wait for state ( map task 2 , task state running ) ; wait for ( new supplier < boolean > ( ) { @ override public boolean get ( ) { task attempt completion event [ ] events = job 2 get task attempt completion events ( 0 , 100 ) ; return events length = = 2 ; } } , check interval millis , wait for millis ) ; events = job 2 get task attempt completion events ( 0 , 100 ) ; assert assert equals ( " expecting 2 completion events for killed & success of map 1 " , 2 , events length ) ; task 2 attempt = map task 2 get attempts ( ) values ( ) iterator ( ) next ( ) ; app get context ( ) get event handler ( ) handle ( new task attempt event ( task 2 attempt get i d ( ) , task attempt event type ta done ) ) ; app wait for state ( map task 2 , task state succeeded ) ; wait for ( new supplier < boolean > ( ) { @ override public boolean get ( ) { task attempt completion event [ ] events = job 2 get task attempt completion events ( 0 , 100 ) ; return events length = = 3 ; } } , check interval millis , wait for millis ) ; events = job 2 get task attempt completion events ( 0 , 100 ) ; assert assert equals ( " expecting 1 more completion events for success " , 3 , events length ) ; app wait for state ( reduce task 1 , task state running ) ; app wait for state ( reduce task 2 , task state running ) ; task attempt task 3 attempt = reduce task 1 get attempts ( ) values ( ) iterator ( ) next ( ) ; app get context ( ) get event handler ( ) handle ( new task attempt event ( task 3 attempt get i d ( ) , task attempt event type ta done ) ) ; app wait for state ( reduce task 1 , task state succeeded ) ; app get context ( ) get event handler ( ) handle ( new task attempt event ( task 3 attempt get i d ( ) , task attempt event type ta kill ) ) ; app wait for state ( reduce task 1 , task state succeeded ) ; task attempt task 4 attempt = reduce task 2 get attempts ( ) values ( ) iterator ( ) next ( ) ; app get context ( ) get event handler ( ) handle ( new task attempt event ( task 4 attempt get i d ( ) , task attempt event type ta done ) ) ; app wait for state ( reduce task 2 , task state succeeded ) ; wait for ( new supplier < boolean > ( ) { @ override public boolean get ( ) { task attempt completion event [ ] events = job 2 get task attempt completion events ( 0 , 100 ) ; return events length = = 5 ; } } , check interval millis , wait for millis ) ; events = job 2 get task attempt completion events ( 0 , 100 ) ; assert assert equals ( " expecting 2 more completion events for reduce success " , 5 , events length ) ; / / job succeeds app wait for state ( job 2 , job state succeeded ) ; }


public void int 6 4 test ( ) { / / todo : test int 6 4 }


get a named { @ link thread factory } that just builds daemon threads

public static thread factory new daemon thread factory ( final string prefix ) { final thread factory named factory = get named thread factory ( prefix ) ; return new thread factory ( ) { @ override public thread new thread ( runnable r ) { thread t = named factory new thread ( r ) ; if ( ! t is daemon ( ) ) { t set daemon ( true ) ; } if ( t get priority ( ) ! = thread norm priority ) { t set priority ( thread norm priority ) ; } return t ; } } ; }


application entry point the application under development is a web application normally you would probably have a backend that is probably implemented in an object - oriented language ( e g java ) that serves the frontend which comprises of a series of html , css , js etc for illustrations purposes only , a very simple static html app is used here this main method just fires up this simple web app in a default browser

public static void main ( string [ ] args ) { try { var class loader = app class get class loader ( ) ; var application file = new file ( class loader get resource ( " sample - ui / login html " ) get path ( ) ) ; / / should work for unix like os ( mac , unix etc ) if ( desktop is desktop supported ( ) ) { desktop get desktop ( ) open ( application file ) ; } else { / / java desktop not supported - above unlikely to work for windows so try the / / following instead runtime get runtime ( ) exec ( " cmd exe start " + application file ) ; } } catch ( i o exception ex ) { ex print stack trace ( ) ; } }


advances the position until after the next newline character if the line is terminated by " \ r \ n " , the ' \ n ' must be consumed as whitespace by the caller

private void skip to end of line ( ) throws i o exception { long index = source index of element ( linefeed or carriage return ) ; buffer skip ( index ! = - 1 ? index + 1 : buffer size ( ) ) ; }


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

public response entity < void > delete user ( @ api param ( value = " the name that needs to be deleted " , required = true ) @ path variable ( " username " ) string username ) { return new response entity < > ( http status not implemented ) ; }


try set cgroup devices params for the container using container - executor if it has real device major number , minor number or dev path , we ' ll do the enforcement otherwise , won ' t do it

private void try isolate devices ( device mapping manager device allocation allocation , string container id str ) throws resource handler exception { try { / / execute c - e to setup device isolation before launch the container privileged operation privileged operation = new privileged operation ( privileged operation operation type device , arrays as list ( container id cli option , container id str ) ) ; boolean need native device operation = false ; int major number ; int minor number ; list < string > dev numbers = new array list < > ( ) ; if ( ! allocation get denied ( ) is empty ( ) ) { device type dev type ; for ( device denied device : allocation get denied ( ) ) { major number = denied device get major number ( ) ; minor number = denied device get minor number ( ) ; / / add device type dev type = get device type ( denied device ) ; if ( dev type ! = null ) { dev numbers add ( dev type get name ( ) + " - " + major number + " : " + minor number + " - rwm " ) ; } } if ( dev numbers size ( ) ! = 0 ) { privileged operation append args ( arrays as list ( excluded devices cli option , string utils join ( " , " , dev numbers ) ) ) ; need native device operation = true ; } } if ( ! allocation get allowed ( ) is empty ( ) ) { dev numbers clear ( ) ; for ( device allowed device : allocation get allowed ( ) ) { major number = allowed device get major number ( ) ; minor number = allowed device get minor number ( ) ; if ( major number ! = - 1 & & minor number ! = - 1 ) { dev numbers add ( major number + " : " + minor number ) ; } } if ( dev numbers size ( ) > 0 ) { privileged operation append args ( arrays as list ( allowed devices cli option , string utils join ( " , " , dev numbers ) ) ) ; need native device operation = true ; } } if ( need native device operation ) { privileged operation executor execute privileged operation ( privileged operation , true ) ; } } catch ( privileged operation exception e ) { c groups handler delete c group ( c groups handler c group controller devices , container id str ) ; log warn ( " could not update cgroup for container " , e ) ; throw new resource handler exception ( e ) ; } }


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


the notion of equality used by atomic double array

static boolean bit equals ( double x , double y ) { return double double to raw long bits ( x ) = = double double to raw long bits ( y ) ; }


public string get state machine name ( ) { return state machine name ; }


set this to true if the line alongside the axis should be drawn or not

public void set draw axis line ( boolean enabled ) { m draw axis line = enabled ; }


public offset date time get ship date ( ) { return ship date ; }


{ @ inherit doc } this implementation is empty

public void add interceptors ( interceptor registry registry ) { }


preserve register values and handle register namesize change

public boolean set language ( language translator translator , task monitor monitor ) throws cancelled exception { register new reg = translator get new register ( base register ) ; if ( new reg = = null ) { return false ; } flush write cache ( ) ; / / todo : what should we do if new register is not a base - register ? - the code below will not work ! if ( new reg is processor context ( ) | | ! new reg is base register ( ) | | ! new reg get name ( ) equals ( base register get name ( ) ) | | new reg get bit length ( ) ! = base register get bit length ( ) ) { range map set language ( translator , base register , monitor ) ; base register = new reg get base register ( ) ; } return true ; }


protected method for plugging in a custom subclass of { @ link exception handler exception resolver }

protected exception handler exception resolver create exception handler exception resolver ( ) { return new exception handler exception resolver ( ) ; }


the specified service is subscribe or not

public boolean is subscribed service ( string service name ) { return do get subscribed services ( ) contains ( service name ) ; }


returns the description value of the { @ link file system info } annotation attached to the specified class

public static string get filesystem description from class ( class < ? > clazz ) { file system info fsi = clazz get annotation ( file system info class ) ; return fsi ! = null ? fsi description ( ) : null ; }


callback that is invoked when a future completes with an error the error should be rethrown to pass it along

void fail ( exception e ) throws exception ;


whether a resource handler has already been registered for the given path pattern

public boolean has mapping for pattern ( string path pattern ) { for ( resource handler registration registration : this registrations ) { if ( arrays as list ( registration get path patterns ( ) ) contains ( path pattern ) ) { return true ; } } return false ; }


check that setting { @ link auto create index # auto create index setting } to < code > false < code > does not affect the ability to auto - create data streams , which are not subject to the setting

public void test can auto create data stream when auto create index disabled ( ) throws i o exception { configure auto create index ( false ) ; create template with allow auto create ( null ) ; assert o k ( this index document ( ) ) ; }


returns a copy of this instance with the requested content position set to the specified value may return the same instance if nothing changed

public media period info copy with requested content position us ( long requested content position us ) { return requested content position us = = this requested content position us ? this : new media period info ( id , start position us , requested content position us , end position us , duration us , is last in timeline period , is last in timeline window , is final ) ; }


creates a symbol todo - make symbols primary ?

public static symbol create symbol ( program program , namespace parent namespace , string symbol name , address symbol address ) throws invalid input exception { symbol symbol = program get symbol table ( ) create label ( symbol address , symbol name , parent namespace , source type imported ) ; symbol set primary ( ) ; return symbol ; }


reads the given fixture file from the classpath ( e g { @ code srctestresources } ) and returns its contents as a string

private static string fixture ( string filename , charset charset ) { final url resource = resources get resource ( filename ) ; try { return resources to string ( resource , charset ) trim ( ) ; } catch ( i o exception e ) { throw new illegal argument exception ( e ) ; } }


private long calc deadline ms ( long now , integer option timeout ms ) { if ( option timeout ms ! = null ) return now + math max ( 0 , option timeout ms ) ; return now + default api timeout ms ; }


gets the a register number , as a code unit this will throw if the value is out of the range of an unsigned code unit

public final short get a unit ( ) { int a = get a ( ) ; if ( ( a & ~ 0xffff ) ! = 0 ) { throw new dex exception ( " register a out of range : " + hex u 8 ( a ) ) ; } return ( short ) a ; }


returns the addresses that this subchannel is bound to this can be called only if the subchannel has only one { @ link equivalent address group } under the hood it calls { @ link # get all addresses } it should be called from the synchronization context currently will log a warning if violated it will become an exception eventually see < a href = " https : github comgrpcgrpc - javaissues 5 0 1 5 " > # 5015 for the background

public final equivalent address group get addresses ( ) { list < equivalent address group > groups = get all addresses ( ) ; preconditions check state ( groups size ( ) = = 1 , " % s does not have exactly one group " , groups ) ; return groups get ( 0 ) ; }


checks if the given name is already used or not if yes , it throws a { @ link malformed pattern exception }

public void check name uniqueness ( string name ) { if ( used names contains ( name ) ) { throw new malformed pattern exception ( " duplicate pattern name : " + name + " names must be unique " ) ; } used names add ( name ) ; }


get parameters from the specified { @ link http request request }

public static multi value map < string , string > get parameters ( http request request ) { uri uri = request get u r i ( ) ; return get parameters ( uri get query ( ) ) ; }


the extra interfaces the mock object should implement

set < class < ? > > get extra interfaces ( ) ;


not serialized , the expanded job ids should only be used on the executing node

public string [ ] get expanded job ids ( ) { return expanded job ids ; }


convenience method to create a response for successful refreshes

public static refresh response success response ( ) { return new refresh response ( 0 , " success " ) ; }


to test enum parameters to test enum parameters

public completable future < api response < void > > test enum parameters with http info ( list < string > enum header string array , string enum header string , list < string > enum query string array , string enum query string , integer enum query integer , double enum query double , list < string > enum form string array , string enum form string ) throws api exception { try { http request builder local var request builder = test enum parameters request builder ( enum header string array , enum header string , enum query string array , enum query string , enum query integer , enum query double , enum form string array , enum form string ) ; return member var http client send async ( local var request builder build ( ) , http response body handlers of string ( ) ) then compose async ( local var response - > { if ( local var response status code ( ) / 100 ! = 2 ) { return completable future failed future ( get api exception ( " test enum parameters " , local var response ) ) ; } return completable future completed future ( new api response < void > ( local var response status code ( ) , local var response headers ( ) map ( ) , null ) ) ; } ) ; } catch ( api exception e ) { return completable future failed future ( e ) ; } }


create a new { @ link marshaller } for the given class

protected final marshaller create marshaller ( class < ? > clazz ) { try { j a x b context jaxb context = get jaxb context ( clazz ) ; marshaller marshaller = jaxb context create marshaller ( ) ; customize marshaller ( marshaller ) ; return marshaller ; } catch ( j a x b exception ex ) { throw new http message conversion exception ( " could not create marshaller for class [ " + clazz + " ] : " + ex get message ( ) , ex ) ; } }


return a string explaining what providers an attribute requires adds hyperlinks to providers

public string attribute providers ( attribute info attribute info ) { list < provider name group > provider names = attribute info get provider name group list ( ) ; list < string > final provider names = new array list < > ( ) ; for ( provider name group provider name list : provider names ) { list < string > providers = provider name list get provider name list ( ) ; final provider names add ( string format ( joiner on ( " , " ) join ( providers ) ) ) ; } return string format ( joiner on ( " ; or " ) join ( final provider names ) ) ; }


returns snapshot state ; { @ code null } if the state is unknown

public snapshot state state ( ) { return state ; }


this implementation parses bean definitions according to the " spring - beans " xsd ( or dtd , historically ) opens a dom document ; then initializes the default settings specified at the { @ code < beans > } level ; then parses the contained bean definitions

public void register bean definitions ( document doc , xml reader context reader context ) { this reader context = reader context ; do register bean definitions ( doc get document element ( ) ) ; }


public void set priority ( priority priority ) { base producer context call on priority changed ( set priority no callbacks ( priority ) ) ; }


check if a path should be in all subclusters

boolean is path all ( final string path ) { if ( subcluster resolver instanceof mount table resolver ) { try { mount table resolver mount table = ( mount table resolver ) subcluster resolver ; mount table entry = mount table get mount point ( path ) ; if ( entry ! = null ) { return entry is all ( ) ; } } catch ( i o exception e ) { log error ( " cannot get mount point " , e ) ; } } return false ; }


get the first exception raised during the service failure if null , no exception was logged


private collection < ? extends function tag > get all tags ( program program ) throws i o exception { function tag manager tag manager = get tag manager ( program ) ; return tag manager get all function tags ( ) ; }


deregister a subcluster identified by { @ code sub cluster id } to change state in federation this can be done to mark the sub cluster lost , deregistered , or decommissioned

sub cluster deregister response deregister sub cluster ( sub cluster deregister request sub cluster deregister request ) throws yarn exception ;


following method performs the finalization

public void unprepare ( ) { if ( this output ! = null ) { this output flush ( ) ; this output close ( ) ; } if ( this error ! = null ) { this error flush ( ) ; this error close ( ) ; } logger debug ( " console logger module : : unprepare ( ) ; " ) ; }


helper which indicates that some bytes were just parsed this should only be used ( for efficiency sake ) if the parse is known to be observed

private void parsed ( int length , string message ) { observer parsed ( bytes , parse cursor , length , message ) ; parse cursor + = length ; }


this method will delegate to the { @ link section } spec method annotated with { @ link on data rendered }

protected void data rendered ( section context c , boolean is data changed , boolean is mounted , long uptime millis , int first visible index , int last visible index , changes info changes info , int global offset ) { }


augments the provided { @ link skyframe executor } with test - specific functionality

public static void process ( skyframe executor skyframe executor ) { }


if true , { @ link # draw debug ( shape renderer ) } will be called for this group and , optionally , all children recursively

public void set debug ( boolean enabled , boolean recursively ) { set debug ( enabled ) ; if ( recursively ) { for ( actor child : children ) { if ( child instanceof group ) { ( ( group ) child ) set debug ( enabled , recursively ) ; } else { child set debug ( enabled ) ; } } } }


test jenkins startup sequences and the changes to the startup type

public void test type transitions ( ) { install util get last exec version file ( ) delete ( ) ; install util get config file ( ) delete ( ) ; / / a new test instance sets up security first assert assert equals ( install state initial security setup , install util get next install state ( install state unknown ) ) ; / / and proceeds to the new state assert assert equals ( install state new , install util get next install state ( install state initial security setup ) ) ; / / save the last exec version this will only be done by jenkins after one of : / / 1 a successful run of the install wizard / / 2 a success upgrade / / 3 a successful restart install util save last exec version ( ) ; / / fudge things a little now , pretending there ' s a restart / / now if we ask what is the install state , we should be told it ' s a restart because / / the install wizard is complete and the version matches the currently executing / / jenkins version assert assert equals ( install state restart , install util get next install state ( install state unknown ) ) ; / / fudge things again , changing the stored version to something old , faking an upgrade install util save last exec version ( " 1 584 " ) ; assert assert equals ( install state upgrade , install util get next install state ( install state unknown ) ) ; / / fudge things yet again , changing the stored version to something very very new , faking a downgrade install util save last exec version ( " 1000 0 " ) ; assert assert equals ( install state downgrade , install util get next install state ( install state unknown ) ) ; }


public ref get ref ( string column label ) throws s q l exception { return null ; }


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


prevent any further processing for this { @ code client call stream observer } no further messages will be received the server is informed of cancellations , but may not stop processing the call cancelling an already { @ code cancel ( ) } ed { @ code client call stream observer } has no effect no other methods on this class can be called after this method has been called it is recommended that at least one of the arguments to be non - { @ code null } , to provide useful debug information both argument being null may log warnings and result in suboptimal performance also note that the provided information will not be sent to the server

public abstract void cancel ( @ nullable string message , @ nullable throwable cause ) ;


format an array of pcode op tpl objects as a multi - line string

public string to string ( program program , op tpl [ ] pcode op templates ) { boolean indent = has label ( pcode op templates ) ; string buffer buf = new string buffer ( ) ; for ( int i = 0 ; i < pcode op templates length ; i + + ) { if ( max display lines > 0 & & i > = max display lines ) { break ; } attributed string line = format op tpl ( program , pcode op templates [ i ] , indent ) ; if ( buf length ( ) ! = 0 ) { buf append ( eol ) ; } buf append ( line to string ( ) ) ; } return buf to string ( ) ; }


verifies that the provided " access token " ( see org elasticsearch xpack security authc token service ) is for the expected user with the expected name and roles if the user was created from role - mapping

private void verify elasticsearch access token for role mapping ( string access token ) throws i o exception { final map < string , object > map = call authenticate api using access token ( access token ) ; assert that ( map get ( " username " ) , equal to ( " thor " ) ) ; assert that ( map get ( " full name " ) , equal to ( " thor odinson " ) ) ; assert singleton list ( map get ( " roles " ) , " kibana admin " ) ; assert that ( map get ( " metadata " ) , instance of ( map class ) ) ; final map < ? , ? > metadata = ( map < ? , ? > ) map get ( " metadata " ) ; assert singleton list ( metadata get ( " saml uid " ) , " thor " ) ; assert singleton list ( metadata get ( " saml ( urn : oid : 0 9 2342 19200300 100 1 1 ) " ) , " thor " ) ; assert singleton list ( metadata get ( " saml display name " ) , " thor odinson " ) ; assert singleton list ( metadata get ( " saml ( urn : oid : 2 5 4 3 ) " ) , " thor odinson " ) ; }


get the method being called this method is a friendly implementation of the { @ link joinpoint # get static part ( ) } method ( same result )


returns the number of pending timeouts of this { @ link timer }

public long pending timeouts ( ) { return pending timeouts get ( ) ; }


adds the given toolchains as requirements for this aspect

public builder add required toolchains ( list < label > required toolchains ) { this required toolchains add all ( required toolchains ) ; return this ; }


returns the set of configuration fragments provided by this module

immutable list < class < ? extends fragment > > get configuration fragments ( ) ;


processes { @ code repo mapping } attribute and populates the package builder with the mappings

public static void add repo mappings ( package builder builder , map < string , object > kwargs , string external repo name ) throws eval exception , label syntax exception { object repo mapping = kwargs get ( " repo mapping " ) ; if ( repo mapping ! = null ) { for ( map entry < string , string > e : dict cast ( repo mapping , string class , string class , " repo mapping " ) entry set ( ) ) { / / create repository names with validation ; may throw label syntax exception builder add repository mapping entry ( repository name create ( " @ " + external repo name ) , repository name create ( e get key ( ) ) , repository name create ( e get value ( ) ) ) ; } } }


return a default { @ link resource pattern resolver } for the given { @ link resource loader } this might be the { @ code resource loader } itself , if it implements the { @ code resource pattern resolver } extension , or a default { @ link path matching resource pattern resolver } built on the given { @ code resource loader }

public static resource pattern resolver get resource pattern resolver ( @ nullable resource loader resource loader ) { if ( resource loader instanceof resource pattern resolver ) { return ( resource pattern resolver ) resource loader ; } else if ( resource loader ! = null ) { return new path matching resource pattern resolver ( resource loader ) ; } else { return new path matching resource pattern resolver ( ) ; } }


path to a file within the apk ( typically restype - configentry ext ) < code > optional string path = 1 ; < code >

public com google protobuf byte string get path bytes ( ) { return com google protobuf byte string copy from utf 8 ( path ) ; }


returns the current highlight ( marked area )

public field selection get highlight ( ) { return new field selection ( highlight ) ; }


public synchronized class < ? > get key class ( ) { if ( null = = key class ) { try { key class = writable name get class ( get key class name ( ) , conf ) ; } catch ( i o exception e ) { throw new runtime exception ( e ) ; } } return key class ; }


the time period for which the { @ link session store } will retain historic data


add legacy block generation stamp record to edit log

void log legacy generation stamp ( long genstamp ) { set genstamp v 1 op op = set genstamp v 1 op get instance ( cache get ( ) ) set generation stamp ( genstamp ) ; log edit ( op ) ; }


unsafely sets the value of the given entry

void set value for testing ( internal entry < k , v , ? > entry , v value ) { this map entry helper set value ( self ( ) , cast for testing ( entry ) , value ) ; }


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

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


returns an object pool instance , of a given starting capacity , that recycles instances of a given poolable object

public static synchronized object pool create ( int with capacity , poolable object ) { object pool result = new object pool ( with capacity , object ) ; result pool id = ids ; ids + + ; return result ; }


positions the reader at the named key , or if none such exists , at the key that falls just before or just after dependent on how the < code > before < code > parameter is set

private synchronized int seek internal ( writable comparable key , final boolean before ) throws i o exception { read index ( ) ; / / make sure index is read if ( seek index ! = - 1 / / seeked before & & seek index + 1 < count & & comparator compare ( key , keys [ seek index + 1 ] ) < 0 / / before next indexed & & comparator compare ( key , next key ) > = 0 ) { / / but after last seeked / / do nothing } else { seek index = binary search ( key ) ; if ( seek index < 0 ) / / decode insertion point seek index = - seek index - 2 ; if ( seek index = = - 1 ) / / belongs before first entry seek position = first position ; / / use beginning of file else seek position = positions [ seek index ] ; / / else use index } data seek ( seek position ) ; if ( next key = = null ) next key = comparator new key ( ) ; / / if we ' re looking for the key before , we need to keep track / / of the position we got the current key as well as the position / / of the key before it long prev position = - 1 ; long cur position = seek position ; while ( data next ( next key ) ) { int c = comparator compare ( key , next key ) ; if ( c < = 0 ) { / / at or beyond desired if ( before & & c ! = 0 ) { if ( prev position = = - 1 ) { / / we ' re on the first record of this index block / / and we ' ve already passed the search key therefore / / we must be at the beginning of the file , so seek / / to the beginning of this block and return c data seek ( cur position ) ; } else { / / we have a previous record to back up to data seek ( prev position ) ; data next ( next key ) ; / / now that we ' ve rewound , the search key must be greater than this key return 1 ; } } return c ; } if ( before ) { prev position = cur position ; cur position = data get position ( ) ; } } return 1 ; }


public static broker < blocking back channel > instance ( ) { return instance ; }


create a packed file from an existing database

private static void pack database ( string name , string content type , file db file , file output file , task monitor monitor ) throws i o exception , cancelled exception { if ( monitor = = null ) { monitor = task monitor adapter dummy monitor ; } monitor set message ( " packing file " ) ; input stream item in = new file input stream ( db file ) ; try { item serializer output item ( name , content type , folder item database file type , db file length ( ) , item in , output file , monitor ) ; } catch ( i o cancelled exception e ) { throw new cancelled exception ( ) ; } finally { try { item in close ( ) ; } catch ( i o exception e ) { } } }


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

public void delete order test ( ) throws api exception { string order id = null ; api delete order ( order id ) ; / / todo : test validations }


rollback the transaction will be called at most once and will not be called if { @ link # commit ( connector transaction handle ) } is called note : calls to this method may race with calls to the connector metadata

default void rollback ( connector transaction handle transaction handle ) { }


adds the given field panel to the list of panels to coordinate

public void add ( field panel fp ) { / / adjust our locked line number array big integer [ ] new line numbers = new big integer [ locked line numbers length + 1 ] ; system arraycopy ( locked line numbers , 0 , new line numbers , 0 , locked line numbers length ) ; new line numbers [ panels length ] = big integer value of ( 0l ) ; locked line numbers = new line numbers ; / / the super class will adjust the field panel array super add ( fp ) ; }


refresh the resource based on identity passed in

collection < refresh response > refresh ( string identifier , string [ ] args ) throws i o exception ;


set an xattr of a file or directory the name must be prefixed with the namespace followed by " " for example , " user attr " refer to the hdfs extended attributes user documentation for details

public void set x attr ( path path , string name , byte [ ] value ) throws i o exception { set x attr ( path , name , value , enum set of ( x attr set flag create , x attr set flag replace ) ) ; }


checks if the supplied { @ link item } or any of its { @ link item # get parent ( ) } are being deleted

public static boolean contains ( @ non null item item ) { item deletion instance = instance ( ) ; if ( instance = = null ) { return false ; } instance lock read lock ( ) lock ( ) ; try { return instance contains ( item ) ; } finally { instance lock read lock ( ) unlock ( ) ; } }


post usercreate with array : creates list of users with given input array

response entity < void > create users with array input ( @ api param ( value = " list of user object " , required = true ) @ valid @ request body list < user > body ) ;


goes recursively against each map entry and replaces any string value starting with " $ " with its corresponding value retrieved from the stash

public map < string , object > replace stashed values ( map < string , object > map ) throws i o exception { return ( map < string , object > ) unstash object ( new array list < > ( ) , map ) ; }


gets whether this instance matches ( describes ) the given address and index

public boolean matches pc and index ( int pc , int index ) { return ( index = = this index ) & & ( pc > = start pc ) & & ( pc < ( start pc + length ) ) ; }


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


test serialization of object with outer number type

public void fake outer composite serialize test ( ) { outer composite outer composite = null ; / / outer composite response = api fake outer composite serialize ( outer composite ) ; / / todo : test validations }


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


get an optional { @ link table factory } instance that ' s responsible for generating table - related instances stored in this catalog , instances such as sourcesink

default optional < table factory > get table factory ( ) { return optional empty ( ) ; }


public span utils set subscript ( ) { this is subscript = true ; return this ; }


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


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 }


tests that number of field names and types has to match

public void test number of field names and types mismatch ( ) { try { new json row deserialization schema builder ( types row named ( new string [ ] { " one " , " two " , " three " } , types long ) ) build ( ) ; assert fail ( " did not throw expected exception " ) ; } catch ( illegal argument exception ignored ) { / / expected } }


creates a mutable copy of { @ code graph } with the same nodes , edges , and edge values

public static < n , v > mutable value graph < n , v > copy of ( value graph < n , v > graph ) { mutable value graph < n , v > copy = value graph builder from ( graph ) expected node count ( graph nodes ( ) size ( ) ) build ( ) ; for ( n node : graph nodes ( ) ) { copy add node ( node ) ; } for ( endpoint pair < n > edge : graph edges ( ) ) { copy put edge value ( edge node u ( ) , edge node v ( ) , graph edge value or default ( edge node u ( ) , edge node v ( ) , null ) ) ; } return copy ; }


get the current { @ link photo view attacher } for this view be wary of holding on to references to this attacher , as it has a reference to this view , which , if a reference is held in the wrong place , can cause memory leaks

public photo view attacher get attacher ( ) { return attacher ; }


performs the specified action with context within the swing thread if the action results in a modal dialog , wait for completion must be false

public static void perform action ( docking action if action , component provider provider , boolean wait ) { action context context = run swing ( ( ) - > { action context action context = new action context ( ) ; if ( provider = = null ) { return action context ; } action context new context = provider get action context ( null ) ; if ( new context = = null ) { return action context ; } action context = new context ; action context set source object ( provider get component ( ) ) ; return action context ; } ) ; do perform action ( action , context , wait ) ; }


get the { @ link url u r ls } that were exported


returns the least value present in { @ code array }

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


return the next id suffix to use when creating the log file this method will look at the files in the directory , find the one with the highest id suffix , and 1 to that suffix , and return it this approach saves a full linear probe , which matters in the case where there are a large number of log files

private int get next id to try ( path initial , int last id ) throws i o exception { remote iterator < located file status > files = file system list files ( current dir path , true ) ; string base = initial to string ( ) ; int id = last id ; while ( files has next ( ) ) { string file = files next ( ) get path ( ) get name ( ) ; if ( file starts with ( base ) ) { int file id = extract id ( file ) ; if ( file id > id ) { id = file id ; } } } / / return either 1 more than the highest we found or 1 more than the last / / id used ( if no id was found ) return id + 1 ; }


when an input value is the empty string , include traces whose { @ link span # annotations ( ) } include a value in this set , or where { @ link span # tags ( ) } include a key is in this set when not , include traces whose { @ link span # tags ( ) } an entry in this map multiple entries are combined with and , and and against other conditions

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


calls do get on the servlet , captures the response body as a string , and returns it to the caller

private string do get and return response body ( ) throws i o exception { servlet do get ( req , resp ) ; return new string ( resp out to byte array ( ) , " utf - 8 " ) ; }


the configured redirect patterns , if any

public string [ ] get redirect patterns ( ) { return this redirect patterns ; }


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


will merge the index down to & lt ; = max num segments by default , will cause the merge process to merge down to half the configured number of segments

public force merge request max num segments ( int max num segments ) { this max num segments = max num segments ; return this ; }


public static void main ( string [ ] args ) throws exception { int count = 1024 * 1024 ; boolean create = true ; boolean check = true ; string file = file ; string compress = " none " ; string usage = " usage : test set file [ - count n ] [ - nocreate ] [ - nocheck ] [ - compress type ] file " ; if ( args length = = 0 ) { system err println ( usage ) ; system exit ( - 1 ) ; } int i = 0 ; path fpath = null ; file system fs = null ; try { for ( ; i < args length ; i + + ) { / / parse command line if ( args [ i ] = = null ) { continue ; } else if ( args [ i ] equals ( " - count " ) ) { count = integer parse int ( args [ + + i ] ) ; } else if ( args [ i ] equals ( " - nocreate " ) ) { create = false ; } else if ( args [ i ] equals ( " - nocheck " ) ) { check = false ; } else if ( args [ i ] equals ( " - compress " ) ) { compress = args [ + + i ] ; } else { / / file is required parameter file = args [ i ] ; fpath = new path ( file ) ; } } fs = fpath get file system ( conf ) ; log info ( " count = " + count ) ; log info ( " create = " + create ) ; log info ( " check = " + check ) ; log info ( " compress = " + compress ) ; log info ( " file = " + file ) ; random datum [ ] data = generate ( count ) ; if ( create ) { write test ( fs , data , file , compression type value of ( compress ) ) ; } if ( check ) { read test ( fs , data , file ) ; } } finally { fs close ( ) ; } }


check that multiple calls to any one of the instances in the multiton returns only that one particular instance , and do that for all instances in multiton

public void test the same object is returned with multiple calls ( ) { for ( var i = 0 ; i < nazgul enum values ( ) length ; i + + ) { var instance 1 = nazgul enum values ( ) [ i ] ; var instance 2 = nazgul enum values ( ) [ i ] ; var instance 3 = nazgul enum values ( ) [ i ] ; assert same ( instance 1 , instance 2 ) ; assert same ( instance 1 , instance 3 ) ; assert same ( instance 2 , instance 3 ) ; } }


if the image has less than 256 colours , simply create a new 8 bit palette and map the colours to the new palette

private static image data get web safe palette image data ( image data image data ) { palette data palette = image data palette ; rgb [ ] web safe palette = get web safe palette ( ) ; palette data new palette data = new palette data ( web safe palette ) ; image data new image data = new image data ( image data width , image data height , 8 , new palette data ) ; int last pixel = - 1 ; int new pixel = - 1 ; for ( int i = 0 ; i < image data width ; + + i ) { for ( int j = 0 ; j < image data height ; + + j ) { int pixel = image data get pixel ( i , j ) ; if ( pixel ! = last pixel ) { last pixel = pixel ; rgb colour = palette get r g b ( pixel ) ; rgb web safe colour = get web safe colour ( colour ) ; for ( new pixel = 0 ; new pixel < 256 ; + + new pixel ) { if ( web safe palette [ new pixel ] equals ( web safe colour ) ) { break ; } } assert is true ( new pixel < 216 ) ; } new image data set pixel ( i , j , new pixel ) ; } } return new image data ; }


sets the usage text for this { @ link expression }

protected void set usage ( string [ ] usage ) { this usage = usage ; }


returns the next non - default primary symbol defined after the given symbol

public final symbol get symbol after ( symbol symbol ) { return get symbol after ( symbol get address ( ) ) ; }


returns what values to pick in the case a document contains multiple values for the targeted sort field

public sort mode sort mode ( ) { return this sort mode ; }


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


sets the enablement state of the " cancel " button

protected void set cancel enabled ( boolean state ) { if ( cancel button ! = null ) { cancel button set enabled ( state ) ; } }


whether the am container for this app is over max a m share limit

private boolean is over a m share limit ( ) { / / check the am resource usage for the leaf queue if ( ! is am running ( ) & & ! get unmanaged a m ( ) ) { / / return true if we have not ask , or queue is not be able to run app ' s am pending ask ask = app scheduling info get next pending ask ( ) ; if ( ask ! = null & & ( ask get count ( ) = = 0 | | ! get queue ( ) can run app a m ( ask get per allocation resource ( ) ) ) ) { return true ; } } return false ; }


gets all server sockets that exist in the process

public io grpc channelz v 1 get server sockets response get server sockets ( io grpc channelz v 1 get server sockets request request ) { return io grpc stub client calls blocking unary call ( get channel ( ) , get get server sockets method ( ) , get call options ( ) , request ) ; }


private static list < sub component > get immediate sub components ( component context context , component component , int width spec , int height spec ) { final list < component > components = extract immediate sub components ( context , component , width spec , height spec ) ; final list < sub component > sub components = new array list < > ( components size ( ) ) ; for ( component lifecycle : components ) { sub components add ( sub component of ( lifecycle ) ) ; } return sub components ; }


returns the current address being resolved as displayed by this panel

address range get address range ( ) { return new address range impl ( min address , max address ) ; }


call this to set the phase of the listing merge that you are in currently

void set conflict type ( string conflict type ) { this conflict type = conflict type ; titled border t border = ( titled border ) get border ( ) ; t border set title ( " resolve " + conflict type + " conflict " ) ; }


public void set is autoincrement ( string is autoincrement ) { this is autoincrement = is autoincrement ; }


verify that credentials continue to be sent even if a 401 ( unauthorized ) response is received

public void test auth credentials are not cleared on auth challenge ( ) throws exception { final string [ ] methods = { " post " , " put " , " get " , " delete " } ; try ( rest client rest client = create rest client ( true , true ) ) { for ( final string method : methods ) { header realm header = new basic header ( " www - authenticate " , " basic realm = \ " test \ " " ) ; final response response 4 0 1 = body test ( rest client , method , 401 , new header [ ] { realm header } ) ; assert that ( response 4 0 1 get header ( " authorization " ) , starts with ( " basic " ) ) ; final response response 2 0 0 = body test ( rest client , method , 200 , new header [ 0 ] ) ; assert that ( response 2 0 0 get header ( " authorization " ) , starts with ( " basic " ) ) ; } } }


modifies the configuration to contain the lifeline rpc address setting

void set rpc lifeline server address ( configuration conf , inet socket address lifeline r p c address ) { log info ( " setting lifeline rpc address { } " , lifeline r p c address ) ; conf set ( dfs namenode lifeline rpc address key , net utils get host port string ( lifeline r p c address ) ) ; }


public string get stat description ( ) { return stat description ; }


public static stream < arguments > get test parameters ( ) { val params = new array list < arguments > ( ) ; / * test case # 1 : unsupported credential type * / var handler = new x 5 0 9 credentials authentication handler ( regex utils create pattern ( " * " ) ) ; params add ( arguments ( handler , new username password credential ( ) , false , null , null ) ) ; / * test case # 2 : valid certificate / * / handler = new x 5 0 9 credentials authentication handler ( regex utils create pattern ( " * " ) ) ; var credential = new x 5 0 9 certificate credential ( create certificates ( user valid crt ) ) ; params add ( arguments ( handler , credential , true , new default authentication handler execution result ( handler , credential , principal factory utils new principal factory ( ) create principal ( credential get id ( ) ) ) , null ) ) ; / * test case # 3 : expired certificate * / handler = new x 5 0 9 credentials authentication handler ( regex utils create pattern ( " * " ) ) ; params add ( arguments ( handler , new x 5 0 9 certificate credential ( create certificates ( " user - expired crt " ) ) , true , null , new certificate expired exception ( ) ) ) ; / * test case # 4 : untrusted issuer * / handler = new x 5 0 9 credentials authentication handler ( regex utils create pattern ( " cn = \ \ w + , ou = cas , o = jasig , l = westminster , st = colorado , c = us " ) , true , false , false ) ; params add ( arguments ( handler , new x 5 0 9 certificate credential ( create certificates ( " snake - oil crt " ) ) , true , null , new failed login exception ( ) ) ) ; / * test case # 5 : disallowed subject * / handler = new x 5 0 9 credentials authentication handler ( regex utils create pattern ( " * " ) , true , regex utils create pattern ( " cn = \ \ w + , ou = cas , o = jasig , l = westminster , st = colorado , c = us " ) ) ; params add ( arguments ( handler , new x 5 0 9 certificate credential ( create certificates ( " snake - oil crt " ) ) , true , null , new failed login exception ( ) ) ) ; / * test case # 6 : check key usage on a cert without key usage extension * / handler = new x 5 0 9 credentials authentication handler ( regex utils create pattern ( " * " ) , false , true , false ) ; credential = new x 5 0 9 certificate credential ( create certificates ( user valid crt ) ) ; params add ( arguments ( handler , credential , true , new default authentication handler execution result ( handler , credential , principal factory utils new principal factory ( ) create principal ( credential get id ( ) ) ) , null ) ) ; / * test case # 7 : require key usage on a cert without key usage extension * / handler = new x 5 0 9 credentials authentication handler ( regex utils create pattern ( " * " ) , false , true , true ) ; params add ( arguments ( handler , new x 5 0 9 certificate credential ( create certificates ( user valid crt ) ) , true , null , new failed login exception ( ) ) ) ; / * test case # 8 : require key usage on a cert with acceptable key usage extension values * / handler = new x 5 0 9 credentials authentication handler ( regex utils create pattern ( " * " ) , false , true , true ) ; credential = new x 5 0 9 certificate credential ( create certificates ( " user - valid - key usage crt " ) ) ; params add ( arguments ( handler , credential , true , new default authentication handler execution result ( handler , credential , principal factory utils new principal factory ( ) create principal ( credential get id ( ) ) ) , null ) ) ; / * test case # 9 : require key usage on a cert with unacceptable key usage extension values * / handler = new x 5 0 9 credentials authentication handler ( regex utils create pattern ( " * " ) , false , true , true ) ; params add ( arguments ( handler , new x 5 0 9 certificate credential ( create certificates ( " user - invalid - key usage crt " ) ) , true , null , new failed login exception ( ) ) ) ; / * * revocation tests * / / * test case # 10 : valid certificate with crl checking * / var checker = new resource c r l revocation checker ( new class path resource ( " user c a - valid crl " ) ) ; checker init ( ) ; handler = new x 5 0 9 credentials authentication handler ( regex utils create pattern ( " * " ) , checker ) ; credential = new x 5 0 9 certificate credential ( create certificates ( user valid crt ) ) ; params add ( arguments ( handler , new x 5 0 9 certificate credential ( create certificates ( user valid crt ) ) , true , new default authentication handler execution result ( handler , credential , principal factory utils new principal factory ( ) create principal ( credential get id ( ) ) ) , null ) ) ; / * test case # 11 : revoked end user certificate * / checker = new resource c r l revocation checker ( new class path resource ( " user c a - valid crl " ) ) ; checker init ( ) ; handler = new x 5 0 9 credentials authentication handler ( regex utils create pattern ( " * " ) , checker ) ; params add ( arguments ( handler , new x 5 0 9 certificate credential ( create certificates ( " user - revoked crt " ) ) , true , null , new revoked certificate exception ( zoned date time now ( zone offset utc ) , null ) ) ) ; / * test case # 12 : valid certificate on expired crl data * / val zero threshold policy = new threshold expired c r l revocation policy ( 0 ) ; checker = new resource c r l revocation checker ( new class path resource ( " user c a - expired crl " ) , null , zero threshold policy ) ; checker init ( ) ; handler = new x 5 0 9 credentials authentication handler ( regex utils create pattern ( " * " ) , checker ) ; params add ( arguments ( handler , new x 5 0 9 certificate credential ( create certificates ( user valid crt ) ) , true , null , new expired c r l exception ( null , zoned date time now ( zone offset utc ) ) ) ) ; return params stream ( ) ; }


convert string value to int value if parameter value is legal and it automatically defaults to 0 if parameter value is null or blank str

public static int to int ( string val ) { return to int ( val , 0 ) ; }


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

public model with data binding binding model on visibility state changed ( on model visibility state changed listener < model with data binding binding model , data binding epoxy model data binding holder > listener ) { on mutation ( ) ; this on model visibility state changed listener epoxy generated model = listener ; return this ; }


gets the amount of time in a time value that the index has been under merge throttling control

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


batch - get all { @ link service instance service instances } by the specified service names

default map < string , page < service instance > > get instances ( iterable < string > service names , int offset , int request size ) throws null pointer exception , illegal argument exception { map < string , page < service instance > > instances = new linked hash map < > ( ) ; for ( string service name : service names ) { instances put ( service name , get instances ( service name , offset , request size ) ) ; } return unmodifiable map ( instances ) ; }


default void publish ( publishable pub ) { }


public get categories response get categories ( get categories request request , request options options ) throws i o exception { return rest high level client perform request and parse entity ( request , m l request converters : : get categories , options , get categories response : : from x content , collections empty set ( ) ) ; }


gets the task attempt start time to be used while publishing to a t sv 2

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


get petfind by tags : finds pets by tags multiple tags can be provided with comma separated strings use tag 1 , tag 2 , tag 3 for testing

default response entity < set < pet > > find pets by tags ( set < string > tags ) { 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 = " { \ " photo urls \ " : [ \ " photo urls \ " , \ " photo urls \ " ] , \ " name \ " : \ " doggie \ " , \ " id \ " : 0 , \ " category \ " : { \ " name \ " : \ " default - name \ " , \ " id \ " : 6 } , \ " tags \ " : [ { \ " name \ " : \ " name \ " , \ " id \ " : 1 } , { \ " name \ " : \ " name \ " , \ " id \ " : 1 } ] , \ " status \ " : \ " available \ " } " ; api util set example response ( request , " application / json " , example string ) ; break ; } if ( media type is compatible with ( media type value of ( " application / xml " ) ) ) { string example string = " < pet > < id > 123456789 < / id > < name > doggie < / name > < photo urls > < photo urls > aeiou < / photo urls > < / photo urls > < tags > < / tags > < status > aeiou < / status > < / pet > " ; api util set example response ( request , " application / xml " , example string ) ; break ; } } } ) ; return new response entity < > ( http status not implemented ) ; }


finds the corresponding row , column for string index , and offset

public row col location data to screen location ( int index , int offset ) { return text offset to screen location ( offset ) ; }


returns a { @ code map splitter } which splits entries based on this splitter , and splits entries into keys and values using the specified key - value splitter note : any configuration option configured on this splitter , such as { @ link # trim results } , does not change the behavior of the { @ code key value splitter } example : { @ code string to split = " x - > y , z - > a " ; splitter outer splitter = splitter on ( ' , ' ) trim results ( ) ; map splitter map splitter = outer splitter with key value separator ( splitter on ( " - > " ) ) ; map < string , string > result = map splitter split ( to split ) ; assert that ( result ) is equal to ( immutable map of ( " x " , " y " , " z " , " a " ) ) ; }

public map splitter with key value separator ( splitter key value splitter ) { return new map splitter ( this , key value splitter ) ; }


private int run oev ( string in filename , string out filename , string processor , boolean recovery ) throws i o exception { log info ( " running oev [ " + in filename + " ] [ " + out filename + " ] " ) ; offline edits viewer oev = new offline edits viewer ( ) ; flags flags = new flags ( ) ; flags set print to screen ( ) ; if ( recovery ) { flags set recovery mode ( ) ; } return oev go ( in filename , out filename , processor , flags , null ) ; }


asks all the { @ link section } in the tree to refresh themselves the refresh is by default a no - op { @ link section } s that need a refresh behaviour should implement a method annotated with { @ link com facebook litho sections annotations on refresh }

public void refresh ( ) { final section section ; synchronized ( this ) { if ( m released ) { throw new illegal state exception ( " calling refresh on a released tree " ) ; } section = m current section ; } if ( section = = null ) { return ; } refresh recursive ( section ) ; }


provides an { @ link extract jars transform action } for the archive entry

public static taobao extract jars transform action get action ( @ non null string archive path , boolean extract code ) { / / manifest files are never merged if ( jar file manifest name equals ( archive path ) ) { return taobao extract jars transform action ignore ; } / / split the path into segments string [ ] segments = archive path split ( " / " ) ; / / empty path ? skip to next entry if ( segments length = = 0 ) { return taobao extract jars transform action ignore ; } return packaging utils check file for apk packaging ( archive path , extract code ) ? taobao extract jars transform action copy : taobao extract jars transform action ignore ; }


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


returns a value in a score system compliant with the css specificity rules

public int get specificity score ( @ nullable string id , @ nullable string tag , set < string > classes , @ nullable string voice ) { if ( target id is empty ( ) & & target tag is empty ( ) & & target classes is empty ( ) & & target voice is empty ( ) ) { / / the selector is universal it matches with the minimum score if and only if the given / / element is a whole cue return text utils is empty ( tag ) ? 1 : 0 ; } int score = 0 ; score = update score for match ( score , target id , id , 0x 4 0 0 0 0 0 0 0 ) ; score = update score for match ( score , target tag , tag , 2 ) ; score = update score for match ( score , target voice , voice , 4 ) ; if ( score = = - 1 | | ! classes contains all ( target classes ) ) { return 0 ; } else { score + = target classes size ( ) * 4 ; } return score ; }


adds a feedback edge the parallelism of the { @ code transformation } must match the parallelism of the input { @ code transformation } of this { @ code feedback transformation }

public void add feedback edge ( transformation < t > transform ) { if ( transform get parallelism ( ) ! = this get parallelism ( ) ) { throw new unsupported operation exception ( " parallelism of the feedback stream must match the parallelism of the original " + " stream parallelism of original stream : " + this get parallelism ( ) + " ; parallelism of feedback stream : " + transform get parallelism ( ) + " parallelism can be modified using data stream # set parallelism ( ) method " ) ; } feedback edges add ( transform ) ; }


build the insert string based on configuration and meta - data information

public string create insert string ( string generated key names ) { set < string > keys = new linked hash set < > ( generated key names length ) ; for ( string key : generated key names ) { keys add ( key to upper case ( ) ) ; } string builder insert statement = new string builder ( ) ; insert statement append ( " insert into " ) ; if ( get schema name ( ) ! = null ) { insert statement append ( get schema name ( ) ) ; insert statement append ( " " ) ; } insert statement append ( get table name ( ) ) ; insert statement append ( " ( " ) ; int column count = 0 ; for ( string column name : get table columns ( ) ) { if ( ! keys contains ( column name to upper case ( ) ) ) { column count + + ; if ( column count > 1 ) { insert statement append ( " , " ) ; } insert statement append ( column name ) ; } } insert statement append ( " ) values ( " ) ; if ( column count < 1 ) { if ( this generated key columns used ) { if ( logger is debug enabled ( ) ) { logger debug ( " unable to locate non - key columns for table ' " + get table name ( ) + " ' so an empty insert statement is generated " ) ; } } else { throw new invalid data access api usage exception ( " unable to locate columns for table ' " + get table name ( ) + " ' so an insert statement can ' t be generated " ) ; } } string params = string join ( " , " , collections n copies ( column count , " ? " ) ) ; insert statement append ( params ) ; insert statement append ( " ) " ) ; return insert statement to string ( ) ; }


reads and discards data from the given { @ code input stream } until the end of the stream is reached returns the total number of bytes read does not close the stream

public static long exhaust ( input stream in ) throws i o exception { long total = 0 ; long read ; byte [ ] buf = create buffer ( ) ; while ( ( read = in read ( buf ) ) ! = - 1 ) { total + = read ; } return total ; }


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


scan for existing repositories and build repository map

private void initialize ( ) throws i o exception { log info ( " known repositories : " ) ; string [ ] names = get repository names ( root dir file ) ; for ( string name : names ) { log info ( " " + name ) ; } if ( names length = = 0 ) { log info ( " < none > " ) ; } for ( string name : names ) { file f = new file ( root dir file , naming utilities mangle ( name ) ) ; if ( ! f is directory ( ) ) { log error ( " error while processing repository " + name + " , directory not found : " + f ) ; continue ; } if ( ! f can write ( ) ) { throw new i o exception ( f get absolute path ( ) + " can not be written to " ) ; } try { repository rep = new repository ( this , null , f , name ) ; repository map put ( name , rep ) ; } catch ( user access exception e ) { / / ignore } catch ( exception e ) { log error ( " error while processing repository " + name + " , " + e get message ( ) ) ; continue ; } } user mgr update user list ( true ) ; }


set the maximum interval , in milliseconds , at which the " system " relay session expects , in the absence of any other data , to receive a heartbeat from the stomp broker a value of zero will configure the relay session to expect not to receive heartbeats from the broker the default value is 10000

public stomp broker relay registration set system heartbeat receive interval ( long heartbeat receive interval ) { this system heartbeat receive interval = heartbeat receive interval ; return this ; }


{ @ inherit doc } because a { @ code set multimap } has unique values for a given key , this method returns a { @ link set } , instead of the { @ link java util collection } specified in the { @ link multimap } interface


get the underlying base subroutine model this is generally the mult ent sub model ( m - model )

public subroutine block model get base subroutine model ( ) ;


wait for expiration of entries from the ugi cache we need to be careful not to touch the entries in the cache while we ' re waiting for expiration if we did , then that would reset the clock on expiration for those entries instead , we trigger internal clean - up of the cache and check for size 0

private void await cache empty due to expiration ( ) throws exception { generic test utils wait for ( new supplier < boolean > ( ) { @ override public boolean get ( ) { data node u g i provider ugi cache clean up ( ) ; return data node u g i provider ugi cache size ( ) = = 0 ; } } , expire after access , 10 * expire after access ) ; }


test that a tombstone won ' t hide an entry after it ' s expired in the listing

public void test root tombstones ( ) throws exception { long ttl = 10l ; i ttl time provider mock time provider = mock ( i ttl time provider class ) ; when ( mock time provider get metadata ttl ( ) ) then return ( ttl ) ; when ( mock time provider get now ( ) ) then return ( 100l ) ; i ttl time provider original time provider = guarded fs get ttl time provider ( ) ; guarded fs set ttl time provider ( mock time provider ) ; path base = path ( get method name ( ) + uuid random u u i d ( ) ) ; path test file = new path ( base , " test file " ) ; try { touch ( guarded fs , test file ) ; contract test utils assert deleted ( guarded fs , test file , false ) ; touch ( raw f s , test file ) ; await file status ( raw f s , test file ) ; / / the raw f s will include the file = lambda test utils eventually ( 5000 , 1000 , ( ) - > { check listing contains path ( raw f s , test file ) ; } ) ; / / it will be hidden because of the tombstone check listing does not contain path ( guarded fs , test file ) ; / / the tombstone is expired , so we should detect the file / / in non - authoritative mode when ( mock time provider get now ( ) ) then return ( 100 + ttl ) ; if ( authoritative ) { check listing does not contain path ( guarded fs , test file ) ; } else { check listing contains path ( guarded fs , test file ) ; } } finally { / / cleanup guarded fs delete ( base , true ) ; guarded fs set ttl time provider ( original time provider ) ; } }


public int get service class ( ) { return service class ; }


utility method for testing versioned writables

public static void test versioned writable ( writable before , writable after ) throws exception { data output buffer dob = new data output buffer ( ) ; before write ( dob ) ; data input buffer dib = new data input buffer ( ) ; dib reset ( dob get data ( ) , dob get length ( ) ) ; try { after read fields ( dib ) ; } catch ( version mismatch exception vmme ) { system out println ( " good , we expected this : " + vmme ) ; return ; } throw new exception ( " a version mismatch didn ' t happen ! " ) ; }


called when building executables or packages to fill in missing empty init py files if the - - incompatible default to explicit init py has not yet been enabled this usually returns a public static final reference , code is free to use that directly on specific implementations instead of making this call

runfiles empty files supplier get empty runfiles supplier ( ) ;


public void set after image ( table records after image ) { this after image = after image ; }


set the user - agent header ' s value ( by adding to the default header map )

public api client set user agent ( string user agent ) { add default header ( " user - agent " , user agent ) ; return this ; }


set the resource utilization of the node this includes the containers

public void set node utilization ( resource utilization node utilization ) { this node utilization = node utilization ; }


returns an iterator for the keys in the map remove is supported if { @ link collections # allocate iterators } is false , the same iterator instance is returned each time this method is called use the { @ link keys } constructor for nested or multithreaded iteration

public keys < k > keys ( ) { if ( collections allocate iterators ) return new keys ( this ) ; if ( keys 1 = = null ) { keys 1 = new keys ( this ) ; keys 2 = new keys ( this ) ; } if ( ! keys 1 valid ) { keys 1 reset ( ) ; keys 1 valid = true ; keys 2 valid = false ; return keys 1 ; } keys 2 reset ( ) ; keys 2 valid = true ; keys 1 valid = false ; return keys 2 ; }


sets a repeating value to all objects or row fields of the passed vals array

private static void fill column with repeating value ( object [ ] vals , int field idx , object repeating value , int child count ) { if ( field idx = = - 1 ) { / / set value as an object arrays fill ( vals , 0 , child count , repeating value ) ; } else { / / set value as a field of row row [ ] rows = ( row [ ] ) vals ; for ( int i = 0 ; i < child count ; i + + ) { rows [ i ] set field ( field idx , repeating value ) ; } } }


returns a slice containing values in the specified range of the specified slice if the range matches the entire slice , the input slice will be returned otherwise , a copy will be returned

static slice compact slice ( slice slice , int index , int length ) { if ( slice is compact ( ) & & index = = 0 & & length = = slice length ( ) ) { return slice ; } return slices copy of ( slice , index , length ) ; }


adds a register pair to the interferenceliveness graph parameter order is insignificant

public void add ( int reg v , int reg w ) { ensure capacity ( math max ( reg v , reg w ) + 1 ) ; interference get ( reg v ) add ( reg w ) ; interference get ( reg w ) add ( reg v ) ; }


returns a { @ code byte sink } that writes base - encoded bytes to the specified { @ code char sink }

public final byte sink encoding sink ( final char sink encoded sink ) { check not null ( encoded sink ) ; return new byte sink ( ) { @ override public output stream open stream ( ) throws i o exception { return encoding stream ( encoded sink open stream ( ) ) ; } } ; }


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


public just symbol enum get just symbol ( ) { return just symbol ; }


this method will use the thread to send packets added to the queued packets list

private void send packets ( ) throws interrupted exception { long trace mask = zoo trace server packet trace mask ; while ( true ) { try { quorum packet p ; p = queued packets poll ( ) ; if ( p = = null ) { buffered output flush ( ) ; p = queued packets take ( ) ; } server metrics get metrics ( ) learner handler qp size add ( long to string ( this sid ) , queued packets size ( ) ) ; if ( p instanceof marker quorum packet ) { marker quorum packet m = ( marker quorum packet ) p ; server metrics get metrics ( ) learner handler qp time add ( long to string ( this sid ) , ( system nano time ( ) - m time ) / 1000000l ) ; continue ; } queued packets size add and get ( - packet size ( p ) ) ; if ( p = = proposal of death ) { / / packet of death ! break ; } if ( p get type ( ) = = leader ping ) { trace mask = zoo trace server ping trace mask ; } if ( p get type ( ) = = leader proposal ) { sync limit check update proposal ( p get zxid ( ) , system nano time ( ) ) ; } if ( log is trace enabled ( ) ) { zoo trace log quorum packet ( log , trace mask , ' o ' , p ) ; } / / log the zxid of the last request , if it is a valid zxid if ( p get zxid ( ) > 0 ) { last zxid = p get zxid ( ) ; } oa write record ( p , " packet " ) ; packets sent increment and get ( ) ; message tracker track sent ( p get type ( ) ) ; } catch ( i o exception e ) { log error ( " exception while sending packets in learner handler " , e ) ; / / this will cause everything to shutdown on / / this learner handler and will help notify / / the learner / observer instantaneously close socket ( ) ; break ; } } }


int get record count ( ) { return ref table get record count ( ) ; }


lifecycle method to close the mailbox for action submissionretrieval this will cancel all instances of { @ link java util concurrent runnable future } that are still contained in the mailbox

public void close ( ) { list < mail > dropped mails = mailbox close ( ) ; if ( ! dropped mails is empty ( ) ) { log debug ( " closing the mailbox dropped mails { } " , dropped mails ) ; optional < runtime exception > maybe err = optional empty ( ) ; for ( mail dropped mail : dropped mails ) { try { dropped mail try cancel ( false ) ; } catch ( runtime exception x ) { maybe err = optional of ( exception utils first or suppressed ( x , maybe err or else ( null ) ) ) ; } } maybe err if present ( e - > { throw e ; } ) ; } }


create the { @ link xml reader context } to pass over to the document reader

public xml reader context create reader context ( resource resource ) { return new xml reader context ( resource , this problem reporter , this event listener , this source extractor , this , get namespace handler resolver ( ) ) ; }


get the date format used to parseformat { @ code offset date time } parameters

public date time formatter get offset date time formatter ( ) { return offset date time formatter ; }


converts { @ link # find configurations } ' s output into a list of { @ link configuration for output } instances

private static immutable sorted set < configuration for output > for output ( immutable sorted map < build configuration value key , build configuration > as sky key map , immutable sorted map < class < ? extends fragment > , immutable sorted set < class < ? extends fragment options > > > fragment defs ) { immutable sorted set builder < configuration for output > ans = immutable sorted set ordered by ( comparing ( e - > e config hash ) ) ; for ( map entry < build configuration value key , build configuration > entry : as sky key map entry set ( ) ) { build configuration value key key = entry get key ( ) ; build configuration config = entry get value ( ) ; ans add ( get configuration for output ( key , config checksum ( ) , config , fragment defs ) ) ; } return ans build ( ) ; }


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

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


searches the given directory ( non - recursively ) for jars and returns their paths in a list

public static list < string > find jars in dir ( resource file dir ) { list < string > list = new array list < > ( ) ; resource file [ ] names = dir list files ( ) ; if ( names ! = null ) { for ( resource file file : names ) { if ( file get name ( ) ends with ( " jar " ) ) { list add ( file get absolute path ( ) ) ; } } } return list ; }


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

public boolean is set success ( ) { return this success ! = null ; }


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


concatenate the given { @ code string } arrays into one , with overlapping array elements included twice the order of elements in the original arrays is preserved

public static string [ ] concatenate string arrays ( @ nullable string [ ] array 1 , @ nullable string [ ] array 2 ) { if ( object utils is empty ( array 1 ) ) { return array 2 ; } if ( object utils is empty ( array 2 ) ) { return array 1 ; } string [ ] new arr = new string [ array 1 length + array 2 length ] ; system arraycopy ( array 1 , 0 , new arr , 0 , array 1 length ) ; system arraycopy ( array 2 , 0 , new arr , array 1 length , array 2 length ) ; return new arr ; }


public void test sample asciidoc markup generation parameter name unchanged ( ) { assert assert true ( markup content contains ( " from - iso - date - string " ) , " keep parameter name from - iso - date - string unchanged " ) ; }


verify if the { @ link number expression # number expression ( string ) } constructor works as expected

public void test from string ( number expression first ) throws exception { final var expected value = first interpret ( ) ; final var test string value = string value of ( expected value ) ; final var number expression = new number expression ( test string value ) ; assert equals ( expected value , number expression interpret ( ) ) ; }


returns user defined content type associated with this handle

public string get content type ( ) { return content type ; }


returns execution trace returns null if trace is not enabled


set the value of the ' { @ code onkeyup } ' attribute may be a runtime expression

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


public boolean is lookup cached ( ) { return ( field get annotation ( cache lookup class ) ! = null ) ; }


merge two collections of accumulators the second will be merged into the first

public static void merge into ( map < string , optional failure < accumulator < ? , ? > > > target , map < string , accumulator < ? , ? > > to merge ) { for ( map entry < string , accumulator < ? , ? > > other entry : to merge entry set ( ) ) { optional failure < accumulator < ? , ? > > own accumulator = target get ( other entry get key ( ) ) ; if ( own accumulator = = null ) { / / create initial counter ( copy ! ) target put ( other entry get key ( ) , wrap unchecked ( other entry get key ( ) , ( ) - > other entry get value ( ) clone ( ) ) ) ; } else if ( own accumulator is failure ( ) ) { continue ; } else { accumulator < ? , ? > accumulator = own accumulator get unchecked ( ) ; / / both should have the same type compare accumulator types ( other entry get key ( ) , accumulator get class ( ) , other entry get value ( ) get class ( ) ) ; / / merge target counter with other counter target put ( other entry get key ( ) , wrap unchecked ( other entry get key ( ) , ( ) - > merge single ( accumulator , other entry get value ( ) clone ( ) ) ) ) ; } } }


post fake : fake endpoint for testing various parameters 가짜 엔드 포인트 fake endpoint for testing various parameters 가짜 엔드 포인트

default response entity < void > test endpoint parameters ( @ api param ( value = " none " , required = true ) @ valid @ request part ( value = " number " , required = true ) big decimal number , @ api param ( value = " none " , required = true ) @ valid @ request part ( value = " double " , required = true ) double double , @ api param ( value = " none " , required = true ) @ valid @ request part ( value = " pattern without delimiter " , required = true ) string pattern without delimiter , @ api param ( value = " none " , required = true ) @ valid @ request part ( value = " byte " , required = true ) byte [ ] byte , @ api param ( value = " none " ) @ valid @ request part ( value = " integer " , required = false ) integer integer , @ api param ( value = " none " ) @ valid @ request part ( value = " int 3 2 " , required = false ) integer int 3 2 , @ api param ( value = " none " ) @ valid @ request part ( value = " int 6 4 " , required = false ) long int 6 4 , @ api param ( value = " none " ) @ valid @ request part ( value = " float " , required = false ) float float , @ api param ( value = " none " ) @ valid @ request part ( value = " string " , required = false ) string string , @ api param ( value = " none " ) @ valid @ request part ( value = " binary " , required = false ) multipart file binary , @ api param ( value = " none " ) @ valid @ request part ( value = " date " , required = false ) local date date , @ api param ( value = " none " ) @ valid @ request part ( value = " date time " , required = false ) offset date time date time , @ api param ( value = " none " ) @ valid @ request part ( value = " password " , required = false ) string password , @ api param ( value = " none " ) @ valid @ request part ( value = " callback " , required = false ) string param callback ) { return new response entity < > ( http status not implemented ) ; }


response entity < void > test endpoint parameters ( @ api param ( value = " none " , required = true ) @ valid @ request part ( value = " number " , required = true ) big decimal number , @ api param ( value = " none " , required = true ) @ valid @ request part ( value = " double " , required = true ) double double , @ api param ( value = " none " , required = true ) @ valid @ request part ( value = " pattern without delimiter " , required = true ) string pattern without delimiter , @ api param ( value = " none " , required = true ) @ valid @ request part ( value = " byte " , required = true ) byte [ ] byte , @ api param ( value = " none " ) @ valid @ request part ( value = " integer " , required = false ) integer integer , @ api param ( value = " none " ) @ valid @ request part ( value = " int 3 2 " , required = false ) integer int 3 2 , @ api param ( value = " none " ) @ valid @ request part ( value = " int 6 4 " , required = false ) long int 6 4 , @ api param ( value = " none " ) @ valid @ request part ( value = " float " , required = false ) float float , @ api param ( value = " none " ) @ valid @ request part ( value = " string " , required = false ) string string , @ api param ( value = " none " ) @ valid @ request part ( value = " binary " , required = false ) multipart file binary , @ api param ( value = " none " ) @ valid @ request part ( value = " date " , required = false ) local date date , @ api param ( value = " none " ) @ valid @ request part ( value = " date time " , required = false ) offset date time date time , @ api param ( value = " none " ) @ valid @ request part ( value = " password " , required = false ) string password , @ api param ( value = " none " ) @ valid @ request part ( value = " callback " , required = false ) string param callback ) ;


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


set the value of the singleton property governs whether this factory should always return the same proxy instance ( which implies the same target ) or whether it should return a new prototype instance , which implies that the target and interceptors may be new instances also , if they are obtained from prototype bean definitions this allows for fine control of independenceuniqueness in the object graph

public void set singleton ( boolean singleton ) { this singleton = singleton ; }


returns whether we are allowed to deploy consumers lazily

public boolean allow lazy deployment ( ) { return allow lazy deployment ; }


test that transaction status set rollback only works

public void programmatic rollback ( ) throws exception { transaction attribute txatt = new default transaction attribute ( ) ; method m = get name method ; map transaction attribute source tas = new map transaction attribute source ( ) ; tas register ( m , txatt ) ; transaction status status = mock ( transaction status class ) ; platform transaction manager ptm = mock ( platform transaction manager class ) ; given ( ptm get transaction ( txatt ) ) will return ( status ) ; final string name = " jenny " ; test bean tb = new test bean ( ) { @ override public string get name ( ) { transaction status tx status = transaction interceptor current transaction status ( ) ; tx status set rollback only ( ) ; return name ; } } ; i test bean itb = ( i test bean ) advised ( tb , ptm , tas ) ; / / verification ! ? assert that ( name equals ( itb get name ( ) ) ) is true ( ) ; verify ( ptm ) commit ( status ) ; }


note the same entry instance is returned each time this method is called

public entry < k > next ( ) { if ( ! has next ) throw new no such element exception ( ) ; if ( ! valid ) throw new gdx runtime exception ( " # iterator ( ) cannot be used nested " ) ; k [ ] key table = map key table ; entry key = key table [ next index ] ; entry value = map value table [ next index ] ; current index = next index ; find next index ( ) ; return entry ; }


determine if the http method is supported by browsers ( i e get or post )

protected boolean is method browser supported ( string method ) { return ( " get " equals ignore case ( method ) | | " post " equals ignore case ( method ) ) ; }


test proper handling where an object incorrectly tests for an incompatible class

public void test invalid equals incompatible class ( ) { object obj = new invalid equals incompatible class object ( ) ; equals tester add equality group ( obj ) ; try { equals tester test equals ( ) ; } catch ( assertion failed error e ) { assert error message ( e , obj + " must not be object # equals to an arbitrary object of another class " ) ; return ; } fail ( " should get equal to incompatible class error " ) ; }


public cancellable start watch service async ( start watch service request request , request options options , action listener < acknowledged response > listener ) { return rest high level client perform request async and parse entity ( request , watcher request converters : : start watch service , options , acknowledged response : : from x content , listener , empty set ( ) ) ; }


delegates to the { @ link log # trace ( object ) } method of the underlying { @ link log } instance however , this form avoids superfluous object creation when the logger is disabled for level trace

public void trace ( string format , object arguments ) { if ( logger is trace enabled ( ) ) { formatting tuple ft = message formatter array format ( format , arguments ) ; logger trace ( ft get message ( ) , ft get throwable ( ) ) ; } }


public void test empty padded log ( ) throws i o exception { run edit log test ( new elts test empty log ( edit log file output stream min preallocation length ) ) ; }


public void delete datafeed config ( string datafeed id , action listener < delete response > action listener ) { delete request request = new delete request ( ml config index index name ( ) , datafeed config document id ( datafeed id ) ) ; request set refresh policy ( write request refresh policy immediate ) ; execute async with origin ( client , ml origin , delete action instance , request , new action listener < delete response > ( ) { @ override public void on response ( delete response delete response ) { if ( delete response get result ( ) = = doc write response result not found ) { action listener on failure ( exceptions helper missing datafeed exception ( datafeed id ) ) ; return ; } assert delete response get result ( ) = = doc write response result deleted ; action listener on response ( delete response ) ; } @ override public void on failure ( exception e ) { action listener on failure ( e ) ; } } ) ; }


get the default api client , which would be used when creating api instances without providing an api client

public static api client get default api client ( ) { return default api client ; }


same as { @ link # regex ( string ) } with full regular expression options see { @ link regex options builder }

public completion suggestion builder regex ( string regex , regex options regex options ) { this regex ( regex ) ; this regex options = regex options ; return this ; }


request that this service yield from the active node election for the specified time period if the node is not currently active , it simply prevents any attempts to become active for the specified time period otherwise , it first tries to transition the local service to standby state , and then quits the election if the attempt to transition to standby succeeds , then the zkfc receiving this rpc will delete its own breadcrumb node in zoo keeper thus , the next node to become active will not run any fencing process otherwise , the breadcrumb will be left , such that the next active will fence this node after the specified time period elapses , the node will attempt to re - join the election , provided that its service is healthy if the node has previously been instructed to cede active , and is still within the specified time period , the later command ' s time period will take precedence , resetting the timer a call to cede active which specifies a 0 or negative time period will allow the target node to immediately rejoin the election , so long as it is healthy

public void cede active ( int millis to cede ) throws i o exception , access control exception ;


executes an { @ link indices aliases request } to copy over all the aliases from the source to the target index , and remove the source index the is write index will not be set on the target index as this operation is currently executed on read - only indices

static void delete source index and transfer aliases ( client client , index metadata source index , time value master timeout value , string target index , listener listener ) { string source index name = source index get index ( ) get name ( ) ; indices aliases request aliases request = new indices aliases request ( ) master node timeout ( master timeout value ) add alias action ( indices aliases request alias actions remove index ( ) index ( source index name ) ) add alias action ( indices aliases request alias actions add ( ) index ( target index ) alias ( source index name ) ) ; / / copy over other aliases from source index source index get aliases ( ) values ( ) spliterator ( ) for each remaining ( alias meta data object cursor - > { alias metadata alias meta data to add = alias meta data object cursor value ; / / inherit all alias properties except ` is write index ` aliases request add alias action ( indices aliases request alias actions add ( ) index ( target index ) alias ( alias meta data to add alias ( ) ) index routing ( alias meta data to add index routing ( ) ) search routing ( alias meta data to add search routing ( ) ) filter ( alias meta data to add filter ( ) = = null ? null : alias meta data to add filter ( ) string ( ) ) write index ( null ) ) ; } ) ; client admin ( ) indices ( ) aliases ( aliases request , action listener wrap ( response - > { if ( response is acknowledged ( ) = = false ) { logger warn ( " aliases swap from [ { } ] to [ { } ] response was not acknowledged " , source index name , target index ) ; } listener on response ( true ) ; } , listener : : on failure ) ) ; }


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

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


set validation method for geo coordinates

public void set validation method ( geo validation method method ) { this validation method = method ; }


reads a long array of < code > n elements < code > starting at the current index and then increments the current index by < code > sizeof long n elements < code >

public long [ ] read next long array ( int n elements ) throws i o exception { long [ ] l = read long array ( current index , n elements ) ; current index + = ( sizeof long * n elements ) ; return l ; }