convenient factory method for converting a primitive type to string call site

private static method invocation site create primitive to string invocation site ( class name primitive type name ) { check argument ( primitive type name is primitive ( ) , " expected a primitive type for a type boxing call site , but got % s " , primitive type name ) ; return method invocation site builder ( ) set invocation kind ( member use kind invokestatic ) set method ( method key create ( primitive type name to boxed type ( ) , " to string " , type get method descriptor ( type get type ( string class ) , primitive type name to asm object type ( ) ) ) ) set is interface ( false ) build ( ) ; }


update the number of threads which may be used concurrently for moving blocks

public boolean update balancer max concurrent movers ( final int movers ) { return balance throttler set max concurrent movers ( movers , this max reconfigure wait time ) ; }


void encode ( byte [ ] in , int in pos , int in avail ) { if ( eof ) { return ; } if ( in avail < 0 ) { eof = true ; if ( 0 = = modulus & & line length = = 0 ) { return ; } ensure buffer size ( encode size ) ; int saved pos = pos ; switch ( modulus ) { case 1 : buffer [ pos + + ] = encode table [ ( bit work area > > 2 ) & mask 6bits ] ; buffer [ pos + + ] = encode table [ ( bit work area < < 4 ) & mask 6bits ] ; if ( encode table = = standard encode table ) { buffer [ pos + + ] = pad ; buffer [ pos + + ] = pad ; } break ; case 2 : buffer [ pos + + ] = encode table [ ( bit work area > > 10 ) & mask 6bits ] ; buffer [ pos + + ] = encode table [ ( bit work area > > 4 ) & mask 6bits ] ; buffer [ pos + + ] = encode table [ ( bit work area < < 2 ) & mask 6bits ] ; if ( encode table = = standard encode table ) { buffer [ pos + + ] = pad ; } break ; default : break ; } current line pos + = pos - saved pos ; / * if current pos = = 0 we are at the start of a line , so don ' t add crlf * / if ( line length > 0 & & current line pos > 0 ) { system arraycopy ( line separator , 0 , buffer , pos , line separator length ) ; pos + = line separator length ; } } else { for ( int i = 0 ; i < in avail ; i + + ) { ensure buffer size ( encode size ) ; modulus = ( modulus + 1 ) % bytes per unencoded block ; int b = in [ in pos + + ] ; if ( b < 0 ) { b + = 256 ; } bit work area = ( bit work area < < 8 ) + b ; if ( 0 = = modulus ) { buffer [ pos + + ] = encode table [ ( bit work area > > 18 ) & mask 6bits ] ; buffer [ pos + + ] = encode table [ ( bit work area > > 12 ) & mask 6bits ] ; buffer [ pos + + ] = encode table [ ( bit work area > > 6 ) & mask 6bits ] ; buffer [ pos + + ] = encode table [ bit work area & mask 6bits ] ; current line pos + = bytes per encoded block ; if ( line length > 0 & & line length < = current line pos ) { system arraycopy ( line separator , 0 , buffer , pos , line separator length ) ; pos + = line separator length ; current line pos = 0 ; } } } } }


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


public simple future < t > reset ( ) { super reset ( ) ; result = null ; exception = null ; waiter = null ; internal callback = null ; silent = false ; return this ; }


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


gets the string representation of the identity in the form that makes sense to the enclosing { @ link federated login service } , such as full open i d url

public abstract string get identifier ( ) ;


get enum record whoose source i d and datatype i d match the specified universal i ds

abstract d b record get record with i ds ( universal i d source i d , universal i d datatype i d ) throws i o exception ;


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


discard any state we are tracking for the given replica this could mean the block is either deleted from the block space or the replica is no longer on transient storage

synchronized void discard replica ( final string bpid , final long block id , boolean delete saved copies ) { map < long , ram disk replica lru > map = replica maps get ( bpid ) ; if ( map = = null ) { return ; } ram disk replica lru ram disk replica lru = map get ( block id ) ; if ( ram disk replica lru = = null ) { return ; } if ( delete saved copies ) { ram disk replica lru delete saved files ( ) ; } map remove ( block id ) ; replicas persisted remove ( ram disk replica lru last used time , ram disk replica lru ) ; / / replicas not persisted will be lazily gc ' ed }


public static iterable < object [ ] > data ( ) { return arrays as list ( new object [ ] [ ] { / / max value / 2 is important because the signs are generally the same for past and future / / deadlines { long max value / 2 } , { 0 } , { long max value } , { long min value } } ) ; }


returns the minimum offset from the given instruction offsets

private int min offset ( value instruction offsets ) { return min offset ( instruction offsets , integer max value ) ; }


public static string encrypt value as jwt ( final key secret key encryption key , final serializable value , final string algorithm header value , final string encryption method header parameter , final map < string , object > custom headers ) { return encrypt value as jwt ( secret key encryption key , value , algorithm header value , encryption method header parameter , null , custom headers ) ; }


public void set minimum size ( dimension min size ) { set minimum size ( min size width , min size height ) ; }


public list < string > get array of string ( ) { return array of string ; }


map < string , object > create from ( o auth 2 0 access token access token , j e e context context ) ;


client connect ( url url , channel handler handler ) throws remoting exception ;


returns true if there are tasks that are running or need to be run

public static boolean is executing tasks ( ) { if ( system utilities is in testing mode ( ) ) { return running tasks size ( ) > 0 ; } return false ; }


public locals array set merge with subroutine caller ( locals array other , int pred label ) { locals array set result = new locals array set ( get max locals ( ) ) ; return result merge with subroutine caller ( other , pred label ) ; }


determines whether the indicated domain object can be closed the user will be prompted to save any editor changes if the user cancels when prompted to save then the domain object should not close

protected boolean can close domain object ( domain object d obj ) { if ( d obj instanceof program ) { program p = ( program ) d obj ; return check editors ( p get listing ( ) get data type manager ( ) , true ) ; } return true ; }


if there ' re intermediate join tables for two tables , when the two classes are not associated , the join table should be dropped

private void remove intermediate tables ( ) { list < string > table names to drop = find intermediate tables to drop ( ) ; drop tables ( table names to drop , m db ) ; clear copy in table schema ( table names to drop ) ; }


try to { @ link # dispatch service instances changed event ( string , collection ) dispatch } { @ link service instances changed event } before { @ link zookeeper service watch # child event ( curator framework , tree cache event ) } execution if required

public void before child event ( curator framework client , tree cache event event ) { if ( supports event type ( event ) ) { string service name = resolve service name ( event ) ; if ( has text ( service name ) ) { dispatch service instances changed event ( service name , get instances ( service name ) ) ; } } }


returns whether the given input is the first line of a web v t t file

public static boolean is webvtt header line ( parsable byte array input ) { @ nullable string line = input read line ( ) ; return line ! = null & & line starts with ( webvtt header ) ; }


resolve the bean class for the specified bean definition , resolving a bean class name into a class reference ( if necessary ) and storing the resolved class in the bean definition for further use

protected class < ? > resolve bean class ( root bean definition mbd , string bean name , class < ? > types to match ) throws cannot load bean class exception { try { if ( mbd has bean class ( ) ) { return mbd get bean class ( ) ; } if ( system get security manager ( ) ! = null ) { return access controller do privileged ( ( privileged exception action < class < ? > > ) ( ) - > do resolve bean class ( mbd , types to match ) , get access control context ( ) ) ; } else { return do resolve bean class ( mbd , types to match ) ; } } catch ( privileged action exception pae ) { class not found exception ex = ( class not found exception ) pae get exception ( ) ; throw new cannot load bean class exception ( mbd get resource description ( ) , bean name , mbd get bean class name ( ) , ex ) ; } catch ( class not found exception ex ) { throw new cannot load bean class exception ( mbd get resource description ( ) , bean name , mbd get bean class name ( ) , ex ) ; } catch ( linkage error err ) { throw new cannot load bean class exception ( mbd get resource description ( ) , bean name , mbd get bean class name ( ) , err ) ; } }


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


if { @ link epoll # is available ( ) } < code > = = true < code > , returns { @ link epoll socket channel } , otherwise returns { @ link nio socket channel }

public static class < ? extends socket channel > nio or epoll socket channel ( ) { if ( epoll is available ( ) ) { return epoll socket channel class ; } else { return nio socket channel class ; } }


returns the long array of < code > n elements < code > starting at < code > index < code >

public long [ ] read long array ( long index , int n elements , long min clamp , long max clamp , long exceptions ) throws i o exception { long [ ] array = read long array ( index , n elements ) ; for ( int ii = 0 ; ii < array length ; + + ii ) { array [ ii ] = clamp long ( array [ ii ] , min clamp , max clamp , exceptions ) ; } return array ; }


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


public list < list < read only first > > get array array of model ( ) { return array array of model ; }


return the { @ link http message writer http message writers } to be used for response body conversion

list < http message writer < ? > > message writers ( ) ;


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


determine if a subsection of an array is zero

public static boolean is zero ( byte [ ] bytes , int start pos , int length ) { return ! has unsafe ( ) | | ! unaligned access ( ) ? is zero safe ( bytes , start pos , length ) : platform dependent 0 is zero ( bytes , start pos , length ) ; }


to be kept in sync with { @ link file path v f # compute relative path to root ( ) }

private string compute relative path to root ( ) { if ( this root equals ( this f ) ) { return " " ; } deque < string > relative path = new linked list < > ( ) ; file current = this f ; while ( current ! = null & & ! current equals ( this root ) ) { relative path add first ( current get name ( ) ) ; current = current get parent file ( ) ; } return join with forward slashes ( relative path ) ; }


public int size ( ) { lock lock ( ) ; try { return queue size ( ) ; } finally { lock unlock ( ) ; } }


public api response < user > get user by name with http info ( string username ) throws api exception { object local var post body = null ; / / verify the required parameter ' username ' is set if ( username = = null ) { throw new api exception ( 400 , " missing the required parameter ' username ' when calling get user by name " ) ; } / / create path and map variables string local var path = " / user / { username } " replace all ( " \ \ { " + " username " + " \ \ } " , api client escape string ( username to string ( ) ) ) ; / / query params list < pair > local var query params = new array list < pair > ( ) ; map < string , string > local var header params = new hash map < string , string > ( ) ; map < string , string > local var cookie params = new hash map < string , string > ( ) ; map < string , object > local var form params = new hash map < string , object > ( ) ; final string [ ] local var accepts = { " application / xml " , " application / json " } ; final string local var accept = api client select header accept ( local var accepts ) ; final string [ ] local var content types = { } ; final string local var content type = api client select header content type ( local var content types ) ; string [ ] local var auth names = new string [ ] { } ; generic type < user > local var return type = new generic type < user > ( ) { } ; return api client invoke a p i ( " user api get user by name " , local var path , " get " , local var query params , local var post body , local var header params , local var cookie params , local var form params , local var accept , local var content type , local var auth names , local var return type , false ) ; }


given a variable for a specified program , create a comparable variable in the specified other program if possible an open transaction on other program must exist

public static variable create variable ( program program , variable var , program other program ) throws duplicate name exception , invalid input exception { symbol parent = var get symbol ( ) get parent symbol ( ) ; source type source = var get source ( ) ; parent = get symbol ( parent , other program ) ; if ( parent = = null ) { return null ; } / / todo : method does not protect against duplicate variable ( i e , same offset , same first - use ) / / todo : is it safe to use variable storage from one program into another ? namespace namespace = ( namespace ) parent get object ( ) ; if ( namespace instanceof function ) { function func = ( function ) namespace ; if ( var instanceof parameter ) { return func insert parameter ( ( ( parameter ) var ) get ordinal ( ) , var , source ) ; } return func add local variable ( var , source ) ; } / / todo : add global or namespace variable support here return null ; }


return { @ code true } if http header validation should be performed

protected boolean is validate http headers ( ) { return validate http headers ; }


set a new list representing your latest data a diff will be computed between this list and the last list set if this has not previously been called then an empty list is used as the previous list the diff computation will be done on the thread given by the handler in the constructor when the diff is done it will be applied ( dispatched to the result callback ) , and the new list will be swapped in

public void submit list ( @ nullable final list < ? extends epoxy model < ? > > new list ) { final int run generation ; @ nullable final list < ? extends epoxy model < ? > > previous list ; synchronized ( this ) { / / incrementing generation means any currently - running diffs are discarded when they finish / / we synchronize to guarantee list object and generation number are in sync run generation = generation tracker increment and get next scheduled ( ) ; previous list = list ; } if ( new list = = previous list ) { / / nothing to do on run completed ( run generation , new list , diff result no op ( previous list ) ) ; return ; } if ( new list = = null | | new list is empty ( ) ) { / / fast simple clear all diff result result = null ; if ( previous list ! = null & & ! previous list is empty ( ) ) { result = diff result clear ( previous list ) ; } on run completed ( run generation , null , result ) ; return ; } if ( previous list = = null | | previous list is empty ( ) ) { / / fast simple first insert on run completed ( run generation , new list , diff result inserted ( new list ) ) ; return ; } final diff callback wrapped callback = new diff callback ( previous list , new list , diff callback ) ; executor execute ( new runnable ( ) { @ override public void run ( ) { diff util diff result result = diff util calculate diff ( wrapped callback ) ; on run completed ( run generation , new list , diff result diff ( previous list , new list , result ) ) ; } } ) ; }


gets the element that is passed as marker for the end of data

static < t > circular element < t > end marker ( ) { @ suppress warnings ( " unchecked " ) circular element < t > c = ( circular element < t > ) eof marker ; return c ; }


generates the proxy instance for a base object , each ipc call will clean its calling identity

public static < t > t gen proxy ( class < t > interface class , final object base ) { / / noinspection constant conditions if ( true ) { return ( t ) base ; } / / noinspection unchecked return ( t ) proxy new proxy instance ( interface class get class loader ( ) , new class [ ] { interface class } , new invocation handler ( ) { @ override public object invoke ( object proxy , method method , object [ ] args ) throws throwable { try { return method invoke ( base , args ) ; } catch ( throwable e ) { throw e get cause ( ) = = null ? e : e get cause ( ) ; } } } ) ; }


returns the alignment shift count some resources offsets and lengths are stored bit shifted

public short get alignment shift count ( ) { return alignment shift count ; }


returns the remainder of this float value divided by the given particular float value

public float value remainder ( particular float value other ) { return remainder ( ( specific float value ) other ) ; }


get the root directory of trash for current user when the path specified is deleted

public path get trash root ( path path ) { return this make qualified ( new path ( get home directory ( ) to uri ( ) get path ( ) , trash prefix ) ) ; }


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

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


returns the status of current or last executed work plan

public disk balancer work status query disk balancer plan ( ) throws i o exception { check superuser privilege ( ) ; return get disk balancer ( ) query work status ( ) ; }


stubs { @ link amazon s 3 # get object ( get object request ) } within s 3 client spy to return throw a file not found exception until inconsistent call count calls have been made this simulates the condition where the s3 endpoint is caching a 404 request , or there is a tombstone in the way which has yet to clear

private void stub temporary not found ( amazon s 3 s 3 client spy , int inconsistent call count , path testpath ) { answer < object metadata > not found = new answer < object metadata > ( ) { private int call count = 0 ; @ override public object metadata answer ( invocation on mock invocation ) throws throwable { / / simulates delayed visibility call count + + ; if ( call count < = inconsistent call count ) { log info ( " temporarily unavailable { } count { } of { } " , testpath , call count , inconsistent call count ) ; log location at debug ( ) ; throw new file not found exception ( testpath to string ( ) ) ; } return ( object metadata ) invocation call real method ( ) ; } } ; / / head requests will fail do answer ( not found ) when ( s 3 client spy ) get object metadata ( matching metadata request ( testpath ) ) ; }


given a list of files , computes and returns an md5 checksum of the full contents of all files

private byte [ ] compute m d 5 ( list < file > files ) throws i o exception , no such algorithm exception { message digest md 5 = message digest get instance ( " md5 " ) ; for ( file file : files ) { get log ( ) debug ( " computing md5 for : " + file ) ; md 5 update ( read file ( file ) ) ; } return md 5 digest ( ) ; }


returns { @ code true } if either an allocation decision or a move decision was taken for the shard if no decision was taken , as in the case of initializing or relocating shards , then this method returns { @ code false }

public boolean is decision taken ( ) { return allocate decision is decision taken ( ) | | move decision is decision taken ( ) ; }


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

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


return true if this xml item 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 ; } xml item xml item = ( xml item ) o ; return objects equals ( this attribute string , xml item attribute string ) & & objects equals ( this attribute number , xml item attribute number ) & & objects equals ( this attribute integer , xml item attribute integer ) & & objects equals ( this attribute boolean , xml item attribute boolean ) & & objects equals ( this wrapped array , xml item wrapped array ) & & objects equals ( this name string , xml item name string ) & & objects equals ( this name number , xml item name number ) & & objects equals ( this name integer , xml item name integer ) & & objects equals ( this name boolean , xml item name boolean ) & & objects equals ( this name array , xml item name array ) & & objects equals ( this name wrapped array , xml item name wrapped array ) & & objects equals ( this prefix string , xml item prefix string ) & & objects equals ( this prefix number , xml item prefix number ) & & objects equals ( this prefix integer , xml item prefix integer ) & & objects equals ( this prefix boolean , xml item prefix boolean ) & & objects equals ( this prefix array , xml item prefix array ) & & objects equals ( this prefix wrapped array , xml item prefix wrapped array ) & & objects equals ( this namespace string , xml item namespace string ) & & objects equals ( this namespace number , xml item namespace number ) & & objects equals ( this namespace integer , xml item namespace integer ) & & objects equals ( this namespace boolean , xml item namespace boolean ) & & objects equals ( this namespace array , xml item namespace array ) & & objects equals ( this namespace wrapped array , xml item namespace wrapped array ) & & objects equals ( this prefix ns string , xml item prefix ns string ) & & objects equals ( this prefix ns number , xml item prefix ns number ) & & objects equals ( this prefix ns integer , xml item prefix ns integer ) & & objects equals ( this prefix ns boolean , xml item prefix ns boolean ) & & objects equals ( this prefix ns array , xml item prefix ns array ) & & objects equals ( this prefix ns wrapped array , xml item prefix ns wrapped array ) ; }


returns { @ code true } if we want to report missing members , { @ code false } otherwise

public boolean get check missing members ( ) { return check missing members ; }


private void return buffer ( byte buffer buf ) { if ( buf ! = null ) { buf clear ( ) ; buffer pool add ( buf ) ; } }


all the registered { @ link computer listener } s

public static extension list < computer listener > all ( ) { return extension list lookup ( computer listener class ) ; }


get a variable using the current location

private variable get variable ( function function , program location current location ) { if ( function = = null ) { return null ; } if ( current location instanceof variable location ) { return ( ( variable location ) current location ) get variable ( ) ; } return null ; }


program entry point initialises an instance of hotel and adds rooms to it carries out booking and cancel booking transactions

public static void main ( string [ ] args ) throws exception { final var data source = create data source ( ) ; delete schema ( data source ) ; create schema ( data source ) ; final var dao = new hotel dao impl ( data source ) ; / / add rooms add rooms ( dao ) ; / / print room booking status get room status ( dao ) ; var hotel = new hotel ( dao ) ; / / book rooms hotel book room ( 1 ) ; hotel book room ( 2 ) ; hotel book room ( 3 ) ; hotel book room ( 4 ) ; hotel book room ( 5 ) ; hotel book room ( 6 ) ; / / cancel booking for a few rooms hotel cancel room booking ( 1 ) ; hotel cancel room booking ( 3 ) ; hotel cancel room booking ( 5 ) ; get room status ( dao ) ; delete schema ( data source ) ; }


called when the last engine is ending its live , it can occur when : 1 service is dying 2 service is switching from one engine to another 3 [ only my assumption ] when wallpaper is not visible and system is going to restore some memory for foreground processing by disposing not used wallpaper engine we can ' t destroy app there , because : 1 in won ' t work - gl context is disposed right now and after app on destroy ( ) app would stuck somewhere in gl thread synchronizing code 2 we don ' t know if service create more engines , app is shared between them and should stay initialized waiting for new engines

public void on deep pause application ( ) { if ( debug ) log d ( tag , " > android live wallpaper service - on deep pause application ( ) " ) ; / / free native resources consuming runtime memory , note that it can cause some lag when resuming wallpaper if ( app ! = null ) { app graphics clear managed caches ( ) ; } }


the pointer that initially pressed this button or - 1 if the button is not pressed

public int get pressed pointer ( ) { return pressed pointer ; }


abstract factory pattern for wrapping an { @ link s s l engine } object this is useful for npnapln support

abstract s s l engine wrap ssl engine ( s s l engine engine , byte buf allocator alloc , jdk application protocol negotiator application negotiator , boolean is server ) ;


gets the location in the input { @ link char stream } at which the lexer action should be executed the value is interpreted as an offset relative to the token start index

public int get offset ( ) { return offset ; }


returns the size in bytes of the given ac - 4 syncframe

public static int parse ac 4 syncframe size ( byte [ ] data , int syncword ) { if ( data length < 7 ) { return c length unset ; } int header size = 2 ; / / syncword int frame size = ( ( data [ 2 ] & 0x f f ) < < 8 ) | ( data [ 3 ] & 0x f f ) ; header size + = 2 ; if ( frame size = = 0x f f f f ) { frame size = ( ( data [ 4 ] & 0x f f ) < < 16 ) | ( ( data [ 5 ] & 0x f f ) < < 8 ) | ( data [ 6 ] & 0x f f ) ; header size + = 3 ; } if ( syncword = = ac41 syncword ) { header size + = 2 ; } frame size + = header size ; return frame size ; }


just some random tests to ensure that we have no silly npe or that kind of error

public void basic ( ) { consistent hash < string > hash = new consistent hash < > ( ) ; hash add ( " data 1 " ) ; hash add ( " data 2 " ) ; hash add ( " data 3 " ) ; / / in a pure random scenario , there ' s one in 2 ^ 32 chance that this test fails / / but as we control the input and the hash function is deterministic , there is no risk of failure string x = hash lookup ( integer min value ) ; string y = hash lookup ( integer max value ) ; / / both values are data 3 assert equals ( x , y ) ; / / list them up iterator < string > itr = hash list ( integer min value ) iterator ( ) ; set < string > all = new hash set < > ( ) ; string z = itr next ( ) ; all add ( z ) ; assert equals ( z , x ) ; all add ( itr next ( ) ) ; all add ( itr next ( ) ) ; assert false ( itr has next ( ) ) ; assert equals ( 3 , all size ( ) ) ; }


maps 500 internal server errors to the provided route

public synchronized void internal server error ( route route ) { custom error pages add ( 500 , route ) ; }


driver icon , includes overlays for driver conditions ( custom , invalid , etc )

public d b p image get icon ( ) { if ( ! is loaded & & is failed ) { return icon error ; } else { return icon normal ; } }


returns the paths to the children of this directory returns an empty list if this file handle represents a file and not a directory on the desktop , an { @ link file type # internal } handle to a directory on the classpath will return a zero length array @ throw gdx runtime exception if this file is an { @ link file type # classpath } file

public file handle [ ] list ( ) { throw new gdx runtime exception ( " stub " ) ; }


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


checks that the given range is valid see https : bugs eclipse orgbugsshow bug cgi ? id = 69292

private void check range ( int offset , int length , int document length ) { assert is legal ( offset > - 1 ) ; assert is legal ( length > - 1 ) ; assert is legal ( offset + length < = document length ) ; }


public map < string , list < object > > get pk values by auto ( ) throws s q l exception { / / pk is just auto generated map < string , list < object > > pk values map = new hash map < > ( 8 ) ; map < string , column meta > pk meta map = get table meta ( ) get primary key map ( ) ; string auto column name = null ; for ( map entry < string , column meta > entry : pk meta map entry set ( ) ) { if ( entry get value ( ) is autoincrement ( ) ) { auto column name = entry get key ( ) ; break ; } } if ( string utils is blank ( auto column name ) ) { throw new should never happen exception ( ) ; } result set gen keys ; try { gen keys = statement proxy get generated keys ( ) ; } catch ( s q l exception e ) { / / java sql s q l exception : generated keys not requested you need to / / specify statement return generated keys to / / statement execute update ( ) or connection prepare statement ( ) if ( err sql state equals ignore case ( e get s q l state ( ) ) ) { logger warn ( " fail to get auto - generated keys , use ' select last insert id ( ) ' instead be cautious , statement could be polluted recommend you set the statement to return generated keys " ) ; gen keys = statement proxy get target statement ( ) execute query ( " select last insert id ( ) " ) ; } else { throw e ; } } list < object > pk values = new array list < > ( ) ; while ( gen keys next ( ) ) { object v = gen keys get object ( 1 ) ; pk values add ( v ) ; } try { gen keys before first ( ) ; } catch ( s q l exception e ) { logger warn ( " fail to reset result set cursor can not get primary key value " ) ; } pk values map put ( auto column name , pk values ) ; return pk values map ; }


public create user oper resp spec ( consumer < response spec builder > resp spec customizer ) { resp spec customizer accept ( resp spec ) ; return this ; }


applies the viewport to the camera and sets the gl viewport

public void apply ( boolean center camera ) { hdpi utils gl viewport ( screen x , screen y , screen width , screen height ) ; camera viewport width = world width ; camera viewport height = world height ; if ( center camera ) camera position set ( world width / 2 , world height / 2 , 0 ) ; camera update ( ) ; }


blow away and recache singleton on an advice change

protected void advice changed ( ) { super advice changed ( ) ; if ( this singleton ) { logger debug ( " advice has changed ; re - caching singleton instance " ) ; synchronized ( this ) { this singleton instance = null ; } } }


format a double value this is used by terms and stats aggregations to format keys for fields that use numbers as a doc value representation such as the { @ code long } , { @ code double } or { @ code date } fields

default object format ( double value ) { throw new unsupported operation exception ( ) ; }


assert that a committer ' s job attempt path exists for the staging committers , this is in the cluster fs

protected void assert job attempt path exists ( final abstract s 3 a committer committer , final job context job context ) throws i o exception { path attempt path = committer get job attempt path ( job context ) ; contract test utils assert is directory ( attempt path get file system ( committer get conf ( ) ) , attempt path ) ; }


protected abstract void render ( page html < > html ) ;


creates a sub - fragment of the current fragment

public file fragment sub fragment ( int from , int to ) { check sub bounds ( from , to ) ; return new file fragment ( buffer , file offset , start incl + from , start incl + to ) ; }


converts a json schema into flink ' s type information throws an exception if the schema cannot converted because of loss of precision or too flexible schema the converter can resolve simple schema references to solve those cases where entities are defined at the beginning and then used throughout a document

public static < t > type information < t > convert ( string json schema ) { preconditions check not null ( json schema , " json schema " ) ; final object mapper mapper = new object mapper ( ) ; mapper get factory ( ) enable ( json parser feature allow comments ) enable ( json parser feature allow unquoted field names ) enable ( json parser feature allow single quotes ) ; final json node node ; try { node = mapper read tree ( json schema ) ; } catch ( i o exception e ) { throw new illegal argument exception ( " invalid json schema " , e ) ; } return ( type information < t > ) convert type ( " < root > " , node , node ) ; }


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

public handler method return value handler composite add handler ( handler method return value handler return value handler ) { this return value handlers add ( return value handler ) ; return this ; }


asynchronously retrieve the set of effective privileges held by the current user

public cancellable get user privileges async ( request options options , action listener < get user privileges response > listener ) { return rest high level client perform request async and parse entity ( get user privileges request instance , get user privileges request : : get request , options , get user privileges response : : from x content , listener , empty set ( ) ) ; }


used the knowledge built up whilst processing since the last path element to determine what kind of path element to create

private path element create path element ( ) { if ( this inside variable capture ) { throw new pattern parse exception ( this pos , this path pattern data , pattern message missing close capture ) ; } path element new p e = null ; char separator = this parser get path options ( ) separator ( ) ; if ( this variable capture count > 0 ) { if ( this variable capture count = = 1 & & this path element start = = this variable capture start & & this path pattern data [ this pos - 1 ] = = ' } ' ) { if ( this is capture the rest variable ) { / / it is { * } new p e = new capture the rest path element ( this path element start , get path element text ( ) , separator ) ; } else { / / it is a full capture of this element ( possibly with constraint ) , for example : / foo / { abc } / try { new p e = new capture variable path element ( this path element start , get path element text ( ) , this parser is case sensitive ( ) , separator ) ; } catch ( pattern syntax exception pse ) { throw new pattern parse exception ( pse , find regex start ( this path pattern data , this path element start ) + pse get index ( ) , this path pattern data , pattern message regex pattern syntax exception ) ; } record captured variable ( this path element start , ( ( capture variable path element ) new p e ) get variable name ( ) ) ; } } else { if ( this is capture the rest variable ) { throw new pattern parse exception ( this path element start , this path pattern data , pattern message capture all is standalone construct ) ; } regex path element new regex section = new regex path element ( this path element start , get path element text ( ) , this parser is case sensitive ( ) , this path pattern data , separator ) ; for ( string variable name : new regex section get variable names ( ) ) { record captured variable ( this path element start , variable name ) ; } new p e = new regex section ; } } else { if ( this wildcard ) { if ( this pos - 1 = = this path element start ) { new p e = new wildcard path element ( this path element start , separator ) ; } else { new p e = new regex path element ( this path element start , get path element text ( ) , this parser is case sensitive ( ) , this path pattern data , separator ) ; } } else if ( this single char wildcard count ! = 0 ) { new p e = new single char wildcarded path element ( this path element start , get path element text ( ) , this single char wildcard count , this parser is case sensitive ( ) , separator ) ; } else { new p e = new literal path element ( this path element start , get path element text ( ) , this parser is case sensitive ( ) , separator ) ; } }


get the percentage of sequences which contain this pattern

public double get percentage ( ) { return percentage ; }


get the string property for name ; returns null if there is no name property for this code unit

public string get string property ( string name ) { throw new unsupported operation exception ( ) ; }


void update track selection ( track selection track selection ) ;


public static void gemv ( double alpha , dense matrix mat a , boolean trans a , sparse vector x , double beta , dense vector y ) { gemv dimension check ( mat a , trans a , x , y ) ; final int m = mat a num rows ( ) ; final int n = mat a num cols ( ) ; if ( trans a ) { int start = 0 ; for ( int i = 0 ; i < n ; i + + ) { double s = 0 ; for ( int j = 0 ; j < x indices length ; j + + ) { s + = x values [ j ] * mat a data [ start + x indices [ j ] ] ; } y data [ i ] = beta * y data [ i ] + alpha * s ; start + = m ; } } else { scal ( beta , y ) ; for ( int i = 0 ; i < x indices length ; i + + ) { int index = x indices [ i ] ; double value = alpha * x values [ i ] ; f2j blas daxpy ( m , value , mat a data , index * m , 1 , y data , 0 , 1 ) ; } } }


return the name of the target bean in the factory

public string get target bean name ( ) { return this target bean name ; }


sets the color of the text to be displayed

public void set text color ( int text color ) { this text color = text color ; set color filter ( text color , porter duff mode src in ) ; invalidate self ( ) ; }


returns { @ code true } if the min max heap structure holds this is only used in testing todo ( kevinb ) : move to the test class ?

boolean is intact ( ) { for ( int i = 1 ; i < size ; i + + ) { if ( ! heap for index ( i ) verify index ( i ) ) { return false ; } } return true ; }


returns the type of device ( e g ' i phone 6 ' ) to simulate when running on the simulator

public string get ios simulator device ( ) { / / todo ( bazel - team ) : deprecate in favor of get simulator device for platform type ( ios ) return ios simulator device ; }


allows { @ link type serializer # create instance ( ) } to return null the { @ link kryo serializer } is one example

protected boolean allow null instances ( type serializer < t > serializer ) { return serializer get class ( ) get name ( ) ends with ( " kryo serializer " ) ; }


add an edge if successful ( i e that edge does not appear in the graph ) , then set the weight to the specified value

public boolean add ( edge e , double weight ) { double wt = get weight ( e ) ; super add ( e ) ; set weight ( e , wt + weight ) ; return true ; }


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


returns { @ code true } if the request is a valid cors one by checking { @ code origin } header presence and ensuring that origins are different

public static boolean is cors request ( http servlet request request ) { string origin = request get header ( http headers origin ) ; if ( origin = = null ) { return false ; } uri components origin url = uri components builder from origin header ( origin ) build ( ) ; string scheme = request get scheme ( ) ; string host = request get server name ( ) ; int port = request get server port ( ) ; return ! ( object utils null safe equals ( scheme , origin url get scheme ( ) ) & & object utils null safe equals ( host , origin url get host ( ) ) & & get port ( scheme , port ) = = get port ( origin url get scheme ( ) , origin url get port ( ) ) ) ; }


creates a new deployment entry enriched with additional properties that are prefixed with { @ link environment # deployment entry }

public static deployment entry enrich ( deployment entry deployment , map < string , string > prefixed properties ) { final map < string , string > enriched properties = new hash map < > ( deployment as map ( ) ) ; prefixed properties for each ( ( k , v ) - > { final string normalized key = k to lower case ( ) ; if ( k starts with ( deployment entry + ' ' ) ) { enriched properties put ( normalized key substring ( deployment entry length ( ) + 1 ) , v ) ; } } ) ; final descriptor properties properties = new descriptor properties ( true ) ; properties put properties ( enriched properties ) ; return new deployment entry ( properties ) ; }


adds the fingerprint of this traversal object


possibly reorders the realm list depending on whether this principal has been recently authenticated by a specific realm

private list < realm > get realm list ( string principal ) { final list < realm > ordered realm list = this default ordered realm list ; if ( last successful auth cache ! = null ) { final realm last success = last successful auth cache get ( principal ) ; if ( last success ! = null ) { final int index = ordered realm list index of ( last success ) ; if ( index > 0 ) { final list < realm > smart order = new array list < > ( ordered realm list size ( ) ) ; smart order add ( last success ) ; for ( int i = 0 ; i < ordered realm list size ( ) ; i + + ) { if ( i ! = index ) { smart order add ( ordered realm list get ( i ) ) ; } } assert smart order size ( ) = = ordered realm list size ( ) & & smart order contains all ( ordered realm list ) : " element mismatch between smart order = " + smart order + " and default order = " + ordered realm list ; return collections unmodifiable list ( smart order ) ; } } } return ordered realm list ; }


a recursive approach to dependency resolution

private void add resolved dependency info ( resolved dependency info parent dependency , multimap < module version identifier , resolved dependency info > resolved dependencies map ) { int indent = parent dependency get indent ( ) ; module version identifier identifier = parent dependency get module version identifier ( ) ; collection < resolved dependency info > child dependencies = resolved dependencies map get ( identifier ) ; / / todo here for ( resolved dependency info child dependency : child dependencies ) { if ( child dependency get indent ( ) > indent ) { / / system out println ( parent dependency + " indent " + indent + " - > " + child dependency / / + " indent " + child dependency get indent ( ) ) ; parent dependency get children ( ) add ( child dependency ) ; if ( child dependency get indent ( ) < = 1 ) { add resolved dependency info ( child dependency , resolved dependencies map ) ; } } } }


sets the class path to be represented in this panel

public void set class path ( class path class path ) { list model clear ( ) ; if ( class path ! = null ) { for ( int index = 0 ; index < class path size ( ) ; index + + ) { list model add element ( class path get ( index ) ) ; } } / / make sure the selection buttons are properly enabled , / / since the clear method doesn ' t seem to notify the listener enable selection buttons ( ) ; }


read { @ code v } - type value from a stream

v read ( stream input in ) throws i o exception ;


returns { @ code true } if and only if the specified message can be encoded by this codec

public boolean accept outbound message ( object msg ) throws exception { return outbound msg matcher match ( msg ) ; }


set hibernate properties , such as " hibernate dialect " note : do not specify a transaction provider here when using spring - driven transactions it is also advisable to omit connection provider settings and use a spring - set data source instead

public void set hibernate properties ( properties hibernate properties ) { this hibernate properties = hibernate properties ; }


parses the output of the external python script sample line : id = 0 , dev = devve 0 , state = online , bus id = 0000 : 65 : 00 0 , major = 243 , minor = 0

private set < device > parse output ( string output ) { set < device > devices = new hash set < > ( ) ; log info ( " parsing output : { } " , output ) ; string [ ] lines = output split ( " \ n " ) ; outer : for ( string line : lines ) { device builder builder = device builder new instance ( ) ; / / map key - - > builder calls map < string , consumer < string > > builder invocations = get builder invocations map ( builder ) ; string [ ] key values = line trim ( ) split ( " , " ) ; for ( string key value : key values ) { string [ ] tokens = key value trim ( ) split ( " = " ) ; if ( tokens length ! = 2 ) { log error ( " unknown format of script output ! skipping this line " ) ; continue outer ; } final string key = tokens [ 0 ] ; final string value = tokens [ 1 ] ; consumer < string > builder invocation = builder invocations get ( key ) ; if ( builder invocation ! = null ) { builder invocation accept ( value ) ; } else { log warn ( " unknown key { } , ignored " , key ) ; } } / / for key value pairs device device = builder build ( ) ; if ( device is healthy ( ) ) { devices add ( device ) ; } else { log warn ( " skipping device { } because it ' s not healthy " , device ) ; } } return devices ; }


get the headers for magic versions 1 and below , this always returns an empty array


returns the absolute path of the current log file if a log file is open or { @ code optional # empty ( ) } otherwise since the log file is opened lazily , this method is expected to return { @ code optional # empty ( ) } if no record has yet been published

public synchronized optional < path > get current log file path ( ) { return output is open ( ) ? optional of ( output get path ( ) ) : optional empty ( ) ; }


used to retrieve the latest offset of a partition

public static offset spec latest ( ) { return new latest spec ( ) ; }


the nonce provides a way to explicitly ack a specific mesh config response in a following mesh config request additional messages may have been sent by client to the management server for the previous version on the stream prior to this mesh config response , that were unprocessed at response send time the nonce allows the management server to ignore any further mesh config requests for the previous version until a mesh config request bearing the nonce < code > string nonce = 4 ; < code >

public java lang string get nonce ( ) { java lang object ref = nonce ; 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 ( ) ; nonce = s ; return s ; } }


change the size of this array content between indexes < code > 0 < code > and < code > min ( size ( ) , new size ) < code > will be preserved

public void resize ( long new size ) { final int num pages = num pages ( new size ) ; if ( num pages > pages length ) { pages = arrays copy of ( pages , array util oversize ( num pages , ram usage estimator num bytes object ref ) ) ; } for ( int i = num pages - 1 ; i > = 0 & & pages [ i ] = = null ; - - i ) { pages [ i ] = new byte page ( i ) ; } for ( int i = num pages ; i < pages length & & pages [ i ] ! = null ; + + i ) { pages [ i ] = null ; release page ( i ) ; } this size = new size ; }


gets a { @ link char sequence } with the given length at the current { @ code reader index } and increases the { @ code reader index } by the given length

public abstract char sequence read char sequence ( int length , charset charset ) ;


where the element was defined < code > optional aapt pb source source = 1 ; < code >

public com android aapt resources source get source ( ) { return instance get source ( ) ; }


delegates to the { @ link log # warn ( object ) } method of the underlying { @ link log } instance

public void warn ( string msg ) { logger warn ( msg ) ; }


public static void put ( @ non null final string key , final drawable value , final int save time ) { put ( key , value , save time , get default cache disk utils ( ) ) ; }


kill an application identified by given id

public abstract void kill application ( application id application id , string diagnostics ) throws yarn exception , i o exception ;


sets the ( new ) value of the { @ code range } header

public void set range ( list < http range > ranges ) { string value = http range to string ( ranges ) ; set ( range , value ) ; }


resolve the given location against the given resource loader if this implementation ' s protocol matches

resource resolve ( string location , resource loader resource loader ) ;


get the corresponding table name of current model

protected string get table name ( ) { return base utility change case ( d b utility get table name by class name ( get class name ( ) ) ) ; }


public long get pid ( ) { return pid ; }


reads < tt > infile < tt > and encodes it to < tt > outfile < tt >

public static void encode file to file ( string infile , string outfile ) throws java io i o exception { string encoded = base 6 4 encode from file ( infile ) ; java io output stream out = null ; try { out = new java io buffered output stream ( new java io file output stream ( outfile ) ) ; out write ( encoded get bytes ( " us - ascii " ) ) ; / / strict , 7 - bit output } / / end try catch ( java io i o exception e ) { throw e ; / / catch and release to execute finally { } } / / end catch finally { try { out close ( ) ; } catch ( exception ex ) { } } / / end finally }


public double get double ( ) { return double ; }


get the value of the latest ( current ) bucket in the rolling counter for the given { @ link hystrix rolling number event } type the { @ link hystrix rolling number event } must be a " counter " type < code > hystrix rolling number event is counter ( ) = = true < code >

public long get value of latest bucket ( hystrix rolling number event type ) { bucket last bucket = get current bucket ( ) ; if ( last bucket = = null ) return 0 ; / / we have bucket data so we ' ll return the last bucket return last bucket get ( type ) ; }


post pet { pet id } upload image : uploads an image

com netflix hystrix hystrix command < response entity < model api response > > upload file ( @ api param ( value = " id of pet to update " , required = true ) @ path variable ( " pet id " ) long pet id , @ api param ( value = " additional data to pass to server " ) @ request param ( value = " additional metadata " , required = false ) string additional metadata , @ api param ( value = " file to upload " ) @ request param ( " file " ) multipart file file ) ;


checks if the configuration fragment may be accessed ( i e , if it ' s declared ) in the specified configuration ( target or host ) note that , currently , all native fragments are included regardless of whether they were specified in the same configuration that was passed

public boolean is legal configuration fragment ( class < ? > configuration fragment , configuration transition config ) { return required configuration fragments contains value ( configuration fragment ) | | has legal fragment name ( configuration fragment , config ) ; }


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

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


performs routine cleanup following a read normally cleanup happens during writes if cleanup is not observed after a sufficient number of reads , try cleaning up from the read thread

void post read cleanup ( ) { if ( ( read count increment and get ( ) & drain threshold ) = = 0 ) { clean up ( ) ; } }


reject the given field with the given error code and error arguments if the value is empty an ' empty ' value in this context means either { @ code null } or the empty string " " the object whose field is being validated does not need to be passed in because the { @ link errors } instance can resolve field values by itself ( it will usually hold an internal reference to the target object )

public static void reject if empty ( errors errors , string field , string error code , object [ ] error args ) { reject if empty ( errors , field , error code , error args , null ) ; }


parse a number that optionally has a postfix that denotes a base

private static long parse human long ( string str ) { char tail = str char at ( str length ( ) - 1 ) ; long base = 1 ; switch ( tail ) { case ' t ' : base * = 1000 * 1000 * 1000 * 1000 ; break ; case ' b ' : base * = 1000 * 1000 * 1000 ; break ; case ' m ' : base * = 1000 * 1000 ; break ; case ' k ' : base * = 1000 ; break ; default : } if ( base ! = 1 ) { str = str substring ( 0 , str length ( ) - 1 ) ; } return long parse long ( str ) * base ; }


precondition check for add rule we must maintain these invariants of the package : each name refers to at most one target no rule with errors is inserted into the package the generating rule of every output file in the package must itself be in the package

private void check for conflicts ( rule rule ) throws name conflict exception { string name = rule get name ( ) ; target existing = targets get ( name ) ; if ( existing ! = null ) { throw name conflict ( rule , existing ) ; } map < string , output file > output files = new hash map < > ( ) ; for ( output file output file : rule get output files ( ) ) { string output file name = output file get name ( ) ; if ( output files put ( output file name , output file ) ! = null ) { / / dups within a single rule : throw duplicate output file ( output file , output file ) ; } existing = targets get ( output file name ) ; if ( existing ! = null ) { throw duplicate output file ( output file , existing ) ; } / / check if this output file is the prefix of an already existing one if ( output file prefixes contains key ( output file name ) ) { throw conflicting output file ( output file , output file prefixes get ( output file name ) ) ; } / / check if a prefix of this output file matches an already existing one path fragment output file fragment = path fragment create ( output file name ) ; int segment count = output file fragment segment count ( ) ; for ( int i = 1 ; i < segment count ; i + + ) { string prefix = output file fragment sub fragment ( 0 , i ) to string ( ) ; if ( output files contains key ( prefix ) ) { throw conflicting output file ( output file , output files get ( prefix ) ) ; } if ( targets contains key ( prefix ) & & targets get ( prefix ) instanceof output file ) { throw conflicting output file ( output file , ( output file ) targets get ( prefix ) ) ; } output file prefixes put if absent ( prefix , output file ) ; } } check for input output conflicts ( rule , output files key set ( ) ) ; }


returns the number of audio frames trimmed since the last call to { @ link # reset trimmed frame count ( ) }

public long get trimmed frame count ( ) { return trimmed frame count ; }


returns a resolved list of the call ' s argument types it also includes a type for every argument in a vararg function call

list < data type > get argument data types ( ) ;


sets the name of the contract instance the name is only used to describe the contract instance in logging output and graphical representations

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


subqueue metrics might be a little out of date because fair shares are recalculated at the update interval , but the root queue metrics needs to be updated synchronously with allocations and completions so that cluster metrics will be consistent

private void update root queue metrics ( ) { root metrics set available resources to queue ( resources subtract ( get cluster resource ( ) , root metrics get allocated resources ( ) ) ) ; }


returns the default equivalence strategy used to compare and hash keys or values referenced at this strength this strategy will be used unless the user explicitly specifies an alternate strategy

abstract equivalence < object > default equivalence ( ) ;


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


the time of the latest sparse bucket seen

public date get latest sparse bucket time stamp ( ) { return latest sparse bucket time stamp ; }


public period set ( @ nullable object id , @ nullable object uid , int window index , long duration us , long position in window us ) { return set ( id , uid , window index , duration us , position in window us , ad playback state none ) ; }


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

public byte [ ] read next byte array ( int n elements , byte min clamp , byte max clamp , byte exceptions ) throws i o exception { byte [ ] b = read byte array ( current index , n elements , min clamp , max clamp , exceptions ) ; current index + = ( sizeof byte * n elements ) ; return b ; }


sets the < code > name < code > property

public void set name ( integer name ) { this name = name ; }


public void rember i service connection ( i binder i service connection , intent intent ) { synchronized ( this m bound services ) { m bound services put ( i service connection , intent ) ; } }


public array < k > to array ( array < k > array ) { while ( has next ) array add ( next ( ) ) ; return array ; }


read encrypted private key file content with provided < code > pass phrase < code >

public static private key read encrypted private key ( byte [ ] file contents , char [ ] pass phrase , boolean pre v 4 ) { byte [ ] key bytes = pre v 4 ? decrypt v 3 format ( file contents ) : decrypt ( file contents , pass phrase ) ; p k c s 8 encoded key spec private key spec = new p k c s 8 encoded key spec ( key bytes ) ; try { return key factory get instance ( key algorithm ) generate private ( private key spec ) ; } catch ( no such algorithm exception | invalid key spec exception e ) { throw new illegal state exception ( e ) ; } }


get the leader epoch for the record if available

public optional < integer > leader epoch ( ) { return leader epoch ; }


return the username to specify on the stub

public string get username ( ) { return this username ; }


join a list of strings with the given separator

public static string join ( collection < string > list , string separator ) { iterator < string > iterator = list iterator ( ) ; string builder out = new string builder ( ) ; if ( iterator has next ( ) ) { out append ( iterator next ( ) ) ; } while ( iterator has next ( ) ) { out append ( separator ) append ( iterator next ( ) ) ; } return out to string ( ) ; }


returns the index of the first bit that is set to false that occurs on or after the specified starting index

public int next clear bit ( int from index ) { long [ ] bits = this bits ; int word = from index > > > 6 ; int bits length = bits length ; if ( word > = bits length ) return bits length < < 6 ; long bits at word = bits [ word ] ; for ( int i = from index & 0x 3f ; i < 64 ; i + + ) { if ( ( bits at word & ( 1l < < ( i & 0x 3 f ) ) ) = = 0l ) { return ( word < < 6 ) + i ; } } for ( word + + ; word < bits length ; word + + ) { if ( word = = 0 ) { return word < < 6 ; } bits at word = bits [ word ] ; for ( int i = 0 ; i < 64 ; i + + ) { if ( ( bits at word & ( 1l < < ( i & 0x 3 f ) ) ) = = 0l ) { return ( word < < 6 ) + i ; } } } return bits length < < 6 ; }


private static void set value ( postcard postcard , integer type def , string key , string value ) { if ( text utils is empty ( key ) | | text utils is empty ( value ) ) { return ; } try { if ( null ! = type def ) { if ( type def = = type kind boolean ordinal ( ) ) { postcard with boolean ( key , boolean parse boolean ( value ) ) ; } else if ( type def = = type kind byte ordinal ( ) ) { postcard with byte ( key , byte parse byte ( value ) ) ; } else if ( type def = = type kind short ordinal ( ) ) { postcard with short ( key , short parse short ( value ) ) ; } else if ( type def = = type kind int ordinal ( ) ) { postcard with int ( key , integer parse int ( value ) ) ; } else if ( type def = = type kind long ordinal ( ) ) { postcard with long ( key , long parse long ( value ) ) ; } else if ( type def = = type kind float ordinal ( ) ) { postcard with float ( key , float parse float ( value ) ) ; } else if ( type def = = type kind double ordinal ( ) ) { postcard with double ( key , double parse double ( value ) ) ; } else if ( type def = = type kind string ordinal ( ) ) { postcard with string ( key , value ) ; } else if ( type def = = type kind parcelable ordinal ( ) ) { / / todo : how to description parcelable value with string ? } else if ( type def = = type kind object ordinal ( ) ) { postcard with string ( key , value ) ; } else { / / compatible compiler sdk 1 0 3 , in that version , the string type = 18 postcard with string ( key , value ) ; } } else { postcard with string ( key , value ) ; } } catch ( throwable ex ) { logger warning ( consts tag , " logistics center set value failed ! " + ex get message ( ) ) ; } }


public void test default schedule mode ( ) { stream execution environment env = stream execution environment get execution environment ( ) ; / / use eager schedule mode by default stream graph stream graph = new stream graph generator ( collections empty list ( ) , env get config ( ) , env get checkpoint config ( ) ) generate ( ) ; job graph job graph = streaming job graph generator create job graph ( stream graph ) ; assert equals ( schedule mode eager , job graph get schedule mode ( ) ) ; }


retrieve the given column as character stream from the given result set might simply invoke { @ code result set get character stream } or work with { @ code sqlxml } or database - specific classes depending on the database and driver

reader get xml as character stream ( result set rs , int column index ) throws s q l exception ;


builds a { @ link cors config } with settings specified by previous method calls

public cors config build ( ) { if ( preflight headers is empty ( ) & & ! no preflight headers ) { preflight headers put ( http header names date , date value generator instance ) ; preflight headers put ( http header names content length , new constant value generator ( " 0 " ) ) ; } return new cors config ( this ) ; }


sets the specified side of this cubemap to the specified { @ link pixmap } , overwriting any previous data set to that side note that you need to reload through { @ link cubemap # load ( cubemap data ) } any cubemap using this data for the change to be taken in account

public void load ( cubemap side side , pixmap pixmap ) { data [ side index ] = pixmap = = null ? null : new pixmap texture data ( pixmap , null , false , false ) ; }


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


sets the minimum frame that the animation will start from when playing or looping

public void set min frame ( final int min frame ) { if ( composition = = null ) { lazy composition tasks add ( new lazy composition task ( ) { @ override public void run ( lottie composition composition ) { set min frame ( min frame ) ; } } ) ; return ; } animator set min frame ( min frame ) ; }


given a grammar type , what should be the default action scope ? if i say @ members in a combined grammar , for example , the default scope should be " parser "

public string get default action scope ( ) { switch ( get type ( ) ) { case a n t l r parser lexer : return " lexer " ; case a n t l r parser parser : case a n t l r parser combined : return " parser " ; } return null ; }


sets the title for the left side ' s listing

public void set left title ( string left title ) { this left title = left title ; set title ( title panels [ left ] , left title prefix , left title ) ; }


verifies that the file is a valid snapshot snapshot may be invalid if it ' s incomplete as in a situation when the server dies while in the process of storing a snapshot any files that are improperly formated or corrupted are invalid any file that is not a snapshot is also an invalid snapshot

public static boolean is valid snapshot ( file file ) throws i o exception { if ( file = = null | | util get zxid from name ( file get name ( ) , file snap snapshot file prefix ) = = - 1 ) { return false ; } boolean is valid = false ; switch ( get stream mode ( file get name ( ) ) ) { case gzip : is valid = is valid g zip stream ( file ) ; break ; case snappy : is valid = is valid snappy stream ( file ) ; break ; case checked : default : is valid = is valid checked stream ( file ) ; } return is valid ; }


public int execute update ( string sql , int auto generated keys ) throws s q l exception { return 0 ; }


boolean remove ( short offset ) { if ( key set instanceof full key set ) { key set = new bit tree ( ( short ) ( page size - 1 ) , true ) ; } boolean result = key set remove ( offset ) ; if ( key set size ( ) = = 0 ) { key set = new red black key set ( ( short ) ( page size - 1 ) ) ; } int row = get row ( offset , false ) ; if ( row > = 0 ) { table remove row ( row ) ; } if ( ( key set size ( ) < switch size / 2 ) & & ( indexer = = null ) ) { data table new table = new data table ( ) ; indexer = new short key indexer ( ) ; short old key = key set get first ( ) ; while ( old key ! = - 1 ) { int new row = indexer put ( old key ) ; table copy row to ( old key , new table , new row ) ; old key = key set get next ( old key ) ; } table = new table ; } return result ; }


return the { @ code file type map } used by this mime message helper

public file type map get file type map ( ) { return this file type map ; }


validates the implementation of seekable seek , seekable get pos , and input stream available

public void test 0311 seek and available and position v 1 ( ) throws exception { validate seek and available and position ( account using input stream v 1 get file system ( ) ) ; }


formats an { @ code int } as a 4 - byte unsigned hex value

public static string u 4 ( int v ) { char [ ] result = new char [ 8 ] ; for ( int i = 0 ; i < 8 ; i + + ) { result [ 7 - i ] = character for digit ( v & 0x 0f , 16 ) ; v > > = 4 ; } return new string ( result ) ; }


any comments associated with the enum or flag < code > optional string comment = 2 ; < code >

private void set comment bytes ( com google protobuf byte string value ) { if ( value = = null ) { throw new null pointer exception ( ) ; } bit field 0 | = 0x 0 0 0 0 0 0 0 2 ; comment = value to string utf 8 ( ) ; }


{ @ code generic groovy xml web context loader } supports both groovy and xml resource types for detection of defaults consequently , this method is not supported

protected string get resource suffix ( ) { throw new unsupported operation exception ( " generic groovy xml web context loader does not support the get resource suffix ( ) method " ) ; }


adds a given line number to the line number table attribute

public void add line number info ( line number info line number info ) { int line number table length = target line number table attribute u 2line number table length ; line number info [ ] line number table = target line number table attribute line number table ; / / make sure there is enough space for the new line number info if ( line number table length < = line number table length ) { target line number table attribute line number table = new line number info [ line number table length + 1 ] ; system arraycopy ( line number table , 0 , target line number table attribute line number table , 0 , line number table length ) ; line number table = target line number table attribute line number table ; } / / add the line number info line number table [ target line number table attribute u 2line number table length + + ] = line number info ; }


verify whether or not the original object was sufficiently serializeddeserialized typically this will be some sort of assertion

void verify deserialized ( t original , t deserialized ) throws exception ;


public abstract row map ( row row ) throws exception ;


specify a database catalog to be applied to each connection

public void set catalog ( @ nullable string catalog ) { this catalog = catalog ; }


check that we log a deprecation warning for " n gram " and " edge n gram " tokenizer names with 7 6 and disallow usages for indices created after 8 0

public void test n gram tokenizer deprecation ( ) throws i o exception { / / tests for prebuilt tokenizer do test prebuilt tokenizer deprecation ( " n gram " , " ngram " , version utils random version between ( random ( ) , version v 7 0 0 , version v 7 5 2 ) , false ) ; do test prebuilt tokenizer deprecation ( " edge n gram " , " edge ngram " , version utils random version between ( random ( ) , version v 7 0 0 , version v 7 5 2 ) , false ) ; do test prebuilt tokenizer deprecation ( " n gram " , " ngram " , version utils random version between ( random ( ) , version v 7 6 0 , version max ( version v 7 6 0 , version utils get previous version ( version v 8 0 0 ) ) ) , true ) ; do test prebuilt tokenizer deprecation ( " edge n gram " , " edge ngram " , version utils random version between ( random ( ) , version v 7 6 0 , version max ( version v 7 6 0 , version utils get previous version ( version v 8 0 0 ) ) ) , true ) ; expect throws ( illegal argument exception class , ( ) - > do test prebuilt tokenizer deprecation ( " n gram " , " ngram " , version utils random version between ( random ( ) , version v 8 0 0 , version current ) , true ) ) ; expect throws ( illegal argument exception class , ( ) - > do test prebuilt tokenizer deprecation ( " edge n gram " , " edge ngram " , version utils random version between ( random ( ) , version v 8 0 0 , version current ) , true ) ) ; / / same batch of tests for custom tokenizer definition in the settings do test custom tokenizer deprecation ( " n gram " , " ngram " , version utils random version between ( random ( ) , version v 7 0 0 , version v 7 5 2 ) , false ) ; do test custom tokenizer deprecation ( " edge n gram " , " edge ngram " , version utils random version between ( random ( ) , version v 7 0 0 , version v 7 5 2 ) , false ) ; do test custom tokenizer deprecation ( " n gram " , " ngram " , version utils random version between ( random ( ) , version v 7 6 0 , version max ( version v 7 6 0 , version utils get previous version ( version v 8 0 0 ) ) ) , true ) ; do test custom tokenizer deprecation ( " edge n gram " , " edge ngram " , version utils random version between ( random ( ) , version v 7 6 0 , version max ( version v 7 6 0 , version utils get previous version ( version v 8 0 0 ) ) ) , true ) ; expect throws ( illegal argument exception class , ( ) - > do test custom tokenizer deprecation ( " n gram " , " ngram " , version utils random version between ( random ( ) , version v 8 0 0 , version current ) , true ) ) ; expect throws ( illegal argument exception class , ( ) - > do test custom tokenizer deprecation ( " edge n gram " , " edge ngram " , version utils random version between ( random ( ) , version v 8 0 0 , version current ) , true ) ) ; }


get the corresponding file type enum by file extension or file type if not found file type enum text is returned

public static file type enum get file type enum by file extension or file type ( string ext or file type ) { if ( string utils is not blank ( ext or file type ) ) { string upper ext name = ext or file type trim ( ) to upper case ( ) ; for ( file type enum value : values ) { if ( value name ( ) equals ( upper ext name ) ) { return value ; } } } return file type enum text ; }


sets the configuration properties from the specified { @ link map }

boolean set options ( map < channel option < ? > , ? > options ) ;


get storeinventory : returns pet inventories by status returns a map of status codes to quantities

default completable future < response entity < map < string , integer > > > get inventory ( ) { return completable future completed future ( new response entity < > ( http status not implemented ) ) ; }


public int get file subtype ( ) { return file subtype ; }


creates a new setting instance with a string value

public static setting < string > simple string ( string key , string default value , property properties ) { return new setting < > ( key , s - > default value , function identity ( ) , properties ) ; }


public model snapshot get model ( ) { return model ; }


sets the value of " exclude interim " when { @ code true } , interim influencers will be filtered out

public void set exclude interim ( boolean exclude interim ) { this exclude interim = exclude interim ; }


returns true if the given class symbol corresponds to one of the sources being compiled

private static boolean have source for symbol ( class symbol class symbol ) { if ( class symbol sourcefile = = null ) { return false ; } try { / / the classreader uses metadata to populate the symbol ' s sourcefile with a fake file object / / call get last modified ( ) to check if it ' s a real file : class symbol sourcefile get last modified ( ) ; } catch ( unsupported operation exception e ) { return false ; } return true ; }


when { @ link # should invoke ( object ) } returns true , it will return false until this duration expires

public builder ttl ( long ttl , time unit ttl unit ) { if ( ttl unit = = null ) throw new null pointer exception ( " ttl unit = = null " ) ; this ttl = ttl ; this ttl unit = ttl unit ; return this ; }


injects the static fields of the classes listed in the object graph ' s { @ code static injections } property

public abstract void inject statics ( ) ;


adds the given raw sql string to the order by section do not use this for standard properties : order asc and order desc are preferred

public query builder < t > order raw ( string raw order ) { check order builder ( ) ; order builder append ( raw order ) ; return this ; }


the set of attribute declarations < code > repeated aapt pb styleable entry entry = 1 ; < code >

public com android aapt resources styleable entry get entry ( int index ) { return entry get ( index ) ; }


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

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


sets the output stream to use for writing until this writer is closed for example : [ code ] writer writer = new u t f 8 stream writer ( ) set output stream ( out ) ; [ code ] is equivalent but writes faster than [ code ] writer writer = new java io output stream writer ( out , " utf - 8 " ) ; [ code ]

public u t f 8 stream writer set output ( output stream out ) { if ( output stream ! = null ) throw new illegal state exception ( " writer not closed or reset " ) ; output stream = out ; return this ; }


called when a new type is encountered or if cached type does not match in that case we revert to a generic , but slower operator handling

object fallback ( object [ ] args ) throws throwable { if ( initialized ) { / / caching defeated method handle generic = lookup generic ( ) ; set target ( generic as type ( type ( ) ) ) ; return generic invoke with arguments ( args ) ; } final method type type = type ( ) ; method handle target = lookup ( args ) ; / / for math operators : wrong method type can be confusing convert into a class cast exception if they screw up try { target = target as type ( type ) ; } catch ( wrong method type exception e ) { exception exc = new class cast exception ( " cannot cast from : " + target type ( ) return type ( ) + " to " + type return type ( ) ) ; exc init cause ( e ) ; throw exc ; } final method handle test ; if ( flavor = = binary operator | | flavor = = shift operator ) { / / some binary operators support nulls , we handle them separate class < ? > clazz 0 = args [ 0 ] = = null ? null : args [ 0 ] get class ( ) ; class < ? > clazz 1 = args [ 1 ] = = null ? null : args [ 1 ] get class ( ) ; if ( type parameter type ( 1 ) ! = object class ) { / / case 1 : only the receiver is unknown , just check that method handle unary test = check lhs bind to ( clazz 0 ) ; test = unary test as type ( unary test type ( ) change parameter type ( 0 , type parameter type ( 0 ) ) ) ; } else if ( type parameter type ( 0 ) ! = object class ) { / / case 2 : only the argument is unknown , just check that method handle unary test = check rhs bind to ( clazz 0 ) bind to ( clazz 1 ) ; test = unary test as type ( unary test type ( ) change parameter type ( 0 , type parameter type ( 0 ) ) change parameter type ( 1 , type parameter type ( 1 ) ) ) ; } else { / / case 3 : check both receiver and argument method handle binary test = check both bind to ( clazz 0 ) bind to ( clazz 1 ) ; test = binary test as type ( binary test type ( ) change parameter type ( 0 , type parameter type ( 0 ) ) change parameter type ( 1 , type parameter type ( 1 ) ) ) ; } } else { / / unary operator method handle receiver test = check lhs bind to ( args [ 0 ] get class ( ) ) ; test = receiver test as type ( receiver test type ( ) change parameter type ( 0 , type parameter type ( 0 ) ) ) ; } method handle guard = method handles guard with test ( test , target , get target ( ) ) ; / / very special cases , where even the receiver can be null ( see jls rules for string concat ) / / we wrap + with an npe catcher , and use our generic method in that case if ( flavor = = binary operator & & ( flags & operator allows null ) ! = 0 ) { method handle handler = method handles drop arguments ( lookup generic ( ) as type ( type ( ) ) , 0 , null pointer exception class ) ; guard = method handles catch exception ( guard , null pointer exception class , handler ) ; } initialized = true ; set target ( guard ) ; return target invoke with arguments ( args ) ; }


required : a list of server specifications < code > repeated istio networking v 1alpha 3 server servers = 1 ; < code >

public com alibaba nacos istio model server builder add servers builder ( ) { return get servers field builder ( ) add builder ( com alibaba nacos istio model server get default instance ( ) ) ; }


public id to digest id ( string digest ) { return new id ( scheme digest , digest ) ; }


equivalent to calling < code > assert that ( value get ( ) ) is equal to ( value ) < code >

public state value assert < t > value equal to ( t value ) { java 6 assertions assert that ( actual get ( ) ) overriding error message ( " expected state value to equal to < % s > , but was < % s > " , value , actual get ( ) ) is equal to ( value ) ; return this ; }


return whether this code unit info has symbols to copy

public boolean has symbols ( ) { return primary symbol name ! = null | | function scope symbol names length ! = 0 | | other symbol names length ! = 0 ; }


ray - cast the world for all particles in the path of the ray your callback controls whether you get the closest point , any point , or n - points

public void raycast ( particle raycast callback particle callback , vec 2 point 1 , vec 2 point 2 ) { m particle system raycast ( particle callback , point 1 , point 2 ) ; }


must be called by all methods which access fields to ensure that the data has been uncompressed

protected void ensure inflated ( ) { if ( compressed ! = null ) { try { byte array input stream deflated = new byte array input stream ( compressed ) ; data input inflater = new data input stream ( new inflater input stream ( deflated ) ) ; read fields compressed ( inflater ) ; compressed = null ; } catch ( i o exception e ) { throw new runtime exception ( e ) ; } } }


determines timestamps of files to be cached , and stores those in the configuration determines the visibilities of the distributed cache files and archives the visibility of a cache path is " public " if the leaf component has read permissions for others , and the parent subdirs have execute permissions for others this is an internal method !

public static void determine timestamps and cache visibilities ( configuration job ) throws i o exception { map < uri , file status > stat cache = new hash map < uri , file status > ( ) ; determine timestamps and cache visibilities ( job , stat cache ) ; }


returns a list of u r ls to each registered command

private list < string > command links ( ) { return commands get primary names ( ) stream ( ) sorted ( ) map ( command - > string format ( " < a href = \ " % s \ " > % s < / a > " , command url + " / " + command , command ) ) collect ( collectors to list ( ) ) ; }


returns the fraction of c p us that should be used for yarn containers the number is derived based on various configuration params such as yarn configuration nm resource percentage physical cpu limit

public static float get containers c p us ( resource calculator plugin plugin , configuration conf ) { int num processors = get node c p us ( plugin , conf ) ; int node cpu percentage = get node cpu percentage ( conf ) ; return ( node cpu percentage * num processors ) / 100 0f ; }


creates a mock generic drawee hierarchy builder with stubbed build

public static generic drawee hierarchy builder mock builder of ( generic drawee hierarchy drawable hierarchies ) { generic drawee hierarchy builder builder = mock ( generic drawee hierarchy builder class , calls real methods ) ; final supplier < generic drawee hierarchy > gdh provider = supplier of ( drawable hierarchies ) ; do answer ( new answer ( ) { @ override public object answer ( invocation on mock invocation ) throws throwable { return gdh provider get ( ) ; } } ) when ( builder ) build ( ) ; return builder ; }


should use the default temp dir when the client env doesn ' t define tmpdir

public void test rewrite env with default tmpdir ( ) throws exception { posix local env provider p = new posix local env provider ( immutable map < string , string > of ( ) ) ; assert that ( rewrite env ( p , immutable map of ( " key 1 " , " value 1 " ) ) ) is equal to ( immutable map of ( " key 1 " , " value 1 " , " tmpdir " , " / tmp " ) ) ; assert that ( rewrite env ( p , immutable map of ( " key 1 " , " value 1 " , " tmpdir " , " ignored " ) ) ) is equal to ( immutable map of ( " key 1 " , " value 1 " , " tmpdir " , " / tmp " ) ) ; }


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


formats a network address for display purposes this formats only the address , any hostname information , if present , is ignored i pv 6 addresses are compressed and without scope identifiers example output with just an address : i pv 4 : { @ code 127 0 0 1 } i pv 6 : { @ code : : 1 }

public static string format ( inet address address ) { return format ( address , new ports range ( " " ) ) ; }


{ @ code previous checkpoint } is a directory , which holds the previous ( before the last save ) state of the storage directory the directory is created as a reference only , it does not play role in state recovery procedures , and is recycled automatically , but it may be useful for manual recovery of a stale state of the system

public file get previous checkpoint ( ) { if ( root = = null ) { return null ; } return new file ( root , storage previous ckpt ) ; }


private void copy table ( table old table , packed d b handle new handle ) throws i o exception , cancelled exception { / / pull out table configuration elements string table name = old table get name ( ) ; / / name schema schema = old table get schema ( ) ; / / schema int [ ] indexed columns = old table get indexed columns ( ) ; / / secondardy indices table new table = new handle create table ( table name , schema , indexed columns ) ; / / create new table monitor set message ( " copying table : " + table name ) ; monitor set maximum ( old table get record count ( ) ) ; monitor set progress ( 0 ) ; record iterator iterator = old table iterator ( ) ; while ( iterator has next ( ) ) { / / iterate through old records d b record record = iterator next ( ) ; new table put record ( record ) ; / / copy as is into new table monitor check canceled ( ) ; monitor increment progress ( 1 ) ; } }


gets whether the progress bar should be hidden when the progress is 0

public boolean get hide when zero ( ) { return m hide when zero ; }


public boolean retry offer ( runnable o , long timeout , time unit unit ) throws interrupted exception { if ( executor is shutdown ( ) ) { throw new rejected execution exception ( " executor is shutdown ! " ) ; } return super offer ( o , timeout , unit ) ; }


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

public boolean is set execute ms avg ( ) { return this execute ms avg ! = null ; }


set the working directory to the given directory

public void set working directory ( path new dir ) { working dir = make absolute ( new dir ) ; check path ( working dir ) ; }


returns the number of bytes in the file to process

public long get length ( ) { return length ; }


ensure api - docs json includes sample and spec files into markup

public void test sample asciidoc markup generation from json with includes ( ) { / / include correct markup from separate directories , relative links assert assert true ( markup content contains ( " include : : { spec dir } rest / project / get / spec adoc [ " ) , " expected project spec adoc to be included in " + markup file name ) ; assert assert true ( markup content contains ( " include : : { spec dir } rest / project / get / implementation adoc [ " ) , " expected project implementation adoc to be included in " + markup file name ) ; assert assert true ( markup content contains ( " include : : { snippet dir } rest / project / get / http - request adoc [ " ) , " expected project http - request adoc to be included in " + markup file name ) ; assert assert true ( markup content contains ( " include : : { snippet dir } rest / project / get / http - response adoc [ " ) , " expected project http - response adoc to be included in " + markup file name ) ; assert assert true ( markup content contains ( " link : rest / project / get / get json [ " ) , " expected link : not found in file : " + markup file name ) ; }


public boolean get prefix ns boolean ( ) { return prefix ns boolean ; }


reload the watcher service , does not switch the state from stopped to started , just keep going

void reload ( cluster state state , string reason ) { / / this method contains the only async code block , being called by the cluster state listener / / the reason for this is , that loading he watches is done in a sync manner and thus cannot be done on the cluster state listener / / thread / / / / this method itself is called by the cluster state listener , so will never be called in parallel / / setting the cluster state version allows us to know if the async method has been overtaken by another async method / / this is unlikely , but can happen , if the thread pool schedules two of those runnables at the same time / / by checking the cluster state version before and after loading the watches we can potentially just exit without applying the / / changes processed cluster state version set ( state get version ( ) ) ; trigger service pause execution ( ) ; int cancelled task count = execution service clear executions and queue ( ( ) - > { } ) ; logger info ( " reloading watcher , reason [ { } ] , cancelled [ { } ] queued tasks " , reason , cancelled task count ) ; executor execute ( wrap watcher service ( ( ) - > reload inner ( state , reason , false ) , e - > logger error ( " error reloading watcher " , e ) ) ) ; }


wait for < code > check < code > to return true for each < code > check every millis < code > ms see also { @ link # wait for ( java util function supplier , int , int ) }

public void wait for ( supplier < boolean > check , int check every millis ) throws interrupted exception { wait for ( check , check every millis , 1 ) ; }


public api response < model api response > upload file with http info ( long pet id , string additional metadata , file file ) throws api exception { okhttp 3 call local var call = upload file validate before call ( pet id , additional metadata , file , null ) ; type local var return type = new type token < model api response > ( ) { } get type ( ) ; return local var api client execute ( local var call , local var return type ) ; }


public list < sequence > get sequences ( ) { return sequences ; }


sets the order of this template if more than one template matches

public put index template request builder set order ( int order ) { request order ( order ) ; return this ; }


get the machine nodes that belong to the rack

public set < machine node > get machines in rack ( ) { return ( set < machine node > ) ( set ) get children ( ) ; }


validate that the provided privilege name is valid , and throws an exception otherwise

public static void validate privilege name ( string name ) { if ( is valid privilege name ( name ) = = false ) { throw new illegal argument exception ( " application privilege names must match the pattern " + valid name pattern ( ) + " ( found ' " + name + " ' ) " ) ; } }


returns the number of linked list being managed

public int get num lists ( ) { return num lists ; }


add a fragment of a class string , like " exception " or " java lang exc " , to identify a parameter type

public void add type identifier ( string identifier ) { this type identifiers add ( identifier ) ; }


test the property ' sc a e t h flow points '

public void sc a e t h flow points test ( ) { / / todo : test sc a e t h flow points }


sets the restart strategy configuration the configuration specifies which restart strategy will be used for the execution graph in case of a restart

public void set restart strategy ( restart strategies restart strategy configuration restart strategy configuration ) { config set restart strategy ( restart strategy configuration ) ; }


collects transitive source jars for the current rule

public nested set < artifact > collect transitive source jars ( iterable < artifact > target src jars ) { nested set builder < artifact > builder = nested set builder < artifact > stable order ( ) add all ( target src jars ) ; for ( java source jars provider source jars provider : java info get providers from list of targets ( java source jars provider class , get dependencies ( ) ) ) { builder add transitive ( source jars provider get transitive source jars ( ) ) ; } return builder build ( ) ; }


public record create copy ( ) { final record rec = new record ( ) ; copy to ( rec ) ; return rec ; }


return true if the path was successfully renamed false if it failed with access control exception any other exceptions are propagated to the caller

private boolean rename path ( file system fs , path src path , path dst path ) throws i o exception { try { fs rename ( src path , dst path ) ; return true ; } catch ( access control exception ace ) { return false ; } }


public synchronized void update retention leases on replica ( final retention leases retention leases ) { assert primary mode = = false ; if ( retention leases supersedes ( this retention leases ) ) { this retention leases = retention leases ; } }


private void test serialize deserialize ( object codecs codecs ) throws exception { stopwatch timer = stopwatch create started ( ) ; int total bytes = 0 ; for ( int i = 0 ; i < repetitions ; + + i ) { for ( object subject : subjects ) { byte string serialized = serialize ( subject , codecs ) ; total bytes + = serialized size ( ) ; object deserialized = deserialize ( serialized , codecs ) ; verification function verify deserialized ( subject , deserialized ) ; } } logger at info ( ) log ( " % s total serialized bytes = % d , % s " , subjects get ( 0 ) get class ( ) get simple name ( ) , total bytes , timer ) ; }


public file get file ( string name , file default value ) { return get as type ( name , default value , file class ) ; }


obtain the session factory for actual use

protected final session factory obtain session factory ( ) { session factory session factory = get session factory ( ) ; assert state ( session factory ! = null , " no session factory set " ) ; return session factory ; }


asserts the value of the fs permission bits on the inode of the test path

private static void assert permission ( short perm , path path to check ) throws exception { acl test helpers assert permission ( hdfs , path to check , perm ) ; }


get the web exchange that this request is based on note : manipulating the exchange directly ( instead of using the methods provided on { @ code server request } and { @ code server response } ) can lead to irregular results


sets the max width and max height to the specified value if the max size is 0 , no maximum size is used

public cell < t > max size ( float size ) { max size ( fixed value of ( size ) ) ; return this ; }


closes this builder and frees any resources

void close ( ) { if ( header block ! = null ) { header block release ( ) ; header block = null ; } / / clear the member variable pointing at this instance headers continuation = null ; }


the same as above , but use hostnames for dn < - > dn communication

public void test block meta data info with hostname ( ) throws exception { assume true ( system get property ( " os name " ) starts with ( " linux " ) ) ; check block meta data info ( true ) ; }


set the limit variable string ( e g { @ code " # { limit } " } )

public t limit ( string variable ) { sql ( ) limit = variable ; sql ( ) limiting rows strategy = s q l statement limiting rows strategy offset limit ; return get self ( ) ; }


add the given locale context resolver to this builder

builder locale context resolver ( locale context resolver locale context resolver ) ;


waits up to the specified timeout for the given { @ link predicate } to become < code > true < code > < p > the timeout time is multiplied by the { @ link # get wait for ratio ( ) }

protected long wait for ( int timeout , boolean fail if timeout , predicate predicate ) { long started = time now ( ) ; long must end = time now ( ) + ( long ) ( get wait for ratio ( ) * timeout ) ; long last echo = 0 ; try { long waiting = must end - time now ( ) ; system out println ( message format format ( " waiting up to [ { 0 } ] msec " , waiting ) ) ; boolean eval ; while ( ! ( eval = predicate evaluate ( ) ) & & time now ( ) < must end ) { if ( ( time now ( ) - last echo ) > 5000 ) { waiting = must end - time now ( ) ; system out println ( message format format ( " waiting up to [ { 0 } ] msec " , waiting ) ) ; last echo = time now ( ) ; } thread sleep ( 100 ) ; } if ( ! eval ) { if ( fail if timeout ) { fail ( message format format ( " waiting timed out after [ { 0 } ] msec " , timeout ) ) ; } else { system out println ( message format format ( " waiting timed out after [ { 0 } ] msec " , timeout ) ) ; } } return ( eval ) ? time now ( ) - started : - 1 ; } catch ( exception ex ) { throw new runtime exception ( ex ) ; } }


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


transfers this buffer ' s data to the specified destination starting at the current { @ code reader index } and increases the { @ code reader index } by the number of the transferred bytes ( = { @ code dst length } )

public abstract byte buf read bytes ( byte [ ] dst ) ;


checks whether the jvm this test is run under is affected by jdk - 8254967 , which causes these tests to fail if a t l sv 1 3 s s l context is used

private static boolean is https server broken with t l sv 1 3 ( ) { return java version current ( ) compare to ( java version parse ( " 16 0 0 " ) ) < 0 ; }


create user this can only be done by the logged in user < b > 0 < b > - successful operation

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


reducing the resources ( with a time out ) triggers a preemption message to the am right away then , increasing them again should prevent the killing when the time out would have happened

public void test reduce preempt and cancel ( ) throws exception { container container = create container ( am , 2 * gb ) ; assert memory ( scheduler , nm id , 4 * gb , 0 ) ; / / we give an overcommit time out of 1 seconds final int timeout = ( int ) time unit seconds to millis ( 1 ) ; / / reducing to 2gb should first preempt the container update node resource ( rm , nm id , 2 * gb , 2 , timeout ) ; wait memory ( scheduler , nm , 4 * gb , - 2 * gb , interval , timeout ) ; / / wait until mark container for preemption is handled rm drain events ( ) ; / / we should receive a notification to preempt the container preemption message preempt msg = am schedule ( ) get preemption message ( ) ; assert preemption ( container get id ( ) , preempt msg ) ; / / increase the resources again update node resource ( rm , nm id , 4 * gb , 2 , timeout ) ; wait memory ( scheduler , nm , 4 * gb , 0 , interval , timeout ) ; long t 0 = time now ( ) ; while ( time now ( ) - t 0 < time unit seconds to millis ( 2 ) ) { nm node heartbeat ( true ) ; allocate response allocation = am schedule ( ) ; assert no preemption ( allocation get preemption message ( ) ) ; assert true ( allocation get completed containers statuses ( ) is empty ( ) ) ; thread sleep ( interval ) ; } / / check that the containers are still running assert memory ( scheduler , nm id , 4 * gb , 0 ) ; assert equals ( 2 , scheduler get node report ( nm id ) get num containers ( ) ) ; }


returns true if the number of instructions selected is less or equal to max selection size

private boolean is selection size valid ( program selection selection ) { int num instructions in selection = get num instructions in selection ( get current program ( ) , selection ) ; return num instructions in selection < = max selection size ; }