this method is useful for debugging tree problems don ' t know where else to put it

public static void print event ( print writer out , string name , tree model event e ) { string buffer buf = new string buffer ( ) ; buf append ( name ) ; buf append ( " \ n \ t path : " ) ; object [ ] path = e get path ( ) ; if ( path ! = null ) { for ( object object : path ) { g tree node node = ( g tree node ) object ; buf append ( node get name ( ) + " ( " + node hash code ( ) + " ) " ) ; buf append ( " , " ) ; } } buf append ( " \ n \ t " ) ; int [ ] child indices = e get child indices ( ) ; if ( child indices ! = null ) { buf append ( " indices [ " ) ; for ( int index : child indices ) { buf append ( integer to string ( index ) + " , " ) ; } buf append ( " ] \ n \ t " ) ; } object [ ] children = e get children ( ) ; if ( children ! = null ) { buf append ( " children [ " ) ; for ( object child : children ) { g tree node node = ( g tree node ) child ; buf append ( node get name ( ) + " ( " + node hash code ( ) + " ) , " ) ; } buf append ( " ] " ) ; } out println ( buf to string ( ) ) ; }


combine a host and port into an authority string

public static string authority from host and port ( string host , int port ) { try { return new uri ( null , null , host , port , null , null , null ) get authority ( ) ; } catch ( u r i syntax exception ex ) { throw new illegal argument exception ( " invalid host or port : " + host + " " + port , ex ) ; } }


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


this method returns all vertices known by this class this differs from the vertices returned from { @ link graph } in that those may be a smaller subset of the collection returned here due to graph manipulation after creation time ( e g , vertex grouping ) , the vertices known by the { @ link graph } may not include all vertices created at the same time as the graph and any others created by graph mutating operations < b > that are not the result of a grouping operation < b >

public set < f g vertex > get ungrouped vertices ( ) { return generate ungrouped vertices ( ) ; }


