builds a new { @ code file source } using a { @ link stream format } to read record - by - record from a file stream when possible , stream - based formats are generally easier ( preferable ) to file - based formats , because they support better default behavior around io batching or progress tracking ( checkpoints ) stream formats also automatically de - compress files based on the file extension this supports files ending in " deflate " ( deflate ) , " xz " ( xz ) , " bz 2 " ( b zip 2 ) , " gz " , " gzip " ( g zip )

public static < t > file source builder < t > for record stream format ( final stream format < t > reader , final path paths ) { check not null ( reader , " reader " ) ; check not null ( paths , " paths " ) ; check argument ( paths length > 0 , " paths must not be empty " ) ; final bulk format < t , file source split > bulk format = new stream format adapter < > ( reader ) ; return new file source builder < > ( paths , bulk format ) ; }


expands the query to another entity type by using a join the given source property is used to match the primary key property of the given destination entity

public < j > join < t , j > join ( property source property , class < j > destination entity class ) { abstract dao < j , ? > destination dao = ( abstract dao < j , ? > ) dao get session ( ) get dao ( destination entity class ) ; property destination property = destination dao get pk property ( ) ; return add join ( table prefix , source property , destination dao , destination property ) ; }


public single < void > rx update pet ( pet body , api client auth info auth info ) { return single create ( new io vertx rx java single on subscribe adapter < > ( fut - > delegate update pet ( body , auth info , fut ) ) ) ; }


register m beans with the given { @ link m bean server }

public builder register with ( m bean server m bean server ) { this m bean server = m bean server ; return this ; }


returns the property value associated with { @ code type } if any , and { @ code null } otherwise

public < t > t get property ( class < t > type ) { return properties get instance ( type ) ; }


parse and store a key - value pair first one is considered to be the cookie namevalue unknown attribute names are silently discarded

void append attribute ( int key start , int key end , int value start , int value end ) { int length = key end - key start ; if ( length = = 4 ) { parse 4 ( key start , value start , value end ) ; } else if ( length = = 6 ) { parse 6 ( key start , value start , value end ) ; } else if ( length = = 7 ) { parse 7 ( key start , value start , value end ) ; } else if ( length = = 8 ) { parse 8 ( key start , value start , value end ) ; } }


