unregisters an object to be closed when the plugin shuts down

public synchronized void unregister closeable ( closeable c ) { close set remove ( c ) ; }


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

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


hash code for the subclass of { @ link suggestion builder } to implement

protected abstract int do hash code ( ) ;


returns the authority ( hostname & port ) used by the jetty server

public static inet socket address get authority ( ) { server server = get jetty server ( ) ; try { inet address add = inet address get by name ( ( ( server connector ) server get connectors ( ) [ 0 ] ) get host ( ) ) ; int port = ( ( server connector ) server get connectors ( ) [ 0 ] ) get port ( ) ; return new inet socket address ( add , port ) ; } catch ( unknown host exception ex ) { throw new runtime exception ( ex ) ; } }


stop the re - encryption updater thread , as well as all edek re - encryption tasks submitted

void stop threads ( ) { assert dir has write lock ( ) ; synchronized ( this ) { for ( zone submission tracker zst : submissions values ( ) ) { zst cancel all tasks ( ) ; } } if ( updater executor ! = null ) { updater executor shutdown now ( ) ; } }


find an element matching an example element

int find element to remove ( object key ) { if ( key = = null | | size ( ) = = 0 ) { return invalid index ; } int slot = slot ( elements , key ) ; int best slot = invalid index ; for ( int seen = 0 ; seen < elements length ; seen + + ) { element element = elements [ slot ] ; if ( element = = null ) { return best slot ; } if ( key = = element ) { return slot ; } else if ( element element keys are equal ( key ) ) { best slot = slot ; } slot = ( slot + 1 ) % elements length ; } return invalid index ; }


given a builder for quota usage , parse the provided json object and construct the relevant fields return the updated builder