an overloaded variant of { @ link # value ( matcher ) } that also accepts a target type for the resulting value that the matcher can work reliably against this can be useful for matching numbers reliably & mdash ; for example , to coerce an integer into a double

public < t > request matcher value ( matcher < ? super t > matcher , class < t > target type ) { return new abstract json path request matcher ( ) { @ override protected void match internal ( mock client http request request ) throws i o exception , parse exception { string body = request get body as string ( ) ; json path request matchers this json path helper assert value ( body , matcher , target type ) ; } } ; }


queue a call for sending if the admin client thread has exited , this will fail otherwise , it will succeed ( even if the admin client is shutting down ) this function should called when retrying an existing call

void enqueue ( call call , long now ) { if ( call tries > max retries ) { log debug ( " max retries { } for { } reached " , max retries , call ) ; call fail ( time milliseconds ( ) , new timeout exception ( ) ) ; return ; } if ( log is debug enabled ( ) ) { log debug ( " queueing { } with a timeout { } ms from now " , call , call deadline ms - now ) ; } boolean accepted = false ; synchronized ( this ) { if ( new calls ! = null ) { new calls add ( call ) ; accepted = true ; } } if ( accepted ) { client wakeup ( ) ; / / wake the thread if it is in poll ( ) } else { log debug ( " the admin client thread has exited timing out { } " , call ) ; call fail ( long max value , new timeout exception ( " the admin client thread has exited " ) ) ; } }


get the prop defaults from the given { @ link type element }

public static immutable list < prop default model > get prop defaults ( type element type element ) { final list < prop default model > prop defaults = new array list < > ( ) ; final list < ? extends element > enclosed elements = type element get enclosed elements ( ) ; for ( element enclosed element : enclosed elements ) { prop defaults add all ( extract from field ( enclosed element ) ) ; prop defaults add all ( extract from method ( enclosed element ) ) ; } return immutable list copy of ( prop defaults ) ; }


return a text representation for a given set of access flags here are some examples : < dl > < dd > < code > " public static final " < code > , < dd > < dd > < code > " package private " < code > , or < dd > < dd > < code > " protected transient " < code > < dd > < dl > note : only access flags that map to java modifier keywords are returned

public static string to string ( int access ) { string buffer string buffer = new string buffer ( ) ; if ( ( access & acc public value ) = = acc public value ) { string buffer append ( " public " ) ; } if ( ( access & acc private value ) = = acc private value ) { string buffer append ( " private " ) ; } if ( ( access & acc protected value ) = = acc protected value ) { string buffer append ( " protected " ) ; } if ( ( access & acc static value ) = = acc static value ) { string buffer append ( " static " ) ; } if ( ( access & acc final value ) = = acc final value ) { string buffer append ( " final " ) ; } if ( ( access & acc synchronized value ) = = acc synchronized value ) { string buffer append ( " synchronized " ) ; } if ( ( access & acc native value ) = = acc native value ) { string buffer append ( " native " ) ; } if ( ( access & acc abstract value ) = = acc abstract value ) { string buffer append ( " abstract " ) ; } return string buffer to string ( ) trim ( ) ; }


service instance topologydependency meta and metrics related source the metrics base on the oal scripts

service instance relation to service instance relation ( ) { if ( string util is empty ( source service instance name ) | | string util is empty ( dest service instance name ) ) { return null ; } service instance relation service instance relation = new service instance relation ( ) ; service instance relation set source service name ( source service name ) ; service instance relation set source service node type ( source node type ) ; service instance relation set source service instance name ( source service instance name ) ; service instance relation set dest service name ( dest service name ) ; service instance relation set dest service node type ( dest node type ) ; service instance relation set dest service instance name ( dest service instance name ) ; service instance relation set endpoint ( dest endpoint name ) ; service instance relation set component id ( component id ) ; service instance relation set latency ( latency ) ; service instance relation set status ( status ) ; service instance relation set response code ( response code ) ; service instance relation set type ( type ) ; service instance relation set detect point ( detect point ) ; service instance relation set time bucket ( time bucket ) ; return service instance relation ; }


test resolving all pattern ( null , empty array or " all " ) for random indices options

public void test concrete indices all pattern random ( ) { for ( int i = 0 ; i < 10 ; i + + ) { final string [ ] all indices ; switch ( random int between ( 0 , 2 ) ) { case 0 : all indices = null ; break ; case 1 : all indices = new string [ 0 ] ; break ; case 2 : all indices = new string [ ] { metadata all } ; break ; default : throw new unsupported operation exception ( ) ; } final indices options indices options = indices options from options ( random boolean ( ) , random boolean ( ) , random boolean ( ) , random boolean ( ) ) ; { cluster state state = cluster state builder ( new cluster name ( " name " ) ) metadata ( metadata builder ( ) build ( ) ) build ( ) ; index name expression resolver context context = new index name expression resolver context ( state , indices options , false ) ; / / with no indices , asking for all indices should return empty list or exception , depending on indices options if ( indices options allow no indices ( ) ) { string [ ] concrete indices = index name expression resolver concrete index names ( context , all indices ) ; assert that ( concrete indices , not null value ( ) ) ; assert that ( concrete indices length , equal to ( 0 ) ) ; } else { expect throws ( index not found exception class , ( ) - > index name expression resolver concrete index names ( context , all indices ) ) ; } } { / / with existing indices , asking for all indices should return all open / closed indices depending on options metadata builder md builder = metadata builder ( ) put ( index builder ( " aaa " ) state ( state open ) put alias ( alias metadata builder ( " aaa alias 1 " ) ) ) put ( index builder ( " bbb " ) state ( state open ) put alias ( alias metadata builder ( " bbb alias 1 " ) ) ) put ( index builder ( " ccc " ) state ( state close ) put alias ( alias metadata builder ( " ccc alias 1 " ) ) ) ; cluster state state = cluster state builder ( new cluster name ( " name " ) ) metadata ( md builder ) build ( ) ; index name expression resolver context context = new index name expression resolver context ( state , indices options , false ) ; if ( indices options expand wildcards open ( ) | | indices options expand wildcards closed ( ) | | indices options allow no indices ( ) ) { string [ ] concrete indices = index name expression resolver concrete index names ( context , all indices ) ; assert that ( concrete indices , not null value ( ) ) ; int expected number of indices = 0 ; if ( indices options expand wildcards open ( ) ) { expected number of indices + = 2 ; } if ( indices options expand wildcards closed ( ) ) { expected number of indices + = 1 ; } assert that ( concrete indices length , equal to ( expected number of indices ) ) ; } else { expect throws ( index not found exception class , ( ) - > index name expression resolver concrete index names ( context , all indices ) ) ; } } } }


change the current theme to the specified one , storing the new theme name through the configured { @ link theme resolver }

public void change theme ( @ nullable theme theme ) { theme resolver theme resolver = request context utils get theme resolver ( this request ) ; if ( theme resolver = = null ) { throw new illegal state exception ( " cannot change theme if no theme resolver configured " ) ; } theme resolver set theme name ( this request , this response , ( theme ! = null ? theme get name ( ) : null ) ) ; this theme = theme ; }


does the actual work for extracting , decoding , encoding and muxing

private void do extract decode edit encode mux ( final @ nullable video track converter video track converter , final @ nullable audio track converter audio track converter , final @ non null muxer muxer ) throws i o exception , transcoding exception { boolean muxing = false ; int percent processed = 0 ; long input duration = math max ( video track converter = = null ? 0 : video track converter m input duration , audio track converter = = null ? 0 : audio track converter m input duration ) ; while ( ! m cancelled & & ( ( video track converter ! = null & & ! video track converter m video encoder done ) | | ( audio track converter ! = null & & ! audio track converter m audio encoder done ) ) ) { if ( verbose ) { log d ( tag , " loop : " + ( video track converter = = null ? " " : video track converter dump state ( ) ) + ( audio track converter = = null ? " " : audio track converter dump state ( ) ) + " muxing : " + muxing ) ; } if ( video track converter ! = null & & ( audio track converter = = null | | audio track converter m audio extractor done | | video track converter m muxing video presentation time < = audio track converter m muxing audio presentation time ) ) { video track converter step ( ) ; } if ( audio track converter ! = null & & ( video track converter = = null | | video track converter m video extractor done | | video track converter m muxing video presentation time > = audio track converter m muxing audio presentation time ) ) { audio track converter step ( ) ; } if ( input duration ! = 0 & & m listener ! = null ) { final long time from us = m time from < = 0 ? 0 : m time from * 1000 ; final long time to us = m time to < = 0 ? input duration : m time to * 1000 ; final int cur percent processed = ( int ) ( 100 * ( math max ( video track converter = = null ? 0 : video track converter m muxing video presentation time , audio track converter = = null ? 0 : audio track converter m muxing audio presentation time ) - time from us ) / ( time to us - time from us ) ) ; if ( cur percent processed ! = percent processed ) { percent processed = cur percent processed ; m cancelled = m cancelled | | m listener on progress ( percent processed ) ; } } if ( ! muxing & & ( video track converter = = null | | video track converter m encoder output video format ! = null ) & & ( audio track converter = = null | | audio track converter m encoder output audio format ! = null ) ) { if ( video track converter ! = null ) { video track converter set muxer ( muxer ) ; } if ( audio track converter ! = null ) { audio track converter set muxer ( muxer ) ; } log d ( tag , " muxer : starting " ) ; muxer start ( ) ; muxing = true ; } } / / basic sanity checks if ( video track converter ! = null ) { video track converter verify end state ( ) ; } if ( audio track converter ! = null ) { audio track converter verify end state ( ) ; } / / todo : check the generated output file }


resolve placeholders within the given string , deferring to the value of { @ link # set ignore unresolvable nested placeholders } to determine whether any unresolvable placeholders should raise an exception or be ignored invoked from { @ link # get property } and its variants , implicitly resolving nested placeholders in contrast , { @ link # resolve placeholders } and { @ link # resolve required placeholders } do not delegate to this method but rather perform their own handling of unresolvable placeholders , as specified by each of those methods

protected string resolve nested placeholders ( string value ) { if ( value is empty ( ) ) { return value ; } return ( this ignore unresolvable nested placeholders ? resolve placeholders ( value ) : resolve required placeholders ( value ) ) ; }


public void map map of string test ( ) { / / todo : test map map of string }


return the pointer to a < a href = " https : www openssl orgdocscrypto b i o get mem ptr html " > in - memory bio or { @ code 0 } if the { @ code cert chain } is { @ code null } the bio contains the content of the { @ code cert chain }

static long to b i o ( byte buf allocator allocator , x 5 0 9 certificate cert chain ) throws exception { if ( cert chain = = null ) { return 0 ; } if ( cert chain length = = 0 ) { throw new illegal argument exception ( " cert chain can ' t be empty " ) ; } pem encoded pem = pem x 5 0 9 certificate to p e m ( allocator , true , cert chain ) ; try { return to b i o ( allocator , pem retain ( ) ) ; } finally { pem release ( ) ; } }


convert binary data to a sequence of hex characters

public static char [ ] hex dump ( byte [ ] data ) { char buf [ ] = new char [ data length * 2 ] ; for ( int i = 0 ; i < data length ; i + + ) { string b = integer to hex string ( data [ i ] & 0x f f ) ; if ( b length ( ) < 2 ) { buf [ i * 2 + 0 ] = ' 0 ' ; buf [ i * 2 + 1 ] = b char at ( 0 ) ; } else { buf [ i * 2 + 0 ] = b char at ( 0 ) ; buf [ i * 2 + 1 ] = b char at ( 1 ) ; } } return buf ; }


filter the response object for all routes created by this builder with the given response processing function filters are typically used to address cross - cutting concerns , such as logging , security , etc for instance , the following example creates a filter that logs the response after the handler function executes < pre class = " code " > router function & lt ; server response & gt ; filtered route = router functions route ( ) get ( " user " , this : : list users ) after ( ( request , response ) - > { log ( response ) ; return response ; } ) build ( ) ;

builder after ( bi function < server request , server response , server response > response processor ) ;


returns { @ code true } if the file descriptor is open

public boolean is open ( ) { return ! is closed ( state ) ; }


generate a quoted string from us - ascii character bytes assuming 1 - byte chars special characters and non - printable characters will be escaped using c character escape conventions ( e g , \ t , \ n , \ \ u h h h h , etc ) if a character size other than 1 - byte is required the alternate form of this method should be used the result string will be single quoted ( ie " ' " ) if the input byte array is 1 byte long , otherwise the result will be double - quoted ( ' " ' )

public static string to quoted string ( byte [ ] bytes ) { string builder builder = new string builder ( ) ; for ( byte b : bytes ) { append char converted to escape sequence ( ( char ) ( b & 0xff ) , 1 , builder ) ; } string str = builder to string ( ) ; if ( bytes length = = 1 ) { str = str replace ( " ' " , " \ \ ' " ) ; return " ' " + str + " ' " ; } str = str replace ( " \ " " , " \ \ \ " " ) ; return " \ " " + str + " \ " " ; }


handles failure to finalize a snapshot if the exception indicates that this node was unable to publish a cluster state and stopped being the master node , then fail all snapshot create and delete listeners executing on this node by delegating to { @ link # fail all listeners on master fail over } otherwise , i e as a result of failing to write to the snapshot repository for some reason , remove the snapshot ' s { @ link snapshots in progress entry } from the cluster state and move on with other queued snapshot operations if there are any

private void handle finalization failure ( exception e , snapshots in progress entry entry , repository data repository data ) { snapshot snapshot = entry snapshot ( ) ; if ( exceptions helper unwrap ( e , not master exception class , failed to commit cluster state exception class ) ! = null ) { / / failure due to not being master any more , don ' t try to remove snapshot from cluster state the next master / / will try ending this snapshot again logger debug ( ( ) - > new parameterized message ( " [ { } ] failed to update cluster state during snapshot finalization " , snapshot ) , e ) ; fail snapshot completion listeners ( snapshot , new snapshot exception ( snapshot , " failed to update cluster state during snapshot finalization " , e ) ) ; fail all listeners on master fail over ( e ) ; } else { logger warn ( ( ) - > new parameterized message ( " [ { } ] failed to finalize snapshot " , snapshot ) , e ) ; remove failed snapshot from cluster state ( snapshot , e , repository data ) ; } }


determine if the specified { @ code instance } matches one of the candidates if the candidates collection is { @ code null } , returns { @ code false }

protected boolean match ( t instance , collection < ? extends t > candidates ) { for ( t candidate : candidates ) { if ( match ( instance , candidate ) ) { return true ; } } return false ; }


returns true if the specified value is in the map note this traverses the entire map and compares every value , which may be an expensive operation

public boolean contains value ( int value ) { k [ ] key table = this key table ; int [ ] value table = this value table ; for ( int i = value table length - 1 ; i > = 0 ; i - - ) if ( key table [ i ] ! = null & & value table [ i ] = = value ) return true ; return false ; }


utility to check the supplied key or value for references to the old schema , and if so to return an updated key or value object that references the new schema note that this method assumes that the new schema may have a different name andor version , but has fields that exactly match those of the old schema currently only { @ link struct } objects have references to the { @ link schema }

protected static object update schema in ( object key or value , schema updated schema ) { if ( key or value instanceof struct ) { struct orig struct = ( struct ) key or value ; struct new struct = new struct ( updated schema ) ; for ( field field : updated schema fields ( ) ) { / / assume both schemas have exact same fields with same names and schemas new struct put ( field , orig struct get ( field ) ) ; } return new struct ; } return key or value ; }


executes the next search and calls < code > next phase < code > with the response or the exception if an error occurs in case the indexer is throttled wait time in nanos can be used as hint for doing a less resource hungry search

protected abstract void do next search ( long wait time in nanos , action listener < search response > next phase ) ;


returns a new immutable array containing the values in the specified range < b > performance note : < b > the returned array has the same full memory footprint as this one does ( no actual copying is performed ) to reduce memory usage , use { @ code sub array ( start , end ) trimmed ( ) }

public immutable int array sub array ( int start index , int end index ) { preconditions check position indexes ( start index , end index , length ( ) ) ; return start index = = end index ? empty : new immutable int array ( array , start + start index , start + end index ) ; }


creates a new blocking - style stub that supports unary and streaming output calls on the service

public static metrics service blocking stub new blocking stub ( io grpc channel channel ) { io grpc stub abstract stub stub factory < metrics service blocking stub > factory = new io grpc stub abstract stub stub factory < metrics service blocking stub > ( ) { @ java lang override public metrics service blocking stub new stub ( io grpc channel channel , io grpc call options call options ) { return new metrics service blocking stub ( channel , call options ) ; } } ; return metrics service blocking stub new stub ( factory , channel ) ; }


public void set ( int n , int start pc , int line number ) { set 0 ( n , new item ( start pc , line number ) ) ; }


verify that the config builder will build a valid config this is not done as part of the basic build because it verifies that the names of analyzerstokenizersfilters referenced by the config are known , and the validity of these names could change over time additionally , it has to be done server - side rather than client - side , as the client will not have loaded the appropriate analysis modulesplugins

public static void verify config builder ( categorization analyzer config builder config builder , analysis registry analysis registry ) throws i o exception { tuple < analyzer , boolean > tuple = make analyzer ( config builder build ( ) , analysis registry ) ; if ( tuple v 2 ( ) ) { tuple v 1 ( ) close ( ) ; } }


true if work should not happen ; false for normal path highlighting operations


return the length of the checksum file given the size of the actual file

public long get checksum file length ( path file , long file size ) { return get checksum length ( file size , get bytes per sum ( ) ) ; }


performs a flat aggregate operation on a grouped table flat aggregate takes a table aggregate function which returns multiple rows use a selection after flat aggregate example : { @ code val table agg func : table aggregate function = new my table aggregate function table env register function ( " table agg func " , table agg func ) ; tab group by ( " key " ) flat aggregate ( " table agg func ( a , b ) as ( x , y , z ) " ) select ( " key , x , y , z " ) }

flat aggregate table flat aggregate ( string table agg function ) ;


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

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


returns { @ code true } if explaining the primary shard for the shard id ( see { @ link # get shard ( ) } ) , { @ code false } if explaining a replica shard copy for the shard id , or { @ code null } to use any unassigned shard ( see { @ link # use any unassigned shard ( ) } )

public boolean is primary ( ) { return this primary ; }


returns this rule class ' s custom starlark rule implementation

public starlark callable get configured target function ( ) { return configured target function ; }


model tests for additional properties string

public void test additional properties string ( ) { / / todo : test additional properties string }


enter the disconnected state for the given node

public void disconnected ( string id , long now ) { node connection state node state = node state ( id ) ; node state last connect attempt ms = now ; update reconnect backoff ( node state ) ; if ( node state state = = connection state connecting ) { update connection setup timeout ( node state ) ; connecting nodes remove ( id ) ; } else { reset connection setup timeout ( node state ) ; } node state state = connection state disconnected ; }


gets the queries that < b > must < b > appear in the matching documents

public list < query builder > must ( ) { return this must clauses ; }


public static authentication result get authentication result ( final request context ctx ) { return ctx get conversation scope ( ) get ( parameter authentication result , authentication result class ) ; }


shows a list of supported file system types and loaders

private void show supported file systems ( ) { string builder sb = new string builder ( ) ; sb append ( " < html > < table > < tr > < td > supported file systems < / td > < td > supported loaders < / td > < / tr > \ n " ) ; sb append ( " < tr valign = ' top ' > < td > < ul > " ) ; for ( string file system name : file system service get instance ( ) get all filesystem names ( ) ) { sb append ( " < li > " + file system name + " \ n " ) ; } sb append ( " < / ul > < / td > < td > < ul > " ) ; for ( string loader name : loader service get all loader names ( ) ) { sb append ( " < li > " + loader name + " \ n " ) ; } sb append ( " < / ul > < / td > < / tr > < / table > " ) ; multi line message dialog show modal message dialog ( plugin get tool ( ) get active window ( ) , " supported file systems and loaders " , " " , sb to string ( ) , multi line message dialog information message ) ; }


specifies if the { @ link layout result } {

boolean has render tree hosts ( r result ) ;


return a list of all valid keys for state handles

public collection < string > get all handles ( ) throws exception { return kube client get config map ( config map name ) map ( config map - > config map get data ( ) key set ( ) stream ( ) filter ( config map key filter ) collect ( collectors to list ( ) ) ) or else throw ( this : : get config map not exist exception ) ; }


tests that { @ link composite sequenceable loader # get next load position us ( ) } returns { @ link c # time end of source } when all sub - loaders have next load position at end - of - source

public void get next load position us returns end of source when all loader loading last chunk ( ) { fake sequenceable loader loader 1 = new fake sequenceable loader ( / * buffered position us * / 1000 , / * next load position us * / c time end of source ) ; fake sequenceable loader loader 2 = new fake sequenceable loader ( / * buffered position us * / 1001 , / * next load position us * / c time end of source ) ; composite sequenceable loader composite sequenceable loader = new composite sequenceable loader ( new sequenceable loader [ ] { loader 1 , loader 2 } ) ; assert that ( composite sequenceable loader get next load position us ( ) ) is equal to ( c time end of source ) ; }


installs the given { @ link overview color service } into the listing margin bars this is public only for testing and screenshot purposes

public void install overview ( overview color service overview color service ) { overview color service set program ( current program ) ; overview color component overview = new overview color component ( tool , overview color service ) ; active services put ( overview color service , overview ) ; code viewer service add overview provider ( overview ) ; overview install actions ( ) ; }


removes and returns the least element of the priority queue in log ( size ) time

public final t pop ( ) { if ( size > 0 ) { t result = heap [ 1 ] ; / / save first value heap [ 1 ] = heap [ size ] ; / / move last to first heap [ size ] = null ; / / permit gc of objects size - - ; down heap ( ) ; / / adjust heap return result ; } else return null ; }


projects a { @ link tuple } { @ link data stream } to the previously selected fields

public < t0 > single output stream operator < tuple 1 < t0 > > project tuple 1 ( ) { type information < ? > [ ] f types = extract field types ( field indexes , data stream get type ( ) ) ; tuple type info < tuple 1 < t0 > > t type = new tuple type info < tuple 1 < t0 > > ( f types ) ; return data stream transform ( " projection " , t type , new stream project < in , tuple 1 < t0 > > ( field indexes , t type create serializer ( data stream get execution config ( ) ) ) ) ; }


test for { @ link retry invocation handler # is rpc invocation ( object ) }

public void test rpc invocation ( ) throws exception { / / for a proxy method should return true final unreliable interface unreliable = ( unreliable interface ) retry proxy create ( unreliable interface class , unreliable impl , retry forever ) ; assert true ( retry invocation handler is rpc invocation ( unreliable ) ) ; final atomic integer count = new atomic integer ( ) ; / / embed the proxy in protocol translator protocol translator xlator = new protocol translator ( ) { @ override public object get underlying proxy object ( ) { count get and increment ( ) ; return unreliable ; } } ; / / for a proxy wrapped in protocol translator method should return true assert true ( retry invocation handler is rpc invocation ( xlator ) ) ; / / ensure underlying proxy was looked at assert equals ( 1 , count get ( ) ) ; / / for non - proxy the method must return false assert false ( retry invocation handler is rpc invocation ( new object ( ) ) ) ; }


public static boolean copy ( final file src , final file dest ) { return copy ( src , dest , null ) ; }


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


public restore snapshot request snapshot ( string snapshot ) { this snapshot = snapshot ; return this ; }


returns the store file metadata for this file info

public store file metadata metadata ( ) { return metadata ; }


the number of slices this task should be divided into defaults to 1 meaning the task isn ' t sliced into subtasks

public int get slices ( ) { return slices ; }


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

public abstract epoxy model with view on unbind ( on model unbound listener < abstract epoxy model with view , view > listener ) { on mutation ( ) ; this on model unbound listener epoxy generated model = listener ; return this ; }


public string execute ( file system fs ) throws i o exception { path snapshot path = fs create snapshot ( path , snapshot name ) ; j s o n object json = to j s o n ( http f s file system home dir json , snapshot path to string ( ) ) ; return json to j s o n string ( ) replace all ( " \ \ \ \ " , " " ) ; }


writes summary information to the { @ link msg } log

public void log summary results ( ) { if ( total elapsed m s > 0 ) { msg info ( this , string format ( " dwarf import - total elapsed : % dms " , total elapsed m s ) ) ; } if ( data type elapsed m s > 0 ) { msg info ( this , string format ( " dwarf data type import - elapsed : % dms " , data type elapsed m s ) ) ; } if ( funcs elapsed m s > 0 ) { msg info ( this , string format ( " dwarf func & symbol import - elapsed : % dms " , funcs elapsed m s ) ) ; } if ( data types added > 0 ) { msg info ( this , string format ( " dwarf types imported : % d " , data types added ) ) ; } if ( funcs added > 0 ) { msg info ( this , string format ( " dwarf funcs added : % d " , funcs added ) ) ; } if ( func signatures added > 0 ) { msg info ( this , string format ( " dwarf function signatures added : % d " , func signatures added ) ) ; } if ( ! type remappings is empty ( ) ) { msg error ( this , " dwarf data type remappings ( dwarf data type definitions that changed meaning in different compile units ) : " ) ; msg error ( this , " data type - > changed to - > data type " ) ; int x = 0 ; for ( string s : type remappings ) { msg error ( this , " " + s ) ; if ( x + + > 1000 ) { msg error ( this , " omitting " + ( type remappings size ( ) - 1000 ) + " additional type remapping warnings " ) ; break ; } } } if ( ! relocation error var defs is empty ( ) ) { msg error ( this , " dwarf static variables with missing address info : " ) ; msg error ( this , " [ variable symbolic name : variable data type ] " ) ; for ( string var def : relocation error var defs ) { msg error ( this , " " + var def ) ; } } if ( var fit error > 0 ) { msg error ( this , " dwarf variable definitions that failed because the data type was too large for the defined register location : " + var fit error ) ; } if ( var dynamic register error > 0 ) { msg error ( this , " dwarf variable definitions that failed because they depended on the dynamic value of a register : " + var dynamic register error ) ; } if ( var d w a r f expression value > 0 ) { msg error ( this , " dwarf variable definitions that failed because they are computed pseudo variables : " + var d w a r f expression value ) ; } if ( expr read error > 0 ) { msg error ( this , " dwarf expression failed to read : " + expr read error ) ; } }


increment the number of write operations

public void increment write ops ( int count ) { get thread statistics ( ) write ops + = count ; }


create a { @ code file not found exception } with the inner nested cause set to the given exception compensates for the fact that fnfe doesn ' t have an initializer that takes an exception

private static file not found exception file not found exception ( string text , exception ex ) { return ( file not found exception ) new file not found exception ( text ) init cause ( ex ) ; }


returns the timestamp when the acknowledgement of this subtask was received at the coordinator

public long get ack timestamp ( ) { return ack timestamp ; }


protected void logd ( string msg ) { log d ( tag , msg ) ; }


completes a transaction by closing the current checkpoint all modified buffers since the previous invocation of this method will be contained within " transaction " the redo stack will be cleared

public boolean checkpoint ( ) { synchronized ( snapshot lock ) { synchronized ( this ) { if ( current checkpoint head = = null ) { / / nothing has been stored at current checkpoint return false ; } if ( lock count ! = 0 ) { throw new assert exception ( " can ' t checkpoint with locked buffers ( " + lock count + " locks found ) " ) ; } current checkpoint head = null ; return true ; } } }


read the unescaped body content from the page

protected string read body content ( ) throws i o exception { assert state ( this body content ! = null , " no body content set " ) ; return this body content get string ( ) ; }


test that program diff can determine the label differences between program 1 and program 2

public void test apply primary symbol differences ( ) throws exception { / / 0x 1 0 0 2d 1d : p 1 has " foo " & " bar " symbols " foo " is primary / / p 2 has " foo " & " bar " symbols " bar " is primary int transaction i d = p 1 start transaction ( " test transaction " ) ; namespace namespace = p 1 get symbol table ( ) get namespace ( addr ( p 1 , 0x 1 0 0 2cf 5 ) ) ; string namespace str = namespace get name ( ) ; program builder 1 create label ( " 1 0 0 2d 1d " , " foo " , namespace str ) ; program builder 1 create label ( " 1 0 0 2d 1d " , " bar " , namespace str ) ; p 1 end transaction ( transaction i d , true ) ; transaction i d = p 2 start transaction ( " test transaction " ) ; namespace = p 2 get symbol table ( ) get namespace ( addr ( p 2 , 0x 1 0 0 2cf 5 ) ) ; namespace str = namespace get name ( ) ; program builder 2 create label ( " 1 0 0 2d 1d " , " bar " , namespace str ) ; program builder 2 create label ( " 1 0 0 2d 1d " , " foo " , namespace str ) ; p 2 end transaction ( transaction i d , true ) ; program merge = new program merge manager ( p 1 , p 2 , task monitor adapter dummy monitor ) ; address set as = new address set ( addr ( 0x 1 0 0 2d 1d ) , addr ( 0x 1 0 0 2d 1d ) ) ; program merge set diff filter ( new program diff filter ( program diff filter symbol diffs ) ) ; program merge set merge filter ( new program merge filter ( program merge filter symbols , program merge filter replace ) ) ; assert equals ( as , program merge get filtered differences ( ) ) ; program merge merge ( as , task monitor adapter dummy monitor ) ; assert equals ( new address set ( ) , program merge get filtered differences ( ) ) ; }


public final i node set modification time ( long modification time , int latest snapshot id ) { record modification ( latest snapshot id ) ; set modification time ( modification time ) ; return this ; }


return a callback for creating an instance of the bean , if any

public supplier < ? > get instance supplier ( ) { return this instance supplier ; }


returns the string representing the type of this parameter with the link to the documentation for the type if available if the parameter type is object , then returns the empty string if the parameter type is not a generic , then this method returns a string representing the type name with a link to the documentation for the type if available if the parameter type is a generic , then this method returns a string " container of type " ( with html link markup )

public string get type ( ) { string builder sb = new string builder ( ) ; for ( int i = 0 ; i < param allowed types ( ) length ; i + + ) { param type param type = param allowed types ( ) [ i ] ; / / todo ( adonovan ) : make generic 1 an array if ( param type generic 1 ( ) = = object class ) { sb append ( get type anchor ( param type type ( ) ) ) ; } else { sb append ( get type anchor ( param type type ( ) , param type generic 1 ( ) ) ) ; } if ( i < param allowed types ( ) length - 1 ) { sb append ( " ; or " ) ; } } return sb to string ( ) ; }


private void rehash ( int new capacity ) { long [ ] old keys = keys ; v [ ] old vals = values ; keys = new long [ new capacity ] ; @ suppress warnings ( { " unchecked " , " suspicious array cast " } ) v [ ] temp = ( v [ ] ) new object [ new capacity ] ; values = temp ; max size = calc max size ( new capacity ) ; mask = new capacity - 1 ; / / insert to the new arrays for ( int i = 0 ; i < old vals length ; + + i ) { v old val = old vals [ i ] ; if ( old val ! = null ) { / / inlined put ( ) , but much simpler : we don ' t need to worry about / / duplicated keys , growing / rehashing , or failing to insert long old key = old keys [ i ] ; int index = hash index ( old key ) ; for ( ; ; ) { if ( values [ index ] = = null ) { keys [ index ] = old key ; values [ index ] = old val ; break ; } / / conflict , keep probing can wrap around , but never reaches start index again index = probe next ( index ) ; } } } }


test override disables a specified service provider through enable = false it is expected that a specified service provider can be disable

public void test nofity override urls disabled specified provider ( ) { registry directory registry directory = get registry directory ( ) ; invocation = new rpc invocation ( ) ; list < url > durls = new array list < url > ( ) ; durls add ( serviceurl set host ( " 10 20 30 140 " ) ) ; durls add ( serviceurl set host ( " 10 20 30 141 " ) ) ; registry directory notify ( durls ) ; durls = new array list < url > ( ) ; durls add ( url value of ( " override : / / 10 20 30 140 : 9091 ? " + disabled key + " = true " ) ) ; registry directory notify ( durls ) ; list < invoker < ? > > invokers = registry directory list ( invocation ) ; assertions assert equals ( 1 , invokers size ( ) ) ; assertions assert equals ( " 10 20 30 141 " , invokers get ( 0 ) get url ( ) get host ( ) ) ; durls = new array list < url > ( ) ; durls add ( url value of ( " empty : / / 0 0 0 0 ? " + disabled key + " = true & " + category key + " = " + configurators category ) ) ; registry directory notify ( durls ) ; list < invoker < ? > > invokers 2 = registry directory list ( invocation ) ; assertions assert equals ( 2 , invokers 2 size ( ) ) ; }


returns the additional properties schema for the specified input schema the additional properties keyword is used to control the handling of additional , undeclared properties , that is , properties whose names are not listed in the properties keyword the additional properties keyword may be either a boolean or an object if additional properties is a boolean and set to false , no additional properties are allowed by default when the additional properties keyword is not specified in the input schema , any additional properties are allowed this is equivalent to setting additional properties to the boolean value true or setting additional properties : { }

protected schema get additional properties ( schema schema ) { return model utils get additional properties ( open a p i , schema ) ; }


validate and set ctime from { @ link properties }

protected void setc time ( properties props , storage directory sd ) throws inconsistent f s state exception { c time = long parse long ( get property ( props , sd , " c time " ) ) ; }


return the name of the destination for this endpoint

public string get destination ( ) { return this destination ; }


creates an select for given columns with a trailing space

public static string create sql select ( string tablename , string table alias , string [ ] columns , boolean distinct ) { if ( table alias = = null | | table alias length ( ) < 0 ) { throw new dao exception ( " table alias required " ) ; } string builder builder = new string builder ( distinct ? " select distinct " : " select " ) ; sql utils append columns ( builder , table alias , columns ) append ( " from " ) ; builder append ( ' " ' ) append ( tablename ) append ( ' " ' ) append ( ' ' ) append ( table alias ) append ( ' ' ) ; return builder to string ( ) ; }


make sure we tolerate when delegate get extra map ( ) returns ' null '

public void get extra map tolerates delegate null map ( ) { priority network fetcher < fetch state > fetcher = new priority network fetcher < > ( delegate , false , 2 , 1 , true , false ) ; priority fetch state < fetch state > one = fetch ( fetcher , " 1 " , callback , true ) ; / / explicitly return a null when ( delegate get extra map ( eq ( one delegated state ) , any int ( ) ) ) then return ( null ) ; fetcher get extra map ( one , 123 ) ; / / implicitly assert we don ' t crash }


public int get num rows ( ) { return rows size ( ) ; }


appends realm name to user to form principal name

protected string principal name ( final string user ) { return user + " @ " + simple kdc ldap server get realm ( ) ; }


calls { @ link future # get ( ) } without the checked exceptions

public static < t > t get ( future < t > future ) { try { return future get ( ) ; } catch ( interrupted exception e ) { thread current thread ( ) interrupt ( ) ; throw new illegal state exception ( " future got interrupted " , e ) ; } catch ( execution exception e ) { throw rethrow execution exception ( e ) ; } }


check if this type is assignable from the given type token

public boolean is assignable from ( type token < ? > token ) { return is assignable from ( token get type ( ) ) ; }


adds a constant dynamic or a constant invoke dynamic info to the constant pool of this symbol table does nothing if the constant pool already contains a similar item

private symbol add constant dynamic or invoke dynamic reference ( final int tag , final string name , final string descriptor , final int bootstrap method index ) { int hash code = hash ( tag , name , descriptor , bootstrap method index ) ; entry entry = get ( hash code ) ; while ( entry ! = null ) { if ( entry tag = = tag & & entry hash code = = hash code & & entry data = = bootstrap method index & & entry name equals ( name ) & & entry value equals ( descriptor ) ) { return entry ; } entry = entry next ; } constant pool put 1 2 2 ( tag , bootstrap method index , add constant name and type ( name , descriptor ) ) ; return put ( new entry ( constant pool count + + , tag , null , name , descriptor , bootstrap method index , hash code ) ) ; }


computes and updates the steady shares of { @ link f s queue } s as per the { @ link scheduling policy } the steady share does not differentiate between queues with and without running applications under them the steady share is not used for scheduling , it is displayed on the web ui for better visibility

public abstract void compute steady shares ( collection < ? extends f s queue > queues , resource total resources ) ;


get an { @ code int } representation of { @ link # get content length ( http message , long ) }

public static int get content length ( http message message , int default value ) { return ( int ) math min ( integer max value , get content length ( message , ( long ) default value ) ) ; }


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


returns the node that is adjacent to { @ code node } along the origin edge

public final n adjacent node ( object node ) { if ( node equals ( node u ) ) { return node v ; } else if ( node equals ( node v ) ) { return node u ; } else { throw new illegal argument exception ( " endpoint pair " + this + " does not contain node " + node ) ; } }


required : service discovery mode for the hosts care must be taken when setting the resolution mode to none for a tcp port without accompanying ip addresses in such cases , traffic to any ip on said port will be allowed ( i e 0 0 0 0 : & lt ; port & gt ; ) < code > istio networking v 1alpha 3 service entry resolution resolution = 5 ; < code >

public builder set resolution value ( int value ) { resolution = value ; on changed ( ) ; return this ; }


path write ( path previous source , @ nullable writer writer ) throws i o exception ;


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

public builder clear element ( ) { copy on write ( ) ; instance clear element ( ) ; return this ; }


public void int 6 4 test ( ) { / / todo : test int 6 4 }


means finish of { @ link # exit ( context , resource wrapper , int , object ) }

void fire exit ( context context , resource wrapper resource wrapper , int count , object args ) ;


set a value in the webapp context these values are available to the jsp pages as " application get attribute ( name ) "

public void set attribute ( string name , object value ) { web app context set attribute ( name , value ) ; }


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


public type list get catches ( ) { return std type list empty ; }


moves the table selection up by the number of rows specified , ensuring that selection does not go beyond the beginning of the file

public void decrement selection ( int rows ) { int row selected = get selected row ( ) ; if ( row selected < 0 & & model selected byte start > = 0 ) { try { model clear ( ) ; clear ( ) ; list < string > lines = reader read next chunk from ( model selected byte start ) ; ( ( f v table model ) get model ( ) ) add rows to top ( lines ) ; } catch ( i o exception e ) { msg error ( this , " error reading next chunk of data starting from byte " + model selected byte start , e ) ; } } / / if we ' re moving to a row that is already in the table , just decrement else if ( row selected - rows > = 0 ) { pair byte range = model get file position for row ( row selected - rows ) ; if ( byte range = = null ) { return ; } model selected byte start = byte range get start ( ) ; model selected byte end = byte range get end ( ) ; / / now update the viewport if ( ! viewport utility is in viewport ( row selected - rows ) ) { viewport utility scroll viewport to ( row selected - rows ) ; } } else { / / if here , then we either need to load a previous chunk , or we ' re at the beginning / / of the file and should just stop try { list < string > lines = reader read previous chunk ( ) ; if ( lines size ( ) = = 0 ) { return ; } ( ( f v table model ) get model ( ) ) add rows to top ( lines ) ; pair byte range = model get file position for row ( ( row selected + lines size ( ) ) - rows ) ; model selected byte start = byte range get start ( ) ; model selected byte end = byte range get end ( ) ; / / need to wait until the table has finished updating before we try and move the / / viewport down swing utilities invoke later ( ( ) - > { / / now slide the viewport back up to account for what we just read in viewport utility move viewport down ( lines size ( ) , false ) ; / / and remove chunks if necessary if ( model get size ( ) > model max visible chunks ) { chunk chunk = model remove ( model get size ( ) - 1 ) ; if ( chunk = = null ) { return ; } ( ( f v table model ) get model ( ) ) remove rows from bottom ( chunk lines in chunk ) ; } } ) ; } catch ( i o exception e ) { msg error ( this , " error reading previous chunk of data " , e ) ; } } }


sets if previously persisted settings should be cleared

spdy settings frame set clear previously persisted settings ( boolean clear ) ;


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


build the rest template used to make http requests

protected rest template build rest template ( ) { rest template rest template = new rest template ( ) ; for ( http message converter converter : rest template get message converters ( ) ) { if ( converter instanceof abstract jackson 2 http message converter ) { object mapper mapper = ( ( abstract jackson 2 http message converter ) converter ) get object mapper ( ) ; three ten module module = new three ten module ( ) ; module add deserializer ( instant class , custom instant deserializer instant ) ; module add deserializer ( offset date time class , custom instant deserializer offset date time ) ; module add deserializer ( zoned date time class , custom instant deserializer zoned date time ) ; mapper register module ( module ) ; mapper register module ( new json nullable module ( ) ) ; } } / / this allows us to read the response more than once - necessary for debugging rest template set request factory ( new buffering client http request factory ( rest template get request factory ( ) ) ) ; return rest template ; }


return the parameter names of the underlying parameter source

iterable < string > get parameter names ( ) ;


returns the encoding and channel config to use when configuring an { @ link audio track } in passthrough mode for the specified { @ link format } returns { @ code null } if passthrough of the format is unsupported

private static pair < integer , integer > get encoding and channel config for passthrough ( format format , @ nullable audio capabilities audio capabilities ) { if ( audio capabilities = = null ) { return null ; } @ c encoding int encoding = mime types get encoding ( assertions check not null ( format sample mime type ) , format codecs ) ; / / check for encodings that are known to work for passthrough with the implementation in this / / class this avoids trying to use passthrough with an encoding where the device / app reports / / it ' s capable but it is untested or known to be broken ( for example aac - lc ) boolean supported encoding = encoding = = c encoding ac3 | | encoding = = c encoding e ac3 | | encoding = = c encoding e ac3 joc | | encoding = = c encoding ac4 | | encoding = = c encoding dts | | encoding = = c encoding dts hd | | encoding = = c encoding dolby truehd ; if ( ! supported encoding ) { return null ; } / / e - ac3 joc is object based , so any channel count specified in the format is arbitrary use 6 , / / since the e - ac3 compatible part of the stream is 5 1 int channel count = encoding = = c encoding e ac3 joc ? 6 : format channel count ; if ( channel count > audio capabilities get max channel count ( ) ) { return null ; } int channel config = get channel config for passthrough ( channel count ) ; if ( channel config = = audio format channel invalid ) { return null ; } if ( audio capabilities supports encoding ( encoding ) ) { return pair create ( encoding , channel config ) ; } else if ( encoding = = c encoding e ac3 joc & & audio capabilities supports encoding ( c encoding e ac3 ) ) { / / e - ac3 receivers support e - ac3 joc streams ( but decode in 2 - d rather than 3 - d ) return pair create ( c encoding e ac3 , channel config ) ; } return null ; }


returns { @ code true } if the given { @ link byte buf } is encrypted be aware that this method will not increase the reader index of the given { @ link byte buf }

public static boolean is encrypted ( byte buf buffer ) { if ( buffer readable bytes ( ) < ssl utils ssl record header length ) { throw new illegal argument exception ( " buffer must have at least " + ssl utils ssl record header length + " readable bytes " ) ; } return get encrypted packet length ( buffer , buffer reader index ( ) ) ! = ssl utils not encrypted ; }


output the type declaration of the property

public string get property type declaration ( schema p ) { string open a p i type = get schema type ( p ) ; if ( type mapping contains key ( open a p i type ) ) { return type mapping get ( open a p i type ) ; } return open a p i type ; }


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


replace the given child with a new child note that we no longer need to replace an normal i node directory or i node file into an i node directory with snapshot or i node file under construction the only cases for child replacement is for reference nodes

public void replace child ( i node old child , final i node new child , final i node map inode map ) { preconditions check not null ( children ) ; final int i = search children ( new child get local name bytes ( ) ) ; preconditions check state ( i > = 0 ) ; preconditions check state ( old child = = children get ( i ) | | old child = = children get ( i ) as reference ( ) get referred i node ( ) as reference ( ) get referred i node ( ) ) ; old child = children get ( i ) ; if ( old child is reference ( ) & & new child is reference ( ) ) { / / both are reference nodes , e g , dst reference - > with name final i node reference with count with count = ( with count ) old child as reference ( ) get referred i node ( ) ; with count remove reference ( old child as reference ( ) ) ; } children set ( i , new child ) ; / / replace the instance in the created list of the diff list directory with snapshot feature sf = this get directory with snapshot feature ( ) ; if ( sf ! = null ) { sf get diffs ( ) replace created child ( old child , new child ) ; } / / update the inode map if ( inode map ! = null ) { inode map put ( new child ) ; } }


returns { @ literal true } if this type of attribute is unknown this means that the attribute content can ' t be parsed to extract constant pool references , labels , etc instead , the attribute content is read as an opaque byte array , and written back as is this can lead to invalid attributes , if the content actually contains constant pool references , labels , or other symbolic references that need to be updated when there are changes to the constant pool , the method bytecode , etc the default implementation of this method always returns { @ literal true }

public boolean is unknown ( ) { return true ; }


public void add pet ( pet body ) { / / todo : implement }


the entries defined for this type < code > repeated aapt pb entry entry = 3 ; < code >

private void set entry ( int index , com android aapt resources entry builder builder for value ) { ensure entry is mutable ( ) ; entry set ( index , builder for value build ( ) ) ; }


reject out - of - order events that are delayed more than { @ code after window end } after the end of its window delay is defined as ( stream time - record timestamp )

public join windows grace ( final duration after window end ) throws illegal argument exception { final string msg prefix = prepare millis check fail msg prefix ( after window end , " after window end " ) ; final long after window end ms = validate millisecond duration ( after window end , msg prefix ) ; if ( after window end ms < 0 ) { throw new illegal argument exception ( " grace period must not be negative " ) ; } return new join windows ( before ms , after ms , after window end ms , maintain duration ms , segments ) ; }


public int run ( string [ ] args , print stream out ) throws i o exception , exit util exit exception { final list < string > parsed args ; try { parsed args = parse args ( args ) ; } catch ( command format unknown option exception e ) { errorln ( get usage ( ) ) ; throw new exit util exit exception ( exit usage , e get message ( ) , e ) ; } if ( parsed args size ( ) < 2 ) { errorln ( get usage ( ) ) ; throw new exit util exit exception ( exit usage , too few arguments ) ; } / / read mandatory arguments final string file = parsed args get ( 0 ) ; final path path = new path ( file ) ; string expression = parsed args get ( 1 ) ; println ( out , " selecting file % s with query % s " , path , expression ) ; / / and the optional arguments to adjust the configuration final optional < string > header = get opt value ( opt header ) ; header if present ( h - > println ( out , " using header option % s " , h ) ) ; path dest path = get opt value ( opt output ) map ( output - > { println ( out , " saving output to % s " , output ) ; return new path ( output ) ; } ) or else ( null ) ; final boolean to console = dest path = = null ; / / expected lines are only checked if empty final optional < integer > expected lines = to console ? get int value ( opt expected ) : optional empty ( ) ; final optional < integer > limit = get int value ( opt limit ) ; if ( limit is present ( ) ) { final int l = limit get ( ) ; println ( out , " using line limit % s " , l ) ; if ( expression to lower case ( locale english ) contains ( " limit " ) ) { println ( out , " line limit already specified in select expression " ) ; } else { expression = expression + " limit " + l ; } } / / now bind to the filesystem file system fs = bind filesystem ( path get file system ( get conf ( ) ) ) ; if ( ! fs has path capability ( path , s3 select capability ) ) { / / capability disabled throw new exit util exit exception ( exit service unavailable , select is disabled + " for " + file ) ; } lines read = 0 ; select duration = new operation duration ( ) ; / / open and scan the stream final future data input stream builder builder = fs open file ( path ) must ( select sql , expression ) ; header if present ( h - > builder must ( csv input header , h ) ) ; get opt value ( opt compression ) if present ( compression - > builder must ( select input compression , compression to upper case ( locale english ) ) ) ; get opt value ( opt inputformat ) if present ( opt - > { if ( ! " csv " equals ignore case ( opt ) ) { throw invalid args ( " unsupported input format % s " , opt ) ; } } ) ; get opt value ( opt outputformat ) if present ( opt - > { if ( ! " csv " equals ignore case ( opt ) ) { throw invalid args ( " unsupported output format % s " , opt ) ; } } ) ; / / turn on sql error reporting builder opt ( select errors include sql , true ) ; f s data input stream stream ; try ( duration info ignored = new duration info ( log , " selecting stream " ) ) { stream = future i o support await future ( builder build ( ) ) ; } catch ( file not found exception e ) { / / the source file is missing throw store not found ( e ) ; } try { if ( to console ) { / / logging to console bytes read = 0 ; @ suppress warnings ( " i o resource opened but not safely closed " ) scanner scanner = new scanner ( new buffered reader ( new input stream reader ( stream , standard charsets utf 8 ) ) ) ; scanner use delimiter ( " \ n " ) ; while ( scanner has next line ( ) ) { lines read + + ; string l = scanner next line ( ) ; bytes read + = l length ( ) + 1 ; println ( out , " % s " , l ) ; } } else { / / straight dump of whole file ; no line counting file system dest f s = dest path get file system ( get conf ( ) ) ; try ( duration info ignored = new duration info ( log , " copying file " ) ; output stream dest stream = dest f s create file ( dest path ) overwrite ( true ) build ( ) ) { bytes read = i o utils copy ( stream , dest stream ) ; } } / / close the stream / / this will take time if there ' s a lot of data remaining try ( duration info ignored = new duration info ( log , " closing stream " ) ) { stream close ( ) ; } / / generate a meaningful result depending on the operation string result = to console ? string format ( " % s lines " , lines read ) : string format ( " % s bytes " , bytes read ) ; / / print some statistics select duration finished ( ) ; println ( out , " read % s in time % s " , result , select duration get duration string ( ) ) ; println ( out , " bytes read : % , d bytes " , bytes read ) ; println ( out , " bandwidth : % , 1f mi b / s " , bandwidth m bs ( bytes read , select duration value ( ) ) ) ; } finally { cleanup with logger ( log , stream ) ; } log debug ( " statistics { } " , stream ) ; expected lines if present ( l - > { if ( l ! = lines read ) { throw exit exception ( exit fail , " expected % d rows but the operation returned % d " , l , lines read ) ; } } ) ; out flush ( ) ; return exit success ; }


simply queue the request , which will be processed in fifo order

public void process request ( request request ) { if ( ! finished ) { request upgrade request = null ; try { upgrade request = zks check upgrade session ( request ) ; } catch ( keeper exception ke ) { if ( request get hdr ( ) ! = null ) { request get hdr ( ) set type ( op code error ) ; request set txn ( new error txn ( ke code ( ) int value ( ) ) ) ; } request set exception ( ke ) ; log info ( " error creating upgrade request " , ke ) ; } catch ( i o exception ie ) { log error ( " unexpected error in upgrade " , ie ) ; } if ( upgrade request ! = null ) { queued requests add ( upgrade request ) ; } queued requests add ( request ) ; } }


return the number of rows that should have been affected

public int get expected rows affected ( ) { return this expected ; }


returns true if this reader will extract values in little endian , otherwise in big endian

public boolean is little endian ( ) { return converter instanceof little endian data converter ; }


sets the go to service to use when navigation is enabled on this table

public void install navigation ( go to service go to service , navigatable nav ) { if ( nav = = null ) { return ; } if ( this navigatable = = null ) { navigation key listener = new key adapter ( ) { @ override public void key pressed ( key event e ) { if ( e get key code ( ) = = key event vk enter ) { int selected row = get selected row ( ) ; int selected column = get selected column ( ) ; if ( selected row < 0 | | selected column < 0 ) { return ; } navigate ( selected row , selected column ) ; e consume ( ) ; } } } ; add key listener ( navigation key listener ) ; navigation mouse listener = new mouse adapter ( ) { @ override public void mouse released ( mouse event e ) { if ( e get click count ( ) = = 2 & & ! is editing ( ) ) { point point = e get point ( ) ; navigate ( row at point ( point ) , column at point ( point ) ) ; } } } ; add mouse listener ( navigation mouse listener ) ; navigation selection listener = new selection listener ( ) ; selection model add list selection listener ( navigation selection listener ) ; } this goto service = go to service ; this navigatable = nav ; }


set the character set to use when writing multipart data to encode file names encoding is based on the { @ code encoded - word } syntax defined in rfc 2047 and relies on { @ code mime utility } from { @ code javax mail } as of 5 0 by default part headers , including { @ code content - disposition } ( and its filename parameter ) will be encoded based on the setting of { @ link # set charset ( charset ) } or { @ code utf - 8 } by default

public void set multipart charset ( charset charset ) { this multipart charset = charset ; }


searches for a function by primary key , then pops up a table with the result ( or empty )

public static fid search result frame search by function i d ( long id , fid service service , fid query service fid query service ) { function record function record = fid query service get function by i d ( id ) ; return new fid search result frame ( string format ( " function id : 0x % x " , id ) , function record = = null ? new array list < function record > ( ) : new array list < function record > ( collections singleton list ( function record ) ) , service , fid query service ) ; }


public static long byte to long ( byte b ) { return int to long ( b & byte mask ) ; }


parses the specified string as a double - precision floating point value the ascii character { @ code ' - ' } ( < code > ' & # 92 ; u 0 0 2 d ' < code > ) is recognized as the minus sign unlike { @ link double # parse double ( string ) } , this method returns { @ code null } instead of throwing an exception if parsing fails valid inputs are exactly those accepted by { @ link double # value of ( string ) } , except that leading and trailing whitespace is not permitted this implementation is likely to be faster than { @ code double parse double } if many failures are expected

public static double try parse ( string string ) { if ( floating point pattern matcher ( string ) matches ( ) ) { / / todo ( lowasser ) : could be potentially optimized , but only with / / extensive testing try { return double parse double ( string ) ; } catch ( number format exception e ) { / / double parse double has changed specs several times , so fall through / / gracefully } } return null ; }


private static < t extends comparable < t > > void validate ( graph < t , null value , null value > graph , boolean include zero degree vertices , result result , float average degree , float density ) throws exception { result vertex metrics = new vertex metrics < t , null value , null value > ( ) set include zero degree vertices ( include zero degree vertices ) run ( graph ) execute ( ) ; assert equals ( result , vertex metrics ) ; assert equals ( average degree , vertex metrics get average degree ( ) , accuracy ) ; assert equals ( density , vertex metrics get density ( ) , accuracy ) ; }


test a m r m proxy restart with recovery

public void test recovery ( ) throws yarn exception , exception { configuration conf = create configuration ( ) ; / / use the mock request interceptor across restart instead for the chain conf set ( yarn configuration amrm proxy interceptor class pipeline , mock request interceptor across restart class get name ( ) ) ; mock r m = new mock resource manager facade ( new yarn configuration ( conf ) , 0 ) ; create and start a m r m proxy service ( conf ) ; int test app id 1 = 1 ; register application master response register response = register application master ( test app id 1 ) ; assert assert not null ( register response ) ; assert assert equals ( integer to string ( test app id 1 ) , register response get queue ( ) ) ; int test app id 2 = 2 ; register response = register application master ( test app id 2 ) ; assert assert not null ( register response ) ; assert assert equals ( integer to string ( test app id 2 ) , register response get queue ( ) ) ; allocate response allocate response = allocate ( test app id 2 ) ; assert assert not null ( allocate response ) ; / / at the time of kill , app 1 just register a m , app 2 already did one allocate / / both application should be recovered create and start a m r m proxy service ( conf ) ; assert assert true ( get a m r m proxy service ( ) get pipelines ( ) size ( ) = = 2 ) ; allocate response = allocate ( test app id 1 ) ; assert assert not null ( allocate response ) ; finish application master response finsh response = finish application master ( test app id 1 , final application status succeeded ) ; assert assert not null ( finsh response ) ; assert assert equals ( true , finsh response get is unregistered ( ) ) ; allocate response = allocate ( test app id 2 ) ; assert assert not null ( allocate response ) ; finsh response = finish application master ( test app id 2 , final application status succeeded ) ; assert assert not null ( finsh response ) ; assert assert equals ( true , finsh response get is unregistered ( ) ) ; int test app id 3 = 3 ; try { / / try to finish an application master that is not registered finish application master ( test app id 3 , final application status succeeded ) ; assert fail ( " the mock rm should complain about not knowing the third app " ) ; } catch ( throwable ex ) { } mock r m = null ; }


this sets the text that appears as the border title of this panel

void set title ( string conflict type ) { ( ( titled border ) get border ( ) ) set title ( " resolve " + conflict type + " conflict " ) ; }


given multiple n - grams producing the same hash , generate secondary hashes based on the each n - gram and its containing block , using the disambiguate strategy generate a histogram of secondary hashes and return it to the caller

private static tree map < hash , disambiguator entry > construct disambiguator tree ( hash entry entry , hash store store , disambiguate strategy strategy ) throws cancelled exception , memory access exception { tree map < hash , disambiguator entry > entry map = new tree map < hash , disambiguator entry > ( ) ; int match size = entry hash size ; for ( instruct hash cur instruct : entry inst list ) { array list < hash > hash list = strategy calc hashes ( cur instruct , match size , store ) ; iterator < hash > iter = hash list iterator ( ) ; while ( iter has next ( ) ) { hash cur hash = iter next ( ) ; disambiguator entry cur entry = entry map get ( cur hash ) ; if ( cur entry = = null ) { cur entry = new disambiguator entry ( cur hash , cur instruct ) ; entry map put ( cur hash , cur entry ) ; } else cur entry count + = 1 ; } } return entry map ; }


get the job ids of anomaly detector job tasks that do not have an assignment

public static set < string > unassigned job ids ( @ nullable persistent tasks custom metadata tasks , discovery nodes nodes ) { return unassigned job tasks ( tasks , nodes ) stream ( ) map ( task - > task get id ( ) substring ( job task id prefix length ( ) ) ) collect ( collectors to set ( ) ) ; }


gets the content sub text for the current media item see { @ link notification compat builder # set sub text ( char sequence ) }

default char sequence get current sub text ( player player ) { return null ; }


helper method to set password for the first http basic authentication

public void set password ( string password ) { for ( authentication auth : authentications values ( ) ) { if ( auth instanceof http basic auth ) { ( ( http basic auth ) auth ) set password ( password ) ; return ; } } throw new runtime exception ( " no http basic authentication configured ! " ) ; }


test that program diff can determine that function default stack params are different

public void test function default stack param diff ( ) throws exception { / / 0x 1 0 0 2cf 5 : created default stack param in p 2 int transaction i d = p 2 start transaction ( " test transaction " ) ; function function = p 2 get function manager ( ) get function at ( addr ( p 2 , 0x 1 0 0 2cf 5 ) ) ; variable var = new parameter impl ( " variable " , data type default , 0x 1c , p 2 ) ; function add parameter ( var , source type user defined ) ; p 2 end transaction ( transaction i d , true ) ; program diff = new program diff ( p 1 , p 2 ) ; program diff set filter ( new program diff filter ( program diff filter function diffs ) ) ; address set diff as = new address set ( ) ; diff as add range ( addr ( 0x 1 0 0 2cf 5 ) , addr ( 0x 1 0 0 2cf 5 ) ) ; assert equals ( diff as , program diff get differences ( program diff get filter ( ) , null ) ) ; }


wrapper of { @ link pl droidsonroids gif gif drawable # gif drawable ( android content res resources , int ) }

public t from ( resources resources , int resource id ) { m input source = new input source resources source ( resources , resource id ) ; return self ( ) ; }


deprecated , use { @ link # add drag ( drag edge , view ) }

public void set drag edges ( drag edge m drag edges ) { clear drag edge ( ) ; set drag edges ( arrays as list ( m drag edges ) ) ; }


load an instance from a file , then validate it

public static success data load ( file system fs , path path ) throws i o exception { log debug ( " reading success data from { } " , path ) ; success data instance = serializer ( ) load ( fs , path ) ; instance validate ( ) ; return instance ; }


delegates to { @ link test context manager # after test execution }

public void after test execution ( extension context context ) throws exception { object test instance = context get required test instance ( ) ; method test method = context get required test method ( ) ; throwable test exception = context get execution exception ( ) or else ( null ) ; get test context manager ( context ) after test execution ( test instance , test method , test exception ) ; }


verify a view fs wrapped over multiple federated name nodes will dispatch the acl operations to the correct name node

public void test acl on mount entry ( ) throws exception { / / set a c ls on the first namespace and verify they are correct list < acl entry > acl spec = lists new array list ( acl entry ( access , user , read write ) , acl entry ( access , user , " foo " , read ) , acl entry ( access , group , read ) , acl entry ( access , other , none ) ) ; fs view set acl ( mount on nn 1 , acl spec ) ; acl entry [ ] expected = new acl entry [ ] { acl entry ( access , user , " foo " , read ) , acl entry ( access , group , read ) } ; assert array equals ( expected , acl entry array ( fs view get acl status ( mount on nn 1 ) ) ) ; / / double - check by getting acl status using file system / / instead of view fs assert array equals ( expected , acl entry array ( f hdfs get acl status ( target test root ) ) ) ; / / modify the acl entries on the first namespace acl spec = lists new array list ( acl entry ( default , user , " foo " , read ) ) ; fs view modify acl entries ( mount on nn 1 , acl spec ) ; expected = new acl entry [ ] { acl entry ( access , user , " foo " , read ) , acl entry ( access , group , read ) , acl entry ( default , user , read write ) , acl entry ( default , user , " foo " , read ) , acl entry ( default , group , read ) , acl entry ( default , mask , read ) , acl entry ( default , other , none ) } ; assert array equals ( expected , acl entry array ( fs view get acl status ( mount on nn 1 ) ) ) ; fs view remove default acl ( mount on nn 1 ) ; expected = new acl entry [ ] { acl entry ( access , user , " foo " , read ) , acl entry ( access , group , read ) } ; assert array equals ( expected , acl entry array ( fs view get acl status ( mount on nn 1 ) ) ) ; assert array equals ( expected , acl entry array ( f hdfs get acl status ( target test root ) ) ) ; / / paranoid check : verify the other namespace does not / / have a c ls set on the same path assert equals ( 0 , fs view get acl status ( mount on nn 2 ) get entries ( ) size ( ) ) ; assert equals ( 0 , f hdfs 2 get acl status ( target test root 2 ) get entries ( ) size ( ) ) ; / / remove the acl entries on the first namespace fs view remove acl ( mount on nn 1 ) ; assert equals ( 0 , fs view get acl status ( mount on nn 1 ) get entries ( ) size ( ) ) ; assert equals ( 0 , f hdfs get acl status ( target test root ) get entries ( ) size ( ) ) ; / / now set a c ls on the second namespace acl spec = lists new array list ( acl entry ( access , user , " bar " , read ) ) ; fs view modify acl entries ( mount on nn 2 , acl spec ) ; expected = new acl entry [ ] { acl entry ( access , user , " bar " , read ) , acl entry ( access , group , read execute ) } ; assert array equals ( expected , acl entry array ( fs view get acl status ( mount on nn 2 ) ) ) ; assert array equals ( expected , acl entry array ( f hdfs 2 get acl status ( target test root 2 ) ) ) ; / / remove the acl entries on the second namespace fs view remove acl entries ( mount on nn 2 , lists new array list ( acl entry ( access , user , " bar " , read ) ) ) ; expected = new acl entry [ ] { acl entry ( access , group , read execute ) } ; assert array equals ( expected , acl entry array ( f hdfs 2 get acl status ( target test root 2 ) ) ) ; fs view remove acl ( mount on nn 2 ) ; assert equals ( 0 , fs view get acl status ( mount on nn 2 ) get entries ( ) size ( ) ) ; assert equals ( 0 , f hdfs 2 get acl status ( target test root 2 ) get entries ( ) size ( ) ) ; }


set the tool option ( ghidra options option docking windows on top ) for whether a docked window will always be shown on top of its parent window

public void set windows on top ( boolean b ) { win mgr set windows on top ( b ) ; }


replace an existing value with a new value ; updates the element list and the hash table , but not the key as that has not changed

public t set ( int i , t value ) { t old element = elements get ( i ) ; elements set ( i , value ) ; / / update list super remove ( old element ) ; / / now update the set : remove / add super add ( value ) ; return old element ; }


determine the connection synchronization order to use for the given { @ link connection factory } decreased for every level of nesting that a { @ link connection factory } has , checked through the level of { @ link delegating connection factory } nesting

private static int get connection synchronization order ( connection factory connection factory ) { int order = connection synchronization order ; connection factory current = connection factory ; while ( current instanceof delegating connection factory ) { order - - ; current = ( ( delegating connection factory ) current ) get target connection factory ( ) ; } return order ; }


shuts down this transport and cancels all streams that it owns , hence immediately terminates this transport

public final void shutdown now ( status status ) { shutdown ( status ) ; collection < pending stream > saved pending streams ; runnable saved report transport terminated ; synchronized ( lock ) { saved pending streams = pending streams ; saved report transport terminated = report transport terminated ; report transport terminated = null ; if ( ! pending streams is empty ( ) ) { pending streams = collections empty list ( ) ; } } if ( saved report transport terminated ! = null ) { for ( pending stream stream : saved pending streams ) { stream cancel ( status ) ; } sync context execute ( saved report transport terminated ) ; } / / if saved report transport terminated = = null , transport terminated ( ) has already been called in / / shutdown ( ) }


gets the number of elements in this list

public final int size ( ) { return arr length ; }


convenience method handling all { @ code null } checks provides the path on the ( possible ) remote settings file

public static file path get settings file path ( global settings provider settings , abstract build < ? , ? > build , task listener listener ) { file path settings path = null ; if ( settings ! = null ) { settings path = settings supply settings ( build , listener ) ; } return settings path ; }


sets the < code > t < code > - converted - to - < code > w < code > type in the delegate editor { @ inherit doc }

public void set value ( column constraint < t > value ) { / / this is safe because the constraint and editor were created together and this / / is guaranteed to be safe @ suppress warnings ( " unchecked " ) mapped column constraint < t , m > new constraint = ( mapped column constraint < t , m > ) value ; delegate editor set value ( new constraint get delegate ( ) ) ; }


get the data sent to the node manager via { @ link container management protocol # start containers ( start containers request ) } as part of { @ link container launch context # get service data ( ) }

public byte buffer get application data for service ( ) { return this app data for service ; }


this method uses reflection to determine if the two < code > object < code > s are equal it uses < code > accessible object set accessible < code > to gain access to private fields this means that it will throw a security exception if run under a security manager , if the permissions are not set up correctly it is also not as efficient as testing explicitly if the test transients parameter is set to < code > true < code > , transient members will be tested , otherwise they are ignored , as they are likely derived fields , and not part of the value of the < code > object < code > static fields will not be tested superclass fields will be included

public static boolean reflection equals ( object lhs , object rhs , boolean test transients ) { return reflection equals ( lhs , rhs , test transients , null , null ) ; }


visual v m calls this to dynamically add things to the classpath note : it is not required to be public

private void append to class path for instrumentation ( string path ) { add path ( path ) ; }


returns the number of started ssltls handshakes in client mode

public long connect ( ) { lock reader lock = context ctx lock read lock ( ) ; reader lock lock ( ) ; try { return s s l context session connect ( context ctx ) ; } finally { reader lock unlock ( ) ; } }


returns the { @ link http 2 connection }

protected http 2 connection connection ( ) { return connection ; }


public final cancellable exists source async ( get source request get source request , request options options , action listener < boolean > listener ) { return perform request async ( get source request , request converters : : source exists , options , rest high level client : : convert exists response , listener , empty set ( ) ) ; }


gets whether the degrees option is set by default , the degrees option is not set

public boolean is opt degrees ( ) { return opt degrees ; }


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

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


public static float read float l e ( byte [ ] arr , int offset ) { return float int bits to float ( read int l e ( arr , offset ) ) ; }


set final headers and fire a channel read event

protected void fire channel read ( channel handler context ctx , full http message msg , boolean release , http 2 stream stream ) { remove message ( stream , release ) ; http util set content length ( msg , msg content ( ) readable bytes ( ) ) ; ctx fire channel read ( msg ) ; }


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


constructs an immutable instance which is the combination of the given instance with the given additional annotation the latter ' s type must not already appear in the former

public static annotations combine ( annotations annotations , annotation annotation ) { annotations result = new annotations ( ) ; result add all ( annotations ) ; result add ( annotation ) ; result set immutable ( ) ; return result ; }


returns a binding builder used to add a new entry in the map each key must be distinct ( and non - null ) bound providers will be evaluated each time the map is injected it is an error to call this method without also calling one of the { @ code to } methods on the returned binding builder scoping elements independently is supported use the { @ code in } method to specify a binding scope

public abstract linked binding builder < v > add binding ( k key ) ;


xml external entities attacks benefit from an xml feature to build documents dynamically at the time of processing an xml entity allows inclusion of data dynamically from a given resource external entities allow an xml document to include data from an external uri unless configured to do otherwise , external entities force the xml parser to access the resource specified by the uri , e g , a file on the local machine or remote system this behavior exposes the application to xml external entity ( xxe ) attacks normally , a custom entity resolver implementing org xml sax entity resolver should not return null as it will then default to the sax entity resolver that allows and resolves external entities this test ensures external entities are ignored whether or not a default sax entity resolver is used using the threaded xml pull parser impl constructor which takes an input stream ( rather than resource file ) will use a default entity resolver the xml utilities create secure s a x parser factory factory configurations will disable external entities regardless of which entity resolver is used

public void test x x e xml ( ) throws exception { / / create file with contents string file contents = " foobar " ; file xxe file = create temp file for test ( ) ; files write ( xxe file to path ( ) , file contents get bytes ( ) ) ; / / place file path in xml entity string xxe xml = xxe xml replace ( " @ temp file @ " , xxe file get path ( ) ) ; / / this constructor will use a default entity resolver threaded xml pull parser impl parser = new threaded xml pull parser impl ( new byte array input stream ( xxe xml get bytes ( ) ) , test name get method name ( ) , new test error handler ( ) , false , 3 ) ; parser start ( " foo " ) ; xml element x 1 = parser next ( ) ; assert false ( " file contents ( external entity ) should not be in xml " , x 1 get text ( ) contains ( file contents ) ) ; }


b context path ( string context path ) ;


copy block references into the snapshot up to the current { @ link # file size } should be done only once

public void set blocks ( block info [ ] blocks ) { if ( this blocks ! = null ) return ; int num blocks = 0 ; for ( long s = 0 ; num blocks < blocks length & & s < file size ; num blocks + + ) s + = blocks [ num blocks ] get num bytes ( ) ; this blocks = arrays copy of ( blocks , num blocks ) ; }


returns all deps of a node that has not yet finished evaluating in other words , if a node has a reverse dep on this node , its key will be in the returned set here if this node was freshly created , this is just any elements that were added using { @ link # add temporary direct deps } ( so it is the same as { @ link # get temporary direct deps } ) if this node is marked dirty , this includes all the elements that would have been returned by successive calls to { @ link # get next dirty direct deps } ( or , equivalently , one call to { @ link # get all remaining dirty direct deps } ) this method should only be called when this node is about to be deleted after an aborted evaluation after such an evaluation , any nodes that did not finish evaluating are deleted , as are any nodes that depend on them , which are necessarily also not done if this node is to be deleted because of this , we must delete it as a reverse dep from other nodes this method returns that list of other nodes this method may not be called on done nodes , since they do not need to be deleted after aborted evaluations this method must not be called twice : the next thing done to this node after this method is called should be the removal of the node from the graph

iterable < sky key > get all direct deps for incomplete node ( ) throws interrupted exception ;


if consuming failure , message will be send back to the broker , and delay consuming in some time later < br > mind ! message can only be consumed in the same group

void send message back ( message ext msg , int delay level , string broker name , string consumer group ) throws remoting exception , m q broker exception , interrupted exception , m q client exception ;


maps legacy int configs to new config objects

private static object map config ( block block , int value , int position ) { if ( block instanceof sorter | | block instanceof unloader | | block instanceof item source ) return content item ( value ) ; if ( block instanceof liquid source ) return content liquid ( value ) ; if ( block instanceof mass driver | | block instanceof item bridge ) return point 2 unpack ( value ) sub ( point 2 x ( position ) , point 2 y ( position ) ) ; if ( block instanceof light block ) return value ; return null ; }


this method is called when ' finish ' button is pressed in the wizard we will create an operation and run it using wizard as execution context

public boolean perform finish ( ) { data source descriptor ds copy = new data source descriptor ( original data source , original data source get registry ( ) ) ; data source descriptor ds changed = new data source descriptor ( data source , data source get registry ( ) ) ; save settings ( ds changed ) ; if ( ds copy equal settings ( ds changed ) ) { / / no changes return true ; } / / check locked datasources if ( ! common utils is empty ( data source get lock password hash ( ) ) ) { if ( data source get project ( ) get secure storage ( ) use secure preferences ( ) & & ! is only user credential changed ( ds copy , ds changed ) ) { if ( ! check lock password ( ) ) { return false ; } } } / / save save settings ( original data source ) ; original data source get registry ( ) update data source ( original data source ) ; if ( original data source is connected ( ) ) { if ( u i utils confirm action ( get shell ( ) , core messages dialog connection edit wizard conn change title , nls bind ( core messages dialog connection edit wizard conn change question , original data source get name ( ) ) ) ) { data source handler reconnect data source ( null , original data source ) ; } } return true ; }


gets the { @ link maven installation } associated with the project can be null if the maven installation can not be uniquely determined , it ' s often better to return just one of them , rather than returning null , since this method is currently ultimately only used to decide where to parse { @ code confsettings xml } from

maven installation infer maven installation ( ) ;


public long generate seq no ( ) { return next seq no get and increment ( ) ; }


private synchronized closeable reference < v > new client reference ( final entry < k , v > entry ) { increase counters ( entry ) ; return closeable reference of ( entry value ref get ( ) , new resource releaser < v > ( ) { @ override public void release ( v unused ) { release client reference ( entry ) ; } } ) ; }


indicates that the caller will pump { @ code stdout } from the child process via { @ link proc # get stdout ( ) } ( whereas by default you call { @ link # stdout ( output stream ) } and let jenkins pump stdout into your { @ link output stream } of choosing when this method is called , { @ link proc # get stdout ( ) } will read the combined output of { @ code stdoutstderr } from the child process , unless { @ link # read stderr ( ) } is called separately , which lets the caller read those two streams separately

public proc starter read stdout ( ) { reverse stdout = true ; stdout = stderr = null ; return this ; }


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


maps a filter to be executed after any matching routes

public void after ( string path , filter filter ) { add filter ( http method after , filter impl create ( path , filter ) ) ; }


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


add mapper ( the first mapper ) that reads input from the input context and writes to queue

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


gets the fallback " unknown " user instance this is used to avoid null { @ link user } instance

public static @ non null user get unknown ( ) { return get by id ( unknown username , true ) ; }


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


true if this column contains any null values

public boolean contains null ( ) { return get null count ( ) > 0l ; }


creates a random string whose length is the number of characters specified characters will be chosen from the set of latin alphabetic characters ( a - z , a - z )

public static string random alphabetic ( final int count ) { return random ( count , true , false ) ; }


when a dead node is put to maintenance , it transitions directly to admin states in maintenance then admin states in maintenance expires and transitions to admin states normal

public void test put dead node to maintenance with expiration ( ) throws exception { log info ( " starting test put dead node to maintenance with expiration " ) ; final path file = new path ( " / test put dead node to maintenance with expiration dat " ) ; start cluster ( 1 , 1 ) ; file system file sys = get cluster ( ) get file system ( 0 ) ; f s namesystem ns = get cluster ( ) get namesystem ( 0 ) ; write file ( file sys , file , 1 , 1 ) ; mini d f s cluster data node properties dn prop = get cluster ( ) stop data node ( 0 ) ; d f s test util wait for datanode state ( get cluster ( ) , dn prop datanode get datanode uuid ( ) , false , 20000 ) ; int dead in maintenance = ns get num in maintenance dead data nodes ( ) ; int live in maintenance = ns get num in maintenance live data nodes ( ) ; datanode info node outof service = take node outof service ( 0 , dn prop datanode get datanode uuid ( ) , long max value , null , admin states in maintenance ) ; / / adjust the expiration take node outof service ( 0 , node outof service get datanode uuid ( ) , time now ( ) + expiration in ms , null , admin states normal ) ; / / no change assert equals ( dead in maintenance , ns get num in maintenance dead data nodes ( ) ) ; assert equals ( live in maintenance , ns get num in maintenance live data nodes ( ) ) ; cleanup file ( file sys , file ) ; }


public void add slow disk for testing ( string slow disk path , map < disk op , double > latencies ) { override status = false ; if ( latencies = = null ) { disk outliers stats put ( slow disk path , immutable map of ( ) ) ; } else { disk outliers stats put ( slow disk path , latencies ) ; } }


public void reset n m heartbeat receive flag ( ) { synchronized ( resource tracker for attributes class ) { received n m heartbeat = false ; } }


sets the compression method for this entry to either { @ code deflated } or { @ code stored } the default is { @ code deflated } , which will cause the size , compressed size , and crc to be set automatically , and the entry ' s data to be compressed if you switch to { @ code stored } note that you ' ll have to set the size ( or compressed size ; they must be the same , but it ' s okay to only set one ) and crc yourself because they must appear before the user data in the resulting zip file see { @ link # set size } and { @ link # set crc }

public void set method ( int value ) { if ( value ! = stored & & value ! = deflated ) { throw new illegal argument exception ( " bad method : " + value ) ; } compression method = value ; }


enables integrating hamcrest matchers that match primitive < code > float < code > arguments note that { @ link # arg that } will not work with primitive < code > float < code > matchers due to < code > null pointer exception < code > auto - unboxing caveat < p > see examples in javadoc for { @ link mockito hamcrest } class

public static float float that ( matcher < float > matcher ) { report matcher ( matcher ) ; return 0 ; }


use from a { @ link job # make search index } override

public final search index builder extend search index ( search index builder sib ) { if ( as job ( ) is buildable ( ) & & as job ( ) has permission ( item build ) ) { sib add ( " build " , " build " ) ; } return sib ; }


reads a timers snapshot from the provided input view

internal timers snapshot < k , n > read timers snapshot ( data input view in ) throws i o exception ;


removes obsolete elements from names and shared elements

private void remove obsolete elements ( list < string > names , map < string , view > shared elements , list < string > elements to remove ) { if ( elements to remove size ( ) > 0 ) { names remove all ( elements to remove ) ; for ( string element to remove : elements to remove ) { shared elements remove ( element to remove ) ; } } }


get the jenkins version from which the plugin was detached

public version number get split when ( ) { return split when ; }


variant of { @ link # to entity flux ( class ) } with a { @ link body extractor }

< t > mono < response entity < flux < t > > > to entity flux ( body extractor < flux < t > , ? super client http response > body extractor ) ;


returns the height of the node as calculated for layout a subclass may override and increase the returned height to create a blank space in the tree above the node , eg for a separator

public float get height ( ) { return height ; }


removes all headers with the specified { @ code name }


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


sets the current generation stamp for legacy blocks

public void set legacy generation stamp ( long stamp ) { legacy generation stamp set current value ( stamp ) ; }


private static void check env name ( string env name ) { if ( env name = = null | | env name index of ( ' ' ) ! = - 1 ) { throw new illegal argument exception ( " env name " + env name + " is null or has dot which is not valid " ) ; } }


returns the number of items that the estimator has processed

synchronized public long get count ( ) { return count ; }