lookup returns a target for a single key

public io grpc lookup v 1 route lookup response route lookup ( io grpc lookup v 1 route lookup request request ) { return io grpc stub client calls blocking unary call ( get channel ( ) , get route lookup method ( ) , get call options ( ) , request ) ; }


the call is considered complete and { @ link # on cancel } is guaranteed not to be called however , the client is not guaranteed to have received all messages there will be no further callbacks for the call


the predecessors of this node within a sub - topology note , sources do not have any predecessors will never be { @ code null }


public object get ( ) { return value ; }


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


protected static assembly resolution solve or backfill ( pattern expression exp , masked long goal , map < string , long > vals , map < integer , object > res , assembly resolved constructor cur , string description ) { try { return solver solve ( exp , goal , vals , res , cur , description ) ; } catch ( needs backfill exception bf ) { int field length = solver get instruction length ( exp , res ) ; return assembly resolution backfill ( exp , goal , res , field length , description ) ; } }


public local date text field get date field ( ) { return date text field ; }


the capacity of the data structure to hold entries

public long get buffer size ( ) { return ring buffer get buffer size ( ) ; }


returns the extended tcp keepinterval socket option , if available on this jdk

public static socket option < integer > get tcp keep interval socket option or null ( ) { return get extended socket option or null ( " tcp keepinterval " ) ; }


this method is called in a finally block after successful execution or on a rejection

public void on after ( ) { / / nothing by default }


resolve the id for the supplied { @ link bean definition } when using { @ link # should generate id generation } , a name is generated automatically otherwise , the id is extracted from the " id " attribute , potentially with a { @ link # should generate id as fallback ( ) fallback } to a generated id

protected string resolve id ( element element , abstract bean definition definition , parser context parser context ) throws bean definition store exception { if ( should generate id ( ) ) { return parser context get reader context ( ) generate bean name ( definition ) ; } else { string id = element get attribute ( id attribute ) ; if ( ! string utils has text ( id ) & & should generate id as fallback ( ) ) { id = parser context get reader context ( ) generate bean name ( definition ) ; } return id ; } }


see { @ link script template configurer # set resource loader path ( string ) } documentation

public void set resource loader path ( string resource loader path ) { string [ ] paths = string utils comma delimited list to string array ( resource loader path ) ; this resource loader paths = new string [ paths length + 1 ] ; this resource loader paths [ 0 ] = " " ; for ( int i = 0 ; i < paths length ; i + + ) { string path = paths [ i ] ; if ( ! path ends with ( " / " ) & & ! path ends with ( " : " ) ) { path = path + " / " ; } this resource loader paths [ i + 1 ] = path ; } }


manipulate this request ' s cookies with the given consumer the map provided to the consumer is " live " , so that the consumer can be used to { @ linkplain multi value map # set ( object , object ) overwrite } existing header values , { @ linkplain multi value map # remove ( object ) remove } values , or use any of the other { @ link multi value map } methods

s cookies ( consumer < multi value map < string , string > > cookies consumer ) ;


convert the source object of type { @ code s } to target type { @ code t }


set an animation listener that is notified for various animation events

public void set animation listener ( @ nullable animation listener animation listener ) { m animation listener = animation listener ! = null ? animation listener : no op listener ; }


deserialize the given bytes returned by { @ link # serialize split assignments ( map , simple versioned serializer ) }

public static < split t extends source split , c extends collection < split t > > map < integer , c > deserialize split assignments ( byte [ ] serialized , simple versioned serializer < split t > split serializer , function < integer , c > collection supplier ) throws i o exception { try ( byte array input stream bais = new byte array input stream ( serialized ) ; data input stream in = new data input stream ( bais ) ) { int num subtasks = in read int ( ) ; map < integer , c > splits assignments = new hash map < > ( num subtasks ) ; int serializer version = in read int ( ) ; for ( int i = 0 ; i < num subtasks ; i + + ) { int subtask id = in read int ( ) ; int num assigned splits = in read int ( ) ; c assigned splits = collection supplier apply ( num assigned splits ) ; for ( int j = 0 ; j < num assigned splits ; j + + ) { int serialized split size = in read int ( ) ; byte [ ] serialized split = new byte [ serialized split size ] ; in read fully ( serialized split ) ; split t split = split serializer deserialize ( serializer version , serialized split ) ; assigned splits add ( split ) ; } splits assignments put ( subtask id , assigned splits ) ; } return splits assignments ; } }


adds a field reference to the constant pool of the class being build does nothing if the constant pool already contains a similar item this method is intended for { @ link attribute } sub classes , and is normally not needed by class generators or adapters

public int new field ( final string owner , final string name , final string descriptor ) { return symbol table add constant fieldref ( owner , name , descriptor ) index ; }


public static double sum squared diff ( vector vec 1 , vector vec 2 ) { if ( vec 1 instanceof dense vector ) { if ( vec 2 instanceof dense vector ) { return mat vec op apply sum ( ( dense vector ) vec 1 , ( dense vector ) vec 2 , ( a , b ) - > ( a - b ) * ( a - b ) ) ; } else { return mat vec op apply sum ( ( dense vector ) vec 1 , ( sparse vector ) vec 2 , ( a , b ) - > ( a - b ) * ( a - b ) ) ; } } else { if ( vec 2 instanceof dense vector ) { return mat vec op apply sum ( ( sparse vector ) vec 1 , ( dense vector ) vec 2 , ( a , b ) - > ( a - b ) * ( a - b ) ) ; } else { return mat vec op apply sum ( ( sparse vector ) vec 1 , ( sparse vector ) vec 2 , ( a , b ) - > ( a - b ) * ( a - b ) ) ; } } }


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


transform all annotations on a single type , member or parameter

private void transform annotation set ( index map index map , dex section set in ) { contents out annotation sets size + + ; annotation set out assert four byte aligned ( ) ; index map put annotation set offset ( set in get position ( ) , annotation set out get position ( ) ) ; int size = set in read int ( ) ; annotation set out write int ( size ) ; for ( int j = 0 ; j < size ; j + + ) { annotation set out write int ( index map adjust annotation ( set in read int ( ) ) ) ; } }


removes a global { @ link controller listener } the method must be called on the rendering thread

static public void remove listener ( controller listener listener ) { initialize ( ) ; get manager ( ) remove listener ( listener ) ; }


returns the supported api versions that this request supports

default collection < rest a p i version > get supported a p i versions ( ) { return collections singleton ( rest a p i version v1 ) ; }


assert that a collection contains elements ; that is , it must not be { @ code null } and must contain at least one element

public static void not empty ( @ nullable collection < ? > collection ) { not empty ( collection , " [ assertion failed ] - this collection must not be empty : it must contain at least 1 element " ) ; }


collect environment info with details on the java and os deployment versions

private string collect environment info ( final environment environment , final class < ? > source class ) { val properties = system get properties ( ) ; if ( properties contains key ( " cas banner skip " ) ) { try ( val formatter = new formatter ( ) ) { formatter format ( " cas version : % s % n " , cas version get version ( ) ) ; return formatter to string ( ) ; } } try ( val formatter = new formatter ( ) ) { val sys info = system utils get system info ( ) ; sys info for each ( ( k , v ) - > { if ( k starts with ( separator char ) ) { formatter format ( " % s % n " , line separator ) ; } else { formatter format ( " % s : % s % n " , k , v ) ; } } ) ; formatter format ( " % s % n " , line separator ) ; inject environment info into banner ( formatter , environment , source class ) ; return formatter to string ( ) ; } }


returns a new { @ link fake data } with the given { @ code uri }

public fake data new data ( string uri ) { return new data ( uri parse ( uri ) ) ; }


creates a mutable , empty { @ code linked hash set } instance < b > note : < b > if mutability is not required , use { @ link immutable set # of ( ) } instead < b > note for java 7 and later : < b > this method is now unnecessary and should be treated as deprecated instead , use the { @ code linked hash set } constructor directly , taking advantage of the new < a href = " http : goo gliz 2 wi " > " diamond " syntax

public static < e > linked hash set < e > new linked hash set ( ) { return new linked hash set < e > ( ) ; }


public list < big decimal > get array number ( ) { return array number ; }


ensures parity in the performance of sequential read after reverse seek for version 2 of the block blob input stream

public void test 0316 sequential read after reverse seek performance v 2 ( ) throws i o exception { assume huge file exists ( ) ; final int max attempts = 10 ; final double max acceptable ratio = 1 01 ; double before seek elapsed ms = 0 , after seek elapsed ms = 0 ; double ratio = double max value ; for ( int i = 0 ; i < max attempts & & ratio > = max acceptable ratio ; i + + ) { before seek elapsed ms = sequential read ( 2 , account using input stream v 2 get file system ( ) , false ) ; after seek elapsed ms = sequential read ( 2 , account using input stream v 2 get file system ( ) , true ) ; ratio = after seek elapsed ms / before seek elapsed ms ; log info ( string format ( " before seek elapsed ms = % 1 $ d , after seek elapsed ms = % 2 $ d , ratio = % 3 $ 2f " , ( long ) before seek elapsed ms , ( long ) after seek elapsed ms , ratio ) ) ; } assert true ( string format ( " performance of version 2 after reverse seek is not acceptable : " + " before seek elapsed ms = % 1 $ d , after seek elapsed ms = % 2 $ d , " + " ratio = % 3 $ 2f " , ( long ) before seek elapsed ms , ( long ) after seek elapsed ms , ratio ) , ratio < max acceptable ratio ) ; }


this create a test case in which two threads are trying to load two different jobs of the same user under the intermediate directory one thread should not be blocked by the other thread that is loading a huge job files ( this is simulated by hanging up parsing the job files forever ) the test will fail by triggering the timeout if one thread is blocked by the other while the other thread is holding the lock on its associated job files and hanging up parsing the files

public void test two threads querying different job of same user ( ) throws interrupted exception , i o exception { final configuration config = new configuration ( ) ; config set ( j h admin config mr history intermediate done dir , intermediate dir get path ( ) ) ; config set long ( j h admin config mr history max age ms , long max value ) ; final job id job 1 = create job id ( 0 ) ; final job id job 2 = create job id ( 1 ) ; final history file manager under contention history file manager = create history file manager ( config , job 1 , job 2 ) ; thread web request 1 = null ; thread web request 2 = null ; try { / * * * create a dummy jhist file for job 1 , and try to load / parse the job * files in one child thread * / create jhist file ( job 1 ) ; web request 1 = new thread ( new runnable ( ) { @ override public void run ( ) { try { history file manager history file info history file info = history file manager get file info ( job 1 ) ; history file info load job ( ) ; } catch ( i o exception e ) { e print stack trace ( ) ; } } } ) ; web request 1 start ( ) ; history file manager wait until intermediate dir is scanned ( job 1 ) ; / * * * at this point , thread web request 1 has finished scanning the * intermediate directory and is hanging up parsing the job files while * it ' s holding the lock on the associated history file info object * / / * * * create a dummy jhist file for job 2 and try to load / parse the job files * in the other child thread because job files are not moved from the * intermediate directory to the done directory , thread web request 2 * will also see the job history files for job 1 * / create jhist file ( job 2 ) ; web request 2 = new thread ( new runnable ( ) { @ override public void run ( ) { try { history file manager history file info history file info = history file manager get file info ( job 2 ) ; history file info load job ( ) ; } catch ( i o exception e ) { e print stack trace ( ) ; } } } ) ; web request 2 start ( ) ; history file manager wait until intermediate dir is scanned ( job 2 ) ;


maps a range to a specified value ( optional operation ) specifically , after a call to { @ code put ( range , value ) } , if { @ link range # contains ( comparable ) range contains ( k ) } , then { @ link # get ( comparable ) get ( k ) } will return { @ code value } if { @ code range } { @ linkplain range # is empty ( ) is empty } , then this is a no - op

void put ( range < k > range , v value ) ;


public v peek value ( ) { return values [ size - 1 ] ; }


selects the items at the given zero - relative indices in the receiver the current selection is not cleared before the new items are selected < p > if the item at a given index is not selected , it is selected if the item at a given index was already selected , it remains selected indices that are out of range and duplicate indices are ignored if the receiver is single - select and multiple indices are specified , then all indices are ignored < p > if cell selection is enabled , all cells within the given indices are selected

public void select ( int [ ] indices ) { check widget ( ) ; if ( indices = = null ) { swt error ( swt error null argument ) ; return ; } if ( selection type = = swt single & & indices length > 1 ) return ; for ( int j : indices ) { if ( j > = 0 & & j < get item count ( ) ) { select cells ( get cells ( j ) ) ; } } redraw ( ) ; }


public cst base method ref get method ref ( ) { return ( cst base method ref ) get ref ( ) ; }


this returns the acyclic dependency list ( broken at structs and pointers to structs )

public array list < data type > get dependency list ( ) { if ( processed = = false ) { process dependency lists ( ) ; } return ordered dependents list ; }


register a listener that will be called when this model is bound to 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 base model view model on bind ( on model bound listener < base model view model , base model view > listener ) { on mutation ( ) ; this on model bound listener epoxy generated model = listener ; return this ; }


private static void decode hanzi segment ( bit source bits , string builder result , int count ) throws format exception { / / don ' t crash trying to read more bits than we have available if ( count * 13 > bits available ( ) ) { throw format exception get format instance ( ) ; } / / each character will require 2 bytes read the characters as 2 - byte pairs / / and decode as gb2312 afterwards byte [ ] buffer = new byte [ 2 * count ] ; int offset = 0 ; while ( count > 0 ) { / / each 13 bits encodes a 2 - byte character int two bytes = bits read bits ( 13 ) ; int assembled two bytes = ( ( two bytes / 0x 0 6 0 ) < < 8 ) | ( two bytes % 0x 0 6 0 ) ; if ( assembled two bytes < 0x 0 0 a 0 0 ) { / / in the 0x a 1 a 1 to 0x a a f e range assembled two bytes + = 0x 0 a 1 a 1 ; } else { / / in the 0x b 0 a 1 to 0x f a f e range assembled two bytes + = 0x 0 a 6 a 1 ; } buffer [ offset ] = ( byte ) ( ( assembled two bytes > > 8 ) & 0x f f ) ; buffer [ offset + 1 ] = ( byte ) ( assembled two bytes & 0x f f ) ; offset + = 2 ; count - - ; } result append ( new string ( buffer , string utils gb2312 charset ) ) ; }


return the original category for the composite data type being viewed

public final category get original category ( ) { data type manager original d t m = get original data type manager ( ) ; if ( original data type path ! = null & & original d t m ! = null ) { category path original category path = original data type path get category path ( ) ; if ( original d t m contains category ( original category path ) ) { return original d t m get category ( original category path ) ; } } return null ; }


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


public just symbol enum get just symbol ( ) { return just symbol ; }


tests that manual hash assignments are mapped to the same operator id - > [ ( map ) ] - > [ ( sink ) @ sink 0 ] [ ( src @ source ) ] - + \ - > [ ( map ) ] - > [ ( sink ) @ sink 1 ] - > [ ( map ) ] - > [ ( reduce ) ] - > [ ( sink ) @ sink 0 ] [ ( src ) @ source ] - + \ - > [ ( map ) ] - > [ ( reduce ) ] - > [ ( sink ) @ sink 1 ]

public void test manual hash assignment ( ) throws exception { stream execution environment env = stream execution environment create local environment ( ) ; env set parallelism ( 4 ) ; env disable operator chaining ( ) ; data stream < string > src = env add source ( new no op source function ( ) ) name ( " source " ) uid ( " source " ) ; src map ( new no op map function ( ) ) add sink ( new discarding sink < > ( ) ) name ( " sink 0 " ) uid ( " sink 0 " ) ; src map ( new no op map function ( ) ) add sink ( new discarding sink < > ( ) ) name ( " sink 1 " ) uid ( " sink 1 " ) ; job graph job graph = env get stream graph ( ) get job graph ( ) ; set < job vertex i d > ids = new hash set < > ( ) ; for ( job vertex vertex : job graph get vertices ( ) ) { assert true ( ids add ( vertex get i d ( ) ) ) ; } / / resubmit a slightly different program env = stream execution environment create local environment ( ) ; env set parallelism ( 4 ) ; env disable operator chaining ( ) ; src = env add source ( new no op source function ( ) ) / / new map function , should be mapped to the source state map ( new no op map function ( ) ) name ( " source " ) uid ( " source " ) ; src map ( new no op map function ( ) ) key by ( new no op key selector ( ) ) reduce ( new no op reduce function ( ) ) add sink ( new discarding sink < > ( ) ) name ( " sink 0 " ) uid ( " sink 0 " ) ; src map ( new no op map function ( ) ) key by ( new no op key selector ( ) ) reduce ( new no op reduce function ( ) ) add sink ( new discarding sink < > ( ) ) name ( " sink 1 " ) uid ( " sink 1 " ) ; job graph new job graph = env get stream graph ( ) get job graph ( ) ; assert not equals ( job graph get job i d ( ) , new job graph get job i d ( ) ) ; for ( job vertex vertex : new job graph get vertices ( ) ) { / / verify that the expected i ds are the same if ( vertex get name ( ) ends with ( " source " ) | | vertex get name ( ) ends with ( " sink 0 " ) | | vertex get name ( ) ends with ( " sink 1 " ) ) { assert true ( ids contains ( vertex get i d ( ) ) ) ; } } }


returns true if this dialog remembers its location from one invocation to the next

public boolean get remember location ( ) { return remember location ; }


return the underlying { @ link path matcher } delegate

public path matcher get path matcher ( ) { return this path matcher ; }


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


assert that a file system list status on a dir finds the subdirchild entry

public static void assert list status finds ( file system fs , path dir , path subdir ) throws i o exception { file status [ ] stats = fs list status ( dir ) ; boolean found = false ; string builder builder = new string builder ( ) ; for ( file status stat : stats ) { builder append ( stat to string ( ) ) append ( ' \ n ' ) ; if ( stat get path ( ) equals ( subdir ) ) { found = true ; } } assert true ( " path " + subdir + " not found in directory " + dir + " : " + builder , found ) ; }


stops the pool of workers this is a blocking call to wait for all tasks to be completed

public void close ( ) { service shutdown ( ) ; try { service await termination ( 10 , time unit seconds ) ; } catch ( interrupted exception ie ) { logger error ( " error waiting for executor service shutdown ! " ) ; } }


gets all the descriptors sorted by their inheritance tree of { @ link describable } so that descriptors of similar types come nearby we sort them by { @ link extension # ordinal ( ) } but only for { @ link global configuration } s , as the value is normally used to compare similar kinds of extensions , and we needed { @ link global configuration } s to be able to position themselves in a layer above this however creates some asymmetry between regular { @ link descriptor } s and { @ link global configuration } s perhaps it is better to introduce another annotation element ? but then , extensions shouldn ' t normally concern themselves about ordering too much , and the only reason we needed this for { @ link global configuration } s are for backward compatibility

public static collection < descriptor > get sorted descriptors for global config by descriptor ( predicate < descriptor > predicate ) { extension list < descriptor > exts = extension list lookup ( descriptor class ) ; list < tag > r = new array list < > ( exts size ( ) ) ; for ( extension component < descriptor > c : exts get components ( ) ) { descriptor d = c get instance ( ) ; if ( d get global config page ( ) = = null ) continue ; if ( predicate test ( d ) ) { r add ( new tag ( c ordinal ( ) , d ) ) ; } } collections sort ( r ) ; list < descriptor > answer = new array list < > ( r size ( ) ) ; for ( tag d : r ) answer add ( d d ) ; return descriptor visibility filter apply ( jenkins get ( ) , answer ) ; }


gets a model name prefix for generated models this name will be prefixed to a model name this option is often used to circumvent compilation issues where models match keywords example : prefix < code > my < code > applied to < code > object < code > results in a generated class named < code > my object < code >

public string get model name prefix ( ) { return model name prefix ; }


adds the given element to this queue if this queue has a maximum size , after adding { @ code element } the queue will automatically evict its greatest element ( according to its comparator ) , which may be { @ code element } itself

public boolean offer ( e element ) { check not null ( element ) ; mod count + + ; int insert index = size + + ; grow if needed ( ) ; / / adds the element to the end of the heap and bubbles it up to the correct / / position heap for index ( insert index ) bubble up ( insert index , element ) ; return size < = maximum size | | poll last ( ) ! = element ; }


check the slot request bulk and timeout its requests if it has been unfulfillable for too long

timeout check result check physical slot request bulk timeout ( final physical slot request bulk with timestamp slot request bulk , final time slot request timeout ) { if ( slot request bulk get pending requests ( ) is empty ( ) ) { return timeout check result fulfilled ; } final boolean fulfillable = is slot request bulk fulfillable ( slot request bulk , slots retriever ) ; if ( fulfillable ) { slot request bulk mark fulfillable ( ) ; } else { final long current timestamp = clock relative time millis ( ) ; slot request bulk mark unfulfillable ( current timestamp ) ; final long unfulfillable since = slot request bulk get unfulfillable since ( ) ; if ( unfulfillable since + slot request timeout to milliseconds ( ) < = current timestamp ) { return timeout check result timeout ; } } return timeout check result pending ; }


private void mark constant ( clazz clazz , int index ) { if ( index > 0 ) { clazz constant pool entry accept ( index , this ) ; } }


returns the value keys that have changed between the two versions

diff get diff ( walkable graph from graph , version from version , version to version ) throws interrupted exception ;


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


public static web application service get service ( final request context context ) { return optional of nullable ( context ) map ( request context - > ( web application service ) request context get flow scope ( ) get ( parameter service ) ) or else ( null ) ; }


format url template using given variables

public string url ( map < string , string > variables ) { string url = this url ; / / go through variables and replace placeholders for ( map entry < string , server variable > variable : this variables entry set ( ) ) { string name = variable get key ( ) ; server variable server variable = variable get value ( ) ; string value = server variable default value ; if ( variables ! = null & & variables contains key ( name ) ) { value = variables get ( name ) ; if ( server variable enum values size ( ) > 0 & & ! server variable enum values contains ( value ) ) { throw new runtime exception ( " the variable " + name + " in the server url has invalid value " + value + " " ) ; } } url = url replace all ( " \ \ { " + name + " \ \ } " , value ) ; } return url ; }


returns a new array based short buffer with the specified capacity

public static short buffer new short buffer ( int capacity ) { return new read write short array buffer ( capacity ) ; }


build a locale context for the given request , exposing the request ' s primary locale as current locale the default implementation uses the dispatcher ' s locale resolver to obtain the current locale , which might change during a request

protected locale context build locale context ( final http servlet request request ) { locale resolver lr = this locale resolver ; if ( lr instanceof locale context resolver ) { return ( ( locale context resolver ) lr ) resolve locale context ( request ) ; } else { return ( ) - > ( lr ! = null ? lr resolve locale ( request ) : request get locale ( ) ) ; } }


verify quota when using the preferred block size for uc block this is usually used by append and truncate

private static quota counts verify quota for u c block ( f s namesystem fsn , i node file file , i nodes in path iip ) throws quota exceeded exception { f s directory fsd = fsn get f s directory ( ) ; if ( ! fsn is image loaded ( ) | | fsd should skip quota checks ( ) ) { / / do not check quota if editlog is still being processed return null ; } if ( file get last block ( ) ! = null ) { final quota counts delta = compute quota delta for u c block ( fsn , file ) ; fsd read lock ( ) ; try { f s directory verify quota ( iip , iip length ( ) - 1 , delta , null ) ; return delta ; } finally { fsd read unlock ( ) ; } } return null ; }


< code > optional float cash = 2 ; < code >

public builder clear cash ( ) { bit field 0 = ( bit field 0 & ~ 0x 0 0 0 0 0 0 0 2 ) ; cash = 0f ; on changed ( ) ; return this ; }


get the list of incompatible dependencies ( if there are any , as determined by is needed dependencies compatible with installed version )

public list < plugin > get dependencies incompatible with installed version ( plugin manager metadata cache cache ) { return cache of ( " get dependencies incompatible with installed version : " + name , list class , ( ) - > { list < plugin > incompatible plugins = new array list < > ( ) ; for ( plugin p : get needed dependencies ( ) ) { if ( ! p is compatible with installed version ( ) | | ! p is needed dependencies compatible with installed version ( ) ) { incompatible plugins add ( p ) ; } } return incompatible plugins ; } ) ; }


this test exercises the case where we invalidate ( mark dirty ) a node in one build command invocation and the revalidation ( because it did not change ) happens in a subsequent build command call - in the first update call we construct a - then we construct b and we make the glob get invalidated we do that by deleting a file because it depends on the directory listing because of that a gets invalidated - then we construct a again the glob gets revalidated because it is still matching just a java and a configured target gets revalidated too at the end of the analysis a java action should be in the action graph

public void test multi build invalidation revalidation ( ) throws exception { if ( default flags ( ) contains ( flag trimmed configurations ) ) { / / todo ( b / 129599328 ) : fix or justify disabling return ; } scratch file ( " java / a / a java " , " bla 1 " ) ; scratch file ( " java / a / c java " , " bla 2 " ) ; scratch file ( " java / a / build " , " java test ( name = ' a ' , " , " srcs = glob ( [ ' a * java ' ] ) ) " , " java test ( name = ' b ' , " , " srcs = [ ' b java ' ] ) " ) ; configured target ct = iterables get only element ( update ( " / / java / a : a " ) get targets to build ( ) ) ; scratch delete file ( " java / a / c java " ) ; update ( " / / java / a : b " ) ; update ( " / / java / a : a " ) ; assert that ( get generating action ( get bin artifact ( " a deploy jar " , ct ) ) ) is not null ( ) ; }


protected void do publish ( final rest client client , final action listener < resource publish result > listener ) { watches check and publish ( client , listener ) ; }


construct a new { @ link application privilege descriptor } from x content

public static application privilege descriptor parse ( x content parser parser , string default application , string default name , boolean allow type ) throws i o exception { final builder builder = parser parse ( parser , allow type ) ; if ( builder application name = = null ) { builder application name ( default application ) ; } if ( builder privilege name = = null ) { builder privilege name ( default name ) ; } return builder build ( ) ; }


override this method to configure asynchronous request processing options

protected void configure async support ( async support configurer configurer ) { }


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

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


public void begin job loop ( ) { run on executor ( ( ) - > { int id = 0 ; for ( int i = 0 ; i < configuration get job thread count ( ) ; i + + ) { new job runner ( application , + + id , job controller , job predicate none ) start ( ) ; } for ( job predicate predicate : configuration get reserved job runners ( ) ) { new job runner ( application , + + id , job controller , predicate ) start ( ) ; } job controller wake up ( ) ; } ) ; }


check if the request is retriable ( convenience method for checking if the exception is an instance of { @ link retriable exception }

public boolean is retriable ( ) { return exception ( ) instanceof retriable exception ; }


basically same as { @ link # find first ( class ) } but pending to a new thread for executing

public static < t > find executor < t > find first async ( class < t > model class ) { return operator find first async ( model class ) ; }


add exception classes for which server won ' t log stack traces optimized for infrequent invocation

void add terse logging exceptions ( class < ? > exception class ) { / / thread - safe replacement of terse exceptions terse exceptions = add exceptions ( terse exceptions , exception class ) ; }


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


test the property ' enum string required '

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


reads this file into a string , by using the current system encoding on the remote machine

public string read to string ( ) throws i o exception , interrupted exception { return act ( new read to string ( ) ) ; }


specify that value that the dynamic value will be animated to

public animation builder to ( float to ) { m to = to ; return this ; }


returns a new async stub with the given channel for the provided method configurations

public static < t extends abstract stub < t > > t new stub ( stub factory < t > factory , channel channel ) { return new stub ( factory , channel , call options default ) ; }


reads all bytes from a file into a byte array < b > { @ link java nio file path } equivalent : < b > { @ link java nio file files # read all bytes }

public static byte [ ] to byte array ( file file ) throws i o exception { return as byte source ( file ) read ( ) ; }


creates a { @ link transaction } out of an existing connection

transaction new transaction ( connection conn ) ;


return the name of the target scope for the bean

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


talks to the http interface to get the json output of a status command on the given file

private void get cmd ( string filename , string message , string command , boolean expect o k ) throws exception { string user = hadoop users conf test helper get hadoop users ( ) [ 0 ] ; string out msg = message + " ( " + command + " ) " ; / / remove leading / from filename if ( filename char at ( 0 ) = = ' / ' ) { filename = filename substring ( 1 ) ; } string path ops = message format format ( " / webhdfs / v 1 / { 0 } ? user name = { 1 } & op = { 2 } " , filename , user , command ) ; url url = new url ( test jetty helper get jetty u r l ( ) , path ops ) ; http u r l connection conn = ( http u r l connection ) url open connection ( ) ; conn set request method ( " get " ) ; conn connect ( ) ; int resp = conn get response code ( ) ; if ( expect o k ) { assert assert equals ( out msg , http u r l connection http ok , resp ) ; } else { assert assert equals ( out msg , http u r l connection http forbidden , resp ) ; } }


notifies the tracker that a format being read by the renderers for the current playback changed

public void on downstream format changed ( event time event time , media load data media load data ) { if ( media load data track type = = c track type video | | media load data track type = = c track type default ) { maybe update video format ( event time , media load data track format ) ; } else if ( media load data track type = = c track type audio ) { maybe update audio format ( event time , media load data track format ) ; } }


gets a ( possibly cached ) syscalls cache , re - initialized each build we cache the syscalls cache if possible because construction of the cache is surprisingly expensive , and is on the critical path of null builds

protected final per build syscall cache get per build syscall cache ( int concurrency level ) { if ( per build syscall cache ! = null & & last concurrency level = = concurrency level ) { per build syscall cache clear ( ) ; return per build syscall cache ; } last concurrency level = concurrency level ; per build syscall cache = new per build syscall cache ( concurrency level ) ; return per build syscall cache ; }


helper method for summarizing a list of values

protected numeric column summary < long > summarize ( long values ) { return new aggregate combine harness < long , numeric column summary < long > , long summary aggregator > ( ) { @ override protected void compare results ( numeric column summary < long > result 1 , numeric column summary < long > result 2 ) { assert assert equals ( result 1 get total count ( ) , result 2 get total count ( ) ) ; assert assert equals ( result 1 get null count ( ) , result 2 get null count ( ) ) ; assert assert equals ( result 1 get missing count ( ) , result 2 get missing count ( ) ) ; assert assert equals ( result 1 get non missing count ( ) , result 2 get non missing count ( ) ) ; assert assert equals ( result 1 get infinity count ( ) , result 2 get infinity count ( ) ) ; assert assert equals ( result 1 get nan count ( ) , result 2 get nan count ( ) ) ; assert assert equals ( result 1 contains null ( ) , result 2 contains null ( ) ) ; assert assert equals ( result 1 contains non null ( ) , result 2 contains non null ( ) ) ; assert assert equals ( result 1 get min ( ) long value ( ) , result 2 get min ( ) long value ( ) ) ; assert assert equals ( result 1 get max ( ) long value ( ) , result 2 get max ( ) long value ( ) ) ; assert assert equals ( result 1 get sum ( ) long value ( ) , result 2 get sum ( ) long value ( ) ) ; assert assert equals ( result 1 get mean ( ) double value ( ) , result 2 get mean ( ) double value ( ) , 1e - 1 2d ) ; assert assert equals ( result 1 get variance ( ) double value ( ) , result 2 get variance ( ) double value ( ) , 1e - 9d ) ; assert assert equals ( result 1 get standard deviation ( ) double value ( ) , result 2 get standard deviation ( ) double value ( ) , 1e - 1 2d ) ; } } summarize ( values ) ; }


concrete subclasses should implement this method to write a log message after the request is processed

protected abstract void after request ( http servlet request request , string message ) ;


put if absent does not add the pair if the key is already present

public void test put if absent 2 ( ) { concurrent map map = map 5 ( ) ; assert equals ( " a " , map put if absent ( one , " z " ) ) ; }


private static string get test name ( i invoked method method ) { return string utils substring after last ( method get test method ( ) get test class ( ) get name ( ) , " " ) + " # " + method get test method ( ) get constructor or method ( ) get name ( ) ; }


calculate the threshold in bytes which should trigger a { @ code go away } if a set of headers exceeds this amount

protected long calculate max header list size go away ( long max header list size ) { return http 2 codec util calculate max header list size go away ( max header list size ) ; }


builds a queue placement policy from a xml element

static void from xml ( element conf element , fair scheduler fs ) throws allocation configuration exception { log debug ( " reloading placement policy from allocation config " ) ; if ( conf element = = null | | ! conf element has child nodes ( ) ) { throw new allocation configuration exception ( " empty configuration for queue placement policy is not allowed " ) ; } list < placement rule > new rules = new array list < > ( ) ; list < boolean > new terminal state = new array list < > ( ) ; node list elements = conf element get child nodes ( ) ; for ( int i = 0 ; i < elements get length ( ) ; i + + ) { node node = elements item ( i ) ; if ( node instanceof element & & node get node name ( ) equals ignore case ( " rule " ) ) { string name = ( ( element ) node ) get attribute ( " name " ) ; log debug ( " creating new rule : { } " , name ) ; placement rule rule = create rule ( ( element ) node ) ; / / the only child node that we currently know is a parent rule placement rule parent rule = null ; string parent name = null ; element child = get parent rule element ( node ) ; if ( child ! = null ) { parent name = child get attribute ( " name " ) ; parent rule = get parent rule ( child , fs ) ; } / / need to make sure that the nested user queue has a parent for / / backwards compatibility if ( name equals ignore case ( " nested user queue " ) & & parent rule = = null ) { throw new allocation configuration exception ( " rule ' " + name + " ' must have a parent rule set " ) ; } new rules add ( rule ) ; if ( parent rule = = null ) { new terminal state add ( get terminal ( rules get ( name ) terminal , rule ) ) ; } else { ( ( f s placement rule ) rule ) set parent rule ( parent rule ) ; new terminal state add ( get terminal ( rules get ( name ) terminal , rule ) & & get terminal ( rules get ( parent name ) terminal , parent rule ) ) ; } } } update rule set ( new rules , new terminal state , fs ) ; }


enter a parse tree produced by the { @ code constant default } labeled alternative in { @ link eql base parser # primary expression }

void enter constant default ( eql base parser constant default context ctx ) ;


accept the event is handled or not by current listener


void query lottery account funds ( wire transfers bank , scanner scanner ) ;


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


compose a " host : port " string from the address

public static string get host port string ( inet socket address addr ) { return addr get host name ( ) + " : " + addr get port ( ) ; }


discards data from the buffer up to the first sps , where { @ code data position ( ) } is interpreted as the length of the buffer when the method returns , { @ code data position ( ) } will contain the new length of the buffer if the buffer is not empty it is guaranteed to start with an sps

public static void discard to sps ( byte buffer data ) { int length = data position ( ) ; int consecutive zeros = 0 ; int offset = 0 ; while ( offset + 1 < length ) { int value = data get ( offset ) & 0x f f ; if ( consecutive zeros = = 3 ) { if ( value = = 1 & & ( data get ( offset + 1 ) & 0x 1 f ) = = h264 nal unit type sps ) { / / copy from this nal unit onwards to the start of the buffer byte buffer offset data = data duplicate ( ) ; offset data position ( offset - 3 ) ; offset data limit ( length ) ; data position ( 0 ) ; data put ( offset data ) ; return ; } } else if ( value = = 0 ) { consecutive zeros + + ; } if ( value ! = 0 ) { consecutive zeros = 0 ; } offset + + ; } / / empty the buffer if the sps nal unit was not found data clear ( ) ; }


writes the given job manager address to the associated configuration object

static void set job manager address in config ( configuration config , inet socket address address ) { config set string ( job manager options address , address get host string ( ) ) ; config set integer ( job manager options port , address get port ( ) ) ; config set string ( rest options address , address get host string ( ) ) ; config set integer ( rest options port , address get port ( ) ) ; }


delegates to the underlying file type map

public string get content type ( string file name ) { return get file type map ( ) get content type ( file name ) ; }


sets the mime types to prioritize for linear ad media if not specified , mime types supported by the { @ link media source factory ad media source factory } used to construct the { @ link ads media source } will be used

public builder set ad media mime types ( list < string > ad media mime types ) { this ad media mime types = immutable list copy of ( check not null ( ad media mime types ) ) ; return this ; }


check that there are no files with a gid other than 0

public void test 1 0 1 all files are group zero ( ) { / / run a ` find ` command in a new container without elasticsearch running , so / / that the results aren ' t subject to sporadic failures from files appearing / / / disappearing while ` find ` is traversing the filesystem / / / / we also create a file under ` data / ` to ensure that files are created with the / / expected group final shell local sh = new shell ( ) ; final string find results = local sh run ( " docker run - - rm - - tty " + get image name ( distribution ) + " bash - c ' touch data / test & & find \ \ ! - group 0 ' " ) stdout ; assert that ( " found some files whose gid ! = 0 " , find results , is ( empty string ( ) ) ) ; }


handles an inbound { @ code ping } frame

void on ping read ( channel handler context ctx , long data ) throws http 2 exception ;


public put index template request source ( bytes reference source , x content type x content type ) { return source ( x content helper convert to map ( source , true , x content type ) v 2 ( ) ) ; }


returns the cache key of the build options used to create this configuration

public string checksum ( ) { return checksum ; }


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


private void op read block ( ) throws i o exception { op read block proto proto = op read block proto parse from ( vint prefixed ( in ) ) ; trace scope trace scope = continue trace span ( proto get header ( ) , proto get class ( ) get simple name ( ) ) ; try { read block ( p b helper client convert ( proto get header ( ) get base header ( ) get block ( ) ) , p b helper client convert ( proto get header ( ) get base header ( ) get token ( ) ) , proto get header ( ) get client name ( ) , proto get offset ( ) , proto get len ( ) , proto get send checksums ( ) , ( proto has caching strategy ( ) ? get caching strategy ( proto get caching strategy ( ) ) : caching strategy new default strategy ( ) ) ) ; } finally { if ( trace scope ! = null ) trace scope close ( ) ; } }


tests that a remote rpc call with a non - serializable argument fails with an { @ link i o exception } ( or an { @ link java lang reflect undeclared throwable exception } if the the method declaration does not include the { @ link i o exception } as throwable )

public void test non serializable remote message transfer ( ) throws exception { linked blocking queue < object > linked blocking queue = new linked blocking queue < > ( ) ; test endpoint test endpoint = new test endpoint ( akka rpc service 1 , linked blocking queue ) ; test endpoint start ( ) ; string address = test endpoint get address ( ) ; completable future < test gateway > remote gateway future = akka rpc service 2 connect ( address , test gateway class ) ; test gateway remote gateway = remote gateway future get ( timeout get size ( ) , timeout get unit ( ) ) ; remote gateway foobar ( new object ( ) ) ; fail ( " should have failed because object is not serializable " ) ; }


determine the media types for the given file name , if possible

public static list < media type > get media types ( @ nullable string filename ) { list < media type > media types = null ; string ext = string utils get filename extension ( filename ) ; if ( ext ! = null ) { media types = file extension to media types get ( ext to lower case ( locale english ) ) ; } return ( media types ! = null ? media types : collections empty list ( ) ) ; }


public void set cache size ( int cache size ) { this cache size = cache size ; }


determine if the supplied { @ link class } meets the criteria for being considered a default configuration class candidate specifically , such candidates : must not be { @ code null } must not be { @ code private } must not be { @ code final } must be { @ code static } must be annotated or meta - annotated with { @ code @ configuration }

private static boolean is default configuration class candidate ( @ nullable class < ? > clazz ) { return ( clazz ! = null & & is static non private and non final ( clazz ) & & annotated element utils has annotation ( clazz , configuration class ) ) ; }


creates a new pooled byte buffer output stream instance with the specified initial capacity

pooled byte buffer output stream new output stream ( int initial capacity ) ;


returns whether the artifact represents a fileset if true , this artifact is necessarily a { @ link special artifact } with type { @ link special artifact type # fileset }

public boolean is fileset ( ) { return false ; }


subscribes to the source again via trampolining

void subscribe next ( ) { if ( get and increment ( ) = = 0 ) { int missed = 1 ; for ( ; ; ) { if ( sa is cancelled ( ) ) { return ; } long p = produced ; if ( p ! = 0l ) { produced = 0l ; sa produced ( p ) ; } source subscribe ( this ) ; missed = add and get ( - missed ) ; if ( missed = = 0 ) { break ; } } } }


whether to use the { @ link gson builder # set pretty printing ( ) } when writing json this is a shortcut for setting up a { @ code gson } as follows : < pre class = " code " > new gson builder ( ) set pretty printing ( ) create ( ) ;

public void set pretty printing ( boolean pretty printing ) { this pretty printing = pretty printing ; }


consume all values of the named response header

public web test client response spec values ( string name , consumer < list < string > > consumer ) { list < string > values = get required values ( name ) ; this exchange result assert with diagnostics ( ( ) - > consumer accept ( values ) ) ; return this response spec ; }


if this remote exception wraps up one of the lookup types then return this exception unwraps any i o exception

public i o exception unwrap remote exception ( class < ? > lookup types ) { if ( lookup types = = null ) return this ; for ( class < ? > lookup class : lookup types ) { if ( ! lookup class get name ( ) equals ( get class name ( ) ) ) continue ; try { return instantiate exception ( lookup class as subclass ( i o exception class ) ) ; } catch ( exception e ) { / / cannot instantiate lookup class , just return this return this ; } } / / wrapped up exception is not in lookup types , just return this return this ; }


set the section c variable to given address

public void set section c ( address section c ) { this section c = section c ; }


public void await completion ( ) throws exception { latch await ( ) ; }


tells the plugin to read its data - independent ( preferences ) properties from the input stream

public void read config state ( save state save state ) { / / do nothing by default ; subclasses should override as needed }


open a session for the session factory that this filter uses the default implementation delegates to the { @ link session factory # open session } method and sets the { @ link session } ' s flush mode to " manual "

protected session open session ( session factory session factory ) throws data access resource failure exception { try { session session = session factory open session ( ) ; session set hibernate flush mode ( flush mode manual ) ; return session ; } catch ( hibernate exception ex ) { throw new data access resource failure exception ( " could not open hibernate session " , ex ) ; } }


convert the order by clause if it contains invalid column names which conflict with s q lite keywords

public static string convert order by clause to valid name ( string order by ) { if ( ! text utils is empty ( order by ) ) { order by = order by trim ( ) to lower case ( locale us ) ; if ( order by contains ( " , " ) ) { string [ ] order by items = order by split ( " , " ) ; string builder builder = new string builder ( ) ; boolean need comma = false ; for ( string order by item : order by items ) { if ( need comma ) { builder append ( " , " ) ; } builder append ( convert order by item ( order by item ) ) ; need comma = true ; } order by = builder to string ( ) ; } else { order by = convert order by item ( order by ) ; } return order by ; } return null ; }


called when the audio position has increased for the first time since the last pause or position reset

default void on audio position advancing ( event time event time , long playout start system time ms ) { }


gets authentication handlers by a filter

default set < authentication handler > get authentication handlers by ( final predicate < authentication handler > filter ) { return get authentication handlers ( ) stream ( ) filter ( filter ) collect ( collectors to set ( ) ) ; }


test the method node heartbeat method should return a not null result

public void test node heartbeat ( ) throws exception { node heartbeat request request = record factory new record instance ( node heartbeat request class ) ; assert not null ( client node heartbeat ( request ) ) ; resource tracker test impl exception = true ; try { client node heartbeat ( request ) ; fail ( " there should be yarn exception " ) ; } catch ( yarn exception e ) { assert true ( e get message ( ) starts with ( " test message " ) ) ; } finally { resource tracker test impl exception = false ; } }


makes a string representation of the exception ' s stack trace , or " ( null ) " , if the exception is null this method makes a best effort and never fails

public static string stringify exception ( final throwable e ) { if ( e = = null ) { return stringified null exception ; } try { string writer stm = new string writer ( ) ; print writer wrt = new print writer ( stm ) ; e print stack trace ( wrt ) ; wrt close ( ) ; return stm to string ( ) ; } catch ( throwable t ) { return e get class ( ) get name ( ) + " ( error while printing stack trace ) " ; } }


run through all deduping strategies and if one results in a single label , return that label otherwise return null

public string get most optimistic name ( ) { if ( raw names size ( ) = = 1 ) { return raw names first ( ) ; } if ( similar base names size ( ) = = 1 ) { return similar base names first ( ) ; } if ( demangled name no template ! = null & & demangled name no template size ( ) = = 1 ) { return demangled name no template first ( ) ; } if ( exact demangled base names ! = null & & exact demangled base names size ( ) = = 1 ) { return exact demangled base names first ( ) ; } return null ; }


public rule context get rule context ( ) { return rule context ; }


create a new { @ link bean wrapper } for the underlying target object

protected bean wrapper create bean wrapper ( ) { if ( this target = = null ) { throw new illegal state exception ( " cannot access properties on null bean instance ' " + get object name ( ) + " ' " ) ; } return property accessor factory for bean property access ( this target ) ; }


{ @ inherit doc } this implementation is guaranteed to throw an { @ link unsupported operation exception }

public final entry < e > poll last entry ( ) { throw new unsupported operation exception ( ) ; }


test the property ' array nullable prop '

public void array nullable prop test ( ) { / / todo : test array nullable prop }


match the specified candidate against the configured patterns

protected boolean matches pattern ( string signature string ) { for ( int i = 0 ; i < this patterns length ; i + + ) { boolean matched = matches ( signature string , i ) ; if ( matched ) { for ( int j = 0 ; j < this excluded patterns length ; j + + ) { boolean excluded = matches exclusion ( signature string , j ) ; if ( excluded ) { return false ; } } return true ; } } return false ; }


assert that two { @ link monitoring doc } are equal by default , it uses { @ link monitoring doc # equals ( object ) } and { @ link monitoring doc # hash code ( ) } methods and also checks x content equality

private void assert monitoring doc equals ( t expected , t actual ) throws i o exception { assert equals ( expected , actual ) ; assert equals ( expected hash code ( ) , actual hash code ( ) ) ; final boolean human = random boolean ( ) ; final x content type x content type = random from ( x content type values ( ) ) ; assert to x content equivalent ( to x content ( expected , x content type , human ) , to x content ( actual , x content type , human ) , x content type ) ; }


set the long value for the specified field

public void set long value ( int col index , long value ) { dirty = true ; field values [ col index ] set long value ( value ) ; }


create a new { @ code transactional application listener } for the given payload consumer

static < t > transactional application listener < payload application event < t > > for payload ( transaction phase phase , consumer < t > consumer ) { transactional application listener adapter < payload application event < t > > listener = new transactional application listener adapter < > ( event - > consumer accept ( event get payload ( ) ) ) ; listener set transaction phase ( phase ) ; return listener ; }


return whether input matches regex of chinese character

public static boolean is zh ( final char sequence input ) { return is match ( regex constants regex zh , input ) ; }


closes the current zip entry and positions the stream for writing the next entry checks that the amount of data written matches the compressed size indicated by the zip entry

private void finish entry ( ) throws i o exception { if ( entry get compressed size ( ) ! = bytes written ) { throw new zip exception ( string format ( " number of bytes written for the entry % s ( % d ) does not " + " match the reported compressed size ( % d ) " , entry get name ( ) , bytes written , entry get compressed size ( ) ) ) ; } zip data add entry ( entry ) ; entry = null ; }


handler for a connection error sends a go away frame to the remote endpoint once all streams are closed , the connection is shut down

protected void on connection error ( channel handler context ctx , boolean outbound , throwable cause , http 2 exception http 2 ex ) { if ( http 2 ex = = null ) { http 2 ex = new http 2 exception ( internal error , cause get message ( ) , cause ) ; } channel promise promise = ctx new promise ( ) ; channel future future = go away ( ctx , http 2 ex , ctx new promise ( ) ) ; if ( http 2 ex shutdown hint ( ) = = http 2 exception shutdown hint graceful shutdown ) { do graceful shutdown ( ctx , future , promise ) ; } else { future add listener ( new closing channel future listener ( ctx , promise ) ) ; } }


advise that a block replica not be written to the local rack data node

public hdfs data output stream builder no local rack ( ) { get flags ( ) add ( create flag no local rack ) ; return this ; }


finds the node that represents the given category

public category node find category node ( category local category , boolean load children ) { / / if we don ' t have to load children and we are not loaded get out if ( ! load children & & ! is loaded ( ) ) { return null ; } if ( local category = = null ) { return null ; } if ( get category ( ) = = local category ) { return archive node this ; } category parent category = local category get parent ( ) ; if ( get parent ( ) = = null ) { return null ; } category node node = find category node ( parent category , load children ) ; if ( node = = null ) { return null ; } list < g tree node > children = node get children ( ) ; for ( g tree node child : children ) { if ( ! ( child instanceof category node ) ) { continue ; } category node category node = ( category node ) child ; if ( category node get category ( ) = = local category ) { return category node ; } } return null ; }


< code > optional string name = 2 ; < code >

private void set name bytes ( com google protobuf byte string value ) { if ( value = = null ) { throw new null pointer exception ( ) ; } bit field 0 | = 0x 0 0 0 0 0 0 0 2 ; name = value to string utf 8 ( ) ; }


returns the highest supported api key of this message , inclusive


return the singleton instance for the current process

public static readahead pool get instance ( ) { synchronized ( readahead pool class ) { if ( instance = = null & & native i o is available ( ) ) { instance = new readahead pool ( ) ; } return instance ; } }


called when the native type is an { @ link long }

t for long ( function < long consumer , grok capture extracter > build extracter ) ;


add an annotation for a specified amount of subsequent output any previously open annotation will be closed by this call if there is already pending annotation from one or more previous calls to this method , the new call " consumes " output after all the output covered by the previous calls

public void annotate ( int amt , string msg ) ;


returns a { @ link selector list } for the given attribute if the attribute is configurable for this rule , null otherwise

public final < t > selector list < t > get selector list ( string attribute name , type < t > type ) { return rule get selector list ( attribute name , type ) ; }


tests various ways to send the basic auth

public void test various ways to call ( ) throws exception { api token test helper enable legacy behavior ( ) ; j jenkins set security realm ( j create dummy security realm ( ) ) ; user foo = user get by id ( " foo " , true ) ; user get by id ( " bar " , true ) ; wc = j create web client ( ) ; / / call without authentication make request and verify ( " anonymous " ) ; spy security listener authenticated calls assert no new events ( ) ; spy security listener failed to authenticate calls assert no new events ( ) ; / / call with api token wc = j create web client ( ) ; wc with basic api token ( " foo " ) ; make request and verify ( " foo " ) ; spy security listener authenticated calls assert last event is and then remove it ( u - > u get username ( ) equals ( " foo " ) ) ; / / call with invalid api token wc = j create web client ( ) ; wc with basic credentials ( " foo " , " abcd " + foo get property ( api token property class ) get api token ( ) ) ; make request and fail ( ) ; spy security listener failed to authenticate calls assert last event is and then remove it ( " foo " ) ; / / call with password wc = j create web client ( ) ; wc with basic credentials ( " foo " ) ; make request and verify ( " foo " ) ; spy security listener authenticated calls assert last event is and then remove it ( u - > u get username ( ) equals ( " foo " ) ) ; / / call with incorrect password wc = j create web client ( ) ; wc with basic credentials ( " foo " , " bar " ) ; make request and fail ( ) ; spy security listener failed to authenticate calls assert last event is and then remove it ( " foo " ) ; wc = j create web client ( ) ; wc login ( " bar " ) ; spy security listener authenticated calls assert last event is and then remove it ( u - > u get username ( ) equals ( " bar " ) ) ; spy security listener logged in calls assert last event is and then remove it ( " bar " ) ; / / if the session cookie is valid , then basic header won ' t be needed make request and verify ( " bar " ) ; spy security listener authenticated calls assert no new events ( ) ; spy security listener failed to authenticate calls assert no new events ( ) ; / / if the session cookie is valid , and basic header is set anyway login should not fail either wc with basic credentials ( " bar " ) ; make request and verify ( " bar " ) ; spy security listener authenticated calls assert no new events ( ) ; spy security listener failed to authenticate calls assert no new events ( ) ; / / but if the password is incorrect , it should fail , instead of silently logging in as the user indicated by session wc with basic credentials ( " foo " , " bar " ) ; make request and fail ( ) ; spy security listener failed to authenticate calls assert last event is and then remove it ( " foo " ) ; }


returns the current transform matrix changing this within { @ link # begin ( ) } { @ link # end ( ) } results in undefined behaviour

public matrix 4 get transform matrix ( ) ;


public void add local ( string index ) { local add ( index ) ; }


sets a schedule to be applied during the test

public final void set schedule ( action schedule schedule ) { if ( ! is started ( ) ) { pending schedule = schedule ; } else { schedule start ( player , track selector , surface , action handler , / * callback = * / null ) ; } }


returns the weighted standard deviation of the values in the snapshot

public double get std dev ( ) { / / two - pass algorithm for variance , avoids numeric overflow if ( values length < = 1 ) { return 0 ; } final double mean = get mean ( ) ; double variance = 0 ; for ( int i = 0 ; i < values length ; i + + ) { final double diff = values [ i ] - mean ; variance + = norm weights [ i ] * diff * diff ; } return math sqrt ( variance ) ; }


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

public void update user ( string username , user user ) throws timeout exception , execution exception , interrupted exception , api exception { object post body = user ; / / verify the required parameter ' username ' is set if ( username = = null ) { volley error error = new volley error ( " missing the required parameter ' username ' when calling update user " , new api exception ( 400 , " missing the required parameter ' username ' when calling update user " ) ) ; } / / verify the required parameter ' user ' is set if ( user = = null ) { volley error error = new volley error ( " missing the required parameter ' user ' when calling update user " , new api exception ( 400 , " missing the required parameter ' user ' when calling update user " ) ) ; } / / create path and map variables string path = " / user / { username } " replace all ( " \ \ { " + " username " + " \ \ } " , api invoker escape string ( username to string ( ) ) ) ; / / query params list < pair > query params = new array list < pair > ( ) ; / / header params map < string , string > header params = new hash map < string , string > ( ) ; / / form params map < string , string > form params = new hash map < string , string > ( ) ; string [ ] content types = { } ; string content type = content types length > 0 ? content types [ 0 ] : " application / json " ; if ( content type starts with ( " multipart / form - data " ) ) { / / file uploading multipart entity builder local var builder = multipart entity builder create ( ) ; http entity http entity = local var builder build ( ) ; post body = http entity ; } else { / / normal form params } string [ ] auth names = new string [ ] { } ; try { string local var response = api invoker invoke a p i ( base path , path , " put " , query params , post body , header params , form params , content type , auth names ) ; if ( local var response ! = null ) { return ; } else { return ; } } catch ( api exception ex ) { throw ex ; } catch ( interrupted exception ex ) { throw ex ; } catch ( execution exception ex ) { if ( ex get cause ( ) instanceof volley error ) { volley error volley error = ( volley error ) ex get cause ( ) ; if ( volley error network response ! = null ) { throw new api exception ( volley error network response status code , volley error get message ( ) ) ; } } throw ex ; } catch ( timeout exception ex ) { throw ex ; } }


permanently discards all data resources associated with the old function manager this should be invoked when an upgrade of all function data has been completed

public synchronized void dispose ( ) throws i o exception { function map dispose ( ) ; function adapter delete table ( db handle ) ; stack var adapter delete table ( db handle ) ; register adapter delete table ( db handle ) ; / / remove function variable tables which were never employed db handle delete table ( " function variables " ) ; db handle delete table ( " function var ranges " ) ; }


hook for client or server specific object readers

protected void extend object readers ( list < http message reader < ? > > object readers ) { }


print the differences matching the types indicated that were found thus far by all calls to get differences the differences are grouped by each of the primary difference types

synchronized public void print known differences by type ( int type ) { int [ ] pt = program diff filter get primary types ( ) ; for ( int element : pt ) { msg info ( this , " \ n " + program diff filter type to name ( element ) + " differences : " ) ; address set as = diff addr sets get ( new integer ( element ) ) ; if ( as ! = null ) { address range iterator iter = as get address ranges ( ) ; while ( iter has next ( ) ) { msg info ( this , " " + iter next ( ) ) ; } } } }


the value of the name and type index item must be a valid index into the constant pool table the constant pool entry at that index must be a constant name and type info structure representing a field descriptor

public int get name and type index ( ) { return name and type index & 0xffff ; }


protected synchronized void set failure info ( string failure info ) { this failure info = failure info ; }


public api response < string > login user with http info ( string username , string password ) throws api exception { okhttp 3 call local var call = login user validate before call ( username , password , null ) ; type local var return type = new type token < string > ( ) { } get type ( ) ; return local var api client execute ( local var call , local var return type ) ; }


regression test to ensure there is no npe when the worker has been disposed

public void npe regression ( ) throws exception { scheduler s = get scheduler ( ) ; new thread worker w = ( new thread worker ) s create worker ( ) ; w dispose ( ) ; / / this method used to throw a npe when the worker has been disposed and the parent is null w schedule actual ( new runnable ( ) { @ override public void run ( ) { } } , 0 , time unit milliseconds , null ) ; }


returns all the the stored disassembly for an instruction sequence

public string get complete disassembly ( boolean in order ) { return get disassembly ( instructions length , in order ) ; }


returns the index of the last matching bmp character in a character sequence , or { @ code - 1 } if no matching character is present the default implementation iterates over the sequence in reverse order calling { @ link # matches } for each character

public int last index in ( char sequence sequence ) { for ( int i = sequence length ( ) - 1 ; i > = 0 ; i - - ) { if ( matches ( sequence char at ( i ) ) ) { return i ; } } return - 1 ; }


returns time in milliseconds as does system current time millis ( ) , but uses elapsed time from an arbitrary epoch more like system nano time ( ) the difference is that if somebody changes the system clock , time current elapsed time will change but nano time won ' t on the other hand , all of zk assumes that time is measured in milliseconds

public static long current elapsed time ( ) { return system nano time ( ) / 1000000 ; }


stores an short array in the table at the given row and column note - all values in a given column must be of the same type

public void put short array ( int row , int col , short [ ] value ) { if ( col > = data columns length ) { grow table ( col + 1 ) ; } short array array saa = null ; if ( data columns [ col ] = = null ) { saa = new short array array ( ) ; data columns [ col ] = saa ; } else { saa = ( short array array ) data columns [ col ] ; } saa put ( row , value ) ; }


read a new stripe covering the current position , and store the data in the { @ link # cur stripe buf }

private void read one stripe ( corrupted blocks corrupted blocks ) throws i o exception { reset cur stripe buffer ( true ) ; / / compute stripe range based on pos final long offset in block group = get offset in block group ( ) ; final long stripe len = cell size * data blk num ; final int stripe index = ( int ) ( offset in block group / stripe len ) ; final int stripe buf offset = ( int ) ( offset in block group % stripe len ) ; final int stripe limit = ( int ) math min ( current located block get block size ( ) - ( stripe index * stripe len ) , stripe len ) ; stripe range stripe range = new stripe range ( offset in block group , stripe limit - stripe buf offset ) ; located striped block block group = ( located striped block ) current located block ; aligned stripe [ ] stripes = striped block util divide one stripe ( ec policy , cell size , block group , offset in block group , offset in block group + stripe range get length ( ) - 1 , cur stripe buf ) ; final located block [ ] blks = striped block util parse striped block group ( block group , cell size , data blk num , parity blk num ) ; / / read the whole stripe for ( aligned stripe stripe : stripes ) { / / parse group to get chosen dn location stripe reader sreader = new stateful stripe reader ( stripe , ec policy , blks , block readers , corrupted blocks , decoder , this ) ; sreader read stripe ( ) ; } cur stripe buf position ( stripe buf offset ) ; cur stripe buf limit ( stripe limit ) ; cur stripe range = stripe range ; }


this method is the only entry point to get a base adapter helper

public static base adapter helper get ( context context , view convert view , view group parent , int layout id ) { return get ( context , convert view , parent , layout id , - 1 ) ; }


test opening an older version of a versioned file version - 1 is opened and checked

public void test old version open ( ) throws exception { test version quick update ( ) ; local managed buffer file vbf = null ; try { / / open / reconstruct old versioned file vbf = new local managed buffer file ( versioned test file mgr , 1 , - 1 ) ; assert equals ( 3 , vbf get index count ( ) ) ; assert true ( arrays equals ( new int [ ] { 2 } , vbf get free indexes ( ) ) ) ; assert equals ( 0x 3 2 1 , vbf get parameter ( " test parm 1 " ) ) ; assert equals ( 0x 5 4 3 , vbf get parameter ( " test parm 2 " ) ) ; do read test 2 ( vbf ) ; vbf close ( ) ; vbf = null ; } finally { if ( vbf ! = null ) { try { vbf close ( ) ; } catch ( i o exception e ) { / / ignore } } } }


registers the actions needed to build the requested a p ks in the rule context

public void register actions ( rule context rule context ) { / / if the caller did not request an unsigned apk , we still need to construct one so that / / we can sign it so we make up an intermediate artifact artifact intermediate unsigned apk = unsigned apk ! = null ? unsigned apk : get apk artifact ( rule context , " unsigned " + signed apk get filename ( ) ) ; build apk ( rule context , intermediate unsigned apk ) ; if ( signed apk ! = null ) { artifact apk to sign = intermediate unsigned apk ; / / zipalignment is performed before signing so if a zipaligned apk is requested , we need an / / intermediate zipaligned - but - not - signed apk artifact if ( zipalign apk ) { apk to sign = get apk artifact ( rule context , " zipaligned " + signed apk get filename ( ) ) ; zipalign apk ( rule context , intermediate unsigned apk , apk to sign ) ; } sign apk ( rule context , apk to sign , signed apk ) ; } }


combines this bloom filter with another bloom filter by performing a bitwise or of the underlying data the mutations happen to < b > this < b > instance callers must ensure the bloom filters are appropriately sized to avoid saturating them

public void put all ( bloom filter < t > that ) { check not null ( that ) ; check argument ( this ! = that , " cannot combine a bloom filter with itself " ) ; check argument ( this num hash functions = = that num hash functions , " bloom filters must have the same number of hash functions ( % s ! = % s ) " , this num hash functions , that num hash functions ) ; check argument ( this bit size ( ) = = that bit size ( ) , " bloom filters must have the same size underlying bit arrays ( % s ! = % s ) " , this bit size ( ) , that bit size ( ) ) ; check argument ( this strategy equals ( that strategy ) , " bloom filters must have equal strategies ( % s ! = % s ) " , this strategy , that strategy ) ; check argument ( this funnel equals ( that funnel ) , " bloom filters must have equal funnels ( % s ! = % s ) " , this funnel , that funnel ) ; this bits put all ( that bits ) ; }


customize the { @ link r socket strategies } allows further customization on { @ link r socket strategies } , mutating them if they were { @ link # rsocket strategies ( r socket strategies ) set } , or starting from { @ link r socket strategies # builder ( ) } defaults }

r socket requester builder rsocket strategies ( consumer < r socket strategies builder > configurer ) ;


validate that all states can be correctly registered at the registry

public void test registry normal ( ) { shared state registry shared state registry = new shared state registry ( ) ; / / register one state test shared state first state = new test shared state ( " first " ) ; shared state registry result result = shared state registry register reference ( first state get registration key ( ) , first state ) ; assert equals ( 1 , result get reference count ( ) ) ; assert true ( first state = = result get reference ( ) ) ; assert false ( first state is discarded ( ) ) ; / / register another state test shared state second state = new test shared state ( " second " ) ; result = shared state registry register reference ( second state get registration key ( ) , second state ) ; assert equals ( 1 , result get reference count ( ) ) ; assert true ( second state = = result get reference ( ) ) ; assert false ( first state is discarded ( ) ) ; assert false ( second state is discarded ( ) ) ; / / attempt to register state under an existing key test shared state first state prime = new test shared state ( first state get registration key ( ) get key string ( ) ) ; result = shared state registry register reference ( first state get registration key ( ) , first state prime ) ; assert equals ( 2 , result get reference count ( ) ) ; assert false ( first state prime = = result get reference ( ) ) ; assert true ( first state = = result get reference ( ) ) ; assert true ( first state prime is discarded ( ) ) ; assert false ( first state is discarded ( ) ) ; / / reference the first state again result = shared state registry register reference ( first state get registration key ( ) , first state ) ; assert equals ( 3 , result get reference count ( ) ) ; assert true ( first state = = result get reference ( ) ) ; assert false ( first state is discarded ( ) ) ; / / unregister the second state result = shared state registry unregister reference ( second state get registration key ( ) ) ; assert equals ( 0 , result get reference count ( ) ) ; assert true ( result get reference ( ) = = null ) ; assert true ( second state is discarded ( ) ) ; / / unregister the first state result = shared state registry unregister reference ( first state get registration key ( ) ) ; assert equals ( 2 , result get reference count ( ) ) ; assert true ( first state = = result get reference ( ) ) ; assert false ( first state is discarded ( ) ) ; }


add a { @ link path } with a custom { @ link input format } to the list of inputs for the map - reduce job

public static void add input path ( job job , path path , class < ? extends input format > input format class ) { string input format mapping = path to string ( ) + " ; " + input format class get name ( ) ; configuration conf = job get configuration ( ) ; string input formats = conf get ( dir formats ) ; conf set ( dir formats , input formats = = null ? input format mapping : input formats + " , " + input format mapping ) ; job set input format class ( delegating input format class ) ; }


construct a random action graph , and initialize the file system so that all of the input files exist and none of the output files exist

public list < counter > build random action graph ( int action graph number ) throws i o exception { list < counter > counters = new array list < > ( num artifacts ) ; artifacts = new artifact [ num artifacts ] ; for ( int i = 0 ; i < num artifacts ; i + + ) { artifacts [ i ] = create derived artifact ( " file " + action graph number + " - " + i ) ; } int num outputs ; for ( int i = 0 ; i < artifacts length ; i + = num outputs ) { int num inputs = random next int ( 3 ) ; num outputs = 1 + random next int ( 2 ) ; if ( i + num outputs > = artifacts length ) { num outputs = artifacts length - i ; } nested set builder < artifact > inputs = nested set builder stable order ( ) ; for ( int j = 0 ; j < num inputs ; j + + ) { if ( i ! = 0 ) { int input num = random next int ( i ) ; inputs add ( artifacts [ input num ] ) ; } } collection < artifact > outputs = new array list < > ( num outputs ) ; for ( int j = 0 ; j < num outputs ; j + + ) { outputs add ( artifacts [ i + j ] ) ; } counters add ( create action counter ( inputs build ( ) , immutable set copy of ( outputs ) ) ) ; if ( inputs is empty ( ) ) { / / source files - - create them for ( artifact output : outputs ) { blaze test utils make empty file ( output get path ( ) ) ; } } else { / / generated files - - delete them for ( artifact output : outputs ) { try { output get path ( ) delete ( ) ; } catch ( file not found exception e ) { / / ok } } } } return counters ; }


only { @ link channel config # get max messages per read ( ) } is used

public void reset ( channel config config ) { this config = config ; max message per read = max messages per read ( ) ; total messages = total bytes read = 0 ; }


validity - checks that no group has its environment referenced in both the " compatible with " and restricted to " attributes returns true if all is good , returns false and reports appropriate errors if there are any problems

boolean validate environment specifications ( ) { immutable collection < environment labels > restriction groups = restriction environments get groups ( ) ; boolean has errors = false ; for ( environment labels group : compatibility environments get groups ( ) ) { if ( restriction groups contains ( group ) ) { / / to avoid error - spamming the user , when we find a conflict we only report one example / / environment from each attribute for that group label compatibility env = compatibility environments get environments ( group ) iterator ( ) next ( ) ; label restriction env = restriction environments get environments ( group ) iterator ( ) next ( ) ; if ( compatibility env equals ( restriction env ) ) { attribute error ( rule context , compatibility attr , compatibility env + " cannot appear both here and in " + restriction attr ) ; } else { attribute error ( rule context , compatibility attr , compatibility env + " and " + restriction env + " belong to the same environment group they should be declared " + " together either here or in " + restriction attr ) ; } has errors = true ; } } return ! has errors ; }


byte argument greater than or equal to the given value see examples in javadoc for { @ link additional matchers } class

public static byte geq ( byte value ) { report matcher ( new greater or equal < byte > ( value ) ) ; return 0 ; }


the character for the key that was type valid for : key typed

public char get character ( ) { return character ; }


public component readiness check ( readiness check readiness check ) { this readiness check = readiness check ; return this ; }


the actual render step : taking the poi { @ link workbook } and rendering it to the given response

protected void render workbook ( workbook workbook , http servlet response response ) throws i o exception { servlet output stream out = response get output stream ( ) ; workbook write ( out ) ; workbook close ( ) ; }


for subclasses externalizing the storage , for example zookeeper based implementations

protected synchronized void set current key id ( int key id ) { current id = key id ; }


public final cancellable multi get async ( multi get request multi get request , request options options , action listener < multi get response > listener ) { return mget async ( multi get request , options , listener ) ; }


returns the { @ code inet 6 address } corresponding to a given { @ code big integer }

public static inet 6 address from i pv 6 big integer ( big integer address ) { return ( inet 6 address ) from big integer ( address , true ) ; }


called when the value of { @ link # get shuffle mode enabled ( ) } changes

default void on shuffle mode enabled changed ( boolean shuffle mode enabled ) { }


protected abstract string resolve username internal ( principal principal , service service , registered service registered service ) ;


updates the enablement for all actions provided by each panel

public void update action enablement ( ) { for ( code comparison panel < ? extends field panel coordinator > code comparison panel : code comparison panels ) { code comparison panel update action enablement ( ) ; } }


the percentage of calls to { @ link # calculate is error ( ) } that return { @ code true }

public int error percent ( ) { return error percent ; }


get resources using the secondary background color

public static set < string > get secondary background resources ( ) { return collections unmodifiable set ( sets new hash set ( " completion popup background " , " checkbox background disabled " , " checkbox background disabled dark " , " checkbox border disabled " , " checkbox border disabled dark " , " code with me access enabled pill background " , " code with me access enabled dropdown border " , " editor groups tabs border color " , " editor tabs border color " , " inactive caption " , " list background " , " memory indicator allocated background " , " memory indicator unused color " , / / deprecated " menu border color " , " parameter info background " , " plugins section header background " , " popup separator color " , " separator background " , " separator foreground " , " separator separator color " , " slider tick color " , " table light selection inactive background " , " text area background " , " toolbar floating background " , " tool window active header background " , " tool window header background " , " tool window header active background " , / / deprecated " tool window header border background " , / / deprecated " tool window header border color " , " u i designer motion our avg background " , " u i designer motion constraint set background " , " u i designer motion our c s background " , " welcome screen side panel background " , " welcome screen projects background " , " welcome screen projects selection inactive background " ) ) ; }


public int read ( ) throws i o exception { synchronized ( lock ) { ensure open ( ) ; for ( ; ; ) { if ( next char > = n chars ) { fill ( ) ; if ( next char > = n chars ) return - 1 ; } if ( skip l f ) { skip l f = false ; if ( cb [ next char ] = = ' \ n ' ) { next char + + ; continue ; } } return cb [ next char + + ] ; } } }


clears the { @ link view } ' s { @ link request } when the { @ link view } is detached from its { @ link android view window } and restarts the { @ link request } when the { @ link view } is re - attached from its { @ link android view window } this is an experimental api that may be removed in a future version using this method can save memory by allowing glide to more eagerly clear resources when transitioning screens or swapping adapters in scrolling views however it also substantially increases the odds that images will not be in memory if users subsequently return to a screen where images were previously loaded whether or not this happens will depend on the number of images loaded in the new screen and the size of the memory cache increasing the size of the memory cache can improve this behavior but it largely negates the memory benefits of using this method use this method with caution and measure your memory usage to ensure that it ' s actually improving your memory usage in the cases you care about

public final view target < t , z > clear on detach ( ) { if ( attach state listener ! = null ) { return this ; } attach state listener = new on attach state change listener ( ) { @ override public void on view attached to window ( view v ) { resume my request ( ) ; } @ override public void on view detached from window ( view v ) { pause my request ( ) ; } } ; maybe add attach state listener ( ) ; return this ; }


returns the total number of state entries across all keysnamespaces

public int num key value state entries ( ) { int sum = 0 ; for ( state snapshot restore state : registered k v states values ( ) ) { sum + = ( ( state table < ? , ? , ? > ) state ) size ( ) ; } return sum ; }


sections support 1 - bit flags that describe miscellaneous attributes flag definitions appear aove

public long get flags ( ) { return sh flags ; }


generates code for this table , which is not supported now

public expression get expression ( class clazz ) { throw new unsupported operation exception ( ) ; }


generate a key based on the specified parameters

public static object generate key ( object params ) { if ( params length = = 0 ) { return simple key empty ; } if ( params length = = 1 ) { object param = params [ 0 ] ; if ( param ! = null & & ! param get class ( ) is array ( ) ) { return param ; } } return new simple key ( params ) ; }


returns the points to create the range distance facets from

public geo point [ ] points ( ) { return this points to array ( new geo point [ this points size ( ) ] ) ; }


tests that the source - only formatting strategy includes relative paths only ( i e not symlinks )

public void test source only formatting ( ) throws exception { string manifest contents = get file contents as string ( create source only action ( ) ) ; assert that ( manifest contents ) is equal to ( " testing / trivial / build \ n " + " testing / trivial / init py \ n " + " testing / trivial / trivial py \ n " ) ; }


parse the string representation of this shard id back to an object we lose index uuid information here , but since we use to string in rest responses , this is the best we can do to reconstruct the object on the client side

public static shard id from string ( string shard id string ) { int split position = shard id string index of ( " ] [ " ) ; if ( split position < = 0 | | shard id string char at ( 0 ) ! = ' [ ' | | shard id string char at ( shard id string length ( ) - 1 ) ! = ' ] ' ) { throw new illegal argument exception ( " unexpected shard id string format , expected [ index name ] [ shard id ] but got " + shard id string ) ; } string index name = shard id string substring ( 1 , split position ) ; int shard id = integer parse int ( shard id string substring ( split position + 2 , shard id string length ( ) - 1 ) ) ; return new shard id ( new index ( index name , index metadata index uuid na value ) , shard id ) ; }


updates all uses of various consts to use the values in the newly assigned registers

private void update const uses ( hash map < typed constant , register spec > new regs , int orig reg count ) { / * * set of constants associated with a local variable ; used * only if collect one local is true * / final hash set < typed constant > used by local = new hash set < typed constant > ( ) ; final array list < ssa insn > [ ] use list = ssa meth get use list copy ( ) ; for ( int i = 0 ; i < orig reg count ; i + + ) { ssa insn insn = ssa meth get definition for register ( i ) ; if ( insn = = null ) { continue ; } final register spec orig reg = insn get result ( ) ; type bearer type bearer = insn get result ( ) get type bearer ( ) ; if ( ! type bearer is constant ( ) ) continue ; typed constant cst = ( typed constant ) type bearer ; final register spec new reg = new regs get ( cst ) ; if ( new reg = = null ) { continue ; } if ( ssa meth is reg a local ( orig reg ) ) { if ( ! collect one local ) { continue ; } else { / * * todo : if the same local gets the same cst * multiple times , it would be nice to reuse the * register * / if ( used by local contains ( cst ) ) { continue ; } else { used by local add ( cst ) ; fix local assignment ( orig reg , new regs get ( cst ) ) ; } } } / / maps an original const register to the new collected register register mapper mapper = new register mapper ( ) { @ override public int get new register count ( ) { return ssa meth get reg count ( ) ; } @ override public register spec map ( register spec register spec ) { if ( register spec get reg ( ) = = orig reg get reg ( ) ) { return new reg with local item ( register spec get local item ( ) ) ; } return register spec ; } } ; for ( ssa insn use : use list [ orig reg get reg ( ) ] ) { if ( use can throw ( ) & & use get block ( ) get successors ( ) cardinality ( ) > 1 ) { continue ; } use map source registers ( mapper ) ; } } }


an action can run multiple spawns those calls can be sequential or parallel if action is a sequence of calls we aggregate the spawn metrics of all the spawn results if there are multiples of the same action run in parallel , we keep the maximum runtime spawn metrics we will also set the longest phase spawn runner name to the longest running spawn runner name across all phases if it exists

void add spawn result ( spawn metrics metrics , @ nullable string runner name , string runner subtype , boolean was remote ) { / / mark this component as having remote components if any spawn result contributing / / to it contains meaningful remote metrics subsequent non - remote spawns in an action / / must not reset this flag if ( was remote ) { this remote = true ; } if ( this phase change ) { if ( ! this phase max metrics is empty ( ) ) { this total spawn metrics = this total spawn metrics sum durations max other ( phase max metrics ) ; } this phase max metrics = metrics ; this phase change = false ; } else if ( metrics total time ( ) compare to ( this phase max metrics total time ( ) ) > 0 ) { this phase max metrics = metrics ; } if ( runner name ! = null & & metrics total time ( ) compare to ( this longest running total duration ) > 0 ) { this longest phase spawn runner name = runner name ; this longest phase spawn runner subtype = runner subtype ; this longest running total duration = metrics total time ( ) ; } }


creates a successful result , with optional metadata

public static authentication result success ( user user , @ nullable map < string , object > metadata ) { return new authentication result ( status success , user , null , null , metadata ) ; }


returns { @ code true } if and only if the end of the compressed stream has been reached

public boolean is closed ( ) { return current state = = state finished ; }


tests the supplied trace against the current request this is used when the backend cannot fully refine a trace query

public boolean test ( list < span > spans ) { / / v 2 returns raw spans in any order , get the root ' s timestamp or the first timestamp long timestamp = 0l ; for ( span span : spans ) { if ( span timestamp as long ( ) = = 0l ) continue ; if ( span parent id ( ) = = null ) { timestamp = span timestamp as long ( ) ; break ; } if ( timestamp = = 0l | | timestamp > span timestamp as long ( ) ) { timestamp = span timestamp as long ( ) ; } } if ( timestamp = = 0l | | timestamp < ( end ts ( ) - lookback ( ) ) * 1000 | | timestamp > end ts ( ) * 1000 ) { return false ; } boolean tested duration = min duration ( ) = = null & & max duration ( ) = = null ; string service name to match = service name ( ) ; string remote service name to match = remote service name ( ) ; string span name to match = span name ( ) ; map < string , string > annotation query remaining = new linked hash map < string , string > ( annotation query ( ) ) ; for ( span span : spans ) { string local service name = span local service name ( ) ; / / service name , when present , constrains other queries if ( service name ( ) = = null | | service name ( ) equals ( local service name ) ) { service name to match = null ; for ( annotation a : span annotations ( ) ) { if ( " " equals ( annotation query remaining get ( a value ( ) ) ) ) { annotation query remaining remove ( a value ( ) ) ; } } for ( map entry < string , string > t : span tags ( ) entry set ( ) ) { string value = annotation query remaining get ( t get key ( ) ) ; if ( value = = null ) continue ; if ( value is empty ( ) | | value equals ( t get value ( ) ) ) { annotation query remaining remove ( t get key ( ) ) ; } } if ( remote service name to match ! = null & & remote service name to match equals ( span remote service name ( ) ) ) { remote service name to match = null ; } if ( span name to match ! = null & & span name to match equals ( span name ( ) ) ) { span name to match = null ; } if ( ! tested duration ) { if ( min duration ( ) ! = null & & max duration ( ) ! = null ) { tested duration = span duration as long ( ) > = min duration ( ) & & span duration as long ( ) < = max duration ( ) ; } else if ( min duration ( ) ! = null ) { tested duration = span duration as long ( ) > = min duration ( ) ; } } } } return ( service name ( ) = = null | | service name to match = = null ) & & remote service name to match = = null & & span name to match = = null & & annotation query remaining is empty ( ) & & tested duration ; }


private void update stat file ( long u time , long n time , long s time ) throws i o exception { file writer f writer = new file writer ( fake statfile ) ; f writer write ( string format ( stat file format , u time , n time , s time ) ) ; f writer close ( ) ; }


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

@ override public t visit listinitializer ( painless parser listinitializer context ctx ) { return visit children ( ctx ) ; }


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


public void put counters ( map < string , long > counters ) { this counters map = counters ; }


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


probes whether the object corresponding to the key is in the cache note that the act of probing touches the item ( if present in cache ) , thus changing its lru timestamp

public void probe ( k key ) { preconditions check not null ( key ) ; entry < k , v > old exclusive ; synchronized ( this ) { old exclusive = m least frequently used exclusive entries remove ( key ) ; if ( old exclusive = = null ) { old exclusive = m most frequently used exclusive entries remove ( key ) ; } if ( old exclusive ! = null ) { increase access count ( old exclusive ) ; maybe add to exclusives ( old exclusive ) ; } } }


verifies if the path informed is a valid absolute path

static boolean is valid absolute path ( final string path ) { return path ! = null & & path starts with ( path separator ) ; }


await the completion of this request ( up to the given time interval )

public boolean await ( long timeout , time unit unit ) throws interrupted exception { return latch await ( timeout , unit ) ; }


look up the offsets for the given partitions by timestamp the returned offset for each partition is the earliest offset whose timestamp is greater than or equal to the given timestamp in the corresponding partition this is a blocking call the consumer does not have to be assigned the partitions if the message format version in a partition is before 0 10 0 , i e the messages do not have timestamps , null will be returned for that partition

public map < topic partition , offset and timestamp > offsets for times ( map < topic partition , long > timestamps to search , duration timeout ) { acquire and ensure open ( ) ; try { for ( map entry < topic partition , long > entry : timestamps to search entry set ( ) ) { / / we explicitly exclude the earliest and latest offset here so the timestamp in the returned / / offset and timestamp is always positive if ( entry get value ( ) < 0 ) throw new illegal argument exception ( " the target time for partition " + entry get key ( ) + " is " + entry get value ( ) + " the target time cannot be negative " ) ; } return fetcher offsets for times ( timestamps to search , time timer ( timeout ) ) ; } finally { release ( ) ; } }


test the property ' enum string required '

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


returns whether skipping silences in the audio stream is enabled