apply the attributes of the given bean element to the given bean definition

public abstract bean definition parse bean definition attributes ( element ele , string bean name , @ nullable bean definition containing bean , abstract bean definition bd ) { if ( ele has attribute ( singleton attribute ) ) { error ( " old 1 x ' singleton ' attribute in use - upgrade to ' scope ' declaration " , ele ) ; } else if ( ele has attribute ( scope attribute ) ) { bd set scope ( ele get attribute ( scope attribute ) ) ; } else if ( containing bean ! = null ) { / / take default from containing bean in case of an inner bean definition bd set scope ( containing bean get scope ( ) ) ; } if ( ele has attribute ( abstract attribute ) ) { bd set abstract ( true value equals ( ele get attribute ( abstract attribute ) ) ) ; } string lazy init = ele get attribute ( lazy init attribute ) ; if ( is default value ( lazy init ) ) { lazy init = this defaults get lazy init ( ) ; } bd set lazy init ( true value equals ( lazy init ) ) ; string autowire = ele get attribute ( autowire attribute ) ; bd set autowire mode ( get autowire mode ( autowire ) ) ; if ( ele has attribute ( depends on attribute ) ) { string depends on = ele get attribute ( depends on attribute ) ; bd set depends on ( string utils tokenize to string array ( depends on , multi value attribute delimiters ) ) ; } string autowire candidate = ele get attribute ( autowire candidate attribute ) ; if ( is default value ( autowire candidate ) ) { string candidate pattern = this defaults get autowire candidates ( ) ; if ( candidate pattern ! = null ) { string [ ] patterns = string utils comma delimited list to string array ( candidate pattern ) ; bd set autowire candidate ( pattern match utils simple match ( patterns , bean name ) ) ; } } else { bd set autowire candidate ( true value equals ( autowire candidate ) ) ; } if ( ele has attribute ( primary attribute ) ) { bd set primary ( true value equals ( ele get attribute ( primary attribute ) ) ) ; } if ( ele has attribute ( init method attribute ) ) { string init method name = ele get attribute ( init method attribute ) ; bd set init method name ( init method name ) ; } else if ( this defaults get init method ( ) ! = null ) { bd set init method name ( this defaults get init method ( ) ) ; bd set enforce init method ( false ) ; } if ( ele has attribute ( destroy method attribute ) ) { string destroy method name = ele get attribute ( destroy method attribute ) ; bd set destroy method name ( destroy method name ) ; } else if ( this defaults get destroy method ( ) ! = null ) { bd set destroy method name ( this defaults get destroy method ( ) ) ; bd set enforce destroy method ( false ) ; } if ( ele has attribute ( factory method attribute ) ) { bd set factory method name ( ele get attribute ( factory method attribute ) ) ; } if ( ele has attribute ( factory bean attribute ) ) { bd set factory bean name ( ele get attribute ( factory bean attribute ) ) ; } return bd ; }


the host on which the { @ link r m app attempt } is runningran on


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

symbol add constant float ( final float value ) { return add constant integer or float ( symbol constant float tag , float float to raw int bits ( value ) ) ; }


creates a new rest request the path is not decoded so this constructor will not throw a { @ link bad parameter exception }

public static rest request request without parameters ( named x content registry x content registry , http request http request , http channel http channel ) { map < string , string > params = collections empty map ( ) ; return new rest request ( x content registry , params , http request uri ( ) , http request get headers ( ) , http request , http channel , request id generator increment and get ( ) ) ; }


public boolean is empty ( ) { return size = = 0 ; }


get all attributes allowed by the service if a service is registered with { @ code scopes } , get attributes allowed as per defined release policies for scopes if a service registered with no { @ code scopes } , then service { @ code attribute release policy } will be used to get allowed attributes

private map < string , list < object > > get attributes allowed for service ( final collection < string > scopes , final principal principal , final service service , final oidc registered service oidc service , final o auth 2 0 access token access token ) { if ( ! oidc service get scopes ( ) is empty ( ) ) { scopes retain all ( oidc service get scopes ( ) ) ; return filter attributes by scope ( scopes , principal , service , oidc service , access token ) ; } return oidc service get attribute release policy ( ) get attributes ( principal , service , oidc service ) ; }


add a starlark transitive info the provider value must be safe ( i e a string , a boolean , an integer , an artifact , a label , none , a java transitive info provider or something composed from these in starlark using lists , sets , structs or dicts ) otherwise an eval exception is thrown

public rule configured target builder add starlark transitive info ( string name , object value , location loc ) throws eval exception { providers builder put ( name , value ) ; return this ; }


determines if the shard can be allocated on at least one node based on the allocation deciders returns the best allocation decision for allocating the shard on any node ( i e yes if at least one node decided yes , throttle if at least one node decided throttle , and no if none of the nodes decided yes or throttle ) if in explain mode , also returns the node - level explanations as the second element in the returned tuple

