ensure that no pending ask request inside app scheduling info does not result in an error

public void test no next pending ask ( ) { f s leaf queue queue = mockito mock ( f s leaf queue class ) ; application attempt id application attempt id = create app attempt id ( 1 , 1 ) ; r m context rm context = mockito mock ( r m context class ) ; concurrent map < application id , r m app > rm apps = new concurrent hash map < > ( ) ; r m app rm app = mockito mock ( r m app class ) ; rm apps put ( application attempt id get application id ( ) , rm app ) ; application submission context app context = mockito mock ( application submission context class ) ; mockito when ( app context get unmanaged a m ( ) ) then return ( false ) ; mockito when ( app context get log aggregation context ( ) ) then return ( mockito mock ( log aggregation context class ) ) ; mockito when ( rm app get application scheduling envs ( ) ) then return ( new hash map < > ( ) ) ; mockito when ( rm app get application submission context ( ) ) then return ( app context ) ; mockito when ( rm context get r m apps ( ) ) then return ( rm apps ) ; mockito when ( rm context get yarn configuration ( ) ) then return ( conf ) ; f s app attempt scheduler app = new f s app attempt ( scheduler , application attempt id , " user 1 " , queue , null , rm context ) ; scheduler app set am running ( false ) ; f s scheduler node scheduler node = mockito mock ( f s scheduler node class ) ; resource resource = scheduler app assign container ( scheduler node ) ; assert equals ( resources none ( ) , resource ) ; }


when an object implementing interface < code > runnable < code > is used to create a thread , starting the thread causes the object ' s < code > run < code > method to be called in that separately executing thread the general contract of the method < code > run < code > is that it may take any action whatsoever

public void run ( ) { string name = null ; try { global settings reset ( ) ; client opt input opts = configurator to client opt input ( ) ; codegen config config = opts get config ( ) ; name = config get name ( ) ; path target = paths get ( config get output dir ( ) ) ; path updated = root dir resolve ( target ) ; config set output dir ( updated to string ( ) ) ; if ( this clean ) { clean previous files ( name , updated ) ; } system out printf ( locale root , " [ % s ] generating % s ( outputs to % s ) … % n " , thread current thread ( ) get name ( ) , name , updated to string ( ) ) ; default generator default generator = new default generator ( ) ; default generator opts ( opts ) ; default generator generate ( ) ; system out printf ( locale root , " [ % s ] finished generating % s … % n " , thread current thread ( ) get name ( ) , name ) ; successes increment and get ( ) ; } catch ( throwable e ) { failures increment and get ( ) ; string failed on = name ; if ( string utils is empty ( failed on ) ) { failed on = " unspecified " ; } system err printf ( locale root , " [ % s ] generation failed for % s : ( % s ) % s % n " , thread current thread ( ) get name ( ) , failed on , e get class ( ) get simple name ( ) , e get message ( ) ) ; e print stack trace ( system err ) ; if ( exit on error ) { system exit ( 1 ) ; } } finally { global settings reset ( ) ; } }


public string get location ( ) { return location ; }


post fakeouterboolean test serialization of outer boolean types

default response entity < boolean > fake outer boolean serialize ( @ api param ( value = " input boolean as post body " ) @ valid @ request body ( required = false ) boolean body ) { return new response entity < > ( http status not implemented ) ; }


creates and adds a new and unique save data object to the save data map

public save data create save data ( string key ) { save data save data = new save data ( this ) ; if ( unique data contains key ( key ) ) throw new runtime exception ( " key already used , data must be unique , use a different key " ) ; unique data put ( key , save data ) ; return save data ; }


sets the children of this node to the given list of child nodes and fires the appropriate tree event to kick the tree to update the display note : this method must be called from the swing thread because it will notify the underlying j tree

protected synchronized void do set children and fire event ( list < g tree node > child list ) { do set children ( child list ) ; do fire node structure changed ( ) ; }


check whether the given path contains invalid escape sequences

private boolean is invalid encoded path ( string path ) { if ( path contains ( " % " ) ) { try { / / use u r l decoder ( vs uri utils ) to preserve potentially decoded utf - 8 chars string decoded path = u r l decoder decode ( path , " utf - 8 " ) ; if ( is invalid path ( decoded path ) ) { return true ; } decoded path = process path ( decoded path ) ; if ( is invalid path ( decoded path ) ) { return true ; } } catch ( illegal argument exception ex ) { / / may not be possible to decode } catch ( unsupported encoding exception ex ) { / / should never happen } } return false ; }


if this project is configured to be always built on this node , return that { @ link node } otherwise null

public @ check for null label get assigned label ( ) { if ( can roam ) return null ; if ( assigned node = = null ) return jenkins get ( ) get self label ( ) ; return jenkins get ( ) get label ( assigned node ) ; }


returns a resource on the classpath as a properties object

public static properties get resource as properties ( class loader loader , string resource ) throws i o exception { properties props = new properties ( ) ; input stream in = get resource as stream ( loader , resource ) ; props load ( in ) ; io utils close quietly ( in ) ; return props ; }


