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

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


compute set of tokens that can follow { @ code s } in the atn in the specified { @ code ctx } if { @ code ctx } is { @ code null } and the end of the rule containing { @ code s } is reached , { @ link token # epsilon } is added to the result set if { @ code ctx } is not { @ code null } and the end of the outermost rule is reached , { @ link token # eof } is added to the result set

public interval set look ( a t n state s , a t n state stop state , rule context ctx ) { interval set r = new interval set ( ) ; boolean see thru preds = true ; / / ignore preds ; get all lookahead prediction context look context = ctx ! = null ? prediction context from rule context ( s atn , ctx ) : null ; look ( s , stop state , look context , r , new hash set < a t n config > ( ) , new bit set ( ) , see thru preds , true ) ; return r ; }


specifies a sql - like filter condition on the table ' s partition columns filter conditions on non - partition columns are invalid a partition filter can significantly reduce the amount of data to be read

public h cat input format base < t > with filter ( string filter ) throws i o exception { / / set filter this h cat input format set filter ( filter ) ; return this ; }


returns either a data type d b or an type ( impl that might be an empty container ) that suffices to break cyclical dependencies in data type generation

data type get cycle break type ( ) { return get data type ( ) ; }


public void write op ( f s edit log op op , int log version ) throws i o exception { int start = buf get length ( ) ; / / write the op code first to make padding and terminator verification / / work buf write byte ( op op code get op code ( ) ) ; buf write int ( 0 ) ; / / write 0 for the length first buf write long ( op txid ) ; op write fields ( buf , log version ) ; int end = buf get length ( ) ; / / write the length back : content of the op + 4 bytes checksum - op code int length = end - start - 1 ; buf write int ( length , start + 1 ) ; checksum reset ( ) ; checksum update ( buf get data ( ) , start , end - start ) ; int sum = ( int ) checksum get value ( ) ; buf write int ( sum ) ; }


public void get gauge ( io grpc testing integration metrics gauge request request , io grpc stub stream observer < io grpc testing integration metrics gauge response > response observer ) { io grpc stub server calls async unimplemented unary call ( get get gauge method ( ) , response observer ) ; }


returns a { @ link configured target } which indicates that an analysis error occurred in processing the target in most cases , this returns null , which signals to callers that the target failed to build and thus the build should fail however , if analysis failures are allowed in this build , this returns a stub { @ link configured target } which contains information about the failure

private configured target errored configured target ( rule context rule context ) throws action conflict exception , interrupted exception { if ( rule context get configuration ( ) allow analysis failures ( ) ) { immutable list builder < analysis failure > analysis failures = immutable list builder ( ) ; for ( string error message : rule context get suppressed error messages ( ) ) { analysis failures add ( new analysis failure ( rule context get label ( ) , error message ) ) ; } rule configured target builder builder = new rule configured target builder ( rule context ) ; builder add native declared provider ( analysis failure info for analysis failures ( analysis failures build ( ) ) ) ; builder add provider ( runfiles provider class , runfiles provider simple ( runfiles empty ) ) ; return builder build ( ) ; } else { / / returning a null configured target is an indication a rule error occurred exceptions are / / not propagated , as this would show a nasty stack trace to users , and only provide info / / on one specific failure with poor messaging by returning null , the caller can / / inspect rule context for multiple errors and output thorough messaging on each return null ; } }


do the actual work of walking epsilon edges

protected void closure ( a t n config config , a t n config set configs , set < a t n config > closure busy , boolean collect predicates , boolean full ctx , int depth , boolean treat eof as epsilon ) { a t n state p = config state ; / / optimization if ( ! p only has epsilon transitions ( ) ) { configs add ( config , merge cache ) ; / / make sure to not return here , because eof transitions can act as / / both epsilon transitions and non - epsilon transitions / / if ( debug ) system out println ( " added config " + configs ) ; } for ( int i = 0 ; i < p get number of transitions ( ) ; i + + ) { if ( i = = 0 & & can drop loop entry edge in left recursive rule ( config ) ) continue ; transition t = p transition ( i ) ; boolean continue collecting = ! ( t instanceof action transition ) & & collect predicates ; a t n config c = get epsilon target ( config , t , continue collecting , depth = = 0 , full ctx , treat eof as epsilon ) ; if ( c ! = null ) { int new depth = depth ; if ( config state instanceof rule stop state ) { assert ! full ctx ; / / target fell off end of rule ; mark resulting c as having dipped into outer context / / we can ' t get here if incoming config was rule stop and we had context / / track how far we dip into outer context might / / come in handy and we avoid evaluating context dependent / / preds if this is > 0 if ( dfa ! = null & & dfa is precedence dfa ( ) ) { int outermost precedence return = ( ( epsilon transition ) t ) outermost precedence return ( ) ; if ( outermost precedence return = = dfa atn start state rule index ) { c set precedence filter suppressed ( true ) ; } } c reaches into outer context + + ; if ( ! closure busy add ( c ) ) { / / avoid infinite recursion for right - recursive rules continue ; } configs dips into outer context = true ; / / todo : can remove ? only care when we add to set per middle of this method assert new depth > integer min value ; new depth - - ; if ( debug ) system out println ( " dips into outer ctx : " + c ) ; } else { if ( ! t is epsilon ( ) & & ! closure busy add ( c ) ) { / / avoid infinite recursion for eof * and eof + continue ; } if ( t instanceof rule transition ) { / / latch when new depth goes negative - once we step out of the entry context we can ' t return if ( new depth > = 0 ) { new depth + + ; } } } closure checking stop state ( c , configs , closure busy , continue collecting , full ctx , new depth , treat eof as epsilon ) ; } } }


public string permissions ( ) { return permissions ; }


adjusts the given bounds to make sure that they do not cover the given location when the < tt > hover area < tt > is obscured , this method will first attempt to move the bounds up if possible if moving up is not possible due to space constraints , then this method will try to shift the bounds to the right of the hover area if this is not possible , then the bounds will not be changed

