this method blocks until the job status is not initializing anymore

public static void wait until job initialization finished ( supplier with exception < job status , exception > job status supplier , supplier with exception < job result , exception > job result supplier , class loader user code classloader ) throws job initialization exception { log debug ( " wait until job initialization is finished " ) ; wait strategy wait strategy = new exponential wait strategy ( 50 , 2000 ) ; try { job status status = job status supplier get ( ) ; long attempt = 0 ; while ( status = = job status initializing ) { thread sleep ( wait strategy sleep time ( attempt + + ) ) ; status = job status supplier get ( ) ; } if ( status = = job status failed ) { job result result = job result supplier get ( ) ; optional < serialized throwable > throwable = result get serialized throwable ( ) ; if ( throwable is present ( ) ) { throwable t = throwable get ( ) deserialize error ( user code classloader ) ; if ( t instanceof job initialization exception ) { throw t ; } } } } catch ( job initialization exception initialization exception ) { throw initialization exception ; } catch ( throwable throwable ) { exception utils check interrupted ( throwable ) ; throw new runtime exception ( " error while waiting for job to be initialized " , throwable ) ; } }


patch fake classname test : to test class name in snake case to test class name in snake case

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


enqueues a task to run when the previous task ( if any ) completes cancellation does not propagate from the output future to a callable that has begun to execute , but if the output future is cancelled before { @ link callable # call ( ) } is invoked , { @ link callable # call ( ) } will not be invoked

public < t > listenable future < t > submit ( final callable < t > callable , executor executor ) { check not null ( callable ) ; check not null ( executor ) ; return submit async ( new async callable < t > ( ) { @ override public listenable future < t > call ( ) throws exception { return immediate future ( callable call ( ) ) ; } @ override public string to string ( ) { return callable to string ( ) ; } } , executor ) ; }


set the buffer ' s size default size equals 8192 bytes

public static void set buffer size ( final int buffer size ) { s buffer size = buffer size ; }


synthesize the merged { @ link # get annotation attributes annotation attributes } in this descriptor back into an annotation of the target { @ linkplain # get annotation type annotation type }

public t synthesize annotation ( ) { return annotation utils synthesize annotation ( get annotation attributes ( ) , ( class < t > ) get annotation type ( ) , get root declaring class ( ) ) ; }


returns the last message received on the input stream , if an unparseable message has been received

abstract string get recording stream message ( ) ;


public void test attempts block ( ) { app context ctx = mock ( app context class ) ; app for test app = new app for test ( ctx ) ; job id job id = new job id p b impl ( ) ; job id set id ( 0 ) ; job id set app id ( application id p b impl new instance ( 0 , 1 ) ) ; task id task id = new task id p b impl ( ) ; task id set id ( 0 ) ; task id set task type ( task type reduce ) ; task id set job id ( job id ) ; task task = mock ( task class ) ; when ( task get i d ( ) ) then return ( task id ) ; task report report = mock ( task report class ) ; when ( task get report ( ) ) then return ( report ) ; when ( task get type ( ) ) then return ( task type reduce ) ; map < task id , task > tasks = new hash map < task id , task > ( ) ; map < task attempt id , task attempt > attempts = new hash map < task attempt id , task attempt > ( ) ; task attempt attempt = mock ( task attempt class ) ; task attempt id ta id = new task attempt id p b impl ( ) ; ta id set id ( 0 ) ; ta id set task id ( task get i d ( ) ) ; when ( attempt get i d ( ) ) then return ( ta id ) ; final task attempt state ta state = task attempt state succeeded ; when ( attempt get state ( ) ) then return ( ta state ) ; task attempt report ta report = mock ( task attempt report class ) ; when ( ta report get task attempt state ( ) ) then return ( ta state ) ; when ( attempt get report ( ) ) then return ( ta report ) ; attempts put ( ta id , attempt ) ; tasks put ( task id , task ) ; when ( task get attempts ( ) ) then return ( attempts ) ; app set task ( task ) ; job job = mock ( job class ) ; when ( job get tasks ( task type reduce ) ) then return ( tasks ) ; app set job ( job ) ; attempts block for test block = new attempts block for test ( app , new configuration ( ) ) ; block add parameter ( a m params task type , " r " ) ; block add parameter ( a m params attempt state , " successful " ) ; print writer p writer = new print writer ( data ) ; block html = new block for test ( new html block for test ( ) , p writer , 0 , false ) ; block render ( html ) ; p writer flush ( ) ; assert true ( data to string ( ) contains ( " < a href = ' " + block url ( " task " , task get i d ( ) to string ( ) ) + " ' > " + " attempt 0 0001 r 000000 0 < / a > " ) ) ; }


takes internal protobuf serialization format and processes it into a { @ link signal service content }

public static signal service content create from proto ( signal service content proto service content proto ) throws protocol invalid message exception , protocol invalid key exception , unsupported data message exception { signal service metadata metadata = signal service metadata protobuf serializer from protobuf ( service content proto get metadata ( ) ) ; signal service address local address = signal service address protobuf serializer from protobuf ( service content proto get local address ( ) ) ; if ( service content proto get data case ( ) = = signal service content proto data case legacydatamessage ) { signal service protos data message message = service content proto get legacy data message ( ) ; return new signal service content ( create signal service message ( metadata , message ) , metadata get sender ( ) , metadata get sender device ( ) , metadata get timestamp ( ) , metadata get server received timestamp ( ) , metadata get server delivered timestamp ( ) , metadata is needs receipt ( ) , service content proto ) ; } else if ( service content proto get data case ( ) = = signal service content proto data case content ) { signal service protos content message = service content proto get content ( ) ; if ( message has data message ( ) ) { return new signal service content ( create signal service message ( metadata , message get data message ( ) ) , metadata get sender ( ) , metadata get sender device ( ) , metadata get timestamp ( ) , metadata get server received timestamp ( ) , metadata get server delivered timestamp ( ) , metadata is needs receipt ( ) , service content proto ) ; } else if ( message has sync message ( ) & & local address matches ( metadata get sender ( ) ) ) { return new signal service content ( create synchronize message ( metadata , message get sync message ( ) ) , metadata get sender ( ) , metadata get sender device ( ) , metadata get timestamp ( ) , metadata get server received timestamp ( ) , metadata get server delivered timestamp ( ) , metadata is needs receipt ( ) , service content proto ) ; } else if ( message has call message ( ) ) { return new signal service content ( create call message ( message get call message ( ) ) , metadata get sender ( ) , metadata get sender device ( ) , metadata get timestamp ( ) , metadata get server received timestamp ( ) , metadata get server delivered timestamp ( ) , metadata is needs receipt ( ) , service content proto ) ; } else if ( message has receipt message ( ) ) { return new signal service content ( create receipt message ( metadata , message get receipt message ( ) ) , metadata get sender ( ) , metadata get sender device ( ) , metadata get timestamp ( ) , metadata get server received timestamp ( ) , metadata get server delivered timestamp ( ) , metadata is needs receipt ( ) , service content proto ) ; } else if ( message has typing message ( ) ) { return new signal service content ( create typing message ( metadata , message get typing message ( ) ) , metadata get sender ( ) , metadata get sender device ( ) , metadata get timestamp ( ) , metadata get server received timestamp ( ) , metadata get server delivered timestamp ( ) , false , service content proto ) ; } } return null ; }


public int get characteristics ( ) { return characteristics ; }


make the directory which corresponds to the specified package

private static file make dir ( file base dir , string pkg name ) { file dir = new file ( base dir , pkg name replace ( ' ' , file separator char ) ) ; file utilities mkdirs ( dir ) ; return dir ; }


assert the order of events is correct and return the number of on next executions

public int assert events ( test concurrency subscriber event expected ending event ) throws illegal state exception { int next count = 0 ; boolean finished = false ; for ( test concurrency subscriber event e : events ) { if ( e = = test concurrency subscriber event on next ) { if ( finished ) { / / already finished , we shouldn ' t get this again throw new illegal state exception ( " received on next but we ' re already finished " ) ; } next count + + ; } else if ( e = = test concurrency subscriber event on error ) { if ( finished ) { / / already finished , we shouldn ' t get this again throw new illegal state exception ( " received on error but we ' re already finished " ) ; } if ( expected ending event ! = null & & test concurrency subscriber event on error ! = expected ending event ) { throw new illegal state exception ( " received on error ending event but expected " + expected ending event ) ; } finished = true ; } else if ( e = = test concurrency subscriber event on complete ) { if ( finished ) { / / already finished , we shouldn ' t get this again throw new illegal state exception ( " received on complete but we ' re already finished " ) ; } if ( expected ending event ! = null & & test concurrency subscriber event on complete ! = expected ending event ) { throw new illegal state exception ( " received on complete ending event but expected " + expected ending event ) ; } finished = true ; } } return next count ; }


get a new unique { @ link reservation id }

reservation id get new reservation id ( ) ;


public string get capital camel ( ) { return capital camel ; }


put resolved multifactor authentication providers into scope

public static void put resolved multifactor authentication providers ( final request context context , final collection < multifactor authentication provider > value ) { val provider ids = value stream ( ) map ( multifactor authentication provider : : get id ) collect ( collectors to set ( ) ) ; context get conversation scope ( ) put ( " resolved multifactor authentication providers " , provider ids ) ; }


execute a docker command and return the output

public static string execute docker command ( docker command docker command , string container id , map < string , string > env , privileged operation executor privileged operation executor , boolean disable failure logging , context nm context ) throws container execution exception { privileged operation docker op = docker command prepare privileged operation ( docker command , container id , env , nm context ) ; if ( disable failure logging ) { docker op disable failure logging ( ) ; } log debug ( " running docker command : { } " , docker command ) ; try { string result = privileged operation executor execute privileged operation ( null , docker op , null , env , true , false ) ; if ( result ! = null & & ! result is empty ( ) ) { result = result trim ( ) ; } return result ; } catch ( privileged operation exception e ) { throw new container execution exception ( " docker operation failed " , e get exit code ( ) , e get output ( ) , e get error output ( ) ) ; } }


translate this { @ link catalog schema table } into flink source table

private static flink preparing table base to preparing table ( rel opt schema rel opt schema , list < string > names , rel data type row type , catalog schema table schema table ) { final catalog base table base table = schema table get catalog table ( ) ; if ( base table instanceof query operation catalog view ) { return convert query operation view ( rel opt schema , names , row type , ( query operation catalog view ) base table ) ; } else if ( base table instanceof connector catalog table ) { connector catalog table < ? , ? > connector table = ( connector catalog table < ? , ? > ) base table ; if ( ( connector table ) get table source ( ) is present ( ) ) { return convert source table ( rel opt schema , row type , schema table get table identifier ( ) , connector table , schema table get statistic ( ) , schema table is streaming mode ( ) ) ; } else { throw new validation exception ( " cannot convert a connector table " + " without source " ) ; } } else if ( base table instanceof catalog view ) { return convert catalog view ( rel opt schema , names , row type , schema table get statistic ( ) , ( catalog view ) base table ) ; } else if ( base table instanceof catalog table ) { return convert catalog table ( rel opt schema , names , row type , ( catalog table ) base table , schema table ) ; } else { throw new validation exception ( " unsupported table type : " + base table ) ; } }


returns the attribute definition that designates a rule compatible with the given environments

protected static string compatible with ( string environments ) { return get attr def ( " compatible with " , environments ) ; }


writes < code > lines < code > using iso 8859 1 into the file , specified by the < code > sub path < code > relative to the working directory overrides the file if it exists , creates the file if it does not exist

public path write ( string sub path , list < string > lines ) throws i o exception { return path utils write file in dir ( work dir , sub path , lines ) ; }


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

public indices options indices options ( ) { return indices options ; }


returns the configured deps for a given target under the given attribute assumes the target uses the target configuration throws an exception if the attribute can ' t be found

protected list < configured target > get configured deps ( string target label , string attr name ) throws exception { configured target target = iterables get only element ( update ( target label ) get targets to build ( ) ) ; return get configured deps ( target , attr name ) ; }


public string get err msg ( ) { return err msg ; }


return { @ code true } if the given { @ link event loop } is compatible with this instance

protected abstract boolean is compatible ( event loop loop ) ;


the value assigned to this plural < code > optional aapt pb item item = 4 ; < code >


rx version of { @ link abstract dao # save in tx ( object [ ] ) } returning an observable note that the observable will emit the given entities back to its subscribers

public observable < object [ ] > save in tx ( final t entities ) { return wrap ( new callable < object [ ] > ( ) { @ override public object [ ] call ( ) throws exception { dao save in tx ( entities ) ; return entities ; } } ) ; }


add a decal to the batch , marking it for later rendering

public void add ( decal decal ) { int group index = group strategy decide group ( decal ) ; array < decal > target group = group list get ( group index ) ; if ( target group = = null ) { target group = group pool obtain ( ) ; target group clear ( ) ; used groups add ( target group ) ; group list insert ( group index , target group ) ; } target group add ( decal ) ; }


sets a new progress bar drawable with old scale type

public void set progress bar image ( int resource id ) { set progress bar image ( m resources get drawable ( resource id ) ) ; }


thread pool executor get thread pool ( int thread count ) throws exception { return new thread pool executor ( thread count , thread count , 2 , time unit seconds , new linked blocking queue < runnable > ( ) , new azure file system thread factory ( this thread name prefix ) ) ; }


this is passed the future or a wrapped future an implementation is expected to do any desired preprocessing , then call the future , then perform any desired post - processing note that this scheme allows catching exceptions from lower layers

spawn result apply ( callable < spawn result > future ) throws exec exception , interrupted exception ;


revert the buffer back to the result whose offset is ` checkpointed offset `

protected void revert ( long checkpointed offset ) { while ( offset > checkpointed offset ) { buffer remove last ( ) ; offset - - ; } }


defines the size of a double primitive data type

public void set double size ( int double size ) { this double size = double size ; if ( long double size < double size ) { set long double size ( double size ) ; } if ( float size > double size ) { set float size ( double size ) ; } }


find the fields constant that matches field id , throwing an exception if it is not found

public static fields find by thrift id or throw ( int field id ) { fields fields = find by thrift id ( field id ) ; if ( fields = = null ) throw new illegal argument exception ( " field " + field id + " doesn ' t exist ! " ) ; return fields ; }


this method is invoked by sasl for authentication challenges

public void handle ( callback [ ] callbacks ) throws i o exception , unsupported callback exception { for ( callback c : callbacks ) { if ( c instanceof name callback ) { log debug ( " name callback " ) ; name callback nc = ( name callback ) c ; nc set name ( username ) ; } else if ( c instanceof password callback ) { log debug ( " password callback " ) ; password callback pc = ( password callback ) c ; if ( password ! = null ) { pc set password ( password to char array ( ) ) ; } } else if ( c instanceof authorize callback ) { log debug ( " authorization callback " ) ; authorize callback ac = ( authorize callback ) c ; string authid = ac get authentication i d ( ) ; string authzid = ac get authorization i d ( ) ; if ( authid equals ( authzid ) ) { ac set authorized ( true ) ; } else { ac set authorized ( false ) ; } if ( ac is authorized ( ) ) { ac set authorized i d ( authzid ) ; } } else if ( c instanceof realm callback ) { realm callback rc = ( realm callback ) c ; ( ( realm callback ) c ) set text ( rc get default text ( ) ) ; } else { throw new unsupported callback exception ( c ) ; } } }


returns incremental of files size that were snapshotted

public long incremental size ( ) { return incremental size ; }


adds a key - value mapping to the built multimap

public builder < k , v > put ( k key , v value ) { check entry not null ( key , value ) ; collection < v > value collection = builder map get ( key ) ; if ( value collection = = null ) { builder map put ( key , value collection = new mutable value collection ( ) ) ; } value collection add ( value ) ; return this ; }


return a sub - list representing the current page

public list < e > get page list ( ) { return get source ( ) sub list ( get first element on page ( ) , get last element on page ( ) + 1 ) ; }


check that the root logger appenders are filtered to just the " rolling " appender

public void test transform filters root logger ( ) { list < string > input = list of ( " root logger appender ref console ref = console " , " root logger appender ref rolling ref = rolling " , " root logger appender ref rolling old ref = rolling old " ) ; list < string > expected = list of ( " root logger appender ref rolling ref = rolling " ) ; run test ( input , expected ) ; }


return a sorted set of the keys in this { @ link properties } object the keys will be converted to strings if necessary using { @ link string # value of ( object ) } and sorted alphanumerically according to the natural order of strings

public set < object > key set ( ) { set < object > sorted keys = new tree set < > ( key comparator ) ; sorted keys add all ( super key set ( ) ) ; return collections synchronized set ( sorted keys ) ; }


provides a { @ code local file header } view of a local header located at the offset indicated by the given { @ code dir entry }

public local file header local header for ( directory entry dir entry ) throws i o exception { return dir entry = = null ? null : local header at ( dir entry get ( cenoff ) ) ; }


public result set execute query ( ) throws s q l exception { connection mark commit state dirty ( ) ; result set result set = ( ( prepared statement ) delegate ) execute query ( ) ; return proxy factory get proxy result set ( connection , this , result set ) ; }


validates a given request with its associated concrete indices and the current state

optional < exception > validate request ( t request , cluster state state , index [ ] indices ) ;


override the default kotlin serialization json { @ code encoder }

void kotlin serialization json encoder ( encoder < ? > encoder ) ;


protected void rollback if necessary ( session session ) throws j m s exception { if ( session get transacted ( ) ) { if ( is session locally transacted ( session ) ) { / / transacted session created by this container - > rollback jms utils rollback if necessary ( session ) ; } } else if ( is client acknowledge ( session ) ) { session recover ( ) ; } }


public void dispose ( ) { program release ( this ) ; }


public final graph explore response explore ( graph explore request graph explore request , request options options ) throws i o exception { return rest high level client perform request and parse entity ( graph explore request , graph request converters : : explore , options , graph explore response : : from x content , empty set ( ) ) ; }


public subject new subject ( final string name id format , final string name id value , final string recipient , final zoned date time not on or after , final string in response to , final zoned date time not before ) { val name i d = get name i d ( name id format , name id value ) ; return new subject ( name i d , null , recipient , not on or after , in response to , not before ) ; }


find a class on the classpath , starting with a specific classloader ( or die trying )

public class < ? > class for name ( string name , class loader class loader ) throws class not found exception { return class for name ( name , get class loaders ( class loader ) ) ; }


public string get status ( ) { return status msg ; }


this test adds randomized fields on all json objects and checks that we can parse it to ensure the parsing is lenient for forward compatibility we need to exclude json objects with the " highlight " and " fields " field name since these objects allow arbitrary keys ( the field names that are queries ) also we want to exclude to add anything under " source " since it is not parsed , and avoid complexity by excluding everything under " inner hits " they are also keyed by arbitrary names and contain search hits , which are already tested elsewhere we also exclude the root level , as all unknown fields on a root level are interpreted as meta - fields and will be kept

public void test from x content lenient parsing ( ) throws i o exception { x content type x content type = random from ( x content type values ( ) ) ; search hit search hit = create test item ( x content type , true , true ) ; bytes reference original bytes = to x content ( search hit , x content type , true ) ; predicate < string > paths to exclude = path - > path ends with ( " highlight " ) | | path contains ( " fields " ) | | path contains ( " source " ) | | path contains ( " inner hits " ) | | path is empty ( ) ; bytes reference with random fields = insert random fields ( x content type , original bytes , paths to exclude , random ( ) ) ; search hit parsed ; try ( x content parser parser = create parser ( x content type x content ( ) , with random fields ) ) { parser next token ( ) ; / / jump to first start object parsed = search hit from x content ( parser ) ; assert equals ( x content parser token end object , parser current token ( ) ) ; assert null ( parser next token ( ) ) ; } assert to x content equivalent ( original bytes , to x content ( parsed , x content type , true ) , x content type ) ; }


private void join clusters ( ) { if ( clusters size ( ) > 1 ) { node source node = null ; node target node = null ; / / add an edge from each successive cluster to next for ( iterator < cluster > iter = clusters iterator ( ) ; iter has next ( ) ; ) { cluster cluster = iter next ( ) ; if ( source node ! = null ) { / / use first node in set as target node target node = cluster set get ( 0 ) ; new dummy edge ( source node , target node ) ; } / / set up source node for the next iteration using last node in / / set source node = cluster set get ( cluster set size ( ) - 1 ) ; } } }


simulates the effect of executing the given basic block this modifies the passed - in frame to represent the end result

public void simulate ( byte block bb , frame frame ) { int end = bb get end ( ) ; visitor set frame ( frame ) ; try { for ( int off = bb get start ( ) ; off < end ; / * off * / ) { int length = code parse instruction ( off , visitor ) ; visitor set previous offset ( off ) ; off + = length ; } } catch ( sim exception ex ) { frame annotate ( ex ) ; throw ex ; } }


this test enforces the behavior that if there is an exception from do transition ( ) during dn starts up , the storage directories that have already been processed are still visible , i e , in data storage storage dirs ( )

public void test recover transition read do transition failure ( ) throws i o exception { final int num locations = 3 ; list < storage location > locations = create storage locations ( num locations ) ; / / prepare volumes storage recover transition read ( mock d n , ns info , locations , start opt ) ; assert equals ( num locations , storage get num storage dirs ( ) ) ; / / reset data storage storage unlock all ( ) ; storage = new data storage ( ) ; / / trigger an exception from do transition ( ) ns info cluster i d = " cluster 1 " ; try { storage recover transition read ( mock d n , ns info , locations , start opt ) ; fail ( " expect to throw an exception from do transition ( ) " ) ; } catch ( i o exception e ) { generic test utils assert exception contains ( " all specified directories " , e ) ; } assert equals ( 0 , storage get num storage dirs ( ) ) ; }


get the number of records which contain the specified field value in the specified record column the table must have been created with a secondary index on the specified column index

public int get matching record count ( field field , int column index ) throws i o exception { synchronized ( db ) { index table index table = secondary indexes get ( column index ) ; if ( index table = = null ) { throw new i o exception ( " index required ( " + get name ( ) + " , " + column index + " ) " ) ; } return index table get key count ( field ) ; } }


returns a list of all key - groups which can be written to this stream

public key groups list get key group list ( ) { return key group range offsets get key group range ( ) ; }


returns a fluent iterable that combines two iterables the returned iterable has an iterator that traverses the elements in { @ code a } , followed by the elements in { @ code b } the source iterators are not polled until necessary the returned iterable ' s iterator supports { @ code remove ( ) } when the corresponding input iterator supports it < b > { @ code stream } equivalent : < b > { @ link stream # concat }

public static < t > fluent iterable < t > concat ( iterable < ? extends t > a , iterable < ? extends t > b ) { return concat no defensive copy ( a , b ) ; }


public string get application id ( ) { return application id ; }


public jvm metrics get jvm metrics ( ) { if ( this router metrics = = null ) { return null ; } return this router metrics get jvm metrics ( ) ; }


given a class , determine the suite it belongs to

public static string get suite name ( class < ? > clazz ) { return get annotation element or default ( clazz , " suite " ) ; }


if a bundle is a " system bundle " it cannot be removed and its contends cannot be edited

public boolean is system bundle ( ) { return system bundle ; }


test the property ' additional metadata '

public void additional metadata test ( ) { / / todo : test additional metadata }


returns the proto files that are the direct srcs of the exported dependencies of this rule

private static nested set < proto source > compute public import protos ( immutable list < proto info > exports ) { nested set builder < proto source > result = nested set builder stable order ( ) ; for ( proto info export : exports ) { result add transitive ( export get exported sources ( ) ) ; } return result build ( ) ; }


return true if the name exists in the name table

private boolean name exists ( string name ) { return name indexer get ( name ) > = 0 ; }


public string get dest vol base path ( ) { return dest vol base path ; }


a sensible definition of { @ link # add all ( collection ) } in terms of { @ link # add ( object ) } and { @ link # add ( object , int ) } if you override either of these methods , you may wish to override { @ link # add all ( collection ) } to forward to this implementation

protected boolean standard add all ( collection < ? extends e > elements to add ) { return multisets add all impl ( this , elements to add ) ; }


private void reply with job data ( http servlet request request , http servlet response response , importing job job ) throws servlet exception , i o exception { writer w = response get writer ( ) ; parsing utilities default writer write value ( w , new job response ( " ok " , job ) ) ; w flush ( ) ; w close ( ) ; }


count how many bytes would be written if all records were directly serialized

public void calc raw data size ( ) throws i o exception { int record index = 0 ; for ( int file index = 0 ; file index < this parallelism ; file index + + ) { byte counter byte counter = new byte counter ( ) ; for ( int file count = 0 ; file count < this get number of tuples per file ( file index ) ; file count + + , record index + + ) { write record ( this get record ( record index ) , new data output view stream wrapper ( byte counter ) ) ; } this raw data sizes [ file index ] = byte counter get length ( ) ; } }


all data sources failed , no intermediate results

public void test lifecycle f1 f2 f3 c ( ) { data source < object > data source = get and subscribe ( ) ; data subscriber < object > subscriber 1 = verify get and subscribe ( m data source supplier 1 , m src 1 ) ; set state ( m src 1 , not closed , finished , without result , null , failed , mock ( throwable class ) ) ; subscriber 1 on failure ( m src 1 ) ; m in order verify ( m src 1 ) close ( ) ; data subscriber < object > subscriber 2 = verify get and subscribe ( m data source supplier 2 , m src 2 ) ; verify state ( data source , null , not closed , not finished , without result , null , not failed , null ) ; set state ( m src 2 , not closed , finished , without result , null , failed , mock ( throwable class ) ) ; subscriber 2 on failure ( m src 2 ) ; m in order verify ( m src 2 ) close ( ) ; data subscriber < object > subscriber 3 = verify get and subscribe ( m data source supplier 3 , m src 3 ) ; verify state ( data source , null , not closed , not finished , without result , null , not failed , null ) ; throwable throwable = mock ( throwable class ) ; set state ( m src 3 , not closed , finished , without result , null , failed , throwable ) ; subscriber 3 on failure ( m src 3 ) ; m in order verify ( m src 3 ) close ( ) ; verify subscriber ( data source , m src 3 , on failure ) ; verify state ( data source , null , not closed , finished , without result , null , failed , throwable ) ; test close ( data source ) ; verify state ( data source , null , closed , finished , without result , null , failed , throwable ) ; }


reads 4 - byte big - endian int value from { @ code buf } starting at { @ code offset } buf length must be greater than or equal to offset + 4

public static int read int ( byte [ ] buf , int offset ) throws i o exception { if ( offset + 4 > buf length ) { throw new i o exception ( string format ( " read int out of bounds : buf length = % d , offset = % d " , buf length , offset ) ) ; } int value = ( ( buf [ offset + 0 ] & 0xff ) < < 24 ) | ( ( buf [ offset + 1 ] & 0xff ) < < 16 ) | ( ( buf [ offset + 2 ] & 0xff ) < < 8 ) | ( ( buf [ offset + 3 ] & 0xff ) ) ; return value ; }


consent repository get consent repository ( ) ;


converts a numeric atom type to the corresponding four character string

public static string get atom type string ( int type ) { return " " + ( char ) ( ( type > > 24 ) & 0x f f ) + ( char ) ( ( type > > 16 ) & 0x f f ) + ( char ) ( ( type > > 8 ) & 0x f f ) + ( char ) ( type & 0x f f ) ; }


suppose this method is called back from the above native method pro guard would remove it , because it is not referenced from java the annotation will make sure it is preserved anyhow

public int get answer ( ) { return 42 ; }


hashes the contents of this byte source using the given hash function

public hash code hash ( hash function hash function ) throws i o exception { hasher hasher = hash function new hasher ( ) ; copy to ( funnels as output stream ( hasher ) ) ; return hasher hash ( ) ; }


get the repeatable { @ linkplain annotation annotations } of { @ code annotation type } from the supplied { @ link annotated element } , where such annotations are either present , indirectly present , or meta - present on the element this method mimics the functionality of java 8 ' s { @ link java lang reflect annotated element # get annotations by type ( class ) } with support for automatic detection of a container annotation declared via @ { @ link java lang annotation repeatable } ( when running on java 8 or higher ) and with additional support for meta - annotations handles both single annotations and annotations nested within a container annotation correctly handles bridge methods generated by the compiler if the supplied element is a { @ link method } meta - annotations will be searched if the annotation is not present on the supplied element

public static < a extends annotation > set < a > get repeatable annotations ( annotated element annotated element , class < a > annotation type ) { return get repeatable annotations ( annotated element , annotation type , null ) ; }


returns the { @ link highlighter } registry

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


instantiates a { @ link watermark generator }

watermark generator < t > create watermark generator ( context context ) ;


order by end ( needs to be followed by { @ link # asc ( ) } or { @ link # desc ( ) } )

historic activity instance query order by historic activity instance end time ( ) ;


creates an unbounded thread pool executor , which is appropriate here since the number of tasks we will add to the thread pool is at most dozens and some of them perform io ( ie , may block )

private static listening executor service create thread pool ( ) { return more executors listening decorator ( executors new cached thread pool ( ) ) ; }


global option to specify a cookie to be added to every request , if the request does not already contain such a cookie

builder default cookie ( string cookie , string values ) ;


returns a list of javacopts reads options until a terminating { @ code " - - " } is reached , to support parsing javacopts that start with { @ code - - } ( e g - - release )

private static void read javacopts ( list < string > javacopts , deque < string > argument deque ) { while ( ! argument deque is empty ( ) ) { string arg = argument deque poll first ( ) ; if ( arg equals ( " - - " ) ) { return ; } javacopts add ( arg ) ; } throw new illegal argument exception ( " javacopts should be terminated by ` - - ` " ) ; }


adds a new item to the < code > array number < code > list

public array of number only add array number item ( big decimal array number item ) { this array number add ( array number item ) ; return this ; }


configures ads rendering for starting playback , returning the settings for the ima sdk or { @ code null } if no ads should play

private ads rendering settings setup ads rendering ( ) { ads rendering settings ads rendering settings = ima factory create ads rendering settings ( ) ; ads rendering settings set enable preloading ( true ) ; ads rendering settings set mime types ( configuration ad media mime types ! = null ? configuration ad media mime types : supported mime types ) ; if ( configuration media load timeout ms ! = timeout unset ) { ads rendering settings set load video timeout ( configuration media load timeout ms ) ; } if ( configuration media bitrate ! = bitrate unset ) { ads rendering settings set bitrate kbps ( configuration media bitrate / 1000 ) ; } ads rendering settings set focus skip button when available ( configuration focus skip button when available ) ; if ( configuration ad ui elements ! = null ) { ads rendering settings set ui elements ( configuration ad ui elements ) ; } / / skip ads based on the start position as required long [ ] ad group times us = ad playback state ad group times us ; long content position ms = get content period position ms ( check not null ( player ) , timeline , period ) ; int ad group for position index = ad playback state get ad group index for position us ( c ms to us ( content position ms ) , c ms to us ( content duration ms ) ) ; if ( ad group for position index ! = c index unset ) { boolean play ad when starting playback = configuration play ad before start position | | ad group times us [ ad group for position index ] = = c ms to us ( content position ms ) ; if ( ! play ad when starting playback ) { ad group for position index + + ; } else if ( has midroll ad groups ( ad group times us ) ) { / / provide the player ' s initial position to trigger loading and playing the ad if there are / / no midrolls , we are playing a preroll and any pending content position wouldn ' t be / / cleared pending content position ms = content position ms ; } if ( ad group for position index > 0 ) { for ( int i = 0 ; i < ad group for position index ; i + + ) { ad playback state = ad playback state with skipped ad group ( i ) ; } if ( ad group for position index = = ad group times us length ) { / / we don ' t need to play any ads because set play ads after time does not discard non - vmap / / ads , we signal that no ads will render so the caller can destroy the ads manager return null ; } long ad group for position time us = ad group times us [ ad group for position index ] ; long ad group before position time us = ad group times us [ ad group for position index - 1 ] ; if ( ad group for position time us = = c time end of source ) { / / play the postroll by offsetting the start position just past the last non - postroll ad ads rendering settings set play ads after time ( ( double ) ad group before position time us / c micros per second + 1d ) ; } else { / / play ads after the midpoint between the ad to play and the one before it , to avoid / / issues with rounding one of the two ad times double midpoint time us = ( ad group for position time us + ad group before position time us ) / 2d ; ads rendering settings set play ads after time ( midpoint time us / c micros per second ) ; } } } return ads rendering settings ; }


returns a single subchannel , or else a not found code

public void get subchannel ( io grpc channelz v 1 get subchannel request request , io grpc stub stream observer < io grpc channelz v 1 get subchannel response > response observer ) { io grpc stub client calls async unary call ( get channel ( ) new call ( get get subchannel method ( ) , get call options ( ) ) , request , response observer ) ; }


compute the hash of the murmur hash 3 x 6 4 128 hashing function note , this hashing function might be used to persist hashes , so if the way hashes are computed changes for some reason , it needs to be addressed ( like in bloom filter and murmur hash field )

public static hash 1 2 8 hash 1 2 8 ( byte [ ] key , int offset , int length , long seed , hash 1 2 8 hash ) { long h 1 = seed ; long h 2 = seed ; if ( length > = 16 ) { final int len 1 6 = length & 0x f f f f f f f 0 ; / / higher multiple of 16 that is lower than or equal to length final int end = offset + len 1 6 ; for ( int i = offset ; i < end ; i + = 16 ) { long k 1 = byte utils read long l e ( key , i ) ; long k 2 = byte utils read long l e ( key , i + 8 ) ; k 1 * = c1 ; k 1 = long rotate left ( k 1 , 31 ) ; k 1 * = c2 ; h 1 ^ = k 1 ; h 1 = long rotate left ( h 1 , 27 ) ; h 1 + = h 2 ; h 1 = h 1 * 5 + 0x 5 2dce 7 2 9 ; k 2 * = c2 ; k 2 = long rotate left ( k 2 , 33 ) ; k 2 * = c1 ; h 2 ^ = k 2 ; h 2 = long rotate left ( h 2 , 31 ) ; h 2 + = h 1 ; h 2 = h 2 * 5 + 0x 3 8 4 9 5ab 5 ; } / / advance offset to the unprocessed tail of the data offset = end ; } long k 1 = 0 ; long k 2 = 0 ; switch ( length & 15 ) { case 15 : k 2 ^ = ( key [ offset + 14 ] & 0x f f l ) < < 48 ; case 14 : k 2 ^ = ( key [ offset + 13 ] & 0x f f l ) < < 40 ; case 13 : k 2 ^ = ( key [ offset + 12 ] & 0x f f l ) < < 32 ; case 12 : k 2 ^ = ( key [ offset + 11 ] & 0x f f l ) < < 24 ; case 11 : k 2 ^ = ( key [ offset + 10 ] & 0x f f l ) < < 16 ; case 10 : k 2 ^ = ( key [ offset + 9 ] & 0x f f l ) < < 8 ; case 9 : k 2 ^ = ( key [ offset + 8 ] & 0x f f l ) < < 0 ; k 2 * = c2 ; k 2 = long rotate left ( k 2 , 33 ) ; k 2 * = c1 ; h 2 ^ = k 2 ; case 8 : k 1 ^ = ( key [ offset + 7 ] & 0x f f l ) < < 56 ; case 7 : k 1 ^ = ( key [ offset + 6 ] & 0x f f l ) < < 48 ; case 6 : k 1 ^ = ( key [ offset + 5 ] & 0x f f l ) < < 40 ; case 5 : k 1 ^ = ( key [ offset + 4 ] & 0x f f l ) < < 32 ; case 4 : k 1 ^ = ( key [ offset + 3 ] & 0x f f l ) < < 24 ; case 3 : k 1 ^ = ( key [ offset + 2 ] & 0x f f l ) < < 16 ; case 2 : k 1 ^ = ( key [ offset + 1 ] & 0x f f l ) < < 8 ; case 1 : k 1 ^ = ( key [ offset ] & 0x f f l ) ; k 1 * = c1 ; k 1 = long rotate left ( k 1 , 31 ) ; k 1 * = c2 ; h 1 ^ = k 1 ; } h 1 ^ = length ; h 2 ^ = length ; h 1 + = h 2 ; h 2 + = h 1 ; h 1 = fmix ( h 1 ) ; h 2 = fmix ( h 2 ) ; h 1 + = h 2 ; h 2 + = h 1 ; hash h 1 = h 1 ; hash h 2 = h 2 ; return hash ; }


public int get segment offset ( ) { return ( int ) ( ( segmented address space ) addr space ) get offset from flat ( offset , segment ) ; }


verifies that group methods instantiate the correct metric with the given name

public void test metric instantiation ( ) throws exception { metric registry impl registry = new metric registry impl ( metric registry configuration default metric registry configuration ( ) , collections singleton list ( reporter setup for reporter ( " test " , new test reporter 1 ( ) ) ) ) ; metric group root = new task manager metric group ( registry , " host " , " id " ) ; counter counter = root counter ( " counter " ) ; assert equals ( counter , test reporter 1 last passed metric ) ; assert equals ( " counter " , test reporter 1 last passed name ) ; gauge < object > gauge = root gauge ( " gauge " , new gauge < object > ( ) { @ override public object get value ( ) { return null ; } } ) ; assert assert equals ( gauge , test reporter 1 last passed metric ) ; assert equals ( " gauge " , test reporter 1 last passed name ) ; histogram histogram = root histogram ( " histogram " , new histogram ( ) { @ override public void update ( long value ) { } @ override public long get count ( ) { return 0 ; } @ override public histogram statistics get statistics ( ) { return null ; } } ) ; assert assert equals ( histogram , test reporter 1 last passed metric ) ; assert equals ( " histogram " , test reporter 1 last passed name ) ; registry shutdown ( ) get ( ) ; }


execute a snapshot lifecycle definition see https : www elastic coguideenelasticsearchclientjava - restcurrent java - rest - high - ilm - slm - execute - snapshot - lifecycle - policy html for more

public execute snapshot lifecycle policy response execute snapshot lifecycle policy ( execute snapshot lifecycle policy request request , request options options ) throws i o exception { return rest high level client perform request and parse entity ( request , index lifecycle request converters : : execute snapshot lifecycle policy , options , execute snapshot lifecycle policy response : : from x content , empty set ( ) ) ; }


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


return true if this category 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 ; } category category = ( category ) o ; return objects equals ( this id , category id ) & & objects equals ( this name , category name ) ; }


limits the given input stream to the provided number of bytes

public static input stream limit stream ( input stream in , long limit ) { return new limited input stream ( in , limit ) ; }


any interruption that happens as a result of calling interrupt task will arrive before this method is called complete futures here

abstract void after ran interruptibly ( @ nullable t result , @ nullable throwable error ) ;


the validation should verify the parent aggregation is allowed

public void test validate ( ) throws i o exception { assert that ( validate ( pipeline aggregation helper tests get random sequentially ordered parent agg ( ) , new derivative pipeline aggregation builder ( " name " , " valid " ) ) , null value ( ) ) ; }


synchronously post preparing the component tree for the given component render info to the handler

public void prepare ( string tag , component render info component render info , @ nullable size size , litho handler handler ) { if ( ! is ready ( ) ) { components reporter emit message ( components reporter log level warning , component warmer log tag , " component warmer not ready : unable to prepare sync this will be executed asynchronously when the component warmer is ready " ) ; add to pending ( tag , component render info , handler ) ; return ; } execute prepare ( tag , component render info , size , false , handler ) ; }


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


public csvout write ( object o ) throws i o exception { if ( is start of line ) { is start of line = false ; } else { out write ( separator ) ; } out write ( o to string ( ) ) ; return this ; }


during a parse is sometimes useful to listen in on the rule entry and exit events as well as token matches this is for quick and dirty debugging

public void set trace ( boolean trace ) { if ( ! trace ) { remove parse listener ( tracer ) ; tracer = null ; } else { if ( tracer ! = null ) remove parse listener ( tracer ) ; else tracer = new trace listener ( ) ; add parse listener ( tracer ) ; } }


get the rpc status corresponding to this exception

public rpc status proto get rpc status proto ( ) { return rpc status proto error ; }


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


returns whether the two defined data objects are the same

private boolean is same data ( data d 1 , data d 2 ) { if ( d 1 get length ( ) ! = d 2 get length ( ) ) { return false ; } ghidra program model data data type dt 1 = d 1 get data type ( ) ; ghidra program model data data type dt 2 = d 2 get data type ( ) ; if ( ! dt 1 is equivalent ( dt 2 ) ) { return false ; } / / detect that data type name or path differs ? if ( ! dt 1 get path name ( ) equals ( dt 2 get path name ( ) ) ) { return false ; } return true ; }


{ @ inherit doc } the default { @ link base future } implementation throws { @ code interrupted exception } if the current thread is interrupted before or during the call , even if the value is already available

public v get ( ) throws interrupted exception , execution exception { assert blocking allowed ( ) ; return sync get ( ) ; }


this test validates that new inserts ( rather than updates ) in " insert or replace ( ) " properly react to out of memory conditions

public void test inserts with insert or replace ( ) { try { final int num elements = 1000 ; final string long string = get long string ( 10000 ) ; list < memory segment > memory = get memory ( 1000 , 32 * 1024 ) ; / / we create a hash table that thinks the records are super large that makes it choose / / initially / / a lot of memory for the partition buffers , and start with a smaller hash table that / / way / / we trigger a hash table growth early compacting hash table < tuple 2 < long , string > > table = new compacting hash table < > ( tuple 2 long string serializer , tuple 2 long string comparator , memory , 100 ) ; table open ( ) ; / / first , we insert some elements for ( long i = 0 ; i < num elements ; i + + ) { table insert or replace record ( tuple 2 of ( i , long string ) ) ; } / / now , we replace the same elements , causing fragmentation for ( long i = 0 ; i < num elements ; i + + ) { table insert or replace record ( tuple 2 of ( i , long string ) ) ; } / / now we insert an additional set of elements without compaction during this / / insertion , / / the memory will run out for ( long i = 0 ; i < num elements ; i + + ) { table insert or replace record ( tuple 2 of ( i + num elements , long string ) ) ; } / / check the results compacting hash table < tuple 2 < long , string > > hash table prober < tuple 2 < long , string > > prober = table get prober ( tuple 2 long string comparator , new same type pair comparator < > ( tuple 2 long string comparator ) ) ; tuple 2 < long , string > reuse = new tuple 2 < > ( ) ; for ( long i = 0 ; i < num elements ; i + + ) { assert not null ( prober get match for ( tuple 2 of ( i , long string ) , reuse ) ) ; assert not null ( prober get match for ( tuple 2 of ( i + num elements , long string ) , reuse ) ) ; } } catch ( exception e ) { e print stack trace ( ) ; fail ( e get message ( ) ) ; } }


use the given thread pool for processing the work items if you do not care to configure the thread pool used and you do not wish to make use of shared thread pools , then you can call { @ link # set thread pool name ( string ) } instead of this method

public concurrent q builder < i , r > set thread pool ( g thread pool thread pool ) { this thread pool = thread pool ; return this ; }


asserts that an escaper does not escape the given character

public static void assert unescaped ( char escaper escaper , char c ) { assert assert null ( compute replacement ( escaper , c ) ) ; }


returns true if this value can fit in 16 bits with sign - extension

public boolean fits in 1 6 bits ( ) { if ( ! fits in int ( ) ) { return false ; } int bits = get int bits ( ) ; return ( short ) bits = = bits ; }


plugin needs to return { @ link resource handler } when any special isolation required for the resource type this will be added to { @ link resource handler chain } during node manager startup when no special isolation need , return null

resource handler create resource handler ( context nm context , c groups handler c groups handler , privileged operation executor privileged operation executor ) ;


grow an array to a size that is larger than < code > min size < code > , preserving content , and potentially reusing part of the provided array

public double array grow ( double array array , long min size ) { if ( min size < = array size ( ) ) { return array ; } final long new size = over size ( min size , page cache recycler long page size , long bytes ) ; return resize ( array , new size ) ; }


public string get name ( ) { return name ; }


fire up our own hand - rolled mini d f s cluster we do this here instead of relying on test hdfs helper because we don ' t want to turn on x attr support

private void start mini d f s ( ) throws exception { file test dir root = test dir helper get test dir ( ) ; if ( system get property ( " hadoop log dir " ) = = null ) { system set property ( " hadoop log dir " , new file ( test dir root , " hadoop - log " ) get absolute path ( ) ) ; } if ( system get property ( " test build data " ) = = null ) { system set property ( " test build data " , new file ( test dir root , " hadoop - data " ) get absolute path ( ) ) ; } configuration conf = hadoop users conf test helper get base conf ( ) ; hadoop users conf test helper add user conf ( conf ) ; conf set ( " fs hdfs impl disable cache " , " true " ) ; conf set ( " dfs block access token enable " , " false " ) ; conf set ( " dfs permissions " , " true " ) ; conf set ( " hadoop security authentication " , " simple " ) ; / / explicitly turn off x attr support conf set boolean ( d f s config keys dfs namenode xattrs enabled key , false ) ; mini d f s cluster builder builder = new mini d f s cluster builder ( conf ) ; builder num data nodes ( 2 ) ; mini dfs = builder build ( ) ; nn conf = mini dfs get configuration ( 0 ) ; }


increments the xmits in progress count xmits in progress count represents the number of data replicationreconstruction tasks running currently

public void increment xmits in progress ( ) { xmits in progress get and increment ( ) ; }


write 1 application entity and checks the record for today in the flow activity table

public void test write flow activity one flow ( ) throws exception { string cluster = " test write flow activity one flow cluster 1 " ; string user = " test write flow activity one flow user 1 " ; string flow = " flow activity test flow name " ; string flow version = " a122110f135bc4 " ; long runid = 1001111178919l ; timeline entities te = new timeline entities ( ) ; long app created time = 1425016501000l ; timeline entity entity app 1 = test flow data generator get flow app 1 ( app created time ) ; te add entity ( entity app 1 ) ; h base timeline writer impl hbi = null ; configuration c 1 = util get configuration ( ) ; try { hbi = new h base timeline writer impl ( ) ; hbi init ( c 1 ) ; string app name = " application 1111999999 1234 " ; hbi write ( new timeline collector context ( cluster , user , flow , flow version , runid , app name ) , te , user group information create remote user ( user ) ) ; hbi flush ( ) ; } finally { if ( hbi ! = null ) { hbi close ( ) ; } } / / check flow activity check flow activity table ( cluster , user , flow , flow version , runid , c 1 , app created time ) ; / / use the reader to verify the data h base timeline reader impl hbr = null ; try { hbr = new h base timeline reader impl ( ) ; hbr init ( c 1 ) ; hbr start ( ) ; set < timeline entity > entities = hbr get entities ( new timeline reader context ( cluster , user , flow , null , null , timeline entity type yarn flow activity to string ( ) , null ) , new timeline entity filters builder ( ) entity limit ( 10l ) build ( ) , new timeline data to retrieve ( ) ) ; assert equals ( 1 , entities size ( ) ) ; for ( timeline entity e : entities ) { flow activity entity entity = ( flow activity entity ) e ; navigable set < flow run entity > flow runs = entity get flow runs ( ) ; assert equals ( 1 , flow runs size ( ) ) ; for ( flow run entity flow run : flow runs ) { assert equals ( runid , flow run get run id ( ) ) ; assert equals ( flow version , flow run get version ( ) ) ; } } } finally { if ( hbr ! = null ) { hbr close ( ) ; } } }


check timed multifactor providers for request optional

protected optional < multifactor authentication provider > check timed multifactor providers for request ( final registered service service ) { val timed multifactor = cas properties get authn ( ) get adaptive ( ) get require timed multifactor ( ) ; val now = local date time now ( zone id system default ( ) ) ; val dow = day of week from ( now ) ; val day names for today = arrays stream ( text style values ( ) ) map ( style - > dow get display name ( style , locale get default ( ) ) ) collect ( collectors to list ( ) ) ; val timed = timed multifactor stream ( ) filter ( t - > { var provider event = false ; if ( ! t get on days ( ) is empty ( ) ) { provider event = t get on days ( ) stream ( ) any match ( day names for today : : contains ) ; } if ( t get on or after hour ( ) > = 0 ) { provider event = now get hour ( ) > = t get on or after hour ( ) ; } if ( t get on or before hour ( ) > = 0 ) { provider event = now get hour ( ) < = t get on or before hour ( ) ; } return provider event ; } ) find first ( ) or else ( null ) ; if ( timed ! = null ) { val provider map = multifactor authentication utils get available multifactor authentication providers ( this application context ) ; val provider found = multifactor authentication utils resolve provider ( provider map , timed get provider id ( ) ) ; if ( provider found is empty ( ) ) { logger error ( " adaptive authentication is configured to require [ { } ] for [ { } ] , yet [ { } ] absent in the configuration " , timed get provider id ( ) , service , timed get provider id ( ) ) ; throw new authentication exception ( ) ; } return provider found ; } return optional empty ( ) ; }


this method expects that the current field name is the concatenation of a type , a delimiter and a name ( ex : terms # foo where " terms " refers to the type of a registered { @ link named x content registry entry } , " # " is the delimiter and " foo " the name of the object to parse ) it also expected that following this field name is either an object or an array x content structure and the cursor points to the start token of this structure the method splits the field ' s name to extract the type and name and then parses the object using the { @ link x content parser # named object ( class , string , object ) } method

public static < t > void parse typed keys object ( x content parser parser , string delimiter , class < t > object class , consumer < t > consumer ) throws i o exception { if ( parser current token ( ) ! = token start object & & parser current token ( ) ! = token start array ) { throw unknown token ( parser current token ( ) , parser get token location ( ) ) ; } string current field name = parser current name ( ) ; if ( strings has length ( current field name ) ) { int position = current field name index of ( delimiter ) ; if ( position > 0 ) { string type = current field name substring ( 0 , position ) ; string name = current field name substring ( position + 1 ) ; consumer accept ( parser named object ( object class , type , name ) ) ; return ; } / / if we didn ' t find a delimiter we ignore the object or array for forward compatibility instead of throwing an error parser skip children ( ) ; } else { throw new parsing exception ( parser get token location ( ) , " failed to parse object : empty key " ) ; } }


specifies the types for the csv fields this method parses the csv data to a 11 - tuple which has fields of the specified types this method is overloaded for each possible length of the tuples to support type safe creation of data sets through csv parsing

public < t0 , t1 , t2 , t3 , t4 , t5 , t6 , t7 , t8 , t9 , t10 > data source < tuple 1 1 < t0 , t1 , t2 , t3 , t4 , t5 , t6 , t7 , t8 , t9 , t10 > > types ( class < t0 > type 0 , class < t1 > type 1 , class < t2 > type 2 , class < t3 > type 3 , class < t4 > type 4 , class < t5 > type 5 , class < t6 > type 6 , class < t7 > type 7 , class < t8 > type 8 , class < t9 > type 9 , class < t10 > type 1 0 ) { tuple type info < tuple 1 1 < t0 , t1 , t2 , t3 , t4 , t5 , t6 , t7 , t8 , t9 , t10 > > types = tuple type info get basic and basic value tuple type info ( type 0 , type 1 , type 2 , type 3 , type 4 , type 5 , type 6 , type 7 , type 8 , type 9 , type 1 0 ) ; csv input format < tuple 1 1 < t0 , t1 , t2 , t3 , t4 , t5 , t6 , t7 , t8 , t9 , t10 > > input format = new tuple csv input format < tuple 1 1 < t0 , t1 , t2 , t3 , t4 , t5 , t6 , t7 , t8 , t9 , t10 > > ( path , types , this included mask ) ; configure input format ( input format ) ; return new data source < tuple 1 1 < t0 , t1 , t2 , t3 , t4 , t5 , t6 , t7 , t8 , t9 , t10 > > ( execution context , input format , types , utils get call location name ( ) ) ; }


the size of the component we will be calling out

dimension get size ( ) { return size ; }


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

public void warn ( string format , object arg a , object arg b ) { if ( logger is warn enabled ( ) ) { formatting tuple ft = message formatter format ( format , arg a , arg b ) ; logger warn ( ft get message ( ) , ft get throwable ( ) ) ; } }


public log get logger ( ) { return logger ; }


get the value of the ' { @ code label } ' attribute

protected object get label ( ) { return this label ; }


the locality associated with the endpoint a locality corresponds to a failure domain ( e g , countryregionzone ) arbitrary failure domain hierarchies can be represented by separating each encapsulating failure domain by for example , the locality of an an endpoint in us , in us - east - 1 region , within availability zone az - 1 , in data center rack r 1 1 can be represented as usus - east - 1az - 1r 1 1 istio will configure the sidecar to route to endpoints within the same locality as the sidecar if none of the endpoints in the locality are available , endpoints parent locality ( but within the same network id ) will be chosen for example , if there are two endpoints in same network ( network i d " n 1 " ) , say e 1 with locality usus - east - 1az - 1r 1 1 and e 2 with locality usus - east - 1az - 2r 1 2 , a sidecar from usus - east - 1az - 1r 1 1 locality will prefer e 1 from the same locality over e 2 from a different locality endpoint e 2 could be the ip associated with a gateway ( that bridges networks n 1 and n 2 ) , or the ip associated with a standard service endpoint < code > string locality = 5 ; < code >

public java lang string get locality ( ) { java lang object ref = locality ; if ( ref instanceof java lang string ) { return ( java lang string ) ref ; } else { com google protobuf byte string bs = ( com google protobuf byte string ) ref ; java lang string s = bs to string utf 8 ( ) ; locality = s ; return s ; } }


all { @ code graph analytic } processing must be terminated by an { @ link output format } rather than obtained via accumulators rather than returned by a { @ link data set }

graph analytic < k , vv , ev , t > run ( graph < k , vv , ev > input ) throws exception ;


used to delay string formatting until actually required , as it otherwise shows up in the test execution profile when running an extremely large numbers of tests

private string report context ( list < e > expected ) { return platform format ( " expected collection % s ; actual collection % s " , expected , this collection ) ; }


the path of temporary folder used to store downloaded files from endpoints with file response the default value is < code > null < code > , i e using the system ' s default tempopary folder

public string get temp folder path ( ) { return temp folder path ; }


processes all pending got16 relocations which match with the specified lo16 relocation

private void process g o t 1 6 relocations ( mips elf relocation context mips relocation context , int lo 1 6 reloc type , elf symbol lo 1 6 elf symbol , int lo 1 6 addend ) { iterator < mips deferred relocation > iterate got 1 6 = mips relocation context iterate got 1 6 ( ) ; while ( iterate got 1 6 has next ( ) ) { mips deferred relocation hi 1 6reloc = iterate got 1 6 next ( ) ; if ( matching hi lo 1 6 types ( hi 1 6reloc reloc type , lo 1 6 reloc type ) & & hi 1 6reloc elf symbol = = lo 1 6 elf symbol ) { process g o t 1 6 relocation ( mips relocation context , hi 1 6reloc , lo 1 6 addend ) ; iterate got 1 6 remove ( ) ; / / remove queued got16 relocation if processed } } }


public string get task name ( ) { return this task name ; }


litho handles addingremoving views automatically using mountunmount calls manually adding removing views will mess up litho ' s bookkeeping of added views and cause weird crashes down the line

public void remove all views in layout ( ) { throw new unsupported operation exception ( " removing views manually within litho views is not supported " ) ; }


the stream this state is associated with

public http 2 stream stream ( ) { return stream ; }


generate code to test argument of type < code > invocation < code > is null

private string generate invocation argument null check ( method method ) { class < ? > [ ] pts = method get parameter types ( ) ; return int stream range ( 0 , pts length ) filter ( i - > classname invocation equals ( pts [ i ] get name ( ) ) ) map to obj ( i - > string format ( code invocation argument null check , i , i ) ) find first ( ) or else ( " " ) ; }


insert 2 lfu keys , and 1 mfu key make sure when adding a new lfu key , the cache evicts the lfu lfu key and not the lru mfu key

public void test evict l f uand not m f u keys ( ) { / / cache has 4 entries ; 2 for lfu and 2 for mfu / / key is considered as mfu , if its access count > 1 m cache = create dummy adaptive counting memory cache ( m params supplier , m cache trim strategy , m value descriptor , 100 , 1 , 2 , initial l f u cache fraction promil ) ; / / insert item 1 to mfu closeable reference < integer > original ref 1 = new reference ( 10 ) ; closeable reference < integer > value ref 1a = m cache cache ( keys [ 1 ] , original ref 1 ) ; closeable reference < integer > value ref 1b = m cache get ( keys [ 1 ] ) ; original ref 1 close ( ) ; value ref 1a close ( ) ; value ref 1b close ( ) ; / / item 1 is in the mfu cache assert m f u exclusively owned ( keys [ 1 ] , 10 ) ; / / insert item 2 to lfu closeable reference < integer > original ref 2 = new reference ( 20 ) ; closeable reference < integer > value ref 2a = m cache cache ( keys [ 2 ] , original ref 2 ) ; original ref 2 close ( ) ; value ref 2a close ( ) ; / / insert item 3 to lfu closeable reference < integer > original ref 3 = new reference ( 30 ) ; closeable reference < integer > value ref 3a = m cache cache ( keys [ 3 ] , original ref 3 ) ; original ref 3 close ( ) ; value ref 3a close ( ) ; assert m f u exclusively owned ( keys [ 1 ] , 10 ) ; assert l f u exclusively owned ( keys [ 2 ] , 20 ) ; assert l f u exclusively owned ( keys [ 3 ] , 30 ) ; / / insert item 4 to lfu , the cache should evict item 2 closeable reference < integer > original ref 4 = new reference ( 40 ) ; closeable reference < integer > value ref 4a = m cache cache ( keys [ 4 ] , original ref 4 ) ; original ref 4 close ( ) ; value ref 4a close ( ) ; assert m f u exclusively owned ( keys [ 1 ] , 10 ) ; assert l f u exclusively owned ( keys [ 3 ] , 30 ) ; assert l f u exclusively owned ( keys [ 4 ] , 40 ) ; }


public static short byte to short ( byte b ) { return ( short ) ( b & byte mask ) ; }


test that , when the health monitor indicates bad health status , failover is triggered also ensures that graceful active - > standby transition is used when possible , falling back to fencing when the graceful approach fails

public void test auto failover on bad health ( ) throws exception { cluster start ( ) ; dummy h a service svc 1 = cluster get service ( 1 ) ; log info ( " faking svc 0 unhealthy , should failover to svc 1 " ) ; cluster set healthy ( 0 , false ) ; log info ( " waiting for svc 0 to enter initializing state " ) ; cluster wait for h a state ( 0 , h a service state initializing ) ; cluster wait for h a state ( 1 , h a service state active ) ; log info ( " allowing svc 0 to be healthy again , making svc 1 unreachable " + " and fail to gracefully go to standby " ) ; cluster set unreachable ( 1 , true ) ; cluster set healthy ( 0 , true ) ; / / should fail back to svc 0 at this point cluster wait for h a state ( 0 , h a service state active ) ; / / and fence svc 1 mockito verify ( svc 1 fencer ) fence ( mockito same ( svc 1 ) ) ; }


add a ticket to the registry ticket storage is based on the ticket id


public int compare to ( utf8 o ) { return writable comparator compare bytes ( bytes , 0 , length , o bytes , 0 , o length ) ; }


removes the mapping with the specified key from this map

public v remove ( long key ) { entry < v > entry = remove entry ( key ) ; if ( entry = = null ) return null ; v ret = entry value ; entry value = null ; entry key = long min value ; reuse after delete = entry ; return ret ; }


set the { @ code mono < principal > } to return for this exchange

builder principal ( mono < principal > principal mono ) ;


builds any miscellaneous renderers used by the player

protected void build miscellaneous renderers ( context context , handler event handler , @ extension renderer mode int extension renderer mode , array list < renderer > out ) { / / do nothing }


set up an ha topology with a single ha nameservice

public static mini d f s n n topology simple h a topology ( int nn count ) { mini d f s n n topology n s conf nameservice = new mini d f s n n topology n s conf ( " minidfs - ns " ) ; for ( int i = 1 ; i < = nn count ; i + + ) { nameservice add n n ( new mini d f s n n topology n n conf ( " nn " + i ) ) ; } mini d f s n n topology topology = new mini d f s n n topology ( ) add nameservice ( nameservice ) ; return topology ; }


cleanup operations once container is completed - deletes cgroup and removes traffic shaping rule ( s )

public list < privileged operation > post complete ( container id container id ) throws resource handler exception { log info ( " post complete for container : " + container id to string ( ) ) ; c groups handler delete c group ( c groups handler c group controller net cls , container id to string ( ) ) ; integer class id = container id class id map get ( container id ) ; if ( class id ! = null ) { privileged operation op = traffic controller new batch builder ( privileged operation operation type tc modify state ) delete container class ( class id ) commit batch to temp file ( ) ; try { privileged operation executor execute privileged operation ( op , false ) ; traffic controller release class id ( class id ) ; } catch ( privileged operation exception e ) { log warn ( " failed to delete tc rule for class id : " + class id ) ; throw new resource handler exception ( " failed to delete tc rule for class id : " + class id ) ; } } else { log warn ( " not cleaning up tc rules class id unknown for container : " + container id to string ( ) ) ; } return null ; }


exit a parse tree produced by the { @ code null literal } labeled alternative in { @ link eql base parser # constant }

void exit null literal ( eql base parser null literal context ctx ) ;


public void nullable message test ( ) { / / todo : test nullable message }


add the ( sanitized ) marshalled credentials to the string value

public string to string ( ) { return super to string ( ) + " ; " + marshalled credentials to string ( ) ; }


returns total number of entries in the unflushed immutable memtables

public void enable num entries imm mem tables ( ) { this properties add ( rocks d b property num entries imm mem tables get rocks d b property ( ) ) ; }


returns the python type for the property

public string get schema type ( schema schema ) { string open a p i type = get single schema type ( schema ) ; if ( type mapping contains key ( open a p i type ) ) { string type = type mapping get ( open a p i type ) ; return type ; } return to model name ( open a p i type ) ; }


get the current record leaf if the current record can not be found , attempt to recover the record position

private field key record node get record leaf ( boolean recover prev ) throws i o exception { if ( root buffer id < 0 | | record = = null ) { return null ; } field key = record get key field ( ) ; field key record node leaf = null ; is next = false ; is prev = false ; if ( expected mod count = = mod count ) { leaf = ( field key record node ) get field key node ( buffer id ) ; if ( record index > = leaf get key count ( ) | | ! leaf get key field ( record index ) equals ( key ) ) { leaf = null ; / / something changed - key search required } } if ( leaf = = null ) { / / something changed - try to relocate record using key field key node root node = get field key node ( root buffer id ) ; leaf = root node get leaf node ( key ) ; int index = leaf get key index ( key ) ; if ( index < 0 ) { / / record was deleted - position on next key index = - index - 1 ; if ( recover prev ) { - - index ; if ( index < 0 ) { leaf = leaf get previous leaf ( ) ; index = leaf ! = null ? ( leaf get key count ( ) - 1 ) : 0 ; } is prev = true ; } else { if ( index = = leaf get key count ( ) ) { leaf = leaf get next leaf ( ) ; index = 0 ; } is next = true ; } } if ( leaf ! = null ) { buffer id = leaf get buffer id ( ) ; record index = index ; } expected mod count = mod count ; } return leaf ; }


determines whether the given list of cases warrant being packed

private static boolean should pack ( int list cases ) { int sz = cases size ( ) ; if ( sz < 2 ) { return true ; } long packed size = packed code size ( cases ) ; long sparse size = sparse code size ( cases ) ; / * * we pick the packed representation if it is possible and * would be as small or smaller than 5 / 4 of the sparse * representation that is , we accept some size overhead on * the packed representation , since that format is faster to * execute at runtime * / return ( packed size > = 0 ) & & ( packed size < = ( ( sparse size * 5 ) / 4 ) ) ; }


returns the admin interface - specific section of the configuration file

public admin factory get admin factory ( ) { return admin ; }


public string to string ( ) { return buffer to string ( ) ; }


makes a best effort to return the last item selected , else returns an arbitrary item or null if the selection is empty

public @ null t get last selected ( ) { if ( last selected ! = null ) { return last selected ; } else if ( selected size > 0 ) { return selected first ( ) ; } return null ; }


determine the overall enablement appearance state

public boolean is enabled ( ) { return enabled ; }


returns the flammability of the used for fire calculations takes flammability of floor liquid into account

public float get flammability ( ) { if ( ! block has items ) { if ( floor liquid drop ! = null & & ! block solid ) { return floor liquid drop flammability ; } return 0 ; } else if ( build ! = null ) { float result = build items sum ( ( item , amount ) - > item flammability * amount ) ; if ( block has liquids ) { result + = build liquids sum ( ( liquid , amount ) - > liquid flammability * amount / 3f ) ; } return result ; } return 0 ; }


forces adding an element to the queue , without doing size checks

public void force put ( e e ) throws interrupted exception { size increment and get ( ) ; try { queue put ( e ) ; } catch ( interrupted exception ie ) { size decrement and get ( ) ; throw ie ; } }


shortcut method for setting the same property on the underlying pattern parser in use for more details see : { @ link # get path pattern parser ( ) } - - the underlying pattern parser { @ link path pattern parser # set match optional trailing separator ( boolean ) } - - the trailing slash option , including its default value

public void set use trailing slash match ( boolean trailing slash match ) { this pattern parser set match optional trailing separator ( trailing slash match ) ; }


executes the given task in a cpu thread pool

public static < t > void execute by cpu ( final task < t > task , @ int range ( from = 1 , to = 10 ) final int priority ) { execute ( get pool by type and priority ( type cpu , priority ) , task ) ; }


increase the partition count for a topic to the given { @ code total count } the assignment of new replicas to brokers will be decided by the broker

public static new partitions increase to ( int total count ) { return new new partitions ( total count , null ) ; }


public list < o m f seg map > get o m f seg maps ( ) { return seg maps list ; }


gets list of illegal usernames , for which users should not be created always includes users from { @ link # illegal persisted usernames }

/ * package * / static set < string > get illegal persisted usernames ( ) { return new hash set < > ( arrays as list ( illegal persisted usernames ) ) ; }


creates a builder for new server - side { @ link ssl context }

public static ssl context builder for server ( private key key , string key password , iterable < ? extends x 5 0 9 certificate > key cert chain ) { return for server ( key , key password , to array ( key cert chain , empty x509 certificates ) ) ; }


public void test query historic task include binary variable ( ) throws exception { / / start process with a binary variable process instance process instance = runtime service start process instance by key ( " one task process " , singleton map ( " binary variable " , ( object ) " it is i , le binary " get bytes ( ) ) ) ; task task = task service create task query ( ) process instance id ( process instance get id ( ) ) single result ( ) ; assert that ( task ) is not null ( ) ; task service set variable local ( task get id ( ) , " binary task variable " , ( object ) " it is i , le binary " get bytes ( ) ) ; / / complete task task service complete ( task get id ( ) ) ; / / query task , including process variables historic task instance historic task = history service create historic task instance query ( ) task id ( task get id ( ) ) include process variables ( ) single result ( ) ; assert that ( historic task ) is not null ( ) ; assert that ( historic task get process variables ( ) ) is not null ( ) ; byte [ ] bytes = ( byte [ ] ) historic task get process variables ( ) get ( " binary variable " ) ; assert that ( new string ( bytes ) ) is equal to ( " it is i , le binary " ) ; / / query task , including task variables historic task = history service create historic task instance query ( ) task id ( task get id ( ) ) include task local variables ( ) single result ( ) ; assert that ( historic task ) is not null ( ) ; assert that ( historic task get task local variables ( ) ) is not null ( ) ; bytes = ( byte [ ] ) historic task get task local variables ( ) get ( " binary task variable " ) ; assert that ( new string ( bytes ) ) is equal to ( " it is i , le binary " ) ; }


skip bytes in the input buffer this skips bytes in the current entry ' s data , not the entire archive , and will stop at the end of the current entry ' s data if the number to skip extends beyond that point

public long skip ( long num to skip ) throws i o exception { / / review / / this is horribly inefficient , but it ensures that we / / properly skip over bytes via the tar buffer / / byte [ ] skip buf = new byte [ 8 * 1024 ] ; long skip = num to skip ; while ( skip > 0 ) { int real skip = ( int ) ( skip > skip buf length ? skip buf length : skip ) ; int num read = this read ( skip buf , 0 , real skip ) ; if ( num read = = - 1 ) { break ; } skip - = num read ; } return ( num to skip - skip ) ; }


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


test { @ link service config exported event } arising

public void test on service config exported event ( ) { service config < echo service > service config = new service config < > ( ) ; service config set interface ( echo service class ) ; service config set ref ( new echo service impl ( ) ) ; service config set registry ( new registry config ( " n / a " ) ) ; service config export ( ) ; string service definition = writable metadata service get service definition ( echo service class get name ( ) ) ; service definition service definition build = service definition builder build ( service config get interface class ( ) ) ; assert equals ( service definition , new gson ( ) to json ( service definition build ) ) ; }


dispatches all listeners { @ linkplain # enqueue enqueued } prior to this call , serially and in order

void dispatch ( ) { boolean schedule event runner = false ; synchronized ( this ) { if ( ! is thread scheduled ) { is thread scheduled = true ; schedule event runner = true ; } } if ( schedule event runner ) { try { executor execute ( this ) ; } catch ( runtime exception e ) { / / reset state in case of an error so that later dispatch calls will actually do something synchronized ( this ) { is thread scheduled = false ; } / / log it and keep going logger log ( level severe , " exception while running callbacks for " + listener + " on " + executor , e ) ; throw e ; } } }


default void begin force landscape ( ) { }


public static cyclic barrier cyclic barrier ( int count ) { return new cyclic barrier ( count ) ; }


return the set of keys that collide from { @ code this } and { @ code other }

public set < string > intersection ( attribute dict other ) { if ( other = = null | | other size ( ) = = 0 | | size ( ) = = 0 ) { return collections empty set ( ) ; } set < string > result = new hash set < string > ( attributes key set ( ) ) ; result retain all ( other attributes key set ( ) ) ; return result ; }


wait for port number passed from main executed statement

private void wait port number ( ) throws d b g exception { int total wait = 0 ; boolean has statement = false ; log debug ( string format ( " waiting for port number with timeout % d " , local timeot ) ) ; while ( total wait < local timeot ) { try { callable statement statement = this local statement ; if ( statement ! = null ) { has statement = true ; if ( local port rcv ( statement get warnings ( ) ) ) { log debug ( " local port recived " ) ; break ; } } else if ( has statement ) { / / statement has been closed log debug ( " statement has been closed " ) ; break ; } / / please forgive me ! thread sleep ( local wait ) ; log debug ( " thread waked up " ) ; } catch ( s q l exception | interrupted exception e ) { log debug ( string format ( " error rcv port number % s " , e get message ( ) ) ) ; throw new d b g exception ( " error rcv port number " , e ) ; } total wait + = local wait ; } if ( local port number < 0 ) { log debug ( string format ( " unable to rcv port number % d " , local port number ) ) ; throw new d b g exception ( " unable to rcv port number " ) ; } }


add the codebase url of the given classname to the codebases map , if the class exists

private static void add class codebase ( map < string , url > codebases , string name , string classname ) { try { if ( codebases contains key ( name ) ) { return ; / / the codebase already exists , from the classpath } class < ? > clazz = bootstrap for testing class get class loader ( ) load class ( classname ) ; url location = clazz get protection domain ( ) get code source ( ) get location ( ) ; if ( location to string ( ) ends with ( " jar " ) = = false ) { if ( codebases put ( name , location ) ! = null ) { throw new illegal state exception ( " already added " + name + " codebase for testing " ) ; } } } catch ( class not found exception e ) { / / no class , fall through to not add this can happen for any tests that do not include / / the given class eg only core tests include plugin - classloader } }


this is more advanced and does not make use of the stub you should not normally need to do this , but here is how you would

void advanced async call ( ) { client call < hello request , hello reply > call = channel new call ( greeter grpc get say hello method ( ) , call options default ) ; final count down latch latch = new count down latch ( 1 ) ; call start ( new client call listener < hello reply > ( ) { @ override public void on close ( status status , metadata trailers ) { verify verify ( status get code ( ) = = status code internal ) ; verify verify ( trailers contains key ( debug info trailer key ) ) ; try { verify verify ( trailers get ( debug info trailer key ) equals ( debug info ) ) ; } catch ( illegal argument exception e ) { throw new verify exception ( e ) ; } latch count down ( ) ; } } , new metadata ( ) ) ; call send message ( hello request new builder ( ) build ( ) ) ; call half close ( ) ; if ( ! uninterruptibles await uninterruptibly ( latch , 1 , time unit seconds ) ) { throw new runtime exception ( " timeout ! " ) ; } }


determines if the supplied class object represents an annotation type

static public boolean is annotation ( class c ) { return reflection cache get type ( c ) is annotation ( ) ; }


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


find the fields constant that matches name , or null if its not found

public static fields find by name ( string name ) { return by name get ( name ) ; }


if end time & gt ; = 0 the parameter is not set

public influencers query builder end ( string end time ) { influencers query end = end time ; return this ; }


returns a string representation of this array in the same form as { @ link arrays # to string ( int [ ] ) } , for example { @ code " [ 1 , 2 , 3 ] " }

public string to string ( ) { if ( is empty ( ) ) { return " [ ] " ; } string builder builder = new string builder ( length ( ) * 5 ) ; / / rough estimate is fine builder append ( ' [ ' ) append ( array [ start ] ) ; for ( int i = start + 1 ; i < end ; i + + ) { builder append ( " , " ) append ( array [ i ] ) ; } builder append ( ' ] ' ) ; return builder to string ( ) ; }


get the current { @ linkplain object test instance } for this test context note : this is a mutable property


override get cononical service name because we don ' t support token in swift

public string get canonical service name ( ) { / / does not support token return null ; }


creates a { @ code variables } configuration from a list of keyvalue pairs if there are multiple entries with the same key , the variable will be treated as sequence type

private cc toolchain variables create variables ( string entries ) { if ( entries length % 2 ! = 0 ) { throw new illegal argument exception ( " create variables takes an even number of arguments ( key / value pairs ) " ) ; } multimap < string , string > entry map = array list multimap create ( ) ; for ( int i = 0 ; i < entries length ; i + = 2 ) { entry map put ( entries [ i ] , entries [ i + 1 ] ) ; } cc toolchain variables builder variables = cc toolchain variables builder ( ) ; for ( string name : entry map key set ( ) ) { collection < string > value = entry map get ( name ) ; if ( value size ( ) = = 1 ) { variables add string variable ( name , value iterator ( ) next ( ) ) ; } else { variables add string sequence variable ( name , immutable list copy of ( value ) ) ; } } return variables build ( ) ; }


service startup : create the secret manager

protected void service start ( ) throws exception { super service start ( ) ; secret manager = create secret mananger ( ) ; }


public static http response execute ( final string url , final string method , final map < string , object > headers ) { return execute ( url , method , null , null , new hash map < > ( 0 ) , headers ) ; }


one request followed by one response the server returns the client payload as - is

public void unary call ( io grpc benchmarks proto messages simple request request , io grpc stub stream observer < io grpc benchmarks proto messages simple response > response observer ) { io grpc stub client calls async unary call ( get channel ( ) new call ( get unary call method ( ) , get call options ( ) ) , request , response observer ) ; }


returns the number of resources of this type

public short get count ( ) { return count ; }


create a driver object that will have a { @ link # context ( ) } that records messages { @ link processor context # forward ( object , object ) forwarded } by the store and that provides the specified serializers and deserializers this can be used when store is created to rely upon the processor context ' s default key and value serializers and deserializers

public static < k , v > key value store test driver < k , v > create ( final serializer < k > key serializer , final deserializer < k > key deserializer , final serializer < v > value serializer , final deserializer < v > value deserializer ) { final state serdes < k , v > serdes = new state serdes < > ( " unexpected " , serdes serde from ( key serializer , key deserializer ) , serdes serde from ( value serializer , value deserializer ) ) ; return new key value store test driver < > ( serdes ) ; }


parses a d file performance - critical ! in large c + + builds there are lots of d files to read , and some of them reach into hundreds of kilobytes

public dependency set process ( byte [ ] content ) throws i o exception { final int n = content length ; if ( n > 0 & & content [ n - 1 ] ! = ' \ n ' ) { throw new i o exception ( " file does not end in a newline " ) ; / / from now on , we can safely peek ahead one character when not at a newline } / / our write position in content [ ] ; we use the prefix as working space to build strings int w = 0 ; / / have we seen a leading " mumble o : " on this line yet ? if not , we ignore / / any dependencies we parse this is bug - for - bug compatibility with our / / msvc wrapper , which generates invalid d files : ( boolean saw target = false ; for ( int r = 0 ; r < n ; ) { final byte c = content [ r + + ] ; switch ( c ) { case ' ' : / / if we haven ' t yet seen the colon delimiting the target name , / / keep scanning we do this to cope with " foo o : \ " which is / / valid makefile syntax produced by the cuda compiler if ( saw target & & w > 0 ) { add dependency ( new string ( content , 0 , w , standard charsets utf 8 ) ) ; w = 0 ; } continue ; case ' \ r ' : / / ignore , should be followed by a \ n continue ; case ' \ n ' : / / this closes a filename / / ( arguably if ! saw target & & w > 0 we should report an error , / / as that suggests the d file is malformed ) if ( saw target & & w > 0 ) { add dependency ( new string ( content , 0 , w , standard charsets utf 8 ) ) ; } w = 0 ; saw target = false ; / / reset for new line continue ; case ' : ' : / / normally this indicates the target name , but it might be part of a / / filename on windows peek ahead at the next character switch ( content [ r ] ) { case ' ' : case ' \ n ' : case ' \ r ' : if ( w > 0 ) { output file name = new string ( content , 0 , w , standard charsets utf 8 ) ; w = 0 ; saw target = true ; } continue ; default : content [ w + + ] = c ; / / copy a colon to filename continue ; } case ' \ \ ' : / / peek ahead at the next character switch ( content [ r ] ) { / / backslashes are taken literally except when followed by whitespace / / see the windows tests for some of the nonsense we have to tolerate case ' ' : content [ w + + ] = ' ' ; / / copy a space to the filename + + r ; / / skip over the space continue ; case ' \ n ' : + + r ; / / skip over the newline continue ; case ' \ r ' : / / one backslash can escape \ r \ n , so peek one more character if ( content [ + + r ] = = ' \ n ' ) { + + r ; } continue ; default : content [ w + + ] = c ; / / copy a backlash to the filename continue ; } case ' $ ' : if ( content [ r ] = = ' $ ' ) { content [ w + + ] = ' $ ' ; + + r ; continue ; } / / i don ' t think this can ever happen , but fall through nevertheless default : content [ w + + ] = c ; } } return this ; }


synchronously gets all the ephemeral nodes created by this session

public list < string > get ephemerals ( ) throws keeper exception , interrupted exception { return get ephemerals ( " / " ) ; }


get the previous bucket item before provided timestamp

public window wrap < t > get previous window ( long time millis ) { if ( time millis < 0 ) { return null ; } int idx = calculate time idx ( time millis - window length in ms ) ; time millis = time millis - window length in ms ; window wrap < t > wrap = array get ( idx ) ; if ( wrap = = null | | is window deprecated ( wrap ) ) { return null ; } if ( wrap window start ( ) + window length in ms < ( time millis ) ) { return null ; } return wrap ; }


public int get signature ( ) { return signature ; }


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


returns a { @ code url } pointing to { @ code resource name } if the resource is found using the { @ linkplain thread # get context class loader ( ) context class loader } in simple environments , the context class loader will find resources from the class path in environments where different threads can have different class loaders , for example app servers , the context class loader will typically have been set to an appropriate loader for the current thread in the unusual case where the context class loader is null , the class loader that loaded this class ( { @ code resources } ) will be used instead

public static url get resource ( string resource name ) { final class loader context class loader = thread current thread ( ) get context class loader ( ) ; final class loader loader = context class loader = = null ? resources class get class loader ( ) : context class loader ; final url url = loader get resource ( resource name ) ; if ( url = = null ) { throw new illegal argument exception ( " resource " + resource name + " not found " ) ; } return url ; }


check if this bean factory contains a bean definition with the given name does not consider any hierarchy this factory may participate in invoked by { @ code contains bean } when no cached singleton instance is found depending on the nature of the concrete bean factory implementation , this operation might be expensive ( for example , because of directory lookups in external registries ) however , for listable bean factories , this usually just amounts to a local hash lookup : the operation is therefore part of the public interface there the same implementation can serve for both this template method and the public interface method in that case

protected abstract boolean contains bean definition ( string bean name ) ;


the response resources wrapped in the common mcp resource message these are typed resources that match the type url in the incremental mesh config request < code > repeated istio mcp v 1alpha 1 resource resources = 2 ; < code >

public java util list < com alibaba nacos istio model mcp resource builder > get resources builder list ( ) { return get resources field builder ( ) get builder list ( ) ; }


returns a new , empty builder for { @ link immutable double array } instances , with a default initial capacity the returned builder is not thread - safe < b > performance note : < b > the { @ link immutable double array } that is built will very likely occupy more memory than necessary ; to trim memory usage , build using { @ code builder build ( ) trimmed ( ) }

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


method to execute the update given arguments and retrieve the generated keys using a key holder

public int update by named param ( map < string , ? > param map , key holder generated key holder ) throws data access exception { validate named parameters ( param map ) ; parsed sql parsed sql = get parsed sql ( ) ; map sql parameter source param source = new map sql parameter source ( param map ) ; string sql to use = named parameter utils substitute named parameters ( parsed sql , param source ) ; object [ ] params = named parameter utils build value array ( parsed sql , param source , get declared parameters ( ) ) ; int rows affected = get jdbc template ( ) update ( new prepared statement creator ( sql to use , params ) , generated key holder ) ; check rows affected ( rows affected ) ; return rows affected ; }


serialize an ( avro ) type serializer snapshot and deserialize it

private static < t > avro serializer snapshot < t > round trip ( type serializer snapshot < t > original ) throws i o exception { / / write snapshot ( ) ; data output serializer out = new data output serializer ( 1024 ) ; original write snapshot ( out ) ; / / init avro serializer snapshot < t > restored = new avro serializer snapshot < > ( ) ; / / read snapshot ( ) ; data input view in = new data input deserializer ( out wrap as byte buffer ( ) ) ; restored read snapshot ( restored get current version ( ) , in , original get class ( ) get class loader ( ) ) ; return restored ; }


test for races in fstat usage note : this test is likely to fail on rhel 6 0 which has a non - threadsafe implementation of getpwuid r

public void test multi threaded fstat ( ) throws exception { assume not windows ( ) ; final file output stream fos = new file output stream ( new file ( test dir , " testfstat " ) ) ; final atomic reference < throwable > thrown = new atomic reference < throwable > ( ) ; list < thread > statters = new array list < thread > ( ) ; for ( int i = 0 ; i < 10 ; i + + ) { thread statter = new thread ( ) { @ override public void run ( ) { long et = time now ( ) + 5000 ; while ( time now ( ) < et ) { try { native i o posix stat stat = native i o posix get fstat ( fos get f d ( ) ) ; assert equals ( system get property ( " user name " ) , stat get owner ( ) ) ; assert not null ( stat get group ( ) ) ; assert true ( ! stat get group ( ) is empty ( ) ) ; assert equals ( " stat mode field should indicate a regular file " , s ifreg , stat get mode ( ) & s ifmt ) ; } catch ( throwable t ) { thrown set ( t ) ; } } } } ; statters add ( statter ) ; statter start ( ) ; } for ( thread t : statters ) { t join ( ) ; } fos close ( ) ; if ( thrown get ( ) ! = null ) { throw new runtime exception ( thrown get ( ) ) ; } }


public void fade in all layers ( ) { m transition state = transition starting ; arrays fill ( m is layer on , true ) ; invalidate self ( ) ; }


returns a { @ link byte provider } with the contents of the requested { @ link g file file } ( in the global file cache directory ) never returns null , throws i o exception if there was a problem caller is responsible for { @ link byte provider # close ( ) closing ( ) } the byte provider when finished

public byte provider get byte provider ( fsrl fsrl , task monitor monitor ) throws cancelled exception , i o exception { file file = get file ( fsrl , monitor ) ; random access byte provider rabp = new random access byte provider ( file , fsrl ) ; return rabp ; }


gets the composite editor actions that are currently added to this action manager the favorites and cycle groups actions that the manager created by default are not part of the actions returned

public composite editor table action [ ] get editor actions ( ) { return editor actions to array ( new composite editor table action [ editor actions size ( ) ] ) ; }


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


is authentication response with result boolean

protected boolean is authentication response with result ( final authn response response ) { return false ; }


create a copy of this resolution with a new description

public assembly resolved constructor with description ( string desc ) { return new assembly resolved constructor ( desc , children , ins , ctx , backfills , forbids ) ; }