public void test simple check number of buttons ( ) throws exception { html page p = create web client ( ) go to ( " self / test simple with delete button " ) ; html form f = p get form by name ( " config " ) ; string button caption = " add " ; assert equals ( 1 , get buttons list ( f , button caption ) size ( ) ) ; get html button ( f , button caption , true ) click ( ) ; / / click add button wait for java script ( p ) ; assert equals ( 1 , get buttons list ( f , button caption ) size ( ) ) ; / / check that second add button is not present get html button ( f , " delete " , true ) click ( ) ; / / click delete button wait for java script ( p ) ; assert equals ( 1 , get buttons list ( f , button caption ) size ( ) ) ; / / check that only one add button is in form }


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

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


sets { @ link # reverse deps } does not alter { @ link # reverse deps data to consolidate }

synchronized void set single reverse dep for reverse deps util ( sky key reverse dep ) { this reverse deps = reverse dep ; }


set an anchor point where the panel can stop during sliding

public void set anchor point ( float anchor point ) { if ( anchor point > 0 & & anchor point < = 1 ) { m anchor point = anchor point ; m first layout = true ; request layout ( ) ; } }


return whether it is a image according to the file name

public static boolean is image ( final string file path ) { try { bitmap factory options options = new bitmap factory options ( ) ; options in just decode bounds = true ; bitmap factory decode file ( file path , options ) ; return options out width > 0 & & options out height > 0 ; } catch ( exception e ) { return false ; } }


report results of a qps test benchmark scenario

public void report scenario ( io grpc benchmarks proto control scenario result request , io grpc stub stream observer < io grpc benchmarks proto control void > response observer ) { io grpc stub client calls async unary call ( get channel ( ) new call ( get report scenario method ( ) , get call options ( ) ) , request , response observer ) ; }


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


protected boolean include aspect attribute ( attribute attr , collection < label > value ) { return true ; }


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

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


configures how to partition records from flink ' s partitions into kafka ' s partitions this strategy allows for a custom partitioner by providing an implementation of { @ link flink kafka partitioner }

public kafka sink partitioner custom ( class < ? extends flink kafka partitioner > partitioner class ) { sink partitioner type = connector sink partitioner value custom ; sink partitioner class = preconditions check not null ( partitioner class ) ; return this ; }


private void show merge panel ( long id , task monitor monitor ) { try { final change listener change listener = new change listener ( ) { @ override public void state changed ( change event e ) { conflict option = conflict panel get selected options ( ) ; if ( conflict option = = ask user | | conflict option = = canceled ) { if ( merge manager ! = null ) { merge manager set apply enabled ( false ) ; } return ; } if ( merge manager ! = null ) { merge manager clear status text ( ) ; } try { merge ( conflict option , monitor ) ; if ( merge manager ! = null ) { merge manager set apply enabled ( true ) ; } } catch ( cancelled exception e 1 ) { / / user cancel - no need to log } } } ; swing utilities invoke and wait ( new runnable ( ) { @ override public void run ( ) { setup conflict panel ( id , change listener , monitor ) ; } } ) ; } catch ( interrupted exception | invocation target exception e ) { msg error ( this , " unexpected error showing merge panel for tag " + id , e ) ; } if ( merge manager ! = null ) { merge manager set apply enabled ( false ) ; merge manager show component ( conflict panel , " function tag merge " , new help location ( help topics repository , " function tags " ) ) ; } / / block until the user either cancels or hits the " apply " button / / on the merge dialog / / when the " apply " button is hit , get the user ' s selection / / and continue }


set the login header applies to the message frame

public void set subscription ( @ nullable string subscription ) { set ( subscription , subscription ) ; }


this test validates the correctness of { @ link r m web service protocol # get app statistics ( ) } inside router

public void test app statistics x m l ( ) throws exception { submit application ( ) ; list < application statistics info > responses = perform get calls ( rm web service path + app statistics , application statistics info class , states , " running " ) ; application statistics info router response = responses get ( 0 ) ; application statistics info rm response = responses get ( 1 ) ; assert not null ( router response ) ; assert not null ( rm response ) ; assert equals ( rm response get stat items ( ) size ( ) , router response get stat items ( ) size ( ) ) ; }


public static simple cache span create lookup ( string key , long position ) { return new simple cache span ( key , position , c length unset , c time unset , null ) ; }


assumes that { @ link # update requirements from metadata ( ) } has been called recently

private map < string , bundle requirement > get computed reqs ( ) { map < string , bundle requirement > deduped reqs = new hash map < > ( ) ; source file to requirements values ( ) stream ( ) flat map ( list : : stream ) for each ( r - > deduped reqs put if absent ( r to string ( ) , r ) ) ; return deduped reqs ; }


creates a temporary file with the contents and returns the absolute path

private static string create temp file ( string contents ) throws i o exception { file temp file = file create temp file ( " orders " , " csv " ) ; temp file delete on exit ( ) ; file utils write file utf 8 ( temp file , contents ) ; return temp file to u r i ( ) to string ( ) ; }


sets the elasticsearch version to be used required

public elasticsearch version ( string version ) { internal properties put string ( connector version , version ) ; return this ; }


{ @ inherit doc } looks for one of { @ link org openqa selenium support find by } , { @ link org openqa selenium support find bys } or { @ link org openqa selenium support find all } field annotations in case no annotations provided for field , uses field name as ' id ' or ' name '

public by build by ( ) { assert valid annotations ( ) ; by ans = null ; for ( annotation annotation : field get declared annotations ( ) ) { abstract find by builder builder = null ; if ( annotation annotation type ( ) is annotation present ( page factory finder class ) ) { try { builder = annotation annotation type ( ) get annotation ( page factory finder class ) value ( ) get declared constructor ( ) new instance ( ) ; } catch ( reflective operation exception e ) { / / fall through } } if ( builder ! = null ) { ans = builder build it ( annotation , field ) ; break ; } } if ( ans = = null ) { ans = build by from default ( ) ; } return ans ; }


required : a list of server specifications < code > repeated istio networking v 1alpha 3 server servers = 1 ; < code >

public com alibaba nacos istio model server builder get servers builder ( int index ) { return get servers field builder ( ) get builder ( index ) ; }


abstract factory pattern for wrapping an { @ link s s l engine } object this is useful for npnapln support

s s l engine wrap ssl engine ( s s l engine engine , jdk application protocol negotiator application negotiator , boolean is server ) ;


get storeorder { order id } : find purchase order by id for valid response try integer i ds with value & lt ; & # x 3 d ; 5 or & gt ; 10 other values will generated exceptions

default response entity < order > get order by id ( @ min ( 1l ) @ max ( 5l ) @ api param ( value = " id of pet that needs to be fetched " , required = true ) @ path variable ( " order id " ) long order id ) { get request ( ) if present ( request - > { for ( media type media type : media type parse media types ( request get header ( " accept " ) ) ) { if ( media type is compatible with ( media type value of ( " application / json " ) ) ) { string example string = " { \ " pet id \ " : 6 , \ " quantity \ " : 1 , \ " id \ " : 0 , \ " ship date \ " : \ " 2000 - 01 - 23t04 : 56 : 07 000 + 00 : 00 \ " , \ " complete \ " : false , \ " status \ " : \ " placed \ " } " ; api util set example response ( request , " application / json " , example string ) ; break ; } if ( media type is compatible with ( media type value of ( " application / xml " ) ) ) { string example string = " < order > < id > 123456789 < / id > < pet id > 123456789 < / pet id > < quantity > 123 < / quantity > < ship date > 2000 - 01 - 23t04 : 56 : 07 000z < / ship date > < status > aeiou < / status > < complete > true < / complete > < / order > " ; api util set example response ( request , " application / xml " , example string ) ; break ; } } } ) ; return new response entity < > ( http status not implemented ) ; }


cache something calculated at the shard level

private bytes reference cache shard level result ( index shard shard , mapping lookup cache key mapping cache key , directory reader reader , bytes reference cache key , checked consumer < stream output , i o exception > loader ) throws exception { index shard cache entity cache entity = new index shard cache entity ( shard ) ; checked supplier < bytes reference , i o exception > supplier = ( ) - > { / * bytes stream output allows to pass the expected size but by default uses * big arrays page size in bytes which is 1 6k a common cached result ie * a date histogram with 3 buckets is ~ 1 0 0byte so 1 6k might be very wasteful * since we don ' t shrink to the actual size once we are done serializing * by passing 512 as the expected size we will resize the byte array in the stream * slowly until we hit the page size and don ' t waste too much memory for small query * results * / final int expected size in bytes = 512 ; try ( bytes stream output out = new bytes stream output ( expected size in bytes ) ) { loader accept ( out ) ; / / for now , keep the paged data structure , which might have unused bytes to fill a page , but better to keep / / the memory properly paged instead of having varied sized bytes return out bytes ( ) ; } } ; return indices request cache get or compute ( cache entity , supplier , mapping cache key , reader , cache key ) ; }


create a new absolute expiration use { @ link expiration # never } to indicate an expiration that never expires

public static expiration new absolute ( date date ) { return new expiration ( date get time ( ) , false ) ; }


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

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


build thread stack element code signature

private string build stack element code signature ( stack trace element element ) { return element get class name ( ) + " " + element get method name ( ) + " : " + element get line number ( ) ; }


checking all { @ link rule } s about the protected method

public static entry entry ( method method , entry type traffic type ) throws block exception { return env sph entry ( method , traffic type , 1 , objects0 ) ; }


< code > map & lt ; string , bytes & gt ; bytes map = 11 ; < code >

public com google protobuf byte string get bytes map or default ( java lang string key , com google protobuf byte string default value ) { if ( key = = null ) { throw new java lang null pointer exception ( ) ; } java util map < java lang string , com google protobuf byte string > map = internal get bytes map ( ) get map ( ) ; return map contains key ( key ) ? map get ( key ) : default value ; }


returns true if at least one of the provided domain files can be added to the repository

public boolean is enabled for context ( domain file context context ) { list < domain file > domain files = context get selected files ( ) ; for ( domain file domain file : domain files ) { if ( domain file can add to repository ( ) ) { return true ; / / has at least one domain file that can be added to the repository } } return false ; }


returns whether a runtime implementation can expect a finite number of rows this information might be derived from the session ' s execution mode andor kind of query


subclasses can override this method to implement interruption of the future ' s computation the method is invoked automatically by a successful call to { @ link # cancel ( boolean ) cancel ( true ) } the default implementation does nothing


called any time the mouse cursor or a finger touch is moved out of an actor on the desktop , this event occurs even when no mouse buttons are pressed ( pointer will be - 1 )

public void exit ( input event event , float x , float y , int pointer , @ null actor to actor ) { }


return the currently specified data type name of the composite being viewed

public string get composite name ( ) { return current name ; }


captures the current thread context as writeable , allowing it to be serialized out later

public writeable capture as writeable ( ) { final thread context struct context = thread local get ( ) ; return out - > context write to ( out , default header ) ; }


public void analyze function ( hash map < address , func info > const use , decomp interface decomp interface , program prog , function f , hash set < address > string location set ) { if ( f = = null ) { return ; } if ( ! decompile function ( f , decomp interface ) ) { return ; } address entry = f get entry point ( ) ; iterator < pcode op a s t > ops = hfunction get pcode ops ( ) ; while ( ops has next ( ) & & ! monitor is cancelled ( ) ) { pcode op a s t pcode op a s t = ops next ( ) ; / / system out println ( pcode op a s t ) ; if ( pcode op a s t get opcode ( ) ! = pcode op call ) { continue ; } varnode called func = pcode op a s t get input ( 0 ) ; if ( called func = = null | | ! called func is address ( ) ) { continue ; } address called func addr = called func get address ( ) ; / / rifle through parameters int num params = pcode op a s t get num inputs ( ) ; for ( int i = 1 ; i < num params ; i + + ) { varnode parm = pcode op a s t get input ( i ) ; / / 1st param is the call dest if ( parm = = null ) { continue ; } / / follow back to a const if possible array list < pcode op > local def use list = new array list < pcode op > ( ) ; / / check out the const use list to see if we fished out a constant don ' t follow out of function / / see if it is a constant if ( parm is constant ( ) ) { / / then this is a resource id / / lookup the resource and create a reference long value = parm get offset ( ) ; / / todo : not so fast , if there is a def use list , must apply it to get the real constant used ! try { value = apply def use list ( value , local def use list ) ; / / const use put ( called func addr , i ) ; } catch ( invalid input exception exc ) { / / do nothing } long mask = 0xffffffffffffffff l > > > ( ( 8 - entry get address space ( ) get pointer size ( ) ) * 8 ) ; address possible addr = entry get new address ( mask & value ) ; if ( string location set contains ( possible addr ) ) { mark string param ( const use , possible addr , called func addr , i - 1 , num params - 1 ) ; } } if ( parm is address ( ) ) { if ( string location set contains ( parm get address ( ) ) ) { mark string param ( const use , parm get address ( ) , called func addr , i - 1 , num params - 1 ) ; } } } } }


get the block data file for a block from a given datanode

public file get block file ( int dn index , extended block block ) { / / check for block file in the two storage directories of the datanode for ( int i = 0 ; i < = 1 ; i + + ) { file storage dir = get storage dir ( dn index , i ) ; file block file = get block file ( storage dir , block ) ; if ( block file exists ( ) ) { return block file ; } } return null ; }


only perform this update request if the document ' s modification was assigned the given sequence number must be used in combination with { @ link # set if primary term ( long ) } if the document last modification was assigned a different sequence number a { @ link org elasticsearch index engine version conflict engine exception } will be thrown

public update request set if seq no ( long seq no ) { if ( seq no < 0 & & seq no ! = unassigned seq no ) { throw new illegal argument exception ( " sequence numbers must be non negative got [ " + seq no + " ] " ) ; } if seq no = seq no ; return this ; }


creates a fixture from a shape and attach it to this body this is a convenience function use b 2 fixture def if you need to set parameters like friction , restitution , user data , or filtering if the density is non - zero , this function automatically updates the mass of the body

public fixture create fixture ( shape shape , float density ) { long fixture addr = jni create fixture ( addr , shape addr , density ) ; fixture fixture = this world free fixtures obtain ( ) ; fixture reset ( this , fixture addr ) ; this world fixtures put ( fixture addr , fixture ) ; this fixtures add ( fixture ) ; return fixture ; }


check the class file with the given name , assuming the current path is part of the classpath

public class name subject with class ( string class name ) { if ( actual = = null ) { fail without actual ( simple fact ( " expected not to be null " ) ) ; } exists ( ) ; return check ( " class ( % s ) " , class name ) about ( class name subject class names ( actual ) ) that ( class name ) ; }


adds a transition factory that produces a trimming transition to be run over all targets after other transitions transitions are run in the order they ' re added this is a temporary measure for supporting trimming of test rules and manual trimming of feature flags , and support for this transition factory will likely be removed at some point in the future ( whenever automatic trimming is sufficiently workable )

public builder add trimming transition factory ( transition factory < rule > factory ) { preconditions check not null ( factory ) ; preconditions check argument ( ! factory is split ( ) ) ; if ( trimming transition factory = = null ) { trimming transition factory = factory ; } else { trimming transition factory = composing transition factory of ( trimming transition factory , factory ) ; } return this ; }


gets the combined exec properties of the given exec group and the target ' s exec properties if a property is set in both , the exec group properties take precedence if a non - existent exec group is passed in , just returns the target ' s exec properties

private static immutable map < string , string > get exec properties ( string exec group , map < string , immutable map < string , string > > exec properties ) { if ( ! exec properties contains key ( exec group ) | | exec group equals ( default exec group name ) ) { return exec properties get ( default exec group name ) ; } / / use a hash map to build here because we expect duplicate keys to happen / / ( and rewrite previous entries ) map < string , string > target and group properties = new hash map < > ( exec properties get ( default exec group name ) ) ; target and group properties put all ( exec properties get ( exec group ) ) ; return immutable map copy of ( target and group properties ) ; }


gets all the records under the current context ( i e join key )

iterable < row data > get records ( ) throws exception ;


this method makes coordinates of connection flow better

protected static list < graphic info > connection perfectionizer ( default process diagram canvas process diagram canvas , bpmn model bpmn model , base element source element , base element target element , list < graphic info > graphic info list ) { graphic info source graphic info = bpmn model get graphic info ( source element get id ( ) ) ; graphic info target graphic info = bpmn model get graphic info ( target element get id ( ) ) ; default process diagram canvas shape type source shape type = get shape type ( source element ) ; default process diagram canvas shape type target shape type = get shape type ( target element ) ; return process diagram canvas connection perfectionizer ( source shape type , target shape type , source graphic info , target graphic info , graphic info list ) ; }


returns true if topology recovery is enabled , false otherwise

public boolean is topology recovery ( ) { return topology recovery ; }


checks that the threads do not terminate within the default millisecond delay of { @ code timeout millis ( ) }

void assert threads stay alive ( thread threads ) { assert threads stay alive ( timeout millis ( ) , threads ) ; }


set the cci template for this dao explicitly , as an alternative to specifying a connection factory

public final void set cci template ( org springframework jca cci core cci template cci template ) { this cci template = cci template ; }


public void test format ( ) throws i o exception { pipes non java input format input format = new pipes non java input format ( ) ; job conf conf = new job conf ( ) ; reporter reporter = mock ( reporter class ) ; record reader < float writable , null writable > reader = input format get record reader ( new fake split ( ) , conf , reporter ) ; assert equals ( 0 0f , reader get progress ( ) , 0 001 ) ; / / input and output files file input 1 = new file ( work space + file separator + " input 1 " ) ; if ( ! input 1 get parent file ( ) exists ( ) ) { assert assert true ( input 1 get parent file ( ) mkdirs ( ) ) ; } if ( ! input 1 exists ( ) ) { assert assert true ( input 1 create new file ( ) ) ; } file input 2 = new file ( work space + file separator + " input 2 " ) ; if ( ! input 2 exists ( ) ) { assert assert true ( input 2 create new file ( ) ) ; } / / set data for splits conf set ( org apache hadoop mapreduce lib input file input format input dir , string utils escape string ( input 1 get absolute path ( ) ) + " , " + string utils escape string ( input 2 get absolute path ( ) ) ) ; input split [ ] splits = input format get splits ( conf , 2 ) ; assert equals ( 2 , splits length ) ; pipes non java input format pipes dummy record reader dummy record reader = new pipes non java input format pipes dummy record reader ( conf , splits [ 0 ] ) ; / / empty dummy record reader assert null ( dummy record reader create key ( ) ) ; assert null ( dummy record reader create value ( ) ) ; assert equals ( 0 , dummy record reader get pos ( ) ) ; assert equals ( 0 0 , dummy record reader get progress ( ) , 0 001 ) ; / / test method next assert true ( dummy record reader next ( new float writable ( 2 0f ) , null writable get ( ) ) ) ; assert equals ( 2 0 , dummy record reader get progress ( ) , 0 001 ) ; dummy record reader close ( ) ; }


public boolean keyed ( ) { return keyed ; }


regression test for hdfs - 2742 the issue in this bug was : - dn does a block report while file is open this br contains the block in rbw state - standby queues the rbw state in pending datanode messages - standby processes edit logs during failover before fixing this bug , it was mistakenly applying the rbw reported state after the block had been completed , causing the block to get marked corrupt instead , we should now be applying the rbw message on op add , and then the finalized message on op close

public void test block reports while file being written ( ) throws exception { f s data output stream out = fs create ( test file path ) ; try { append test util write ( out , 0 , 10 ) ; out hflush ( ) ; / / block report will include the rbw replica , but will be / / queued on the standby node cluster trigger block reports ( ) ; } finally { i o utils close stream ( out ) ; } cluster transition to standby ( 0 ) ; cluster transition to active ( 1 ) ; / / verify that no replicas are marked corrupt , and that the / / file is readable from the failed - over standby block manager test util update state ( nn 1 get namesystem ( ) get block manager ( ) ) ; block manager test util update state ( nn 2 get namesystem ( ) get block manager ( ) ) ; assert equals ( 0 , nn 1 get namesystem ( ) get corrupt replica blocks ( ) ) ; assert equals ( 0 , nn 2 get namesystem ( ) get corrupt replica blocks ( ) ) ; d f s test util read file ( fs , test file path ) ; }


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

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


an opaque identifier for the mcp node < code > string id = 1 ; < code >

public builder set id bytes ( com google protobuf byte string value ) { if ( value = = null ) { throw new null pointer exception ( ) ; } check byte string is utf 8 ( value ) ; id = value ; on changed ( ) ; return this ; }


helper function that verified blocks of a file are placed on the expected storage type

public static boolean verify file replicas on storage type ( file system fs , d f s client client , path path , storage type storage type ) throws i o exception { if ( ! fs exists ( path ) ) { log info ( " verify file replicas on storage type : file " + path + " does not exist " ) ; return false ; } long file length = client get file info ( path to string ( ) ) get len ( ) ; located blocks located blocks = client get located blocks ( path to string ( ) , 0 , file length ) ; for ( located block located block : located blocks get located blocks ( ) ) { if ( located block get storage types ( ) [ 0 ] ! = storage type ) { log info ( " verify file replicas on storage type : for file " + path + " expect blk " + located block + " on type : " + storage type + " actual type : " + located block get storage types ( ) [ 0 ] ) ; return false ; } } return true ; }


return the intent of shutdown requires root permission or hold { @ code android : shared user id = " android uid system " } , { @ code < uses - permission android : name = " android permission shutdown " > } in manifest

public static intent get shutdown intent ( ) { intent intent ; if ( build version sdk int > = build version codes o ) { intent = new intent ( intent action shutdown ) ; } else { intent = new intent ( " com android internal intent action request shutdown " ) ; } intent put extra ( " android intent extra key confirm " , false ) ; return intent add flags ( intent flag activity new task ) ; }


verifies that a collection is immutable a collection is considered immutable if : all its mutation methods result in unsupported operation exception , and do not change the underlying contents all methods that return objects that can indirectly mutate the collection throw unsupported operation exception when those mutators are called

public static < e > void assert collection is unmodifiable ( collection < e > collection , e sample element ) { collection < e > sibling collection = new array list < > ( ) ; sibling collection add ( sample element ) ; collection < e > copy = new array list < > ( ) ; / / avoid copy add all ( collection ) , which runs afoul of an android bug in older versions : / / http : / / b android com / 72073 http : / / r android com / 98929 iterators add all ( copy , collection iterator ( ) ) ; try { collection add ( sample element ) ; fail ( " add succeeded on unmodifiable collection " ) ; } catch ( unsupported operation exception expected ) { } assert collections are equivalent ( copy , collection ) ; try { collection add all ( sibling collection ) ; fail ( " add all succeeded on unmodifiable collection " ) ; } catch ( unsupported operation exception expected ) { } assert collections are equivalent ( copy , collection ) ; try { collection clear ( ) ; fail ( " clear succeeded on unmodifiable collection " ) ; } catch ( unsupported operation exception expected ) { } assert collections are equivalent ( copy , collection ) ; assert iterator is unmodifiable ( collection iterator ( ) ) ; assert collections are equivalent ( copy , collection ) ; try { collection remove ( sample element ) ; fail ( " remove succeeded on unmodifiable collection " ) ; } catch ( unsupported operation exception expected ) { } assert collections are equivalent ( copy , collection ) ; try { collection remove all ( sibling collection ) ; fail ( " remove all succeeded on unmodifiable collection " ) ; } catch ( unsupported operation exception expected ) { } assert collections are equivalent ( copy , collection ) ; try { collection retain all ( sibling collection ) ; fail ( " retain all succeeded on unmodifiable collection " ) ; } catch ( unsupported operation exception expected ) { } assert collections are equivalent ( copy , collection ) ; }


returns pure string representation of the id in hexadecimal this method should be used to construct things like paths etc , that require a stable representation and is therefore final

public final string to hex string ( ) { if ( this hex string = = null ) { final byte [ ] ba = new byte [ size ] ; long to byte array ( this lower part , ba , 0 ) ; long to byte array ( this upper part , ba , size of long ) ; this hex string = string utils byte to hex string ( ba ) ; } return this hex string ; }


private static iterator < string > iterator 2 ( byte trie ifc < string > trie ) throws cancelled exception { final array list < string > list = new array list < string > ( ) ; trie inorder ( task monitor adapter dummy monitor , new op < string > ( ) { @ override public void op ( byte trie node ifc < string > node ) { if ( node is terminal ( ) ) { assert equals ( " wrong node length " , node get value ( ) length , node length ( ) ) ; list add ( node get item ( ) ) ; } } } ) ; return list iterator ( ) ; }


all the dependent plugins , mandatory or optional , are disabled using - strategy all

public void disable plugins strategy all ( ) { assert plugin enabled ( " dependee " ) ; assert plugin enabled ( " depender " ) ; assert plugin enabled ( " mandatory - depender " ) ; assert that ( disable plugins c li command ( " - strategy " , " all " , " variant " , " dependee " , " plugin - first " ) , succeeded ( ) ) ; assert plugin disabled ( " variant " ) ; assert plugin disabled ( " dependee " ) ; assert plugin disabled ( " depender " ) ; assert plugin disabled ( " plugin - first " ) ; assert plugin disabled ( " mandatory - depender " ) ; }


updates the current search range to encompass the entire program

public void update search range all ( ) { if ( plugin = = null ) { return ; } search ranges clear ( ) ; address range iterator iterator = plugin get current program ( ) get memory ( ) get loaded and initialized address set ( ) get address ranges ( ) ; while ( iterator has next ( ) ) { search ranges add ( iterator next ( ) ) ; } }


public void register listener ( job i d job id , kv state registry listener listener ) { final kv state registry listener previous value = listeners put if absent ( job id , listener ) ; if ( previous value ! = null ) { throw new illegal state exception ( " listener already registered under " + job id + ' ' ) ; } }


adds the textures and regions from the specified texture atlas data

public void load ( texture atlas data data ) { textures ensure capacity ( data pages size ) ; for ( page page : data pages ) { if ( page texture = = null ) page texture = new texture ( page texture file , page format , page use mip maps ) ; page texture set filter ( page min filter , page mag filter ) ; page texture set wrap ( page u wrap , page v wrap ) ; textures add ( page texture ) ; } regions ensure capacity ( data regions size ) ; for ( region region : data regions ) { atlas region atlas region = new atlas region ( region page texture , region left , region top , / / region rotate ? region height : region width , / / region rotate ? region width : region height ) ; atlas region index = region index ; atlas region name = region name ; atlas region offset x = region offset x ; atlas region offset y = region offset y ; atlas region original height = region original height ; atlas region original width = region original width ; atlas region rotate = region rotate ; atlas region degrees = region degrees ; atlas region names = region names ; atlas region values = region values ; if ( region flip ) atlas region flip ( false , true ) ; regions add ( atlas region ) ; } }


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

builder patch ( string pattern , handler function < server response > handler function ) ;


helper method to set api key prefix for the first api key authentication

public void set api key prefix ( string api key prefix ) { for ( authentication auth : authentications values ( ) ) { if ( auth instanceof api key auth ) { ( ( api key auth ) auth ) set api key prefix ( api key prefix ) ; return ; } } throw new runtime exception ( " no api key authentication configured ! " ) ; }


list < web socket extension > get extensions ( ) ;


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

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


returns < code > true < code > iff all replicas are active for the given shard routing otherwise < code > false < code >

public boolean all replicas active ( shard id shard id , metadata metadata ) { final list < shard routing > shards = assigned shards ( shard id ) ; if ( shards is empty ( ) | | shards size ( ) < metadata get index safe ( shard id get index ( ) ) get number of replicas ( ) + 1 ) { return false ; / / if we are empty nothing is active if we have less than total at least one is unassigned } for ( shard routing shard : shards ) { if ( ! shard active ( ) ) { return false ; } } return true ; }


get a packed database whose unpacking may be cached if possible provided do not cache is false

public static packed database get packed database ( resource file packed db file , boolean never cache , task monitor monitor ) throws i o exception , cancelled exception { if ( ! never cache & & packed database cache is enabled ( ) ) { try { return packed database cache get cache ( ) get cached d b ( packed db file , monitor ) ; } catch ( i o exception e ) { msg warn ( packed database class , " packed database cache failure for : " + packed db file + " , " + e get message ( ) ) ; } } return new packed database ( packed db file ) ; }


{ @ inherit doc } if more data was requested than was actually returned , this was an incomplete read increment { @ link # reads incomplete }

public void read operation completed ( int requested , int actual ) { if ( requested > actual ) { reads incomplete increment and get ( ) ; } }


returns true if the specified value is in the map note this traverses the entire map and compares every value , which may be an expensive operation

public boolean contains value ( int value ) { if ( has zero value & & zero value = = value ) return true ; int [ ] key table = this key table ; int [ ] value table = this value table ; for ( int i = value table length - 1 ; i > = 0 ; i - - ) if ( key table [ i ] ! = 0 & & value table [ i ] = = value ) return true ; return false ; }


public static command result exec cmd ( final string command , final boolean is rooted , final boolean is need result msg ) { return exec cmd ( new string [ ] { command } , is rooted , is need result msg ) ; }


handle the case where the result set does not contain a row

protected void handle no row found ( ) throws data access exception { throw new empty result data access exception ( " lob streaming result set extractor did not find row in database " , 1 ) ; }


public static < t > t execute groovy script ( final resource groovy script , final string method name , final class < t > clazz , final object args ) { return execute groovy script ( groovy script , method name , args , clazz , false ) ; }


enable or disable the recommendation check for the ' type ' attribute for more details , see { @ link rule configuration # is enable invalid type recommendation ( ) }

public void set enable invalid type recommendation ( boolean enable invalid type recommendation ) { this enable invalid type recommendation = enable invalid type recommendation ; }


get the name with any namespace stripped

string strip namespace ( string name ) { int index = name last index of ( namespace delimiter ) ; if ( index < = 0 ) { return name ; } return name substring ( index + namespace delimiter length ( ) ) ; }


return whether this represents an actual autowiring value

public boolean is autowire ( ) { return ( this = = by name | | this = = by type ) ; }


return the actual data length of the blob with the specified properties if it is a page blob , you can ' t rely on the length from the properties argument and you must get it from the file otherwise , you can

private long get data length ( cloud blob wrapper blob , blob properties properties ) throws azure exception { if ( blob instanceof cloud page blob wrapper ) { try { return page blob input stream get page blob data size ( ( cloud page blob wrapper ) blob , get instrumented context ( is concurrent o o b append allowed ( ) ) ) ; } catch ( exception e ) { throw new azure exception ( " unexpected exception getting page blob actual data size " , e ) ; } } return properties get length ( ) ; }


finds the lowest - order bit set at or after the given index in the given { @ code int }

public static int find first ( int value , int idx ) { value & = ~ ( ( 1 < < idx ) - 1 ) ; / / mask off too - low bits int result = integer number of trailing zeros ( value ) ; return ( result = = 32 ) ? - 1 : result ; }


internal query to resolve the " to many desc list " to - many relationship of to many entity

public list < to many target entity > query to many entity to many desc list ( long to many id desc ) { synchronized ( this ) { if ( to many entity to many desc list query = = null ) { query builder < to many target entity > query builder = query builder ( ) ; query builder where ( properties to many id desc eq ( null ) ) ; query builder order raw ( " t ' id ' desc " ) ; to many entity to many desc list query = query builder build ( ) ; } } query < to many target entity > query = to many entity to many desc list query for current thread ( ) ; query set parameter ( 0 , to many id desc ) ; return query list ( ) ; }


attach an instance or additional location the variable can be found in

public void attach instances ( varnode [ ] inst , varnode rep ) { represent = rep ; if ( inst = = null ) { instances = new varnode [ 1 ] ; instances [ 0 ] = rep ; } else { instances = inst ; } }


splits the specified polygon by datelines and adds them to the supplied polygon array

public static void decompose polygon ( polygon polygon , boolean orientation , list < polygon > collector ) { if ( polygon is empty ( ) ) { return ; } linear ring shell = filter ring ( polygon get polygon ( ) ) ; linear ring [ ] holes = new linear ring [ polygon get number of holes ( ) ] ; int num edges = shell length ( ) - 1 ; / / last point is repeated for ( int i = 0 ; i < polygon get number of holes ( ) ; i + + ) { holes [ i ] = filter ring ( polygon get hole ( i ) ) ; num edges + = holes [ i ] length ( ) - 1 ; validate hole ( shell , holes [ i ] ) ; } edge [ ] edges = new edge [ num edges ] ; edge [ ] hole components = new edge [ holes length ] ; final atomic boolean translated = new atomic boolean ( false ) ; int offset = create edges ( 0 , orientation , shell , null , edges , 0 , translated ) ; for ( int i = 0 ; i < polygon get number of holes ( ) ; i + + ) { int length = create edges ( i + 1 , orientation , shell , holes [ i ] , edges , offset , translated ) ; hole components [ i ] = edges [ offset ] ; offset + = length ; } int num holes = hole components length ; num holes = merge ( edges , 0 , intersections ( + dateline , edges ) , hole components , num holes ) ; num holes = merge ( edges , 0 , intersections ( - dateline , edges ) , hole components , num holes ) ; compose ( edges , hole components , num holes , collector ) ; }


default response entity < void > delete pet ( @ api param ( value = " pet id to delete " , required = true ) @ path variable ( " pet id " ) long pet id , @ api param ( value = " " ) @ request header ( value = " api key " , required = false ) string api key ) { return new response entity < > ( http status not implemented ) ; }


when provided an emoji that is a skin variation of another , this will return the default yellow version this is to aid in search , so using a variation will still find all emojis tagged with the default version if the emoji has no skin variations , this function will return the original emoji

public static @ non null string get canonical representation ( @ non null string emoji ) { string canonical = variation map get ( emoji ) ; return canonical ! = null ? canonical : emoji ; }


mark an access of the specified entry used only in { @ code compact linked hash map } for lru ordering

void access entry ( int index ) { / / no - op by default }


factory method to create and initialize a row object

public static row object create row object ( table model model , int row ) { row object row object = new row object ( ) ; int columns = model get column count ( ) ; for ( int i = 0 ; i < columns ; i + + ) { row object add element ( model get value at ( row , i ) ) ; } return row object ; }


notifies the reader that a seek has occurred following a call to this method , the data passed to the next invocation of { @ link # consume ( parsable byte array ) } will not be a continuation of the data that was previously passed hence the reader should reset any internal state

public void seek ( ) { seen first dts = false ; pes payload reader seek ( ) ; }


returns the next unsigned byte , adding it the crc and incrementing { @ code bytes consumed } it is the responsibility of the caller to verify and reset the crc as needed , as well as caching the current crc value when necessary before invoking this method

private int read unsigned byte ( ) { int bytes remaining in inflater input = inflater input end - inflater input start ; int b ; if ( bytes remaining in inflater input > 0 ) { b = inflater input [ inflater input start ] & 0x f f ; inflater input start + = 1 ; } else { b = gzipped data read unsigned byte ( ) ; } crc update ( b ) ; bytes consumed + = 1 ; return b ; }


list children ; mark the result as non - auth if the ttl has expired if the allow authoritative flag is true , return without filtering or checking for ttl expiry if false : the expiry scan takes place and the todo : should we always purge tombstones ? even in auth ?

public static dir listing metadata list children with ttl ( metadata store ms , path path , @ nullable i ttl time provider time provider , boolean allow authoritative ) throws i o exception { dir listing metadata dlm = ms list children ( path ) ; if ( time provider = = null ) { log debug ( " time provider is null , returning dir listing metadata as is " ) ; return dlm ; } if ( allow authoritative ) { log debug ( " allow authoritative is true , returning path metadata as is " ) ; return dlm ; } / / filter expired entries if ( dlm ! = null ) { list < path metadata > expired = dlm remove expired entries from listing ( time provider get metadata ttl ( ) , time provider get now ( ) ) ; / / now purge the tombstones for ( path metadata metadata : expired ) { if ( metadata is deleted ( ) ) { ms forget metadata ( metadata get file status ( ) get path ( ) ) ; } } } return dlm ; }


trims the cache according to the specified trimming strategy and the given trim type

public void trim ( memory trim type trim type ) { array list < entry < k , v > > old entries ; final double trim ratio = m cache trim strategy get trim ratio ( trim type ) ; synchronized ( this ) { int target cache size = ( int ) ( m cached entries get size in bytes ( ) * ( 1 - trim ratio ) ) ; int target eviction queue size = math max ( 0 , target cache size - get in use size in bytes ( ) ) ; old entries = trim exclusively owned entries ( integer max value , target eviction queue size ) ; make orphans ( old entries ) ; } maybe close ( old entries ) ; maybe notify exclusive entry removal ( old entries ) ; maybe update cache params ( ) ; maybe evict entries ( ) ; }


test the listing with different user names to make sure only directories that are owned by the user are listed

public void test list with different user ( ) throws exception { cluster get namesystem ( ) get snapshot manager ( ) set allow nested snapshots ( true ) ; / / first make dir 1 and dir 2 snapshottable hdfs allow snapshot ( dir 1 ) ; hdfs allow snapshot ( dir 2 ) ; hdfs set permission ( root , fs permission value of ( " - rwxrwxrwx " ) ) ; / / create two dirs and make them snapshottable under the name of user 1 user group information ugi 1 = user group information create user for testing ( " user 1 " , new string [ ] { " group 1 " } ) ; distributed file system fs 1 = ( distributed file system ) d f s test util get file system as ( ugi 1 , conf ) ; path dir 1 user 1 = new path ( " / dir 1 user 1 " ) ; path dir 2 user 1 = new path ( " / dir 2 user 1 " ) ; fs 1 mkdirs ( dir 1 user 1 ) ; fs 1 mkdirs ( dir 2 user 1 ) ; hdfs allow snapshot ( dir 1 user 1 ) ; hdfs allow snapshot ( dir 2 user 1 ) ; / / user 2 user group information ugi 2 = user group information create user for testing ( " user 2 " , new string [ ] { " group 2 " } ) ; distributed file system fs 2 = ( distributed file system ) d f s test util get file system as ( ugi 2 , conf ) ; path dir user 2 = new path ( " / dir user 2 " ) ; path subdir user 2 = new path ( dir user 2 , " subdir " ) ; fs 2 mkdirs ( dir user 2 ) ; fs 2 mkdirs ( subdir user 2 ) ; hdfs allow snapshot ( dir user 2 ) ; hdfs allow snapshot ( subdir user 2 ) ; / / super user string supergroup = conf get ( dfs permissions superusergroup key , dfs permissions superusergroup default ) ; user group information super ugi = user group information create user for testing ( " superuser " , new string [ ] { supergroup } ) ; distributed file system fs 3 = ( distributed file system ) d f s test util get file system as ( super ugi , conf ) ; / / list the snapshottable dirs for superuser snapshottable directory status [ ] dirs = fs 3 get snapshottable dir listing ( ) ; / / 6 snapshottable dirs : dir 1 , dir 2 , dir 1 user 1 , dir 2 user 1 , dir user 2 , and / / subdir user 2 assert equals ( 6 , dirs length ) ; / / list the snapshottable dirs for user 1 dirs = fs 1 get snapshottable dir listing ( ) ; / / 2 dirs owned by user 1 : dir 1 user 1 and dir 2 user 1 assert equals ( 2 , dirs length ) ; assert equals ( dir 1 user 1 , dirs [ 0 ] get full path ( ) ) ; assert equals ( dir 2 user 1 , dirs [ 1 ] get full path ( ) ) ; / / list the snapshottable dirs for user 2 dirs = fs 2 get snapshottable dir listing ( ) ; / / 2 dirs owned by user 2 : dir user 2 and subdir user 2 assert equals ( 2 , dirs length ) ; assert equals ( dir user 2 , dirs [ 0 ] get full path ( ) ) ; assert equals ( subdir user 2 , dirs [ 1 ] get full path ( ) ) ; }


returns the action type must not be { @ code null }


if the delegate collection is empty , but the multimap has values for the key , replace the delegate with the new collection for the key for a subcollection , refresh its ancestor and validate that the ancestor delegate hasn ' t changed

void refresh if empty ( ) { if ( ancestor ! = null ) { ancestor refresh if empty ( ) ; if ( ancestor get delegate ( ) ! = ancestor delegate ) { throw new concurrent modification exception ( ) ; } } else if ( delegate is empty ( ) ) { collection < v > new delegate = map get ( key ) ; if ( new delegate ! = null ) { delegate = new delegate ; } } }


public < t extends transitive info provider > rule configured target builder add providers ( transitive info provider map providers ) { providers builder add all ( providers ) ; return this ; }


primitive sink put bytes ( byte [ ] bytes ) ;


default void on seek started ( event time event time ) { }


tests that { @ link event sample stream # update event stream ( event stream , boolean ) } will update the underlying event stream , but keep the timestamp the stream has seek to , so the next { @ link event sample stream # read data ( format holder , decoder input buffer , boolean ) } call will return sample data from the seek position

public void seek to us then update stream continue to read from seek position ( ) { long presentation time us 1 = 1000000 ; long presentation time us 2 = 2000000 ; long presentation time us 3 = 3000000 ; event message event message 1 = new event message with id ( 1 ) ; event message event message 2 = new event message with id ( 2 ) ; event message event message 3 = new event message with id ( 3 ) ; event stream event stream 1 = new event stream ( scheme id , value , time scale , new long [ ] { presentation time us 1 , presentation time us 2 } , new event message [ ] { event message 1 , event message 2 } ) ; event stream event stream 2 = new event stream ( scheme id , value , time scale , new long [ ] { presentation time us 1 , presentation time us 2 , presentation time us 3 } , new event message [ ] { event message 1 , event message 2 , event message 3 } ) ; event sample stream sample stream = new event sample stream ( event stream 1 , format , true ) ; / / first read - read format read data ( sample stream ) ; sample stream seek to us ( presentation time us 2 ) ; sample stream update event stream ( event stream 2 , true ) ; int result = read data ( sample stream ) ; assert that ( result ) is equal to ( c result buffer read ) ; assert that ( input buffer data array ( ) ) is equal to ( get encoded message ( event message 2 ) ) ; }


get the directory query parameter used by the list paths rest api and used as the path in the continuation token if the input path is null or the root path " " , empty string is returned if the input path begins with ' ' , the return value is the substring beginning at offset 1 otherwise , the input path is returned

public static string get directory query parameter ( final string path ) { string directory = path ; if ( strings is null or empty ( directory ) ) { directory = abfs http constants empty string ; } else if ( directory char at ( 0 ) = = ' / ' ) { directory = directory substring ( 1 ) ; } return directory ; }


private endpoint find by a p i ( list < endpoint > list , string api ) { for ( endpoint endpoint : list ) { if ( endpoint api equals ( api ) ) { return endpoint ; } } return null ; }


create a lexer which takes input from the specified string resets the error handler beforehand

private lexer create lexer ( string input ) { parser input input source = parser input from string ( input , " " ) ; errors clear ( ) ; return new lexer ( input source , file options default , errors ) ; }


some browsers require all the resources of the current system in order to run ( for example , safari on i o s ) and so do not support multiple simultaneous sessions on the same system other browsers can create isolated state for each new { @ link web driver } instance the count of simultaneous sessions is typically 1 , some multiple of the available number of cores , or { @ link integer # max value } if the number is unbounded or no - one cares

int get maximum simultaneous sessions ( ) ;


returns the lowest line number that has been visited so far

public int get lowest line number ( ) { return lowest line number ; }


fetch retry policy from configuration and create the retry policy with specified retry time and retry interval

protected static retry policy create retry policy ( configuration conf , long retry time , long retry interval , boolean is h a enabled ) { long rm connect wait m s = retry time ; long rm connection retry interval m s = retry interval ; boolean wait for ever = ( rm connect wait m s = = - 1 ) ; if ( ! wait for ever ) { if ( rm connect wait m s < 0 ) { throw new yarn runtime exception ( " invalid configuration " + yarn configuration resourcemanager connect max wait ms + " can be - 1 , but can not be other negative numbers " ) ; } / / try connect once if ( rm connect wait m s < rm connection retry interval m s ) { log warn ( yarn configuration resourcemanager connect max wait ms + " is smaller than " + yarn configuration resourcemanager connect retry interval ms + " only try connect once " ) ; rm connect wait m s = 0 ; } } / / handle ha case first if ( is h a enabled ) { final long failover sleep base ms = conf get long ( yarn configuration client failover sleeptime base ms , rm connection retry interval m s ) ; final long failover sleep max ms = conf get long ( yarn configuration client failover sleeptime max ms , rm connection retry interval m s ) ; int max failover attempts = conf get int ( yarn configuration client failover max attempts , - 1 ) ; if ( max failover attempts = = - 1 ) { if ( wait for ever ) { max failover attempts = integer max value ; } else { max failover attempts = ( int ) ( rm connect wait m s / failover sleep base ms ) ; } } return retry policies failover on network exception ( retry policies try once then fail , max failover attempts , failover sleep base ms , failover sleep max ms ) ; } if ( rm connection retry interval m s < 0 ) { throw new yarn runtime exception ( " invalid configuration " + yarn configuration resourcemanager connect retry interval ms + " should not be negative " ) ; } retry policy retry policy = null ; if ( wait for ever ) { retry policy = retry policies retry forever with fixed sleep ( rm connection retry interval m s , time unit milliseconds ) ; } else { retry policy = retry policies retry up to maximum time with fixed sleep ( rm connect wait m s , rm connection retry interval m s , time unit milliseconds ) ; } map < class < ? extends exception > , retry policy > exception to policy map = new hash map < class < ? extends exception > , retry policy > ( ) ; exception to policy map put ( e o f exception class , retry policy ) ; exception to policy map put ( connect exception class , retry policy ) ; exception to policy map put ( no route to host exception class , retry policy ) ; exception to policy map put ( unknown host exception class , retry policy ) ; exception to policy map put ( connect timeout exception class , retry policy ) ; exception to policy map put ( retriable exception class , retry policy ) ; exception to policy map put ( socket exception class , retry policy ) ; exception to policy map put ( socket timeout exception class , retry policy ) ; exception to policy map put ( standby exception class , retry policy ) ; / / yarn - 4288 : local i o exception is also possible exception to policy map put ( i o exception class , retry policy ) ; / / not retry on remote io exception return retry policies retry other than remote exception ( retry policies try once then fail , exception to policy map ) ; }


applies the given visitor to all type path elements

public void type path infos accept ( clazz clazz , type path info visitor type path visitor ) { for ( int index = 0 ; index < type path length ; index + + ) { / / we don ' t need double dispatching here , since there is only one / / type of type path info type path visitor visit type path info ( clazz , this , type path [ index ] ) ; } }


cancels a relocation of a shard that shard must relocating

private shard routing cancel relocation ( shard routing shard ) { relocating shards - - ; shard routing cancelled shard = shard cancel relocation ( ) ; update assigned ( shard , cancelled shard ) ; return cancelled shard ; }


the set of values defined for this entry , each corresponding to a different configurationvariant < code > repeated aapt pb config value config value = 4 ; < code >

private void add config value ( int index , com android aapt resources config value builder builder for value ) { ensure config value is mutable ( ) ; config value add ( index , builder for value build ( ) ) ; }


releases the { @ code client preface string } any active streams will be left in the open

private void cleanup ( ) { if ( client preface string ! = null ) { client preface string release ( ) ; client preface string = null ; } }


should only be used for tests to reset to any value

void reset last inode id without checking ( long new value ) { inode id set current value ( new value ) ; }


public get pet by id oper req spec ( consumer < request spec builder > req spec customizer ) { req spec customizer accept ( req spec ) ; return this ; }


determine if an external elf symbol has already been established with the same name and re - use it

private boolean process duplicate external ( elf symbol elf symbol ) { if ( last external block entry address = = null ) { return false ; } string sym name = elf symbol get name as string ( ) ; symbol s = find external block symbol ( sym name , external block limits get min address ( ) , last external block entry address ) ; if ( s ! = null ) { / / note : re - use of other fake external address does not support / / data allocation it may be necessary to ensure that dynamic / / symbol table is processed last set elf symbol address ( elf symbol , s get address ( ) ) ; return true ; } return false ; }


build vertices to represent an oriented box

public void set as box ( float hx , float hy , vector 2 center , float angle ) { jni set as box ( addr , hx , hy , center x , center y , angle ) ; }


specify the http server ' s tcp backlog default is - 1 , indicating the system ' s default value only applicable for a locally configured http server ignored when the { @ link # set server " server " } property has been specified

public void set backlog ( int backlog ) { this backlog = backlog ; }


output the getter name for boolean property , e g is active

public string to boolean getter ( string name ) { return boolean getter prefix + getter and setter capitalize ( name ) ; }


provide custom { @ link litho handler } if null is provided default one will be used for layouts

public void update layout thread handler ( @ nullable litho handler layout thread handler ) { synchronized ( m update state sync runnable lock ) { if ( m update state sync runnable ! = null ) { m layout thread handler remove ( m update state sync runnable ) ; } } synchronized ( m current calculate layout runnable lock ) { if ( m current calculate layout runnable ! = null ) { m layout thread handler remove ( m current calculate layout runnable ) ; } } m layout thread handler = ensure and instrument layout thread handler ( layout thread handler ) ; }


adds runfiles inputs from runfiles supplier to input mappings

void add runfiles to inputs ( map < path fragment , action input > input map , runfiles supplier runfiles supplier , metadata provider action file cache , artifact expander artifact expander ) throws i o exception { map < path fragment , map < path fragment , artifact > > roots and mappings = runfiles supplier get mappings ( ) ; for ( map entry < path fragment , map < path fragment , artifact > > root and mappings : roots and mappings entry set ( ) ) { path fragment root = root and mappings get key ( ) ; preconditions check state ( ! root is absolute ( ) , root ) ; for ( map entry < path fragment , artifact > mapping : root and mappings get value ( ) entry set ( ) ) { path fragment location = root get relative ( mapping get key ( ) ) ; artifact local artifact = mapping get value ( ) ; if ( local artifact ! = null ) { preconditions check state ( ! local artifact is middleman artifact ( ) ) ; if ( local artifact is tree artifact ( ) ) { list < action input > expanded inputs = action input helper expand artifacts ( nested set builder create ( order stable order , local artifact ) , artifact expander ) ; for ( action input input : expanded inputs ) { add mapping ( input map , location get relative ( ( ( tree file artifact ) input ) get parent relative path ( ) ) , input ) ; } } else if ( local artifact is fileset ( ) ) { immutable list < fileset output symlink > fileset links ; try { fileset links = artifact expander get fileset ( local artifact ) ; } catch ( missing expansion exception e ) { throw new illegal state exception ( e ) ; } add fileset manifest ( location , local artifact , fileset links , input map ) ; } else { if ( strict ) { fail if directory ( action file cache , local artifact ) ; } add mapping ( input map , location , local artifact ) ; } } else { add mapping ( input map , location , virtual action input empty marker ) ; } } } }


public int get pending conn size ( ) { return pending conn size ; }


sets the array size , leaving any values beyond the current size undefined

public boolean [ ] set size ( int new size ) { if ( new size < 0 ) throw new illegal argument exception ( " new size must be > = 0 : " + new size ) ; if ( new size > items length ) resize ( math max ( 8 , new size ) ) ; size = new size ; return items ; }


sets the content source to index using the default content type ( { @ link requests # index content type } ) < b > note : the number of objects passed to this method must be an even number also the first argument in each pair ( the field name ) must have a valid string representation < b >

public index request source ( object source ) { return source ( requests index content type , source ) ; }


collapsing toolbar layout sets it ' s own set on apply insets listener which consumes system insets { @ link collapsing toolbar layout # on window inset changed ( window insets compat ) } so we will not receive them in subviews with fits system windows = true override google ' s behavior

public void override listener ( ) { view compat set on apply window insets listener ( this , ( v , insets ) - > insets ) ; }


returns the class ' s access flags ( see { @ link opcodes } ) this value may not reflect deprecated and synthetic flags when bytecode is before 1 5 and those flags are represented by attributes

public int get access ( ) { return read unsigned short ( header ) ; }


public expiration policy to ticket expiration policy ( ) { return new saml attribute query ticket expiration policy ( cas properties get ticket ( ) get st ( ) get time to kill in seconds ( ) ) ; }


tests whether mtab parsing works as expected with the specified hierarchy

public void test remount ( ) throws exception { / / initialize mount point file parent dir = new file ( tmp path ) ; final string old mount point dir = " oldmount " ; final string new mount point dir = " newmount " ; file old mount point = new file ( parent dir , old mount point dir ) ; file mtab = create premounted cgroups ( old mount point , true ) ; file new mount point = new file ( parent dir , new mount point dir ) ; assert true ( " could not create dirs " , new file ( new mount point , " cpu " ) mkdirs ( ) ) ; / / initialize yarn classes configuration conf mount = create mount configuration ( ) ; conf mount set ( yarn configuration nm linux container cgroups mount path , parent dir get absolute path ( ) + path separator + new mount point dir ) ; c groups handler impl c groups handler = new c groups handler impl ( conf mount , privileged operation executor mock , mtab get absolute path ( ) ) ; c groups handler initialize c group controller ( c groups handler c group controller cpu ) ; argument captor < privileged operation > op captor = argument captor for class ( privileged operation class ) ; verify ( privileged operation executor mock ) execute privileged operation ( op captor capture ( ) , eq ( false ) ) ; file hierarchy file = new file ( new file ( new mount point , " cpu " ) , this hierarchy ) ; assert true ( " yarn cgroup should exist " , hierarchy file exists ( ) ) ; }


public final int compare to ( final integer that ) { return snapshot id integer comparator compare ( this snapshot id , that ) ; }


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


clears all selected records from multi - select mode

void clear selection ( ) { selected clear ( ) ; }


public void upload file ( long pet id , string additional metadata , async file file , handler < async result < model api response > > result handler ) { upload file ( pet id , additional metadata , file , null , result handler ) ; }


returns a function that computes the options referenced by a rule

public function < ? super rule , ? extends set < string > > get option reference function ( ) { return option reference function ; }


public void test skip to first with one or more at beginning ( ) throws exception { list < stream record < event > > stream events = new array list < > ( ) ; event a 1 = new event ( 1 , " a 1 " , 0 0 ) ; event a 2 = new event ( 2 , " a 2 " , 0 0 ) ; event a 3 = new event ( 3 , " a 3 " , 0 0 ) ; event b 1 = new event ( 4 , " b 1 " , 0 0 ) ; stream events add ( new stream record < > ( a 1 ) ) ; stream events add ( new stream record < > ( a 2 ) ) ; stream events add ( new stream record < > ( a 3 ) ) ; stream events add ( new stream record < > ( b 1 ) ) ; pattern < event , ? > pattern = pattern < event > begin ( " a " , after match skip strategy skip to first ( " a " ) ) where ( new simple condition < event > ( ) { @ override public boolean filter ( event value ) throws exception { return value get name ( ) contains ( " a " ) ; } } ) one or more ( ) consecutive ( ) greedy ( ) next ( " b " ) where ( new simple condition < event > ( ) { @ override public boolean filter ( event value ) throws exception { return value get name ( ) contains ( " b " ) ; } } ) ; n f a test harness nfa test harness = n f a test harness for pattern ( pattern ) build ( ) ; list < list < event > > resulting patterns = nfa test harness feed records ( stream events ) ; compare patterns ( resulting patterns , lists new array list ( lists new array list ( a 1 , a 2 , a 3 , b 1 ) , lists new array list ( a 2 , a 3 , b 1 ) , lists new array list ( a 3 , b 1 ) ) ) ; }


returns whether the current window is dynamic , or { @ code false } if the { @ link timeline } is empty


this test validates the correctness of the metric : submitted apps successfully

public void test succeeded apps submitted ( ) { long total good before = metrics get num succeeded apps submitted ( ) ; good sub cluster submit application ( 100 ) ; assert assert equals ( total good before + 1 , metrics get num succeeded apps submitted ( ) ) ; assert assert equals ( 100 , metrics get latency succeeded apps submitted ( ) , 0 ) ; good sub cluster submit application ( 200 ) ; assert assert equals ( total good before + 2 , metrics get num succeeded apps submitted ( ) ) ; assert assert equals ( 150 , metrics get latency succeeded apps submitted ( ) , 0 ) ; }


create a { @ code document builder } that this marshaller will use for creating dom documents when passed an empty { @ code d o m source } the resulting { @ code document builder factory } is cached , so this method will only be called once

protected document builder factory create document builder factory ( ) throws parser configuration exception { document builder factory factory = document builder factory new instance ( ) ; factory set validating ( false ) ; factory set namespace aware ( true ) ; factory set feature ( " http : / / apache org / xml / features / disallow - doctype - decl " , ! is support dtd ( ) ) ; factory set feature ( " http : / / xml org / sax / features / external - general - entities " , is process external entities ( ) ) ; return factory ; }


set a preference of which shard copies to execute the request

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


return the type of the constructor argument

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


the exceptions below extend their parent classes in order to additionally store the error that caused them however , they must impersonate their parents to any outside callers , including in their to string ( ) method , which prints the class name followed by the exception method this method returns the same value as the to string ( ) method of a { @ link throwable } ' s parent would , so that the child class can have the same to string ( ) value

private static string parent throwable to string ( throwable obj ) { string s = obj get class ( ) get superclass ( ) get name ( ) ; string message = obj get localized message ( ) ; return ( message ! = null ) ? ( s + " : " + message ) : s ; }


utility function for partial evaluation of { @ link file status } instances to a fixed set of handle options

public static function < file status , path handle > resolve ( bi function < file status , handle opt [ ] , path handle > fsr , handle opt opt ) { return ( stat ) - > fsr apply ( stat , opt ) ; }


returns the text of the comment , including the leading ' # ' but not the trailing newline

public string get text ( ) { return text ; }


checks if a top - level view with the given name exists and make sure that the name is good as a view name

public form validation do check view name ( @ query parameter string value ) { check permission ( view create ) ; string name = fix empty ( value ) ; if ( name = = null ) return form validation ok ( ) ; / / already exists ? if ( get view ( name ) ! = null ) return form validation error ( messages hudson view already exists ( name ) ) ; / / good view name ? try { check good name ( name ) ; } catch ( failure e ) { return form validation error ( e get message ( ) ) ; } return form validation ok ( ) ; }


unsafely removes the given entry from the given chain in this segment ' s hash table

e remove from chain for testing ( internal entry < k , v , ? > first , internal entry < k , v , ? > entry ) { return remove from chain ( cast for testing ( first ) , cast for testing ( entry ) ) ; }


tests that we don ' t try to be smart about < code > null < code > results they should be treated explicitly

public void test null pointer exception on null serialized result ( ) throws exception { new kv state response ( ( byte [ ] ) null ) ; }


public string get name ( ) { return name ; }


constructs a target expression on an allocation tag it is satisfied if there are allocations with one of the given tags the default namespace for these tags is { @ link allocation tag namespace type # self } , this only checks tags within the application

public static target expression allocation tag ( string allocation tags ) { return allocation tag with namespace ( allocation tag namespace type self to string ( ) , allocation tags ) ; }


get the fid hasher object suitable for producing fid hash quad objects for functions coming from a particular program

public fid hasher get hasher ( program program ) { list < instruction skipper > list = skippers get ( program get language ( ) get processor ( ) ) ; if ( list = = null ) { list = collections empty list ( ) ; } fid hasher fid hasher = new message digest fid hasher ( generator , short hash code unit length , digest factory , list ) ; return fid hasher ; }


returns the int denoted by a literal string in the specified base , as if by the starlark expression { @ code int ( s , base ) }

public static starlark int parse ( string s , int base ) { string string for errors = s ; if ( s is empty ( ) ) { throw new number format exception ( " empty string " ) ; } / / + / - prefix ? boolean is negative = false ; char c = s char at ( 0 ) ; if ( c = = ' + ' ) { s = s substring ( 1 ) ; } else if ( c = = ' - ' ) { s = s substring ( 1 ) ; is negative = true ; } string digits = s ; / / 0b 0o 0x prefix ? if ( s length ( ) > 1 & & s char at ( 0 ) = = ' 0 ' ) { int prefix base = 0 ; c = s char at ( 1 ) ; if ( c = = ' b ' | | c = = ' b ' ) { prefix base = 2 ; } else if ( c = = ' o ' | | c = = ' o ' ) { prefix base = 8 ; } else if ( c = = ' x ' | | c = = ' x ' ) { prefix base = 16 ; } if ( prefix base ! = 0 ) { digits = s substring ( 2 ) ; / / strip prefix if ( base = = 0 ) { base = prefix base ; } else if ( base ! = prefix base ) { throw new number format exception ( string format ( " invalid base - % d literal : % s ( % s prefix wants base % d ) " , base , starlark repr ( string for errors ) , s substring ( 0 , 2 ) , prefix base ) ) ; } } } / / no prefix , no base ? use decimal if ( digits = = s & & base = = 0 ) { / / don ' t infer base when input starts with ' 0 ' due to octal / decimal ambiguity if ( s length ( ) > 1 & & s char at ( 0 ) = = ' 0 ' ) { throw new number format exception ( " cannot infer base when string begins with a 0 : " + starlark repr ( string for errors ) ) ; } base = 10 ; } if ( base < 2 | | base > 36 ) { throw new number format exception ( string format ( " invalid base % d ( want 2 < = base < = 36 ) " , base ) ) ; } / / do not allow long parse long and new big integer to accept another + / - sign if ( digits starts with ( " + " ) | | digits starts with ( " - " ) ) { throw new number format exception ( string format ( " invalid base - % d literal : % s " , base , starlark repr ( string for errors ) ) ) ; } starlark int result ; try { result = starlark int of ( long parse long ( digits , base ) ) ; } catch ( number format exception unused 1 ) { try { result = starlark int of ( new big integer ( digits , base ) ) ; } catch ( number format exception unused 2 ) { throw new number format exception ( string format ( " invalid base - % d literal : % s " , base , starlark repr ( string for errors ) ) ) ; } } return is negative ? starlark int uminus ( result ) : result ; }


returns a list of batch result objects there will be one entry in the list for each successful sub - executor executed before the failing executor

public list < batch result > get successful batch results ( ) { return successful batch results ; }


partition the model - m subroutine graph using the model - p algorythm the method create block graph ( ) must first be called to generate the initial model - m graph

private void partition graph ( task monitor monitor ) throws cancelled exception { / / make entry point list and set their source number attribute linked list < vertex > entry list = new linked list < > ( ) ; vertex [ ] sources = g get sources ( ) ; for ( vertex source : sources ) { entry list add last ( source ) ; } linked list < vertex > todo stack = new linked list < > ( ) ; boolean source list is growing = true ; while ( source list is growing ) { source list is growing = false ; integer attribute < vertex > source number = ( integer attribute < vertex > ) vertex attributes create attribute ( source number , attribute type ) ; int cnt = entry list size ( ) ; for ( int i = 0 ; i < cnt ; i + + ) { todo stack add last ( entry list get ( i ) ) ; / / initialize stack with entry point while ( ! todo stack is empty ( ) ) { / / traverse the graph from source if ( monitor is cancelled ( ) ) { throw new cancelled exception ( ) ; } vertex v = todo stack remove last ( ) ; / / pop vertex off todo stack source number set value ( v , i + 1 ) ; set < vertex > children = g get children ( v ) ; if ( children is empty ( ) ) { continue ; } iterator < vertex > child iter = children iterator ( ) ; while ( child iter has next ( ) ) { vertex child = child iter next ( ) ; / / check to see if child has already been labeled / / if not , give it label of current source int source value = 0 ; try { source value = source number get value ( child ) ; if ( source value = = i + 1 ) { / / there ' s a cycle - - need to break out continue ; } } catch ( no value exception n v e ) { source value = i + 1 ; } / / if child ' s label is the same as the source , continue traversing graph / / if child ' s label differs from source , we found a new entry point ! / / in later case , don ' t traverse graph - - removing incoming edges / / and add to entry list if ( source value = = i + 1 ) { todo stack add last ( child ) ; } else { / / remove all edges going into child set < edge > incoming edges = g get incoming edges ( child ) ; iterator < edge > edge iter = incoming edges iterator ( ) ; while ( edge iter has next ( ) ) { g remove ( edge iter next ( ) ) ; } / / add child to entry list entry list add last ( child ) ; / / child has entry point ent attribute set value ( child , 0 ) ; source list is growing = true ; } } } } } }


create a new object metadata instance any standard metadata headers are added here , for example : encryption

static object metadata new object metadata ( final long length ) { final object metadata om = new object metadata ( ) ; if ( length > = 0 ) { om set content length ( length ) ; } return om ; }


finds the position of the first path separator

private int find separator ( string pattern ) { int idx 1 = pattern index of ( ' \ \ ' ) ; int idx 2 = pattern index of ( ' / ' ) ; if ( idx 1 = = - 1 ) return idx 2 ; if ( idx 2 = = - 1 ) return idx 1 ; return math min ( idx 1 , idx 2 ) ; }


actions called during the inited to started transition this method will only ever be called once during the lifecycle of a specific service instance implementations do not need to be synchronized as the logic in { @ link # start ( ) } prevents re - entrancy

protected void service start ( ) throws exception { }


inform the parser of user - defined types

private void add user identifiers ( job conf job ) throws i o exception { pattern x = pattern compile ( " ^ mapred \ \ join \ \ define \ \ ( \ \ w + ) $ " ) ; for ( map entry < string , string > kv : job ) { matcher m = x matcher ( kv get key ( ) ) ; if ( m matches ( ) ) { try { parser c node add identifier ( m group ( 1 ) , job get class ( m group ( 0 ) , null , composable record reader class ) ) ; } catch ( no such method exception e ) { throw ( i o exception ) new i o exception ( " invalid define for " + m group ( 1 ) ) init cause ( e ) ; } } } }


format < code > obj < code > using the provided { @ link doc value format } if the format is equals to { @ link doc value format # raw } , the object is returned as is for numbers and a string for { @ link bytes ref } s

static object format object ( object obj , doc value format format ) { if ( obj = = null ) { return null ; } if ( obj get class ( ) = = bytes ref class ) { bytes ref value = ( bytes ref ) obj ; if ( format = = doc value format raw ) { return value utf 8 to string ( ) ; } else { return format format ( value ) ; } } else if ( obj get class ( ) = = long class ) { long value = ( long ) obj ; if ( format = = doc value format raw ) { return value ; } else { return format format ( value ) ; } } else if ( obj get class ( ) = = double class ) { double value = ( double ) obj ; if ( format = = doc value format raw ) { return value ; } else { return format format ( value ) ; } } return obj ; }


set the scheduling information associated to particular job queue

public void set scheduling info ( string scheduling info ) { super set scheduling info ( scheduling info ) ; }


a sensible definition of { @ link # hash code } in terms of { @ link # iterator } if you override { @ link # iterator } , you may wish to override { @ link # equals } to forward to this implementation

protected int standard hash code ( ) { return sets hash code impl ( this ) ; }


public static list < string > check md 5 ( ) { list < string > diff list = new array list < string > ( ) ; long start time = system current time millis ( ) ; for ( entry < string / * group key * / , cache item > entry : cache entry set ( ) ) { string group key = entry get key ( ) ; string [ ] dg = group key parse key ( group key ) ; string data id = dg [ 0 ] ; string group = dg [ 1 ] ; string tenant = dg [ 2 ] ; try { string loacal md 5 = disk util get local config md 5 ( data id , group , tenant ) ; if ( ! entry get value ( ) md 5 equals ( loacal md 5 ) ) { default log warn ( " [ md 5 - different ] data id : { } , group : { } " , data id , group ) ; diff list add ( group key ) ; } } catch ( i o exception e ) { default log error ( " get local config md 5 fail , data id : { } , group : { } " , data id , group ) ; } } long end time = system current time millis ( ) ; default log warn ( " check md 5 cost : { } ; diff count : { } " , end time - start time , diff list size ( ) ) ; return diff list ; }


performs a binary search to find the last term with ' key ' as a prefix

static long find max ord ( bytes ref key , sorted set doc values delegate ) throws i o exception { long low = 0 ; long high = delegate get value count ( ) - 1 ; long result = - 1 ; while ( low < = high ) { long mid = ( low + high ) > > > 1 ; final bytes ref term = delegate lookup ord ( mid ) ; int cmp = compare ( key , term ) ; if ( cmp = = 0 ) { result = mid ; low = mid + 1 ; } else if ( cmp < 0 ) { high = mid - 1 ; } else { low = mid + 1 ; } } return result ; }


controls the choice of algorithm used to select interesting terms the default value is true which means terms are selected based on significance ( see the { @ link significant terms } aggregation ) rather than popularity ( using the { @ link terms aggregator } )

public void use significance ( boolean value ) { this use significance = value ; }


returns the raw ( string ) settings value if the setting is not present in the given settings object the default value is returned instead this is useful if the value can ' t be parsed due to an invalid value to access the actual value

private string get raw ( final settings settings ) { check deprecation ( settings ) ; return inner get raw ( settings ) ; }


public builder initialize as recovery ( index metadata index metadata ) { return initialize empty ( index metadata , new unassigned info ( unassigned info reason cluster recovered , null ) ) ; }


decodes the settings header and returns a { @ link http 2 settings } object

private http 2 settings decode settings header ( channel handler context ctx , char sequence settings header ) throws http 2 exception { byte buf header = byte buf util encode string ( ctx alloc ( ) , char buffer wrap ( settings header ) , charset util utf 8 ) ; try { / / decode the settings payload byte buf payload = base 6 4 decode ( header , url safe ) ; / / create an http / 2 frame for the settings byte buf frame = create settings frame ( ctx , payload ) ; / / decode the settings frame and return the settings object return decode settings ( ctx , frame ) ; } finally { header release ( ) ; } }


repeated weak compare and set succeeds in changing value when equal to expected

public void test weak compare and set ( ) { atomic double array aa = new atomic double array ( size ) ; for ( int i : new int [ ] { 0 , size - 1 } ) { double prev = 0 0 ; double unused = math e + math pi ; for ( double x : values ) { assert bit equals ( prev , aa get ( i ) ) ; assert false ( aa weak compare and set ( i , unused , x ) ) ; assert bit equals ( prev , aa get ( i ) ) ; while ( ! aa weak compare and set ( i , prev , x ) ) { ; } assert bit equals ( x , aa get ( i ) ) ; prev = x ; } } }


shortcut to same property on underlying { @ link # set url path helper url path helper }

public void set always use full path ( boolean always use full path ) { }


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


public web test client response spec same site ( string name , string expected ) { string same site = get cookie ( name ) get same site ( ) ; this exchange result assert with diagnostics ( ( ) - > { string message = get message ( name ) + " secure " ; assertion errors assert equals ( message , expected , same site ) ; } ) ; return this response spec ; }


returns the memory size for the entries residing in block cache

public void enable block cache usage ( ) { this properties add ( rocks d b property block cache usage get rocks d b property ( ) ) ; }


register that a target has been configured

void done configure target ( ) { configured targets completed increment and get ( ) ; }


public static int compare ( starlark int x , starlark int y ) { / / if both arguments are big , we compare big integers / / if neither argument is big , we compare longs / / if only one argument is big , its magnitude is greater / / than the other operand , so only its sign matters / / / / we avoid unnecessary branches try { long xl = x to long fast ( ) ; try { long yl = y to long fast ( ) ; return long compare ( xl , yl ) ; / / ( long , long ) } catch ( overflow unused ) { return - ( ( big ) y ) v signum ( ) ; / / ( long , big ) } } catch ( overflow unused ) { return y instanceof big ? ( ( big ) x ) v compare to ( ( ( big ) y ) v ) / / ( big , big ) : ( ( big ) x ) v signum ( ) ; / / ( big , long ) } }


public string get small camel ( ) { return small camel ; }


current time from some arbitrary time base in the past , counting in milliseconds , and not affected by settimeofday or similar system clock changes this is appropriate to use when computing how much longer to wait for an interval to expire

public long monotonic now ( ) { return time monotonic now ( ) ; }


gets the read - only snapshot view of all { @ link one off executor } s

public list < one off executor > get one off executors ( ) { return new array list < > ( one off executors ) ; }


when qr codes use multiple data blocks , they are actually interleaved that is , the first byte of data block 1 to n is written , then the second bytes , and so on this method will separate the data into original blocks

static data block [ ] get data blocks ( byte [ ] raw codewords , version version , error correction level ec level ) { if ( raw codewords length ! = version get total codewords ( ) ) { throw new illegal argument exception ( ) ; } / / figure out the number and size of data blocks used by this version and / / error correction level version e c blocks ec blocks = version get e c blocks for level ( ec level ) ; / / first count the total number of data blocks int total blocks = 0 ; version ecb [ ] ec block array = ec blocks get e c blocks ( ) ; for ( version ecb ec block : ec block array ) { total blocks + = ec block get count ( ) ; } / / now establish data blocks of the appropriate size and number of data codewords data block [ ] result = new data block [ total blocks ] ; int num result blocks = 0 ; for ( version ecb ec block : ec block array ) { for ( int i = 0 ; i < ec block get count ( ) ; i + + ) { int num data codewords = ec block get data codewords ( ) ; int num block codewords = ec blocks get e c codewords per block ( ) + num data codewords ; result [ num result blocks + + ] = new data block ( num data codewords , new byte [ num block codewords ] ) ; } } / / all blocks have the same amount of data , except that the last n / / ( where n may be 0 ) have 1 more byte figure out where these start int shorter blocks total codewords = result [ 0 ] codewords length ; int longer blocks start at = result length - 1 ; while ( longer blocks start at > = 0 ) { int num codewords = result [ longer blocks start at ] codewords length ; if ( num codewords = = shorter blocks total codewords ) { break ; } longer blocks start at - - ; } longer blocks start at + + ; int shorter blocks num data codewords = shorter blocks total codewords - ec blocks get e c codewords per block ( ) ; / / the last elements of result may be 1 element longer ; / / first fill out as many elements as all of them have int raw codewords offset = 0 ; for ( int i = 0 ; i < shorter blocks num data codewords ; i + + ) { for ( int j = 0 ; j < num result blocks ; j + + ) { result [ j ] codewords [ i ] = raw codewords [ raw codewords offset + + ] ; } } / / fill out the last data block in the longer ones for ( int j = longer blocks start at ; j < num result blocks ; j + + ) { result [ j ] codewords [ shorter blocks num data codewords ] = raw codewords [ raw codewords offset + + ] ; } / / now add in error correction blocks int max = result [ 0 ] codewords length ; for ( int i = shorter blocks num data codewords ; i < max ; i + + ) { for ( int j = 0 ; j < num result blocks ; j + + ) { int i offset = j < longer blocks start at ? i : i + 1 ; result [ j ] codewords [ i offset ] = raw codewords [ raw codewords offset + + ] ; } } return result ; }


returns information about bitcode object files resulting from compilation

public lto compilation context get lto compilation context ( ) { return lto compilation context ; }


( asynchronously ) test serialization of outer string types

public okhttp 3 call fake outer string serialize async ( string body , final api callback < string > callback ) throws api exception { okhttp 3 call local var call = fake outer string serialize validate before call ( body , callback ) ; type local var return type = new type token < string > ( ) { } get type ( ) ; local var api client execute async ( local var call , local var return type , callback ) ; return local var call ; }


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

t visit pattern escape ( sql base parser pattern escape context ctx ) ;


execute the runnable in the execution context of this rpc service , as returned by { @ link # get executor ( ) } , after a scheduled delay

scheduled future < ? > schedule runnable ( runnable runnable , long delay , time unit unit ) ;


get or create a sensor with the given unique name and zero or more parent sensors all parent sensors will receive every value recorded with this sensor

public synchronized sensor sensor ( string name , metric config config , long inactive sensor expiration time seconds , sensor recording level recording level , sensor parents ) { sensor s = get sensor ( name ) ; if ( s = = null ) { s = new sensor ( this , name , parents , config = = null ? this config : config , time , inactive sensor expiration time seconds , recording level ) ; this sensors put ( name , s ) ; if ( parents ! = null ) { for ( sensor parent : parents ) { list < sensor > children = children sensors compute if absent ( parent , k - > new array list < > ( ) ) ; children add ( s ) ; } } log trace ( " added sensor with name { } " , name ) ; } return s ; }


calculates and writes the 4 - byte checksum to the output buffer

private static void calculate and write checksum ( byte buf slice , byte buf out ) { out write int l e ( calculate checksum ( slice ) ) ; }


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


looks up the label - like string in the location map and returns the resolved path string if the label - like string begins with a repository name , the repository name may be remapped using the { @ code repository mapping }

public string apply ( string arg , immutable map < repository name , repository name > repository mapping ) { label label ; try { label = root get relative with remapping ( arg , repository mapping ) ; } catch ( label syntax exception e ) { throw new illegal state exception ( string format ( " invalid label in % s expression : % s " , function name ( ) , e get message ( ) ) , e ) ; } collection < string > paths = resolve label ( label ) ; return join paths ( paths ) ; }


returns the minimum acceptable run length for an array of the specified length natural runs shorter than this will be extended with { @ link # binary sort } roughly speaking , the computation is : if n < min merge , return n ( it ' s too small to bother with fancy stuff ) else if n is an exact power of 2 , return min merge2 else return an int k , min merge2 < = k < = min merge , such that nk is close to , but strictly less than , an exact power of 2 for the rationale , see listsort txt

private static int min run length ( int n ) { if ( debug ) assert n > = 0 ; int r = 0 ; / / becomes 1 if any 1 bits are shifted off while ( n > = min merge ) { r | = ( n & 1 ) ; n > > = 1 ; } return n + r ; }


converts the specified byte value into a hexadecimal integer

public static string byte to hex string ( int value ) { return byte2hex nopad [ value & 0xff ] ; }


once the job state has been written calling this function makes it immediately searchable

public void commit state writes ( string job id ) { string index name = anomaly detectors index job state index pattern ( ) ; / / refresh should wait for lucene to make the data searchable logger trace ( " [ { } ] es api call : refresh index { } " , job id , index name ) ; refresh request refresh request = new refresh request ( index name ) ; refresh request indices options ( indices options lenient expand open ( ) ) ; try ( thread context stored context ignore = client thread pool ( ) get thread context ( ) stash with origin ( ml origin ) ) { client admin ( ) indices ( ) refresh ( refresh request ) action get ( ) ; } }


returns the { @ link format } that can be used to decode the wrapped metadata in { @ link # get wrapped metadata bytes ( ) } , or null if this entry doesn ' t contain wrapped metadata

default format get wrapped metadata format ( ) { return null ; }


method that runs the initialization , that this task wraps

public method get method ( ) { return e ; }


the type of the backing class , method parameter , field , or property described by this type descriptor returns primitive types as - is see { @ link # get object type ( ) } for a variation of this operation that resolves primitive types to their corresponding object types if necessary

public class < ? > get type ( ) { return this type ; }


creates list of users with given input array ( asynchronously )

public okhttp 3 call create users with list input async ( list < user > body , final api callback < void > callback ) throws api exception { okhttp 3 call local var call = create users with list input validate before call ( body , callback ) ; local var api client execute async ( local var call , callback ) ; return local var call ; }


public rest result < string > execute ( map < string , string > args ) { final cli service cli service = raft server get cli service ( ) ; if ( args contains key ( j raft constants group id ) ) { final string group id = args get ( j raft constants group id ) ; final node node = raft server find node by group ( group id ) ; return single ( cli service , group id , node , args ) ; } map < string , j raft server raft group tuple > tuple map = raft server get multi raft group ( ) ; for ( map entry < string , j raft server raft group tuple > entry : tuple map entry set ( ) ) { final string group = entry get key ( ) ; final node node = entry get value ( ) get node ( ) ; rest result < string > result = single ( cli service , group , node , args ) ; if ( ! result ok ( ) ) { return result ; } } return rest result utils success ( ) ; }


public boolean is arg ( string string ) { return args contains key ( string ) ; }


set the compression estimation for a topic compression type combination this method is for unit test purpose

public static void set estimation ( string topic , compression type type , float ratio ) { float [ ] compression ratio for topic = get and create estimation if absent ( topic ) ; synchronized ( compression ratio for topic ) { compression ratio for topic [ type id ] = ratio ; } }


returns the sum of file sizes plus protobuf sizes used to represent this merkle tree

public long get input bytes ( ) { return input bytes ; }


returns { @ code value } , if non - negative otherwise , returns { @ link long # max value }

private static long negative to max value ( long value ) { return ( value > = 0 ) ? value : long max value ; }


public string dump ( string prefix , string separator , string suffix , boolean all ) { metric string builder metric builder = new metric string builder ( null , prefix , separator , suffix ) ; registry snapshot ( metric builder , all ) ; return metric builder to string ( ) ; }


returns a new collection containing all labels that match a given predicate , not including outputs

public collection < label > get labels ( binary predicate < ? super rule , attribute > predicate ) { return immutable sorted set copy of ( get transitions ( predicate ) values ( ) ) ; }


stores key - value in this staging area this call overrides previous value of stored reference if

public synchronized void put ( final cache key key , final encoded image encoded image ) { preconditions check not null ( key ) ; preconditions check argument ( encoded image is valid ( encoded image ) ) ; / / we ' re making a ' copy ' of this reference - so duplicate it final encoded image old entry = m map put ( key , encoded image clone or null ( encoded image ) ) ; encoded image close safely ( old entry ) ; log stats ( ) ; }


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


returns the mutability for values created by this thread

public mutability mutability ( ) { return mutability ; }