add the mock for the file system calls in client protocol

public void add file system mock ( ) throws i o exception { final sorted map < string , string > fs = new concurrent skip list map < string , string > ( ) ; directory listing l = mock nn get listing ( any string ( ) , any ( ) , any boolean ( ) ) ; when ( l ) then answer ( invocation - > { string src = get src ( invocation ) ; log info ( " { } get listing ( { } ) " , ns id , src ) ; if ( fs get ( src ) = = null ) { throw new file not found exception ( " file does not exist " + src ) ; } if ( ! src ends with ( " / " ) ) { src + = " / " ; } map < string , string > files = fs sub map ( src , src + character max value ) ; list < hdfs file status > list = new array list < > ( ) ; for ( string file : files key set ( ) ) { if ( file substring ( src length ( ) ) index of ( ' / ' ) < 0 ) { hdfs file status file status = get mock hdfs file status ( file , fs get ( file ) ) ; list add ( file status ) ; } } hdfs file status [ ] array = list to array ( new hdfs file status [ list size ( ) ] ) ; return new directory listing ( array , 0 ) ; } ) ; when ( mock nn get file info ( any string ( ) ) ) then answer ( invocation - > { string src = get src ( invocation ) ; log info ( " { } get file info ( { } ) " , ns id , src ) ; return get mock hdfs file status ( src , fs get ( src ) ) ; } ) ; hdfs file status c = mock nn create ( any string ( ) , any ( ) , any string ( ) , any ( ) , any boolean ( ) , any short ( ) , any long ( ) , any ( ) , any ( ) , any ( ) ) ; when ( c ) then answer ( invocation - > { string src = get src ( invocation ) ; log info ( " { } create ( { } ) " , ns id , src ) ; boolean create parent = ( boolean ) invocation get argument ( 4 ) ; if ( create parent ) { path path = new path ( src ) get parent ( ) ; while ( ! path is root ( ) ) { log info ( " { } create parent { } " , ns id , path ) ; fs put ( path to string ( ) , " directory " ) ; path = path get parent ( ) ; } } fs put ( src , " file " ) ; return get mock hdfs file status ( src , " file " ) ; } ) ; located blocks b = mock nn get block locations ( any string ( ) , any long ( ) , any long ( ) ) ; when ( b ) then answer ( invocation - > { string src = get src ( invocation ) ; log info ( " { } get block locations ( { } ) " , ns id , src ) ; if ( ! fs contains key ( src ) ) { log error ( " { } cannot find { } for get block locations " , ns id , src ) ; throw new file not found exception ( " file does not exist " + src ) ; } return mock ( located blocks class ) ; } ) ; boolean f = mock nn complete ( any string ( ) , any string ( ) , any ( ) , any long ( ) ) ; when ( f ) then answer ( invocation - > { string src = get src ( invocation ) ; if ( ! fs contains key ( src ) ) { log error ( " { } cannot find { } for complete " , ns id , src ) ; throw new file not found exception ( " file does not exist " + src ) ; } return true ; } ) ; located block a = mock nn add block ( any string ( ) , any string ( ) , any ( ) , any ( ) , any long ( ) , any ( ) , any ( ) ) ; when ( a ) then answer ( invocation - > { string src = get src ( invocation ) ; if ( ! fs contains key ( src ) ) { log error ( " { } cannot find { } for add block " , ns id , src ) ; throw new file not found exception ( " file does not exist " + src ) ; } return get mock located block ( ns id ) ; } ) ; boolean m = mock nn mkdirs ( any string ( ) , any ( ) , any boolean ( ) ) ; when ( m ) then answer ( invocation - > { string src = get src ( invocation ) ; log info ( " { } mkdirs ( { } ) " , ns id , src ) ; boolean create parent = ( boolean ) invocation get argument ( 2 ) ; if ( create parent ) { path path = new path ( src ) get parent ( ) ; while ( ! path is root ( ) ) { log info ( " { } mkdir parent { } " , ns id , path ) ; fs put ( path to string ( ) , " directory " ) ; path = path get parent ( ) ; } } fs put ( src , " directory " ) ; return true ; } ) ; when ( mock nn get server defaults ( ) ) then answer ( invocation - > { log info ( " { } get server defaults " , ns id ) ; fs server defaults defaults = mock ( fs server defaults class ) ; when ( defaults get checksum type ( ) ) then return ( type value of ( data checksum checksum crc32 ) ) ; when ( defaults get key provider uri ( ) ) then return ( ns id ) ; return defaults ; } ) ; when ( mock nn get content summary ( any string ( ) ) ) then answer ( invocation - > { string src = get src ( invocation ) ; log info ( " { } get content summary ( { } ) " , ns id , src ) ; if ( fs get ( src ) = = null ) { throw new file not found exception ( " file does not exist " + src ) ; } if ( ! src ends with ( " / " ) ) { src + = " / " ; } map < string , string > files = fs sub map ( src , src + character max value ) ; int num files = 0 ; int num dirs = 0 ; int length = 0 ; for ( entry < string , string > entry : files entry set ( ) ) { string file = entry get key ( ) ; if ( file substring ( src length ( ) ) index of ( ' / ' ) < 0 ) { string type = entry get value ( ) ; if ( " directory " equals ( type ) ) { num dirs + + ; } else if ( " file " equals ( type ) ) { num files + + ; length + = 100 ; } } } return new content summary builder ( ) file count ( num files ) directory count ( num dirs ) length ( length ) erasure coding policy ( " " ) build ( ) ; } ) ; }


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


get the number of records appended to the batch this is updated after each append

public int num records ( ) { return ( int ) ( next offset - base offset ) ; }


tests that exception thrown in the on stop method are returned by the termination future

public void test on stop exception propagation ( ) throws exception { failing on stop endpoint rpc endpoint = new failing on stop endpoint ( akka rpc service , " failing on stop endpoint " ) ; rpc endpoint start ( ) ; completable future < void > termination future = rpc endpoint close async ( ) ; try { termination future get ( ) ; } catch ( execution exception e ) { assert true ( e get cause ( ) instanceof failing on stop endpoint on stop exception ) ; } }


the attributes of this element < code > repeated aapt pb xml attribute attribute = 4 ; < code >

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


removes all of the elements from this deque the deque will be empty after this call returns

public void clear ( ) { int h = head ; int t = tail ; if ( h ! = t ) { / / clear all cells head = tail = 0 ; int i = h ; int mask = elements length - 1 ; do { elements [ i ] = null ; i = ( i + 1 ) & mask ; } while ( i ! = t ) ; } }


returns the minimum value this chart can display on it ' s y - axis

public float get y chart min ( ) { return m y axis m axis minimum ; }


this method generate record instance by calling new intance using reflection , add register the generated value to type value cache

protected static object generate by new instance ( class clazz ) throws exception { object ret = type value cache get ( clazz ) ; if ( ret ! = null ) { return ret ; } method new instance = null ; type [ ] param types = new type [ 0 ] ; / / get new instance method with most parameters for ( method m : clazz get methods ( ) ) { int mod = m get modifiers ( ) ; if ( m get declaring class ( ) equals ( clazz ) & & modifier is public ( mod ) & & modifier is static ( mod ) & & m get name ( ) equals ( " new instance " ) ) { type [ ] pts = m get generic parameter types ( ) ; if ( new instance = = null | | ( pts length > param types length ) ) { new instance = m ; param types = pts ; } } } if ( new instance = = null ) { throw new illegal argument exception ( " type " + clazz get name ( ) + " does not have new instance method " ) ; } object [ ] args = new object [ param types length ] ; for ( int i = 0 ; i < args length ; i + + ) { args [ i ] = gen type value ( param types [ i ] ) ; } ret = new instance invoke ( null , args ) ; type value cache put ( clazz , ret ) ; return ret ; }


returns a string representation of this location

public string to string ( ) { return super to string ( ) + " , comment type = " + type ; }


get the available data that can be read from the current entry in the archive this does not indicate how much data is left in the entire archive , only in the current entry this value is determined from the entry ' s size header field and the amount of data already read from the current entry integer max value is returned in case more than integer max value bytes are left in the current entry in the archive

public int available ( ) throws i o exception { if ( this entry size - this entry offset > integer max value ) { return integer max value ; } return ( int ) ( this entry size - this entry offset ) ; }


asks this shard to stop throttling indexing to one thread

protected void deactivate throttling ( index shard shard ) { shard deactivate throttling ( ) ; }


returns the number of chars required to encode the given bytes

public static int get encoded length ( byte [ ] input array , int input offset , int input length ) { / / use long for intermediaries to protect against overflow return ( int ) ( ( 8l * input length + 14l ) / 15l ) + 1 ; }


tests addingremoving wild card as the usergroup

public void test add remove wild card ( ) { access control list acl = new access control list ( " drwho tardis " ) ; throwable th = null ; try { acl add user ( " * " ) ; } catch ( throwable t ) { th = t ; } assert that ( th ) is not null ( ) ; assert that ( th ) is instance of ( illegal argument exception class ) ; th = null ; try { acl add group ( " * " ) ; } catch ( throwable t ) { th = t ; } assert that ( th ) is not null ( ) ; assert that ( th ) is instance of ( illegal argument exception class ) ; th = null ; try { acl remove user ( " * " ) ; } catch ( throwable t ) { th = t ; } assert that ( th ) is not null ( ) ; assert that ( th ) is instance of ( illegal argument exception class ) ; th = null ; try { acl remove group ( " * " ) ; } catch ( throwable t ) { th = t ; } assert that ( th ) is not null ( ) ; assert that ( th ) is instance of ( illegal argument exception class ) ; }


inserts a new plain insn before the given instruction todo : move this somewhere more appropriate

private void insert plain insn before ( ssa insn insn , register spec list new sources , register spec new result , int new opcode , constant cst ) { insn original rop insn = insn get original rop insn ( ) ; rop new rop ; if ( new opcode = = reg ops move result pseudo ) { new rop = rops op move result pseudo ( new result get type ( ) ) ; } else { new rop = rops rop for ( new opcode , new result , new sources , cst ) ; } insn new rop insn ; if ( cst = = null ) { new rop insn = new plain insn ( new rop , original rop insn get position ( ) , new result , new sources ) ; } else { new rop insn = new plain cst insn ( new rop , original rop insn get position ( ) , new result , new sources , cst ) ; } normal ssa insn new insn = new normal ssa insn ( new rop insn , insn get block ( ) ) ; list < ssa insn > insns = insn get block ( ) get insns ( ) ; insns add ( insns last index of ( insn ) , new insn ) ; ssa meth on insn added ( new insn ) ; }


get number of source references flowing from this subroutine ( block ) all calls to this block , and all external flow type block references to this block are counted