public static tuple < decision , map < string , node allocation result > > can be allocated to at least one node ( shard routing shard , routing allocation allocation ) { decision made decision = decision no ; final boolean explain = allocation debug decision ( ) ; map < string , node allocation result > node decisions = explain ? new hash map < > ( ) : null ; for ( object cursor < discovery node > cursor : allocation nodes ( ) get data nodes ( ) values ( ) ) { routing node node = allocation routing nodes ( ) node ( cursor value get id ( ) ) ; if ( node = = null ) { continue ; } / / if we can ' t allocate it on a node , ignore it , for example , this handles / / cases for only allocating a replica after a primary decision decision = allocation deciders ( ) can allocate ( shard , node , allocation ) ; if ( decision type ( ) = = decision type yes & & made decision type ( ) ! = decision type yes ) { if ( explain ) { made decision = decision ; } else { return tuple tuple ( decision , null ) ; } } else if ( made decision type ( ) = = decision type no & & decision type ( ) = = decision type throttle ) { made decision = decision ; } if ( explain ) { node decisions put ( node node id ( ) , new node allocation result ( node node ( ) , null , decision ) ) ; } } return tuple tuple ( made decision , node decisions ) ; }


return all values for the given header as a list of value objects

public list < object > get header values ( string name ) { header value holder header = this headers get ( name ) ; if ( header ! = null ) { return header get values ( ) ; } else { return collections empty list ( ) ; } }


private void verify open ( ) throws i o exception { if ( byte buffer = = null ) { throw new i o exception ( f s exception messages stream is closed ) ; } }


compares the given program against original to determine if any tags differ between the two any tags in original that are not in the given program indicate deletions

private collection < ? extends function tag > get deleted tags ( program program , task monitor monitor ) { / / 1 get all tags in the original database function manager d b orig function manager d b = ( function manager d b ) original pgm get function manager ( ) ; collection < ? extends function tag > original tags = orig function manager d b get function tag manager ( ) get all function tags ( ) ; / / 2 get all tags in the given program database function manager d b my function manager d b = ( function manager d b ) program get function manager ( ) ; collection < ? extends function tag > program tags = my function manager d b get function tag manager ( ) get all function tags ( ) ; / / 3 determine which ones are in original but not in the given program original tags remove all ( program tags ) ; return original tags ; }


gets the absolute offset of this item as a string , suitable for including in annotations

public final string offset string ( ) { return ' [ ' + integer to hex string ( get absolute offset ( ) ) + ' ] ' ; }


sets the < code > my string < code > property

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


returns the number of bits in the underlying bit array

long bit size ( ) { return bits bit size ( ) ; }


called after { @ link # on drag started ( epoxy model , view , int ) } when the dragged view is dropped to a new position the epoxy controller will be updated automatically for you to reposition the models and notify the recycler view of the change you must use this callback to modify your data backing the models to reflect the change the next callback in the drag lifecycle will be { @ link # on drag started ( epoxy model , view , int ) }

void on model moved ( int from position , int to position , t model being moved , view item view ) ;


entry point to the cli command the default implementation uses args 4j to parse command line arguments and call { @ link # run ( ) } , but if that processing is undesirable , subtypes can directly override this method and leave { @ link # run ( ) } to an empty method you would however then have to consider { @ link # get transport authentication 2 } , so this is not really recommended

public int main ( list < string > args , locale locale , input stream stdin , print stream stdout , print stream stderr ) { this stdin = new buffered input stream ( stdin ) ; this stdout = stdout ; this stderr = stderr ; this locale = locale ; register option handlers ( ) ; cmd line parser p = get cmd line parser ( ) ; / / add options from the authenticator security context sc = null ; authentication old = null ; authentication auth ; try { / / todo as in c l i registerer this may be doing too much work sc = security context holder get context ( ) ; old = sc get authentication ( ) ; sc set authentication ( auth = get transport authentication 2 ( ) ) ; if ( ! ( this instanceof help command | | this instanceof who am i command ) ) jenkins get ( ) check permission ( jenkins read ) ; p parse argument ( args to array ( new string [ 0 ] ) ) ; logger log ( level fine , " invoking cli command { 0 } , with { 1 } arguments , as user { 2 } " , new object [ ] { get name ( ) , args size ( ) , auth get name ( ) } ) ; int res = run ( ) ; logger log ( level fine , " executed cli command { 0 } , with { 1 } arguments , as user { 2 } , return code { 3 } " , new object [ ] { get name ( ) , args size ( ) , auth get name ( ) , res } ) ; return res ; } catch ( cmd line exception e ) { log failed command and print exception error message ( args , e ) ; print usage ( stderr , p ) ; return 2 ; } catch ( illegal state exception e ) { log failed command and print exception error message ( args , e ) ; return 4 ; } catch ( illegal argument exception e ) { log failed command and print exception error message ( args , e ) ; return 3 ; } catch ( abort exception e ) { log failed command and print exception error message ( args , e ) ; return 5 ; } catch ( access denied exception e ) { log failed command and print exception error message ( args , e ) ; return 6 ; } catch ( bad credentials exception e ) { / / to the caller , we can ' t reveal whether the user didn ' t exist or the password didn ' t match / / do that to the server log instead string id = uuid random u u i d ( ) to string ( ) ; log and print error ( e , " bad credentials search the server log for " + id + " for more details " , " cli login attempt failed : " + id , level info ) ; return 7 ; } catch ( throwable e ) { string error msg = " unexpected exception occurred while performing " + get name ( ) + " command " ; log and print error ( e , error msg , error msg , level warning ) ; functions print stack trace ( e , stderr ) ; return 1 ; } finally { if ( sc ! = null ) sc set authentication ( old ) ; / / restore } }


public list < list < read only first > > get array array of model ( ) { return array array of model ; }


propagate a fatal error which affects the ability to fetch metadata for the cluster two examples are authentication and unsupported version exceptions

public synchronized void fatal error ( kafka exception exception ) { this fatal exception = exception ; }


tests that suspends keeps all checkpoints ( so that they can be recovered later by the zoo keeper store ) furthermore , suspending a job should release all locks

public void test suspend keeps checkpoints ( ) throws exception { curator framework client = zookeeper get client ( ) ; shared state registry shared state registry = new shared state registry ( ) ; completed checkpoint store store = create completed checkpoints ( 1 ) ; test completed checkpoint checkpoint = create checkpoint ( 0 , shared state registry ) ; store add checkpoint ( checkpoint , new checkpoints cleaner ( ) , ( ) - > { } ) ; assert equals ( 1 , store get number of retained checkpoints ( ) ) ; assert not null ( client check exists ( ) for path ( checkpoint path + checkpoint store util checkpoint i d to name ( checkpoint get checkpoint i d ( ) ) ) ) ; store shutdown ( job status suspended , new checkpoints cleaner ( ) , ( ) - > { } ) ; assert equals ( 0 , store get number of retained checkpoints ( ) ) ; final string checkpoint path = checkpoint path + checkpoint store util checkpoint i d to name ( checkpoint get checkpoint i d ( ) ) ; stat stat = client check exists ( ) for path ( checkpoint path ) ; assert not null ( " the checkpoint node should exist " , stat ) ; assert equals ( " the checkpoint node should not be locked " , 0 , stat get num children ( ) ) ; / / recover again shared state registry close ( ) ; store recover ( ) ; completed checkpoint recovered = store get latest checkpoint ( false ) ; assert equals ( checkpoint , recovered ) ; }


copy the aop configuration from the given advised support object , but allow substitution of a fresh target source and a given interceptor chain

protected void copy configuration from ( advised support other , target source target source , list < advisor > advisors ) { copy from ( other ) ; this target source = target source ; this advisor chain factory = other advisor chain factory ; this interfaces = new array list < > ( other interfaces ) ; for ( advisor advisor : advisors ) { if ( advisor instanceof introduction advisor ) { validate introduction advisor ( ( introduction advisor ) advisor ) ; } assert not null ( advisor , " advisor must not be null " ) ; this advisors add ( advisor ) ; } advice changed ( ) ; }


checks if the given array contains any elements

public static boolean is empty ( object [ ] array ) { return array = = null | | array length = = 0 ; }


public long get teardown worker validity interval ( ) { return long parse long ( configs map get ( master teardown worker validity interval ms ) ) ; }


indexes the new version of { @ link data frame analytics config } document into the config index

private void index ( data frame analytics config config , @ nullable get response get response , action listener < data frame analytics config > listener ) { try ( x content builder builder = x content factory json builder ( ) ) { config to x content ( builder , new to x content map params ( to xcontent params ) ) ; index request index request = new index request ( ml config index index name ( ) ) id ( data frame analytics config document id ( config get id ( ) ) ) set refresh policy ( write request refresh policy immediate ) source ( builder ) ; if ( get response = = null ) { index request op type ( doc write request op type create ) ; } else { index request op type ( doc write request op type index ) set if seq no ( get response get seq no ( ) ) set if primary term ( get response get primary term ( ) ) ; } execute async with origin ( client , ml origin , index action instance , index request , action listener wrap ( index response - > listener on response ( config ) , e - > { if ( exceptions helper unwrap cause ( e ) instanceof version conflict engine exception ) { listener on failure ( exceptions helper data frame analytics already exists ( config get id ( ) ) ) ; } else { listener on failure ( e ) ; } } ) ) ; } catch ( i o exception e ) { listener on failure ( new elasticsearch parse exception ( " failed to serialise data frame analytics with id [ " + config get id ( ) + " ] " ) ) ; } }


list the directory and create { @ code sky key } s to request contents of its children recursively the returned keys are of type { @ link sky functions # recursive filesystem traversal }

private static collection < sky key > create recursive traversal keys ( environment env , traversal request traversal ) throws missing dep exception , interrupted exception , i o exception { / / use the traversal ' s path , even if it ' s a symlink the contents of the directory , as listed / / in the result , must be relative to it iterable < dirent > dirents ; if ( traversal is root generated ) { / / if we ' re dealing with an output file , read the directory directly instead of creating / / filesystem nodes under the output tree list < dirent > dirents collection = new array list < > ( traversal root as rooted path ( ) as path ( ) readdir ( symlinks follow ) ) ; collections sort ( dirents collection ) ; dirents = dirents collection ; } else { dirents = ( ( directory listing value ) get dependent sky value ( env , directory listing value key ( traversal root as rooted path ( ) ) ) ) get dirents ( ) ; } list < sky key > result = new array list < > ( ) ; for ( dirent dirent : dirents ) { rooted path child path = rooted path to rooted path ( traversal root as rooted path ( ) get root ( ) , traversal root as rooted path ( ) get root relative path ( ) get relative ( dirent get name ( ) ) ) ; traversal request child traversal = traversal for child entry ( child path ) ; result add ( child traversal ) ; } return result ; }


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


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


just like assert equals ( x , y ) , but additionally recording ( using thread record failure ) any assertion failed error thrown , so that the current testcase will fail

public void thread assert equals ( long x , long y ) { try { assert equals ( x , y ) ; } catch ( assertion failed error t ) { thread record failure ( t ) ; throw t ; } }


helper method that encodes any of the register - list formats

private static void encode register list ( decoded instruction insn , code output out ) { out write ( code unit ( insn get opcode ( ) , make byte ( insn get e ( ) , insn get register count ( ) ) ) , insn get index unit ( ) , code unit ( insn get a ( ) , insn get b ( ) , insn get c ( ) , insn get d ( ) ) ) ; }


populates the global partitions by host and standby partitions by host maps that are sent to each member

private void populate partitions by host maps ( final map < host info , set < topic partition > > partitions by host , final map < host info , set < topic partition > > standby partitions by host , final map < task id , set < topic partition > > partitions for task , final map < uuid , client metadata > client metadata map ) { for ( final map entry < uuid , client metadata > entry : client metadata map entry set ( ) ) { final host info host info = entry get value ( ) host info ; / / if application server is configured , also include host state map if ( host info ! = null ) { final set < topic partition > topic partitions = new hash set < > ( ) ; final set < topic partition > standby partitions = new hash set < > ( ) ; final client state state = entry get value ( ) state ; for ( final task id id : state active tasks ( ) ) { topic partitions add all ( partitions for task get ( id ) ) ; } for ( final task id id : state standby tasks ( ) ) { standby partitions add all ( partitions for task get ( id ) ) ; } partitions by host put ( host info , topic partitions ) ; standby partitions by host put ( host info , standby partitions ) ; } } }


test that accept z value parameter correctly parses

public void test ignore z value ( ) throws i o exception { document mapper mapper = create document mapper ( field mapping ( b - > b field ( " type " , " geo shape " ) field ( " tree " , " quadtree " ) field ( " ignore z value " , true ) ) ) ; mapper field mapper = mapper mappers ( ) get mapper ( " field " ) ; assert that ( field mapper , instance of ( legacy geo shape field mapper class ) ) ; boolean ignore z value = ( ( legacy geo shape field mapper ) field mapper ) ignore z value ( ) ; assert that ( ignore z value , equal to ( true ) ) ; / / explicit false accept z value test mapper = create document mapper ( field mapping ( b - > b field ( " type " , " geo shape " ) field ( " tree " , " quadtree " ) field ( " ignore z value " , false ) ) ) ; field mapper = mapper mappers ( ) get mapper ( " field " ) ; assert that ( field mapper , instance of ( legacy geo shape field mapper class ) ) ; ignore z value = ( ( legacy geo shape field mapper ) field mapper ) ignore z value ( ) ; assert that ( ignore z value , equal to ( false ) ) ; assert field warnings ( " strategy " , " tree " ) ; }


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


sets the doc to use for updates when a script is not specified

public update request doc ( map < string , object > source , x content type content type ) { safe doc ( ) source ( source , content type ) ; return this ; }


returns a range , closed on both ends , whose endpoints are the minimum and maximum values contained in this set this is equivalent to { @ code range ( closed , closed ) }


creates a new , empty { @ code linked hash multiset } using the default initial capacity

public static < e > linked hash multiset < e > create ( ) { return create ( object count hash map default size ) ; }


return a { @ link bean name url handler mapping } ordered at 2 to map url paths to controller bean names

public bean name url handler mapping bean name handler mapping ( @ qualifier ( " mvc conversion service " ) formatting conversion service conversion service , @ qualifier ( " mvc resource url provider " ) resource url provider resource url provider ) { bean name url handler mapping mapping = new bean name url handler mapping ( ) ; mapping set order ( 2 ) ; mapping set interceptors ( get interceptors ( conversion service , resource url provider ) ) ; mapping set cors configurations ( get cors configurations ( ) ) ; return mapping ; }


test serialization of outer boolean types

boolean fake outer boolean serialize ( boolean body ) ;


this method will be removed in a certain version after april 5 , 2020 , so please do not use this method

public message ext view message ( string topic , string msg id ) throws remoting exception , m q broker exception , interrupted exception , m q client exception { try { message decoder decode message id ( msg id ) ; return this view message ( msg id ) ; } catch ( exception e ) { / / ignore } return this default m q push consumer impl query message by uniq key ( with namespace ( topic ) , msg id ) ; }


public double get double ( ) { return double ; }


wraps an { @ link executor } into a new scheduler instance and delegates { @ code schedule ( ) } calls to it the tasks scheduled by the returned { @ link scheduler } and its { @ link io reactivex rxjava 3 core scheduler worker scheduler worker } can be optionally interrupted if the provided executor doesn ' t support any of the more specific standard java executor a p is , tasks scheduled with a time delay or periodically will use the { @ link # single ( ) } scheduler for the timed waiting before posting the actual task to the given executor if the provided executor supports the standard java { @ link executor service } api , canceling tasks scheduled by this scheduler can be cancelledinterrupted by calling { @ link io reactivex rxjava 3 disposables disposable # dispose ( ) } in addition , tasks scheduled with a time delay or periodically will use the { @ link # single ( ) } scheduler for the timed waiting before posting the actual task to the given executor if the provided executor supports the standard java { @ link scheduled executor service } api , canceling tasks scheduled by this scheduler can be cancelledinterrupted by calling { @ link io reactivex rxjava 3 disposables disposable # dispose ( ) } in addition , tasks scheduled with a time delay or periodically will use the provided executor note , however , if the provided { @ code scheduled executor service } instance is not single threaded , tasks scheduled with a time delay close to each other may end up executing in different order than the original schedule ( ) call was issued this limitation may be lifted in a future patch the implementation of the worker of this wrapper scheduler can operate in both eager ( non - fair ) and fair modes depending on the specified parameter in eager mode , it will execute as many non - delayed tasks as it can , which may result in a longer than expected occupation of a thread of the given backing executor in other terms , it does not allow per - runnable fairness in case the worker runs on a shared underlying thread of the executor in fair mode , non - delayed tasks will still be executed in a fifo and non - overlapping manner , but after each task , the execution for the next task is rescheduled with the same underlying executor , allowing interleaving from both the same scheduler or other external usages of the underlying executor starting , stopping and restarting this scheduler is not supported ( no - op ) and the provided executor ' s lifecycle must be managed externally : < code > executor service exec = executors new single threaded executor ( ) ; try { scheduler scheduler = schedulers from ( exec , true , true ) ; flowable just ( 1 ) subscribe on ( scheduler ) map ( v - & gt ; v + 1 ) observe on ( scheduler ) blocking subscribe ( system out : : println ) ; } finally { exec shutdown ( ) ; } < code > this type of scheduler is less sensitive to leaking { @ link io reactivex rxjava 3 core scheduler worker scheduler worker } instances , although not disposing a worker that has timeddelayed tasks not cancelled by other means may leak resources andor execute those tasks " unexpectedly " note that this method returns a new { @ link scheduler } instance , even for the same { @ link executor } instance

public static scheduler from ( @ non null executor executor , boolean interruptible worker , boolean fair ) { return new executor scheduler ( executor , interruptible worker , fair ) ; }


create an http server instance for the given webapp

public static http server 2 create server ( string webapp ) throws i o exception { return local server builder ( webapp ) set find port ( true ) build ( ) ; }


create an f s data output stream at the indicated path with write - progress reporting

public f s data output stream create ( final path f , final fs permission permission , final enum set < create flag > flags , final int buffer size , final short replication , final long blk size , final progressable progress , final checksum opt checksum opt ) throws i o exception { log debug ( " create : creating new file { } , flags : { } , is fs bucket : { } " , f , flags , is fs bucket ( ) ) ; if ( null ! = flags & & flags contains ( create flag append ) ) { if ( ! is fs bucket ( ) ) { throw new unsupported operation exception ( " non - posix bucket append is not supported by " + " o b s file system " ) ; } string key = o b s common utils path to key ( this , f ) ; file status status ; long object len = 0 ; try { / / get the status or throw an fnfe status = get file status ( f ) ; object len = status get len ( ) ; / / if the thread reaches here , there is something at the path if ( status is directory ( ) ) { / / path references a directory : automatic error throw new file already exists exception ( f + " is a directory " ) ; } } catch ( file not found exception e ) { log debug ( " file not found exception , create : creating new file { } " , f ) ; } return new f s data output stream ( new o b s block output stream ( this , key , object len , new semaphored delegating executor ( bounded multipart upload thread pool , block output active blocks , true ) , true ) , null ) ; } else { return create ( f , permission , flags = = null | | flags contains ( create flag overwrite ) , buffer size , replication , blk size , progress ) ; } }


sets the { @ link progress update listener }

public void set progress update listener ( @ nullable progress update listener listener ) { this progress update listener = listener ; }


public void close ( reporter reporter ) throws i o exception { super close ( null ) ; }


compute the part number that contains the byte at the given position in the corresponding lucene file

private int get part number for position ( long position ) { ensure valid position ( position ) ; final int part = math to int exact ( position / file info part size ( ) get bytes ( ) ) ; assert part < = file info number of parts ( ) : " part number [ " + part + " ] exceeds number of parts : " + file info number of parts ( ) ; assert part > = 0 : " part number [ " + part + " ] is negative " ; return part ; }


private void submit plan ( final string plan file , final string plan data , boolean skip date check ) throws i o exception { preconditions check not null ( plan data ) ; node plan plan = node plan parse json ( plan data ) ; string data node address = plan get node name ( ) + " : " + plan get port ( ) ; preconditions check not null ( data node address ) ; client datanode protocol data node = get data node proxy ( data node address ) ; string plan hash = digest utils sha 1 hex ( plan data ) ; try { data node submit disk balancer plan ( plan hash , disk balancer c l i plan version , plan file , plan data , skip date check ) ; } catch ( disk balancer exception ex ) { log error ( " submitting plan on { } failed result : { } , message : { } " , plan get node name ( ) , ex get result ( ) to string ( ) , ex get message ( ) ) ; throw ex ; } }


the number of server - to - client messages that a session can cache while waiting for the next http polling request from the client all http transports use this property since even streaming transports recycle http requests periodically the amount of time between http requests should be relatively brief and will not exceed the allows disconnect delay ( see { @ link org springframework web socket sockjs support abstract sock js service # set disconnect delay ( long ) } , 5 seconds by default the default size is 100


checks for verification errors and stops the browser

public void tear down ( ) throws exception { try { check for verification errors ( ) ; } finally { if ( selenium ! = null ) { selenium stop ( ) ; selenium = null ; } } }


resets counters that track evaluation state may only be called when its corresponding node has no outstanding unsignaled deps , because otherwise this resetting and that signalling would race

final void reset for restart from scratch ( ) { preconditions check state ( dirty state = = dirty state rebuilding | | dirty state = = dirty state forced rebuilding , this ) ; signaled deps = 0 ; external deps = 0 ; dirty direct dep index = 0 ; }


specify the ( potentially vendor - specific ) entity manager factory interface that this entity manager factory proxy is supposed to implement the default will be taken from the specific jpa vendor adapter , if any , or set to the standard { @ code javax persistence entity manager factory } interface else

public void set entity manager factory interface ( class < ? extends entity manager factory > emf interface ) { this entity manager factory interface = emf interface ; }


convert a long value to a { @ link offset date time }

public static offset date time offset date time from timestamp ( final long value ) { return value = = null ? null : offset date time of instant ( instant of epoch milli ( value ) , zone offset utc ) ; }


load extra data from a doc implementers should grow their underlying storage to fit the { @ code index }

void load from doc ( long index , int doc ) throws i o exception ;


returns the symbol ' s visibility for example , default

public byte get visibility ( ) { return ( byte ) ( st other & 0x 0 3 ) ; }


returns dividend divisor , where the dividend and divisor are treated as unsigned 32 - bit quantities

public static int divide ( int dividend , int divisor ) { return ( int ) ( to long ( dividend ) / to long ( divisor ) ) ; }


configure the http method ( s ) over which the locale can be changed

public void set http methods ( @ nullable string http methods ) { this http methods = http methods ; }


return maximum length since actual length is unknown

public long length ( ) { return integer max value ; }


static public scale by action scale by ( float amount x , float amount y ) { return scale by ( amount x , amount y , 0 , null ) ; }


helper method to configure authentications which respects aliases of api keys

public api client configure api keys ( map < string , string > secrets ) { for ( map entry < string , authentication > auth entry : authentications entry set ( ) ) { authentication auth = auth entry get value ( ) ; if ( auth instanceof api key auth ) { string name = auth entry get key ( ) ; / / respect x - auth - id - alias property name = authentication lookup contains key ( name ) ? authentication lookup get ( name ) : name ; if ( secrets contains key ( name ) ) { ( ( api key auth ) auth ) set api key ( secrets get ( name ) ) ; } } } return this ; }


void clear ( ) { callbacks clear ( ) ; }


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


removes the given listener from the set of listeners managed by this lifecycle implementation , returning { @ code true } if the listener was removed successfully , and { @ code false } otherwise this is an optimization only , there is no guarantee that every added listener will eventually be removed

void remove listener ( @ non null lifecycle listener listener ) ;


converts a value into a notification value

public static < t > object next ( t value ) { return value ; }


the connectors included in this assignment

public collection < string > connectors ( ) { return connector ids ; }


private void begin file lease ( final long inode id , final d f s output stream out ) throws i o exception { synchronized ( files being written ) { put file being written ( inode id , out ) ; get lease renewer ( ) put ( this ) ; } }


removes the first occurrence of the given value

public void remove value ( int value ) { for ( int i = 0 ; i < size ; + + i ) { if ( ints [ i ] = = value ) { remove value at ( i ) ; return ; } } }


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


public synchronized void on transport started ( ) { if ( keep alive during transport idle ) { on transport active ( ) ; } }


seek to an offset if the data is already in the buffer , move to it

public synchronized void seek ( long target pos ) throws i o exception { if ( target pos < 0 ) { throw new e o f exception ( f s exception messages negative seek ) ; } / / there ' s some special handling of near - local data / / as the seek can be omitted if it is in / adjacent long offset = target pos - pos ; if ( log is debug enabled ( ) ) { log debug ( " seek to " + target pos + " ; current pos = " + pos + " ; offset = " + offset ) ; } if ( offset = = 0 ) { log debug ( " seek is no - op " ) ; return ; } if ( offset < 0 ) { log debug ( " seek is backwards " ) ; } else if ( ( range offset + offset < buffer size ) ) { / / if the seek is in range of that requested , scan forwards / / instead of closing and re - opening a new http connection swift utils debug ( log , " seek is within current stream " + " ; pos = % d ; target pos = % d ; " + " offset = % d ; buffer offset = % d " , pos , target pos , offset , range offset ) ; try { log debug ( " chomping " ) ; chomp bytes ( offset ) ; } catch ( i o exception e ) { / / this is assumed to be recoverable with a seek - or more likely to fail log debug ( " while chomping " , e ) ; } if ( target pos - pos = = 0 ) { log trace ( " chomping successful " ) ; return ; } log trace ( " chomping failed " ) ; } else { if ( log is debug enabled ( ) ) { log debug ( " seek is beyond buffer size of " + buffer size ) ; } } inner close ( " seeking to " + target pos ) ; fill buffer ( target pos ) ; }


retry a test in case of a failure with a specific exception

public void evaluate ( ) throws throwable { for ( current run = 0 ; current run < = times on failure ; current run + + ) { try { statement evaluate ( ) ; break ; / / success } catch ( throwable t ) { log warn ( string format ( " test run failed ( % d / % d ) " , current run , times on failure + 1 ) , t ) ; if ( ! exception class is assignable from ( t get class ( ) ) | | current run > = times on failure ) { / / throw the failure if retried too often , or if it is the wrong exception throw t ; } } } }


load an edit log , and apply the changes to the in - memory structure this is where we apply edits that we ' ve been writing to disk all along

long load f s edits ( edit log input stream edits , long expected starting tx id , long max txns to read , startup option start opt , meta recovery context recovery ) throws i o exception { startup progress prog = name node get startup progress ( ) ; step step = create startup progress step ( edits ) ; prog begin step ( phase loading edits , step ) ; fs namesys write lock ( ) ; try { long start time = timer monotonic now ( ) ; log action pre log action = load edits log helper record ( " pre " , start time ) ; if ( pre log action should log ( ) ) { f s image log info ( " start loading edits file " + edits get name ( ) + " max txns to read = " + max txns to read + log throttling helper get log supression message ( pre log action ) ) ; } long num edits = load edit records ( edits , false , expected starting tx id , max txns to read , start opt , recovery ) ; long end time = timer monotonic now ( ) ; log action post log action = load edits log helper record ( " post " , end time , num edits , edits length ( ) , end time - start time ) ; if ( post log action should log ( ) ) { f s image log info ( " loaded { } edits file ( s ) ( the last named { } ) of " + " total size { } , total edits { } , total load time { } ms " , post log action get count ( ) , edits get name ( ) , post log action get stats ( 1 ) get sum ( ) , post log action get stats ( 0 ) get sum ( ) , post log action get stats ( 2 ) get sum ( ) ) ; } return num edits ; } finally { edits close ( ) ; fs namesys write unlock ( " load f s edits " ) ; prog end step ( phase loading edits , step ) ; } }


performs one - time initialization of the metadata store via configuration this initialization depends on the configuration object to get aws credentials , dynamo d b factory implementation class , dynamo d b endpoints , dynamo d b table names etc after initialization , this metadata store does not explicitly relate to any s3 bucket , which be nonexistent this is used to operate the metadata store directly beyond the scope of the s 3 a file system integration , e g command line tools generally , callers should use { @ link metadata store # initialize ( file system , i ttl time provider ) } with an initialized { @ code s 3 a file system } instance without a filesystem to act as a reference point , the configuration itself must declare the table name and region in the { @ link constants # s3guard ddb table name key } and { @ link constants # s3guard ddb region key } respectively it also creates a new credential provider list from the configuration , using the base fs s 3a options , as there is no bucket to infer per - bucket settings from

public void initialize ( configuration config , i ttl time provider ttl tp ) throws i o exception { conf = config ; / / use the bucket as the dynamo d b table name if not specified in config table name = conf get trimmed ( s3guard ddb table name key ) ; preconditions check argument ( ! string utils is empty ( table name ) , " no dynamo d b table name configured " ) ; region = conf get trimmed ( s3guard ddb region key ) ; preconditions check argument ( ! string utils is empty ( region ) , " no dynamo d b region configured " ) ; / / there ' s no uri here , which complicates life : you cannot / / create aws providers here which require one credentials = create a w s credential provider set ( null , conf ) ; dynamo d b = create dynamo d b ( conf , region , null , credentials ) ; username = user group information get current user ( ) get short user name ( ) ; / / without an executor from the owner fs , create one using / / the executor capacity for work int executor capacity = int option ( conf , executor capacity , default executor capacity , 1 ) ; executor = blocking thread pool executor service new instance ( executor capacity , executor capacity * 2 , long option ( conf , keepalive time , default keepalive time , 0 ) , time unit seconds , " s 3a - ddb - " + table name ) ; init data access retries ( conf ) ; this ttl time provider = ttl tp ; table handler = new dynamo d b metadata store table manager ( dynamo d b , table name , region , amazon dynamo d b , conf , read op , batch write retry policy ) ; this table = table handler init table ( ) ; }


test running an analysis worker from an ad hoc thread ( i e , main ) with events ignored by analysis at various priority levels

public void test disable ignore resume adhoc thread worker invocation ( ) throws exception { env show tool ( ) ; load program ( " notepad empty " ) ; auto analysis manager mgr = auto analysis manager get analysis manager ( program ) ; schedule ( mgr , new set test property command ( " p 0 " , 500 ) , 0 ) ; schedule ( mgr , new set test property command ( " p 1 " , 500 ) , 10 ) ; try { mgr schedule worker ( worker , null , false , task monitor adapter dummy monitor ) ; } catch ( exception e ) { fail with exception ( " unexpected exception " , e ) ; } verify program state then undo ( false ) ; }


the response resources wrapped in the common mcp resource message these are typed resources that match the type url in the request resources message when ` incremental ` is true , this contains an array of resources to addupdate for the specified collection this modifies the existing collection at the sink when ` incremental ` is false , this contains the full set of resources for the specified collection this replaces any previously delivered resources < code > repeated istio mcp v 1alpha 1 resource resources = 3 ; < code >

public builder set resources ( int index , com alibaba nacos istio model mcp resource value ) { if ( resources builder = = null ) { if ( value = = null ) { throw new null pointer exception ( ) ; } ensure resources is mutable ( ) ; resources set ( index , value ) ; on changed ( ) ; } else { resources builder set message ( index , value ) ; } return this ; }


public list < file path > list directories ( ) throws i o exception , interrupted exception { return list ( new directory filter ( ) ) ; }


given a list of elements and a target number of groups , generates list of groups of elements to match the target number of groups , spreading them evenly among the groups this generates groups with contiguous elements , which results in intuitive ordering if your elements are also ordered ( e g alphabetical lists of table names if you sort table names alphabetically to generate the raw partitions ) or can result in efficient partitioning if elements are sorted according to some criteria that affects performance ( e g topic partitions with the same leader )

public static < t > list < list < t > > group partitions ( list < t > elements , int num groups ) { if ( num groups < = 0 ) throw new illegal argument exception ( " number of groups must be positive " ) ; list < list < t > > result = new array list < > ( num groups ) ; / / each group has either n + 1 or n raw partitions int per group = elements size ( ) / num groups ; int leftover = elements size ( ) - ( num groups * per group ) ; int assigned = 0 ; for ( int group = 0 ; group < num groups ; group + + ) { int num this group = group < leftover ? per group + 1 : per group ; list < t > group list = new array list < > ( num this group ) ; for ( int i = 0 ; i < num this group ; i + + ) { group list add ( elements get ( assigned ) ) ; assigned + + ; } result add ( group list ) ; } return result ; }


checks to see if a list of ssa registers can all be mapped into the same rop reg ignores registers that have already been mapped , and checks the interference graph and ensures the range does not cross the parameter range

private boolean can map regs ( array list < register spec > specs , int rop reg ) { for ( register spec spec : specs ) { if ( ssa regs mapped get ( spec get reg ( ) ) ) continue ; if ( ! can map reg ( spec , rop reg ) ) return false ; } return true ; }


handles redoing a table whose key is address based when a ranges of addresses is moved

public static void update address key ( table table , address map addr map , address from addr , address to addr , long length , task monitor monitor ) throws i o exception , cancelled exception { if ( length < = 0 ) { throw new illegal argument exception ( " length must be > 0 " ) ; } address end addr ; try { end addr = from addr add no wrap ( length - 1 ) ; } catch ( address overflow exception e ) { throw new illegal argument exception ( " illegal range : end range overflow " ) ; } update address key ( table , addr map , from addr , end addr , to addr , monitor ) ; }


gets the d register number , as a byte this will throw if the value is out of the range of an unsigned byte

public final short get d byte ( ) { int d = get d ( ) ; if ( ( d & ~ 0xff ) ! = 0 ) { throw new dex exception ( " register d out of range : " + hex u 8 ( d ) ) ; } return ( short ) d ; }


called when the { @ link listenable future } completes with success note that exceptions raised by this method are ignored

void on success ( @ nullable t result ) ;


public string get phase ( ) { return phase ; }


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


determine this scheme corresponds to a 1 : 1 byte mapping

public boolean is one to one mapping ( ) { return mapped source byte count < = 1 ; }


invoke api by sending http request with the given options

public < t > api response < t > invoke a p i ( string operation , string path , string method , list < pair > query params , object body , map < string , string > header params , map < string , string > cookie params , map < string , object > form params , string accept , string content type , string [ ] auth names , generic type < t > return type , boolean is body nullable ) throws api exception { / / not using ` target ( target u r l ) path ( path ) ` below , / / to support ( constant ) query string in ` path ` , e g " / posts ? draft = 1 " string target u r l ; if ( server index ! = null & & operation servers contains key ( operation ) ) { integer index = operation server index contains key ( operation ) ? operation server index get ( operation ) : server index ; map < string , string > variables = operation server variables contains key ( operation ) ? operation server variables get ( operation ) : server variables ; list < server configuration > server configurations = operation servers get ( operation ) ; if ( index < 0 | | index > = server configurations size ( ) ) { throw new array index out of bounds exception ( string format ( " invalid index % d when selecting the host settings must be less than % d " , index , server configurations size ( ) ) ) ; } target u r l = server configurations get ( index ) url ( variables ) + path ; } else { target u r l = this base path + path ; } web target target = http client target ( target u r l ) ; if ( query params ! = null ) { for ( pair query param : query params ) { if ( query param get value ( ) ! = null ) { target = target query param ( query param get name ( ) , escape string ( query param get value ( ) ) ) ; } } } invocation builder invocation builder = target request ( ) accept ( accept ) ; for ( entry < string , string > entry : cookie params entry set ( ) ) { string value = entry get value ( ) ; if ( value ! = null ) { invocation builder = invocation builder cookie ( entry get key ( ) , value ) ; } } for ( entry < string , string > entry : default cookie map entry set ( ) ) { string value = entry get value ( ) ; if ( value ! = null ) { invocation builder = invocation builder cookie ( entry get key ( ) , value ) ; } } entity < ? > entity = serialize ( body , form params , content type , is body nullable ) ; / / put all headers in one place map < string , string > all header params = new hash map < > ( default header map ) ; all header params put all ( header params ) ; / / update different parameters ( e g headers ) for authentication update params for auth ( auth names , query params , all header params , cookie params , serialize to string ( body , form params , content type , is body nullable ) , method , target get uri ( ) ) ; for ( entry < string , string > entry : all header params entry set ( ) ) { string value = entry get value ( ) ; if ( value ! = null ) { invocation builder = invocation builder header ( entry get key ( ) , value ) ; } } response response = null ; try { response = send request ( method , invocation builder , entity ) ; / / if o auth is used and a status 401 is received , renew the access token and retry the request if ( response get status info ( ) = = status unauthorized ) { for ( string auth name : auth names ) { authentication authentication = authentications get ( auth name ) ; if ( authentication instanceof o auth ) { o auth 2 access token access token = ( ( o auth ) authentication ) renew access token ( ) ; if ( access token ! = null ) { invocation builder header ( " authorization " , null ) ; invocation builder header ( " authorization " , " bearer " + access token get access token ( ) ) ; response = send request ( method , invocation builder , entity ) ; } break ; } } } int status code = response get status info ( ) get status code ( ) ; map < string , list < string > > response headers = build response headers ( response ) ; if ( response get status info ( ) = = status no content ) { return new api response < t > ( status code , response headers ) ; } else if ( response get status info ( ) get family ( ) = = status family successful ) { if ( return type = = null ) { return new api response < t > ( status code , response headers ) ; } else { return new api response < t > ( status code , response headers , deserialize ( response , return type ) ) ; } } else { string message = " error " ; string resp body = null ; if ( response has entity ( ) ) { try { resp body = string value of ( response read entity ( string class ) ) ; message = resp body ; } catch ( runtime exception e ) { / / e print stack trace ( ) ; } } throw new api exception ( response get status ( ) , message , build response headers ( response ) , resp body ) ; } } finally { try { response close ( ) ; } catch ( exception e ) { / / it ' s not critical , since the response object is local in method invoke a p i ; that ' s fine , / / just continue } } }


replace the indicated component with a new component containing the specified data type

private data type component replace ( data type component orig dtc , data type data type , int length , string new name , string comment ) { int ordinal = orig dtc get ordinal ( ) ; int new offset = orig dtc get offset ( ) ; int dtc length = orig dtc get length ( ) ; int bytes needed = length - dtc length ; int delta ordinal = - bytes needed ; if ( bytes needed > 0 ) { int bytes available = get num undefined bytes ( ordinal + 1 ) ; if ( bytes available < bytes needed ) { / / throw new illegal argument exception ( " not enough undefined bytes " ) ; delta ordinal = - bytes available ; length - = ( bytes needed - bytes available ) ; } } orig dtc get data type ( ) remove parent ( this ) ; data type component impl new dtc = new data type component impl ( data type , this , length , ordinal , new offset , new name , comment ) ; data type add parent ( this ) ; int index = collections binary search ( components , new integer ( ordinal ) , ordinal comparator ) ; if ( index < 0 ) { index = - index - 1 ; } else { components remove ( index ) ; } if ( delta ordinal ! = 0 ) { adjust offsets ( index , new offset , delta ordinal , 0 ) ; } components add ( index , new dtc ) ; if ( delta ordinal ! = 0 ) { num components + = delta ordinal ; } return new dtc ; }


public static logical type to logical type ( data type data type ) { return data type get logical type ( ) ; }


returns a copy of the most recent data measured by this monitor

public gc data get latest gc data ( ) { return cur data clone ( ) ; }


returns whether the codec needs the renderer to propagate the end - of - stream signal directly , rather than by using an end - of - stream buffer queued to the codec

protected boolean get codec needs eos propagation ( ) { return false ; }


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


generates a payload of desired type and size reads compressable buffer or uncompressable buffer as a circular buffer

private byte string generate payload ( byte string data buffer , int offset , int size ) { byte string payload = byte string empty ; / / this offset would never pass the array boundary int begin = offset ; int end = 0 ; int bytes left = size ; while ( bytes left > 0 ) { end = math min ( begin + bytes left , data buffer size ( ) ) ; / / byte string substring returns the substring from begin , inclusive , to end , exclusive payload = payload concat ( data buffer substring ( begin , end ) ) ; bytes left - = ( end - begin ) ; begin = end % data buffer size ( ) ; } return payload ; }


get an input stream attached to the configuration resource with the given < code > name < code >

public input stream get conf resource as input stream ( string name ) { try { url url = get resource ( name ) ; if ( url = = null ) { log info ( name + " not found " ) ; return null ; } else { log info ( " found resource " + name + " at " + url ) ; } return url open stream ( ) ; } catch ( exception e ) { return null ; } }


see appel algorithm 19 6 : place phi functions in appropriate locations

private static void place phi functions ( ssa method ssa meth , local variable info local info , int threshold ) { array list < ssa basic block > ssa blocks ; int reg count ; int block count ; ssa blocks = ssa meth get blocks ( ) ; block count = ssa blocks size ( ) ; reg count = ssa meth get reg count ( ) - threshold ; dom front df = new dom front ( ssa meth ) ; dom front dom info [ ] dom infos = df run ( ) ; / / bit set of registers vs block index " definition sites " bit set [ ] defsites = new bit set [ reg count ] ; / / bit set of registers vs block index " phi placement sites " bit set [ ] phisites = new bit set [ reg count ] ; for ( int i = 0 ; i < reg count ; i + + ) { defsites [ i ] = new bit set ( block count ) ; phisites [ i ] = new bit set ( block count ) ; } / * * for each register , build a set of all basic blocks where * containing an assignment to that register * / for ( int bi = 0 , s = ssa blocks size ( ) ; bi < s ; bi + + ) { ssa basic block b = ssa blocks get ( bi ) ; for ( ssa insn insn : b get insns ( ) ) { register spec rs = insn get result ( ) ; if ( rs ! = null & & rs get reg ( ) - threshold > = 0 ) { defsites [ rs get reg ( ) - threshold ] set ( bi ) ; } } } if ( debug ) { system out println ( " defsites " ) ; for ( int i = 0 ; i < reg count ; i + + ) { string builder sb = new string builder ( ) ; sb append ( ' v ' ) append ( i ) append ( " : " ) ; sb append ( defsites [ i ] to string ( ) ) ; system out println ( sb ) ; } } bit set worklist ; / * * for each register , compute all locations for phi placement * based on dominance - frontier algorithm * / for ( int reg = 0 , s = reg count ; reg < s ; reg + + ) { int work block index ; / * worklist set starts out with each node where reg is assigned * / worklist = ( bit set ) ( defsites [ reg ] clone ( ) ) ; while ( 0 < = ( work block index = worklist next set bit ( 0 ) ) ) { worklist clear ( work block index ) ; int iterator df iterator = dom infos [ work block index ] dominance frontiers iterator ( ) ; while ( df iterator has next ( ) ) { int df block index = df iterator next ( ) ; if ( ! phisites [ reg ] get ( df block index ) ) { phisites [ reg ] set ( df block index ) ; int t reg = reg + threshold ; register spec rs = local info get starts ( df block index ) get ( t reg ) ; if ( rs = = null ) { ssa blocks get ( df block index ) add phi insn for reg ( t reg ) ; } else { ssa blocks get ( df block index ) add phi insn for reg ( rs ) ; } if ( ! defsites [ reg ] get ( df block index ) ) { worklist set ( df block index ) ; } } } } } if ( debug ) { system out println ( " phisites " ) ; for ( int i = 0 ; i < reg count ; i + + ) { string builder sb = new string builder ( ) ; sb append ( ' v ' ) append ( i ) append ( " : " ) ; sb append ( phisites [ i ] to string ( ) ) ; system out println ( sb ) ; } } }


add the other { @ link runfiles } object transitively , but don ' t merge artifacts

public builder merge except artifacts ( runfiles runfiles ) { return merge ( runfiles , false ) ; }


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

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


this test validates that an invalid program exception is thrown when min by is used on a custom data type

public void test custom key fields dataset ( ) { final execution environment env = execution environment get execution environment ( ) ; this custom type data add ( new custom type ( ) ) ; data set < custom type > custom ds = env from collection ( custom type data ) ; / / should not work : groups on custom type custom ds min by ( 0 ) ; }


update ( a portion of ) the instance data does not resize the backing buffer

public mesh update instance data ( int target offset , float [ ] source ) { return update instance data ( target offset , source , 0 , source length ) ; }


returns true if this segment is preloaded

public boolean is preload ( ) { return ( flagword & flag preload ) ! = 0 ; }


creation of the label mgr plugin actions

private void setup actions ( ) { docking action add label action = new add label action ( this ) ; tool add action ( add label action ) ; / / add the plugin action docking action edit label action = new edit label action ( this ) ; tool add action ( edit label action ) ; docking action edit external label action = new edit external label action ( this ) ; tool add action ( edit external label action ) ; docking action remove label action = new remove label action ( this ) ; tool add action ( remove label action ) ; / / add the plugin action docking action set operand label action = new set operand label action ( this ) ; tool add action ( set operand label action ) ; / / add the plugin action docking action label history action = new label history action ( tool , get name ( ) ) ; tool add action ( label history action ) ; / / create the show all history action docking action all history action = new all history action ( tool , get name ( ) ) ; tool add action ( all history action ) ; }


wait until a container has reached a specified state the timeout is specified by the parameter

public boolean wait for state ( mock n m nm , container id container id , r m container state container state , int timeout msecs ) throws exception { return wait for state ( arrays as list ( nm ) , container id , container state , timeout msecs ) ; }


sets the { @ link value type } for the value produced by this aggregation

public ab user value type hint ( value type value type ) { if ( value type = = null ) { throw new illegal argument exception ( " [ user value type hint ] must not be null : [ " + name + " ] " ) ; } this user value type hint = value type ; return ( ab ) this ; }


tests registration with the kv state registry

public void test queryable state registration ( ) throws exception { kv state registry registry = env get kv state registry ( ) ; checkpoint stream factory stream factory = create stream factory ( ) ; shared state registry shared state registry = new shared state registry ( ) ; abstract keyed state backend < integer > backend = create keyed backend ( int serializer instance , env ) ; key group range expected key group range = backend get key group range ( ) ; kv state registry listener listener = mock ( kv state registry listener class ) ; registry register listener ( high availability services default job id , listener ) ; value state descriptor < integer > desc = new value state descriptor < > ( " test " , int serializer instance ) ; desc set queryable ( " banana " ) ; backend get partitioned state ( void namespace instance , void namespace serializer instance , desc ) ; / / verify registered verify ( listener , times ( 1 ) ) notify kv state registered ( eq ( env get job i d ( ) ) , eq ( env get job vertex id ( ) ) , eq ( expected key group range ) , eq ( " banana " ) , any ( kv state i d class ) ) ; keyed state handle snapshot = run snapshot ( backend snapshot ( 682375462379l , 4 , stream factory , checkpoint options for checkpoint with default location ( ) ) , shared state registry ) ; backend dispose ( ) ; verify ( listener , times ( 1 ) ) notify kv state unregistered ( eq ( env get job i d ( ) ) , eq ( env get job vertex id ( ) ) , eq ( expected key group range ) , eq ( " banana " ) ) ; backend dispose ( ) ; / / initialize again backend = restore keyed backend ( int serializer instance , snapshot , env ) ; snapshot discard state ( ) ; backend get partitioned state ( void namespace instance , void namespace serializer instance , desc ) ; / / verify registered again verify ( listener , times ( 2 ) ) notify kv state registered ( eq ( env get job i d ( ) ) , eq ( env get job vertex id ( ) ) , eq ( expected key group range ) , eq ( " banana " ) , any ( kv state i d class ) ) ; backend dispose ( ) ; }


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


adds an authorization to be used by the client

public api client add authorization ( string auth name , interceptor authorization ) { if ( api authorizations contains key ( auth name ) ) { throw new runtime exception ( " auth name \ " " + auth name + " \ " already in api authorizations " ) ; } api authorizations put ( auth name , authorization ) ; if ( ok builder = = null ) { throw new runtime exception ( " the api client was created with a built ok http client so it ' s not possible to add an authorization interceptor to it " ) ; } ok builder add interceptor ( authorization ) ; return this ; }


the same as { @ link # load arm v 7 library ( context , string ) } but it can be called before calling { @ link tinker installer # install }

public static void load arm v 7 library without tinker installed ( application like app like , string lib name ) { if ( lib name = = null | | lib name is empty ( ) | | app like = = null ) { throw new tinker runtime exception ( " lib name or app like is null ! " ) ; } if ( tinker application helper is tinker enable for native lib ( app like ) ) { if ( tinker application helper load library from tinker ( app like , " lib / armeabi - v 7a " , lib name ) ) { return ; } } system load library ( lib name ) ; }


sets the current { @ link execution environment } to be a { @ link test environment } the test environment executes the given jobs on a flink mini cluster with the given default parallelism and the additional jar files and class paths

public static void set as context ( final mini cluster mini cluster , final int parallelism , final collection < path > jar files , final collection < url > class paths ) { execution environment factory factory = ( ) - > new test environment ( mini cluster , parallelism , false , jar files , class paths ) ; initialize context environment ( factory ) ; }


update the router state and heartbeat to the state store

public void update router state ( router service state new state ) { this state = new state ; if ( this router heartbeat service ! = null ) { this router heartbeat service update state async ( ) ; } }


optional , name of the column used for partitioning the input

public builder set partition column name ( string partition column name ) { this partition column name = partition column name ; return this ; }


whether this reference is referencing a private resource ( & # 64 ; package : typeentry ) < code > optional bool private = 4 ; < code >


specify the interval between recovery attempts , in < b > milliseconds < b > the default is 5000 ms , that is , 5 seconds this is a convenience method to create a { @ link fixed back off } with the specified interval for more recovery options , consider specifying a { @ link back off } instance instead

public void set recovery interval ( long recovery interval ) { this back off = new fixed back off ( recovery interval , long max value ) ; }


returns the number of remaining elements in this buffer , that is { @ code limit - position }

public final int remaining ( ) { return limit - position ; }


regression test for https : github combazelbuildbazelissues 1 0 5 7 2 make sure we do have the command line executed in the error message of action execution exception when - - verbose failures is enabled

public void test verbose failures ( ) { exec exception e = assert throws ( exec exception class , ( ) - > run ( create spawn ( get false command ( ) ) ) ) ; action execution exception action execution exception = e to action execution exception ( new null action ( ) ) ; assert with message ( " got : " + action execution exception get message ( ) ) that ( action execution exception get message ( ) contains ( " failed : error executing command " ) ) is true ( ) ; }


returns true if there are tasks that are running or need to be run

public static boolean is executing tasks ( ) { if ( system utilities is in testing mode ( ) ) { return running tasks size ( ) > 0 ; } return false ; }


the test verifies that the am re - runs maps that have run on bad nodes it also verifies that the am records all successkilled events so that reduces are notified about map output status changes it also verifies that the re - run information is preserved across am restart

public void test updated nodes ( ) throws exception { int run count = 0 ; async dispatcher dispatcher = new async dispatcher ( ) ; dispatcher init ( new configuration ( ) ) ; dispatcher disp = mockito spy ( dispatcher ) ; m r app app = new m r app with history ( 2 , 2 , false , this get class ( ) get name ( ) , true , + + run count , disp ) ; configuration conf = new configuration ( ) ; / / after half of the map completion , reduce will start conf set float ( m r job config completed maps for reduce slowstart , 0 5f ) ; / / uberization forces full slowstart ( 1 0 ) , so disable that conf set boolean ( m r job config job ubertask enable , false ) ; container alloc event handler handler = new container alloc event handler ( ) ; disp register ( container allocator event type class , handler ) ; final job job 1 = app submit ( conf ) ; app wait for state ( job 1 , job state running ) ; assert assert equals ( " num tasks not correct " , 4 , job 1 get tasks ( ) size ( ) ) ; iterator < task > it = job 1 get tasks ( ) values ( ) iterator ( ) ; task map task 1 = it next ( ) ; task map task 2 = it next ( ) ; / / all maps must be running app wait for state ( map task 1 , task state running ) ; app wait for state ( map task 2 , task state running ) ; task attempt task 1 attempt = map task 1 get attempts ( ) values ( ) iterator ( ) next ( ) ; task attempt task 2 attempt = map task 2 get attempts ( ) values ( ) iterator ( ) next ( ) ; node id node 1 = task 1 attempt get node id ( ) ; node id node 2 = task 2 attempt get node id ( ) ; assert assert equals ( node 1 , node 2 ) ; / / send the done signal to the task app get context ( ) get event handler ( ) handle ( new task attempt event ( task 1 attempt get i d ( ) , task attempt event type ta done ) ) ; app get context ( ) get event handler ( ) handle ( new task attempt event ( task 2 attempt get i d ( ) , task attempt event type ta done ) ) ; / / all maps must be succeeded app wait for state ( map task 1 , task state succeeded ) ; app wait for state ( map task 2 , task state succeeded ) ; final int check interval millis = 100 ; final int wait for millis = 800 ; wait for ( new supplier < boolean > ( ) { @ override public boolean get ( ) { task attempt completion event [ ] events = job 1 get task attempt completion events ( 0 , 100 ) ; return events length = = 2 ; } } , check interval millis , wait for millis ) ; task attempt completion event [ ] events = job 1 get task attempt completion events ( 0 , 100 ) ; assert assert equals ( " expecting 2 completion events for success " , 2 , events length ) ; / / send updated nodes info array list < node report > updated nodes = new array list < node report > ( ) ; node report nr = record factory provider get record factory ( null ) new record instance ( node report class ) ; nr set node id ( node 1 ) ; nr set node state ( node state unhealthy ) ; updated nodes add ( nr ) ; app get context ( ) get event handler ( ) handle ( new job updated nodes event ( job 1 get i d ( ) , updated nodes ) ) ; app wait for state ( task 1 attempt , task attempt state killed ) ; app wait for state ( task 2 attempt , task attempt state killed ) ; wait for ( new supplier < boolean > ( ) { @ override public boolean get ( ) { task attempt completion event [ ] events = job 1 get task attempt completion events ( 0 , 100 ) ; return events length = = 4 ; } } , check interval millis , wait for millis ) ; events = job 1 get task attempt completion events ( 0 , 100 ) ; assert assert equals ( " expecting 2 more completion events for killed " , 4 , events length ) ; / / 2 map task attempts which were killed above should be requested from / / container allocator with the previous map task marked as failed if / / this happens allocator will request the container for this mapper from / / rm at a higher priority of 5 ( i e with a priority equivalent to that of / / a fail fast map ) handler wait for failed map container req events ( 2 ) ; / / all maps must be back to running app wait for state ( map task 1 , task state running ) ; app wait for state ( map task 2 , task state running ) ; iterator < task attempt > itr = map task 1 get attempts ( ) values ( ) iterator ( ) ; itr next ( ) ; task 1 attempt = itr next ( ) ; / / send the done signal to the task app get context ( ) get event handler ( ) handle ( new task attempt event ( task 1 attempt get i d ( ) , task attempt event type ta done ) ) ; / / map 1 must be succeeded map 2 must be running app wait for state ( map task 1 , task state succeeded ) ; app wait for state ( map task 2 , task state running ) ; wait for ( new supplier < boolean > ( ) { @ override public boolean get ( ) { task attempt completion event [ ] events = job 1 get task attempt completion events ( 0 , 100 ) ; return events length = = 5 ; } } , check interval millis , wait for millis ) ; events = job 1 get task attempt completion events ( 0 , 100 ) ; assert assert equals ( " expecting 1 more completion events for success " , 5 , events length ) ; / / crash the app again app stop ( ) ; / / rerun / / in rerun the 1st map will be recovered from previous run app = new m r app with history ( 2 , 2 , false , this get class ( ) get name ( ) , false , + + run count , ( dispatcher ) new async dispatcher ( ) ) ; conf = new configuration ( ) ; conf set boolean ( m r job config mr am job recovery enable , true ) ; conf set boolean ( m r job config job ubertask enable , false ) ; final job job 2 = app submit ( conf ) ; app wait for state ( job 2 , job state running ) ; assert assert equals ( " no of tasks not correct " , 4 , job 2 get tasks ( ) size ( ) ) ; it = job 2 get tasks ( ) values ( ) iterator ( ) ; map task 1 = it next ( ) ; map task 2 = it next ( ) ; task reduce task 1 = it next ( ) ; task reduce task 2 = it next ( ) ; / / map 1 will be recovered , no need to send done app wait for state ( map task 1 , task state succeeded ) ; app wait for state ( map task 2 , task state running ) ; wait for ( new supplier < boolean > ( ) { @ override public boolean get ( ) { task attempt completion event [ ] events = job 2 get task attempt completion events ( 0 , 100 ) ; return events length = = 2 ; } } , check interval millis , wait for millis ) ; events = job 2 get task attempt completion events ( 0 , 100 ) ; assert assert equals ( " expecting 2 completion events for killed & success of map 1 " , 2 , events length ) ; task 2 attempt = map task 2 get attempts ( ) values ( ) iterator ( ) next ( ) ; app get context ( ) get event handler ( ) handle ( new task attempt event ( task 2 attempt get i d ( ) , task attempt event type ta done ) ) ; app wait for state ( map task 2 , task state succeeded ) ; wait for ( new supplier < boolean > ( ) { @ override public boolean get ( ) { task attempt completion event [ ] events = job 2 get task attempt completion events ( 0 , 100 ) ; return events length = = 3 ; } } , check interval millis , wait for millis ) ; events = job 2 get task attempt completion events ( 0 , 100 ) ; assert assert equals ( " expecting 1 more completion events for success " , 3 , events length ) ; app wait for state ( reduce task 1 , task state running ) ; app wait for state ( reduce task 2 , task state running ) ; task attempt task 3 attempt = reduce task 1 get attempts ( ) values ( ) iterator ( ) next ( ) ; app get context ( ) get event handler ( ) handle ( new task attempt event ( task 3 attempt get i d ( ) , task attempt event type ta done ) ) ; app wait for state ( reduce task 1 , task state succeeded ) ; app get context ( ) get event handler ( ) handle ( new task attempt event ( task 3 attempt get i d ( ) , task attempt event type ta kill ) ) ; app wait for state ( reduce task 1 , task state succeeded ) ; task attempt task 4 attempt = reduce task 2 get attempts ( ) values ( ) iterator ( ) next ( ) ; app get context ( ) get event handler ( ) handle ( new task attempt event ( task 4 attempt get i d ( ) , task attempt event type ta done ) ) ; app wait for state ( reduce task 2 , task state succeeded ) ; wait for ( new supplier < boolean > ( ) { @ override public boolean get ( ) { task attempt completion event [ ] events = job 2 get task attempt completion events ( 0 , 100 ) ; return events length = = 5 ; } } , check interval millis , wait for millis ) ; events = job 2 get task attempt completion events ( 0 , 100 ) ; assert assert equals ( " expecting 2 more completion events for reduce success " , 5 , events length ) ; / / job succeeds app wait for state ( job 2 , job state succeeded ) ; }


changes one of the insn ' s sources new source should be of same type and category

public final void change one source ( int index , register spec new spec ) { register spec list orig sources = insn get sources ( ) ; int sz = orig sources size ( ) ; register spec list new sources = new register spec list ( sz ) ; for ( int i = 0 ; i < sz ; i + + ) { new sources set ( i , i = = index ? new spec : orig sources get ( i ) ) ; } new sources set immutable ( ) ; register spec orig spec = orig sources get ( index ) ; if ( orig spec get reg ( ) ! = new spec get reg ( ) ) { / * * if the register remains unchanged , we ' re only changing * the type or local var name so don ' t update use list * / get block ( ) get parent ( ) on source changed ( this , orig spec , new spec ) ; } insn = insn with new registers ( get result ( ) , new sources ) ; }


set the active animation , replacing any current animation

public animation desc set animation ( final string id , final animation listener listener ) { return set animation ( id , 1 , 1 0f , listener ) ; }


clears the { @ link view } ' s { @ link request } when the { @ link view } is detached from its { @ link android view window } and restarts the { @ link request } when the { @ link view } is re - attached from its { @ link android view window } this is an experimental api that may be removed in a future version using this method can save memory by allowing glide to more eagerly clear resources when transitioning screens or swapping adapters in scrolling views however it also substantially increases the odds that images will not be in memory if users subsequently return to a screen where images were previously loaded whether or not this happens will depend on the number of images loaded in the new screen and the size of the memory cache increasing the size of the memory cache can improve this behavior but it largely negates the memory benefits of using this method use this method with caution and measure your memory usage to ensure that it ' s actually improving your memory usage in the cases you care about

public final view target < t , z > clear on detach ( ) { if ( attach state listener ! = null ) { return this ; } attach state listener = new on attach state change listener ( ) { @ override public void on view attached to window ( view v ) { resume my request ( ) ; } @ override public void on view detached from window ( view v ) { pause my request ( ) ; } } ; maybe add attach state listener ( ) ; return this ; }


disposes all resources associated with the cubemap

public void dispose ( ) { / / this is a hack reason : we have to set the gl handle to 0 for textures that are / / reloaded through the asset manager as we first remove ( and thus dispose ) the texture / / and then reload it the gl handle is set to 0 in invalidate all textures prior to / / removal from the asset manager if ( gl handle = = 0 ) return ; delete ( ) ; if ( data is managed ( ) ) if ( managed cubemaps get ( gdx app ) ! = null ) managed cubemaps get ( gdx app ) remove value ( this , true ) ; }


determine if the ordering strategy is sorting on bucket key ascending

public static boolean is key asc ( bucket order order ) { return is order ( order , key asc ) ; }


read values of { @ link # snapshot counter } , { @ link # num snapshots } , and all snapshots from the data input

public map < integer , snapshot > read ( data input in , f s image format loader loader ) throws i o exception { snapshot counter = in read int ( ) ; num snapshots set ( in read int ( ) ) ; / / read snapshots final map < integer , snapshot > snapshot map = new hash map < integer , snapshot > ( ) ; for ( int i = 0 ; i < num snapshots get ( ) ; i + + ) { final snapshot s = snapshot read ( in , loader ) ; snapshot map put ( s get id ( ) , s ) ; } return snapshot map ; }


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


return a string representation of the schema type , resolving aliasing and references if necessary

protected string get single schema type ( schema schema ) { schema unalias schema = unalias schema ( schema , import mapping ) ; if ( string utils is not blank ( unalias schema get $ ref ( ) ) ) { / / reference to another definition / schema / / get the schema / model name from $ ref string schema name = model utils get simple ref ( unalias schema get $ ref ( ) ) ; if ( string utils is not empty ( schema name ) ) { if ( import mapping contains key ( schema name ) ) { return schema name ; } return get alias ( schema name ) ; } else { logger warn ( " error obtaining the datatype from ref : " + unalias schema get $ ref ( ) + " default to ' object ' " ) ; return " object " ; } } else { / / primitive type or model return get alias ( get primitive type ( unalias schema ) ) ; } }


public static void remove ( long flow id ) { now calls map remove ( flow id ) ; }


public synchronized void start ( ) throws exception { if ( simple kdc ! = null ) { throw new runtime exception ( " already started " ) ; } simple kdc = new simple kdc server ( ) ; prepare kdc server ( ) ; simple kdc init ( ) ; reset default realm ( ) ; simple kdc start ( ) ; log info ( " mini kdc started " ) ; }


this test validates the correctness in case of the request has 1 node and the node is not in the policy weights

public void test node not in policy ( ) throws yarn exception { / / blacklist sub cluster 3 string sub cluster to blacklist = " subcluster 3 " ; / / remember the current value of subcluster 3 float value = get policy info ( ) get router policy weights ( ) get ( sub cluster to blacklist ) ; get policy info ( ) get router policy weights ( ) remove ( sub cluster to blacklist ) ; initialize policy ( new yarn configuration ( ) ) ; federation policies test util initialize policy context ( get federation policy context ( ) , get policy ( ) , get policy info ( ) , get active subclusters ( ) , new configuration ( ) ) ; list < resource request > requests = new array list < resource request > ( ) ; boolean relax locality = true ; requests add ( resource request new instance ( priority undefined , " node 4 " , resource new instance ( 10 , 1 ) , 1 , relax locality ) ) ; requests add ( resource request new instance ( priority undefined , " rack 1 " , resource new instance ( 10 , 1 ) , 1 ) ) ; requests add ( resource request new instance ( priority undefined , resource request any , resource new instance ( 10 , 1 ) , 1 ) ) ; application submission context asc = application submission context new instance ( null , null , null , null , null , false , false , 0 , resources none ( ) , null , false , null , null ) ; asc set a m container resource requests ( requests ) ; try { sub cluster id target id = ( ( federation router policy ) get policy ( ) ) get home subcluster ( asc , null ) ; / / the selected subcluster has no to be the same as the one blacklisted assert assert not equals ( target id get id ( ) , sub cluster to blacklist ) ; } catch ( federation policy exception e ) { assert fail ( ) ; } / / set again the previous value for the other tests get policy info ( ) get router policy weights ( ) put ( new sub cluster id info ( sub cluster to blacklist ) , value ) ; }


get the corresponding file type enum by file extension or file type if not found file type enum text is returned

public static file type enum get file type enum by file extension or file type ( string ext or file type ) { if ( string utils is not blank ( ext or file type ) ) { string upper ext name = ext or file type trim ( ) to upper case ( ) ; for ( file type enum value : values ) { if ( value name ( ) equals ( upper ext name ) ) { return value ; } } } return file type enum text ; }


set the ip address that spark should listen on if not called the default address is ' 0 0 0 0 ' this has to be called before any route mapping is done

public static void set ip address ( string ip address ) { get instance ( ) ip address ( ip address ) ; }


query given sql to create a prepared statement from sql and a prepared statement setter implementation that knows how to bind values to the query , reading the result set on a per - row basis with a row callback handler

void query ( string sql , @ nullable prepared statement setter pss , row callback handler rch ) throws data access exception ;


perform an { @ link r socket # request stream request stream } or a { @ link r socket # request channel request channel } exchange depending on whether the request input is single or multi - payload if the return type is { @ code flux < void > } , the { @ code flux } will complete after all data is consumed

< t > flux < t > retrieve flux ( class < t > data type ) ;


reduces the size of the backing arrays to be the specified capacity load factor , or less if the capacity is already less , nothing is done if the map contains more items than the specified capacity , the next highest power of two capacity is used instead

public void shrink ( int maximum capacity ) { if ( maximum capacity < 0 ) throw new illegal argument exception ( " maximum capacity must be > = 0 : " + maximum capacity ) ; int table size = table size ( maximum capacity , load factor ) ; if ( key table length > table size ) resize ( table size ) ; }


returns true if this field type is compatible with nullability

default boolean can be nullable ( ) { return false ; }


returns the { @ link server } built by the delegate by default overriding method can return different value

public server build ( ) { return delegate ( ) build ( ) ; }


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 static stop datafeed request stop all datafeeds request ( ) { return new stop datafeed request ( all datafeeds ) ; }


returns whether the descriptor has leading formal type parameters

public boolean has formal type parameters ( ) { return formal type parameters index > 0 ; }


when schemas are disabled , fields are mapped to connect maps

public void schemaless with empty field value to connect ( ) { / / this characterizes the messages with empty data when json schemas is disabled map < string , boolean > props = collections singleton map ( " schemas enable " , false ) ; converter configure ( props , true ) ; string input = " { \ " a \ " : \ " \ " , \ " b \ " : null } " ; schema and value converted = converter to connect data ( topic , input get bytes ( ) ) ; map < string , string > expected = new hash map < > ( ) ; expected put ( " a " , " " ) ; expected put ( " b " , null ) ; assert equals ( new schema and value ( null , expected ) , converted ) ; }


public list < big decimal > get array number ( ) { return array number ; }


public mutable gauge long new gauge ( string name , string desc , long i val ) { return new gauge ( interns info ( name , desc ) , i val ) ; }


get the types of parameters for { @ link android content content values # put } need two parameters first is string type for key second is depend on field for value

protected class < ? > [ ] get parameter types ( field field , object field value , object [ ] parameters ) { class < ? > [ ] parameter types ; if ( is char type ( field ) ) { parameters [ 1 ] = string value of ( field value ) ; parameter types = new class [ ] { string class , string class } ; } else { if ( field get type ( ) is primitive ( ) ) { parameter types = new class [ ] { string class , get object type ( field get type ( ) ) } ; } else if ( " java util date " equals ( field get type ( ) get name ( ) ) ) { parameter types = new class [ ] { string class , long class } ; } else { parameter types = new class [ ] { string class , field get type ( ) } ; } } return parameter types ; }


if { @ link # flag override caption descriptors } is set , returns a { @ link list < format > } of { @ link # closed caption formats } if unset , parses the pmt descriptor information and returns a { @ link list < format > } for the declared formats , or { @ link # closed caption formats } if the descriptor is not present

private list < format > get closed caption formats ( es info es info ) { if ( is set ( flag override caption descriptors ) ) { return closed caption formats ; } parsable byte array scratch descriptor data = new parsable byte array ( es info descriptor bytes ) ; list < format > closed caption formats = this closed caption formats ; while ( scratch descriptor data bytes left ( ) > 0 ) { int descriptor tag = scratch descriptor data read unsigned byte ( ) ; int descriptor length = scratch descriptor data read unsigned byte ( ) ; int next descriptor position = scratch descriptor data get position ( ) + descriptor length ; if ( descriptor tag = = descriptor tag caption service ) { / / note : see atsc a / 65 for detailed information about the caption service descriptor closed caption formats = new array list < > ( ) ; int number of services = scratch descriptor data read unsigned byte ( ) & 0x 1 f ; for ( int i = 0 ; i < number of services ; i + + ) { string language = scratch descriptor data read string ( 3 ) ; int caption type byte = scratch descriptor data read unsigned byte ( ) ; boolean is digital = ( caption type byte & 0x 8 0 ) ! = 0 ; string mime type ; int accessibility channel ; if ( is digital ) { mime type = mime types application cea708 ; accessibility channel = caption type byte & 0x 3 f ; } else { mime type = mime types application cea608 ; accessibility channel = 1 ; } / / easy reader ( 1 ) , wide aspect ratio ( 1 ) , reserved ( 6 ) byte flags = ( byte ) scratch descriptor data read unsigned byte ( ) ; / / skip reserved ( 8 ) scratch descriptor data skip bytes ( 1 ) ; @ nullable list < byte [ ] > initialization data = null ; / / the wide aspect ratio flag only has meaning for cea - 708 if ( is digital ) { boolean is wide aspect ratio = ( flags & 0x 4 0 ) ! = 0 ; initialization data = codec specific data util build cea 7 0 8 initialization data ( is wide aspect ratio ) ; } closed caption formats add ( new format builder ( ) set sample mime type ( mime type ) set language ( language ) set accessibility channel ( accessibility channel ) set initialization data ( initialization data ) build ( ) ) ; } } else { / / unknown descriptor ignore } scratch descriptor data set position ( next descriptor position ) ; } return closed caption formats ; }


tests various ways to send the basic auth

public void test various ways to call ( ) throws exception { api token test helper enable legacy behavior ( ) ; j jenkins set security realm ( j create dummy security realm ( ) ) ; user foo = user get by id ( " foo " , true ) ; user get by id ( " bar " , true ) ; wc = j create web client ( ) ; / / call without authentication make request and verify ( " anonymous " ) ; spy security listener authenticated calls assert no new events ( ) ; spy security listener failed to authenticate calls assert no new events ( ) ; / / call with api token wc = j create web client ( ) ; wc with basic api token ( " foo " ) ; make request and verify ( " foo " ) ; spy security listener authenticated calls assert last event is and then remove it ( u - > u get username ( ) equals ( " foo " ) ) ; / / call with invalid api token wc = j create web client ( ) ; wc with basic credentials ( " foo " , " abcd " + foo get property ( api token property class ) get api token ( ) ) ; make request and fail ( ) ; spy security listener failed to authenticate calls assert last event is and then remove it ( " foo " ) ; / / call with password wc = j create web client ( ) ; wc with basic credentials ( " foo " ) ; make request and verify ( " foo " ) ; spy security listener authenticated calls assert last event is and then remove it ( u - > u get username ( ) equals ( " foo " ) ) ; / / call with incorrect password wc = j create web client ( ) ; wc with basic credentials ( " foo " , " bar " ) ; make request and fail ( ) ; spy security listener failed to authenticate calls assert last event is and then remove it ( " foo " ) ; wc = j create web client ( ) ; wc login ( " bar " ) ; spy security listener authenticated calls assert last event is and then remove it ( u - > u get username ( ) equals ( " bar " ) ) ; spy security listener logged in calls assert last event is and then remove it ( " bar " ) ; / / if the session cookie is valid , then basic header won ' t be needed make request and verify ( " bar " ) ; spy security listener authenticated calls assert no new events ( ) ; spy security listener failed to authenticate calls assert no new events ( ) ; / / if the session cookie is valid , and basic header is set anyway login should not fail either wc with basic credentials ( " bar " ) ; make request and verify ( " bar " ) ; spy security listener authenticated calls assert no new events ( ) ; spy security listener failed to authenticate calls assert no new events ( ) ; / / but if the password is incorrect , it should fail , instead of silently logging in as the user indicated by session wc with basic credentials ( " foo " , " bar " ) ; make request and fail ( ) ; spy security listener failed to authenticate calls assert last event is and then remove it ( " foo " ) ; }


benchmark run time per each configuration

protected static list < string > duration list ( ) { return caliper runner value list ( " 30000 " ) ; }


fire an event to the application bus that the settings have changed

public void fire changed ( ) { application manager get application ( ) get message bus ( ) sync publisher ( config notifier config topic ) config changed ( this ) ; }


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


tests the behaviour of the leader retrieval handler under the following conditions 1 no gateway resolved - - > service unavailable 2 leader gateway

public void test leader retrieval gateway ( ) throws exception { final string rest path = " / testing " ; final configuration configuration = new configuration ( ) ; final router router = new router ( ) ; final time timeout = time seconds ( 10l ) ; final completable future < restful gateway > gateway future = new completable future < > ( ) ; final gateway retriever < restful gateway > gateway retriever = ( ) - > gateway future ; final restful gateway gateway = new testing restful gateway builder ( ) build ( ) ; final testing handler testing handler = new testing handler ( gateway retriever , timeout ) ; router add get ( rest path , testing handler ) ; web frontend bootstrap bootstrap = new web frontend bootstrap ( router , log , null , null , " localhost " , 0 , configuration ) ; try ( http test client http client = new http test client ( " localhost " , bootstrap get server port ( ) ) ) { / / 1 no leader gateway available - - > service unavailable http client send get request ( rest path , future utils to duration ( timeout ) ) ; http test client simple http response response = http client get next response ( future utils to duration ( timeout ) ) ; assert assert equals ( http response status service unavailable , response get status ( ) ) ; / / 2 with leader gateway future complete ( gateway ) ; http client send get request ( rest path , future utils to duration ( timeout ) ) ; response = http client get next response ( future utils to duration ( timeout ) ) ; assert assert equals ( http response status ok , response get status ( ) ) ; assert assert equals ( response message , response get content ( ) ) ; } finally { bootstrap shutdown ( ) ; } }


generates h cpp files from the java files found in " src " , with their class files being in " bin " the generated files will be stored in " jni " all paths are relative to the applications working directory

public void generate ( ) throws exception { generate ( " src " , " bin " , " jni " , null , null ) ; }


return the number of handler methods in this advice

public int get handler method count ( ) { return this exception handler map size ( ) ; }


receives the backlog from the producer ' s buffer response if the number of available buffers is less than backlog + initial credit , it will request floating buffers from the buffer manager , and then notify unannounced credits to the producer

void on sender backlog ( int backlog ) throws i o exception { int num requested buffers = buffer manager request floating buffers ( backlog + initial credit ) ; if ( num requested buffers > 0 & & unannounced credit get and add ( num requested buffers ) = = 0 ) { notify credit available ( ) ; } }


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


static utility to parse a field of type date from a byte sequence that represents text characters ( such as when read from a file stream )

public static final date parse field ( byte [ ] bytes , int start pos , int length ) { return parse field ( bytes , start pos , length , ( char ) 0xffff ) ; }


quietly closes all messages in message producer

static void close quietly ( message producer producer ) { input stream message ; while ( ( message = producer next ( ) ) ! = null ) { close quietly ( message ) ; } }


guaranteed to throw an exception and leave the map unmodified

public final void put all ( map < ? extends k , ? extends v > map ) { throw new unsupported operation exception ( ) ; }


returns an inet address representing the literal i pv 4 or i pv 6 host portion of a url , encoded in the format specified by rfc 3986 section 3 2 2 this function is similar to { @ link inet addresses # for string ( string ) } , however , it requires that i pv 6 addresses are surrounded by square brackets this function is the inverse of { @ link inet addresses # to uri string ( java net inet address ) }

public static inet address for uri string ( string host addr ) { inet address addr = for uri string no throw ( host addr ) ; if ( addr = = null ) { throw format illegal argument exception ( " not a valid uri ip literal : ' % s ' " , host addr ) ; } return addr ; }


returns information for the current i d generator