private rectangle adjust bounds for cursor location ( rectangle bounds , rectangle hover area ) { if ( ! bounds intersects ( hover area ) ) { return bounds ; } / / first attempt to move the window - - try to go up int moved y = hover area y - bounds height ; boolean can move up = moved y > = 0 ; if ( can move up ) { / / move the given bounds above the current point bounds y = moved y ; return bounds ; } / / we couldn ' t move up , so we try to go left , since by default the popup is placed / / to the right of the hover area int moved x = hover area x - bounds width ; boolean can move left = moved x > = 0 ; if ( can move left ) { bounds x = moved x ; } return bounds ; }


assume that the huge file exists ; skip the test if it does not

void assume huge file exists ( ) throws i o exception { assume file exists ( this hugefile ) ; }


< code > repeated org apache dubbo common serialize protobuf model phone number phone = 8 ; < code >

public builder clear phone ( ) { if ( phone builder = = null ) { phone = java util collections empty list ( ) ; bit field 0 = ( bit field 0 & ~ 0x 0 0 0 0 0 0 8 0 ) ; on changed ( ) ; } else { phone builder clear ( ) ; } return this ; }


return the producer id of the record batches created by this builder

public long producer id ( ) { return this producer id ; }


public static map config build map config ( final base hazelcast properties hz , final string map name , final long timeout seconds ) { val cluster = hz get cluster ( ) ; val eviction policy = eviction policy value of ( cluster get eviction policy ( ) ) ; val eviction config = new eviction config ( ) ; eviction config set eviction policy ( eviction policy ) ; eviction config set max size policy ( max size policy value of ( cluster get max size policy ( ) ) ) ; eviction config set size ( cluster get max size ( ) ) ; val merge policy config = new merge policy config ( ) ; if ( string utils has text ( cluster get map merge policy ( ) ) ) { switch ( cluster get map merge policy ( ) trim ( ) to lower case ( ) ) { case " discard " : merge policy config set policy ( discard merge policy class get name ( ) ) ; break ; case " pass through " : merge policy config set policy ( pass through merge policy class get name ( ) ) ; break ; case " expiration time " : merge policy config set policy ( expiration time merge policy class get name ( ) ) ; break ; case " higher hits " : merge policy config set policy ( higher hits merge policy class get name ( ) ) ; break ; case " latest update " : merge policy config set policy ( latest update merge policy class get name ( ) ) ; break ; case " latest access " : merge policy config set policy ( latest access merge policy class get name ( ) ) ; break ; case " put if absent " : default : merge policy config set policy ( put if absent merge policy class get name ( ) ) ; break ; } } return new map config ( ) set name ( map name ) set merge policy config ( merge policy config ) set max idle seconds ( ( int ) timeout seconds ) set backup count ( cluster get backup count ( ) ) set async backup count ( cluster get async backup count ( ) ) set eviction config ( eviction config ) ; }


configures a failure handling strategy in case a request to elasticsearch fails this strategy ignores failures and drops the request

public elasticsearch failure handler ignore ( ) { internal properties put string ( connector failure handler , elasticsearch validator connector failure handler value ignore ) ; return this ; }


return an ordered version of the client environment restricted to those variables allowlisted by the command - line options to be inheritable by actions

public map < string , string > get allowlisted test env ( ) { return filter client env ( visible test env ) ; }


creates a new server - side { @ link ssl context }

public static ssl context new server context ( file cert chain file , file key file , string key password , iterable < string > ciphers , iterable < string > next protocols , long session cache size , long session timeout ) throws s s l exception { return new server context ( null , cert chain file , key file , key password , ciphers , next protocols , session cache size , session timeout ) ; }


create a new { @ link composite aggregation builder } aggregation with the given name

public static composite aggregation builder composite ( string name , list < composite values source builder < ? > > sources ) { return new composite aggregation builder ( name , sources ) ; }


opens the given project in a task that will show a dialog to block input while opening the project in the swing thread

final boolean open project ( project locator project locator ) { open task runnable open runnable = new open task runnable ( project locator ) ; task launcher launch modal ( " opening project " , ( ) - > swing run now ( open runnable ) ) ; return open runnable get result ( ) ; }


sets the validation method to use for geo coordinates

public geo polygon query builder set validation method ( geo validation method method ) { this validation method = method ; return this ; }


extract the ( mandatory ) cause of an exception

private < e extends throwable > e verify cause class ( throwable ex , class < e > clazz ) throws assertion error { throwable cause = ex get cause ( ) ; if ( cause = = null ) { throw new assertion error ( " no cause " , ex ) ; } if ( ! cause get class ( ) equals ( clazz ) ) { throw new assertion error ( " wrong cause class " , cause ) ; } return ( e ) cause ; }


public object get target ( ) { jenkins get ( ) check permission ( jenkins administer ) ; return this ; }


public void test attempts block ( ) { app context ctx = mock ( app context class ) ; app for test app = new app for test ( ctx ) ; task task = get task ( 0 ) ; map < task attempt id , task attempt > attempts = new hash map < task attempt id , task attempt > ( ) ; task attempt attempt = mock ( task attempt class ) ; task attempt id ta id = new task attempt id p b impl ( ) ; ta id set id ( 0 ) ; ta id set task id ( task get i d ( ) ) ; when ( attempt get i d ( ) ) then return ( ta id ) ; when ( attempt get node http address ( ) ) then return ( " node address " ) ; application id app id = application id p b impl new instance ( 0 , 5 ) ; application attempt id app attempt id = application attempt id p b impl new instance ( app id , 1 ) ; container id container id = container id p b impl new container id ( app attempt id , 1 ) ; when ( attempt get assigned container i d ( ) ) then return ( container id ) ; when ( attempt get assigned container mgr address ( ) ) then return ( " assigned container mgr address " ) ; when ( attempt get node rack name ( ) ) then return ( " node rack name " ) ; final long ta start time = 100002l ; final long ta finish time = 100012l ; final long ta shuffle finish time = 100010l ; final long ta sort finish time = 100011l ; final task attempt state ta state = task attempt state succeeded ; when ( attempt get launch time ( ) ) then return ( ta start time ) ; when ( attempt get finish time ( ) ) then return ( ta finish time ) ; when ( attempt get shuffle finish time ( ) ) then return ( ta shuffle finish time ) ; when ( attempt get sort finish time ( ) ) then return ( ta sort finish time ) ; when ( attempt get state ( ) ) then return ( ta state ) ; task attempt report ta report = mock ( task attempt report class ) ; when ( ta report get start time ( ) ) then return ( ta start time ) ; when ( ta report get finish time ( ) ) then return ( ta finish time ) ; when ( ta report get shuffle finish time ( ) ) then return ( ta shuffle finish time ) ; when ( ta report get sort finish time ( ) ) then return ( ta sort finish time ) ; when ( ta report get container id ( ) ) then return ( container id ) ; when ( ta report get progress ( ) ) then return ( 1 0f ) ; when ( ta report get state string ( ) ) then return ( " processed 128 / 128 records < p > \ n " ) ; when ( ta report get task attempt state ( ) ) then return ( ta state ) ; when ( ta report get diagnostic info ( ) ) then return ( " " ) ; when ( attempt get report ( ) ) then return ( ta report ) ; attempts put ( ta id , attempt ) ; when ( task get attempts ( ) ) then return ( attempts ) ; app set task ( task ) ; job job = mock ( job class ) ; when ( job get user name ( ) ) then return ( " user " ) ; app set job ( job ) ; configuration conf = new configuration ( ) ; conf set boolean ( yarn configuration log aggregation enabled , true ) ; attempts block for test block = new attempts block for test ( app , conf ) ; block add parameter ( a m params task type , " r " ) ; print writer p writer = new print writer ( data ) ; block html = new block for test ( new html block for test ( ) , p writer , 0 , false ) ; block render ( html ) ; p writer flush ( ) ; / / should be printed information about attempts assert true ( data to string ( ) contains ( " attempt 0 0001 r 000000 0 " ) ) ; assert true ( data to string ( ) contains ( " succeeded " ) ) ; assert false ( data to string ( ) contains ( " processed 128 / 128 records < p > \ n " ) ) ; assert true ( data to string ( ) contains ( " processed 128 \ \ / 128 records & lt ; p & gt ; \ \ n " ) ) ; assert true ( data to string ( ) contains ( " 0005 01 000001 : attempt 0 0001 r 000000 0 : user : " ) ) ; assert true ( data to string ( ) contains ( " 100002 " ) ) ; assert true ( data to string ( ) contains ( " 100010 " ) ) ; assert true ( data to string ( ) contains ( " 100011 " ) ) ; assert true ( data to string ( ) contains ( " 100012 " ) ) ; data reset ( ) ; conf set boolean ( yarn configuration log aggregation enabled , false ) ; block = new attempts block for test ( app , conf ) ; block add parameter ( a m params task type , " r " ) ; p writer = new print writer ( data ) ; html = new block for test ( new html block for test ( ) , p writer , 0 , false ) ; block render ( html ) ; p writer flush ( ) ; / / should be printed information about attempts assert true ( data to string ( ) contains ( " attempt 0 0001 r 000000 0 " ) ) ; assert true ( data to string ( ) contains ( " succeeded " ) ) ; assert false ( data to string ( ) contains ( " processed 128 / 128 records < p > \ n " ) ) ; assert true ( data to string ( ) contains ( " processed 128 \ \ / 128 records & lt ; p & gt ; \ \ n " ) ) ; assert true ( data to string ( ) contains ( " node address : node : containerlogs : container 0 0005 01 000001 : user : " ) ) ; assert true ( data to string ( ) contains ( " 100002 " ) ) ; assert true ( data to string ( ) contains ( " 100010 " ) ) ; assert true ( data to string ( ) contains ( " 100011 " ) ) ; assert true ( data to string ( ) contains ( " 100012 " ) ) ; }


helper method to determine a limit ' s collation

public static list < rel collation > limit ( rel metadata query mq , rel node input ) { return mq collations ( input ) ; }


public void set data ( string path , string data , int version ) throws exception { byte [ ] bytes = data get bytes ( charset for name ( " utf - 8 " ) ) ; set data ( path , bytes , version ) ; }


outputs a reasonably normalized javac option list

public list < string > normalize ( list < string > javacopts ) { list < string > normalized = new array list < > ( ) ; iterator < string > it = javacopts iterator ( ) ; while ( it has next ( ) ) { string opt = it next ( ) ; boolean found = false ; for ( javac option normalizer normalizer : normalizers ) { if ( normalizer process option ( opt , it ) ) { found = true ; break ; } } if ( ! found ) { normalized add ( opt ) ; } } for ( javac option normalizer normalizer : normalizers ) { normalizer normalize ( normalized ) ; } return normalized ; }


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


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

private void create fragment ( program node node ) { synchronized ( root ) { string err msg = null ; / / sync program so we don ' t get a deadlock - - / / an event gets generated because of the add module synchronized ( program ) { string name = tree get new fragment name ( ) ; string tree name = tree get tree name ( ) ; create fragment cmd cmd = new create fragment cmd ( tree name , name , node get name ( ) ) ; if ( tree get tool ( ) execute ( cmd , program ) ) { program fragment f = program get listing ( ) get fragment ( tree name , name ) ; initiate cell editor ( node , f ) ; } else { err msg = cmd get status msg ( ) ; } } if ( err msg ! = null ) { msg show error ( this , tree , " create fragment failed " , err msg ) ; } } }


public static < k , v > multimap < k , v > unmodifiable multimap ( immutable multimap < k , v > delegate ) { return check not null ( delegate ) ; }


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 : / / arg return arg ; default : return null ; } }


method that the service will run periodically

protected abstract void periodic invoke ( ) ;


marks the current { @ code reader index } in this buffer you can reposition the current { @ code reader index } to the marked { @ code reader index } by calling { @ link # reset reader index ( ) } the initial value of the marked { @ code reader index } is { @ code 0 }


helper method to build downstream tls context for multiple test classes

static io envoyproxy envoy api v 2 auth downstream tls context build downstream tls context v 2 ( io envoyproxy envoy api v 2 auth common tls context common tls context , boolean require client cert ) { io envoyproxy envoy api v 2 auth downstream tls context downstream tls context = io envoyproxy envoy api v 2 auth downstream tls context new builder ( ) set common tls context ( common tls context ) set require client certificate ( bool value of ( require client cert ) ) build ( ) ; return downstream tls context ; }


add a duration to the minmeanmax statistics , using the given prefix and adding a suffix for each specific value the update is non - atomic , even though each individual statistic is updated thread - safely if two threads update the values simultaneously , at the end of each operation the state will be correct it is only during the sequence that the statistics may be observably inconsistent

public void add timed operation ( string prefix , long duration millis ) { add mean statistic sample ( prefix + suffix mean , duration millis ) ; add minimum sample ( prefix + suffix min , duration millis ) ; add maximum sample ( prefix + suffix max , duration millis ) ; }


move all records from index to the end by the specified offset

private int move records ( int index , int offset ) { int last index = key count - 1 ; / / no movement needed for appended record if ( index = = key count ) { if ( index = = 0 ) { return buffer length ( ) + offset ; } return get record key offset ( last index ) + offset ; } / / determine block to be moved int start = get record key offset ( last index ) ; int end = ( index = = 0 ) ? buffer length ( ) : get record key offset ( index - 1 ) ; int len = end - start ; / / move record data buffer move ( start , start + offset , len ) ; / / adjust stored offsets for ( int i = index ; i < key count ; i + + ) { put record key offset ( i , get record key offset ( i ) + offset ) ; } return end + offset ; }


replaces the resource at the specified index and returns the old resource

public disposable replace resource ( int index , disposable resource ) { for ( ; ; ) { disposable o = get ( index ) ; if ( o = = disposable helper disposed ) { resource dispose ( ) ; return null ; } if ( compare and set ( index , o , resource ) ) { return o ; } } }


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


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

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


establish a connection to a remote server

public i connection connect ( string storm id , string host , int port ) { i connection client = new client ( storm conf , host , port ) ; connections add ( client ) ; return client ; }


other process may have installed old patch version , if we try to clean patch , we should kill other process first

public void check and clean patch ( ) { tinker tinker = tinker with ( context ) ; / / only main process can load a new patch if ( tinker is main process ( ) ) { tinker load result tinker load result = tinker get tinker load result if present ( ) ; / / if version change and the old patch version is not " " if ( tinker load result version changed ) { share patch info share patch info = tinker load result patch info ; if ( share patch info ! = null & & ! share tinker internals is null or nil ( share patch info old version ) ) { share tinker log w ( tag , " check and clean patch , old version % s is not null , try kill all other process " , share patch info old version ) ; share tinker internals kill all other process ( context ) ; } } } tinker clean patch ( ) ; }


public static void start activity for result ( @ non null final fragment fragment , @ non null final intent intent , final int request code ) { start activity for result ( intent , fragment , request code , null ) ; }


return the source of the resolver ( used for hash code and equals )


public map < string , big decimal > get map number ( ) { return map number ; }


perform an action on each record of { @ code k stream } this is a stateless record - by - record operation ( cf { @ link # process ( processor supplier , string ) } ) peek is a non - terminal operation that triggers a side effect ( such as logging or statistics collection ) and returns an unchanged stream note that since this operation is stateless , it may execute multiple times for a single record in failure cases

k stream < k , v > peek ( final foreach action < ? super k , ? super v > action , final named named ) ;


parses a runtime [ in ] visible type annotations attribute to find the offset of each type annotation entry it contains , to find the corresponding labels , and to visit the try catch block annotations

private int [ ] read type annotations ( final method visitor method visitor , final context context , final int runtime type annotations offset , final boolean visible ) { char [ ] char buffer = context char buffer ; int current offset = runtime type annotations offset ; / / read the num annotations field and create an array to store the type annotation offsets int [ ] type annotations offsets = new int [ read unsigned short ( current offset ) ] ; current offset + = 2 ; / / parse the ' annotations ' array field for ( int i = 0 ; i < type annotations offsets length ; + + i ) { type annotations offsets [ i ] = current offset ; / / parse the type annotation ' s target type and the target info fields the size of the / / target info field depends on the value of target type int target type = read int ( current offset ) ; switch ( target type > > > 24 ) { case type reference local variable : case type reference resource variable : / / a localvar target has a variable size , which depends on the value of their table length / / field it also references bytecode offsets , for which we need labels int table length = read unsigned short ( current offset + 1 ) ; current offset + = 3 ; while ( table length - - > 0 ) { int start pc = read unsigned short ( current offset ) ; int length = read unsigned short ( current offset + 2 ) ; / / skip the index field ( 2 bytes ) current offset + = 6 ; create label ( start pc , context current method labels ) ; create label ( start pc + length , context current method labels ) ; } break ; case type reference cast : case type reference constructor invocation type argument : case type reference method invocation type argument : case type reference constructor reference type argument : case type reference method reference type argument : current offset + = 4 ; break ; case type reference class extends : case type reference class type parameter bound : case type reference method type parameter bound : case type reference throws : case type reference exception parameter : case type reference instanceof : case type reference new : case type reference constructor reference : case type reference method reference : current offset + = 3 ; break ; case type reference class type parameter : case type reference method type parameter : case type reference method formal parameter : case type reference field : case type reference method return : case type reference method receiver : default : / / type reference type which can ' t be used in code attribute , or which is unknown throw new illegal argument exception ( ) ; } / / parse the rest of the type annotation structure , starting with the target path structure / / ( whose size depends on its path length field ) int path length = read byte ( current offset ) ; if ( ( target type > > > 24 ) = = type reference exception parameter ) { / / parse the target path structure and create a corresponding type path type path path = path length = = 0 ? null : new type path ( class file buffer , current offset ) ; current offset + = 1 + 2 * path length ; / / parse the type index field string annotation descriptor = read u t f 8 ( current offset , char buffer ) ; current offset + = 2 ; / / parse num element value pairs and element value pairs and visit these values current offset = read element values ( method visitor visit try catch annotation ( target type & 0x f f f f f f 0 0 , path , annotation descriptor , visible ) , current offset , / * named = * / true , char buffer ) ; } else { / / we don ' t want to visit the other target type annotations , so we just skip them ( which / / requires some parsing because the element value pairs array has a variable size ) first , / / skip the target path structure : current offset + = 3 + 2 * path length ; / / then skip the num element value pairs and element value pairs fields ( by reading them / / with a null annotation visitor ) current offset = read element values ( / * annotation visitor = * / null , current offset , / * named = * / true , char buffer ) ; } } return type annotations offsets ; }


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

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


public static file temp file ( configuration conf , string prefix , long size ) throws i o exception { return get allocator ( conf , buffer dir ) create tmp file for write ( prefix , size , conf ) ; }


returns list of { @ link charset } s that encode with the number of bytes specified

public list < string > get charset names with char size ( int size ) { list < string > names = new array list < > ( ) ; for ( string name : charset names ) { if ( get charset char size ( name ) = = size ) { names add ( name ) ; } } return names ; }


public void set text ( string text ) { if ( text ! = null & & text length ( ) = = 0 ) { text = null ; } this text = text ; }


compares two reference addresses to determine whether the first is effectively less than ( comes before it in memory ) , equal to ( at the same spot in memory ) , or greater than ( comes after it in memory ) the second

public int compare ( object obj 1 , object obj 2 ) { address a 1 = ( address ) obj 1 ; address a 2 = ( address ) obj 2 ; address address 2 compatible with 1 = simple diff utility get compatible address ( program 2 , a 2 , program 1 ) ; return a 1 compare to ( address 2 compatible with 1 ) ; }


public boolean is raw ( ) { return is raw ; }


public void handle ( container scheduler event event ) { switch ( event get type ( ) ) { case schedule container : schedule container ( event get container ( ) ) ; break ; / / note : is sent only after container state has changed to paused case container paused : / / note : is sent only after container state has changed to done case container completed : on resources reclaimed ( event get container ( ) ) ; break ; case update container : if ( event instanceof update container scheduler event ) { on update container ( ( update container scheduler event ) event ) ; } else { log error ( " unknown event type on update c ontainer : " + event get type ( ) ) ; } break ; case shed queued containers : shed queued opportunistic containers ( ) ; break ; case recovery completed : start pending containers ( max opp queue length < = 0 ) ; metrics set queued containers ( queued opportunistic containers size ( ) , queued guaranteed containers size ( ) ) ; break ; default : log error ( " unknown event arrived at container scheduler : " + event to string ( ) ) ; } }


set the d ns to belong to only one subcluster

public void set independent d ns ( ) { this shared d ns = false ; }


gets the token , which together with the scheme , will be sent as the value of the authorization header

public string get bearer token ( ) { return bearer token ; }


get the number of models added so far during the { @ link # build models ( ) } phase it is only valid to call this from within that method this is different from the number of models currently on the adapter , since models on the adapter are not updated until after models are finished being built to access current adapter count call { @ link # get adapter ( ) } and { @ link epoxy controller adapter # get item count ( ) }

protected int get model count built so far ( ) { assert is building models ( ) ; return models being built size ( ) ; }


get the string property at the given offset

string get string ( short offset ) { if ( key set contains key ( offset ) ) { int row = get row ( offset , false ) ; return table get string ( row , 0 ) ; } return null ; }


private object resolve inner bean ( object arg name , string inner bean name , bean definition inner bd ) { root bean definition mbd = null ; try { mbd = this bean factory get merged bean definition ( inner bean name , inner bd , this bean definition ) ; / / check given bean name whether it is unique if not already unique , / / add counter - increasing the counter until the name is unique string actual inner bean name = inner bean name ; if ( mbd is singleton ( ) ) { actual inner bean name = adapt inner bean name ( inner bean name ) ; } this bean factory register contained bean ( actual inner bean name , this bean name ) ; / / guarantee initialization of beans that the inner bean depends on string [ ] depends on = mbd get depends on ( ) ; if ( depends on ! = null ) { for ( string depends on bean : depends on ) { this bean factory register dependent bean ( depends on bean , actual inner bean name ) ; this bean factory get bean ( depends on bean ) ; } } / / actually create the inner bean instance now object inner bean = this bean factory create bean ( actual inner bean name , mbd , null ) ; if ( inner bean instanceof factory bean ) { boolean synthetic = mbd is synthetic ( ) ; inner bean = this bean factory get object from factory bean ( ( factory bean < ? > ) inner bean , actual inner bean name , ! synthetic ) ; } if ( inner bean instanceof null bean ) { inner bean = null ; } return inner bean ; } catch ( beans exception ex ) { throw new bean creation exception ( this bean definition get resource description ( ) , this bean name , " cannot create inner bean ' " + inner bean name + " ' " + ( mbd ! = null & & mbd get bean class name ( ) ! = null ? " of type [ " + mbd get bean class name ( ) + " ] " : " " ) + " while setting " + arg name , ex ) ; } }


asserts that the expected completion time has passed ( and not " too much " time beyond that )

void assert completion expected ( ) { assert at least time passed ( stopwatch , expected completion wait millis ) ; assert time not passed ( stopwatch , expected completion wait millis + long delay ms ) ; }


calculates the dominance - frontier set from " a simple , fast dominance algorithm " by cooper , harvey , and kennedy ; transliterated to java

private void calc dom fronts ( ) { int sz nodes = nodes size ( ) ; for ( int b = 0 ; b < sz nodes ; b + + ) { ssa basic block nb = nodes get ( b ) ; dom info nb info = dom infos [ b ] ; bit set pred = nb get predecessors ( ) ; if ( pred cardinality ( ) > 1 ) { for ( int i = pred next set bit ( 0 ) ; i > = 0 ; i = pred next set bit ( i + 1 ) ) { for ( int runner index = i ; runner index ! = nb info idom ; / * empty * / ) { / * * we can stop if we hit a block we already * added label to , since we must be at a part * of the dom tree we have seen before * / if ( runner index = = - 1 ) break ; dom info runner info = dom infos [ runner index ] ; if ( runner info dominance frontiers has ( b ) ) { break ; } / / add b to runner ' s dominance frontier set runner info dominance frontiers add ( b ) ; runner index = runner info idom ; } } } } }


process the given request , generating a response

void handle request ( http servlet request request , http servlet response response ) throws servlet exception , i o exception ;


public static < k , v > immutable sorted map builder < k , v > builder with expected size ( int expected size ) { throw new unsupported operation exception ( ) ; }


sets the timeout for the command run using the { @ code linux - sandbox } tool

public command line builder set timeout ( duration timeout ) { this timeout = timeout ; return this ; }


test the property ' array array of integer '

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


check the given property values for field markers , i e for fields that start with the field marker prefix the existence of a field marker indicates that the specified field existed in the form if the property values do not contain a corresponding field value , the field will be considered as empty and will be reset appropriately

protected void check field markers ( mutable property values mpvs ) { string field marker prefix = get field marker prefix ( ) ; if ( field marker prefix ! = null ) { property value [ ] pv array = mpvs get property values ( ) ; for ( property value pv : pv array ) { if ( pv get name ( ) starts with ( field marker prefix ) ) { string field = pv get name ( ) substring ( field marker prefix length ( ) ) ; if ( get property accessor ( ) is writable property ( field ) & & ! mpvs contains ( field ) ) { class < ? > field type = get property accessor ( ) get property type ( field ) ; mpvs add ( field , get empty value ( field , field type ) ) ; } mpvs remove property value ( pv ) ; } } } }


try to delete a file , verify that it is not allowed

public static void assert delete forbidden ( final file system fs , final path path ) throws exception { intercept ( access denied exception class , " " , ( ) - > fs delete ( path , true ) ) ; }


return the url for the web socket endpoint

public uri get uri ( ) { return this uri ; }


public string get web address ( ) { return this web address ; }


returns an immutable array containing the given values , in order

public static immutable double array of ( double e 0 , double e 1 , double e 2 , double e 3 ) { return new immutable double array ( new double [ ] { e 0 , e 1 , e 2 , e 3 } ) ; }


strip indirect pointer data type from a parameter

private static variable revert indirect parameter ( variable param , boolean create ) { data type dt = param get data type ( ) ; if ( dt instanceof pointer ) { try { dt = ( ( pointer ) dt ) get data type ( ) ; if ( create ) { param = new parameter impl ( param get name ( ) , dt , param get program ( ) ) ; } else { param set data type ( dt , variable storage unassigned storage , false , param get source ( ) ) ; } } catch ( invalid input exception e ) { throw new assert exception ( e ) ; / / unexpected } } return param ; }


public list < metric convert > converts ( ) { return metric converts ; }


resolves a principal from the given credential using an arbitrary strategy

principal resolve ( credential credential , optional < principal > principal , optional < authentication handler > handler ) ;


append to an existing file in the namespace

last block with status append file ( string src arg , string holder , string client machine , enum set < create flag > flag , boolean log retry cache ) throws i o exception { final string operation name = " append " ; boolean new block = flag contains ( create flag new block ) ; if ( new block ) { require effective layout version for feature ( feature append new block ) ; } name node state change log debug ( " dir * name system append file : src = { } , holder = { } , client machine = { } " , src arg , holder , client machine ) ; try { boolean skip sync = false ; last block with status lbs = null ; check operation ( operation category write ) ; final f s permission checker pc = get permission checker ( ) ; f s permission checker set operation type ( operation name ) ; write lock ( ) ; try { check operation ( operation category write ) ; check name node safe mode ( " cannot append to file " + src arg ) ; lbs = f s dir append op append file ( this , src arg , pc , holder , client machine , new block , log retry cache ) ; } catch ( standby exception se ) { skip sync = true ; throw se ; } finally { write unlock ( operation name , get lock report info supplier ( src arg ) ) ; / / there might be transactions logged while trying to recover the lease / / they need to be sync ' ed even when an exception was thrown if ( ! skip sync ) { get edit log ( ) log sync ( ) ; } } log audit event ( true , operation name , src arg ) ; return lbs ; } catch ( access control exception e ) { log audit event ( false , operation name , src arg ) ; throw e ; } }


returns the actual options reference used by this configuration < b > be very careful using this method < b > options classes are mutable - no caller should ever call this method if there ' s any change the reference might be written to this method only exists because { @ link # clone options } can be expensive when applied to every edge in a dependency graph do not use this method without careful review with other bazel developers

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


aggregate response data and convert to a string using the " content - type " charset or " utf - 8 " by default

public mono < string > get body as string ( ) { charset charset = optional of nullable ( get headers ( ) get content type ( ) ) map ( mime type : : get charset ) or else ( standard charsets utf 8 ) ; return data buffer utils join ( get body ( ) ) map ( buffer - > { string s = buffer to string ( charset ) ; data buffer utils release ( buffer ) ; return s ; } ) default if empty ( " " ) ; }


return the current byte position in the input file

public synchronized long get position ( ) throws i o exception { return in get pos ( ) ; }


if this dereference expression looks like a qualified name , return qualified name otherwise return null

public static qualified name get qualified name ( dereference expression expression ) { list < string > parts = try parse parts ( expression base , expression field get value ( ) to lower case ( locale english ) ) ; return parts = = null ? null : qualified name of ( parts ) ; }


a reference implementation for { @ code try parse } that just catches the exception from { @ link float # value of }

private static float reference try parse ( string input ) { if ( input trim ( ) length ( ) < input length ( ) ) { return null ; } try { return float value of ( input ) ; } catch ( number format exception e ) { return null ; } }


called after { @ link # on drag started ( epoxy model , view , int ) } when the view being dragged is released if the view was dragged to a new , valid location then { @ link # on model moved ( int , int , epoxy model , view ) } will be called before this and the view will settle to the new location otherwise the view will animate back to its original position you can use this callback to modify the view as it animates back into position { @ link base epoxy touch callback # clear view ( epoxy model , view ) } will be called after this , when the view has finished animating final cleanup of the view should be done there

void on drag released ( t model , view item view ) ;


checks if we need to expand , and expands if necessary

protected void expand if necessary ( ) { if ( size > this expand threshold & & capacity < maximum capacity ) { resize ( capacity * expand multiplier ) ; } }


uid and gid are defined as uint 3 2 in linux some systems create ( intended or unintended ) < nfsnobody , 4294967294 > kind of < name , id > mapping , where 4294967294 is 232 - 2 as unsigned int 3 2 as an example , https : bugzilla redhat comshow bug cgi ? id = 511876 because user or group id are treated as integer ( signed integer or int 3 2 ) here , the number 4294967294 is out of range the solution is to convert uint 3 2 to int 3 2 , so to map the out - of - range id to the negative side of integer , e g 4294967294 maps to - 2 and 4294967295 maps to - 1

private static integer parse id ( final string id str ) { long long val = long parse long ( id str ) ; return integer value of ( ( int ) long val ) ; }


public void get gauge ( io grpc testing integration metrics gauge request request , io grpc stub stream observer < io grpc testing integration metrics gauge response > response observer ) { io grpc stub client calls async unary call ( get channel ( ) new call ( get get gauge method ( ) , get call options ( ) ) , request , response observer ) ; }


sets the radix mode to hex < p > if the field is currently in decimal mode , the current text will be change from displaying the current value from decimal to hex

public void set hex mode ( ) { big integer current value = get value ( ) ; is hex mode = true ; update text field ( current value ) ; }


bind { @ link job property } s to url spaces

public job property get property ( string class name ) { for ( job property p : properties ) if ( p get class ( ) get name ( ) equals ( class name ) ) return p ; return null ; }


adds the blob key to the given { @ link message digest }

public void add to message digest ( message digest md ) { md update ( this key ) ; }


map < k , v > get all present ( @ non null iterable < ? > keys ) ;


public timer timer ( string name ) { return noop timer instance ; }


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


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


public void test successful as list logging exception ( ) throws exception { assert equals ( new array list ( ( object ) null ) , get done ( successful as list ( immediate failed future ( new my exception ( ) ) ) ) ) ; assert with message ( " nothing should be logged " ) that ( aggregate future log handler get stored log records ( ) ) is empty ( ) ; / / not even if there are a bunch of failures assert equals ( new array list ( null , null , null ) , get done ( successful as list ( immediate failed future ( new my exception ( ) ) , immediate failed future ( new my exception ( ) ) , immediate failed future ( new my exception ( ) ) ) ) ) ; assert with message ( " nothing should be logged " ) that ( aggregate future log handler get stored log records ( ) ) is empty ( ) ; }


method to capture unusual this pointer types

void witness member function this pointer ( ms type applier applier ) { / / we know that we have seen primitive ms types that are pointer types if ( applier instanceof pointer type applier ) { return ; } unexpected member function this pointer types add ( applier get ms type ( ) get class ( ) ) ; }


disable x 509 certificate validation in tls connections please note that trusting all certificates is extremely risky this may be useful in a development environment with self - signed certificates

protected void disable certificate validation ( client builder client builder ) throws key management exception , no such algorithm exception { trust manager [ ] trust all certs = new x 5 0 9 trust manager [ ] { new x 5 0 9 trust manager ( ) { @ override public x 5 0 9 certificate [ ] get accepted issuers ( ) { return null ; } @ override public void check client trusted ( x 5 0 9 certificate [ ] certs , string auth type ) { } @ override public void check server trusted ( x 5 0 9 certificate [ ] certs , string auth type ) { } } } ; s s l context ssl context = s s l context get instance ( " tls " ) ; ssl context init ( null , trust all certs , new secure random ( ) ) ; client builder ssl context ( ssl context ) ; }


fully parses the semi - parsed { @ code map < string , object > } aggregations

public aggregator factories builder get parsed aggregations ( named x content registry named x content registry ) { return agg provider = = null ? null : parse aggregations ( named x content registry , new array list < > ( ) ) ; }


fetches f s namesystem metrics from namenode

private void get fs namesystem metrics ( string address , namenode status report report ) throws j s o n exception { string query = " hadoop : service = name node , name = f s namesystem * " ; j s o n array aux = federation util get jmx ( query , address , connection factory , scheme ) ; if ( aux ! = null ) { for ( int i = 0 ; i < aux length ( ) ; i + + ) { j s o n object json object = aux get j s o n object ( i ) ; string name = json object get string ( " name " ) ; if ( name equals ( " hadoop : service = name node , name = f s namesystem state " ) ) { report set datanode info ( json object get int ( " num live data nodes " ) , json object get int ( " num dead data nodes " ) , json object get int ( " num stale data nodes " ) , json object get int ( " num decommissioning data nodes " ) , json object get int ( " num decom live data nodes " ) , json object get int ( " num decom dead data nodes " ) , json object opt int ( " num in maintenance live data nodes " ) , json object opt int ( " num in maintenance dead data nodes " ) , json object opt int ( " num entering maintenance data nodes " ) , json object opt long ( " scheduled replication blocks " ) ) ; } else if ( name equals ( " hadoop : service = name node , name = f s namesystem " ) ) { report set namesystem info ( json object get long ( " capacity remaining " ) , json object get long ( " capacity total " ) , json object get long ( " files total " ) , json object get long ( " blocks total " ) , json object get long ( " missing blocks " ) , json object get long ( " pending replication blocks " ) , json object get long ( " under replicated blocks " ) , json object get long ( " pending deletion blocks " ) , json object opt long ( " provided capacity total " ) ) ; } } } }


searches everywhere for classes with the specified full - qualified name and returns all found classes ( including class )

public static psi class [ ] find classes ( project project , string qualified name ) { return java psi facade get instance ( project ) find classes ( qualified name , global search scope everything scope ( project ) ) ; }


return the capacity of the { @ link k queue event array } which represent the maximum number of { @ code kevent } s that can be stored in it


sorts the views by { @ link view # get display name ( ) }

public list < view > sort ( @ non null list < ? extends view > views ) { list < view > result = new array list < > ( views ) ; result sort ( new comparator < view > ( ) { @ override public int compare ( view o 1 , view o 2 ) { return o 1 get display name ( ) compare to ( o 2 get display name ( ) ) ; } } ) ; return result ; }


return the entity extracted from the response body

public t get response body ( ) { return this body ; }


test a case where rename a dir , then create a new dir with the same name and sub dir

public void test sync 7 ( ) throws exception { if ( is src not same as tgt ) { init data 7 ( source ) ; } init data 7 ( target ) ; enable and create first snapshot ( ) ; int num deleted and modified = change data 7 ( target ) ; create second snapshot at target ( ) ; test and verify ( num deleted and modified ) ; }


public void reset ( ) { if ( get input stream ( ) ! = null ) get input stream ( ) seek ( 0 ) ; err handler reset ( this ) ; ctx = null ; syntax errors = 0 ; matched e o f = false ; set trace ( false ) ; precedence stack clear ( ) ; precedence stack push ( 0 ) ; a t n simulator interpreter = get interpreter ( ) ; if ( interpreter ! = null ) { interpreter reset ( ) ; } }


returns true if this value can fit in 8 bits with sign - extension

public boolean fits in 8 bits ( ) { if ( ! fits in int ( ) ) { return false ; } int bits = get int bits ( ) ; return ( byte ) bits = = bits ; }


public static bucket collector wrap ( bucket collector collectors ) { return wrap ( arrays as list ( collectors ) ) ; }


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


sets a custom option to be passed to client interceptors on the channel { @ link io grpc client interceptor } via the call options parameter

public final < t > s with option ( call options key < t > key , t value ) { return build ( channel , call options with option ( key , value ) ) ; }


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


test sparse watch case where only one watcher watches all paths , and only one path being watched by all watchers the output of this test will be the average time used to add those sparse watches

public void test add sparse watch ( add sparse watch state state ) throws exception { / / all watchers are watching the 1st path for ( watcher watcher : state watchers ) { if ( state watch manager add watch ( state paths [ 0 ] , watcher ) ) { state watches added + + ; } } / / the 1st watcher is watching all paths for ( string path : state paths ) { if ( state watch manager add watch ( path , state watchers [ 0 ] ) ) { state watches added + + ; } } }


a sensible default implementation of { @ link # sub list ( int , int ) } if you override any other methods , you may wish to override { @ link # sub list ( int , int ) } to forward to this implementation

protected list < e > standard sub list ( int from index , int to index ) { return lists sub list impl ( this , from index , to index ) ; }


process the { @ link watch event watch events } loop in async execution

private void process watch events ( watch service watch service ) { get watch events loop thread pool ( ) execute ( ( ) - > { / / watch events loop while ( true ) { watch key watch key = null ; try { watch key = watch service take ( ) ; if ( watch key is valid ( ) ) { for ( watch event event : watch key poll events ( ) ) { watch event kind kind = event kind ( ) ; / / config change type ' s key to match watch event ' s kind config change type config change type = config change types map get ( kind name ( ) ) ; if ( config change type ! = null ) { path config directory path = ( path ) watch key watchable ( ) ; path current path = ( path ) event context ( ) ; path config file path = config directory path resolve ( current path ) ; file config directory = config directory path to file ( ) ; execute mutually ( config directory , ( ) - > { fire config change event ( config directory , config file path to file ( ) , config change type ) ; signal config directory ( config directory ) ; return null ; } ) ; } } } } catch ( exception e ) { return ; } finally { if ( watch key ! = null ) { / / reset watch key reset ( ) ; } } } } ) ; }


lists up all the registered { @ link tool property descriptor } s in the system

public static descriptor extension list < tool property < ? > , tool property descriptor > all ( ) { return ( descriptor extension list ) jenkins get ( ) get descriptor list ( tool property class ) ; }


gets the { @ link standard socket options # so reuseaddr } option

datagram channel config set reuse address ( boolean reuse address ) ;


public static http response execute ( final string url , final string method ) { return execute ( url , method , null , null , new hash map < > ( 0 ) , new hash map < > ( 0 ) ) ; }


override this to switch to testing https

protected string get protocol ( ) { return " http " ; }


locate an elf file headerstructure within loaded memory based upon its file offset preference is given to an allocated section over segments this method assumes filter loads will not be employed for the referenced file location ( e g , elf data structures ) todo : this could be a problem for dynamic

private address find load address ( long file offset , long header size ) { long header end offset = file offset + header size - 1 ; / / locate possible load of elf header within section ( i e , start of file ) address header addr = null ; for ( elf section header section : elf get sections ( ) ) { if ( section get type ( ) = = elf section header constants sht nobits ) { continue ; } long start offset = section get offset ( ) ; if ( start offset < 0 ) { continue ; } long end offset = start offset + section get size ( ) - 1 ; if ( file offset > = start offset & & header end offset < = end offset ) { header addr = find load address ( section , file offset - section get offset ( ) ) ; if ( header addr ! = null ) { return header addr ; } } } / / locate possible load of elf header within segment for ( elf program header segment : elf get program headers ( ) ) { if ( segment get type ( ) = = elf program header constants pt null ) { continue ; } long start offset = segment get offset ( ) ; if ( start offset < 0 ) { continue ; } long end offset = start offset + segment get file size ( ) - 1 ; if ( file offset > = start offset & & header end offset < = end offset ) { header addr = find load address ( segment , file offset - segment get offset ( ) ) ; if ( header addr ! = null & & segment get type ( ) = = elf program header constants pt load ) { return header addr ; } } } return header addr ; }


returns true if the given language has been successfully loaded

boolean is language loaded ( language i d language id ) ;


returns whether the timeline service v 2 is enabled via configuration

public static boolean timeline service v 2 enabled ( configuration conf ) { boolean enabled = false ; if ( timeline service enabled ( conf ) ) { collection < float > versions = get timeline service versions ( conf ) ; for ( float version : versions ) { if ( version int value ( ) = = 2 ) { enabled = true ; break ; } } } return enabled ; }


creates a related entity key , serializing entity entry prefix + entity type + revstarttime + entity id + related entities column + relatedentity type + relatedentity id

private static byte [ ] create related entity key ( string entity id , string entity type , byte [ ] rev start time , string related entity id , string related entity type ) throws i o exception { return key builder new instance ( ) add ( entity entry prefix ) add ( entity type ) add ( rev start time ) add ( entity id ) add ( related entities column ) add ( related entity type ) add ( related entity id ) get bytes ( ) ; }


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


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


validate and set layout version from { @ link properties }

protected void set layout version ( properties props , storage directory sd ) throws incorrect version exception , inconsistent f s state exception { int lv = integer parse int ( get property ( props , sd , " layout version " ) ) ; if ( lv < get service layout version ( ) ) { / / future version throw new incorrect version exception ( get service layout version ( ) , lv , " storage directory " + sd root get absolute path ( ) ) ; } layout version = lv ; }


determine if the it is network exception

public static boolean is net exception ( throwable throwable ) { net exception type net exception type = get net exception type ( throwable ) ; return net exception type ! = null & & net exception type ! = net exception type not net exception ; }


default implementation always returns false

public boolean attempt allocation on node ( scheduler application attempt app attempt , scheduling request scheduling request , scheduler node scheduler node ) { return false ; }


method used to check if the end of the input is reached

public boolean reached end ( ) throws i o exception { return ! ensure batch ( ) ; }


finds pets by status multiple status values can be provided with comma separated strings

public void find pets by status test ( ) throws exception { list < string > status = cache get objects ( " / find pets by status / status " , string class ) ; list < pet > response = api find pets by status ( status ) ; / / todo : complete test assertions validate ( response ) ; }


determine , if possible , the content length of the given resource without reading it

private optional long content length ( resource resource ) { / / don ' t try to determine content length on input stream resource - cannot be read afterwards / / note : custom input stream resource subclasses could provide a pre - calculated content length ! if ( input stream resource class ! = resource get class ( ) ) { try { return optional long of ( resource content length ( ) ) ; } catch ( i o exception ignored ) { } } return optional long empty ( ) ; }


returns a threshold that enforces a pre - filter roundtrip to pre - filter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold , or < code > null < code > if the threshold is unspecified this filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method ie if date filters are mandatory to match but the shard bounds and the query are disjoint when unspecified , the pre - filter phase is executed if any of these conditions is met : the request targets more than 128 shards the request targets one or more read - only index the primary sort of the query targets an indexed field

public integer get pre filter shard size ( ) { return pre filter shard size ; }


returns true if the graph is too large for animation ( usually due to performance issues )

protected boolean is too big to animate ( ) { return graph get vertex count ( ) > = too big to animate ; }


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


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

symbol add constant methodref ( final string owner , final string name , final string descriptor , final boolean is interface ) { int tag = is interface ? symbol constant interface methodref tag : symbol constant methodref tag ; return add constant member reference ( tag , owner , name , descriptor ) ; }


whether to treat the redirect url as a uri template set this flag to { @ code false } if the redirect url contains open and close curly braces " { " , " } " and you don ' t want them interpreted as uri variables defaults to { @ code true }

public void set expand uri template variables ( boolean expand uri template variables ) { this expand uri template variables = expand uri template variables ; }


initializes log probabilities based on counts from the given input file

private static void load string models ( string trigram file ) throws i o exception { list < resource file > model files = application find files by extension in application ( model file extension ) ; input stream count file contents = null ; string filename = " " ; resource file found file = null ; for ( resource file resource file : model files ) { filename = resource file get name ( ) ; if ( filename equals ( trigram file ) ) { count file contents = resource file is file ( ) ? resource file get input stream ( ) : null ; found file = resource file ; break ; } } if ( count file contents = = null ) { last loaded trigram model path = " " ; last loaded trigram model = " " ; throw new i o exception ( " was not able to load the strings model file ( " + trigram file + " ) " ) ; } load string models ( count file contents , filename ) ; last loaded trigram model path = found file get absolute path ( ) ; }


{ @ inherit doc } the default implementation does nothing

@ override public void exit select items ( sql base parser select items context ctx ) { }


the manager ( merge resolver ) for a particular merge phase should call this when its phase or sub - phase completes the string array should match one that the returned by merge resolver get phases ( )

public void set completed ( string [ ] merge phase ) { merge progress panel set completed ( merge phase ) ; update progress ( 0 , " " ) ; merge monitor set message ( " " ) ; merge monitor set progress ( 0 ) ; }


change the current bpmn element the execution is at

void set current flow element ( flow element flow element ) ;


join an array of strings with the given separator note : this might be replaced by utility method from commons - lang or guava someday if one of those libraries is added as dependency

public static string join ( string [ ] array , string separator ) { int len = array length ; if ( len = = 0 ) return " " ; string builder out = new string builder ( ) ; out append ( array [ 0 ] ) ; for ( int i = 1 ; i < len ; i + + ) { out append ( separator ) append ( array [ i ] ) ; } return out to string ( ) ; }


protected path get truncate file ( ) { path fn = get finder ( ) get file ( ) ; return fn ; }


/ * package * / void dedup ( final map < string , char [ ] > table ) { string l = get label ( ) ; char [ ] v = table get ( l ) ; if ( v ! = null ) { label = v ; } else { table put ( l , label ) ; } }


parse a < code > categorization analyzer < code > configuration a custom parser is needed due to the complexity of the format , with many elements able to be specified as either the name of a built - in element or an object containing a custom definition

static categorization analyzer config build from x content fragment ( x content parser parser ) throws i o exception { categorization analyzer config builder builder = new categorization analyzer config builder ( ) ; x content parser token token = parser current token ( ) ; if ( token = = x content parser token value string ) { builder set analyzer ( parser text ( ) ) ; } else if ( token ! = x content parser token start object ) { throw new illegal argument exception ( " [ " + categorization analyzer + " ] should be analyzer ' s name or settings [ " + token + " ] " ) ; } else { string current field name = null ; while ( ( token = parser next token ( ) ) ! = x content parser token end object ) { if ( token = = x content parser token field name ) { current field name = parser current name ( ) ; } else if ( char filters match ( current field name , parser get deprecation handler ( ) ) & & token = = x content parser token start array ) { while ( ( token = parser next token ( ) ) ! = x content parser token end array ) { if ( token = = x content parser token value string ) { builder add char filter ( parser text ( ) ) ; } else if ( token = = x content parser token start object ) { builder add char filter ( parser map ( ) ) ; } else { throw new illegal argument exception ( " [ " + current field name + " ] in [ " + categorization analyzer + " ] array element should contain char filter ' s name or settings [ " + token + " ] " ) ; } } } else if ( tokenizer match ( current field name , parser get deprecation handler ( ) ) ) { if ( token = = x content parser token value string ) { builder set tokenizer ( parser text ( ) ) ; } else if ( token = = x content parser token start object ) { builder set tokenizer ( parser map ( ) ) ; } else { throw new illegal argument exception ( " [ " + current field name + " ] in [ " + categorization analyzer + " ] should be tokenizer ' s name or settings [ " + token + " ] " ) ; } } else if ( token filters match ( current field name , parser get deprecation handler ( ) ) & & token = = x content parser token start array ) { while ( ( token = parser next token ( ) ) ! = x content parser token end array ) { if ( token = = x content parser token value string ) { builder add token filter ( parser text ( ) ) ; } else if ( token = = x content parser token start object ) { builder add token filter ( parser map ( ) ) ; } else { throw new illegal argument exception ( " [ " + current field name + " ] in [ " + categorization analyzer + " ] array element should contain token filter ' s name or settings [ " + token + " ] " ) ; } } } } } return builder build ( ) ; }


pass through for checking filter condition validity

public boolean has valid filter value ( ) { return column condition set has valid filter value ( ) ; }


add an attachment to the mime message , taking the content from a { @ code javax activation data source } note that the input stream returned by the data source implementation needs to be a fresh one on each call , as java mail will invoke { @ code get input stream ( ) } multiple times

public void add attachment ( string attachment filename , data source data source ) throws messaging exception { assert not null ( attachment filename , " attachment filename must not be null " ) ; assert not null ( data source , " data source must not be null " ) ; try { mime body part mime body part = new mime body part ( ) ; mime body part set disposition ( mime body part attachment ) ; mime body part set file name ( is encode filenames ( ) ? mime utility encode text ( attachment filename ) : attachment filename ) ; mime body part set data handler ( new data handler ( data source ) ) ; get root mime multipart ( ) add body part ( mime body part ) ; } catch ( unsupported encoding exception ex ) { throw new messaging exception ( " failed to encode attachment filename " , ex ) ; } }


returns true if the specified char is not valid for use in a symbol name

public static boolean is invalid char ( char c ) { if ( c < ' ' ) { / / non - printable ascii return true ; } for ( char element : invalidchars ) { if ( c = = element ) { return true ; } } return false ; }


notification that the delete block command completed

public void delete block completed ( delete block cmd cmd ) ;


get a varnode that maps to the given register

public varnode get varnode ( register register ) { varnode node = new varnode ( register get address ( ) , register get minimum byte size ( ) ) ; return node ; }


should only public methods be allowed to have caching semantics ? the default implementation returns { @ code false }

protected boolean allow public methods only ( ) { return false ; }


adds the map value to the provided map under the provided field name , if it should be included the supplier is only invoked if the field is to be included

public map builder add map ( string field name , boolean include , supplier < map < string , ? > > supplier ) { if ( include ) { map < string , ? > value = supplier get ( ) ; if ( value ! = null & & ! value is empty ( ) ) { map put ( get field name ( field name ) , value ) ; } } return this ; }


converts a big integer to either an i pv 4 or i pv 6 address if the ip is i pv 4 , it must be constrainted to 32 bits , otherwise it is constrained to 128 bits

private static inet address from big integer ( big integer address , boolean is ipv 6 ) { check argument ( address signum ( ) > = 0 , " big integer must be greater than or equal to 0 " ) ; int num bytes = is ipv 6 ? 16 : 4 ; byte [ ] address bytes = address to byte array ( ) ; byte [ ] target copy array = new byte [ num bytes ] ; int src pos = math max ( 0 , address bytes length - num bytes ) ; int copy length = address bytes length - src pos ; int dest pos = num bytes - copy length ; / / check the extra bytes in the big integer are all zero for ( int i = 0 ; i < src pos ; i + + ) { if ( address bytes [ i ] ! = 0x 0 0 ) { throw format illegal argument exception ( " big integer cannot be converted to inet address because it has more than % d " + " bytes : % s " , num bytes , address ) ; } } / / copy the bytes into the least significant positions system arraycopy ( address bytes , src pos , target copy array , dest pos , copy length ) ; try { return inet address get by address ( target copy array ) ; } catch ( unknown host exception impossible ) { throw new assertion error ( impossible ) ; } }


public static void reset ( ) { prototype created = false ; }


decodes a bit of a url encoded by a browser this is equivalent to calling { @ link # decode component ( string , charset ) } with the utf - 8 charset ( recommended to comply with rfc 3986 , section 2 )

public static string decode component ( final string s ) { return decode component ( s , http constants default charset ) ; }


the value assigned to this element < code > optional aapt pb item item = 3 ; < code >

private void set item ( com android aapt resources item value ) { if ( value = = null ) { throw new null pointer exception ( ) ; } item = value ; bit field 0 | = 0x 0 0 0 0 0 0 0 4 ; }


the brokers which this partition currently resides on

public list < integer > replicas ( ) { return replicas ; }


public rounding params set corners radius ( float radius ) { arrays fill ( get or create rounded corners radii ( ) , radius ) ; return this ; }


returns next edge having the same ' to ' if it exists otherwise returns null

edge get next edge with same to ( edge e ) { int index of edge = index ( e ) ; if ( index of edge > = 0 ) { return next edge with same to [ index of edge ] ; } return null ; }


public list < log record > get log records ( ) { return handler get view ( ) ; }


serialize the sparse vector to string the format of the returned is described at { @ link # parse sparse ( string ) }

public static string to string ( sparse vector sparse vector ) { string builder sbd = new string builder ( ) ; if ( sparse vector n > 0 ) { sbd append ( header delimiter ) ; sbd append ( sparse vector n ) ; sbd append ( header delimiter ) ; } if ( null ! = sparse vector indices ) { for ( int i = 0 ; i < sparse vector indices length ; i + + ) { sbd append ( sparse vector indices [ i ] ) ; sbd append ( index value delimiter ) ; sbd append ( sparse vector values [ i ] ) ; if ( i < sparse vector indices length - 1 ) { sbd append ( element delimiter ) ; } } } return sbd to string ( ) ; }


public date range aggregation builder add unbounded from ( string key , string from ) { add range ( new range aggregator range ( key , from , null ) ) ; return this ; }


test that deprecated flags touched via use default in the invocation policy don ' t elicit a deprecation warning

public void test dont print deprecation warning use default ( ) throws exception { invocation policy builder invocation policy builder = invocation policy new builder ( ) ; invocation policy builder add flag policies builder ( ) set flag name ( " test deprecated " ) get use default builder ( ) ; invocation policy enforcer enforcer = create options policy enforcer ( invocation policy builder ) ; enforcer enforce ( parser , build command ) ; assert that ( parser get warnings ( ) ) is empty ( ) ; }


revert a commit by deleting the file relies on retry code in filesystem

public void revert commit ( string dest key , @ nullable bulk operation state operation state ) throws i o exception { once ( " revert commit " , dest key , ( ) - > { path dest path = owner key to qualified path ( dest key ) ; owner delete object at path ( dest path , dest key , true , operation state ) ; owner maybe create fake parent directory ( dest path ) ; } ) ; }


{ @ inherit doc } this implementation is empty

public void configure message converters ( list < http message converter < ? > > converters ) { }


transcodes webp image given by input stream into png

public void transcode webp to png ( input stream input stream , output stream output stream ) throws i o exception { static webp native loader ensure ( ) ; native transcode webp to png ( preconditions check not null ( input stream ) , preconditions check not null ( output stream ) ) ; }


1 writes contents with nfly link having two target uris 2 deletes one target file 3 tests the read works with repair on read flag 4 tests that previously deleted file fully recovered and exists

public void test nfly repair ( ) throws exception { final nfly f system nfly key repair key = nfly f system nfly key repair on read ; final path hdfs target path 1 = new path ( default f s u r i + hdfs user folder ) ; final path hdfs target path 2 = new path ( default f s u r i + hdfs user folder + 1 ) ; final uri uri 1 = hdfs target path 1 to uri ( ) ; final uri uri 2 = hdfs target path 2 to uri ( ) ; final path nfly root = new path ( " / nflyroot " ) ; final string nfly link key = constants config viewfs link nfly + " min replication = 2 , " + repair key + " = true " + nfly root to string ( ) ; add mount links ( default f s u r i get authority ( ) , new string [ ] { nfly link key } , new string [ ] { uri 1 to string ( ) + " , " + uri 2 to string ( ) } , conf ) ; try ( file system nfly = file system get ( default f s u r i , conf ) ) { / / write contents to nfly final path test file path = new path ( " / nflyroot / test txt " ) ; write string ( nfly , test string , test file path ) ; final uri [ ] test uris = new uri [ ] { uri 1 , uri 2 } ; / / both nodes are up again , test repair fs getter getter = new view file system overload scheme child fs getter ( " hdfs " ) ; try ( file system fs 1 = getter get new instance ( test uris [ 0 ] , conf ) ) { / / delete a file from one target uri string test file = " / test txt " ; assert true ( fs 1 delete ( new path ( test uris [ 0 ] to string ( ) + test file ) , false ) ) ; assert false ( fs 1 exists ( new path ( test uris [ 0 ] to string ( ) + test file ) ) ) ; / / verify read success read string ( nfly , test file path , test string , test uris [ 0 ] ) ; / / verify file recovered assert true ( fs 1 exists ( new path ( test uris [ 0 ] to string ( ) + test file ) ) ) ; } } }


given an existing directory ' dir ' , looks up ' name ' within it and returns its inode assumes the file exists , unless ' create ' , in which case it will try to create it may fail with enotdir , eacces , enoent error messages will be reported against file ' path '

private inode or errno directory lookup errno ( in memory content info dir , string name , boolean create , path path ) { if ( ! dir is directory ( ) ) { return error enotdir as inode or errno ( ) ; } in memory directory info imdi = ( in memory directory info ) dir ; if ( ! imdi is executable ( ) ) { return error eacces as inode or errno ( ) ; } in memory content info child = imdi get child ( name ) ; if ( child = = null ) { if ( ! create ) { return error enoent as inode or errno ( ) ; } else { child = new file ( clock , path ) ; error error = insert ( imdi , name , child ) ; if ( error ! = null ) { return error as inode or errno ( ) ; } } } return inode or errno create inode ( child ) ; }


given a map of old - > new , cancel medias that were changed and upload their replacements will also upload any media in the map that wasn ' t yet uploaded

void apply media updates ( @ non null map < media , media > old to new , @ nullable recipient recipient ) { executor execute ( ( ) - > { for ( map entry < media , media > entry : old to new entry set ( ) ) { boolean same = entry get key ( ) equals ( entry get value ( ) ) & & ( ! entry get value ( ) get transform properties ( ) is present ( ) | | ! entry get value ( ) get transform properties ( ) get ( ) is video edited ( ) ) ; if ( ! same | | ! upload results contains key ( entry get value ( ) ) ) { cancel upload internal ( entry get key ( ) ) ; upload media internal ( entry get value ( ) , recipient ) ; } } } ) ; }


get the value of the ' { @ code onselect } ' attribute

protected string get onselect ( ) { return this onselect ; }


this method should set the additional options on top of the current options object the current options object may contain pre - defined options based on flags that have been configured on the state backend it is important to set the options on the current object and return the result from the setter methods , otherwise the pre - defined options may get lost

default read options create read options ( read options current options , collection < auto closeable > handles to close ) { return current options ; }


public test string overloads view model title via value shortcut ( @ string res int string res , object format args ) { on mutation ( ) ; assigned attributes epoxy generated model set ( 2 ) ; title via value shortcut string attribute data set value ( string res , format args ) ; return this ; }


returns { @ code } true if the given { @ link load path } is the signal object returned from { @ link # get ( class , class , class ) } that indicates that we ' ve previously found that there are no available paths to load the requested resources and { @ code false } otherwise

public boolean is empty load path ( @ nullable load path < ? , ? , ? > path ) { return no paths signal equals ( path ) ; }


public static void start activity ( @ non null final bundle extras , @ non null final class < ? extends activity > clz , @ nullable final bundle options ) { context context = get top activity or app ( ) ; start activity ( context , extras , context get package name ( ) , clz get name ( ) , options ) ; }


public segment table get segment table ( ) { return seg table ; }


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


returns the number of cache hits for bitmaps in the pool

public long hit count ( ) { return hits ; }


set the value of the ' { @ code alt } ' attribute may be a runtime expression

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


url which exposes the metadata location in a specific update site

public string get metadata url for downloadable ( string downloadable ) { string site url = get url ( ) ; string update site metadata url = null ; int base url end = site url index of ( " update - center json " ) ; if ( base url end ! = - 1 ) { string site base url = site url substring ( 0 , base url end ) ; update site metadata url = site base url + " updates / " + downloadable ; } else { logger log ( level warning , " url { 0 } does not look like an update center : " , site url ) ; } return update site metadata url ; }


create a new token with the given name and return it id and secret value result meant to be sent displayed and then discarded

public synchronized @ non null token uuid and plain value generate new token ( @ non null string name ) { / / 1 6x 8 = 1 2 8bit worth of randomness , using brute - force you need on average 2 ^ 127 tries ( ~ 10 ^ 37 ) byte [ ] random = new byte [ 16 ] ; random next bytes ( random ) ; / / 32 - char in hex string secret value = util to hex string ( random ) ; string token the user will use = hash version + secret value ; assert token the user will use length ( ) = = 2 + 32 ; hashed token token = prepare and store token ( name , secret value ) ; return new token uuid and plain value ( token uuid , token the user will use ) ; }


gets singleton instance of d beaver application

public static d beaver application get instance ( ) { return instance ; }


stops the application level timeline collector for this app this should be used only if the timeline service v 2 is enabled

public void stop timeline collector ( ) { rm context get r m timeline collector manager ( ) remove ( application id ) ; }


if a value of 0 is set then this attribute will revert to its default value optional : default value is ( char sequence ) null

public test null string overloads view model title ( @ string res int string res ) { on mutation ( ) ; title string attribute data set value ( string res ) ; return this ; }


test to make sure bug # 2848 never happens again https : github comnettynettyissues 2 8 4 8

public void test max capacity ( ) { test max capacity ( 300 ) ; random rand = new random ( ) ; for ( int i = 0 ; i < 50 ; i + + ) { test max capacity ( rand next int ( 1000 ) + 256 ) ; / / 256 - 1256 } }


returns all variations of this policy based on the configuration parameters

public static set < policy > policies ( config config ) { hill climber window tiny lfu settings settings = new hill climber window tiny lfu settings ( config ) ; set < policy > policies = new hash set < > ( ) ; for ( hill climber type climber : settings strategy ( ) ) { for ( double percent main : settings percent main ( ) ) { policies add ( new hill climber window tiny lfu policy ( climber , percent main , settings ) ) ; } } return policies ; }


perform additional checks on a resolved resource beyond checking whether the resources exists and is readable the default implementation also verifies the resource is either under the location relative to which it was found or is under one of the { @ link # set allowed locations allowed locations }

protected boolean check resource ( resource resource , resource location ) throws i o exception { if ( is resource under location ( resource , location ) ) { return true ; } if ( get allowed locations ( ) ! = null ) { for ( resource current : get allowed locations ( ) ) { if ( is resource under location ( resource , current ) ) { return true ; } } } return false ; }


this has to be duplicated in in place mutable hash table test and compacting hash table test because of the different constructor calls

public void test hash table growth with insert ( ) { try { final int num elements = 1000000 ; list < memory segment > memory = get memory ( 10000 , 32 * 1024 ) ; in place mutable hash table < tuple 2 < long , string > > table = new in place mutable hash table < tuple 2 < long , string > > ( serializer , comparator , memory ) ; table open ( ) ; for ( long i = 0 ; i < num elements ; i + + ) { table insert ( new tuple 2 < long , string > ( i , string value of ( i ) ) ) ; } / / make sure that all elements are contained via the entry iterator { bit set bit set = new bit set ( num elements ) ; mutable object iterator < tuple 2 < long , string > > iter = table get entry iterator ( ) ; tuple 2 < long , string > next ; while ( ( next = iter next ( ) ) ! = null ) { assert not null ( next f 0 ) ; assert not null ( next f 1 ) ; assert equals ( next f 0 long value ( ) , long parse long ( next f 1 ) ) ; bit set set ( next f 0 int value ( ) ) ; } assert equals ( num elements , bit set cardinality ( ) ) ; } / / make sure all entries are contained via the prober { in place mutable hash table < tuple 2 < long , string > > hash table prober < long > proper = table get prober ( probe comparator , pair comparator ) ; tuple 2 < long , string > reuse = new tuple 2 < > ( ) ; for ( long i = 0 ; i < num elements ; i + + ) { assert not null ( proper get match for ( i , reuse ) ) ; assert null ( proper get match for ( i + num elements , reuse ) ) ; } } table close ( ) ; } catch ( exception e ) { e print stack trace ( ) ; fail ( e get message ( ) ) ; } }


long execute op ( int daemon id , int input idx , string client name ) throws i o exception { long start = time now ( ) ; try { eek = kp generate encrypted key ( encryption key name ) ; } catch ( general security exception e ) { log warn ( " failed to generate encrypted key " , e ) ; } long end = time now ( ) ; return end - start ; }


when a field on a class needs to be decorated with an { @ link element locator } this method will be called

element locator create locator ( field field ) ;


returns a { @ link field } that represents the specified declared field for the supplied class

static public field get declared field ( class c , string name ) throws reflection exception { try { return new field ( c get declared field ( name ) ) ; } catch ( security exception e ) { throw new reflection exception ( " security violation while getting field : " + name + " , for class : " + c get name ( ) , e ) ; } catch ( no such field exception e ) { throw new reflection exception ( " field not found : " + name + " , for class : " + c get name ( ) , e ) ; } }


registers a listener which is called whenever new slots become available

void register new slots listener ( new slots listener listener ) ;


get the configuration constructed from the command line arguments

public final configuration get configuration ( ) { return configuration ; }


add the corresponding files as public textual header files these files will not be compiled into a target ' s header module , but will be made visible as textual includes to dependent rules

public cc compilation helper add public textual headers ( list < artifact > textual headers ) { iterables add all ( this public textual headers , textual headers ) ; for ( artifact header : textual headers ) { this additional exported headers add ( header get exec path ( ) ) ; } return this ; }


void executes huge script in reasonable time ( ) throws s q l exception { database populator add script ( default schema ( ) ) ; database populator add script ( resource ( " db - test - data - huge sql " ) ) ; database populator utils execute ( database populator , db ) ; }


public void test concat ( ) throws exception { reset call ( ) ; string file 1 = " / test namenode retry cache / test concat / file 1 " ; string file 2 = " / test namenode retry cache / test concat / file 2 " ; / / two retried concat calls succeed concat setup ( file 1 , file 2 ) ; new call ( ) ; nn rpc concat ( file 1 , new string [ ] { file 2 } ) ; nn rpc concat ( file 1 , new string [ ] { file 2 } ) ; nn rpc concat ( file 1 , new string [ ] { file 2 } ) ; / / a non - retried concat request fails new call ( ) ; try { / / second non - retry call should fail with an exception nn rpc concat ( file 1 , new string [ ] { file 2 } ) ; assert fail ( " test concat - expected exception is not thrown " ) ; } catch ( i o exception e ) { / / expected } }


not supported by this stream throws { @ link unsupported operation exception }

public synchronized void reset ( ) throws i o exception { throw new unsupported operation exception ( " mark ( ) / reset ( ) not supported on this stream " ) ; }


returns the raw call , initializing it if necessary throws if initializing the raw call throws , or has thrown in previous attempts to create it

private okhttp 3 call get raw call ( ) throws i o exception { okhttp 3 call call = raw call ; if ( call ! = null ) return call ; / / re - throw previous failures if this isn ' t the first attempt if ( creation failure ! = null ) { if ( creation failure instanceof i o exception ) { throw ( i o exception ) creation failure ; } else if ( creation failure instanceof runtime exception ) { throw ( runtime exception ) creation failure ; } else { throw ( error ) creation failure ; } } / / create and remember either the success or the failure try { return raw call = create raw call ( ) ; } catch ( runtime exception | error | i o exception e ) { throw if fatal ( e ) ; / / do not assign a fatal error to creation failure creation failure = e ; throw e ; } }


returns the name of this symbol this value could be null since some libraries only export by ordinal value

string get name ( ) { return symbol name ; }


factory method for an annotation matching pointcut that matches for the specified annotation at the class level

public static annotation matching pointcut for class annotation ( class < ? extends annotation > annotation type ) { assert not null ( annotation type , " annotation type must not be null " ) ; return new annotation matching pointcut ( annotation type ) ; }


find out how many transactions we can read from a file journal manager , starting at a given transaction id

static long get number of transactions ( file journal manager jm , long from tx id , boolean in progress ok , boolean abort on gap ) throws i o exception { long num transactions = 0 , tx id = from tx id ; final priority queue < edit log input stream > all streams = new priority queue < edit log input stream > ( 64 , journal set edit log input stream comparator ) ; jm select input streams ( all streams , from tx id , in progress ok ) ; edit log input stream elis = null ; try { while ( ( elis = all streams poll ( ) ) ! = null ) { try { elis skip until ( tx id ) ; while ( true ) { f s edit log op op = elis read op ( ) ; if ( op = = null ) { break ; } if ( abort on gap & & ( op get transaction id ( ) ! = tx id ) ) { log info ( " get number of transactions : detected gap at tx id " + from tx id ) ; return num transactions ; } tx id = op get transaction id ( ) + 1 ; num transactions + + ; } } finally { i o utils cleanup with logger ( log , elis ) ; } } } finally { i o utils cleanup with logger ( log , all streams to array ( new edit log input stream [ 0 ] ) ) ; } return num transactions ; }


release any external resources occupied by the given partition this call triggers release of any resources which are occupied by the given partition in the external systems outside of the producer executor this is mostly relevant for the batch jobs and blocking result partitions the producer local resources are managed by { @ link shuffle descriptor # stores local resources on ( ) } and { @ link shuffle environment # release partitions locally ( collection ) }

void release partition externally ( shuffle descriptor shuffle descriptor ) ;


whether this shader instance implements the specified uniform , only valid after a call to init ( )

public final boolean has ( final int input i d ) { return input i d > = 0 & & input i d < locations length & & locations [ input i d ] > = 0 ; }


validate the given handler against the current request the default implementation is empty can be overridden in subclasses , for example to enforce specific preconditions expressed in url mappings

protected void validate handler ( object handler , server web exchange exchange ) { }


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


gets the declared output fields for the specified global stream id

public fields get component output fields ( global stream id id ) { return get component output fields ( id get component id ( ) , id get stream id ( ) ) ; }


create a composite record writer that can write keyvalue data to different output files

public record writer < k , v > get record writer ( file system fs , job conf job , string name , progressable arg 3 ) throws i o exception { final file system my f s = fs ; final string my name = generate leaf file name ( name ) ; final job conf my job = job ; final progressable my progressable = arg 3 ; return new record writer < k , v > ( ) { / / a cache storing the record writers for different output files tree map < string , record writer < k , v > > record writers = new tree map < string , record writer < k , v > > ( ) ; public void write ( k key , v value ) throws i o exception { / / get the file name based on the key string key based path = generate file name for key value ( key , value , my name ) ; / / get the file name based on the input file name string final path = get input file based output file name ( my job , key based path ) ; / / get the actual key k actual key = generate actual key ( key , value ) ; v actual value = generate actual value ( key , value ) ; record writer < k , v > rw = this record writers get ( final path ) ; if ( rw = = null ) { / / if we don ' t have the record writer yet for the final path , create / / one / / and add it to the cache rw = get base record writer ( my f s , my job , final path , my progressable ) ; this record writers put ( final path , rw ) ; } rw write ( actual key , actual value ) ; } ; public void close ( reporter reporter ) throws i o exception { iterator < string > keys = this record writers key set ( ) iterator ( ) ; while ( keys has next ( ) ) { record writer < k , v > rw = this record writers get ( keys next ( ) ) ; rw close ( reporter ) ; } this record writers clear ( ) ; } ; } ; }


builds the alignment panel gui components

public j panel build alignment panel ( ) { alignment table = create alignment table ( null , 0 ) ; main panel = new j panel ( new border layout ( ) ) ; main panel set border ( border factory create empty border ( 10 , 10 , 10 , 10 ) ) ; alignment table set column header popup enabled ( true ) ; scroll pane = new j scroll pane ( alignment table ) ; main panel add ( scroll pane , border layout center ) ; j panel modulus panel = new j panel ( ) ; pair layout modulus layout = new pair layout ( ) ; modulus panel set layout ( modulus layout ) ; modulus panel add ( new g label ( modulus field text ) ) ; modulus field = new integer text field ( ) ; modulus field set value ( default modulus ) ; modulus panel add ( modulus field get component ( ) ) ; j button recompute button = new j button ( recompute button text ) ; recompute button add action listener ( e - > update alignment panel ( ) ) ; get button panel ( ) add ( recompute button ) ; main panel add ( modulus panel , border layout north ) ; main panel add ( get button panel ( ) , border layout south ) ; return main panel ; }


protected void finalize profile response ( final o auth 2 0 access token access token ticket , final map < string , object > map , final principal principal , final registered service registered service ) { if ( registered service instanceof o auth registered service ) { val service = access token ticket get service ( ) ; map put ( cas protocol constants parameter service , service get id ( ) ) ; } }


check if a field is a collection of strings

public boolean is collection of strings ( string field name ) { optional < java type > property type = get type of field ( field name ) ; if ( ! property type is present ( ) ) { return false ; } if ( ! property type get ( ) is collection like type ( ) & & ! property type get ( ) is array type ( ) ) { return false ; } return property type get ( ) get content type ( ) is type or sub type of ( string class ) ; }


public boolean is compatible ( dalv insn insn ) { register spec list regs = insn get registers ( ) ; return ( insn instanceof simple insn ) & & ( regs size ( ) = = 2 ) & & unsigned fits in byte ( regs get ( 0 ) get reg ( ) ) & & unsigned fits in short ( regs get ( 1 ) get reg ( ) ) ; }


set the body of the request to the given { @ code body inserter }

builder body ( body inserter < ? , ? super client http request > inserter ) ;


called when the renderer is started the default implementation is a no - op

protected void on started ( ) throws exo playback exception { / / do nothing }


returns whether the given method accesses package visible classes or class members

public static boolean accesses package code ( method method ) { method optimization info info = method optimization info get method optimization info ( method ) ; return info = = null | | info accesses package code ( ) ; }