issue : add at least one assertion to this test case solution : inserted assertion to check whether the execution of the main method in { @ link app # main ( string [ ] ) } throws an exception

void should execute application without exception ( ) { assert does not throw ( ( ) - > app main ( new string [ ] { } ) ) ; }


set the value of the ' { @ code for } ' attribute defaults to the value of { @ link # get path } ; may be a runtime expression

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


group the selected vertices into one vertex that represents them all

public attributed vertex group selected vertices ( ) { mutable selected state < attributed vertex > selected v state = vv get selected vertex state ( ) ; mutable selected state < attributed edge > selected e state = vv get selected edge state ( ) ; collection < attributed vertex > selected = selected v state get selected ( ) ; if ( selected size ( ) > 1 ) { attributed vertex group vertex = collapse ( selected ) ; selected v state clear ( ) ; selected e state clear ( ) ; selected v state select ( group vertex ) ; return group vertex ; } return null ; }


protected sequenced skyframe executor get skyframe executor ( ) { return preconditions check not null ( skyframe executor ) ; }


sets whether transpositions are supported in fuzzy queries the default metric used by fuzzy queries to determine a match is the damerau - levenshtein distance formula which supports transpositions setting transposition to false will switch to classic levenshtein distance < br > if not set , damerau - levenshtein distance metric will be used

public query string query builder fuzzy transpositions ( boolean fuzzy transpositions ) { this fuzzy transpositions = fuzzy transpositions ; return this ; }


checks whether the specified method should be optimized

public static boolean should optimize ( string canonical method name ) { / / optimize only what ' s in the optimize list if ( optimize list ! = null ) { return optimize list contains ( canonical method name ) ; } / * * or don ' t optimize what ' s listed here ( the two lists are * mutually exclusive * / if ( dont optimize list ! = null ) { return ! dont optimize list contains ( canonical method name ) ; } / / if neither list has been specified , then optimize everything return true ; }


void read xml config ( file xml config file ) throws i o exception , parser configuration exception , s a x exception { if ( ! xml config file exists ( ) ) { return ; } system out printf ( " reading config file , % s \ n " , xml config file get absolute path ( ) ) ; buffered input stream input = null ; try { document builder factory factory = document builder factory new instance ( ) ; input = new buffered input stream ( new file input stream ( xml config file ) ) ; input source source = new input source ( input ) ; factory set namespace aware ( false ) ; factory set validating ( false ) ; document builder builder = factory new document builder ( ) ; / / block any external content resolving actions since we don ' t need them and a report / / says these actions may cause security problems builder set entity resolver ( new entity resolver ( ) { @ override public input source resolve entity ( string public id , string system id ) throws s a x exception , i o exception { return new input source ( ) ; } } ) ; document document = builder parse ( source ) ; node list issues = document get elements by tag name ( tag issue ) ; for ( int i = 0 , count = issues get length ( ) ; i < count ; i + + ) { node node = issues item ( i ) ; element element = ( element ) node ; string id = element get attribute ( attr id ) ; if ( id length ( ) = = 0 ) { system err println ( " invalid config file : missing required issue id attribute " ) ; continue ; } if ( id equals ( property issue ) ) { read property from xml ( node ) ; } else if ( id equals ( dex issue ) ) { read dex patterns from xml ( node ) ; } else if ( id equals ( so issue ) ) { read lib patterns from xml ( node ) ; } else if ( id equals ( res issue ) ) { read res patterns from xml ( node ) ; } else if ( id equals ( package config issue ) ) { read package config from xml ( node ) ; } else if ( id equals ( sign issue ) ) { if ( m use sign a pk ) { read sign from xml ( node ) ; } } else if ( id equals ( arkhot issue ) ) { read ark hot property from xml ( node ) ; } else { system err println ( " unknown issue " + id ) ; } } } finally { i o helper close quietly ( input ) ; } }


gets the write buffer size for created checkpoint stream if not explicitly configured , this is the default value of { @ link checkpointing options # fs write buffer size }

public int get write buffer size ( ) { return write buffer size > = 0 ? write buffer size : checkpointing options fs write buffer size default value ( ) ; }


the optinal style from which this style inherits attributes < code > optional aapt pb reference parent = 1 ; < code >

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


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


checks if the given name is already used or not if yes , it throws a { @ link malformed pattern exception }

public void check name uniqueness ( string name ) { if ( used names contains ( name ) ) { throw new malformed pattern exception ( " duplicate pattern name : " + name + " names must be unique " ) ; } used names add ( name ) ; }


perform static checking whether the given method matches if this returns { @ code false } or if the { @ link # is runtime ( ) } method returns { @ code false } , no runtime check ( i e no { @ link # matches ( java lang reflect method , class , object [ ] ) } call ) will be made

boolean matches ( method method , class < ? > target class ) ;


return the nanoseconds until the next scheduled task is ready to be run or { @ code - 1 } if no task is scheduled

protected final long next scheduled task nano ( ) { scheduled future task < ? > scheduled task = peek scheduled task ( ) ; return scheduled task ! = null ? scheduled task delay nanos ( ) : - 1 ; }


for use with { @ code merged configured target } and similar , where we create a virtual { @ link configured target } corresponding to the same { @ link target }

public configured target and data from configured target ( configured target maybe new ) { if ( configured target equals ( maybe new ) ) { return this ; } return new configured target and data ( maybe new , target , configuration , transition keys ) ; }


determines whether the exception is recoverable using exponential - backoff

protected static boolean is recoverable exception ( amazon service exception ex ) { if ( ex get error type ( ) = = null ) { return false ; } switch ( ex get error type ( ) ) { case client : return ex instanceof provisioned throughput exceeded exception ; case service : case unknown : return true ; default : return false ; } }


public void remove acl ( path path ) throws i o exception { map < string , string > params = new hash map < string , string > ( ) ; params put ( op param , operation removeacl to string ( ) ) ; http u r l connection conn = get connection ( operation removeacl get method ( ) , params , path , true ) ; http exception utils validate response ( conn , http u r l connection http ok ) ; }


provides an ordering for assembled instructions appearing in the list the items with the highest preference are positioned at the top of the list

protected int compute preference ( assembly resolved constructor rc , instruction existing ) { if ( existing = = null ) { return 0 ; } string my tree = rc dump constructor tree ( ) ; string ex tree = ( ( sleigh instruction prototype ) existing get prototype ( ) ) dump constructor tree ( ) ; for ( int i = 0 ; i < my tree length ( ) ; i + + ) { if ( ! my tree starts with ( ex tree substring ( 0 , i ) ) ) { return rc get instruction length ( ) = = existing get length ( ) ? 5000 : i ; } } return 10000 ; }


get the { @ link timestamped key value store } with the given name the store can be a " regular " or global store this is often useful in test cases to pre - populate the store before the test case instructs the topology to { @ link # pipe input ( consumer record ) process an input message } , andor to check the store afterward

public < k , v > key value store < k , value and timestamp < v > > get timestamped key value store ( final string name ) { final state store store = get state store ( name , false ) ; return store instanceof timestamped key value store ? ( timestamped key value store < k , v > ) store : null ; }


invoked with the command is unsubscribed before a terminal state

public < t > void on unsubscribe ( hystrix invokable < t > command instance ) { / / do nothing by default }


determine if a set equate operation is permitted for the specified action context the current context must satisfy the following constraints : current location must correspond to an operand scalar within the default representation if an equate reference on the operand exists it must correspond to the same value for data , it must be a simple defined data unit not contained within an array or composite ( create equate cmd does not currently support such data cases ) currently markup of equates is not supported within composite or array data

protected boolean is equate permitted ( listing action context context ) { / / is the data a scalar object scalar scalar = get scalar ( context ) ; if ( scalar = = null ) { return false ; } / / is the data defined code unit cu = get code unit ( context ) ; if ( cu instanceof data ) { data data = ( data ) cu ; if ( ! data is defined ( ) ) { return false ; } data type data type = data get base data type ( ) ; if ( ! ( data type instanceof abstract integer data type ) ) { return false ; } } equate equate = get equate ( context ) ; if ( equate = = null ) { return true ; } return ! is equate equal scalar ( equate , scalar ) ; }


returns whether the shard is a relocated primary , i e not in charge anymore of replicating changes ( see { @ link replication tracker } )

public boolean is relocated primary ( ) { assert shard routing primary ( ) : " only call is relocated primary on primary shard " ; return replication tracker is relocated ( ) ; }


int allocate ( ) { return allocate ( lot size ) ; }


returns the value of this { @ code unsigned integer } as a { @ code float } , analogous to a widening primitive conversion from { @ code int } to { @ code float } , and correctly rounded

public float float value ( ) { return long value ( ) ; }


combines a user query with a time range query

public static query builder wrap in time range query ( query builder user query , string time field , long start , long end ) { query builder time query = new range query builder ( time field ) gte ( start ) lt ( end ) format ( epoch millis ) ; return new bool query builder ( ) filter ( user query ) filter ( time query ) ; }


public void finish ( ) { time = duration ; }


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


deletes all files and subdirectories in directory ( doesn ' t delete the directory passed as parameter )

public static boolean delete contents ( file directory ) { file [ ] files = directory list files ( ) ; boolean success = true ; if ( files ! = null ) { for ( file file : files ) { success & = delete recursively ( file ) ; } } return success ; }


test that enabling " search only in accessible memory blocks " only looks for strings in memory blocks that have one or more of the r , w , or x permissions set test that disabling the option allows strings to be made in all memory blocks regardless of permissions

public void test create strings in accessible memory blocks only ( ) throws exception { program test program = build program ( " xtraceroute " , false ) ; listing listing = test program get listing ( ) ; / / these inaccessible strings will be in the comment address space / memory block string [ ] inaccessible strings = new string [ ] { " gcc : ( gnu ) 3 2 20020720 ( red hat linux rawhide 3 2 - 0 1 ) " , " gcc : ( gnu ) 3 2 20020720 ( red hat linux rawhide 3 2 - 0 1 1 ) " } ; int [ ] offsets = new int [ ] { 0x 0 0 0 0 0 0 0 1 , 0x 0 0 0 0 0 2fc } ; string [ ] accessible strings = new string [ ] { " anguilla " , " q80 @ at " , " bosnia and herzegowina " , " kingdom of sweden " } ; int [ ] offsets 2 = new int [ ] { 0x 0 8 0 5 7b 6 0 , 0x 0 8 0 5 7e 3 8 , 0x 0 8 0 5 7fb 0 , 0x 0 8 0 5bc 6c } ; boolean [ ] should exist = new boolean [ ] { true , false , true , true } ; address space space = test program get language ( ) get address factory ( ) get default address space ( ) ; address [ ] inaccessible addresses = new address [ offsets length ] ; address [ ] accessible addresses = new address [ offsets 2 length ] ; for ( int i = 0 ; i < offsets length ; i + + ) { inaccessible addresses [ i ] = addr ( space , offsets [ i ] ) ; } for ( int i = 0 ; i < offsets 2 length ; i + + ) { accessible addresses [ i ] = addr ( space , offsets 2 [ i ] ) ; } data data here ; / / verify none of the strings exist prior to running the strings analyzer for ( address curr address : inaccessible addresses ) { data here = listing get defined data at ( curr address ) ; assert null ( data here ) ; } for ( address curr address : accessible addresses ) { data here = listing get defined data at ( curr address ) ; assert null ( data here ) ; } auto analysis manager manager = auto analysis manager get analysis manager ( test program ) ; / / set to search only accessible memory blocks we don ' t expect to find the / / ' inaccessible ' strings in this case strings analyzer analyzer = new strings analyzer ( ) ; analyzer set search accessible memory blocks ( true ) ; analyzer set string end alignment ( 1 ) ; analyzer set require null termination ( false ) ; analyzer added ( test program , null , monitor , manager get message log ( ) ) ; / / verify the inaccessible strings still don ' t exist for ( address curr address : inaccessible addresses ) { data here = listing get defined data at ( curr address ) ; assert null ( data here ) ; } / / but most of the accessible strings should exist string string here ; for ( int i = 0 ; i < accessible addresses length ; i + + ) { data here = listing get defined data at ( accessible addresses [ i ] ) ; if ( should exist [ i ] ) { assert not null ( data here ) ; string here = data here get default value representation ( ) ; / / string will look something like - - > " my string " , 00 string build my string = " \ " " + accessible strings [ i ] + " \ " " ; assert equals ( build my string , string here ) ; } else { assert null ( data here ) ; } } / / set to search all memory blocks analyzer set search accessible memory blocks ( false ) ; analyzer added ( test program , null , monitor , manager get message log ( ) ) ; for ( int i = 0 ; i < inaccessible strings length ; i + + ) { / / verify formerly inaccessible strings are now there data here = listing get defined data at ( inaccessible addresses [ i ] ) ; assert not null ( data here ) ; string here = data here get default value representation ( ) ; / / string will look something like - - > " my string " , 00 string build my string = " \ " " + inaccessible strings [ i ] + " \ " " ; assert equals ( build my string , string here ) ; } }


get the annotated classes that were declared via { @ link context configuration @ context configuration } note : this is a mutable property the returned value may therefore represent a processed value that does not match the original value declared via { @ link context configuration @ context configuration }

public class < ? > [ ] get classes ( ) { return this classes ; }


public static void set short ( memory segment [ ] segments , int offset , short value ) { if ( in first segment ( segments , offset , 2 ) ) { segments [ 0 ] put short ( offset , value ) ; } else { set short multi segments ( segments , offset , value ) ; } }


set the { @ link async uncaught exception handler } to use to handle uncaught exceptions thrown by asynchronous method executions

public void set exception handler ( async uncaught exception handler exception handler ) { this exception handler = singleton supplier of ( exception handler ) ; }


runs < code > bazel build & lt ; args & gt ; < code > and returns the result asserts that the process exit code is zero does not assert that the error stream is empty

public process result build ( string args ) throws exception { return run binary ( " build " , args ) ; }


aggregations should use this method to define a { @ link values source type } of last resort this will only be used when the resolver can ' t find a field and the user hasn ' t provided a value type hint

protected abstract values source type default value source type ( ) ;


given data and error - correction codewords received , possibly corrupted by errors , attempts to correct the errors in - place using reed - solomon error correction

private void correct errors ( byte [ ] codeword bytes , int num data codewords ) throws checksum exception { int num codewords = codeword bytes length ; / / first read into an array of ints int [ ] codewords ints = new int [ num codewords ] ; for ( int i = 0 ; i < num codewords ; i + + ) { codewords ints [ i ] = codeword bytes [ i ] & 0x f f ; } try { rs decoder decode ( codewords ints , codeword bytes length - num data codewords ) ; } catch ( reed solomon exception ignored ) { throw checksum exception get checksum instance ( ) ; } / / copy back into array of bytes - - only need to worry about the bytes that were data / / we don ' t care about errors in the error - correction codewords for ( int i = 0 ; i < num data codewords ; i + + ) { codeword bytes [ i ] = ( byte ) codewords ints [ i ] ; } }


{ @ code true } if the first write request shouldn ' t be encrypted

public ssl context builder start tls ( boolean start tls ) { this start tls = start tls ; return this ; }


recursively explores the space of possible canonical names for a given binary class name

private static type element resolve type ( elements elements , string class name , string builder sb , final int index ) { / / we assume ' $ ' should be converted to ' ' so we search for classes with dots first sb set char at ( index , ' ' ) ; int next index = next dollar ( class name , sb , index + 1 ) ; type element type = next index = = - 1 ? get type element ( elements , sb ) : resolve type ( elements , class name , sb , next index ) ; if ( type ! = null ) { return type ; } / / if not found , change back to dollar and search sb set char at ( index , ' $ ' ) ; next index = next dollar ( class name , sb , index + 1 ) ; return next index = = - 1 ? get type element ( elements , sb ) : resolve type ( elements , class name , sb , next index ) ; }


create a builder with an { @ linkplain http status # accepted accepted } status

public static body builder accepted ( ) { return status ( http status accepted ) ; }


void create awb packages ( ) throws execution exception , interrupted exception , i o exception { file awb apk output dir = app variant context get awb apk output dir ( ) ; file utils clean output dir ( awb apk output dir ) ; atlas dependency tree atlas dependency tree = atlas build context android dependency trees get ( get variant name ( ) ) ; if ( null = = atlas dependency tree ) { return ; } executor services helper executor services helper = new executor services helper ( task name , get logger ( ) , 0 ) ; list < runnable > runnables = new array list < > ( ) ; final atomic long dex total time = new atomic long ( 0 ) ; final atomic long package total time = new atomic long ( 0 ) ; final map < string , long [ ] > monitors = new hash map < string , long [ ] > ( ) ; long start time = system current time millis ( ) ; for ( final awb bundle awb bundle : atlas dependency tree get awb bundles ( ) ) { if ( awb bundle is m bundle ) { continue ; } runnables add ( ( ) - > { try { long start = system current time millis ( ) ; / / create dex file dex output file = app variant context get awb dex output ( awb bundle get name ( ) ) ; long end dex = system current time millis ( ) ; / / package app : file resource file = null ; if ( app variant context get scope ( ) use resource shrinker ( ) ) { resource file = app variant output context get awb compress resource package output file ( awb bundle ) ; } else { resource file = app variant output context get awb android resources map ( ) get ( awb bundle get name ( ) ) get package output file ( ) ; } if ( ! resource file exists ( ) ) { resource file = app variant output context get awb android resources map ( ) get ( awb bundle get name ( ) ) get package output file ( ) ; } set < file > dex folders = new hash set < file > ( ) ; dex folders add ( dex output file ) ; set < file > jni folders = sets new hash set ( ) ; if ( app variant output context get awb jni folder ( awb bundle ) ! = null & & app variant output context get awb jni folder ( awb bundle ) exists ( ) ) { jni folders add ( app variant output context get awb jni folder ( awb bundle ) ) ; } set < file > java resources locations = sets new hash set ( ) ; if ( app variant context get atlas extension ( ) get t build config ( ) is incremental ( ) & & awb bundle get all library aars ( ) size ( ) > 1 ) { file base awb = app variant output context get variant context ( ) ap context get base awb ( awb bundle get awb so name ( ) ) ; if ( base awb ! = null ) { zip file files = new zip file ( base awb ) ; zip entry entry = files get entry ( " classes dex " ) ; if ( entry = = null ) { throw new dex exception ( " expected classes dex in " + base awb ) ; } file file = new file ( dex output file , " classes dex " ) ; com android dex dex [ ] dexes = new com android dex dex [ 2 ] ; dexes [ 0 ] = new com android dex dex ( file ) ; dexes [ 1 ] = new com android dex dex ( files get input stream ( entry ) ) ; com android dex dex merged = new dex merger ( dexes , collision policy keep first , new dx context ( ) ) merge ( ) ; merged write to ( file ) ; java resources locations add ( base awb ) ; } } if ( app variant context get atlas extension ( ) get t build config ( ) get merge awb java res ( ) ) { java resources locations add ( new file ( app variant output context get awb java res folder ( awb bundle ) , " res jar " ) ) ; } awb apk package task awb apk package task = new awb apk package task ( get project ( ) files ( resource file ) , app variant context , awb bundle , app variant output context , get project ( ) files ( dex folders ) , get project ( ) files ( java resources locations ) , get project ( ) files ( app variant output context get variant context ( ) get merge assets ( awb bundle ) ) , get project ( ) files ( jni folders ) , get project ( ) files ( awb bundle get merged manifest ( ) ) , get builder ( ) , config get min sdk version ( ) get api level ( ) , get name ( ) ) ; file awb file = awb apk package task do full task action ( ) ; bundles put ( awb bundle , awb file ) ; / / / / / / todo 2 3 / / atlas build context android builder map get ( get project ( ) ) / / old package apk ( resource file get absolute path ( ) , / / dex folders , / / java resources locations , / / jni folders , / / null , / / get abi filters ( ) , / / config get build type ( ) is jni debuggable ( ) , / / null , / / get output file ( awb bundle ) , / / config get min sdk version ( ) get api level ( ) , / / new com google common base predicate < string > ( ) { / / @ override / / public boolean apply ( @ nullable string s ) { / / return false ; / / } / / } ) ; long end package = system current time millis ( ) ; dex total time add and get ( end dex - start ) ; package total time add and get ( end package - end dex ) ; monitors put ( awb bundle get name ( ) , new long [ ] { end dex - start , end package - end dex } ) ; } catch ( throwable e ) { / / e print stack trace ( ) ; throw new gradle exception ( " package " + awb bundle get name ( ) + " failed " , e ) ; } } ) ; } executor services helper execute ( runnables ) ; get logger ( ) info ( " > > > > > package awbs > > > > > > > > > > > > " ) ; file logger file logger = file logger get instance ( " package awbs " ) ; file logger log ( " total time is " + ( system current time millis ( ) - start time ) ) ; file logger log ( " dex total time is " + dex total time ) ; file logger log ( " package total time is " + package total time ) ; string format = " [ packageawb ] bundle : % 5 0s dex time : % 1 0d package time : % 1 0d " ; for ( string bundle : monitors key set ( ) ) { long [ ] value = monitors get ( bundle ) ; file logger log ( string format ( format , bundle , value [ 0 ] , value [ 1 ] ) ) ; } get logger ( ) info ( " > > > > > package awbs > > > > > > > > > > > > " ) ; package application package application = app variant context get scope ( ) get package application task ( ) get ( new task container adaptor ( app variant context get scope ( ) get global scope ( ) get project ( ) get tasks ( ) ) ) ; package application do first ( new first apk action ( app variant output context ) ) ; package application do last ( new last apk action ( ) ) ; }


build call for test body with query params

public okhttp 3 call test body with query params call ( string query , user body , final api callback callback ) throws api exception { object local var post body = body ; / / create path and map variables api operation api operation = local var api client get operation lookup map ( ) get ( " test body with query params " ) ; if ( api operation = = null ) { throw new api exception ( " operation not found in oas " ) ; } operation operation = api operation get operation ( ) ; string local var path = api operation get path ( ) ; map < string , object > param map = new hash map < > ( ) ; param map put ( " query " , query ) ; list < pair > local var query params = new array list < pair > ( ) ; list < pair > local var collection query params = new array list < pair > ( ) ; map < string , string > local var header params = new hash map < string , string > ( ) ; map < string , string > local var cookie params = new hash map < string , string > ( ) ; map < string , object > local var form params = new hash map < string , object > ( ) ; local var path = local var api client fill parameters from operation ( operation , param map , local var path , local var query params , local var collection query params , local var header params , local var cookie params ) ; final string [ ] local var accepts = { } ; final string local var accept = local var api client select header accept ( local var accepts ) ; if ( local var accept ! = null ) { local var header params put ( " accept " , local var accept ) ; } final string [ ] local var content types = { " application / json " } ; final string local var content type = local var api client select header content type ( local var content types ) ; local var header params put ( " content - type " , local var content type ) ; string [ ] local var auth names = new string [ ] { } ; return local var api client build call ( local var path , api operation get method ( ) , local var query params , local var collection query params , local var post body , local var header params , local var cookie params , local var form params , local var auth names , callback ) ; }


if - - enable platform specific config is true and the corresponding config definition exists , we should enable the platform specific config

private static boolean should enable platform specific config ( option value description enable platform specific config description , list multimap < string , rc chunk of args > command to rc args , list < string > commands to parse ) { if ( enable platform specific config description = = null | | ! ( boolean ) enable platform specific config description get value ( ) ) { return false ; } for ( string command name : commands to parse ) { string default config def = command name + " : " + get platform name ( ) ; if ( command to rc args contains key ( default config def ) ) { return true ; } } return false ; }


public static long get time span ( final date date 1 , final date date 2 , @ time constants unit final int unit ) { return millis 2 time span ( date 2 millis ( date 1 ) - date 2 millis ( date 2 ) , unit ) ; }


provides a reproducible source of randomness seeded by a long seed in the settings with the key setting

public static random get ( settings settings , setting < long > setting ) { if ( setting exists ( settings ) ) { return new random ( setting get ( settings ) ) ; } else { return get ( ) ; } }


public codegen type get tag ( ) { return codegen type server ; }


public void set show vr button ( boolean show vr button ) { control view layout manager set show button ( vr button , show vr button ) ; }


test creation of a leaf queue and its parent

public void test create leaf queue and parent ( ) { f s queue q 2 = queue manager create queue ( " root queue 1 queue 2 " , f s queue type leaf ) ; assert not null ( " parent queue root queue 1 was not created " , queue manager get parent queue ( " root queue 1 " , false ) ) ; assert not null ( " leaf queue root queue 1 queue 2 was not created " , queue manager get leaf queue ( " root queue 1 queue 2 " , false ) ) ; assert equals ( " create queue ( ) returned wrong queue " , " root queue 1 queue 2 " , q 2 get name ( ) ) ; }


returns a base 6 4 encoded version of a version 4 0 compatible uuid as defined here : http : www ietf orgrfcrfc 4 1 2 2 txt

public string get base 6 4 u u i d ( ) { return get base 6 4 u u i d ( secure random holder instance ) ; }


returns an array containing all of the elements in this queue , in proper sequence ; the runtime type of the returned array is that of the specified array if the queue fits in the specified array , it is returned therein otherwise , a new array is allocated with the runtime type of the specified array and the size of this queue if this queue fits in the specified array with room to spare ( i e , the array has more elements than this queue ) , the element in the array immediately following the end of the queue is set to < tt > null < tt > like the { @ link # to array ( ) } method , this method acts as bridge between array - based and collection - based a p is further , this method allows precise control over the runtime type of the output array , and may , under certain circumstances , be used to save allocation costs suppose < tt > x < tt > is a queue known to contain only strings the following code can be used to dump the queue into a newly allocated array of < tt > string < tt > : string [ ] y = x to array ( new string [ 0 ] ) ; note that < tt > to array ( new object [ 0 ] ) < tt > is identical in function to < tt > to array ( ) < tt >

public < t > t [ ] to array ( t [ ] a ) { final e [ ] items = this items ; final monitor monitor = this monitor ; monitor enter ( ) ; try { if ( a length < count ) a = object arrays new array ( a , count ) ; int k = 0 ; int i = take index ; while ( k < count ) { / / this cast is not itself safe , but the following statement / / will fail if the runtime type of items [ i ] is not assignable / / to the runtime type of a [ k + + ] , which is all that the method / / contract requires ( see @ throws array store exception above ) @ suppress warnings ( " unchecked " ) t t = ( t ) items [ i ] ; a [ k + + ] = t ; i = inc ( i ) ; } if ( a length > count ) a [ count ] = null ; return a ; } finally { monitor leave ( ) ; } }


resolves a seek based on the parameters , given the requested seek position and two candidate sync points

public long resolve seek position us ( long position us , long first sync us , long second sync us ) { if ( tolerance before us = = 0 & & tolerance after us = = 0 ) { return position us ; } long min position us = util subtract with overflow default ( position us , tolerance before us , long min value ) ; long max position us = util add with overflow default ( position us , tolerance after us , long max value ) ; boolean first sync position valid = min position us < = first sync us & & first sync us < = max position us ; boolean second sync position valid = min position us < = second sync us & & second sync us < = max position us ; if ( first sync position valid & & second sync position valid ) { if ( math abs ( first sync us - position us ) < = math abs ( second sync us - position us ) ) { return first sync us ; } else { return second sync us ; } } else if ( first sync position valid ) { return first sync us ; } else if ( second sync position valid ) { return second sync us ; } else { return min position us ; } }


returns the name of the f fmpeg decoder that could be used to decode the format , or { @ code null } if it ' s unsupported

/ * package * / static string get codec name ( string mime type ) { switch ( mime type ) { case mime types audio aac : return " aac " ; case mime types audio mpeg : case mime types audio mpeg l1 : case mime types audio mpeg l2 : return " mp 3 " ; case mime types audio ac3 : return " ac 3 " ; case mime types audio e ac3 : case mime types audio e ac3 joc : return " eac 3 " ; case mime types audio truehd : return " truehd " ; case mime types audio dts : case mime types audio dts hd : return " dca " ; case mime types audio vorbis : return " vorbis " ; case mime types audio opus : return " opus " ; case mime types audio amr nb : return " amrnb " ; case mime types audio amr wb : return " amrwb " ; case mime types audio flac : return " flac " ; case mime types audio alac : return " alac " ; case mime types audio mlaw : return " pcm mulaw " ; case mime types audio alaw : return " pcm alaw " ; case mime types video h264 : return " h 2 6 4 " ; case mime types video h265 : return " hevc " ; default : return null ; } }


tells whether the function was inlined within another

public boolean was inlined within another function ( ) { return was inlined within another function ; }


this method retrieves all the app reports in the cluster , and it is reachable by using { @ link r m w s consts # apps }

apps info get apps ( http servlet request hsr , string state query , set < string > states query , string final status query , string user query , string queue query , string count , string started begin , string started end , string finish begin , string finish end , set < string > application types , set < string > application tags , string name , set < string > unselected fields ) ;


guaranteed to throw an exception and leave the table unmodified

public final void clear ( ) { throw new unsupported operation exception ( ) ; }


public okhttp 3 call get user by name call ( string username , final api callback callback ) throws api exception { object local var post body = null ; / / create path and map variables string local var path = " / user / { username } " replace all ( " \ \ { " + " username " + " \ \ } " , local var api client escape string ( username to string ( ) ) ) ; list < pair > local var query params = new array list < pair > ( ) ; list < pair > local var collection query params = new array list < pair > ( ) ; map < string , string > local var header params = new hash map < string , string > ( ) ; map < string , string > local var cookie params = new hash map < string , string > ( ) ; map < string , object > local var form params = new hash map < string , object > ( ) ; final string [ ] local var accepts = { " application / xml " , " application / json " } ; final string local var accept = local var api client select header accept ( local var accepts ) ; if ( local var accept ! = null ) { local var header params put ( " accept " , local var accept ) ; } final string [ ] local var content types = { } ; final string local var content type = local var api client select header content type ( local var content types ) ; local var header params put ( " content - type " , local var content type ) ; string [ ] local var auth names = new string [ ] { } ; return local var api client build call ( local var path , " get " , local var query params , local var collection query params , local var post body , local var header params , local var cookie params , local var form params , local var auth names , callback ) ; }


public string get application name ( ) { string app name = get property ( application properties application name property ) ; if ( app name = = null | | app name trim ( ) is empty ( ) ) { return " " ; } return app name ; }


returns a type adapter for { @ code type } , or null if this factory doesn ' t support { @ code type }

< t > type adapter < t > create ( gson gson , type token < t > type ) ;


visits a non standard attribute of the record component

public void visit attribute ( final attribute attribute ) { if ( delegate ! = null ) { delegate visit attribute ( attribute ) ; } }


similar to { @ link # cardinality ( string , int , int , string ) } , but determines only the maximum cardinality ( the minimum cardinality is 0 )

public static abstract constraint max cardinality ( string scope , int max cardinality , string allocation tags ) { return cardinality ( scope , 0 , max cardinality , allocation tags ) ; }


check the consistency of this index table

boolean is consistent ( task monitor monitor ) throws i o exception , cancelled exception { return index table is consistent ( primary table get schema ( ) get field names ( ) [ index column ] , monitor ) ; }


gets the names and order of the actions to be included in the notification at the current player state the playback and custom actions are combined and placed in the following order if not omitted : + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + | prev | & lt ; & lt ; | playpause | & gt ; & gt ; | next | custom actions | stop | + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + this method can be safely overridden however , the names must be of the playback actions { @ link # action pause } , { @ link # action play } , { @ link # action fast forward } , { @ link # action rewind } , { @ link # action next } or { @ link # action previous } , or a key contained in the map returned by { @ link custom action receiver # create custom actions ( context , int ) } otherwise the action name is ignored

protected list < string > get actions ( player player ) { boolean enable previous = false ; boolean enable rewind = false ; boolean enable fast forward = false ; boolean enable next = false ; timeline timeline = player get current timeline ( ) ; if ( ! timeline is empty ( ) & & ! player is playing ad ( ) ) { timeline get window ( player get current window index ( ) , window ) ; enable previous = window is seekable | | ! window is dynamic | | player has previous ( ) ; enable rewind = control dispatcher is rewind enabled ( ) ; enable fast forward = control dispatcher is fast forward enabled ( ) ; enable next = window is dynamic | | player has next ( ) ; } list < string > string actions = new array list < > ( ) ; if ( use previous action & & enable previous ) { string actions add ( action previous ) ; } if ( enable rewind ) { string actions add ( action rewind ) ; } if ( use play pause actions ) { if ( should show pause button ( player ) ) { string actions add ( action pause ) ; } else { string actions add ( action play ) ; } } if ( enable fast forward ) { string actions add ( action fast forward ) ; } if ( use next action & & enable next ) { string actions add ( action next ) ; } if ( custom action receiver ! = null ) { string actions add all ( custom action receiver get custom actions ( player ) ) ; } if ( use stop action ) { string actions add ( action stop ) ; } return string actions ; }


copies a value from a specified path into the cache , computing the cache key itself

public synchronized string put ( path source path , key type key type , string canonical id ) throws i o exception , interrupted exception { string cache key = get checksum ( key type , source path ) ; put ( cache key , source path , key type , canonical id ) ; return cache key ; }


callback on exception in do lock retry on conflict

protected void on exception ( exception e ) throws exception { }


a util function to retrieve specific additional sasl property from config used by subclasses to read sasl properties used by themselves

static map < string , string > get sasl properties ( configuration conf , string config key , quality of protection default q o p ) { map < string , string > sasl props = new tree map < > ( ) ; string [ ] qop = conf get strings ( config key , default q o p to string ( ) ) ; for ( int i = 0 ; i < qop length ; i + + ) { qop [ i ] = quality of protection value of ( string utils to upper case ( qop [ i ] ) ) get sasl qop ( ) ; } sasl props put ( sasl qop , string utils join ( " , " , qop ) ) ; sasl props put ( sasl server auth , " true " ) ; return sasl props ; }


returns true if there are no type variables in this type


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


set the < code > container id < code > of the container

public abstract void set container id ( container id container id ) ;


set the schema resource to use for validation

public void set schema ( resource schema resource ) { this schema resources = new resource [ ] { schema resource } ; }


returns true if there is a { @ link program manager } associated with this fsb

/ * package * / boolean has program manager ( ) { return tool get service ( program manager class ) ! = null | | f s b utils get running program manager tools ( get tool ( ) ) size ( ) = = 1 ; }


finds pets by tags multiple tags can be provided with comma separated strings use tag 1 , tag 2 , tag 3 for testing

public void find pets by tags test ( ) { list < string > tags = null ; / / list < pet > response = api find pets by tags ( tags ) ; / / todo : test validations }


this method will be removed in a certain version after april 5 , 2020 , so please do not use this method

public long max offset ( message queue mq ) throws m q client exception { return this default m q push consumer impl max offset ( queue with namespace ( mq ) ) ; }


public void set object ( int parameter index , object x ) throws s q l exception { }


show the sign up page with the data from the identity

public http response commence signup ( final federated identity identity ) { / / store the identity in the session so that we can use this later stapler get current request ( ) get session ( ) set attribute ( federated identity session key , identity ) ; return new forward to view ( this , " signup with federated identity jelly " ) { @ override public void generate response ( stapler request req , stapler response rsp , object node ) throws i o exception , servlet exception { signup info si = new signup info ( identity ) ; si error message = messages hudson private security realm would you like to sign up ( identity get pronoun ( ) , identity get identifier ( ) ) ; req set attribute ( " data " , si ) ; super generate response ( req , rsp , node ) ; } } ; }


get the value of the < code > name < code > property , < code > null < code > if no such property exists if the key is deprecated , it returns the value of the first key which replaces the deprecated key and is not null values are processed for < a href = " # variable expansion " > variable expansion before being returned as a side effect get loads the properties from the sources if called for the first time as a lazy init

public string get ( string name ) { string [ ] names = handle deprecation ( deprecation context get ( ) , name ) ; string result = null ; for ( string n : names ) { result = substitute vars ( get props ( ) get property ( n ) ) ; } return result ; }


returns true if any of the filters contain this fingerprint at the specified bucket this is an expert - level api since it is dealing with buckets and fingerprints , not raw values being hashed

private boolean might contain fingerprint ( int bucket , int fingerprint ) { int alternate index = cuckoo filter alternate index ( bucket , fingerprint , num buckets ) ; for ( cuckoo filter filter : filters ) { if ( filter might contain fingerprint ( bucket , fingerprint , alternate index ) ) { return true ; } } return false ; }


tries to coordinate async counting but it is flaky due to the low 1 0s of milliseconds

void ref count async actual ( ) { final atomic integer subscribe count = new atomic integer ( ) ; final atomic integer next count = new atomic integer ( ) ; observable < long > r = observable interval ( 0 , 25 , time unit milliseconds ) do on subscribe ( new consumer < disposable > ( ) { @ override public void accept ( disposable d ) { subscribe count increment and get ( ) ; } } ) do on next ( new consumer < long > ( ) { @ override public void accept ( long l ) { next count increment and get ( ) ; } } ) publish ( ) ref count ( ) ; final atomic integer received count = new atomic integer ( ) ; disposable d 1 = r subscribe ( new consumer < long > ( ) { @ override public void accept ( long l ) { received count increment and get ( ) ; } } ) ; disposable d 2 = r subscribe ( ) ; / / give time to emit try { thread sleep ( 260 ) ; } catch ( interrupted exception e ) { } / / now unsubscribe d 2 dispose ( ) ; / / unsubscribe s 2 first as we ' re counting in 1 and there can be a race between unsubscribe and one observer getting a value but not the other d 1 dispose ( ) ; system out println ( " on next : " + next count get ( ) ) ; / / should emit once for both subscribers assert equals ( next count get ( ) , received count get ( ) ) ; / / only 1 subscribe assert equals ( 1 , subscribe count get ( ) ) ; }


specify packages to search for autodetection of your entity classes in the classpath this is analogous to spring ' s component - scan feature ( { @ link org springframework context annotation class path bean definition scanner } )

public void set packages to scan ( string packages to scan ) { this packages to scan = packages to scan ; }


called when a new type is encountered or if cached type does not match in that case we revert to a generic , but slower operator handling

object fallback ( object [ ] args ) throws throwable { if ( initialized ) { / / caching defeated method handle generic = lookup generic ( ) ; set target ( generic as type ( type ( ) ) ) ; return generic invoke with arguments ( args ) ; } final method type type = type ( ) ; method handle target = lookup ( args ) ; / / for math operators : wrong method type can be confusing convert into a class cast exception if they screw up try { target = target as type ( type ) ; } catch ( wrong method type exception e ) { exception exc = new class cast exception ( " cannot cast from : " + target type ( ) return type ( ) + " to " + type return type ( ) ) ; exc init cause ( e ) ; throw exc ; } final method handle test ; if ( flavor = = binary operator | | flavor = = shift operator ) { / / some binary operators support nulls , we handle them separate class < ? > clazz 0 = args [ 0 ] = = null ? null : args [ 0 ] get class ( ) ; class < ? > clazz 1 = args [ 1 ] = = null ? null : args [ 1 ] get class ( ) ; if ( type parameter type ( 1 ) ! = object class ) { / / case 1 : only the receiver is unknown , just check that method handle unary test = check lhs bind to ( clazz 0 ) ; test = unary test as type ( unary test type ( ) change parameter type ( 0 , type parameter type ( 0 ) ) ) ; } else if ( type parameter type ( 0 ) ! = object class ) { / / case 2 : only the argument is unknown , just check that method handle unary test = check rhs bind to ( clazz 0 ) bind to ( clazz 1 ) ; test = unary test as type ( unary test type ( ) change parameter type ( 0 , type parameter type ( 0 ) ) change parameter type ( 1 , type parameter type ( 1 ) ) ) ; } else { / / case 3 : check both receiver and argument method handle binary test = check both bind to ( clazz 0 ) bind to ( clazz 1 ) ; test = binary test as type ( binary test type ( ) change parameter type ( 0 , type parameter type ( 0 ) ) change parameter type ( 1 , type parameter type ( 1 ) ) ) ; } } else { / / unary operator method handle receiver test = check lhs bind to ( args [ 0 ] get class ( ) ) ; test = receiver test as type ( receiver test type ( ) change parameter type ( 0 , type parameter type ( 0 ) ) ) ; } method handle guard = method handles guard with test ( test , target , get target ( ) ) ; / / very special cases , where even the receiver can be null ( see jls rules for string concat ) / / we wrap + with an npe catcher , and use our generic method in that case if ( flavor = = binary operator & & ( flags & operator allows null ) ! = 0 ) { method handle handler = method handles drop arguments ( lookup generic ( ) as type ( type ( ) ) , 0 , null pointer exception class ) ; guard = method handles catch exception ( guard , null pointer exception class , handler ) ; } initialized = true ; set target ( guard ) ; return target invoke with arguments ( args ) ; }


returns true if the given target cpu is an apple platform

public static boolean is apple platform ( string target cpu ) { return for target cpu nullable ( target cpu ) ! = null ; }


creates a { @ link pattern process function } that as a result will produce strings as follows : { @ code [ current processing time ] : [ event get name ] } the event get name will occur state number times if the match does not contain n - th pattern it will replace this position with " null "

private static pattern process function < event , string > extract current processing time and names ( int state number ) { return new access context with names ( state number , context - > string value of ( context current processing time ( ) ) ) ; }


compare the remaining shorts of this buffer to another short buffer ' s remaining shorts

public int compare to ( short buffer other buffer ) { int compare remaining = ( remaining ( ) < other buffer remaining ( ) ) ? remaining ( ) : other buffer remaining ( ) ; int this pos = position ; int other pos = other buffer position ; short this byte , other byte ; while ( compare remaining > 0 ) { this byte = get ( this pos ) ; other byte = other buffer get ( other pos ) ; if ( this byte ! = other byte ) { return this byte < other byte ? - 1 : 1 ; } this pos + + ; other pos + + ; compare remaining - - ; } return remaining ( ) - other buffer remaining ( ) ; }


returns the generic supertype for { @ code supertype } for example , given a class { @ code integer set } , the result for when supertype is { @ code set class } is { @ code set < integer > } and the result when the supertype is { @ code collection class } is { @ code collection < integer > }

static type get generic supertype ( type context , class < ? > raw type , class < ? > to resolve ) { if ( to resolve = = raw type ) return context ; / / we skip searching through interfaces if unknown is an interface if ( to resolve is interface ( ) ) { class < ? > [ ] interfaces = raw type get interfaces ( ) ; for ( int i = 0 , length = interfaces length ; i < length ; i + + ) { if ( interfaces [ i ] = = to resolve ) { return raw type get generic interfaces ( ) [ i ] ; } else if ( to resolve is assignable from ( interfaces [ i ] ) ) { return get generic supertype ( raw type get generic interfaces ( ) [ i ] , interfaces [ i ] , to resolve ) ; } } } / / check our supertypes if ( ! raw type is interface ( ) ) { while ( raw type ! = object class ) { class < ? > raw supertype = raw type get superclass ( ) ; if ( raw supertype = = to resolve ) { return raw type get generic superclass ( ) ; } else if ( to resolve is assignable from ( raw supertype ) ) { return get generic supertype ( raw type get generic superclass ( ) , raw supertype , to resolve ) ; } raw type = raw supertype ; } } / / we can ' t resolve this further return to resolve ; }


test that the variable rejects a particular cell value

public void is skipped ( string input ) { cell cell = new cell ( input , null ) ; is skipped ( cell ) ; }


creates a fake { @ code test property exporter } instance , passing values to the passed - in callback

public static test property exporter create fake ( final callback callback ) { return new test property exporter ( callback ) ; }


copies this { @ code directory entry } into a writable buffer the copy is made at the buffer ' s current position , and the position is advanced , by the size of the copy

public directory entry copy ( byte buffer buffer ) { int size = get size ( ) ; directory entry view = new directory entry ( buffer slice ( ) ) ; this buffer rewind ( ) ; view buffer put ( this buffer ) flip ( ) ; buffer position ( buffer position ( ) + size ) ; this buffer rewind ( ) limit ( size ) ; return view ; }


show a animation , and depending on gone on end , will stay on the screen or be gone

public void show and animate control ( final int drawable id , final boolean gone on end ) { if ( debug ) { log d ( tag , " show and animate control ( ) called with : " + " drawable id = [ " + drawable id + " ] , gone on end = [ " + gone on end + " ] " ) ; } if ( control view animator ! = null & & control view animator is running ( ) ) { if ( debug ) { log d ( tag , " show and animate control : control view animator is running " ) ; } control view animator end ( ) ; } if ( drawable id = = - 1 ) { if ( binding control animation view get visibility ( ) = = view visible ) { control view animator = object animator of property values holder ( binding control animation view , property values holder of float ( view alpha , 1 0f , 0 0f ) , property values holder of float ( view scale x , 1 4f , 1 0f ) , property values holder of float ( view scale y , 1 4f , 1 0f ) ) set duration ( default controls duration ) ; control view animator add listener ( new animator listener adapter ( ) { @ override public void on animation end ( final animator animation ) { binding control animation view set visibility ( view gone ) ; } } ) ; control view animator start ( ) ; } return ; } final float scale from = gone on end ? 1f : 1f ; final float scale to = gone on end ? 1 8f : 1 4f ; final float alpha from = gone on end ? 1f : 0f ; final float alpha to = gone on end ? 0f : 1f ; control view animator = object animator of property values holder ( binding control animation view , property values holder of float ( view alpha , alpha from , alpha to ) , property values holder of float ( view scale x , scale from , scale to ) , property values holder of float ( view scale y , scale from , scale to ) ) ; control view animator set duration ( gone on end ? 1000 : 500 ) ; control view animator add listener ( new animator listener adapter ( ) { @ override public void on animation end ( final animator animation ) { binding control animation view set visibility ( gone on end ? view gone : view visible ) ; } } ) ; binding control animation view set visibility ( view visible ) ; binding control animation view set image drawable ( app compat resources get drawable ( context , drawable id ) ) ; control view animator start ( ) ; }


tests { @ code top hits } inside of { @ code terms } while not strictly a unit test this is a fairly common way to run { @ code top hits } and serves as a good example of running { @ code top hits } inside of another aggregation

public void test inside terms ( ) throws exception { aggregation result ; if ( random boolean ( ) ) { result = test case ( new match all docs query ( ) , terms ( " term " ) field ( " string " ) sub aggregation ( top hits ( " top " ) sort ( " string " , sort order desc ) ) ) ; } else { query query = new query parser ( " string " , new keyword analyzer ( ) ) parse ( " d ^ 1000 c ^ 100 b ^ 10 a ^ 1 " ) ; result = test case ( query , terms ( " term " ) field ( " string " ) sub aggregation ( top hits ( " top " ) ) ) ; } terms terms = ( terms ) result ; / / the " a " bucket top hits hits = ( top hits ) terms get bucket by key ( " a " ) get aggregations ( ) get ( " top " ) ; search hits search hits = ( hits ) get hits ( ) ; assert equals ( 2l , search hits get total hits ( ) value ) ; assert equals ( " 2 " , search hits get at ( 0 ) get id ( ) ) ; assert equals ( " 1 " , search hits get at ( 1 ) get id ( ) ) ; assert true ( aggregation inspection helper has value ( ( ( internal top hits ) terms get bucket by key ( " a " ) get aggregations ( ) get ( " top " ) ) ) ) ; / / the " b " bucket search hits = ( ( top hits ) terms get bucket by key ( " b " ) get aggregations ( ) get ( " top " ) ) get hits ( ) ; assert equals ( 2l , search hits get total hits ( ) value ) ; assert equals ( " 3 " , search hits get at ( 0 ) get id ( ) ) ; assert equals ( " 1 " , search hits get at ( 1 ) get id ( ) ) ; assert true ( aggregation inspection helper has value ( ( ( internal top hits ) terms get bucket by key ( " b " ) get aggregations ( ) get ( " top " ) ) ) ) ; / / the " c " bucket search hits = ( ( top hits ) terms get bucket by key ( " c " ) get aggregations ( ) get ( " top " ) ) get hits ( ) ; assert equals ( 1l , search hits get total hits ( ) value ) ; assert equals ( " 2 " , search hits get at ( 0 ) get id ( ) ) ; assert true ( aggregation inspection helper has value ( ( ( internal top hits ) terms get bucket by key ( " c " ) get aggregations ( ) get ( " top " ) ) ) ) ; / / the " d " bucket search hits = ( ( top hits ) terms get bucket by key ( " d " ) get aggregations ( ) get ( " top " ) ) get hits ( ) ; assert equals ( 1l , search hits get total hits ( ) value ) ; assert equals ( " 3 " , search hits get at ( 0 ) get id ( ) ) ; assert true ( aggregation inspection helper has value ( ( ( internal top hits ) terms get bucket by key ( " d " ) get aggregations ( ) get ( " top " ) ) ) ) ; }


get a bit - field datatype instance for a given id the upper byte of the id will be ignored

static final bit field data type get bit field data type ( long id , data type manager d b dtm ) { int bit size = ( int ) ( id & 0xff ) ; / / 8 - bits int bit offset = ( int ) ( ( id > > bit offset shift ) & 0xff ) ; / / 8 - bits int base type info = ( int ) ( ( id > > base type shift ) & 0xff ) ; / / 8 - bit encoded field base datatype kind base data type kind = base datatype kind get kind ( ( base type info > > 5 ) & 3 ) ; / / boolean extra storage used = ( base type info & 0x 1 0 ) ! = 0 ; data type base data type = null ; long data type index = ( id > > datatype index shift ) & max datatype index ; / / 32 - bits if ( base data type kind ! = base datatype kind none & & data type index ! = max datatype index ) { if ( base data type kind = = base datatype kind typedef ) { base data type = get type def ( data type index , dtm ) ; } else if ( base data type kind = = base datatype kind enum ) { base data type = get enum ( data type index , dtm ) ; } else { base data type = get integer type ( data type index , dtm ) ; } } try { if ( base data type = = null ) { / / use integer datatype on failure base data type = integer data type data type clone ( dtm ) ; } / / int effective bit size = get effective bit size ( bit size , base data type get length ( ) ) ; / / int storage size = get minimum storage size ( effective bit size ) ; / / if ( extra storage used ) { / / + + storage size ; / / } return new bit field d b data type ( base data type , bit size , bit offset ) ; } catch ( invalid data type exception e ) { return null ; } }


excludes the defined { @ link global feature } from the set of supported features

public builder exclude global features ( global feature global feature ) { this global features remove all ( arrays stream ( global feature ) collect ( collectors to list ( ) ) ) ; return this ; }


generate an error if the host might be a non - bracketed i pv 6 literal uri formatting requires that i pv 6 literals be surrounded by brackets , like " [ 2001 : db 8 : : 1 ] " chain this call after { @ link # from string ( string ) } to increase the strictness of the parser , and disallow i pv 6 literals that don ' t contain these brackets note that this parser identifies i pv 6 literals solely based on the presence of a colon to perform actual validation of ip addresses , see the { @ link inet addresses # for string ( string ) } method

public host and port require brackets for i pv 6 ( ) { check argument ( ! has bracketless colons , " possible bracketless i pv 6 literal : % s " , host ) ; return this ; }


adds data which is useful for the time when the dependency graph is built up all this data will be cleaned once the dependency graph creation has finished

public < t > void put computational data ( class < t > key , t value ) { this computational data put ( key , value ) ; }


overridden version which checks for servlet context resource and uses { @ code servlet context get resource paths } to find matching resources below the web application root directory in case of other resources , delegates to the superclass version

protected set < resource > do find path matching file resources ( resource root dir resource , string sub pattern ) throws i o exception { if ( root dir resource instanceof servlet context resource ) { servlet context resource sc resource = ( servlet context resource ) root dir resource ; servlet context sc = sc resource get servlet context ( ) ; string full pattern = sc resource get path ( ) + sub pattern ; set < resource > result = new linked hash set < > ( 8 ) ; do retrieve matching servlet context resources ( sc , full pattern , sc resource get path ( ) , result ) ; return result ; } else { return super do find path matching file resources ( root dir resource , sub pattern ) ; } }


notepad pdb is here : < teexenotepad pdb 3 6 c f d 5 f 9 8 8 8 c 4 4 8 3 b 5 2 2 b 9 d b 2 4 2 d 8 4 7 8 2 notepad pdb xml is here : < tepdb xml repo location set to < tepdb xml on windows , pdb xml file should be found on non - windows , pdb xml file should be found

public void test find pdb 1 5 ( ) throws exception { created files = create files ( pdb location same as exe subdir , pdb xml location own dir ) ; file pdb = pdb parser find p d b ( test program , false , pdb xml file get parent file ( ) ) ; assert not null ( pdb ) ; if ( pdb parser on windows ) { assert equals ( pdb xml file , pdb ) ; } else { assert equals ( pdb xml file , pdb ) ; } }


construct a new u r l connection factory based on the configuration it will try to load ssl certificates when it is specified

public static u r l connection factory new default u r l connection factory ( configuration conf ) { connection configurator conn = get s s l connection configuration ( default socket timeout , default socket timeout , conf ) ; return new u r l connection factory ( conn ) ; }


adds the given options as linker options to the link command

public cc linking helper add linkopts ( iterable < string > linkopts ) { iterables add all ( this linkopts , linkopts ) ; return this ; }


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


this implementation throws an unsupported operation exception

public class loader get new temp class loader ( ) { throw new unsupported operation exception ( " get new temp class loader not supported " ) ; }


public void test d c g at six missing ratings ( ) { list < rated document > rated = new array list < > ( ) ; integer [ ] relevance ratings = new integer [ ] { 3 , 2 , 3 , null , 1 } ; search hit [ ] hits = new search hit [ 6 ] ; for ( int i = 0 ; i < 6 ; i + + ) { if ( i < relevance ratings length ) { if ( relevance ratings [ i ] ! = null ) { rated add ( new rated document ( " index " , integer to string ( i ) , relevance ratings [ i ] ) ) ; } } hits [ i ] = new search hit ( i , integer to string ( i ) , collections empty map ( ) , collections empty map ( ) ) ; hits [ i ] shard ( new search shard target ( " testnode " , new shard id ( " index " , " uuid " , 0 ) , null , original indices none ) ) ; } discounted cumulative gain dcg = new discounted cumulative gain ( ) ; eval query quality result = dcg evaluate ( " id " , hits , rated ) ; assert equals ( 12 779642067948913 , result metric score ( ) , delta ) ; assert equals ( 2 , filter unrated documents ( result get hits and ratings ( ) ) size ( ) ) ;


returns pure string representation of the id in hexadecimal this method should be used to construct things like paths etc , that require a stable representation and is therefore final

public final string to hex string ( ) { if ( this hex string = = null ) { final byte [ ] ba = new byte [ size ] ; long to byte array ( this lower part , ba , 0 ) ; long to byte array ( this upper part , ba , size of long ) ; this hex string = string utils byte to hex string ( ba ) ; } return this hex string ; }


static void write int ( int value , data output stream out ) throws i o exception { int writable u int = tl data get ( ) u int ; u int set ( value ) ; u int write ( out ) ; }


set whether the returned { @ link connection } ' s " auto commit " setting should be overridden

public void set auto commit ( boolean auto commit ) { this auto commit = auto commit ; }


wraps a { @ code runnable } for submission to the underlying executor the default implementation delegates to { @ link # wrap task ( callable ) }

protected runnable wrap task ( runnable command ) { final callable < object > wrapped = wrap task ( executors callable ( command , null ) ) ; return new runnable ( ) { @ override public void run ( ) { try { wrapped call ( ) ; } catch ( exception e ) { throw if unchecked ( e ) ; throw new runtime exception ( e ) ; } } } ; }


checks if the current security principal has one of the supplied permissions this is just a convenience function

public final void check any permission ( @ non null permission permissions ) { if ( permissions length = = 0 ) { throw new illegal argument exception ( " at least one permission must be provided " ) ; } boolean failed = ! has any permission ( permissions ) ; authentication authentication = jenkins get authentication 2 ( ) ; if ( failed ) { / / we know that none of the permissions are granted set < permission > enabled permissions = new linked hash set < > ( ) ; for ( permission p : permissions ) { while ( ! p enabled & & p implied by ! = null ) { p = p implied by ; } enabled permissions add ( p ) ; } string permissions display name = enabled permissions stream ( ) map ( p - > p group title + " / " + p name ) collect ( collectors joining ( " , " ) ) ; string error message ; if ( enabled permissions size ( ) = = 1 ) { error message = messages access denied exception 2 missing permission ( authentication get name ( ) , permissions display name ) ; } else { error message = messages access denied exception missing permissions ( authentication get name ( ) , permissions display name ) ; } throw new access denied exception ( error message ) ; } }


all method invocations on this mock can be empty - it means there were no interactions with the mock this method is useful for framework integrators and for certain edge cases manipulating the collection ( e g by removing , adding elements ) is safe and has no effect on the mock throws meaningful exception when object wrapped by mocking details is not a mock

collection < invocation > get invocations ( ) ;


return the configured reactive type registry of adapters

public reactive adapter registry get reactive adapter registry ( ) { return this reactive adapter registry ; }


protected boolean is grant type supported by ( final o auth registered service registered service , final string type ) { return o auth 2 0 utils is authorized grant type for service ( type , registered service ) ; }


public final long get long bits ( ) { return bits ; }


given an index in the range < code > 0 size ( ) - 1 < code > , returns the value from the < code > index < code > th key - value mapping that this sparse int array stores the values corresponding to indices in ascending order are guaranteed to be associated with keys in ascending order , e g , < code > value at ( 0 ) < code > will return the value associated with the smallest key and < code > value at ( size ( ) - 1 ) < code > will return the value associated with the largest key

public int value at ( int index ) { return m values [ index ] ; }


encodes an integer in a variable - length encoding , 7 bits per byte , into a destination byte [ ] , following the protocol buffer convention

public static int put var int ( int v , byte [ ] sink , int offset ) { do { / / encode next 7 bits + terminator bit int bits = v & 0x 7 f ; v > > > = 7 ; byte b = ( byte ) ( bits + ( ( v ! = 0 ) ? 0x 8 0 : 0 ) ) ; sink [ offset + + ] = b ; } while ( v ! = 0 ) ; return offset ; }


track state - in particular watch for expiration if it happens for re - creation of the zk client session

synchronized public void process ( watched event event ) { if ( event get state ( ) = = keeper state expired ) { close ( context path ) ; } }


reads data from the front of the rolling buffer

private void read data ( long absolute position , byte buffer target , int length ) { advance read to ( absolute position ) ; int remaining = length ; while ( remaining > 0 ) { int to copy = min ( remaining , ( int ) ( read allocation node end position - absolute position ) ) ; allocation allocation = read allocation node allocation ; target put ( allocation data , read allocation node translate offset ( absolute position ) , to copy ) ; remaining - = to copy ; absolute position + = to copy ; if ( absolute position = = read allocation node end position ) { read allocation node = read allocation node next ; } } }


check service name , clusters is subscribed

public boolean is subscribed ( string service name , string clusters ) { string key = service info get key ( service name , clusters ) ; concurrent hash set < event listener > event listeners = listener map get ( key ) ; return collection utils is not empty ( event listeners ) ; }


gets called when the user clicks on the ok action for the dialog

protected void ok callback ( ) { list < domain file > list = new array list < > ( ) ; for ( int i = 0 ; i < checkboxes length ; i + + ) { if ( checkboxes [ i ] is selected ( ) ) { list add ( files get ( i ) ) ; } } if ( list size ( ) > 0 ) { domain file [ ] delete files = new domain file [ list size ( ) ] ; save task task = new save task ( list to array ( delete files ) ) ; new task launcher ( task , get component ( ) ) ; } else { operation completed = true ; close ( ) ; } }


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


returns { @ code true } if { @ code object } is an { @ code immutable int array } containing the same values as this one , in the same order

public boolean equals ( @ nullable decl object object ) { if ( object = = this ) { return true ; } if ( ! ( object instanceof immutable int array ) ) { return false ; } immutable int array that = ( immutable int array ) object ; if ( this length ( ) ! = that length ( ) ) { return false ; } for ( int i = 0 ; i < length ( ) ; i + + ) { if ( this get ( i ) ! = that get ( i ) ) { return false ; } } return true ; }


returns the time that this entry was last written , in ns

public long get write time ( ) { return 0l ; }


create an instance of { @ code joined } with a value { @ link serde } { @ code null } values are accepted and will be replaced by the default value serde as defined in config

public static < k , v , vo > joined < k , v , vo > value serde ( final serde < v > value serde ) { return new joined < > ( null , value serde , null , null ) ; }


returns the ( unordered , immutable ) set of output artifacts that this action generates ( it would not make sense for this to be empty )

immutable set < artifact > get outputs ( ) ;


set the service locator interface to use , which must have one or more methods with the signatures { @ code my type xxx ( ) } or { @ code my type xxx ( my id type id ) } ( typically , { @ code my service get service ( ) } or { @ code my service get service ( string id ) } ) see the { @ link service locator factory bean class - level javadoc } for information on the semantics of such methods

public void set service locator interface ( class < ? > interface type ) { this service locator interface = interface type ; }


return a handler mapping instance ordered at { @ link ordered # lowest precedence } containing the { @ link default servlet http request handler } instance mapped to { @ code " " } ; or { @ code null } if default servlet handling was not been enabled

protected simple url handler mapping build handler mapping ( ) { if ( this handler = = null ) { return null ; } return new simple url handler mapping ( collections singleton map ( "


public void set primary ( boolean state ) { is primary = state ; }


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


{ @ link headers # get all ( object ) } and convert each element of { @ link list } to a { @ link string }

list < string > get all as string ( char sequence name ) ;


returns the class name for { @ code key } , if { @ code key } was created with a class instance returns null if { @ code key } represents a parameterized type or an array type

public static string get class name ( string key ) { int start = 0 ; if ( key starts with ( " @ " ) | | key starts with ( " members / " ) ) { start = key last index of ( ' / ' ) + 1 ; } return ( key index of ( ' < ' , start ) = = - 1 & & key index of ( ' [ ' , start ) = = - 1 ) ? key substring ( start ) : null ; }


if the specified event collector contains any events , an informative assertion fails in the context of the specified test case

public static void assert no events ( iterable < event > event collector ) { string events string = events to string ( event collector ) ; assert that ( events string ) is empty ( ) ; }


start probe dead node and suspect node thread

void start probe scheduler ( ) { probe dead nodes scheduler thr = new thread ( new probe scheduler ( this , probe type check dead ) ) ; probe dead nodes scheduler thr set daemon ( true ) ; probe dead nodes scheduler thr start ( ) ; probe suspect nodes scheduler thr = new thread ( new probe scheduler ( this , probe type check suspect ) ) ; probe suspect nodes scheduler thr set daemon ( true ) ; probe suspect nodes scheduler thr start ( ) ; }


returns the same range relative to the reversed comparator

general range < t > reverse ( ) { general range < t > result = reverse ; if ( result = = null ) { result = new general range < t > ( ordering from ( comparator ) reverse ( ) , has upper bound , get upper endpoint ( ) , get upper bound type ( ) , has lower bound , get lower endpoint ( ) , get lower bound type ( ) ) ; result reverse = this ; return this reverse = result ; } return result ; }


returns the number of writable bytes which is equal to { @ code ( this capacity - this writer index ) }


the wire size of some outbound data is revealed this can only used to record the accumulative outbound wire size there is no guarantee wrt timing or granularity of this method

public void outbound wire size ( long bytes ) { }


subscribes listener to spec model updates removes subscription once parent is disposed

public void subscribe ( spec update notifier listener , disposable parent ) { listeners add ( listener ) ; disposer register ( parent , ( ) - > listeners remove ( listener ) ) ; }


gets the { @ code settings initial window size } value if unavailable , returns { @ code null }

public integer initial window size ( ) { return get int value ( settings initial window size ) ; }


creates and returns an exit code that has the same numeric code as another exit code this is to allow the duplicate error codes listed above to be registered , but is private to prevent other users from creating duplicate error codes in the future

private static exit code create unregistered ( int code , string name ) { return new exit code ( code , name , / * infrastructure failure = * / false , / * register = * / false ) ; }


public < t > param converter < t > get converter ( final class < t > raw type , final type generic type , final annotation [ ] annotations ) { if ( optional class equals ( raw type ) ) { final list < class type pair > ctps = reflection helper get type argument and class ( generic type ) ; final class type pair ctp = ( ctps size ( ) = = 1 ) ? ctps get ( 0 ) : null ; if ( ctp = = null | | ctp raw class ( ) = = string class ) { return new param converter < t > ( ) { @ override public t from string ( final string value ) { return raw type cast ( optional of nullable ( value ) ) ; } @ override public string to string ( final t value ) { return value to string ( ) ; } } ; } for ( param converter provider provider : providers get providers ( manager , param converter provider class ) ) { final param converter < ? > converter = provider get converter ( ctp raw class ( ) , ctp type ( ) , annotations ) ; if ( converter ! = null ) { return new param converter < t > ( ) { @ override public t from string ( final string value ) { return raw type cast ( optional of nullable ( value ) map ( s - > converter from string ( value ) ) ) ; } @ override public string to string ( final t value ) { return value to string ( ) ; } } ; } } } return null ; }


this directory is bin in eclipse ; it will be a resources directory in the classpath when run in batch mode the directory is one specifically created by and for this test

private file get classes directory ( ) throws file not found exception { file file = get test data type file ( ) ; if ( file = = null ) { throw new file not found exception ( " could not find resource test data type txt " ) ; } file parent = file get parent file ( ) ; string parent path = parent get absolute path ( ) ; int pos = parent path last index of ( " ghidra " ) ; string dest path = parent path substring ( 0 , pos - 1 ) ; string newpath = dest path + file separator + " ghidra " + file separator + " app " + file separator + " test " ; return new file ( newpath ) ; }


public void test multiple commands carry over multiple buckets and then age out ( ) throws interrupted exception { hystrix command group key group key = hystrix command group key factory as key ( " thread pool - concurrency - f " ) ; hystrix thread pool key thread pool key = hystrix thread pool key factory as key ( " thread pool - concurrency - f " ) ; hystrix command key key = hystrix command key factory as key ( " rolling concurrency - f " ) ; stream = rolling thread pool max concurrency stream get instance ( thread pool key , 10 , 100 ) ; stream start caching stream values if unstarted ( ) ; final count down latch latch = new count down latch ( 1 ) ; stream observe ( ) take ( 30 ) subscribe ( get subscriber ( latch ) ) ; command cmd 1 = command from ( group key , key , hystrix event type success , 300 ) ; command cmd 2 = command from ( group key , key , hystrix event type success , 300 ) ; command cmd 3 = command from ( group key , key , hystrix event type success , 10 ) ; command cmd 4 = command from ( group key , key , hystrix event type success , 10 ) ; cmd 1 observe ( ) ; thread sleep ( 100 ) ; / / bucket roll cmd 2 observe ( ) ; thread sleep ( 100 ) ; cmd 3 observe ( ) ; thread sleep ( 100 ) ; cmd 4 observe ( ) ; assert true ( latch await ( 10000 , time unit milliseconds ) ) ; assert equals ( 0 , stream get latest rolling max ( ) ) ; }


get znode path based on full path and split index supplied

private string get split znode parent ( string path , int split index ) { / / calculated as string up to index ( path length - split index - 1 ) we / / deduct 1 to exclude path separator return path substring ( 0 , path length ( ) - split index - 1 ) ; }


returns true if windows - sandbox should be used for this build returns true if requested in [ " auto " , " yes " ] and binary is valid throws an error if state is " yes " and binary is not valid

private static boolean should use windows sandbox ( tri state requested , path fragment binary ) throws i o exception { switch ( requested ) { case auto : return windows sandbox util is available ( binary ) ; case no : return false ; case yes : if ( ! windows sandbox util is available ( binary ) ) { throw new i o exception ( " windows - sandbox explicitly requested but \ " " + binary + " \ " could not be found or is not valid " ) ; } return true ; } throw new illegal state exception ( " not reachable " ) ; }


ensure on next can not be called after on complete

public void on next after on completed ( ) { test observable t = new test observable ( ) ; flowable < string > st = flowable unsafe create ( t ) ; subscriber < string > w = test helper mock subscriber ( ) ; st subscribe ( new safe subscriber < > ( new test subscriber < > ( w ) ) ) ; t send on next ( " one " ) ; t send on completed ( ) ; t send on next ( " two " ) ; verify ( w , times ( 1 ) ) on next ( " one " ) ; verify ( w , mockito never ( ) ) on next ( " two " ) ; verify ( w , times ( 1 ) ) on complete ( ) ; verify ( w , mockito never ( ) ) on error ( any ( throwable class ) ) ; }


after reading a corrupted block , make sure the client can correctly report the corruption to the name node

public void test report bad block ( ) throws i o exception { / / create file final path file = new path ( " / corrupted " ) ; final int length = 10 ; / / length of " corruption " final byte [ ] bytes = striped file test util generate bytes ( length ) ; d f s test util write file ( dfs , file , bytes ) ; / / corrupt the first data block int dn index = read striped file with decoding helper find first data node ( cluster , dfs , file , cell size * num data units ) ; assert assert not equals ( - 1 , dn index ) ; located striped block slb = ( located striped block ) dfs get client ( ) get located blocks ( file to string ( ) , 0 , cell size * num data units ) get ( 0 ) ; final located block [ ] blks = striped block util parse striped block group ( slb , cell size , num data units , num parity units ) ; / / find the first block file file storage dir = cluster get instance storage dir ( dn index , 0 ) ; file blk file = mini d f s cluster get block file ( storage dir , blks [ 0 ] get block ( ) ) ; assert assert true ( " block file does not exist " , blk file exists ( ) ) ; / / corrupt the block file log info ( " deliberately corrupting file " + blk file get name ( ) ) ; try ( file output stream out = new file output stream ( blk file ) ) { out write ( " corruption " get bytes ( ) ) ; } / / disable the heartbeat from dn so that the corrupted block record is kept / / in name node for ( data node dn : cluster get data nodes ( ) ) { data node test utils set heartbeats disabled for tests ( dn , true ) ; } try { / / do stateful read striped file test util verify stateful read ( dfs , file , length , bytes , byte buffer allocate ( 1024 ) ) ; / / check whether the corruption has been reported to the name node final f s namesystem ns = cluster get namesystem ( ) ; final block manager bm = ns get block manager ( ) ; block info block info = ( ns get f s directory ( ) get i node 4 write ( file to string ( ) ) as file ( ) get blocks ( ) ) [ 0 ] ; assert assert equals ( 1 , bm get corrupt replicas ( block info ) size ( ) ) ; } finally { for ( data node dn : cluster get data nodes ( ) ) { data node test utils set heartbeats disabled for tests ( dn , false ) ; } } }


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


public optional < encrypt table > find encrypt table ( final string logic table ) { return optional of nullable ( tables get ( logic table ) ) ; }


returns unit to nanos ( time ) , additionally ensuring the returned value is not at risk of overflowing or underflowing , by bounding the value between 0 and ( long max value 4 ) 3 actually waiting for more than 219 years is not supported !

private static long to safe nanos ( long time , time unit unit ) { long timeout nanos = unit to nanos ( time ) ; return longs constrain to range ( timeout nanos , 0l , ( long max value / 4 ) * 3 ) ; }


creates a new async stub that supports all call types for the service

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


register a new { @ link jms listener endpoint } alongside the { @ link jms listener container factory } to use to create the underlying container the { @ code factory } may be { @ code null } if the default factory has to be used for that endpoint

public void register endpoint ( jms listener endpoint endpoint , @ nullable jms listener container factory < ? > factory ) { assert not null ( endpoint , " endpoint must not be null " ) ; assert has text ( endpoint get id ( ) , " endpoint id must be set " ) ; / / factory may be null , we defer the resolution right before actually creating the container jms listener endpoint descriptor descriptor = new jms listener endpoint descriptor ( endpoint , factory ) ; synchronized ( this mutex ) { if ( this start immediately ) { / / register and start immediately assert state ( this endpoint registry ! = null , " no jms listener endpoint registry set " ) ; this endpoint registry register listener container ( descriptor endpoint , resolve container factory ( descriptor ) , true ) ; } else { this endpoint descriptors add ( descriptor ) ; } } }


return a command for determining if process with specified pid is alive

public static string [ ] get check process is alive command ( string pid ) { return get signal kill command ( 0 , pid ) ; }


return the http method of the request ( usually get or post )

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


does this database support returning result sets that should be retrieved with the jdbc call : { @ link java sql statement # get result set ( ) } ?

boolean is return result set supported ( ) ;


returns whether or not the selection is allowed to be changed into an array

public boolean is array allowed ( ) { boolean allowed = false ; if ( ! this is contiguous selection ( ) ) { return false ; } / / get the range this index is in , if its in one field range range = selection get field range ( 0 ) ; data type component comp = get component ( range get start ( ) get index ( ) int value ( ) ) ; if ( comp = = null | | comp is flexible array component ( ) | | comp is bit field component ( ) ) { return false ; } data type dt = comp get data type ( ) ; int dt len = dt get length ( ) ; / / can only create arrays from components that aren ' t broken / / ( i e component and data type are same size ) if ( ( dt len < 0 ) | | ( dt len = = comp get length ( ) ) ) { allowed = true ; } return allowed ; }


combines the given jobs overview with this

public jobs overview combine ( jobs overview jobs overview ) { return new jobs overview ( this , jobs overview ) ; }


this implementation returns false to cause a further invocation of do begin despite an already existing transaction jta implementations might support nested transactions via further { @ code user transaction begin ( ) } invocations , but never support savepoints

protected boolean use savepoint for nested transaction ( ) { return false ; }


public void test model return ( ) { / / todo : test model return }


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

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


returns a snapshot of the entry named { @ code key } , or null if it doesn ' t exist is not currently readable if a value is returned , it is moved to the head of the lru queue

public synchronized snapshot get ( string key ) throws i o exception { check not closed ( ) ; validate key ( key ) ; entry entry = lru entries get ( key ) ; if ( entry = = null ) { return null ; } if ( ! entry readable ) { return null ; } / / open all streams eagerly to guarantee that we see a single published / / snapshot if we opened streams lazily then the streams could come / / from different edits file [ ] files = new file [ value count ] ; input stream [ ] ins = new input stream [ value count ] ; try { file file ; for ( int i = 0 ; i < value count ; i + + ) { file = entry get clean file ( i ) ; files [ i ] = file ; ins [ i ] = new file input stream ( file ) ; } } catch ( file not found exception e ) { / / a file must have been deleted manually ! for ( int i = 0 ; i < value count ; i + + ) { if ( ins [ i ] ! = null ) { util close quietly ( ins [ i ] ) ; } else { break ; } } return null ; } redundant op count + + ; journal writer append ( read + ' ' + key + ' \ n ' ) ; if ( journal rebuild required ( ) ) { executor service submit ( cleanup callable ) ; } return new snapshot ( key , entry sequence number , files , ins , entry lengths ) ; }


applies { @ link longs # try parse ( string ) } to the given string and asserts that the result is as expected

private static void try parse and assert equals ( long expected , string value ) { assert equals ( expected , longs try parse ( value ) ) ; }


public void test snapshot ( ) throws exception { file snap dir = new file ( test data , " invalidsnap " ) ; zoo keeper server zks = new zoo keeper server ( snap dir , snap dir , 3000 ) ; sync request processor set snap count ( 1000 ) ; final int port = integer parse int ( hostport split ( " : " ) [ 1 ] ) ; server cnxn factory f = server cnxn factory create factory ( port , - 1 ) ; f startup ( zks ) ; log info ( " starting up the zookeeper server waiting " ) ; assert true ( client base wait for server up ( hostport , connection timeout ) , " waiting for server being up " ) ; zoo keeper zk = client base create z k client ( hostport ) ; try { / / we know this from the data files / / this node is the last node in the snapshot assert true ( zk exists ( " / 9 / 9 / 8 " , false ) ! = null ) ; } finally { zk close ( ) ; } f shutdown ( ) ; zks shutdown ( ) ; assert true ( client base wait for server down ( hostport , client base connection timeout ) , " waiting for server down " ) ; }


determine whether the given interface is a well - known internal language interface and therefore not to be considered as a reasonable proxy interface if no reasonable proxy interface is found for a given bean , it will get proxied with its full target class , assuming that as the user ' s intention

protected boolean is internal language interface ( class < ? > ifc ) { return ( ifc get name ( ) equals ( " groovy lang groovy object " ) | | ifc get name ( ) ends with ( " cglib proxy factory " ) | | ifc get name ( ) ends with ( " bytebuddy mock access " ) ) ; }


adds a route to the given handler function that handles all http { @ code put } requests that match the given pattern and predicate for instance , the following example routes put requests for " user " that contain json to the { @ code edit user } method in { @ code user controller } : < pre class = " code " > router function & lt ; server response & gt ; route = router functions route ( ) put ( " user " , request predicates content type ( media type application json ) , user controller : : edit user ) build ( ) ;

builder put ( string pattern , request predicate predicate , handler function < server response > handler function ) ;


emits one element from the source , without attaching a timestamp in most cases , this is the default way of emitting elements the timestamp that the element will get assigned depends on the time characteristic of the streaming program : on { @ link time characteristic # processing time } , the element has no timestamp on { @ link time characteristic # ingestion time } , the element gets the system ' s current time as the timestamp on { @ link time characteristic # event time } , the element will have no timestamp initially it needs to get a timestamp ( via a { @ link timestamp assigner } ) before any time - dependent operation ( like time windows )


create a task attempt for a job by creating a stub task id

public task attempt context create task attempt for job ( ) { return abstract commit i test task attempt for job ( m r builder utils new job id ( 1 , job id get id ( ) , 1 ) , job ) ; }


apply steps applies the current step on to a volume set so that we can compute next steps until we reach the desired goals

private void apply step ( step next step , disk balancer volume set current set , disk balancer volume low volume , disk balancer volume high volume ) throws exception { long used ; if ( next step ! = null ) { used = low volume get used ( ) + next step get bytes to move ( ) ; low volume set used ( used ) ; used = high volume get used ( ) - next step get bytes to move ( ) ; high volume set used ( used ) ; } / / since the volume data changed , we need to recompute the data density current set compute volume data density ( ) ; print queue ( current set get sorted queue ( ) ) ; }


get the defaultassumed stack depth change for this language

private static int get default stack depth change ( program depth program , int depth ) { prototype model default model = depth program get compiler spec ( ) get default calling convention ( ) ; int call stack mod = default model get extrapop ( ) ; int call stack shift = default model get stackshift ( ) ; if ( call stack mod ! = prototype model unknown extrapop & & call stack shift > = 0 ) { return call stack shift - call stack mod ; } return depth ; }


gets the double array for the given name

public double [ ] get doubles ( string name , double [ ] default value ) { return map contains key ( name ) ? ( double [ ] ) map get ( name ) : default value ; }


convenience wrapper that simply calls through to { @ code observer change indent ( ) }

private void change indent ( int indent ) { observer change indent ( indent ) ; }


public void delete snapshot ( final path path , final string snapshot name ) throws i o exception { final path abs f = fix relative part ( path ) ; new f s link resolver < void > ( ) { @ override public void next ( final abstract file system fs , final path p ) throws i o exception { fs delete snapshot ( p , snapshot name ) ; return null ; } } resolve ( this , abs f ) ; }


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

public void delete user ( string username ) { / / todo : implement }


sets sticky bit if this method is not called , then the builder assumes false

public builder sticky bit ( boolean sticky bit ) { this sticky bit = sticky bit ; return this ; }