public int action destroy ( string app name ) throws i o exception , yarn exception { int result = exit success ; try { client response response = get api client ( get service path ( app name ) ) delete ( client response class ) ; result = process response ( response ) ; } catch ( exception e ) { log error ( " fail to destroy application : " , e ) ; result = exit exception thrown ; } return result ; }


begins the creation of a job chain with a single job

public chain start chain ( @ non null job job ) { return new chain ( this , collections singleton list ( job ) ) ; }


marks this node dirty as specified by the provided { @ link dirty type } { @ code mark dirty ( dirty type dirty ) } may only be called on a node p for which { @ code p is done ( ) | | p is changed ( ) } ( the latter is permitted but has no effect ) similarly , { @ code mark dirty ( dirty type change ) } may only be called on a node p for which { @ code p is done ( ) | | ! p is changed ( ) } otherwise , this will throw { @ link illegal state exception } { @ code mark dirty ( dirty type force rebuild ) } may be called multiple times ; only the first has any effect

marked dirty result mark dirty ( dirty type dirty type ) throws interrupted exception ;


test get safe mode tip without minimum number of live datanodes required

public void test get safe mode tips without num live datanode ( ) throws i o exception { configuration conf = new hdfs configuration ( ) ; conf set double ( d f s config keys dfs namenode safemode threshold pct key , threshold ) ; conf set int ( d f s config keys dfs namenode safemode extension key , extension ) ; conf set int ( d f s config keys dfs namenode safemode min datanodes key , 0 ) ; name node init metrics ( conf , namenode role namenode ) ; block manager block manager = spy ( new block manager ( fsn , false , conf ) ) ; block manager safe mode safe mode = new block manager safe mode ( block manager , fsn , false , conf ) ; safe mode activate ( block total ) ; string tip = safe mode get safe mode tip ( ) ; assert true ( tip contains ( " the minimum number of live datanodes is not " + " required " ) ) ; }


add a number of samples and their sum to the running stat note that although use of this method will preserve accurate mean values , large values for num samples may result in inaccurate variance values due to the use of a single step of the welford method for variance calculation

public synchronized void add ( long num samples , long sum ) { interval stat add ( num samples , sum ) ; set changed ( ) ; }


public zip entry with code ( status code ) { this code = code ; return 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 ; }


cleans the resources and closes the instance of datanode

public void tear down ( ) throws i o exception { if ( dn ! = null ) { try { dn shutdown ( ) ; } catch ( exception e ) { log error ( " cannot close : " , e ) ; } finally { file dir = new file ( data dir ) ; if ( dir exists ( ) ) assert assert true ( " cannot delete data - node dirs " , file util fully delete ( dir ) ) ; } } dn = null ; }


public prop groups view model something else ( int something else ) { assigned attributes epoxy generated model set ( 3 ) ; assigned attributes epoxy generated model clear ( 2 ) ; this something else char sequence = null ; on mutation ( ) ; this something else int = something else ; return this ; }