private static < t extends quota usage builder > t build quota usage ( t builder , j s o n object json , class < t > type ) { long quota = ( long ) json get ( quota usage quota json ) ; long space consumed = ( long ) json get ( quota usage space consumed json ) ; long space quota = ( long ) json get ( quota usage space quota json ) ; j s o n object type json = ( j s o n object ) json get ( quota usage type quota json ) ; builder = type cast ( builder quota ( quota ) space consumed ( space consumed ) space quota ( space quota ) ) ; / / content summary doesn ' t set this so check before using it if ( json get ( quota usage file and directory count json ) ! = null ) { long file and directory count = ( long ) json get ( quota usage file and directory count json ) ; builder = type cast ( builder file and directory count ( file and directory count ) ) ; } if ( type json ! = null ) { for ( storage type t : storage type get types supporting quota ( ) ) { j s o n object type quota = ( j s o n object ) type json get ( t to string ( ) ) ; if ( type quota ! = null ) { builder = type cast ( builder type quota ( t , ( ( long ) type quota get ( quota usage quota json ) ) ) type consumed ( t , ( ( long ) type quota get ( quota usage consumed json ) ) ) ) ; } } } return builder ; }


calculates diff between two immutable open maps of non - diffable objects

public static < k , t > map diff < k , t , immutable open map < k , t > > diff ( immutable open map < k , t > before , immutable open map < k , t > after , key serializer < k > key serializer , value serializer < k , t > value serializer ) { assert after ! = null & & before ! = null ; return new immutable open map diff < > ( before , after , key serializer , value serializer ) ; }


public static void read patterns ( resource file file , array list < pattern > patlist , pattern factory pfactory ) throws s a x exception , i o exception { error handler handler = new error handler ( ) { @ override public void error ( s a x parse exception exception ) throws s a x exception { throw new s a x exception ( " error : " + exception ) ; } @ override public void fatal error ( s a x parse exception exception ) throws s a x exception { throw new s a x exception ( " fatal error : " + exception ) ; } @ override public void warning ( s a x parse exception exception ) throws s a x exception { throw new s a x exception ( " warning : " + exception ) ; } } ; xml pull parser parser ; try ( input stream input stream = file get input stream ( ) ) { parser = new non threaded xml pull parser impl ( input stream , file get name ( ) , handler , false ) ; } parser start ( " patternlist " ) ; xml element el = parser peek ( ) ; while ( el is start ( ) ) { if ( el get name ( ) equals ( " patternpairs " ) ) { pattern pair set pairset = new pattern pair set ( ) ; pairset restore xml ( parser , pfactory ) ; pairset create final patterns ( patlist ) ; } else { pattern pat = new pattern ( ) ; pat restore xml ( parser , pfactory ) ; patlist add ( pat ) ; } el = parser peek ( ) ; } parser end ( ) ; }


tell the terminal that the following text will be normal text , not indicating a status or similar

ansi terminal writer normal ( ) throws i o exception ;


configures a friendly name for the generator this will be used by the generator to select the library with the - g flag

public string get name ( ) { return " scala - gatling " ; }


builds normal , tangent and binormal of a renderable provider with default colors ( normal blue , tangent red , binormal green )

public static void build normals ( mesh part builder builder , renderable provider renderable provider , float vector size ) { build normals ( builder , renderable provider , vector size , tmp color 0 set ( 0 , 0 , 1 , 1 ) , tmp color 1 set ( 1 , 0 , 0 , 1 ) , tmp color 2 set ( 0 , 1 , 0 , 1 ) ) ; }


if set , this node is an elementtag < code > optional aapt pb xml element element = 1 ; < code >

public builder set element ( com android aapt resources xml element builder builder for value ) { copy on write ( ) ; instance set element ( builder for value ) ; return this ; }


if the pattern misses the delimiter , add " " to the beginning and end otherwise , return the original pattern

public string add regular expression delimiter ( string pattern ) { if ( string utils is empty ( pattern ) ) { return pattern ; } if ( ! pattern matches ( " ^ / * " ) ) { return " / " + pattern replace all ( " / " , " \ \ \ \ / " ) + " / " ; } return pattern ; }


subclasses should invoke this method to set the result of the computation to { @ code value } this will set the state of the future to { @ link base future sync # completed } and call { @ link # done ( boolean ) } if the state was successfully changed

protected boolean set ( @ nullable v value ) { boolean result = sync set ( value ) ; if ( result ) { done ( true ) ; } return result ; }


test a { @ link decoder # decode to mono decode } scenario where the input stream contains an error this test method will feed the first element of the { @ code input } stream to the decoder , followed by an { @ link input exception } the result is expected to contain the error

protected void test decode to mono error ( publisher < data buffer > input , resolvable type output type , @ nullable mime type mime type , @ nullable map < string , object > hints ) { input = mono from ( input ) concat with ( flux error ( new input exception ( ) ) ) ; mono < ? > result = this decoder decode to mono ( input , output type , mime type , hints ) ; step verifier create ( result ) expect error ( input exception class ) verify ( ) ; }


returns a list of the parameters for this demangled functions

public list < demangled data type > get parameters ( ) { return new array list < > ( parameters ) ; }


checks if a simple naming context builder is active

public static simple naming context builder get current context builder ( ) { return activated ; }


updates the asset manager continuously for the specified number of milliseconds , yielding the cpu to the loading thread between updates this may block for less time if all loading tasks are complete this may block for more time if the portion of a single task that happens in the gl thread takes a long time

public boolean update ( int millis ) { long end time = time utils millis ( ) + millis ; while ( true ) { boolean done = update ( ) ; if ( done | | time utils millis ( ) > end time ) return done ; thread utils yield ( ) ; } }


public string to string ( ) { return this original sql ; }


creates a trigger that fires when the processing time passes the end of the window

public static < w extends window > after end of window < w > after end of window ( ) { return new after end of window < > ( ) ; }


simulate a failure on the first job commit ; expect the second to succeed

public void test committer with no outputs ( ) throws exception { describe ( " have a task and job with no outputs : expect success " ) ; job data job data = start job ( new failing committer factory ( ) , false ) ; task attempt context t context = job data t context ; abstract s 3 a committer committer = job data committer ; / / do commit committer commit task ( t context ) ; assert task attempt path does not exist ( committer , t context ) ; }


stops a program on flink cluster whose job - manager is configured in this client ' s configuration stopping works only for streaming programs be aware , that the program might continue to run for a while after sending the stop command , because after sources stopped to emit data all operators need to finish processing

completable future < string > stop with savepoint ( final job i d job id , final boolean advance to end of event time , @ nullable final string savepoint directory ) ;


serializes this filter into a save state object

public save state save ( ) { save state save state = new save state ( " column table filter " ) ; save state put string ( " name " , name ) ; save state put int ( " column filter count " , constraint sets size ( ) ) ; for ( int i = 0 ; i < constraint sets size ( ) ; i + + ) { column constraint set < r , ? > constraint set = constraint sets get ( i ) ; save state save = constraint set save ( ) ; save state put xml element ( " column filter " + i , save save to xml ( ) ) ; } return save state ; }


calculates a " load " , given on two deltas

public static double calc load ( long delta cpu time , long delta uptime , long factor ) { if ( delta cpu time = = null | | delta cpu time < = 0 | | delta uptime = = 0 ) { return 0 0 ; } return delta cpu time * 1 0 0d / factor / delta uptime ; }


private void set equate ( long address , string name ) throws exception { go to listing ( address , " operands " , true ) ; perform action ( set action , cb get provider ( ) , false ) ; set equate dialog d = wait for dialog component ( set equate dialog class ) ; final j text field tf = find component ( d get component ( ) , j text field class ) ; set text ( tf , name ) ; swing utilities invoke and wait ( ( ) - > tf get action listeners ( ) [ 0 ] action performed ( null ) ) ; program flush events ( ) ; }


returns whether this predicate can be used while simplifying other or operands

default boolean allowed in or ( rel opt predicate list predicates ) { return true ; }


private mono < object > get default value ( named value info named value info , method parameter parameter , binding context binding context , model model , server web exchange exchange ) { return mono from supplier ( ( ) - > { object value = null ; if ( named value info default value ! = null ) { value = resolve embedded values and expressions ( named value info default value ) ; } else if ( named value info required & & ! parameter is optional ( ) ) { handle missing value ( named value info name , parameter , exchange ) ; } value = handle null value ( named value info name , value , parameter get nested parameter type ( ) ) ; value = apply conversion ( value , named value info , parameter , binding context , exchange ) ; handle resolved value ( value , named value info name , parameter , model , exchange ) ; return value ; } ) ; }


public builder < k , v > put ( entry < ? extends k , ? extends v > entry ) { super put ( entry ) ; return this ; }


private < t > t [ ] sort ( t [ ] a ) { arrays sort ( a , new comparator < t > ( ) { public int compare ( t o 1 , t o 2 ) { return o 1 get class ( ) get name ( ) compare to ( o 2 get class ( ) get name ( ) ) ; } } ) ; return a ; }


group a - user a group b - user a , user b group c - user c spnego filter has been enabled user a has the privilege to impersonate users in group b user a has admin access to all default servlets , but user b and user c don ' t have so " logs " can only be accessed by user a

public void test authentication with proxy user ( ) throws exception { configuration spengo conf = get spengo conf ( new configuration ( ) ) ; / / setup logs dir system set property ( " hadoop log dir " , test root dir get absolute path ( ) ) ; / / setup user group user group information create user for testing ( " user a " , new string [ ] { " group a " , " group b " } ) ; user group information create user for testing ( " user b " , new string [ ] { " group b " } ) ; user group information create user for testing ( " user c " , new string [ ] { " group c " } ) ; / / make user a impersonate users in group b spengo conf set ( " hadoop proxyuser user a hosts " , " * " ) ; spengo conf set ( " hadoop proxyuser user a groups " , " group b " ) ; proxy users refresh super user groups configuration ( spengo conf ) ; http server 2 http server = null ; try { / / create http server to test http server = get common builder ( ) set conf ( spengo conf ) set a c l ( new access control list ( " user a group a " ) ) build ( ) ; http server start ( ) ; / / get signer to encrypt token signer signer = get signer to encrypt ( ) ; / / setup auth token for user a authenticated u r l token token = get encrypted auth token ( signer , " user a " ) ; string server u r l = " http : / / " + net utils get host port string ( http server get connector address ( 0 ) ) + " / " ; / / the default authenticator is kerberos authenticated u r l auth url = new authenticated u r l ( ) ; / / user a impersonates user b , it ' s allowed for ( string servlet : new string [ ] { " stacks " , " jmx " , " conf " } ) { http u r l connection conn = auth url open connection ( new url ( server u r l + servlet + " ? do as = user b " ) , token ) ; assert assert equals ( http u r l connection http ok , conn get response code ( ) ) ; } / / user a cannot impersonate user c , it fails for ( string servlet : new string [ ] { " stacks " , " jmx " , " conf " } ) { http u r l connection conn = auth url open connection ( new url ( server u r l + servlet + " ? do as = user c " ) , token ) ; assert assert equals ( http u r l connection http forbidden , conn get response code ( ) ) ; } / / " / logs " and " / log level " require admin authorization , / / only user a has the access for ( string servlet : new string [ ] { " log level " , " logs " } ) { http u r l connection conn = auth url open connection ( new url ( server u r l + servlet ) , token ) ; assert assert equals ( http u r l connection http ok , conn get response code ( ) ) ; } / / setup token for user b token = get encrypted auth token ( signer , " user b " ) ; / / user b cannot access these servlets for ( string servlet : new string [ ] { " log level " , " logs " } ) { http u r l connection conn = auth url open connection ( new url ( server u r l + servlet ) , token ) ; assert assert equals ( http u r l connection http forbidden , conn get response code ( ) ) ; } } finally { if ( http server ! = null ) { http server stop ( ) ; } } }


covert an exception to an i o exception for a non - i o exception , wrap it with i o exception for a remote exception , unwrap it for an i o exception which is not a remote exception , return it

private static i o exception to i o exception ( exception e ) { if ( ! ( e instanceof i o exception ) ) { return new i o exception ( e ) ; } final i o exception ioe = ( i o exception ) e ; if ( ! ( ioe instanceof remote exception ) ) { return ioe ; } return ( ( remote exception ) ioe ) unwrap remote exception ( ) ; }


set id andor class attributes for an element

public static < e extends core attrs > e set selector ( e e , string selector ) { string [ ] res = parse selector ( selector ) ; if ( res [ s id ] ! = null ) { e $ id ( res [ s id ] ) ; } if ( res [ s class ] ! = null ) { e $ class ( res [ s class ] ) ; } return e ; }


public @ non null group id v2 migrate to v 2 ( long thread id , @ non null group id v1 group id v 1 , @ non null decrypted group decrypted group ) { s q lite database db = database helper get writable database ( ) ; group id v2 group id v 2 = group id v 1 derive v 2 migration group id ( ) ; group master key group master key = group id v 1 derive v 2 migration master key ( ) ; db begin transaction ( ) ; try { group record record = get group ( group id v 1 ) get ( ) ; content values content values = new content values ( ) ; content values put ( group id , group id v 2 to string ( ) ) ; content values put ( v2 master key , group master key serialize ( ) ) ; content values put null ( expected v2 id ) ; list < recipient id > new members = uuids to recipient ids ( decrypted group util members to uuid list ( decrypted group get members list ( ) ) ) ; list < recipient id > pending members = uuids to recipient ids ( decrypted group util pending to uuid list ( decrypted group get pending members list ( ) ) ) ; new members add all ( pending members ) ; list < recipient id > dropped members = new array list < > ( set util difference ( record get members ( ) , new members ) ) ; list < recipient id > unmigrated members = util concatenated list ( pending members , dropped members ) ; content values put ( unmigrated v1 members , unmigrated members is empty ( ) ? null : recipient id to serialized list ( unmigrated members ) ) ; int updated = db update ( table name , content values , group id + " = ? " , sql util build args ( group id v 1 to string ( ) ) ) ; if ( updated ! = 1 ) { throw new assertion error ( ) ; } database factory get recipient database ( context ) update group id ( group id v 1 , group id v 2 ) ; update ( group master key , decrypted group ) ; database factory get sms database ( context ) insert group v 1 migration events ( record get recipient id ( ) , thread id , new group migration membership change ( pending members , dropped members ) ) ; db set transaction successful ( ) ; } finally { db end transaction ( ) ; } return group id v 2 ; }


returns an instance which specifies that the natural ordering of the elements is guaranteed

public static < s extends comparable < ? super s > > element order < s > natural ( ) { return new element order < s > ( type sorted , ordering < s > natural ( ) ) ; }


assert the response status code is { @ code http status permanent redirect } ( 308 )

public result matcher is permanent redirect ( ) { return matcher ( http status value of ( 308 ) ) ; }


this method extracts the actual queue name from an app add event currently unfortunately application placement context and application submission context are used in a quite erratic way , this method helps to get the proper placement path for the queue if placement context is provided

private string get added app queue name ( app added scheduler event app added event ) { / / app added event uses the queue from application submission context but in / / the case of cs it may be only a leaf name due to legacy reasons string ret = app added event get queue ( ) ; application placement context placement context = app added event get placement context ( ) ; / / if we have a placement context , it means a mapping rule made a decision / / about the queue placement , so we use those data , it is supposed to be in / / sync with the application submission context and app added event get queue , but / / because of the aforementioned legacy reasons these two may only contain / / the leaf queue name if ( placement context ! = null ) { string leaf name = placement context get queue ( ) ; string parent name = placement context get parent queue ( ) ; if ( leaf name ! = null ) { / / building the proper queue path from the parent and leaf queue name ret = placement context has parent queue ( ) ? ( parent name + " " + leaf name ) : leaf name ; } } return ret ; }


returns the list of x d s servers to be connected to

list < server info > get servers ( ) { return collections unmodifiable list ( servers ) ; }


initialize the index generator , this will be called only once before { @ link # generate ( row ) } is called


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

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


returns a new { @ code path fragment } formed by replacing the extension of the last path segment of { @ code path } with { @ code new extension } null is returned iff { @ code path } has zero segments

public static path fragment replace extension ( path fragment path , string new extension ) { return path replace name ( remove extension ( path get base name ( ) ) + new extension ) ; }


public void schedule update if absent ( string service name , string clusters ) { if ( future map get ( service info get key ( service name , clusters ) ) ! = null ) { return ; } synchronized ( future map ) { if ( future map get ( service info get key ( service name , clusters ) ) ! = null ) { return ; } scheduled future < ? > future = add task ( new update task ( service name , clusters ) ) ; future map put ( service info get key ( service name , clusters ) , future ) ; } }


this is called when the { @ link mount item } s mounted on this { @ link mount state } need to be re - bound with the same render unit this happens when a detachattach happens on the root { @ link host } that owns the mount state

public void attach ( ) { if ( m render unit ids = = null ) { return ; } for ( int i = 0 , size = m render unit ids length ; i < size ; i + + ) { final mount item mount item = get item at ( i ) ; if ( mount item = = null | | mount item is bound ( ) ) { continue ; } final object content = mount item get content ( ) ; bind render unit to content ( m mount delegate , m context , mount item ) ; if ( content instanceof view & & ! ( content instanceof host ) & & ( ( view ) content ) is layout requested ( ) ) { final view view = ( view ) content ; bounds utils apply bounds to mount content ( mount item get render tree node ( ) , view , true ) ; } } }


return the { @ link bitset filter cache } for this index

public bitset filter cache bitset filter cache ( ) { return bitset filter cache ; }


public integer get integer ( ) { return integer ; }


for caching to work correctly , implementations must implement this method and { @ link # equals ( object ) }


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


override this method to truncate a terminated buffer based on its properties ( i e , truncate but the very last node )

void truncate final ( ) { trim head ( ) ; }


call get metrics on source and get a record builder mock to verify

public static metrics record builder get metrics ( metrics source source , boolean all ) { metrics record builder rb = mock metrics record builder ( ) ; metrics collector mc = rb parent ( ) ; source get metrics ( mc , all ) ; return rb ; }


sets an enum setting with the provided setting key and enum instance

public builder put ( string key , enum < ? > enum value ) { return put ( key , enum value to string ( ) ) ; }


< b > note : < b > this method is not presently used

public int [ ] get registers by frequency ( ) { int reg count = ssa meth get reg count ( ) ; integer [ ] ret = new integer [ reg count ] ; for ( int i = 0 ; i < reg count ; i + + ) { ret [ i ] = i ; } arrays sort ( ret , new comparator < integer > ( ) { public int compare ( integer o 1 , integer o 2 ) { return ssa meth get use list for register ( o 2 ) size ( ) - ssa meth get use list for register ( o 1 ) size ( ) ; } } ) ; int result [ ] = new int [ reg count ] ; for ( int i = 0 ; i < reg count ; i + + ) { result [ i ] = ret [ i ] ; } return result ; }


return the formatted time string differ time span

public static string get string ( final long millis , @ non null final date format format , final long time span , @ time constants unit final int unit ) { return millis 2 string ( millis + time span 2 millis ( time span , unit ) , format ) ; }


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


encodes bing tile as a 64 - bit long : version ( 5 bits ) , 0 ( 4 bits ) , x ( 23 bits ) , zoom ( 5 bits ) , 0 ( 4 bits ) , y ( 23 bits ) ( high bits left , low bits right ) this arrangement maximizes low - bit entropy for the java long hash function

public long encode ( ) { / / java ' s long hash function just x o rs itself right shifted 32 / / this is used for bucketing , so if you have 2 ^ k buckets , this only / / keeps the k lowest bits this puts the highest entropy bits / / ( finest resolution x and y bits ) in places that contribute to the / / low bits of the hash return ( ( ( long ) version < < version offset ) | y | ( ( long ) x < < 32 ) | ( ( long ) zoom level < < zoom offset ) ) ; }


verifies normal operation of the strings analyzer - - that these specific strings are created by the analyzer when default options are checked !

public void test default strings creation ( ) throws exception { program test program = build program ( " libopencoreplayer so " , false ) ; data data here ; string string here ; listing listing = test program get listing ( ) ; address space space = test program get language ( ) get address factory ( ) get default address space ( ) ; string [ ] existing strings = new string [ ] { " drm / duration " , " p v f m video m i o " , " set to invalid mode ( % d ) " , " device " , " height " , " player quit " , " video / decoder " } ; int [ ] offsets = new int [ ] { 0xa 7 1 9 8 1 2 0 , 0xa 7 1 9 5fd 4 , 0xa 7 1 9 6ee 8 , 0xa 7 1 7fa 4 8 , 0xa 7 1 9 5 6a 0 , 0xa 7 1 9 7 3 0 4 , 0xa 7 1 8 0 2 5c } ; address [ ] existing addresses = new address [ offsets length ] ; for ( int i = 0 ; i < offsets length ; i + + ) { existing addresses [ i ] = addr ( space , offsets [ i ] ) ; } / / verify strings aren ' t already there for ( address existing addresse : existing addresses ) { data here = listing get defined data at ( existing addresse ) ; assert null ( data here ) ; } auto analysis manager manager = auto analysis manager get analysis manager ( test program ) ; / / run strings analyzer that shouldn ' t make the bigger string around this one strings analyzer analyzer = new strings analyzer ( ) ; analyzer set create string over existing string ( false ) ; analyzer set string end alignment ( 1 ) ; analyzer added ( test program , null , monitor , manager get message log ( ) ) ; for ( int i = 0 ; i < existing strings length ; i + + ) { / / verify string is actually there data here = listing get defined data at ( existing addresses [ i ] ) ; assert not null ( data here ) ; string here = data here get default value representation ( ) ; assert equals ( " \ " " + existing strings [ i ] + " \ " " , string here ) ; } }


the offset of the part string into the parent string

public int get offset ( ) { return offset ; }


performs an aggregate operation on a window grouped table you have to close the { @ link # aggregate ( expression ) } with a select statement the output will be flattened if the output type is a composite type example : { @ code window grouped table aggregate ( call ( my aggregate function class , $ ( " a " ) , $ ( " b " ) ) as ( " x " , " y " , " z " ) ) select ( $ ( " key " ) , $ ( " window " ) start ( ) , $ ( " x " ) , $ ( " y " ) , $ ( " z " ) ) ; } scala example : { @ code val agg func = new my aggregate function window grouped table aggregate ( agg func ( ' a , ' b ) as ( ' x , ' y , ' z ) ) select ( ' key , ' window start , ' x , ' y , ' z ) }

aggregated table aggregate ( expression aggregate function ) ;


count the number of records in this stream by the grouped key records with { @ code null } key or value are ignored the result is written into a local { @ link key value store } ( which is basically an ever - updating materialized view ) provided by the given store name in { @ code materialized } furthermore , updates to the store are sent downstream into a { @ link k table } changelog stream not all updates might get sent downstream , as an internal cache is used to deduplicate consecutive updates to the same key the rate of propagated updates depends on your input data rate , the number of distinct keys , the number of parallel running kafka streams instances , and the { @ link streams config configuration } parameters for { @ link streams config # cache max bytes buffering config cache size } , and { @ link streams config # commit interval ms config commit interval } to query the local { @ link read only key value store } it must be obtained via { @ link kafka streams # store ( store query parameters ) kafka streams # store ( ) } { @ code kafka streams streams = counting words string queryable store name = " store name " ; the store name should be the name of the store as defined by the materialized instance read only key value store < k , value and timestamp < long > > local store = streams store ( queryable store name , queryable store types < k , value and timestamp < long > > timestamped key value store ( ) ) ; k key = " some - word " ; value and timestamp < long > count for word = local store get ( key ) ; key must be local ( application state is shared over all running kafka streams instances ) } for non - local keys , a custom rpc mechanism must be implemented using { @ link kafka streams # all metadata ( ) } to query the value of the key on a parallel running instance of your kafka streams application for failure and recovery the store ( which always will be of type { @ link timestamped key value store } - - regardless of what is specified in the parameter { @ code materialized } ) will be backed by an internal changelog topic that will be created in kafka therefore , the store name defined by the materialized instance must be a valid kafka topic name and cannot contain characters other than ascii alphanumerics , ' ' , ' ' and ' - ' the changelog topic will be named " $ { application id } - $ { store name } - changelog " , where " application id " is user - specified in { @ link streams config } via parameter { @ link streams config # application id config application id config } , " store name " is the provide store name defined in { @ code materialized } , and " - changelog " is a fixed suffix you can retrieve all generated internal topic names via { @ link topology # describe ( ) }

k table < k , long > count ( final named named , final materialized < k , long , key value store < bytes , byte [ ] > > materialized ) ;


friendly way to create an array of bytes with static values

public static byte [ ] bytes ( int unsigned bytes ) { byte [ ] result = new byte [ unsigned bytes length ] ; for ( int i = 0 ; i < unsigned bytes length ; i + + ) { result [ i ] = ( byte ) unsigned bytes [ i ] ; } return result ; }


internal version of { @ link wait until active handler }

public static channel handler wait until active handler ( channel handler next ) { return new wait until active handler ( next ) ; }


evaluates an expression ' s response to binding the specified input symbols to null

private row expression null input evaluator ( final collection < variable reference expression > null symbols , row expression expression ) { expression = row expression node inliner replace expression ( expression , null symbols stream ( ) collect ( collectors to map ( identity ( ) , variable - > constant null ( variable get type ( ) ) ) ) ) ; return new row expression optimizer ( metadata ) optimize ( expression , expression optimizer level optimized , session to connector session ( ) ) ; }


checks if the provided path string contains a windows drive letter

private boolean has windows drive ( string path , boolean slashed ) { final int start = slashed ? 1 : 0 ; return path length ( ) > = start + 2 & & ( ! slashed | | path char at ( 0 ) = = ' / ' ) & & path char at ( start + 1 ) = = ' : ' & & ( ( path char at ( start ) > = ' a ' & & path char at ( start ) < = ' z ' ) | | ( path char at ( start ) > = ' a ' & & path char at ( start ) < = ' z ' ) ) ; }


create a drawable for the given image it is guaranteed that this method is only called if { @ link # supports image type ( closeable image ) } returned true

drawable create drawable ( @ nonnull closeable image image ) ;


boolean has render tree hosts ( r result ) ;


linearly interpolates between from value to to value on progress position

static public float lerp ( float from value , float to value , float progress ) { return from value + ( to value - from value ) * progress ; }


populates a multiset by reading an input stream , as part of deserialization see { @ link # write multiset } for the data format

static < e > void populate multiset ( multiset < e > multiset , object input stream stream ) throws i o exception , class not found exception { int distinct elements = stream read int ( ) ; populate multiset ( multiset , stream , distinct elements ) ; }


attempt to export a random number of documents via { @ code exporters } from multiple threads

private int assert exporters ( final exporters exporters ) throws interrupted exception { final thread [ ] threads = new thread [ 3 + random int ( 7 ) ] ; final cyclic barrier barrier = new cyclic barrier ( threads length ) ; final list < throwable > exceptions = new copy on write array list < > ( ) ; final atomic integer counter = new atomic integer ( threads length ) ; int total = 0 ; for ( int i = 0 ; i < threads length ; i + + ) { final int thread docs = random int between ( 10 , 50 ) ; final int thread num = i ; total + = thread docs ; threads [ i ] = new thread ( new abstract runnable ( ) { @ override public void on failure ( exception e ) { exceptions add ( e ) ; } @ override protected void do run ( ) throws exception { final list < monitoring doc > docs = new array list < > ( ) ; for ( int n = 0 ; n < thread docs ; n + + ) { docs add ( new test monitoring doc ( random alpha of length ( 5 ) , random non negative long ( ) , random non negative long ( ) , null , monitored system es , random alpha of length ( 5 ) , null , string value of ( n ) ) ) ; } exporters export ( docs , action listener wrap ( r - > { counter decrement and get ( ) ; logger debug ( " - - > thread [ { } ] successfully exported { } documents " , thread num , thread docs ) ; } , e - > { exceptions add ( e ) ; logger debug ( " - - > thread [ { } ] failed to export { } documents " , thread num , thread docs ) ; } ) ) ; barrier await ( 10 , time unit seconds ) ; } } , " export thread " + i ) ; threads [ i ] start ( ) ; } for ( thread thread : threads ) { thread join ( ) ; } assert that ( exceptions , empty ( ) ) ; assert that ( counter get ( ) , is ( 0 ) ) ; return total ; }


public erasure coding policy [ ] get enabled policies ( ) { return enabled policies ; }


test the property ' prefix namespace wrapped array '

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


the collection of items to add to the filter

public void set add items ( collection < string > add items ) { this add items = new tree set < > ( objects require non null ( add items , " [ " + add items get preferred name ( ) + " ] must not be null " ) ) ; }


sets up two of the nodes to each drop a single rpc , at all possible combinations of r p cs this may result in the active writer failing to write after this point , a new writer should be able to recover and continue writing without data loss

public void test recover after double failures ( ) throws exception { final long max ipc number = determine max ipc number ( ) ; for ( int fail a = 1 ; fail a < = max ipc number ; fail a + + ) { for ( int fail b = 1 ; fail b < = max ipc number ; fail b + + ) { string injection str = " ( " + fail a + " , " + fail b + " ) " ; log info ( " \ n \ n - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ n " + " beginning test , failing at " + injection str + " \ n " + " - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ n \ n " ) ; mini journal cluster cluster = new mini journal cluster builder ( conf ) build ( ) ; cluster wait active ( ) ; quorum journal manager qjm = null ; try { qjm = create injectable q j m ( cluster ) ; qjm format ( fake nsinfo , false ) ; list < async logger > loggers = qjm get logger set for tests ( ) get loggers for tests ( ) ; fail ipc number ( loggers get ( 0 ) , fail a ) ; fail ipc number ( loggers get ( 1 ) , fail b ) ; int last acked txn = do workload ( cluster , qjm ) ; if ( last acked txn < 6 ) { log info ( " failed after injecting failures at " + injection str + " this is expected since we injected a failure in the " + " majority " ) ; } qjm close ( ) ; qjm = null ; / / now should be able to recover qjm = create injectable q j m ( cluster ) ; long last recovered txn = q j m test util recover and return last txn ( qjm ) ; assert true ( last recovered txn > = last acked txn ) ; write segment ( cluster , qjm , last recovered txn + 1 , 3 , true ) ; } catch ( throwable t ) { / / test failure ! rethrow with the test setup info so it can be / / easily triaged throw new runtime exception ( " test failed with injection : " + injection str , t ) ; } finally { cluster shutdown ( ) ; cluster = null ; i o utils close stream ( qjm ) ; qjm = null ; } } } }


return true if the request should be validated without altering the configs

public boolean should validate only ( ) { return validate only ; }


< code > optional bytes data = 1 ; < code >

com google protobuf byte string get data ( ) ;


setup the flink job with the graph input , algorithm , and output to then execute the job call { @ link # execute }

public runner run ( ) throws exception { / / set up the execution environment env = execution environment get execution environment ( ) ; execution config config = env get config ( ) ; / / should not have any non - flink data types config disable force avro ( ) ; config disable force kryo ( ) ; config set global job parameters ( parameters ) ; parameterize ( this ) ; / / configure local parameters and throw proper exception on error try { this configure ( parameters ) ; } catch ( runtime exception ex ) { throw new program parametrization exception ( ex get message ( ) ) ; } / / integration tests run with with object reuse both disabled and enabled if ( disable object reuse get value ( ) ) { config disable object reuse ( ) ; } else { config enable object reuse ( ) ; } / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - / / usage and configuration / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - / / algorithm and usage if ( ! parameters has ( algorithm ) ) { throw new program parametrization exception ( get algorithms listing ( ) ) ; } string algorithm name = parameters get ( algorithm ) ; algorithm = driver factory get ( algorithm name ) ; if ( algorithm = = null ) { throw new program parametrization exception ( " unknown algorithm name : " + algorithm name ) ; } / / input and usage if ( ! parameters has ( input ) ) { if ( ! parameters has ( output ) ) { / / if neither input nor output is given then print algorithm usage throw new program parametrization exception ( get algorithm usage ( algorithm name ) ) ; } throw new program parametrization exception ( " no input given " ) ; } parameterize ( algorithm ) ; string input name = parameters get ( input ) ; input input = input factory get ( input name ) ; if ( input = = null ) { throw new program parametrization exception ( " unknown input type : " + input name ) ; } parameterize ( input ) ; / / output and usage if ( ! parameters has ( output ) ) { throw new program parametrization exception ( " no output given " ) ; } string output name = parameters get ( output ) ; output = output factory get ( output name ) ; if ( output = = null ) { throw new program parametrization exception ( " unknown output type : " + output name ) ; } parameterize ( output ) ; / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - / / create list of input and algorithm transforms / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - list < transform > transforms = new array list < > ( ) ; if ( input instanceof transformable ) { transforms add all ( ( ( transformable ) input ) get transformers ( ) ) ; } if ( algorithm instanceof transformable ) { transforms add all ( ( ( transformable ) algorithm ) get transformers ( ) ) ; } for ( transform transform : transforms ) { parameterize ( transform ) ; } / / unused parameters if ( parameters get unrequested parameters ( ) size ( ) > 0 ) { throw new program parametrization exception ( " unrequested parameters : " + parameters get unrequested parameters ( ) ) ; } / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - / / execute / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - / / create input graph graph = input create ( env ) ; / / transform input for ( transform transform : transforms ) { graph = ( graph ) transform transform input ( graph ) ; } / / run algorithm result = algorithm plan ( graph ) ; / / output execution name = job name get value ( ) ! = null ? job name get value ( ) + " : " : " " ; execution name + = input get identity ( ) + " ⇨ " + algorithm name + " ⇨ " + output get name ( ) ; if ( transforms size ( ) > 0 ) { / / append identifiers to job name string buffer buffer = new string buffer ( execution name ) append ( " [ " ) ; for ( transform transform : transforms ) { buffer append ( transform get identity ( ) ) ; } execution name = buffer append ( " ] " ) to string ( ) ; } if ( output = = null ) { throw new program parametrization exception ( " unknown output type : " + output name ) ; } try { output configure ( parameters ) ; } catch ( runtime exception ex ) { throw new program parametrization exception ( ex get message ( ) ) ; } if ( result ! = null ) { / / transform output if algorithm returned result data set if ( transforms size ( ) > 0 ) { collections reverse ( transforms ) ; for ( transform transform : transforms ) { result = ( data set ) transform transform result ( result ) ; } } } return this ; }


public final cst nat get nat ( ) { return nat ; }


call all the constructors and verify the delegation is working properly

public void test block location constructors ( ) throws exception { / / block location loc ; loc = new block location ( ) ; check block location ( loc ) ; loc = new block location ( null , null , 1 , 2 ) ; check block location ( loc , 1 , 2 , false ) ; loc = new block location ( null , null , null , 1 , 2 ) ; check block location ( loc , 1 , 2 , false ) ; loc = new block location ( null , null , null , 1 , 2 , true ) ; check block location ( loc , 1 , 2 , true ) ; loc = new block location ( null , null , null , null , 1 , 2 , true ) ; check block location ( loc , 1 , 2 , true ) ; loc = new block location ( null , null , null , null , null , null , 1 , 2 , true ) ; check block location ( loc , 1 , 2 , true ) ; }


generates the list of overrides of methods that return { @ code request builder }

private list < method spec > generate request manager request builder method overrides ( ) { / / without the erasure , this is a request builder < y > a request builder < x > is not assignable to a / / request builder < y > after type erasure this is a request builder a request builder < x > is / / assignable to the raw request builder type mirror raw request builder = processing env get type utils ( ) erasure ( request builder type as type ( ) ) ; return fluent iterable from ( processor util find instance methods returning ( request manager type , raw request builder ) ) filter ( new predicate < executable element > ( ) { @ override public boolean apply ( executable element input ) { / / skip the < t > as ( class < t > ) method return ! input get simple name ( ) to string ( ) equals ( " as " ) ; } } ) transform ( new function < executable element , method spec > ( ) { @ override public method spec apply ( executable element input ) { return generate request manager request builder method override ( input ) ; } } ) to list ( ) ; }


handle a vote request this api may return the following errors : - { @ link errors # broker not available } if this node is currently shutting down - { @ link errors # fenced leader epoch } if the epoch is smaller than this node ' s epoch - { @ link errors # inconsistent voter set } if the request suggests inconsistent voter membership ( e g if this node or the sender is not one of the current known voters ) - { @ link errors # invalid request } if the last epoch or offset are invalid

private vote response data handle vote request ( raft request inbound request metadata ) throws i o exception { vote request data request = ( vote request data ) request metadata data ; if ( ! has valid topic partition ( request , log topic partition ( ) ) ) { / / until we support multi - raft , we treat topic partition mismatches as invalid requests return new vote response data ( ) set error code ( errors invalid request code ( ) ) ; } vote request data partition data partition request = request topics ( ) get ( 0 ) partitions ( ) get ( 0 ) ; int candidate id = partition request candidate id ( ) ; int candidate epoch = partition request candidate epoch ( ) ; int last epoch = partition request last offset epoch ( ) ; long last epoch end offset = partition request last offset ( ) ; if ( last epoch end offset < 0 | | last epoch < 0 | | last epoch > = candidate epoch ) { return build vote response ( errors invalid request , false ) ; } optional < errors > error opt = validate voter only request ( candidate id , candidate epoch ) ; if ( error opt is present ( ) ) { return build vote response ( error opt get ( ) , false ) ; } if ( candidate epoch > quorum epoch ( ) ) { transition to unattached ( candidate epoch ) ; } final boolean vote granted ; if ( quorum is leader ( ) ) { logger debug ( " rejecting vote request { } with epoch { } since we are already leader on that epoch " , request , candidate epoch ) ; vote granted = false ; } else if ( quorum is candidate ( ) ) { logger debug ( " rejecting vote request { } with epoch { } since we are already candidate on that epoch " , request , candidate epoch ) ; vote granted = false ; } else if ( quorum is resigned ( ) ) { logger debug ( " rejecting vote request { } with epoch { } since we have resigned as candidate / leader in this epoch " , request , candidate epoch ) ; vote granted = false ; } else if ( quorum is follower ( ) ) { follower state state = quorum follower state or throw ( ) ; logger debug ( " rejecting vote request { } with epoch { } since we already have a leader { } on that epoch " , request , candidate epoch , state leader id ( ) ) ; vote granted = false ; } else if ( quorum is voted ( ) ) { voted state state = quorum voted state or throw ( ) ; vote granted = state voted id ( ) = = candidate id ; if ( ! vote granted ) { logger debug ( " rejecting vote request { } with epoch { } since we already have voted for " + " another candidate { } on that epoch " , request , candidate epoch , state voted id ( ) ) ; } } else if ( quorum is unattached ( ) ) { offset and epoch last epoch end offset and epoch = new offset and epoch ( last epoch end offset , last epoch ) ; vote granted = last epoch end offset and epoch compare to ( end offset ( ) ) > = 0 ; if ( vote granted ) { transition to voted ( candidate id , candidate epoch ) ; } } else { throw new illegal state exception ( " unexpected quorum state " + quorum ) ; } logger info ( " vote request { } is { } " , request , vote granted ? " granted " : " rejected " ) ; return build vote response ( errors none , vote granted ) ; }


closes the zoo keeper utility factory this entails closing the cached { @ link curator framework } instance if cleanup is true , then the initial path and all its children are deleted

public void close ( boolean cleanup ) throws exception { if ( cleanup ) { facade delete ( ) deleting children if needed ( ) for path ( " / " ) ; } root close ( ) ; }


create a panel for the checkboxes to indicate the filter settings

private j panel create diff filter panel ( ) { j panel check box panel = new j panel ( ) ; check box panel set tool tip text ( " check the types of differences between the two " + " programs that you want detected and highlighted " ) ; create bytes check box ( ) ; create labels check box ( ) ; create code units check box ( ) ; create references check box ( ) ; create program context check box ( ) ; create comments check box ( ) ; create bookmarks check box ( ) ; create properties check box ( ) ; create functions check box ( ) ; check box panel set layout ( new grid layout ( 3 , 3 , 5 , 0 ) ) ; check box panel add ( diff bytes c b ) ; check box panel add ( diff labels c b ) ; check box panel add ( diff code units c b ) ; check box panel add ( diff references c b ) ; check box panel add ( diff program context c b ) ; check box panel add ( diff comments c b ) ; check box panel add ( diff bookmarks c b ) ; check box panel add ( diff properties c b ) ; check box panel add ( diff functions c b ) ; j panel button panel = new j panel ( ) ; create select all button ( ) ; button panel add ( select all button ) ; create deselect all button ( ) ; button panel add ( deselect all button ) ; j panel panel = new j panel ( new border layout ( ) ) ; panel add ( check box panel , border layout center ) ; panel add ( button panel , border layout south ) ; return panel ; }


get the the number of bytes written to an output stream this is for testing

public static long get bytes written ( f s data output stream output stream ) { swift native output stream snos = get swift native output stream ( output stream ) ; return snos get bytes written ( ) ; }


public string get old value ( ) { return old value ; }


sets the null check if enabled , all fields need to be checked for null first

public void set null check ( boolean null check ) { this null check = preconditions check not null ( null check ) ; }


scaling to ensure that there are commits in between the various test events , just to exercise that everything works properly in the presence of commits

private static long scaled time ( final long unscaled time ) { return commit interval * 2 * unscaled time ; }


provides check for verifying if this element represents a null value or not

public boolean is json null ( ) { return this instanceof json null ; }


a sensible default implementation of { @ link # sub set ( object , object ) } in terms of { @ link # head set ( object ) } and { @ link # tail set ( object ) } in some situations , you may wish to override { @ link # sub set ( object , object ) } to forward to this implementation

protected sorted set < e > standard sub set ( e from element , e to element ) { return tail set ( from element ) head set ( to element ) ; }


uses a simple http u r l connection to do the job end notification

private boolean notify via built in notifier ( ) { boolean success = false ; try { log get log ( ) info ( " job end notification trying " + url to notify ) ; http u r l connection conn = ( http u r l connection ) url to notify open connection ( proxy to use ) ; conn set connect timeout ( timeout ) ; conn set read timeout ( timeout ) ; conn set allow user interaction ( false ) ; if ( conn get response code ( ) ! = http u r l connection http ok ) { log get log ( ) warn ( " job end notification to " + url to notify + " failed with code : " + conn get response code ( ) + " and message \ " " + conn get response message ( ) + " \ " " ) ; } else { success = true ; log get log ( ) info ( " job end notification to " + url to notify + " succeeded " ) ; } } catch ( i o exception ioe ) { log get log ( ) warn ( " job end notification to " + url to notify + " failed " , ioe ) ; } return success ; }


get all statistics data mr or other frameworks can use the method to get all statistics at once

public statistics data get data ( ) { return visit all ( new statistics aggregator < statistics data > ( ) { private statistics data all = new statistics data ( ) ; @ override public void accept ( statistics data data ) { all add ( data ) ; } public statistics data aggregate ( ) { return all ; } } ) ; }


ensures the truth of an expression involving one or more parameters to the calling method see { @ link # check argument ( boolean , string , object ) } for details

public static void check argument ( boolean b , @ nullable decl string error message template , int p 1 , @ nullable decl object p 2 ) { if ( ! b ) { throw new illegal argument exception ( lenient format ( error message template , p 1 , p 2 ) ) ; } }


if < code > true < code > the analysis component created by this provider requires certain settings to be instantiated it can ' t be created with defaults the default is < code > false < code >

default boolean requires analysis settings ( ) { return false ; }


see { @ link block token secret manager # check access ( block token identifier , string , extended block , block token identifier access mode ) }

public void check access ( block token identifier id , string user id , extended block block , access mode mode ) throws invalid token { get ( block get block pool id ( ) ) check access ( id , user id , block , mode ) ; }


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


use several strings to define the id of the model similar to { @ link # id ( char sequence ) } , but with additional strings

public epoxy model < t > id ( @ nullable char sequence key , @ nullable char sequence other keys ) { long result = hash string 6 4 bit ( key ) ; if ( other keys ! = null ) { for ( char sequence other key : other keys ) { result = 31 * result + hash string 6 4 bit ( other key ) ; } } return id ( result ) ; }


returns the data of the table as a { @ link data set } note : this method is for internal use only for defining a { @ link table source } do not use it in table api programs

data set < t > get data set ( execution environment exec env ) ;


{ @ link com alibaba nacos core code spring application run listener # context loaded }

void context prepared ( configurable application context context ) ;


gets all of the open cdt projects in the workspace

public static collection < i project > get c d t projects ( ) { list < i project > cdt projects = new array list < > ( ) ; for ( i project project : resources plugin get workspace ( ) get root ( ) get projects ( ) ) { if ( project is open ( ) & & is cdt project ( project ) ) { cdt projects add ( project ) ; } } return cdt projects ; }


forcibly reset the stream , by aborting the connection the next { @ code read ( ) } operation will trigger the opening of a new https connection this is potentially very inefficient , and should only be invoked in extreme circumstances it logs at info for this reason

public synchronized boolean reset connection ( ) throws i o exception { check not closed ( ) ; if ( is object stream open ( ) ) { log info ( " forced reset of connection to { } " , uri ) ; close stream ( " reset ( ) " , content range finish , true ) ; } return is object stream open ( ) ; }


create a new { @ link adjacency matrix } aggregation with the given name and separator

public static adjacency matrix aggregation builder adjacency matrix ( string name , string separator , map < string , query builder > filters ) { return new adjacency matrix aggregation builder ( name , separator , filters ) ; }


reset the calendar setting all the fields provided to zero

private void reset ( calendar calendar , list < integer > fields ) { for ( int field : fields ) { calendar set ( field , field = = calendar day of month ? 1 : 0 ) ; } }


returns the commons - cli < code > command line < code > object to process the parsed arguments note : if the object is created with { @ link # generic options parser ( configuration , string [ ] ) } , then returned object will only contain parsed generic options

public command line get command line ( ) { return command line ; }


compute the header separately because we need to wait for the bounding box

protected string builder header ( ) { string builder b = new string builder ( ) ; b append ( " % ! ps - adobe - 3 0 epsf - 3 0 \ n " ) ; b append ( bounding box ) append ( " \ n " ) ; b append ( " 0 3 setlinewidth \ n " ) ; b append ( " % % x y w h highlight \ n " + " / highlight { \ n " + " 4 dict begin \ n " + " / h exch def \ n " + " / w exch def \ n " + " / y exch def \ n " + " / x exch def \ n " + " gsave \ n " + " newpath \ n " + " x y moveto \ n " + " 0 h rlineto % up to left corner \ n " + " w 0 rlineto % to upper right corner \ n " + " 0 h neg rlineto % to lower right corner \ n " + " w neg 0 rlineto % back home to lower left corner \ n " + " closepath \ n " + " 95 83 82 setrgbcolor \ n " + " fill \ n " + " grestore \ n " + " end \ n " + " } def \ n " ) ; return b ; }


an implementation of { @ link multiset # retain all }

static boolean retain all impl ( multiset < ? > self , collection < ? > elements to retain ) { check not null ( elements to retain ) ; collection < ? > collection = ( elements to retain instanceof multiset ) ? ( ( multiset < ? > ) elements to retain ) element set ( ) : elements to retain ; return self element set ( ) retain all ( collection ) ; }


clear all the files in cache ( in memory and disk )

public static void clear state files ( ) { if ( main activity debug ) { log d ( tag , " clear state files ( ) called " ) ; } state objects holder clear ( ) ; file cache dir = new file ( cache dir path ) ; if ( ! cache dir exists ( ) ) { return ; } cache dir = new file ( cache dir , cache dir name ) ; if ( cache dir exists ( ) ) { for ( final file file : cache dir list files ( ) ) { file delete ( ) ; } } }


returns the { @ link calling convention }

protected abstract calling convention get calling convention ( ) ;


configure the instance of { @ link consumed } with a value { @ link serde }

public consumed < k , v > with value serde ( final serde < v > value serde ) { this value serde = value serde ; return this ; }


returns the coordinate vector of a multi - dimensional point

public double [ ] get coordinates ( ) { return this coordinates ; }


assert that the given component contains the provided pattern

public litho view assert has visible text matching ( string pattern ) { assert that view tree ( ) has visible text matching ( pattern ) ; return this ; }


pops values from the stack of the types indicated by the given { @ code prototype } ( popped in reverse of the argument order , so the first prototype argument type is for the deepest element of the stack ) , and store them in the arguments area , indicating that there are now that many arguments also , clear the auxiliary arguments

public void pop args ( frame frame , prototype prototype ) ;


attempt compilation of the supplied expression a check is made to see if it is compilable before compilation proceeds the check involves visiting all the nodes in the expression ast and ensuring enough state is known about them that bytecode can be generated for them

public compiled expression compile ( spel node impl expression ) { if ( expression is compilable ( ) ) { if ( logger is debug enabled ( ) ) { logger debug ( " sp e l : compiling " + expression to string a s t ( ) ) ; } class < ? extends compiled expression > clazz = create expression class ( expression ) ; if ( clazz ! = null ) { try { return reflection utils accessible constructor ( clazz ) new instance ( ) ; } catch ( throwable ex ) { throw new illegal state exception ( " failed to instantiate compiled expression " , ex ) ; } } } if ( logger is debug enabled ( ) ) { logger debug ( " sp e l : unable to compile " + expression to string a s t ( ) ) ; } return null ; }


public void update clob ( int column index , reader reader , long length ) throws s q l exception { }


public integer get namespace integer ( ) { return namespace integer ; }


get the default { @ link test execution listener } classes for this bootstrapper this method is invoked by { @ link # get test execution listeners ( ) } and delegates to { @ link # get default test execution listener class names ( ) } to retrieve the class names if a particular class cannot be loaded , a { @ code debug } message will be logged , but the associated exception will not be rethrown

protected set < class < ? extends test execution listener > > get default test execution listener classes ( ) { set < class < ? extends test execution listener > > default listener classes = new linked hash set < > ( ) ; class loader cl = get class ( ) get class loader ( ) ; for ( string class name : get default test execution listener class names ( ) ) { try { default listener classes add ( ( class < ? extends test execution listener > ) class utils for name ( class name , cl ) ) ; } catch ( throwable ex ) { if ( logger is debug enabled ( ) ) { logger debug ( " could not load default test execution listener class [ " + class name + " ] specify custom listener classes or make the default listener classes available " , ex ) ; } } } return default listener classes ; }


get the type code embedded in the first byte

public type get type ( ) { byte [ ] bytes = get bytes ( ) ; if ( bytes = = null | | bytes length = = 0 ) { return null ; } for ( type type : type values ( ) ) { if ( type code = = ( int ) bytes [ 0 ] ) { return type ; } } return null ; }


returns true if this test subscriber has been cancelled

public final boolean is cancelled ( ) { return cancelled ; }


returns a value that is a percentage of the specified actor ' s width the context actor is ignored

static public value percent width ( final float percent , final actor actor ) { if ( actor = = null ) throw new illegal argument exception ( " actor cannot be null " ) ; return new value ( ) { public float get ( @ null actor context ) { return actor get width ( ) * percent ; } } ; }


set a unique synchronization identifier for this store

public void set identifier ( string id ) { this identifier = id ; }


return the configured virtual host value

public string get virtual host ( ) { return this virtual host ; }


finds or creates a invoke dynamic constant constant pool entry with the given bootstrap method constant pool entry index , method name , and descriptor

public int add invoke dynamic constant ( int bootstrap method index , string name , string descriptor , clazz [ ] referenced classes ) { return add invoke dynamic constant ( bootstrap method index , add name and type constant ( name , descriptor ) , referenced classes ) ; }


null - safe check if the specified collection is empty null returns true

public static boolean is empty ( collection coll ) { return ( coll = = null | | coll is empty ( ) ) ; }


check if the given { @ link signal } is the same as this instance if not an { @ link illegal state exception } will be thrown

public void expect ( signal signal ) { if ( this ! = signal ) { throw new illegal state exception ( " unexpected signal : " + signal ) ; } }


creates a constant binding to { @ code @ named ( key ) } for each entry in { @ code properties }

public static void bind properties ( binder binder , map < string , string > properties ) { binder = binder skip sources ( names class ) ; for ( map entry < string , string > entry : properties entry set ( ) ) { string key = entry get key ( ) ; string value = entry get value ( ) ; binder bind ( key get ( string class , new named impl ( key ) ) ) to instance ( value ) ; } }


sets an animator to run a { @ link android view view property animator } on a view that the target may be wrapping when a resource load finishes will only be run if the load was loaded asynchronously ( i e was not in the memory cache )

public final child transition ( @ non null view property transition animator animator ) { return transition ( new view property animation factory < > ( animator ) ) ; }


public void error ( string message , @ nullable object source , @ nullable parse state parse state ) { error ( message , source , parse state , null ) ; }


if you just begin typing into an editable cell in a j table , then the cell editor will be displayed however , the editor component will not have a focus this method has been overridden to request focus on the editor component

public boolean edit cell at ( int row , int column ) { boolean edit at cell = super edit cell at ( row , column ) ; if ( edit at cell ) { component editor = get editor component ( ) ; editor request focus ( ) ; } return edit at cell ; }


public int read bits ( int num bits ) { int return value = 0 ; bit offset + = num bits ; while ( bit offset > 8 ) { bit offset - = 8 ; return value | = ( data [ byte offset ] & 0x f f ) < < bit offset ; byte offset + = should skip byte ( byte offset + 1 ) ? 2 : 1 ; } return value | = ( data [ byte offset ] & 0x f f ) > > ( 8 - bit offset ) ; return value & = 0x f f f f f f f f > > > ( 32 - num bits ) ; if ( bit offset = = 8 ) { bit offset = 0 ; byte offset + = should skip byte ( byte offset + 1 ) ? 2 : 1 ; } assert valid offset ( ) ; return return value ; }


returns { @ code true } if { @ code target } is present as an element anywhere in { @ code array }

public static boolean contains ( int [ ] array , int target ) { for ( int value : array ) { if ( value = = target ) { return true ; } } return false ; }


retrieves the { @ link transitive option details } containing data on this configuration ' s options

transitive option details get transitive option details ( ) { return transitive option details ; }


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

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


retrieves the number of values for the current document this must always be greater than zero it is illegal to call this method after { @ link # advance exact ( int ) } returned { @ code false }

public abstract int doc value count ( ) ;


e g http ( yarn will perform a simple rest call at a regular interval and expect a 204 no content )

public readiness check type ( type enum type ) { this type = type ; return this ; }


adds a to - many relationship ; the target entity is joined to the pk property of this entity ( typically the id )

public to many add to many ( entity target , property target property ) { property [ ] target properties = { target property } ; return add to many ( null , target , target properties ) ; }


public org elasticsearch action admin indices shrink resize response split ( org elasticsearch action admin indices shrink resize request resize request , request options options ) throws i o exception { return rest high level client perform request and parse entity ( resize request , indices request converters : : split , options , org elasticsearch action admin indices shrink resize response : : from x content , empty set ( ) ) ; }


public outer enum get outer enum ( ) { return outer enum ; }


corrupt the byte at the given offset in the given file , by subtracting 1 from it

private void corrupt byte in file ( file file , long offset ) throws i o exception { random access file raf = new random access file ( file , " rw " ) ; try { raf seek ( offset ) ; int orig byte = raf read ( ) ; raf seek ( offset ) ; raf write byte ( orig byte - 1 ) ; } finally { i o utils close stream ( raf ) ; } }


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


returns the aggregate phase strategy configuration

public static aggregate phase strategy get agg phase strategy ( table config table config ) { string agg phase conf = table config get configuration ( ) get string ( table optimizer agg phase strategy ) trim ( ) ; if ( agg phase conf is empty ( ) ) { return aggregate phase strategy auto ; } else { return aggregate phase strategy value of ( agg phase conf ) ; } }


configure a { @ link message header initializer } to apply to the headers of { @ link message messages } from decoded stomp frames

public void set header initializer ( @ nullable message header initializer header initializer ) { this header initializer = header initializer ; }


int divider right margin ( int position , recycler view parent ) ;


cancels and removes a pending slot request with the given allocation id if there is no such pending request , then nothing is done

public boolean unregister slot request ( allocation i d allocation id ) { check init ( ) ; pending slot request pending slot request = pending slot requests remove ( allocation id ) ; if ( null ! = pending slot request ) { log debug ( " cancel slot request { } " , allocation id ) ; cancel pending slot request ( pending slot request ) ; return true ; } else { log debug ( " no pending slot request with allocation id { } found ignoring unregistration request " , allocation id ) ; return false ; } }


set to true if quota violation should be automatically retried

public create partitions options retry on quota violation ( boolean retry on quota violation ) { this retry on quota violation = retry on quota violation ; return this ; }


asserts that a prior call that had caused this thread to block or wait has since returned normally

public void assert prior call returns ( @ nullable decl string method name ) throws exception { assert equals ( null , get response ( method name ) get result ( ) ) ; }


move some or all of the keys from the right node into the left node if all keys are moved , the caller is responsible for deleting the right node

private static boolean move keys left ( var key interior node left node , var key interior node right node , int count ) { if ( count < = 0 ) return false ; int left key count = left node key count ; int right key count = right node key count ; int right offset = right node get key offset ( count - 1 ) ; int len = right node buffer length ( ) - right offset ; int left offset = left node get key offset ( left key count - 1 ) - len ; / / move key data to left node left node buffer copy ( left offset , right node buffer , right offset , len ) ; / / move entries to left node int elen = count * entry size ; left node buffer copy ( base + ( left key count * entry size ) , right node buffer , base , elen ) ; / / fix key offsets in left node int offset correction = left offset - right offset ; int new left key count = left key count + count ; for ( int i = left key count ; i < new left key count ; i + + ) { left node put key offset ( i , left node get key offset ( i ) + offset correction ) ; } left node set key count ( left key count + count ) ; if ( count < right key count ) { / / only need to update right node if partial move right node move keys ( count , len ) ; right key count - = count ; right node buffer move ( base + elen , base , right key count * entry size ) ; right node set key count ( right key count ) ; } return true ; }


create the scheduler instance for the given factory and scheduler name called by { @ link # after properties set } the default implementation invokes scheduler factory ' s { @ code get scheduler } method can be overridden for custom scheduler creation

protected scheduler create scheduler ( scheduler factory scheduler factory , @ nullable string scheduler name ) throws scheduler exception { / / override thread context class loader to work around naive quartz class load helper loading thread current thread = thread current thread ( ) ; class loader thread context class loader = current thread get context class loader ( ) ; boolean override class loader = ( this resource loader ! = null & & this resource loader get class loader ( ) ! = thread context class loader ) ; if ( override class loader ) { current thread set context class loader ( this resource loader get class loader ( ) ) ; } try { scheduler repository repository = scheduler repository get instance ( ) ; synchronized ( repository ) { scheduler existing scheduler = ( scheduler name ! = null ? repository lookup ( scheduler name ) : null ) ; scheduler new scheduler = scheduler factory get scheduler ( ) ; if ( new scheduler = = existing scheduler ) { throw new illegal state exception ( " active scheduler of name ' " + scheduler name + " ' already registered " + " in quartz scheduler repository cannot create a new spring - managed scheduler of the same name ! " ) ; } if ( ! this expose scheduler in repository ) { / / need to remove it in this case , since quartz shares the scheduler instance by default ! scheduler repository get instance ( ) remove ( new scheduler get scheduler name ( ) ) ; } return new scheduler ; } } finally { if ( override class loader ) { / / reset original thread context class loader current thread set context class loader ( thread context class loader ) ; } } }


access a value in this { @ link char sequence } this method is considered unsafe as index values are assumed to be legitimate only underlying array bounds checking is done

public char char at unsafe ( int index ) { return chars [ index ] ; }


creates a new builder allowing construction of a new test summary object

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


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


asserts that a unicode escaper does not escape the given character

public static void assert unescaped ( unicode escaper escaper , int cp ) { assert assert null ( compute replacement ( escaper , cp ) ) ; }


get scheduler ' s configuration provider , so other classes can directly call mutation a p is on configuration provider

mutable configuration provider get mutable conf provider ( ) ;


public uri get notification uri ( ) { return null ; }


timeout to wait for the shards on to be available for each bulk request ?

public self set timeout ( string timeout ) { this timeout = time value parse time value ( timeout , this timeout , get class ( ) get simple name ( ) + " timeout " ) ; return self ( ) ; }


post storeorder : place an order for a pet

default response entity < order > place order ( @ api param ( value = " order placed for purchasing the pet " , required = true ) @ valid @ request body order body ) { get request ( ) if present ( request - > { for ( media type media type : media type parse media types ( request get header ( " accept " ) ) ) { if ( media type is compatible with ( media type value of ( " application / json " ) ) ) { string example string = " { \ " pet id \ " : 6 , \ " quantity \ " : 1 , \ " id \ " : 0 , \ " ship date \ " : \ " 2000 - 01 - 23t04 : 56 : 07 000 + 00 : 00 \ " , \ " complete \ " : false , \ " status \ " : \ " placed \ " } " ; api util set example response ( request , " application / json " , example string ) ; break ; } if ( media type is compatible with ( media type value of ( " application / xml " ) ) ) { string example string = " < order > < id > 123456789 < / id > < pet id > 123456789 < / pet id > < quantity > 123 < / quantity > < ship date > 2000 - 01 - 23t04 : 56 : 07 000z < / ship date > < status > aeiou < / status > < complete > true < / complete > < / order > " ; api util set example response ( request , " application / xml " , example string ) ; break ; } } } ) ; return new response entity < > ( http status not implemented ) ; }


return true if the given key is in the hashtable

public boolean contains ( int key ) { return indexer get ( key ) > = 0 ; }


get the external location which best matches the specified parameters preference is given to ext label over ext addr

private external location get ext location ( namespace library , string ext label , address ext addr , boolean reuse existing ) throws invalid input exception { if ( ext label ! = null & & ( ext label length ( ) = = 0 | | symbol utilities is reserved external default name ( ext label , addr map get address factory ( ) ) ) ) { ext label = null ; / / force use of address } external location match = find matching location by name ( library , ext label , ext addr , reuse existing ) ; if ( match ! = null ) { return match ; } / / so now get all the external locations for a library and search them list < external location > locations = get external locations ( library ) ; if ( ext label = = null ) { return find matching location by address ( locations , ext addr , reuse existing ) ; } return find matching location by original import name ( locations , ext label , ext addr ) ; }


add the requisite security principal settings to the given configuration , returning a copy

public static configuration add security configuration ( configuration conf ) { / / make a copy so we don ' t mutate it also use an hdfs configuration to / / force loading of hdfs - site xml conf = new hdfs configuration ( conf ) ; string name node principal = conf get ( d f s config keys dfs namenode kerberos principal key , " " ) ; if ( log is debug enabled ( ) ) { log debug ( " using nn principal : " + name node principal ) ; } conf set ( common configuration keys hadoop security service user name key , name node principal ) ; return conf ; }


remove the first item from the queue ( dequeue from head ) always o ( 1 )

public long remove first ( ) { if ( size = = 0 ) { / / underflow throw new no such element exception ( " queue is empty " ) ; } final long [ ] values = this values ; final long result = values [ head ] ; head + + ; if ( head = = values length ) { head = 0 ; } size - - ; return result ; }


update the destination of the mount point to target namespace and target path

private static void update mount table destination ( string mount , string dst ns , string dst path , configuration conf ) throws i o exception { string address = conf get trimmed ( r b f config keys dfs router admin address key , r b f config keys dfs router admin address default ) ; inet socket address router socket = net utils create socket addr ( address ) ; router client r client = new router client ( router socket , conf ) ; try { mount table manager mount table = r client get mount table manager ( ) ; mount table original entry = get mount entry ( mount , mount table ) ; if ( original entry = = null ) { throw new i o exception ( " mount table " + mount + " doesn ' t exist " ) ; } else { remote location remote location = new remote location ( dst ns , dst path , mount ) ; original entry set destinations ( arrays as list ( remote location ) ) ; update mount table entry request update request = update mount table entry request new instance ( original entry ) ; update mount table entry response response = mount table update mount table entry ( update request ) ; if ( ! response get status ( ) ) { throw new i o exception ( " failed update mount table " + mount ) ; } r client get mount table manager ( ) refresh mount table entries ( refresh mount table entries request new instance ( ) ) ; } } finally { r client close ( ) ; } }


set the user ' s time zone alternatively , set a { @ link time zone aware locale context } on { @ link locale context holder } this context class will fall back to checking the locale context if no setting has been provided here

public void set time zone ( @ nullable date time zone time zone ) { this time zone = time zone ; }


queues the glyphs in the ascii character set ( codepoints 32 through 255 ) to be loaded note that the glyphs are not actually loaded until { @ link # load glyphs ( ) } is called

public void add ascii glyphs ( ) { add glyphs ( 32 , 255 ) ; }


the rectangular radius of the bounding box for the center text , as a percentage of the pie hole default 1 f ( 100 % )

public float get center text radius percent ( ) { return m center text radius percent ; }


format the given parameter object into string

public string parameter to string ( object param ) { if ( param = = null ) { return " " ; } else if ( param instanceof date | | param instanceof offset date time | | param instanceof local date ) { / / serialize to json string and remove the " enclosing characters string json str = json serialize ( param ) ; return json str substring ( 1 , json str length ( ) - 1 ) ; } else if ( param instanceof collection ) { string builder b = new string builder ( ) ; for ( object o : ( collection ) param ) { if ( b length ( ) > 0 ) { b append ( " , " ) ; } b append ( string value of ( o ) ) ; } return b to string ( ) ; } else { return string value of ( param ) ; } }


tests that cumulative memory is computed only for processes older than a given age

public void test mem for older processes ( ) throws i o exception { test mem for older processes ( false ) ; test mem for older processes ( true ) ; }


returns whether this source supports nested projection

boolean supports nested projection ( ) ;


an extension method to convert a stomp encoded buffer to a different message type based on an original { @ link stomp headers subframe } headers sub frame by default an encoded buffer is returned as is

protected object convert headers sub frame ( stomp headers subframe original , byte buf encoded ) { return encoded ; }


verify if the fatigue level is set properly though the constructor and setter

public void test set fatigue ( ) { final var model = new giant model ( health healthy , fatigue alert , nourishment saturated ) ; assert equals ( fatigue alert , model get fatigue ( ) ) ; var message format = " the giant looks healthy , % s and saturated " ; for ( final var fatigue : fatigue values ( ) ) { model set fatigue ( fatigue ) ; assert equals ( fatigue , model get fatigue ( ) ) ; assert equals ( string format ( message format , fatigue ) , model to string ( ) ) ; } }


construct a new object using a class name and parameters

public static < t > t new parameterized instance ( string class name , object params ) throws class not found exception { class < ? > [ ] arg types = new class < ? > [ params length / 2 ] ; object [ ] args = new object [ params length / 2 ] ; try { class < ? > c = class for name ( class name , true , utils get context or kafka class loader ( ) ) ; for ( int i = 0 ; i < params length / 2 ; i + + ) { arg types [ i ] = ( class < ? > ) params [ 2 * i ] ; args [ i ] = params [ ( 2 * i ) + 1 ] ; } @ suppress warnings ( " unchecked " ) constructor < t > constructor = ( constructor < t > ) c get constructor ( arg types ) ; return constructor new instance ( args ) ; } catch ( no such method exception e ) { throw new class not found exception ( string format ( " failed to find " + " constructor with % s for % s " , utils join ( arg types , " , " ) , class name ) , e ) ; } catch ( instantiation exception e ) { throw new class not found exception ( string format ( " failed to instantiate " + " % s " , class name ) , e ) ; } catch ( illegal access exception e ) { throw new class not found exception ( string format ( " unable to access " + " constructor of % s " , class name ) , e ) ; } catch ( invocation target exception e ) { throw new class not found exception ( string format ( " unable to invoke " + " constructor of % s " , class name ) , e ) ; } }


callback from an { @ link event } ( once it is complete ) the event is then removed from the pool

public void completed event handler ( int event id ) { event pool get ( event id ) status ( ) ; if ( event pool get ( event id ) is synchronous ( ) ) { currently running sync event = - 1 ; } event pool remove ( event id ) ; }


adds { @ code edge } connecting { @ code node u } to { @ code node v } if the network is directed , { @ code edge } will be directed in this network ; otherwise , it will be undirected < b > { @ code edge } must be unique to this network < b > , just as a { @ code map } key must be it must also be non - null if { @ code node u } and { @ code node v } are not already present in this network , this method will silently { @ link # add node ( object ) add } { @ code node u } and { @ code node v } to the network if { @ code edge } already connects { @ code node u } to { @ code node v } ( in the specified order if this network { @ link # is directed ( ) } , else in any order ) , then this method will have no effect

public immutable network builder < n , e > add edge ( n node u , n node v , e edge ) { mutable network add edge ( node u , node v , edge ) ; return this ; }


returns the portion of the second file that trails the full path of the first file if the paths are the same or unrelated , then null is returned < p > for example , given , in this order , two files with these paths < code > ab < code > and < code > abc < code > , this method will return ' c '

public static string relativize path ( file f 1 , file f 2 ) throws i o exception { string parent path = f 1 get canonical path ( ) replace ( ' \ \ ' , ' / ' ) ; string other path = f 2 get canonical path ( ) replace ( ' \ \ ' , ' / ' ) ; if ( parent path equals ( other path ) ) { return null ; } if ( ! parent path ends with ( " / " ) ) { parent path + = " / " ; } if ( ! other path starts with ( parent path ) ) { return null ; } string child path = other path substring ( parent path length ( ) ) ; return child path ; }


set the bundle host and start the framework

private static void set bundle host ( bundle host a bundle host ) { if ( bundle host ! = null ) { throw new runtime exception ( " ghidra script util initialized multiple times ! " ) ; } try { bundle host = a bundle host ; bundle host start framework ( ) ; } catch ( o s gi exception | i o exception e ) { msg error ( ghidra script util class , " failed to initialize bundle host " , e ) ; } }


get all the unique principals from keytabfile which matches a pattern

public static final string [ ] get principal names ( string keytab , pattern pattern ) throws i o exception { string [ ] principals = get principal names ( keytab ) ; if ( principals length ! = 0 ) { list < string > matching principals = new array list < string > ( ) ; for ( string principal : principals ) { if ( pattern matcher ( principal ) matches ( ) ) { matching principals add ( principal ) ; } } principals = matching principals to array ( new string [ 0 ] ) ; } return principals ; }


secure method for deleting the contents of a directory using { @ code secure directory stream } returns a collection of exceptions that occurred or null if no exceptions were thrown

private static @ nullable collection < i o exception > delete directory contents secure ( secure directory stream < path > dir ) { collection < i o exception > exceptions = null ; try { for ( path path : dir ) { exceptions = concat ( exceptions , delete recursively secure ( dir , path get file name ( ) ) ) ; } return exceptions ; } catch ( directory iterator exception e ) { return add exception ( exceptions , e get cause ( ) ) ; } }


stops a random node in the cluster that applies to the given filter does nothing if none of the nodes match the filter

public synchronized void stop random node ( final predicate < settings > filter ) throws i o exception { ensure open ( ) ; node and client node and client = get random node and client ( nc - > filter test ( nc node settings ( ) ) ) ; if ( node and client ! = null ) { if ( node prefix equals ( e s integ test case suite cluster node prefix ) & & node and client node and client id ( ) < shared nodes seeds length & & node and client is master eligible ( ) & & auto manage master nodes & & nodes values ( ) stream ( ) filter ( node and client : : is master eligible ) filter ( n - > n node and client id ( ) < shared nodes seeds length ) count ( ) = = 1 ) { throw new assertion error ( " tried to stop the only master eligible shared node " ) ; } logger info ( " closing filtered random node [ { } ] " , node and client name ) ; stop nodes and client ( node and client ) ; } }


turn an array of resource - colors ( contains resource - id integers ) into an array list of actual color integers

public static list < integer > create colors ( resources r , int [ ] colors ) { list < integer > result = new array list < integer > ( ) ; for ( int i : colors ) { result add ( r get color ( i ) ) ; } return result ; }


ensures this big array is at least the specified length if the array is smaller , segments are added until the array is larger then the specified length

public void ensure capacity ( long length ) { if ( capacity > length ) { return ; } grow ( length ) ; }


loads a class through this class loader but defer to the parent class loader this ensures that instances of the returned class will be compatible with instances which have already been loaded on the parent loader

public class force load system class ( string classname ) throws class not found exception { log ( " force system loading " + classname , project msg debug ) ; class the class = find loaded class ( classname ) ; if ( the class = = null ) { the class = find base class ( classname ) ; } return the class ; }


public future < ? > submit ( runnable task ) { submitted mark ( ) ; return delegate submit ( new instrumented runnable ( task ) ) ; }


for vi vo or some other rom , they would make dex 2oat asynchronous so we need to check whether oat file is actually generated

private static boolean check all dex opt file ( array list < file > files , int count ) { for ( file file : files ) { if ( ! share patch file util is legal file ( file ) ) { if ( share patch file util should accept even if illegal ( file ) ) { continue ; } share tinker log e ( tag , " parallel dex optimizer file % s is not exist , just wait % d times " , file get name ( ) , count ) ; return false ; } } return true ; }


ensures that the object referenced by the given reference remains < a href = " package - summary html # reachability " > strongly reachable , regardless of any prior actions of the program that might otherwise cause the object to become unreachable ; thus , the referenced object is not reclaimable by garbage collection at least until after the invocation of this method recent versions of the jdk have a nasty habit of prematurely deciding objects are unreachable see : https : stackoverflow comquestions 2 6 6 4 2 1 5 3finalize - called - on - strongly - reachable - object - in - java - 8 the java 9 method reference reachability fence offers a solution to this problem this method is always implemented as a synchronization on { @ code ref } , not as { @ code reference reachability fence } for consistency across platforms and to allow building on jdk 6 - 8 < b > it is the caller ' s responsibility to ensure that this synchronization will not cause deadlock < b >

private static void reachability fence 0 ( object ref ) { if ( ref ! = null ) { synchronized ( ref ) { / / empty synchronized is ok : https : / / stackoverflow com / a / 31933260 / 1151521 } } }


called on failure if a post action failed


returns a type that represents an unknown type that extends { @ code bound } for example , if { @ code bound } is { @ code char sequence class } , this returns { @ code ? extends char sequence } if { @ code bound } is { @ code object class } , this returns { @ code ? } , which is shorthand for { @ code ? extends object }

public static wildcard type subtype of ( type bound ) { return new wildcard type impl ( new type [ ] { bound } , more types empty type array ) ; }


public void put ( string path , router quota usage quota usage ) { write lock lock ( ) ; try { this cache put ( path , quota usage ) ; } finally { write lock unlock ( ) ; } }


authorized operations for this group , or null if that information is not known

public set < acl operation > authorized operations ( ) { return authorized operations ; }


adds a global { @ link state store } to the topology the { @ link state store } sources its data from all partitions of the provided input topic there will be exactly one instance of this { @ link state store } per kafka streams instance a { @ link source node } with the provided source name will be added to consume the data arriving from the partitions of the input topic the provided { @ link processor supplier } will be used to create an { @ link processor node } that will receive all records forwarded from the { @ link source node } this { @ link processor node } should be used to keep the { @ link state store } up - to - date the default { @ link timestamp extractor } as specified in the { @ link streams config config } is used

public synchronized < k in , v in > topology add global store ( final store builder < ? > store builder , final string source name , final deserializer < k in > key deserializer , final deserializer < v in > value deserializer , final string topic , final string processor name , final processor supplier < k in , v in , void , void > state update supplier ) { internal topology builder add global store ( store builder , source name , null , key deserializer , value deserializer , topic , processor name , state update supplier ) ; return this ; }


test method for { @ link org apache dubbo registry support abstract registry # notify ( list ) }

public void test notify ( ) throws exception { final atomic reference < boolean > notified = new atomic reference < boolean > ( false ) ; notify listener listener 1 = urls - > notified set ( boolean true ) ; url url 1 = new url ( " dubbo " , " 192 168 0 1 " , 2200 , parameters consumer ) ; abstract registry subscribe ( url 1 , listener 1 ) ; notify listener listener 2 = urls - > notified set ( boolean true ) ; url url 2 = new url ( " dubbo " , " 192 168 0 2 " , 2201 , parameters consumer ) ; abstract registry subscribe ( url 2 , listener 2 ) ; notify listener listener 3 = urls - > notified set ( boolean true ) ; url url 3 = new url ( " dubbo " , " 192 168 0 3 " , 2202 , parameters consumer ) ; abstract registry subscribe ( url 3 , listener 3 ) ; list < url > urls = new array list < > ( ) ; urls add ( url 1 ) ; urls add ( url 2 ) ; urls add ( url 3 ) ; abstract registry notify ( url 1 , listener 1 , urls ) ; map < url , map < string , list < url > > > map = abstract registry get notified ( ) ; matcher assert assert that ( true , matchers equal to ( map contains key ( url 1 ) ) ) ; matcher assert assert that ( false , matchers equal to ( map contains key ( url 2 ) ) ) ; matcher assert assert that ( false , matchers equal to ( map contains key ( url 3 ) ) ) ; }


transfers the content of the specified source stream to this buffer starting at the specified absolute { @ code index } this method does not modify { @ code reader index } or { @ code writer index } of this buffer

int set bytes ( int index , input stream src , int length ) throws i o exception ;


public char peek char ( ) { return ( char ) ( ( data [ position ] & 0x f f ) < < 8 | ( data [ position + 1 ] & 0x f f ) ) ; }


get the decompiler ' s function model owning this container

public high function get high function ( ) { return func ; }


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


perform pending metrics additions or removals it is important to perform them in order for example , we don ' t want to try to remove a metric that we haven ' t finished adding yet

private void perform pending metrics operations ( ) { modify metrics lock lock ( ) ; try { log trace ( " { } : entering perform pending metrics operations " , suite name ) ; for ( pending metrics change change = pending poll last ( ) ; change ! = null ; change = pending poll last ( ) ) { if ( change provider = = null ) { if ( log is trace enabled ( ) ) { log trace ( " { } : removing metric { } " , suite name , change metric name ) ; } metrics remove metric ( change metric name ) ; } else { if ( log is trace enabled ( ) ) { log trace ( " { } : adding metric { } " , suite name , change metric name ) ; } metrics add metric ( change metric name , change provider ) ; } } log trace ( " { } : leaving perform pending metrics operations " , suite name ) ; } finally { modify metrics lock unlock ( ) ; } }


reads the outer snapshot , i e any information beyond the nested serializers of the outer serializer the base implementation of this methods reads nothing , i e it assumes that the outer serializer only has nested serializers and no extra information otherwise , if the outer serializer contains some extra information that has been persisted as part of the serializer snapshot , this must be overridden note that this method and the corresponding methods { @ link # write outer snapshot ( data output view ) } , { @ link # resolve outer schema compatibility ( type serializer ) } needs to be implemented

protected void read outer snapshot ( int read outer snapshot version , data input view in , class loader user code class loader ) throws i o exception { }


notify any parent data types that my size has changed

protected void notify size changed ( ) { iterator < data type > it = parent list iterator ( ) ; while ( it has next ( ) ) { data type dt = it next ( ) ; dt data type size changed ( this ) ; } }


important : this method is for testing only it allows us to set a " type " record for a particular record number

public boolean set type record ( int record number , abstract ms type type ) { return type program interface set record ( record number , type ) ; }


determine the number of shards with a specific state

public int number of shards with state ( shard routing state states ) { if ( states length = = 1 ) { if ( states [ 0 ] = = shard routing state initializing ) { return initializing shards size ( ) ; } else if ( states [ 0 ] = = shard routing state relocating ) { return relocating shards size ( ) ; } } int count = 0 ; for ( shard routing shard entry : this ) { for ( shard routing state state : states ) { if ( shard entry state ( ) = = state ) { count + + ; } } } return count ; }


public static map < string , string > convert directed list to map ( final list < string > input list ) { val mappings = new tree map < string , string > ( ) ; input list stream ( ) map ( s - > { val bits = splitter on ( " - > " ) split to list ( s ) ; return pair of ( bits get ( 0 ) , bits size ( ) > 1 ? bits get ( 1 ) : string utils empty ) ; } ) for each ( p - > mappings put ( p get key ( ) , p get value ( ) ) ) ; return mappings ; }


returns the abstract type corresponding to the internal name of a class

static int get abstract type from internal name ( final symbol table symbol table , final string internal name ) { return reference kind | symbol table add type ( internal name ) ; }


public static string get log output type ( ) { return log output type ; }