updates the liveness resulting from mapping the given old variable on the given new variable

private void update liveness ( int old variable index , int new variable index , int code length ) { / / loop over all instructions for ( int offset = 0 ; offset < code length ; offset + + ) { / / update the liveness before the instruction if ( liveness analyzer is alive before ( offset , old variable index ) ) { liveness analyzer set alive before ( offset , old variable index , false ) ; liveness analyzer set alive before ( offset , new variable index , true ) ; } / / update the liveness after the instruction if ( liveness analyzer is alive after ( offset , old variable index ) ) { liveness analyzer set alive after ( offset , old variable index , false ) ; liveness analyzer set alive after ( offset , new variable index , true ) ; } } }


creates a symbolic link with the name of the current path , following symbolic links the referent of the created symlink is is the path fragment " target " , which may be absolute or relative

public void create symbolic link ( path fragment target ) throws i o exception { file system create symbolic link ( this , target ) ; }


returns true if field corresponding to field i d is set ( has been assigned a value ) and false otherwise

public boolean is set ( fields field ) { if ( field = = null ) { throw new illegal argument exception ( ) ; } switch ( field ) { case success : return is set success ( ) ; } throw new illegal state exception ( ) ; }


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

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


wait for a latch to countdown and provide a useful error message if it does not often latches are called as < code > assert true ( latch await ( 1 , time unit seconds ) ) ; < code > in case of a failure this will just throw an assertion error without any further message

public static void await latch ( count down latch latch , long timeout , time unit unit ) throws interrupted exception { time value time value = new time value ( timeout , unit ) ; string message = string format ( locale root , " expected latch to be counted down after % s , but was not " , time value ) ; boolean is counted down = latch await ( timeout , unit ) ; assert that ( message , is counted down , is ( true ) ) ; }


save the values out of the configuaration that we need to write the data

public void setup ( context context ) { configuration conf = context get configuration ( ) ; num bytes to write = conf get long ( bytes per map , 1 * 1024 * 1024 * 1024 ) ; min key size = conf get int ( min key , 10 ) ; key size range = conf get int ( max key , 1000 ) - min key size ; min value size = conf get int ( min value , 0 ) ; value size range = conf get int ( max value , 20000 ) - min value size ; }


if false , the widgets are arranged in a single column and the preferred height is the widget heights plus spacing if true , the widgets will wrap using the height of the vertical group the preferred height of the group will be 0 as it is expected that something external will set the height of the group widgets are sized to their preferred height unless it is larger than the group ' s height , in which case they are sized to the group ' s height but not less than their minimum height default is false when wrap is enabled , the group ' s preferred width depends on the height of the group in some cases the parent of the group will need to layout twice : once to set the height of the group and a second time to adjust to the group ' s new preferred width

public vertical group wrap ( ) { wrap = true ; return this ; }


