commit offsets returned on the last { @ link # poll ( duration ) poll ( ) } for all the subscribed list of topics and partitions this commits offsets only to kafka the offsets committed using this api will be used on the first fetch after every rebalance and also on startup as such , if you need to store offsets in anything other than kafka , this api should not be used this is a synchronous commit and will block until either the commit succeeds , an unrecoverable error is encountered ( in which case it is thrown to the caller ) , or the timeout specified by { @ code default api timeout ms } expires ( in which case a { @ link org apache kafka common errors timeout exception } is thrown to the caller ) note that asynchronous offset commits sent previously with the { @ link # commit async ( offset commit callback ) } ( or similar ) are guaranteed to have their callbacks invoked prior to completion of this method

public void commit sync ( ) { commit sync ( duration of millis ( default api timeout ms ) ) ; }


encodes all initial vowels to a encodes non - initial vowels to a if m encode vowels is true

void encode vowels ( ) { if ( m current = = 0 ) { / / all init vowels map to ' a ' / / as of double metaphone metaph add ( " a " ) ; } else if ( m encode vowels ) { if ( char at ( m current ) ! = ' e ' ) { if ( skip silent ue ( ) ) { return ; } if ( o silent ( ) ) { m current + + ; return ; } / / encode all vowels and / / diphthongs to the same value metaph add ( " a " ) ; } else { encode e pronounced ( ) ; } } if ( ! ( ! is vowel ( m current - 2 ) & & string at ( ( m current - 1 ) , 4 , " lewa " , " lewo " , " lewi " , " " ) ) ) { m current = skip vowels ( m current ) ; } else { m current + + ; } }


test @ link { @ link query rescore mode } enum ordinals and names , since serialization relies on it

public void test query rescore mode ( ) throws i o exception { float primary = random float ( ) ; float secondary = random float ( ) ; assert equals ( 0 , query rescore mode avg ordinal ( ) ) ; assert equals ( " avg " , query rescore mode avg to string ( ) ) ; assert equals ( ( primary + secondary ) / 2 0f , query rescore mode avg combine ( primary , secondary ) , float min value ) ; assert equals ( 1 , query rescore mode max ordinal ( ) ) ; assert equals ( " max " , query rescore mode max to string ( ) ) ; assert equals ( math max ( primary , secondary ) , query rescore mode max combine ( primary , secondary ) , float min value ) ; assert equals ( 2 , query rescore mode min ordinal ( ) ) ; assert equals ( " min " , query rescore mode min to string ( ) ) ; assert equals ( math min ( primary , secondary ) , query rescore mode min combine ( primary , secondary ) , float min value ) ; assert equals ( 3 , query rescore mode total ordinal ( ) ) ; assert equals ( " sum " , query rescore mode total to string ( ) ) ; assert equals ( primary + secondary , query rescore mode total combine ( primary , secondary ) , float min value ) ; assert equals ( 4 , query rescore mode multiply ordinal ( ) ) ; assert equals ( " product " , query rescore mode multiply to string ( ) ) ; assert equals ( primary * secondary , query rescore mode multiply combine ( primary , secondary ) , float min value ) ; }


abort a multi - part upload retries are attempted on failures i o exceptions are caught ; this is expected to be run as a cleanup process

void abort ( ) { string operation = string format ( " aborting multi - part upload for ' % s ' , id ' % s " , write operation helper , upload id ) ; try { log debug ( operation ) ; write operation helper abort multipart upload ( key , upload id ) ; } catch ( obs exception e ) { log warn ( " unable to abort multipart upload , you may need to purge " + " uploaded parts " , e ) ; } }


this test case is more specific to internal

public void test when mover is already running before storage policy satisfier ( ) throws exception { }


registers generating actions for { @ code out apk } that build an unsigned apk using single jar

private void build apk ( rule context rule context , artifact out apk ) { artifact compressed apk = get apk artifact ( rule context , " compressed " + out apk get filename ( ) ) ; spawn action builder compressed apk action builder = new spawn action builder ( ) set mnemonic ( " apk builder " ) set progress message ( " generating unsigned % s " , apk name ) add output ( compressed apk ) ; custom command line builder compressed apk command line = custom command line builder ( ) add ( " - - exclude build data " ) add ( " - - compression " ) add ( " - - normalize " ) add exec path ( " - - output " , compressed apk ) ; set single jar as executable ( rule context , compressed apk action builder ) ; if ( classes dex ! = null ) { compressed apk action builder add input ( classes dex ) ; if ( classes dex get filename ( ) ends with ( " zip " ) ) { compressed apk command line add exec path ( " - - sources " , classes dex ) ; } else { compressed apk command line add ( " - - resources " ) add formatted ( " % s : % s " , classes dex , classes dex get filename ( ) ) ; } } if ( java resource file ! = null ) { compressed apk action builder add input ( java resource file ) ; compressed apk command line add ( " - - resources " ) add formatted ( " % s : % s " , java resource file , java resource file get filename ( ) ) ; } for ( string architecture : native libs get map ( ) key set ( ) ) { for ( artifact native lib : native libs get map ( ) get ( architecture ) to list ( ) ) { compressed apk action builder add input ( native lib ) ; compressed apk command line add ( " - - resources " ) add formatted ( " % s : lib / % s / % s " , native lib , architecture , native lib get filename ( ) ) ; } } spawn action builder single jar action builder = new spawn action builder ( ) set mnemonic ( " apk builder " ) set progress message ( " generating unsigned % s " , apk name ) add input ( compressed apk ) add output ( out apk ) ; custom command line builder single jar command line = custom command line builder ( ) ; single jar command line add ( " - - exclude build data " ) add ( " - - dont change compression " ) add ( " - - normalize " ) add exec path ( " - - sources " , compressed apk ) add exec path ( " - - output " , out apk ) ; set single jar as executable ( rule context , single jar action builder ) ; if ( java resource zip ! = null ) { / / the java resource zip contains many files that are unwanted in the apk such as class files artifact extracted java resource zip = get apk artifact ( rule context , " extracted " + java resource zip get filename ( ) ) ; rule context register action ( new spawn action builder ( ) set executable ( resource extractor ) set mnemonic ( " resource extractor " ) set progress message ( " extracting java resources from deploy jar for % s " , apk name ) add input ( java resource zip ) add output ( extracted java resource zip ) add command line ( custom command line builder ( ) add exec path ( java resource zip ) add exec path ( extracted java resource zip ) build ( ) ) use default shell environment ( ) build ( rule context ) ) ; if ( rule context get fragment ( android configuration class ) compress java resources ( ) ) { compressed apk action builder add input ( extracted java resource zip ) ; compressed apk command line add exec path ( " - - sources " , extracted java resource zip ) ; } else { single jar action builder add input ( extracted java resource zip ) ; single jar command line add exec path ( " - - sources " , extracted java resource zip ) ; } } if ( native libs get name ( ) ! = null ) { single jar action builder add input ( native libs get name ( ) ) ; single jar command line add ( " - - resources " ) add formatted ( " % s : % s " , native libs get name ( ) , native libs get name ( ) get filename ( ) ) ; } for ( artifact input zip : input zips build ( ) ) { single jar action builder add input ( input zip ) ; single jar command line add exec path ( " - - sources " , input zip ) ; } list < string > no compress extensions ; if ( rule context get rule ( ) is attr defined ( android rule classes nocompress extensions attr , type string list ) ) { no compress extensions = rule context get expander ( ) with data locations ( ) tokenized ( android rule classes nocompress extensions attr ) ; } else { / / this code is also used by android test , which doesn ' t have this attribute no compress extensions = immutable list of ( ) ; } if ( ! no compress extensions is empty ( ) ) { compressed apk command line add all ( " - - nocompress suffixes " , no compress extensions ) ; single jar command line add all ( " - - nocompress suffixes " , no compress extensions ) ; } compressed apk action builder add command line ( compressed apk command line build ( ) ) ; rule context register action ( compressed apk action builder build ( rule context ) ) ; single jar action builder add command line ( single jar command line build ( ) ) ; rule context register action ( single jar action builder build ( rule context ) ) ; }


get a list of { @ link url } s from the context classloader for all the resources found at the specified path

protected static list < url > get resources ( string path ) throws i o exception { return collections list ( thread current thread ( ) get context class loader ( ) get resources ( path ) ) ; }


this implementation returns just the view name , as this view resolver doesn ' t support localized resolution

protected object get cache key ( string view name , locale locale ) { return view name ; }


public long weight ( ) { return weight ; }


sets a size multiplier that will be applied to the size provided in the constructor to put the new size of the cache if the new size is less than the current size , entries will be evicted until the current size is less than or equal to the new size

public synchronized void set size multiplier ( float multiplier ) { if ( multiplier < 0 ) { throw new illegal argument exception ( " multiplier must be > = 0 " ) ; } max size = math round ( initial max size * multiplier ) ; evict ( ) ; }


clean up any attributes and stored resources


copies the contents of src to dst , starting from src [ src offset ] , copying num elements elements the { @ link buffer } instance ' s { @ link buffer # position ( ) } is used to define the offset into the buffer itself the position and limit will stay the same < b > the buffer must be a direct buffer with native byte order no error checking is performed < b >

public static void copy ( char [ ] src , int src offset , int num elements , buffer dst ) { char buffer buffer = null ; if ( dst instanceof byte buffer ) buffer = ( ( byte buffer ) dst ) as char buffer ( ) ; else if ( dst instanceof char buffer ) buffer = ( char buffer ) dst ; if ( buffer = = null ) throw new gdx runtime exception ( " dst must be a byte buffer or char buffer " ) ; int old position = buffer position ( ) ; buffer put ( src , src offset , num elements ) ; buffer position ( old position ) ; }


rolls the edit log on the active name node requires super - user privileges

public long roll edits ( ) throws i o exception { return dfs roll edits ( ) ; }


resolve schema compatibility given an instance of a { @ code type serializer config snapshot } this method should redirect the compatibility check to the new { @ code type serializer snapshot } class along with the relevant information as present in the given { @ code deprecated config snapshot }

type serializer schema compatibility < e > resolve schema compatibility via redirecting to new snapshot class ( type serializer config snapshot < e > deprecated config snapshot ) ;


public static string get model ( ) { string model = build model ; if ( model ! = null ) { model = model trim ( ) replace all ( " \ \ s * " , " " ) ; } else { model = " " ; } return model ; }


public int get client port ( ) { return client port ; }


returns the number of { @ link action } objects present in this value

default int get num actions ( ) { return get actions ( ) size ( ) ; }


calculate output name map for different source types separately returns a merged output name map for all artifacts

private immutable map < artifact , string > calculate output name map by type ( map < artifact , cpp source > sources , string prefix dir ) { immutable map builder < artifact , string > builder = immutable map builder ( ) ; builder put all ( calculate output name map ( get source artifacts by type ( sources , cpp source type source ) , prefix dir ) ) ; builder put all ( calculate output name map ( get source artifacts by type ( sources , cpp source type header ) , prefix dir ) ) ; / / todo ( plf ) : removing clif logic builder put all ( calculate output name map ( get source artifacts by type ( sources , cpp source type clif input proto ) , prefix dir ) ) ; return builder build ( ) ; }


this test validates the correctness of get nodes in case the cluster is composed of only 1 bad sub cluster the excepted result would be a cluster metrics info with all its values set to 0

public void test get cluster metrics one bad s c ( ) throws yarn exception , i o exception , interrupted exception { setup cluster ( arrays as list ( bad 2 ) ) ; cluster metrics info response = interceptor get cluster metrics info ( ) ; assert assert not null ( response ) ; / / check if we got an empty metrics check empty metrics ( response ) ; }


tests that savepoint loading succeeds when there is non - restored state and it is not allowed

public void test non restored state when allowed ( ) throws exception { final operator i d operator id = new operator i d ( ) ; final int parallelism = 9 ; final completed checkpoint storage location test savepoint = create savepoint with operator subtask state ( 242l , operator id , parallelism ) ; final map < job vertex i d , execution job vertex > tasks = collections empty map ( ) ; final completed checkpoint loaded = checkpoints load and validate checkpoint ( new job i d ( ) , tasks , test savepoint , cl , true ) ; assert true ( loaded get operator states ( ) is empty ( ) ) ; }


if expected values ever change double check that the change is not braking the contract of { @ link streaming runtime context # get operator unique i d ( ) } being stable between job submissions


returns the segment ( msft says section , but we are interpreting as segment for now )

public int get segment ( ) { return section ; }


default collection < single logout url > determine logout url ( final registered service registered service , final web application service single logout service ) { return determine logout url ( registered service , single logout service , optional empty ( ) ) ; }


returns the index to the start of the segment table , relative to the beginning of the ne windows header

short get segment table offset ( ) { return ne segtab ; }


when we load a new patch , we need to rewrite the patch info file but patch info corrupted , we can ' t recover from it

public void on patch info corrupted ( file patch file , string old version , string new version ) { share tinker log i ( tag , " patch reporter on patch info corrupted : patch info is corrupted old : % s , new : % s " , old version , new version ) ; / / patch info is corrupted , just clean all patch tinker with ( context ) clean patch ( ) ; }


reads the given file , translating { @ link i o exception } to a { @ link runtime exception } of some sort

public static byte [ ] read file ( file file ) throws i o exception { if ( ! file exists ( ) ) { throw new runtime exception ( file + " : file not found " ) ; } if ( ! file is file ( ) ) { throw new runtime exception ( file + " : not a file " ) ; } if ( ! file can read ( ) ) { throw new runtime exception ( file + " : file not readable " ) ; } long long length = file length ( ) ; int length = ( int ) long length ; if ( length ! = long length ) { throw new runtime exception ( file + " : file too long " ) ; } byte array output stream baos = new byte array output stream ( length ) ; input stream in = null ; try { in = new buffered input stream ( new file input stream ( file ) ) ; byte [ ] buffer = new byte [ 8192 ] ; int bytes read = 0 ; while ( ( bytes read = in read ( buffer ) ) > 0 ) { baos write ( buffer , 0 , bytes read ) ; } } finally { if ( in ! = null ) { try { in close ( ) ; } catch ( exception e ) { / / ignored } } } return baos to byte array ( ) ; }


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


add mapper that reads and writes fromto the queue

void add mapper ( chain blocking queue < key value pair < ? , ? > > input , chain blocking queue < key value pair < ? , ? > > output , task input output context context , int index ) throws i o exception , interrupted exception { configuration conf = get conf ( index ) ; class < ? > key class = conf get class ( mapper input key class , object class ) ; class < ? > value class = conf get class ( mapper input value class , object class ) ; class < ? > key out class = conf get class ( mapper output key class , object class ) ; class < ? > value out class = conf get class ( mapper output value class , object class ) ; record reader rr = new chain record reader ( key class , value class , input , conf ) ; record writer rw = new chain record writer ( key out class , value out class , output , conf ) ; map runner runner = new map runner ( mappers get ( index ) , create map context ( rr , rw , context , get conf ( index ) ) , rr , rw ) ; threads add ( runner ) ; }


get a { @ code write operation helper } instance this class permits other low - level operations against the store it is unstable and only intended for code with intimate knowledge of the object store if using this , be prepared for changes even on minor point releases

public write operation helper get write operation helper ( ) { return write helper ; }


creates a new { @ code list multimap } that uses the provided map and factory it can generate a multimap based on arbitrary { @ link map } and { @ link list } classes the { @ code factory } - generated and { @ code map } classes determine the multimap iteration order they also specify the behavior of the { @ code equals } , { @ code hash code } , and { @ code to string } methods for the multimap and its returned views the multimap ' s { @ code get } , { @ code remove all } , and { @ code replace values } methods return { @ code random access } lists if the factory does however , the multimap ' s { @ code get } method returns instances of a different class than does { @ code factory get ( ) } the multimap is serializable if { @ code map } , { @ code factory } , the lists generated by { @ code factory } , and the multimap contents are all serializable the multimap is not threadsafe when any concurrent operations update the multimap , even if { @ code map } and the instances generated by { @ code factory } are concurrent read operations will work correctly to allow concurrent update operations , wrap the multimap with a call to { @ link # synchronized list multimap } call this method only when the simpler methods { @ link array list multimap # create ( ) } and { @ link linked list multimap # create ( ) } won ' t suffice note : the multimap assumes complete ownership over of { @ code map } and the lists returned by { @ code factory } those objects should not be manually updated , they should be empty when provided , and they should not use soft , weak , or phantom references

public static < k , v > list multimap < k , v > new list multimap ( map < k , collection < v > > map , final supplier < ? extends list < v > > factory ) { return new custom list multimap < > ( map , factory ) ; }


public completable future < api response < void > > delete pet with http info ( long pet id , string api key ) throws api exception { try { http request builder local var request builder = delete pet request builder ( pet id , api key ) ; return member var http client send async ( local var request builder build ( ) , http response body handlers of string ( ) ) then compose async ( local var response - > { if ( local var response status code ( ) / 100 ! = 2 ) { return completable future failed future ( get api exception ( " delete pet " , local var response ) ) ; } return completable future completed future ( new api response < void > ( local var response status code ( ) , local var response headers ( ) map ( ) , null ) ) ; } ) ; } catch ( api exception e ) { return completable future failed future ( e ) ; } }


increases the size of the backing array to accommodate the specified number of additional items load factor useful before adding many items to avoid multiple backing array resizes

public void ensure capacity ( int additional capacity ) { int table size = table size ( size + additional capacity , load factor ) ; if ( key table length < table size ) resize ( table size ) ; }


renames path src to path dst can take place on local fs or remote dfs

public boolean rename ( path src , path dst ) throws i o exception { return fs rename ( src , dst ) ; }


public long get end pointer ( ) { return end pointer ; }


if a file - based recovery occurs , a recovery target calls this method to reset the recovery stage

public void reset recovery stage ( ) { assert routing entry ( ) recovery source ( ) get type ( ) = = recovery source type peer : " not a peer recovery [ " + routing entry ( ) + " ] " ; assert current engine reference get ( ) = = null ; if ( state ! = index shard state recovering ) { throw new index shard not recovering exception ( shard id , state ) ; } recovery state ( ) set stage ( recovery state stage init ) ; }


public object get attribute ( string name ) { return web app context get attribute ( name ) ; }


the configuration for which the resource is defined < code > optional aapt pb config description config = 2 ; < code >

public builder merge config ( com android aapt resources config description value ) { copy on write ( ) ; instance merge config ( value ) ; return this ; }


public dalv insn with opcode ( dop opcode ) { return new target insn ( opcode , get position ( ) , get registers ( ) , target ) ; }


checks each action in the given collection against the given new action to make sure that they share the same default key binding

public static void assert same default key bindings ( docking action if new action , collection < docking action if > existing actions ) { if ( ! new action get key binding type ( ) supports key bindings ( ) ) { return ; } key binding data new default binding = new action get default key binding data ( ) ; key stroke default ks = get key stroke ( new default binding ) ; for ( docking action if action : existing actions ) { if ( ! action get key binding type ( ) supports key bindings ( ) ) { continue ; } key binding data existing default binding = action get default key binding data ( ) ; key stroke existing ks = get key stroke ( existing default binding ) ; if ( ! objects equals ( default ks , existing ks ) ) { log different key bindings warnig message ( new action , action , existing ks ) ; break ; / / one warning seems like enough } } }


gets the table ' s data source ( if it has one ) only table models that extends { @ link g dynamic column table model } can have a data source

private object get data source ( ) { if ( model instanceof g dynamic column table model ) { return ( ( g dynamic column table model < ? , ? > ) model ) get data source ( ) ; } return null ; }


filters the given stack trace to remove entries known to be present in the test thread that offer little forensic value

public static stack trace element [ ] filter trace ( stack trace element [ ] trace ) { / / @ formatter : off stack trace element [ ] filtered = reflection utilities filter stack trace ( trace , junit org package , junit framework package , mockit junit package , java awt event package , java lang package , sun package , ghidra swing runner ) ; / / @ formatter : on return filtered ; }


returns a string summarizing the results of the xml data read or < code > null < code > if there was nothing to report


returns an immutable sorted map containing the given entries , sorted by the natural ordering of their keys

public static < k extends comparable < ? super k > , v > immutable sorted map < k , v > of ( k k 1 , v v 1 , k k 2 , v v 2 ) { return of entries ( entry of ( k 1 , v 1 ) , entry of ( k 2 , v 2 ) ) ; }


public static void put ( string path , route route , response transformer transformer ) { get instance ( ) put ( path , route , transformer ) ; }


register a listener that will be called when this model is unbound from a view the listener will contribute to this model ' s hash code state per the { @ link com airbnb epoxy epoxy attribute option # do not hash } rules you may clear the listener by setting a null value , or by calling { @ link # reset ( ) }

public model with all private field types on unbind ( on model unbound listener < model with all private field types , object > listener ) { on mutation ( ) ; this on model unbound listener epoxy generated model = listener ; return this ; }


begins a new named array container , having the given name to finish the array call { @ link # pop ( ) }

public u b json writer array ( string name ) throws i o exception { name ( name ) array ( ) ; return this ; }


changes the size of the popup based on the width

public void change popup size ( final int width ) { if ( debug ) { log d ( tag , " change popup size ( ) called with : width = [ " + width + " ] " ) ; } if ( any popup view is null ( ) ) { return ; } final float minimum width = context get resources ( ) get dimension ( r dimen popup minimum width ) ; final int actual width = ( int ) ( width > screen width ? screen width : ( width < minimum width ? minimum width : width ) ) ; final int actual height = ( int ) get minimum video height ( width ) ; if ( debug ) { log d ( tag , " update popup size ( ) updated values : " + " width = [ " + actual width + " ] , height = [ " + actual height + " ] " ) ; } popup layout params width = actual width ; popup layout params height = actual height ; binding surface view set heights ( popup layout params height , popup layout params height ) ; objects require non null ( window manager ) update view layout ( binding get root ( ) , popup layout params ) ; }


evaluate the json path expression against the supplied { @ code content } and assert that the resulting value is an array

public void assert value is array ( string content ) { object value = assert exists and return ( content ) ; matcher assert assert that ( failure reason ( " an array " , value ) , value , core matchers instance of ( list class ) ) ; }


return true if the field includes the { @ code protected } modifier

public boolean is protected ( ) { return modifier is protected ( field get modifiers ( ) ) ; }


creates a new client - side { @ link ssl context }

public static ssl context new client context ( file cert chain file , trust manager factory trust manager factory ) throws s s l exception { return new client context ( null , cert chain file , trust manager factory ) ; }


tests the interaction of requesting memory segments and creating local buffer pool and verifies the number of assigned buffers match after redistributing buffers because of newly requested memory segments or new buffer pools created

public void test uniform distribution bounded 4 ( ) throws i o exception { network buffer pool global pool = new network buffer pool ( 10 , 128 ) ; try { buffer pool first = global pool create buffer pool ( 1 , 10 ) ; assert equals ( 10 , first get num buffers ( ) ) ; list < memory segment > segment list 1 = global pool request memory segments ( 2 ) ; assert equals ( 2 , segment list 1 size ( ) ) ; assert equals ( 8 , first get num buffers ( ) ) ; buffer pool second = global pool create buffer pool ( 1 , 10 ) ; assert equals ( 4 , first get num buffers ( ) ) ; assert equals ( 4 , second get num buffers ( ) ) ; list < memory segment > segment list 2 = global pool request memory segments ( 2 ) ; assert equals ( 2 , segment list 2 size ( ) ) ; assert equals ( 3 , first get num buffers ( ) ) ; assert equals ( 3 , second get num buffers ( ) ) ; list < memory segment > segment list 3 = global pool request memory segments ( 2 ) ; assert equals ( 2 , segment list 3 size ( ) ) ; assert equals ( 2 , first get num buffers ( ) ) ; assert equals ( 2 , second get num buffers ( ) ) ; string msg = " wrong number of available segments after creating buffer pools and requesting segments " ; assert equals ( msg , 2 , global pool get number of available memory segments ( ) ) ; global pool recycle memory segments ( segment list 1 ) ; assert equals ( msg , 4 , global pool get number of available memory segments ( ) ) ; assert equals ( 3 , first get num buffers ( ) ) ; assert equals ( 3 , second get num buffers ( ) ) ; global pool recycle memory segments ( segment list 2 ) ; assert equals ( msg , 6 , global pool get number of available memory segments ( ) ) ; assert equals ( 4 , first get num buffers ( ) ) ; assert equals ( 4 , second get num buffers ( ) ) ; global pool recycle memory segments ( segment list 3 ) ; assert equals ( msg , 8 , global pool get number of available memory segments ( ) ) ; assert equals ( 5 , first get num buffers ( ) ) ; assert equals ( 5 , second get num buffers ( ) ) ; first lazy destroy ( ) ; assert equals ( msg , 9 , global pool get number of available memory segments ( ) ) ; assert equals ( 10 , second get num buffers ( ) ) ; } finally { global pool destroy all buffer pools ( ) ; global pool destroy ( ) ; } }


return the jms connection factory used by the gateway

public final connection factory get connection factory ( ) { return ( this jms template ! = null ? this jms template get connection factory ( ) : null ) ; }


tests if the memory contains a sequence of contiguous bytes that match the given byte array at all bit positions where the mask contains an " on " bit the test will be something like for ( int i = 0 ; i < bytes length ; i + + ) { if ( bytes [ i ] ! = memory get byte ( addr + i ) & amp ; masks [ i ] ) { return false ; } } return false ;

private int match ( address addr , byte [ ] bytes , byte [ ] masks , byte [ ] data , boolean forward ) { try { if ( get bytes ( addr , data ) < data length ) { return 0 ; } / / / / if there is no mask , check is simpler / / if ( masks = = null ) { / / check if the bytes pattern entirely matches the data if ( arrays equals ( data , bytes ) ) { return 1 ; } if ( ! forward ) { return 0 ; } / / check to see if the first byte of the pattern / / matches any byte in the buffer / / if it does , return it ' s negative offset for ( int j = 1 ; j < bytes length ; j + + ) { int off = 0 ; for ( ; off < ( data length - j ) ; off + + ) { if ( bytes [ off ] ! = data [ j + off ] ) { break ; } } if ( off + j = = data length ) { return - j ; } } return - bytes length ; } / / first check if the pattern entirely matches the bytes int i ; for ( i = 0 ; i < bytes length ; i + + ) { if ( ( data [ i ] & masks [ i ] ) ! = ( bytes [ i ] & masks [ i ] ) ) { break ; } } if ( i = = bytes length ) { return 1 ; } if ( ! forward ) { return 0 ; } / / check to see if the first byte of the pattern / / matches any byte in the buffer / / if it does , return it ' s negative offset for ( int j = 1 ; j < bytes length ; j + + ) { int off = 0 ; for ( ; off < ( data length - j ) ; off + + ) { if ( ( bytes [ off ] & masks [ off ] ) ! = ( data [ j + off ] & masks [ off ] ) ) { break ; } } if ( off + j = = data length ) { return - j ; } } return - bytes length ; } catch ( exception e ) { return 0 ; } }


updates the child component if the union of the new dependency component runtime and the current component runtime is greater than the union of the current child runtime and current component runtime the caller should ensure the dependency component is not running

synchronized void add dep info ( critical path component dep , long component finish nanos ) { long current elapsed time = component finish nanos - start nanos ; long aggregated elapsed time = dep get aggregated elapsed time nanos ( ) + current elapsed time ; / / this corrects the overlapping run time if ( dep finish nanos > start nanos ) { aggregated elapsed time - = dep finish nanos - start nanos ; } if ( child = = null | | aggregated elapsed time > this aggregated elapsed time ) { this aggregated elapsed time = aggregated elapsed time ; child = dep ; } }


this method will return a borrowed object to the bag objects that are borrowed from the bag but never " requited " will result in a memory leak

public void requite ( final t bag entry ) { bag entry set state ( state not in use ) ; for ( int i = 0 ; waiters get ( ) > 0 ; i + + ) { if ( bag entry get state ( ) ! = state not in use | | handoff queue offer ( bag entry ) ) { return ; } else if ( ( i & 0xff ) = = 0xff ) { park nanos ( microseconds to nanos ( 10 ) ) ; } else { thread yield ( ) ; } } final list < object > thread local list = thread list get ( ) ; if ( thread local list size ( ) < 50 ) { thread local list add ( weak thread locals ? new weak reference < > ( bag entry ) : bag entry ) ; } }


complete the target with an error signal

public final void error ( throwable t ) { int state = get ( ) ; if ( ( state & ( fused ready | fused consumed | terminated | disposed ) ) ! = 0 ) { rx java plugins on error ( t ) ; return ; } lazy set ( terminated ) ; downstream on error ( t ) ; }


returns and removes the entry associated with the lowest element in this multiset , or returns { @ code null } if this multiset is empty


returns the size in bytes of the jvms exception table corresponding to the handler list that begins with the given element this includes the exception table length field

static int get exception table size ( final handler first handler ) { return 2 + 8 * get exception table length ( first handler ) ; }


this is not defined in the protocol but some servers won ' t add the leading empty space when the message is empty http : www w 3 org protocolsrfc 2 6 1 6rfc 2 6 1 6 - sec 6 html # sec 6 1

@ test public void empty message and no leading space ( ) throws i o exception { int version = 1 ; int code = 503 ; status line status line = status line companion parse ( " http / 1 " + version + " " + code ) ; assert that ( status line message ) is equal to ( " " ) ; assert that ( status line protocol ) is equal to ( protocol http 1 1 ) ; assert that ( status line code ) is equal to ( code ) ; }


sends the http request note that http url connection requires that an empty buffer be sent in order to set the " content - length : 0 " header , which is required by our endpoint

public void send request ( byte [ ] buffer , int offset , int length ) throws i o exception { this connection set do output ( true ) ; this connection set fixed length streaming mode ( length ) ; if ( buffer = = null ) { / / an empty buffer is sent to set the " content - length : 0 " header , which / / is required by our endpoint buffer = new byte [ ] { } ; offset = 0 ; length = 0 ; } / / send the request body long start time = 0 ; if ( this is trace enabled ) { start time = system nano time ( ) ; } try ( output stream output stream = this connection get output stream ( ) ) { / / update bytes sent before they are sent so we may observe / / attempted sends as well as successful sends via the / / accompanying status code this bytes sent = length ; output stream write ( buffer , offset , length ) ; } finally { if ( this is trace enabled ) { this send request time ms = elapsed time ms ( start time ) ; } } }


helper method for stat and inode stat : return the path ' s ( no symlink - followed ) stat

private synchronized inode or errno no follow stat errno ( path path ) { inode or errno dir info or error = get directory errno ( path get parent directory ( ) ) ; if ( dir info or error has error ( ) ) { return dir info or error ; } return directory lookup errno ( dir info or error inode ( ) , base name or windows drive ( path ) , / * create = * / false , path ) ; }


returns if delegation token is transmitted as a http header

public boolean use query string for delegation token ( ) { return use query stringfor delegation token ; }


this method will remove references to the null address and it will adjust thumb references to no longer be offcut

public final static void fixup references ( objective c 1 state state ) { state monitor set message ( " fixing references " ) ; address set address set = new address set ( ) ; list < string > section names = state get objective c section names ( ) ; for ( string section name : section names ) { if ( state monitor is cancelled ( ) ) { break ; } memory block block = state program get memory ( ) get block ( section name ) ; if ( block ! = null ) { / / not all blocks will exist address set add range ( block get start ( ) , block get end ( ) ) ; } } state monitor initialize ( address set get num addresses ( ) ) ; int progress = 0 ; reference manager reference manager = state program get reference manager ( ) ; address iterator reference iterator = reference manager get reference source iterator ( address set , true ) ; while ( reference iterator has next ( ) ) { if ( state monitor is cancelled ( ) ) { break ; } + + progress ; if ( ( progress % 100 ) = = 0 ) { state monitor set progress ( progress ) ; } address source address = reference iterator next ( ) ; reference [ ] references = reference manager get references from ( source address ) ; for ( reference reference : references ) { if ( state monitor is cancelled ( ) ) { break ; } if ( objective c 1 utilities is null ( reference get to address ( ) ) ) { reference manager delete ( reference ) ; } if ( objective c 1 utilities is thumb ( state program , reference get to address ( ) ) ) { reference manager delete ( reference ) ; reference manager add memory reference ( reference get from address ( ) , reference get to address ( ) subtract ( 1 ) , reference get reference type ( ) , reference get source ( ) , reference get operand index ( ) ) ; } } } }


resolve the given resource uri to a { @ code java io file } , i e to a file in the file system

public static file get file ( uri resource uri , string description ) throws file not found exception { assert not null ( resource uri , " resource uri must not be null " ) ; if ( ! url protocol file equals ( resource uri get scheme ( ) ) ) { throw new file not found exception ( description + " cannot be resolved to absolute file path " + " because it does not reside in the file system : " + resource uri ) ; } return new file ( resource uri get scheme specific part ( ) ) ; }


private static int skip whitespace ( string string , int index ) { while ( index < string length ( ) & & character is whitespace ( string char at ( index ) ) ) { index + + ; } return index ; }


reads buffer length number of bytes from the program ' s memory starting at the indicated address

public static void read bytes ( program program , address addr , byte [ ] buffer ) throws memory access exception { program get memory ( ) get bytes ( addr , buffer ) ; }


customize the { @ link configurable application context } created by this { @ code context loader } after bean definitions have been loaded into the context but before the context has been refreshed the default implementation delegates to all { @ link merged context configuration # get context customizers context customizers } that have been registered with the supplied { @ code merged config }

protected void customize context ( configurable application context context , merged context configuration merged config ) { for ( context customizer context customizer : merged config get context customizers ( ) ) { context customizer customize context ( context , merged config ) ; } } / / context loader


test older than ( page down ) when set to id less than the oldest ( should never happen ) should just give an empty list of builds

public void test older than lt oldest ( ) throws i o exception { history page filter < model object > history page filter = new page ( 5 , null , 0l ) ; list < model object > item list = new runs ( 1 , 10 ) ; history page filter add ( item list ) ; assert assert true ( history page filter has up page ) ; assert assert false ( history page filter has down page ) ; assert assert equals ( 0 , history page filter runs size ( ) ) ; }


set the theme to be used for the rationale dialog should it be shown

public builder set theme ( @ style res int theme ) { m theme = theme ; return this ; }


returns the transitive closure of { @ code graph } the transitive closure of a graph is another graph with an edge connecting node a to node b if node b is { @ link # reachable nodes ( graph , object ) reachable } from node a this is a " snapshot " based on the current topology of { @ code graph } , rather than a live view of the transitive closure of { @ code graph } in other words , the returned { @ link graph } will not be updated after modifications to { @ code graph }

public static < n > graph < n > transitive closure ( graph < n > graph ) { mutable graph < n > transitive closure = graph builder from ( graph ) allows self loops ( true ) build ( ) ; / / every node is , at a minimum , reachable from itself since the resulting transitive closure / / will have no isolated nodes , we can skip adding nodes explicitly and let put edge ( ) do it if ( graph is directed ( ) ) { / / note : works for both directed and undirected graphs , but we only use in the directed case for ( n node : graph nodes ( ) ) { for ( n reachable node : reachable nodes ( graph , node ) ) { transitive closure put edge ( node , reachable node ) ; } } } else { / / an optimization for the undirected case : for every node b reachable from node a , / / node a and node b have the same reachability set set < n > visited nodes = new hash set < n > ( ) ; for ( n node : graph nodes ( ) ) { if ( ! visited nodes contains ( node ) ) { set < n > reachable nodes = reachable nodes ( graph , node ) ; visited nodes add all ( reachable nodes ) ; int pairwise match = 1 ; / / start at 1 to include self - loops for ( n node u : reachable nodes ) { for ( n node v : iterables limit ( reachable nodes , pairwise match + + ) ) { transitive closure put edge ( node u , node v ) ; } } } } } return transitive closure ; }


returns an instance that is identical to this one , except that the type bearer is replaced by the actual underlying type ( thereby stripping off non - type information ) with any initialization information stripped away as well

public register spec with simple type ( ) { type bearer orig = type ; type new type ; if ( orig instanceof type ) { new type = ( type ) orig ; } else { new type = orig get type ( ) ; } if ( new type is uninitialized ( ) ) { new type = new type get initialized type ( ) ; } if ( new type = = orig ) { return this ; } return make local optional ( reg , new type , local ) ; }


public static cluster search shards request cluster search shards request ( ) { return new cluster search shards request ( ) ; }


total number of input files or 0 if unavailable

public long input files ( ) { return input files ; }


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 test ( ) { list < string > tags = null ; / / list < pet > response = api find pets by tags ( tags ) ; / / assert not null ( response ) ; / / todo : test validations }


return the configured registry for adapting reactive types

public reactive adapter registry get reactive adapter registry ( ) { return this invocable helper get reactive adapter registry ( ) ; }


create request for uploading one part of a multipart task

upload part request new upload part request ( final string dest key , final string upload id , final int part number , final int size , final input stream upload stream ) { preconditions check not null ( upload id ) ; preconditions check argument ( upload stream ! = null , " data source " ) ; preconditions check argument ( size > 0 , " invalid partition size % s " , size ) ; preconditions check argument ( part number > 0 & & part number < = part number ) ; log debug ( " creating part upload request for { } # { } size { } " , upload id , part number , size ) ; upload part request request = new upload part request ( ) ; request set upload id ( upload id ) ; request set bucket name ( bucket ) ; request set object key ( dest key ) ; request set part size ( ( long ) size ) ; request set part number ( part number ) ; request set input ( upload stream ) ; if ( owner get sse ( ) is sse c enable ( ) ) { request set sse c header ( owner get sse ( ) get sse c header ( ) ) ; } return request ; }


public int solve ( ) { return dancer solve ( printer ) ; }


set whether proxies should perform aggressive optimizations the exact meaning of " aggressive optimizations " will differ between proxies , but there is usually some tradeoff default is " false " for example , optimization will usually mean that advice changes won ' t take effect after a proxy has been created for this reason , optimization is disabled by default an optimize value of " true " may be ignored if other settings preclude optimization : for example , if " expose proxy " is set to " true " and that ' s not compatible with the optimization

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


fills the buffer with a chunk data no mark is supported this method assumes that all data in the buffer has already been read in , hence pos > count

private void fill ( ) throws i o exception { assert ( pos > = count ) ; / / fill internal buffer count = read checksum chunk ( buf , 0 , max chunk size ) ; if ( count < 0 ) count = 0 ; }


returns the number of instructions ( and data ) in the selection

private int get num instructions in selection ( program program , program selection selection ) { / / first get the addresses in the selection ; address range iterator address ranges = selection get address ranges ( ) ; / / keep track of the number of instructions we find int num instructions = 0 ; / / loop over all the addresses , getting all code units and checking to see which ones / / are instructions for those that are , increment our counter while ( address ranges has next ( ) ) { address range range = address ranges next ( ) ; address set addr set = new address set ( range ) ; code unit iterator cu iter = program get listing ( ) get code units ( addr set , true ) ; while ( cu iter has next ( ) ) { code unit cu = cu iter next ( ) ; if ( ( cu instanceof instruction ) | | ( cu instanceof data ) ) { num instructions + + ; } } } return num instructions ; }


creates a new journal that omits redundant information this replaces the current journal if it exists

private synchronized void rebuild journal ( ) throws i o exception { if ( journal writer ! = null ) { close writer ( journal writer ) ; } writer writer = new buffered writer ( new output stream writer ( new file output stream ( journal file tmp ) , util us ascii ) ) ; try { writer write ( magic ) ; writer write ( " \ n " ) ; writer write ( version 1 ) ; writer write ( " \ n " ) ; writer write ( integer to string ( app version ) ) ; writer write ( " \ n " ) ; writer write ( integer to string ( value count ) ) ; writer write ( " \ n " ) ; writer write ( " \ n " ) ; for ( entry entry : lru entries values ( ) ) { if ( entry current editor ! = null ) { writer write ( dirty + ' ' + entry key + ' \ n ' ) ; } else { writer write ( clean + ' ' + entry key + entry get lengths ( ) + ' \ n ' ) ; } } } finally { close writer ( writer ) ; } if ( journal file exists ( ) ) { rename to ( journal file , journal file backup , true ) ; } rename to ( journal file tmp , journal file , false ) ; journal file backup delete ( ) ; journal writer = new buffered writer ( new output stream writer ( new file output stream ( journal file , true ) , util us ascii ) ) ; }


returns a list of all directories in any module that have the given module relative path for example , a relative path of " foobar " will return all directories that are of the form { @ code < module root > datafoobar }

public static list < resource file > find module sub directories ( string relative path ) { check app initialized ( ) ; return app find module directories ( relative path ) ; }


materializes a list of topic names ( optionally with ranges ) into a map of the topics and their partitions example : [ ' foo [ 1 - 3 ] ' , ' foobar : 2 ' , ' bar [ 1 - 2 ] : [ 1 - 2 ] ' ] = > { ' foo 1 ' : [ ] , ' foo 2 ' : [ ] , ' foo 3 ' : [ ] , ' foobar ' : [ 2 ] , ' bar 1 ' : [ 1 , 2 ] , ' bar 2 ' : [ 1 , 2 ] }

map < string , list < topic partition > > materialize topics ( ) { map < string , list < topic partition > > partitions by topics = new hash map < > ( ) ; for ( string raw topic name : this active topics ) { set < string > expanded names = expand topic name ( raw topic name ) ; if ( ! expanded names iterator ( ) next ( ) matches ( valid expanded topic name pattern ) ) throw new illegal argument exception ( string format ( " expanded topic name % s is invalid " , raw topic name ) ) ; for ( string topic name : expanded names ) { topic partition partition = null ; if ( topic name contains ( " : " ) ) { string [ ] topic and partition = topic name split ( " : " ) ; topic name = topic and partition [ 0 ] ; partition = new topic partition ( topic name , integer parse int ( topic and partition [ 1 ] ) ) ; } if ( ! partitions by topics contains key ( topic name ) ) { partitions by topics put ( topic name , new array list < > ( ) ) ; } if ( partition ! = null ) { partitions by topics get ( topic name ) add ( partition ) ; } } } return partitions by topics ; }


appends the string representation of each of { @ code parts } , using the previously configured separator between each , to { @ code appendable }

public < a extends appendable > a append to ( a appendable , iterator < ? > parts ) throws i o exception { check not null ( appendable ) ; if ( parts has next ( ) ) { appendable append ( to string ( parts next ( ) ) ) ; while ( parts has next ( ) ) { appendable append ( separator ) ; appendable append ( to string ( parts next ( ) ) ) ; } } return appendable ; }


return whether horizontal layout direction of views are from right to left

public static boolean is layout rtl ( ) { if ( build version sdk int > = build version codes jelly bean mr1 ) { locale primary locale ; if ( build version sdk int > = build version codes n ) { primary locale = utils get app ( ) get resources ( ) get configuration ( ) get locales ( ) get ( 0 ) ; } else { primary locale = utils get app ( ) get resources ( ) get configuration ( ) locale ; } return text utils get layout direction from locale ( primary locale ) = = view layout direction rtl ; } return false ; }


convert a string to a fs permission object

static fs permission to fs permission ( final string s ) { return null = = s ? null : new fs permission ( short parse short ( s , 8 ) ) ; }


we use a fairly generic error message here the motivation is to share the same message for both bind time errors : < code > guice create injector ( new abstract module ( ) { public void configure ( ) { bind ( runnable class ) ; } } < code > and at provide - time errors : < code > guice create injector ( ) get instance ( runnable class ) ; < code > otherwise we need to know who ' s calling when resolving a just - in - time binding , which makes things unnecessarily complex

public errors missing implementation ( key key ) { return add message ( " no implementation for % s was bound " , key ) ; }


filters the given json response body , removing elements that would impede testing specifically , it removes elapsed time fields , because we cannot predict the exact values

private string filter json ( string str ) { return str replace all ( " \ " elapsed time \ " : \ \ d + \ \ , " , " " ) replace all ( " \ \ , \ " elapsed time \ " : \ \ d + " , " " ) ; }


callback for { @ link job graph } instances added by a different { @ link job graph store } instance important : it is possible to get false positives and be notified about a job graph , which was added by this instance

void on added job graph ( job i d job id ) ;


generates a directory tree with a max depth of < code > max depth < code >

private void gen dir structure ( ) { root = gen dir structure ( " " , max depth ) ; }


adds or remove the bits specified in " permission bits " to the permission mask of the file specified by { @ code path } if the argument { @ code add } is true , the specified permissions are added , otherwise they are removed

private void modify permission bits ( path path , int permission bits , boolean add ) throws i o exception { int old mode = stat internal ( path , true ) get permissions ( ) ; int new mode = add ? ( old mode | permission bits ) : ( old mode & ~ permission bits ) ; native posix files chmod ( path to string ( ) , new mode ) ; }


returns the type to look up a type adapter for when writing { @ code value } to json without this , attempts to emit standard types like ` linked hash map ` would fail because moshi doesn ' t provide built - in adapters for implementation types it knows how to write those types , but lacks a mechanism to read them because it doesn ' t know how to find the appropriate constructor

private class < ? > to json type ( class < ? > value class ) { if ( map class is assignable from ( value class ) ) return map class ; if ( collection class is assignable from ( value class ) ) return collection class ; return value class ; }


given the timestamp and element , returns the set of windows into which it should be placed

public abstract collection < w > assign windows ( row data element , long timestamp ) throws i o exception ;


returns the collected list of input files ( directory , jar , aar , etc , represented as object , string , file , etc )

public list get in jar files ( ) { return in jar files ; }


whether the contained type has any exception mappings

public boolean has exception mappings ( ) { return ! this mapped methods is empty ( ) ; }


returns a new { @ link media metadata } instance with the current builder values

public media metadata build ( ) { return new media metadata ( title ) ; }


tests that get file status on raw and non raw resolve to the same file

public void test get file status ( ) throws exception { final path zone = new path ( " zone " ) ; final path slash zone = new path ( " / " , zone ) ; fs mkdirs ( slash zone ) ; dfs admin create encryption zone ( slash zone , test key , no trash ) ; final path base = new path ( " base " ) ; final path reserved raw = new path ( " / reserved / raw " ) ; final path base raw = new path ( reserved raw , base ) ; final int len = 8192 ; d f s test util create file ( fs , base raw , len , ( short ) 1 , 0x f e e d ) ; assert path equals ( new path ( " / " , base ) , base raw ) ; / * repeat the test for a file in an ez * / final path ez enc file = new path ( slash zone , base ) ; final path ez raw enc file = new path ( new path ( reserved raw , zone ) , base ) ; d f s test util create file ( fs , ez enc file , len , ( short ) 1 , 0x f e e d ) ; assert path equals ( ez enc file , ez raw enc file ) ; }


should be called before the start of each new transaction note that prior to the first invocation of this method , you must invoke { @ link # init transactions ( ) } exactly one time

public void begin transaction ( ) throws producer fenced exception { throw if no transaction manager ( ) ; throw if producer closed ( ) ; transaction manager begin transaction ( ) ; }


gets result of a accessible name and description computation for the accessible name of the element see < a href = " https : www w 3 org t rwebdriver # get - computed - label " > w3c web driver specification for more details

default string get accessible name ( ) { throw new unsupported operation exception ( ) ; }


checks a specific exception class is thrown ( boxed inside script exception ) and returns it

public static < t extends throwable > t expect script throws ( class < t > expected type , boolean should have script stack , throwing runnable runnable ) { try { runnable run ( ) ; } catch ( throwable e ) { if ( e instanceof script exception ) { boolean has empty script stack = ( ( script exception ) e ) get script stack ( ) is empty ( ) ; if ( should have script stack & & has empty script stack ) { / * if this fails you * might * be missing - xx : - omit stack trace in fast throw in the test jvm * in eclipse you can add this by default by going to preference - > java - > installed j r es , * clicking on the default jre , clicking edit , and adding the flag to the * " default vm arguments " * / assertion failed error assertion = new assertion failed error ( " script exception should have a script stack " ) ; assertion init cause ( e ) ; throw assertion ; } else if ( false = = should have script stack & & false = = has empty script stack ) { assertion failed error assertion = new assertion failed error ( " script exception shouldn ' t have a script stack " ) ; assertion init cause ( e ) ; throw assertion ; } e = e get cause ( ) ; if ( expected type is instance ( e ) ) { return expected type cast ( e ) ; } } else { assertion failed error assertion = new assertion failed error ( " expected boxed script exception " ) ; assertion init cause ( e ) ; throw assertion ; } assertion failed error assertion = new assertion failed error ( " unexpected exception type , expected " + expected type get simple name ( ) ) ; assertion init cause ( e ) ; throw assertion ; } throw new assertion failed error ( " expected exception " + expected type get simple name ( ) ) ; }


creates a new solution set update output collector this collector is used by { @ link iteration intermediate task } or { @ link iteration tail task } to update the solution set of workset iterations depending on the task configuration , either a fast ( non - probing ) { @ link org apache flink runtime iterative io solution set fast update output collector } or normal ( re - probing ) { @ link solution set update output collector } is created if a non - null delegate is given , the new { @ link collector } will write back to the solution set and also call collect ( t ) of the delegate

protected collector < ot > create solution set update output collector ( collector < ot > delegate ) { broker < object > solution set broker = solution set broker instance ( ) ; object ss = solution set broker get ( broker key ( ) ) ; if ( ss instanceof compacting hash table ) { @ suppress warnings ( " unchecked " ) compacting hash table < ot > solution set = ( compacting hash table < ot > ) ss ; return new solution set update output collector < ot > ( solution set , delegate ) ; } else if ( ss instanceof join hash map ) { @ suppress warnings ( " unchecked " ) join hash map < ot > map = ( join hash map < ot > ) ss ; return new solution set objects update output collector < ot > ( map , delegate ) ; } else { throw new runtime exception ( " unrecognized solution set handle : " + ss ) ; } }


public boolean is code ( ) { return ! is data ( ) ; }


ensures that an object reference passed as a parameter to the calling method is not null

private static < t > t check not null ( t reference ) throws swift internal state exception { return check not null ( reference , " null reference " ) ; }


public string get a t t n a m e ( ) { return att name ; }


protected void validate path ( string path ) throws invalid pathname exception { / / currently no checks are performed }


uses the constructor to create and initialize a new instance of the constructor ' s declaring class , with the supplied initialization parameters

public object new instance ( object args ) throws reflection exception { try { return constructor new instance ( args ) ; } catch ( illegal argument exception e ) { throw new reflection exception ( " illegal argument ( s ) supplied to constructor for class : " + get declaring class ( ) get name ( ) , e ) ; } }


public void update object ( string column label , object x , int scale or length ) throws s q l exception { }


first check that the atn predicts right alt then check adaptive prediction

public void check predicted alt ( lexer grammar lg , grammar g , int decision , string input string , int expected alt ) { tool internal option show a t n configs in d f a = true ; atn lexatn = create a t n ( lg , true ) ; lexer a t n simulator lex interp = new lexer a t n simulator ( lexatn , new dfa [ ] { new dfa ( lexatn mode to start state get ( lexer default mode ) ) } , new prediction context cache ( ) ) ; integer list types = get token types via a t n ( input string , lex interp ) ; / / system out println ( types ) ; semantic process ( lg ) ; g import vocab ( lg ) ; semantic process ( g ) ; parser a t n factory f = new parser a t n factory ( g ) ; atn atn = f create a t n ( ) ; d o t generator dot = new d o t generator ( g ) ; rule r = g get rule ( " a " ) ; / / if ( r ! = null ) system out println ( dot get d o t ( atn rule to start state [ r index ] ) ) ; r = g get rule ( " b " ) ; / / if ( r ! = null ) system out println ( dot get d o t ( atn rule to start state [ r index ] ) ) ; r = g get rule ( " e " ) ; / / if ( r ! = null ) system out println ( dot get d o t ( atn rule to start state [ r index ] ) ) ; r = g get rule ( " ifstat " ) ; / / if ( r ! = null ) system out println ( dot get d o t ( atn rule to start state [ r index ] ) ) ; r = g get rule ( " block " ) ; / / if ( r ! = null ) system out println ( dot get d o t ( atn rule to start state [ r index ] ) ) ; / / check atn prediction / / parser a t n simulator interp = new parser a t n simulator ( atn ) ; token stream input = new int token stream ( types ) ; parser interpreter for testing interp = new parser interpreter for testing ( g , input ) ; int alt = interp adaptive predict ( input , decision , parser rule context empty ) ; assert equals ( expected alt , alt ) ; / / check adaptive prediction input seek ( 0 ) ; alt = interp adaptive predict ( input , decision , null ) ; assert equals ( expected alt , alt ) ; / / run 2x ; first time creates dfa in atn input seek ( 0 ) ; alt = interp adaptive predict ( input , decision , null ) ; assert equals ( expected alt , alt ) ; }


asserts that the given expected watermarks are present in the actual watermarks in streaming mode otherwise , asserts that the list of actual watermarks is empty in batch mode

private void assert watermarks or empty ( list < watermark > actual watermarks , watermark expected watermarks ) { / / we add the expected long max value watermark to the end we expect that for both / / " streaming " and " batch " mode if ( emit progressive watermarks ) { array list < watermark > watermarks = lists new array list ( expected watermarks ) ; assert that ( actual watermarks , contains ( watermarks to array ( ) ) ) ; } else { assert that ( actual watermarks , has size ( 0 ) ) ; } }


public static void create table ( database db , boolean if not exists ) { string constraint = if not exists ? " if not exists " : " " ; db exec s q l ( " create table " + constraint + " \ " keep entity \ " ( " + / / " \ " id \ " integer primary key ) ; " ) ; / / 0 : id }


creates a fresh entry with the specified object at the specified position in the entry arrays

void insert entry ( int entry index , @ nullable k key , @ nullable v value , int hash ) { this entries [ entry index ] = ( ( long ) hash < < 32 ) | ( next mask & unset ) ; this keys [ entry index ] = key ; this values [ entry index ] = value ; }


void set feedback cursor ( cursor c ) { feedback cursor = c ; }


test to verify that the checksum can be computed with greater than file length

public void test striped file checksum with missed data blocks range query 1 9 ( ) throws exception { int file length = 100 ; string striped file 3 = ec dir + " / striped file checksum 3 " ; prepare test files ( file length , new string [ ] { striped file 3 } ) ; test striped file checksum with missed data blocks range query ( striped file 3 , file length * 2 ) ; }


returns the string name for the constant define of the section type

public final static string get type name ( int type ) { field [ ] fields = section types class get declared fields ( ) ; for ( field field : fields ) { if ( field get name ( ) starts with ( " s " ) ) { try { integer value = ( integer ) field get ( null ) ; if ( value = = type ) { return field get name ( ) substring ( " s " length ( ) ) ; } } catch ( exception e ) { } } } return " unrecognized section type 0x " + integer to hex string ( type ) ; }


returns a { @ code future } whose result is taken from this { @ code future } or , if this { @ code future } fails with the given { @ code exception type } , from the result provided by the { @ code fallback } { @ link async function # apply } is not invoked until the primary input has failed , so if the primary input succeeds , it is never invoked if , during the invocation of { @ code fallback } , an exception is thrown , this exception is used as the result of the output { @ code future } usage examples : { @ code falling back to a zero counter in case an exception happens when processing the rpc to fetch counters listenable future < integer > fault tolerant future = fetch counters ( ) catching async ( fetch exception class , x - > immediate future ( 0 ) , direct executor ( ) ) ; } the fallback can also choose to propagate the original exception when desired : { @ code falling back to a zero counter only in case the exception was a timeout exception listenable future < integer > fault tolerant future = fetch counters ( ) catching async ( fetch exception class , e - > { if ( omit data on fetch failure ) { return immediate future ( 0 ) ; } throw e ; } , direct executor ( ) ) ; } when selecting an executor , note that { @ code direct executor } is dangerous in some cases see the discussion in the { @ link # add listener } documentation all its warnings about heavyweight listeners are also applicable to heavyweight functions passed to this method ( specifically , { @ code direct executor } functions should avoid heavyweight operations inside { @ code async function apply } any heavyweight operations should occur in other threads responsible for completing the returned { @ code future } ) this method is similar to { @ link java util concurrent completable future # exceptionally } it can also serve some of the use cases of { @ link java util concurrent completable future # handle } and { @ link java util concurrent completable future # handle async } when used along with { @ link # transform }

public final < x extends throwable > fluent future < v > catching async ( class < x > exception type , async function < ? super x , ? extends v > fallback , executor executor ) { return ( fluent future < v > ) futures catching async ( this , exception type , fallback , executor ) ; }


creates an { @ link internal timer service } for handling a group of timers identified by the given { @ code name } the timers are scoped to a key and namespace when a timer fires the given { @ link triggerable } will be invoked

< n > internal timer service < n > get internal timer service ( string name , type serializer < k > key serializer , type serializer < n > namespace serializer , triggerable < k , n > triggerable ) ;


@ t c description : @ test step : @ expect result :

public void multiple tenant multi group register instance ( ) throws exception { string service name = random domain name ( ) ; naming 1 register instance ( service name , test group 1 , " 11 11 11 11 " , 80 ) ; naming 2 register instance ( service name , test group 2 , " 22 22 22 22 " , 80 ) ; naming register instance ( service name , " 33 33 33 33 " , 8888 ) ; naming register instance ( service name , " 44 44 44 44 " , 8888 ) ; time unit seconds sleep ( 5l ) ; list < instance > instances = naming 1 get all instances ( service name ) ; assert assert equals ( 0 , instances size ( ) ) ; instances = naming 2 get all instances ( service name , test group 2 ) ; assert assert equals ( 1 , instances size ( ) ) ; assert assert equals ( " 22 22 22 22 " , instances get ( 0 ) get ip ( ) ) ; assert assert equals ( 80 , instances get ( 0 ) get port ( ) ) ; instances = naming get all instances ( service name ) ; assert assert equals ( 2 , instances size ( ) ) ; naming 1 deregister instance ( service name , test group 1 , " 11 11 11 11 " , 80 ) ; naming 1 deregister instance ( service name , test group 2 , " 22 22 22 22 " , 80 ) ; }


public void test model return ( ) { / / todo : test model return }


returns true if there is a { @ link code unit } for the address wrapped by this info if not , then we do not have a valid addreess

public boolean is valid address ( ) { return ( address code unit ! = null ) ; }


test uam work preserving restart when the keep containers across attempt flag is on , we allow uam to directly register again and move on without getting the application already registered exception

protected void test u a m restart ( boolean keep containers ) throws exception { / / start rm mock r m rm = new mock r m ( ) ; rm start ( ) ; mock n m nm = new mock n m ( " 127 0 0 1 : 1234 " , 15120 , rm get resource tracker service ( ) ) ; nm register node ( ) ; / / create app and launch the uam boolean unamanged = true ; int max attempts = 1 ; boolean wait for accepted = true ; mock r m app submission data data = mock r m app submission data builder create with memory ( 200 , rm ) with app name ( " " ) with user ( user group information get current user ( ) get short user name ( ) ) with acls ( null ) with unmanaged a m ( unamanged ) with queue ( null ) with max app attempts ( max attempts ) with credentials ( null ) with app type ( null ) with wait for app accepted state ( wait for accepted ) with keep containers ( keep containers ) build ( ) ; r m app app = mock r m app submitter submit ( rm , data ) ; mock a m am = mock r m launch u a m ( app , rm , nm ) ; / / register for the first time am register app attempt ( ) ; / / allocate two containers to uam int num containers = 3 ; list < container > conts = am allocate ( " 127 0 0 1 " , 1000 , num containers , new array list < container id > ( ) ) get allocated containers ( ) ; while ( conts size ( ) < num containers ) { nm node heartbeat ( true ) ; conts add all ( am allocate ( new array list < resource request > ( ) , new array list < container id > ( ) ) get allocated containers ( ) ) ; thread sleep ( 100 ) ; } / / release one container list < container id > release list = collections singleton list ( conts get ( 0 ) get id ( ) ) ; list < container status > finished conts = am allocate ( new array list < resource request > ( ) , release list ) get completed containers statuses ( ) ; while ( finished conts size ( ) < release list size ( ) ) { nm node heartbeat ( true ) ; finished conts add all ( am allocate ( new array list < resource request > ( ) , new array list < container id > ( ) ) get completed containers statuses ( ) ) ; thread sleep ( 100 ) ; } / / register for the second time register application master response response = null ; try { response = am register app attempt ( false ) ; } catch ( invalid application master request exception e ) { assert assert equals ( false , keep containers ) ; return ; } assert assert equals ( " rm should not allow second register " + " for uam without keep container flag " , true , keep containers ) ; / / expecting the two running containers previously assert assert equals ( 2 , response get containers from previous attempts ( ) size ( ) ) ; assert assert equals ( 1 , response get n m tokens from previous attempts ( ) size ( ) ) ; / / allocate one more containers to uam , just to be safe num containers = 1 ; am allocate ( " 127 0 0 1 " , 1000 , num containers , new array list < container id > ( ) ) ; nm node heartbeat ( true ) ; conts = am allocate ( new array list < resource request > ( ) , new array list < container id > ( ) ) get allocated containers ( ) ; while ( conts size ( ) < num containers ) { nm node heartbeat ( true ) ; conts add all ( am allocate ( new array list < resource request > ( ) , new array list < container id > ( ) ) get allocated containers ( ) ) ; thread sleep ( 100 ) ; } rm stop ( ) ; }


the primary payload for the resource < code > google protobuf any body = 2 ; < code >

public builder merge body ( com google protobuf any value ) { if ( body builder = = null ) { if ( body ! = null ) { body = com google protobuf any new builder ( body ) merge from ( value ) build partial ( ) ; } else { body = value ; } on changed ( ) ; } else { body builder merge from ( value ) ; } return this ; }


gets the azure storage account name corresponding to this instance of configuration

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


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


sets the name of the button to be used as the default button

public option dialog builder set default button ( string option name ) { default option = option name ; return this ; }


{ @ inherit doc } the default implementation returns the result of calling { @ link # visit children } on { @ code ctx }

@ override public t visit select expression ( sql base parser select expression context ctx ) { return visit children ( ctx ) ; }


entrypoint of the dispatcher process entry point other arguments are parsed to a { @ link configuration } and passed to the dispatcher , for instance : < code > - - high - availability zookeeper - - high - availability zookeeper quorum " xyz : 123 : 456 " < code >

public static void main ( string [ ] args ) { try { parameter tool params = parameter tool from args ( args ) ; configuration config = params get configuration ( ) ; log info ( " configuration : { } " , config ) ; config set integer ( job manager options port , 0 ) ; config set string ( rest options bind port , " 0 " ) ; final standalone session cluster entrypoint cluster entrypoint = new standalone session cluster entrypoint ( config ) ; cluster entrypoint run cluster entrypoint ( cluster entrypoint ) ; } catch ( throwable t ) { log error ( " failed to start dispatcher process " , t ) ; system exit ( 1 ) ; } }


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


creates a { @ link top docs collector context } from the provided < code > search context < code >

static top docs collector context create top docs collector context ( search context search context , boolean has filter collector ) throws i o exception { final index reader reader = search context searcher ( ) get index reader ( ) ; final query query = search context query ( ) ; / / top collectors don ' t like a size of 0 final int total num docs = math max ( 1 , reader num docs ( ) ) ; if ( search context size ( ) = = 0 ) { / / no matter what the value of from is return new empty top docs collector context ( reader , query , search context sort ( ) , search context track total hits up to ( ) , has filter collector ) ; } else if ( search context scroll context ( ) ! = null ) { / / we can disable the tracking of total hits after the initial scroll query / / since the total hits is preserved in the scroll context int track total hits up to = search context scroll context ( ) total hits ! = null ? search context track total hits disabled : search context track total hits accurate ; / / no matter what the value of from is int num docs = math min ( search context size ( ) , total num docs ) ; return new scrolling top docs collector context ( reader , query , search context scroll context ( ) , search context sort ( ) , num docs , search context track scores ( ) , search context number of shards ( ) , track total hits up to , has filter collector ) ; } else if ( search context collapse ( ) ! = null ) { boolean track scores = search context sort ( ) = = null ? true : search context track scores ( ) ; int num docs = math min ( search context from ( ) + search context size ( ) , total num docs ) ; return new collapsing top docs collector context ( search context collapse ( ) , search context sort ( ) , num docs , track scores ) ; } else { int num docs = math min ( search context from ( ) + search context size ( ) , total num docs ) ; final boolean rescore = search context rescore ( ) is empty ( ) = = false ; if ( rescore ) { assert search context sort ( ) = = null ; for ( rescore context rescore context : search context rescore ( ) ) { num docs = math max ( num docs , rescore context get window size ( ) ) ; } } return new simple top docs collector context ( reader , query , search context sort ( ) , search context search after ( ) , num docs , search context track scores ( ) , search context track total hits up to ( ) , has filter collector ) { @ override boolean should rescore ( ) { return rescore ; } } ; } }


sets a new placeholder drawable with old scale type

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


gets the target path of the file write operation

public path get path ( ) { return path ; }


return a clone of this resolver instance if necessary , retaining its local configuration and allowing for the cloned instance to get associated with a new bean factory , or this original instance if there is no such state the default implementation creates a separate instance via the default class constructor , assuming no specific configuration state to copy subclasses may override this with custom configuration state handling or with standard { @ link cloneable } support ( as implemented by spring ' s own configurable { @ code autowire candidate resolver } variants ) , or simply return { @ code this } ( as in { @ link simple autowire candidate resolver } )

default autowire candidate resolver clone if necessary ( ) { return bean utils instantiate class ( get class ( ) ) ; }


returns a hash function implementing the message authentication code ( mac ) algorithm , using the md5 ( 128 hash bits ) hash function and a { @ link secret key spec } created from the given byte array and the md5 algorithm

public static hash function hmac md 5 ( byte [ ] key ) { return hmac md 5 ( new secret key spec ( check not null ( key ) , " hmac m d 5 " ) ) ; }


sets the aliases that will be associated with the index when it gets created

public put index template request builder set aliases ( string source ) { request aliases ( source ) ; return this ; }


the reload request should go to only one shard per node the index lives on

protected shards iterator shards ( cluster state cluster state , reload analyzers request request , string [ ] concrete indices ) { routing table routing table = cluster state routing table ( ) ; list < shard routing > shards = new array list < > ( ) ; for ( string index : concrete indices ) { set < string > nodes covered = new hash set < > ( ) ; index routing table index routing table = routing table index ( index ) ; for ( index shard routing table index shard routing table : index routing table ) { for ( shard routing shard routing : index shard routing table ) { if ( nodes covered contains ( shard routing current node id ( ) ) = = false ) { shards add ( shard routing ) ; nodes covered add ( shard routing current node id ( ) ) ; } } } } return new plain shards iterator ( shards ) ; }


receives the instance of the corresponding field , and expects the implementor to return an editor value representation of it this structure will be replicated for the values received by { @ link editor # write ( field , object , editor value ) }

editor value read ( field f , object node ) ;


fetch the wrapped client use this to make calls that don ' t set { @ link action request # set parent task ( task id ) }

public client unwrap ( ) { return in ( ) ; }


public double get double ( ) { return double ; }


interprets the command - line arguments by expanding each pattern to targets and populating the list of { @ code failed patterns }

private static list < expanded pattern > get targets to build ( environment env , target pattern phase key options , immutable map < repository name , repository name > repo mapping , list < string > failed patterns ) throws interrupted exception { immutable list builder < string > canonical patterns = new immutable list builder < > ( ) ; for ( string raw pattern : options get target patterns ( ) ) { canonical patterns add ( target pattern rename repository ( raw pattern , repo mapping ) ) ; } list < target pattern key > pattern sky keys = new array list < > ( options get target patterns ( ) size ( ) ) ; for ( target pattern sky key or exception key or exception : target pattern value keys ( canonical patterns build ( ) , options get build manual tests ( ) ? filtering policies no filter : filtering policies filter manual , options get offset ( ) ) ) { try { pattern sky keys add ( key or exception get sky key ( ) ) ; } catch ( target parsing exception e ) { failed patterns add ( key or exception get original pattern ( ) ) ; / / we post a pattern expanding error here - the pattern could not be parsed , so we don ' t even / / get to run target pattern function env get listener ( ) post ( pattern expanding error failed ( key or exception get original pattern ( ) , e get message ( ) ) ) ; / / we generally skip patterns that don ' t parse we report a parsing failed exception to the / / event bus here , but not in determine tests below , which goes through the same list note / / that the target pattern function otherwise reports these events ( but only if the target / / pattern could be parsed successfully ) env get listener ( ) post ( new parsing failed event ( key or exception get original pattern ( ) , e get message ( ) ) ) ; try { env get value or throw ( target pattern error function key ( e get message ( ) ) , target parsing exception class ) ; } catch ( target parsing exception ignore ) { / / we ignore this keep going is active } env get listener ( ) handle ( event error ( " skipping ' " + key or exception get original pattern ( ) + " ' : " + e get message ( ) ) ) ; } } map < sky key , value or exception < target parsing exception > > resolved patterns = env get values or throw ( pattern sky keys , target parsing exception class ) ; list < expanded pattern > expanded patterns = new array list < > ( pattern sky keys size ( ) ) ; for ( target pattern key pattern : pattern sky keys ) { target pattern value value ; try { value = ( target pattern value ) resolved patterns get ( pattern ) get ( ) ; } catch ( target parsing exception e ) { string raw pattern = pattern get pattern ( ) ; string error message = e get message ( ) ; failed patterns add ( raw pattern ) ; env get listener ( ) post ( pattern expanding error failed ( raw pattern , error message ) ) ; env get listener ( ) handle ( event error ( " skipping ' " + raw pattern + " ' : " + error message ) ) ; continue ; } if ( value = = null ) { continue ; } / / todo ( ulfjack ) : this is terribly inefficient resolved targets < target > as targets = tests for target pattern function labels to targets ( env , value get targets ( ) get targets ( ) , value get targets ( ) has error ( ) ) ; if ( as targets = = null ) { continue ; } expanded patterns add ( expanded pattern of ( pattern , as targets ) ) ; } return expanded patterns ; }


simply verify invocation structure in memory : entrance node ( default context name ) - - interface node ( interface name ) - - - - method node ( resource name )

private void verify invocation structure ( invoker invoker , invocation invocation ) { context context = context util get context ( ) ; assert not null ( context ) ; / / as not call context util enter ( resource name , application ) in sentinel dubbo consumer filter , use default context / / in actual project , a consumer is usually also a provider , the context will be created by / / sentinel dubbo provider filter / / if consumer is on the top of dubbo rpc invocation chain , use default context string resource name = consumer filter get method name ( invoker , invocation , null ) ; assert equals ( com alibaba csp sentinel constants context default name , context get name ( ) ) ; assert equals ( " " , context get origin ( ) ) ; default node entrance node = context get entrance node ( ) ; resource wrapper entrance resource = entrance node get id ( ) ; assert equals ( com alibaba csp sentinel constants context default name , entrance resource get name ( ) ) ; assert same ( entry type in , entrance resource get entry type ( ) ) ; / / as sph u entry ( interface name , entry type out ) ; set < node > child list = entrance node get child list ( ) ; assert equals ( 1 , child list size ( ) ) ; default node interface node = get node ( dubbo utils get interface name ( invoker ) , entrance node ) ; resource wrapper interface resource = interface node get id ( ) ; assert equals ( dubbo utils get interface name ( invoker ) , interface resource get name ( ) ) ; assert same ( entry type out , interface resource get entry type ( ) ) ; / / as sph u entry ( resource name , entry type out ) ; child list = interface node get child list ( ) ; assert equals ( 1 , child list size ( ) ) ; default node method node = get node ( resource name , entrance node ) ; resource wrapper method resource = method node get id ( ) ; assert equals ( resource name , method resource get name ( ) ) ; assert same ( entry type out , method resource get entry type ( ) ) ; / / verify cur entry entry cur entry = context get cur entry ( ) ; assert same ( method node , cur entry get cur node ( ) ) ; assert same ( interface node , cur entry get last node ( ) ) ; assert null ( cur entry get origin node ( ) ) ; / / as context origin is not " " , no origin node should be created in cur entry / / verify cluster node cluster node method cluster node = method node get cluster node ( ) ; cluster node interface cluster node = interface node get cluster node ( ) ; assert not same ( method cluster node , interface cluster node ) ; / / different resource - > different processor slot - > different cluster node / / as context origin is " " , the statistic node should not be created in origin count map of cluster node map < string , statistic node > method origin count map = method cluster node get origin count map ( ) ; assert equals ( 0 , method origin count map size ( ) ) ; map < string , statistic node > interface origin count map = interface cluster node get origin count map ( ) ; assert equals ( 0 , interface origin count map size ( ) ) ; }


returns all matching container requests that match the given priority , resource name , execution type and capability note : this matches only requests that were made by the client without the allocation request id specified

public list < ? extends collection < t > > get matching requests ( priority priority , string resource name , execution type execution type , resource capability ) { return client get matching requests ( priority , resource name , execution type , capability ) ; }


public final void write ( final data output data output ) throws i o exception { worker id write ( data output ) ; hostname write ( data output ) ; ip add write ( data output ) ; }


enter a parse tree produced by the { @ code time escaped literal } labeled alternative in { @ link sql base parser # constant }

void enter time escaped literal ( sql base parser time escaped literal context ctx ) ;


generate the client id based on the configuration

static string generate client id ( admin client config config ) { string client id = config get string ( admin client config client id config ) ; if ( ! client id is empty ( ) ) return client id ; return " adminclient - " + admin client id sequence get and increment ( ) ; }


public cli blob get blob ( int index ) { return blob map get ( index ) ; }


returns the { @ link h a proxy proxied protocol } of this { @ link h a proxy message }

public h a proxy proxied protocol proxied protocol ( ) { return proxied protocol ; }


return the class loader to load class path resources with will get passed to class path resource ' s constructor for all class path resource objects created by this resource loader

public class loader get class loader ( ) { return ( this class loader ! = null ? this class loader : class utils get default class loader ( ) ) ; }


private mono < connection > get connection ( ) { return connection factory utils get connection ( obtain connection factory ( ) ) ; }


public static void drop table ( database db , boolean if exists ) { string sql = " drop table " + ( if exists ? " if exists " : " " ) + " \ " string key value entity \ " " ; db exec s q l ( sql ) ; }


public void set max client cnxns per host ( int max ) { max client cnxns = max ; }


returns the query for selecting the records , subclasses can override this for custom behaviour

protected string get select query ( ) { string builder query = new string builder ( ) ; data driven d b input format data driven d b input split data split = ( data driven d b input format data driven d b input split ) get split ( ) ; d b configuration db conf = get d b conf ( ) ; string [ ] field names = get field names ( ) ; string table name = get table name ( ) ; string conditions = get conditions ( ) ; / / build the where clauses associated with the data split first / / we need them in both branches of this function string builder condition clauses = new string builder ( ) ; condition clauses append ( " ( " ) append ( data split get lower clause ( ) ) ; condition clauses append ( " ) and ( " ) append ( data split get upper clause ( ) ) ; condition clauses append ( " ) " ) ; if ( db conf get input query ( ) = = null ) { / / we need to generate the entire query query append ( " select " ) ; for ( int i = 0 ; i < field names length ; i + + ) { query append ( field names [ i ] ) ; if ( i ! = field names length - 1 ) { query append ( " , " ) ; } } query append ( " from " ) append ( table name ) ; if ( ! db product name starts with ( " oracle " ) ) { / / seems to be necessary for hsqldb ? oracle explicitly does * not * / / use this clause query append ( " as " ) append ( table name ) ; } query append ( " where " ) ; if ( conditions ! = null & & conditions length ( ) > 0 ) { / / put the user ' s conditions first query append ( " ( " ) append ( conditions ) append ( " ) and " ) ; } / / now append the conditions associated with our split query append ( condition clauses to string ( ) ) ; } else { / / user provided the query we replace the special token with our where clause string input query = db conf get input query ( ) ; if ( input query index of ( data driven d b input format substitute token ) = = - 1 ) { log error ( " could not find the clause substitution token " + data driven d b input format substitute token + " in the query : [ " + input query + " ] parallel splits may not work correctly " ) ; } query append ( input query replace ( data driven d b input format substitute token , condition clauses to string ( ) ) ) ; } log debug ( " using query : " + query to string ( ) ) ; return query to string ( ) ; }


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

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


get the attribute from the specified { @ link annotation annotation }

static < t > t get attribute ( annotation annotation , string attribute name ) throws illegal argument exception { return annotation = = null ? null : invoke method ( annotation , attribute name ) ; }


returns whether caching has been deemed safe by looking at the previous test run ( for local caching ) if the previous run is not present , return " true " here , as remote execution caching should be safe

public boolean should cache result ( ) { return ! execute unconditionally ( ) ; }


adds a sort against the given field name and the sort ordering

public search request builder add sort ( string field , sort order order ) { source builder ( ) sort ( field , order ) ; return this ; }


wrap the supplied { @ link statement } with a { @ code run before test class callbacks } statement

private statement with before test class callbacks ( statement next , test context manager test context manager ) { return new run before test class callbacks ( next , test context manager ) ; }


the unit tests below are from operation merge and should ensure the normal merge functionality is correct

public void merge flowable of flowables ( ) { final flowable < string > f 1 = flowable unsafe create ( new test synchronous flowable ( ) ) ; final flowable < string > f 2 = flowable unsafe create ( new test synchronous flowable ( ) ) ; flowable < flowable < string > > flowable of flowables = flowable unsafe create ( new publisher < flowable < string > > ( ) { @ override public void subscribe ( subscriber < ? super flowable < string > > subscriber ) { subscriber on subscribe ( new boolean subscription ( ) ) ; / / simulate what would happen in a flowable subscriber on next ( f 1 ) ; subscriber on next ( f 2 ) ; subscriber on complete ( ) ; } } ) ; flowable < string > m = flowable merge delay error ( flowable of flowables ) ; m subscribe ( string subscriber ) ; verify ( string subscriber , never ( ) ) on error ( any ( throwable class ) ) ; verify ( string subscriber , times ( 1 ) ) on complete ( ) ; verify ( string subscriber , times ( 2 ) ) on next ( " hello " ) ; }


returns results program for update this represents the checkin program containing the merged data program returned will be released by the merge test facilitator when disposed or re - initialized

public program d b get result program ( ) { return result program ; }


returns the last build that was actually built - i e , skipping any with result not built

public @ check for null run t get previous built build ( ) { run t r = get previous build ( ) ; / / in certain situations ( aborted m 2 builds ) r get result ( ) can still be null , although it should theoretically never happen while ( r ! = null & & ( r get result ( ) = = null | | r get result ( ) = = result not built ) ) r = r get previous build ( ) ; return r ; }


convenience method to get this array as a { @ link number } if it contains a single element

public number get as number ( ) { if ( elements size ( ) = = 1 ) { return elements get ( 0 ) get as number ( ) ; } throw new illegal state exception ( ) ; }


returns the filter for this model the value returned from this method will not be null , but will instead be an instanceof { @ link null table filter } when no filter is applied the value returned from this method may not actually yet be applied , depending upon when the background thread finishes loading

public table filter < row object > get table filter ( ) { if ( pending table filter ! = null ) { return pending table filter ; } return table filter ; }


returns a set of { @ code proto } sources that may be re - exported by this { @ code proto library } ' s direct sources

nested set < proto source > get public import sources ( ) { return public import sources ; }


reset state so the cell can be reused , setting all constraints to their { @ link # defaults ( ) default } values

public void reset ( ) { actor = null ; table = null ; end row = false ; cell above index = - 1 ; set ( defaults ( ) ) ; }


checks if the state is { @ link # cancelled } or { @ link # interrupted }

boolean is cancelled ( ) { return ( get state ( ) & ( cancelled | interrupted ) ) ! = 0 ; }


an alternative to { @ link # media type }

public content negotiation configurer media types ( @ nullable map < string , media type > media types ) { if ( media types ! = null ) { this media types put all ( media types ) ; } return this ; }


the { @ code @ before test method } condition in { @ link test event listener configuration # before test method ( before test method event ) } only matches if the test method is annotated with { @ code @ traceable } , and { @ link example test case # standard test ( ) } is not

public void before test method annotation with failing condition ( ) throws exception { method standard test = reflection utils find method ( example test case class , " standard test " ) ; test context manager before test method ( test instance , standard test ) ; verify ( listener , never ( ) ) before test method ( test context ) ; }


returns a { @ link list } of all initializing shards , including target shards of relocations

public list < shard routing > get all initializing shards ( ) { return this all initializing shards ; }


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


the name of the original source - topic , which may have been replicated multiple hops returns the topic if it is not a remote topic

default string original topic ( string topic ) { string upstream = upstream topic ( topic ) ; if ( upstream = = null ) { return topic ; } else { return original topic ( upstream ) ; } }


lists access control lists ( a c ls ) according to the supplied filter note : it may take some time for changes made by { @ code create acls } or { @ code delete acls } to be reflected in the output of { @ code describe acls } this operation is supported by brokers with version 0 11 0 0 or higher

describe acls result describe acls ( acl binding filter filter , describe acls options options ) ;


set the job ' s jar file by finding an example class location

public void set jar by class ( class cls ) { string jar = class util find containing jar ( cls ) ; if ( jar ! = null ) { set jar ( jar ) ; } }