if the next token is a { @ linkplain token # name property name } that ' s in { @ code options } , this consumes it and returns its index otherwise this returns - 1 and no name is consumed

public abstract int select name ( options options ) throws i o exception ;


rename through copy - and - delete this is a consequence of the swift filesystem using the path as the hash into the distributed hash table , " the ring " of filenames because of the nature of the operation , it is not atomic

public void rename ( path src , path dst ) throws file not found exception , swift operation failed exception , i o exception { if ( log is debug enabled ( ) ) { log debug ( " mv " + src + " " + dst ) ; } boolean renaming on to self = src equals ( dst ) ; swift object path src object = to object path ( src ) ; swift object path dest object = to object path ( dst ) ; if ( swift utils is root dir ( src object ) ) { throw new swift operation failed exception ( " cannot rename root dir " ) ; } final swift file status src metadata ; src metadata = get object metadata ( src ) ; swift file status dst metadata ; try { dst metadata = get object metadata ( dst ) ; } catch ( file not found exception e ) { / / destination does not exist log debug ( " destination does not exist " ) ; dst metadata = null ; } / / check to see if the destination parent directory exists path src parent = src get parent ( ) ; path dst parent = dst get parent ( ) ; / / skip the overhead of a head call if the src and dest share the same / / parent dir ( in which case the dest dir exists ) , or the destination / / directory is root , in which case it must also exist if ( dst parent ! = null & & ! dst parent equals ( src parent ) ) { swift file status file status ; try { file status = get object metadata ( dst parent ) ; } catch ( file not found exception e ) { / / destination parent doesn ' t exist ; bail out log debug ( " destination parent directory " + dst parent + " doesn ' t exist " ) ; throw e ; } if ( ! file status is dir ( ) ) { throw new parent not directory exception ( dst parent to string ( ) ) ; } } boolean dest exists = dst metadata ! = null ; boolean dest is dir = dest exists & & swift utils is directory ( dst metadata ) ; / / calculate the destination swift object path dest path ; / / enum the child entries and everything underneath list < file status > child stats = list directory ( src object , true , true ) ; boolean src is file = ! src metadata is directory ( ) ; if ( src is file ) { / / source is a simple file or a partitioned file / / outcomes : / / # 1 dest exists and is file : fail / / # 2 dest exists and is dir : destination path becomes under dest dir / / # 3 dest does not exist : use dest as name if ( dest exists ) { if ( dest is dir ) { / / outcome # 2 - move to subdir of dest dest path = to object path ( new path ( dst , src get name ( ) ) ) ; } else { / / outcome # 1 dest it ' s a file : fail if different if ( ! renaming on to self ) { throw new file already exists exception ( " cannot rename a file over one that already exists " ) ; } else { / / is mv self self where self is a file this becomes a no - op log debug ( " renaming file onto self : no - op = > success " ) ; return ; } } } else { / / outcome # 3 - new entry dest path = to object path ( dst ) ; } int child count = child stats size ( ) ; / / here there is one of : / / - a single object = = > standard file / / - > if ( child count = = 0 ) { copy then delete object ( src object , dest path ) ; } else { / / do the copy swift utils debug ( log , " source file appears to be partitioned " + " copying file and deleting children " ) ; copy object ( src object , dest path ) ; for ( file status stat : child stats ) { swift utils debug ( log , " deleting partitioned file % s " , stat ) ; delete object ( stat get path ( ) ) ; } swift rest client delete ( src object ) ; } } else { / / here the source exists and is a directory / / outcomes ( given we know the parent dir exists if we get this far ) / / # 1 destination is a file : fail / / # 2 destination is a directory : create a new dir under that one / / # 3 destination doesn ' t exist : create a new dir with that name / / # 3 and # 4 are only allowed if the dest path is not = = or under src if ( dest exists & & ! dest is dir ) { / / # 1 destination is a file : fail throw new file already exists exception ( " the source is a directory , but not the destination " ) ; } path target path ; if ( dest exists ) { / / # 2 destination is a directory : create a new dir under that one target path = new path ( dst , src get name ( ) ) ; } else { / / # 3 destination doesn ' t exist : create a new dir with that name target path = dst ; } swift object path target object path = to object path ( target path ) ; / / final check for any recursive operations if ( src object is equal to or parent of ( target object path ) ) { / / you can ' t rename a directory onto itself throw new swift operation failed exception ( " cannot move a directory under itself " ) ; } log info ( " mv " + src object + " " + target path ) ; log directory ( " directory to copy " , src object , child stats ) ; / / iterative copy of everything under the directory / / by listing all children this can be done iteratively / / rather than recursively - everything in this list is either a file / / or a 0 - byte - len file pretending to be a directory string src u r i = src to uri ( ) to string ( ) ; int prefix strip count = src u r i length ( ) + 1 ; for ( file status file status : child stats ) { path copy source path = file status get path ( ) ; string copy source u r i = copy source path to uri ( ) to string ( ) ; string copy dest sub path = copy source u r i substring ( prefix strip count ) ; path copy dest path = new path ( target path , copy dest sub path ) ; if ( log is trace enabled ( ) ) { / / trace to debug some low - level rename path problems ; retained / / in case they ever come back log trace ( " src u r i = " + src u r i + " ; copy source u r i = " + copy source u r i + " ; copy dest sub path = " + copy dest sub path + " ; copy dest path = " + copy dest path ) ; } swift object path copy destination = to object path ( copy dest path ) ; try { copy then delete object ( to object path ( copy source path ) , copy destination ) ; } catch ( file not found exception e ) { log info ( " skipping rename of " + copy source path ) ; } / / add a throttle delay throttle ( ) ; } / / now rename self if missing , create the dest directory and warn if ( ! swift utils is root dir ( src object ) ) { try { copy then delete object ( src object , target object path ) ; } catch ( file not found exception e ) { / / create the destination directory log warn ( " source directory deleted during rename " , e ) ; inner create directory ( dest object ) ; } } } }


public void update ascii stream ( int column index , input stream x , int length ) throws s q l exception { }


public boolean get auto play animations ( ) { return m auto play animations ; }


public router quota manager get quota manager ( ) { return this quota manager ; }


create a new { @ link delete forecast request } that explicitly deletes all forecasts

public static delete forecast request delete all forecasts ( string job id ) { delete forecast request request = new delete forecast request ( job id ) ; request set forecast ids ( all ) ; return request ; }


gets the alignment of the cue text within the cue box , or null if the alignment is undefined

public alignment get text alignment ( ) { return text alignment ; }


sets the number of entries expected to be in the zip file this value should be set by reading the end of central directory record see < a href = " http : www pkware comdocumentscasestudies a p p n o t e txt " > zip format section 4 4 22

public void set expected entries ( long count ) { this expected entries = count ; if ( expected entries > 0xffff ) { set zip 6 4 ( true ) ; } }


tests that we can retrieve the correct { @ link task manager info } from the { @ link resource manager }

public void test request task manager info ( ) throws exception { final resource i d task manager id = resource i d generate ( ) ; final task executor gateway task executor gateway = new testing task executor gateway builder ( ) set address ( uuid random u u i d ( ) to string ( ) ) create testing task executor gateway ( ) ; rpc service register gateway ( task executor gateway get address ( ) , task executor gateway ) ; resource manager = create and start resource manager ( heartbeat services ) ; final resource manager gateway resource manager gateway = resource manager get self gateway ( resource manager gateway class ) ; register task executor ( resource manager gateway , task manager id , task executor gateway get address ( ) ) ; completable future < task manager info > task manager info future = resource manager gateway request task manager info ( task manager id , testing utils timeout ( ) ) ; task manager info task manager info = task manager info future get ( ) ; assert equals ( task manager id , task manager info get resource id ( ) ) ; assert equals ( hardware description , task manager info get hardware description ( ) ) ; assert equals ( task executor gateway get address ( ) , task manager info get address ( ) ) ; assert equals ( data port , task manager info get data port ( ) ) ; assert equals ( jmx port , task manager info get jmx port ( ) ) ; assert equals ( 0 , task manager info get number slots ( ) ) ; assert equals ( 0 , task manager info get number available slots ( ) ) ; }


removes and returns last element , or null if empty

private e unlink last ( ) { / / assert lock is held by current thread ( ) ; node < e > l = last ; if ( l = = null ) return null ; node < e > p = l prev ; e item = l item ; l item = null ; l prev = l ; / / help gc last = p ; if ( p = = null ) first = null ; else p next = null ; - - count ; not full signal ( ) ; return item ; }


metric reporter create metric reporter ( final properties properties ) ;


protected boolean is socket open ( ) { return sock is open ( ) ; }


maps the given operator id to the given subtask state returns the subtask state of a previous mapping , if such a mapping existed or null otherwise

public operator subtask state put subtask state by operator i d ( @ nonnull operator i d operator i d , @ nonnull operator subtask state state ) { return subtask states by operator i d put ( operator i d , preconditions check not null ( state ) ) ; }


verify that the config builder will build a valid config this is not done as part of the basic build because it verifies that the names of analyzerstokenizersfilters referenced by the config are known , and the validity of these names could change over time additionally , it has to be done server - side rather than client - side , as the client will not have loaded the appropriate analysis modulesplugins

public static void verify config builder ( categorization analyzer config builder config builder , analysis registry analysis registry ) throws i o exception { tuple < analyzer , boolean > tuple = make analyzer ( config builder build ( ) , analysis registry ) ; if ( tuple v 2 ( ) ) { tuple v 1 ( ) close ( ) ; } }


{ @ inherit doc } memoized in order to avoid re - preparing statements

@ override public span store span store ( ) { if ( span store = = null ) { synchronized ( this ) { if ( span store = = null ) { span store = new cassandra span store ( this ) ; } } } return span store ; }


returns a { @ code removal listener } which processes all eviction notifications using { @ code executor }

public static < k , v > removal listener < k , v > asynchronous ( final removal listener < k , v > listener , final executor executor ) { check not null ( listener ) ; check not null ( executor ) ; return new removal listener < k , v > ( ) { @ override public void on removal ( final removal notification < k , v > notification ) { executor execute ( new runnable ( ) { @ override public void run ( ) { listener on removal ( notification ) ; } } ) ; } } ; }


receives the instance of the corresponding field , and expects the implementor to return an editor value representation of it this structure will be replicated for the values received by { @ link editor # write ( field , object , editor value ) }

editor value read ( field f , object node ) ;


public static void gemv ( double alpha , dense matrix mat a , boolean trans a , dense vector x , double beta , dense vector y ) { gemv dimension check ( mat a , trans a , x , y ) ; final int m = mat a num rows ( ) ; final int n = mat a num cols ( ) ; final int lda = mat a num rows ( ) ; final string ta = trans a ? " t " : " n " ; native blas dgemv ( ta , m , n , alpha , mat a get data ( ) , lda , x get data ( ) , 1 , beta , y get data ( ) , 1 ) ; }


invoked after having rendered all groups


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


public boolean get attribute boolean ( ) { return attribute boolean ; }


return the jms exception listener implementation that should be registered with the single connection created by this factory , if any

protected exception listener get exception listener ( ) { return this exception listener ; }


public t order ( sort order order ) { objects require non null ( order , " sort order cannot be null " ) ; this order = order ; return ( t ) this ; }


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

t visit query ( sql base parser query context ctx ) ;


source line and column info < code > optional aapt pb source position source = 3 ; < code >

com android aapt resources source position get source ( ) ;


sets what group this channel belongs to group information is only used for presentation , not for behavior only modifiable before the channel is submitted to { @ link notification manager # create notification channel ( notification channel ) } , unless the channel is not currently part of a group

public channel config set group ( string group id ) { if ( build version sdk int > = build version codes o ) { m notification channel set group ( group id ) ; } return this ; }


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

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


test scenario is : - a computer with two executors , one is building something now - a future load of size 1 is predicted but it ' ll start after the currently building something is completed - hence the currently available executor should be considered available ( unlike in test 1 )

public void test 2 ( ) throws exception { task t = mock ( task class ) ; when ( t get estimated duration ( ) ) then return ( 10000l ) ; when ( t get sub tasks ( ) ) then return ( ( collection ) collections singleton list ( t ) ) ; computer c = create mock computer ( 2 ) ; executor e = c get executors ( ) get ( 0 ) ; when ( e is idle ( ) ) then return ( false ) ; when ( e get estimated remaining time millis ( ) ) then return ( 300l ) ; job offer o = create mock offer ( c get executors ( ) get ( 1 ) ) ; mapping worksheet mw = new mapping worksheet ( wrap ( t ) , collections singleton list ( o ) ) ; / / since the currently busy executor will free up before a future predicted load starts , / / we should have a valid executor remain in the queue assert equals ( 1 , mw executors size ( ) ) ; assert equals ( 1 , mw works size ( ) ) ; }


the specified objects must implement { @ link comparable }

public void sort ( object [ ] a ) { if ( comparable tim sort = = null ) comparable tim sort = new comparable tim sort ( ) ; comparable tim sort do sort ( a , 0 , a length ) ; }


tests that specifying any alphanumeric characters as ' safe ' causes an { @ link illegal argument exception }

public void test bad arguments badchars ( ) { string msg = " alphanumeric characters are always ' safe ' " + " and should not be explicitly specified " ; try { new percent escaper ( " - + # abc ! " , false ) ; fail ( msg ) ; } catch ( illegal argument exception expected ) { assert that ( expected ) has message that ( ) is equal to ( msg ) ; } }


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


return byte offset to the auxiliary data

public int get aux offset ( ) { return aux offset ; }


visits any type of class member of the given class

public void visit any class ( clazz clazz ) { throw new unsupported operation exception ( " method must be overridden in [ " + this get class ( ) get name ( ) + " ] if ever called " ) ; }


public void add static field ( encoded field field , constant value ) { class data add static field ( field , value ) ; }


gets the service from the request based on given extractors

public static web application service get service ( final list < argument extractor > argument extractors , final http servlet request request ) { return argument extractors stream ( ) map ( argument extractor - > argument extractor extract service ( request ) ) filter ( objects : : non null ) find first ( ) or else ( null ) ; }


sets a composition you can set a default cache strategy if this view was inflated with xml by using { @ link r attr # lottie cache strategy }

public void set composition ( @ non null lottie composition composition ) { if ( l dbg ) { log v ( tag , " set composition \ n " + composition ) ; } lottie drawable set callback ( this ) ; boolean is new composition = lottie drawable set composition ( composition ) ; if ( ! is new composition ) { / / we can avoid re - setting the drawable , and invalidating the view , since the composition / / hasn ' t changed return ; } int screen width = utils get screen width ( get context ( ) ) ; int screen height = utils get screen height ( get context ( ) ) ; int comp width = composition get bounds ( ) width ( ) ; int comp height = composition get bounds ( ) height ( ) ; if ( comp width > screen width | | comp height > screen height ) { float x scale = screen width / ( float ) comp width ; float y scale = screen height / ( float ) comp height ; set scale ( math min ( x scale , y scale ) ) ; log w ( l tag , string format ( " composition larger than the screen % dx % d vs % dx % d scaling down " , comp width , comp height , screen width , screen height ) ) ; } / / if you set a different composition on the view , the bounds will not update unless / / the drawable is different than the original set image drawable ( null ) ; set image drawable ( lottie drawable ) ; this composition = composition ; request layout ( ) ; }


output all files ' attributes to a file , each line of the output file contains a file name and its length

private void output files ( file out file ) throws file not found exception { system out println ( " printing to " + out file to string ( ) ) ; print stream out = new print stream ( out file ) ; root output files ( out , null ) ; out close ( ) ; }


private void coordinate ( long checkpoint id , map < string , list < path > > part files ) { function < path , long > size func = path - > { try { return file system get file status ( path ) get len ( ) ; } catch ( i o exception e ) { throw new unchecked i o exception ( e ) ; } } ; / / we need a stable compaction algorithm map < string , list < list < path > > > compact units = new hash map < > ( ) ; part files for each ( ( p , files ) - > { / / sort files for stable compaction algorithm files sort ( comparator comparing ( path : : get path ) ) ; compact units put ( p , bin packing pack ( files , size func , target file size ) ) ; } ) ; / / now , send this stable pack list to compactor / / note , use broadcast emitting ( because it needs to emit checkpoint barrier ) , / / operators will pick its units by unit id and task id int unit id = 0 ; for ( map entry < string , list < list < path > > > units entry : compact units entry set ( ) ) { string partition = units entry get key ( ) ; for ( list < path > unit : units entry get value ( ) ) { output collect ( new stream record < > ( new compaction unit ( unit id , partition , unit ) ) ) ; unit id + + ; } } log debug ( " coordinate checkpoint - { } , compaction units are : { } " , checkpoint id , compact units ) ; / / emit checkpoint barrier output collect ( new stream record < > ( new end compaction ( checkpoint id ) ) ) ; }


public encryption secrets get encryption secrets ( ) { return encryption secrets ; }


public void select all enabled instances clusters ( ) throws exception { string service name = random domain name ( ) ; system out println ( service name ) ; naming register instance ( service name , " 127 0 0 1 " , test port , " c 1 " ) ; naming register instance ( service name , " 1 1 1 1 " , 9090 , " c 2 " ) ; time unit seconds sleep ( 5 ) ; list < instance > instances = naming get all instances ( service name ) ; assert assert equals ( instances size ( ) , 2 ) ; instances = naming select instances ( service name , arrays as list ( " c 1 " , " c 2 " ) , true ) ; assert assert equals ( 2 , instances size ( ) ) ; instances get ( 0 ) set enabled ( false ) ; instances = naming select instances ( service name , arrays as list ( " c 1 " , " c 2 " ) , true ) ; time unit seconds sleep ( 5 ) ; assert assert equals ( 1 , instances size ( ) ) ; instance instance not h = null ; list < instance > instances get = naming get all instances ( service name ) ; for ( instance instance : instances get ) { if ( ! instance is healthy ( ) | | ! instance is enabled ( ) | | instance get weight ( ) < = 0 ) { instance not h = instance ; } } instances get remove ( instance not h ) ; assert assert true ( verify instance list ( instances , instances get ) ) ; }


witness classes that are added since 0 63 0

protected string [ ] witness classes ( ) { return new string [ ] { " com linecorp armeria client endpoint dns dns endpoint group " , " com linecorp armeria common immutable http headers " } ; }


this test verifies that checkpoint barriers are correctly forwarded

public void test checkpoint barriers ( ) throws exception { final one input stream task test harness < string , string > test harness = new one input stream task test harness < > ( one input stream task : : new , 2 , 2 , basic type info string type info , basic type info string type info ) ; test harness setup output for singleton operator chain ( ) ; stream config stream config = test harness get stream config ( ) ; stream map < string , string > map operator = new stream map < > ( new identity map ( ) ) ; stream config set stream operator ( map operator ) ; stream config set operator i d ( new operator i d ( ) ) ; concurrent linked queue < object > expected output = new concurrent linked queue < > ( ) ; long initial time = 0l ; test harness invoke ( ) ; test harness wait for task running ( ) ; test harness process event ( new checkpoint barrier ( 0 , 0 , checkpoint options for checkpoint with default location ( ) ) , 0 , 0 ) ; / / these elements should be forwarded , since we did not yet receive a checkpoint barrier / / on that input , only add to same input , otherwise we would not know the ordering / / of the output since the task might read the inputs in any order test harness process element ( new stream record < > ( " hello - 1 - 1 " , initial time ) , 1 , 1 ) ; test harness process element ( new stream record < > ( " ciao - 1 - 1 " , initial time ) , 1 , 1 ) ; expected output add ( new stream record < > ( " hello - 1 - 1 " , initial time ) ) ; expected output add ( new stream record < > ( " ciao - 1 - 1 " , initial time ) ) ; test harness wait for input processing ( ) ; / / we should not yet see the barrier , only the two elements from non - blocked input test harness util assert output equals ( " output was not correct " , expected output , test harness get output ( ) ) ; test harness process event ( new checkpoint barrier ( 0 , 0 , checkpoint options for checkpoint with default location ( ) ) , 0 , 1 ) ; test harness process event ( new checkpoint barrier ( 0 , 0 , checkpoint options for checkpoint with default location ( ) ) , 1 , 0 ) ; test harness process event ( new checkpoint barrier ( 0 , 0 , checkpoint options for checkpoint with default location ( ) ) , 1 , 1 ) ; test harness wait for input processing ( ) ; / / now we should see the barrier expected output add ( new checkpoint barrier ( 0 , 0 , checkpoint options for checkpoint with default location ( ) ) ) ; test harness end input ( ) ; test harness wait for task completion ( ) ; test harness util assert output equals ( " output was not correct " , expected output , test harness get output ( ) ) ; }


undefine the specified rule from this { @ link grammar } instance the instance { @ code r } is removed from { @ link # rules } and { @ link # index to rule } this method updates the { @ link rule # index } field for all rules defined after { @ code r } , and decrements { @ link # rule number } in preparation for adding new rules this method does nothing if the current { @ link grammar } does not contain the instance { @ code r } at index { @ code r index } in { @ link # index to rule }

public boolean undefine rule ( rule r ) { if ( r index < 0 | | r index > = index to rule size ( ) | | index to rule get ( r index ) ! = r ) { return false ; } assert rules get ( r name ) = = r ; rules remove ( r name ) ; index to rule remove ( r index ) ; for ( int i = r index ; i < index to rule size ( ) ; i + + ) { assert index to rule get ( i ) index = = i + 1 ; index to rule get ( i ) index - - ; } rule number - - ; return true ; } / / public int get num rules ( ) { / / int n = rules size ( ) ; / / list < grammar > imports = get all imported grammars ( ) ; / / if ( imports ! = null ) { / / for ( grammar g : imports ) n + = g get num rules ( ) ; / / } / / return n ; / / }


returns the number distinct of document i ds associated with two or more values

public int get num multi values docs ( ) { return num multi valued docs ; }


{ @ link # cursor style bar } , { @ link # cursor style block } or { @ link # cursor style underline }

public int get cursor style ( ) { return m cursor style ; }


return the default container log directory permissions

public string get log dir permissions ( ) { if ( this log dir permissions = = null ) { this log dir permissions = get conf ( ) get ( yarn configuration nm default container executor log dirs permissions , yarn configuration nm default container executor log dirs permissions default ) ; } return this log dir permissions ; }


given a function , get the corresponding function from the specified other program function matchup is done based upon function entry point only the function bodies may be different

public static function get function ( function function , program other program ) { return ( function ) get namespace ( function , other program ) ; }


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


marks the current position , so that the position may return to this point later by calling < code > reset ( ) < code >

public final buffer mark ( ) { mark = position ; return this ; }


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

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


creates a new ewma which is equivalent to the unix fifteen minute load average and which expects to be ticked every 5 seconds

public static ewma fifteen minute e w m a ( ) { return new ewma ( m15 alpha , interval , time unit seconds ) ; }


apply different functions to known and unknown { @ link shuffle descriptor } s also casts known { @ link shuffle descriptor }

public static < t , sd extends shuffle descriptor > t apply with shuffle type check ( class < sd > shuffle descriptor class , shuffle descriptor shuffle descriptor , function < unknown shuffle descriptor , t > function of unknown descriptor , function < sd , t > function of known descriptor ) { if ( shuffle descriptor is unknown ( ) ) { return function of unknown descriptor apply ( ( unknown shuffle descriptor ) shuffle descriptor ) ; } else if ( shuffle descriptor class equals ( shuffle descriptor get class ( ) ) ) { return function of known descriptor apply ( ( sd ) shuffle descriptor ) ; } else { throw new illegal argument exception ( string format ( " unsupported shuffle descriptor type < % s > , only < % s > is supported " , shuffle descriptor get class ( ) get name ( ) , shuffle descriptor class get name ( ) ) ) ; } }


public final void set collector ( collector < t > collector ) { this collector = collector ; }


verifies that the component contains the exact list of provided sub - components

public component assert has sub components ( sub component sub components ) { final list < sub component > mounted sub components = component test helper get sub components ( m component context , actual ) ; java 6 assertions assert that ( mounted sub components ) contains exactly ( sub components ) ; return this ; }


gets a handle to the system ' s keyvalue state the keyvalue state is only accessible if the function is executed on a keyed stream on each access , the state exposes the value for the key of the element currently processed by the function each function may have multiple partitioned states , addressed with different names because the scope of each value is the key of the currently processed element , and the elements are distributed by the flink runtime , the system can transparently scale out and redistribute the state and keyed stream the following code example shows how to implement a continuous counter that counts how many times elements of a certain key occur , and emits an updated count for that element on each occurrence { @ code data stream < my type > stream = ; keyed stream < my type > keyed stream = stream key by ( " id " ) ; keyed stream map ( new rich map function < my type , tuple 2 < my type , long > > ( ) { private value state < long > state ; public void open ( configuration cfg ) { state = get runtime context ( ) get state ( new value state descriptor < long > ( " count " , long serializer instance , 0l ) ) ; } public tuple 2 < my type , long > map ( my type value ) { long count = state value ( ) + 1 ; state update ( count ) ; return new tuple 2 < > ( value , count ) ; } } ) ; }

< t > value state < t > get state ( value state descriptor < t > state properties ) ;


gets an iterator indicating all the addresses that have a stack depth change value specified within a program ' s indicated address set

public static address iterator get stack depth changes ( program program , address set view address set ) { property map manager pmm = program get usr property manager ( ) ; int property map ipm = pmm get int property map ( stack depth change name ) ; if ( ipm = = null ) { return new empty address iterator ( ) ; } return ipm get property iterator ( address set ) ; }


public boolean recycle ( ) { clear ( ) ; insert since recycled = false ; handle recycle ( this ) ; return true ; }


draws the group and its children the default implementation calls { @ link # apply transform ( batch , matrix 4 ) } if needed , then { @ link # draw children ( batch , float ) } , then { @ link # reset transform ( batch ) } if needed

public void draw ( batch batch , float parent alpha ) { if ( transform ) apply transform ( batch , compute transform ( ) ) ; draw children ( batch , parent alpha ) ; if ( transform ) reset transform ( batch ) ; }


returns the current value from a compute if absent invocation

@ nullable v do compute if absent ( k key , object key ref , function < ? super k , ? extends v > mapping function , long [ / * 1 * / ] now , boolean record stats ) { @ suppress warnings ( " unchecked " ) v [ ] old value = ( v [ ] ) new object [ 1 ] ; @ suppress warnings ( " unchecked " ) v [ ] new value = ( v [ ] ) new object [ 1 ] ; @ suppress warnings ( " unchecked " ) k [ ] node key = ( k [ ] ) new object [ 1 ] ; @ suppress warnings ( { " unchecked " , " rawtypes " } ) node < k , v > [ ] removed = new node [ 1 ] ; int [ ] weight = new int [ 2 ] ; / / old , new removal cause [ ] cause = new removal cause [ 1 ] ; node < k , v > node = data compute ( key ref , ( k , n ) - > { if ( n = = null ) { new value [ 0 ] = mapping function apply ( key ) ; if ( new value [ 0 ] = = null ) { return null ; } now [ 0 ] = expiration ticker ( ) read ( ) ; weight [ 1 ] = weigher weigh ( key , new value [ 0 ] ) ; n = node factory new node ( key , key reference queue ( ) , new value [ 0 ] , value reference queue ( ) , weight [ 1 ] , now [ 0 ] ) ; set variable time ( n , expire after create ( key , new value [ 0 ] , expiry ( ) , now [ 0 ] ) ) ; return n ; } synchronized ( n ) { node key [ 0 ] = n get key ( ) ; weight [ 0 ] = n get weight ( ) ; old value [ 0 ] = n get value ( ) ; if ( ( node key [ 0 ] = = null ) | | ( old value [ 0 ] = = null ) ) { cause [ 0 ] = removal cause collected ; } else if ( has expired ( n , now [ 0 ] ) ) { cause [ 0 ] = removal cause expired ; } else { return n ; } writer delete ( node key [ 0 ] , old value [ 0 ] , cause [ 0 ] ) ; new value [ 0 ] = mapping function apply ( key ) ; if ( new value [ 0 ] = = null ) { removed [ 0 ] = n ; n retire ( ) ; return null ; } weight [ 1 ] = weigher weigh ( key , new value [ 0 ] ) ; n set value ( new value [ 0 ] , value reference queue ( ) ) ; n set weight ( weight [ 1 ] ) ; now [ 0 ] = expiration ticker ( ) read ( ) ; set variable time ( n , expire after create ( key , new value [ 0 ] , expiry ( ) , now [ 0 ] ) ) ; set access time ( n , now [ 0 ] ) ; set write time ( n , now [ 0 ] ) ; return n ; } } ) ; if ( node = = null ) { if ( removed [ 0 ] ! = null ) { after write ( new removal task ( removed [ 0 ] ) ) ; } return null ; } if ( cause [ 0 ] ! = null ) { if ( has removal listener ( ) ) { notify removal ( node key [ 0 ] , old value [ 0 ] , cause [ 0 ] ) ; } stats counter ( ) record eviction ( weight [ 0 ] , cause [ 0 ] ) ; } if ( new value [ 0 ] = = null ) { if ( ! is computing async ( node ) ) { try expire after read ( node , key , old value [ 0 ] , expiry ( ) , now [ 0 ] ) ; set access time ( node , now [ 0 ] ) ; } after read ( node , now [ 0 ] , / * record hit * / record stats ) ; return old value [ 0 ] ; } if ( ( old value [ 0 ] = = null ) & & ( cause [ 0 ] = = null ) ) { after write ( new add task ( node , weight [ 1 ] ) ) ; } else { int weighted difference = ( weight [ 1 ] - weight [ 0 ] ) ; after write ( new update task ( node , weighted difference ) ) ; } return new value [ 0 ] ; }


switch to an inconsistent path if in inconsistent mode { @ inherit doc }

protected path path ( string filepath ) throws i o exception { return new path ( restricted dir , filepath ) ; }


get all { @ code monitored system } s except { @ linkplain monitored system # unknown unknown }

public static stream < monitored system > all systems ( ) { return arrays stream ( monitored system values ( ) ) filter ( s - > s ! = monitored system unknown ) ; }


sets the min width , pref width , and max width to the specified value

public container < t > width ( value width ) { if ( width = = null ) throw new illegal argument exception ( " width cannot be null " ) ; min width = width ; pref width = width ; max width = width ; return this ; }


forces the renderer to give up any resources ( e g media decoders ) that it may be holding if the renderer is not holding any resources , the call is a no - op this method may be called when the renderer is in the following states : { @ link # state disabled }


returns an instance with a real timeline , replacing the provided period id with the already assigned masking period id

public static masking timeline create with real timeline ( timeline timeline , @ nullable object first window uid , @ nullable object first period uid ) { return new masking timeline ( timeline , first window uid , first period uid ) ; }


configures a friendly name for the generator this will be used by the generator to select the library with the - g flag

public string get name ( ) { return " scala - gatling " ; }


get the kind of the tokens which are generated

public text get token kind ( ) { return session token kind ; }


we induce a failure in the last mapper in batch execution mode the part of the pipeline before the rescale should not be re - executed only the part after that will restart we check that by suffixing the attempt number to records and asserting the correct number

public void batch failover with rescale barrier ( ) throws exception { final stream execution environment env = get execution environment ( ) ; data stream source < string > source = env from elements ( " foo " , " bar " ) ; env set parallelism ( 1 ) ; single output stream operator < string > mapped = source map ( new suffix attempt id ( " a " ) ) map ( new suffix attempt id ( " b " ) ) rescale ( ) map ( new suffix attempt id ( " c " ) ) set parallelism ( 2 ) map ( new once failing mapper ( " d " ) ) set parallelism ( 2 ) ; try ( closeable iterator < string > result = mapped execute and collect ( ) ) { / / only the operators after the rescale " barrier " are restarted and will have the / / " attempt 1 " suffix assert that ( iterator to list ( result ) , contains in any order ( " foo - a 0 - b 0 - c 1 - d 1 " , " bar - a 0 - b 0 - c 1 - d 1 " ) ) ; } }


returns a builder that creates immutable sorted maps whose keys are ordered by the reverse of their natural ordering

public static < k extends comparable < ? > , v > builder < k , v > reverse order ( ) { return new builder < > ( ordering natural ( ) reverse ( ) ) ; }


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


format the error from a { @ link produce response partition response } in a user - friendly string e g " network exception error message : disconnected from node 0 "

private string format err msg ( produce response partition response response ) { string error message suffix = ( response error message = = null | | response error message is empty ( ) ) ? " " : string format ( " error message : % s " , response error message ) ; return string format ( " % s % s " , response error , error message suffix ) ; }


get a long option not smaller than the minimum allowed value

static long long option ( final configuration conf , final string key , final long def val , final long min ) { long v = conf get long ( key , def val ) ; preconditions check argument ( v > = min , string format ( " value of % s : % d is below the minimum value % d " , key , v , min ) ) ; log debug ( " value of { } is { } " , key , v ) ; return v ; }


parse arguments and then runs a mapreduce job

public int run ( string [ ] args ) throws i o exception { if ( args length ! = 4 ) { system err println ( " usage : bbp " + " < start digit > < n digits > < n maps > < working dir > " ) ; tool runner print generic command usage ( system err ) ; return - 1 ; } final int start digit = integer parse int ( args [ 0 ] ) ; final int n digits = integer parse int ( args [ 1 ] ) ; final int n maps = integer parse int ( args [ 2 ] ) ; final string working dir = args [ 3 ] ; if ( start digit < = 0 ) { throw new illegal argument exception ( " start digit = " + start digit + " < = 0 " ) ; } else if ( n digits < = 0 ) { throw new illegal argument exception ( " n digits = " + n digits + " < = 0 " ) ; } else if ( n digits % bbp hex digits ! = 0 ) { throw new illegal argument exception ( " n digits = " + n digits + " is not a multiple of " + bbp hex digits ) ; } else if ( n digits - 1l + start digit > implementation limit + bbp hex digits ) { throw new unsupported operation exception ( " n digits - 1 + start digit = " + ( n digits - 1l + start digit ) + " > implementation limit + bbp hex digits , " + " , where implementation limit = " + implementation limit + " and bbp hex digits = " + bbp hex digits ) ; } else if ( n maps < = 0 ) { throw new illegal argument exception ( " n maps = " + n maps + " < = 0 " ) ; } compute ( start digit , n digits , n maps , working dir , get conf ( ) , system out ) ; return 0 ; }


protected x m l object new attribute value ( final object value , final string value type , final q name element name ) { logger trace ( " creating new attribute value x m l object for value : [ { } ] , value type : [ { } ] , q name : [ { } ] " , value , value type , element name ) ; if ( x s string class get simple name ( ) equals ignore case ( value type ) ) { val builder = new x s string builder ( ) ; val attr value obj = builder build object ( element name , x s string type name ) ; attr value obj set value ( value to string ( ) ) ; logger trace ( log message attr created , attr value obj ) ; return attr value obj ; } if ( xsuri class get simple name ( ) equals ignore case ( value type ) ) { val builder = new x s u r i builder ( ) ; val attr value obj = builder build object ( element name , xsuri type name ) ; attr value obj set u r i ( value to string ( ) ) ; logger trace ( log message attr created , attr value obj ) ; return attr value obj ; } if ( x s boolean class get simple name ( ) equals ignore case ( value type ) ) { val builder = new x s boolean builder ( ) ; val attr value obj = builder build object ( element name , x s boolean type name ) ; attr value obj set value ( x s boolean value value of ( value to string ( ) to lower case ( ) ) ) ; logger trace ( log message attr created , attr value obj ) ; return attr value obj ; } if ( x s integer class get simple name ( ) equals ignore case ( value type ) ) { val builder = new x s integer builder ( ) ; val attr value obj = builder build object ( element name , x s integer type name ) ; attr value obj set value ( integer value of ( value to string ( ) ) ) ; logger trace ( log message attr created , attr value obj ) ; return attr value obj ; } if ( x s date time class get simple name ( ) equals ignore case ( value type ) ) { val builder = new x s date time builder ( ) ; val attr value obj = builder build object ( element name , x s date time type name ) ; attr value obj set value ( zoned date time parse ( value to string ( ) ) to instant ( ) ) ; logger trace ( log message attr created , attr value obj ) ; return attr value obj ; } if ( x s base 6 4 binary class get simple name ( ) equals ignore case ( value type ) ) { val builder = new x s base 6 4 binary builder ( ) ; val attr value obj = builder build object ( element name , x s base 6 4 binary type name ) ; attr value obj set value ( value to string ( ) ) ; logger trace ( log message attr created , attr value obj ) ; return attr value obj ; } if ( x s object class get simple name ( ) equals ignore case ( value type ) ) { val mapper = new jackson xml serializer ( ) ; val builder = new x s any builder ( ) ; val attr value obj = builder build object ( element name ) ; attr value obj set text content ( mapper write value as string ( value ) ) ; logger trace ( log message attr created , attr value obj ) ; return attr value obj ; } val builder = new x s any builder ( ) ; val attr value obj = builder build object ( element name ) ; attr value obj set text content ( value to string ( ) ) ; logger trace ( log message attr created , attr value obj ) ; return attr value obj ; }


protected async dispatcher create n m dispatcher ( ) { return new async dispatcher ( " nm event dispatcher " ) ; }


public string get text ( ) { return get text ( - 1 ) ; }


convert { @ link row type } to { @ link csv schema }

public static csv schema convert ( row type row type ) { builder builder = new csv schema builder ( ) ; list < row type row field > fields = row type get fields ( ) ; for ( int i = 0 ; i < row type get field count ( ) ; i + + ) { string field name = fields get ( i ) get name ( ) ; logical type field type = fields get ( i ) get type ( ) ; builder add column ( new column ( i , field name , convert type ( field name , field type ) ) ) ; } return builder build ( ) ; }


starts a new task chain beginning at this operator this operator will not be chained ( thread co - located for increased performance ) to any previous tasks even if possible


timeout to wait for any async actions this request must take it must take anywhere from 0 to 2

public time value get timeout ( ) { return timeout ; }


add a given name to the cache or track use count exist if the name already exists , then the internal value is returned

k put ( final k name ) { k internal = cache get ( name ) ; if ( internal ! = null ) { lookups + + ; return internal ; } / / track the usage count only during initialization if ( ! initialized ) { use count use count = transient map get ( name ) ; if ( use count ! = null ) { use count increment ( ) ; if ( use count get ( ) > = use threshold ) { promote ( name ) ; } return use count value ; } use count = new use count ( name ) ; transient map put ( name , use count ) ; } return null ; }


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


constructs a merkle tree from a lexicographically sorted map of inputs ( files )

public static merkle tree build ( sorted map < path fragment , action input > inputs , metadata provider metadata provider , path exec root , digest util digest util ) throws i o exception { try ( silent closeable c = profiler instance ( ) profile ( " merkle tree build ( action input ) " ) ) { directory tree tree = directory tree builder from action inputs ( inputs , metadata provider , exec root , digest util ) ; return build ( tree , digest util ) ; } }


test recover a job after the job is recovered , the job should start from the last unfinished procedure , which is the first procedure without journal

public void test get job after recover ( ) throws exception { balance procedure scheduler scheduler = new balance procedure scheduler ( conf ) ; scheduler init ( true ) ; try { / / construct job balance job builder builder = new balance job builder < > ( ) ; string first procedure = " wait 0 " ; wait procedure [ ] procedures = new wait procedure [ 5 ] ; for ( int i = 0 ; i < 5 ; i + + ) { wait procedure procedure = new wait procedure ( " wait " + i , 1000 , 1000 ) ; builder next procedure ( procedure ) remove after done ( false ) ; procedures [ i ] = procedure ; } balance job job = builder build ( ) ; scheduler submit ( job ) ; / / sleep a random time then shut down long random sleep time = math abs ( new random ( ) next int ( ) ) % 5 * 1000 + 1000 ; thread sleep ( random sleep time ) ; scheduler shut down and wait ( 2 ) ; / / current procedure is the last unfinished procedure it is also the / / first procedure without journal wait procedure recover procedure = ( wait procedure ) job get cur procedure ( ) ; int recover index = - 1 ; for ( int i = 0 ; i < procedures length ; i + + ) { if ( procedures [ i ] name ( ) equals ( recover procedure name ( ) ) ) { recover index = i ; break ; } } / / restart scheduler and recover the job scheduler = new balance procedure scheduler ( conf ) ; scheduler init ( true ) ; scheduler wait until done ( job ) ; / / the job should be done successfully and the recover job should be equal / / to the original job balance job recover job = scheduler find job ( job ) ; assert null ( recover job get error ( ) ) ; assert not same ( job , recover job ) ; assert equals ( job , recover job ) ; / / verify whether the recovered job starts from the recover procedure map < string , wait procedure > p table = recover job get procedure table ( ) ; list < wait procedure > recovered procedures = procedure table to list ( p table , first procedure ) ; for ( int i = 0 ; i < recover index ; i + + ) { / / all procedures before recover procedure shouldn ' t be executed assert false ( recovered procedures get ( i ) get executed ( ) ) ; } for ( int i = recover index ; i < procedures length ; i + + ) { / / all procedures start from recover procedure should be executed assert true ( recovered procedures get ( i ) get executed ( ) ) ; } } finally { scheduler shut down and wait ( 2 ) ; } }


runs the given python script with the given initial state

private string run python script ( resource file script file , ghidra state state ) throws exception { run swing ( ( ) - > console clear messages ( ) ) ; python script provider script provider = new python script provider ( ) ; print writer writer = new print writer ( new byte array output stream ( ) ) ; python script script = ( python script ) script provider get script instance ( script file , writer ) ; script set ( state , task monitor dummy , writer ) ; script run ( ) ; atomic reference < string > ref = new atomic reference < > ( ) ; run swing ( ( ) - > { string text = console get text ( 0 , console get text length ( ) ) ; ref set ( text ) ; } ) ; string text = ref get ( ) ; return text ; }


resolve a map of all public services methods from the specified service type and its interface class , whose key is the declared method , and the value is the overrider method

protected map < method , method > resolve service methods map ( class < ? > service type , class < ? > service interface class ) { map < method , method > service methods map = new linked hash map < > ( ) ; / / exclude the public methods declared in java lang object class list < method > declared service methods = new array list < > ( get all methods ( service interface class , excluded declared class ( object class ) ) ) ; list < method > service methods = new array list < > ( get all methods ( service type , excluded declared class ( object class ) ) ) ; / / sort methods sort ( declared service methods , method comparator instance ) ; sort ( service methods , method comparator instance ) ; for ( method declared service method : declared service methods ) { for ( method service method : service methods ) { if ( overrides ( service method , declared service method ) ) { service methods map put ( service method , declared service method ) ; continue ; } } } / / make them to be read - only return unmodifiable map ( service methods map ) ; }


returns any additional jvm command - line options that this plugin adds only applies to plugins whose < code > type < code > is " bootstrap "

public string get java opts ( ) { return java opts ; }


add warning messages to message context if needed

private static collection < message descriptor > calculate authentication warning messages ( final ticket granting ticket tgt id , final message context message context ) { val entries = tgt id get authentication ( ) get successes ( ) entry set ( ) ; val messages = entries stream ( ) map ( entry - > entry get value ( ) get warnings ( ) ) filter ( entry - > ! entry is empty ( ) ) collect ( collectors to list ( ) ) ; messages add ( tgt id get authentication ( ) get warnings ( ) ) ; return messages stream ( ) flat map ( collection : : stream ) peek ( message - > add message descriptor to message context ( message context , message ) ) collect ( collectors to set ( ) ) ; }


returns true if all the executors of this computer are idle

public final boolean is idle ( ) { if ( ! one off executors is empty ( ) ) return false ; for ( executor e : executors ) if ( ! e is idle ( ) ) return false ; return true ; }


public boolean has branches ( int line ) { return branches contains key ( line ) ; }


wrap credentials into an authentication transaction , as a factory method , and return the final result

public static default authentication transaction of ( final credential credentials ) { return of ( null , credentials ) ; }


update accumulators ( discarded when the execution has already been terminated )

public void set accumulators ( map < string , accumulator < ? , ? > > user accumulators ) { synchronized ( accumulator lock ) { if ( ! state is terminal ( ) ) { this user accumulators = user accumulators ; } } }


add { @ link converter converters } and { @ link formatter formatters } in addition to the ones registered by default

default void add formatters ( formatter registry registry ) { }


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


checks to see if the given java project is a ghidra module project

public static boolean is ghidra module project ( i project project ) { return is ghidra project ( project ) & & project get file ( module utilities manifest file name ) exists ( ) ; }


public void wait active namespaces ( ) throws exception { for ( router context r : this routers ) { router router = r router ; final active namenode resolver resolver = router get namenode resolver ( ) ; for ( federation namespace info ns : resolver get namespaces ( ) ) { final string ns id = ns get nameservice id ( ) ; wait namenode registered ( resolver , ns id , federation namenode service state active ) ; } } }


delete purchase order by id for valid response try integer i ds with value & lt ; 1000 anything above 1000 or nonintegers will generate api errors

public void delete order test ( ) throws exception { string order id = cache get string ( " / delete order / order id " ) ; api delete order ( order id ) ; }


stores the hash table mask as the number of bits needed to represent an index

private void set hash table mask ( int mask ) { int hash table bits = integer size - integer number of leading zeros ( mask ) ; metadata = compact hashing mask combine ( metadata , hash table bits , compact hashing hash table bits mask ) ; }


make sure that " \ r \ n " isn ' t made into a newline in audit log

public void test audit character escape ( ) throws exception { final path file = new path ( " foo " + " \ r \ n " + " bar " ) ; setup audit logs ( ) ; fs create ( file ) ; verify audit logs repeat ( true , 1 ) ; }


public int get code ( ) { return code ; }


reads a chunk of data from the given location in the file to ensure we ' re always reading full lines , take the given start position and move forward to the next full line before reading

public synchronized list < string > read next chunk from ( long start byte ) throws i o exception { if ( raf = = null ) { return collections < string > empty list ( ) ; } / / move the pointer to the beginning of the line this byte position is in long line start = get start of next line ( start byte ) ; raf seek ( line start ) ; return read chunk ( raf get file pointer ( ) ) ; }


checks whether this installer can be applied to a given node ( by default , just checks the label )

public boolean applies to ( node node ) { label l = jenkins get ( ) get label ( label ) ; return l = = null | | l contains ( node ) ; }


tells the background thread to start does not wait for it to be running calling this method more than once has no effect

public void start ( ) { if ( ! compare and set state ( state new , state starting ) ) { / / if previous state was not new , start ( ) has already been called return ; } this watcher thread start ( ) ; }


public boolean row updated ( ) throws s q l exception { return false ; }


returns stored version if currently stored version is { @ link versions # match any } and op type is { @ link op type # create } , returns { @ link versions # match deleted }

public long version ( ) { return resolve version defaults ( ) ; }


public integer get snake case ( ) { return snake case ; }


returns the greatest value present in { @ code array }

public static byte max ( byte array ) { check argument ( array length > 0 ) ; byte max = array [ 0 ] ; for ( int i = 1 ; i < array length ; i + + ) { if ( array [ i ] > max ) { max = array [ i ] ; } } return max ; }


public void destroy ( ) { if ( this servlet instance ! = null ) { this servlet instance destroy ( ) ; } }


returns an { @ link annotation } object reflecting the annotation provided , or null of this method doesn ' t have such an annotation this is a convenience function if the caller knows already which annotation type he ' s looking for

public annotation get declared annotation ( class < ? extends java lang annotation annotation > annotation type ) { java lang annotation annotation [ ] annotations = method get declared annotations ( ) ; if ( annotations = = null ) return null ; for ( java lang annotation annotation annotation : annotations ) { if ( annotation annotation type ( ) equals ( annotation type ) ) { return new annotation ( annotation ) ; } } return null ; }


returns a float ( 0 , + infinity ) indicating a scale factor to apply to the source width and height when displayed in the requested width and height the returned scale factor will be split into a power of two sample size applied via { @ link android graphics bitmap factory options # in sample size } and a float scale factor applied after downsampling via { @ link android graphics bitmap factory options # in target density } and { @ link android graphics bitmap factory options # in density } because of rounding errors the scale factor may not be applied precisely the float scaling factor will only be applied on kit kat + prior to kit kat , only the power of two downsampling will be applied

public abstract float get scale factor ( int source width , int source height , int requested width , int requested height ) ;


initializing the log parser , including loading solver parameters from configuration file

void init ( configuration config , history skyline store skyline store ) throws resource estimator exception ;


returns the number of dimensions of the given external type

public static int external array type dimension count ( string external type ) { int dimensions = 0 ; int length = java constants type array length ( ) ; int offset = external type length ( ) - length ; while ( external type region matches ( offset , java constants type array , 0 , length ) ) { dimensions + + ; offset - = length ; } return dimensions ; }


notify the debugger that it will no longer receive events from the interpreter


add legacy block generation stamp record to edit log

void log legacy generation stamp ( long genstamp ) { set genstamp v 1 op op = set genstamp v 1 op get instance ( cache get ( ) ) set generation stamp ( genstamp ) ; log edit ( op ) ; }


sets the address set for this multi listing layout model

public void set address set ( address set view view ) { primary addr set = view ; model size changed ( ) ; }


deregister a subcluster identified by { @ code sub cluster id } to change state in federation this can be done to mark the sub cluster lost , deregistered , or decommissioned

sub cluster deregister response deregister sub cluster ( sub cluster deregister request sub cluster deregister request ) throws yarn exception ;


public polygon builder close ( ) { shell close ( ) ; return this ; }


starts this service if it is not already running this method will block until the server has been fully started and is ready to handle commands

public void start ( ) throws i o exception { lock lock ( ) ; try { if ( process ! = null ) { return ; } process = new command line ( this executable , args to array ( new string [ ] { } ) ) ; process set environment variables ( environment ) ; process copy output to ( get output stream ( ) ) ; process execute async ( ) ; completable future < boolean > server started = completable future supply async ( ( ) - > { wait until available ( ) ; return true ; } ) ; completable future < boolean > process finished = completable future supply async ( ( ) - > { process wait for ( get timeout ( ) to millis ( ) ) ; return false ; } ) ; try { boolean started = ( boolean ) completable future any of ( server started , process finished ) get ( get timeout ( ) to millis ( ) * 2 , time unit milliseconds ) ; if ( ! started ) { process = null ; throw new web driver exception ( " driver server process died prematurely " ) ; } } catch ( execution exception | timeout exception e ) { throw new web driver exception ( " timed out waiting for driver server to start " , e ) ; } catch ( interrupted exception e ) { thread current thread ( ) interrupt ( ) ; throw new web driver exception ( " timed out waiting for driver server to start " , e ) ; } } finally { lock unlock ( ) ; } }


gets the current connectivity state of the channel this method is threadsafe

connectivity state get state ( ) { connectivity state state copy = state ; if ( state copy = = null ) { throw new unsupported operation exception ( " channel state api is not implemented " ) ; } return state copy ; }


print strings as is ( no newline , a la php echo )

public void echo without escape html ( object args ) { print writer out = writer ( ) ; for ( object s : args ) { out print ( s ) ; } }


protected void create service warning view state ( final flow flow ) { val state warning = create view state ( flow , cas webflow constants state id show warning view , cas webflow constants view id confirm ) ; create transition for state ( state warning , cas webflow constants transition id success , " finalize warning " ) ; val finalize warn = create action state ( flow , " finalize warning " , " service warning action " ) ; create transition for state ( finalize warn , cas webflow constants state id redirect , cas webflow constants state id redirect ) ; }


public void set model key ( string model key ) { this model keys = collections singleton ( model key ) ; }


adds a route to the given handler function that handles all http { @ code post } requests that match the given predicate

builder post ( request predicate predicate , handler function < server response > handler function ) ;


normally , a workspace is assigned by { @ link hudson model run run execution } , but this lets you set the workspace in case { @ link abstract build } is created without a build

protected void set workspace ( @ non null file path ws ) { this workspace = ws get remote ( ) ; }


test case where there is no existing file

public void test write new file ( ) throws i o exception { output stream fos = new atomic file output stream ( dst file ) ; assert false ( dst file exists ( ) ) ; fos write ( test string get bytes ( ) ) ; fos flush ( ) ; assert false ( dst file exists ( ) ) ; fos close ( ) ; assert true ( dst file exists ( ) ) ; string read back data = new string ( files read all bytes ( dst file to path ( ) ) , utf 8 ) ; assert equals ( test string , read back data ) ; }


writes a number of lines of text to a source file using latin - 1 encoding

public path write ( string relative path , string lines ) throws i o exception { path path = get workspace ( ) get relative ( relative path ) ; return write absolute ( path , lines ) ; }


tells whether the input has text selected

public boolean is text selected ( ) { if ( hex edit control = = null ) return false ; long [ ] selection = hex edit control get selection ( ) ; return selection [ 0 ] ! = selection [ 1 ] ; }


public void start ( ) { view set presenter ( this ) ; view open ( ) ; }


applies the given class visitor to this mark ' s member , if any

public void accept member visitor ( member visitor member visitor ) { if ( clazz ! = null & & member ! = null ) { member accept ( clazz , member visitor ) ; } }


returns whether we are prohibiting hyphen ( ' - ' ) characters in the package paths of python targets and source files

boolean prohibit hyphens in package paths ( ) ;


add { @ link pool chunk } and { @ code handle } to the cache if there is enough room returns { @ code true } if it fit into the cache { @ code false } otherwise

boolean add ( pool arena < ? > area , pool chunk chunk , byte buffer nio buffer , long handle , int norm capacity , size class size class ) { int size idx = area size 2 size idx ( norm capacity ) ; memory region cache < ? > cache = cache ( area , size idx , size class ) ; if ( cache = = null ) { return false ; } return cache add ( chunk , nio buffer , handle , norm capacity ) ; }


test request scoped caching with a mixture of commands

public void test no request cache 3 ( ) { final test collapser timer timer = new test collapser timer ( ) ; successful cacheable collapsed command command 1 = new successful cacheable collapsed command ( timer , " a " , false ) ; successful cacheable collapsed command command 2 = new successful cacheable collapsed command ( timer , " b " , false ) ; successful cacheable collapsed command command 3 = new successful cacheable collapsed command ( timer , " b " , false ) ; future < string > f 1 = command 1 queue ( ) ; future < string > f 2 = command 2 queue ( ) ; future < string > f 3 = command 3 queue ( ) ; / / increment past batch time so it executes timer increment time ( 15 ) ; try { assert equals ( " a " , f 1 get ( 1000 , time unit milliseconds ) ) ; assert equals ( " b " , f 2 get ( 1000 , time unit milliseconds ) ) ; assert equals ( " b " , f 3 get ( 1000 , time unit milliseconds ) ) ; } catch ( exception e ) { throw new runtime exception ( e ) ; } future < string > f 4 = command 1 queue ( ) ; future < string > f 5 = command 2 queue ( ) ; future < string > f 6 = command 3 queue ( ) ; / / increment past batch time so it executes timer increment time ( 15 ) ; try { assert equals ( " a " , f 4 get ( 1000 , time unit milliseconds ) ) ; assert equals ( " b " , f 5 get ( 1000 , time unit milliseconds ) ) ; assert equals ( " b " , f 6 get ( 1000 , time unit milliseconds ) ) ; } catch ( exception e ) { throw new runtime exception ( e ) ; } / / request caching is turned off on this so we expect 2 command executions assert equals ( 2 , hystrix request log get current request ( ) get all executed commands ( ) size ( ) ) ; / / we expect to see it with success and collapsed and both hystrix invokable info < ? > command a = hystrix request log get current request ( ) get all executed commands ( ) to array ( new hystrix invokable info < ? > [ 2 ] ) [ 0 ] ; assert equals ( 2 , command a get execution events ( ) size ( ) ) ; assert true ( command a get execution events ( ) contains ( hystrix event type success ) ) ; assert true ( command a get execution events ( ) contains ( hystrix event type collapsed ) ) ; / / we expect to see it with success and collapsed and both hystrix invokable info < ? > command b = hystrix request log get current request ( ) get all executed commands ( ) to array ( new hystrix invokable info < ? > [ 2 ] ) [ 1 ] ; assert equals ( 2 , command b get execution events ( ) size ( ) ) ; assert true ( command b get execution events ( ) contains ( hystrix event type success ) ) ; assert true ( command b get execution events ( ) contains ( hystrix event type collapsed ) ) ; iterator < hystrix invokable info < ? > > cmd iterator = hystrix request log get current request ( ) get all executed commands ( ) iterator ( ) ; assert equals ( 2 , cmd iterator next ( ) get number collapsed ( ) ) ; / / 1 for a , 1 for b batch contains only unique arguments ( no duplicates ) assert equals ( 2 , cmd iterator next ( ) get number collapsed ( ) ) ; / / 1 for a , 1 for b batch contains only unique arguments ( no duplicates ) }


set the bitmask indicating the presence of the six potential connecting edges

public void set bitmask ( byte value bitmask ) { this bitmask = bitmask ; }


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


return a cleared { @ link native datagram packet array } that can be used for writes in this { @ link event loop }

native datagram packet array clean datagram packet array ( ) { if ( datagram packet array = = null ) { datagram packet array = new native datagram packet array ( ) ; } else { datagram packet array clear ( ) ; } return datagram packet array ; }


builds a cache which does not automatically load values when keys are requested unless a mapping function is provided note that multiple threads can concurrently load values for distinct keys consider { @ link # build ( cache loader ) } instead , if it is feasible to implement a { @ code cache loader } this method does not alter the state of this { @ code caffeine } instance , so it can be invoked again to create multiple independent caches

public < k1 extends k , v1 extends v > cache < k1 , v1 > build ( ) { require weight with weigher ( ) ; require non loading cache ( ) ; @ suppress warnings ( " unchecked " ) caffeine < k1 , v1 > self = ( caffeine < k1 , v1 > ) this ; return is bounded ( ) ? new bounded local cache bounded local manual cache < > ( self ) : new unbounded local cache unbounded local manual cache < > ( self ) ; }


not supported < b > you are attempting to create a multiset that may contain a non - { @ code comparable } element < b > proper calls will resolve to the version in { @ code immutable sorted multiset } , not this dummy version

public static < e > immutable sorted multiset < e > of ( e e 1 , e e 2 , e e 3 , e e 4 , e e 5 ) { throw new unsupported operation exception ( ) ; }


starts draining the codec for re - initialization re - initialization may occur immediately if no buffers have been queued to the codec

private void drain and reinitialize codec ( ) throws exo playback exception { if ( codec received buffers ) { codec drain state = drain state signal end of stream ; codec drain action = drain action reinitialize ; } else { / / nothing has been queued to the decoder , so we can re - initialize immediately reinitialize codec ( ) ; } }


returns a { @ link playback state compat custom action } which will be published to the media session by the connector or { @ code null } if this action should not be published at the given player state

playback state compat custom action get custom action ( player player ) ;


public builder seek ( long position ms ) { return apply ( new seek ( tag , position ms ) ) ; }


public void update recognizer test 3 ( ) { string sql = " update t 1 set name 1 = ' name 1 ' , name 2 = ' name 2 ' where id in ( ? , ? ) " ; s q l statement statement = get s q l statement ( sql ) ; my s q l update recognizer my s q l update recognizer = new my s q l update recognizer ( sql , statement ) ; assertions assert equals ( sql , my s q l update recognizer get original s q l ( ) ) ; assertions assert equals ( " t 1 " , my s q l update recognizer get table name ( ) ) ; assertions assert equals ( 2 , my s q l update recognizer get update columns ( ) size ( ) ) ; assertions assert equals ( " name 1 " , my s q l update recognizer get update columns ( ) get ( 0 ) ) ; assertions assert equals ( " name 1 " , my s q l update recognizer get update values ( ) get ( 0 ) ) ; assertions assert equals ( " name 2 " , my s q l update recognizer get update columns ( ) get ( 1 ) ) ; assertions assert equals ( " name 2 " , my s q l update recognizer get update values ( ) get ( 1 ) ) ; array list < list < object > > param appender list = new array list < > ( ) ; string where condition = my s q l update recognizer get where condition ( new parameters holder ( ) { @ override public map < integer , array list < object > > get parameters ( ) { array list < object > id 1 param = new array list < > ( ) ; id 1 param add ( " id 1 " ) ; array list < object > id 2 param = new array list < > ( ) ; id 2 param add ( " id 2 " ) ; map result = new hash map ( ) ; result put ( 1 , id 1 param ) ; result put ( 2 , id 2 param ) ; return result ; } } , param appender list ) ; assertions assert equals ( collections singleton list ( arrays as list ( " id 1 " , " id 2 " ) ) , param appender list ) ; assertions assert equals ( " id in ( ? , ? ) " , where condition ) ; }


customize the response for servlet request binding exception this method delegates to { @ link # handle exception internal }

protected response entity < object > handle servlet request binding exception ( servlet request binding exception ex , http headers headers , http status status , web request request ) { return handle exception internal ( ex , null , headers , status , request ) ; }


short - circuit integer : no threadsemaphore : thread thread pool full integer : no thread pool queue full integer : no timeout : no execution result : e m i tx 4 , failure , fallback e m i tx 4 , fallback success

public void test execution hook thread multiple emits then error then multiple fallback emits and then fallback success ( ) { assert hooks on success ( new func 0 < test hystrix observable command < integer > > ( ) { @ override public test hystrix observable command < integer > call ( ) { return get command ( execution isolation strategy thread , abstract test hystrix command execution result multiple emits then failure , 0 , abstract test hystrix command fallback result multiple emits then success ) ; } } , new action 1 < test hystrix observable command < integer > > ( ) { @ override public void call ( test hystrix observable command < integer > command ) { testable execution hook hook = command get builder ( ) execution hook ; assert true ( hook command emissions match ( 8 , 0 , 1 ) ) ; assert true ( hook execution events match ( 4 , 1 , 0 ) ) ; assert true ( hook fallback events match ( 4 , 0 , 1 ) ) ; assert equals ( runtime exception class , hook get execution exception ( ) get class ( ) ) ; assert equals ( " on start - on thread start - ! on run start - on execution start - " + " on execution emit - ! on run success - ! on complete - on emit - " + " on execution emit - ! on run success - ! on complete - on emit - " + " on execution emit - ! on run success - ! on complete - on emit - " + " on execution emit - ! on run success - ! on complete - on emit - " + " on execution error - ! on run error - on thread complete - on fallback start - " + " on fallback emit - ! on fallback success - ! on complete - on emit - " + " on fallback emit - ! on fallback success - ! on complete - on emit - " + " on fallback emit - ! on fallback success - ! on complete - on emit - " + " on fallback emit - ! on fallback success - ! on complete - on emit - " + " on fallback success - on success - " , command get builder ( ) execution hook execution sequence to string ( ) ) ; } } ) ; }


gets the absolute world position of this planet , taking into account all parents o ( n ) complexity

public vec 3 get world position ( vec 3 in ) { in set zero ( ) ; for ( planet current = this ; current ! = null ; current = current parent ) { current add parent offset ( in ) ; } return in ; }


boolean capture open files ( ) { return capture open files ; }


creates a { @ link search processor factory } based on bitap string search algorithm it is a jump free algorithm that has very stable performance ( the contents of the inputs have a minimal effect on it ) the limitation is that the { @ code needle } can be no more than 64 bytes long < br > precomputation ( this method ) time is linear in the size of the input ( { @ code o ( | needle | ) } ) < br > the factory allocates and retains a long [ 256 ] array < br > search ( the actual application of { @ link search processor } ) time is linear in the size of { @ link io netty buffer byte buf } on which the search is peformed ( { @ code o ( | haystack | ) } ) every byte of { @ link io netty buffer byte buf } is processed only once , sequentually

public static bitap search processor factory new bitap search processor factory ( byte [ ] needle ) { return new bitap search processor factory ( needle ) ; }


specifies a listener instance that caches should notify each time an entry is removed for any { @ linkplain removal cause reason } each cache created by this builder will invoke this listener as part of the routine maintenance described in the class documentation above < b > warning : < b > after invoking this method , do not continue to use this cache builder reference ; instead use the reference this method returns at runtime , these point to the same instance , but only the returned reference has the correct generic type information so as to ensure type safety for best results , use the standard method - chaining idiom illustrated in the class documentation above , configuring a builder and building your cache in a single statement failure to heed this advice can result in a { @ link class cast exception } being thrown by a cache operation at some undefined point in the future < b > warning : < b > any exception thrown by { @ code listener } will not be propagated to the { @ code cache } user , only logged via a { @ link logger }

public < k1 extends k , v1 extends v > cache builder < k1 , v1 > removal listener ( removal listener < ? super k1 , ? super v1 > listener ) { check state ( this removal listener = = null ) ; / / safely limiting the kinds of caches this can produce @ suppress warnings ( " unchecked " ) cache builder < k1 , v1 > me = ( cache builder < k1 , v1 > ) this ; me removal listener = check not null ( listener ) ; return me ; }


retrieves and removes the head of the queue represented by this deque ( in other words , the first element of this deque ) , or returns < tt > null < tt > if this deque is empty < p > this method is equivalent to { @ link # poll first ( ) }


update switch information from new switch domain

public void update ( switch domain new switch domain ) { switch domain set masters ( new switch domain get masters ( ) ) ; switch domain set ad weight map ( new switch domain get ad weight map ( ) ) ; switch domain set default push cache millis ( new switch domain get default push cache millis ( ) ) ; switch domain set client beat interval ( new switch domain get client beat interval ( ) ) ; switch domain set default cache millis ( new switch domain get default cache millis ( ) ) ; switch domain set distro threshold ( new switch domain get distro threshold ( ) ) ; switch domain set health check enabled ( new switch domain is health check enabled ( ) ) ; switch domain set auto change health check enabled ( new switch domain is auto change health check enabled ( ) ) ; switch domain set distro enabled ( new switch domain is distro enabled ( ) ) ; switch domain set push enabled ( new switch domain is push enabled ( ) ) ; switch domain set enable standalone ( new switch domain is enable standalone ( ) ) ; switch domain set check times ( new switch domain get check times ( ) ) ; switch domain set http health params ( new switch domain get http health params ( ) ) ; switch domain set tcp health params ( new switch domain get tcp health params ( ) ) ; switch domain set mysql health params ( new switch domain get mysql health params ( ) ) ; switch domain set incremental list ( new switch domain get incremental list ( ) ) ; switch domain set server status synchronization period millis ( new switch domain get server status synchronization period millis ( ) ) ; switch domain set service status synchronization period millis ( new switch domain get service status synchronization period millis ( ) ) ; switch domain set disable add i p ( new switch domain is disable add i p ( ) ) ; switch domain set send beat only ( new switch domain is send beat only ( ) ) ; switch domain set limited url map ( new switch domain get limited url map ( ) ) ; switch domain set distro server expired millis ( new switch domain get distro server expired millis ( ) ) ; switch domain set push go version ( new switch domain get push go version ( ) ) ; switch domain set push java version ( new switch domain get push java version ( ) ) ; switch domain set push python version ( new switch domain get push python version ( ) ) ; switch domain set push c version ( new switch domain get push c version ( ) ) ; switch domain set enable authentication ( new switch domain is enable authentication ( ) ) ; switch domain set overridden server status ( new switch domain get overridden server status ( ) ) ; switch domain set default instance ephemeral ( new switch domain is default instance ephemeral ( ) ) ; switch domain set light beat enabled ( new switch domain is light beat enabled ( ) ) ; }


create an open redirection url from a request it points to the same http f s endpoint but removes the " redirect " parameter

private uri create open redirection u r l ( uri info uri info ) { uri builder uri builder = uri info get request uri builder ( ) ; uri builder replace query param ( no redirect param name , ( object [ ] ) null ) ; return uri builder build ( ( object [ ] ) null ) ; }


a more human - friendly version of arrays # to string ( byte [ ] ) that uses hex representation

private static string byte array to string ( byte [ ] bytes ) { string builder builder = new string builder ( " [ " ) ; for ( int i = 0 ; i < bytes length ; i + + ) { if ( i > 0 ) { builder append ( " , " ) ; } builder append ( byte to string ( bytes [ i ] ) ) ; } return builder append ( ' ] ' ) to string ( ) ; }


< code > optional bytes data = 1 ; < code >

public boolean has data ( ) { return instance has data ( ) ; }


discard the task output this is called from a task ' s process to clean up a single task ' s output that can not yet been committed this may be called multiple times for the same task , but for different task attempts

public abstract void abort task ( task attempt context task context ) throws i o exception ;


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

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


removes and returns the extra data record with the specified id if it exists note : does not modify the underlying storage , only marks the record as removed

public extra data remove ( short id ) { return entries remove ( id ) ; }


geo shape values get geo shape values ( ) ;


retrieves the min delta progress required to log the task attempt current progress

public static double get task progress min delta threshold ( ) { if ( progress min delta threshold = = null ) { return progress min delta factor * m r job config task log progress delta threshold default ; } return progress min delta threshold double value ( ) ; }


called on the start of each build , giving extensions a chance to intercept the data that is written to the log even though this method is not marked ' abstract ' , this is the method that must be overridden by extensions

public output stream decorate logger ( run build , output stream logger ) throws i o exception , interrupted exception { / / this implementation is backward compatibility thunk in case subtypes only override the / / old signature ( abstract build , output stream ) if ( build instanceof abstract build ) { / / maybe the plugin implements the old signature return decorate logger ( ( abstract build ) build , logger ) ; } else { / / this console log filter can only decorate abstract build , so just pass through return logger ; } }


advance cursor by n positions within the block

private void in block advance ( long n ) throws i o exception { for ( long i = 0 ; i < n ; + + i ) { check key ( ) ; if ( ! value buffer input stream is closed ( ) ) { value buffer input stream close ( ) ; } klen = - 1 ; current location inc record index ( ) ; } }


this test makes sure that even when the decoder is confronted with various chunk sizes in the middle of decoding , it can recover and decode all the time eventually

public void should handle non uniform network batches ( ) { byte buf incoming = unpooled copied buffer ( set request with content ) ; while ( incoming is readable ( ) ) { channel write inbound ( incoming read bytes ( 5 ) ) ; } incoming release ( ) ; binary memcache request request = channel read inbound ( ) ; assert that ( request , not null value ( ) ) ; assert that ( request key ( ) , not null value ( ) ) ; assert that ( request extras ( ) , null value ( ) ) ; request release ( ) ; memcache content content 1 = channel read inbound ( ) ; memcache content content 2 = channel read inbound ( ) ; assert that ( content 1 , instance of ( memcache content class ) ) ; assert that ( content 2 , instance of ( last memcache content class ) ) ; assert that ( content 1 content ( ) readable bytes ( ) , is ( 3 ) ) ; assert that ( content 2 content ( ) readable bytes ( ) , is ( 5 ) ) ; content 1 release ( ) ; content 2 release ( ) ; }


appends data of the specified channel to this { @ link sort buffer } and returns true if all bytes of the source buffer is copied to this { @ link sort buffer } successfully , otherwise if returns false , nothing will be copied

boolean append ( byte buffer source , int target channel , buffer data type data type ) throws i o exception ;


perform a language fallback , server - side

static object node merge languages ( object node preferred , object node fallback ) { object node results = parsing utilities mapper create object node ( ) ; iterator < entry < string , json node > > iterator = fallback fields ( ) ; while ( iterator has next ( ) ) { entry < string , json node > entry = iterator next ( ) ; string code = entry get key ( ) ; json node value = preferred get ( code ) ; if ( value = = null ) { ; value = entry get value ( ) ; } results set ( code , value ) ; } return results ; }


sets the < code > namespace array < code > property

public void set namespace array ( list < integer > namespace array ) { this namespace array = namespace array ; }


returns all nodes in this network adjacent to { @ code node } which can be reached by traversing { @ code node } ' s outgoing edges in the direction ( if any ) of the edge in an undirected network , this is equivalent to { @ link # adjacent nodes ( object ) } this is not the same as " all nodes reachable from { @ code node } by following outgoing edges " for that functionality , see { @ link graphs # reachable nodes ( graph , object ) }


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


create a service instance level meter entity

public static meter entity new service instance ( string service name , string service instance ) { return new meter entity ( scope type service instance , service name , service instance , null ) ; }


public cancellable stop watch service async ( stop watch service request request , request options options , action listener < acknowledged response > listener ) { return rest high level client perform request async and parse entity ( request , watcher request converters : : stop watch service , options , acknowledged response : : from x content , listener , empty set ( ) ) ; }


if not sure has the active span , use this method , will be cause npe when has no active span , use context manager : : is active method to determine whether there has the active span

public static abstract span active span ( ) { return get ( ) active span ( ) ; }


helper method to determine a limit ' s collation

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


public int [ ] execute batch ( ) throws s q l exception { connection mark commit state dirty ( ) ; return delegate execute batch ( ) ; }


returns the ratio of cache requests which were hits this is defined as { @ code hit count request count } , or { @ code 1 0 } when { @ code request count = = 0 } note that { @ code hit rate + miss rate = ~ 1 0 }

public double hit rate ( ) { long request count = request count ( ) ; return ( request count = = 0 ) ? 1 0 : ( double ) hit count / request count ; }


create the default origin text message with local hostname and timestamp

public static string create default origin message ( ) { return string format ( " created on % s at time % s " , net utils get hostname ( ) , java time instant now ( ) ) ; }


returns a size field that gives the number of bytes of data at that offset

public int get size ( ) { return size ; }


gets the evaluation result for this metric

optional < ? extends evaluation metric result > get result ( ) ;


returns whether the given objects are the same

public static boolean equal ( object object 1 , object object 2 ) { return object 1 = = null ? object 2 = = null : object 1 equals ( object 2 ) ; }


calculate list of file statuses assuming path to be a non - empty directory

public triple < remote iterator < s 3 a file status > , dir listing metadata , boolean > get file statuses assuming non empty dir ( path path ) throws i o exception { string key = path to key ( path ) ; list < s 3 a file status > result ; if ( ! key is empty ( ) ) { key = key + ' / ' ; } boolean allow authoritative = listing operation callbacks allow authoritative ( path ) ; dir listing metadata dir meta = s 3 guard list children with ttl ( get store context ( ) get metadata store ( ) , path , listing operation callbacks get updated ttl time provider ( ) , allow authoritative ) ; / / in auth mode return directly with auth flag if ( allow authoritative & & dir meta ! = null & & dir meta is authoritative ( ) ) { remote iterator < s 3 a file status > mfs itr = create provided file status iterator ( s 3 guard dir meta to statuses ( dir meta ) , accept all , listing accept all but s3n ) ; return triple of ( mfs itr , dir meta , boolean true ) ; } s 3 list request request = create list objects request ( key , " / " ) ; log debug ( " list status : doing list objects for directory { } " , key ) ; file status listing iterator files itr = create file status listing iterator ( path , request , accept all , new listing accept all but self and s 3n dirs ( path ) ) ; / / return the results obtained from s 3 return triple of ( files itr , dir meta , boolean false ) ; }


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


called after we read the whole line of plain text , which is stored in { @ link # buf } this method performs annotations and send the result to { @ link # out }

protected void eol ( byte [ ] in , int sz ) throws i o exception { line reset ( ) ; final string buffer str buf = line get string buffer ( ) ; int next = console note find preamble ( in , 0 , sz ) ; list < console annotator < t > > annotators = null ; { / / perform byte [ ] - > char [ ] while figuring out the char positions of the b l o bs int written = 0 ; while ( next > = 0 ) { if ( next > written ) { line out write ( in , written , next - written ) ; line out flush ( ) ; written = next ; } else { assert next = = written ; } / / character position of this annotation in this line final int char pos = str buf length ( ) ; int rest = sz - next ; byte array input stream b = new byte array input stream ( in , next , rest ) ; try { final console note a = console note read from ( new data input stream ( b ) ) ; if ( a ! = null ) { if ( annotators = = null ) annotators = new array list < > ( ) ; annotators add ( new console annotator < t > ( ) { @ override public console annotator < t > annotate ( t context , markup text text ) { return a annotate ( context , text , char pos ) ; } } ) ; } } catch ( i o exception | class not found exception e ) { / / if we failed to resurrect an annotation , ignore it logger log ( level fine , " failed to resurrect annotation from \ " " + string escape utils escape java ( new string ( in , next , rest ) ) + " \ " " , e ) ; } int bytes used = rest - b available ( ) ; / / bytes consumed by annotations written + = bytes used ; next = console note find preamble ( in , written , sz - written ) ; } / / finish the remaining bytes - > chars conversion line out write ( in , written , sz - written ) ; if ( annotators ! = null ) { / / aggregate newly retrieved console annotators into the current one if ( ann ! = null ) annotators add ( ann ) ; ann = console annotator combine ( annotators ) ; } } line out flush ( ) ; markup text mt = new markup text ( str buf to string ( ) ) ; if ( ann ! = null ) ann = ann annotate ( context , mt ) ; out write ( mt to string ( true ) ) ; / / this perform escapes }


process the given arg list as command line arguments to the data node to make sure we get the expected result if the expected result is success then further validate that the parsed startup option is the same as what was expected

private static void check expected ( boolean expect success , startup option expected option , configuration conf , string arg ) { string [ ] args = new string [ arg length ] ; int i = 0 ; for ( string current arg : arg ) { args [ i + + ] = current arg ; } boolean return value = data node parse arguments ( args , conf ) ; startup option option = data node get startup option ( conf ) ; assert that ( return value , is ( expect success ) ) ; if ( expect success ) { assert that ( option , is ( expected option ) ) ; } }


add a callback to be invoked on processing within transaction synchronization , i e when { @ link # process event } is being triggered during actual transactions

void add callback ( synchronization callback callback ) ;


returns the number of rows that are visible in the viewport

public int get num rows in viewport ( ) { return viewport get height ( ) / table get row height ( ) ; }


returns the appropriate { @ code invoke - super } rop for the given type the result is typically a newly - allocated instance

public static rop op invoke super ( prototype meth ) { return new rop ( reg ops invoke super , meth get parameter frame types ( ) , std type list throwable ) ; }


void remove tree listener ( ) { tree remove tree listener ( ) ; }


returns true if there is an edge that directly connects { @ code endpoints } ( in the order , if any , specified by { @ code endpoints } ) this is equivalent to { @ code edges ( ) contains ( endpoints ) } unlike the other { @ code endpoint pair } - accepting methods , this method does not throw if the endpoints are unordered and the graph is directed ; it simply returns { @ code false } this is for consistency with the behavior of { @ link collection # contains ( object ) } ( which does not generally throw if the object cannot be present in the collection ) , and the desire to have this method ' s behavior be compatible with { @ code edges ( ) contains ( endpoints ) }

boolean has edge connecting ( endpoint pair < n > endpoints ) ; / / / / graph identity / /


creates a time limiter instance using the given executor service to execute method calls < b > warning : < b > using a bounded executor may be counterproductive ! if the thread pool fills up , any time callers spend waiting for a thread may count toward their time limit , and in this case the call may even time out before the target method is ever invoked

public static simple time limiter create ( executor service executor ) { return new simple time limiter ( executor ) ; }


set a custom port number for the target service

public api client set port ( int port ) { this port = port ; return this ; }


returns the { @ link media format } signalled by the underlying { @ link media codec } call this < b > after < b > { @ link # dequeue output buffer index } returned { @ link media codec # info output format changed }

public media format get output format ( ) throws illegal state exception { if ( current format = = null ) { throw new illegal state exception ( ) ; } return current format ; }


allows to iterate over all currently active streams this method may only be called from the eventloop thread

protected final void for each active stream ( http 2 frame stream visitor stream visitor ) throws http 2 exception { frame codec for each active stream ( stream visitor ) ; }


public list < integer > get namespace wrapped array ( ) { return namespace wrapped array ; }


adds the path of a custom file required to run the job on a task manager

public void add user artifact ( string name , distributed cache distributed cache entry file ) { if ( file = = null ) { throw new illegal argument exception ( ) ; } user artifacts put if absent ( name , file ) ; }


public static void set rules ( string rule string ) { rules = ( rule string ! = null ) ? parse rules ( rule string ) : null ; }


close the connection , unless a { @ link smart data source } doesn ' t want us to

public static void do close connection ( connection con , @ nullable data source data source ) throws s q l exception { if ( ! ( data source instanceof smart data source ) | | ( ( smart data source ) data source ) should close ( con ) ) { con close ( ) ; } }