flush the output only valid in the state { @ code writing } in the base class , this is a no - op

void flush ( ) throws i o exception { verify state ( writing ) ; }


return the management interface of the target m bean , or { @ code null } if none specified

protected final class < ? > get management interface ( ) { return this management interface ; }


starts the autocompleter on the given text field first , this repeatedly attempts auto - activation when there are many suggestions , or when auto - activation is prevented ( see { @ link # get completion can default ( object ) get completion can default ( t ) } ) , a list is displayed ( usually below the caret ) containing the suggestions given the fields current contents the list remains open until either the user cancels it ( usually via esc ) or the user activates a suggestion note : the text field must already be attached

public void start completion ( j text field field ) { if ( ! attachees contains ( field ) ) { throw new illegal argument exception ( " given field is not attached " ) ; } set < string > visited = new hash set < > ( ) ; while ( true ) { string before = get prefix ( field ) ; if ( ! visited add ( before ) ) { return ; } collection < t > comp = model compute completions ( before ) ; if ( comp = = null | | comp size ( ) = = 0 ) { return ; } else if ( comp size ( ) = = 1 ) { t sel = comp iterator ( ) next ( ) ; if ( get completion can default ( sel ) ) { completion activated ( comp iterator ( ) next ( ) ) ; } else { set completion list visible ( true ) ; update display contents ( ) ; return ; } } else if ( ! is completion list visible ( ) ) { set completion list visible ( true ) ; update display contents ( ) ; return ; } } }


suitable for a 1 : 1 conversation or a gv1 group only

public static void send profile key ( final context context , final long thread id ) { application dependencies get job manager ( ) add ( profile key send job create ( context , thread id ) ) ; }


create a context of the shuffle inputoutput owner used to create partitions or gates belonging to the owner this method has to be called only once to avoid duplicated internal metric group registration

shuffle i o owner context create shuffle i o owner context ( string owner name , execution attempt i d execution attempt i d , metric group parent group ) ;


perform a cleanup on the given resource ( which is left bound to the thread )

protected mono < void > cleanup resource ( o resource holder , k resource key , boolean committed ) { return mono empty ( ) ; }


tests that the use of a { @ link finalizable reference queue } does not subsequently prevent the loader of that class from being garbage - collected

public void test unloadable without security manager ( ) throws exception { if ( is jdk 9 or higher ( ) ) { return ; } security manager old security manager = system get security manager ( ) ; try { system set security manager ( null ) ; do test unloadable ( ) ; } finally { system set security manager ( old security manager ) ; } }


create a mock resource tracker server that returns the resources we want in the heartbeat

private static server get mock resource tracker ( final resource resource ) throws exception { / / setup the mock resource tracker final resource tracker rt = mock ( resource tracker class ) ; when ( rt register node manager ( any ( ) ) ) then answer ( invocation - > { register node manager response response = record factory new record instance ( register node manager response class ) ; response set container token master key ( create master key ( ) ) ; response set n m token master key ( create master key ( ) ) ; return response ; } ) ; when ( rt node heartbeat ( any ( ) ) ) then answer ( invocation - > { node heartbeat response response = record factory new record instance ( node heartbeat response class ) ; response set resource ( resource ) ; return response ; } ) ; when ( rt un register node manager ( any ( ) ) ) then answer ( invocaiton - > { un register node manager response response = record factory new record instance ( un register node manager response class ) ; return response ; } ) ; / / get the rpc server yarn configuration conf = new yarn configuration ( ) ; yarn r p c rpc = yarn r p c create ( conf ) ; server server = rpc get server ( resource tracker class , rt , new inet socket address ( " 0 0 0 0 " , 0 ) , conf , null , 1 ) ; return server ; }


returns the stripe that corresponds to the passed key it is always guaranteed that if { @ code key 1 equals ( key 2 ) } , then { @ code get ( key 1 ) = = get ( key 2 ) }


set whether to use statements that are capable of returning updatable result sets

public void set updatable results ( boolean updatable results ) { if ( is compiled ( ) ) { throw new invalid data access api usage exception ( " the updateable results flag must be set before the operation is compiled " ) ; } this updatable results = updatable results ; }


gets the uri to access the given application on map reduce history server

public uri get tracking uri ( application id id ) throws u r i syntax exception { string job suffix = id to string ( ) replace first ( " ^ application " , " job " ) ; string history server address = m r web app util get j h s webapp u r l with scheme ( get conf ( ) ) ; return new uri ( history server address + " / jobhistory / job / " + job suffix ) ; }


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


a blob of key - value pairs of common service properties

public configuration properties ( map < string , string > properties ) { this properties = properties ; return this ; }


disable the specified filters on the given session

protected void disable filters ( session session ) { string [ ] filter names = get filter names ( ) ; if ( filter names ! = null ) { for ( string filter name : filter names ) { session disable filter ( filter name ) ; } } }


start the re - encryption updater thread

void start updater thread ( ) { updater executor = executors new single thread executor ( new thread factory builder ( ) set daemon ( true ) set name format ( " reencryption updater thread # % d " ) build ( ) ) ; updater executor execute ( reencryption updater ) ; }


generate the blur kernels which will be repeatedly applied when blurring images

private static float [ ] [ ] generate gaussian blur kernels ( int level ) { float [ ] [ ] pascals triangle = generate pascals triangle ( level ) ; float [ ] [ ] gaussian triangle = new float [ pascals triangle length ] [ ] ; for ( int i = 0 ; i < gaussian triangle length ; i + + ) { float total = 0 0f ; gaussian triangle [ i ] = new float [ pascals triangle [ i ] length ] ; for ( int j = 0 ; j < pascals triangle [ i ] length ; j + + ) total + = pascals triangle [ i ] [ j ] ; float coefficient = 1 / total ; for ( int j = 0 ; j < pascals triangle [ i ] length ; j + + ) gaussian triangle [ i ] [ j ] = coefficient * pascals triangle [ i ] [ j ] ; } return gaussian triangle ; }


maximum depth of containers ( ie filesystems ) to recurse into when processing a file added by the user

public int get max depth ( ) { return max depth ; }


returns the chart data object that has been set for the chart

public t get data ( ) { return m data ; }


returns the first input , or null , if none is set

public operator < in1 > get first input ( ) { return this input 1 ; }


public static boolean write file from bytes by stream ( final file file , final byte [ ] bytes , final boolean append , final on progress update listener listener ) { if ( bytes = = null ) return false ; return write file from i s ( file , new byte array input stream ( bytes ) , append , listener ) ; }


returns the { @ link iterator } that enumerates all { @ link channel future } s which are associated with this future please note that the returned { @ link iterator } is is unmodifiable , which means a { @ link channel future } cannot be removed from this future

iterator < channel future > iterator ( ) ;


register a listener that will be called when this model visibility has changed the listener will contribute to this model ' s hash code state per the { @ link com airbnb epoxy epoxy attribute option # do not hash } rules

public test field prop null on recycle option view model on visibility changed ( on model visibility changed listener < test field prop null on recycle option view model , test field prop null on recycle option view > listener ) { on mutation ( ) ; this on model visibility changed listener epoxy generated model = listener ; return this ; }


returns an instantiator , used to create new class instances

instantiator get instantiator ( mock creation settings < ? > settings ) ;


empty implementation to satisfy the build listener interface

public void target finished ( build event event ) { / / not significant for the class loader }


public user find user by user name ( string user name ) { if ( ! user name 2 user contains key ( user name ) ) { return null ; } return user name 2 user get ( user name ) ; }


any symbols this file auto - generatesexports ( eg & # 64 ; + idfoo in an xml file ) < code > repeated aapt pb internal compiled file symbol exported symbol = 4 ; < code >

private void set exported symbol ( int index , symbol builder builder for value ) { ensure exported symbol is mutable ( ) ; exported symbol set ( index , builder for value build ( ) ) ; }


set statuses to filter shards to get stores info on see { @ link cluster health status } for details defaults to " yellow " and " red " status

public indices shard stores request shard statuses ( string shard statuses ) { statuses = enum set none of ( cluster health status class ) ; for ( string status string : shard statuses ) { if ( " all " equals ignore case ( status string ) ) { statuses = enum set all of ( cluster health status class ) ; return this ; } statuses add ( cluster health status from string ( status string ) ) ; } return this ; }


creates an empty double stream using reflection to stay backwards - compatible with older j d ks

public static object empty double stream ( ) { / / note : the empty stream can not be stored as a singleton return invoke nullary factory method ( " java util stream double stream " , " empty " ) ; }


removes all vertices and edges from the graph without changing the space allocated

public void clear ( ) { this edges clear ( ) ; this vertices clear ( ) ; this edge attributes clear ( ) ; this vertex attributes clear ( ) ; }


private static set < class < ? > > get classes between ( class < ? > descendant , class < ? > ancestor ) { set < class < ? > > classes = new hash set ( ) ; while ( ! descendant equals ( ancestor ) ) { classes add ( descendant ) ; descendant = descendant get superclass ( ) ; } return classes ; }


protected boolean add elem ( final t element ) { / / validate element if ( element = = null ) { throw new illegal argument exception ( " null element is not supported " ) ; } / / find hash code & index final int hash code = element hash code ( ) ; final int index = get index ( hash code ) ; / / return false if already present if ( get contained elem ( index , element , hash code ) ! = null ) { return false ; } modification + + ; size + + ; / / update bucket linked list linked element < t > le = new linked element < t > ( element , hash code ) ; le next = entries [ index ] ; entries [ index ] = le ; return true ; }


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

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


tests that if an runtime exception occurs in an output stream , the exception will be recorded and thrown when we call wait for completion

public void test asynchronous runtime exception in consumer output stream ( ) throws exception { output stream out = new output stream ( ) { @ override public void write ( int b ) { throw new runtime exception ( secret message ) ; } } ; out err consumers out err = consumers create streaming consumers ( out , out ) ; byte array input stream out input = new byte array input stream ( new byte [ ] { ' a ' } ) ; byte array input stream err input = new byte array input stream ( new byte [ 0 ] ) ; out err register inputs ( out input , err input , false ) ; runtime exception e = assert throws ( runtime exception class , ( ) - > out err wait for completion ( ) ) ; assert that ( e ) has message that ( ) is equal to ( secret message ) ; }


returns the current bounds as the constraint if none can be found in the figures constraint object

public rectangle get current constraint for ( graphical edit part child ) { i figure fig = child get figure ( ) ; object constraint = fig get parent ( ) get layout manager ( ) get constraint ( fig ) ; rectangle rectangle = constraint instanceof rectangle ? ( rectangle ) constraint : null ; if ( rectangle = = null ) { rectangle = fig get bounds ( ) ; } return rectangle ; }


verify the stages of a dying sun , without going back in time

public void test time passes ( ) { final var star = new star ( star type sun , 1 , 2 ) ; assert equals ( " sun age : 1 years mass : 2 tons " , star to string ( ) ) ; star time passes ( ) ; assert equals ( " red giant age : 2 years mass : 16 tons " , star to string ( ) ) ; star time passes ( ) ; assert equals ( " white dwarf age : 4 years mass : 128 tons " , star to string ( ) ) ; star time passes ( ) ; assert equals ( " supernova age : 8 years mass : 1024 tons " , star to string ( ) ) ; star time passes ( ) ; assert equals ( " dead star age : 16 years mass : 8192 tons " , star to string ( ) ) ; star time passes ( ) ; assert equals ( " dead star age : 64 years mass : 0 tons " , star to string ( ) ) ; star time passes ( ) ; assert equals ( " dead star age : 256 years mass : 0 tons " , star to string ( ) ) ; }


evaluates the expresson and checks whether it fails with the expected error

scenario test if error contains ( string expected error , string lines ) throws exception { run test ( error testable ( false , expected error , lines ) ) ; return this ; }


used during { @ link segmented bytes store # fetch ( bytes , long , long ) } operations to determine which segments should be scanned

< s extends segment > list < s > segments to search ( segments < s > segments , long from , long to , boolean forward ) ;


mqtt client config get client config ( ) ;


returns true if the edges in this graph are directed directed edges connect a { @ link endpoint pair # source ( ) source node } to a { @ link endpoint pair # target ( ) target node } , while undirected edges connect a pair of nodes to each other


set properties that contain well - known free marker keys which will be passed to free marker ' s { @ code configuration set settings } method

public void set freemarker settings ( properties settings ) { this freemarker settings = settings ; }


public float get damping ratio ( ) { return joint get damping ratio ( ) ; }


tracks when some work is ready to offered for continuation

object on offer work for continuation ( string tag ) ;


should rendering of this tag proceed at all returns ' { @ code true } ' by default causing rendering to occur always , subclasses can override this if they provide conditional rendering

protected boolean should render ( ) throws jsp exception { return true ; }


invoke this for an expectation that has been matched the count of the given expectation is incremented , then it is either stored if remaining count > 0 or removed otherwise

public void update ( request expectation expectation ) { expectation increment and validate ( ) ; update internal ( expectation ) ; }


called when the given component provider is deactivated

public void component provider deactivated ( component provider component provider ) ;


create a file context for specified default uri using the specified config

public static file context get file context ( final uri default fs uri , final configuration a conf ) throws unsupported file system exception { user group information current user = null ; abstract file system default afs = null ; if ( default fs uri get scheme ( ) = = null ) { return get file context ( a conf ) ; } try { current user = user group information get current user ( ) ; default afs = get abstract file system ( current user , default fs uri , a conf ) ; } catch ( unsupported file system exception ex ) { throw ex ; } catch ( i o exception ex ) { log error ( ex to string ( ) ) ; throw new runtime exception ( ex ) ; } return get file context ( default afs , a conf ) ; }


return a string representing the rule summary for the given rule with the given name for example : ' my rule ( foo , bar ) ' the summary will contain hyperlinks for each attribute

public string rule summary ( string rule name , rule info rule info ) { list < string > attribute names = rule info get attribute list ( ) stream ( ) map ( attr - > attr get name ( ) ) collect ( collectors to list ( ) ) ; return summary ( rule name , attribute names ) ; }


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


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


sets the width spec and height spec that should be used to measure the { @ link root host }

public render core test rule set size specs ( int width spec , int height spec ) { this width spec = width spec ; this height spec = height spec ; return this ; }


public analysis config get analysis config ( ) { return analysis config ; }


copies playback info with new loading state

public playback info copy with is loading ( boolean is loading ) { return new playback info ( timeline , period id , requested content position us , playback state , playback error , is loading , track groups , track selector result , loading media period id , play when ready , playback suppression reason , playback parameters , buffered position us , total buffered duration us , position us , offload scheduling enabled ) ; }


this also verifies that we don ' t have leakage between keysnamespaces

public void test set and fire processing time timers ( ) throws exception { @ suppress warnings ( " unchecked " ) triggerable < integer , string > mock triggerable = mock ( triggerable class ) ; test key context key context = new test key context ( ) ; test processing time service processing time service = new test processing time service ( ) ; internal timer service impl < integer , string > timer service = create and start internal timer service ( mock triggerable , key context , processing time service , test key group range , create queue factory ( ) ) ; / / get two different keys int key 1 = get key in key group range ( test key group range , max parallelism ) ; int key 2 = get key in key group range ( test key group range , max parallelism ) ; while ( key 2 = = key 1 ) { key 2 = get key in key group range ( test key group range , max parallelism ) ; } key context set current key ( key 1 ) ; timer service register processing time timer ( " ciao " , 10 ) ; timer service register processing time timer ( " hello " , 10 ) ; key context set current key ( key 2 ) ; timer service register processing time timer ( " ciao " , 10 ) ; timer service register processing time timer ( " hello " , 10 ) ; assert equals ( 4 , timer service num processing time timers ( ) ) ; assert equals ( 2 , timer service num processing time timers ( " hello " ) ) ; assert equals ( 2 , timer service num processing time timers ( " ciao " ) ) ; processing time service set current time ( 10 ) ; verify ( mock triggerable , times ( 4 ) ) on processing time ( any internal timer ( ) ) ; verify ( mock triggerable , times ( 1 ) ) on processing time ( eq ( new timer heap internal timer < > ( 10 , key 1 , " ciao " ) ) ) ; verify ( mock triggerable , times ( 1 ) ) on processing time ( eq ( new timer heap internal timer < > ( 10 , key 1 , " hello " ) ) ) ; verify ( mock triggerable , times ( 1 ) ) on processing time ( eq ( new timer heap internal timer < > ( 10 , key 2 , " ciao " ) ) ) ; verify ( mock triggerable , times ( 1 ) ) on processing time ( eq ( new timer heap internal timer < > ( 10 , key 2 , " hello " ) ) ) ; assert equals ( 0 , timer service num processing time timers ( ) ) ; }


the parent service name ( caller ) , { @ link span # local service name ( ) } if instrumented

public string parent ( ) { return parent ; }


used to prevent unnecessary checks for cancellation


helper for { @ link # assign addresses and fix branches } , which checks the branch target size requirement of each branch instruction to make sure it fits for instructions that don ' t fit , this rewrites them to use a { @ code goto } of some sort in the case of a conditional branch that doesn ' t fit , the sense of the test is reversed in order to branch around a { @ code goto } to the original target

private boolean fix branches ( ) { int size = insns size ( ) ; boolean any fixed = false ; for ( int i = 0 ; i < size ; i + + ) { dalv insn insn = insns get ( i ) ; if ( ! ( insn instanceof target insn ) ) { / / this loop only needs to inspect target insns continue ; } dop opcode = insn get opcode ( ) ; target insn target = ( target insn ) insn ; if ( opcode get format ( ) branch fits ( target ) ) { continue ; } if ( opcode get family ( ) = = opcodes goto ) { / / it is a goto ; widen it if possible opcode = find opcode for insn ( insn , opcode ) ; if ( opcode = = null ) { / * * the branch is already maximally large this should * only be possible if a method somehow manages to have * more than 2 ^ 31 code units * / throw new unsupported operation exception ( " method too long " ) ; } insns set ( i , insn with opcode ( opcode ) ) ; } else { / * * it is a conditional : reverse its sense , and arrange for * it to branch around an absolute goto to the original * branch target * * note : an invariant of the list being processed is * that every target insn is followed by a code address * hence , it is always safe to get the next element * after a target insn and cast it to code address , as * is happening a few lines down * * also note : size gets incremented by one here , as we * have - - in the net - - added one additional element * to the list , so we increment i to match the added * and changed elements will be inspected by a repeat * call to this method after this invocation returns * / code address new target ; try { new target = ( code address ) insns get ( i + 1 ) ; } catch ( index out of bounds exception ex ) { / / the target insn / code address invariant was violated throw new illegal state exception ( " unpaired target insn ( dangling ) " ) ; } catch ( class cast exception ex ) { / / the target insn / code address invariant was violated throw new illegal state exception ( " unpaired target insn " ) ; } target insn goto insn = new target insn ( dops goto , target get position ( ) , register spec list empty , target get target ( ) ) ; insns set ( i , goto insn ) ; insns add ( i , target with new target and reversed ( new target ) ) ; size + + ; i + + ; } any fixed = true ; } return any fixed ; }


determine a media type for the given file name , if possible

public static optional < media type > get media type ( @ nullable string filename ) { return get media types ( filename ) stream ( ) find first ( ) ; }


public list < integer > get prefix ns array ( ) { return prefix ns array ; }


add a list of rejected scheduling requests to the allocate response

public void set rejected scheduling requests ( list < rejected scheduling request > rejected requests ) { }


public cassandra sink builder < in > set host ( string host ) { return set host ( host , 9042 ) ; }


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

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


public kafka template < k , v > get kafka template ( final serializer < k > key serializer , final serializer < v > value serializer ) { val producer factory = new default kafka producer factory < > ( get producer configuration ( ) , key serializer , value serializer ) ; return new kafka template < > ( producer factory ) ; }


public mean statistic get mean statistic ( string key ) { return lookup ( mean statistic map , key ) ; }


invoked when the target of the listener has changed its state

public void state changed ( change event e ) { if ( e get source ( ) instanceof j viewport ) { / / note : this code is a workaround certain j v ms ( visual cafe , / / jdk 1 2 2 ) where the page down key is not handled correctly for / / scrolling the j tree ; the tree ends up a the bottom of the / / viewport - - not desirable j viewport viewport = ( j viewport ) e get source ( ) ; rectangle view rect = viewport get view rect ( ) ; rectangle tree rect = tree get bounds ( ) ; if ( view rect y < tree rect y ) { / / force y position to be at the top of the viewport tree rect y = 0 ; tree set bounds ( tree rect ) ; } invalidate ( ) ; validate ( ) ; } else { tool set config changed ( true ) ; } }


returns the { @ link java toolchain tool } for the header compiler

public java toolchain tool get header compiler ( ) { return header compiler ; }


returns true if the set contains the given value

public boolean contains ( int value ) { return indexer get ( value ) > = 0 ; }


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

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


gets any warning messages associated with the initial diff of the two programs

public string get warnings ( ) { return merge engine get warnings ( ) ; }


marks the given constant pool entry of the given class this includes visiting any referenced objects

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


generates all test cases appropriate for the given method

private static void add tests ( test suite suite , method method ) { if ( is guarded ( method ) ) { for ( boolean fair 1 : new boolean [ ] { true , false } ) { for ( boolean fair 2 : new boolean [ ] { true , false } ) { suite add test ( generate guard with wrong monitor test case ( method , fair 1 , fair 2 ) ) ; } } } if ( is any enter ( method ) ) { add tests ( suite , method , scenario satisfied and unoccupied before entering , timeouts to use any , outcome success ) ; add tests ( suite , method , scenario unsatisfied and unoccupied before entering , timeouts to use finite , is guarded ( method ) ? ( is boolean ( method ) ? outcome failure : outcome hang ) : outcome success ) ; add tests ( suite , method , scenario unsatisfied and unoccupied before entering , timeouts to use infinite , is guarded ( method ) ? ( is try enter ( method ) | | is enter if ( method ) ? outcome failure : outcome hang ) : outcome success ) ; add tests ( suite , method , scenario satisfied and occupied before entering , timeouts to use finite , is boolean ( method ) ? outcome failure : outcome hang ) ; add tests ( suite , method , scenario satisfied and occupied before entering , timeouts to use infinite , is guarded ( method ) ? outcome hang : ( is try enter ( method ) ? outcome failure : outcome hang ) ) ; add tests ( suite , method , scenario satisfied unoccupied and interrupted before entering , timeouts to use any , is interruptible ( method ) ? outcome interrupt : outcome success ) ; } else { / / any wait for xxx method suite add test ( generate wait for when not occupying test case ( method , true ) ) ; suite add test ( generate wait for when not occupying test case ( method , false ) ) ; add tests ( suite , method , scenario satisfied before waiting , timeouts to use any , outcome success ) ; add tests ( suite , method , scenario satisfied while waiting , timeouts to use infinite , outcome success ) ; add tests ( suite , method , scenario satisfied while waiting , timeouts to use past , outcome failure ) ; add tests ( suite , method , scenario satisfied and interrupted before waiting , timeouts to use any , outcome success ) ; add tests ( suite , method , scenario unsatisfied before and while waiting , timeouts to use finite , outcome failure ) ; add tests ( suite , method , scenario unsatisfied before and while waiting , timeouts to use infinite , outcome hang ) ; add tests ( suite , method , scenario unsatisfied and interrupted before waiting , timeouts to use past , / / prefer responding to interrupt over timing out is interruptible ( method ) ? outcome interrupt : outcome failure ) ; add tests ( suite , method , scenario unsatisfied and interrupted before waiting , timeouts to use small , is interruptible ( method ) ? outcome interrupt : outcome failure ) ; add tests ( suite , method , scenario unsatisfied and interrupted before waiting , timeouts to use infinite , is interruptible ( method ) ? outcome interrupt : outcome hang ) ; } }


releases the batch that this iterator iterated over this is not supposed to close the reader and its resources , but is simply a signal that this iterator is no used any more this method can be used as a hook to recyclereuse heavyweight object structures


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


downloads the blob identified by the given blob key from the blob server

input stream get internal ( @ nullable job i d job id , blob key blob key ) throws i o exception { if ( this socket is closed ( ) ) { throw new illegal state exception ( " blob client is not connected " + " client has been shut down or encountered an error before " ) ; } if ( log is debug enabled ( ) ) { log debug ( " get blob { } / { } from { } " , job id , blob key , socket get local socket address ( ) ) ; } try { output stream os = this socket get output stream ( ) ; input stream is = this socket get input stream ( ) ; / / send get header send get header ( os , job id , blob key ) ; receive and check get response ( is ) ; return new blob input stream ( is , blob key , os ) ; } catch ( throwable t ) { blob utils close silently ( socket , log ) ; throw new i o exception ( " get operation failed : " + t get message ( ) , t ) ; } }


{ @ inherit doc } the default implementation does nothing

@ override public void enter timestamp escaped literal ( sql base parser timestamp escaped literal context ctx ) { }


returns an address range iterator over all occupied ranges in the map the first range must have a from address at or after the specified start addr

public address range iterator get address ranges ( address start addr ) { return new range iterator ( start addr ) ; }


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


tests that when the parent dirs does not exist in fallback but the immediate parent dir is not same as mount internal directory , then we create parent structure ( mount internal directory tree structure ) in fallback

public void test mkdir of deep tree with fallback link and mount path matching dir exist ( ) throws exception { configuration conf = new configuration ( ) ; conf set boolean ( constants config viewfs mount links as symlinks , false ) ; config util add link ( conf , " / user 1 / hive " , new path ( target test root to string ( ) ) to uri ( ) ) ; path fallback target = new path ( target test root , " fallback dir " ) ; fs target mkdirs ( fallback target ) ; config util add link fallback ( conf , fallback target to uri ( ) ) ; abstract file system vfs = abstract file system get ( view fs default cluster uri , conf ) ; / / user 1 does not exist in fallback path multiple level to internal dir = new path ( " / user 1 / test / test " ) ; path test = path merge paths ( fallback target , multiple level to internal dir ) ; assert false ( fs target exists ( test ) ) ; vfs mkdir ( multiple level to internal dir , null , true ) ; assert true ( fs target exists ( test ) ) ; }


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


gets the original pre - built jars provided as inputs to this rule these should be used where class files are needed or wanted in place of recompiling the sources from { @ link # get source jars for jar files ( ) } , as this is the source of truth used by the normal java machinery

public collection < artifact > get jar files ( ) { return jar files ; }


http options variant see { @ link # get ( string , object ) } for general info

public static base builder < ? > options ( string url template , object uri vars ) { return method ( http method options , url template , uri vars ) ; }


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


is the list of object summaries empty after accounting for tombstone markers ( if provided ) ?

public boolean is empty of objects ( final context accessors accessors , final set < path > tombstones ) { if ( tombstones = = null ) { return get object summaries ( ) is empty ( ) ; } return is empty of keys ( accessors , object summary keys ( ) , tombstones ) ; }


returns the contents that have been written to this instance , as a byte array


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


returns { @ code true } if and only if < a href = " https : netty iowikiforked - tomcat - native html " > { @ code netty - tcnative } and its open s s l support are available

public static boolean is available ( ) { return unavailability cause = = null ; }


define a new configuration with no dependents

public config def define ( string name , type type , object default value , validator validator , importance importance , string documentation , string group , int order in group , width width , string display name , recommender recommender ) { return define ( name , type , default value , validator , importance , documentation , group , order in group , width , display name , collections empty list ( ) , recommender ) ; }


public static rated request from x content ( x content parser parser ) { return parser apply ( parser , null ) ; }


invoke the given bean factory post processor beans

private static void invoke bean factory post processors ( collection < ? extends bean factory post processor > post processors , configurable listable bean factory bean factory ) { for ( bean factory post processor post processor : post processors ) { startup step post process bean factory = bean factory get application startup ( ) start ( " spring context bean - factory post - process " ) tag ( " post processor " , post processor : : to string ) ; post processor post process bean factory ( bean factory ) ; post process bean factory end ( ) ; } }


simulate a block and note the results in the lattice

private void simulate block ( ssa basic block block ) { for ( ssa insn insn : block get insns ( ) ) { if ( insn instanceof phi insn ) { simulate phi ( ( phi insn ) insn ) ; } else { simulate stmt ( insn ) ; } } }


returns a string listing the possible flag completion for this command along with the command completion if any see { @ link options usage # get completion ( option definition , string builder ) } for more details on the format for the flag completion

public string get options completion ( ) { string builder desc = new string builder ( ) ; visit options ( option definition - > option definition get documentation category ( ) ! = option documentation category undocumented , option definition - > options usage get completion ( option definition , desc ) ) ; return desc to string ( ) ; }


post storeorder : place an order for a pet

response entity < order > place order ( @ api param ( value = " order placed for purchasing the pet " , required = true ) @ valid @ request body order body ) ;


returns a human - oriented string representing the given access flags , as defined on inner classes

public static string inner class string ( int flags ) { return human helper ( flags , inner class flags , conv class ) ; }


construct an answer from a two parameter answer interface

public static < a , b > answer < void > to answer ( final void answer 2 < a , b > answer ) { return new answer < void > ( ) { @ suppress warnings ( " unchecked " ) public void answer ( invocation on mock invocation ) throws throwable { answer answer ( ( a ) invocation get argument ( 0 ) , ( b ) invocation get argument ( 1 ) ) ; return null ; } } ; }


encodes contexts where ' l ' is not pronounced in " - lm - "

boolean encode silent l in lm ( ) { if ( string at ( m current , 2 , " lm " , " ln " , " " ) ) { / / e g " lincoln " , " holmes " , " psalm " , " salmon " if ( ( string at ( ( m current - 2 ) , 4 , " coln " , " calm " , " balm " , " malm " , " palm " , " " ) | | ( string at ( ( m current - 1 ) , 3 , " olm " , " " ) & & ( ( m current + 1 ) = = m last ) ) | | string at ( ( m current - 3 ) , 5 , " psalm " , " qualm " , " " ) | | string at ( ( m current - 2 ) , 6 , " salmon " , " holmes " , " " ) | | string at ( ( m current - 1 ) , 6 , " almond " , " " ) | | ( ( m current = = 1 ) & & string at ( ( m current - 1 ) , 4 , " alms " , " " ) ) ) & & ( ! string at ( ( m current + 2 ) , 1 , " a " , " " ) & & ! string at ( ( m current - 2 ) , 5 , " balmo " , " " ) & & ! string at ( ( m current - 2 ) , 6 , " palmer " , " palmor " , " balmer " , " " ) & & ! string at ( ( m current - 3 ) , 5 , " thalm " , " " ) ) ) { m current + + ; return true ; } else { metaph add ( " l " ) ; m current + + ; return true ; } } return false ; }


test to ensure that source a is inside as well as outside of the iteration the same node ( src a ) ( src b ) \ \ ( sink 1 ) ( iteration ) | ( sink 2 ) \ ( sink 3 ) ( cross = > next partial solution )

public void test closure ( ) { execution environment env = execution environment get execution environment ( ) ; env set parallelism ( default parallelism ) ; data set < long > source a = env generate sequence ( 0 , 1 ) ; data set < long > source b = env generate sequence ( 0 , 1 ) ; source a output ( new discarding output format < long > ( ) ) ; source b output ( new discarding output format < long > ( ) ) ; iterative data set < long > loop head = source a iterate ( 10 ) name ( " loop " ) ; data set < long > loop tail = loop head cross ( source b ) with ( new identity crosser < long > ( ) ) ; data set < long > loop res = loop head close with ( loop tail ) ; loop res output ( new discarding output format < long > ( ) ) ; plan plan = env create program plan ( ) ; try { compile no stats ( plan ) ; } catch ( exception e ) { e print stack trace ( ) ; assert fail ( e get message ( ) ) ; } }


public void test replace value null pointer exception ( ) { concurrent map c = map ( ) ; try { c replace ( null , one , " whatever " ) ; should throw ( ) ; } catch ( null pointer exception success ) { } }


returns whether the given partition is available

boolean is available ( intermediate result partition i d result partition i d ) ;


return whether the config value is the default or if it ' s been explicitly set

public boolean is default ( ) { return source = = config source default config ; }


put user { username } : updated user this can only be done by the logged in user

default mono < response entity < void > > update user ( string username , mono < user > body , server web exchange exchange ) { mono < void > result = mono empty ( ) ; exchange get response ( ) set status code ( http status not implemented ) ; return result then ( mono empty ( ) ) ; }


get the disabled administrative monitors

public set < string > get disabled administrative monitors ( ) { synchronized ( this disabled administrative monitors ) { return new hash set < > ( disabled administrative monitors ) ; } }


returns the { @ link stream operator factory } of this { @ code legacy sink transformation }

public stream operator factory < object > get operator factory ( ) { return operator factory ; }


returns a string , of length at least { @ code min length } , consisting of { @ code string } prepended with as many copies of { @ code pad char } as are necessary to reach that length for example , { @ code pad start ( " 7 " , 3 , ' 0 ' ) } returns { @ code " 007 " } { @ code pad start ( " 2010 " , 3 , ' 0 ' ) } returns { @ code " 2010 " } see { @ link java util formatter } for a richer set of formatting capabilities

public static string pad start ( string string , int min length , char pad char ) { check not null ( string ) ; / / eager for gwt if ( string length ( ) > = min length ) { return string ; } string builder sb = new string builder ( min length ) ; for ( int i = string length ( ) ; i < min length ; i + + ) { sb append ( pad char ) ; } sb append ( string ) ; return sb to string ( ) ; }


convert oas callback object to codegen callback object

public codegen callback from callback ( string name , callback callback , list < server > servers ) { codegen callback c = new codegen callback ( ) ; c name = name ; if ( callback get extensions ( ) ! = null & & ! callback get extensions ( ) is empty ( ) ) { c vendor extensions put all ( callback get extensions ( ) ) ; } callback for each ( ( expression , pi ) - > { codegen callback url u = new codegen callback url ( ) ; u expression = expression ; if ( pi get extensions ( ) ! = null & & ! pi get extensions ( ) is empty ( ) ) { u vendor extensions put all ( pi get extensions ( ) ) ; } stream of ( pair of ( " get " , pi get get ( ) ) , pair of ( " head " , pi get head ( ) ) , pair of ( " put " , pi get put ( ) ) , pair of ( " post " , pi get post ( ) ) , pair of ( " delete " , pi get delete ( ) ) , pair of ( " patch " , pi get patch ( ) ) , pair of ( " options " , pi get options ( ) ) ) filter ( p - > p get value ( ) ! = null ) for each ( p - > { string method = p get key ( ) ; operation op = p get value ( ) ; boolean gen id = op get operation id ( ) = = null ; if ( gen id ) { op set operation id ( get or generate operation id ( op , c name + " " + expression replace all ( " \ \ { \ \ $ * } " , " " ) , method ) ) ; } if ( op get extensions ( ) = = null ) { op set extensions ( new hash map < > ( ) ) ; } / / this extension will be removed later by ` from operation ( ) ` as it is only needed here to / / distinguish between normal operations and callback requests op get extensions ( ) put ( " x - callback - request " , true ) ; codegen operation co = from operation ( expression , method , op , servers ) ; if ( gen id ) { co operation id original = null ; / / legacy ( see ` from operation ( ) ` ) co nickname = co operation id ; } u requests add ( co ) ; } ) ; c urls add ( u ) ; } ) ; return c ; }


replaces the root group this can be useful , for example , to subclass the root group to be notified by { @ link group # children changed ( ) }

public void set root ( group root ) { if ( root parent ! = null ) root parent remove actor ( root , false ) ; this root = root ; root set parent ( null ) ; root set stage ( this ) ; }


normalize the triangle listing such that for each result ( k0 , k1 , k2 ) the vertex i ds are sorted k0 < k1 < k2

public triangle listing base < k , vv , ev , r > set sort triangle vertices ( boolean sort triangle vertices ) { this sort triangle vertices set ( sort triangle vertices ) ; return this ; }


the response resources wrapped in the common mcp resource message < code > repeated istio mcp v 1alpha 1 resource resources = 2 ; < code >

public java util list < com alibaba nacos istio model mcp resource > get resources list ( ) { return resources ; }


public app store entry get ( @ path param ( " id " ) string id ) { app catalog solr client sc = new app catalog solr client ( ) ; return sc find app store entry ( id ) ; }


add the object property at the given offset

void add saveable object ( short offset , saveable value ) { add key ( offset ) ; int row = get row ( offset , true ) ; value save ( new object storage adapter ( table , row ) ) ; }


similar to the previous test , change the percentage value to understand the performance of the mixed approach more specifically , this test takes the approach that , it uses old approach for the first try , only if the old approach failed in the first try , it makes another call with the new approach there is no comparison within this test

public void test percentage storage type with mixed topology ( ) throws exception { double percentage = 0 9 ; for ( int i = 0 ; i < node num ; i + + ) { if ( coin flip ( percentage ) ) { types [ i ] = storage type archive ; } else { types [ i ] = storage type disk ; } } add node by types ( types ) ; / / wait a bit for things to become stable thread sleep ( 1000 ) ; print mem usage ( " before test 1 " ) ; total start = system nano time ( ) ; total trials = 0 ; for ( int i = 0 ; i < op num ; i + + ) { / / mimic the behavior of current code : / / 1 choose random on network topology / / 2 if it satisfies , we are good , do the next operation / / 3 if not , choose random on d f s network topology local start = system nano time ( ) ; total trials + = 1 ; node = cluster choose random ( " " , excluded ) ; assert not null ( node ) ; if ( ! is type ( node , storage type archive ) ) { total trials + = 1 ; excluded add ( node ) ; node = dfscluster choose random with storage type ( " " , excluded , storage type archive ) ; } assert true ( is type ( node , storage type archive ) ) ; excluded clear ( ) ; local end = system nano time ( ) ; records [ i ] = local end - local start ; } total end = system nano time ( ) ; total ms = ( total end - total start ) / ns to ms ; log info ( " total time : { } avg time : { } avg trials : { } " , total ms , total ms / op num , ( float ) total trials / op num ) ; / / wait a bit for things to become stable thread sleep ( 1000 ) ; print mem usage ( " test storage type with mixed topology " ) ; }


protected void check part handles ( map < integer , part handle > part handles ) { check argument ( ! part handles is empty ( ) , " empty upload " ) ; part handles key set ( ) stream ( ) for each ( key - > check argument ( key > 0 , " invalid part handle index % s " , key ) ) ; }


creates a raw read - only database file from a packed database this file is useful for including in a distribution

protected void create raw file ( ) { fid file fid file = ask choice ( " choose destination fid db " , " please choose the destination fid db for population " , fid file manager get user added files ( ) , null ) ; if ( fid file = = null ) { return ; } ghidra file chooser chooser = new ghidra file chooser ( tool get tool frame ( ) ) ; chooser set title ( " where do you want to create the read - only installable database ? " ) ; chooser set file selection mode ( ghidra file chooser mode directories only ) ; file selected file = chooser get selected file ( ) ; if ( selected file = = null ) { return ; } file output file = new file ( selected file , fid file get base name ( ) + fid file fid raw database file extension ) ; try ( fid d b fid d b = fid file get fid d b ( false ) ) { fid d b save raw database file ( output file , task monitor dummy ) ; } catch ( version exception | i o exception | cancelled exception e ) { / / btw cancelled exception can ' t happen because we used a dummy monitor msg show error ( this , null , " error saving read - only installable database " , e get message ( ) , e ) ; } }


returns { @ literal true } if this type of attribute is a code attribute

public boolean is code attribute ( ) { return false ; }


returns the addresses that are to indicate the difference of this comparison type for this object

public address set get address set ( object obj , program program ) { address set addrs = new address set ( ) ; if ( obj = = null ) { return addrs ; } address addr = ( address ) obj ; code unit cu = program get listing ( ) get code unit containing ( addr ) ; if ( cu ! = null ) { addrs add range ( cu get min address ( ) , cu get max address ( ) ) ; } return addrs ; }


applies this function to three inputs , or throws an exception if unable to do so any objects that are passed to { @ link deferred closer # eventually close ( closeable , executor ) closer eventually close ( ) } will be closed when the { @ link closing future } pipeline is done ( but not before this method completes ) , even if this method throws or the pipeline is cancelled

u apply ( deferred closer closer , @ nullable decl v1 value 1 , @ nullable decl v2 value 2 , @ nullable decl v3 v 3 ) throws exception ;


default response entity < void > update user ( string username , user body ) { return new response entity < > ( http status not implemented ) ; }


like { @ link # seek to ( int ) } but uses index of the frame instead of time if < code > frame index < code > exceeds number of frames , seek stops at the end , no exception is thrown

public void seek to frame ( @ int range ( from = 0 , to = integer max value ) final int frame index ) { if ( frame index < 0 ) { throw new index out of bounds exception ( " frame index is not positive " ) ; } m executor execute ( new safe runnable ( this ) { @ override public void do work ( ) { m native info handle seek to frame ( frame index , m buffer ) ; m invalidation handler send empty message at time ( msg type invalidation , 0 ) ; } } ) ; }


register the given converter objects with the given target converter registry

public static void register converters ( @ nullable set < ? > converters , converter registry registry ) { if ( converters ! = null ) { for ( object converter : converters ) { if ( converter instanceof generic converter ) { registry add converter ( ( generic converter ) converter ) ; } else if ( converter instanceof converter < ? , ? > ) { registry add converter ( ( converter < ? , ? > ) converter ) ; } else if ( converter instanceof converter factory < ? , ? > ) { registry add converter factory ( ( converter factory < ? , ? > ) converter ) ; } else { throw new illegal argument exception ( " each converter object must implement one of the " + " converter , converter factory , or generic converter interfaces " ) ; } } } }


generate salted hash for specified message supplied salt is returned as prefix to returned hash

public static char [ ] get salted hash ( string algorithm , char [ ] salt , char [ ] msg ) { message digest message digest = get message digest ( algorithm ) ; byte [ ] msg bytes = new byte [ msg length + salt length ] ; try { for ( int i = 0 ; i < salt length ; i + + ) { msg bytes [ i ] = ( byte ) salt [ i ] ; } for ( int i = 0 ; i < msg length ; i + + ) { msg bytes [ i + salt length ] = ( byte ) msg [ i ] ; } char [ ] hash = hex dump ( message digest digest ( msg bytes ) ) ; char [ ] salted hash = new char [ hash length + salt length ] ; system arraycopy ( salt , 0 , salted hash , 0 , salt length ) ; system arraycopy ( hash , 0 , salted hash , salt length , hash length ) ; return salted hash ; } finally { / / attempt to remove message from memory since it may be a password arrays fill ( msg bytes , ( byte ) 0 ) ; } }


repositions the current { @ code reader index } to the marked { @ code reader index } in this buffer

public abstract byte buf reset reader index ( ) ;


check to see if this orc file is from a future version and if so , warn the user that we may not be able to read all of the column encodings

private static void check orc version ( orc data source orc data source , list < integer > version ) { if ( version size ( ) > = 1 ) { int major = version get ( 0 ) ; int minor = 0 ; if ( version size ( ) > 1 ) { minor = version get ( 1 ) ; } if ( major > current major version | | ( major = = current major version & & minor > current minor version ) ) { log warn ( " orc file % s was written by a newer hive version % s this file may not be readable by this version of hive ( % s % s ) " , orc data source , joiner on ( ' ' ) join ( version ) , current major version , current minor version ) ; } } }


set this to true to draw the pie center empty

public void set draw hole enabled ( boolean enabled ) { this m draw hole = enabled ; }


traverse the constructors in the language

public int traverse ( constructor entry visitor visitor ) { for ( symbol sym : lang get symbol table ( ) get symbol list ( ) ) { if ( sym instanceof subtable symbol ) { subtable symbol subtable = ( subtable symbol ) sym ; sleigh subtable traversal t = new sleigh subtable traversal ( subtable ) ; int result = t traverse ( new sub visitor ( subtable , visitor ) ) ; if ( result ! = finished ) { assert result ! = continue ; return result ; } } } return finished ; }


public file download file from response ( response response ) throws api exception { try { file file = prepare download file ( response ) ; buffered sink sink = okio buffer ( okio sink ( file ) ) ; sink write all ( response body ( ) source ( ) ) ; sink close ( ) ; return file ; } catch ( i o exception e ) { throw new api exception ( e ) ; } }


returns a doc id set per segments containing the matching docs for the specified slice

private doc id set build ( leaf reader reader ) throws i o exception { final doc id set builder builder = new doc id set builder ( reader max doc ( ) ) ; final terms terms = reader terms ( get field ( ) ) ; if ( terms = = null ) { return doc id set empty ; } final terms enum te = terms iterator ( ) ; postings enum docs enum = null ; for ( bytes ref term = te next ( ) ; term ! = null ; term = te next ( ) ) { / / use a fixed seed instead of term hash code ( ) otherwise this query may return inconsistent results when / / running on another replica ( string helper sets its default seed at startup with current time ) int hash code = string helper murmurhash 3 x 8 6 32 ( term , seed ) ; if ( contains ( hash code ) ) { docs enum = te postings ( docs enum , postings enum none ) ; builder add ( docs enum ) ; } } return builder build ( ) ; }


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

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


we would have liked renames across file system to fail but unfortunately there is not way to distinguish the two file systems

public void test rename across fs ( ) throws i o exception { fc mkdir ( new path ( " / new dir / dir foo " ) , file context default perm , true ) ; / / the root will get interpreted to the root of the chrooted fs fc rename ( new path ( " / new dir / dir foo " ) , new path ( " file : / / / dir foo bar " ) ) ; file context test helper is dir ( fc , new path ( " / dir foo bar " ) ) ; }


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


verify that the datanode uuid has been initialized if this is a new datanode then we generate a new datanode uuid and persist it to disk

synchronized void check datanode uuid ( ) throws i o exception { if ( storage get datanode uuid ( ) = = null ) { storage set datanode uuid ( generate uuid ( ) ) ; storage write all ( ) ; log info ( " generated and persisted new datanode uuid { } " , storage get datanode uuid ( ) ) ; } }


calculate all filenames for the given bundle basename and locale will calculate filenames for the given locale , the system locale ( if applicable ) , and the default file

protected list < string > calculate all filenames ( string basename , locale locale ) { map < locale , list < string > > locale map = this cached filenames get ( basename ) ; if ( locale map ! = null ) { list < string > filenames = locale map get ( locale ) ; if ( filenames ! = null ) { return filenames ; } } / / filenames for given locale list < string > filenames = new array list < > ( 7 ) ; filenames add all ( calculate filenames for locale ( basename , locale ) ) ; / / filenames for default locale , if any locale default locale = get default locale ( ) ; if ( default locale ! = null & & ! default locale equals ( locale ) ) { list < string > fallback filenames = calculate filenames for locale ( basename , default locale ) ; for ( string fallback filename : fallback filenames ) { if ( ! filenames contains ( fallback filename ) ) { / / entry for fallback locale that isn ' t already in filenames list filenames add ( fallback filename ) ; } } } / / filename for default bundle file filenames add ( basename ) ; if ( locale map = = null ) { locale map = new concurrent hash map < > ( ) ; map < locale , list < string > > existing = this cached filenames put if absent ( basename , locale map ) ; if ( existing ! = null ) { locale map = existing ; } } locale map put ( locale , filenames ) ; return filenames ; }


public map < string , inner enum > get map of enum string ( ) { return map of enum string ; }


required the ports associated with the external service if the endpoints are unix domain socket addresses , there must be exactly one port < code > repeated istio networking v 1alpha 3 port ports = 3 ; < code >

public builder set ports ( int index , com alibaba nacos istio model port builder builder for value ) { if ( ports builder = = null ) { ensure ports is mutable ( ) ; ports set ( index , builder for value build ( ) ) ; on changed ( ) ; } else { ports builder set message ( index , builder for value build ( ) ) ; } return this ; }


copies the characters in this string to a character array

public char [ ] to char array ( int start , int end ) { int length = end - start ; if ( length = = 0 ) { return empty arrays empty chars ; } if ( is out of bounds ( start , length , length ( ) ) ) { throw new index out of bounds exception ( " expected : " + " 0 < = start ( " + start + " ) < = src idx + length ( " + length + " ) < = src len ( " + length ( ) + ' ) ' ) ; } final char [ ] buffer = new char [ length ] ; for ( int i = 0 , j = start + array offset ( ) ; i < length ; i + + , j + + ) { buffer [ i ] = b 2c ( value [ j ] ) ; } return buffer ; }


returns the { @ link pixmap } for upload by texture a call to { @ link # prepare ( ) } must precede a call to this method any internal data structures created in { @ link # prepare ( ) } should be disposed of here


returns a copy of this request builder with all of the options put so far on this builder this method returns a " deep " copy in that all non - immutable arguments are copied such that changes to one builder will not affect the other builder however , in addition to immutable arguments , the current model is not copied copied so changes to the model will affect both builders even if this object was locked , the cloned object returned from this method will not be locked

public t clone ( ) { try { base request options < ? > result = ( base request options < ? > ) super clone ( ) ; result options = new options ( ) ; result options put all ( options ) ; result transformations = new cached hash code array map < > ( ) ; result transformations put all ( transformations ) ; result is locked = false ; result is auto clone enabled = false ; return ( t ) result ; } catch ( clone not supported exception e ) { throw new runtime exception ( e ) ; } }


browser service performance related source

browser app perf to browser app perf ( ) { browser app perf perf = new browser app perf ( ) ; perf set name ( service ) ; to browser app perf source ( perf ) ; return perf ; }


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


this tests the scenario where put index { " settings " : { " number of replicas " : 0 , " number of shards " : 1 } } put index settings { " number of replicas " : 1 , " index routing allocation include id " : " { node - name } " }

public void test execute replicas not allocated on single node ( ) { index index = new index ( random alpha of length between ( 1 , 20 ) , random alpha of length between ( 1 , 20 ) ) ; map < string , string > requires = collections singleton map ( " id " , " node 1 " ) ; settings builder existing settings = settings builder ( ) put ( index metadata setting version created , version current id ) put ( index metadata index routing require group prefix + " id " , " node 1 " ) put ( index metadata setting index uuid , index get u u i d ( ) ) ; settings builder expected settings = settings builder ( ) ; settings builder node 1 settings = settings builder ( ) ; settings builder node 2 settings = settings builder ( ) ; requires for each ( ( k , v ) - > { expected settings put ( index metadata index routing require group setting get key ( ) + k , v ) ; } ) ; index routing table builder index routing table = index routing table builder ( index ) add shard ( test shard routing new shard routing ( new shard id ( index , 0 ) , " node 1 " , true , shard routing state started ) ) add shard ( test shard routing new shard routing ( new shard id ( index , 1 ) , " node 1 " , false , shard routing state started ) ) add shard ( test shard routing new shard routing ( new shard id ( index , 1 ) , " node 2 " , true , shard routing state started ) ) add shard ( test shard routing new shard routing ( new shard id ( index , 0 ) , null , null , false , shard routing state unassigned , new unassigned info ( unassigned info reason replica added , " no attempt " ) ) ) ; check shrink ready step step = create random instance ( ) ; assert allocate status ( index , 2 , 1 , step , existing settings , node 1 settings , node 2 settings , index routing table , new cluster state wait step result ( true , null ) ) ; }


tries to replace an instruction with a const instruction the given instruction must have a constant result for it to be replaced

private boolean try replacing with constant ( normal ssa insn insn ) { insn original rop insn = insn get original rop insn ( ) ; rop opcode = original rop insn get opcode ( ) ; register spec result = insn get result ( ) ; if ( result ! = null & & ! ssa meth is reg a local ( result ) & & opcode get opcode ( ) ! = reg ops const ) { type bearer type = insn get result ( ) get type bearer ( ) ; if ( type is constant ( ) & & type get basic type ( ) = = type bt int ) { / / replace the instruction with a constant replace plain insn ( insn , register spec list empty , reg ops const , ( constant ) type ) ; / / remove the source as well if this is a move - result - pseudo if ( opcode get opcode ( ) = = reg ops move result pseudo ) { int pred = insn get block ( ) get predecessors ( ) next set bit ( 0 ) ; array list < ssa insn > pred insns = ssa meth get blocks ( ) get ( pred ) get insns ( ) ; normal ssa insn source insn = ( normal ssa insn ) pred insns get ( pred insns size ( ) - 1 ) ; replace plain insn ( source insn , register spec list empty , reg ops goto , null ) ; } return true ; } } return false ; }


public void test include binary variables ( ) throws exception { / / start process with a binary variable process instance process instance = runtime service start process instance by key ( " one task process " , singleton map ( " binary variable " , ( object ) " it is i , le binary " get bytes ( ) ) ) ; process instance = runtime service create process instance query ( ) process instance id ( process instance get id ( ) ) include process variables ( ) single result ( ) ; assert that ( process instance ) is not null ( ) ; / / query process , including variables byte [ ] bytes = ( byte [ ] ) process instance get process variables ( ) get ( " binary variable " ) ; assert that ( new string ( bytes ) ) is equal to ( " it is i , le binary " ) ; }


sets the settings selected tab of this m t config object

public void set settings selected tab ( final integer settings selected tab ) { this settings selected tab = settings selected tab ; }


returns the composition of a function and a predicate for every { @ code x } , the generated predicate returns { @ code predicate ( function ( x ) ) }

public static < a , b > predicate < a > compose ( predicate < b > predicate , function < a , ? extends b > function ) { return new composition predicate < > ( predicate , function ) ; }


returns true if field corresponding to field i d is set ( has been assigned a value ) and false otherwise

public boolean is set ( fields field ) { if ( field = = null ) { throw new illegal argument exception ( ) ; } switch ( field ) { case name : return is set name ( ) ; case options : return is set options ( ) ; } throw new illegal state exception ( ) ; }


reads the serialized { @ link data key } and { @ link data value } to the { @ link key value consumers }

public void read ( dependency info dependency info , path in path , key value consumers consumers ) { stopwatch timer = stopwatch create started ( ) ; try ( input stream in = files new input stream ( in path , standard open option read ) ) { file system current file system = in path get file system ( ) ; header header = header parse delimited from ( in ) ; if ( header = = null ) { throw new deserialization exception ( " no header found in " + in path ) ; } read entries segment ( consumers , in , current file system , header ) ; } catch ( i o exception e ) { throw new deserialization exception ( " error deserializing " + in path , e ) ; } finally { logger fine ( string format ( " deserialized in merged in % sms " , timer elapsed ( time unit milliseconds ) ) ) ; } }


returns all the registered { @ link saveable listener } descriptors

public static extension list < saveable listener > all ( ) { return extension list lookup ( saveable listener class ) ; }


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

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


set the target connection factory that this connection factory should delegate to

public final void set target connection factory ( connection factory target connection factory ) { assert not null ( target connection factory , " ' target connection factory ' must not be null " ) ; this target connection factory = target connection factory ; }


this supplier is used for all the field types that should be aggregated as bytesstrings , including those that need global ordinals

private static terms aggregator supplier bytes supplier ( ) { return new terms aggregator supplier ( ) { @ override public aggregator build ( string name , aggregator factories factories , values source values source , bucket order order , doc value format format , terms aggregator bucket count thresholds bucket count thresholds , include exclude include exclude , string execution hint , aggregation context context , aggregator parent , sub agg collection mode sub agg collect mode , boolean show term doc count error , cardinality upper bound cardinality , map < string , object > metadata ) throws i o exception { execution mode execution = null ; if ( execution hint ! = null ) { execution = execution mode from string ( execution hint ) ; } / / in some cases , using ordinals is just not supported : override it if ( values source instanceof values source bytes with ordinals = = false ) { execution = execution mode map ; } if ( execution = = null ) { execution = execution mode global ordinals ; } final long max ord = execution = = execution mode global ordinals ? get max ord ( values source , context searcher ( ) ) : - 1 ; if ( sub agg collect mode = = null ) { sub agg collect mode = pick sub agg colect mode ( factories , bucket count thresholds get shard size ( ) , max ord ) ; } if ( ( include exclude ! = null ) & & ( include exclude is regex based ( ) ) & & format ! = doc value format raw ) { / / todo this exception message is not really accurate for the string case it ' s really disallowing regex + formatter throw new aggregation execution exception ( " aggregation [ " + name + " ] cannot support regular expression style " + " include / exclude settings as they can only be applied to string fields use an array of values for " + " include / exclude clauses " ) ; } / / todo : [ zach ] we might want refactor and remove execution mode # create ( ) , moving that logic outside the enum return execution create ( name , factories , values source , order , format , bucket count thresholds , include exclude , context , parent , sub agg collect mode , show term doc count error , cardinality , metadata ) ; } } ; }


releases the lock on the specific state handle so that it could be deleted by other { @ link state handle store } if no lock exists or the underlying storage does not support , nothing will happen

void release ( string name ) throws exception ;


protected abstract string get signing key setting ( ) ;


deserialize each valid { @ link debug data } stream , based upon valid stream numbers found while parsing the { @ link debug data } header

public void deserialize ( task monitor monitor ) throws pdb exception , cancelled exception , i o exception { if ( debug streams is empty ( ) ) { throw new pdb exception ( " debug data header had not been deserialized at the appropriate time " ) ; } for ( debug type dbg : debug type values ( ) ) { int stream num = debug streams get ( dbg get value ( ) ) ; if ( stream num = = 0xffff ) { continue ; } switch ( dbg ) { case frame pointer omission : deserialize frame pointer omission data ( stream num , monitor ) ; break ; case exception : / / todo : implement break ; case fixup : / / todo : implement break ; case omap to source : / / omap to source = deserialize o map ( stream num , monitor ) ; break ; case omap from source : omap from source = deserialize o map ( stream num , monitor ) ; break ; case section header : image section headers = deserialize section headers ( stream num , monitor ) ; break ; case token rid map : / / todo : implement break ; case x data : deserialize x data ( stream num , monitor ) ; break ; case p data : deserialize p data ( stream num , monitor ) ; break ; case new frame pointer omission : / / todo : implement break ; case section header orig : image section headers orig = deserialize section headers ( stream num , monitor ) ; break ; } } }


gets the non - cropped post - scaling bounds of the actual image

public void get actual image bounds ( rect f out bounds ) { m actual image wrapper get transformed bounds ( out bounds ) ; }


return the endpoint address to specify on the stub

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


a sensible definition of { @ link # contains value } in terms of the { @ code iterator } method of { @ link # entry set } if you override { @ link # entry set } , you may wish to override { @ link # contains value } to forward to this implementation

protected boolean standard contains value ( @ nullable object value ) { return maps contains value impl ( this , value ) ; }


returns the requested variable by name if found within this scope otherwise , requests the variable from the parent scope

public variable get variable ( location location , string name ) { objects require non null ( location ) ; objects require non null ( name ) ; variable variable = variables get ( name ) ; if ( variable = = null ) { variable = parent get variable ( location , name ) ; } else { used variables add ( name ) ; } return variable ; }


public list < pending cluster task > get pending tasks ( ) { return pending tasks ( ) ; }


adds the given keyvalue pair to the configuration object

public void set boolean ( string key , boolean value ) { set value internal ( key , value ) ; }


inspect initial headers to make sure they conform to http and g r p c , returning a { @ code status } on failure

private status validate initial metadata ( metadata headers ) { integer http status = headers get ( http2 status ) ; if ( http status = = null ) { return status internal with description ( " missing http status code " ) ; } string content type = headers get ( grpc util content type key ) ; if ( ! grpc util is grpc content type ( content type ) ) { return grpc util http status to grpc status ( http status ) augment description ( " invalid content - type : " + content type ) ; } return null ; }


get the time in milliseconds this task took

public long get time millis ( ) { return nanos to millis ( this time nanos ) ; }


{ @ inherit doc } the default implementation does nothing

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


add all property values from the given map

public mutable property values add property values ( @ nullable map < ? , ? > other ) { if ( other ! = null ) { other for each ( ( attr name , attr value ) - > add property value ( new property value ( attr name to string ( ) , attr value ) ) ) ; } return this ; }


returns a collection of all the module root directories a module root directory is the top - level directory of a module

public static collection < resource file > get module root directories ( ) { check app initialized ( ) ; list < resource file > list = new array list < > ( ) ; collection < g module > values = app layout get modules ( ) values ( ) ; for ( g module g module : values ) { list add ( g module get module root ( ) ) ; } return list ; }


create a new aws { @ code client configuration } all clients to aws services must use this for consistent setup of connectivity , ua , proxy settings

public static client configuration create aws conf ( configuration conf , string bucket ) throws i o exception { return create aws conf ( conf , bucket , null ) ; }


public void test indexed ( ) throws exception { directory dir = new directory ( ) ; index writer config iwc = new index writer config ( null ) ; index writer iw = new index writer ( dir , iwc ) ; / / add document with 2 fields document doc = new document ( ) ; doc add ( new string field ( " field a " , " test " , field store no ) ) ; doc add ( new string field ( " field b " , " test " , field store no ) ) ; iw add document ( doc ) ; / / open reader directory reader ir = field subset reader wrap ( directory reader open ( iw ) , new character run automaton ( automata make string ( " field a " ) ) ) ; / / see only one field leaf reader segment reader = ir leaves ( ) get ( 0 ) reader ( ) ; set < string > seen fields = new hash set < > ( ) ; for ( field info info : segment reader get field infos ( ) ) { seen fields add ( info name ) ; } assert equals ( collections singleton ( " field a " ) , seen fields ) ; assert not null ( segment reader terms ( " field a " ) ) ; assert null ( segment reader terms ( " field b " ) ) ; test util check reader ( ir ) ; i o utils close ( ir , iw , dir ) ; }


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


to test class name in snake case to test class name in snake case < b > 200 < b > - successful operation

public client test classname ( client body , map < string , object > params ) throws i o exception { http response response = test classname for http response ( body , params ) ; type reference < client > type ref = new type reference < client > ( ) { } ; return api client get object mapper ( ) read value ( response get content ( ) , type ref ) ; }


public boolean is prefix ns boolean ( ) { return prefix ns boolean ; }


test the state machine transition we use separate test methods instead of a single one because the mocked { @ link # fsn } is accessed concurrently by the current thread and the < code > smmthread < code > thread in the { @ link block manager safe mode } stubbing or verification of a shared mock from different threads is not the proper way of testing , which leads to intermittent behavior meanwhile , previous state transition may have side effects that should be reset before next test case for example , in { @ link block manager safe mode } , there is a safe mode monitor thread , which is created when block manager safe mode is constructed it will start the first time the safe mode enters extension stage and will stop if the safe mode leaves to off state across different test cases , this thread should be reset

public void test check safe mode 1 ( ) { / / stays in pending threshold : pending block threshold bm safe mode activate ( block total ) ; set safe mode status ( b m safe mode status pending threshold ) ; for ( long i = 0 ; i < block threshold ; i + + ) { set block safe ( i ) ; bm safe mode check safe mode ( ) ; assert equals ( b m safe mode status pending threshold , get safe mode status ( ) ) ; } }


return the first readable image file for the given txid and image type , or null if no such image can be found

file find image file ( name node file nnf , long txid ) { return find file ( name node dir type image , get name node file name ( nnf , txid ) ) ; }


execute a query given static sql , reading the result set with a result set extractor uses a jdbc statement , not a prepared statement if you want to execute a static query with a prepared statement , use the overloaded { @ code query } method with { @ code null } as argument array

< t > t query ( string sql , result set extractor < t > rse ) throws data access exception ;


public void add next value ( object val ) { string val count str = val to string ( ) ; int pos = val count str last index of ( " \ t " ) ; string val str = val count str ; string count str = " 1 " ; if ( pos > = 0 ) { val str = val count str substring ( 0 , pos ) ; count str = val count str substring ( pos + 1 ) ; } long count = ( long ) this items get ( val str ) ; long inc = long parse long ( count str ) ; if ( count = = null ) { count = inc ; } else { count = count long value ( ) + inc ; } items put ( val str , count ) ; }


public void add container ( container container ) { containers add ( container ) ; }


returns the keyed object with the specified key in this key indexable set returns null if the set contains no object with that key

public t get keyed object ( long key ) ;


a utility that tests serializationdeserialization

public static < k > k test serialization ( configuration conf , k before ) throws exception { serialization factory factory = new serialization factory ( conf ) ; serializer < k > serializer = factory get serializer ( generics util get class ( before ) ) ; deserializer < k > deserializer = factory get deserializer ( generics util get class ( before ) ) ; data output buffer out = new data output buffer ( ) ; serializer open ( out ) ; serializer serialize ( before ) ; serializer close ( ) ; data input buffer in = new data input buffer ( ) ; in reset ( out get data ( ) , out get length ( ) ) ; deserializer open ( in ) ; k after = deserializer deserialize ( null ) ; deserializer close ( ) ; return after ; }


public long get number of vertices ( ) { return vertex count ; }


enforces the content - type to be applicationoctet - stream for post and put requests

public void do filter ( servlet request request , servlet response response , filter chain chain ) throws i o exception , servlet exception { boolean content type o k = true ; http servlet request http req = ( http servlet request ) request ; http servlet response http res = ( http servlet response ) response ; string method = http req get method ( ) ; if ( method equals ( " put " ) | | method equals ( " post " ) ) { string op = http req get parameter ( http f s file system op param ) ; if ( op ! = null & & upload operations contains ( string utils to upper case ( op ) ) ) { if ( " true " equals ignore case ( http req get parameter ( http f s parameters provider data param name ) ) ) { string content type = http req get content type ( ) ; content type o k = http f s file system upload content type equals ignore case ( content type ) ; } } } if ( content type o k ) { chain do filter ( http req , http res ) ; } else { http res send error ( http servlet response sc bad request , " data upload requests must have content - type set to ' " + http f s file system upload content type + " ' " ) ; } }


set the set of allowed { @ link http method http methods } , as specified by the { @ code allow } header

b allow ( set < http method > allowed methods ) ;


get pet { pet id } : find pet by id returns a single pet

default response entity < pet > get pet by id ( @ api param ( value = " id of pet to return " , required = true ) @ path variable ( " pet id " ) long pet id ) { get request ( ) if present ( request - > { for ( media type media type : media type parse media types ( request get header ( " accept " ) ) ) { if ( media type is compatible with ( media type value of ( " application / json " ) ) ) { string example string = " { \ " photo urls \ " : [ \ " photo urls \ " , \ " photo urls \ " ] , \ " name \ " : \ " doggie \ " , \ " id \ " : 0 , \ " category \ " : { \ " name \ " : \ " default - name \ " , \ " id \ " : 6 } , \ " tags \ " : [ { \ " name \ " : \ " name \ " , \ " id \ " : 1 } , { \ " name \ " : \ " name \ " , \ " id \ " : 1 } ] , \ " status \ " : \ " available \ " } " ; api util set example response ( request , " application / json " , example string ) ; break ; } if ( media type is compatible with ( media type value of ( " application / xml " ) ) ) { string example string = " < pet > < id > 123456789 < / id > < name > doggie < / name > < photo urls > < photo urls > aeiou < / photo urls > < / photo urls > < tags > < / tags > < status > aeiou < / status > < / pet > " ; api util set example response ( request , " application / xml " , example string ) ; break ; } } } ) ; return new response entity < > ( http status not implemented ) ; }


public static string pretty format ( big decimal number ) { return pretty format ( number double value ( ) ) ; }


public checkpointing mode get checkpoint mode ( ) { return stream config get checkpoint mode ( ) ; }


find the program address at which a specified offset within a section or segment was loadedresolved

address find load address ( memory loadable section , long byte offset within section ) ;


protected void init object readers ( ) { this object readers clear ( ) ; if ( ! this register defaults ) { return ; } if ( kotlin serialization json present ) { add codec ( this object readers , new decoder http message reader < > ( get kotlin serialization json decoder ( ) ) ) ; } if ( jackson 2 present ) { add codec ( this object readers , new decoder http message reader < > ( get jackson 2 json decoder ( ) ) ) ; } if ( jackson 2 smile present ) { add codec ( this object readers , new decoder http message reader < > ( this jackson 2 smile decoder ! = null ? ( jackson 2 smile decoder ) this jackson 2 smile decoder : new jackson 2 smile decoder ( ) ) ) ; } if ( jaxb 2 present & & ! should ignore xml ) { add codec ( this object readers , new decoder http message reader < > ( this jaxb 2 decoder ! = null ? ( jaxb 2 xml decoder ) this jaxb 2 decoder : new jaxb 2 xml decoder ( ) ) ) ; } / / client vs server extend object readers ( this object readers ) ; }


tries to delete all blobs for the given job from storage note : this also tries to delete any created directories if empty


the evaluate function performs the core authorization mechanism of cel - based authorization engine it determines whether a g r p c call is allowed , denied , or unable to be decided

public authorization decision evaluate ( evaluate args args ) { list < string > unknown policy names = new array list < > ( ) ; / / set up activation used in cel library ' s eval function activation activation = activation copy of ( args generate envoy attributes ( ) ) ; / / iterate through deny engine ' s map / / if there is match , immediately return deny / / if there are unknown conditions , return unknown / / if all non - match , then iterate through allow engine if ( deny engine ! = null ) { authorization decision authz decision = evaluate engine ( deny engine conditions entry set ( ) , authorization decision output deny , unknown policy names , activation ) ; if ( authz decision ! = null ) { return authz decision ; } if ( ! unknown policy names is empty ( ) ) { return new authorization decision ( authorization decision output unknown , unknown policy names ) ; } } / / once we enter allow engine , if there is a match , immediately return allow / / in the end of iteration , if there are unknown conditions , return unknown / / if all non - match , return deny if ( allow engine ! = null ) { authorization decision authz decision = evaluate engine ( allow engine conditions entry set ( ) , authorization decision output allow , unknown policy names , activation ) ; if ( authz decision ! = null ) { return authz decision ; } if ( ! unknown policy names is empty ( ) ) { return new authorization decision ( authorization decision output unknown , unknown policy names ) ; } } / / return allow if it only has a deny engine and it ’ s unmatched if ( this allow engine = = null & & this deny engine ! = null ) { return new authorization decision ( authorization decision output allow , new array list < string > ( ) ) ; } / / return deny if none of deny engine and allow engine matched , / / or the single allow engine is unmatched when there is only one allow engine return new authorization decision ( authorization decision output deny , new array list < string > ( ) ) ; }


public static result code get ( int ordinal ) { for ( result code result code : result code values ( ) ) { if ( result code ordinal ( ) = = ordinal ) { return result code ; } } throw new illegal argument exception ( " unknown result code [ " + ordinal + " ] " ) ; }


builds a new acl entry populated with the set properties

public acl entry build ( ) { return new acl entry ( type , name , permission , scope ) ; }


determine whether a { @ link reader } is required as opposed to an { @ link input stream } , i e whether an { @ linkplain # get encoding ( ) encoding } or a { @ link # get charset ( ) charset } has been specified

public boolean requires reader ( ) { return ( this encoding ! = null | | this charset ! = null ) ; }


gets the remaining splits that this assigner has pending


attempts to parse the watermark into a percentage , returning 100 0 % if it cannot be parsed

private static double threshold percentage from watermark ( string watermark ) { return threshold percentage from watermark ( watermark , true ) ; }


there is a nested folder and file under the folder to be renamed and the process crashes after the nested folder has been renamed but not the file then when you list the parent folder , pending renames should be redone apache jira hadoop - 12780

public void test redo rename folder rename in progress ( ) throws i o exception { / / create original folder string parent = " parent " ; path parent folder = new path ( parent ) ; assert true ( fs mkdirs ( parent folder ) ) ; path folder to be renamed = new path ( parent folder , " folder to be renamed " ) ; assert true ( fs mkdirs ( folder to be renamed ) ) ; string inner folder name = " inner folder " ; path inner = new path ( folder to be renamed , inner folder name ) ; assert true ( fs mkdirs ( inner ) ) ; string inner file name = " file " ; path inner file = new path ( inner , inner file name ) ; assert true ( fs create new file ( inner file ) ) ; path renamed folder = new path ( parent folder , " renamed folder " ) ; / / propose ( but don ' t do ) the rename of inner folder 2 path home = fs get home directory ( ) ; string relative home dir = get relative path ( home to string ( ) ) ; native azure file system folder rename pending pending = new native azure file system folder rename pending ( relative home dir + " / " + folder to be renamed , relative home dir + " / " + renamed folder , null , ( native azure file system ) fs ) ; / / create a rename - pending file and write rename information to it final string rename pending str = folder to be renamed + folder rename pending suffix ; path rename pending file = new path ( rename pending str ) ; f s data output stream out = fs create ( rename pending file , true ) ; assert true ( out ! = null ) ; write string to stream ( out , pending make rename pending file contents ( ) ) ; / / rename inner folder to simulate the scenario where rename has started and / / only one directory has been renamed but not the files under it ( ( native azure file system ) fs ) get store interface ( ) rename ( relative home dir + " / " + inner , relative home dir + " / " + renamed folder + " / " + inner folder name , true , null ) ; / / instead of using fs exist use store explicit file exists because fs exist will return true / / even if directory has been renamed , but there are still file under that directory assert false ( ( ( native azure file system ) fs ) get store interface ( ) explicit file exists ( relative home dir + " / " + inner ) ) ; / / verify the explicit inner folder is gone assert true ( ( ( native azure file system ) fs ) get store interface ( ) explicit file exists ( relative home dir + " / " + inner file ) ) ; / / verify inner file is present / / redo the rename operation based on the contents of the / / - rename pending json file trigger the redo by checking for existence of / / the original folder it must appear to not exist file status [ ] listed = fs list status ( parent folder ) ; assert equals ( 1 , listed length ) ; assert true ( listed [ 0 ] is directory ( ) ) ; / / the rename pending file is not a directory , so at this point we know the / / redo has been done assert false ( fs exists ( inner ) ) ; / / verify original folder is gone assert false ( fs exists ( inner file ) ) ; / / verify original file is gone assert true ( fs exists ( renamed folder ) ) ; / / verify the target is there assert true ( fs exists ( new path ( renamed folder , inner folder name + " / " + inner file name ) ) ) ; }


returns the number of { @ link executor } s this may be different from { @ code get executors ( ) size ( ) } because it takes time to adjust the number of executors

public abstract int get num executors ( ) ;


returns the artifacts included on the runtime classpath of this binary

public depset / * < artifact > * / get runtime classpath ( ) { return depset of ( artifact type , runtime classpath ) ; }


assigns to { @ code input } a " bucket " in the range { @ code [ 0 , buckets ) } , in a uniform manner that minimizes the need for remapping as { @ code buckets } grows that is , { @ code consistent hash ( h , n ) } equals : { @ code n - 1 } , with approximate probability { @ code 1n } { @ code consistent hash ( h , n - 1 ) } , otherwise ( probability { @ code 1 - 1n } ) this method is suitable for the common use case of dividing work among buckets that meet the following conditions : you want to assign the same fraction of inputs to each bucket when you reduce the number of buckets , you can accept that the most recently added buckets will be removed first more concretely , if you are dividing traffic among tasks , you can decrease the number of tasks from 15 and 10 , killing off the final 5 tasks , and { @ code consistent hash } will handle it if , however , you are dividing traffic among servers { @ code alpha } , { @ code bravo } , and { @ code charlie } and you occasionally need to take each of the servers offline , { @ code consistent hash } will be a poor fit : it provides no way for you to specify which of the three buckets is disappearing thus , if your buckets change from { @ code [ alpha , bravo , charlie ] } to { @ code [ bravo , charlie ] } , it will assign all the old { @ code alpha } traffic to { @ code bravo } and all the old { @ code bravo } traffic to { @ code charlie } , rather than letting { @ code bravo } keep its traffic see the < a href = " http : en wikipedia orgwiki consistent hashing " > wikipedia article on consistent hashing for more information

public static int consistent hash ( long input , int buckets ) { check argument ( buckets > 0 , " buckets must be positive : % s " , buckets ) ; linear congruential generator generator = new linear congruential generator ( input ) ; int candidate = 0 ; int next ; / / jump from bucket to bucket until we go out of range while ( true ) { next = ( int ) ( ( candidate + 1 ) / generator next double ( ) ) ; if ( next > = 0 & & next < buckets ) { candidate = next ; } else { return candidate ; } } }


returns the glibc version used by the abi we ' re using this is a glibc version number ( e g , " 2 2 2 " ) note that in practice we might be using glibc 2 2 2 as abi even when compiling with gcc - 4 2 2 , gcc - 4 3 1 , or gcc - 4 4 0 ( which use glibc 2 3 6 ) , because a b is are backwards compatible

public string get abi glibc version ( ) { return abi glibc version ; }


performs atn simulation to compute a predicted alternative based upon the remaining input , but also updates the dfa cache to avoid having to traverse the atn again for the same input sequence there are some key conditions we ' re looking for after computing a new set of atn configs ( proposed dfa state ) : if the set is empty , there is no viable alternative for current symbol does the state uniquely predict an alternative ? does the state have a conflict that would prevent us from putting it on the work list ? we also have some key operations to do : add an edge from previous dfa state to potentially new dfa state , d , upon current symbol but only if adding to work list , which means in all cases except no viable alternative ( and possibly non - greedy decisions ? ) collecting predicates and adding semantic context to dfa accept states adding rule context to context - sensitive dfa accept states consuming an input symbol reporting a conflict reporting an ambiguity reporting a context sensitivity reporting insufficient predicates cover these cases : dead end single alt single alt + preds conflict conflict + preds

protected int exec a t n ( dfa dfa , d f a state s 0 , token stream input , int start index , parser rule context outer context ) { if ( debug | | debug list atn decisions ) { system out println ( " exec a t n decision " + dfa decision + " exec la ( 1 ) = = " + get lookahead name ( input ) + " line " + input lt ( 1 ) get line ( ) + " : " + input lt ( 1 ) get char position in line ( ) ) ; } d f a state previous d = s 0 ; if ( debug ) system out println ( " s 0 = " + s 0 ) ; int t = input la ( 1 ) ; while ( true ) { / / while more work d f a state d = get existing target state ( previous d , t ) ; if ( d = = null ) { d = compute target state ( dfa , previous d , t ) ; } if ( d = = error ) { / / if any configs in previous dipped into outer context , that / / means that input up to t actually finished entry rule / / at least for sll decision full ll doesn ' t dip into outer / / so don ' t need special case / / we will get an error no matter what so delay until after / / decision ; better error message also , no reachable target / / atn states in sll implies ll will also get nowhere / / if conflict in states that dip out , choose min since we / / will get error no matter what no viable alt exception e = no viable alt ( input , outer context , previous d configs , start index ) ; input seek ( start index ) ; int alt = get syn valid or sem invalid alt that finished decision entry rule ( previous d configs , outer context ) ; if ( alt ! = atn invalid alt number ) { return alt ; } throw e ; } if ( d requires full context & & mode ! = prediction mode sll ) { / / if preds , might resolve to single alt = > sll ( or syntax error ) bit set conflicting alts = d configs conflicting alts ; if ( d predicates ! = null ) { if ( debug ) system out println ( " dfa state has preds in dfa sim ll failover " ) ; int conflict index = input index ( ) ; if ( conflict index ! = start index ) { input seek ( start index ) ; } conflicting alts = eval semantic context ( d predicates , outer context , true ) ; if ( conflicting alts cardinality ( ) = = 1 ) { if ( debug ) system out println ( " full ll avoided " ) ; return conflicting alts next set bit ( 0 ) ; } if ( conflict index ! = start index ) { / / restore the index so reporting the fallback to full / / context occurs with the index at the correct spot input seek ( conflict index ) ; } } if ( dfa debug ) system out println ( " ctx sensitive state " + outer context + " in " + d ) ; boolean full ctx = true ; a t n config set s 0 closure = compute start state ( dfa atn start state , outer context , full ctx ) ; report attempting full context ( dfa , conflicting alts , d configs , start index , input index ( ) ) ; int alt = exec a t n with full context ( dfa , d , s 0 closure , input , start index , outer context ) ; return alt ; } if ( d is accept state ) { if ( d predicates = = null ) { return d prediction ; } int stop index = input index ( ) ; input seek ( start index ) ; bit set alts = eval semantic context ( d predicates , outer context , true ) ; switch ( alts cardinality ( ) ) { case 0 : throw no viable alt ( input , outer context , d configs , start index ) ; case 1 : return alts next set bit ( 0 ) ; default : / / report ambiguity after predicate evaluation to make sure the correct / / set of ambig alts is reported report ambiguity ( dfa , d , start index , stop index , false , alts , d configs ) ; return alts next set bit ( 0 ) ; } } previous d = d ; if ( t ! = int stream eof ) { input consume ( ) ; t = input la ( 1 ) ; } } }