returns the value of the given byte as an integer , when treated as unsigned that is , returns { @ code value + 256 } if { @ code value } is negative ; { @ code value } itself otherwise < b > java 8 users : < b > use { @ link byte # to unsigned int ( byte ) } instead

public static int to int ( byte value ) { return value & unsigned mask ; }


close the stream this will not return until the upload is complete or the attempt to perform the upload has failed exceptions raised in this method are indicative that the write has failed and data is at risk of being lost

public void close ( ) throws i o exception { if ( closed get and set ( true ) ) { / / already closed log debug ( " ignoring close ( ) as stream is already closed " ) ; return ; } s 3 a data blocks data block block = get active block ( ) ; boolean has block = has active block ( ) ; log debug ( " { } : closing block # { } : current block = { } " , this , block count , has block ? block : " ( none ) " ) ; long bytes = 0 ; try { if ( multi part upload = = null ) { if ( has block ) { / / no uploads of data have taken place , put the single block up / / this must happen even if there is no data , so that 0 byte files / / are created bytes = put object ( ) ; bytes submitted = bytes ; } } else { / / there ' s an mpu in progress ' ; / / if there is more data to upload , or no data has yet been uploaded , / / put the final block if ( has block & & ( block has data ( ) | | multi part upload get parts submitted ( ) = = 0 ) ) { / / send last part upload current block ( ) ; } / / wait for the partial uploads to finish final list < part e tag > part e tags = multi part upload wait for all part uploads ( ) ; bytes = bytes submitted ; / / then complete the operation if ( put tracker about to complete ( multi part upload get upload id ( ) , part e tags , bytes , iostatistics ) ) { multi part upload complete ( part e tags ) ; } else { log info ( " file { } will be visible when the job is committed " , key ) ; } } if ( ! put tracker output immediately visible ( ) ) { / / track the number of bytes uploaded as commit operations statistics commit uploaded ( bytes ) ; } log debug ( " upload complete to { } by { } " , key , write operation helper ) ; } catch ( i o exception ioe ) { / / the operation failed / / if this happened during a multipart upload , abort the / / operation , so as to not leave ( billable ) data / / pending on the bucket if ( multi part upload ! = null ) { multi part upload abort ( ) ; } write operation helper write failed ( ioe ) ; throw ioe ; } finally { cleanup with logger ( log , block , block factory ) ; log debug ( " statistics : { } " , statistics ) ; cleanup with logger ( log , statistics ) ; clear active block ( ) ; } / / note end of write this does not change the state of the remote fs write operation helper write successful ( bytes ) ; }


create a new delegation token it ' s slightly inefficient to create a new one every time , but it avoids concurrency problems with managing any singleton

public abstract s 3 a token identifier create token identifier ( final optional < role model policy > policy , final encryption secrets encryption secrets , final text renewer ) throws i o exception { require service started ( ) ; preconditions check not null ( aws credentials , " no aws credentials to use for a delegation token " ) ; return new full credentials token identifier ( get canonical uri ( ) , get owner text ( ) , renewer , aws credentials , encryption secrets , credential origin ) ; }


list all the snapshottable directories that are owned by the current user

public snapshottable directory status [ ] get snapshottable dir listing ( string user name ) { if ( snapshottables is empty ( ) ) { return null ; } list < snapshottable directory status > status list = new array list < snapshottable directory status > ( ) ; for ( i node directory dir : snapshottables values ( ) ) { if ( user name = = null | | user name equals ( dir get user name ( ) ) ) { snapshottable directory status status = new snapshottable directory status ( dir get modification time ( ) , dir get access time ( ) , dir get fs permission ( ) , enum set none of ( hdfs file status flags class ) , dir get user name ( ) , dir get group name ( ) , dir get local name bytes ( ) , dir get id ( ) , dir get children num ( snapshot current state id ) , dir get directory snapshottable feature ( ) get num snapshots ( ) , dir get directory snapshottable feature ( ) get snapshot quota ( ) , dir get parent ( ) = = null ? d f s util client empty bytes : d f s util string 2 bytes ( dir get parent ( ) get full path name ( ) ) ) ; status list add ( status ) ; } } collections sort ( status list , snapshottable directory status comparator ) ; return status list to array ( new snapshottable directory status [ status list size ( ) ] ) ; }


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


asserts that a { @ link starlark info } has fields a = 1 , b = 2 , c = 3 ( and nothing else )

private static void assert has exactly values a 1 b 2 c 3 ( starlark info info ) throws exception { assert that ( info get field names ( ) ) contains exactly ( " a " , " b " , " c " ) ; assert that ( info get value ( " a " ) ) is equal to ( starlark int of ( 1 ) ) ; assert that ( info get value ( " b " ) ) is equal to ( starlark int of ( 2 ) ) ; assert that ( info get value ( " c " ) ) is equal to ( starlark int of ( 3 ) ) ; }


removes a { @ link graph binding } this means any nodes that only belonged to that binding will be removed from the graph

public synchronized void unregister ( graph binding binding ) { if ( ! m bindings remove ( binding ) ) { throw new runtime exception ( " tried to unregister non - existent binding " ) ; } unregister nodes ( binding ) ; if ( m bindings is empty ( ) ) { m timing source stop ( ) ; m sorted nodes clear ( ) ; if ( ! m node states is empty ( ) ) { throw new runtime exception ( " failed to clean up all nodes " ) ; } } m is dirty = true ; }


set whether to use direct field access instead of bean property access default is { @ code false } , using bean property access switch this to { @ code true } in order to enforce direct field access

public final void set direct field access ( boolean direct field access ) { this direct field access = direct field access ; }


optional hook executed when the subscription is cancelled by calling this subscriber ' s { @ link # cancel ( ) } method defaults to doing nothing

protected void hook on cancel ( ) { / / no - op }


set whether the entries in the table can be edited

public void set editing enabled ( boolean enable edits ) { table model set editing enabled ( enable edits ) ; }


get the original { @ link service discovery }

public final service discovery get original ( ) { return original ; }


test inline additional properties < b > 200 < b > - successful operation

public void test inline additional properties ( map < string , string > param ) throws i o exception { test inline additional properties for http response ( param ) ; }


set the max number of map tasks to run concurrently in the local job runner

public static void set local max running maps ( org apache hadoop mapreduce job context job , int max maps ) { job get configuration ( ) set int ( local max maps , max maps ) ; }


create a server builder that will bind with the given name

public static in process server builder for name ( string name ) { return new in process server builder ( name ) ; }


if set to true , the load balancer will send a 301 redirect for all http connections , asking the clients to use https < code > bool https redirect = 1 ; < code >

public builder set https redirect ( boolean value ) { https redirect = value ; on changed ( ) ; return this ; }


merges runfiles from a given runfiles support

public builder merge ( @ nullable runfiles support runfiles support ) { if ( runfiles support = = null ) { return this ; } merge ( runfiles support get runfiles ( ) ) ; return this ; }


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

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


public void set flink collector ( collector < tuple 2 < key , value > > flink collector ) { this flink collector = flink collector ; }


public boolean is message id enabled ( ) { return this message id enabled ; }


verifies that a reporter can be configured with all it ' s arguments being forwarded

public void test reporter argument forwarding ( ) { final configuration config = new configuration ( ) ; configure reporter 1 ( config ) ; final list < reporter setup > reporter setups = reporter setup from configuration ( config , null ) ; assert assert equals ( 1 , reporter setups size ( ) ) ; final reporter setup reporter setup = reporter setups get ( 0 ) ; assert reporter 1 configured ( reporter setup ) ; }


the from part of the range query null indicates unbounded

public range query builder from ( object from ) { return from ( from , this include lower ) ; }


set the < code > ask list < code > of the request

public allocate request builder ask list ( list < resource request > ask list ) { allocate request set ask list ( ask list ) ; return this ; }


returns one of the something decodabet byte arrays depending on the options specified it ' s possible , though silly , to specify ordered and url safe in which case one of them will be picked , though there is no guarantee as to which one will be picked

private final static byte [ ] get decodabet ( int options ) { if ( ( options & url safe ) = = url safe ) { return url safe decodabet ; } else if ( ( options & ordered ) = = ordered ) { return ordered decodabet ; } else { return standard decodabet ; } }


returns a single value the subject currently has or null if no such value exists the method is thread - safe

public t get value ( ) { return buffer get value ( ) ; }


retrieve a { @ link script engine } from the given { @ link script engine manager } by name , delegating to { @ link script engine manager # get engine by name } but throwing a descriptive exception if not found or if initialization failed

public static script engine retrieve engine by name ( script engine manager script engine manager , string engine name ) { script engine engine = script engine manager get engine by name ( engine name ) ; if ( engine = = null ) { set < string > engine names = new linked hash set < > ( ) ; for ( script engine factory engine factory : script engine manager get engine factories ( ) ) { list < string > factory names = engine factory get names ( ) ; if ( factory names contains ( engine name ) ) { / / special case : get engine by name returned null but engine is present / / let ' s assume it failed to initialize ( which script engine manager silently swallows ) / / if it happens to initialize fine now , alright , but we really expect an exception try { engine = engine factory get script engine ( ) ; engine set bindings ( script engine manager get bindings ( ) , script context global scope ) ; } catch ( throwable ex ) { throw new illegal state exception ( " script engine with name ' " + engine name + " ' failed to initialize " , ex ) ; } } engine names add all ( factory names ) ; } throw new illegal argument exception ( " script engine with name ' " + engine name + " ' not found ; registered engine names : " + engine names ) ; } return engine ; }


returns an immutable multimap containing the given entries , in order

public static < k , v > immutable list multimap < k , v > of ( k k 1 , v v 1 , k k 2 , v v 2 , k k 3 , v v 3 ) { immutable list multimap builder < k , v > builder = immutable list multimap builder ( ) ; builder put ( k 1 , v 1 ) ; builder put ( k 2 , v 2 ) ; builder put ( k 3 , v 3 ) ; return builder build ( ) ; }


returns entry data size , based on directory entry information for a valid zip file , this will be the correct size of of the entry data

public int data size ( ) { return get ( cenhow ) = = 0 ? get ( cenlen ) : get ( censiz ) ; }


sets the interesting properties for this pact connection

public void set interesting properties ( interesting properties props ) { if ( this interesting props = = null ) { this interesting props = props ; } else { throw new illegal state exception ( " interesting properties have already been set " ) ; } }


equivalent to { @ link # peek fully ( byte [ ] , int , int , boolean ) peek fully ( target , offset , length , false ) }

void peek fully ( byte [ ] target , int offset , int length ) throws i o exception ;


public void remove node ( @ non null node n ) throws i o exception { nodes remove node ( n ) ; }


create a new { @ link merged annotations } instance containing all annotations and meta - annotations from the specified element and , depending on the { @ link search strategy } , related inherited elements

static merged annotations from ( annotated element element , search strategy search strategy ) { return from ( element , search strategy , repeatable containers standard repeatables ( ) ) ; }


the specified instr has set the specified bit for this context reg if setting fails the value will be left in an unknown state

public boolean set bit at ( instruction instr , scalar bit , int right shift factor ) { if ( bit ! = null ) { int bit num = ( int ) bit get unsigned value ( ) - right shift factor ; return set bit at ( instr , bit num ) ; } value = null ; return false ; }


check patch signature , tinker id and meta files

public void on load package check fail ( file patch file , int error code ) { share tinker log i ( tag , " patch load reporter on load package check fail : " + " load patch package check fail file path : % s , error code : % d " , patch file get absolute path ( ) , error code ) ; check and clean patch ( ) ; }


an expectation for checking if the given element is selected

public static expected condition < boolean > element to be selected ( final web element element ) { return element selection state to be ( element , true ) ; }


public final commit stats commit stats ( ) { return new commit stats ( get last committed segment infos ( ) ) ; }


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


returns a list of actions to delete bookmarks that are in the code unit surrounding the given address < b > for the given type of bookmark < b >

private list < docking action if > get actions for code unit and type ( address primary address , string type , bookmark navigator navigator ) { / / find all bookmarks that may be within the code unit at address list < docking action if > action list = new array list < > ( ) ; code unit cu = current program get listing ( ) get code unit containing ( primary address ) ; if ( cu = = null ) { return action list ; } address start = cu get min address ( ) ; address end = cu get max address ( ) ; if ( ! navigator intersects ( start , end ) ) { return action list ; } for ( int i = 1 ; i < cu get length ( ) ; i + + ) { address next code unit address = start add ( i ) ; if ( ! next code unit address equals ( primary address ) ) { / / skip the original location bookmark [ ] other bookmarks = bookmark mgr get bookmarks ( next code unit address , type ) ; if ( other bookmarks length > 0 ) { docking action action = new delete bookmark action ( this , other bookmarks [ 0 ] , true ) ; action set enabled ( true ) ; action list add ( action ) ; } } } return action list ; }


public static int get layout id by name ( string name ) { return utils get app ( ) get resources ( ) get identifier ( name , " layout " , utils get app ( ) get package name ( ) ) ; }


returns an input stream that reads from the log file it will use a gzip - compressed log file ( log gz ) if that exists

public @ non null input stream get log input stream ( ) throws i o exception { file log file = get log file ( ) ; if ( log file exists ( ) ) { / / checking if a " gz " file was return try { input stream fis = files new input stream ( log file to path ( ) ) ; if ( log file get name ( ) ends with ( " gz " ) ) { return new g z i p input stream ( fis ) ; } else { return fis ; } } catch ( invalid path exception e ) { throw new i o exception ( e ) ; } } string message = " no such file : " + log file ; return new byte array input stream ( charset ! = null ? message get bytes ( charset ) : message get bytes ( ) ) ; }


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


adds the specified value to the specified element of this big array

public void add ( long index , long value ) { array [ segment ( index ) ] [ offset ( index ) ] + = value ; }


recursively list all entries , with a depth first traversal of the directory tree

public static tree scan results tree walk ( file system fs , path path ) throws i o exception { tree scan results dirs and files = new tree scan results ( ) ; file status [ ] statuses = fs list status ( path ) ; for ( file status status : statuses ) { log info ( " { } { } " , status get path ( ) , status is directory ( ) ? " * " : " " ) ; } for ( file status status : statuses ) { dirs and files add ( status ) ; if ( status is directory ( ) ) { dirs and files add ( tree walk ( fs , status get path ( ) ) ) ; } } return dirs and files ; }


specifies a listener instance that caches should notify each time an entry is removed for any { @ linkplain removal cause reason } each cache created by this builder will invoke this listener as part of the routine maintenance described in the class documentation above < b > warning : < b > after invoking this method , do not continue to use this cache builder reference ; instead use the reference this method returns at runtime , these point to the same instance , but only the returned reference has the correct generic type information so as to ensure type safety for best results , use the standard method - chaining idiom illustrated in the class documentation above , configuring a builder and building your cache in a single statement failure to heed this advice can result in a { @ link class cast exception } being thrown by a cache operation at some undefined point in the future < b > warning : < b > any exception thrown by { @ code listener } will not be propagated to the { @ code cache } user , only logged via a { @ link logger }

public < k1 extends k , v1 extends v > cache builder < k1 , v1 > removal listener ( removal listener < ? super k1 , ? super v1 > listener ) { check state ( this removal listener = = null ) ; / / safely limiting the kinds of caches this can produce @ suppress warnings ( " unchecked " ) cache builder < k1 , v1 > me = ( cache builder < k1 , v1 > ) this ; me removal listener = check not null ( listener ) ; return me ; }


tests that link stamping is disabled for all tests that support it

public void test no stamping for tests ( ) throws exception { rule factory rule factory = new rule factory ( analysis mock create rule class provider ( ) ) ; for ( string name : rule factory get rule class names ( ) ) { rule class rule class = rule factory get rule class ( name ) ; if ( target utils is test rule name ( name ) & & rule class has attr ( " stamp " , build type tristate ) ) { assert that ( rule class get attribute by name ( " stamp " ) get default value ( null ) ) is equal to ( tri state no ) ; } } }


shutdown gracefully the server and wait for resources to be released


public final short get opcode unit ( ) { return ( short ) opcode ; }


void set attribute value ( int attr index , object value , boolean explicit ) { if ( attr index < 0 | | attr index > = values length ) { throw new illegal argument exception ( " attribute with index " + attr index + " is not valid for rule " ) ; } if ( ! explicit & & explicit attrs get ( attr index ) ) { throw new illegal argument exception ( " attribute with index " + attr index + " already explicitly set " ) ; } values [ attr index ] = value ; if ( explicit ) { explicit attrs set ( attr index ) ; } }


not supported < b > you are attempting to create a set that may contain a non - { @ code comparable } element < b > proper calls will resolve to the version in { @ code immutable sorted set } , not this dummy version

public static < e > immutable sorted set < e > of ( e e 1 , e e 2 , e e 3 , e e 4 , e e 5 ) { throw new unsupported operation exception ( ) ; }


returns the escaped form of the given unicode code point , or { @ code null } if this code point does not need to be escaped when called as part of an escaping operation , the given code point is guaranteed to be in the range { @ code 0 < = cp < = character # max code point } if an empty array is returned , this effectively strips the input character from the resulting text if the character does not need to be escaped , this method should return { @ code null } , rather than an array containing the character representation of the code point this enables the escaping algorithm to perform more efficiently if the implementation of this method cannot correctly handle a particular code point then it should either throw an appropriate runtime exception or return a suitable replacement character it must never silently discard invalid input as this may constitute a security risk

protected abstract char [ ] escape ( int cp ) ;


returns the size of the view in the list where the resources will be displayed in pixels in the format [ x , y ] , or { @ code null } if no size is currently available note - the dimensions returned here must precisely match those of the view in the list if this method returns { @ code null } , then no request will be started for the given item

int [ ] get preload size ( @ non null t item , int adapter position , int per item position ) ;


returns an array of directories to search for libraries

public static string [ ] get library paths ( ) { string [ ] paths = new string [ path list size ( ) ] ; path list to array ( paths ) ; return paths ; }


get delete one row statement by condition fields , default not use limit 1 , because limit 1 is a sql dialect

default string get delete statement ( string table name , string [ ] condition fields ) { string condition clause = arrays stream ( condition fields ) map ( f - > format ( " % s = : % s " , quote identifier ( f ) , f ) ) collect ( collectors joining ( " and " ) ) ; return " delete from " + quote identifier ( table name ) + " where " + condition clause ; }


{ @ inherit doc } the default implementation does nothing

@ override public void enter select expression ( sql base parser select expression context ctx ) { }


returns a string representation for this instance < b > comparison to { @ code java util optional } : < b > this class leaves the specific string representation unspecified , unlike the java 8 equivalent


called when the format of the media being consumed by the renderer changes

default void on video input format changed ( format format ) { }


a list of namespaces to which this service is exported exporting a service allows it to be used by sidecars , gateways and virtual services defined in other namespaces this feature provides a mechanism for service owners and mesh administrators to control the visibility of services across namespace boundaries if no namespaces are specified then the service is exported to all namespaces by default the value " " is reserved and defines an export to the same namespace that the service is declared in similarly the value " " is reserved and defines an export to all namespaces for a kubernetes service , the equivalent effect can be achieved by setting the annotation " networking istio ioexport to " to a comma - separated list of namespace names note : in the current release , the ` export to ` value is restricted to " " or " " ( i e , the current namespace or all namespaces ) < code > repeated string export to = 7 ; < code >

public builder clear export to ( ) { export to = com google protobuf lazy string array list empty ; bit field 0 = ( bit field 0 & ~ 0x 0 0 0 0 0 0 1 0 ) ; on changed ( ) ; return this ; }


sorts the given methods primarily by name and secondarily by number of parameters

private static void sort methods ( method [ ] methods ) { arrays sort ( methods , new comparator < method > ( ) { @ override public int compare ( method m 1 , method m 2 ) { int name comparison = m 1 get name ( ) compare to ( m 2 get name ( ) ) ; if ( name comparison ! = 0 ) { return name comparison ; } else { return ints compare ( m 1 get parameter types ( ) length , m 2 get parameter types ( ) length ) ; } } } ) ; }


test regex mount pointes with named capture group

public void test conf link regex named group mapping ( ) throws exception { / / config : / / < property > / / < name > fs viewfs mounttable test view file system link regex cluster / / link regex ^ / ( ? < first dir > \ w + ) < / name > / / < value > / target test root / $ first dir < / value > / / < / property > / / dir path to test : / test conf link regex named group mapping 1 / / expect path : / target test root / test conf link regex named group mapping 1 uri view fs uri = new uri ( fs constants viewfs scheme , cluster name , " / " , null , null ) ; string regex str = " ^ / ( ? < first dir > \ \ w + ) " ; string dst path str = target test root + " $ first dir " ; path src path = new path ( " / test conf link regex named group mapping 1 " ) ; path expected resolve result = new path ( dst path str replace ( " $ first dir " , " test conf link regex named group mapping 1 " ) ) ; test regex mountpoint ( new configuration ( conf ) , regex str , dst path str , null , src path , expected resolve result , 3 ) ; / / config : / / < property > / / < name > fs viewfs mounttable test view file system link regex cluster / / link regex ^ / ( ? < first dir > \ w + ) < / name > / / < value > / target test root / $ { first dir } < / value > / / < / property > / / dir path to test : / test conf link regex named group mapping 2 / / expect path : / target test root / test conf link regex named group mapping 2 dst path str = target test root + " $ { first dir } " ; src path = new path ( " / test conf link regex named group mapping 2 " ) ; expected resolve result = new path ( dst path str replace ( " $ { first dir } " , " test conf link regex named group mapping 2 " ) ) ; test regex mountpoint ( new configuration ( conf ) , regex str , dst path str , null , src path , expected resolve result , 5 ) ; }


string to show abfs output stream statistics values in abfs output stream

@ override public string to string ( ) { final string builder output stream stats = new string builder ( " output stream statistics { " ) ; output stream stats append ( io statistics store to string ( ) ) ; output stream stats append ( " } " ) ; return output stream stats to string ( ) ; }


handler for an inbound http2 rst stream frame , terminating a stream

private void on rst stream read ( int stream id , long error code ) { netty client stream transport state stream = client stream ( connection ( ) stream ( stream id ) ) ; if ( stream ! = null ) { perf mark event ( " netty client handler on rst stream read " , stream tag ( ) ) ; status status = status from h 2 error ( null , " rst stream closed stream " , error code , null ) ; stream transport report status ( status , error code = = http 2 error refused stream code ( ) ? rpc progress refused : rpc progress processed , false / * stop delivery * / , new metadata ( ) ) ; if ( keep alive manager ! = null ) { keep alive manager on data received ( ) ; } } }


public timeline clear ( @ nullable shuffle order shuffle order ) { this shuffle order = shuffle order ! = null ? shuffle order : this shuffle order clone and clear ( ) ; remove media sources internal ( / * from index = * / 0 , / * to index = * / get size ( ) ) ; return create timeline ( ) ; }


get the list of acceptable media types , as specified by the { @ code accept } header returns an empty list if the acceptable media types are unspecified


catch cases where ' l ' spelled twice but pronounced once , e g , ' docilely ' = > tsl

boolean encode lely to l ( ) { / / e g " agilely " , " docilely " if ( string at ( ( m current - 1 ) , 5 , " ilely " , " " ) & & ( ( m current + 3 ) = = m last ) ) { metaph add ( " l " ) ; m current + = 3 ; return true ; } return false ; }


update index or offset mapping in { @ code sparse index map }

protected void update index or offset ( sparse index map sparse index map , int old index , int old offset , int new index , int new offset ) { / / should override by subclass if needed }


returns the field name used in this query

public string field name ( ) { return this field name ; }


throws { @ link mutability exception } if this instance is mutable

public final void throw if mutable ( ) { if ( mutable ) { throw new mutability exception ( " mutable instance " ) ; } }


public ascii string name ( ) { return name ; }


check that multiple blank lines are reduced to a single line

public void test multiple blanks reduced to one ( ) { list < string > input = list of ( " status = error " , " " , " " , " root logger level = info " ) ; list < string > expected = list of ( " status = error " , " " , " root logger level = info " ) ; final list < string > transformed = transform log 4j config skip blanks ( input ) ; assert that ( transformed , equal to ( expected ) ) ; }


@ override public void exit comparison ( eql base parser comparison context ctx ) { }


see the edsl examples at { @ link org elasticsearch common inject binder }

scoped binding builder to provider ( key < ? extends provider < ? extends t > > provider key ) ;


returns the number of relocations pointed to by the pointer to relocations field

public short get number of relocations ( ) { return number of relocations ; }


public static byte [ ] decrypt r s a ( final byte [ ] data , final byte [ ] private key , final int key size , final string transformation ) { return rsa template ( data , private key , key size , transformation , false ) ; }


public date histogram interval get delay ( ) { return delay ; }


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


public static logical type to logical type ( data type data type ) { return data type get logical type ( ) ; }


returns f fmpeg - compatible codec - specific initialization data ( " extra data " ) , or { @ code null } if not required

private static @ nullable byte [ ] get extra data ( string mime type , list < byte [ ] > initialization data ) { switch ( mime type ) { case mime types audio aac : case mime types audio opus : return initialization data get ( 0 ) ; case mime types audio alac : return get alac extra data ( initialization data ) ; case mime types audio vorbis : return get vorbis extra data ( initialization data ) ; default : / / other codecs do not require extra data return null ; } }


set the components of the dynamic structure all at once this does not add the components in , it replaces any existing ones

public void set components ( list < data type > components , list < string > component names , list < string > component descs ) { this components = new array list < data type > ( components ) ; this component names = new array list < string > ( component names ) ; this component descs = new array list < string > ( component descs ) ; }


public void set temporary state ( state temporary state ) { this temporary state = temporary state ; }


public void get user by name test ( ) throws api exception { string username = null ; user response = api get user by name ( username ) ; / / todo : test validations }


find a free port that hasn ' t been assigned yet

private int get un assigned port ( set < integer > used ports , int max trials ) { int count = 0 ; while ( count < max trials ) { int port = net utils get free socket port ( ) ; if ( used ports contains ( port ) ) { count + + ; } else { return port ; } } return - 1 ; }


checks that in a streaming use case where checkpointing is enabled and the number of execution retries is set to 0 , restarting is deactivated

public void test no restarting when checkpointing and explicit execution retries zero ( ) throws exception { stream execution environment env = stream execution environment get execution environment ( ) ; env enable checkpointing ( 500 ) ; env set number of execution retries ( 0 ) ; env from elements ( 1 ) print ( ) ; stream graph graph = env get stream graph ( ) ; job graph job graph = graph get job graph ( ) ; restart strategies restart strategy configuration restart strategy = job graph get serialized execution config ( ) deserialize value ( get class ( ) get class loader ( ) ) get restart strategy ( ) ; assert assert not null ( restart strategy ) ; assert assert true ( restart strategy instanceof restart strategies no restart strategy configuration ) ; }


public uri get canonical uri ( ) { return uri ; }


public create users with array input oper req spec ( consumer < request spec builder > req spec customizer ) { req spec customizer accept ( req spec ) ; return this ; }


sets a new drawable at the specified index , and return the previous drawable , if any

public drawable set drawable ( int index , @ nullable drawable drawable ) { preconditions check argument ( index > = 0 ) ; preconditions check argument ( index < m layers length ) ; final drawable old drawable = m layers [ index ] ; if ( drawable ! = old drawable ) { if ( drawable ! = null & & m is mutated ) { drawable mutate ( ) ; } drawable utils set callbacks ( m layers [ index ] , null , null ) ; drawable utils set callbacks ( drawable , null , null ) ; drawable utils set drawable properties ( drawable , m drawable properties ) ; drawable utils copy properties ( drawable , this ) ; drawable utils set callbacks ( drawable , this , this ) ; m is stateful calculated = false ; m layers [ index ] = drawable ; invalidate self ( ) ; } return old drawable ; }


see the edsl examples at { @ link binder }

< t > linked binding builder < t > bind ( key < t > key ) ;


return true if this inline object 1 object is equal to o

public boolean equals ( object o ) { if ( this = = o ) { return true ; } if ( o = = null | | get class ( ) ! = o get class ( ) ) { return false ; } inline object 1 inline object 1 = ( inline object 1 ) o ; return objects equals ( this additional metadata , inline object 1 additional metadata ) & & objects equals ( this file , inline object 1 file ) ; }


parameters used for controlling the response and thus might not be consumed during preparation of the request execution in { @ link base rest handler # prepare request ( rest request , node client ) }

protected set < string > response params ( ) { return collections empty set ( ) ; }


public builder persist records ( list < anomaly record > records ) { for ( anomaly record record : records ) { logger trace ( " [ { } ] es bulk action : index record to index [ { } ] with id [ { } ] " , job id , index name , record get id ( ) ) ; index result ( record get id ( ) , record , " record " ) ; } return this ; }


public static function definition def ( class < ? extends function > function , function builder builder , boolean datetime , string names ) { check is true ( names length > 0 , " at least one name must be provided for the function " ) ; string primary name = names [ 0 ] ; list < string > aliases = arrays as list ( names ) sub list ( 1 , names length ) ; function definition builder real builder = ( uf , distinct , cfg ) - > { try { return builder build ( uf source ( ) , uf children ( ) , distinct , cfg ) ; } catch ( ql illegal argument exception e ) { throw new parsing exception ( uf source ( ) , " error building [ " + primary name + " ] : " + e get message ( ) , e ) ; } } ; return new function definition ( primary name , unmodifiable list ( aliases ) , function , datetime , real builder ) ; }


returns the values of a given property in qualifiers

protected list < value > find values ( list < snak group > groups , string pid ) { list < value > results = new array list < > ( ) ; for ( snak group group : groups ) { if ( group get property ( ) get id ( ) equals ( pid ) ) { for ( snak snak : group get snaks ( ) ) results add ( snak get value ( ) ) ; } } return results ; }


reconstruct a set of blocks to full strength through replication or erasure coding

int compute reconstruction work for blocks ( list < list < block info > > blocks to reconstruct ) { int scheduled work = 0 ; list < block reconstruction work > recon work = new array list < > ( ) ; / / step 1 : categorize at - risk blocks into replication and ec tasks namesystem write lock ( ) ; try { synchronized ( needed reconstruction ) { for ( int priority = 0 ; priority < blocks to reconstruct size ( ) ; priority + + ) { for ( block info block : blocks to reconstruct get ( priority ) ) { block reconstruction work rw = schedule reconstruction ( block , priority ) ; if ( rw ! = null ) { recon work add ( rw ) ; } } } } } finally { namesystem write unlock ( ) ; } / / step 2 : choose target nodes for each reconstruction task for ( block reconstruction work rw : recon work ) { / / exclude all of the containing nodes from being targets / / this list includes decommissioning or corrupt nodes final set < node > excluded nodes = new hash set < > ( rw get containing nodes ( ) ) ; / / exclude all nodes which already exists as targets for the block list < datanode storage info > targets = pending reconstruction get targets ( rw get block ( ) ) ; if ( targets ! = null ) { for ( datanode storage info dn : targets ) { excluded nodes add ( dn get datanode descriptor ( ) ) ; } } / / choose replication targets : not holding the global lock final block placement policy placement policy = placement policies get policy ( rw get block ( ) get block type ( ) ) ; rw choose targets ( placement policy , storage policy suite , excluded nodes ) ; } / / step 3 : add tasks to the dn namesystem write lock ( ) ; try { for ( block reconstruction work rw : recon work ) { final datanode storage info [ ] targets = rw get targets ( ) ; if ( targets = = null | | targets length = = 0 ) { rw reset targets ( ) ; continue ; } synchronized ( needed reconstruction ) { if ( validate reconstruction work ( rw ) ) { scheduled work + + ; } } } } finally { namesystem write unlock ( ) ; } if ( block log is debug enabled ( ) ) { / / log which blocks have been scheduled for reconstruction for ( block reconstruction work rw : recon work ) { datanode storage info [ ] targets = rw get targets ( ) ; if ( targets ! = null & & targets length ! = 0 ) { string builder target list = new string builder ( " datanode ( s ) " ) ; for ( datanode storage info target : targets ) { target list append ( ' ' ) append ( target get datanode descriptor ( ) ) ; } block log debug ( " block * ask { } to replicate { } to { } " , rw get src nodes ( ) , rw get block ( ) , target list ) ; } } block log debug ( " block * needed reconstruction = { } pending reconstruction = { } " , needed reconstruction size ( ) , pending reconstruction size ( ) ) ; } return scheduled work ; }


writes three code units to the given output destination , where the second and third are represented as single < code > int < code > and emitted in little - endian order

protected static void write ( annotated output out , short c 0 , int c 1c 2 ) { write ( out , c 0 , ( short ) c 1c 2 , ( short ) ( c 1c 2 > > 16 ) ) ; }


create a { @ link simple cache manager } with the specified cache ( s )

public static cache manager create simple cache manager ( string cache names ) { simple cache manager result = new simple cache manager ( ) ; list < cache > caches = new array list < > ( ) ; for ( string cache name : cache names ) { caches add ( new concurrent map cache ( cache name ) ) ; } result set caches ( caches ) ; result after properties set ( ) ; return result ; }


parses a given datetime string to milli seconds since 1970 - 01 - 01 00 : 00 : 00 utc using the default format " yyyy - mm - dd " or " yyyy - mm - dd hh : mm : ss " depends on the string length

private static long parse to time millis ( string date str , time zone tz ) { string format ; if ( date str length ( ) < = 10 ) { format = date format string ; } else { format = timestamp format string ; } return parse to time millis ( date str , format , tz ) + get millis ( date str ) ; }


start a transfer - manager managed async put of an object , incrementing the put requests and put bytes counters it does not update the other counters , as existing code does that as progress callbacks come in byte length is calculated from the file length , or , if there is no file , from the content length of the header because the operation is async , any stream supplied in the request must reference data ( files , buffers ) which stay valid until the upload completes retry policy : na : the transfer manager is performing the upload

public upload info put object ( put object request put object request ) { long len = get put request length ( put object request ) ; log debug ( " put { } bytes to { } via transfer manager " , len , put object request get key ( ) ) ; increment put start statistics ( len ) ; upload upload = transfers upload ( put object request ) ; return new upload info ( upload , len ) ; }


when a { @ link item } is copied from existing one , the files are first copied on the file system , then it will be loaded , then this method will be invoked to perform any implementation - specific work

public void on copied from ( item src ) { }


checks if the token is about to expire in the next 5 minutes the 5 minute allowance is to allow for clock skew and also to allow for token to be refreshed in that much time

protected boolean is token about to expire ( ) { if ( token = = null ) { log debug ( " a a d token : no token returning expiring = true " ) ; return true ; / / no token should have same response as expired token } boolean expiring = false ; / / allow 5 minutes for clock skew long approximately now = system current time millis ( ) + five minutes ; if ( token get expiry ( ) get time ( ) < approximately now ) { expiring = true ; } if ( expiring ) { log debug ( " a a d token : token expiring : " + token get expiry ( ) to string ( ) + " : five - minute window : " + new date ( approximately now ) to string ( ) ) ; } return expiring ; }


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


sets the preference to execute the search defaults to randomize across shards can be set to { @ code local } to prefer local shards or a custom value , which guarantees that the same order will be used across different requests

public multi get request builder set preference ( string preference ) { request preference ( preference ) ; return this ; }


returns true if this is a full fetch request

public boolean is full ( ) { return ( this epoch = = initial epoch ) | | ( this epoch = = final epoch ) ; }


highlights any y - value at the given x - value in the given data set provide - 1 as the data set index to undo all highlighting this method will call the listener

public void highlight value ( float x , int data set index ) { highlight value ( x , data set index , - 1 , true ) ; }


disposes this index array and all its associated open g l resources

public void dispose ( ) { buffer utils dispose unsafe byte buffer ( byte buffer ) ; }


create a new row mapper for reading result objects from a single column

protected < t > row mapper < t > get single column row mapper ( class < t > required type ) { return new single column row mapper < > ( required type ) ; }


indicates that the computer was marked as temporarily offline by the administrator this is the reverse operation of { @ link # on temporarily online ( computer ) }

public void on temporarily offline ( computer c , offline cause cause ) { }


public void user status test ( ) { / / todo : test user status }


inserts the specified number of items at the specified index the new items will have values equal to the values at those indices before the insertion

public void insert range ( int index , int count ) { if ( index > size ) throw new index out of bounds exception ( " index can ' t be > size : " + index + " > " + size ) ; int size needed = size + count ; if ( size needed > items length ) items = resize ( math max ( math max ( 8 , size needed ) , ( int ) ( size * 1 7 5f ) ) ) ; system arraycopy ( items , index , items , index + count , size - index ) ; size = size needed ; }


turns a long representing a sequence of 8 bytes read in little - endian order into a number that when compared produces the same effect as comparing the original sequence of bytes lexicographically

private static long long bytes to long ( long bytes ) { return long reverse bytes ( bytes ) ^ long min value ; }


get the property value , if it is null return default value

public string get property ( string key , string default value ) { string value = properties get ( key ) ; return ( value = = null ) ? default value : value ; }


expands - - config options present in the requested commands using the options configuration provided in command to rc args

static void expand config options ( event handler event handler , list multimap < string , rc chunk of args > command to rc args , list < string > commands to parse , consumer < string > rc file notes consumer , options parser options parser ) throws options parsing exception { option value description config value description = options parser get option value description ( " config " ) ; if ( config value description ! = null & & config value description get canonical instances ( ) ! = null ) { / / find the base set of configs this does not include the config options that might be / / recursively included immutable list < parsed option description > config instances = immutable list copy of ( config value description get canonical instances ( ) ) ; / / expand the configs that are mentioned in the input flatten these expansions before parsing / / them , to preserve order for ( parsed option description config instance : config instances ) { string config value to expand = ( string ) config instance get converted value ( ) ; list < string > expansion = get expansion ( event handler , command to rc args , commands to parse , config value to expand , rc file notes consumer ) ; options parser parse args as expansion of option ( config instance , string format ( " expanded from - - % s " , config value to expand ) , expansion ) ; } } option value description enable platform specific config description = options parser get option value description ( " enable platform specific config " ) ; if ( should enable platform specific config ( enable platform specific config description , command to rc args , commands to parse ) ) { list < string > expansion = get expansion ( event handler , command to rc args , commands to parse , get platform name ( ) , rc file notes consumer ) ; options parser parse args as expansion of option ( iterables get only element ( enable platform specific config description get canonical instances ( ) ) , string format ( " enabled by - - enable platform specific config " ) , expansion ) ; } / / at this point , we ' ve expanded everything , identify duplicates , if any , to warn about / / re - application list < string > configs = options parser get options ( common command options class ) configs ; set < string > config set = new hash set < > ( ) ; linked hash set < string > duplicate configs = new linked hash set < > ( ) ; for ( string config value : configs ) { if ( ! config set add ( config value ) ) { duplicate configs add ( config value ) ; } } if ( ! duplicate configs is empty ( ) ) { event handler handle ( event warn ( string format ( " the following configs were expanded more than once : % s for repeatable flags , " + " repeats are counted twice and may lead to unexpected behavior " , duplicate configs ) ) ) ; } }


builds the { @ link client } instance with a custom reactive client provider

public < rx extends rx invoker provider < ? > > client build rx ( string name , class < rx > invoker type ) { return build ( name ) register ( invoker type ) ; }


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


public io grpc testing integration empty protos empty unimplemented call ( io grpc testing integration empty protos empty request ) { return io grpc stub client calls blocking unary call ( get channel ( ) , get unimplemented call method ( ) , get call options ( ) , request ) ; }


parses all items in the text input field and adds them as new tags

private void process creates ( ) { if ( program = = null ) { msg show info ( this , tool get active window ( ) , " no program " , " you must load a program before trying to create tags " ) ; return ; } list < string > dropped = new array list < > ( ) ; list < string > names = get input names ( ) ; for ( string name : names ) { / / only execute the create command if a tag with the given name does not already exist / / ( note : this could fail if the model is not yet loaded , but this is unlikely the / / only fallout is that the error message would not be shown - - the database will not add / / the tag twice ) if ( source panel tag exists ( name ) ) { dropped add ( name ) ; } else { command cmd = new create function tag cmd ( name ) ; tool execute ( cmd , program ) ; } } if ( ! dropped is empty ( ) ) { string text = string utils join ( dropped , " , " ) ; msg show info ( this , tool get active window ( ) , " duplicate tag names " , " tags aleady exist ignoring the following tags : " + text ) ; } swing run later ( ( ) - > tag input field set text ( " " ) ) ; }


print exceptions resolved through a handler exception resolver

protected void print resolved exception ( @ nullable exception resolved exception ) throws exception { if ( resolved exception = = null ) { this printer print value ( " type " , null ) ; } else { this printer print value ( " type " , resolved exception get class ( ) get name ( ) ) ; } }


public long get pointer to inliner ( ) { return pointer to inliner ; }


public mongo client get mongo client ( ) { return mongo client ; }


public void initialize ( ) throws i o exception { try { src pattern = pattern compile ( src path regex ) ; } catch ( pattern syntax exception ex ) { throw new i o exception ( " failed to initialized mount point due to bad src path regex : " + src path regex + " , dst path : " + dst path , ex ) ; } var in dest path map = get var list in string ( dst path ) ; initialize interceptors ( ) ; }


return the outermost group vertex containing the given vertex or else return the given vertex if it is not in a group

public attributed vertex get outermost vertex ( attributed vertex vertex ) { while ( ! graph contains vertex ( vertex ) ) { attributed vertex owner = find owner of ( vertex ) ; if ( owner = = null ) { break ; / / should never happen not sure what to do here , but don ' t want to loop forever } vertex = owner ; } return vertex ; }


send a source event to the source coordinator

void send source event to coordinator ( source event source event ) ;


public object node client beat ( http servlet request request ) throws exception { override parameter request wrapper request wrapper = override parameter request wrapper build request ( request ) ; request wrapper add parameter ( common params service name , constants default group + constants service info spliter + web utils required ( request , " dom " ) ) ; return beat ( request wrapper ) ; }


gets the attempt number of this parallel subtask first attempt is numbered 0 the attempt number corresponds to the number of times this task has been restarted ( after failurecancellation ) since the job was initially started

public int get attempt number ( ) { return this attempt number ; }


sets the count of the given miss reason to the given value

public miss details builder set ( miss reason reason , int count ) { check argument ( details contains key ( reason ) ) ; details put ( reason , count ) ; return this ; }


model tests for additional properties array

public void test additional properties array ( ) { / / todo : test additional properties array }


lifted from core ' s rollup job caps , so that we can test without having to include this actual logic in the request

private static map < string , rollup job caps rollup field caps > create rollup field caps ( final rollup job config rollup job config ) { final map < string , list < map < string , object > > > temp field caps = new hash map < > ( ) ; final group config group config = rollup job config get group config ( ) ; if ( group config ! = null ) { / / create rollup field caps for the date histogram final date histogram group config date histogram = group config get date histogram ( ) ; final map < string , object > date histogram agg cap = new hash map < > ( ) ; date histogram agg cap put ( " agg " , date histogram aggregation builder name ) ; date histogram agg cap put ( " interval " , date histogram get interval ( ) to string ( ) ) ; if ( date histogram get delay ( ) ! = null ) { date histogram agg cap put ( " delay " , date histogram get delay ( ) to string ( ) ) ; } date histogram agg cap put ( " time zone " , date histogram get time zone ( ) ) ; list < map < string , object > > date agg caps = temp field caps get or default ( date histogram get field ( ) , new array list < > ( ) ) ; date agg caps add ( date histogram agg cap ) ; temp field caps put ( date histogram get field ( ) , date agg caps ) ; / / create rollup field caps for the histogram final histogram group config histogram = group config get histogram ( ) ; if ( histogram ! = null ) { final map < string , object > histogram agg cap = new hash map < > ( ) ; histogram agg cap put ( " agg " , histogram aggregation builder name ) ; histogram agg cap put ( " interval " , histogram get interval ( ) ) ; arrays stream ( rollup job config get group config ( ) get histogram ( ) get fields ( ) ) for each ( field - > { list < map < string , object > > caps = temp field caps get or default ( field , new array list < > ( ) ) ; caps add ( histogram agg cap ) ; temp field caps put ( field , caps ) ; } ) ; } / / create rollup field caps for the term final terms group config terms = group config get terms ( ) ; if ( terms ! = null ) { final map < string , object > terms agg cap = singleton map ( " agg " , terms aggregation builder name ) ; arrays stream ( rollup job config get group config ( ) get terms ( ) get fields ( ) ) for each ( field - > { list < map < string , object > > caps = temp field caps get or default ( field , new array list < > ( ) ) ; caps add ( terms agg cap ) ; temp field caps put ( field , caps ) ; } ) ; } } / / create rollup field caps for the metrics final list < metric config > metrics config = rollup job config get metrics config ( ) ; if ( metrics config size ( ) > 0 ) { rollup job config get metrics config ( ) for each ( metric config - > { final list < map < string , object > > metrics = metric config get metrics ( ) stream ( ) map ( metric - > singleton map ( " agg " , ( object ) metric ) ) collect ( collectors to list ( ) ) ; metrics for each ( m - > { list < map < string , object > > caps = temp field caps get or default ( metric config get field ( ) , new array list < > ( ) ) ; caps add ( m ) ; temp field caps put ( metric config get field ( ) , caps ) ; } ) ; } ) ; } return collections unmodifiable map ( temp field caps entry set ( ) stream ( ) collect ( collectors to map ( map entry : : get key , e - > new rollup job caps rollup field caps ( e get value ( ) ) ) ) ) ; }


creates a new blocking - style stub that supports unary and streaming output calls on the service

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


group the records of this { @ code k stream } on a new key that is selected using the provided { @ link key value mapper } and { @ link serde } s as specified by { @ link grouped } { @ link k grouped stream } can be further grouped with other streams to form a { @ link cogrouped k stream } grouping a stream on the record key is required before an aggregation operator can be applied to the data ( cf { @ link k grouped stream } ) the { @ link key value mapper } selects a new key ( which may or may not be of the same type ) while preserving the original values if the new record key is { @ code null } the record will not be included in the resulting { @ link k grouped stream } because a new key is selected , an internal repartitioning topic may need to be created in kafka if a later operator depends on the newly selected key this topic will be named " $ { application id } - & lt ; name & gt ; - repartition " , where " application id " is user - specified in { @ link streams config } via parameter { @ link streams config # application id config application id config } , " & lt ; name & gt ; " is either provided via { @ link org apache kafka streams kstream grouped # as ( string ) } or an internally generated name you can retrieve all generated internal topic names via { @ link topology # describe ( ) } all data of this stream will be redistributed through the repartitioning topic by writing all records to it , and rereading all records from it , such that the resulting { @ link k grouped stream } is partitioned on the new key this operation is equivalent to calling { @ link # select key ( key value mapper ) } followed by { @ link # group by key ( ) }

< kr > k grouped stream < kr , v > group by ( final key value mapper < ? super k , ? super v , kr > key selector , final grouped < kr , v > grouped ) ;


create a new copy of this { @ link aggregation } with the same settings as this { @ link aggregation } and contains the provided sub - aggregations

public internal single bucket aggregation create ( internal aggregations sub aggregations ) { return new aggregation ( get name ( ) , get doc count ( ) , sub aggregations ) ; }


public long get long ( address addr ) throws no value exception ;


reschedules an active timer event for the node

public void reschedule ( @ non null node < k , v > node ) { if ( node get next in variable order ( ) ! = null ) { unlink ( node ) ; schedule ( node ) ; } }


returns the memoization strategy for this codec if set to { @ link memoization strategy # memoize before } , then { @ link deserialization context # register initial value } must be called first in the { @ link # deserialize } method , before delegating to any other codecs implementations of this method should just return a constant , since the choice of strategy is usually intrinsic to { @ link t }

default memoization strategy get strategy ( ) { return memoization strategy memoize after ; }


turns off the gui displays for errors this does not change the " is use error g u i ( ) " value for other tests in the test case

public static void dispose error g u i ( ) { msg set error display ( new console error display ( ) ) ; }


check whether an argument value has been registered for the given index

public boolean has indexed argument value ( int index ) { return this indexed argument values contains key ( index ) ; }


makes sure that the given name is good as a job name for use from { @ code new job }

public form validation do check job name ( @ query parameter string value ) { / / this method can be used to check if a file exists anywhere in the file system , / / so it should be protected get owner ( ) check permission ( item create ) ; if ( util fix empty ( value ) = = null ) { return form validation ok ( ) ; } try { jenkins check good name ( value ) ; value = value trim ( ) ; / / why trim * after * check good name ? not sure , but item group mix in create top level item does the same jenkins get ( ) get project naming strategy ( ) check name ( value ) ; } catch ( failure e ) { return form validation error ( e get message ( ) ) ; } if ( get owner ( ) get item group ( ) get item ( value ) ! = null ) { return form validation error ( messages hudson job already exists ( value ) ) ; } / / looks good return form validation ok ( ) ; }


searches for the first occurrence of a { @ link component provider } that is an instance of the given < code > provider class < code >

public static < t extends component provider > t get component provider ( class < t > clazz ) { docking window manager dwm = find active docking window manager ( ) ; assert not null ( " unable to find a docking window manager - is there a tool showing ? " , dwm ) ; return get component provider ( dwm , clazz ) ; }


configures how to buffer elements before sending them in bulk to the cluster for efficiency sets the maximum number of retries for a backoff attempt when flushing bulk requests make sure to enable backoff by selecting a strategy ( { @ link # bulk flush backoff constant ( ) } or { @ link # bulk flush backoff exponential ( ) } )

public elasticsearch bulk flush backoff max retries ( int max retries ) { internal properties put int ( connector bulk flush backoff max retries , max retries ) ; return this ; }


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


ensures that { @ code expression } is { @ code true } , throwing a { @ code verify exception } with a custom message otherwise see { @ link # verify ( boolean , string , object ) } for details

public static void verify ( boolean expression , @ nullable decl string error message template , char p 1 ) { if ( ! expression ) { throw new verify exception ( lenient format ( error message template , p 1 ) ) ; } }


specifies the expected number of nodes in the graph

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


public pattern evaluation stats evaluate patterns ( list < pattern info row object > rows ) { array list < pattern > pattern list = get pattern list ( rows ) ; if ( only pre patterns ) { msg show warn ( this , this , " only pre - patterns " , " only pre - patterns in selection : no true / false positive information will be calculated " ) ; } sequence search state root = sequence search state build state machine ( pattern list ) ; index to size clear ( ) ; for ( pattern pattern : pattern list ) { index to size put ( pattern get index ( ) , pattern get size ( ) ) ; } program current program = plugin get current program ( ) ; memory block [ ] blocks = current program get memory ( ) get blocks ( ) ; pattern evaluation stats match stats = new pattern evaluation stats ( ) ; for ( memory block block : blocks ) { if ( ! block is initialized ( ) ) { continue ; } / / todo : add toggle for searching non - executable blocks ? if ( ! block is execute ( ) ) { continue ; } search block ( root , block , match stats , current program , task monitor dummy ) ; } return match stats ; }


test that giving a null ' safe chars ' string causes a { @ link null pointer exception }

public void test bad arguments null ( ) { try { new percent escaper ( null , false ) ; fail ( " expected null pointer exception for null parameter " ) ; } catch ( null pointer exception expected ) { / / pass } }


public void delete pet ( long pet id , string api key ) throws api exception { delete pet with http info ( pet id , api key ) ; }


called when a view is requesting a start of a drag

void on start drag ( recycler view view holder view holder ) ;


protected w s federation registered service get ws federation registered service ( final service target service ) { val svc = config context get services manager ( ) find service by ( target service , w s federation registered service class ) ; registered service access strategy utils ensure service access is allowed ( target service , svc ) ; return svc ; }


get fakejson form data : test json serialization of form data

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


gets the underlying { @ code byte [ ] } of this instance , which may be larger than the number of bytes written

public byte [ ] get array ( ) { return data ; }


test of next header from method , of class zip in

public void test next header from directory entry ( ) throws exception { int count = entry count ; string filename = " test jar " ; zip file builder builder = new zip file builder ( ) ; for ( int i = 0 ; i < count ; i + + ) { builder add ( " pkg / f " + i + " class " , " all day long " ) ; } builder create ( filename ) ; final zip in zip in = new zip in ( filename ) ; zip in central directory ( ) ; list < directory entry > list = zip in central directory ( ) list ( ) ; count = 0 ; string name ; local file header header = zip in next header from ( null ) ; for ( directory entry dir entry : list ) { name = " pkg / f " + count + " class " ; assert that ( dir entry get filename ( ) ) is equal to ( name ) ; assert that ( header get filename ( ) ) is equal to ( name ) ; header = zip in next header from ( dir entry ) ; count + + ; } assert that ( header ) is null ( ) ; }


factory method that makes a new cache directive info by applying fields in a cache directive info to an existing cache directive

private static cache directive info create from info and defaults ( cache directive info info , cache directive defaults ) { / / initialize the builder with the default values cache directive info builder builder = new cache directive info builder ( defaults to info ( ) ) ; / / replace default with new value if present if ( info get path ( ) ! = null ) { builder set path ( info get path ( ) ) ; } if ( info get replication ( ) ! = null ) { builder set replication ( info get replication ( ) ) ; } if ( info get pool ( ) ! = null ) { builder set pool ( info get pool ( ) ) ; } if ( info get expiration ( ) ! = null ) { builder set expiration ( info get expiration ( ) ) ; } return builder build ( ) ; }


returns the primary symbol at the specified address , or null if no symbol exists

public final symbol get symbol at ( address address ) { return current program get symbol table ( ) get primary symbol ( address ) ; }


update index or offset mapping in { @ code sparse index map }

protected void update index or offset ( sparse index map sparse index map , int old index , int old offset , int new index , int new offset ) { / / should override by subclass if needed }


returns time at which version was created

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


returns the offset in { @ link # class file buffer } of the first class file ' s ' attributes ' array field entry

final int get first attribute offset ( ) { / / skip the access flags , this class , super class , and interfaces count fields ( using 2 bytes / / each ) , as well as the interfaces array field ( 2 bytes per interface ) int current offset = header + 8 + read unsigned short ( header + 6 ) * 2 ; / / read the fields count field int fields count = read unsigned short ( current offset ) ; current offset + = 2 ; / / skip the ' fields ' array field while ( fields count - - > 0 ) { / / invariant : current offset is the offset of a field info structure / / skip the access flags , name index and descriptor index fields ( 2 bytes each ) , and read the / / attributes count field int attributes count = read unsigned short ( current offset + 6 ) ; current offset + = 8 ; / / skip the ' attributes ' array field while ( attributes count - - > 0 ) { / / invariant : current offset is the offset of an attribute info structure / / read the attribute length field ( 2 bytes after the start of the attribute info ) and skip / / this many bytes , plus 6 for the attribute name index and attribute length fields / / ( yielding the total size of the attribute info structure ) current offset + = 6 + read int ( current offset + 2 ) ; } } / / skip the methods count and ' methods ' fields , using the same method as above int methods count = read unsigned short ( current offset ) ; current offset + = 2 ; while ( methods count - - > 0 ) { int attributes count = read unsigned short ( current offset + 6 ) ; current offset + = 8 ; while ( attributes count - - > 0 ) { current offset + = 6 + read int ( current offset + 2 ) ; } } / / skip the class file ' s attributes count field return current offset + 2 ; }


decset 7 , decawm , controls wraparound mode

public void test wrap around mode ( ) { / / default with wraparound : with terminal sized ( 3 , 3 ) enter string ( " abcd " ) assert lines are ( " abc " , " d " , " " ) ; / / with wraparound disabled : with terminal sized ( 3 , 3 ) enter string ( " \ 033 [ ? 7labcd " ) assert lines are ( " abd " , " " , " " ) ; enter string ( " efg " ) assert lines are ( " abg " , " " , " " ) ; / / re - enabling wraparound : enter string ( " \ 033 [ ? 7hhij " ) assert lines are ( " abh " , " ij " , " " ) ; }


commits the pending file , making it visible the file will contain the exact data as when the pending file was created this method tolerates situations where the file was already committed and will not raise an exception in that case this is important for idempotent commit retries as they need to happen after recovery

void commit after recovery ( ) throws i o exception ;


sets the db access related fields in the job conf

public static void configure d b ( configuration job , string driver class , string db url ) { configure d b ( job , driver class , db url , null , null ) ; }


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


get userlogout : logs out current logged in user session

default response entity < void > logout user ( ) { return new response entity < > ( http status not implemented ) ; }


test a cluster with even distribution , g then three nodes are added to the cluster , runs balancer with two of the nodes in the exclude list

public void test balancer cli with exclude list with ports in a file ( ) throws exception { final configuration conf = new hdfs configuration ( ) ; init conf ( conf ) ; do test ( conf , new long [ ] { capacity , capacity } , new string [ ] { rack0 , rack1 } , capacity , rack2 , new port number based nodes ( 3 , 2 , 0 ) , true , true ) ; }


private void key ( byte key [ ] ) { int i ; int koffp [ ] = { 0 } ; int lr [ ] = { 0 , 0 } ; int plen = p length , slen = s length ; for ( i = 0 ; i < plen ; i + + ) p [ i ] = p [ i ] ^ streamtoword ( key , koffp ) ; for ( i = 0 ; i < plen ; i + = 2 ) { encipher ( lr , 0 ) ; p [ i ] = lr [ 0 ] ; p [ i + 1 ] = lr [ 1 ] ; } for ( i = 0 ; i < slen ; i + = 2 ) { encipher ( lr , 0 ) ; s [ i ] = lr [ 0 ] ; s [ i + 1 ] = lr [ 1 ] ; } }


get the names of in parameters to be used

public set < string > get in parameter names ( ) { return this call meta data context get limited in parameter names ( ) ; }


blocks the current thread until a condition becomes true if the current thread is interrupted while waiting for the condition to become true , this method will restore the interrupt < b > after < b > the condition became true

private synchronized void wait uninterruptibly ( supplier < boolean > condition ) { boolean was interrupted = false ; while ( ! condition get ( ) ) { try { wait ( ) ; } catch ( interrupted exception e ) { was interrupted = true ; } } if ( was interrupted ) { / / restore the interrupted status thread current thread ( ) interrupt ( ) ; } }


notifies the view that the transform ended

void on transform end ( matrix transform ) ;


create the { @ linkplain aggregator } when none of the configured fields can be resolved to a { @ link values source }

protected abstract aggregator create unmapped ( aggregator parent , map < string , object > metadata ) throws i o exception ;


applies an aggregation that that gives the minimum value of every window of the data stream at the given position

public single output stream operator < t > min ( int position to min ) { return aggregate ( new comparable aggregator < > ( position to min , input get type ( ) , aggregation function aggregation type min , input get execution config ( ) ) ) ; }


sets the < code > my boolean < code > property

public outer composite my boolean ( boolean my boolean ) { this my boolean = my boolean ; return this ; }


gets the token , which together with the scheme , will be sent as the value of the authorization header

public string get bearer token ( ) { return bearer token ; }


< code > map & lt ; string , org apache dubbo metadata definition protobuf model phone number & gt ; double map = 9 ; < code >

public builder put all double map ( java util map < java lang string , org apache dubbo metadata definition protobuf model google p b phone number > values ) { internal get mutable double map ( ) get mutable map ( ) put all ( values ) ; return this ; }


specify the transaction name to use for transactional wrapping default is the bean name of this listener container , if any

public void set transaction name ( string transaction name ) { this transaction definition set name ( transaction name ) ; }


returns the ratio of cache requests which were hits this is defined as { @ code hit count request count } , or { @ code 1 0 } when { @ code request count = = 0 } note that { @ code hit rate + miss rate = ~ 1 0 }

public double hit rate ( ) { long request count = request count ( ) ; return ( request count = = 0 ) ? 1 0 : ( double ) hit count / request count ; }


public void set conf ( configuration configuration ) { this conf = configuration ; }


public void fatal ( string message , @ nullable object source , @ nullable parse state parse state , @ nullable throwable cause ) { location location = new location ( get resource ( ) , source ) ; this problem reporter fatal ( new problem ( message , location , parse state , cause ) ) ; }


triggers the program execution the environment will execute all parts of the program that have resulted in a " sink " operation sink operations are for example printing results or forwarding them to a message queue the program execution will be logged and displayed with a generated default name

public job execution result execute ( ) throws exception { return execute ( get job name ( ) ) ; }


return the role hint for this { @ code bean definition }

public int get role ( ) { return this role ; }


sets the single record to be returned by this iterator the offset and records - to - skip count will be used as provided here for the returned { @ link record and position } , meaning they need to point to after this specific record ( because a checkpoint taken after the record was processed needs to resume from after this record )

public void set ( final e element , final long offset , final long skip count ) { this record and position set ( element , offset , skip count ) ; this element = this record and position ; }


creates a { @ link paired stats } from with the given lists of { @ code x } and { @ code y } values , which must be of the same size

static paired stats create paired stats of ( list < double > x values , list < double > y values ) { return create filled paired stats accumulator ( x values , y values ) snapshot ( ) ; }


determine whether the given collection type is an approximable type , i e a type that { @ link # create approximate collection } can approximate

public static boolean is approximable collection type ( @ nullable class < ? > collection type ) { return ( collection type ! = null & & approximable collection types contains ( collection type ) ) ; }


get the checkout type whose name corresponds to the specified id

public static checkout type get checkout type ( int type i d ) { for ( checkout type type : values ( ) ) { if ( type name ( ) char at ( 0 ) = = type i d ) { return type ; } } return null ; }


see https : developer mozilla orgen - u sdocs web a p i windowdevice pixel ratio for more information

public static native double get native screen density ( ) / * - { return $ wnd device pixel ratio | | 1 ; }


public void clear ( ) { arrays fill ( bits , 0 ) ; }


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


does starting time allow service access boolean

protected boolean does starting time allow service access ( ) { if ( this starting date time ! = null ) { val st = date time utils zoned date time of ( this starting date time ) ; if ( st ! = null ) { val now = zoned date time now ( zone offset utc ) ; if ( now is before ( st ) ) { logger warn ( " service access not allowed because it starts at [ { } ] zoned now is [ { } ] " , this starting date time , now ) ; return false ; } } else { val st local = date time utils local date time of ( this starting date time ) ; if ( st local ! = null ) { val now = local date time now ( zone offset utc ) ; if ( now is before ( st local ) ) { logger warn ( " service access not allowed because it starts at [ { } ] local now is [ { } ] " , this starting date time , now ) ; return false ; } } } } return true ; }


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


like { @ link # get dependents } but excluding optional dependencies

public @ non null set < string > get mandatory dependents ( ) { set < string > s = new hash set < > ( dependents ) ; s remove all ( optional dependents ) ; return s ; }


returns the format model to use for the internals of open structures

public field format model get open data format ( data data ) { if ( group array elements & & is primitive array element ( data ) ) { if ( data get component index ( ) % array values per line = = 0 ) { return models [ field format model array ] ; } return null ; } return models [ field format model open data ] ; }


fall back validation that verifies that queries during rewrite don ' t use the client to make remote calls in the case of dls this can cause a dead lock if dls is also applied on these remote calls for example in the case of terms query with lookup , this can cause recursive execution of the dls query until the get thread pool has been exhausted : https : github comelasticx - pluginsissues 3 1 4 5

static void fail if query uses client ( query builder query builder , query rewrite context original ) throws i o exception { query rewrite context copy = new query rewrite context ( original get x content registry ( ) , original get writeable registry ( ) , null , original : : now in millis ) ; rewriteable rewrite ( query builder , copy ) ; if ( copy has async actions ( ) ) { throw new illegal state exception ( " role queries are not allowed to execute additional requests " ) ; } }


public final delete response delete ( delete request delete request , request options options ) throws i o exception { return perform request and parse entity ( delete request , request converters : : delete , options , delete response : : from x content , singleton ( 404 ) ) ; }


processes a resource request checks for the existence of the requested resource in the configured list of locations if the resource does not exist , a { @ code 404 } response will be returned to the client if the resource exists , the request will be checked for the presence of the { @ code last - modified } header , and its value will be compared against the last - modified timestamp of the given resource , returning a { @ code 304 } status code if the { @ code last - modified } value is greater if the resource is newer than the { @ code last - modified } value , or the header is not present , the content resource of the resource will be written to the response with caching headers set to expire one year in the future

public void handle request ( http servlet request request , http servlet response response ) throws servlet exception , i o exception { / / for very general mappings ( e g " / " ) we need to check 404 first resource resource = get resource ( request ) ; if ( resource = = null ) { logger debug ( " resource not found " ) ; response send error ( http servlet response sc not found ) ; return ; } if ( http method options matches ( request get method ( ) ) ) { response set header ( " allow " , get allow header ( ) ) ; return ; } / / supported methods and required session check request ( request ) ; / / header phase if ( is use last modified ( ) & & new servlet web request ( request , response ) check not modified ( resource last modified ( ) ) ) { logger trace ( " resource not modified " ) ; return ; } / / apply cache settings , if any prepare response ( response ) ; / / check the media type for the resource media type media type = get media type ( request , resource ) ; set headers ( response , resource , media type ) ; / / content phase servlet server http response output message = new servlet server http response ( response ) ; if ( request get header ( http headers range ) = = null ) { assert state ( this resource http message converter ! = null , " not initialized " ) ; this resource http message converter write ( resource , media type , output message ) ; } else { assert state ( this resource region http message converter ! = null , " not initialized " ) ; servlet server http request input message = new servlet server http request ( request ) ; try { list < http range > http ranges = input message get headers ( ) get range ( ) ; response set status ( http servlet response sc partial content ) ; this resource region http message converter write ( http range to resource regions ( http ranges , resource ) , media type , output message ) ; } catch ( illegal argument exception ex ) { response set header ( http headers content range , " bytes * / " + resource content length ( ) ) ; response send error ( http servlet response sc requested range not satisfiable ) ; } } }


public void clear ( ) { this argument resolvers clear ( ) ; }


when add mount table entry , it needs write permission of the nearest parent entry if exist , and execute permission of other ancestor entries

public add mount table entry response add mount table entry ( add mount table entry request request ) throws i o exception { mount table mount table = request get entry ( ) ; if ( mount table ! = null ) { mount table validate ( ) ; final string src = mount table get source path ( ) ; check mount table permission ( src ) ; boolean status = get driver ( ) put ( mount table , false , true ) ; add mount table entry response response = add mount table entry response new instance ( ) ; response set status ( status ) ; update cache all routers ( ) ; return response ; } else { add mount table entry response response = add mount table entry response new instance ( ) ; response set status ( false ) ; return response ; } }


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

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


delete fake : fake endpoint to test group parameters ( optional ) fake endpoint to test group parameters ( optional )

default response entity < void > test group parameters ( @ not null @ api param ( value = " required string in group parameters " , required = true ) @ valid @ request param ( value = " required string group " , required = true ) integer required string group , @ api param ( value = " required boolean in group parameters " , required = true ) @ request header ( value = " required boolean group " , required = true ) boolean required boolean group , @ not null @ api param ( value = " required integer in group parameters " , required = true ) @ valid @ request param ( value = " required int 6 4 group " , required = true ) long required int 6 4 group , @ api param ( value = " string in group parameters " ) @ valid @ request param ( value = " string group " , required = false ) integer string group , @ api param ( value = " boolean in group parameters " ) @ request header ( value = " boolean group " , required = false ) boolean boolean group , @ api param ( value = " integer in group parameters " ) @ valid @ request param ( value = " int 6 4 group " , required = false ) long int 6 4 group ) { return get delegate ( ) test group parameters ( required string group , required boolean group , required int 6 4 group , string group , boolean group , int 6 4 group ) ; }


returns a new { @ link builder } suitable for creating instances of module action context registry

public static builder builder ( ) { return new builder ( ) ; }


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


summarizes the cluster used for this { @ link gridmix } run

public string to string ( ) { string builder builder = new string builder ( ) ; builder append ( " cluster summary : - " ) ; builder append ( " \ n job tracker : " ) append ( get job tracker info ( ) ) ; builder append ( " \ n file system : " ) append ( get namenode info ( ) ) ; builder append ( " \ n number of blacklisted trackers : " ) append ( get num blacklisted trackers ( ) ) ; builder append ( " \ n number of active trackers : " ) append ( get num active trackers ( ) ) ; builder append ( " \ n max map task capacity : " ) append ( get max map tasks ( ) ) ; builder append ( " \ n max reduce task capacity : " ) append ( get max reduce tasks ( ) ) ; builder append ( " \ n \ n " ) ; return builder to string ( ) ; }


returns a { @ link yarn configuration } built from the { @ code conf } parameter that is guaranteed to have the { @ link yarn configuration # rm ha id } property set

static yarn configuration get yarn conf with rm ha id ( configuration conf ) throws i o exception { yarn configuration yarn conf = new yarn configuration ( conf ) ; if ( yarn conf get ( yarn configuration rm ha id ) = = null ) { / / if rm ha id is not configured , use the first of rm ha ids / / any valid rm ha id should work string [ ] rm ids = yarn conf get strings ( yarn configuration rm ha ids ) ; if ( ( rm ids ! = null ) & & ( rm ids length > 0 ) ) { yarn conf set ( yarn configuration rm ha id , rm ids [ 0 ] ) ; } else { throw new i o exception ( " rm ha ids property is not set for ha resource " + " manager " ) ; } } return yarn conf ; }


wrap an { @ link executor } so that it always executes with this context as the { @ link # current } context it is generally expected that { @ link # current context executor ( executor ) } would be used more commonly than this method one scenario in which this executor may be useful is when a single thread is sharding work to multiple threads

public executor fixed context executor ( final executor e ) { final class fixed context executor implements executor { @ override public void execute ( runnable r ) { e execute ( wrap ( r ) ) ; } } return new fixed context executor ( ) ; }


returns the action by the given name that belongs to the given provider

public static docking action if get local action ( component provider provider , string action name ) { tool tool = provider get tool ( ) ; docking tool actions tool actions = tool get tool actions ( ) ; docking action if action = tool actions get local action ( provider , action name ) ; return action ; }


writes the allocated bytes for this stream any { @ link throwable } thrown from this method is considered a programming error a { @ code goaway } frame will be sent and the will be connection closed

void write ( http 2 stream stream , int num bytes ) ;


tests { @ link task slot table impl # get active task slot allocation ids ( ) }

public void test retrieving all active slots ( ) throws exception { try ( final task slot table impl < ? > task slot table = create task slot table and start ( 3 ) ) { final job i d job id 1 = new job i d ( ) ; final allocation i d allocation id 1 = new allocation i d ( ) ; task slot table allocate slot ( 0 , job id 1 , allocation id 1 , slot timeout ) ; final allocation i d allocation id 2 = new allocation i d ( ) ; task slot table allocate slot ( 1 , job id 1 , allocation id 2 , slot timeout ) ; final allocation i d allocation id 3 = new allocation i d ( ) ; final job i d job id 2 = new job i d ( ) ; task slot table allocate slot ( 2 , job id 2 , allocation id 3 , slot timeout ) ; task slot table mark slot active ( allocation id 1 ) ; task slot table mark slot active ( allocation id 3 ) ; assert that ( task slot table get active task slot allocation ids ( ) , is ( sets new hash set ( allocation id 1 , allocation id 3 ) ) ) ; } }


assert that at a summary has a matching mean value

protected void assert summary mean ( final duration statistic summary summary , final int expected sample count , final double mean greater than ) { string description = " mean of " + summary ; assert that ( summary get mean ( ) ) described as ( description ) is not null ( ) ; assert that ( summary get mean ( ) get samples ( ) ) described as ( description ) is equal to ( expected sample count ) ; assert that ( summary get mean ( ) mean ( ) ) described as ( description ) is greater than ( mean greater than ) ; }


public void put ( string path , route route ) { add route ( http method put , create route impl ( path , route ) ) ; }


parse the given input into millis - since - epoch

default long parse millis ( string input ) { return date formatters from ( parse ( input ) ) to instant ( ) to epoch milli ( ) ; }


determine whether the given method is supposed to be included , that is , not configured as to be ignored

protected boolean is not ignored ( method method , string bean key ) { if ( this ignored method mappings ! = null ) { set < string > method names = this ignored method mappings get ( bean key ) ; if ( method names ! = null ) { return ! method names contains ( method get name ( ) ) ; } } if ( this ignored methods ! = null ) { return ! this ignored methods contains ( method get name ( ) ) ; } return true ; }


returns the labels corresponding to this attribute

protected label [ ] get labels ( ) { return new label [ 0 ] ; }


return the configured { @ link # set default charset ( charset ) default charset }

public charset get default charset ( ) { return this default charset ; }


compares this protocol version with another one only protocol versions with the same protocol name can be compared this method does not define a total ordering , as it would be required for { @ link java lang comparable }

public int compare to version ( protocol version that ) { if ( that = = null ) { throw new illegal argument exception ( " protocol version must not be null " ) ; } if ( ! this protocol equals ( that protocol ) ) { throw new illegal argument exception ( " versions for different protocols cannot be compared " + this + " " + that ) ; } int delta = get major ( ) - that get major ( ) ; if ( delta = = 0 ) { delta = get minor ( ) - that get minor ( ) ; } return delta ; }


checks for verification errors and stops the browser

public void tear down ( ) throws exception { try { check for verification errors ( ) ; } finally { if ( selenium ! = null ) { selenium stop ( ) ; selenium = null ; } } }


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

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


this test unit makes sure that jobs that contain bad get action methods will continue to load the project

public void xml file read exception on load ( ) throws exception { mock folder d = r jenkins get item by full name ( " d " , mock folder class ) ; assert not null ( d ) ; collection < top level item > items = d get items ( ) ; assert equals ( 5 , items size ( ) ) ; }


obtain the tokens in credentials form associated with this user

public credentials get credentials ( ) { synchronized ( subject ) { credentials creds = new credentials ( get credentials internal ( ) ) ; iterator < token < ? > > iter = creds get all tokens ( ) iterator ( ) ; while ( iter has next ( ) ) { if ( iter next ( ) is private ( ) ) { iter remove ( ) ; } } return creds ; } }


< code > merge program context < code > merges all program context register values ( as indicated ) in the specified address set from the second program it merges them into the merge program

void merge program context ( address set view p 1 merge set , program merge filter filter , task monitor monitor ) throws cancelled exception { monitor set message ( " applying program context " ) ; if ( filter get filter ( program merge filter program context ) = = program merge filter ignore ) { return ; } program diff filter program context diff filter = new program diff filter ( program diff filter program context diffs ) ; address set diff addr set = p 1 merge set intersect ( program diff get differences ( program context diff filter , monitor ) ) ; address set diff addr set 2 = diff utility get compatible address set ( diff addr set , program 2 ) ; if ( diff addr set 2 is empty ( ) ) { return ; } merger merge program context ( diff addr set 2 , monitor ) ; }