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

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


whether to use the default pretty printer when writing the output this is a shortcut for setting up an { @ code object mapper } as follows : < pre class = " code " > object mapper mapper = new object mapper ( ) ; mapper configure ( serialization feature indent output , true ) ; the default value is { @ code false }

public void set pretty print ( boolean pretty print ) { this pretty print = pretty print ; configure pretty print ( ) ; }


return true if this action implies that action

public boolean implies ( fs action that ) { if ( that ! = null ) { return ( ordinal ( ) & that ordinal ( ) ) = = that ordinal ( ) ; } return false ; }


same as { @ link # create ( string , fs permission , enum set , boolean , short , long , progressable , int , checksum opt , inet socket address [ ] ) } with the addition of ec policy name that is used to specify a specific erasure coding policy instead of inheriting any policy from this new file ' s parent directory this policy will be persisted in hdfs a value of null means inheriting parent groups ' whatever policy

public d f s output stream create ( string src , fs permission permission , enum set < create flag > flag , boolean create parent , short replication , long block size , progressable progress , int buffersize , checksum opt checksum opt , inet socket address [ ] favored nodes , string ec policy name ) throws i o exception { return create ( src , permission , flag , create parent , replication , block size , progress , buffersize , checksum opt , favored nodes , ec policy name , null ) ; }


public final cancellable reindex async ( reindex request reindex request , request options options , action listener < bulk by scroll response > listener ) { return perform request async and parse entity ( reindex request , request converters : : reindex , options , bulk by scroll response : : from x content , listener , singleton ( 409 ) ) ; }


performs the default outgoing bpmn 2 0 behavior , which is having parallel paths of executions for the outgoing sequence flow more precisely : every sequence flow that has a condition which evaluates to true ( or which doesn ' t have a condition ) , is selected for continuation of the process instance if multiple sequencer flow are selected , multiple , parallel paths of executions are created

public void perform default outgoing behavior ( execution entity activity execution ) { perform outgoing behavior ( activity execution , true , false ) ; }


returns the quotient of the given particular float value and this float value

public float value divide of ( particular float value other ) { return divide of ( ( specific float value ) other ) ; }


implementation of the invoke method of the sink function class collects the incoming tuples in tuple list and appends the list to the end of the target file if update condition ( ) is true or the current tuple is the end tuple

public void invoke ( in tuple ) { tuple list add ( tuple ) ; if ( update condition ( ) ) { format write ( path , tuple list ) ; reset parameters ( ) ; } }


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


a static method to get the { @ link stream execution environment } configuration merged with python dependency management configurations

public static configuration get env config with dependencies ( stream execution environment env ) throws invocation target exception , illegal access exception , no such method exception { return python dependency utils configure python dependencies ( env get cached files ( ) , get environment config ( env ) ) ; }


sets whether to decode all the frames and store them in memory this should only ever be used for animations that are known to be small ( e g stickers ) caching dozens of large bitmaps in memory for general g i fs or web p ' s will not fit in memory

public t set decode all frames ( boolean decode all frames ) { m decode all frames = decode all frames ; return get this ( ) ; }


figure out the best ( most common ) format for the set of files , select all files which match that format , and return the format found

static public string auto select files ( importing job job , object node retrieval record , array node file selection indexes ) { final map < string , integer > format to count = new hash map < string , integer > ( ) ; list < string > formats = new array list < string > ( ) ; array node file records = j s o n utilities get array ( retrieval record , " files " ) ; int count = file records size ( ) ; for ( int i = 0 ; i < count ; i + + ) { object node file record = j s o n utilities get object element ( file records , i ) ; string format = j s o n utilities get string ( file record , " format " , null ) ; if ( format ! = null ) { if ( format to count contains key ( format ) ) { format to count put ( format , format to count get ( format ) + 1 ) ; } else { format to count put ( format , 1 ) ; formats add ( format ) ; } } } collections sort ( formats , new comparator < string > ( ) { @ override public int compare ( string o 1 , string o 2 ) { return format to count get ( o 2 ) - format to count get ( o 1 ) ; } } ) ; / / default to " text " to to avoid parsing as " binary / excel " / / " text " is more general than " text / line - based " , so a better starting point string best format = formats size ( ) > 0 ? formats get ( 0 ) : " text " ; if ( j s o n utilities get int ( retrieval record , " archive count " , 0 ) = = 0 ) { / / if there ' s no archive , then select everything for ( int i = 0 ; i < count ; i + + ) { j s o n utilities append ( file selection indexes , i ) ; } } else { / / otherwise , select files matching the best format for ( int i = 0 ; i < count ; i + + ) { object node file record = j s o n utilities get object element ( file records , i ) ; string format = j s o n utilities get string ( file record , " format " , null ) ; if ( format ! = null & & format equals ( best format ) ) { j s o n utilities append ( file selection indexes , i ) ; } } / / if nothing matches the best format but we have some files , / / then select them all if ( file selection indexes size ( ) = = 0 & & count > 0 ) { for ( int i = 0 ; i < count ; i + + ) { j s o n utilities append ( file selection indexes , i ) ; } } } return best format ; }


send a message to the specified destination , converting the payload to a { @ code byte [ ] } with the help of a { @ link org springframework messaging converter message converter message converter }

receiptable send ( string destination , object payload ) ;


@ t c description : nacos ， ( ) @ test step : todo test steps @ expect result : todo expect results

public void nacos add listener 6 ( ) throws interrupted exception , nacos exception { properties properties = new properties ( ) ; properties put ( property key const server addr , " 127 0 0 1 " + " : " + port ) ; properties put ( property key const enable remote sync config , " true " ) ; properties put ( property key const context path , context path ) ; config service iconfig = nacos factory create config service ( properties ) ; final atomic integer count = new atomic integer ( 0 ) ; final string data id = " nacos add listener 6 " ; final string group = " nacos add listener 6 " ; final string content = " test - abc " ; final string new content = " new - test - def " ; boolean result = iconfig publish config ( data id , group , content ) ; assert assert true ( result ) ; thread sleep ( 2000 ) ; listener ml = new abstract listener ( ) { @ override public void receive config info ( string config info ) { count increment and get ( ) ; system out println ( " listener receive : [ " + config info + " ] " ) ; assert assert equals ( new content , config info ) ; } } ; iconfig add listener ( data id , group , ml ) ; string receive content = iconfig get config ( data id , group , 1000 ) ; system out println ( receive content ) ; result = iconfig publish config ( data id , group , new content ) ; assert assert true ( result ) ; thread sleep ( 2000 ) ; receive content = iconfig get config ( data id , group , 1000 ) ; assert assert equals ( new content , receive content ) ; assert assert equals ( 1 , count get ( ) ) ; iconfig remove listener ( data id , group , ml ) ; }


finds the record by a specific id person p = lite pal find ( person class , 1 ) ; the model class determines which table to query and the object type to return if no record can be found , then return null < br > note that the associated models won ' t be loaded by default considering the efficiency , but you can do that by using { @ link operator # find ( class , long , boolean ) }

public static < t > t find ( class < t > model class , long id ) { return find ( model class , id , false ) ; }


sets the polygon to be rotated by the supplied degrees

public void set rotation ( float degrees ) { this rotation = degrees ; dirty = true ; }


protected static list < string > message list ( ) { return caliper runner value list ( " 500 , 1500 , 3000 , 5000 , 10000 , 20000 , 50000 , 100000 " ) ; }


gets the string representation of the current enum

public string get xml attribute name ( ) { return name ( ) to lower case ( ) ; }


private void connect tools ( ) { tool manager tm = plugin get active project ( ) get tool manager ( ) ; if ( tool connection dialog = = null ) { tool connection dialog = new tool connection dialog ( tool , tm ) ; } else { tool connection dialog set tool manager ( tm ) ; } tool connection dialog set visible ( true ) ; / / dialog handles the connections }


override for storage that does upserts and cannot return the original spans

protected boolean returns raw spans ( ) { return true ; }


unsubscribe the provided listener from all job updates

public void remove listener ( @ non null job tracker job listener listener ) { job tracker remove listener ( listener ) ; }


public i o statistics get i o statistics ( ) { return io statistics store ; }


adds a variables extension to template the toolchain for this link action

public cpp link action builder add variables extension ( variables extension variables extension ) { this variables extensions add ( variables extension ) ; return this ; }


closes the given print stream , or closes it if is the standard output

private void close print stream ( print stream print stream ) { if ( print stream = = system out ) { print stream flush ( ) ; } else { print stream close ( ) ; } }


submit two opportunistic and one guaranteed containers the resources requests by each container as such that only one can run in parallel thus , the opportunistic container that started running , will be killed for the guaranteed container to start once the guaranteed container finishes its execution , the remaining opportunistic container will be executed

public void test kill opportunistic for guaranteed container ( ) throws exception { container manager start ( ) ; list < start container request > list = new array list < > ( ) ; list add ( start container request new instance ( record factory new record instance ( container launch context class ) , create container token ( create container id ( 0 ) , dummy rm identifier , context get node id ( ) , user , builder utils new resource ( 2048 , 1 ) , context get container token secret manager ( ) , null , execution type opportunistic ) ) ) ; list add ( start container request new instance ( record factory new record instance ( container launch context class ) , create container token ( create container id ( 1 ) , dummy rm identifier , context get node id ( ) , user , builder utils new resource ( 2048 , 1 ) , context get container token secret manager ( ) , null , execution type opportunistic ) ) ) ; list add ( start container request new instance ( record factory new record instance ( container launch context class ) , create container token ( create container id ( 2 ) , dummy rm identifier , context get node id ( ) , user , builder utils new resource ( 2048 , 1 ) , context get container token secret manager ( ) , null , execution type guaranteed ) ) ) ; start containers request all requests = start containers request new instance ( list ) ; container manager start containers ( all requests ) ; base container manager test wait for n m container state ( container manager , create container id ( 0 ) , container state done , 40 ) ; thread sleep ( 5000 ) ; / / get container statuses container 0 should be killed , container 1 / / should be queued and container 2 should be running list < container id > stat list = new array list < container id > ( ) ; for ( int i = 0 ; i < 3 ; i + + ) { stat list add ( create container id ( i ) ) ; } get container statuses request stat request = get container statuses request new instance ( stat list ) ; list < container status > container statuses = container manager get container statuses ( stat request ) get container statuses ( ) ; for ( container status status : container statuses ) { if ( status get container id ( ) equals ( create container id ( 0 ) ) ) { assert assert true ( status get diagnostics ( ) contains ( " container killed to make room for guaranteed container " ) ) ; } else if ( status get container id ( ) equals ( create container id ( 1 ) ) ) { assert assert equals ( container sub state scheduled , status get container sub state ( ) ) ; } else if ( status get container id ( ) equals ( create container id ( 2 ) ) ) { assert assert equals ( container sub state running , status get container sub state ( ) ) ; } system out println ( " \ n status : [ " + status + " ] \ n " ) ; } assert assert equals ( 1 , metrics get queued opportunistic containers ( ) ) ; assert assert equals ( 0 , metrics get queued guaranteed containers ( ) ) ; / / make sure the remaining opportunistic container starts its execution base container manager test wait for n m container state ( container manager , create container id ( 2 ) , container state done , 40 ) ; thread sleep ( 5000 ) ; stat request = get container statuses request new instance ( arrays as list ( create container id ( 1 ) ) ) ; container status cont status 1 = container manager get container statuses ( stat request ) get container statuses ( ) get ( 0 ) ; assert assert equals ( org apache hadoop yarn api records container state running , cont status 1 get state ( ) ) ; assert assert equals ( 0 , metrics get queued opportunistic containers ( ) ) ; assert assert equals ( 0 , metrics get queued guaranteed containers ( ) ) ; }


applies a group combine function on a grouped { @ link data set } a combine function is similar to a group reduce function but does not perform a full data exchange instead , the combine function calls the combine method once per partition for combining a group of results this operator is suitable for combining values into an intermediate format before doing a proper group reduce where the data is shuffled across the node for further reduction the group reduce operator can also be supplied with a combiner by implementing the rich group reduce function the combine method of the rich group reduce function demands input and output type to be the same the combine function , on the other side , can have an arbitrary output type

public < r > group combine operator < t , r > combine group ( group combine function < t , r > combiner ) { if ( combiner = = null ) { throw new null pointer exception ( " group combine function must not be null " ) ; } type information < r > result type = type extractor get group combine return types ( combiner , this get input data set ( ) get type ( ) , utils get call location name ( ) , true ) ; return new group combine operator < > ( this , result type , input data set clean ( combiner ) , utils get call location name ( ) ) ; }


set the parameter name discoverer to use for resolving method parameter names if needed ( e g for constructor names ) default is a { @ link default parameter name discoverer }

public void set parameter name discoverer ( @ nullable parameter name discoverer parameter name discoverer ) { this parameter name discoverer = parameter name discoverer ; }


protected void add headers ( api response response , list < codegen property > properties ) { if ( response get headers ( ) ! = null ) { for ( map entry < string , header > header entry : response get headers ( ) entry set ( ) ) { string description = header entry get value ( ) get description ( ) ; / / follow the $ ref header header = model utils get referenced header ( this open a p i , header entry get value ( ) ) ; schema schema ; if ( header get schema ( ) = = null ) { logger warn ( " no schema defined for header ' " + header entry get key ( ) + " ' , using a string schema " ) ; schema = new string schema ( ) ; } else { schema = header get schema ( ) ; } codegen property cp = from property ( header entry get key ( ) , schema ) ; cp set description ( escape text ( description ) ) ; cp set unescaped description ( description ) ; if ( header get required ( ) ! = null ) { cp set required ( header get required ( ) ) ; } else { cp set required ( false ) ; } properties add ( cp ) ; } } }


public long get count ( ) { return count ; }


returns the currently configured delta threshold

public float get threshold ( ) { return threshold ; }


public string get type name ( ) { return type name ; }


public void test model 2 0 0 response ( ) { / / todo : test model 2 0 0 response }


public response entity < string > handle post request ( final http servlet request request , final http servlet response response ) throws exception { return handle get request ( request , response ) ; }


public synchronized boolean wait for finish ( ) throws throwable { while ( ! done & & exception = = null ) { wait ( ) ; } if ( exception ! = null ) { throw exception ; } return done ; }


sets the text color to use for the labels make sure to use get resources ( ) get color ( ) when using a color from the resources

public void set text color ( int color ) { m text color = color ; }


returns true if the task can be canceled

public boolean can cancel ( ) { return can cancel ; }


public void can be committed async test ( global session global session ) { assertions assert false ( global session can be committed async ( ) ) ; }


collect all hidden tokens ( any off - default channel ) to the left of the current token up until we see a token on default token channel

public list < token > get hidden tokens to left ( int token index ) { return get hidden tokens to left ( token index , - 1 ) ; }


append information that will be included in the locally generated deadline exceeded errors to the given { @ link insight builder } , in order to tell the user about the state of the stream so that they can better diagnose the cause of the error

void append timeout insight ( insight builder insight ) ;


affects the size of the node it is applied to padding will not add to the total size of an element if it has an explicit size set see < a href = " https : yogalayout comdocsmargins - paddings - borders " > https : yogalayout comdocsmargins - paddings - borders for more information

public t padding px ( @ nullable yoga edge edge , @ px int padding ) { m component get or create common props ( ) padding px ( edge , padding ) ; return get this ( ) ; }


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


public void invalidate all text ( ) { string map clear ( ) ; invalidate ( ) ; }


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

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


draws a curve using { @ link shape type # line }

public void curve ( float x 1 , float y 1 , float cx 1 , float cy 1 , float cx 2 , float cy 2 , float x 2 , float y 2 , int segments ) { check ( shape type line , null , segments * 2 + 2 ) ; float color bits = color to float bits ( ) ; / / algorithm from : http : / / www antigrain com / research / bezier interpolation / index html # page bezier interpolation float subdiv step = 1f / segments ; float subdiv step 2 = subdiv step * subdiv step ; float subdiv step 3 = subdiv step * subdiv step * subdiv step ; float pre 1 = 3 * subdiv step ; float pre 2 = 3 * subdiv step 2 ; float pre 4 = 6 * subdiv step 2 ; float pre 5 = 6 * subdiv step 3 ; float tmp 1x = x 1 - cx 1 * 2 + cx 2 ; float tmp 1y = y 1 - cy 1 * 2 + cy 2 ; float tmp 2x = ( cx 1 - cx 2 ) * 3 - x 1 + x 2 ; float tmp 2y = ( cy 1 - cy 2 ) * 3 - y 1 + y 2 ; float fx = x 1 ; float fy = y 1 ; float dfx = ( cx 1 - x 1 ) * pre 1 + tmp 1x * pre 2 + tmp 2x * subdiv step 3 ; float dfy = ( cy 1 - y 1 ) * pre 1 + tmp 1y * pre 2 + tmp 2y * subdiv step 3 ; float ddfx = tmp 1x * pre 4 + tmp 2x * pre 5 ; float ddfy = tmp 1y * pre 4 + tmp 2y * pre 5 ; float dddfx = tmp 2x * pre 5 ; float dddfy = tmp 2y * pre 5 ; while ( segments - - > 0 ) { renderer color ( color bits ) ; renderer vertex ( fx , fy , 0 ) ; fx + = dfx ; fy + = dfy ; dfx + = ddfx ; dfy + = ddfy ; ddfx + = dddfx ; ddfy + = dddfy ; renderer color ( color bits ) ; renderer vertex ( fx , fy , 0 ) ; } renderer color ( color bits ) ; renderer vertex ( fx , fy , 0 ) ; renderer color ( color bits ) ; renderer vertex ( x 2 , y 2 , 0 ) ; }


returns the { @ link sub cluster info } of all active sub cluster ( s )

public map < sub cluster id , sub cluster info > get sub clusters ( final boolean filter inactive sub clusters ) throws yarn exception { try { if ( is caching enabled ( ) ) { return ( map < sub cluster id , sub cluster info > ) cache get ( build get sub clusters cache request ( filter inactive sub clusters ) ) ; } else { return build sub cluster info map ( state store get sub clusters ( get sub clusters info request new instance ( filter inactive sub clusters ) ) ) ; } } catch ( throwable ex ) { throw new yarn exception ( ex ) ; } }


returns whether the given target is a test suite target if this returns true , then { @ link # is rule } must also return true for the target , but { @ link # is test rule } must return false ; test suites are not test rules , and vice versa


create an { @ link environment } for the command to use overrideable for tests

protected environment create env ( final map < string , string > settings ) throws user exception { return create env ( settings empty , settings ) ; }


public boolean get has teeth ( ) { return has teeth ; }


tests that when restoring from a snapshot and we find a node with a shard copy and allocation deciders say yes , we allocate to that node

public void test restore ( ) { routing allocation allocation = get restore routing allocation ( yes allocation deciders ( ) , random long ( ) , " alloc id " ) ; test allocator add data ( node 1 , " some alloc id " , random boolean ( ) ) ; allocate all unassigned ( allocation ) ; assert that ( allocation routing nodes changed ( ) , equal to ( true ) ) ; assert that ( allocation routing nodes ( ) unassigned ( ) ignored ( ) is empty ( ) , equal to ( true ) ) ; assert that ( allocation routing nodes ( ) shards with state ( shard routing state initializing ) size ( ) , equal to ( 1 ) ) ; assert cluster health status ( allocation , cluster health status yellow ) ; }


tests that formerly used task managers can again timeout after all of their slots have been freed

public void test timeout for unused task manager ( ) throws exception { final long task manager timeout = 50l ; final completable future < instance i d > released resource future = new completable future < > ( ) ; final resource actions resource manager actions = new testing resource actions builder ( ) set release resource consumer ( ( instance i d , e ) - > released resource future complete ( instance i d ) ) build ( ) ; final resource manager id resource manager id = resource manager id generate ( ) ; final scheduled executor scheduled executor = testing utils default scheduled executor ( ) ; final resource i d resource id = resource i d generate ( ) ; final job i d job id = new job i d ( ) ; final allocation i d allocation id = new allocation i d ( ) ; final resource profile resource profile = resource profile unknown ; final slot request slot request = new slot request ( job id , allocation id , resource profile , " foobar " ) ; final completable future < slot i d > requested slot future = new completable future < > ( ) ; final task executor gateway task executor gateway = new testing task executor gateway builder ( ) set request slot function ( tuple 6 - > { requested slot future complete ( tuple 6 f 0 ) ; return completable future completed future ( acknowledge get ( ) ) ; } ) create testing task executor gateway ( ) ; final task executor connection task manager connection = new task executor connection ( resource id , task executor gateway ) ; final slot i d slot id 1 = new slot i d ( resource id , 0 ) ; final slot i d slot id 2 = new slot i d ( resource id , 1 ) ; final slot status slot status 1 = new slot status ( slot id 1 , resource profile any ) ; final slot status slot status 2 = new slot status ( slot id 2 , resource profile any ) ; final slot report initial slot report = new slot report ( arrays as list ( slot status 1 , slot status 2 ) ) ; final executor main thread executor = testing utils default executor ( ) ; try ( final slot manager impl slot manager = create slot manager builder ( ) set task manager timeout ( time of ( task manager timeout , time unit milliseconds ) ) set redundant task manager num ( 0 ) build ( ) ) { slot manager start ( resource manager id , main thread executor , resource manager actions ) ; completable future supply async ( ( ) - > { try { return slot manager register slot request ( slot request ) ; } catch ( resource manager exception e ) { throw new completion exception ( e ) ; } } , main thread executor ) then run ( ( ) - > slot manager register task manager ( task manager connection , initial slot report , resource profile any , resource profile any ) ) ; final slot i d slot id = requested slot future get ( ) ; completable future < boolean > idle future = completable future supply async ( ( ) - > slot manager is task manager idle ( task manager connection get instance i d ( ) ) , main thread executor ) ; / / check that the task manager is not idle assert false ( idle future get ( ) ) ; completable future < task manager slot > slot future = completable future supply async ( ( ) - > slot manager get slot ( slot id ) , main thread executor ) ; task manager slot slot = slot future get ( ) ; assert true ( slot get state ( ) = = slot state allocated ) ; assert equals ( allocation id , slot get allocation id ( ) ) ; completable future < boolean > idle future 2 = completable future run async ( ( ) - > slot manager free slot ( slot id , allocation id ) , main thread executor ) then apply ( ( object value ) - > slot manager is task manager idle ( task manager connection get instance i d ( ) ) ) ; assert true ( idle future 2 get ( ) ) ; assert that ( released resource future get ( ) , is ( equal to ( task manager connection get instance i d ( ) ) ) ) ; } }


unadjust address offset for certain pre - linked binaries which do not adjust certain header fields ( e g , dynamic table address entries ) this may be needed when updating a header address field which requires pre - link adjustment

public long unadjust address for prelink ( long address ) { / / todo : how do we ensure that adjustment is only made to / / addresses in the default space ? should loads into / / data space have the same adjustment ? long base = get pre link image base ( ) ; if ( base = = - 1 ) { base = 0 ; } return address - base ; }


regression test for bug : " illegal argument exception in path package locator create ( ) "

public void test dollar signs ( ) throws exception { path workspace = scratch dir ( " / some / path / to / workspace $ 1 " ) ; path package locator create ( null , immutable list of ( " % workspace % / blabla " ) , reporter , workspace , workspace get relative ( " foo " ) , bazel skyframe executor constants build files by priority ) ; }


receive notification of a parameter predicate

void param ( string name , string value ) ;


only { @ link # get name ( ) } is considered

public int hash code ( ) { return get name ( ) hash code ( ) ; }


checks various conditions for file access if all checks pass this method returns , and processing of the request may continue if any check fails this method throws a { @ link rest handler exception } , and further processing of the request must be limited to sending an error response

public static void check file validity ( file file , file root path , logger logger ) throws i o exception , rest handler exception { / / this check must be done first to prevent probing for arbitrary files if ( ! file get canonical file ( ) to path ( ) starts with ( root path to path ( ) ) ) { if ( logger is debug enabled ( ) ) { logger debug ( " requested path { } points outside the root directory " , file get absolute path ( ) ) ; } throw new rest handler exception ( " forbidden " , forbidden ) ; } if ( ! file exists ( ) | | file is hidden ( ) ) { if ( logger is debug enabled ( ) ) { logger debug ( " requested path { } cannot be found " , file get absolute path ( ) ) ; } throw new rest handler exception ( " file not found " , not found ) ; } if ( file is directory ( ) | | ! file is file ( ) ) { if ( logger is debug enabled ( ) ) { logger debug ( " requested path { } does not point to a file " , file get absolute path ( ) ) ; } throw new rest handler exception ( " file not found " , method not allowed ) ; } }


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

b allow ( http method allowed methods ) ;


public void add allowed header ( string allowed header ) { if ( this allowed headers = = null ) { this allowed headers = new array list < > ( 4 ) ; } else if ( this allowed headers = = default permit all ) { set allowed headers ( default permit all ) ; } this allowed headers add ( allowed header ) ; }


called at the end of repository verification process this method should perform all necessary cleanup of the temporary files created in the repository

void end verification ( string verification token ) ;


computes sample size for downscaling image size ( < b > src size < b > ) to view size ( < b > target size < b > ) this sample size is used during { @ linkplain bitmap factory # decode stream ( java io input stream , android graphics rect , android graphics bitmap factory options ) decoding image } to bitmap < br > < br > < b > examples : < b > < br > < p > src size ( 1 0 0x 1 0 0 ) , target size ( 1 0x 1 0 ) , power of 2 scale = true - > sample size = 8 src size ( 1 0 0x 1 0 0 ) , target size ( 1 0x 1 0 ) , power of 2 scale = false - > sample size = 10 src size ( 1 0 0x 1 0 0 ) , target size ( 2 0x 4 0 ) , view scale type = fit inside - > sample size = 5 src size ( 1 0 0x 1 0 0 ) , target size ( 2 0x 4 0 ) , view scale type = crop - > sample size = 2 < p > < br > the sample size is the number of pixels in either dimension that correspond to a single pixel in the decoded bitmap for example , in sample size = = 4 returns an image that is 14 the widthheight of the original , and 116 the number of pixels any value < = 1 is treated the same as 1

public static int compute image sample size ( image size src size , image size target size , view scale type view scale type , boolean power of 2 scale ) { final int src width = src size get width ( ) ; final int src height = src size get height ( ) ; final int target width = target size get width ( ) ; final int target height = target size get height ( ) ; int scale = 1 ; switch ( view scale type ) { case fit inside : if ( power of 2 scale ) { final int half width = src width / 2 ; final int half height = src height / 2 ; while ( ( half width / scale ) > target width | | ( half height / scale ) > target height ) { / / | | scale * = 2 ; } } else { scale = math max ( src width / target width , src height / target height ) ; / / max } break ; case crop : if ( power of 2 scale ) { final int half width = src width / 2 ; final int half height = src height / 2 ; while ( ( half width / scale ) > target width & & ( half height / scale ) > target height ) { / / & & scale * = 2 ; } } else { scale = math min ( src width / target width , src height / target height ) ; / / min } break ; } if ( scale < 1 ) { scale = 1 ; } scale = consider max texture size ( src width , src height , scale , power of 2 scale ) ; return scale ; }


set this to true to enable drawing the labels of this axis ( this will not affect drawing the grid lines or axis lines )

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


public void hand in ( string key , v obj ) { if ( ! retrieve shared queue ( key ) offer ( obj ) ) { throw new runtime exception ( " could not register the given element , broker slot is already occupied " ) ; } }


convert the given time duration in the given unit to this unit conversions from finer to coarser granularities truncate , so lose precision for example converting { @ code 999 } milliseconds to seconds results in { @ code 0 } conversions from coarser to finer granularities with arguments that would numerically overflow saturate to { @ code long min value } if negative or { @ code long max value } if positive for example , to convert 10 minutes to milliseconds , use : { @ code time unit milliseconds convert ( 10l , time unit minutes ) }

public long convert ( long source duration , time unit source unit ) { throw new abstract method error ( ) ; }


set of ports associated with the endpoint the ports must be associated with a port name that was declared as part of the service do not use for ` unix : ` addresses < code > map & lt ; string , uint 3 2 & gt ; ports = 2 ; < code >

public builder remove ports ( java lang string key ) { if ( key = = null ) { throw new java lang null pointer exception ( ) ; } internal get mutable ports ( ) get mutable map ( ) remove ( key ) ; return this ; }


kill all background processes must hold { @ code < uses - permission android : name = " android permission kill background processes " > }

public static set < string > kill all background processes ( ) { activity manager am = ( activity manager ) utils get app ( ) get system service ( context activity service ) ; list < activity manager running app process info > info = am get running app processes ( ) ; set < string > set = new hash set < > ( ) ; if ( info = = null ) return set ; for ( activity manager running app process info a info : info ) { for ( string pkg : a info pkg list ) { am kill background processes ( pkg ) ; set add ( pkg ) ; } } info = am get running app processes ( ) ; for ( activity manager running app process info a info : info ) { for ( string pkg : a info pkg list ) { set remove ( pkg ) ; } } return set ; }


in a standalone setup there is no support for placeholder values embedded in request mappings this method allows manually provided placeholder values so they can be resolved alternatively consider creating a test that initializes a { @ link web application context }

public standalone mock mvc builder add placeholder value ( string name , string value ) { this placeholder values put ( name , value ) ; return this ; }


tests that a failing resource manager request fails a pending slot request and cancels the slot request at the rm ( e g due to a timeout exception ) see flink - 7870

public void test failing resource manager request fails pending slot request and cancels r m request ( ) throws exception { try ( slot pool impl slot pool = create and set up slot pool ( resource manager gateway ) ) { final completable future < acknowledge > request slot future = new completable future < > ( ) ; final completable future < allocation i d > cancel slot future = new completable future < > ( ) ; final completable future < allocation i d > request slot future allocation id = new completable future < > ( ) ; resource manager gateway set request slot future ( request slot future ) ; resource manager gateway set request slot consumer ( slot request - > request slot future allocation id complete ( slot request get allocation id ( ) ) ) ; resource manager gateway set cancel slot consumer ( cancel slot future : : complete ) ; final completable future < physical slot > slot future = request new allocated slot ( slot pool , new slot request id ( ) ) ; request slot future complete exceptionally ( new flink exception ( " testing exception " ) ) ; try { slot future get ( ) ; fail ( " the slot future should not have been completed properly " ) ; } catch ( exception ignored ) { / / expected } / / check that a failure triggered the slot request cancellation / / with the correct allocation id assert equals ( request slot future allocation id get ( ) , cancel slot future get ( ) ) ; } }


set the query parameter values replacing existing values , or if no values are given , the query parameter is removed note : please , review the javadoc of { @ link # query param ( string , object ) } for further notes on the treatment and encoding of individual query parameters

uri builder replace query param ( string name , object values ) ;


deserialize the { @ link public symbol information } from the appropriate stream in the pdb

void deserialize ( int stream number , task monitor monitor ) throws i o exception , pdb exception , cancelled exception { super deserialize ( stream number , monitor ) ; pdb byte reader reader = pdb get reader for stream number ( stream number , monitor ) ; deserialize pub header ( reader ) ; pdb byte reader hash reader = reader get sub pdb byte reader ( symbol hash length ) ; deserialize hash table ( hash reader , monitor ) ; pdb byte reader address map reader = reader get sub pdb byte reader ( address map length ) ; deserialize address map ( address map reader , monitor ) ; pdb byte reader thunk map reader = reader get sub pdb byte reader ( thunk map length ) ; deserialize thunk map ( thunk map reader , monitor ) ; / * * see note in { @ link # deserialize pub header ( pdb byte reader ) } regarding spurious data * for num sections because of this , we will assume the rest of the data in the * reader belongs to the section map and set the appropriate variable values here * / section map length = reader num remaining ( ) ; if ( section map length % 8 ! = 0 ) { throw new pdb exception ( " section map length size not multiple of 8 " ) ; } num sections = section map length / 8 ; pdb byte reader section map reader = reader get sub pdb byte reader ( section map length ) ; deserialize section map ( section map reader , monitor ) ; / / organize the information generate symbols list ( monitor ) ; }


private void records written ( final int count ) { instrumentation records written ( count ) ; }


merges the sorted runs described by the given channel i ds into a single sorted run the merging process uses the given read and write buffers

private channel with block count merge channels ( list < channel with block count > channel i ds , list < list < memory segment > > read buffers , list < memory segment > write buffers ) throws i o exception { / / the list with the readers , to be closed at shutdown final list < file i o channel > channel accesses = new array list < > ( channel i ds size ( ) ) ; / / the list with the target iterators final merge iterator < e > merge iterator = get merging iterator ( channel i ds , read buffers , channel accesses , null ) ; / / create a new channel writer final file i o channel id merged channel i d = this io manager create channel ( ) ; spill channel manager register channel to be removed at shutdown ( merged channel i d ) ; final block channel writer < memory segment > writer = this io manager create block channel writer ( merged channel i d ) ; spill channel manager register open channel to be removed at shutdown ( writer ) ; final channel writer output view output = new channel writer output view ( writer , write buffers , this mem manager get page size ( ) ) ; open spilling behaviour ( ) ; spilling behaviour merge records ( merge iterator , output ) ; output close ( ) ; final int num blocks written = output get block count ( ) ; / / register merged result to be removed at shutdown spill channel manager unregister open channel to be removed at shutdown ( writer ) ; / / remove the merged channel readers from the clear - at - shutdown list for ( file i o channel access : channel accesses ) { access close and delete ( ) ; spill channel manager unregister open channel to be removed at shutdown ( access ) ; } return new channel with block count ( merged channel i d , num blocks written ) ; }


calculate a routing value to be used , either the included index request ' s routing , or retrieved document ' s routing when defined

static string calculate routing ( get result get result , @ nullable index request update index request ) { if ( update index request ! = null & & update index request routing ( ) ! = null ) { return update index request routing ( ) ; } else if ( get result get fields ( ) contains key ( routing field mapper name ) ) { return get result field ( routing field mapper name ) get value ( ) to string ( ) ; } else { return null ; } }


return the configured resolvers for controller method arguments

public argument resolver configurer get argument resolver configurer ( ) { return this argument resolver configurer ; }


get set of namespace info ' s removing the already invoked namespaceinfo

private set < federation namespace info > get name space info ( string ns id ) { set < federation namespace info > namespace infos = new hash set < > ( ) ; for ( federation namespace info ns : namespace infos ) { if ( ! ns id equals ( ns get nameservice id ( ) ) ) { namespace infos add ( ns ) ; } } return namespace infos ; }


sets a format string to use for the flag that is passed to original command the format string must have a single " % s " that will be replaced by the execution path to the param file

public builder set flag format string ( string flag format string ) { this flag format string = flag format string ; return this ; }


by default , tests will fail if any shard created by this class fails tests that cause failures by design can call this method to ignore those failures

protected void allow shard failures ( ) { fail on shard failures set ( false ) ; }


prepare the compressor to be used in a new stream with settings defined in the given configuration it will reset the compressor ' s compression level and compression strategy

public void reinit ( configuration conf ) { reset ( ) ; if ( conf = = null ) { return ; } end ( stream ) ; level = zlib factory get compression level ( conf ) ; strategy = zlib factory get compression strategy ( conf ) ; stream = init ( level compression level ( ) , strategy compression strategy ( ) , window bits window bits ( ) ) ; if ( log is debug enabled ( ) ) { log debug ( " reinit compressor with new compression configuration " ) ; } }


public void fatal ( throwable cause , char sequence message ) { this log fatal ( message , cause ) ; }


public list < token > get tokens ( ) { return tokens ; }


returns an ordered list based on modules name

public list < plugin info > get module infos ( ) { list < plugin info > modules = new array list < > ( this modules ) ; collections sort ( modules , comparator comparing ( plugin info : : get name ) ) ; return modules ; }


generate delay millis list by given plans string , separated by comma < br > eg , 03 : 00 - 05 : 00 , 13 : 00 - 14 : 00

public static list < long > get delay mills list ( string schedule plans ) { list < long > result = new array list < > ( ) ; string [ ] plans = string utils split ( schedule plans , ' , ' ) ; for ( string plan : plans ) { result add ( get delay millis ( plan ) ) ; } return result ; }


returns an { @ code immutable list } containing all of the elements from this { @ code fluent iterable } in the order specified by { @ code comparator } to produce an { @ code immutable list } sorted by its natural ordering , use { @ code to sorted list ( ordering natural ( ) ) } < b > { @ code stream } equivalent : < b > { @ code immutable list copy of ( stream sorted ( comparator ) iterator ( ) ) } , or pass { @ link immutable list # to immutable list } to { @ code stream sorted ( comparator ) collect ( ) }

public final immutable list < e > to sorted list ( comparator < ? super e > comparator ) { return ordering from ( comparator ) immutable sorted copy ( get delegate ( ) ) ; }


public static local container entity manager factory bean new entity manager factory bean ( final jpa configuration context config ) { val bean = new local container entity manager factory bean ( ) ; bean set jpa vendor adapter ( config get jpa vendor adapter ( ) ) ; if ( config get persistence provider ( ) ! = null ) { bean set persistence provider ( config get persistence provider ( ) ) ; } if ( string utils is not blank ( config get persistence unit name ( ) ) ) { bean set persistence unit name ( config get persistence unit name ( ) ) ; } if ( ! config get packages to scan ( ) is empty ( ) ) { bean set packages to scan ( config get packages to scan ( ) to array ( array utils empty string array ) ) ; } if ( config get data source ( ) ! = null ) { bean set data source ( config get data source ( ) ) ; } bean get jpa property map ( ) put all ( config get jpa properties ( ) ) ; return bean ; }


build new web application service simple web application service

protected static abstract web application service new web application service ( final http servlet request request , final string service to use ) { val artifact id = optional of nullable ( request ) map ( http servlet request - > http servlet request get parameter ( cas protocol constants parameter ticket ) ) or else ( null ) ; val id = cleanup url ( service to use ) ; val new service = new simple web application service impl ( id , service to use , artifact id ) ; determine web application format ( request , new service ) ; val source = get source parameter ( request , cas protocol constants parameter target service , cas protocol constants parameter service ) ; new service set source ( source ) ; if ( request ! = null ) { populate attributes ( new service , request ) ; } return new service ; }


checks that a plan with consecutive u n i o ns followed by partition by hash is correctly translated the program can be illustrated as follows : src 1 - \ > - > union 1 2 - - < src 2 - \ > - > union 1 2 3 - > partition by hash - > output src 3 - - - - - - - - - - - - - - - - in the resulting plan , the hash partitioning ( shipping strategy partition hash ) must be pushed to the inputs of the unions ( src 1 , src 2 , src 3 )

public void test consecutive unions with hash partitioning ( ) throws exception { / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - / / build test program / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - execution environment env = execution environment get execution environment ( ) ; env set parallelism ( default parallelism ) ; data set < tuple 2 < long , long > > src 1 = env from elements ( new tuple 2 < > ( 0l , 0l ) ) ; data set < tuple 2 < long , long > > src 2 = env from elements ( new tuple 2 < > ( 0l , 0l ) ) ; data set < tuple 2 < long , long > > src 3 = env from elements ( new tuple 2 < > ( 0l , 0l ) ) ; data set < tuple 2 < long , long > > union 1 2 = src 1 union ( src 2 ) ; data set < tuple 2 < long , long > > union 1 2 3 = union 1 2 union ( src 3 ) ; union 1 2 3 partition by hash ( 1 ) output ( new discarding output format < tuple 2 < long , long > > ( ) ) name ( " out " ) ; / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - / / verify optimized plan / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - optimized plan optimized plan = compile no stats ( env create program plan ( ) ) ; optimizer plan node resolver resolver = get optimizer plan node resolver ( optimized plan ) ; single input plan node sink = resolver get node ( " out " ) ; / / check partitioning is correct assert equals ( " sink input should be hash partitioned " , partitioning property hash partitioned , sink get input ( ) get global properties ( ) get partitioning ( ) ) ; assert equals ( " sink input should be hash partitioned on 1 " , new field list ( 1 ) , sink get input ( ) get global properties ( ) get partitioning fields ( ) ) ; single input plan node partitioner = ( single input plan node ) sink get input ( ) get source ( ) ; assert true ( partitioner get driver strategy ( ) = = driver strategy unary no op ) ; assert equals ( " partitioner input should be hash partitioned " , partitioning property hash partitioned , partitioner get input ( ) get global properties ( ) get partitioning ( ) ) ; assert equals ( " partitioner input should be hash partitioned on 1 " , new field list ( 1 ) , partitioner get input ( ) get global properties ( ) get partitioning fields ( ) ) ; assert equals ( " partitioner input channel should be forwarding " , ship strategy type forward , partitioner get input ( ) get ship strategy ( ) ) ; n ary union plan node union = ( n ary union plan node ) partitioner get input ( ) get source ( ) ; / / all union inputs should be hash partitioned for ( channel c : union get inputs ( ) ) { assert equals ( " union input should be hash partitioned " , partitioning property hash partitioned , c get global properties ( ) get partitioning ( ) ) ; assert equals ( " union input channel should be hash partitioning " , ship strategy type partition hash , c get ship strategy ( ) ) ; assert true ( " union input should be data source " , c get source ( ) instanceof source plan node ) ; } }


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


returns the single edge that directly connects { @ code endpoints } ( in the order , if any , specified by { @ code endpoints } ) , if one is present , or { @ code optional empty ( ) } if no such edge exists if this graph is directed , the endpoints must be ordered

optional < e > edge connecting ( endpoint pair < n > endpoints ) ;


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


retrieves a string representing the state of the job queue intended for debugging

synchronized @ non null string get debug info ( ) { list < job spec > jobs = job storage get all job specs ( ) ; list < constraint spec > constraints = job storage get all constraint specs ( ) ; list < dependency spec > dependencies = job storage get all dependency specs ( ) ; string builder info = new string builder ( ) ; info append ( " - - jobs \ n " ) ; if ( ! jobs is empty ( ) ) { stream of ( jobs ) for each ( j - > info append ( j to string ( ) ) append ( ' \ n ' ) ) ; } else { info append ( " none \ n " ) ; } info append ( " \ n - - constraints \ n " ) ; if ( ! constraints is empty ( ) ) { stream of ( constraints ) for each ( c - > info append ( c to string ( ) ) append ( ' \ n ' ) ) ; } else { info append ( " none \ n " ) ; } info append ( " \ n - - dependencies \ n " ) ; if ( ! dependencies is empty ( ) ) { stream of ( dependencies ) for each ( d - > info append ( d to string ( ) ) append ( ' \ n ' ) ) ; } else { info append ( " none \ n " ) ; } return info to string ( ) ; }


public collection < couch db cas event > find by type for principal id ( final string type , final string principal id ) { val view = create query ( " by type for principal id " ) key ( complex key of ( type , principal id ) ) ; return db query view ( view , couch db cas event class ) ; }


scan through the given input , and perform the defined actions

protected void run ( scanner scanner ) { string current profile name = null ; try { while ( scanner has next line ( ) ) { string line = scanner next line ( ) trim ( ) ; / / empty or comment lines if ( line is empty ( ) | | line starts with ( " # " ) ) { on empty or comment line ( current profile name , line ) ; continue ; } / / parse group name returns null if this line does not / / indicate a new property group string new profile name = parse profile name ( line ) ; boolean at new profile starting line = new profile name ! = null ; if ( at new profile starting line ) { if ( current profile name ! = null ) { on profile ending line ( current profile name ) ; } on profile starting line ( new profile name , line ) ; / / start the new profile current profile name = new profile name ; } else { / / parse the property line entry < string , string > property = parse property line ( line ) ; if ( current profile name = = null ) { throw new illegal argument exception ( " property is defined without a preceding profile name " + " current line : " + line ) ; } on profile property ( current profile name , property get key ( ) , property get value ( ) , is supported property ( property get key ( ) ) , line ) ; } } / / eof if ( current profile name ! = null ) { on profile ending line ( current profile name ) ; } on end of file ( ) ; } finally { scanner close ( ) ; } }


adds a character to this sequence matcher

public boolean add char ( int c ) { last sequence = null ; current index + + ; if ( char set contains ( c ) ) { if ( ! in ascii sequence & & meets alignment requirement ( ) ) { sequence start index = current index ; in ascii sequence = true ; } } else if ( c = = 0 ) { return check sequence ( sequence start index , current index , true ) ; } else { return check sequence ( sequence start index , current index - 1 , false ) ; } return false ; }


public domain event read next ( ) { if ( index > = events size ( ) ) { return null ; } var event = events get ( index ) ; index + + ; var parser = new json parser ( ) ; var json element = parser parse ( event ) ; var event class name = json element get as json object ( ) get ( " event class name " ) get as string ( ) ; var gson = new gson ( ) ; domain event domain event ; if ( event class name equals ( " account create event " ) ) { domain event = gson from json ( json element , account create event class ) ; } else if ( event class name equals ( " money deposit event " ) ) { domain event = gson from json ( json element , money deposit event class ) ; } else if ( event class name equals ( " money transfer event " ) ) { domain event = gson from json ( json element , money transfer event class ) ; } else { throw new runtime exception ( " journal event not recegnized " ) ; } domain event set real time ( false ) ; return domain event ; }


sets the restart strategy to be used for recovery { @ code execution config config = env get config ( ) ; config set restart strategy ( restart strategies fixed delay restart ( 10 , number of retries 1000 delay between retries ) ) ; }

public void set restart strategy ( restart strategies restart strategy configuration restart strategy configuration ) { this restart strategy configuration = preconditions check not null ( restart strategy configuration ) ; }


queues a write operation to be handled by the event loop this can be called by any thread and is the api available for non - selector threads to schedule writes when invoked from the selector thread the write will be executed right away

public void queue write ( write operation write operation ) { if ( is on current thread ( ) ) { write to channel ( write operation ) ; } else { queued writes offer ( write operation ) ; if ( is open ( ) = = false ) { boolean was removed = queued writes remove ( write operation ) ; if ( was removed ) { write operation get listener ( ) accept ( null , new closed selector exception ( ) ) ; } } else { wakeup ( ) ; } } }


searches in this string for the index of the specified char { @ code ch } the search for the char starts at the specified offset { @ code start } and moves towards the end of this string

public int index of ( char ch , int start ) { if ( ch > max char value ) { return index not found ; } if ( start < 0 ) { start = 0 ; } final byte ch as byte = c 2b 0 ( ch ) ; final int len = offset + length ; for ( int i = start + offset ; i < len ; + + i ) { if ( value [ i ] = = ch as byte ) { return i - offset ; } } return index not found ; }


register the status of network changed listener

public static void register network status changed listener ( final on network status changed listener listener ) { network changed receiver get instance ( ) register listener ( listener ) ; }


configuration mutations applied directly in - memory as such , there is no persistent configuration store as there is no configuration store for versioning purposes , a conf store version is not applicable

public version get conf store version ( ) throws exception { / / does nothing return null ; }


public void test boolean array merger ( ) { boolean [ ] array one = { true , false } ; boolean [ ] array two = { false } ; boolean [ ] result = merger factory get merger ( boolean [ ] class ) merge ( array one , array two , null ) ; assertions assert equals ( 3 , result length ) ; boolean [ ] merged result = { true , false , false } ; for ( int i = 0 ; i < merged result length ; i + + ) { assertions assert equals ( merged result [ i ] , result [ i ] ) ; } result = merger factory get merger ( boolean [ ] class ) merge ( null ) ; assertions assert equals ( 0 , result length ) ; result = merger factory get merger ( boolean [ ] class ) merge ( null , null ) ; assertions assert equals ( 0 , result length ) ; }


generate error view stuffing the code and description of the error into the model view name is set to { @ link # failure view }

private model and view generate error view ( final string code , final object [ ] args , final http servlet request request ) { val model and view = new model and view ( this failure view ) ; model and view add object ( " code " , string escape utils escape html 4 ( code ) ) ; val desc = string escape utils escape html 4 ( this context get message ( code , args , code , request get locale ( ) ) ) ; model and view add object ( " description " , desc ) ; return model and view ; }


test serialization of outer boolean types

public api response < boolean > fake outer boolean serialize with http info ( boolean body ) throws api exception { okhttp 3 call local var call = fake outer boolean serialize validate before call ( body , null ) ; type local var return type = new type token < boolean > ( ) { } get type ( ) ; return local var api client execute ( local var call , local var return type ) ; }


the radius of the distortion , ranging from 0 0 to 1 0 , with a default of 0 5

public void set radius ( float radius ) { this radius = radius ; set float ( radius location , radius ) ; }


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


the allocation id uniquely identifying an allocation , note , if it is relocation the { @ link # get relocation id ( ) } need to be taken into account as well

public string get id ( ) { return id ; }


rebuilds the dependency map asynchronously this would keep the ui thread more responsive and helps avoid the deadlocks , as dependency graph recomputation tends to touch a lot of other things

public future < dependency graph > rebuild dependency graph async ( ) { dependency graph dirty set ( true ) ; return timer get ( ) schedule ( new java util concurrent callable < dependency graph > ( ) { @ override public dependency graph call ( ) throws exception { if ( dependency graph dirty get ( ) ) { rebuild dependency graph ( ) ; } return dependency graph ; } } , 500 , time unit milliseconds ) ; }


{ @ inherit doc } also automatically sets the { @ link # set default heartbeat default heartbeat } property to " 10000 , 10000 " if it is currently set to " 0 , 0 "

public void set task scheduler ( @ nullable task scheduler task scheduler ) { if ( ! is default heartbeat enabled ( ) ) { set default heartbeat ( new long [ ] { 10000 , 10000 } ) ; } super set task scheduler ( task scheduler ) ; }


this method fails the vertex due to an external condition the task will move to state failed if the task was in state running or deploying before , it will send a cancel call to the task manager

public void fail ( throwable t ) { process fail ( t , true ) ; }


tests that the checkpoint coordinator is shut down if the execution graph is failed

public void test shutdown checkpoint coordinator on failure ( ) throws exception { final completable future < job status > counter shutdown future = new completable future < > ( ) ; checkpoint i d counter counter = new testing checkpoint i d counter ( counter shutdown future ) ; final completable future < job status > store shutdown future = new completable future < > ( ) ; completed checkpoint store store = new testing completed checkpoint store ( store shutdown future ) ; final scheduler base scheduler = create scheduler and enable checkpointing ( counter , store ) ; final execution graph graph = scheduler get execution graph ( ) ; final checkpoint coordinator checkpoint coordinator = graph get checkpoint coordinator ( ) ; assert that ( checkpoint coordinator , matchers not null value ( ) ) ; assert that ( checkpoint coordinator is shutdown ( ) , is ( false ) ) ; graph fail global ( new exception ( " test exception " ) ) ; assert that ( checkpoint coordinator is shutdown ( ) , is ( true ) ) ; assert that ( counter shutdown future get ( ) , is ( job status failed ) ) ; assert that ( store shutdown future get ( ) , is ( job status failed ) ) ; }


public static void fail state machine ( process context context , exception exp ) { state machine instance state machine instance = ( state machine instance ) context get variable ( domain constants var name statemachine inst ) ; state machine config state machine config = ( state machine config ) context get variable ( domain constants var name statemachine config ) ; state machine config get status decision strategy ( ) decide on task state fail ( context , state machine instance , exp ) ; state machine instance get end params ( ) put all ( ( map < string , object > ) context get variable ( domain constants var name statemachine context ) ) ; state instruction instruction = context get instruction ( state instruction class ) ; instruction set end ( true ) ; state machine instance set running ( false ) ; state machine instance set gmt end ( new date ( ) ) ; state machine instance set exception ( exp ) ; if ( state machine instance get state machine ( ) is persist ( ) & & state machine config get state log store ( ) ! = null ) { state machine config get state log store ( ) record state machine finished ( state machine instance , context ) ; } async callback callback = ( async callback ) context get variable ( domain constants var name async callback ) ; if ( callback ! = null ) { callback on error ( context , state machine instance , exp ) ; } }


retrieve the attributes of the annotation of the given type , if any ( i e if defined on the underlying element , as direct annotation or meta - annotation ) , also taking attribute overrides on composed annotations into account

default map < string , object > get annotation attributes ( string annotation name , boolean class values as string ) { merged annotation < annotation > annotation = get annotations ( ) get ( annotation name , null , merged annotation selectors first directly declared ( ) ) ; if ( ! annotation is present ( ) ) { return null ; } return annotation as annotation attributes ( adapt values ( class values as string , true ) ) ; }


a helper api for creating an audit event object

static audit event create log event ( string user , string operation , result result ) { audit event event = new audit event ( result ) ; event add entry ( field name user , user ) ; event add entry ( field name operation , operation ) ; return event ; }


public set < string > get photo urls ( ) { return photo urls ; }


public record number get type record number ( ) { return type record number ; }


public void set first name ( string first name ) { this first name = first name ; }


test for { @ link sample bean } discovery if a factory with the default name is set , an endpoint will use it automatically

protected void test sample configuration ( application context context ) { jms listener container test factory default factory = context get bean ( " jms listener container factory " , jms listener container test factory class ) ; jms listener container test factory simple factory = context get bean ( " simple factory " , jms listener container test factory class ) ; assert that ( default factory get listener containers ( ) size ( ) ) is equal to ( 1 ) ; assert that ( simple factory get listener containers ( ) size ( ) ) is equal to ( 1 ) ; }


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


returns an enum instance that corresponds to the setting stored , or the { @ link # get default enum ( ) default enum } if the setting has not been assigned yet

public t get enum value ( settings settings ) { return get enum value ( settings , default value ) ; }


find an { @ link annotation } of { @ code annotation type } on the specified bean , traversing its interfaces and super classes if no annotation can be found on the given class itself , as well as checking the bean ' s factory method ( if any )

< a extends annotation > a find annotation on bean ( string bean name , class < a > annotation type ) throws no such bean definition exception ;


public job i d get job id ( ) { return job i d for name ( datum get jobid ( ) to string ( ) ) ; }


public static builder new builder ( ) { return new builder ( ) ; }


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

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


public synchronized advice get advice ( ) { if ( this instantiated advice = = null ) { this instantiated advice = instantiate advice ( this declared pointcut ) ; } return this instantiated advice ; }


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


gets the minimum score below which docs will be filtered out

public float min score ( ) { return min score ; }


positive test to verify file delete with sticky bit on parent

public void test single file delete with sticky bit positive ( ) throws throwable { path parent dir = new path ( " / test single file delete with sticky bit positive " ) ; path test path = new path ( parent dir , " test dat " ) ; authorizer add auth rule for owner ( " / " , write , true ) ; authorizer add auth rule for owner ( parent dir to string ( ) , write , true ) ; fs update wasb authorizer ( authorizer ) ; try { fs create ( test path ) ; contract test utils assert path exists ( fs , " test path was not created " , test path ) ; / / set stickybit on parent directory fs set permission ( parent dir , new fs permission ( stickybit permission constant ) ) ; assert true ( fs delete ( test path , true ) ) ; contract test utils assert path does not exist ( fs , " test path exists after deletion ! " , test path ) ; } finally { allow recursive delete ( fs , parent dir to string ( ) ) ; fs delete ( parent dir , true ) ; } }


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

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


find the best address space to use for the reference if the space was unknown

private int get reference space i d ( instruction instruction , long offset ) { / / todo : this should be passed to the client callback to make the decision if ( offset < = 4 & & offset > = - 1 ) { return - 1 ; / / don ' t make speculative reference to certain offset values } address space default space = program get language ( ) get default data space ( ) ; / / if only one memory space , no overlays , just return default space if ( memory spaces size ( ) = = 1 ) { return default space get space i d ( ) ; } int real mem space cnt = 0 ; / / count of real memory spaces that could contain the target int containing mem space cnt = 0 ; / / number of memory blocks that have the target defined address containing addr = null ; int symbol target cnt = 0 ; / / number of targets with a primary symbol at the address address symbol target = null ; / / primary symbol target address space instr space = instruction get min address ( ) get address space ( ) ; / / find likely preferred target space / / 1 only non - overlay space is default space , or / / 2 presence of destination symbol / reference at only one of many possible targets / / if this instruction is in an overlay space overlaying the default space , change the default space if ( instr space is overlay space ( ) & & ( ( overlay address space ) instr space ) get base space i d ( ) = = default space get space i d ( ) ) { default space = instr space ; } for ( address space space : memory spaces ) { if ( space is overlay space ( ) ) { if ( space ! = instr space ) { continue ; / / skip overlay spaces which do not contain instruction } } else { / / don ' t add overlay spaces to real mem space cnt + + real mem space cnt ; } address addr = space get truncated address ( offset , true ) ; if ( space is overlay space ( ) & & ! addr get address space ( ) equals ( space ) ) { continue ; / / overlay space address ended up in the base space , don ' t use it twice } if ( space has mapped registers ( ) & & program get register ( addr ) ! = null ) { if ( ! space is overlay space ( ) ) { real mem space cnt - - ; } continue ; / / skip registers } if ( program get memory ( ) contains ( addr ) ) { containing mem space cnt + + ; containing addr = addr ; } if ( program get reference manager ( ) has references to ( addr ) | | program get symbol table ( ) get primary symbol ( addr ) ! = null ) { symbol target cnt + + ; symbol target = addr ; } } / / if only one memory space held a valid value , use it if ( containing mem space cnt = = 1 & & containing addr ! = null ) { return containing addr get address space ( ) get space i d ( ) ; } if ( symbol target cnt = = 1 & & symbol target ! = null ) { return symbol target get address space ( ) get space i d ( ) ; } / / nothing to lead to one space or the other , and code / data spaces are not the same if ( real mem space cnt ! = 1 & & ! default spaces are the same ) { return - 1 ; } return default space get space i d ( ) ; }


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


allows the user to enable and disable the table ' s feature that triggers navigation on certain selection events , like mouse clicking and pressing the ' enter ' key

public void set navigate on selection enabled ( boolean enabled ) { navigate on selection = enabled ; }


constant instance that represents no changes

public static change log set < ? extends change log set entry > create empty ( run build ) { return new empty change log set ( build ) ; }


returns the { @ link batch segregating criteria } of this group

public batch segregating criteria get criteria ( ) { return criteria ; }


public object get anytype 3 ( ) { return anytype 3 ; }


method to check whether we are allowed to make any configuration changes at this time if the class has been compiled , then no further changes to the configuration are allowed

protected void check if configuration modification is allowed ( ) { if ( is compiled ( ) ) { throw new invalid data access api usage exception ( " configuration cannot be altered once the class has been compiled or used " ) ; } }


returns the default { @ link delegation token authenticator } class to use when an { @ link delegation token authenticated u r l } instance is created without specifying one the default class is { @ link kerberos delegation token authenticator }

public static class < ? extends delegation token authenticator > get default delegation token authenticator ( ) { return default authenticator ; }


this is populated when the previous incremental mesh config responses failed to update configuration the message field in error details provides the client internal exception related to the failure < code > google rpc status error detail = 5 ; < code >

public com google rpc status or builder get error detail or builder ( ) { return get error detail ( ) ; }


executes the given task in a fixed thread pool

public static < t > void execute by fixed ( @ int range ( from = 1 ) final int size , final task < t > task , @ int range ( from = 1 , to = 10 ) final int priority ) { execute ( get pool by type and priority ( size , priority ) , task ) ; }


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


get { @ link processor slot chain } of the resource new { @ link processor slot chain } will be created if the resource doesn ' t relate one same resource ( { @ link resource wrapper # equals ( object ) } ) will share the same { @ link processor slot chain } globally , no matter in which { @ link context } < p > note that total { @ link processor slot } count must not exceed { @ link constants # max slot chain size } , otherwise null will return

processor slot < object > look process chain ( resource wrapper resource wrapper ) { processor slot chain chain = chain map get ( resource wrapper ) ; if ( chain = = null ) { synchronized ( lock ) { chain = chain map get ( resource wrapper ) ; if ( chain = = null ) { / / entry size limit if ( chain map size ( ) > = constants max slot chain size ) { return null ; } chain = slot chain provider new slot chain ( ) ; map < resource wrapper , processor slot chain > new map = new hash map < resource wrapper , processor slot chain > ( chain map size ( ) + 1 ) ; new map put all ( chain map ) ; new map put ( resource wrapper , chain ) ; chain map = new map ; } } } return chain ; }


notify the new content by providing the file input stream for all files in this group

void files changed ( list < byte [ ] > readable contents ) throws exception ;


enabledisable infinite loops setting for the handlebars engine enabling this allows for recursive partial inclusion

public handlebars engine adapter infinite loops ( boolean infinite loops ) { this infinite loops = infinite loops ; return this ; }


set the { @ link org apache tiles preparer factory preparer factory } implementation to use default is { @ link org apache tiles preparer factory basic preparer factory } , creating shared instances for specified preparer classes specify { @ link simple spring preparer factory } to autowire { @ link org apache tiles preparer view preparer } instances based on specified preparer classes , applying spring ' s container callbacks as well as applying configured spring bean post processors if spring ' s context - wide annotation - config has been activated , annotations in view preparer classes will be automatically detected and applied specify { @ link spring bean preparer factory } to operate on specified preparer names instead of classes , obtaining the corresponding spring bean from the dispatcher servlet ' s application context the full bean creation process will be in the control of the spring application context in this case , allowing for the use of scoped beans etc note that you need to define one spring bean definition per preparer name ( as used in your tiles definitions )

public void set preparer factory class ( class < ? extends preparer factory > preparer factory class ) { this preparer factory class = preparer factory class ; }


determines the integer value of the system property with the specified name , or a default value this behaves just like { @ link long # get long ( string , long ) } , except that it also consults the { @ link servlet context } ' s " init " parameters if neither exist , return the default value

public static long get long ( string name , long def , level log level ) { string v = get string ( name ) ; if ( v ! = null ) { try { return long decode ( v ) ; } catch ( number format exception e ) { / / ignore , fallback to default if ( logger is loggable ( log level ) ) { logger log ( log level , " property value is not long : { 0 } = > { 1 } " , new object [ ] { name , v } ) ; } } } return def ; }


return the number of currently active threads requires an underlying { @ link scheduled thread pool executor }

public int get active count ( ) { if ( this scheduled executor = = null ) { / / not initialized yet : assume no active threads return 0 ; } return get scheduled thread pool executor ( ) get active count ( ) ; }


< code > optional aapt pb value value = 2 ; < code >

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


true iff the named path is a regular file note : avoid using this method instead reuse the file status returned by { @ link # get file status ( path ) } or list status ( ) methods

public boolean is file ( path f ) throws i o exception { try { return get file status ( f ) is file ( ) ; } catch ( file not found exception e ) { return false ; / / f does not exist } }


shift the back - fill record ' s " instruction " pattern to the right

public assembly resolved backfill shift ( int amt ) { return new assembly resolved backfill ( description , exp , goal , res , inslen , offset + amt ) ; }


removes the field at the given position this method should be used carefully be aware that as the field is actually removed from the record , the total number of fields is modified , and all fields to the right of the field removed shift one position to the left

public void remove field ( int field num ) { / / range check if ( field num < 0 | | field num > = this num fields ) { throw new index out of bounds exception ( ) ; } int last index = this num fields - 1 ; if ( field num < last index ) { int len = last index - field num ; system arraycopy ( this offsets , field num + 1 , this offsets , field num , len ) ; system arraycopy ( this lengths , field num + 1 , this lengths , field num , len ) ; system arraycopy ( this read fields , field num + 1 , this read fields , field num , len ) ; system arraycopy ( this write fields , field num + 1 , this write fields , field num , len ) ; mark modified ( field num ) ; } this offsets [ last index ] = null indicator offset ; this lengths [ last index ] = 0 ; this write fields [ last index ] = null ; set num fields ( last index ) ; }


returns a new { @ link string data instance } that points to the string characters that start at { @ code byte offset } from the start of this instance if the requested offset is not valid , the base string instance ( itself ) will be returned instead of a new instance

public string data instance get byte offcut ( int byte offset ) { if ( is bad char size ( ) | | is probe ( ) | | ! is valid offcut offset ( byte offset ) ) { return null instance ; } int new length = math max ( 0 , length - byte offset ) ; string data instance sub = new string data instance ( this , get offcut layout ( ) , new wrapped mem buffer ( buf , byte offset ) , new length , charset name ) ; return sub ; }


this test makes sure that when an action encounters an error it should not be subject to throttling also , the ack status of the action in the watch should remain awaits successful execution as long as the execution fails

public void test error in action ( ) throws exception { create index ( " foo " ) ; client ( ) admin ( ) indices ( ) prepare update settings ( " foo " ) set settings ( settings builder ( ) put ( " index blocks write " , true ) ) get ( ) ; put watch response put watch response = new put watch request builder ( client ( ) , " id " ) set source ( watch builder ( ) trigger ( schedule ( interval ( " 1 0m " ) ) ) / / adding an action that throws an error and is associated with a 60 minute throttle period / / with such a period , on successful execution we other executions of the watch will be / / throttled within the hour but on failed execution there should be no throttling add action ( " action " , time value time value minutes ( 60 ) , index action builder ( " foo " ) ) ) get ( ) ; assert that ( put watch response is created ( ) , is ( true ) ) ; time warp ( ) trigger ( " id " ) ; flush ( ) ; / / there should be a single history record with a failure status for the action : assert busy ( ( ) - > { long count = watch record count ( query builders bool query ( ) must ( terms query ( " result actions id " , " action " ) ) must ( terms query ( " result actions status " , " failure " ) ) ) ; assert that ( count , is ( 1l ) ) ; } ) ; / / now we ' ll trigger the watch again and make sure that it ' s not throttled and instead / / writes another record to the history / / within the 60 minute throttling period time warp ( ) clock ( ) fast forward ( time value time value minutes ( random int between ( 1 , 50 ) ) ) ; time warp ( ) trigger ( " id " ) ; flush ( ) ; / / there should be a single history record with a failure status for the action : assert busy ( ( ) - > { long count = watch record count ( query builders bool query ( ) must ( terms query ( " result actions id " , " action " ) ) must ( terms query ( " result actions status " , " failure " ) ) ) ; assert that ( count , is ( 2l ) ) ; } ) ; / / now lets confirm that the ack status of the action is awaits successful execution get watch response get watch response = new get watch request builder ( client ( ) , " id " ) get ( ) ; x content source watch = get watch response get source ( ) ; watch get value ( " status actions action ack awaits successful execution " ) ; }


verifies that we set the flags for fallback id correctly when applying a fallback id via another request options

public void fallback id flag after applying via other request options is set ( ) { assert that ( options fallback ( new color drawable ( color red ) ) apply ( new request options ( ) apply ( new request options ( ) fallback ( android r drawable star on ) ) ) get fallback drawable ( ) ) is null ( ) ; }


gets the set of input symbols which could potentially follow the previously matched symbol at the time this exception was thrown if the set of expected tokens is not known and could not be computed , this method returns { @ code null }

public interval set get expected tokens ( ) { if ( recognizer ! = null ) { return recognizer get a t n ( ) get expected tokens ( offending state , ctx ) ; } return null ; }


set the name of the servlet context attribute which should be used to retrieve the { @ link web application context } that this servlet is supposed to use

public void set context attribute ( @ nullable string context attribute ) { this context attribute = context attribute ; }


public void snake case test ( ) { / / todo : test snake case }


configure encoders or writers for use with { @ link org springframework http codec multipart multipart http message writer multipart http message writer }


get the value of the home dir conf value for specified mount table

public static string get home dir value ( final configuration conf , final string mount table name ) { return conf get ( get config view fs prefix ( mount table name ) + " " + constants config viewfs homedir ) ; }


send a single mouse event code to the terminal

void send mouse event code ( motion event e , int button , boolean pressed ) { int x = ( int ) ( e get x ( ) / m renderer m font width ) + 1 ; int y = ( int ) ( ( e get y ( ) - m renderer m font line spacing and ascent ) / m renderer m font line spacing ) + 1 ; if ( pressed & & ( button = = terminal emulator mouse wheeldown button | | button = = terminal emulator mouse wheelup button ) ) { if ( m mouse start down time = = e get down time ( ) ) { x = m mouse scroll start x ; y = m mouse scroll start y ; } else { m mouse start down time = e get down time ( ) ; m mouse scroll start x = x ; m mouse scroll start y = y ; } } m emulator send mouse event ( button , x , y , pressed ) ; }


add the given filter to the end of the filter chain filter functions are typically used to invoke methods on the statement before it is executed for example : < pre class = " code " > database client client = … ; client sql ( " select book id from book " ) filter ( statement - > statement fetch size ( 100 ) )

default generic execute spec filter ( function < ? super statement , ? extends statement > filter function ) { assert not null ( filter function , " filter function must not be null " ) ; return filter ( ( statement , next ) - > next execute ( filter function apply ( statement ) ) ) ; }


opens a new { @ link output stream } for writing to this sink this method returns a new , independent stream each time it is called the caller is responsible for ensuring that the returned stream is closed

public abstract output stream open stream ( ) throws i o exception ;


sets all locations that call the function at entry to be non - returning

protected address set set no fall thru ( program program , address non returning function entry ) { address set called locations = new address set ( ) ; reference iterator ref iter = program get reference manager ( ) get references to ( non returning function entry ) ; while ( ref iter has next ( ) ) { reference ref = ref iter next ( ) ; if ( ! ref get reference type ( ) is call ( ) ) { continue ; } address from addr = ref get from address ( ) ; instruction instr = program get listing ( ) get instruction at ( from addr ) ; if ( instr = = null ) { continue ; } address fallthru addr = instr get fall through ( ) ; if ( instr get flow override ( ) ! = flow override call return & & fallthru addr ! = null ) { instr set flow override ( flow override call return ) ; / / some overriden flows , like conditional call , keep their fallthrough / / no need to fix these locations if ( instr get flow type ( ) has fallthrough ( ) ) { continue ; } called locations add ( instr get min address ( ) ) ; } } return called locations ; }


defines a mapping indicating the class path name of the current ghidra class that is the same class as the indicated old class path name from a previous ghidra version

public static void put ( string old class path , string current class path ) { class path map put ( old class path , current class path ) ; }


determine the number of segments to merge in a given pass assuming more than factor segments , the first pass should attempt to bring the total number of segments - 1 to be divisible by the factor - 1 ( each pass takes x segments and produces 1 ) to minimize the number of merges

private int get pass factor ( int factor , int pass no , int num segments ) { if ( pass no > 1 | | num segments < = factor | | factor = = 1 ) return factor ; int mod = ( num segments - 1 ) % ( factor - 1 ) ; if ( mod = = 0 ) return factor ; return mod + 1 ; }


get the value of the ' { @ code onmousedown } ' attribute may be a runtime expression

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


public void parse property element ( element ele , bean definition bd ) { string property name = ele get attribute ( name attribute ) ; if ( ! string utils has length ( property name ) ) { error ( " tag ' property ' must have a ' name ' attribute " , ele ) ; return ; } this parse state push ( new property entry ( property name ) ) ; try { if ( bd get property values ( ) contains ( property name ) ) { error ( " multiple ' property ' definitions for property ' " + property name + " ' " , ele ) ; return ; } object val = parse property value ( ele , bd , property name ) ; property value pv = new property value ( property name , val ) ; parse meta elements ( ele , pv ) ; pv set source ( extract source ( ele ) ) ; bd get property values ( ) add property value ( pv ) ; } finally { this parse state pop ( ) ; } }


returns the { @ code short } value that is equal to { @ code value } , if possible

public static short checked cast ( long value ) { short result = ( short ) value ; check argument ( result = = value , " out of range : % s " , value ) ; return result ; }


sets a new position and size for this ellipse

public void set ( float x , float y , float width , float height ) { this x = x ; this y = y ; this width = width ; this height = height ; }


public void add next value ( object val ) { long new val = long parse long ( val to string ( ) ) ; if ( this max val < new val ) { this max val = new val ; } }


retrieves setting determining whether or not consonants will be encoded " exactly "

boolean get encode exact ( ) { return m encode exact ; }


write the object to the byte stream , handling text as a special case

private void write object ( object o ) throws i o exception { if ( o instanceof text ) { text to = ( text ) o ; out write ( to get bytes ( ) , 0 , to get length ( ) ) ; } else { out write ( o to string ( ) get bytes ( standard charsets utf 8 ) ) ; } }


constructs a uri from the template , substituting in the provided arguments arguments whose corresponding identifiers are not present in the template will be ignored

public string build uri ( string representation id , long segment number , int bandwidth , long time ) { string builder builder = new string builder ( ) ; for ( int i = 0 ; i < identifier count ; i + + ) { builder append ( url pieces [ i ] ) ; if ( identifiers [ i ] = = representation id ) { builder append ( representation id ) ; } else if ( identifiers [ i ] = = number id ) { builder append ( string format ( locale us , identifier format tags [ i ] , segment number ) ) ; } else if ( identifiers [ i ] = = bandwidth id ) { builder append ( string format ( locale us , identifier format tags [ i ] , bandwidth ) ) ; } else if ( identifiers [ i ] = = time id ) { builder append ( string format ( locale us , identifier format tags [ i ] , time ) ) ; } } builder append ( url pieces [ identifier count ] ) ; return builder to string ( ) ; }


get the kind of the tokens which are generated

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


public long get network bytes read ( ) { read proc net info file ( ) ; return num net bytes read ; }


an index into the library ' s table of contents

public int get table of contents index ( ) { return itoc ; }


public static set < annotation > get all annotations ( final class < ? > cls ) { list < class < ? > > all types = class util get all superclasses ( cls ) ; all types add all ( class util get all interfaces ( cls ) ) ; all types add ( cls ) ; set < annotation > anns = new hash set < annotation > ( ) ; for ( class < ? > type : all types ) { anns add all ( arrays as list ( type get declared annotations ( ) ) ) ; } set < annotation > super annotations = new hash set < annotation > ( ) ; for ( annotation ann : anns ) { get super annotations ( ann annotation type ( ) , super annotations ) ; } anns add all ( super annotations ) ; return anns ; }


asserts that the requested sky value can be built and results in the expected set of files the metadata of files is ignored in comparing the actual results with the expected ones the returned object however contains the actual metadata

private final recursive filesystem traversal value traverse and assert files ( traversal request params , resolved file expected files ignoring metadata ) throws exception { recursive filesystem traversal value result = eval traversal request ( params ) ; map < path fragment , resolved file > name to actual resolved files = new hash map < > ( ) ; for ( resolved file act : result get transitive files ( ) to list ( ) ) { / / we can ' t compare directly , since metadata would be different , so we compare / / by comparing the results of public method calls name to actual resolved files put ( act get name in symlink tree ( ) , act ) ; } assert expected resolved files present ( name to actual resolved files , expected files ignoring metadata ) ; return result ; }


writes this to { @ code directory } as utf - 8 using the standard directory structure

public void write to ( path directory ) throws i o exception { write to path ( directory ) ; }


< code > optional int 6 4 num = 4 ; < code >


for the framework to setup the job output during initialization this is called from the application master process for the entire job this will be called multiple times , once per job attempt

public abstract void setup job ( job context job context ) throws i o exception ;


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


returns padding using the specified delimiter repeated to a given length string utils repeat ( ' e ' , 0 ) = " " string utils repeat ( ' e ' , 3 ) = " eee " string utils repeat ( ' e ' , - 2 ) = " " note : this method doesn ' t not support padding with < a href = " http : www unicode orgglossary # supplementary character " > unicode supplementary characters as they require a pair of { @ code char } s to be represented if you are needing to support full i18n of your applications consider using { @ link # repeat ( string , int ) } instead

public static string repeat ( final char ch , final int repeat ) { final char [ ] buf = new char [ repeat ] ; for ( int i = repeat - 1 ; i > = 0 ; i - - ) { buf [ i ] = ch ; } return new string ( buf ) ; }