if this { @ link launcher } is encapsulating an execution on a specific { @ link computer } , return it because of the way internal hudson abstractions are set up ( that is , { @ link launcher } only needs a { @ link virtual channel } to do its job and isn ' t really required that the channel comes from an existing { @ link computer } ) , this method may not always the right { @ link computer } instance

public computer get computer ( ) { for ( computer c : jenkins get ( ) get computers ( ) ) if ( c get channel ( ) = = channel ) return c ; return null ; }


a sensible definition of { @ link # last key } in terms of { @ code last entry } if you override { @ code last entry } , you may wish to override { @ code last key } to forward to this implementation

protected k standard last key ( ) { entry < k , v > entry = last entry ( ) ; if ( entry = = null ) { throw new no such element exception ( ) ; } else { return entry get key ( ) ; } }


update build reqs based on \ @ importpackage tag in java files in the default ( unnamed ) package

private void update requirements from metadata ( ) throws ghidra bundle exception { source file to requirements clear ( ) ; requirement to source file map clear ( ) ; import package values clear ( ) ; for ( resource file root source file : get source directory ( ) list files ( ) ) { if ( root source file get name ( ) ends with ( " java " ) ) { / / without ghidra script component provider update available script files for directory , / / or ghidra script component provider new script this might be the earliest need for / / script info , so allow construction / / nb : script info will update field values if last modified has changed since last time they were computed string import package = parse import package metadata ( root source file ) ; if ( import package ! = null & & ! import package is empty ( ) ) { import package values add all ( manifest parser parse delimited string ( import package strip ( ) , " , " ) ) ; list < bundle requirement > requirements ; try { requirements = o s gi utils parse import package ( import package ) ; } catch ( bundle exception e ) { throw new ghidra bundle exception ( get location identifier ( ) , " @ importpackage error " , e ) ; } source file to requirements put ( root source file , requirements ) ; for ( bundle requirement requirement : requirements ) { requirement to source file map compute if absent ( requirement to string ( ) , x - > new array list < > ( ) ) add ( root source file ) ; } } } } }


public final cancellable scroll async ( search scroll request search scroll request , request options options , action listener < search response > listener ) { return perform request async and parse entity ( search scroll request , request converters : : search scroll , options , search response : : from x content , listener , empty set ( ) ) ; }


maps an array of filters to be executed before any matching routes

public static void before ( string path , filter filters ) { for ( filter filter : filters ) { get instance ( ) before ( path , filter ) ; } }


this is for covering a case where the service manager would behave strangely if constructed with no service under management listeners would never fire because the service manager was healthy and stopped at the same time this test ensures that listeners fire and is healthy makes sense

public void test empty service manager ( ) { logger logger = logger get logger ( service manager class get name ( ) ) ; logger set level ( level finest ) ; test log handler log handler = new test log handler ( ) ; logger add handler ( log handler ) ; service manager manager = new service manager ( arrays < service > as list ( ) ) ; recording listener listener = new recording listener ( ) ; manager add listener ( listener , direct executor ( ) ) ; manager start async ( ) await healthy ( ) ; assert true ( manager is healthy ( ) ) ; assert true ( listener healthy called ) ; assert false ( listener stopped called ) ; assert true ( listener failed services is empty ( ) ) ; manager stop async ( ) await stopped ( ) ; assert false ( manager is healthy ( ) ) ; assert true ( listener stopped called ) ; assert true ( listener failed services is empty ( ) ) ; / / check that our no op service is not directly observable via any of the inspection methods or / / via logging assert equals ( " service manager { services = [ ] } " , manager to string ( ) ) ; assert true ( manager services by state ( ) is empty ( ) ) ; assert true ( manager startup times ( ) is empty ( ) ) ; formatter log formatter = new formatter ( ) { @ override public string format ( log record record ) { return format message ( record ) ; } } ; for ( log record record : log handler get stored log records ( ) ) { assert that ( log formatter format ( record ) ) does not contain ( " no op service " ) ; } }


create map instance , which must ben created during initialization phases and always be the same instance

public abstract map < string , ticket > get map instance ( ) ;


parses a trex atom ( defined in 14496 - 12 )

private static pair < integer , default sample values > parse trex ( parsable byte array trex ) { trex set position ( atom full header size ) ; int track id = trex read int ( ) ; int default sample description index = trex read int ( ) - 1 ; int default sample duration = trex read int ( ) ; int default sample size = trex read int ( ) ; int default sample flags = trex read int ( ) ; return pair create ( track id , new default sample values ( default sample description index , default sample duration , default sample size , default sample flags ) ) ; }


private static byte [ ] generate byte hash ( byte [ ] msg , secret key key ) { return job token secret manager compute hash ( msg , key ) ; }


create an auth token from a credential response

public groups v 2 authorization string get groups v 2 authorization string ( uuid self , int today , group secret params group secret params , auth credential response auth credential response ) throws verification failed exception { client zk auth operations auth operations = groups operations get auth operations ( ) ; auth credential auth credential = auth operations receive auth credential ( self , today , auth credential response ) ; auth credential presentation auth credential presentation = auth operations create auth credential presentation ( new secure random ( ) , group secret params , auth credential ) ; return new groups v 2 authorization string ( group secret params , auth credential presentation ) ; }


returns the attribute manager for the vertices of this graph

public attribute manager < vertex > vertex attributes ( ) { return this vertex attributes ; }


sets a predicate for dynamically determining if this action is valid for the current { @ link action context } see { @ link docking action if # is valid context ( action context ) }

public void valid context when ( predicate < action context > predicate ) { valid context predicate = predicate ; }


updates the index an iterator is pointing to after a call to remove : returns the index of the entry that should be looked at after a removal on index removed , with index before remove as the index that was the next entry that would be looked at

int adjust after remove ( int index before remove , @ suppress warnings ( " unused " ) int index removed ) { return index before remove - 1 ; }


returns a duplicated buffer that shares its content with this buffer the duplicated buffer ' s position , limit , capacity and mark are the same as this buffer ' s the duplicated buffer ' s read - only property and byte order are the same as this buffer ' s too the new buffer shares its content with this buffer , which means either buffer ' s change of content will be visible to the other the two buffer ' s position , limit and mark are independent

public abstract byte buffer duplicate ( ) ;


returns a new just - in - time binding created by resolving { @ code key } the strategies used to create just - in - time bindings are : internalizing providers if the requested binding is for { @ code provider < t > } , we delegate to the binding for { @ code t } converting constants implemented by and provided by annotations only for unannotated keys the constructor of the raw type only for unannotated keys

< t > binding impl < t > create just in time binding ( key < t > key , errors errors ) throws errors exception { if ( state is blacklisted ( key ) ) { throw errors child binding already set ( key ) to exception ( ) ; } / / handle cases where t is a provider < ? > if ( is provider ( key ) ) { / / these casts are safe we know t extends provider < x > and that given key < provider < x > > , / / create provider binding ( ) will return binding impl < provider < x > > @ suppress warnings ( " unchecked " ) binding impl binding = create provider binding ( ( key ) key , errors ) ; return binding ; } / / handle cases where t is a members injector < ? > if ( is members injector ( key ) ) { / / these casts are safe t extends members injector < x > and that given key < members injector < x > > , / / create members injector binding ( ) will return binding impl < members injector < x > > @ suppress warnings ( " unchecked " ) binding impl binding = create members injector binding ( ( key ) key , errors ) ; return binding ; } / / try to convert a constant string binding to the requested type binding impl < t > converted binding = convert constant string binding ( key , errors ) ; if ( converted binding ! = null ) { return converted binding ; } / / if the key has an annotation if ( key has annotation type ( ) ) { / / look for a binding without annotation attributes or return null if ( key has attributes ( ) ) { try { errors ignored = new errors ( ) ; return get binding or throw ( key without attributes ( ) , ignored ) ; } catch ( errors exception ignored ) { / / throw with a more appropriate message below } } throw errors missing implementation ( key ) to exception ( ) ; } object source = key get type literal ( ) get raw type ( ) ; binding impl < t > binding = create unitialized binding ( key , scoping unscoped , source , errors ) ; initialize binding ( binding , errors ) ; return binding ; }


public void add ( t t ) { maybe warn about anonymous value ( t ) ; weak hash storage put ( t , null ) ; }


returns true if { @ code type } is a { @ code type variable } with the same name and declared by the same { @ code generic declaration }

boolean equals type ( type type ) { if ( type instanceof type variable ) { return equals type variable ( ( type variable < ? > ) type ) ; } else { return false ; } }


resolve the given destination name to a destination and send a message to it

void send ( string destination name , message < ? > message ) throws messaging exception ;


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


return true if this enum arrays object is equal to o

public boolean equals ( object o ) { if ( this = = o ) { return true ; } if ( o = = null | | get class ( ) ! = o get class ( ) ) { return false ; } enum arrays enum arrays = ( enum arrays ) o ; return objects equals ( this just symbol , enum arrays just symbol ) & & objects equals ( this array enum , enum arrays array enum ) ; }


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


returns candidate build for calculating the estimated duration of the current run returns the 3 last successful ( stable or unstable ) builds , if there are any failing to find 3 of those , it will return up to 3 last unsuccessful builds in any case it will not go more than 6 builds into the past to avoid costly build loading

protected list < run t > get estimated duration candidates ( ) { list < run t > candidates = new array list < > ( 3 ) ; run t last successful = get last successful build ( ) ; int last successful number = - 1 ; if ( last successful ! = null ) { candidates add ( last successful ) ; last successful number = last successful get number ( ) ; } int i = 0 ; run t r = get last build ( ) ; list < run t > fallback candidates = new array list < > ( 3 ) ; while ( r ! = null & & candidates size ( ) < 3 & & i < 6 ) { if ( ! r is building ( ) & & r get result ( ) ! = null & & r get number ( ) ! = last successful number ) { result result = r get result ( ) ; if ( result is better or equal to ( result unstable ) ) { candidates add ( r ) ; } else if ( result is complete build ( ) ) { fallback candidates add ( r ) ; } } i + + ; r = r get previous build ( ) ; } while ( candidates size ( ) < 3 ) { if ( fallback candidates is empty ( ) ) break ; run t run = fallback candidates remove ( 0 ) ; candidates add ( run ) ; } return candidates ; }


configures { @ link # bind ( ) } to use the specified { @ code tex id } for this sampler uniform

public void set sampler tex id ( int tex id , int unit ) { this tex id = tex id ; this unit = unit ; }


gets a recoverable object to recover the committer the recovered committer will commit the file with the exact same data as this committer would commit it

commit recoverable get recoverable ( ) ;


public big decimal get name number ( ) { return name number ; }


test that is atomic rename key ( ) works as expected

public void test is atomic rename key ( ) { azure native file system store store = fs get store ( ) ; / / we want to know if the default configuration changes so we can fix / / this test assert equals ( azure blob storage test account default atomic rename directories , " / atomic rename dir 1 , / atomic rename dir 2 " ) ; / / uri prefix for test environment string uri prefix = " file : / / / " ; / / negative tests string [ ] negative keys = { " " , " / " , " bar " , " bar / " , " bar / hbase " , " bar / hbase / foo " , " bar / hbase / foo / " , " / hbase / " , " / hbase " , " hbasexyz / " , " foo / atomic rename dir 1 / " } ; for ( string s : negative keys ) { assert false ( store is atomic rename key ( s ) ) ; assert false ( store is atomic rename key ( uri prefix + s ) ) ; } / / positive tests the directories for atomic rename are / hbase / / plus the ones in the configuration ( default atomic rename directories / / for this test ) string [ ] positive keys = { " hbase / " , " hbase / foo / " , " hbase / foo / bar / " , " atomic rename dir 1 / foo / " , " atomic rename dir 2 / bar / " } ; for ( string s : positive keys ) { assert true ( store is atomic rename key ( s ) ) ; assert true ( store is atomic rename key ( uri prefix + s ) ) ; } }


tests that un - registration of task managers will free and remove all registered slots

public void test task manager unregistration ( ) throws exception { final task executor gateway task executor gateway = new testing task executor gateway builder ( ) set request slot function ( tuple 6 - > new completable future < > ( ) ) create testing task executor gateway ( ) ; final task executor connection task manager connection = create task executor connection ( task executor gateway ) ; final resource i d resource id = task manager connection get resource i d ( ) ; final slot i d slot id 1 = new slot i d ( resource id , 0 ) ; final slot i d slot id 2 = new slot i d ( resource id , 1 ) ; final slot report slot report = new slot report ( arrays as list ( create allocated slot status ( slot id 1 ) , create free slot status ( slot id 2 ) ) ) ; final resource requirements resource requirements = create resource requirements for single slot ( ) ; final default slot tracker slot tracker = new default slot tracker ( ) ; try ( declarative slot manager slot manager = create declarative slot manager builder ( ) set slot tracker ( slot tracker ) build and start with direct exec ( ) ) { slot manager register task manager ( task manager connection , slot report , resource profile any , resource profile any ) ; assert equals ( " the number registered slots does not equal the expected number " , 2 , slot manager get number registered slots ( ) ) ; slot manager process resource requirements ( resource requirements ) ; slot manager unregister task manager ( task manager connection get instance i d ( ) , test exception ) ; assert equals ( 0 , slot manager get number registered slots ( ) ) ; } }


sets the source jars corresponding to the jar files included in this rule used by , e g , the srcjars attribute of { @ link java import }

public builder set source jars for jar files ( collection < artifact > source jars for jar files ) { this source jars for jar files = preconditions check not null ( source jars for jar files ) ; return this ; }


verify that the calling thread is the android main thread calls to this method are usually preconditions for subscription behavior which instances of this class later undo see the class documentation for an example

public static void verify main thread ( ) { if ( looper my looper ( ) ! = looper get main looper ( ) ) { throw new illegal state exception ( " expected to be called on the main thread but was " + thread current thread ( ) get name ( ) ) ; } }


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


test the property ' enum string required '

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


private void destroy all invokers ( ) { map < url , invoker < t > > local url invoker map = this url invoker map ; / / local reference if ( local url invoker map ! = null ) { for ( invoker < t > invoker : new array list < > ( local url invoker map values ( ) ) ) { try { invoker destroy ( ) ; } catch ( throwable t ) { logger warn ( " failed to destroy service " + service key + " to provider " + invoker get url ( ) , t ) ; } } local url invoker map clear ( ) ; } invokers = null ; }


specify a custom hessian connection factory to use for the hessian client

public void set connection factory ( hessian connection factory connection factory ) { this proxy factory set connection factory ( connection factory ) ; }


sets the new current nested level and pushes old current nested level down the stack returns that level

public object mapper next level ( object mapper level ) { object mapper previous = level stack peek ( ) ; level stack push ( level ) ; return previous ; }


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


tests simple value state queryable state instance with a default value set each source emits ( subtask index , 0 ) ( subtask index , num elements ) tuples , the key is mapped to 1 but key 0 is queried which should throw a { @ link unknown key or namespace exception } exception

public void test value state default ( ) throws throwable { final deadline deadline = deadline now ( ) plus ( test timeout ) ; final long num elements = 1024l ; stream execution environment env = stream execution environment get execution environment ( ) ; env set state backend ( state backend ) ; env set parallelism ( max parallelism ) ; / / very important , because cluster is shared between tests and we / / don ' t explicitly check that all slots are available before / / submitting env set restart strategy ( restart strategies fixed delay restart ( integer max value , 1000l ) ) ; data stream < tuple 2 < integer , long > > source = env add source ( new test ascending value source ( num elements ) ) ; value state descriptor < tuple 2 < integer , long > > value state = new value state descriptor < > ( " any " , source get type ( ) , tuple 2 of ( 0 , 1337l ) ) ; / / only expose key " 1 " queryable state stream < integer , tuple 2 < integer , long > > queryable state = source key by ( new key selector < tuple 2 < integer , long > , integer > ( ) { private static final long serial version u i d = 4509274556892655887l ; @ override public integer get key ( tuple 2 < integer , long > value ) { return 1 ; } } ) as queryable state ( " hakuna " , value state ) ; try ( auto cancellable job auto cancellable job = new auto cancellable job ( deadline , cluster client , env ) ) { final job i d job id = auto cancellable job get job id ( ) ; final job graph job graph = auto cancellable job get job graph ( ) ; cluster client submit job ( job graph ) get ( ) ; / / now query int key = 0 ; completable future < value state < tuple 2 < integer , long > > > future = get kv state ( deadline , client , job id , queryable state get queryable state name ( ) , key , basic type info int type info , value state , true , executor ) ; try { future get ( deadline time left ( ) to millis ( ) , time unit milliseconds ) ; } catch ( execution exception | completion exception e ) { / / get ( ) on a completed exceptionally future wraps the / / exception in an execution exception throw e get cause ( ) ; } } }


resolves the given path into inodes reserved paths are not handled and permissions are not verified client supplied paths should be resolved via { @ link # resolve path ( f s permission checker , string , dir op ) } this method should only be used by internal methods

public i nodes in path get i nodes in path ( string src , dir op dir op ) throws unresolved link exception , access control exception , parent not directory exception { return get i nodes in path ( i node get path components ( src ) , dir op ) ; }


retrieve the name of the key class for this sequence file

public string get key class name ( ) { return in get key class name ( ) ; }


store the child node entry ( key and buffer id ) associated with the specified key index the entry at index is overwritten since each entry is a fixed length , movement of existing entries is not necessary

private void put entry ( int index , long key , int buffer id ) { int offset = base + ( index * entry size ) ; buffer put long ( offset , key ) ; buffer put int ( offset + key size , buffer id ) ; }


performs { @ link # resume requests ( ) } recursively for all managers that are contextually descendant to this manager based on the activity fragment hierarchy the hierarchical semantics are identical as for { @ link # pause requests recursive ( ) }

public synchronized void resume requests recursive ( ) { util assert main thread ( ) ; resume requests ( ) ; for ( request manager request manager : tree node get descendants ( ) ) { request manager resume requests ( ) ; } }


public void handle application ready event ( final application ready event event ) { ascii art utils print ascii art ready ( logger , string utils empty ) ; logger info ( " ready to process requests @ [ { } ] " , date time utils zoned date time of ( instant of epoch milli ( event get timestamp ( ) ) ) ) ; }


check that a known database produces recognizable codes

public void test default instance with oracle ( ) { s q l error codes sec = s q l error codes factory get instance ( ) get error codes ( " oracle " ) ; assert is oracle ( sec ) ; }


private void put long key record ( d b record record ) throws i o exception { / / boolean inserted = false ; try { / / ? ? do we need to validate record against schema / / establish root node + + mod count ; long key node root node = null ; if ( root buffer id < 0 ) { root node = long key record node create record node ( node mgr , schema ) ; } else { root node = node mgr get long key node ( root buffer id ) ; } / / put record and update root buffer id long rec key = record get key ( ) ; long key record node leaf = root node get leaf node ( rec key ) ; root node = leaf put record ( record , is indexed ? this : null ) ; int id = root node get buffer id ( ) ; if ( root buffer id ! = id ) { root buffer id = id ; table record set root buffer id ( root buffer id ) ; } / / update maximum key if ( maximum key < rec key ) { maximum key = rec key ; table record set max key ( maximum key ) ; } } finally { / / release node buffers and update record count int delta = node mgr release nodes ( ) ; if ( delta ! = 0 ) { / / inserted = true ; record count + = delta ; table record set record count ( record count ) ; } } }


match the given { @ code path } against the given { @ code pattern } , according to this path matcher ' s matching strategy

boolean match ( string pattern , string path ) ;


remove all { @ link # flushed entry stored ( object ) flushed entries } , { @ link # flushed entry removed ( object ) flushed removals } ,

public void clear ( ) { restorable entries clear ( ) ; flushed entries clear ( ) ; flushed removals clear ( ) ; }


configure the indentation settings for the supplied { @ link transformer }

protected final void configure indentation ( transformer transformer ) { if ( this indent ) { transformer utils enable indenting ( transformer ) ; } else { transformer utils disable indenting ( transformer ) ; } }


public void set configuration ( configuration configuration ) { this configuration = configuration ; }


configure the default destination to use in send methods that don ' t have a destination argument if a default destination is not configured , send methods without a destination argument will raise an exception if invoked

public void set default destination ( @ nullable d default destination ) { this default destination = default destination ; }


add the stats to the reporter , print if completed , and stop the simulator

private void report stats ( policy stats stats ) throws i o exception { reporter add ( stats ) ; if ( reporter stats ( ) size ( ) = = seq as java list ( router routees ( ) ) size ( ) ) { reporter print ( ) ; context ( ) stop ( self ( ) ) ; system out println ( " executed in " + stopwatch ) ; } }


retrieves and removes the head of the given queue , waiting if necessary until an element becomes available

circular element < e > take ( sort stage stage ) throws interrupted exception ;


return the names of singleton beans registered in this registry only checks already instantiated singletons ; does not return names for singleton bean definitions which have not been instantiated yet the main purpose of this method is to check manually registered singletons ( see { @ link # register singleton } ) can also be used to check which singletons defined by a bean definition have already been created


specifies the time attribute on which rows are ordered for streaming tables , reference a rowtime or proctime time attribute here to specify the time mode for batch tables , refer to a timestamp or long attribute

public static over window partitioned ordered order by ( string order by ) { return partition by ( ) order by ( order by ) ; }


returns the transformer class that contains all matrices and is responsible for transforming values into pixels on the screen and backwards

public transformer get transformer ( axis dependency which ) { if ( which = = axis dependency left ) return m left axis transformer ; else return m right axis transformer ; }


indicates whether or not a push promise was sent to the remote endpoint


add a leaf node update node counter & amp ; rack counter if necessary

public void add ( node node ) { if ( node = = null ) return ; int new depth = node base location to depth ( node get network location ( ) ) + 1 ; netlock write lock ( ) lock ( ) ; try { if ( node instanceof inner node ) { throw new illegal argument exception ( " not allow to add an inner node : " + node base get path ( node ) ) ; } if ( ( depth of all leaves ! = - 1 ) & & ( depth of all leaves ! = new depth ) ) { log error ( " error : can ' t add leaf node { } at depth { } to topology : { } \ n " , node base get path ( node ) , new depth , this ) ; throw new invalid topology exception ( " failed to add " + node base get path ( node ) + " : you cannot have a rack and a non - rack node at the same " + " level of the network topology " ) ; } node rack = get node for network location ( node ) ; if ( rack ! = null & & ! ( rack instanceof inner node ) ) { throw new illegal argument exception ( " unexpected data node " + node to string ( ) + " at an illegal network location " ) ; } if ( cluster map add ( node ) ) { log info ( " adding a new node : " + node base get path ( node ) ) ; if ( rack = = null ) { increment racks ( ) ; } if ( depth of all leaves = = - 1 ) { depth of all leaves = node get level ( ) ; } } log debug ( " network topology became : \ n { } " , this ) ; } finally { netlock write lock ( ) unlock ( ) ; } }


returns a { @ link media item } for the content defined by the request

public media item to media item ( ) { return new media item builder ( ) set media id ( id ) set uri ( uri ) set custom cache key ( custom cache key ) set mime type ( mime type ) set stream keys ( stream keys ) set drm key set id ( key set id ) build ( ) ; }


public list < v > sub list ( int from index , int to index ) { throw new unsupported operation exception ( ) ; }


test { @ code set file reader } methods next ( ) , get ( ) in combination

public void test set file access methods ( ) { try { file system fs = file system get local ( conf ) ; int size = 10 ; write data ( fs , size ) ; set file reader reader = create reader ( fs ) ; assert true ( " test set file with construction 1 error ! ! ! " , reader next ( new int writable ( 0 ) ) ) ; / / don ' t know why reader get ( i ) return i + 1 assert equals ( " test set file with construction 2 error ! ! ! " , new int writable ( size / 2 + 1 ) , reader get ( new int writable ( size / 2 ) ) ) ; assert null ( " test set file with construction 3 error ! ! ! " , reader get ( new int writable ( size * 2 ) ) ) ; } catch ( exception ex ) { fail ( " test set file with construction error ! ! ! " ) ; } }


a { @ link collector } implementation that joins { @ link code block } instances together into one separated by { @ code separator } for example , joining { @ code string s } , { @ code object o } and { @ code int i } using { @ code " , " } would produce { @ code string s , object o , int i }

public static collector < code block , ? , code block > joining ( string separator ) { return collector of ( ( ) - > new code block joiner ( separator , builder ( ) ) , code block joiner : : add , code block joiner : : merge , code block joiner : : join ) ; }


static my token create tokens ( text renewer ) throws i o exception { text user 1 = new text ( " user 1 " ) ; my delegation token secret manager sm = new my delegation token secret manager ( d f s config keys dfs namenode delegation key update interval default , d f s config keys dfs namenode delegation token max lifetime default , d f s config keys dfs namenode delegation token renew interval default , 3600000 , null ) ; sm start threads ( ) ; delegation token identifier dt id 1 = new delegation token identifier ( user 1 , renewer , user 1 ) ; my token token 1 = new my token ( dt id 1 , sm ) ; token 1 set service ( new text ( " localhost : 0 " ) ) ; return token 1 ; }


test that uploading blobs works to both the action cache and the cas also test that the handler is reusable

public void uploads should work ( ) throws exception { embedded channel ch = new embedded channel ( new http upload handler ( null , immutable list of ( ) ) ) ; http response status [ ] statuses = new http response status [ ] { http response status ok , http response status created , http response status accepted , http response status no content } ; for ( http response status status : statuses ) { uploads should work ( true , ch , status ) ; uploads should work ( false , ch , status ) ; } }


emits a new tuple to a specific stream with a single anchor the emitted values must be immutable

public list < integer > emit ( string stream id , tuple anchor , list < object > tuple ) { return emit ( stream id , arrays as list ( anchor ) , tuple ) ; }


public http client create http client ( ) { val builder = new std http client builder ( ) url ( couch db properties get url ( ) ) max connections ( couch db properties get max connections ( ) ) max cache entries ( couch db properties get max cache entries ( ) ) connection timeout ( couch db properties get connection timeout ( ) ) socket timeout ( couch db properties get socket timeout ( ) ) enable s s l ( couch db properties is enable ssl ( ) ) relaxed s s l settings ( couch db properties is relaxed ssl settings ( ) ) caching ( couch db properties is caching ( ) ) max object size bytes ( couch db properties get max object size bytes ( ) ) use expect continue ( couch db properties is use expect continue ( ) ) cleanup idle connections ( couch db properties is cleanup idle connections ( ) ) ; if ( string utils is not blank ( couch db properties get proxy host ( ) ) ) { builder proxy ( couch db properties get proxy host ( ) ) ; if ( couch db properties get proxy port ( ) > 0 ) { builder proxy port ( couch db properties get proxy port ( ) ) ; logger info ( " couch db proxy settings enabled [ { } ] : [ { } ] " , couch db properties get proxy host ( ) , couch db properties get proxy port ( ) ) ; } else { logger debug ( " proxy port not set for host [ { } ] clearing proxy host " , couch db properties get proxy host ( ) ) ; builder proxy ( null ) ; } } if ( string utils is not blank ( couch db properties get username ( ) ) ) { builder username ( couch db properties get username ( ) ) ; } if ( string utils is not blank ( couch db properties get password ( ) ) ) { builder password ( couch db properties get password ( ) ) ; } val client = builder build ( ) ; logger debug ( " client created : [ { } ] " , client ) ; return client ; }


set up drag and drop and drop for the component edit area

private void set up drag drop ( ) { / / set up the drop site table selection color for dn d table cell renderer def renderer = table get default renderer ( string class ) ; dnd table cell renderer = new dnd table cell renderer ( def renderer , table ) ; dnd table cell renderer set border color ( color utils derive background ( table get selection background ( ) , color utils hue pine ) ) ; table set default renderer ( string class , dnd table cell renderer ) ; table cell renderer dti renderer = table get default renderer ( data type instance class ) ; dnd dti cell renderer = new dnd table cell renderer ( dti renderer , table ) ; dnd dti cell renderer set border color ( color utils derive background ( table get selection background ( ) , color utils hue pine ) ) ; table set default renderer ( data type instance class , dnd dti cell renderer ) ; / / data types are the only thing that can be dragged / dropped in the editor acceptable flavors = new data flavor [ ] { data type transferable local data type flavor , data type transferable local builtin data type flavor } ; / / set up the field panel as a drop target that accepts data types drop target adapter = new drop tgt adapter ( this , dn d constants action copy or move , acceptable flavors ) ; drop target = new drop target ( table , dn d constants action copy or move , drop target adapter , true ) ; drop target set active ( true ) ; / / set up the component area as a drag site that provides data types drag source = drag source get default drag source ( ) ; drag gesture adapter = new drag gesture adapter ( this ) ; drag source adapter = new drag src adapter ( this ) ; drag source create default drag gesture recognizer ( table , drag action , drag gesture adapter ) ; }


map of string keys and values that can be used to organize and categorize resources within a collection < code > map & lt ; string , string & gt ; labels = 4 ; < code >

public boolean contains labels ( java lang string key ) { if ( key = = null ) { throw new java lang null pointer exception ( ) ; } return internal get labels ( ) get map ( ) contains key ( key ) ; }


returns a freshly created { @ link weak value reference } for the given { @ code entry } ( and on the given { @ code queue } with the same value as this { @ link weak value reference }

weak value reference < k , v , e > copy for ( reference queue < v > queue , e entry ) ;


directly load the raw model data on the calling thread

public model data load model data ( final file handle file handle ) { return load model data ( file handle , null ) ; }


writes { @ code s } to { @ code out } encoded as utf - 8 , returns the written length in bytes

private static long write string ( string s , output stream out ) throws i o exception { byte [ ] b = s get bytes ( standard charsets utf 8 ) ; out write ( b ) ; return b length ; }


all foldable conditions that fold to false should have been removed by the optimizer

public boolean foldable ( ) { if ( conditions is empty ( ) & & else result foldable ( ) ) { return true ; } if ( conditions size ( ) = = 1 & & conditions get ( 0 ) condition ( ) foldable ( ) ) { if ( conditions get ( 0 ) condition ( ) fold ( ) = = boolean true ) { return conditions ( ) get ( 0 ) result ( ) foldable ( ) ; } else { return else result ( ) foldable ( ) ; } } return false ; }


builds a map which can be used with create , confirming that the desired flag values were actually received , and producing an error if they were not ( because aliases were used ) if the attribute which defines feature flags was not specified , an empty { @ link optional } instance is returned

public static optional < immutable map < label , string > > get and validate flag map from rule context ( rule context rule context ) throws rule error exception { nonconfigurable attribute mapper attrs = nonconfigurable attribute mapper of ( rule context get rule ( ) ) ; if ( ! attrs is attribute value explicitly specified ( feature flag attr ) ) { return optional absent ( ) ; } map < label , string > expected values = attrs get ( feature flag attr , build type label keyed string dict ) ; if ( expected values is empty ( ) ) { return optional of ( immutable map of ( ) ) ; } if ( ! config feature flag is available ( rule context ) ) { throw rule context throw with attribute error ( feature flag attr , string format ( " the % s attribute is not available in package ' % s ' " , feature flag attr , rule context get label ( ) get package identifier ( ) ) ) ; } iterable < ? extends transitive info collection > actual targets = rule context get prerequisites ( feature flag attr ) ; rule error exception exception = null ; for ( transitive info collection target : actual targets ) { label label = alias provider get dependency label ( target ) ; if ( ! label equals ( target get label ( ) ) ) { try { exception = rule context throw with attribute error ( feature flag attr , string format ( " feature flags must be named directly , not through aliases ; use ' % s ' , not " + " ' % s ' " , target get label ( ) , label ) ) ; } catch ( rule error exception e ) { exception = e ; } } } if ( exception ! = null ) { throw exception ; } return optional of ( immutable map copy of ( expected values ) ) ; }


sync buffered data to data nodes ( flush to disk devices )

public void hsync ( enum set < sync flag > sync flags ) throws i o exception { output stream wrapped stream = get wrapped stream ( ) ; if ( wrapped stream instanceof crypto output stream ) { wrapped stream flush ( ) ; wrapped stream = ( ( crypto output stream ) wrapped stream ) get wrapped stream ( ) ; } ( ( d f s output stream ) wrapped stream ) hsync ( sync flags ) ; }


emulate the resource usage to match the usage target the plugin can use the given { @ link resource calculator plugin } to query for the current resource usage

void emulate ( ) throws i o exception , interrupted exception ;


get the { @ link file io provider } for disk io operations

public file io provider get file io provider ( ) { / / in tests and when invoked via fs dataset util # compute checksum , the / / target volume for this replica may be unknown and hence null / / use the default file io provider with no - op hooks return ( volume ! = null ) ? volume get file io provider ( ) : default file io provider ; }


this helper method resolves the dependencies between the ground truth of the operator state obtained from the job manager and potential alternatives for recovery , e g from a task - local source

protected < t extends state object > list < state object collection < t > > resolve prioritized alternatives ( state object collection < t > job manager state , list < state object collection < t > > alternatives by priority , bi function < t , t , boolean > approve fun ) { / / nothing to resolve if there are no alternatives , or the ground truth has already no / / state , or if we can / / assume that a rescaling happened because we find more than one handle in the jm state / / ( this is more a sanity / / check ) if ( alternatives by priority = = null | | alternatives by priority is empty ( ) | | ! job manager state has state ( ) | | job manager state size ( ) ! = 1 ) { return collections singleton list ( job manager state ) ; } / / as we know size is = = 1 t reference = job manager state iterator ( ) next ( ) ; / / this will contain the end result , we initialize it with the potential max size list < state object collection < t > > approved = new array list < > ( 1 + alternatives by priority size ( ) ) ; for ( state object collection < t > alternative : alternatives by priority ) { / / we found an alternative to the jm state if it has state , we have a 1 : 1 / / relationship , and the / / approve - function signaled true if ( alternative ! = null & & alternative has state ( ) & & alternative size ( ) = = 1 & & boolean utils is true ( approve fun apply ( reference , alternative iterator ( ) next ( ) ) ) ) { approved add ( alternative ) ; } } / / of course we include the ground truth as last alternative approved add ( job manager state ) ; return collections unmodifiable list ( approved ) ; }


get the list of nodes transforms are executing on

public static string [ ] transform task nodes ( list < string > transform ids , cluster state cluster state ) { set < string > executor nodes = new hash set < > ( ) ; persistent tasks custom metadata tasks metadata = persistent tasks custom metadata get persistent tasks custom metadata ( cluster state ) ; if ( tasks metadata ! = null ) { set < string > transform ids set = new hash set < > ( transform ids ) ; collection < persistent tasks custom metadata persistent task < ? > > tasks = tasks metadata find tasks ( transform field task name , t - > transform ids set contains ( t get id ( ) ) & & t is assigned ( ) ) ; for ( persistent tasks custom metadata persistent task < ? > task : tasks ) { executor nodes add ( task get executor node ( ) ) ; } } return executor nodes to array ( new string [ 0 ] ) ; }


public void reset ( ) { reset ( 0l ) ; }


gets the initial solution set this is the data set on which the delta iteration was started consider the following example : { @ code data set < my type > solution set data = ; data set < another type > workset data = ; delta iteration < my type , another type > iteration = solution set data iterator delta ( workset data , 10 , ) ; } the < tt > solution set data < tt > would be the data set returned by { @ code iteration get initial solution set ( ) ; }

public data set get initial solution set ( ) { return initial solution set ; }


configure view resolution for supporting template engines

protected void configure view resolvers ( view resolver registry registry ) { }


sets a new value for the stack depth change at the indicated address

public static void set stack depth change ( program program , address address , int stack depth change ) throws duplicate name exception { property map manager pmm = program get usr property manager ( ) ; int property map ipm = pmm get int property map ( stack depth change name ) ; if ( ipm = = null ) { ipm = pmm create int property map ( stack depth change name ) ; } ipm add ( address , stack depth change ) ; }


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


shutdown the resources , such as thread pool

public void shutdown ( ) throws nacos exception ;


completes the join operation with the user function that is executed for each combination of elements with the same key in a window note : this method ' s return type does not support setting an operator - specific parallelism due to binary backwards compatibility , this cannot be altered use the { @ link # with ( join function ) } method to set an operator - specific parallelism

public < t > data stream < t > apply ( join function < t1 , t2 , t > function ) { type information < t > result type = type extractor get binary operator return type ( function , join function class , 0 , 1 , 2 , type extractor no index , input 1 get type ( ) , input 2 get type ( ) , " join " , false ) ; return apply ( function , result type ) ; }


updates to our list of queues : adds the new queues and deletes the removed ones be careful , do not overwrite existing queues

private void update queues ( c s queue store existing queues , c s queue store new queues ) { capacity scheduler configuration conf = cs context get configuration ( ) ; for ( c s queue queue : new queues get queues ( ) ) { if ( existing queues get ( queue get queue path ( ) ) = = null ) { existing queues add ( queue ) ; } } for ( c s queue queue : existing queues get queues ( ) ) { if ( new queues get ( queue get queue path ( ) ) = = null & & ! ( queue instanceof auto created leaf queue & & conf is auto create child queue enabled ( queue get parent ( ) get queue path ( ) ) ) ) { existing queues remove ( queue ) ; } } }


add a varargs list of configuration parameters — if they are present

public void add conf options ( configuration conf , string keys ) { for ( string key : keys ) { add conf option ( conf , key ) ; } }


allows the view to be scrolled by an x and y offset

public touch actions scroll ( int x offset , int y offset ) { if ( touch screen ! = null ) { action add action ( new scroll action ( touch screen , x offset , y offset ) ) ; } return this ; }


public < t > t execute ( function < response , t > handler ) { return handler apply ( rest assured given ( ) spec ( req spec build ( ) ) expect ( ) spec ( resp spec build ( ) ) when ( ) request ( req method , req uri ) ) ; }


determine the class loader to use for pointcut evaluation

private class loader determine pointcut class loader ( ) { if ( this bean factory instanceof configurable bean factory ) { return ( ( configurable bean factory ) this bean factory ) get bean class loader ( ) ; } if ( this pointcut declaration scope ! = null ) { return this pointcut declaration scope get class loader ( ) ; } return class utils get default class loader ( ) ; }


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


adds an alias in case class names change unlike { @ link # alias ( string , class ) } , which uses the registered alias name for writing xml , this method registers an alias to be used only for the sake of reading from xml this makes this method usable for the situation when class names change

public void add compatibility alias ( string old class name , class new class ) { compatibility aliases put ( old class name , new class ) ; }


returns a < a href = " https : en wikipedia orgwiki hex dump " > hex dump of the specified buffer ' s readable bytes

public static string hex dump ( byte buf buffer ) { return hex dump ( buffer , buffer reader index ( ) , buffer readable bytes ( ) ) ; }


reads a { @ link byte size unit } from a given { @ link stream input }

public static byte size unit read from ( stream input in ) throws i o exception { return byte size unit from id ( in read v int ( ) ) ; }


public span utils set horizontal align ( @ non null final alignment alignment ) { this alignment = alignment ; return this ; }


this method throws an exception if the indicated data type is not a valid data type for a component of this composite data type

protected void validate data type ( data type data type ) { if ( is internally aligned ( ) & & data type = = data type default ) { throw new illegal argument exception ( " the default data type is not allowed in an aligned composite data type " ) ; } if ( data type instanceof factory data type ) { throw new illegal argument exception ( " the \ " " + data type get name ( ) + " \ " data type is not allowed in a composite data type " ) ; } else if ( data type instanceof dynamic ) { dynamic dynamic data type = ( dynamic ) data type ; if ( ! dynamic data type can specify length ( ) ) { throw new illegal argument exception ( " the \ " " + data type get name ( ) + " \ " data type is not allowed in a composite data type " ) ; } } }


returns the smallest power of two greater than or equal to { @ code x }

static long ceiling power of two ( long x ) { / / from hacker ' s delight , chapter 3 , harry s warren jr return 1l < < - long number of leading zeros ( x - 1 ) ; }


private void on mouse vertical wheel ( event e ) { if ( v scroll get visible ( ) ) { v scroll handle mouse wheel ( e ) ; if ( get vertical bar ( ) = = null ) e doit = false ; } else { if ( h scroll get visible ( ) ) { h scroll handle mouse wheel ( e ) ; if ( get horizontal bar ( ) = = null ) e doit = false ; } } }


public nodes info request builder set settings ( boolean settings ) { add or remove metric ( settings , nodes info request metric settings ) ; return this ; }


stops the configured { @ link scheduled reporter } from reporting metrics

public void stop ( ) throws exception { try { if ( report on stop ) { reporter report ( ) ; } } finally { reporter stop ( ) ; } }


public void run ( string [ ] args ) throws i o exception , u r i syntax exception { if ( ! parse arguments ( args ) ) { return ; } start ( ) ; sleep forever ( ) ; }


initiate shutdown , but do not wait for it to complete

public void begin shutdown ( ) { if ( ! shutdown executor is shutdown ( ) ) { shutdown executor submit ( ( callable < void > ) ( ) - > { try { log info ( " stopping rest server " ) ; jetty server stop ( ) ; jetty server join ( ) ; log info ( " rest server stopped " ) ; } catch ( exception e ) { log error ( " unable to stop rest server " , e ) ; } finally { jetty server destroy ( ) ; } shutdown executor shutdown ( ) ; return null ; } ) ; } }


public static void patch ( string path , string accept type , route route ) { get instance ( ) patch ( path , accept type , route ) ; }


aggregates the thread ' s local samples into the global metrics the caller should ensure its thread safety

private void aggregate local states to global metrics ( final concurrent map < string , thread safe sample stat > local stats ) { for ( map entry < string , thread safe sample stat > entry : local stats entry set ( ) ) { string name = entry get key ( ) ; mutable rate global metric = add metric if not exists ( name ) ; entry get value ( ) snapshot into ( global metric ) ; } }


sets whether the fast forward button is shown

public void set show fast forward button ( boolean show fast forward button ) { control view layout manager set show button ( fast forward button , show fast forward button ) ; update navigation ( ) ; }


create a file with the provided permission the permission of the file is set to be the provided permission as in set permission , not permission { @ literal & ~ } umask the hdfs implementation is implemented using two r p cs it is understood that it is inefficient , but the implementation is thread - safe the other option is to change the value of umask in configuration to be 0 , but it is not thread - safe

public static f s data output stream create ( file system fs , path file , fs permission permission ) throws i o exception { / / create the file with default permission f s data output stream out = fs create ( file ) ; / / set its permission to the supplied one fs set permission ( file , permission ) ; return out ; }


copies the contents of this byte source to the given { @ code output stream } does not close { @ code output }

public long copy to ( output stream output ) throws i o exception { check not null ( output ) ; closer closer = closer create ( ) ; try { input stream in = closer register ( open stream ( ) ) ; return byte streams copy ( in , output ) ; } catch ( throwable e ) { throw closer rethrow ( e ) ; } finally { closer close ( ) ; } }


returns < code > true < code > iff this context is a system context

public boolean is system context ( ) { return thread local get ( ) is system context ; }


public encrypted i d encode ( final name i d saml object , final saml registered service service , final saml registered service service provider metadata facade adaptor ) { try { val encrypter = build encrypter for saml object ( saml object , service , adaptor ) ; if ( encrypter ! = null ) { return encrypter encrypt ( saml object ) ; } } catch ( final exception e ) { handle encryption failure ( service , adaptor ) ; } return null ; }


set the storage directories which will be used this should only ever be called from inside n n storage however , it needs to remain package private for testing , as storage directories need to be reinitialised after using mockito spy ( ) on this class , as mockito doesn ' t work well with inner classes , such as storage directory in this case synchronized due to initialization of storage dirs and removed storage dirs

synchronized void set storage directories ( collection < uri > fs name dirs , collection < uri > fs edits dirs , collection < uri > shared edits dirs ) throws i o exception { get storage dirs ( ) clear ( ) ; this removed storage dirs clear ( ) ; / / add all name dirs with appropriate name node dir type for ( uri dir name : fs name dirs ) { check scheme consistency ( dir name ) ; boolean is also edits = false ; for ( uri edits dir name : fs edits dirs ) { if ( edits dir name compare to ( dir name ) = = 0 ) { is also edits = true ; fs edits dirs remove ( edits dir name ) ; break ; } } name node dir type dir type = ( is also edits ) ? name node dir type image and edits : name node dir type image ; / / add to the list of storage directories , only if the / / uri is of type file : / / if ( dir name get scheme ( ) compare to ( " file " ) = = 0 ) { / / don ' t lock the dir if it ' s shared storage directory sd = new storage directory ( new file ( dir name get path ( ) ) , dir type , shared edits dirs contains ( dir name ) , new fs permission ( conf get ( d f s config keys dfs namenode name dir permission key , d f s config keys dfs namenode name dir permission default ) ) ) ; this add storage dir ( sd ) ; } } / / add edits dirs if they are different from name dirs for ( uri dir name : fs edits dirs ) { check scheme consistency ( dir name ) ; / / add to the list of storage directories , only if the / / uri is of type file : / / if ( dir name get scheme ( ) compare to ( " file " ) = = 0 ) { this add storage dir ( new storage directory ( new file ( dir name get path ( ) ) , name node dir type edits , shared edits dirs contains ( dir name ) , new fs permission ( conf get ( d f s config keys dfs namenode name dir permission key , d f s config keys dfs namenode name dir permission default ) ) ) ) ; } } }


to test enum parameters to test enum parameters

public void test enum parameters ( list < string > enum header string array , string enum header string , list < string > enum query string array , string enum query string , integer enum query integer , double enum query double , list < string > enum form string array , string enum form string , api client auth info auth info , handler < async result < void > > result handler ) { delegate test enum parameters ( enum header string array , enum header string , enum query string array , enum query string , enum query integer , enum query double , enum form string array , enum form string , auth info , result handler ) ; }


helper method for summarizing a list of values

protected numeric column summary < short > summarize ( integer values ) { / / cast everything to short here short [ ] short values = new short [ values length ] ; for ( int i = 0 ; i < values length ; i + + ) { if ( values [ i ] ! = null ) { short values [ i ] = values [ i ] short value ( ) ; } } return new aggregate combine harness < short , numeric column summary < short > , short summary aggregator > ( ) { @ override protected void compare results ( numeric column summary < short > result 1 , numeric column summary < short > result 2 ) { assert assert equals ( result 1 get total count ( ) , result 2 get total count ( ) ) ; assert assert equals ( result 1 get null count ( ) , result 2 get null count ( ) ) ; assert assert equals ( result 1 get missing count ( ) , result 2 get missing count ( ) ) ; assert assert equals ( result 1 get non missing count ( ) , result 2 get non missing count ( ) ) ; assert assert equals ( result 1 get infinity count ( ) , result 2 get infinity count ( ) ) ; assert assert equals ( result 1 get nan count ( ) , result 2 get nan count ( ) ) ; assert assert equals ( result 1 contains null ( ) , result 2 contains null ( ) ) ; assert assert equals ( result 1 contains non null ( ) , result 2 contains non null ( ) ) ; assert assert equals ( result 1 get min ( ) short value ( ) , result 2 get min ( ) short value ( ) ) ; assert assert equals ( result 1 get max ( ) short value ( ) , result 2 get max ( ) short value ( ) ) ; assert assert equals ( result 1 get sum ( ) short value ( ) , result 2 get sum ( ) short value ( ) ) ; assert assert equals ( result 1 get mean ( ) double value ( ) , result 2 get mean ( ) double value ( ) , 1e - 1 2d ) ; assert assert equals ( result 1 get variance ( ) double value ( ) , result 2 get variance ( ) double value ( ) , 1e - 9d ) ; assert assert equals ( result 1 get standard deviation ( ) double value ( ) , result 2 get standard deviation ( ) double value ( ) , 1e - 1 2d ) ; } } summarize ( short values ) ; }


receive first notification of a logical and predicate the first subsequent notification will contain the left - hand side of the and - predicate ; followed by { @ link # and ( ) } , followed by the right - hand side , followed by { @ link # end and ( ) }


consider using { @ link # add ( int ) } instead for primitive integer values

public void add ( integer value ) { this max = math max ( this max , value ) ; }


utility function to compute the hash code of an array using the murmur hash algorithm

public static < t > int hash code ( t [ ] data , int seed ) { int hash = initialize ( seed ) ; for ( t value : data ) { hash = update ( hash , value ) ; } hash = finish ( hash , data length ) ; return hash ; }


initialize this transformer this is called once per instance when the topology gets initialized the provided { @ link processor context context } can be used to access topology and record meta data , to { @ link processor context # schedule ( duration , punctuation type , punctuator ) schedule } a method to be { @ link punctuator # punctuate ( long ) called periodically } and to access attached { @ link state store } s note that { @ link processor context } is updated in the background with the current record ' s meta data thus , it only contains valid record meta data when accessed within { @ link # transform ( object , object ) } note that using { @ link processor context # forward ( object , object ) } or { @ link processor context # forward ( object , object , to ) } is not allowed within any method of { @ code value transformer with key } and will result in an { @ link streams exception exception }

void init ( final processor context context ) ;


manually implemented with json so not as slow as normal java

public span serialize kryo ( ) { return kryo read object ( new input ( client span serialized ) , span class ) ; }


uses a hash table to map keys to value collections , initialized to expect the specified number of keys

public static multimap builder with keys < object > hash keys ( final int expected keys ) { check nonnegative ( expected keys , " expected keys " ) ; return new multimap builder with keys < object > ( ) { @ override < k , v > map < k , collection < v > > create map ( ) { return platform new hash map with expected size ( expected keys ) ; } } ; }


public collection < ? extends item > items ( ) { if ( ordered defs ! = null ) { return ordered defs ; } return class defs values ( ) ; }


creates the notification if it does not exist already and recreates it if force recreate is true updates the notification with the data in the player

synchronized void create notification if needed and update ( final player player , final boolean force recreate ) { if ( force recreate | | notification builder = = null ) { notification builder = create notification ( player ) ; } update notification ( player ) ; notification manager notify ( notification id , notification builder build ( ) ) ; }


builds the { @ link animated image result } the preview bitmap and the decoded frames are closed after build is called , so this should not be called more than once or those fields will be lost after the first call

public animated image result build ( ) { try { return new animated image result ( this ) ; } finally { closeable reference close safely ( m preview bitmap ) ; m preview bitmap = null ; closeable reference close safely ( m decoded frames ) ; m decoded frames = null ; } }


test for { @ link jms listener repeatable bean } and { @ link jms listeners bean } that validates that the { @ code @ jms listener } annotation is repeatable and generate one specific container per annotation

protected void test jms listener repeatable ( application context context ) { jms listener container test factory simple factory = context get bean ( " jms listener container factory " , jms listener container test factory class ) ; assert that ( simple factory get listener containers ( ) size ( ) ) is equal to ( 2 ) ; method jms listener endpoint first = ( method jms listener endpoint ) simple factory get listener container ( " first " ) get endpoint ( ) ; assert that ( first get id ( ) ) is equal to ( " first " ) ; assert that ( first get destination ( ) ) is equal to ( " my queue " ) ; assert that ( first get concurrency ( ) ) is equal to ( null ) ; method jms listener endpoint second = ( method jms listener endpoint ) simple factory get listener container ( " second " ) get endpoint ( ) ; assert that ( second get id ( ) ) is equal to ( " second " ) ; assert that ( second get destination ( ) ) is equal to ( " another queue " ) ; assert that ( second get concurrency ( ) ) is equal to ( " 2 - 10 " ) ; }


generate overview table for app web page

private void generate overview table ( app info app , string scheduler path , string web ui type , application report app report ) { response info overview table = info ( " application overview " ) ( " user : " , scheduler path , app get user ( ) ) ( " name : " , app get name ( ) ) ( " application type : " , app get type ( ) ) ( " application tags : " , app get application tags ( ) = = null ? " " : app get application tags ( ) ) ( " application priority : " , clarify app priority ( app get priority ( ) ) ) ( " yarn application state : " , app get app state ( ) = = null ? unavailable : clarify app state ( app get app state ( ) ) ) ( " queue : " , scheduler path , app get queue ( ) ) ( " final status reported by am : " , clairfy app final status ( app get final app status ( ) ) ) ( " started : " , times format ( app get started time ( ) ) ) ( " launched : " , times format ( app get launch time ( ) ) ) ( " finished : " , times format ( app get finished time ( ) ) ) ( " elapsed : " , string utils format time ( app get elapsed time ( ) ) ) ( " tracking url : " , app get tracking url ( ) = = null | | app get tracking url ( ) equals ( unavailable ) ? null : root url ( app get tracking url ( ) ) , app get tracking url ( ) = = null | | app get tracking url ( ) equals ( unavailable ) ? " unassigned " : apps is application final state ( app get app state ( ) ) ? " history " : " application master " ) ; if ( web ui type ! = null & & web ui type equals ( yarn web params rm web ui ) ) { log aggregation status status = get log aggregation status ( ) ; if ( status = = null ) { overview table ( " log aggregation status : " , " n / a " ) ; } else if ( status = = log aggregation status disabled | | status = = log aggregation status not start | | status = = log aggregation status succeeded ) { overview table ( " log aggregation status : " , status name ( ) ) ; } else { overview table ( " log aggregation status : " , root url ( " logaggregationstatus " , app get app id ( ) ) , status name ( ) ) ; } long timeout = app report get application timeouts ( ) get ( application timeout type lifetime ) get remaining time ( ) ; if ( timeout < 0 ) { overview table ( " application timeout ( remaining time ) : " , " unlimited " ) ; } else { overview table ( " application timeout ( remaining time ) : " , string format ( " % d seconds " , timeout ) ) ; } } overview table ( " diagnostics : " , app get diagnostics info ( ) = = null ? " " : app get diagnostics info ( ) ) ; overview table ( " unmanaged application : " , app is unmanaged app ( ) ) ; overview table ( " application node label expression : " , app get app node label expression ( ) = = null ? " < not set > " : app get app node label expression ( ) ) ; overview table ( " am container node label expression : " , app get am node label expression ( ) = = null ? " < not set > " : app get am node label expression ( ) ) ; }


appends a newline to the given buffer via the given writer , but only if it isn ' t empty and doesn ' t already end with one

private static void append newline if necessary ( string buffer buf , writer out ) throws i o exception { int len = buf length ( ) ; if ( ( len ! = 0 ) & & ( buf char at ( len - 1 ) ! = ' \ n ' ) ) { out write ( ' \ n ' ) ; } }


map file name and offset into statistical data the map task is to get the < tt > key < tt > , which contains the file name , and the < tt > value < tt > , which is the offset within the file the parameters are passed to the abstract method { @ link # do i o ( reporter , string , long ) } , which performs the io operation , usually read or write data , and then { @ link # collect stats ( output collector , string , long , object ) } is called to prepare stat data for a subsequent reducer

public void map ( text key , long writable value , output collector < text , text > output , reporter reporter ) throws i o exception { string name = key to string ( ) ; long long value = value get ( ) ; reporter set status ( " starting " + name + " : : host = " + host name ) ; this stream = get i o stream ( name ) ; t stat value = null ; long t start = system current time millis ( ) ; try { stat value = do i o ( reporter , name , long value ) ; } finally { if ( stream ! = null ) stream close ( ) ; } long t end = system current time millis ( ) ; long exec time = t end - t start ; collect stats ( output , name , exec time , stat value ) ; reporter set status ( " finished " + name + " : : host = " + host name ) ; }


public final string get long description ( ) { byte array output stream out = new byte array output stream ( ) ; print stream ps = new print stream ( out ) ; print usage summary ( ps ) ; ps close ( ) ; return out to string ( ) ; }


return the additional ( undeclared ) property

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


public final builder add ( extra link time library b ) { class < ? extends extra link time library > c = b get class ( ) ; libraries compute if absent ( c , k - > b get builder ( ) ) ; libraries get ( c ) add transitive ( b ) ; return this ; }


public void test l s on root with fallback link with same mount directories ( ) throws exception { configuration conf = new configuration ( ) ; conf set boolean ( constants config viewfs mount links as symlinks , false ) ; config util add link ( conf , " / user 1 " , new path ( target test root to string ( ) ) to uri ( ) ) ; / / creating multiple directories path under the fallback directory / / " / user 1 " directory already exists as configured mount point path dir 1 = new path ( target test root , " fallback dir / user 1 " ) ; path dir 2 = new path ( target test root , " fallback dir / user 2 " ) ; fs target mkdirs ( dir 1 ) ; fs target mkdirs ( dir 2 , fs permission value of ( " - rwxr - - r - - " ) ) ; fs target set permission ( target test root , fs permission value of ( " - rwxr - - rw - " ) ) ; hash set < path > before fallback = new hash set < > ( ) ; try ( file system vfs = file system get ( view fs default cluster uri , conf ) ) { for ( file status stat : vfs list status ( new path ( view fs default cluster uri to string ( ) , " / " ) ) ) { before fallback add ( stat get path ( ) ) ; } } config util add link fallback ( conf , new path ( target test root , " fallback dir " ) to uri ( ) ) ; try ( file system vfs = file system get ( view fs default cluster uri , conf ) ) { hash set < path > after fallback = new hash set < > ( ) ; for ( file status stat : vfs list status ( new path ( view fs default cluster uri to string ( ) , " / " ) ) ) { after fallback add ( stat get path ( ) ) ; if ( dir 1 get name ( ) equals ( stat get path ( ) get name ( ) ) ) { / / make sure fallback dir listed out with correct permissions , but not / / with link permissions assert equals ( fs permission value of ( " - rwxr - - rw - " ) , stat get permission ( ) ) ; } else { assert equals ( " path is : " + stat get path ( ) , fs permission value of ( " - rwxr - - r - - " ) , stat get permission ( ) ) ; } } after fallback remove all ( before fallback ) ; assert equals ( 1 , after fallback size ( ) ) ; assert equals ( " / user 2 dir from fallback should be listed " , " user 2 " , after fallback iterator ( ) next ( ) get name ( ) ) ; } }


simplifies a list of terms and combines them into an or modifies the list in place

private rex node simplify ors ( list < rex node > terms , rex unknown as unknown as ) { final sarg collector sarg collector = new sarg collector ( rex builder , false ) ; final list < rex node > new terms = new array list < > ( ) ; terms for each ( t - > sarg collector accept ( t , new terms ) ) ; if ( sarg collector need to fix ( ) ) { terms clear ( ) ; new terms for each ( t - > terms add ( sarg collector fix ( rex builder , t ) ) ) ; } / / calcite - 3198 auxiliary map to simplify cases like : / / x < > a or x < > b = > x is not null or null / / the map key will be the ' x ' ; and the value the first call ' x < > a ' that is found , / / or ' x is not null ' if a simplification takes place ( because another ' x < > b ' is found ) final map < rex node , rex node > not equals comparison map = new hash map < > ( ) ; final rex literal true literal = rex builder make literal ( true ) ; for ( int i = 0 ; i < terms size ( ) ; i + + ) { final rex node term = terms get ( i ) ; switch ( term get kind ( ) ) { case literal : if ( rex literal is null literal ( term ) ) { if ( unknown as = = false ) { terms remove ( i ) ; - - i ; continue ; } else if ( unknown as = = true ) { return true literal ; } } else { if ( rex literal boolean value ( term ) ) { return term ; / / true } else { terms remove ( i ) ; - - i ; continue ; } } break ; case not equals : final comparison not equals comparison = comparison of ( term ) ; if ( not equals comparison ! = null ) { / / we are dealing with a x < > a term , check if we saw before another / / not equals involving x final rex node prev not equals = not equals comparison map get ( not equals comparison ref ) ; if ( prev not equals = = null ) { / / this is the first not equals involving x , put it in the map not equals comparison map put ( not equals comparison ref , term ) ; } else { / / there is already in the map another not equals involving x : / / - if it is already an is not null : it was already simplified , / / ignore this term / / - if it is not an is not null ( i e it is a not equals ) : check / / comparison values if ( prev not equals get kind ( ) ! = sql kind is not null ) { final comparable comparable 1 = not equals comparison literal get value ( ) ; final comparable comparable 2 = comparison of ( prev not equals ) literal get value ( ) ; / / noinspection unchecked if ( comparable 1 compare to ( comparable 2 ) ! = 0 ) { / / x < > a or x < > b = > x is not null or null final rex node is not null = rex builder make call ( sql std operator table is not null , not equals comparison ref ) ; final rex node constant null = rex builder make null literal ( true literal get type ( ) ) ; final rex node new condition = simplify ( rex builder make call ( sql std operator table or , is not null , constant null ) , unknown as ) ; if ( new condition is always true ( ) ) { return true literal ; } not equals comparison map put ( not equals comparison ref , is not null ) ; final int pos = terms index of ( prev not equals ) ; terms set ( pos , new condition ) ; } } terms remove ( i ) ; - - i ; continue ; } } break ; } } return rex util compose disjunction ( rex builder , terms ) ; }


sets a custom merge validator by default , merges are accepted if the parameter is updateable , or if the previous and new values are equal

public parameter < t > set merge validator ( merge validator < t > merge validator ) { this merge validator = merge validator ; return this ; }


initializes the ghidra script editor subcomponent nothing in the package should be used until this initialization happens should be called during eclipse startup

public static void init ( boolean first time consent ) { if ( first time consent ) { ghidra script editor preferences set script editor enabled ( true ) ; } listen ( ghidra script editor preferences get script editor port ( ) ) ; }


protected void handle sso post profile request ( final http servlet response response , final http servlet request request , final base http servlet request x m l message decoder decoder ) throws exception { val result = get saml profile handler configuration context ( ) get saml http request extractor ( ) extract ( request , decoder , authn request class ) ; if ( result is present ( ) ) { initiate authentication request ( result get ( ) , response , request ) ; } }


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


public node < k , v > first ( ) { node < k , v > node = this ; node < k , v > child = node left ; while ( child ! = null ) { node = child ; child = node left ; } return node ; }


create a tiles { @ link request } this implementation creates a { @ link servlet request }

protected request create tiles request ( final http servlet request request , http servlet response response ) { return new servlet request ( this application context , request , response ) { @ override public locale get request locale ( ) { return request context utils get locale ( request ) ; } } ; }


get the number of acceptable skip groups surrounding the bad group per bad group in reducer the number includes the bad group as well to turn the feature of detectionskipping of bad groups off , set the value to 0 the framework tries to narrow down the skipped range by retrying until this threshold is met or all attempts get exhausted for this task set the value to long max value to indicate that framework need not try to narrow down whatever groups ( depends on application ) get skipped are acceptable default value is 0

public static long get reducer max skip groups ( configuration conf ) { return conf get long ( reducer max skip groups , 0 ) ; }


gets the downstream builds of this build , which are the builds of the downstream projects that use artifacts of this build

public map < abstract project , range set > get downstream builds ( ) { map < abstract project , range set > r = new hash map < > ( ) ; for ( abstract project p : get parent ( ) get downstream projects ( ) ) { if ( p is fingerprint configured ( ) ) r put ( p , get downstream relationship ( p ) ) ; } return r ; }


converts a { @ link server credentials } to a negotiator , in similar fashion as for a new server

public static internal protocol negotiator server factory to negotiator ( server credentials server credentials ) { final protocol negotiators from server credentials result result = protocol negotiators from ( server credentials ) ; if ( result error ! = null ) { throw new illegal argument exception ( result error ) ; } final class server factory implements internal protocol negotiator server factory { @ override public internal protocol negotiator protocol negotiator new negotiator ( object pool < ? extends executor > offload executor pool ) { return new internal protocol negotiator protocol negotiator adapter ( result negotiator new negotiator ( offload executor pool ) ) ; } } return new server factory ( ) ; }


factory method to create a new { @ link hystrix command } { @ code < batch return type > } command object each time a batch needs to be executed do not return the same instance each time return a new instance on each invocation process the ' requests ' argument into the arguments the command object needs to perform its work if a batch or requests needs to be split ( sharded ) into multiple commands , see { @ link # shard requests } implementation note : be fast ( ie < 1ms ) in this method otherwise it can block the timer from executing subsequent batches do not do any processing beyond constructing the command and returning it

protected abstract hystrix command < batch return type > create command ( collection < collapsed request < response type , request argument type > > requests ) ;


default void execute ( t t ) throws runtime exception { try { accept ( t ) ; } catch ( throwable e ) { throw new runtime exception ( e get message ( ) , e get cause ( ) ) ; } }


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


called if a { @ code rst stream } is received but we have some data for that stream

protected void on rst stream read ( http 2 stream stream , full http message msg ) { remove message ( stream , true ) ; }


stream all annotations and meta - annotations that match the specified type the resulting stream follows the same ordering rules as { @ link # stream ( ) }

< a extends annotation > stream < merged annotation < a > > stream ( class < a > annotation type ) ;


create files at the target path with some known data in them each file will have the same content : & quot ; extra stuff & quot ; if the test run is happening within 20 seconds of the top of the hour , this method will sleep until the top of the hour

protected void pre create log file ( string path , int num files ) throws i o exception , interrupted exception , u r i syntax exception { calendar now = get now not top of hour ( ) ; file system fs = file system get ( new uri ( path ) , new configuration ( ) ) ; path dir = new path ( path , date format format ( now get time ( ) ) + " 00 " ) ; fs mkdirs ( dir ) ; path file = new path ( dir , get log filename ( ) ) ; / / create the log file to force the sink to append try ( f s data output stream out = fs create ( file ) ) { out write ( " extra stuff \ n " get bytes ( ) ) ; out flush ( ) ; } if ( num files > 1 ) { int count = 1 ; while ( count < num files ) { file = new path ( dir , get log filename ( ) + " " + count ) ; / / create the log file to force the sink to append try ( f s data output stream out = fs create ( file ) ) { out write ( " extra stuff \ n " get bytes ( ) ) ; out flush ( ) ; } count + = 1 ; } } }


returns { @ code true } if < a href = " https : man 7 orglinuxman - pagesman 7ip 7 html " > ip transparent is enabled , { @ code false } otherwise

public boolean is ip transparent ( ) { try { return ( ( epoll socket channel ) channel ) socket is ip transparent ( ) ; } catch ( i o exception e ) { throw new channel exception ( e ) ; } }


return a string that describes this filesystem instance

public string to string ( ) { final string builder sb = new string builder ( " o b s file system { " ) ; sb append ( " uri = " ) append ( uri ) ; sb append ( " , working dir = " ) append ( working dir ) ; sb append ( " , part size = " ) append ( part size ) ; sb append ( " , enable multi objects delete = " ) append ( enable multi object delete ) ; sb append ( " , max keys = " ) append ( max keys ) ; if ( canned a c l ! = null ) { sb append ( " , canned a c l = " ) append ( canned a c l to string ( ) ) ; } sb append ( " , read ahead range = " ) append ( read ahead range ) ; sb append ( " , block size = " ) append ( get default block size ( ) ) ; if ( block factory ! = null ) { sb append ( " , block factory = " ) append ( block factory ) ; } sb append ( " , bounded multipart upload thread pool = " ) append ( bounded multipart upload thread pool ) ; sb append ( " , statistics { " ) append ( statistics ) append ( " } " ) ; sb append ( " , metrics { " ) append ( " } " ) ; sb append ( ' } ' ) ; return sb to string ( ) ; }


returns the number of chunk lists for the arena


pretty print action diffs ( at most { @ code max diff artifacts to report } lines )

private static void pretty print artifact diffs ( string builder sb , set < artifact > diff ) { for ( artifact artifact : iterables limit ( diff , max diff artifacts to report ) ) { sb append ( " \ t " + artifact pretty print ( ) + " \ n " ) ; } }


get a datanode descriptor given corresponding datanode u u i d

public datanode descriptor get datanode ( final string datanode uuid ) { if ( datanode uuid = = null ) { return null ; } synchronized ( this ) { return datanode map get ( datanode uuid ) ; } }


convert { @ link inet 4 address } into { @ code int }

public static int ipv 4 address to int ( inet 4 address ip address ) { byte [ ] octets = ip address get address ( ) ; return ( octets [ 0 ] & 0xff ) < < 24 | ( octets [ 1 ] & 0xff ) < < 16 | ( octets [ 2 ] & 0xff ) < < 8 | octets [ 3 ] & 0xff ; }


sets the < code > number item < code > property

public void set number item ( big decimal number item ) { this number item = number item ; }


public cancellable start data frame analytics async ( start data frame analytics request request , request options options , action listener < start data frame analytics response > listener ) { return rest high level client perform request async and parse entity ( request , m l request converters : : start data frame analytics , options , start data frame analytics response : : from x content , listener , collections empty set ( ) ) ; }


get a snapshot of the current values of all the tracked quantiles

synchronized public map < quantile , long > snapshot ( ) { / / flush the buffer first for best results insert batch ( ) ; if ( samples is empty ( ) ) { return null ; } map < quantile , long > values = new tree map < quantile , long > ( ) ; for ( int i = 0 ; i < quantiles length ; i + + ) { values put ( quantiles [ i ] , query ( quantiles [ i ] quantile ) ) ; } return values ; }


public double get double ( ) { return double ; }


the version of this test supplied by { @ link map interface test } fails for this particular map implementation , because { @ code map get ( ) } returns a view collection that changes in the course of a call to { @ code remove ( ) } thus , the expectation doesn ' t hold that { @ code map remove ( x ) } returns the same value which { @ code map get ( x ) } did immediately beforehand

public void test remove ( ) { final map < string , map < integer , character > > map ; final string key to remove ; try { map = make populated map ( ) ; } catch ( unsupported operation exception e ) { return ; } key to remove = map key set ( ) iterator ( ) next ( ) ; if ( supports remove ) { int initial size = map size ( ) ; map get ( key to remove ) ; map remove ( key to remove ) ; / / this line doesn ' t hold - see the javadoc comments above / / assert equals ( expected value , old value ) ; assert false ( map contains key ( key to remove ) ) ; assert equals ( initial size - 1 , map size ( ) ) ; } else { try { map remove ( key to remove ) ; fail ( " expected unsupported operation exception " ) ; } catch ( unsupported operation exception expected ) { } } assert invariants ( map ) ; }


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


break the prefix string into moves ( a sequence of integer row ids that will be selected for each column in order ) find all solutions with that prefix

public void map ( writable comparable < ? > key , text value , context context ) throws i o exception { prefix string = value ; string tokenizer itr = new string tokenizer ( prefix string to string ( ) , " , " ) ; int [ ] prefix = new int [ depth ] ; int idx = 0 ; while ( itr has more tokens ( ) ) { string num = itr next token ( ) ; prefix [ idx + + ] = integer parse int ( num ) ; } pent solve ( prefix ) ; }


public acknowledged response pause auto follow pattern ( pause auto follow pattern request request , request options options ) throws i o exception { return rest high level client perform request and parse entity ( request , ccr request converters : : pause auto follow pattern , options , acknowledged response : : from x content , collections empty set ( ) ) ; }


test if mock policy works fine : fail - mock

public void test mock invoker from override invoke fock with fail default ( ) { url url = url value of ( " remote : / / 1 2 3 4 / " + i hello service class get name ( ) ) add parameter ( " mock " , " fail : return z " ) add parameter ( " get something mock " , " fail : return x " ) add parameter ( " get something 2 mock " , " force : return y " ) add parameter ( refer key , url encode ( path key + " = " + i hello service class get name ( ) ) ) add parameter ( " invoke return error " , " true " ) ; invoker < i hello service > cluster = get cluster invoker ( url ) ; / / configured with mock rpc invocation invocation = new rpc invocation ( ) ; invocation set method name ( " get something " ) ; result ret = cluster invoke ( invocation ) ; assertions assert equals ( " x " , ret get value ( ) ) ; / / if no mock was configured , return null directly invocation = new rpc invocation ( ) ; invocation set method name ( " get something 2 " ) ; ret = cluster invoke ( invocation ) ; assertions assert equals ( " y " , ret get value ( ) ) ; / / if no mock was configured , return null directly invocation = new rpc invocation ( ) ; invocation set method name ( " get something 3 " ) ; ret = cluster invoke ( invocation ) ; assertions assert equals ( " z " , ret get value ( ) ) ; / / if no mock was configured , return null directly invocation = new rpc invocation ( ) ; invocation set method name ( " say hello " ) ; ret = cluster invoke ( invocation ) ; assertions assert equals ( " z " , ret get value ( ) ) ; }


dump constructor details to the log note : method has no affect unless constructed with verbose logging mode

void dump constructor ( string subtable name , constructor c ) { if ( ! is verbose enabled ( ) ) { return ; } if ( subtable name ! = null ) { append ( " " + subtable name ) ; } else { subtable symbol parent = c get parent ( ) ; if ( parent ! = null ) { string name = parent get name ( ) ; if ( ! " instruction " equals ( name ) ) { append ( " " + name ) ; } } } append ( " : " ) ; append ( " { line # " ) ; append ( integer to string ( c get lineno ( ) ) ) ; append ( " } " ) ; list < string > print pieces = c get print pieces ( ) ; if ( print pieces size ( ) = = 0 ) { for ( int i = 0 ; i < c get num operands ( ) ; i + + ) { if ( i ! = 0 ) { append ( " , " ) ; } operand symbol operand = c get operand ( i ) ; append ( " < " ) ; append ( operand get name ( ) ) ; append ( " > " ) ; } } else { for ( string piece : print pieces ) { if ( piece starts with ( " \ n " ) ) { int sym index = piece char at ( 1 ) - ' a ' ; operand symbol sym = c get operand ( sym index ) ; append ( " < " ) ; append ( sym get name ( ) ) ; append ( " > " ) ; } else { append ( piece ) ; } } } append ( " \ n " ) ; }


look up the class by name and instantiate it

public static < t > t new instance ( string klass , class < t > base ) throws class not found exception { return utils new instance ( load class ( klass , base ) ) ; }


updates the toolbar to remove the given action

public void action removed ( docking action if action ) { tool bar mgr remove action ( action ) ; }


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


lookup ( or create and store ) the request variable for a given hystrix collapser key

private hystrix request variable holder < request collapser < ? , ? , ? > > get request variable for command ( final hystrix collapser bridge < batch return type , response type , request argument type > command collapser ) { hystrix request variable holder < request collapser < ? , ? , ? > > request variable = request scoped collapsers get ( command collapser get collapser key ( ) name ( ) ) ; if ( request variable = = null ) { / / create new collapser using ' this ' first instance as the one that will get cached for future executions ( ' this ' is stateless so we can do that ) @ suppress warnings ( { " rawtypes " } ) hystrix request variable holder new collapser = new request collapser request variable ( command collapser , properties , timer , concurrency strategy ) ; hystrix request variable holder < request collapser < ? , ? , ? > > existing = request scoped collapsers put if absent ( command collapser get collapser key ( ) name ( ) , new collapser ) ; if ( existing = = null ) { / / this thread won , so return the one we just created request variable = new collapser ; } else { / / another thread beat us ( this should only happen when we have concurrency on the first request for the life of the app for this hystrix collapser class ) request variable = existing ; / * * this * should * be okay to discard the created object without cleanup as the request variable implementation * should properly do lazy - initialization and only call initial value ( ) the first time get ( ) is called * * if it does not correctly follow this contract then there is a chance of a memory leak here * / } } return request variable ; }


sets a { @ link priority task manager } , or null to clear a previously set priority task manager the priority { @ link c # priority playback } will be set while the player is loading

public void set priority task manager ( @ nullable priority task manager priority task manager ) { verify application thread ( ) ; if ( util are equal ( this priority task manager , priority task manager ) ) { return ; } if ( is priority task manager registered ) { assertions check not null ( this priority task manager ) remove ( c priority playback ) ; } if ( priority task manager ! = null & & is loading ( ) ) { priority task manager add ( c priority playback ) ; is priority task manager registered = true ; } else { is priority task manager registered = false ; } this priority task manager = priority task manager ; }


check whether the given bean is defined as a { @ link factory bean }

protected boolean is factory bean ( string bean name , root bean definition mbd ) { boolean result = mbd is factory bean ; if ( result = = null ) { class < ? > bean type = predict bean type ( bean name , mbd , factory bean class ) ; result = ( bean type ! = null & & factory bean class is assignable from ( bean type ) ) ; mbd is factory bean = result ; } return result ; }


invoke this method to preempt container based on res to obtain

public static boolean try preempt container and deduct res to obtain ( resource calculator rc , capacity scheduler preemption context context , map < string , resource > resource to obtain by partitions , r m container rm container , resource cluster resource , map < application attempt id , set < r m container > > preempt map , map < application attempt id , set < r m container > > cur candidates , resource total preemption allowed , boolean conservative d r f ) { application attempt id attempt id = rm container get application attempt id ( ) ; / / we will not account resource of a container twice or more if ( preempt map contains ( preempt map , attempt id , rm container ) ) { return false ; } string node partition = get partition by node id ( context , rm container get allocated node ( ) ) ; resource to obtain by partition = resource to obtain by partitions get ( node partition ) ; if ( null = = to obtain by partition ) { return false ; } / / if a to obtain resource type = = 0 , set it to - 1 to avoid 0 resource / / type affect following do preemption check : is any major resource zero for ( resource information ri : to obtain by partition get resources ( ) ) { if ( ri get value ( ) = = 0 ) { ri set value ( - 1 ) ; } } if ( rc is any major resource above zero ( to obtain by partition ) & & resources fits in ( rc , rm container get allocated resource ( ) , total preemption allowed ) ) { boolean do preempt ; / / how much resource left after preemption happen resource to obtain after preemption = resources subtract ( to obtain by partition , rm container get allocated resource ( ) ) ; if ( conservative d r f ) { do preempt = ! rc is any major resource zero or negative ( to obtain by partition ) ; } else { / / when we want to do more aggressive preemption , we will do preemption / / only if : / / - the preempt of the container makes positive contribution to the / / to - obtain resource positive contribution means any positive / / resource type decreases / / / / this is example of positive contribution : / / * before : < 30 , 10 , 5 > , after < 20 , 10 , - 10 > / / but this not positive contribution : / / * before : < 30 , 10 , 0 > , after < 30 , 10 , - 15 > do preempt = resources less than ( rc , cluster resource , resources componentwise max ( to obtain after preemption , resources none ( ) ) , resources componentwise max ( to obtain by partition , resources none ( ) ) ) ; } if ( ! do preempt ) { return false ; } resources subtract from ( to obtain by partition , rm container get allocated resource ( ) ) ; resources subtract from ( total preemption allowed , rm container get allocated resource ( ) ) ; / / when we have no more resource need to obtain , remove from map if ( resources less than or equal ( rc , cluster resource , to obtain by partition , resources none ( ) ) ) { resource to obtain by partitions remove ( node partition ) ; } / / add to preempt map add to preempt map ( preempt map , cur candidates , attempt id , rm container ) ; return true ; } return false ; }


configures { @ link # bind ( ) } to attach vertices in { @ code buffer } ( each of size { @ code size } elements ) to this { @ link attribute }

public void set buffer ( float [ ] buffer , int size ) { this buffer = create buffer ( buffer ) ; this size = size ; }


this is unreliable for some c + + compilers - probably best not to display it prominently

public string get clazz ( ) { return clazz ; }


find the first occurrence of the given bytes b in a utf - 8 encoded string

public static int find bytes ( byte [ ] utf , int start , int end , byte [ ] b ) { int match end = end - b length ; for ( int i = start ; i < = match end ; i + + ) { boolean matched = true ; for ( int j = 0 ; j < b length ; j + + ) { if ( utf [ i + j ] ! = b [ j ] ) { matched = false ; break ; } } if ( matched ) { return i ; } } return - 1 ; }


returns true if the two data types have the same source archive and the same universal i d

public static boolean is same data type ( data type data type 1 , data type data type 2 ) { universal i d id 1 = data type 1 get universal i d ( ) ; universal i d id 2 = data type 2 get universal i d ( ) ; if ( id 1 = = null | | id 2 = = null ) { return false ; } if ( ! id 1 equals ( id 2 ) ) { return false ; } / / same universal id , but to be sure make sure the source archives are the same source archive source archive 1 = data type 1 get source archive ( ) ; source archive source archive 2 = data type 2 get source archive ( ) ; if ( source archive 1 = = null | | source archive 2 = = null ) { return false ; } return source archive 1 get source archive i d ( ) equals ( source archive 2 get source archive i d ( ) ) ; }


increases the member use count by one when an member access is encountered

public boolean increment member use count ( class member use class member use ) { return member use counter add ( class member use ) ; }