step out from some existing vertex terms looking for useful connections

synchronized void expand ( ) { if ( has timed out ( ) ) { timed out set ( true ) ; listener on response ( build response ( ) ) ; return ; } map < string , set < vertex > > last hop findings = hop findings get ( current hop number ) ; if ( ( current hop number > = ( request get hop numbers ( ) - 1 ) ) | | ( last hop findings = = null ) | | ( last hop findings size ( ) = = 0 ) ) { / / either we gathered no leads from the last hop or we have / / reached the final hop listener on response ( build response ( ) ) ; return ; } hop last hop = request get hop ( current hop number ) ; current hop number + + ; hop current hop = request get hop ( current hop number ) ; final search request search request = new search request ( request indices ( ) ) indices options ( request indices options ( ) ) ; if ( request routing ( ) ! = null ) { search request routing ( request routing ( ) ) ; } bool query builder root bool = query builders bool query ( ) ; / / a single sample pool of docs is built at the root of the aggs tree / / for quality ' s sake it might have made more sense to sample top docs / / for each of the terms from the previous hop ( e g an initial query for " beatles " / / may have separate doc - sample pools for significant root terms " john " , " paul " , " yoko " etc ) / / but i found this dramatically slowed down execution - each pool typically had different docs which / / each had non - overlapping sets of terms that needed frequencies looking up for significant terms / / a common sample pool reduces the specialization that can be given to each root term but / / ultimately is much faster to run because of the shared vocabulary in a single sample set aggregation builder sample agg = null ; if ( request sample diversity field ( ) ! = null ) { diversified aggregation builder diversified sample agg = aggregation builders diversified sampler ( " sample " ) shard size ( request sample size ( ) ) ; diversified sample agg field ( request sample diversity field ( ) ) ; diversified sample agg max docs per value ( request max docs per diversity value ( ) ) ; sample agg = diversified sample agg ; } else { sample agg = aggregation builders sampler ( " sample " ) shard size ( request sample size ( ) ) ; } / / add any user - supplied criteria to the root query as a must clause root bool must ( current hop guiding query ( ) ) ; / / build a must clause that matches one of either / / a : ) include clauses supplied by the client or / / b : ) vertex terms from the previous hop bool query builder source terms or clause = query builders bool query ( ) ; add user defined includes to query ( current hop , source terms or clause ) ; add big or clause ( last hop findings , source terms or clause ) ; root bool must ( source terms or clause ) ; / / now build the agg tree that will channel the content - > / / base agg is terms agg for terms from last wave ( one per field ) , / / under each is a sig terms agg to find next candidates ( again , one per field ) for ( int field num = 0 ; field num < last hop get number vertex requests ( ) ; field num + + ) { vertex request last vr = last hop get vertex request ( field num ) ; set < vertex > last wave vertices for field = last hop findings get ( last vr field name ( ) ) ; if ( last wave vertices for field = = null ) { continue ; } string [ ] terms = new string [ last wave vertices for field size ( ) ] ; int i = 0 ; for ( vertex v : last wave vertices for field ) { terms [ i + + ] = v get term ( ) ; } terms aggregation builder last wave terms agg = aggregation builders terms ( " field " + field num ) include exclude ( new include exclude ( terms , null ) ) shard min doc count ( 1 ) field ( last vr field name ( ) ) min doc count ( 1 ) / / map execution mode used because sampler agg keeps us / / focused on smaller sets of high quality docs and therefore / / examine smaller volumes of terms execution hint ( " map " ) size ( terms length ) ; sample agg sub aggregation ( last wave terms agg ) ; for ( int f = 0 ; f < current hop get number vertex requests ( ) ; f + + ) { vertex request vr = current hop get vertex request ( f ) ; int size = vr size ( ) ; if ( vr field name ( ) equals ( last vr field name ( ) ) ) { / / we have the potential for self - loops as we are looking at the same field so add 1 to the requested size / / because we need to eliminate field a : term a - > field a : term a links that are likely to be in the results size + + ; } if ( request use significance ( ) ) { significant terms aggregation builder next wave sig terms = aggregation builders significant terms ( " field " + f ) field ( vr field name ( ) ) min doc count ( vr min doc count ( ) ) shard min doc count ( vr shard min doc count ( ) ) execution hint ( " map " ) size ( size ) ; / / next wave sig terms significance heuristic ( new percentage score percentage score builder ( ) ) ; / / had some issues with no significant terms being returned when asking for small / / number of final results ( eg 1 ) and only one shard setting shard size higher helped if ( size < 10 ) { next wave sig terms shard size ( 10 ) ; } / / alternative choices of significance algo didn ' t seem to be improvements / / next wave sig terms significance heuristic ( new gnd g n d builder ( true ) ) ; / / next wave sig terms significance heuristic ( new chi square chi square builder ( false , true ) ) ; if ( vr has include clauses ( ) ) { string [ ] includes = vr include values as string array ( ) ; next wave sig terms include exclude ( new include exclude ( includes , null ) ) ; / / originally i thought users would always want the / / same number of results as listed in the include / / clause but it may be the only want the most / / significant e g in the lastfm example of / / plotting a single user ' s tastes and how that maps / / into a network showing only the most interesting / / band connections so line below commmented out / / next wave sig terms size ( includes length ) ; } else if ( vr has exclude clauses ( ) ) { next wave sig terms include exclude ( new include exclude ( null , vr excludes as array ( ) ) ) ; } last wave terms agg sub aggregation ( next wave sig terms ) ; } else { terms aggregation builder next wave popular terms = aggregation builders terms ( " field " + f ) field ( vr field name ( ) ) min doc count ( vr min doc count ( ) ) shard min doc count ( vr shard min doc count ( ) ) / / map execution mode used because sampler agg keeps us / / focused on smaller sets of high quality docs and therefore / / examine smaller volumes of terms execution hint ( " map " ) size ( size ) ; if ( vr has include clauses ( ) ) { string [ ] includes = vr include values as string array ( ) ; next wave popular terms include exclude ( new include exclude ( includes , null ) ) ; / / next wave popular terms size ( includes length ) ; } else if ( vr has exclude clauses ( ) ) { next wave popular terms include exclude ( new include exclude ( null , vr excludes as array ( ) ) ) ; } last wave terms agg sub aggregation ( next wave popular terms ) ; } } } / / execute the search search source builder source = new search source builder ( ) query ( root bool ) aggregation ( sample agg ) size ( 0 ) ; if ( request timeout ( ) ! = null ) { source timeout ( time value time value millis ( time remaining millis ( ) ) ) ; } search request source ( source ) ; / / system out println ( source ) ; logger trace ( " executing expansion graph search request " ) ; client search ( search request , new action listener < search response > ( ) { @ override public void on response ( search response search response ) { / / system out println ( search response ) ; add shard failures ( search response get shard failures ( ) ) ; array list < connection > new connections = new array list < connection > ( ) ; array list < vertex > new vertices = new array list < vertex > ( ) ; sampler sample = search response get aggregations ( ) get ( " sample " ) ; / / we think of the total scores as the energy - level pouring / / out of all the last hop ' s connections / / each new node encountered is given a score which is / / normalized between zero and one based on / / what percentage of the total scores its own score / / provides double total signal output = get expand total signal strength ( last hop , current hop , sample ) ; / / signal output can be zero if we did not encounter any new / / terms as part of this stage if ( total signal output > 0 ) { add and score new vertices ( last hop , current hop , sample , total signal output , new connections , new vertices ) ; trim new additions ( current hop , new connections , new vertices ) ; } / / potentially run another round of queries to perform next " hop " - will terminate if no new additions expand ( ) ; } / / add new vertices and apportion share of total signal along / / connections private void add and score new vertices ( hop last hop , hop current hop , sampler sample , double total signal output , array list < connection > new connections , array list < vertex > new vertices ) { / / gather all matching terms into the graph and propagate / / signals for ( int j = 0 ; j < last hop get number vertex requests ( ) ; j + + ) { vertex request last vr = last hop get vertex request ( j ) ; terms last wave terms = sample get aggregations ( ) get ( " field " + j ) ; if ( last wave terms = = null ) { / / there were no terms from the previous phase that needed pursuing continue ; } list < ? extends terms bucket > buckets = last wave terms get buckets ( ) ; for ( org elasticsearch search aggregations bucket terms terms bucket last wave term : buckets ) { vertex from vertex = get vertex ( last vr field name ( ) , last wave term get key as string ( ) ) ; for ( int k = 0 ; k < current hop get number vertex requests ( ) ; k + + ) { vertex request vr = current hop get vertex request ( k ) ; / / as we travel further out into the graph we apply a / / decay to the signals being propagated down the various channels double decay = 0 9 5d ; if ( request use significance ( ) ) { significant terms significant terms = last wave term get aggregations ( ) get ( " field " + k ) ; if ( significant terms ! = null ) { for ( bucket bucket : significant terms get buckets ( ) ) { if ( ( vr field name ( ) equals ( from vertex get field ( ) ) ) & & ( bucket get key as string ( ) equals ( from vertex get term ( ) ) ) ) { / / avoid self - joins continue ; } double signal strength = bucket get significance score ( ) / total signal output ; / / decay the signal by the weight attached to the source vertex signal strength = signal strength * math min ( decay , from vertex get weight ( ) ) ; vertex to vertex = get vertex ( vr field name ( ) , bucket get key as string ( ) ) ; if ( to vertex = = null ) { to vertex = add vertex ( vr field name ( ) , bucket get key as string ( ) , signal strength , current hop number , bucket get superset df ( ) , bucket get subset df ( ) ) ; new vertices add ( to vertex ) ; } else { to vertex set weight ( to vertex get weight ( ) + signal strength ) ; / / we cannot ( without further querying ) determine an accurate number / / for the foreground count of the to vertex term - if we sum the values / / from each from vertex term we may actually double - count occurrences so / / the best we can do is take the maximum foreground value we have observed to vertex set fg ( math max ( to vertex get fg ( ) , bucket get subset df ( ) ) ) ; } new connections add ( add connection ( from vertex , to vertex , signal strength , bucket get doc count ( ) ) ) ; } } } else { terms terms = last wave term get aggregations ( ) get ( " field " + k ) ; if ( terms ! = null ) { for ( org elasticsearch search aggregations bucket terms terms bucket bucket : terms get buckets ( ) ) { double signal strength = bucket get doc count ( ) / total signal output ; / / decay the signal by the weight attached to the source vertex signal strength = signal strength * math min ( decay , from vertex get weight ( ) ) ; vertex to vertex = get vertex ( vr field name ( ) , bucket get key as string ( ) ) ; if ( to vertex = = null ) { to vertex = add vertex ( vr field name ( ) , bucket get key as string ( ) , signal strength , current hop number , 0 , 0 ) ; new vertices add ( to vertex ) ; } else { to vertex set weight ( to vertex get weight ( ) + signal strength ) ; } new connections add ( add connection ( from vertex , to vertex , signal strength , bucket get doc count ( ) ) ) ; } } } } } } } / / having let the signals from the last results rattle around the graph / / we have adjusted weights for the various vertices we encountered / / now we review these new additions and remove those with the / / weakest weights / / a priority queue is used to trim vertices according to the size settings / / requested for each field private void trim new additions ( hop current hop , array list < connection > new connections , array list < vertex > new vertices ) { set < vertex > evictions = new hash set < > ( ) ; for ( int k = 0 ; k < current hop get number vertex requests ( ) ; k + + ) { / / for each of the fields vertex request vr = current hop get vertex request ( k ) ; if ( new vertices size ( ) < = vr size ( ) ) { / / nothing to trim continue ; } / / get the top vertices for this field vertex priority queue pq = new vertex priority queue ( vr size ( ) ) ; for ( vertex vertex : new vertices ) { if ( vertex get field ( ) equals ( vr field name ( ) ) ) { vertex eviction = pq insert with overflow ( vertex ) ; if ( eviction ! = null ) { evictions add ( eviction ) ; } } } } / / remove weak new nodes and their dangling connections from the main graph if ( evictions size ( ) > 0 ) { for ( connection connection : new connections ) { if ( evictions contains ( connection get to ( ) ) ) { connections remove ( connection get id ( ) ) ; remove vertex ( connection get to ( ) ) ; } } } } / / todo right now we only trim down to the best n vertices we might also want to offer / / clients the option to limit to the best m connections one scenario where this is required / / is if the " from " and " to " nodes are a client - supplied set of includes e g a list of / / music artists then the client may be wanting to draw only the most - interesting connections / / between them see https : / / github com / elastic / x - plugins / issues / 518 # issuecomment - 160186424 / / i guess clients could trim the returned connections ( which all have weights ) but i wonder if / / we can do something server - side here / / helper method - compute the total signal of all scores in the search results private double get expand total signal strength ( hop last hop , hop current hop , sampler sample ) { double total signal output = 0 ; for ( int j = 0 ; j < last hop get number vertex requests ( ) ; j + + ) { vertex request last vr = last hop get vertex request ( j ) ; terms last wave terms = sample get aggregations ( ) get ( " field " + j ) ; if ( last wave terms = = null ) { continue ; } list < ? extends terms bucket > buckets = last wave terms get buckets ( ) ; for ( org elasticsearch search aggregations bucket terms terms bucket last wave term : buckets ) { for ( int k = 0 ; k < current hop get number vertex requests ( ) ; k + + ) { vertex request vr = current hop get vertex request ( k ) ; if ( request use significance ( ) ) { / / signal is based on significance score significant terms significant terms = last wave term get aggregations ( ) get ( " field " + k ) ; if ( significant terms ! = null ) { for ( bucket bucket : significant terms get buckets ( ) ) { if ( ( vr field name ( ) equals ( last vr field name ( ) ) ) & & ( bucket get key as string ( ) equals ( last wave term get key as string ( ) ) ) ) { / / don ' t count self joins ( term a obviously co - occurs with term a ) continue ; } else { total signal output + = bucket get significance score ( ) ; } } } } else { / / signal is based on popularity ( number of / / documents ) terms terms = last wave term get aggregations ( ) get ( " field " + k ) ; if ( terms ! = null ) { for ( org elasticsearch search aggregations bucket terms terms bucket bucket : terms get buckets ( ) ) { if ( ( vr field name ( ) equals ( last vr field name ( ) ) ) & & ( bucket get key as string ( ) equals ( last wave term get key as string ( ) ) ) ) { / / don ' t count self joins ( term a obviously co - occurs with term a ) continue ; } else { total signal output + = bucket get doc count ( ) ; } } } } } } } return total signal output ; } @ override public void on failure ( exception e ) { listener on failure ( e ) ; } } ) ; }


gets the list of " inner class " entries associated with this instance

public inner class list get inner classes ( ) { return inner classes ; }


creates a new { @ code linked hash multiset } containing the specified elements this implementation is highly efficient when { @ code elements } is itself a { @ link multiset }

public static < e > linked hash multiset < e > create ( iterable < ? extends e > elements ) { linked hash multiset < e > multiset = create ( multisets infer distinct elements ( elements ) ) ; iterables add all ( multiset , elements ) ; return multiset ; }


public blob get blob ( string column label ) throws s q l exception { return null ; }


this method is invoked to initialize of update the configuration of policies the implementor should provide try - n - swap semantics , and retain state if possible

void reinitialize ( federation policy initialization context policy context ) throws federation policy initialization exception ;


public boolean is read ( ) { return false ; }


multiplies the vector with the given matrix the matrix array is assumed to hold a 4x 4 column major matrix as you can get from { @ link matrix 4 # val } the vector array is assumed to hold a 3 - component vector , with x being the first element , y being the second and z being the last component the result is stored in the vector array this is the same as { @ link vector 3 # mul ( matrix 4 ) }

public static void mul vec ( float [ ] mat , float [ ] vec ) { float x = vec [ 0 ] * mat [ m00 ] + vec [ 1 ] * mat [ m01 ] + vec [ 2 ] * mat [ m02 ] + mat [ m03 ] ; float y = vec [ 0 ] * mat [ m10 ] + vec [ 1 ] * mat [ m11 ] + vec [ 2 ] * mat [ m12 ] + mat [ m13 ] ; float z = vec [ 0 ] * mat [ m20 ] + vec [ 1 ] * mat [ m21 ] + vec [ 2 ] * mat [ m22 ] + mat [ m23 ] ; vec [ 0 ] = x ; vec [ 1 ] = y ; vec [ 2 ] = z ; }


configure the value for the heart - beat settings the first number represents how often the server will write or send a heartbeat the second is how often the client should write 0 means no heartbeats by default this is set to " 0 , 0 " unless the { @ link # set task scheduler task scheduler } in which case the default becomes " 10000 , 10000 " ( in milliseconds )

public void set heartbeat value ( @ nullable long [ ] heartbeat ) { if ( heartbeat ! = null & & ( heartbeat length ! = 2 | | heartbeat [ 0 ] < 0 | | heartbeat [ 1 ] < 0 ) ) { throw new illegal argument exception ( " invalid heart - beat : " + arrays to string ( heartbeat ) ) ; } this heartbeat value = heartbeat ; }


returns estimate of capacity lost this is said to be an estimate , because in some cases it ' s impossible to know the capacity of the volume , such as if we never had a chance to query its capacity before the failure occurred

public long get estimated capacity lost total ( ) { return this estimated capacity lost total ; }


a sensible definition of { @ link # equals ( object ) } in terms of { @ link # size } and { @ link # iterator } if you override either of those methods , you may wish to override { @ link # equals ( object ) } to forward to this implementation

protected boolean standard equals ( @ nullable decl object object ) { return lists equals impl ( this , object ) ; }


returns suggested test size for the given time in seconds will suggest times that are unlikely to result in timeout flakiness even if the test has a significant amount of time variance

public static test timeout get suggested test timeout ( int time in seconds ) { return suggested timeout get ( time in seconds ) ; }


exposes the underlying { @ link groovy bean definition reader } for convenient access to the { @ code load bean definition } methods on it as well as the ability to specify an inline groovy bean definition closure

public final groovy bean definition reader get reader ( ) { return this reader ; }


public int get xceiver count ( ) { if ( metrics = = null ) { return 0 ; } return metrics get data node active xceiver count ( ) ; }


returns a multi - valued view over the provided { @ link geo point values }

public static multi geo point values singleton ( geo point values values ) { return new singleton multi geo point values ( values ) ; }


converts { @ link i o exception } on body byte reading to { @ link push network exception }

private static byte [ ] read body bytes ( response body response ) throws push network exception { if ( response = = null ) { throw new push network exception ( " no body ! " ) ; } try { return response bytes ( ) ; } catch ( i o exception e ) { throw new push network exception ( e ) ; } }


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

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


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


public static m t application component get instance ( ) { return application manager get application ( ) get component ( m t application component class ) ; }


test connecting to the main host then an alternative , although only subject alternative names are used if present no special consideration of common name

@ test public void common then alternative ( ) throws exception { server enqueue ( new mock response ( ) ) ; server enqueue ( new mock response ( ) ) ; assert 2 0 0 http 2 response ( execute ( url ) , server get host name ( ) ) ; http url san url = url new builder ( ) host ( " san com " ) build ( ) ; assert 2 0 0 http 2 response ( execute ( san url ) , " san com " ) ; assert that ( client connection pool ( ) connection count ( ) ) is equal to ( 1 ) ; }


public static string to xml ( collection < ? > root , string root name , class clazz , string encoding ) { try { collection wrapper wrapper = new collection wrapper ( ) ; wrapper collection = root ; j a x b element < collection wrapper > wrapper element = new j a x b element < collection wrapper > ( new q name ( root name ) , collection wrapper class , wrapper ) ; string writer writer = new string writer ( ) ; create marshaller ( clazz , encoding ) marshal ( wrapper element , writer ) ; return writer to string ( ) ; } catch ( j a x b exception e ) { throw exception util unchecked ( e ) ; } }


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

public static fields find by thrift id ( int field id ) { switch ( field id ) { case 1 : / / id return id ; case 2 : / / name return name ; case 3 : / / num tasks return num tasks ; case 4 : / / num executors return num executors ; case 5 : / / num workers return num workers ; case 6 : / / uptime secs return uptime secs ; case 7 : / / status return status ; default : return null ; } }


used for sorting attributes by type ( not by value )

public final int compare ( final attribute arg 0 , final attribute arg 1 ) { return ( int ) ( arg 0 type - arg 1 type ) ; }


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

public void update user test ( ) throws api exception { string username = null ; user body = null ; api update user ( username , body ) ; / / todo : test validations }


creates a config option without a default value

public config option < list < e > > no default value ( ) { return new config option < > ( key , clazz , config option empty description , null , true ) ; }


an item leaves the buildable phase it will move to the " left " state if the executors are allocated to it , or it will move to the blocked phase if someone starts vetoing once again

public void on leave buildable ( buildable item bi ) { }


delegate the construction of the detail editor component subclasses should override this method if they choose to provide a detailed constraint editor this is an optional feature , and this implementation returns null to satisfy the < code > column constraint editor < code > contract

protected component build detail editor component ( ) { return null ; }


the children of this element < code > repeated aapt pb xml node child = 5 ; < code >


equality testing is based on the text supplied by the caller , after normalization as described in the class documentation for example , a non - ascii unicode domain name and the punycode version of the same domain name would not be considered equal

public boolean equals ( @ nullable object object ) { if ( object = = this ) { return true ; } if ( object instanceof internet domain name ) { internet domain name that = ( internet domain name ) object ; return this name equals ( that name ) ; } return false ; }


recursively check if any descendants of this node is in the view

boolean has descendants in view ( ) { if ( is in view ) { return true ; } for ( int i = 0 ; i < get child count ( ) ; i + + ) { program node child = ( program node ) get child at ( i ) ; if ( child is in view ( ) ) { return true ; } if ( child get allows children ( ) ) { if ( child has descendants in view ( ) ) { return true ; } } } return false ; }


calculates diff between two immutable open int maps of diffable objects

public static < t extends diffable < t > > map diff < integer , t , immutable open int map < t > > diff ( immutable open int map < t > before , immutable open int map < t > after , key serializer < integer > key serializer ) { assert after ! = null & & before ! = null ; return new immutable open int map diff < > ( before , after , key serializer , diffable value serializer get write only instance ( ) ) ; }


notifies the listener that the content has just been changed


persists a list of installing plugins ; this is used in the case jenkins fails mid - installation and needs to be restarted

public static synchronized void persist install status ( list < update center job > installing plugins ) { file installing plugins file = get installing plugins file ( ) ; if ( installing plugins = = null | | installing plugins is empty ( ) ) { installing plugins file delete ( ) ; return ; } logger fine ( " writing install state to : " + installing plugins file get absolute path ( ) ) ; map < string , string > statuses = new hash map < > ( ) ; for ( update center job j : installing plugins ) { if ( j instanceof installation job & & j get correlation id ( ) ! = null ) { / / only include install jobs with a correlation id ( directly selected ) installation job ij = ( installation job ) j ; installation status status = ij status ; string status text = status get type ( ) ; if ( status instanceof installing ) { / / flag currently installing plugins as pending status text = " pending " ; } statuses put ( ij plugin name , status text ) ; } } try { string installing plugin xml = new x stream ( ) to x m l ( statuses ) ; file utils write ( installing plugins file , installing plugin xml ) ; } catch ( i o exception e ) { logger log ( severe , " failed to save " + installing plugins file get absolute path ( ) , e ) ; } }


returns a random source containing a random number of fields , objects and array , with maximum depth 5

public static bytes reference random source ( random random ) { / / the source can be stored in any format and eventually converted when retrieved depending on the format of the response return random source ( random , random picks random from ( random , x content type values ( ) ) ) ; }


public void test load exception ( ) { assertions assert throws ( enhanced service not found exception class , ( ) - > { enhanced service loader test load = enhanced service loader load ( enhanced service loader test class ) ; } ) ; }


resolve the tree for the given parameters

public assembly resolution results resolve ( ) { assembly resolution results results = resolve branch ( tree ) ; assembly resolution results ret = new assembly resolution results ( ) ; for ( assembly resolution ar : results ) { assert ! ( ar instanceof assembly resolved backfill ) ; if ( ar is error ( ) ) { ret add ( ar ) ; continue ; } assembly resolved constructor rc = ( assembly resolved constructor ) ar ; vals put ( inst next , lang get default space ( ) get addressable word offset ( inst start + rc get instruction length ( ) ) ) ; if ( rc has backfills ( ) ) { dbg println ( " backfilling : " + rc ) ; } ar = rc backfill ( solver , vals ) ; dbg println ( " backfilled final : " + ar ) ; if ( ar is error ( ) ) { ret add ( ar ) ; continue ; } rc = ( assembly resolved constructor ) ar ; if ( rc has backfills ( ) ) { ret add ( assembly resolution error ( " solution is incomplete " , " failed backfill " , list of ( rc ) ) ) ; continue ; } assembly resolved constructor ctx = assembly resolution context only ( context , " selecting context " , null ) ; assembly resolved constructor check = rc combine ( ctx ) ; if ( null = = check ) { ret add ( assembly resolution error ( " incompatible context " , " resolving " , list of ( rc ) ) ) ; continue ; } rc = check ; assembly resolution fcheck = rc check not forbidden ( ) ; if ( fcheck is error ( ) ) { ret add ( fcheck ) ; continue ; } rc = ( assembly resolved constructor ) fcheck ; ret add ( rc ) ; } return ret ; }


note the same entry instance is returned each time this method is called

public entry next ( ) { if ( ! has next ) throw new no such element exception ( ) ; if ( ! valid ) throw new gdx runtime exception ( " # iterator ( ) cannot be used nested " ) ; int [ ] key table = map key table ; if ( next index = = index zero ) { entry key = 0 ; entry value = map zero value ; } else { entry key = key table [ next index ] ; entry value = map value table [ next index ] ; } current index = next index ; find next index ( ) ; return entry ; }


set the list of container update requests to inform the < code > resource manager < code > about the containers that need to be updated

public abstract void set update requests ( list < update container request > update requests ) ;


public void test u u i d load ordering ( ) throws exception { configuration config = new config ( ) ; config set boolean ( fs s3a committer require uuid , true ) ; string uuid = uuid ( ) ; / / must be picked up config set ( fs s3a committer uuid , uuid ) ; config set ( spark write uuid , " something " ) ; pair < string , abstract s 3 a committer job u u i d source > t 3 = abstract s 3 a committer build job u u i d ( config , job id ) ; assert equals ( " job uuid " , uuid , t 3 get left ( ) ) ; assert equals ( " job uuid source : " + t 3 , abstract s 3 a committer job u u i d source committer u u i d property , t 3 get right ( ) ) ; }


removes the child with the specified index this requires walking the linked list to the specified entry , see { @ link json value } for how to iterate efficiently

public json value remove ( int index ) { json value child = get ( index ) ; if ( child = = null ) return null ; if ( child prev = = null ) { this child = child next ; if ( this child ! = null ) this child prev = null ; } else { child prev next = child next ; if ( child next ! = null ) child next prev = child prev ; } size - - ; return child ; }


set the g progress bar to use to display the progress

public void set progress bar ( g progress bar g progress bar ) { progress bar = g progress bar ; progress bar initialize ( max ) ; progress bar set progress ( progress ) ; progress bar set message ( message ) ; progress bar set cancelled listener ( this ) ; }


public static http 2 multiplex codec builder for server ( channel handler child handler ) { return new http 2 multiplex codec builder ( true , child handler ) ; }


tests the python version selectable target , which is the canonical way of determining the python version from within a select ( )

public void select on python version target ( ) throws exception { / / get rule context ( ) doesn ' t populate the information needed to resolve select ( ) s , and / / configured target doesn ' t allow us to test an end - to - end view of the behavior of a select ( ) / / so this test has the select ( ) control srcs and asserts on which one ' s in the files to build artifact py 2 = get source artifact ( " pkg / py 2 " ) ; artifact py 3 = get source artifact ( " pkg / py 3 " ) ; scratch file ( " pkg / build " , " sh binary ( " , " name = ' foo ' , " , " srcs = select ( { " , " ' " + test constants tools repository + " / / tools / python : py2 ' : [ ' py 2 ' ] , " , " ' " + test constants tools repository + " / / tools / python : py3 ' : [ ' py 3 ' ] , " , " } ) , " , " ) " ) ; / / no - - python version , use default value do test select on python version target ( py 2 , " - - incompatible py 3 is default = false " ) ; do test select on python version target ( py 3 , " - - incompatible py 3 is default = true " ) ; / / - - python version is given , use it do test select on python version target ( py 2 , " - - python version = py2 " ) ; do test select on python version target ( py 3 , " - - python version = py3 " ) ; }


if one instance is empty , the other " wins " if both instances have conditions , compare them in the order in which they were provided

public int compare to ( composite request condition other , http servlet request request ) { if ( is empty ( ) & & other is empty ( ) ) { return 0 ; } else if ( is empty ( ) ) { return 1 ; } else if ( other is empty ( ) ) { return - 1 ; } else { assert number of conditions ( other ) ; for ( int i = 0 ; i < get length ( ) ; i + + ) { int result = this request conditions [ i ] compare to ( other request conditions [ i ] , request ) ; if ( result ! = 0 ) { return result ; } } return 0 ; } }


desugars the given jar using an executable prerequisite { @ code " $ desugar " } rules calling this method must declare the appropriate prerequisite , similar to how { @ link # get definition } does it for { @ link dex archive aspect } under a different name it ' s useful to have this action separately since callers need to look up classpath and bootclasspath in a different way than this aspect does it

static artifact desugar ( rule context rule context , artifact jar , nested set < artifact > bootclasspath , nested set < artifact > classpath , artifact result ) { return create desugar action ( rule context , " $ desugar " , jar , bootclasspath , classpath , result ) ; }


construct an implementation of { @ link hystrix command properties } for { @ link hystrix command } instances with { @ link hystrix command key } < b > default implementation < b > constructs instance of { @ link hystrix properties command default }

public hystrix command properties get command properties ( hystrix command key command key , hystrix command properties setter builder ) { return new hystrix properties command default ( command key , builder ) ; }


it ' s not ok to drop tombstones for non - final - results windowed streams , since we may have emitted some results for the window before getting the tombstone ( see the { @ link suppressed internal } javadoc )

public void suppress should not drop tombstones for time windows ( ) { final harness < windowed < string > , long > harness = new harness < > ( until time limit ( of millis ( 0 ) , max records ( 0 ) ) , time windowed serde from ( string class , 100l ) , long ( ) ) ; final mock internal processor context context = harness context ; final long timestamp = 100l ; context set record metadata ( " " , 0 , 0l , null , timestamp ) ; final windowed < string > key = new windowed < > ( " hey " , new time window ( 0l , 100l ) ) ; final change < long > value = new change < > ( null , arbitrary long ) ; harness processor process ( key , value ) ; assert that ( context forwarded ( ) , has size ( 1 ) ) ; final mock processor context captured forward captured forward = context forwarded ( ) get ( 0 ) ; assert that ( captured forward key value ( ) , is ( new key value < > ( key , value ) ) ) ; assert that ( captured forward timestamp ( ) , is ( timestamp ) ) ; }


sets the csv reader vertices file to ignore any invalid lines this is useful for files that contain an empty line at the end , multiple header lines or comments this would throw an exception otherwise

public graph csv reader ignore invalid lines vertices ( ) { if ( this vertex reader ! = null ) { this vertex reader ignore invalid lines ( ) ; } return this ; }


private static void patch nav bar ( ) throws no such field exception , illegal access exception { static patcher set final static ( nav bar u i manager class , " darcula " , new m t nav bar u i ( ) ) ; static patcher set final static ( nav bar u i manager class , " common " , new m t nav bar u i ( ) ) ; }


create a new empty module ; called from an action listener on a menu

private void create folder ( ) { string error msg = null ; synchronized ( root ) { / / sync program so we don ' t get a deadlock - - / / an event gets generated because of the add module synchronized ( program ) { program node node = ( program node ) tree get last selected path component ( ) ; / / if the node has not been yet visited , then when the group is added via the / / command below , the new child node in the parent will not be found node visit ( ) ; string name = tree get new folder name ( ) ; string tree name = tree get tree name ( ) ; create folder command cmd = new create folder command ( tree name , name , node get name ( ) ) ; if ( tree get tool ( ) execute ( cmd , program ) ) { program module m = program get listing ( ) get module ( tree name , name ) ; initiate cell editor ( node , m ) ; } else { error msg = cmd get status msg ( ) ; } } } if ( error msg ! = null ) { msg show error ( this , tree , " create folder failed " , error msg ) ; } }


< code > optional aapt pb plural plural = 5 ; < code >

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


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

public api response < void > update user with http info ( string username , user body ) throws api exception { http request builder local var request builder = update user request builder ( username , body ) ; try { http response < input stream > local var response = member var http client send ( local var request builder build ( ) , http response body handlers of input stream ( ) ) ; if ( member var response interceptor ! = null ) { member var response interceptor accept ( local var response ) ; } if ( local var response status code ( ) / 100 ! = 2 ) { throw new api exception ( local var response status code ( ) , " update user call received non - success response " , local var response headers ( ) , local var response body ( ) = = null ? null : new string ( local var response body ( ) read all bytes ( ) ) ) ; } return new api response < void > ( local var response status code ( ) , local var response headers ( ) map ( ) , null ) ; } catch ( i o exception e ) { throw new api exception ( e ) ; } catch ( interrupted exception e ) { thread current thread ( ) interrupt ( ) ; throw new api exception ( e ) ; } }


private void parse variable chunk ( ) throws eval exception { current = current + 1 ; if ( current > = value length ( ) | | value char at ( current ) ! = ' { ' ) { abort ( " expected ' { ' " ) ; } current = current + 1 ; if ( current > = value length ( ) | | value char at ( current ) = = ' } ' ) { abort ( " expected variable name " ) ; } int end = value index of ( ' } ' , current ) ; final string name = value substring ( current , end ) ; used variables add ( name ) ; chunks add ( new variable chunk ( name ) ) ; current = end + 1 ; }


return all writers that support specific types

final list < http message writer < ? > > get typed writers ( ) { return this typed writers ; }


int get current cwnd ( int default value ) { int bit = 1 < < current cwnd ; return ( bit & set ) ! = 0 ? values [ current cwnd ] : default value ; }


checks , if all outgoing connections have their interesting properties set from their target nodes

public boolean have all output connection interesting properties ( ) { for ( dag connection conn : get outgoing connections ( ) ) { if ( conn get interesting properties ( ) = = null ) { return false ; } } return true ; }


treats errors as fatal use this method only if it ' s an error if the input isn ' t valid this might be appropriate if all input is from dropdowns , for example

public void close no catch ( ) throws bind exception { if ( get binding result ( ) has errors ( ) ) { throw new bind exception ( get binding result ( ) ) ; } }


removes a previously added virtual authenticator the authenticator is no longer valid after removal , so no methods may be called

void remove virtual authenticator ( virtual authenticator authenticator ) ;


returns information on how any text in this field is indexed fields that do not support any text - based queries should return { @ link text search info # none } some fields ( eg keyword ) may support only simple match queries , and can return { @ link text search info # simple match only } ; other fields may support simple match queries without using the terms index , and can return { @ link text search info # simple match without terms }

public text search info get text search info ( ) { return text search info ; }


parses a monitoring bulk request and builds the list of documents to be indexed

public monitoring bulk request add ( final monitored system system , final bytes reference content , final x content type x content type , final long timestamp , final long interval millis ) throws i o exception { / / monitoring bulk request accepts a body request that has the same format as the bulk request new bulk request parser ( false ) parse ( content , null , null , null , null , null , true , x content type , ( index request , type ) - > { / / we no longer accept non - timestamped indexes from kibana , ls , or beats because we do not use the data / / and it was duplicated anyway ; by simply dropping it , we allow bwc for older clients that still send it if ( monitoring index from ( index request index ( ) ) ! = monitoring index timestamped ) { return ; } final bytes reference source = index request source ( ) ; if ( source length ( ) = = 0 ) { throw new illegal argument exception ( " source is missing for monitoring document [ " + index request index ( ) + " ] [ " + type + " ] [ " + index request id ( ) + " ] " ) ; } / / builds a new monitoring document based on the index request add ( new monitoring bulk doc ( system , type , index request id ( ) , timestamp , interval millis , source , x content type ) ) ; } , update request - > { throw new illegal argument exception ( " monitoring bulk requests should only contain index requests " ) ; } , delete request - > { throw new illegal argument exception ( " monitoring bulk requests should only contain index requests " ) ; } ) ; return this ; }


update mount table entry api should internally update the cache on all the routers

public void test mount table entries cache updated after update a p i call ( ) throws i o exception { / / add string src path = " / update path src " ; string dst path = " / update path dest " ; string name service id = " ns 0 " ; mount table new entry = mount table new instance ( src path , collections singleton map ( " ns 0 " , " / update path dest " ) , time now ( ) , time now ( ) ) ; add mount table entry ( mount table manager , new entry ) ; / / when add entry is done , all the routers must have updated its mount table / / entry list < router context > routers = get routers ( ) ; for ( router context rc : routers ) { list < mount table > result = get mount table entries ( rc get admin client ( ) get mount table manager ( ) ) ; assert equals ( 1 , result size ( ) ) ; mount table mount table result = result get ( 0 ) ; assert equals ( src path , mount table result get source path ( ) ) ; assert equals ( name service id , mount table result get destinations ( ) get ( 0 ) get nameservice id ( ) ) ; assert equals ( dst path , mount table result get destinations ( ) get ( 0 ) get dest ( ) ) ; } / / update string key = " ns 1 " ; string value = " / update path dest 2 " ; mount table upate entry = mount table new instance ( src path , collections singleton map ( key , value ) , time now ( ) , time now ( ) ) ; update mount table entry response update mount table entry = mount table manager update mount table entry ( update mount table entry request new instance ( upate entry ) ) ; assert true ( update mount table entry get status ( ) ) ; mount table updated mount table = get mount table entry ( src path ) ; assert not null ( " updated mount table entrty cannot be null " , updated mount table ) ; / / when update entry is done , all the routers must have updated its mount / / table entry routers = get routers ( ) ; for ( router context rc : routers ) { list < mount table > result = get mount table entries ( rc get admin client ( ) get mount table manager ( ) ) ; assert equals ( 1 , result size ( ) ) ; mount table mount table result = result get ( 0 ) ; assert equals ( src path , mount table result get source path ( ) ) ; assert equals ( key , updated mount table get destinations ( ) get ( 0 ) get nameservice id ( ) ) ; assert equals ( value , updated mount table get destinations ( ) get ( 0 ) get dest ( ) ) ; } }


creates a link when there ' s a span missing , in this case 2l which is an rpc from web to app

@ test void missing span ( ) { list < span > single host spans = as list ( span ( " a " , null , " a " , kind server , " web " , null , false ) , span ( " a " , " a " , " b " , kind client , " app " , null , false ) ) ; assert that ( new dependency linker ( logger ) put trace ( single host spans ) link ( ) ) contains only ( dependency link new builder ( ) parent ( " web " ) child ( " app " ) call count ( 1l ) build ( ) ) ; assert that ( messages ) contains ( " detected missing link to client span " ) ; }


given a pattern and a full path , extract the uri template variables uri template variables are expressed through curly brackets ( ' { ' and ' } ' ) for example : for pattern " hotels { hotel } " and path " hotels 1 " , this method will return a map containing " hotel " - > " 1 "

map < string , string > extract uri template variables ( string pattern , string path ) ;


at one time , this may have been a set of flags however , microsoft changed its meaning and never bothered to update winnt h this field is really an offset ( an rva ) to an array of pointers each of these pointers points to an image import by name structure

public int get original first thunk ( ) { return original first thunk ; }


adds a task to the queue that is to be executed to after the specified delay

public void add ( runnable runnable , long delay ms ) { delta queue add ( tick remaining + delay ms , runnable ) ; }


returns all the metadata entries named ' name ' , in the order they were received , parsed as t , or null if there are none the iterator is not guaranteed to be " live " it may or may not be accurate if metadata is mutated

public < t > iterable < t > get all ( final key < t > key ) { for ( int i = 0 ; i < size ; i + + ) { if ( bytes equal ( key ascii name ( ) , name ( i ) ) ) { return new iterable at < > ( key , i ) ; } } return null ; }


public void test reconfigure ( ) { reconfigurable dummy dummy = new reconfigurable dummy ( conf 1 ) ; assert true ( prop1 + " set to wrong value " , dummy get conf ( ) get ( prop1 ) equals ( val1 ) ) ; assert true ( prop2 + " set to wrong value " , dummy get conf ( ) get ( prop2 ) equals ( val1 ) ) ; assert true ( prop3 + " set to wrong value " , dummy get conf ( ) get ( prop3 ) equals ( val1 ) ) ; assert true ( prop4 + " set to wrong value " , dummy get conf ( ) get ( prop4 ) = = null ) ; assert true ( prop5 + " set to wrong value " , dummy get conf ( ) get ( prop5 ) = = null ) ; assert true ( prop1 + " should be reconfigurable " , dummy is property reconfigurable ( prop1 ) ) ; assert true ( prop2 + " should be reconfigurable " , dummy is property reconfigurable ( prop2 ) ) ; assert false ( prop3 + " should not be reconfigurable " , dummy is property reconfigurable ( prop3 ) ) ; assert true ( prop4 + " should be reconfigurable " , dummy is property reconfigurable ( prop4 ) ) ; assert false ( prop5 + " should not be reconfigurable " , dummy is property reconfigurable ( prop5 ) ) ; / / change something to the same value as before { boolean exception caught = false ; try { dummy reconfigure property ( prop1 , val1 ) ; assert true ( prop1 + " set to wrong value " , dummy get conf ( ) get ( prop1 ) equals ( val1 ) ) ; } catch ( reconfiguration exception e ) { exception caught = true ; } assert false ( " received unexpected exception " , exception caught ) ; } / / change something to null { boolean exception caught = false ; try { dummy reconfigure property ( prop1 , null ) ; assert true ( prop1 + " set to wrong value " , dummy get conf ( ) get ( prop1 ) = = null ) ; } catch ( reconfiguration exception e ) { exception caught = true ; } assert false ( " received unexpected exception " , exception caught ) ; } / / change something to a different value than before { boolean exception caught = false ; try { dummy reconfigure property ( prop1 , val2 ) ; assert true ( prop1 + " set to wrong value " , dummy get conf ( ) get ( prop1 ) equals ( val2 ) ) ; } catch ( reconfiguration exception e ) { exception caught = true ; } assert false ( " received unexpected exception " , exception caught ) ; } / / set unset property to null { boolean exception caught = false ; try { dummy reconfigure property ( prop4 , null ) ; assert true ( prop4 + " set to wrong value " , dummy get conf ( ) get ( prop4 ) = = null ) ; } catch ( reconfiguration exception e ) { exception caught = true ; } assert false ( " received unexpected exception " , exception caught ) ; } / / set unset property { boolean exception caught = false ; try { dummy reconfigure property ( prop4 , val1 ) ; assert true ( prop4 + " set to wrong value " , dummy get conf ( ) get ( prop4 ) equals ( val1 ) ) ; } catch ( reconfiguration exception e ) { exception caught = true ; } assert false ( " received unexpected exception " , exception caught ) ; } / / try to set unset property to null ( not reconfigurable ) { boolean exception caught = false ; try { dummy reconfigure property ( prop5 , null ) ; } catch ( reconfiguration exception e ) { exception caught = true ; } assert true ( " did not receive expected exception " , exception caught ) ; } / / try to set unset property to value ( not reconfigurable ) { boolean exception caught = false ; try { dummy reconfigure property ( prop5 , val1 ) ; } catch ( reconfiguration exception e ) { exception caught = true ; } assert true ( " did not receive expected exception " , exception caught ) ; } / / try to change property to value ( not reconfigurable ) { boolean exception caught = false ; try { dummy reconfigure property ( prop3 , val2 ) ; } catch ( reconfiguration exception e ) { exception caught = true ; } assert true ( " did not receive expected exception " , exception caught ) ; } / / try to change property to null ( not reconfigurable ) { boolean exception caught = false ; try { dummy reconfigure property ( prop3 , null ) ; } catch ( reconfiguration exception e ) { exception caught = true ; } assert true ( " did not receive expected exception " , exception caught ) ; } }


set a target class to be proxied , indicating that the proxy should be castable to the given class internally , an { @ link org springframework aop target empty target source } for the given target class will be used the kind of proxy needed will be determined on actual creation of the proxy this is a replacement for setting a " target source " or " target " , for the case where we want a proxy based on a target class ( which can be an interface or a concrete class ) without having a fully capable target source available

public void set target class ( @ nullable class < ? > target class ) { this target source = empty target source for class ( target class ) ; }


public final void keep log ( ) throws i o exception { keep log ( true ) ; }


public static void clear instance ( ) { lite pal attr = null ; }


this method will be removed in the version 5 0 0 and < code > get check listener < code > is recommended

public transaction check listener check listener ( ) { if ( this default m q producer instanceof transaction m q producer ) { transaction m q producer producer = ( transaction m q producer ) default m q producer ; return producer get transaction check listener ( ) ; } return null ; }


public string [ ] get path elements ( ) { return as array ( ) ; }


ray - cast the world for all fixtures in the path of the ray the ray - cast ignores shapes that contain the starting point

public void ray cast ( ray cast callback callback , vector 2 point 1 , vector 2 point 2 ) { ray cast ( callback , point 1 x , point 1 y , point 2 x , point 2 y ) ; }


create a size - constrained buffer in terms of the maximum number of keys it will store

static eager buffer config max records ( final long record limit ) { return new eager buffer config impl ( record limit , long max value ) ; }


public boolean is far ( ) { return ( mode = = address mode far ) ; }


public void test char array merger ( ) { char [ ] array one = " hello " to char array ( ) ; char [ ] array two = " world " to char array ( ) ; char [ ] result = merger factory get merger ( char [ ] class ) merge ( array one , array two , null ) ; assertions assert equals ( 10 , result length ) ; char [ ] merged result = " helloworld " to char array ( ) ; for ( int i = 0 ; i < merged result length ; i + + ) { assertions assert equals ( merged result [ i ] , result [ i ] ) ; } result = merger factory get merger ( char [ ] class ) merge ( null ) ; assertions assert equals ( 0 , result length ) ; result = merger factory get merger ( char [ ] class ) merge ( null , null ) ; assertions assert equals ( 0 , result length ) ; }


import spring bean definitions from either xml or groovy sources into the current bean builder instance

public void import beans ( string resource pattern ) throws i o exception { load bean definitions ( resource pattern ) ; }


create a filename from the given headers when the headers have no " content - disposition " information , a random uuid name is generated

protected string generate filename ( multi map headers ) { string filename = uuid random u u i d ( ) to string ( ) ; string content disposition = headers get ( " content - disposition " ) ; if ( content disposition ! = null & & ! content disposition is empty ( ) ) { matcher matcher = content disposition pattern matcher ( content disposition ) ; if ( matcher find ( ) ) { filename = sanitize filename ( matcher group ( 1 ) ) ; } } return filename ; }


check if the given mime is a json mime json mime examples : applicationjson applicationjson ; charset = utf8 applicationjson

protected static boolean is json mime type ( string mime ) { return mime ! = null & & ( json mime pattern matcher ( mime ) matches ( ) ) ; }


public void test nested exception 3 ( ) { throwable throwable = assertions assert throws ( s q l exception class , ( ) - > { message print 3 ( ) ; } ) ; assert that ( throwable ) has message containing ( " message " ) ; }


returns a { @ link request options } object with { @ link request options # circle crop ( ) } set

public static request options circle crop transform ( ) { if ( circle crop options = = null ) { circle crop options = new request options ( ) circle crop ( ) auto clone ( ) ; } return circle crop options ; }


create a meta block and obtain an output stream for adding data into the block the meta block will be compressed with the same compression algorithm as data blocks there can only be one block appender stream active at any time regular blocks may not be created after the first meta blocks the caller must call block appender close ( ) to conclude the block creation

public block appender prepare meta block ( string name ) throws i o exception , meta block already exists { return prepare meta block ( name , get default compression algorithm ( ) ) ; }


make a file or directory tree writable if the path is a directory , make all files under it ( and all of its subdirectories ) writable

public static void set tree writable ( path path ) throws i o exception { if ( ! files exists ( path ) ) { throw new i o exception ( string format ( " can not recursively modify files inside % s : directory does not exist " , path to absolute path ( ) to string ( ) ) ) ; } files walk file tree ( path , new simple file visitor < path > ( ) { @ override public file visit result pre visit directory ( path dir , basic file attributes attrs ) throws i o exception { if ( ! dir to file ( ) can write ( ) & & ! dir to file ( ) set writable ( true ) ) { throw new i o exception ( string format ( " can not make % s writeable " , dir to absolute path ( ) to string ( ) ) ) ; } return file visit result continue ; } @ override public file visit result visit file ( path file , basic file attributes attrs ) throws i o exception { if ( ! file to file ( ) set writable ( true ) ) { throw new i o exception ( string format ( " can not make % s writeable " , file to absolute path ( ) to string ( ) ) ) ; } return file visit result continue ; } } ) ; }


default boolean is internal topic ( string topic ) { return topic ends with ( " internal " ) | | topic ends with ( " - internal " ) | | topic starts with ( " " ) | | topic starts with ( " " ) ; }


loops until all notifications in the queue has been processed

void emit loop ( ) { for ( ; ; ) { append only linked array list < object > q ; synchronized ( this ) { q = queue ; if ( q = = null ) { emitting = false ; return ; } queue = null ; } q for each while ( this ) ; } }


return whether the user cancelled the input dialog

public boolean was cancelled ( ) { return was cancelled ; }


sets the increment applied to the ticker whenever it is queried the default behavior is to auto increment by zero i e : the ticker is left unchanged when queried

public synchronized fake test clock set auto increment step ( duration auto increment step ) { if ( auto increment step to nanos ( ) < 0 ) { throw new illegal argument exception ( " may not auto - increment by a negative amount " ) ; } this auto increment step = auto increment step ; return this ; }


get the text matched so far for the current token

public string get text ( char stream input ) { / / index is first lookahead char , don ' t include return input get text ( interval of ( start index , input index ( ) - 1 ) ) ; }


if the inner stream supports { @ link stream capabilities } , forward the probe to it otherwise : return false

public boolean has capability ( final string capability ) { if ( in instanceof stream capabilities ) { return ( ( stream capabilities ) in ) has capability ( capability ) ; } else { return false ; } }


allows the execution of several statements before each following test

scenario set up ( string lines ) { setup register exec ( lines ) ; return this ; }


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


public static h a algorithm provided bean registry ha algorithm provided bean registry ( final environment environment ) { return new h a algorithm provided bean registry ( environment ) ; }


the same as { @ link # install navitve library a b i ( context , string ) } but it can be called before calling { @ link tinker installer # install }

public static boolean install native library a b i without tinker installed ( application like app like , string current a b i ) { final string current version = tinker application helper get current version ( app like ) ; if ( share tinker internals is null or nil ( current version ) ) { share tinker log e ( tag , " failed to get current patch version " ) ; return false ; } final file patch directory = share patch file util get patch directory ( app like get application ( ) ) ; if ( patch directory = = null ) { share tinker log e ( tag , " failed to get current patch directory " ) ; return false ; } file patch version directory = new file ( patch directory get absolute path ( ) + " / " + share patch file util get patch version directory ( current version ) ) ; file lib path = new file ( patch version directory get absolute path ( ) + " / lib / lib / " + current a b i ) ; if ( ! lib path exists ( ) ) { share tinker log e ( tag , " tinker lib path [ % s ] is not exists " , lib path ) ; return false ; } final class loader class loader = app like get application ( ) get class loader ( ) ; if ( class loader = = null ) { share tinker log e ( tag , " classloader is null " ) ; return false ; } else { share tinker log i ( tag , " before hack classloader : " + class loader to string ( ) ) ; try { final method install native library path method = tinker load library class get declared method ( " install native library path " , class loader class , file class ) ; install native library path method set accessible ( true ) ; install native library path method invoke ( null , class loader , lib path ) ; return true ; } catch ( throwable thr ) { share tinker log e ( tag , " install native library path fail : " + lib path + " , thr : " + thr ) ; return false ; } finally { share tinker log i ( tag , " after hack classloader : " + class loader to string ( ) ) ; } } }


transitions from the alpha at the time this action starts to the specified alpha

static public alpha action alpha ( float a , float duration , @ null interpolation interpolation ) { alpha action action = action ( alpha action class ) ; action set alpha ( a ) ; action set duration ( duration ) ; action set interpolation ( interpolation ) ; return action ; }


create a new { @ code remote invocation } object for the given aop method invocation the default implementation delegates to the { @ link remote invocation factory } can be overridden in subclasses to provide custom { @ code remote invocation } subclasses , containing additional invocation parameters like user credentials note that it is preferable to use a custom { @ code remote invocation factory } which is a reusable strategy

protected remote invocation create remote invocation ( method invocation method invocation ) { return this remote invocation factory create remote invocation ( method invocation ) ; }


set the default response transformer all requests not using a custom transformer will use this one

public static void default response transformer ( response transformer transformer ) { get instance ( ) default response transformer ( transformer ) ; }


records the failed load of a new entry this should be called when a cache request causes an entry to be loaded , but an exception is thrown while loading the entry in contrast to { @ link # record misses } , this method should only be called by the loading thread

void record load exception ( long load time ) ;


mark the block belonging to datanode as corrupt

void add to corrupt replicas map ( block blk , datanode descriptor dn , string reason , reason reason code , boolean is striped ) { map < datanode descriptor , reason > nodes = corrupt replicas map get ( blk ) ; if ( nodes = = null ) { nodes = new hash map < datanode descriptor , reason > ( ) ; corrupt replicas map put ( blk , nodes ) ; increment block stat ( is striped ) ; } string reason text ; if ( reason ! = null ) { reason text = " because " + reason ; } else { reason text = " " ; } if ( ! nodes key set ( ) contains ( dn ) ) { name node block state change log debug ( " block name system add to corrupt replicas map : { } added as corrupt on " + " { } by { } { } " , blk , dn , server get remote ip ( ) , reason text ) ; } else { name node block state change log debug ( " block name system add to corrupt replicas map : duplicate requested for " + " { } to add as corrupt on { } by { } { } " , blk , dn , server get remote ip ( ) , reason text ) ; } / / add the node or update the reason nodes put ( dn , reason code ) ; }


test that the proper state is propagated when the health monitor sees an uncaught exception in its thread

public void test health monitor dies ( ) throws exception { log info ( " mocking rte in health monitor , waiting for failed " ) ; throw o o m e on create = true ; svc act unreachable = true ; wait for state ( hm , health monitor state health monitor failed ) ; hm shutdown ( ) ; hm join ( ) ; assert false ( hm is alive ( ) ) ; }


the list of array elements < code > repeated aapt pb array element element = 1 ; < code >

public int get element count ( ) { return element size ( ) ; }


returns a new builder the generated builder is equivalent to the builder created by the { @ link builder } constructor

public static < k , v > builder < k , v > builder ( ) { return new builder < > ( ) ; }


attempts to create an adapter for { @ code type } annotated with { @ code annotations } this returns the adapter if one was created , or null if this factory isn ' t capable of creating such an adapter implementations may use { @ link moshi # adapter } to compose adapters of other types , or { @ link moshi # next adapter } to delegate to the underlying adapter of the same type

json adapter < ? > create ( type type , set < ? extends annotation > annotations , moshi moshi ) ;


used to call seccomp ( 2 ) , its too new this is the only way , don ' t use it on some other architecture unless you know wtf you are doing

native long syscall ( native long number , object args ) ;


set the text body of the rendered html { @ code < option > } tag may be a runtime expression

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


public synchronized void remove ( final int statement id ) { my s q l binary statement binary statement = get binary statement ( statement id ) ; if ( null ! = binary statement ) { statement id assigner remove ( binary statement get sql ( ) ) ; binary statements remove ( statement id ) ; } }


protected index shard new started shard ( checked function < boolean , index shard , i o exception > shard function , boolean primary ) throws i o exception { index shard shard = shard function apply ( primary ) ; if ( primary ) { recover shard from store ( shard ) ; assert that ( shard get max seq no of updates or deletes ( ) , equal to ( shard seq no stats ( ) get max seq no ( ) ) ) ; } else { recovery empty replica ( shard , true ) ; } return shard ; }


tests metasave after delete , to make sure there are no orphaned blocks

public void test metasave after delete ( ) throws i o exception , interrupted exception , timeout exception { for ( int i = 0 ; i < 2 ; i + + ) { path file = new path ( " / filestatus " + i ) ; d f s test util create file ( file sys , file , 1024 , 1024 , block size , ( short ) 2 , seed ) ; } / / stop datanode and wait for namenode to discover that a datanode is dead stop datanode and wait ( 1 ) ; nn rpc set replication ( " / filestatus 0 " , ( short ) 4 ) ; nn rpc delete ( " / filestatus 0 " , true ) ; nn rpc delete ( " / filestatus 1 " , true ) ; nn rpc meta save ( " metasave after delete out txt " ) ; / / verification buffered reader reader = null ; try { file input stream fstream = new file input stream ( get log file ( " metasave after delete out txt " ) ) ; data input stream in = new data input stream ( fstream ) ; reader = new buffered reader ( new input stream reader ( in ) ) ; reader read line ( ) ; string line = reader read line ( ) ; assert true ( line equals ( " live datanodes : 1 " ) ) ; line = reader read line ( ) ; assert true ( line equals ( " dead datanodes : 1 " ) ) ; line = reader read line ( ) ; assert true ( line equals ( " metasave : blocks waiting for reconstruction : 0 " ) ) ; line = reader read line ( ) ; assert true ( line equals ( " metasave : blocks currently missing : 0 " ) ) ; line = reader read line ( ) ; assert true ( line equals ( " mis - replicated blocks that have been postponed : " ) ) ; line = reader read line ( ) ; assert true ( line equals ( " metasave : blocks being reconstructed : 0 " ) ) ; line = reader read line ( ) ; assert true ( line equals ( " metasave : blocks 2 waiting deletion from 1 datanodes " ) ) ; / / skip 2 lines to reach hdfs - 9033 scenario line = reader read line ( ) ; line = reader read line ( ) ; assert true ( line contains ( " blk " ) ) ; / / skip 1 line for corrupt blocks section line = reader read line ( ) ; line = reader read line ( ) ; assert true ( line equals ( " metasave : number of datanodes : 2 " ) ) ; line = reader read line ( ) ; assert false ( line contains ( " na n " ) ) ; } finally { if ( reader ! = null ) reader close ( ) ; } }


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


try to instantiate a protocol buffer of the given message class from the given input stream

private static message try instantiate protobuf ( class < ? > proto class , data input data in ) throws i o exception { try { if ( data in instanceof input stream ) { / / we can use the built - in parse delimited from and not have to re - copy / / the data method parse method = get static protobuf method ( proto class , " parse delimited from " , input stream class ) ; return ( message ) parse method invoke ( null , ( input stream ) data in ) ; } else { / / have to read it into a buffer first , since protobuf doesn ' t deal / / with the data input interface directly / / read the size delimiter that write delimited to writes int size = proto util read raw varint 3 2 ( data in ) ; if ( size < 0 ) { throw new i o exception ( " invalid size : " + size ) ; } byte [ ] data = new byte [ size ] ; data in read fully ( data ) ; method parse method = get static protobuf method ( proto class , " parse from " , byte [ ] class ) ; return ( message ) parse method invoke ( null , data ) ; } } catch ( invocation target exception e ) { if ( e get cause ( ) instanceof i o exception ) { throw ( i o exception ) e get cause ( ) ; } else { throw new i o exception ( e get cause ( ) ) ; } } catch ( illegal access exception iae ) { throw new assertion error ( " could not access parse method in " + proto class ) ; } }


checks whether the producer may be able to produce images of the specified size this makes no promise about being able to produce images for a particular source , only generally being able to produce output of the desired resolution

boolean can provide image for size ( resize options resize options ) ;


set the resource that this bean definition came from ( for the purpose of showing context in case of errors )

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


writes a long value into a byte array see { @ link # get bytes ( long , byte [ ] ) }

default void put long ( byte [ ] b , long value ) { put long ( b , 0 , value ) ; }


public void set limits ( float lower , float upper ) { jni set limits ( addr , lower , upper ) ; }


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


get the value class for the map output data if it is not set , use the ( final ) output value class this allows the map output value class to be different than the final output value class

public class < ? > get map output value class ( ) { class < ? > retv = get class ( job context map output value class , null , object class ) ; if ( retv = = null ) { retv = get output value class ( ) ; } return retv ; }


specify the content type to use for sending remote invocation responses default is " applicationx - java - serialized - object "

public void set content type ( string content type ) { assert not null ( content type , " ' content type ' must not be null " ) ; this content type = content type ; }


order by tenant id ( needs to be followed by { @ link # asc ( ) } or { @ link # desc ( ) } )


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


ensures that { @ code expression } is { @ code true } , throwing a { @ code verify exception } with a custom message otherwise see { @ link # verify ( boolean , string , object ) } for details

public static void verify ( boolean expression , @ nullable decl string error message template , @ nullable decl object p 1 ) { if ( ! expression ) { throw new verify exception ( lenient format ( error message template , p 1 ) ) ; } }


public long get type quota ( storage type type ) { return ( type quota ! = null ) ? type quota [ type ordinal ( ) ] : - 1l ; }


define the format for datetime with the given { @ link date format } note : setting this property makes the exposed { @ link object mapper } non - thread - safe , according to jackson ' s thread safety rules

public jackson 2 object mapper builder date format ( date format date format ) { this date format = date format ; return this ; }


returns the number of produced intermediate data sets

public int get number of produced intermediate data sets ( ) { return this results size ( ) ; }


returns the fallthrough address null is returned if there is no fall through

public address get fall through ( ) { return fallthrough address ; }


test the property ' namespace wrapped array '

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


only perform this delete request if the document was last modification was assigned the given primary term must be used in combination with { @ link # set if seq no ( long ) } if the document last modification was assigned a different primary term a { @ link org elasticsearch index engine version conflict engine exception } will be thrown

public delete request set if primary term ( long term ) { if ( term < 0 ) { throw new illegal argument exception ( " primary term must be non negative got [ " + term + " ] " ) ; } if primary term = term ; return this ; }


specify whether to submit a binary stream character stream to the jdbc driver as explicit lob content , using the jdbc 4 0 { @ code set blob } { @ code set clob } method with a stream argument default is " false " , using the common jdbc 2 0 { @ code set binary stream } { @ code set character stream } method for setting the content switch this to " true " for explicit jdbc 4 0 streaming , provided that your jdbc driver actually supports those jdbc 4 0 operations ( e g derby ' s ) this setting affects stream arguments as well as byte array string arguments , requiring jdbc 4 0 support for supporting lob content against jdbc 3 0 , check out the { @ link # set wrap as lob " wrap as lob " } setting

public void set stream as lob ( boolean stream as lob ) { this stream as lob = stream as lob ; }


stores a key - value pair in this multimap for each of { @ code values } , all using the same key , { @ code key } equivalent to ( but expected to be more efficient than ) : { @ code for ( v value : values ) { put ( key , value ) ; } } in particular , this is a no - op if { @ code values } is empty

boolean put all ( @ nullable decl k key , iterable < ? extends v > values ) ;


public json node get leader ( http servlet request request , http servlet response response ) { if ( version judgement all member is new version ( ) ) { throw new illegal state exception ( " old raft protocol already stop " ) ; } object node result = jackson utils create empty json node ( ) ; result put ( " leader " , jackson utils to json ( raft core get leader ( ) ) ) ; return result ; }


public boolean is eternal ( ) { return ( expire time m s = = long max value ) ; }


provide a abstract configuration implementation instance


sets the path for writing execution statistics ( e g resource usage )

public command line builder set statistics path ( path statistics path ) { this statistics path = statistics path ; return this ; }


converts a hex string to byte [ ] will convert full bytes only , odd number of hex characters will have a leading ' 0 ' added big endian

public static byte [ ] hex string to byte ( string hex string ) { if ( ( hex string length ( ) & 1 ) = = 1 ) / / nibbles promote to a full byte hex string = ' 0 ' + hex string ; byte [ ] tmp = new byte [ hex string length ( ) / 2 ] ; for ( int i = 0 ; i < tmp length ; + + i ) { string hex byte = hex string substring ( i * 2 , i * 2 + 2 ) ; tmp [ i ] = ( byte ) integer parse int ( hex byte , 16 ) ; } return tmp ; } / * private class editable styled text extends styled text { editable styled text ( composite parent , int style ) { super ( parent , style ) ; } @ override public void copy ( ) { hex edit control this copy ( ) ; } @ override public void paste ( ) { hex edit control this paste ( ) ; } }


regression test for hdfs - 1997 test that , if an exception occurs on the client side , it is properly reported as such , and reported to the associated n n storage object

public void test client side exception ( ) throws i o exception { configuration conf = new hdfs configuration ( ) ; mini d f s cluster cluster = new mini d f s cluster builder ( conf ) num data nodes ( 0 ) build ( ) ; n n storage mock storage = mockito mock ( n n storage class ) ; list < file > local path = collections singleton list ( new file ( " / xxxxx - does - not - exist / blah " ) ) ; try { url fs name = d f s util get info server ( cluster get name node ( ) get service rpc address ( ) , conf , d f s util get http client scheme ( conf ) ) to u r l ( ) ; string id = " getimage = 1 & txid = 0 " ; transfer fs image get file client ( fs name , id , local path , mock storage , false ) ; fail ( " didn ' t get an exception ! " ) ; } catch ( i o exception ioe ) { mockito verify ( mock storage ) report error on file ( local path get ( 0 ) ) ; assert true ( " unexpected exception : " + string utils stringify exception ( ioe ) , ioe get message ( ) contains ( " unable to download to any storage " ) ) ; } finally { cluster shutdown ( ) ; } }


adds a channel to a successor node to this node

public void add outgoing channel ( channel channel ) { this out channels add ( channel ) ; }


failover from service 1 to service 2 if the failover fails then try to failback

public void failover ( h a service target from svc , h a service target to svc , boolean force fence , boolean force active ) throws failover failed exception { preconditions check argument ( from svc get fencer ( ) ! = null , " failover requires a fencer " ) ; pre failover checks ( from svc , to svc , force active ) ; / / try to make from svc standby boolean try fence = true ; if ( try graceful fence ( from svc ) ) { try fence = force fence ; } / / fence from svc if it ' s required or forced by the user if ( try fence ) { if ( ! from svc get fencer ( ) fence ( from svc , to svc ) ) { throw new failover failed exception ( " unable to fence " + from svc + " fencing failed " ) ; } } / / try to make to svc active boolean failed = false ; throwable cause = null ; try { h a service protocol helper transition to active ( to svc get proxy ( conf , rpc timeout to new active ) , create req info ( ) ) ; } catch ( service failed exception sfe ) { log error ( " unable to make { } active ( { } ) failing back " , to svc , sfe get message ( ) ) ; failed = true ; cause = sfe ; } catch ( i o exception ioe ) { log error ( " unable to make { } active ( unable to connect ) failing back " , to svc , ioe ) ; failed = true ; cause = ioe ; } / / we failed to make to svc active if ( failed ) { string msg = " unable to failover to " + to svc ; / / only try to failback if we didn ' t fence from svc if ( ! try fence ) { try { / / unconditionally fence to svc in case it is still trying to / / become active , eg we timed out waiting for its response / / unconditionally force from svc to become active since it / / was previously active when we initiated failover failover ( to svc , from svc , true , true ) ; } catch ( failover failed exception ffe ) { msg + = " failback to " + from svc + " failed ( " + ffe get message ( ) + " ) " ; log error ( msg ) ; } } throw new failover failed exception ( msg , cause ) ; } }


returns a new array of the given length with the specified component type

public static < t > t [ ] new array ( class < t > type , int length ) { return ( t [ ] ) array new instance ( type , length ) ; }


writes a - keep rule for each class listing any members to keep we sort classes and members so the output is deterministic

private static void write keep directives ( print stream out , map < string , immutable set < keep reference > > seeds ) { seeds entry set ( ) stream ( ) sorted ( comparing ( map entry : : get key ) ) for each ordered ( type - > { out printf ( " - keep class % s { % n " , type get key ( ) replace ( ' / ' , ' ' ) ) ; type get value ( ) stream ( ) filter ( keep reference : : is member reference ) sorted ( comparing ( keep reference : : name ) then comparing ( keep reference : : desc ) ) map ( ref - > to keep descriptor ( ref ) ) distinct ( ) / / drop duplicates due to method descriptors with different returns for each ordered ( line - > out append ( " " ) append ( line ) append ( " ; " ) println ( ) ) ; out printf ( " } % n " ) ; } ) ; }


the @ override annotation is intentionally removed for this method to align with the production codes ' assumption that this interface may not be available for the given hadoop version

public list < container > get containers from previous attempts ( ) { return get containers from previous attempts supplier get ( ) ; }


gets a scalar that matches the value of the scalar at the cursor location

private scalar grab matching scalar ( instruction instruction , int op index ) { scalar scalar at cursor = action plugin get scalar ( context ) ; scalar scalar = instruction get scalar ( op index ) ; if ( scalar at cursor equals ( scalar ) ) { return scalar ; } if ( scalar = = null ) { / / checks the sub - operands for any scalars list < ? > op objects = instruction get default operand representation list ( op index ) ; / / @ formatter : off optional < scalar > match = op objects stream ( ) filter ( scalar class : : is instance ) map ( scalar class : : cast ) filter ( s - > s equals ( scalar at cursor ) ) find any ( ) ; / / @ formatter : on if ( match is present ( ) ) { return match get ( ) ; } } return null ; }


add a legacy record without doing offsetmagic validation ( this should only be used in testing )

public void append unchecked with offset ( long offset , legacy record record ) { ensure open for record append ( ) ; try { int size = record size in bytes ( ) ; abstract legacy record batch write header ( append stream , to inner offset ( offset ) , size ) ; byte buffer buffer = record buffer ( ) duplicate ( ) ; append stream write ( buffer array ( ) , buffer array offset ( ) , buffer limit ( ) ) ; record written ( offset , record timestamp ( ) , size + records log overhead ) ; } catch ( i o exception e ) { throw new kafka exception ( " i / o exception when writing to the append stream , closing " , e ) ; } }


public void upload file test ( ) { long pet id = null ; string additional metadata = null ; org apache cxf jaxrs ext multipart attachment file = null ; / / model api response response = api upload file ( pet id , additional metadata , file ) ; / / assert not null ( response ) ; / / todo : test validations }


aggregate the values of records in this stream by the grouped key and defined windows records with { @ code null } key or value are ignored aggregating is a generalization of { @ link # reduce ( reducer ) combining via reduce ( ) } as it , for example , allows the result to have a different type than the input values the result is written into a local { @ link window store } ( which is basically an ever - updating materialized view ) furthermore , updates to the store are sent downstream into a { @ link k table } changelog stream the specified { @ link initializer } is applied directly before the first input record ( per key ) in each window is processed to provide an initial intermediate aggregation result that is used to process the first record for the window ( per key ) the specified { @ link aggregator } is applied for each input record and computes a new aggregate using the current aggregate ( or for the very first record using the intermediate aggregation result provided via the { @ link initializer } ) and the record ' s value thus , { @ code aggregate ( ) } can be used to compute aggregate functions like count ( c f { @ link # count ( ) } ) the default key and value serde from the config will be used for serializing the result if a different serde is required then you should use { @ link # aggregate ( initializer , aggregator , named , materialized ) } not all updates might get sent downstream , as an internal cache is used to deduplicate consecutive updates to the same window and key the rate of propagated updates depends on your input data rate , the number of distinct keys , the number of parallel running kafka streams instances , and the { @ link streams config configuration } parameters for { @ link streams config # cache max bytes buffering config cache size } , and { @ link streams config # commit interval ms config commit interval } for failure and recovery the store ( which always will be of type { @ link timestamped window store } ) will be backed by an internal changelog topic that will be created in kafka the changelog topic will be named " $ { application id } - $ { internal store name } - changelog " , where " application id " is user - specified in { @ link streams config } via parameter { @ link streams config # application id config application id config } , " internal store name " is an internal name and " - changelog " is a fixed suffix note that the internal store name may not be queryable through interactive queries you can retrieve all generated internal topic names via { @ link topology # describe ( ) }

< vr > k table < windowed < k > , vr > aggregate ( final initializer < vr > initializer , final aggregator < ? super k , ? super v , vr > aggregator , final named named ) ;


get the number of file system read operations such as list files

public int get read ops ( ) { return visit all ( new statistics aggregator < integer > ( ) { private int read ops = 0 ; @ override public void accept ( statistics data data ) { read ops + = data read ops ; read ops + = data large read ops ; } public integer aggregate ( ) { return read ops ; } } ) ; }


update the environment of the native module

void update native ( immutable map builder < string , object > env ) ;


test restricting privileges to no permissions actually works

public void test restrict privileges ( ) { assume true ( " test requires security manager " , system get security manager ( ) ! = null ) ; try { system get property ( " user home " ) ; } catch ( security exception e ) { fail ( " this test needs to be fixed : user home not available by policy " ) ; } permission collection no permissions = new permissions ( ) ; access control context no permissions acc = new access control context ( new protection domain [ ] { new protection domain ( null , no permissions ) } ) ; try { access controller do privileged ( new privileged action < void > ( ) { public void run ( ) { system get property ( " user home " ) ; fail ( " access should have been denied " ) ; return null ; } } , no permissions acc ) ; } catch ( security exception expected ) { / / expected exception } }


add a directed edge between two blocks in this container

public void add edge ( pcode block begin , pcode block end ) { end add in edge ( begin , 0 ) ; }


create a cookie with the given value , using the cookie descriptor settings of this generator ( except for " cookie max age " )

protected cookie create cookie ( string cookie value ) { cookie cookie = new cookie ( get cookie name ( ) , cookie value ) ; if ( get cookie domain ( ) ! = null ) { cookie set domain ( get cookie domain ( ) ) ; } cookie set path ( get cookie path ( ) ) ; return cookie ; }


returns true if this cause points to a build in the specified job

public boolean points to ( job < ? , ? > j ) { return j get full name ( ) equals ( upstream project ) ; }


public void int 3 2 test ( ) { / / todo : test int 3 2 }


populates { @ code buffer } with an ac - 4 sample header for a sample of the specified size

public static void get ac 4 sample header ( int size , parsable byte array buffer ) { / / see etsi ts 103 190 - 1 v1 3 1 , annex g buffer reset ( sample header size ) ; byte [ ] data = buffer get data ( ) ; data [ 0 ] = ( byte ) 0x a c ; data [ 1 ] = 0x 4 0 ; data [ 2 ] = ( byte ) 0x f f ; data [ 3 ] = ( byte ) 0x f f ; data [ 4 ] = ( byte ) ( ( size > > 16 ) & 0x f f ) ; data [ 5 ] = ( byte ) ( ( size > > 8 ) & 0x f f ) ; data [ 6 ] = ( byte ) ( size & 0x f f ) ; }


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


tests basic storeretrieve of local state

public void store and retrieve ( ) throws exception { final int chk count = 3 ; for ( int i = 0 ; i < chk count ; + + i ) { assert assert null ( task local state store retrieve local state ( i ) ) ; } list < task state snapshot > task state snapshots = store states ( chk count ) ; check stored as expected ( task state snapshots , 0 , chk count ) ; assert assert null ( task local state store retrieve local state ( chk count + 1 ) ) ; }


replace the content of this diff with the given content

void install new lines ( diff lines new lines ) { if ( input ! = new lines input ) { throw new assert exception ( " can only install new diff lines from a clone of the original " ) ; } clear ( ) ; add all ( new lines ) ; }


return the set of allowed { @ link http method http methods } , as specified by the { @ code allow } header returns an empty set when the allowed methods are unspecified

public set < http method > get allow ( ) { string value = get first ( allow ) ; if ( string utils has length ( value ) ) { string [ ] tokens = string utils tokenize to string array ( value , " , " ) ; list < http method > result = new array list < > ( tokens length ) ; for ( string token : tokens ) { http method resolved = http method resolve ( token ) ; if ( resolved ! = null ) { result add ( resolved ) ; } } return enum set copy of ( result ) ; } else { return enum set none of ( http method class ) ; } }


given a starting index , return the index of the next token on channel return { @ code i } if { @ code tokens [ i ] } is on channel return the index of the eof token if there are no tokens on channel between { @ code i } and eof

protected int next token on channel ( int i , int channel ) { sync ( i ) ; if ( i > = size ( ) ) { return size ( ) - 1 ; } token token = tokens get ( i ) ; while ( token get channel ( ) ! = channel ) { if ( token get type ( ) = = token eof ) { return i ; } i + + ; sync ( i ) ; token = tokens get ( i ) ; } return i ; }


convert android net uri to java net url as necessary for some networking a p is

public static url uri to url ( @ nullable uri uri ) { if ( uri = = null ) { return null ; } try { return new url ( uri to string ( ) ) ; } catch ( java net malformed u r l exception e ) { / / this should never happen since we got a valid uri throw new runtime exception ( e ) ; } }


returns the index of the first external symbol

public int get external symbol index ( ) { return iextdefsym ; }


void consume ( parsable byte array data , @ flags int flags ) throws parser exception ;


return the { @ link method parameter } from which { @ link # get return type ( ) return type } was created

public method parameter get return type source ( ) { return ( method parameter ) this return type get source ( ) ; }


create and initialize a new index for this d b buffer the entire index is allocated within the database ( i e , index nodes ) data nodes are only allocated as needed when data is written

private void create index ( data buffer index buffer ) throws i o exception { try { index buffer put byte ( node type offset , node mgr chained buffer index node ) ; index buffer put int ( data length offset , get obfuscation data length field value ( ) ) ; index buffer put int ( next index id offset , - 1 ) ; int index count = allocate index ( index buffer ) ; arrays fill ( data buffer id table , - 1 ) ; int index buffer count = ( ( index count - 1 ) / indexes per buffer ) + 1 ; index buffer id table = new int [ index buffer count ] ; byte [ ] empty index data = new byte [ indexes per buffer * id size ] ; arrays fill ( empty index data , ( byte ) 0xff ) ; index buffer id table [ 0 ] = index buffer get id ( ) ; index buffer put ( index base offset , empty index data ) ; for ( int i = 1 ; i < index buffer count ; i + + ) { index buffer = append index buffer ( index buffer ) ; index buffer id table [ i ] = index buffer get id ( ) ; index buffer put ( index base offset , empty index data ) ; } } finally { buffer mgr release buffer ( index buffer ) ; } }


closes the current recovery target and waits up to a certain timeout for resources to be freed returns true if resetting the recovery was successful , false if the recovery target is already cancelled failed or marked as done

boolean reset recovery ( cancellable threads new target cancellable threads ) throws i o exception { if ( finished compare and set ( false , true ) ) { try { logger debug ( " reset of recovery with shard { } and id [ { } ] " , shard id , recovery id ) ; } finally { / / release the initial reference recovery files will be cleaned as soon as ref count goes to zero , potentially now dec ref ( ) ; } try { new target cancellable threads execute ( closed latch : : await ) ; } catch ( cancellable threads execution cancelled exception e ) { logger trace ( " new recovery target cancelled for shard { } while waiting on old recovery target with id [ { } ] to close " , shard id , recovery id ) ; return false ; } recovery state stage stage = index shard recovery state ( ) get stage ( ) ; if ( index shard recovery state ( ) get primary ( ) & & ( stage = = recovery state stage finalize | | stage = = recovery state stage done ) ) { / / once primary relocation has moved past the finalization step , the relocation source can put the target into primary mode / / and start indexing as primary into the target shard ( see transport replication action ) resetting the target shard in this / / state could mean that indexing is halted until the recovery retry attempt is completed and could also destroy existing / / documents indexed and acknowledged before the reset assert stage ! = recovery state stage done : " recovery should not have completed when it ' s being reset " ; throw new illegal state exception ( " cannot reset recovery as previous attempt made it past finalization step " ) ; } index shard perform recovery restart ( ) ; return true ; } return false ; }


register a listener that will be called when this model visibility has changed the listener will contribute to this model ' s hash code state per the { @ link com airbnb epoxy epoxy attribute option # do not hash } rules

public all types model view model on visibility changed ( on model visibility changed listener < all types model view model , all types model view > listener ) { on mutation ( ) ; this on model visibility changed listener epoxy generated model = listener ; return this ; }


same as { @ link # format } , but with a list instead of variadic args

public static void format with list ( printer printer , string pattern , list < ? > arguments ) { / / n b missing format width exception is the only kind of illegal format exception / / whose constructor can take and display arbitrary error message , hence its use below / / todo ( adonovan ) : this suggests we ' re using the wrong exception throw iae ? int length = pattern length ( ) ; int arg length = arguments size ( ) ; int i = 0 ; / / index of next character in pattern int a = 0 ; / / index of next argument in arguments while ( i < length ) { int p = pattern index of ( ' % ' , i ) ; if ( p = = - 1 ) { printer append ( pattern , i , length ) ; break ; } if ( p > i ) { printer append ( pattern , i , p ) ; } if ( p = = length - 1 ) { throw new missing format width exception ( " incomplete format pattern ends with % : " + starlark repr ( pattern ) ) ; } char conv = pattern char at ( p + 1 ) ; i = p + 2 ; / / % % : literal % if ( conv = = ' % ' ) { printer append ( ' % ' ) ; continue ; } / / valid ? if ( " drsefg e f g " index of ( conv ) < 0 ) { throw new missing format width exception ( / / the call to starlark repr doesn ' t cause an infinite recursion because it ' s / / only used to format a string properly string format ( " unsupported format character \ " % s \ " at index % s in % s " , string value of ( conv ) , p + 1 , starlark repr ( pattern ) ) ) ; } / / get argument if ( a > = arg length ) { throw new missing format width exception ( " not enough arguments for format pattern " + starlark repr ( pattern ) + " : " + starlark repr ( tuple copy of ( arguments ) ) ) ; } object arg = arguments get ( a + + ) ; switch ( conv ) { case ' d ' : if ( arg instanceof starlark int | | arg instanceof integer ) { printer repr ( arg ) ; } else if ( arg instanceof starlark float ) { double d = ( ( starlark float ) arg ) to double ( ) ; starlark int rounded ; try { rounded = starlark int of finite double ( d ) ; } catch ( illegal argument exception unused ) { throw new missing format width exception ( " got " + arg + " , want a finite number " ) ; } printer repr ( rounded ) ; } else { throw new missing format width exception ( " invalid argument " + starlark repr ( arg ) + " for format pattern % d " ) ; } continue ; case ' e ' : case ' f ' : case ' g ' : case ' e ' : case ' f ' : case ' g ' : double v ; if ( arg instanceof integer ) { v = ( double ) ( integer ) arg ; } else if ( arg instanceof starlark int ) { v = ( ( starlark int ) arg ) to double ( ) ; } else if ( arg instanceof starlark float ) { v = ( ( starlark float ) arg ) to double ( ) ; } else { throw new missing format width exception ( " invalid argument " + starlark repr ( arg ) + " for format pattern % d " ) ; } printer str ( starlark float format ( v , conv ) ) ; continue ; case ' r ' : printer repr ( arg ) ; continue ; case ' s ' : printer str ( arg ) ; continue ; default : throw new illegal state exception ( " unreachable " ) ; } } if ( a < arg length ) { throw new missing format width exception ( " not all arguments converted during string formatting " ) ; } }


return the default container log directory permissions

public string get log dir permissions ( ) { if ( this log dir permissions = = null ) { this log dir permissions = get conf ( ) get ( yarn configuration nm default container executor log dirs permissions , yarn configuration nm default container executor log dirs permissions default ) ; } return this log dir permissions ; }


public void fling ( float fling time , float velocity x , float velocity y ) { this fling timer = fling time ; this velocity x = velocity x ; this velocity y = velocity y ; }