parses an integral msft numeric type from the pdb byte reader

public void parse ( pdb byte reader reader ) throws pdb exception { sub type index = reader parse unsigned short val ( ) ; / / todo : create these as intrinsic types and do proper parsing ? switch ( sub type index ) { / / for each case , parse bytes ( to move index forward ) and throw bytes away / / the number of bytes parsed is based on the size of the integral type / / represented by sub type index case 0x 8 0 0 0 : / / char object = little endian data converter instance get big integer ( reader parse bytes ( 1 ) , 1 , true ) ; break ; case 0x 8 0 0 1 : / / short object = little endian data converter instance get big integer ( reader parse bytes ( 2 ) , 2 , true ) ; break ; case 0x 8 0 0 2 : / / unsigned short object = little endian data converter instance get big integer ( reader parse bytes ( 2 ) , 2 , false ) ; break ; case 0x 8 0 0 3 : / / 32 - bit object = little endian data converter instance get big integer ( reader parse bytes ( 4 ) , 4 , true ) ; break ; case 0x 8 0 0 4 : / / unsigned 32 - bit object = little endian data converter instance get big integer ( reader parse bytes ( 4 ) , 4 , false ) ; break ; case 0x 8 0 0 5 : / / real 3 2 object = byte buffer wrap ( reader parse bytes ( 4 ) ) get float ( ) ; break ; case 0x 8 0 0 6 : / / real 6 4 object = byte buffer wrap ( reader parse bytes ( 8 ) ) get double ( ) ; break ; case 0x 8 0 0 7 : / / real 8 0 object = new real 8 0 ( reader ) ; break ; case 0x 8 0 0 8 : / / real 1 2 8 object = new real 1 2 8 ( reader ) ; break ; case 0x 8 0 0 9 : / / 64 - bit object = little endian data converter instance get big integer ( reader parse bytes ( 8 ) , 8 , true ) ; break ; case 0x 8 0 0a : / / unsigned 64 - bit object = little endian data converter instance get big integer ( reader parse bytes ( 8 ) , 8 , false ) ; break ; case 0x 8 0 0b : / / real 4 8 object = new real 4 8 ( reader ) ; break ; case 0x 8 0 0c : / / complex 3 2 object = new complex 3 2 ( reader ) ; break ; case 0x 8 0 0d : / / complex 6 4 object = new complex 6 4 ( reader ) ; break ; case 0x 8 0 0e : / / complex 8 0 object = new complex 8 0 ( reader ) ; break ; case 0x 8 0 0f : / / complex 1 2 8 object = new complex 1 2 8 ( reader ) ; break ; case 0x 8 0 1 7 : / / 128 - bit object = little endian data converter instance get big integer ( reader parse bytes ( 16 ) , 16 , true ) ; break ; case 0x 8 0 1 8 : / / unsigned 128 - bit object = little endian data converter instance get big integer ( reader parse bytes ( 16 ) , 16 , false ) ; break ; case 0x 8 0 1 9 : / / decimal object = new decimal ( reader ) ; break ; case 0x 8 0 1a : / / date object = new date ( reader ) ; break ; case 0x 8 0 1b : / / real 1 6 object = new real 1 6 ( reader ) ; break ; default : if ( sub type index > = 0x 8 0 0 0 ) { throw new pdb exception ( string format ( " unknown numeric subtype : 0x % 0 4x " , sub type index ) ) ; } object = big integer value of ( sub type index ) ; break ; } } / / public byte [ ] get bytes ( ) { / / / / } / / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / / old code from pdb byte writer todo : evaluate to see if want to use any of it here / / ( expect that certain parts are wrong ) for outputting bytes of a numeric there were / / problems in the parse numeric ( ) code that was in the pdb byte reader / / note : as of this writing , the following code is still in the pdb byte writer as it is / / used by types test methods todo : if we get a suitable replacement here , then delete / / method in pdb byte writer and convert the tests to use this class / /


public final list < o s process > get children ( ) { list < o s process > r = new array list < > ( ) ; for ( o s process p : process tree this ) if ( p get parent ( ) = = this ) r add ( p ) ; return r ; }


get the split to put back this only happens when a source reader subtask has failed

list < split t > get and remove uncheckpointed assignment ( int subtask id , long restored checkpoint id ) { return assignment tracker get and remove uncheckpointed assignment ( subtask id , restored checkpoint id ) ; }