public static int get num sources ( code block block , boolean follow indirect flows , task monitor monitor ) throws cancelled exception { return get sources ( block , null , follow indirect flows , monitor ) ; }


returns a predicate that evaluates to true if and only if the input is equivalent to { @ code target } according to this equivalence relation

public final predicate < t > equivalent to ( @ nullable decl t target ) { return new equivalent to predicate < t > ( this , target ) ; }


set the content of the request body as a byte array if the supplied byte array represents text such as xml or json , the { @ link # set character encoding character encoding } should typically be set as well

public void set content ( @ nullable byte [ ] content ) { this content = content ; this input stream = null ; this reader = null ; }


public list < timeline domain > get domains ( ) { return domains ; }


quote the url so that users specifying the host http header can ' t inject attacks

public string buffer get request u r l ( ) { string url = raw request get request u r l ( ) to string ( ) ; return new string buffer ( html quoting quote html chars ( url ) ) ; }


constructs a class pool visitor to efficiently travel to the specified classes and class members

public static class pool visitor create class pool visitor ( list keep class specifications , class visitor class visitor , member visitor member visitor , boolean shrinking , boolean optimizing , boolean obfuscating ) { multi class pool visitor multi class pool visitor = new multi class pool visitor ( ) ; if ( keep class specifications ! = null ) { for ( int index = 0 ; index < keep class specifications size ( ) ; index + + ) { keep class specification keep class specification = ( keep class specification ) keep class specifications get ( index ) ; if ( ( shrinking & & ! keep class specification allow shrinking ) | | ( optimizing & & ! keep class specification allow optimization ) | | ( obfuscating & & ! keep class specification allow obfuscation ) ) { multi class pool visitor add class pool visitor ( create class pool visitor ( keep class specification , class visitor , member visitor ) ) ; } } } return multi class pool visitor ; }


returns a spawn exec pre - populated with values for a default spawn

private static spawn exec builder default spawn exec builder ( string cmd ) { return spawn exec new builder ( ) add command args ( cmd ) set remotable ( true ) set cacheable ( true ) set progress message ( " progress message " ) set mnemonic ( " mnemonic " ) set runner ( " runner " ) set status ( " non zero exit " ) set exit code ( 23 ) ; }


provision the table with given read and write capacity units call will fail if the table is busy , or the new values match the current ones until the aws sdk lets us switch a table to on - demand , an attempt to set the io capacity to zero will fail

void provision table ( long read capacity , long write capacity ) throws i o exception { if ( read capacity = = 0 | | write capacity = = 0 ) { / / table is pay on demand throw new i o exception ( e on demand no set capacity ) ; } final provisioned throughput to provision = new provisioned throughput ( ) with read capacity units ( read capacity ) with write capacity units ( write capacity ) ; invoker retry ( " provision table " , table name , true , ( ) - > { final provisioned throughput description p = table update table ( to provision ) get provisioned throughput ( ) ; log info ( " provision table { } in region { } : read capacity units = { } , " + " write capacity units = { } " , table name , region , p get read capacity units ( ) , p get write capacity units ( ) ) ; } ) ; }


adds an unnamed value to the formatted output it is strongly encouraged to use { @ link # add ( string , char ) } instead and give value a readable name

public to string helper add value ( char value ) { return add holder ( string value of ( value ) ) ; }


public string get name ( ) { return name ; }


public boolean is left reference ( ) { return is l ref ; }


helper that fetches the current list of dangling indices

private list < dangling index info > list dangling indices ( ) { final list dangling indices response response = client ( ) admin ( ) cluster ( ) list dangling indices ( new list dangling indices request ( ) ) action get ( ) ; assert that ( response status ( ) , equal to ( rest status ok ) ) ; final list < node list dangling indices response > node responses = response get nodes ( ) ; final list < dangling index info > results = new array list < > ( ) ; for ( node list dangling indices response node response : node responses ) { results add all ( node response get dangling indices ( ) ) ; } return results ; }


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


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

public static fields find by name ( string name ) { return by name get ( name ) ; }


exit a parse tree produced by the { @ code process check } labeled alternative in { @ link eql base parser # boolean expression }

void exit process check ( eql base parser process check context ctx ) ;


applies this function to the given argument


public static bitmap to round ( final bitmap src , final boolean recycle ) { return to round ( src , 0 , 0 , recycle ) ; }


remove any values from the test bucket and the base values too

public static void remove base and bucket overrides ( final configuration conf , final string options ) { for ( string option : options ) { conf unset ( option ) ; } remove base and bucket overrides ( get test bucket name ( conf ) , conf , options ) ; }


tests if the pipeline is created properly

public void test request interceptor chain creation ( ) throws exception { r e s t request interceptor root = super get router web services ( ) create request interceptor chain ( ) ; int index = 0 ; while ( root ! = null ) { / / the current pipeline is : / / pass through r e s t request interceptor - index = 0 / / pass through r e s t request interceptor - index = 1 / / pass through r e s t request interceptor - index = 2 / / mock r e s t request interceptor - index = 3 switch ( index ) { case 0 : / / fall to the next case case 1 : / / fall to the next case case 2 : / / if index is equal to 0 , 1 or 2 we fall in this check assert assert equals ( pass through r e s t request interceptor class get name ( ) , root get class ( ) get name ( ) ) ; break ; case 3 : assert assert equals ( mock r e s t request interceptor class get name ( ) , root get class ( ) get name ( ) ) ; break ; default : assert fail ( ) ; } root = root get next interceptor ( ) ; index + + ; } assert assert equals ( " the number of interceptors in chain does not match " , 4 , index ) ; }


tests that a collision on the manual hash throws an exception

public void test manual hash assignment collision throws exception ( ) throws exception { stream execution environment env = stream execution environment create local environment ( ) ; env set parallelism ( 4 ) ; env disable operator chaining ( ) ; env add source ( new no op source function ( ) ) uid ( " source " ) map ( new no op map function ( ) ) uid ( " source " ) / / collision add sink ( new discarding sink < > ( ) ) ; / / this call is necessary to generate the job graph env get stream graph ( ) get job graph ( ) ; }


returns the index of the next ad in the specified ad group that should be played after playing { @ code ad index in ad group } , or the number of ads in the ad group if no later ads should be played

public int get next ad index to play ( int ad group index , int last played ad index ) { return ad playback state ad groups [ ad group index ] get next ad index to play ( last played ad index ) ; }


option to control creating function signature datatypes for each function defintion found in the dwarf debug data

public void set create func signatures ( boolean create func signatures ) { this create func signatures = create func signatures ; }


removes and disposes the given { @ link disposable } if it is part of this container

public boolean remove ( @ non null disposable disposable ) { if ( delete ( disposable ) ) { disposable dispose ( ) ; return true ; } return false ; }


set the node update type ( null indicates absent node update type )

public void set node update type ( node update type node update type ) { }


returns the symbol path for the parent namespace or null if the parent is the global space

public symbol path get parent ( ) { return parent path ; }


return the current nested path of this { @ link errors } object returns a nested path with a dot , i e " address " , for easy building of concatenated paths default is an empty string


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


get existing constant by name or creates new one if not exists threadsafe

private t get or create ( string name ) { t constant = constants get ( name ) ; if ( constant = = null ) { final t temp constant = new constant ( next id ( ) , name ) ; constant = constants put if absent ( name , temp constant ) ; if ( constant = = null ) { return temp constant ; } } return constant ; }


whether or not any action was taken for this test , that is there was some result that was not cached

public boolean action ran ( ) { return action ran ; }


quickly converts a hexadecimal string to a byte array

public static byte [ ] decode hex ( string hex string ) { int length = hex string length ( ) ; if ( ( length & 0x 0 1 ) ! = 0 ) { throw new illegal argument exception ( " odd number of characters " ) ; } boolean bad hex = false ; byte [ ] out = new byte [ length > > 1 ] ; for ( int i = 0 , j = 0 ; j < length ; i + + ) { int c 1 = hex string char at ( j + + ) ; if ( c 1 > ' f ' ) { bad hex = true ; break ; } final byte d 1 = digits [ c 1 ] ; if ( d 1 = = - 1 ) { bad hex = true ; break ; } int c 2 = hex string char at ( j + + ) ; if ( c 2 > ' f ' ) { bad hex = true ; break ; } final byte d 2 = digits [ c 2 ] ; if ( d 2 = = - 1 ) { bad hex = true ; break ; } out [ i ] = ( byte ) ( d 1 < < 4 | d 2 ) ; } if ( bad hex ) { throw new illegal argument exception ( " invalid hexadecimal digit : " + hex string ) ; } return out ; }


get the last job that was run using this instance

public job get result ( ) { return job ; }


creates a new data set that contains the given elements the framework will determine the type according to the based type user supplied the elements should be the same or be the subclass to the based type the sequence of elements must not be empty note that this operation will result in a non - parallel data stream source , i e a data stream source with a degree of parallelism one

public final < out > data stream source < out > from elements ( class < out > type , out data ) { if ( data length = = 0 ) { throw new illegal argument exception ( " from elements needs at least one element as argument " ) ; } type information < out > type info ; try { type info = type extractor get for class ( type ) ; } catch ( exception e ) { throw new runtime exception ( " could not create type information for type " + type get name ( ) + " ; please specify the type information manually via " + " stream execution environment # from elements ( collection , type information ) " , e ) ; } return from collection ( arrays as list ( data ) , type info ) ; }


returns a newly inserted { @ code loading value reference } , or null if the live value reference is already loading

loading value reference < k , v > insert loading value reference ( final k key , final int hash , boolean check time ) { reference entry < k , v > e = null ; lock ( ) ; try { long now = map ticker read ( ) ; pre write cleanup ( now ) ; atomic reference array < reference entry < k , v > > table = this table ; int index = hash & ( table length ( ) - 1 ) ; reference entry < k , v > first = table get ( index ) ; / / look for an existing entry for ( e = first ; e ! = null ; e = e get next ( ) ) { k entry key = e get key ( ) ; if ( e get hash ( ) = = hash & & entry key ! = null & & map key equivalence equivalent ( key , entry key ) ) { / / we found an existing entry value reference < k , v > value reference = e get value reference ( ) ; if ( value reference is loading ( ) | | ( check time & & ( now - e get write time ( ) < map refresh nanos ) ) ) { / / refresh is a no - op if loading is pending / / if check time , we want to check * after * acquiring the lock if refresh still needs / / to be scheduled return null ; } / / continue returning old value while loading + + mod count ; loading value reference < k , v > loading value reference = new loading value reference < > ( value reference ) ; e set value reference ( loading value reference ) ; return loading value reference ; } } + + mod count ; loading value reference < k , v > loading value reference = new loading value reference < > ( ) ; e = new entry ( key , hash , first ) ; e set value reference ( loading value reference ) ; table set ( index , e ) ; return loading value reference ; } finally { unlock ( ) ; post write cleanup ( ) ; } }


returns whether auto - analysis found a terminator within the flow of the function body

public boolean has terminator ( ) { byte val = record get byte value ( flags col ) ; return ( ( val & has terminator flag ) ! = 0 ) ; }


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

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


remove the eldest entries until the total of remaining entries is at or below the requested size

private void trim to size ( int max size ) { while ( true ) { string key ; bitmap value ; synchronized ( this ) { if ( size < 0 | | ( map is empty ( ) & & size ! = 0 ) ) { throw new illegal state exception ( get class ( ) get name ( ) + " size of ( ) is reporting inconsistent results ! " ) ; } if ( size < = max size | | map is empty ( ) ) { break ; } map entry < string , bitmap > to evict = map entry set ( ) iterator ( ) next ( ) ; if ( to evict = = null ) { break ; } key = to evict get key ( ) ; value = to evict get value ( ) ; map remove ( key ) ; size - = size of ( key , value ) ; } } }


set to true if snapshot should include global cluster state

public create snapshot request builder set include global state ( boolean include global state ) { request include global state ( include global state ) ; return this ; }


finalize the namenode block pools corresponding to the namenode are finalized on the datanode

private void finalize namenode ( name node nn , configuration conf ) throws exception { if ( nn = = null ) { throw new illegal state exception ( " attempting to finalize " + " namenode but it is not running " ) ; } tool runner run ( new d f s admin ( conf ) , new string [ ] { " - finalize upgrade " } ) ; }


set the default value , used if no value is set by the command - line configuration

protected simple parameter set default value ( t default value ) { this has default value = true ; this default value = default value ; return this ; }


returns the minimum length of the input prefix required to apply any edits

public int get fuzzy prefix length ( ) { return fuzzy prefix length ; }


whether the < code > run ( ) < code > resulted in a failure ( exception )

public boolean is failed execution ( ) { return get command result ( ) get event counts ( ) contains ( hystrix event type failure ) ; }


locate or create the rmi registry for this exporter

protected registry get registry ( int registry port , @ nullable r m i client socket factory client socket factory , @ nullable r m i server socket factory server socket factory ) throws remote exception { if ( client socket factory ! = null ) { if ( this always create registry ) { logger debug ( " creating new rmi registry " ) ; return locate registry create registry ( registry port , client socket factory , server socket factory ) ; } if ( logger is debug enabled ( ) ) { logger debug ( " looking for rmi registry at port ' " + registry port + " ' , using custom socket factory " ) ; } synchronized ( locate registry class ) { try { / / retrieve existing registry registry reg = locate registry get registry ( null , registry port , client socket factory ) ; test registry ( reg ) ; return reg ; } catch ( remote exception ex ) { logger trace ( " rmi registry access threw exception " , ex ) ; logger debug ( " could not detect rmi registry - creating new one " ) ; / / assume no registry found - > create new one return locate registry create registry ( registry port , client socket factory , server socket factory ) ; } } } else { return get registry ( registry port ) ; } }


manually run this to write binary snapshot data

public void write and or subtyp conditions pattern after migration snapshot ( ) throws exception { key selector < event , integer > key selector = new key selector < event , integer > ( ) { private static final long serial version u i d = - 4873366487571254798l ; @ override public integer get key ( event value ) throws exception { return value get id ( ) ; } } ; final event start event 1 = new sub event ( 42 , " start " , 1 0 , 6 0 ) ; one input stream operator test harness < event , map < string , list < event > > > harness = new keyed one input stream operator test harness < > ( get keyed cep opearator ( false , new n f a complex conditions factory ( ) ) , key selector , basic type info int type info ) ; try { harness setup ( ) ; harness open ( ) ; harness process element ( new stream record < > ( start event 1 , 5 ) ) ; harness process watermark ( new watermark ( 6 ) ) ; / / do snapshot and save to file operator subtask state snapshot = harness snapshot ( 0l , 0l ) ; operator snapshot util write state handle ( snapshot , " src / test / resources / cep - migration - conditions - flink " + flink generate savepoint version + " - snapshot " ) ; } finally { harness close ( ) ; } }


list < row > get model rows ( runtime context runtime context ) ;


public void add subchannel ( internal instrumented < channel stats > subchannel ) { add ( subchannels , subchannel ) ; }


sets the x - and y - position ( pixels ) where this highlight was last drawn

public void set draw ( float x , float y ) { this m draw x = x ; this m draw y = y ; }


returns the previous visible column in the table

private grid column get previous visible column ( grid column column ) { int index = index of ( column ) ; if ( index < = 0 ) return null ; return columns get ( index - 1 ) ; }


set the red component of { @ code color } to be { @ code red }

public static int set red component ( @ color int int color , @ float range ( from = 0 , to = 1 ) float red ) { return ( color & 0xff 0 0ffff ) | ( ( int ) ( red * 255 0f + 0 5f ) < < 16 ) ; }


returns the files necessary for an ' as ' invocation may be empty if the crosstool file does not define as files

public nested set < artifact > get as files ( ) { return as files ; }


private double [ ] concat embeddings ( list < feature value [ ] > feature vectors ) { double [ ] concat = new double [ concat layer size ] ; int offset = 0 ; / / " es index " stands for " embedding space index " for ( int es index = 0 ; es index < feature vectors size ( ) ; + + es index ) { byte [ ] embedding weight = this embeddings weights [ es index ] ; short [ ] quants = this embeddings quant scales [ es index ] ; int embedding dim = embedding dimensions [ es index ] ; feature value [ ] feature vector = feature vectors get ( es index ) ; assert ( offset + embedding dim < = concat length ) ; for ( feature value feature value : feature vector ) { / / multiplier for each embedding weight int row = feature value get row ( ) ; double multiplier = feature value get weight ( ) * short to double ( quants [ row ] ) ; / / iterate across columns for this row for ( int i = 0 ; i < embedding dim ; + + i ) { double value = ( get row major data ( embedding weight , embedding dim , row , i ) ) * multiplier ; int concat index = offset + i ; concat [ concat index ] + = value ; } } offset + = embedding dim ; } return concat ; }


this implementation returns the hash code of the underlying class path location

public int hash code ( ) { return this path hash code ( ) ; }


converts a { @ link response exception } obtained from the low level rest client into an { @ link elasticsearch exception } if a response body was returned , tries to parse it as an error returned from elasticsearch if no response body was returned or anything goes wrong while parsing the error , returns a new { @ link elasticsearch status exception } that wraps the original { @ link response exception } the potential exception obtained while parsing is added to the returned exception as a suppressed exception this method is guaranteed to not throw any exception eventually thrown while parsing

protected final elasticsearch status exception parse response exception ( response exception response exception ) { response response = response exception get response ( ) ; http entity entity = response get entity ( ) ; elasticsearch status exception elasticsearch exception ; rest status rest status = rest status from code ( response get status line ( ) get status code ( ) ) ; if ( entity = = null ) { elasticsearch exception = new elasticsearch status exception ( response exception get message ( ) , rest status , response exception ) ; } else { try { elasticsearch exception = parse entity ( entity , bytes rest response : : error from x content ) ; elasticsearch exception add suppressed ( response exception ) ; } catch ( exception e ) { elasticsearch exception = new elasticsearch status exception ( " unable to parse response body " , rest status , response exception ) ; elasticsearch exception add suppressed ( e ) ; } } return elasticsearch exception ; }


creates an ndk release for r 1 1 + ( uses source properties )

private static ndk release create from source properties ( string release string ) { properties properties = new properties ( ) ; try { properties load ( new string reader ( release string ) ) ; } catch ( i o exception e ) { / / this shouldn ' t happen from a string reader throw new illegal state exception ( e ) ; } string revision = properties get property ( revision property ) ; string [ ] revision parsed = revision split ( " \ \ " ) ; if ( revision parsed length < 2 ) { / / unable to parse pkg revision return invalid ndk release that is assumed to be the / / latest ndk revision return new ndk release ( revision , false , android ndk crosstools latest known revision get key ( ) , null , null , false ) ; } else { return new ndk release ( revision , / / raw revision / * is valid = * / true , integer parse int ( revision parsed [ 0 ] ) , / / major revision revision parsed [ 1 ] , / / minor revision null , / / release candidate true / / is 6 4 bit 32 - bit n d ks are provided for only windows ) ; } }


tests if there is an exception if all restore attempts are exhausted and failed

public void test exception thrown if all restores failed ( ) throws exception { closeable registry closeable registry = new closeable registry ( ) ; operator state handle first fail handle = mock ( operator state handle class ) ; operator state handle second fail handle = mock ( operator state handle class ) ; operator state handle third fail handle = mock ( operator state handle class ) ; list < state object collection < operator state handle > > sorted restore options = arrays as list ( new state object collection < > ( collections singleton list ( first fail handle ) ) , new state object collection < > ( collections singleton list ( second fail handle ) ) , new state object collection < > ( collections singleton list ( third fail handle ) ) ) ; backend restorer procedure < operator state backend , operator state handle > restorer procedure = new backend restorer procedure < > ( backend supplier , closeable registry , " test op state backend " ) ; try { restorer procedure create and restore ( sorted restore options ) ; assert fail ( ) ; } catch ( exception ignore ) { } verify ( first fail handle ) open input stream ( ) ; verify ( second fail handle ) open input stream ( ) ; verify ( third fail handle ) open input stream ( ) ; }


returns an array containing the modified utf - 8 form of { @ code s }

public static byte [ ] encode ( string s ) throws u t f data format exception { int utf count = ( int ) count bytes ( s , false ) ; byte [ ] result = new byte [ utf count ] ; encode ( result , 0 , s ) ; return result ; }


updates the preferences for this tool with a set of new extensions

private void add installed extensions ( set < extension details > new extensions ) { docking window manager docking window manager = docking window manager get instance ( get tool frame ( ) ) ; / / get the current preference object we need to get the existing prefs so we can add our / / new extensions to them if the extensions category doesn ' t exist yet , just create one preference state state = get extension preferences ( docking window manager ) ; / / now get the list of extensions already in the prefs string [ ] ext names = state get strings ( extensions preference name , new string [ 0 ] ) ; / / and parse the passed - in extension list to get just the names of the extensions to add list < string > extension names to add = new extensions stream ( ) map ( ext - > ext get name ( ) ) collect ( collectors to list ( ) ) ; / / finally add them together and update the preference state string [ ] all preferences = array utils add all ( ext names , extension names to add to array ( new string [ extension names to add size ( ) ] ) ) ; state put strings ( extensions preference name , all preferences ) ; docking window manager put preference state ( extensions preference name , state ) ; }


public void incr sent bytes ( int count ) { sent bytes incr ( count ) ; }


finds and returns the node with the specified label if there is no such node , an exception is thrown the null pointer is not a valid label

public node < t > get node ( t label ) { if ( label = = null ) { throw new null pointer exception ( ) ; } node < t > node = nodes get ( label ) ; if ( node = = null ) { throw new illegal argument exception ( " no such node label : " + label ) ; } return node ; }


returns true if the given address does not point to the minimum address of the containing { @ link code unit }

public static boolean is offcut ( program program , address address ) { if ( ! address is memory address ( ) ) { return false ; } listing listing = program get listing ( ) ; code unit cu = listing get code unit containing ( address ) ; if ( cu = = null ) { return false ; } if ( cu instanceof data ) { / / update the code unit for the composite data like structures and arrays , as the / / call to get code unit containing ( ) gets the outermost data , not the inner - most cu = get deepest data containing ( address , program ) ; } if ( cu get min address ( ) equals ( address ) ) { return false ; } return true ; }


merge the differences from the indicated program on the specified address set with the indicated filtering

public boolean merge ( address set view p 1 merge set , program merge filter filter , task monitor monitor ) throws memory access exception , cancelled exception { clear messages ( ) ; merger clear messages ( ) ; merger clear duplicate symbols ( ) ; merger clear duplicate equates ( ) ; address set p 1 code unit set = diff utility get code unit set ( p 1 merge set , this program 1 ) ; if ( monitor = = null ) { / / create a " do nothing " task monitor that we can pass along monitor = task monitor adapter dummy monitor ; } / / check that the needed memory addresses are available in the merge program if ( ! has merge addresses ( p 1 merge set ) ) { error msg append ( " the difference cannot be applied \ n " + " the program does not have memory defined \ n " + " for some of the indicated addresses \ n " ) ; return false ; } / / note : the order in which the following merge methods are called / / is important in some cases for example , calling the / / merge references ( ) before merge labels ( ) would lead to extra / / default labels appearing in the merge program also , you / / want to apply code unit differences before applying / / other merge differences to them merge bytes ( p 1 merge set , filter , monitor ) ; merge program context ( p 1 merge set , filter , monitor ) ; merge code units ( p 1 merge set , filter , monitor ) ; / / code units should follow program context merge comments ( p 1 merge set , filter , monitor ) ; merge functions ( p 1 merge set , filter , monitor ) ; / / functions should follow code units / / note : this should follow code units and functions so that we already / / have a " fun " label since we can ' t create default labels merge labels ( p 1 merge set , filter , monitor ) ; / / labels should follow code units & functions merge references ( p 1 merge set , filter , monitor ) ; / / references should follow labels and code units merge bookmarks ( p 1 merge set , filter , monitor ) ; merge properties ( p 1 merge set , filter , monitor ) ; merge function tags ( p 1 merge set , filter , monitor ) ; merger re apply duplicate equates ( ) ; string dup equates message = merger get duplicate equates info ( ) ; if ( dup equates message length ( ) > 0 ) { info msg append ( dup equates message ) ; } merger re apply duplicate symbols ( ) ; string dup symbols message = merger get duplicate symbols info ( ) ; if ( dup symbols message length ( ) > 0 ) { info msg append ( dup symbols message ) ; } program diff re diff sub set ( p 1 code unit set , monitor ) ; return ( error msg length ( ) = = 0 & & ! merger has error message ( ) ) ; }


public client config get default client config ( ) { client config client config = new client config ( ) ; client config register ( multi part feature class ) ; client config register ( json ) ; client config register ( jackson feature class ) ; client config property ( http url connector provider set method workaround , true ) ; / / turn off compliance validation to be able to send payloads with delete calls client config property ( client properties suppress http compliance validation , true ) ; if ( debugging ) { client config register ( new logging feature ( java util logging logger get logger ( logging feature default logger name ) , java util logging level info , logging feature verbosity payload any , 1024 * 50 / * log payloads up to 50k * / ) ) ; client config property ( logging feature logging feature verbosity , logging feature verbosity payload any ) ; / / set logger to all java util logging logger get logger ( logging feature default logger name ) set level ( java util logging level all ) ; } else { / / suppress warnings for payloads with delete calls : java util logging logger get logger ( " org glassfish jersey client " ) set level ( java util logging level severe ) ; } return client config ; }


adjusts the total width of the component field area

private void adjust width ( ) { int new width = left margin ; int num cols = get column count ( ) ; for ( int i = 0 ; i < num cols ; i + + ) { new width + = column widths [ i ] ; } this width = new width ; }


public void on begin test ( global session global session ) throws exception { for ( session manager session manager : session manager list ) { session manager on begin ( global session ) ; session manager on end ( global session ) ; } }


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


returns an immutable multimap containing the given entries , in order

public static < k , v > immutable list multimap < k , v > of ( k k 1 , v v 1 , k k 2 , v v 2 , k k 3 , v v 3 , k k 4 , v v 4 ) { immutable list multimap builder < k , v > builder = immutable list multimap builder ( ) ; builder put ( k 1 , v 1 ) ; builder put ( k 2 , v 2 ) ; builder put ( k 3 , v 3 ) ; builder put ( k 4 , v 4 ) ; return builder build ( ) ; }


creates an { @ code array table } with the mappings in the provided table if { @ code table } includes a mapping with row key { @ code r } and a separate mapping with column key { @ code c } , the returned table contains a mapping with row key { @ code r } and column key { @ code c } if that row key column key pair in not in { @ code table } , the pair maps to { @ code null } in the generated table the returned table allows subsequent { @ code put } calls with the row keys in { @ code table row key set ( ) } and the column keys in { @ code table column key set ( ) } calling { @ link # put } with other keys leads to an { @ code illegal argument exception } the ordering of { @ code table row key set ( ) } and { @ code table column key set ( ) } determines the row and column iteration ordering of the returned table

public static < r , c , v > array table < r , c , v > create ( table < r , c , v > table ) { return ( table instanceof array table < ? , ? , ? > ) ? new array table < r , c , v > ( ( array table < r , c , v > ) table ) : new array table < r , c , v > ( table ) ; }


specify the uri by through a { @ link uri builder }

s uri ( function < uri builder , uri > uri function ) ;


configures a resource file by default , resources are output in the initial shard if a resource file is specified , resources are written to this instead

public split zip set resource file ( string resource file ) { this resource file = resource file ; return this ; }


public auth filter builder < c , p , t > set authenticator ( authenticator < c , p > authenticator ) { this authenticator = authenticator ; return this ; }


e decorate ( simple adapter < e > decoratee , int position ) ;


check the correctness of the diff reports

private void verify diff report ( path dir , string from , string to , diff report entry entries ) throws i o exception { d f s test util verify snapshot diff report ( fs , dir , from , to , entries ) ; }


converts an email attachment to an attachment , potentially executing code like an http request

attachment to attachment ( watch execution context context , payload payload , t attachment ) throws i o exception ;


public void set release note ( string release note ) { this release note = release note ; }


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


the property string that specifies that a key store or trust store should use this store file type

public string get property value ( ) { return this name ( ) ; }


collect the { @ link cache put request } for all { @ link cache operation } using the specified result item

private void collect put requests ( collection < cache operation context > contexts , @ nullable object result , collection < cache put request > put requests ) { for ( cache operation context context : contexts ) { if ( is condition passing ( context , result ) ) { object key = generate key ( context , result ) ; put requests add ( new cache put request ( context , key ) ) ; } } }


regression test to ensure that non - string typed build setting values are being properly converted from strings to their real type

public void buildsettings converted type ( ) throws exception { scratch file ( " test / build settings bzl " , " def impl ( ctx ) : " , " return [ ] " , " bool flag = rule ( implementation = impl , build setting = config bool ( flag = true ) ) " ) ; scratch file ( " test / build " , " load ( ' / / test : build settings bzl ' , ' bool flag ' ) " , " config setting ( " , " name = ' match ' , " , " flag values = { " , " ' : cheese ' : ' true ' , " , " } , " , " ) " , " bool flag ( name = ' cheese ' , build setting default = true ) " ) ; assert that ( get config matching provider ( " / / test : match " ) matches ( ) ) is true ( ) ; }


checks to see if the user id is the same for the two uids , i e , they belong to the same user @ hide

public static boolean is same user ( int uid 1 , int uid 2 ) { return get user id ( uid 1 ) = = get user id ( uid 2 ) ; }


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


transfers the specified source array ' s data to this buffer starting at the specified absolute { @ code index } this method does not modify { @ code reader index } or { @ code writer index } of this buffer

public abstract byte buf set bytes ( int index , byte [ ] src , int src index , int length ) ;


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


execute the given remote invocation via the { @ link http invoker request executor } can be overridden in subclasses to pass a different configuration object to the executor alternatively , add further configuration properties in a subclass of this accessor : by default , the accessor passed itself as configuration object to the executor

protected remote invocation result execute request ( remote invocation invocation ) throws exception { return get http invoker request executor ( ) execute request ( this , invocation ) ; }


get the leader retriever for the cluster ' s rest endpoint

leader retrieval service get cluster rest endpoint leader retriever ( ) ;


adjust unaligned structure following member reconstruction

private void adjust size ( int preferred size ) { if ( ! is structure container ( ) ) { return ; } structure struct = ( structure ) get data type ( ) ; if ( struct is not yet defined ( ) & & preferred size > 0 ) { / / handle special case of empty structure struct grow structure ( preferred size ) ; return ; } if ( struct get length ( ) < preferred size ) { struct grow structure ( preferred size - struct get length ( ) ) ; return ; } data type component dtc = struct get component at ( preferred size ) ; if ( dtc = = null ) { return ; } int start ordinal = dtc get ordinal ( ) ; if ( dtc get offset ( ) ! = preferred size ) { + + start ordinal ; } for ( int i = struct get num components ( ) - 1 ; i > = start ordinal ; i - - ) { data type component comp = struct get component ( i ) ; if ( comp get data type ( ) ! = data type default ) { break ; } struct delete ( i ) ; } }


get an entry which must exist and not be deleted

protected path metadata verify cached ( final string path str ) throws i o exception { path metadata meta = get non null ( path str ) ; assert false ( path str + " was found but marked deleted : " + meta , meta is deleted ( ) ) ; return meta ; }


extracts a sorted list of declared version constants from a class the argument would normally be version class but is exposed for testing with other classes - containing - version - constants

public static list < version > get declared versions ( final class < ? > version class ) { final field [ ] fields = version class get fields ( ) ; final list < version > versions = new array list < > ( fields length ) ; for ( final field field : fields ) { final int mod = field get modifiers ( ) ; if ( false = = modifier is static ( mod ) & & modifier is final ( mod ) & & modifier is public ( mod ) ) { continue ; } if ( field get type ( ) ! = version class ) { continue ; } switch ( field get name ( ) ) { case " current " : case " v empty " : continue ; } assert field get name ( ) matches ( " v ( \ \ d + ) { 3 } ? " ) : field get name ( ) ; try { versions add ( ( ( version ) field get ( null ) ) ) ; } catch ( final illegal access exception e ) { throw new runtime exception ( e ) ; } } collections sort ( versions ) ; return versions ; }


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


stop the timer if necessary can safely be called multiple times

public void stop ( ) { timer task timer task = task get and set ( null ) ; if ( timer task ! = null ) { timer task cancel ( ) ; } timer cancel ( ) ; }


exit a parse tree produced by { @ link sql base parser # predicated }

void exit predicated ( sql base parser predicated context ctx ) ;


move primary symbol to last element in array

private void make primary last item ( symbol [ ] symbols ) { for ( int i = 0 ; i < symbols length - 1 ; + + i ) { if ( symbols [ i ] is primary ( ) ) { symbol primary = symbols [ i ] ; system arraycopy ( symbols , i + 1 , symbols , i , symbols length - i - 1 ) ; symbols [ symbols length - 1 ] = primary ; break ; } } }


for internal use in logging at the http adapter layer

string get log prefix ( ) { if ( this log prefix = = null ) { this log prefix = " [ " + get id ( ) + " ] " ; } return this log prefix ; }


assert that an index creation was fully acknowledged , meaning that both the index creation cluster state update was successful and that the requisite number of shard copies were started before returning

public static void assert acked ( create index response response ) { assert that ( response get class ( ) get simple name ( ) + " failed - not acked " , response is acknowledged ( ) , equal to ( true ) ) ; assert true ( response get class ( ) get simple name ( ) + " failed - index creation acked but not all shards were started " , response is shards acknowledged ( ) ) ; }


applies this function to the given argument and its index within a stream


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


public long get int 6 4 ( ) { return int 6 4 ; }


checks for a { @ link create table operation } you can provide additional matchers as parameters all of the provided nested matchers must match example : { @ code assert that ( operation , create table operation ( has schema ( table schema builder ( ) field ( " f 0 " , data types int ( ) not null ( ) ) field ( " f 1 " , data types timestamp ( 3 ) ) field ( " a " , data types int ( ) ) watermark ( " f 1 " , " ` f 1 ` - interval ' 5 ' second " , data types timestamp ( 3 ) ) build ( ) ) , has options ( entry ( " connector type " , " kafka " ) , entry ( " format type " , " json " ) ) , has partition ( " a " , " f 0 " ) ) ) ; }

public static matcher < operation > is create table operation ( matcher < create table operation > nested matchers ) { return new create table operation matcher ( nested matchers ) ; }


public swift native file system get fs ( ) { return fs ; }


protected set < event > handle possible suspicious attempt ( final http servlet request request , final authentication authentication , final registered service service ) { val application context = get webflow event resolution configuration context ( ) get application context ( ) ; application context publish event ( new cas risk based authentication evaluation started event ( this , authentication , service ) ) ; logger debug ( " evaluating possible suspicious authentication attempt for [ { } ] " , authentication get principal ( ) ) ; val score = authentication risk evaluator eval ( authentication , service , request ) ; val threshold = get webflow event resolution configuration context ( ) get cas properties ( ) get authn ( ) get adaptive ( ) get risk ( ) get threshold ( ) ; if ( score is risk greater than ( threshold ) ) { application context publish event ( new cas risky authentication detected event ( this , authentication , service , score ) ) ; logger debug ( " calculated risk score [ { } ] for authentication request by [ { } ] is above the risk threshold [ { } ] " , score get score ( ) , authentication get principal ( ) , threshold ) ; application context publish event ( new cas risk based authentication mitigation started event ( this , authentication , service , score ) ) ; val res = authentication risk mitigator mitigate ( authentication , service , score , request ) ; application context publish event ( new cas risky authentication mitigated event ( this , authentication , service , res ) ) ; return collection utils wrap set ( res get result ( ) ) ; } logger debug ( " authentication request for [ { } ] is below the risk threshold " , authentication get principal ( ) ) ; return null ; }


disposes any pixmap pages which don ' t have a texture page pixmaps that have a texture will not be disposed until their texture is disposed

public synchronized void dispose ( ) { for ( page page : pages ) { if ( page texture = = null ) { page image dispose ( ) ; } } disposed = true ; }


indicates whether { @ code c } is one of the twenty - six uppercase ascii alphabetic characters between { @ code ' a ' } and { @ code ' z ' } inclusive all others ( including non - ascii characters ) return { @ code false }

public static boolean is upper case ( char c ) { return ( c > = ' a ' ) & & ( c < = ' z ' ) ; }


public map < string , list < object > > get map array anytype ( ) { return map array anytype ; }


assert the evaluation result of two row expressions equivalent no matter they are constants or remaining row expressions

private static void assert row expression evaluation equals ( object left , object right ) { if ( right instanceof row expression ) { assert true ( left instanceof row expression ) ; / / assert equals ( ( ( row expression ) left ) get type ( ) , ( ( row expression ) right ) get type ( ) ) ; if ( left instanceof constant expression ) { if ( is removable cast ( right ) ) { assert row expression evaluation equals ( left , ( ( call expression ) right ) get arguments ( ) get ( 0 ) ) ; return ; } assert true ( right instanceof constant expression ) ; assert row expression evaluation equals ( ( ( constant expression ) left ) get value ( ) , ( ( constant expression ) left ) get value ( ) ) ; } else if ( left instanceof input reference expression | | left instanceof variable reference expression ) { assert equals ( left , right ) ; } else if ( left instanceof call expression ) { assert true ( right instanceof call expression ) ; assert equals ( ( ( call expression ) left ) get function handle ( ) , ( ( call expression ) right ) get function handle ( ) ) ; assert equals ( ( ( call expression ) left ) get arguments ( ) size ( ) , ( ( call expression ) right ) get arguments ( ) size ( ) ) ; for ( int i = 0 ; i < ( ( call expression ) left ) get arguments ( ) size ( ) ; i + + ) { assert row expression evaluation equals ( ( ( call expression ) left ) get arguments ( ) get ( i ) , ( ( call expression ) right ) get arguments ( ) get ( i ) ) ; } } else if ( left instanceof special form expression ) { assert true ( right instanceof special form expression ) ; assert equals ( ( ( special form expression ) left ) get form ( ) , ( ( special form expression ) right ) get form ( ) ) ; assert equals ( ( ( special form expression ) left ) get arguments ( ) size ( ) , ( ( special form expression ) right ) get arguments ( ) size ( ) ) ; for ( int i = 0 ; i < ( ( special form expression ) left ) get arguments ( ) size ( ) ; i + + ) { assert row expression evaluation equals ( ( ( special form expression ) left ) get arguments ( ) get ( i ) , ( ( special form expression ) right ) get arguments ( ) get ( i ) ) ; } } else { assert true ( left instanceof lambda definition expression ) ; assert true ( right instanceof lambda definition expression ) ; assert equals ( ( ( lambda definition expression ) left ) get arguments ( ) , ( ( lambda definition expression ) right ) get arguments ( ) ) ; assert equals ( ( ( lambda definition expression ) left ) get argument types ( ) , ( ( lambda definition expression ) right ) get argument types ( ) ) ; assert row expression evaluation equals ( ( ( lambda definition expression ) left ) get body ( ) , ( ( lambda definition expression ) right ) get body ( ) ) ; } } else { / / we have constants ; directly compare if ( left instanceof block ) { assert true ( right instanceof block ) ; assert equals ( block to slice ( ( block ) left ) , block to slice ( ( block ) right ) ) ; } else { assert equals ( left , right ) ; } } }


writes one code unit to the given output destination

protected static void write ( annotated output out , short c 0 ) { out write short ( c 0 ) ; }


enables the approximate local recovery mode in this recovery mode , when a task fails , the entire downstream of the tasks ( including the failed task ) restart notice that 1 approximate recovery may lead to data loss the amount of data which leads the failed task from the state of the last completed checkpoint to the state when the task fails is lost 2 in the next version , we will support restarting the set of failed set of tasks only in this version , we only support downstream restarts when a task fails 3 it is only an internal feature for now

public void enable approximate local recovery ( boolean enabled ) { approximate local recovery = enabled ; }


return true if this buffer contains modified data when this buffer is released to the buffer mgr , the data is consumed and this flag reset to false

public boolean is dirty ( ) { return dirty ; }


returns a list of property values from decision paths that matched the constraints

public list < string > get values ( ) { list < string > values = new array list < string > ( decision list size ( ) ) ; for ( decision decision : decision list ) { values add ( decision get value ( ) ) ; } return values ; }


public void att n a m e test ( ) { / / todo : test att name }


public table statistics [ ] get all statistics ( ) throws i o exception { table statistics [ ] stat list = new table statistics [ indexed columns length + 1 ] ; stat list [ 0 ] = get statistics ( ) ; for ( int i = 0 ; i < indexed columns length ; i + + ) { index table index table = secondary indexes get ( indexed columns [ i ] ) ; stat list [ i + 1 ] = index table get statistics ( ) ; } return stat list ; }


creates a { @ link reentrant lock } with the given fairness policy the { @ code lock name } is used in the warning or exception output to help identify the locks involved in the detected deadlock

public reentrant lock new reentrant lock ( string lock name , boolean fair ) { return policy = = policies disabled ? new reentrant lock ( fair ) : new cycle detecting reentrant lock ( new lock graph node ( lock name ) , fair ) ; }


like add entry except that this version is used when creating entries as part of map construction or " pseudo - construction " ( cloning , deserialization ) this version needn ' t worry about resizing the table subclass overrides this to alter the behavior of int key map ( map ) , clone , and read object

void create entry ( int hash , int key , value value , int bucket index ) { table [ bucket index ] = new int entry < > ( hash , key , value , table [ bucket index ] ) ; size + + ; }


fetch the updated data id list from server

list < string > check update config str ( string probe update string , boolean is initializing cache list ) throws exception { map < string , string > params = new hash map < string , string > ( 2 ) ; params put ( constants probe modify request , probe update string ) ; map < string , string > headers = new hash map < string , string > ( 2 ) ; headers put ( " long - pulling - timeout " , " " + timeout ) ; / / told server do not hang me up if new initializing cache data added in if ( is initializing cache list ) { headers put ( " long - pulling - timeout - no - hangup " , " true " ) ; } if ( string utils is blank ( probe update string ) ) { return collections empty list ( ) ; } try { / / in order to prevent the server from handling the delay of the client ' s long task , / / increase the client ' s read timeout to avoid this problem long read timeout ms = timeout + ( long ) math round ( timeout > > 1 ) ; http rest result < string > result = agent http post ( constants config controller path + " / listener " , headers , params , agent get encode ( ) , read timeout ms ) ; if ( result ok ( ) ) { set health server ( true ) ; return parse update data id response ( result get data ( ) ) ; } else { set health server ( false ) ; logger error ( " [ { } ] [ check - update ] get changed data id error , code : { } " , agent get name ( ) , result get code ( ) ) ; } } catch ( exception e ) { set health server ( false ) ; logger error ( " [ " + agent get name ( ) + " ] [ check - update ] get changed data id exception " , e ) ; throw e ; } return collections empty list ( ) ; }


find pet by id returns a single pet < b > 200 < b > - successful operation < b > 400 < b > - invalid id supplied < b > 404 < b > - pet not found

public mono < pet > get pet by id ( long pet id ) throws web client response exception { object post body = null ; / / verify the required parameter ' pet id ' is set if ( pet id = = null ) { throw new web client response exception ( " missing the required parameter ' pet id ' when calling get pet by id " , http status bad request value ( ) , http status bad request get reason phrase ( ) , null , null , null ) ; } / / create path and map variables final map < string , object > path params = new hash map < string , object > ( ) ; path params put ( " pet id " , pet id ) ; final multi value map < string , string > query params = new linked multi value map < string , string > ( ) ; final http headers header params = new http headers ( ) ; final multi value map < string , string > cookie params = new linked multi value map < string , string > ( ) ; final multi value map < string , object > form params = new linked multi value map < string , object > ( ) ; final string [ ] local var accepts = { " application / xml " , " application / json " } ; final list < media type > local var accept = api client select header accept ( local var accepts ) ; final string [ ] local var content types = { } ; final media type local var content type = api client select header content type ( local var content types ) ; string [ ] local var auth names = new string [ ] { " api key " } ; parameterized type reference < pet > local var return type = new parameterized type reference < pet > ( ) { } ; return api client invoke a p i ( " / pet / { pet id } " , http method get , path params , query params , post body , header params , cookie params , form params , local var accept , local var content type , local var auth names , local var return type ) ; }


check that an unknown logging config is rejected

public void test 1 2 3 cannot use unknown logging config ( ) { final result result = run container expecting failure ( distribution ( ) , builder ( ) env vars ( map of ( " es log style " , " unknown " ) ) ) ; assert that ( result stderr , contains string ( " error : es log style set to [ unknown ] expected [ console ] or [ file ] " ) ) ; }


public static string bytes 2base 6 4 ( final byte [ ] bs , final int off , final int len , final char [ ] code ) { if ( off < 0 ) { throw new index out of bounds exception ( " bytes 2base 6 4 : offset < 0 , offset is " + off ) ; } if ( len < 0 ) { throw new index out of bounds exception ( " bytes 2base 6 4 : length < 0 , length is " + len ) ; } if ( off + len > bs length ) { throw new index out of bounds exception ( " bytes 2base 6 4 : offset + length > array length " ) ; } if ( code length < 64 ) { throw new illegal argument exception ( " base 6 4 code length < 64 " ) ; } boolean pad = code length > 64 ; / / has pad char int num = len / 3 , rem = len % 3 , r = off , w = 0 ; char [ ] cs = new char [ num * 4 + ( rem = = 0 ? 0 : pad ? 4 : rem + 1 ) ] ; for ( int i = 0 ; i < num ; i + + ) { int b 1 = bs [ r + + ] & mask8 , b 2 = bs [ r + + ] & mask8 , b 3 = bs [ r + + ] & mask8 ; cs [ w + + ] = code [ b 1 > > 2 ] ; cs [ w + + ] = code [ ( b 1 < < 4 ) & mask6 | ( b 2 > > 4 ) ] ; cs [ w + + ] = code [ ( b 2 < < 2 ) & mask6 | ( b 3 > > 6 ) ] ; cs [ w + + ] = code [ b 3 & mask6 ] ; } if ( rem = = 1 ) { int b 1 = bs [ r + + ] & mask8 ; cs [ w + + ] = code [ b 1 > > 2 ] ; cs [ w + + ] = code [ ( b 1 < < 4 ) & mask6 ] ; if ( pad ) { cs [ w + + ] = code [ 64 ] ; cs [ w + + ] = code [ 64 ] ; } } else if ( rem = = 2 ) { int b 1 = bs [ r + + ] & mask8 , b 2 = bs [ r + + ] & mask8 ; cs [ w + + ] = code [ b 1 > > 2 ] ; cs [ w + + ] = code [ ( b 1 < < 4 ) & mask6 | ( b 2 > > 4 ) ] ; cs [ w + + ] = code [ ( b 2 < < 2 ) & mask6 ] ; if ( pad ) { cs [ w + + ] = code [ 64 ] ; } } return new string ( cs ) ; }


returns an { @ link method invocation site } that serves as an adapter between desugar - mirrored invocations and desugar - shadowed invocations

static method invocation site get adapter invocation site ( method invocation site method invocation site ) { return method invocation site builder ( ) set invocation kind ( member use kind invokestatic ) set method ( method invocation site method ( ) to adapter method for args and return types ( method invocation site is static invocation ( ) , method invocation site hash code ( ) ) ) set is interface ( false ) build ( ) ; }


the last time metadata was successfully updated

public synchronized long last successful update ( ) { return this last successful refresh ms ; }


removes a node if the node instance is not in the list of nodes , then this will be a no - op , even if there is another instance with the same { @ link node # get node name ( ) }

public void remove node ( final @ non null node node ) throws i o exception { if ( node = = nodes get ( node get node name ( ) ) ) { queue with lock ( new runnable ( ) { @ override public void run ( ) { computer c = node to computer ( ) ; if ( c ! = null ) { c record termination ( ) ; c disconnect ( offline cause create ( hudson model messages hudson node being removed ( ) ) ) ; } if ( node = = nodes remove ( node get node name ( ) ) ) { jenkins update computer list ( ) ; jenkins trim labels ( ) ; } } } ) ; / / no need for a full save ( ) so we just do the minimum util delete recursive ( new file ( get nodes dir ( ) , node get node name ( ) ) ) ; node listener fire on deleted ( node ) ; } }


public test integration build ( ) { return new test integration ( contact email , component id , name , url , icon url , icon name , description , foreground color , background color ) ; }


visit a parse tree produced by { @ link sql base parser # limit clause }

t visit limit clause ( sql base parser limit clause context ctx ) ;


restore the information saved in the ticket and return the service

protected service restore delegated authentication request ( final request context request context , final web context web context , final transient session ticket ticket ) { val service = ticket get service ( ) ; logger trace ( " restoring requested service [ { } ] back in the authentication flow " , service ) ; web utils put service into flow scope ( request context , service ) ; web context set request attribute ( cas protocol constants parameter service , service ) ; val theme param name = cas properties get theme ( ) get param name ( ) ; val local param name = cas properties get locale ( ) get param name ( ) ; val properties = ticket get properties ( ) ; web context set request attribute ( theme param name , properties get ( theme param name ) ) ; web context set request attribute ( local param name , properties get ( local param name ) ) ; web context set request attribute ( cas protocol constants parameter method , properties get ( cas protocol constants parameter method ) ) ; return service ; }


get the md 5 for the file call get m d 5 ( file input stream is , int buf len ) inside

public static string get m d 5 ( final file file ) { if ( file = = null | | ! file exists ( ) ) { return null ; } file input stream fin = null ; try { fin = new file input stream ( file ) ; string md 5 = get m d 5 ( fin ) ; return md 5 ; } catch ( exception e ) { share tinker log e ( tag , e get message ( ) ) ; return null ; } finally { close quietly ( fin ) ; } }


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


return a future which succeeds if all the feature updates succeed

public kafka future < void > all ( ) { return kafka future all of ( futures values ( ) to array ( new kafka future [ 0 ] ) ) ; }


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


sign extend the masked value as if of the given size in bits , to a full long

public masked long sign extend ( int n ) { long new msk = sign extend ( this msk , n ) ; long new val = sign extend ( this val , n ) ; return from mask and value ( new msk , new val ) ; }


in executables , returns the rva where the section begins in memory should be set to 0 in o b js this section should be loaded into memory

public int get virtual address ( ) { return virtual address ; }


test serialization of object with outer number type

public void fake outer composite serialize test ( ) throws i o exception { outer composite outer composite = null ; outer composite response = api fake outer composite serialize ( outer composite ) ; / / todo : test validations }


positive test for set permission when authorization is enabled

public void test set permission for authorised users ( ) throws throwable { / / user 1 is already part of chmod allowed users / / this test validates the allowed user can do set permission test set permission ( " / test set permission positive " , null , null , " user 1 " , false , false ) ; }


default void cleanup idle clients ( ) { / / do nothing by default }


rewrites { @ code urls } using the configuration provided to { @ link # get downloader url rewriter ( string , reporter ) } the returned list of u r ls may be empty if the configuration used blocks all the input u r ls

public list < url > amend ( list < url > urls ) { objects require non null ( urls , " urls to check must be set but may be empty " ) ; immutable list < url > rewritten = urls stream ( ) map ( rewriter ) flat map ( collection : : stream ) collect ( to immutable list ( ) ) ; if ( ! urls equals ( rewritten ) ) { log accept ( string format ( " rewritten % s as % s " , urls , rewritten ) ) ; } return rewritten ; }


decodes image from uri into { @ link bitmap } image is scaled close to incoming { @ linkplain image size target size } during decoding ( depend on incoming parameters )

public bitmap decode ( image decoding info decoding info ) throws i o exception { bitmap decoded bitmap ; image file info image info ; input stream image stream = get image stream ( decoding info ) ; if ( image stream = = null ) { l e ( error no image stream , decoding info get image key ( ) ) ; return null ; } try { image info = define image size and rotation ( image stream , decoding info ) ; image stream = reset stream ( image stream , decoding info ) ; options decoding options = prepare decoding options ( image info image size , decoding info ) ; decoded bitmap = bitmap factory decode stream ( image stream , null , decoding options ) ; } finally { io utils close silently ( image stream ) ; } if ( decoded bitmap = = null ) { l e ( error cant decode image , decoding info get image key ( ) ) ; } else { decoded bitmap = consider exact scale and orientatiton ( decoded bitmap , decoding info , image info exif rotation , image info exif flip horizontal ) ; } return decoded bitmap ; }


public static void shutdown kdc ( ) { if ( kdc ! = null ) { kdc stop ( ) ; } }


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


merge overlapping { @ link time window } s for use by merging { @ link org apache flink streaming api windowing assigners window assigner window assigners }

public static void merge windows ( collection < time window > windows , merging window assigner merge callback < time window > c ) { / / sort the windows by the start time and then merge overlapping windows list < time window > sorted windows = new array list < > ( windows ) ; collections sort ( sorted windows , new comparator < time window > ( ) { @ override public int compare ( time window o 1 , time window o 2 ) { return long compare ( o 1 get start ( ) , o 2 get start ( ) ) ; } } ) ; list < tuple 2 < time window , set < time window > > > merged = new array list < > ( ) ; tuple 2 < time window , set < time window > > current merge = null ; for ( time window candidate : sorted windows ) { if ( current merge = = null ) { current merge = new tuple 2 < > ( ) ; current merge f 0 = candidate ; current merge f 1 = new hash set < > ( ) ; current merge f 1 add ( candidate ) ; } else if ( current merge f 0 intersects ( candidate ) ) { current merge f 0 = current merge f 0 cover ( candidate ) ; current merge f 1 add ( candidate ) ; } else { merged add ( current merge ) ; current merge = new tuple 2 < > ( ) ; current merge f 0 = candidate ; current merge f 1 = new hash set < > ( ) ; current merge f 1 add ( candidate ) ; } } if ( current merge ! = null ) { merged add ( current merge ) ; } for ( tuple 2 < time window , set < time window > > m : merged ) { if ( m f 1 size ( ) > 1 ) { c merge ( m f 1 , m f 0 ) ; } } }


initialize the list of buckets get the bucket sizes ( and bucket lengths ) from the bucket sizes provider

private synchronized void init buckets ( ) { final sparse int array bucket sizes = m pool params bucket sizes ; / / create the buckets if ( bucket sizes ! = null ) { fill buckets ( bucket sizes ) ; m allow new buckets = false ; } else { m allow new buckets = true ; } }


create a mutable escaper from an existing escaper , which may already be immutable

public string escaper get mutable clone ( ) { string escaper clone = clone ( ) ; if ( clone translation vector = = null ) { clone translation vector = arrays as list ( clone translation table ) ; clone translation table = null ; } return clone ; }


saves the property at the given index to the given output stream

protected void save property ( object output stream oos , long index ) throws i o exception { oos write object ( get object ( index ) ) ; }


compares the mappings from the template and the index and asserts they are the same the assertion error message details the differences in the mappings the mappings , which are maps of maps , are flattened with the keys built from the keys of the sub - maps appended to the parent key this makes diffing the 2 maps easier and diffs more comprehensible the meta field is not compared as it contains version numbers that change even when the mappings don ' t mistakes happen and some indices may be stuck with the incorrect mappings that cannot be fixed without re - index in this case use the { @ code exceptions } parameter to filter out fields in the index mapping that are not in the template each exception should be a ' ' separated path to the value e g { @ code properties analysis analysis field type }

public static void assert legacy template matches index mappings ( rest client client , string template name , string index name , boolean not an error if index does not exist , set < string > exceptions , boolean allow system index warnings ) throws i o exception { request get template = new request ( " get " , " template / " + template name ) ; response template response = client perform request ( get template ) ; assert equals ( " missing template [ " + template name + " ] " , 200 , template response get status line ( ) get status code ( ) ) ; map < string , object > template mappings = ( map < string , object > ) x content map values extract value ( e s rest test case entity as map ( template response ) , template name , " mappings " ) ; assert not null ( template mappings ) ; request get index mapping = new request ( " get " , index name + " / mapping " ) ; if ( allow system index warnings ) { final string system index warning = " this request accesses system indices : [ " + index name + " ] , but in a future major version , " + " direct access to system indices will be prevented by default " ; get index mapping set options ( e s rest test case expect version specific warnings ( v - > { v current ( system index warning ) ; v compatible ( system index warning ) ; } ) ) ; } response index mapping response ; try { index mapping response = client perform request ( get index mapping ) ; } catch ( response exception e ) { if ( e get response ( ) get status line ( ) get status code ( ) = = 404 & & not an error if index does not exist ) { return ; } else { throw e ; } } assert equals ( " error getting mappings for index [ " + index name + " ] " , 200 , index mapping response get status line ( ) get status code ( ) ) ; map < string , object > index mappings = ( map < string , object > ) x content map values extract value ( e s rest test case entity as map ( index mapping response ) , index name , " mappings " ) ; assert not null ( index mappings ) ; / / ignore the meta field index mappings remove ( " meta " ) ; template mappings remove ( " meta " ) ; / / we cannot do a simple comparison of mappings e g / / objects equals ( index mappings , template mappings ) because some / / templates use strings for the boolean values - " true " and " false " / / which are automatically converted to booleans causing the equality / / to fail boolean mappings are the same = true ; / / flatten the map of maps map < string , object > flat template map = flatten map ( template mappings ) ; map < string , object > flat index map = flatten map ( index mappings ) ; sorted set < string > keys in template missing from index = new tree set < > ( flat template map key set ( ) ) ; keys in template missing from index remove all ( flat index map key set ( ) ) ; keys in template missing from index remove all ( exceptions ) ; sorted set < string > keys in index missing from template = new tree set < > ( flat index map key set ( ) ) ; keys in index missing from template remove all ( flat template map key set ( ) ) ; / / in the case of object fields the ' type : object ' mapping is set by default / / if this does not explicitly appear in the template it is not an error / / as es has added the default to the index mappings keys in index missing from template remove if ( key - > key ends with ( " type " ) & & " object " equals ( flat index map get ( key ) ) ) ; / / remove the exceptions keys in index missing from template remove all ( exceptions ) ; string builder error messsage = new string builder ( " error the template mappings [ " ) append ( template name ) append ( " ] and index mappings [ " ) append ( index name ) append ( " ] are not the same " ) append ( system line separator ( ) ) ; if ( keys in template missing from index is empty ( ) = = false ) { mappings are the same = false ; error messsage append ( " keys in the template missing from the index mapping : " ) append ( keys in template missing from index ) append ( system line separator ( ) ) ; } if ( keys in index missing from template is empty ( ) = = false ) { mappings are the same = false ; error messsage append ( " keys in the index missing from the template mapping : " ) append ( keys in index missing from template ) append ( system line separator ( ) ) ; } / / find values that are different for the same key set < string > common keys = new tree set < > ( flat index map key set ( ) ) ; common keys retain all ( flat template map key set ( ) ) ; for ( string key : common keys ) { object template = flat template map get ( key ) ; object index = flat index map get ( key ) ; if ( objects equals ( template , index ) = = false ) { / / both maybe be booleans but different representations if ( are boolean objects and equal ( index , template ) ) { continue ; } mappings are the same = false ; error messsage append ( " values for key [ " ) append ( key ) append ( " ] are different " ) append ( system line separator ( ) ) ; error messsage append ( " template value [ " ) append ( template ) append ( " ] " ) append ( template get class ( ) get simple name ( ) ) append ( system line separator ( ) ) ; error messsage append ( " index value [ " ) append ( index ) append ( " ] " ) append ( index get class ( ) get simple name ( ) ) append ( system line separator ( ) ) ; } } if ( mappings are the same = = false ) { fail ( error messsage to string ( ) ) ; } }


public static starlark int add ( starlark int x , starlark int y ) { if ( x instanceof int 3 2 & & y instanceof int 3 2 ) { long xl = ( ( int 3 2 ) x ) v ; long yl = ( ( int 3 2 ) y ) v ; return starlark int of ( xl + yl ) ; } / / we avoid math add exact and its overheads of exception allocation try { long xl = x to long fast ( ) ; long yl = y to long fast ( ) ; long zl = xl + yl ; boolean overflow = ( ( xl ^ zl ) & ( yl ^ zl ) ) < 0 ; / / see hacker ' s delight , chapter 2 if ( ! overflow ) { return starlark int of ( zl ) ; } } catch ( overflow unused ) { / * fall through * / } big integer xbig = x to big integer ( ) ; big integer ybig = y to big integer ( ) ; big integer zbig = xbig add ( ybig ) ; return starlark int of ( zbig ) ; }


enables a cross fade animation between both the placeholder and the first resource and between subsequent resources ( if thumbnails are used )

public bitmap transition options cross fade ( @ non null drawable cross fade factory drawable cross fade factory ) { return transition using ( drawable cross fade factory ) ; }


public int get index ( ) { return index ; }


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


return the associated conversion service , if any

conversion service get conversion service ( ) ;


override this method if the plugin needs to cancel the closing of the domain object

protected boolean can close domain object ( domain object d obj ) { return true ; }


check whether the storage entity exists need to implement based on the real storage

protected abstract boolean is exists ( model model ) throws storage exception ;


string operator describes all the current statistics < b > important : there are no guarantees as to the stability of this value < b >

public string to string ( ) { final string builder sb = new string builder ( " stream statistics { " ) ; sb append ( io statistics store to string ( ) ) ; sb append ( ' } ' ) ; return sb to string ( ) ; }


always applies the interceptor if the " track all invocations " flag has been set ; else just kicks in if the log is enabled

protected boolean is interceptor enabled ( method invocation invocation , log logger ) { return ( this track all invocations | | is log enabled ( logger ) ) ; }


public boolean is primary symbol ( symbol s ) { if ( is bad reference symbol ( s ) ) { return false ; } return s is primary ( ) ; }


returns an ordering which first uses the ordering { @ code this } , but which in the event of a " tie " , then delegates to { @ code secondary comparator } for example , to sort a bug list first by status and second by priority , you might use { @ code by status compound ( by priority ) } for a compound ordering with three or more components , simply chain multiple calls to this method an ordering produced by this method , or a chain of calls to this method , is equivalent to one created using { @ link ordering # compound ( iterable ) } on the same component comparators < b > java 8 users : < b > use { @ code this comparator then comparing ( secondary comparator ) } instead depending on what { @ code secondary comparator } is , one of the other overloads of { @ code then comparing } may be even more useful

public < u extends t > ordering < u > compound ( comparator < ? super u > secondary comparator ) { return new compound ordering < u > ( this , check not null ( secondary comparator ) ) ; }


root directory on this agent where all the job workspaces are laid out

public @ check for null file path get workspace root ( ) { file path r = get root path ( ) ; if ( r = = null ) return null ; return r child ( workspace root ) ; }


public list < string > get data source names ( ) { return data source names stream ( ) filter ( each - > ! disabled data source names contains ( each ) ) collect ( collectors to list ( ) ) ; }


synchronized void add ( obj key , long time ) { map put ( key , time ) ; }


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


returns the file for which needs to satisfy the policy

public long get file ( ) { return file id ; }


delete a service ' s registered endpoints if the operation returns without an error then the entry has been deleted

void delete ( string path , service record record ) throws i o exception ;


public headless options get options ( ) { return options ; }


looks up the currently running build , if known while most { @ link run } implementations do add a { @ link run execution } to the stack for the duration of the build , those which have a different implementation of { @ link run # run } ( or which do additional work after { @ link run # execute } completes ) may not consistently or ever keep an execution on the stack in such cases this method will return null , meaning that { @ link check point # block ( build listener , string ) } and { @ link check point # report } will do nothing

synchronized @ check for null run execution peek ( ) { executor e = executor current executor ( ) ; if ( e ! = null ) { stack < run execution > s = stack get ( e ) ; if ( s ! = null & & ! s is empty ( ) ) { return s peek ( ) ; } } return null ; }


if there are errors during error manager init , we have no choice but to go to system err

static void raw error ( string msg ) { system err println ( msg ) ; }


only select process instances which have a local string variable which is not the given value , case insensitive this method only works if your database has encodingcollation that supports case - sensitive queries for example , use " collate utf - 8 " on my s q l and for mssql , select one of the case - sensitive collations available ( < a href = " http : msdn microsoft comen - uslibraryms 1 4 4 2 5 0 ( v = sql 105 ) aspx " > msdn server collation reference )

process instance query variable value not equals ignore case ( string name , string value ) ;


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


this method will perform a save on the given archive however , the one caveat is that if the archive has never been saved , then a filename needs to be chosen under this ' special ' condition this method logically turns into a { @ link # save as ( component , file archive ) }

public static void save ( component component , archive archive ) throws duplicate file exception , i o exception { if ( ! archive is savable ( ) ) { archive save as ( component ) ; } else { archive save ( ) ; } }


public header [ ] head request ( string reason , swift object path path , final header request headers ) throws i o exception { pre remote command ( " head request : " + reason ) ; return perform ( reason , path to u r i ( path ) , new head request processor < header [ ] > ( ) { @ override public header [ ] extract result ( http head req , http response resp ) throws i o exception { if ( resp get status line ( ) get status code ( ) = = sc not found ) { throw new file not found exception ( " not found " + req get u r i ( ) ) ; } return resp get all headers ( ) ; } @ override protected void setup ( http head req ) throws swift internal state exception { set headers ( req , request headers ) ; } } ) ; }


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

public static fields find by thrift id ( int field id ) { switch ( field id ) { case 1 : / / func args return func args ; case 2 : / / request id return request id ; default : return null ; } }


returns a flat map from jars to dex archives transitively produced for the given dexopts

public map < artifact , artifact > archives for dexopts ( immutable set < string > dexopts ) { / / can ' t use immutable map because we can encounter the same key - value pair multiple times / / use linked hash map in case someone tries to iterate this map ( not the case as of 2 / 2017 ) linked hash map < artifact , artifact > result = new linked hash map < > ( ) ; for ( immutable table < immutable set < string > , artifact , artifact > partial mapping : dex archives to list ( ) ) { result put all ( partial mapping row ( dexopts ) ) ; } return result ; }


tests that a shard snapshot with a corrupted shard index file can still be used for restore and incremental snapshots

public void test snapshot with corrupted shard index file ( ) throws exception { final client client = client ( ) ; final path repo = random repo path ( ) ; final string index name = " test - idx " ; final int n docs = random int between ( 1 , 10 ) ; logger info ( " - - > creating index [ { } ] with [ { } ] documents in it " , index name , n docs ) ; assert acked ( prepare create ( index name ) set settings ( index settings no replicas ( 1 ) ) ) ; final index request builder [ ] documents = new index request builder [ n docs ] ; for ( int j = 0 ; j < n docs ; j + + ) { documents [ j ] = client prepare index ( index name ) set source ( " foo " , " bar " ) ; } index random ( true , documents ) ; flush and refresh ( ) ; create repository ( " test - repo " , " fs " , repo ) ; final string snapshot 1 = " test - snap - 1 " ; final snapshot info snapshot info = create full snapshot ( " test - repo " , snapshot 1 ) ; assert that ( snapshot info indices ( ) , has size ( 1 ) ) ; final repository data repository data = get repository data ( " test - repo " ) ; final map < string , index id > index ids = repository data get indices ( ) ; assert that ( index ids size ( ) , equal to ( 1 ) ) ; final index id corrupted index = index ids get ( index name ) ; final path shard index file = repo resolve ( " indices " ) resolve ( corrupted index get id ( ) ) resolve ( " 0 " ) resolve ( " index - " + repository data shard generations ( ) get shard gen ( corrupted index , 0 ) ) ; logger info ( " - - > truncating shard index file [ { } ] " , shard index file ) ; try ( seekable byte channel out chan = files new byte channel ( shard index file , standard open option write ) ) { out chan truncate ( random int ( 10 ) ) ; } logger info ( " - - > verifying snapshot state for [ { } ] " , snapshot 1 ) ; list < snapshot info > snapshot infos = cluster admin ( ) prepare get snapshots ( " test - repo " ) get ( ) get snapshots ( " test - repo " ) ; assert that ( snapshot infos size ( ) , equal to ( 1 ) ) ; assert that ( snapshot infos get ( 0 ) state ( ) , equal to ( snapshot state success ) ) ; assert that ( snapshot infos get ( 0 ) snapshot id ( ) get name ( ) , equal to ( snapshot 1 ) ) ; logger info ( " - - > deleting index [ { } ] " , index name ) ; assert acked ( client ( ) admin ( ) indices ( ) prepare delete ( index name ) ) ; logger info ( " - - > restoring snapshot [ { } ] " , snapshot 1 ) ; cluster admin ( ) prepare restore snapshot ( " test - repo " , snapshot 1 ) set restore global state ( random boolean ( ) ) set wait for completion ( true ) get ( ) ; ensure green ( ) ; assert doc count ( index name , n docs ) ; logger info ( " - - > indexing [ { } ] more documents into [ { } ] " , n docs , index name ) ; for ( int j = 0 ; j < n docs ; j + + ) { documents [ j ] = client prepare index ( index name ) set source ( " foo 2 " , " bar 2 " ) ; } index random ( true , documents ) ; final string snapshot 2 = " test - snap - 2 " ; logger info ( " - - > creating snapshot [ { } ] " , snapshot 2 ) ; final snapshot info snapshot info 2 = cluster admin ( ) prepare create snapshot ( " test - repo " , snapshot 2 ) set wait for completion ( true ) get ( ) get snapshot info ( ) ; assert that ( snapshot info 2 state ( ) , equal to ( snapshot state partial ) ) ; assert that ( snapshot info 2 failed shards ( ) , equal to ( 1 ) ) ; assert that ( snapshot info 2 successful shards ( ) , equal to ( snapshot info total shards ( ) - 1 ) ) ; assert that ( snapshot info 2 indices ( ) , has size ( 1 ) ) ; }


sets the aspects that are propagating to the target this dependency points to

builder set aspects ( aspect collection aspect collection ) ;


scan fields annotated by & # 064 ; inject mocks

private set < field > scan ( ) { set < field > mock dependent fields = new hash set < field > ( ) ; field [ ] fields = clazz get declared fields ( ) ; for ( field field : fields ) { if ( null ! = field get annotation ( inject mocks class ) ) { assert no annotations ( field , mock class , captor class ) ; mock dependent fields add ( field ) ; } } return mock dependent fields ; }


creates a new { @ link default drm session } and acquires it on behalf of the caller ( passing in { @ code event dispatcher } ) if { @ link # session keepalive ms } ! = { @ link c # time unset } then acquires it again to allow the manager to keep it alive ( passing in { @ code event dispatcher = null }

private default drm session create and acquire session ( @ nullable list < scheme data > scheme datas , boolean is placeholder session , @ nullable drm session event listener event dispatcher event dispatcher ) { assertions check not null ( exo media drm ) ; / / placeholder sessions should always play clear samples without keys boolean play clear samples without keys = this play clear samples without keys | is placeholder session ; default drm session session = new default drm session ( uuid , exo media drm , / * provisioning manager = * / provisioning manager impl , reference count listener , scheme datas , mode , play clear samples without keys , is placeholder session , offline license key set id , key request parameters , callback , assertions check not null ( playback looper ) , load error handling policy ) ; / / acquire the session once on behalf of the caller to drm session manager - this is the / / reference ' assigned ' to the caller which they ' re responsible for releasing do this first , / / to ensure that event dispatcher receives all events related to the initial / / acquisition / opening session acquire ( event dispatcher ) ; if ( session keepalive ms ! = c time unset ) { / / acquire the session once more so the manager can keep it alive session acquire ( / * event dispatcher = * / null ) ; } return session ; }


sets the { @ link load error handling policy } the default value is created by calling { @ link default load error handling policy # default load error handling policy ( ) } calling this method overrides any calls to { @ link # set min loadable retry count ( int ) }

public factory set load error handling policy ( @ nullable load error handling policy load error handling policy ) { this load error handling policy = load error handling policy ! = null ? load error handling policy : new default load error handling policy ( ) ; return this ; }


marks this runner ' s job as not running other job manager will not recover the job after this call this method never throws an exception

private void unregister job from high availability ( ) { try { running jobs registry set job finished ( job graph get job i d ( ) ) ; } catch ( throwable t ) { log error ( " could not un - register from high - availability services job { } ( { } ) " + " other job manager ' s may attempt to recover it and re - execute it " , job graph get name ( ) , job graph get job i d ( ) , t ) ; } }


loads ( but doesn ' t link or initialize ) the class

public class < ? > load ( ) { try { return loader load class ( class name ) ; } catch ( class not found exception e ) { / / shouldn ' t happen , since the class name is read from the class path throw new illegal state exception ( e ) ; } }


< code > optional org apache dubbo common serialize protobuf model phone type type = 2 [ default = home ] ; < code >


return a string template that refers to the current format used for emitting messages

public st get location format ( ) { return format get instance of ( " location " ) ; }


get the current length of the segment attached to body 1

public float get length 1 ( ) { return jni get length 1 ( addr ) ; }


converts { @ link reader } to given type

public static < t > t from json ( @ non null final reader reader , @ non null final class < t > type ) { return from json ( get gson ( ) , reader , type ) ; }


public void name thread ( ) { thread current thread ( ) set name ( " j unit " ) ; }