returns { @ code true } if { @ code n } is a < a href = " http : mathworld wolfram com prime number html " > prime number : an integer greater than one that cannot be factored into a product of smaller positive integers returns { @ code false } if { @ code n } is zero , one , or a composite number ( one which can be factored into smaller positive integers ) to test larger numbers , use { @ link long math # is prime } or { @ link big integer # is probable prime }

public static boolean is prime ( int n ) { return long math is prime ( n ) ; }


sets the uniform with the given name the { @ link shader program } must be bound for this to work

public void set uniformf ( string name , float value ) { gl20 gl = gdx gl 2 0 ; check managed ( ) ; int location = fetch uniform location ( name ) ; gl gl uniform 1f ( location , value ) ; }


test decompressing a tar gz file with hard link file and symbolic link file inside and stripping a prefix

public void test decompress with prefix ( ) throws exception { test archive descriptor archive descriptor = new test archive descriptor ( archive name , " out " , false ) ; decompressor descriptor builder descriptor builder = archive descriptor create descriptor builder ( ) set prefix ( root folder name ) ; path output dir = decompress ( descriptor builder ) ; archive descriptor assert output files ( output dir , inner folder name ) ; }


creates a contextual ( presumably stateful ) authentication policy based on provided context data

contextual authentication policy < t > create policy ( t context ) ;


verify that multiple readers can get the read lock concurrently

public void test read ( ) throws exception { var execute service = executors new fixed thread pool ( 2 ) ; var lock = new reader writer lock ( ) ; var reader 1 = spy ( new reader ( " reader 1 " , lock read lock ( ) ) ) ; var reader 2 = spy ( new reader ( " reader 2 " , lock read lock ( ) ) ) ; execute service submit ( reader 1 ) ; thread sleep ( 150 ) ; execute service submit ( reader 2 ) ; execute service shutdown ( ) ; try { execute service await termination ( 10 , time unit seconds ) ; } catch ( interrupted exception e ) { logger error ( " error waiting for executor service shutdown " , e ) ; } / / read operation will hold the read lock 250 milliseconds , so here we prove that multiple reads / / can be performed in the same time assert true ( appender log contains ( " reader 1 begin " ) ) ; assert true ( appender log contains ( " reader 2 begin " ) ) ; assert true ( appender log contains ( " reader 1 finish " ) ) ; assert true ( appender log contains ( " reader 2 finish " ) ) ; }


public double get ( long key ) throws no value exception { int index = indexer get ( key ) ; if ( index < 0 ) { throw new no value exception ( ) ; } return values [ index ] ; }


gets the { @ code settings initial window size } value if unavailable , returns { @ code null }

public integer initial window size ( ) { return get int value ( settings initial window size ) ; }


subclasses should override this method if it is interested when a program is opened this event has no affect on the " current program " a " program activated " call will occur that affects the active program

protected void program opened ( program program ) { }


void expire after access ( string key , @ nullable string value ) { require argument ( expire after access = = null , " expire after access was already set " ) ; expire after access = parse duration ( key , value ) ; }


returns the { @ linkplain # get sample elements ( ) sample elements } as ordered by { @ link test container generator # order ( list ) } tests should used this method only if they declare requirement { @ link com google common collect testing features collection feature # known order }

protected list < e > get ordered elements ( ) { list < e > list = new array list < e > ( ) ; for ( e e : get subject generator ( ) order ( new array list < e > ( get sample elements ( ) ) ) ) { list add ( e ) ; } return collections unmodifiable list ( list ) ; }


contains value returns true for held values

public void test contains value ( ) { concurrent map map = map 5 ( ) ; assert true ( map contains value ( " a " ) ) ; assert false ( map contains value ( " z " ) ) ; }


called when preparation completes called on the playback thread after invoking this method , the { @ link media period } can expect for { @ link # select tracks ( track selection [ ] , boolean [ ] , sample stream [ ] , boolean [ ] , long ) } to be called with the initial track selection

void on prepared ( media period media period ) ;


the default heuristic on whether we need to use whole - archive for the link

private static boolean need whole archive ( feature configuration feature configuration , linking mode linking mode , link target type type , collection < string > linkopts , cpp configuration cpp config ) { boolean shared linkopts = type is dynamic library ( ) | | linkopts contains ( " - shared " ) | | cpp config has shared link option ( ) ; / / fasten your seat belt , the logic below doesn ' t make perfect sense and it ' s full of obviously / / missed corner cases the world still stands and depends on this behavior , so ¯ \ ( ツ ) / ¯ if ( ! shared linkopts ) { / / we are not producing shared library , there is no reason to use - - whole - archive with / / executable ( if the executable doesn ' t use the symbols , nobody else will , so - - whole - archive / / is not needed ) return false ; } if ( cpp config remove legacy whole archive ( ) ) { / / - - incompatible remove legacy whole archive has been flipped , no - - whole - archive for the / / entire build return false ; } if ( linking mode ! = linking mode static ) { / / legacy whole archive only applies to static linking mode return false ; } if ( feature configuration get requested features ( ) contains ( cpp rule classes legacy whole archive ) ) { / / - - incompatible remove legacy whole archive has not been flipped , and this target requested / / - - whole - archive using features return true ; } if ( cpp config legacy whole archive ( ) ) { / / - - incompatible remove legacy whole archive has not been flipped , so whether to / / use - - whole - archive depends on - - legacy whole archive return true ; } / / hopefully future default return false ; }


invoke the cache operation defined by this instance wraps any exception that is thrown during the invocation in a { @ link throwable wrapper }

object invoke ( ) throws throwable wrapper ;


the program was restored from an undo redo operation so reload it

void reload program ( boolean check root ) { if ( current program = = null ) { / / can happen when the swing update manager fires after the program has been closed return ; } listing listing = current program get listing ( ) ; string [ ] tree names = listing get tree names ( ) ; for ( string element : tree names ) { program dn d tree tree = get tree ( element ) ; if ( tree ! = null ) { reload tree ( tree , check root ) ; } } }


to test class name in snake case to test class name in snake case

public client test classname ( client body ) throws api exception { api response < client > local var resp = test classname with http info ( body ) ; return local var resp get data ( ) ; }


boolean remove group ( program node node , string buffer sb ) { boolean changes made = false ; synchronized ( root ) { program node parent = ( program node ) node get parent ( ) ; if ( parent = = null ) { return false ; / / node has already been removed } program module parent module = node get parent module ( ) ; try { if ( parent module remove child ( node get name ( ) ) ) { changes made = true ; } / / domain object change listener will update the tree } catch ( not empty exception e ) { sb append ( " \ n " + node get name ( ) + " from " + parent module get name ( ) + " : not empty " ) ; } } return changes made ; }


public void add total time ( long time ) { total time add and get ( time ) ; }


public void init ( ) { for ( int i = 0 ; i < pool size ; i + + ) { byte buffer byte buffer = byte buffer allocate direct ( file size ) ; final long address = ( ( direct buffer ) byte buffer ) address ( ) ; pointer pointer = new pointer ( address ) ; lib c instance mlock ( pointer , new native long ( file size ) ) ; available buffers offer ( byte buffer ) ; } }


make a s 3 a file status object for a directory at given path the file status only contains what s3a needs , and omits mod time since s3a uses its own implementation which returns current system time

private s 3 a file status make dir status ( string dir owner , path path ) { return new s 3 a file status ( tristate unknown , path , dir owner ) ; }


a factory method for { @ link local channel } s users may override it to create custom instances of { @ link local channel } s

protected local channel new local channel ( local channel peer ) { return new local channel ( this , peer ) ; }


retrieves the version information of netty artifacts using the specified { @ link class loader }

public static map < string , version > identify ( class loader class loader ) { if ( class loader = = null ) { class loader = platform dependent get context class loader ( ) ; } / / collect all properties properties props = new properties ( ) ; try { enumeration < url > resources = class loader get resources ( " meta - inf / io netty versions properties " ) ; while ( resources has more elements ( ) ) { url url = resources next element ( ) ; input stream in = url open stream ( ) ; try { props load ( in ) ; } finally { try { in close ( ) ; } catch ( exception ignore ) { / / ignore } } } } catch ( exception ignore ) { / / not critical just ignore } / / collect all artifact ids set < string > artifact ids = new hash set < string > ( ) ; for ( object o : props key set ( ) ) { string k = ( string ) o ; int dot index = k index of ( ' ' ) ; if ( dot index < = 0 ) { continue ; } string artifact id = k substring ( 0 , dot index ) ; / / skip the entries without required information if ( ! props contains key ( artifact id + prop version ) | | ! props contains key ( artifact id + prop build date ) | | ! props contains key ( artifact id + prop commit date ) | | ! props contains key ( artifact id + prop short commit hash ) | | ! props contains key ( artifact id + prop long commit hash ) | | ! props contains key ( artifact id + prop repo status ) ) { continue ; } artifact ids add ( artifact id ) ; } map < string , version > versions = new tree map < string , version > ( ) ; for ( string artifact id : artifact ids ) { versions put ( artifact id , new version ( artifact id , props get property ( artifact id + prop version ) , parse iso 8 6 0 1 ( props get property ( artifact id + prop build date ) ) , parse iso 8 6 0 1 ( props get property ( artifact id + prop commit date ) ) , props get property ( artifact id + prop short commit hash ) , props get property ( artifact id + prop long commit hash ) , props get property ( artifact id + prop repo status ) ) ) ; } return versions ; }


post fakeouterboolean test serialization of outer boolean types

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


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


reads a count corresponding to a serialized map , multiset , or multimap it returns the size of a map serialized by { @ link # write map ( map , object output stream ) } , the number of distinct elements in a multiset serialized by { @ link # write multiset ( multiset , object output stream ) } , or the number of distinct keys in a multimap serialized by { @ link # write multimap ( multimap , object output stream ) }

static int read count ( object input stream stream ) throws i o exception { return stream read int ( ) ; }


this tests the forcing of a function to be a thunk with create thunk function cmd tests that the function start analyzer will create a thunk given the thunk tag on a matching function that the mips be language has a thunking pattern that the mips 6432 hybrid with sign extension of registers still gets found as a thunk that the thunking function can be found with out the constant reference analyzer

public void test delay mips 6 4 3 2 slot thunk ( ) throws exception { builder = new program builder ( " thunk " , program builder mips 6432 ) ; builder set bytes ( " 0x 4 6 6 0 5 0 " , " 3c 0f 00 47 8d f 9 72 24 03 20 00 08 25 f 8 72 24 " ) ; builder set bytes ( " 0x 4 7 7 2 2 4 " , " 00 47 99 c 0 " ) ; builder create empty function ( " chdir " , " 0x 4 7 9 9c 0 " , 1 , data type void ) ; builder disassemble ( " 0x 4 6 6 0 5 0 " , 27 , true ) ; builder create function ( " 0x 4 6 6 0 5 0 " ) ; program = builder get program ( ) ; analyze ( ) ; function is thunk = program get function manager ( ) get function at ( builder addr ( 0x 4 6 6 0 5 0 ) ) ; assert equals ( true , is thunk is thunk ( ) ) ; assert equals ( " chdir " , is thunk get name ( ) ) ; }


if a trial license was not started as a result of the request corresponding to this response ( see { @ link # is trial was started ( ) } then returns a brief message explaining why the trial could not be started returns false otherwise

public string get error message ( ) { return error message ; }


returns true if the query is null or it ' s a properly formatted query string

protected boolean is valid query ( string query ) { if ( query = = null ) { return true ; } return query pattern matcher ( query ) matches ( ) ; }


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


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

default void on audio input format changed ( event time event time , format format ) { }


give the blob server a choice of three ports , where two of them are allocated

public void test one port available ( ) throws i o exception { int num allocated = 2 ; server socket [ ] sockets = new server socket [ num allocated ] ; for ( int i = 0 ; i < num allocated ; i + + ) { try { sockets [ i ] = new server socket ( 0 ) ; } catch ( i o exception e ) { e print stack trace ( ) ; assert fail ( " an exception was thrown while preparing the test " + e get message ( ) ) ; } } configuration conf = new configuration ( ) ; conf set string ( blob server options port , sockets [ 0 ] get local port ( ) + " , " + sockets [ 1 ] get local port ( ) + " , 50000 - 50050 " ) ; conf set string ( blob server options storage directory , temporary folder new folder ( ) get absolute path ( ) ) ; / / this thing is going to throw an exception try { blob server server = new blob server ( conf , new void blob store ( ) ) ; server start ( ) ; assert that ( server get port ( ) , all of ( greater than or equal to ( 50000 ) , less than or equal to ( 50050 ) ) ) ; server close ( ) ; } finally { for ( int i = 0 ; i < num allocated ; + + i ) { sockets [ i ] close ( ) ; } } }


invoke the original ( super ) method on the specified object

public object invoke super ( object obj , object [ ] args ) throws throwable { try { init ( ) ; fast class info fci = fast class info ; return fci f 2 invoke ( fci i 2 , obj , args ) ; } catch ( invocation target exception e ) { throw e get target exception ( ) ; } }


verify that adding padding bytes won ' t violate boundaries or allow defined data or instructions to be overwritten

private int get valid pad length ( program program , address string end address , int pad length ) { listing listing = program get listing ( ) ; address address = string end address ; for ( int i = 0 ; i < pad length ; i + + ) { address = address next ( ) ; if ( address = = null ) { return 0 ; } code unit cu = listing get code unit containing ( address ) ; if ( cu = = null ) { return 0 ; / / null implies there cannot be data here } if ( ! ( cu instanceof data ) | | ( ( data ) cu ) is defined ( ) ) { return 0 ; } } return pad length ; }


expands all nodes under and including this node

public void expand all ( ) { set expanded ( true ) ; if ( children size > 0 ) tree expand all ( children ) ; }


specifically test interaction with a scheduler with subscribe on

public void issue 2 1 9 1 scheduler unsubscribe ( ) throws throwable { / / setup mocks consumer < integer > source next = mock ( consumer class ) ; action source completed = mock ( action class ) ; action source unsubscribed = mock ( action class ) ; final scheduler mock scheduler = mock ( scheduler class ) ; final disposable mock subscription = mock ( disposable class ) ; worker spied worker = worker spy ( mock subscription ) ; subscriber < integer > mock observer before connect = test helper mock subscriber ( ) ; subscriber < integer > mock observer after connect = test helper mock subscriber ( ) ; when ( mock scheduler create worker ( ) ) then return ( spied worker ) ; / / flowable under test connectable flowable < integer > replay = flowable just ( 1 , 2 , 3 ) do on next ( source next ) do on cancel ( source unsubscribed ) do on complete ( source completed ) subscribe on ( mock scheduler ) replay ( ) ; replay subscribe ( mock observer before connect ) ; replay subscribe ( mock observer before connect ) ; replay connect ( ) ; replay subscribe ( mock observer after connect ) ; replay subscribe ( mock observer after connect ) ; verify ( mock observer before connect , times ( 2 ) ) on subscribe ( ( subscription ) any ( ) ) ; verify ( mock observer after connect , times ( 2 ) ) on subscribe ( ( subscription ) any ( ) ) ; / / verify interactions verify ( source next , times ( 1 ) ) accept ( 1 ) ; verify ( source next , times ( 1 ) ) accept ( 2 ) ; verify ( source next , times ( 1 ) ) accept ( 3 ) ; verify ( source completed , times ( 1 ) ) run ( ) ; verify ( mock scheduler , times ( 1 ) ) create worker ( ) ; verify ( spied worker , times ( 1 ) ) schedule ( ( runnable ) not null ( ) ) ; verify observer mock ( mock observer before connect , 2 , 6 ) ; verify observer mock ( mock observer after connect , 2 , 6 ) ; / / fixme publish calls cancel too verify ( spied worker , times ( 1 ) ) dispose ( ) ; verify ( source unsubscribed , never ( ) ) run ( ) ; verify no more interactions ( source next ) ; verify no more interactions ( source completed ) ; verify no more interactions ( source unsubscribed ) ; verify no more interactions ( spied worker ) ; verify no more interactions ( mock subscription ) ; verify no more interactions ( mock scheduler ) ; verify no more interactions ( mock observer before connect ) ; verify no more interactions ( mock observer after connect ) ; }


returns the required toolchains declared by this aspect

public immutable set < label > get required toolchains ( ) { return required toolchains ; }


public string get comment ( ) { return m native info handle get comment ( ) ; }


the number of failed indexing operations

public long get index failed count ( ) { return index failed count ; }


set movement method ( link movement method get instance ( ) )

public builder set click span ( @ non null clickable span click span ) { this click span = click span ; return this ; }


immediately remove all entries from this cache

public void clear ( ) { this lock write lock ( ) lock ( ) ; try { this cache clear ( ) ; this queue clear ( ) ; this size = 0 ; } finally { this lock write lock ( ) unlock ( ) ; } }


get the memory requirement for the type of job corresponding to a specified persistent task name this method only works on the master node

public long get job memory requirement ( string task name , string id ) { if ( is master = = false ) { return null ; } map < string , long > memory requirement by job = memory requirement by task name get ( task name ) ; if ( memory requirement by job = = null ) { return null ; } return memory requirement by job get ( id ) ; }


removes the first occurrence of the given value

public void remove value ( int value ) { for ( int i = 0 ; i < size ; + + i ) { if ( ints [ i ] = = value ) { remove value at ( i ) ; return ; } } }


visit a parse tree produced by the { @ code select expression } labeled alternative in { @ link sql base parser # select item }

t visit select expression ( sql base parser select expression context ctx ) ;


time out calls which have been assigned to nodes

private int timeout calls to send ( timeout processor processor ) { int num timed out = 0 ; for ( list < call > call list : calls to send values ( ) ) { num timed out + = processor handle timeouts ( call list , " timed out waiting to send the call " ) ; } if ( num timed out > 0 ) log debug ( " timed out { } call ( s ) with assigned nodes " , num timed out ) ; return num timed out ; }


adds unannounced credits from the consumer or resumes data consumption after an exactly - once checkpoint and enqueues the corresponding reader for this consumer ( if not enqueued yet )

void add credit or resume consumption ( input channel i d receiver id , consumer < network sequence view reader > operation ) throws exception { if ( fatal error ) { return ; } network sequence view reader reader = all readers get ( receiver id ) ; if ( reader ! = null ) { operation accept ( reader ) ; enqueue available reader ( reader ) ; } else { throw new illegal state exception ( " no reader for receiver id = " + receiver id + " exists " ) ; } }


string initiate multi part upload ( final string dest key ) throws i o exception { log debug ( " initiating multipart upload " ) ; final initiate multipart upload request initiate m p u request = new initiate multipart upload request ( bucket , dest key ) ; initiate m p u request set acl ( owner get canned a c l ( ) ) ; initiate m p u request set metadata ( new object metadata ( - 1 ) ) ; if ( owner get sse ( ) is sse c enable ( ) ) { initiate m p u request set sse c header ( owner get sse ( ) get sse c header ( ) ) ; } else if ( owner get sse ( ) is sse kms enable ( ) ) { initiate m p u request set sse kms header ( owner get sse ( ) get sse kms header ( ) ) ; } try { return obs initiate multipart upload ( initiate m p u request ) get upload id ( ) ; } catch ( obs exception ace ) { throw o b s common utils translate exception ( " initiate multi part upload " , dest key , ace ) ; } }


tests that the pending checkpoint stats callbacks are created

public void test checkpoint stats tracker pending checkpoint callback ( ) throws exception { / / set up the coordinator and validate the initial state checkpoint coordinator checkpoint coordinator = new checkpoint coordinator builder ( ) set timer ( manually triggered scheduled executor ) build ( ) ; checkpoint stats tracker tracker = mock ( checkpoint stats tracker class ) ; checkpoint coordinator set checkpoint stats tracker ( tracker ) ; when ( tracker report pending checkpoint ( any long ( ) , any long ( ) , any ( checkpoint properties class ) ) ) then return ( mock ( pending checkpoint stats class ) ) ; / / trigger a checkpoint and verify callback completable future < completed checkpoint > checkpoint future = checkpoint coordinator trigger checkpoint ( false ) ; manually triggered scheduled executor trigger all ( ) ; future utils throw if completed exceptionally ( checkpoint future ) ; verify ( tracker , times ( 1 ) ) report pending checkpoint ( eq ( 1l ) , any ( long class ) , eq ( checkpoint properties for checkpoint ( checkpoint retention policy never retain after termination ) ) ) ; }


flush the underlying session to the datastore , if applicable : for example , a hibernate j p a session


just like assert same ( x , y ) , but additionally recording ( using thread record failure ) any assertion failed error thrown , so that the current testcase will fail

public void thread assert same ( object x , object y ) { try { assert same ( x , y ) ; } catch ( assertion failed error fail ) { thread record failure ( fail ) ; throw fail ; } }


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

public void find pets by tags ( set < string > tags , api client auth info auth info , handler < async result < set < pet > > > result handler ) { object local var body = null ; / / verify the required parameter ' tags ' is set if ( tags = = null ) { result handler handle ( api exception fail ( 400 , " missing the required parameter ' tags ' when calling find pets by tags " ) ) ; return ; } / / create path and map variables string local var path = " / pet / find by tags " ; / / query params list < pair > local var query params = new array list < > ( ) ; local var query params add all ( api client parameter to pairs ( " csv " , " tags " , tags ) ) ; / / header params multi map local var header params = multi map case insensitive multi map ( ) ; / / cookie params multi map local var cookie params = multi map case insensitive multi map ( ) ; / / form params / / todo : sending files within multipart / form - data is not supported yet ( because of vertx web - client ) map < string , object > local var form params = new hash map < > ( ) ; string [ ] local var accepts = { " application / xml " , " application / json " } ; string [ ] local var content types = { } ; string [ ] local var auth names = new string [ ] { " petstore auth " } ; type reference < set < pet > > local var return type = new type reference < set < pet > > ( ) { } ; api client invoke a p i ( local var path , " get " , local var query params , local var body , local var header params , local var cookie params , local var form params , local var accepts , local var content types , local var auth names , auth info , local var return type , result handler ) ; }


public final void handle ( mvc result result ) throws exception { this printer print heading ( " mock http servlet request " ) ; print request ( result get request ( ) ) ; this printer print heading ( " handler " ) ; print handler ( result get handler ( ) , result get interceptors ( ) ) ; this printer print heading ( " async " ) ; print async result ( result ) ; this printer print heading ( " resolved exception " ) ; print resolved exception ( result get resolved exception ( ) ) ; this printer print heading ( " model and view " ) ; print model and view ( result get model and view ( ) ) ; this printer print heading ( " flash map " ) ; print flash map ( request context utils get output flash map ( result get request ( ) ) ) ; this printer print heading ( " mock http servlet response " ) ; print response ( result get response ( ) ) ; }


return the names of all beans found when only one matching bean was expected note that this may be { @ code null } if not specified at construction time

public collection < string > get bean names found ( ) { return this bean names found ; }


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


creates the collector tree from the provided < code > collectors < code >

static collector create query collector ( list < query collector context > collectors ) throws i o exception { collector collector = null ; for ( query collector context ctx : collectors ) { collector = ctx create ( collector ) ; } return collector ; }


public duration execution wall time ( ) { return execution wall time ; }


public void small camel test ( ) { / / todo : test small camel }


simulates branch insns , if possible adds reachable successor blocks to the cfg worklists

private void simulate branch ( ssa insn insn ) { rop opcode = insn get opcode ( ) ; register spec list sources = insn get sources ( ) ; boolean constant branch = false ; boolean constant successor = false ; / / check if the insn is a branch with a constant condition if ( opcode get branchingness ( ) = = rop branch if ) { constant c a = null ; constant c b = null ; register spec spec a = sources get ( 0 ) ; int reg a = spec a get reg ( ) ; if ( ! ssa meth is reg a local ( spec a ) & & lattice values [ reg a ] = = constant ) { c a = lattice constants [ reg a ] ; } if ( sources size ( ) = = 2 ) { register spec spec b = sources get ( 1 ) ; int reg b = spec b get reg ( ) ; if ( ! ssa meth is reg a local ( spec b ) & & lattice values [ reg b ] = = constant ) { c b = lattice constants [ reg b ] ; } } / / calculate the result of the condition if ( c a ! = null & & sources size ( ) = = 1 ) { switch ( ( ( typed constant ) c a ) get basic type ( ) ) { case type bt int : constant branch = true ; int v a = ( ( cst integer ) c a ) get value ( ) ; switch ( opcode get opcode ( ) ) { case reg ops if eq : constant successor = ( v a = = 0 ) ; break ; case reg ops if ne : constant successor = ( v a ! = 0 ) ; break ; case reg ops if lt : constant successor = ( v a < 0 ) ; break ; case reg ops if ge : constant successor = ( v a > = 0 ) ; break ; case reg ops if le : constant successor = ( v a < = 0 ) ; break ; case reg ops if gt : constant successor = ( v a > 0 ) ; break ; default : throw new runtime exception ( " unexpected op " ) ; } break ; default : / / not yet supported } } else if ( c a ! = null & & c b ! = null ) { switch ( ( ( typed constant ) c a ) get basic type ( ) ) { case type bt int : constant branch = true ; int v a = ( ( cst integer ) c a ) get value ( ) ; int v b = ( ( cst integer ) c b ) get value ( ) ; switch ( opcode get opcode ( ) ) { case reg ops if eq : constant successor = ( v a = = v b ) ; break ; case reg ops if ne : constant successor = ( v a ! = v b ) ; break ; case reg ops if lt : constant successor = ( v a < v b ) ; break ; case reg ops if ge : constant successor = ( v a > = v b ) ; break ; case reg ops if le : constant successor = ( v a < = v b ) ; break ; case reg ops if gt : constant successor = ( v a > v b ) ; break ; default : throw new runtime exception ( " unexpected op " ) ; } break ; default : / / not yet supported } } } / * * if condition is constant , add only the target block to the * worklist otherwise , add all successors to the worklist * / ssa basic block block = insn get block ( ) ; if ( constant branch ) { int successor block ; if ( constant successor ) { successor block = block get successor list ( ) get ( 1 ) ; } else { successor block = block get successor list ( ) get ( 0 ) ; } add block to worklist ( ssa meth get blocks ( ) get ( successor block ) ) ; branch worklist add ( insn ) ; } else { for ( int i = 0 ; i < block get successor list ( ) size ( ) ; i + + ) { int successor block = block get successor list ( ) get ( i ) ; add block to worklist ( ssa meth get blocks ( ) get ( successor block ) ) ; } } }


sets the internal file attributes of the entry

public void set internal attributes ( short internal attributes ) { this internal attributes = internal attributes ; }


handles collisions for object obj using quadtree

abstract void handle collisions using qt ( t obj ) ;


checks the given rest client has the provided default headers

public void assert headers ( rest client client , map < string , string > expected headers ) { expected headers = new hash map < > ( expected headers ) ; / / copy so we can remove as we check for ( header header : client default headers ) { string name = header get name ( ) ; string expected value = expected headers remove ( name ) ; if ( expected value = = null ) { fail ( " found unexpected header in rest client : " + name ) ; } assert equals ( expected value , header get value ( ) ) ; } if ( expected headers is empty ( ) = = false ) { fail ( " missing expected headers in rest client : " + strings join ( expected headers key set ( ) , " , " ) ) ; } }


list < service factory < ? extends web application service > > get service factories ( ) ;


subtract the values of this object from that object

public final void subtract ( final enum doubles < e > that ) { for ( int i = 0 ; i < doubles length ; i + + ) { this doubles [ i ] - = that doubles [ i ] ; } }


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


public fallback method get fallback method ( class < ? > enclosing type , method command method , boolean extended ) { if ( command method is annotation present ( hystrix command class ) ) { return fallback method finder find ( enclosing type , command method , extended ) ; } return fallback method absent ; }


get the value of this metrics center point

public double center value ( ) { return this center value ; }


returns an instance with all unavailable and available ads marked as skipped if the ad count hasn ' t been set , it will be set to zero

public ad group with all ads skipped ( ) { if ( count = = c length unset ) { return new ad group ( / * count = * / 0 , / * states = * / new int [ 0 ] , / * uris = * / new uri [ 0 ] , / * durations us = * / new long [ 0 ] ) ; } int count = this states length ; @ ad state int [ ] states = arrays copy of ( this states , count ) ; for ( int i = 0 ; i < count ; i + + ) { if ( states [ i ] = = ad state available | | states [ i ] = = ad state unavailable ) { states [ i ] = ad state skipped ; } } return new ad group ( count , states , uris , durations us ) ; }


get the configuration for the scheduler this is used when setting up the resource manager and should setup the scheduler ( e g , capacity scheduler or fair scheduler ) it needs to set the configuration with { @ link yarn configuration # rm scheduler }

protected configuration get configuration ( ) { configuration conf = new yarn configuration ( ) ; / / prevent loading node attributes conf set class ( yarn configuration fs node attribute store impl class , null node attribute store class , node attribute store class ) ; return conf ; }


the string pool containing source paths referenced throughout the resource table this does not end up in the final binary arsc file < code > optional aapt pb string pool source pool = 1 ; < code >

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


public static int get max inactive channel check ( ) { return max inactive channel check ; }


to test value and watermark serialization and deserialization with time characteristic : ingestion time producer parallelism = 1 ; kafka partition # = 1 ; consumer parallelism = 1

public void test ser de ingestion time ( ) throws exception { test record ser de ( ingestion time ) ; }


sets the < code > map array integer < code > property

public additional properties class map array integer ( map < string , list < integer > > map array integer ) { this map array integer = map array integer ; return this ; }


test that , if the remote node gets unsynchronized ( eg some edits were missed or the node rebooted ) , the client stops sending edits until the next roll test for hdfs - 3726

public void test stop sending edits when out of sync ( ) throws exception { mockito do throw ( new i o exception ( " injected error " ) ) when ( mock proxy ) journal ( mockito < request info > any ( ) , mockito eq ( 1l ) , mockito eq ( 1l ) , mockito eq ( 1 ) , mockito same ( fake data ) ) ; try { ch send edits ( 1l , 1l , 1 , fake data ) get ( ) ; fail ( " injected joose did not cause send edits ( ) to throw " ) ; } catch ( execution exception ee ) { generic test utils assert exception contains ( " injected " , ee ) ; } mockito verify ( mock proxy ) journal ( mockito < request info > any ( ) , mockito eq ( 1l ) , mockito eq ( 1l ) , mockito eq ( 1 ) , mockito same ( fake data ) ) ; assert true ( ch is out of sync ( ) ) ; try { ch send edits ( 1l , 2l , 1 , fake data ) get ( ) ; fail ( " send edits ( ) should throw until next roll " ) ; } catch ( execution exception ee ) { generic test utils assert exception contains ( " disabled until next roll " , ee get cause ( ) ) ; } / / it should have failed without even sending the edits , since it was not sync mockito verify ( mock proxy , mockito never ( ) ) journal ( mockito < request info > any ( ) , mockito eq ( 1l ) , mockito eq ( 2l ) , mockito eq ( 1 ) , mockito same ( fake data ) ) ; / / it should have sent a heartbeat instead mockito verify ( mock proxy ) heartbeat ( mockito < request info > any ( ) ) ; / / after a roll , sending new edits should not fail ch start log segment ( 3l , name node layout version current layout version ) get ( ) ; assert false ( ch is out of sync ( ) ) ; ch send edits ( 3l , 3l , 1 , fake data ) get ( ) ; }


{ @ code previous tmp } is a transient directory , which holds current file system state while the new state is saved into the new { @ code current } during upgrade if the saving succeeds { @ code previous tmp } will be moved to { @ code previous } , otherwise it will be renamed back to { @ code current } by the recovery procedure during startup

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


public boolean get attribute boolean ( ) { return attribute boolean ; }


writes the given int value ( 3 2bit , 4 bytes ) to the given position in little endian byte order this method ' s speed depends on the system ' s native byte order , and it is possibly slower than { @ link # put int ( int , int ) } for most cases ( such as transient storage in memory or serialization for io and network ) , it suffices to know that the byte order in which the value is written is the same as the one in which it is read , and { @ link # put int ( int , int ) } is the preferable choice

public final void put int little endian ( int index , int value ) { if ( little endian ) { put int ( index , value ) ; } else { put int ( index , integer reverse bytes ( value ) ) ; } }


parses variable at the current lexer position

public pair < string , ninja variable value > parse variable ( ) throws generic parsing exception { string name = as string ( parse expected ( ninja token identifier ) ) ; parse expected ( ninja token equals ) ; parse and ignore whitespace ( ) ; ninja variable value value = parse variable value ( ) ; return pair of ( name interner intern ( name ) , value ) ; }


this method is called by { @ link # start async } to initiate service startup the invocation of this method should cause a call to { @ link # notify started ( ) } , either during this method ' s run , or after it has returned if startup fails , the invocation should cause a call to { @ link # notify failed ( throwable ) } instead this method should return promptly ; prefer to do work on a different thread where it is convenient it is invoked exactly once on service startup , even when { @ link # start async } is called multiple times


return a " flattened " collection this should be used when the collection type is itself a complex type with properties annotated as gradle inputs rather than a simple type like { @ link string }

public list < ? extends t > get flat normalized collection ( ) { return get normalized collection ( ) stream ( ) map ( property list entry : : get value ) collect ( collectors to list ( ) ) ; }


make an metrics source from an annotated object

public static metrics source make source ( object source ) { return new metrics source builder ( source , default metrics factory get annotated metrics factory ( ) ) build ( ) ; }


creates an { @ link incremental file merger input } from a { @ link directory input } all files in the directory will be reported in the incremental input this method assumes the input does not contain incremental information all files will be reported as new

public static incremental file merger input to non incremental input ( @ non null directory input directory input , @ nullable map < incremental file merger input , qualified content > content map ) { file dir file = directory input get file ( ) ; if ( ! dir file is directory ( ) ) { return null ; } incremental file merger input input = lazy incremental file merger inputs from new ( dir file get absolute path ( ) , immutable set of ( dir file ) ) ; if ( content map ! = null ) { content map put ( input , directory input ) ; } return input ; }


set the data flavors acceptable to the associated drop target

public void set acceptable drop flavors ( data flavor [ ] drop flavors ) { this drop flavors = drop flavors ; }


verify the class of an exception if it is not as expected , rethrow it comparison is on the exact class , not subclass - of inference as offered by { @ code instanceof }

public static < e extends throwable > e verify exception class ( class < e > clazz , exception ex ) throws exception { if ( ! ( ex get class ( ) equals ( clazz ) ) ) { throw ex ; } return ( e ) ex ; }


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

public list < pet > find pets by tags ( @ query param ( " tags " ) @ not null list < string > tags ) ;


retrieve the errors instance for the given bind object , using the " default html escape " setting

public errors get errors ( string name ) { return get errors ( name , is default html escape ( ) ) ; }


gets the transform of the viewport , transforms around the center not a copy

public mat 2 2 get transform ( ) { return box r ; }


public void delete pet ( long pet id , string api key ) throws api exception { object local var post body = null ; / / verify the required parameter ' pet id ' is set if ( pet id = = null ) { throw new api exception ( 400 , " missing the required parameter ' pet id ' when calling delete pet " ) ; } / / create path and map variables string local var path = " / pet / { pet id } " replace all ( " \ \ { " + " pet id " + " \ \ } " , api client escape string ( pet id to string ( ) ) ) ; / / query params list < pair > local var query params = new array list < pair > ( ) ; list < pair > local var collection 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 > ( ) ; if ( api key ! = null ) local var header params put ( " api key " , api client parameter to string ( api key ) ) ; final string [ ] local var accepts = { } ; 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 [ ] { " petstore auth " } ; api client invoke a p i ( local var path , " delete " , local var query params , local var collection 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 , null ) ; }


gets the high state value of the try , if there is one , in the try block map entry indicated by the ordinal

public int get try high ( int try block ordinal ) throws invalid data type exception { check validity ( try block ordinal ) ; data type dt = get data type ( ) ; mem buffer specific mem buffer = get specific mem buffer ( try block ordinal , dt ) ; / / component 1 is the high state value of the try return e h data type utilities get e h state value ( dt , try high ordinal , specific mem buffer ) ; }


requests the thread dump from the given { @ link task executor }

completable future < thread dump info > request thread dump ( resource i d task manager id , @ rpc timeout time timeout ) ;


canned access control list get canned a c l ( ) { return canned a c l ; }


runs ant glob against the current { @ link file path } and returns matching paths

private static list < list < path > > pattern scan ( virtual file base dir , string pattern , string base ref ) throws i o exception { collection < string > files = base dir list ( pattern , null , / * todo what is the user expectation ? * / true , get no follow links ( ) ) ; if ( ! files is empty ( ) ) { list < list < path > > r = new array list < > ( files size ( ) ) ; for ( string match : files ) { list < path > file = build path list ( base dir , base dir child ( match ) , base ref ) ; r add ( file ) ; } return r ; } return null ; }


if the page replacement policy buffers writes

protected boolean buffers writes ( ) { return false ; }


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

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


public final void write annotation ( annotated output out ) { if ( data map size ( ) = = 0 ) { return ; } out annotate ( 0 , " \ nstatistics : \ n " ) ; tree map < string , data > sorted data = new tree map < string , data > ( ) ; for ( data data : data map values ( ) ) { sorted data put ( data name , data ) ; } for ( data data : sorted data values ( ) ) { data write annotation ( out ) ; } }


executes an asynchronous action using the provided client the origin is set in the context and the listener is wrapped to ensure the proper context is restored

public static < request extends action request , response extends action response , request builder extends action request builder < request , response > > void execute async with origin ( client client , string origin , action type < response > action , request request , action listener < response > listener ) { final thread context thread context = client thread pool ( ) get thread context ( ) ; final supplier < thread context stored context > supplier = thread context new restorable context ( false ) ; try ( thread context stored context ignore = thread context stash with origin ( origin ) ) { client execute ( action , request , new context preserving action listener < > ( supplier , listener ) ) ; } }


a put operation that can be used in the fluent pattern

public builder < k type , v type > f put ( k type key , v type value ) { map put ( key , value ) ; return this ; }


causes the cache to be rebuilt the next time it is rendered

public void invalidate cache ( ) { cached = false ; }


in order to avoid check back unlimited , we will discard the message that have been checked more than a certain number of times

public abstract void resolve discard msg ( message ext msg ext ) ;


remove ( key , value ) removes only if pair present

public void test remove 2 ( ) { concurrent map map = map 5 ( ) ; map remove ( five , " e " ) ; assert equals ( 4 , map size ( ) ) ; assert false ( map contains key ( five ) ) ; map remove ( four , " a " ) ; assert equals ( 4 , map size ( ) ) ; assert true ( map contains key ( four ) ) ; }


test that decoding invalid utf8 throws an appropriate error message

public void test invalid u t f 8 ( ) throws exception { byte [ ] invalid = new byte [ ] { 0x 0 1 , 0x 0 2 , ( byte ) 0xff , ( byte ) 0xff , 0x 0 1 , 0x 0 2 , 0x 0 3 , 0x 0 4 , 0x 0 5 } ; try { utf8 from bytes ( invalid ) ; fail ( " did not throw an exception " ) ; } catch ( u t f data format exception utfde ) { generic test utils assert exception contains ( " invalid utf8 at ffff 0 1 0 2 0 3 0 4 " , utfde ) ; } }


protected boolean is dark ( ) { if ( state teams get ( player team ( ) ) has core ( ) & & state teams get ( player team ( ) ) core ( ) healthf ( ) < 0 8 5f ) { / / core damaged - > dark return true ; } / / it may be dark based on wave if ( mathf chance ( ( float ) ( math log 1 0 ( ( state wave - 1 7f ) / 1 9f ) + 1 ) / 4f ) ) { return true ; } / / dark based on enemies return mathf chance ( state enemies / 7 0f + 0 1f ) ; }


writes a { @ code data } frame to the remote endpoint this will result in one or more frames being written to the context

channel future write data ( channel handler context ctx , int stream id , byte buf data , int padding , boolean end stream , channel promise promise ) ;


get the { @ link sorted set sorted set } of string that presents all dubbo exported { @ link url urls }

default sorted set < string > get exported u r ls ( ) { return get exported u r ls ( all service interfaces ) ; }


updates in - sync allocations with routing changes that were made to the routing table

private index metadata builder update in sync allocations ( routing table new routing table , index metadata old index metadata , index metadata builder index metadata builder , shard id shard id , updates updates ) { assert sets have empty intersection ( updates added allocation ids , updates removed allocation ids ) : " allocation ids cannot be both added and removed in the same allocation round , added ids : " + updates added allocation ids + " , removed ids : " + updates removed allocation ids ; set < string > old in sync allocation ids = old index metadata in sync allocation ids ( shard id id ( ) ) ; / / check if we have been force - initializing an empty primary or a stale primary if ( updates initialized primary ! = null & & old in sync allocation ids is empty ( ) = = false & & old in sync allocation ids contains ( updates initialized primary allocation id ( ) get id ( ) ) = = false ) { / / we ' re not reusing an existing in - sync allocation id to initialize a primary , which means that we ' re either force - allocating / / an empty or a stale primary ( see allocate empty primary allocation command or allocate stale primary allocation command ) recovery source recovery source = updates initialized primary recovery source ( ) ; recovery source type recovery source type = recovery source get type ( ) ; boolean empty primary = recovery source type = = recovery source type empty store ; assert updates added allocation ids is empty ( ) : ( empty primary ? " empty " : " stale " ) + " primary is not force - initialized in same allocation round where shards are started " ; if ( index metadata builder = = null ) { index metadata builder = index metadata builder ( old index metadata ) ; } if ( empty primary ) { / / forcing an empty primary resets the in - sync allocations to the empty set ( shard routing allocated post index create ) index metadata builder put in sync allocation ids ( shard id id ( ) , collections empty set ( ) ) ; } else { final string allocation id ; if ( recovery source = = recovery source existing store recovery source force stale primary instance ) { allocation id = recovery source existing store recovery source forced allocation id ; index metadata builder timestamp range ( index metadata builder get timestamp range ( ) remove shard ( shard id id ( ) , old index metadata get number of shards ( ) ) ) ; } else { assert recovery source instanceof recovery source snapshot recovery source : recovery source ; allocation id = updates initialized primary allocation id ( ) get id ( ) ; } / / forcing a stale primary resets the in - sync allocations to the singleton set with the stale id index metadata builder put in sync allocation ids ( shard id id ( ) , collections singleton ( allocation id ) ) ; } } else { / / standard path for updating in - sync ids set < string > in sync allocation ids = new hash set < > ( old in sync allocation ids ) ; in sync allocation ids add all ( updates added allocation ids ) ; in sync allocation ids remove all ( updates removed allocation ids ) ; assert old in sync allocation ids contains ( recovery source existing store recovery source forced allocation id ) = = false | | in sync allocation ids contains ( recovery source existing store recovery source forced allocation id ) = = false : " fake allocation id has to be removed , in sync allocation ids : " + in sync allocation ids ; / / prevent set of in sync allocation ids to grow unboundedly this can happen for example if we don ' t write to a primary / / but repeatedly shut down nodes that have active replicas / / we use number of replicas + 1 ( = possible active shard copies ) to bound the in sync allocation ids set / / only trim the set of allocation ids when it grows , otherwise we might trim too eagerly when the number / / of replicas was decreased while shards were unassigned int max active shards = old index metadata get number of replicas ( ) + 1 ; / / + 1 for the primary index shard routing table new shard routing table = new routing table shard routing table ( shard id ) ; assert new shard routing table assigned shards ( ) stream ( ) filter ( shard routing : : is relocation target ) map ( s - > s allocation id ( ) get id ( ) ) none match ( in sync allocation ids : : contains ) : new shard routing table assigned shards ( ) + " vs " + in sync allocation ids ; if ( in sync allocation ids size ( ) > old in sync allocation ids size ( ) & & in sync allocation ids size ( ) > max active shards ) { / / trim entries that have no corresponding shard routing in the cluster state ( i e trim unavailable copies ) list < shard routing > assigned shards = new shard routing table assigned shards ( ) stream ( ) filter ( s - > s is relocation target ( ) = = false ) collect ( collectors to list ( ) ) ; assert assigned shards size ( ) < = max active shards : " cannot have more assigned shards " + assigned shards + " than maximum possible active shards " + max active shards ; set < string > assigned allocations = assigned shards stream ( ) map ( s - > s allocation id ( ) get id ( ) ) collect ( collectors to set ( ) ) ; in sync allocation ids = in sync allocation ids stream ( ) sorted ( comparator comparing ( assigned allocations : : contains ) reversed ( ) ) / / values with routing entries first limit ( max active shards ) collect ( collectors to set ( ) ) ; } / / only remove allocation id of failed active primary if there is at least one active shard remaining assume for example that / / the primary fails but there is no new primary to fail over to if we were to remove the allocation id of the primary from the / / in - sync set , this could create an empty primary on the next allocation if ( new shard routing table active shards ( ) is empty ( ) & & updates first failed primary ! = null ) { / / add back allocation id of failed primary in sync allocation ids add ( updates first failed primary allocation id ( ) get id ( ) ) ; } assert in sync allocation ids is empty ( ) = = false | | old in sync allocation ids is empty ( ) : " in - sync allocations cannot become empty after they have been non - empty : " + old in sync allocation ids ; / / be extra safe here and only update in - sync set if it is non - empty if ( in sync allocation ids is empty ( ) = = false ) { if ( index metadata builder = = null ) { index metadata builder = index metadata builder ( old index metadata ) ; } index metadata builder put in sync allocation ids ( shard id id ( ) , in sync allocation ids ) ; } } return index metadata builder ; }


public set < audit action context > get audit log ( @ selector final string interval ) { if ( string utils is blank ( interval ) ) { val since date = local date now ( zone id system default ( ) ) minus days ( cas properties get audit ( ) get number of days in history ( ) ) ; return this audit trail manager get audit records since ( since date ) ; } val duration = beans new duration ( interval ) ; val since time = new date ( new date ( ) get time ( ) - duration to millis ( ) ) ; val days = duration to days ( ) ; val since date = local date now ( zone id system default ( ) ) minus days ( days + 1 ) ; return this audit trail manager get audit records since ( since date ) stream ( ) filter ( a - > a get when action was performed ( ) after ( since time ) ) collect ( collectors to set ( ) ) ; }


public long get int 6 4 ( ) { return int 6 4 ; }


begin building a mesh call { @ link # part ( string , int ) } to start a { @ link mesh part }

public void begin ( final vertex attributes attributes ) { begin ( attributes , - 1 ) ; }


returns the offset of the int array which this buffer is based on , if there is one the offset is the index of the array corresponds to the zero position of the buffer

public final int array offset ( ) { return protected array offset ( ) ; }


public static tree scan results create subdirs ( file system fs , path current , int depth , int width , int files , int filesize , string dir prefix , string file prefix , string marker ) throws i o exception { fs mkdirs ( current ) ; tree scan results results = new tree scan results ( current ) ; if ( depth > 0 ) { byte [ ] data = dataset ( filesize , ' a ' , ' z ' ) ; for ( int i = 0 ; i < files ; i + + ) { string name = string format ( " % s - % s - % 0 4d txt " , file prefix , marker , i ) ; path path = new path ( current , name ) ; create file ( fs , path , true , data ) ; results add ( fs , path ) ; } for ( int w = 0 ; w < width ; w + + ) { string marker 2 = string format ( " % s - % 0 4d " , marker , w ) ; path child = new path ( current , dir prefix + marker 2 ) ; results add ( create subdirs ( fs , child , depth - 1 , width , files , filesize , dir prefix , file prefix , marker 2 ) ) ; results add ( fs , child ) ; } } return results ; }


protected void handle outbound message ( object msg ) { outbound messages ( ) add ( msg ) ; }


creates an " greater than ( ' & gt ; ' ) " condition for this property

public where condition gt ( object value ) { return new property condition ( this , " > ? " , value ) ; }


constructs an event with kind { @ link event kind # info }

public static event info ( string message ) { return of ( event kind info , message ) ; }


{ @ inherit doc } this implementation passes the message to the maven log

public void error ( a n t l r message message ) { st msg s t = tool err mgr get message template ( message ) ; string output msg = msg s t render ( ) ; if ( tool err mgr format wants single line message ( ) ) { output msg = output msg replace ( ' \ n ' , ' ' ) ; } log error ( output msg ) ; if ( message file name ! = null ) { string text = message get message template ( false ) render ( ) ; build context add message ( new file ( message file name ) , message line , message char position , text , build context severity error , message get cause ( ) ) ; } }


this implementation returns a url for the underlying class path resource

public url get u r l ( ) throws i o exception { url url ; if ( this clazz ! = null ) { url = this clazz get resource ( this path ) ; } else { url = this class loader get resource ( this path ) ; } if ( url = = null ) { throw new file not found exception ( get description ( ) + " cannot be resolved to url because it does not exist " ) ; } return url ; }


adds a description to be printed if verification fails < pre class = " code " > < code class = " java " > verify ( mock , description ( " this will print on failure " ) ) some method ( " some arg " ) ; < code >

public static verification mode description ( string description ) { return times ( 1 ) description ( description ) ; }


public int failed shards ( ) { return total shards - successful shards ; }


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

public void delete user test ( test context test context ) { async async = test context async ( ) ; string username = null ; api delete user ( username , result - > { / / todo : test validations async complete ( ) ; } ) ; }


is authorized to release credential password ?

default boolean is authorized to release credential password ( ) { return false ; }


public void clear ( ) { x = 0 ; y = 0 ; pools free all ( pooled layouts , true ) ; pooled layouts clear ( ) ; layouts clear ( ) ; for ( int i = 0 , n = idx length ; i < n ; i + + ) { if ( page glyph indices ! = null ) page glyph indices [ i ] clear ( ) ; idx [ i ] = 0 ; } }


public void set selected index ( int i ) { list set selected index ( i ) ; }


returns true if this { @ code required providers } instance accept any set of providers

public boolean accepts any ( ) { return constraint equals ( constraint any ) ; }


returns the child at the specified index

public actor get child ( int index ) { return children get ( index ) ; }


format the given parameter object into string

public string parameter to string ( object param ) { if ( param = = null ) { return " " ; } else if ( param instanceof date ) { return format date ( ( date ) param ) ; } else if ( param instanceof collection ) { string builder b = new string builder ( ) ; for ( object o : ( collection < ? > ) param ) { if ( b length ( ) > 0 ) { b append ( " , " ) ; } b append ( string value of ( o ) ) ; } return b to string ( ) ; } else { return string value of ( param ) ; } }


get the approximate amount of dram cache space used

public long get mem cache used ( ) { return mem cache stats get cache used ( ) ; }


public void set tangent speed ( float speed ) { jni set tangent speed ( addr , speed ) ; }


determines whether any of this range set ' s member ranges contains { @ code value }


use it in optimizer { @ link com facebook presto sql planner iterative rule } only if you truly do not have a better option todo : replace it with a support for plan ( physical ) properties in rules pattern matching

public static plan node searcher search from ( plan node node , lookup lookup ) { return new plan node searcher ( node , lookup ) ; }


this test checks the async exceptions handling wraps the message and cause as an asynchronous exception and propagates this to the environment

public void stream task async exception handler handle exception forwards message properly ( ) { mock environment mock environment = mock environment builder ( ) build ( ) ; runtime exception expected exception = new runtime exception ( " runtime exception " ) ; final stream task stream task async exception handler async exception handler = new stream task stream task async exception handler ( mock environment ) ; mock environment set expected external failure cause ( asynchronous exception class ) ; final string expected error message = " expected error message " ; async exception handler handle async exception ( expected error message , expected exception ) ; / / expect an asynchronous exception containing the supplied error details optional < ? extends throwable > actual external failure cause = mock environment get actual external failure cause ( ) ; final throwable actual exception = actual external failure cause or else throw ( ( ) - > new assertion error ( " expected exceptional completion " ) ) ; assert that ( actual exception , instance of ( asynchronous exception class ) ) ; assert that ( actual exception get message ( ) , is ( " expected error message " ) ) ; assert that ( actual exception get cause ( ) , is ( expected exception ) ) ; }


public abstract boolean interest ( string context ) ;


starts draining the codec for re - initialization re - initialization may occur immediately if no buffers have been queued to the codec

private void drain and reinitialize codec ( ) throws exo playback exception { if ( codec received buffers ) { codec drain state = drain state signal end of stream ; codec drain action = drain action reinitialize ; } else { / / nothing has been queued to the decoder , so we can re - initialize immediately reinitialize codec ( ) ; } }


centers the dialog on the given component

public void set centered on component ( component c ) { if ( c = = null ) { set centered on screen ( ) ; return ; } if ( c instanceof hidden docking frame ) { set centered on screen ( ) ; return ; / / don ' t center over a hidden frame , as it may be is offscreen } if ( ! c is visible ( ) ) { / / hidden frames cause us to be put in the upper - left - - don ' t do that set centered on screen ( ) ; return ; } rectangle r = get bounds ( ) ; point p = window utilities center on component ( c , this ) ; r set location ( p ) ; set bounds ( r ) ; }


read bytes from the given file { @ code path } into a { @ code flux } of { @ code data buffer } s the method ensures that the file is closed when the flux is terminated

public static flux < data buffer > read ( path path , data buffer factory buffer factory , int buffer size , open option options ) { assert not null ( path , " path must not be null " ) ; assert not null ( buffer factory , " buffer factory must not be null " ) ; assert is true ( buffer size > 0 , " ' buffer size ' must be > 0 " ) ; if ( options length > 0 ) { for ( open option option : options ) { assert is true ( ! ( option = = standard open option append | | option = = standard open option write ) , " ' " + option + " ' not allowed " ) ; } } return read asynchronous file channel ( ( ) - > asynchronous file channel open ( path , options ) , buffer factory , buffer size ) ; }


update the display because tools have been added or removed ; restore selection if possible

void update display ( ) { panel update display ( ) ; }


creates a { @ code collector tester } for the specified { @ code collector } the result of the { @ code collector } will be compared to the expected value using the specified { @ code equivalence }

public static < t , a , r > collector tester < t , a , r > of ( collector < t , a , r > collector , bi predicate < ? super r , ? super r > equivalence ) { return new collector tester < > ( collector , equivalence ) ; }


this supplier is used for all the field types that should be aggregated as bytesstrings , including those that need global ordinals

private static significant terms aggregator supplier bytes supplier ( ) { return new significant terms aggregator supplier ( ) { @ override public aggregator build ( string name , aggregator factories factories , values source values source , doc value format format , terms aggregator bucket count thresholds bucket count thresholds , include exclude include exclude , string execution hint , aggregation context context , aggregator parent , significance heuristic significance heuristic , significance lookup lookup , cardinality upper bound cardinality , map < string , object > metadata ) throws i o exception { execution mode execution = null ; if ( execution hint ! = null ) { execution = execution mode from string ( execution hint , deprecation logger ) ; } if ( values source instanceof values source bytes with ordinals = = false ) { execution = execution mode map ; } if ( execution = = null ) { execution = execution mode global ordinals ; } if ( ( include exclude ! = null ) & & ( include exclude is regex based ( ) ) & & format ! = doc value format raw ) { throw new illegal argument exception ( " aggregation [ " + name + " ] cannot support regular expression style " + " include / exclude settings as they can only be applied to string fields use an array of values for " + " include / exclude clauses " ) ; } return execution create ( name , factories , values source , format , bucket count thresholds , include exclude , context , parent , significance heuristic , lookup , cardinality , metadata ) ; } } ; }


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


public album page change album title ( string album title ) { var album title input text field = ( html text input ) page get element by id ( " album title " ) ; album title input text field set text ( album title ) ; return this ; }


returns a list of all users who have project access

user [ ] get project users ( ) { user [ ] users = new user [ table model get model data ( ) size ( ) ] ; return table model get model data ( ) to array ( users ) ; }


test that program diff correctly returns program 1 and program 2

public void test get programs ( ) throws exception { program diff = new program diff ( p 1 , p 2 ) ; assert equals ( p 1 , program diff get program one ( ) ) ; assert equals ( p 2 , program diff get program two ( ) ) ; }


public boolean is mutable ( ) { return false ; }


test that a structure can contain a pointer in it to a typedef of the same structure

public void test no cyclic dependency problem for typedef pointer ( ) { type def type def = create type def ( struct ) ; pointer typedef pointer = create pointer ( type def , 4 ) ; try { struct add ( typedef pointer ) ; } catch ( illegal argument exception e ) { assert fail ( " should be able to add a structure typedef pointer to the pointer ' s structure " ) ; } try { struct insert ( 0 , typedef pointer ) ; } catch ( illegal argument exception e ) { assert fail ( " should be able to insert a structure typedef pointer into the pointer ' s structure " ) ; } try { struct replace ( 0 , typedef pointer , typedef pointer get length ( ) ) ; } catch ( illegal argument exception e ) { assert fail ( " should be able to replace a structure component with the structure ' s typedef pointer " ) ; } pointer p = ( pointer ) struct get component ( 0 ) get data type ( ) ; typedef data type data type = ( typedef data type ) p get data type ( ) ; assert equals ( data type , type def ) ; assert equals ( data type get base data type ( ) , struct ) ; }


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

protected void remove detached view ( view child , boolean animate ) { throw new unsupported operation exception ( " removing views manually within litho views is not supported " ) ; }


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


output the subtree rooted at the current node only the leaves are printed

private void output ( print stream out , string prefix ) { prefix = prefix = = null ? name : prefix + " / " + name ; if ( children is empty ( ) ) { out println ( prefix ) ; } else { for ( i node child : children ) { child output ( out , prefix ) ; } } }


public zipkin annotations rename ( name name ) { return new zipkin annotations ( name , null ) ; }


protected assertion get assertion from ( final map < string , object > model ) { return ( assertion ) model get ( cas view constants model attribute name assertion ) ; }


fire a mouse moved event for the given component

public static void move mouse ( component comp , int x , int y ) { post event ( new mouse event ( comp , mouse event mouse moved , system current time millis ( ) , 0 , x , y , 0 , false ) ) ; }


public void test custom bandwidth ( ) throws exception { mock mover helper mock mover helper = new mock mover helper ( ) invoke ( ) ; node plan plan = mock mover helper get plan ( ) ; disk balancer balancer = mock mover helper get balancer ( ) ; for ( step step : plan get volume set plans ( ) ) { move step temp step = ( move step ) step ; temp step set bandwidth ( 100 ) ; } execute submit plan ( plan , balancer ) ; disk balancer work status status = balancer query work status ( ) ; assert not null ( status ) ; disk balancer work status disk balancer work entry entry = balancer query work status ( ) get current state ( ) get ( 0 ) ; assert equals ( 100l , entry get work item ( ) get bandwidth ( ) ) ; }


registers actions to generate code from proto files this method uses information from proto lang toolchain ( ) rules new rules should use this method instead of the soup of methods above

public static void register actions ( rule context rule context , list < toolchain invocation > toolchain invocations , proto info proto info , label rule label , iterable < artifact > outputs , string flavor name , exports use exports , services allow services ) { spawn action builder actions = create actions ( rule context , toolchain invocations , proto info , rule label , outputs , flavor name , use exports , allow services ) ; if ( actions ! = null ) { rule context register action ( actions build ( rule context ) ) ; } }


cancel any pending loads glide may have for the target and free any resources ( such as { @ link bitmap } s ) that may have been loaded for the target so they may be reused

public void clear ( @ nullable final target < ? > target ) { if ( target = = null ) { return ; } untrack or delegate ( target ) ; }


int argument that matches any of the given argument matchers see examples in javadoc for { @ link additional matchers } class

public static int or ( int first , int second ) { mocking progress ( ) get argument matcher storage ( ) report or ( ) ; return 0 ; }


concatenates the passed prefix string and the artifact ' s exec path

public builder add prefixed exec path ( @ compile time constant string prefix , @ nullable artifact arg ) { return add prefixed internal ( prefix , arg ) ; }


show the splash screen ; displayed only when ghidra is first coming up

public static splash screen show splash screen ( ) { if ( splash window ! = null ) { return splash window ; / / already showing } final j frame parent frame = get parent frame ( ) ; splash window = new splash screen ( parent frame ) ; initialize splash window and parent ( parent frame ) ; create splash screen close listeners ( parent frame ) ; parent frame set visible ( true ) ; splash window set visible ( true ) ; / / this call is needed for the splash screen to initially paint correctly on the mac splash window repaint ( ) ; return splash window ; }


returns the offset component of the msft symbol hash record

public long get offset ( ) { return offset val ; }


create an array of descriptors representing the parameter types for the supplied constructor returns a zero sized array if there are no parameters

public static string [ ] to param descriptors ( constructor < ? > ctor ) { return to descriptors ( ctor get parameter types ( ) ) ; }


invoked when this thread local variable is removed by { @ link # remove ( ) }

protected void on removal ( @ suppress warnings ( " unused " ) v value ) throws exception { }


deletes this file or empty directory and returns success will not delete a directory that has children

public boolean delete ( ) { if ( type = = file type classpath ) throw new gdx runtime exception ( " cannot delete a classpath file : " + file ) ; if ( type = = file type internal ) throw new gdx runtime exception ( " cannot delete an internal file : " + file ) ; return file ( ) delete ( ) ; }


helper method to make remote http get request

public string make remote request ( string [ ] urls , string path , list < name value pair > query params , string http method ) throws i o exception { return retryable request ( urls , path , query params , http method ) ; }


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


gets whether or not this { @ link load spec } is complete a { @ link load spec } is not considered complete if it requires a languagecompiler to load something , but the languagecompiler is currently unknown

public boolean is complete ( ) { return ! requires language compiler spec | | lcs ! = null ; }


get the { @ link state store } with the given name the store can be a " regular " or global store should be used for custom stores only for built - in stores , the corresponding typed methods like { @ link # get key value store ( string ) } should be used this is often useful in test cases to pre - populate the store before the test case instructs the topology to { @ link # pipe input ( consumer record ) process an input message } , andor to check the store afterward

public state store get state store ( final string name ) throws illegal argument exception { return get state store ( name , true ) ; }


maps the label of a pre - copied block to the label of the inlined block , allocating a new label and adding it to the worklist if necessary if the orig label is a " special " label , it is returned exactly and not scheduled for duplication : copying never proceeds past a special label , which likely is the function return block or an immediate predecessor

private int map or allocate label ( int orig label ) { int result label ; integer mapped label = orig label to copied label get ( orig label ) ; if ( mapped label ! = null ) { result label = mapped label ; } else if ( ! involved in subroutine ( orig label , subroutine start ) ) { / * * a subroutine has ended by some means other than a " ret " * ( which really means a throw caught later ) * / result label = orig label ; } else { result label = label allocator get next label ( ) ; work list set ( orig label ) ; orig label to copied label put ( orig label , result label ) ; / / the new label has the same frame as the original label while ( label to subroutines size ( ) < = result label ) { label to subroutines add ( null ) ; } label to subroutines set ( result label , label to subroutines get ( orig label ) ) ; } return result label ; }


public static string pipeline name ( string id ) { return " xpack monitoring " + id ; }


calculate a resource ' s min share ratios assuming that cpu and memory are the only configured resource types the return array will be populated with the { @ code resource info } divided by { @ code min share info } for each resource type if the min shares are 5 mb and 10 vcores , and the usage ( { @ code resource info } ) is 10 mb and 5 cpu , the ratios will be 2 and 0 5 the length of the { @ code ratios } array must be 2

double [ ] calculate min share ratios ( resource information [ ] resource info , resource information [ ] min share info ) { double [ ] min shares 1 = new double [ 2 ] ; / / both are needy below min share min shares 1 [ resource memory index ] = ( ( double ) resource info [ resource memory index ] get value ( ) ) / min share info [ resource memory index ] get value ( ) ; min shares 1 [ resource vcores index ] = ( ( double ) resource info [ resource vcores index ] get value ( ) ) / min share info [ resource vcores index ] get value ( ) ; return min shares 1 ; }


wrap the given { @ code byte } array in a { @ code data buffer } unlike { @ linkplain # allocate buffer ( int ) allocating } , wrapping does not use new memory


gets the nearest ancestor { @ link abstract build } that belongs to { @ linkplain abstract project # get root project ( ) the root project of get project ( ) } that dominatesgovernsencompasses this build some projects ( such as matrix projects , maven projects , or promotion processes ) form a tree of jobs , and still in some of them , builds of child projects are relatedtied to that of the parent project in such a case , this method returns the governing build

public abstract build < ? , ? > get root build ( ) { return this ; }


returns true if the matcher matches the current context

boolean match ( variable context variables ) ;


returns true if the task executed successfully < p > note : this method only makes sense if called after the task has executed if called before , it will always return false ;

public boolean was successfull ( ) { return success ; }


create a new { @ link job manager job metric group }

job manager job metric group create ( @ nonnull job graph job graph ) ;


to test \ & quot ; client \ & quot ; model to test \ & quot ; client \ & quot ; model

public void test client model test ( test context context ) { async async = context async ( ) ; client body = null ; api test client model ( body , result - > { / / todo : test validations async complete ( ) ; } ) ; }


invalidates an entry for given key if exists this operation will trigger { @ link eviction listener } with { @ link eviction type # explicit }


returns true if the { @ link request } can display a placeholder

boolean can notify status changed ( request request ) ;


return a transaction object for the current transaction state the returned object will usually be specific to the concrete transaction manager implementation , carrying corresponding transaction state in a modifiable fashion this object will be passed into the other template methods ( e g do begin and do commit ) , either directly or as part of a default reactive transaction status instance the returned object should contain information about any existing transaction , that is , a transaction that has already started before the current { @ code get transaction } call on the transaction manager consequently , a { @ code do get transaction } implementation will usually look for an existing transaction and store corresponding state in the returned transaction object

protected abstract object do get transaction ( transaction synchronization manager synchronization manager ) throws transaction exception ;


creates a new data stream that contains the strings received infinitely from a socket received strings are decoded by the system ' s default character set the reader is terminated immediately when the socket is down

public data stream source < string > socket text stream ( string hostname , int port , string delimiter ) { return socket text stream ( hostname , port , delimiter , 0 ) ; }


whether case - sensitive pattern matching is enabled

public boolean is case sensitive ( ) { return this case sensitive ; }


return the property value associated with the given key , or { @ code default value } if the key cannot be resolved

< t > t get property ( string key , class < t > target type , t default value ) ;


route to the supplied router function if the given request predicate applies this method can be used to create nested routes , where a group of routes share a common path ( prefix ) , header , or other request predicate for instance , the following example creates a nested route with a " user " path predicate , so that get requests for " user " will list users , and post request for " user " will create a new user < pre class = " code " > router function & lt ; server response & gt ; nested route = router functions route ( ) nest ( request predicates path ( " user " ) , ( ) - > router functions route ( ) get ( this : : list users ) post ( this : : create user ) build ( ) ) build ( ) ;

builder nest ( request predicate predicate , supplier < router function < server response > > router function supplier ) ;


set the home sub - cluster that this application has been assigned to

public abstract void set home sub cluster ( sub cluster id home sub cluster ) ;


sets a single location for properties files associated with ghidra scripts typically , properties files should be located in the same directory as their corresponding scripts however , this method may need to be used when circumstances make it impossible to have both files in the same directory ( i e , if the scripts are included in ghidra jar )

public void set properties file directory ( string path ) { properties file str paths = new array list < > ( ) ; properties file str paths add ( path ) ; }


public void write ( final point point , final string db name ) { this influx db write ( db name , " autogen " , point ) ; }


get fake : to test enum parameters to test enum parameters

default mono < response entity < void > > test enum parameters ( @ api param ( value = " header parameter enum test ( string array ) " , allowable values = " > , $ " ) @ request header ( value = " enum header string array " , required = false ) list < string > enum header string array , @ api param ( value = " header parameter enum test ( string ) " , allowable values = " abc , - efg , ( xyz ) " , default value = " - efg " ) @ request header ( value = " enum header string " , required = false ) string enum header string , @ api param ( value = " query parameter enum test ( string array ) " , allowable values = " > , $ " ) @ valid @ request param ( value = " enum query string array " , required = false ) list < string > enum query string array , @ api param ( value = " query parameter enum test ( string ) " , allowable values = " abc , - efg , ( xyz ) " , default value = " - efg " ) @ valid @ request param ( value = " enum query string " , required = false , default value = " - efg " ) string enum query string , @ api param ( value = " query parameter enum test ( double ) " , allowable values = " 1 , - 2 " ) @ valid @ request param ( value = " enum query integer " , required = false ) integer enum query integer , @ api param ( value = " query parameter enum test ( double ) " , allowable values = " 1 1 , - 1 2 " ) @ valid @ request param ( value = " enum query double " , required = false ) double enum query double , @ api param ( value = " form parameter enum test ( string array ) " , allowable values = " > , $ " ) @ valid @ request part ( value = " enum form string array " , required = false ) list < string > enum form string array , @ api param ( value = " form parameter enum test ( string ) " , allowable values = " abc , - efg , ( xyz ) " , default value = " - efg " ) @ valid @ request part ( value = " enum form string " , required = false ) string enum form string , @ api ignore final server web exchange exchange ) { return get delegate ( ) test enum parameters ( enum header string array , enum header string , enum query string array , enum query string , enum query integer , enum query double , enum form string array , enum form string , exchange ) ; }


validates the implementation of random read in abfs

public void test random read ( ) throws exception { assume assume false ( " this test does not support namespace enabled account " , this get file system ( ) get is namespace enabled ( ) ) ; path test path = new path ( test file prefix + " test random read " ) ; assume huge file exists ( test path ) ; try ( f s data input stream input stream v 1 = this get file system ( ) open ( test path ) ; f s data input stream input stream v 2 = this get wasb file system ( ) open ( test path ) ; ) { final int buffer size = 4 * kilobyte ; byte [ ] buffer v 1 = new byte [ buffer size ] ; byte [ ] buffer v 2 = new byte [ buffer v 1 length ] ; verify consistent reads ( input stream v 1 , input stream v 2 , buffer v 1 , buffer v 2 ) ; input stream v 1 seek ( 0 ) ; input stream v 2 seek ( 0 ) ; verify consistent reads ( input stream v 1 , input stream v 2 , buffer v 1 , buffer v 2 ) ; verify consistent reads ( input stream v 1 , input stream v 2 , buffer v 1 , buffer v 2 ) ; input stream v 1 seek ( seek position one ) ; input stream v 2 seek ( seek position one ) ; input stream v 1 seek ( 0 ) ; input stream v 2 seek ( 0 ) ; verify consistent reads ( input stream v 1 , input stream v 2 , buffer v 1 , buffer v 2 ) ; verify consistent reads ( input stream v 1 , input stream v 2 , buffer v 1 , buffer v 2 ) ; verify consistent reads ( input stream v 1 , input stream v 2 , buffer v 1 , buffer v 2 ) ; input stream v 1 seek ( seek position two ) ; input stream v 2 seek ( seek position two ) ; verify consistent reads ( input stream v 1 , input stream v 2 , buffer v 1 , buffer v 2 ) ; input stream v 1 seek ( seek position three ) ; input stream v 2 seek ( seek position three ) ; verify consistent reads ( input stream v 1 , input stream v 2 , buffer v 1 , buffer v 2 ) ; verify consistent reads ( input stream v 1 , input stream v 2 , buffer v 1 , buffer v 2 ) ; input stream v 1 seek ( seek position four ) ; input stream v 2 seek ( seek position four ) ; verify consistent reads ( input stream v 1 , input stream v 2 , buffer v 1 , buffer v 2 ) ; } }


creates a { @ link hash set } instance , with a high enough " initial capcity " that it should hold { @ code expected size } elements without growth

private static < t > hash set < t > new hash set with expected size ( int expected size ) { return new hash set < t > ( calculate initial capacity ( expected size ) ) ; }


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

public static fields find by thrift id ( int field id ) { switch ( field id ) { case 0 : / / success return success ; default : return null ; } }


returns the entry class as specified in the manifest of the provided jar file the following manifest attributes are checked in order to find the entry class : { @ link packaged program # manifest attribute assembler class } { @ link packaged program # manifest attribute main class }

static optional < string > find entry class ( file jar file ) throws i o exception { return find first manifest attribute ( jar file , packaged program manifest attribute assembler class , packaged program manifest attribute main class ) ; }


whether to log request params at debug level , and headers at trace level both may contain sensitive information by default set to { @ code false } so that request details are not shown

public void set enable logging request details ( boolean enable ) { this enable logging request details = enable ; }


number of retries that had to be attempted due to search actions being rejected

public long get search retries ( ) { return search retries ; }


initialize the static configuration of caches triggered on startup through { @ link # after properties set ( ) } ; can also be called to re - initialize at runtime

public void initialize caches ( ) { collection < ? extends cache > caches = load caches ( ) ; synchronized ( this cache map ) { this cache names = collections empty set ( ) ; this cache map clear ( ) ; set < string > cache names = new linked hash set < > ( caches size ( ) ) ; for ( cache cache : caches ) { string name = cache get name ( ) ; this cache map put ( name , decorate cache ( cache ) ) ; cache names add ( name ) ; } this cache names = collections unmodifiable set ( cache names ) ; } }


set the role hint for this { @ code bean definition } the role hint provides the frameworks as well as tools an indication of the role and importance of a particular { @ code bean definition }


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


invoked when the given model should be loaded , or checked against an existing one to see if it is different ( in which case , it would be loaded )

public static void start new session ( string trigram file , boolean force reload ) throws i o exception { if ( ! initializations done ) { / / set min string length based on thresholds for ( int i = 0 ; i < ng thresholds length ; i + + ) { if ( ng thresholds [ i ] < 0 ) { minimum string length = i ; break ; } } assign descriptions to a s c i i nums ( ) ; initializations done = true ; } if ( force reload | | ( ! last loaded trigram model equals ( trigram file ) ) ) { log probs = new model log probabilities ( ascii char count ) ; load string models ( trigram file ) ; } }


inserts the specified element at the specified position in the array shifts the element currently at that position ( if any ) and any subsequent elements to the right ( adds one to their indices ) this method returns a new array with the same elements of the input array plus the given element on the specified position the component type of the returned array is always the same as that of the input array if the input array is < code > null < code > , a new one element array is returned whose component type is the same as the element array utils add ( null , 0 , null ) = [ null ] array utils add ( null , 0 , " a " ) = [ " a " ] array utils add ( [ " a " ] , 1 , null ) = [ " a " , null ] array utils add ( [ " a " ] , 1 , " b " ) = [ " a " , " b " ] array utils add ( [ " a " , " b " ] , 3 , " c " ) = [ " a " , " b " , " c " ]

public static < t > t [ ] add ( t [ ] array , int index , t element ) { class clss ; if ( array ! = null ) { clss = array get class ( ) get component type ( ) ; } else if ( element ! = null ) { clss = element get class ( ) ; } else { return ( t [ ] ) new object [ ] { null } ; } return ( t [ ] ) real add ( array , index , element , clss ) ; }


test serialization of object with outer number type < b > 200 < b > - output composite

public outer composite fake outer composite serialize ( outer composite body ) throws rest client exception { return fake outer composite serialize with http info ( body ) get body ( ) ; }


computes the quantile value of the given dataset , performing the computation in - place

public double compute in place ( double dataset ) { check argument ( dataset length > 0 , " cannot calculate quantiles of an empty dataset " ) ; if ( contains na n ( dataset ) ) { return na n ; } / / calculate the quotient and remainder in the integer division x = k * ( n - 1 ) / q , i e / / index * ( dataset length - 1 ) / scale if there is no remainder , we can just find the value / / whose index in the sorted dataset equals the quotient ; if there is a remainder , we / / interpolate between that and the next value / / since index and ( dataset length - 1 ) are non - negative ints , their product can be expressed / / as a long , without risk of overflow : long numerator = ( long ) index * ( dataset length - 1 ) ; / / since scale is a positive int , index is in [ 0 , scale ] , and ( dataset length - 1 ) is a / / non - negative int , we can do long - arithmetic on index * ( dataset length - 1 ) / scale to get / / a rounded ratio and a remainder which can be expressed as ints , without risk of overflow : int quotient = ( int ) long math divide ( numerator , scale , rounding mode down ) ; int remainder = ( int ) ( numerator - ( long ) quotient * scale ) ; select in place ( quotient , dataset , 0 , dataset length - 1 ) ; if ( remainder = = 0 ) { return dataset [ quotient ] ; } else { select in place ( quotient + 1 , dataset , quotient + 1 , dataset length - 1 ) ; return interpolate ( dataset [ quotient ] , dataset [ quotient + 1 ] , remainder , scale ) ; } }


checks if the runnable arose from asynchronous submission of a task to an executor if an uncaught exception was thrown during the execution of this task , we need to inspect this runnable and see if it is an error that should be propagated to the uncaught exception handler

public static throwable rethrow errors ( runnable runnable ) { if ( runnable instanceof runnable future ) { assert ( ( runnable future ) runnable ) is done ( ) ; try { ( ( runnable future ) runnable ) get ( ) ; } catch ( final exception e ) { / * * in theory , future # get can only throw a cancellation exception , an interrupted exception , or an execution * exception we want to ignore cancellation exceptions , restore the interrupt status on interrupted exceptions , and * inspect the cause of an execution we are going to be extra paranoid here though and completely unwrap the * exception to ensure that there is not a buried error anywhere we assume that a general exception has been * handled by the executed task or the task submitter * / assert e instanceof cancellation exception | | e instanceof interrupted exception | | e instanceof execution exception : e ; final optional < error > maybe error = exceptions helper maybe error ( e ) ; if ( maybe error is present ( ) ) { / / throw this error where it will propagate to the uncaught exception handler throw maybe error get ( ) ; } if ( e instanceof interrupted exception ) { / / restore the interrupt status thread current thread ( ) interrupt ( ) ; } if ( e instanceof execution exception ) { return e get cause ( ) ; } } } return null ; }